Merged
Merge Request #620 · created by 后端研发-苏明海


Dev


From dev into test

Merged by 后端研发-苏明海

1 participants






app.js
... ... @@ -20,6 +20,12 @@ App({
20 20 "src_sele": t.imghost+"/miniapp/images/bar/fl_on.png"
21 21 },
22 22 {
  23 + "weappurl": "pages/distribution/distribution",
  24 + "nav_name": "分销",
  25 + "src": t.imghost+"/miniapp/images/bar/fx.png",
  26 + "src_sele": t.imghost+"/miniapp/images/bar/fx_on.png"
  27 + },
  28 + {
23 29 "weappurl": "pages/cart/cart/cart",
24 30 "nav_name": "购物车",
25 31 "src": t.imghost+"/miniapp/images/bar/car.png",
... ... @@ -358,10 +364,12 @@ App({
358 364 if(arr.length>8){
359 365 arr.splice(0, 2);
360 366 }
361   - var arr_tabbar=["/pages/index/index/index","/pages/goods/categoryList/categoryList",
  367 + var arr_tabbar=["/pages/index/index/index",
  368 + "/pages/goods/categoryList/categoryList",
362 369 "/pages/goods/categoryList/categoryList?type=2",
363 370 "/pages/goods/categoryList/categoryList?type=1",
364   - "/pages/cart/cart/cart","/pages/user/index/index"];
  371 + "/pages/cart/cart/cart","/pages/user/index/index",
  372 + "/pages/distribution/distribution"];
365 373 if(arr_tabbar.indexOf(url)!=-1){
366 374 if(url.indexOf("categoryList?type=1")!=-1) this.globalData.cat_type=1;
367 375 if(url.indexOf("categoryList?type=2")!=-1) this.globalData.cat_type=2;
... ... @@ -603,6 +611,22 @@ App({
603 611 })
604 612 })
605 613 },
  614 +
  615 +
  616 + // 判断是否登录
  617 + isLogin() {
  618 + return new Promise(function(resolve, reject) {
  619 + let user_info = getApp().globalData.userInfo;
  620 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  621 + wx.navigateTo({
  622 + url: '/pages/togoin/togoin',
  623 + })
  624 + return false;
  625 + } else {
  626 + resolve(user_info);
  627 + };
  628 + });
  629 + },
606 630  
607 631  
608 632  
... ...
app.json
... ... @@ -92,7 +92,8 @@
92 92 "pages/user/collect_list/collect_list",
93 93 "pages/user/deposit/deposit",
94 94 "pages/user/deposit/prepaid/msg/msg",
95   - "pages/user/deposit/prepaid/prepaid"
  95 + "pages/user/deposit/prepaid/prepaid",
  96 + "pages/distribution/distribution"
96 97 ],
97 98 "plugins": {
98 99 "live-player-plugin": {
... ... @@ -116,8 +117,23 @@
116 117 "pages/quan/quan",
117 118 "pages/chongzhi/chongzhi",
118 119 "pages/chongzhiDetails/chongzhiDetails",
119   - "pages/jfbuy/jfbuy"
120   -
  120 + "pages/jfbuy/jfbuy",
  121 + "pages/hongBao/hongBao",
  122 + "pages/hongBaoDetails/hongBaoDetails",
  123 + "pages/service_record/service_record",
  124 + "pages/checkin/checkin",
  125 + "pages/distribution/main/main",
  126 + "pages/distribution/myteam/myteam",
  127 + "pages/distribution/order/order",
  128 + "pages/distribution/commision/commision",
  129 + "pages/distribution/rank/rank",
  130 + "pages/distribution/card/card",
  131 + "pages/distribution/goods/goods",
  132 + "pages/distribution/shop/shop",
  133 + "pages/distribution/rookie/rookie",
  134 + "pages/service_share/service_share",
  135 + "pages/cardList/cardList",
  136 + "pages/cardDetails/cardDetails"
121 137 ]
122 138  
123 139 }],
... ... @@ -133,6 +149,7 @@
133 149 "navigationBarBackgroundColor": "#ffffff",
134 150 "backgroundColor": "#ffffff",
135 151 "enablePullDownRefresh": true
  152 +
136 153 },
137 154  
138 155 "tabBar": {
... ... @@ -154,6 +171,12 @@
154 171 "iconPath": "packageA/images/bar/fl.png",
155 172 "selectedIconPath": "packageA/images/bar/fl_on.png"
156 173 },
  174 + {
  175 + "pagePath": "pages/distribution/distribution",
  176 + "text": "分销",
  177 + "iconPath": "packageA/images/bar/fx.png",
  178 + "selectedIconPath": "packageA/images/bar/fx_on.png"
  179 + },
157 180 {
158 181 "pagePath": "pages/cart/cart/cart",
159 182 "text": "购物车",
... ...
app.wxss
  1 +@import './utils/weapp-icon.wxss';
  2 +@import "./utils/wxParse/wxParse.wxss";
  3 +
  4 +.pd10 {
  5 + padding: 10rpx;
  6 +}
  7 +.pd20 {
  8 + padding: 20rpx;
  9 +}
  10 +.pd30 {
  11 + padding: 30rpx;
  12 +}
1 13 .pdt20 {
2 14 padding-top: 20rpx;
3 15 }
  16 +.pdb20 {
  17 + padding-bottom: 20rpx;
  18 +}
  19 +.pdt10 {
  20 + padding-top: 10rpx;
  21 +}
  22 +.pdb10 {
  23 + padding-bottom: 10rpx;
  24 +}
  25 +.pdl10 {
  26 + padding-left: 10rpx;
  27 +}
  28 +.pdl20 {
  29 + padding-left: 20rpx;
  30 +}
  31 +.pdr10 {
  32 + padding-right: 10rpx;
  33 +}
  34 +.pdr20 {
  35 + padding-right: 20rpx;
  36 +}
4 37 .pdb18 {
5 38 padding-bottom: 18rpx;
6 39 }
7 40 .pdt40 {
8 41 padding-top: 40rpx;
9 42 }
  43 +
  44 +.pdr40 {
  45 + padding-right: 40rpx;
  46 +}
  47 +.pdh10 {
  48 + padding-left: 10rpx;
  49 + padding-right: 10rpx;
  50 +}
  51 +.pdh20 {
  52 + padding-left: 20rpx;
  53 + padding-right: 20rpx;
  54 +}
  55 +.pdv20 {
  56 + padding-top: 30rpx;
  57 + padding-bottom: 30rpx;
  58 +}
  59 +.pdv30 {
  60 + padding-top: 30rpx;
  61 + padding-bottom: 30rpx;
  62 +}
  63 +.pdv40 {
  64 + padding-top: 40rpx;
  65 + padding-bottom: 40rpx;
  66 +}
  67 +.pdh40 {
  68 + padding-left: 40rpx;
  69 + padding-right: 40rpx;
  70 +}
  71 +
  72 +.w25 {
  73 + width: 25%;
  74 + box-sizing: border-box;
  75 +}
  76 +.w33 {
  77 + width: calc(100% / 3);
  78 + box-sizing: border-box;
  79 +}
  80 +
  81 +.c-green {
  82 + color: #7CFC00;
  83 +}
  84 +
  85 +.c-red2 {
  86 + color: red;
  87 +}
  88 +
  89 +.c-f0 {
  90 + color: #f0f0f0;
  91 +}
  92 +
  93 +.c-red {
  94 + color: #FF6768;
  95 +}
  96 +
  97 +.c-a {
  98 + color: #aaa;
  99 +}
  100 +
  101 +.c-c7 {
  102 + color: #c7c7c7;
  103 +}
  104 +
  105 +.c-d {
  106 + color: #ddd;
  107 +}
  108 +
  109 +.c-db {
  110 + color: #dbdbdb;
  111 +}
  112 +
  113 +.c-5 {
  114 + color: #555;
  115 +}
  116 +
  117 +.c7b {
  118 + color: #7b7b7b;
  119 +}
  120 +
  121 +.bg-white {
  122 + background-color: white;
  123 +}
  124 +
  125 +.bg-f0 {
  126 + background-color: #f0f0f0;
  127 +}
  128 +
  129 +.pr {
  130 + position: relative;
  131 +}
  132 +
  133 +.bold {
  134 + font-weight: bold;
  135 +}
  136 +
  137 +.mgv20 {
  138 + margin-top: 20rpx;
  139 + margin-bottom: 20rpx;
  140 +}
  141 +
  142 +.mgh20 {
  143 + margin-left: 20rpx;
  144 + margin-right: 20rpx;
  145 +}
  146 +
10 147 .ib{
11 148 display: inline-block;
12 149 }
13   -.flex_auto {
  150 +
  151 +.flex_auto,
  152 +.f1 {
14 153 flex: 1;
15 154 }
  155 +
  156 +.fdc {
  157 + flex-direction: column;
  158 +}
  159 +
16 160 .bdt16 {
17 161 border-top: 16rpx solid #f4f4f4;
18 162 }
  163 +.bdb {
  164 + border-bottom: 2rpx solid #f8f8f8;
  165 +}
  166 +.bdt {
  167 + border-top: 2rpx solid #f8f8f8;
  168 +}
19 169 .container {
20 170 /*font-family: "iconfont" !important; */
21 171 display: flex; flex-direction: column;
... ... @@ -24,6 +174,10 @@
24 174 overflow-x:hidden;
25 175 }
26 176  
  177 +.line-del {
  178 + text-decoration: line-through;
  179 +}
  180 +
27 181 page {
28 182 overflow-x: hidden;
29 183 }
... ... @@ -83,7 +237,9 @@ button {
83 237 .hide {
84 238 display: none;
85 239 }
86   -
  240 +.taj {
  241 + text-align: justify;
  242 +}
87 243 .t-c {
88 244 text-align: center;
89 245 }
... ... @@ -202,8 +358,11 @@ align-items:center;
202 358 display:flex;
203 359 justify-content:space-around;
204 360 }
205   -.jc_sb{ justify-content: space-between}
206   -
  361 +.jc_sb {justify-content: space-between;}
  362 +.jc_sa {justify-content: space-around;}
  363 +.jc_fe {
  364 + justify-content: flex-end;
  365 +}
207 366 /* 相对定位 */
208 367 .rel{
209 368 position: relative;
... ... @@ -330,9 +489,27 @@ color: #b9b9b9;
330 489  
331 490 }
332 491  
333   -.xc-ash_c999{
  492 +.xc-ash_c999,
  493 +.c9 {
334 494 color: #999;
335 495 }
  496 +
  497 +.cb {
  498 + color: #bbb;
  499 +}
  500 +
  501 +.c29f {
  502 + color: #2299ff;
  503 +}
  504 +
  505 +.cf79 {
  506 + color: #ff7799;
  507 +}
  508 +
  509 +.ctb {
  510 + color: #ff5000;
  511 +}
  512 +
336 513 .xc-ash-b{
337 514 background: #b9b9b9;
338 515 }
... ... @@ -423,7 +600,8 @@ background: #ffe3e2;
423 600 }
424 601 .fs60{ font-size:60rpx;}
425 602 .fs80 {font-size: 80rpx;}
426   -.flex-wrap {
  603 +.flex-wrap,
  604 +.wrap {
427 605 flex-wrap:wrap;
428 606 }
429 607  
... ... @@ -443,15 +621,17 @@ background: #ffe3e2;
443 621  
444 622  
445 623  
  624 +
  625 +
446 626 /* 图标字体(ty) */
447 627 @font-face {
448 628 font-family: 'iconfont'; /* project id 2054717 */
449   - src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot');
450   - src: url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.eot?#iefix') format('embedded-opentype'),
451   - url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff2') format('woff2'),
452   - url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.woff') format('woff'),
453   - url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.ttf') format('truetype'),
454   - url('//at.alicdn.com/t/font_2054717_qfl8swm1iw.svg#iconfont') format('svg');
  629 + src: url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.eot');
  630 + src: url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.eot?#iefix') format('embedded-opentype'),
  631 + url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.woff2') format('woff2'),
  632 + url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.woff') format('woff'),
  633 + url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.ttf') format('truetype'),
  634 + url('//at.alicdn.com/t/font_2054717_uapbrzlc8k.svg#iconfont') format('svg');
455 635 }
456 636  
457 637 .iconfont {
... ... @@ -462,6 +642,107 @@ background: #ffe3e2;
462 642 -moz-osx-font-smoothing: grayscale;
463 643 }
464 644  
  645 +.icon-yuanquan:before {
  646 + content: "\e60d";
  647 +}
  648 +
  649 +.icon-yes:before {
  650 + content: "\e630";
  651 +}
  652 +
  653 +.icon-renzheng:before {
  654 + content: "\e60f";
  655 +}
  656 +
  657 +.icon-huiyuan1:before {
  658 + content: "\e62a";
  659 +}
  660 +
  661 +.icon-badge:before {
  662 + content: "\e60a";
  663 +}
  664 +
  665 +.icon-ren1:before {
  666 + content: "\e61d";
  667 +}
  668 +
  669 +.icon-shaixuan:before {
  670 + content: "\e68a";
  671 +}
  672 +
  673 +.icon-fenxiang:before {
  674 + content: "\e690";
  675 +}
  676 +
  677 +.icon-fenlie:before {
  678 + content: "\e620";
  679 +}
  680 +
  681 +.icon-sort2:before {
  682 + content: "\e62b";
  683 +}
  684 +
  685 +.icon-guanbi:before {
  686 + content: "\e638";
  687 +}
  688 +
  689 +
  690 +.icon-sousuo:before {
  691 + content: "\e618";
  692 +}
  693 +
  694 +.icon-sort:before {
  695 + content: "\e6ab";
  696 +}
  697 +
  698 +.icon-ren:before {
  699 + content: "\e60b";
  700 +}
  701 +
  702 +.icon-mingpian:before {
  703 + content: "\e65d";
  704 +}
  705 +
  706 +.icon-paihangbang:before {
  707 + content: "\e69b";
  708 +}
  709 +
  710 +.icon-gouwu:before {
  711 + content: "\e7b1";
  712 +}
  713 +
  714 +.icon-huiyuan:before {
  715 + content: "\e8a6";
  716 +}
  717 +
  718 +.icon-xinshouyindao:before {
  719 + content: "\e72f";
  720 +}
  721 +
  722 +.icon-jine:before {
  723 + content: "\e658";
  724 +}
  725 +
  726 +.icon-tuandui:before {
  727 + content: "\e609";
  728 +}
  729 +
  730 +.icon-shangjia:before {
  731 + content: "\e6e5";
  732 +}
  733 +
  734 +.icon-xiajia:before {
  735 + content: "\e6e4";
  736 +}
  737 +
  738 +.icon-yongjin:before {
  739 + content: "\e60c";
  740 +}
  741 +
  742 +.icon-gouwu1:before {
  743 + content: "\f1cd";
  744 +}
  745 +
465 746 .icon-riqi:before {
466 747 content: "\e64c";
467 748 }
... ...
components/nodata/nodata.wxss
... ... @@ -29,4 +29,5 @@
29 29 padding-top: 40rpx;
30 30 padding-bottom: 40rpx;
31 31 color: #bbb;
  32 + font-size: 28rpx;
32 33 }
33 34 \ No newline at end of file
... ...
images/banner.jpg 0 → 100644

33.7 KB

packageA/images/badge.png 0 → 100644

14.3 KB

packageA/images/no1.png 0 → 100644

7.71 KB

packageA/images/no2.png 0 → 100644

7.15 KB

packageA/images/no3.png 0 → 100644

7.04 KB

packageA/pages/checkin/checkin.js
... ... @@ -70,7 +70,6 @@ Page({
70 70 // 没有登录则跳转到登录页,
71 71 // 已登录则设置已登录状态,请求加载签到数据
72 72 this.isLogin().then(function() {
73   - console.log('loginnnn',app.globalData.userInfo);
74 73 self.setData({
75 74 isLogin: true
76 75 });
... ...
packageA/pages/distribution/card/card.js 0 → 100644
  1 +// packageA//pages/distribution/card/card.js
  2 +const app = getApp();
  3 +let self = null;
  4 +var os = app.globalData.setting;
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + isLogin: false,
  13 + },
  14 +
  15 + /**
  16 + * 生命周期函数--监听页面加载
  17 + */
  18 + onLoad: function (options) {
  19 + self = this;//保存全局指针
  20 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  21 + self.setData({
  22 + userInfo: data,
  23 + });
  24 + });
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面初次渲染完成
  29 + */
  30 + onReady: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面显示
  36 + */
  37 + onShow: function () {
  38 + if(app.globalData.userInfo) {
  39 + if(!this.data.isLogin) {
  40 + this.setData({
  41 + userInfo: app.globalData.userInfo,
  42 + imghost: app.globalData.setting.imghost,
  43 + isLogin: true,
  44 + });
  45 +
  46 + var user_id=app.globalData.userInfo.user_id;
  47 + // 请求数据
  48 + wx.getImageInfo({
  49 + src: os.url+'/api/wx/open/app/user/getWeAppEwm/1?sceneValue='+user_id+'&pageValue=packageA/pages/distribution/shop/shop',
  50 + success (res) {
  51 + self.setData({
  52 + img: res.path,
  53 + });
  54 + }
  55 + });
  56 +
  57 + };
  58 + };
  59 + },
  60 +
  61 + /**
  62 + * 生命周期函数--监听页面隐藏
  63 + */
  64 + onHide: function () {
  65 +
  66 + },
  67 +
  68 + /**
  69 + * 生命周期函数--监听页面卸载
  70 + */
  71 + onUnload: function () {
  72 +
  73 + },
  74 +
  75 + /**
  76 + * 页面相关事件处理函数--监听用户下拉动作
  77 + */
  78 + onPullDownRefresh: function () {
  79 +
  80 + },
  81 +
  82 + /**
  83 + * 页面上拉触底事件的处理函数
  84 + */
  85 + onReachBottom: function () {
  86 +
  87 + },
  88 +
  89 + /**
  90 + * 用户点击右上角分享
  91 + */
  92 + onShareAppMessage: function () {
  93 +
  94 + },
  95 +
  96 +})
0 97 \ No newline at end of file
... ...
packageA/pages/distribution/card/card.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "qrcode": "/components/qr_code/qr_code"
  4 + },
  5 + "navigationBarTitleText": "我的名片",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/card/card.wxml 0 → 100644
  1 +<view class="main">
  2 +
  3 + <view class="panel">
  4 + <view class="flex ai-center">
  5 + <view><image class="avatar" src="{{userInfo.head_pic}}"/></view>
  6 + <view class="pdl20">
  7 + <view class="fs30 bold">{{userInfo.nickname}}</view>
  8 + <view class="fs26">{{userInfo.mobile}}</view>
  9 + </view>
  10 + </view>
  11 +
  12 +
  13 +
  14 + <view class="t-c">
  15 + <view class="pdt40 pdb20 fs28">
  16 + <view>扫码进入我的小店</view>
  17 + <view>现在就一起欢乐购吧~</view>
  18 + </view>
  19 + <view class="pdv20">
  20 + <image class="qrCode" src="{{img}}"/>
  21 + </view>
  22 + <view class="c-a fs24 pdv20">长按识别小程序码,即可买买买~</view>
  23 + </view>
  24 +
  25 + </view>
  26 +
  27 +
  28 +
  29 +</view>
0 30 \ No newline at end of file
... ...
packageA/pages/distribution/card/card.wxss 0 → 100644
  1 +page,
  2 +.main {
  3 + width: 100%;
  4 + height: 100%;
  5 +}
  6 +
  7 +.main {
  8 + position: relative;
  9 + background-image: linear-gradient(-225deg,#F8C9CF,#F76275);
  10 +}
  11 +
  12 +.panel {
  13 + position: absolute;
  14 + top: 50%;
  15 + left: 50%;
  16 + transform: translate(-50%, -50%);
  17 + border-radius: 20rpx;
  18 + background-color: #fff;
  19 + padding: 60rpx;
  20 + width: 60%;
  21 +}
  22 +
  23 +.avatar {
  24 + background-color: #eee;
  25 + border-radius: 50%;
  26 + width: 120rpx;
  27 + height: 120rpx;
  28 +}
  29 +
  30 +
  31 +.qrCode-container {
  32 + /* width: 400rpx;
  33 + height: 400rpx; */
  34 + /* margin: 0 auto; */
  35 +}
  36 +.qrCode {
  37 + display: block;
  38 + width: 400rpx;
  39 + height: 400rpx;
  40 + margin: 0 auto;
  41 +}
0 42 \ No newline at end of file
... ...
packageA/pages/distribution/commision/commision.js 0 → 100644
  1 +// packageA//pages/distribution/commision/commision.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + isHiddenDropdown: true,//控制下拉菜单显隐
  12 + dropdownArr: ['综合','未付款','已付款','待分成','已分成','已取消'],
  13 + statusArr: ['未付款', '已付款', '等待分成', '已分成', '已取消'],
  14 + currentSelect: '',//记录当前下拉菜单选中项
  15 + isInputFocus: false,//记录搜索输入框是否聚焦
  16 + inputVal: '',//记录搜索输入框的内容
  17 + isSort: false,//控制排序开关状态,true开启排序
  18 + isDescending: false, //isDescending降序,ascending升序
  19 + currentQuery: null,//保存当前请求参数
  20 +
  21 + list: null,
  22 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  23 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  24 + pageNum: 1, // 当前页数
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面加载
  29 + */
  30 + onLoad: function (options) {
  31 + this.setData({
  32 + currentSelect: this.data.dropdownArr[0],
  33 + });
  34 +
  35 + self = this;//保存全局指针
  36 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  37 + self.setData({
  38 + userInfo: data,
  39 + });
  40 + });
  41 + // 判断会员是否授权登录,
  42 + // 没有登录则跳转到登录页,
  43 + // 已登录则设置已登录状态,请求加载签到数据
  44 + // isLogin记录登录状态
  45 + // app.isLogin().then(function(data) {
  46 + // console.log('data', data);
  47 + // // 1.登录成功
  48 + // self.setData({
  49 + // isLogin: true,
  50 + // userInfo: data,
  51 + // currentQuery: {
  52 + // store_id: app.globalData.setting.stoid,
  53 + // user_id: app.globalData.user_id,
  54 + // },
  55 + // });
  56 + // // 2.请求数据
  57 + // self.getData(true, '/api/weshop/rebateLog/commissionlist', self.data.currentQuery);
  58 +
  59 + // });
  60 + },
  61 +
  62 + /**
  63 + * 生命周期函数--监听页面初次渲染完成
  64 + */
  65 + onReady: function () {
  66 +
  67 + },
  68 +
  69 + /**
  70 + * 生命周期函数--监听页面显示
  71 + */
  72 + onShow: function () {
  73 +
  74 + if(app.globalData.userInfo) {
  75 + if(!this.data.isLogin) {
  76 + this.setData({
  77 + userInfo: app.globalData.userInfo,
  78 + imghost: app.globalData.setting.imghost,
  79 + currentQuery: {
  80 + store_id: app.globalData.setting.stoid,
  81 + user_id: app.globalData.user_id,
  82 + },
  83 + isLogin: true,
  84 + });
  85 +
  86 + // 请求数据
  87 + this.getData(true, '/api/weshop/rebateLog/commissionlist', this.data.currentQuery);
  88 +
  89 + };
  90 + };
  91 +
  92 +
  93 + // if(app.globalData.userInfo instanceof Object) {
  94 + // this.setData({
  95 + // userInfo: app.globalData.userInfo,
  96 + // imghost: app.globalData.setting.imghost,
  97 + // currentQuery: {
  98 + // store_id: app.globalData.setting.stoid,
  99 + // user_id: app.globalData.user_id,
  100 + // },
  101 + // });
  102 + // // 检测从登录页返回后的登录状态
  103 + // if(this.data.isLogin) {
  104 + // // 初次就授权登录
  105 + // return;
  106 + // } else {
  107 + // // 初次未授权登录,过后才授权
  108 + // this.setData({
  109 + // isLogin: true
  110 + // });
  111 + // // 请求数据
  112 + // this.getData(true, '/api/weshop/rebateLog/commissionlist', this.data.currentQuery);
  113 + // };
  114 + // };
  115 + },
  116 +
  117 + /**
  118 + * 生命周期函数--监听页面隐藏
  119 + */
  120 + onHide: function () {
  121 +
  122 + },
  123 +
  124 + /**
  125 + * 生命周期函数--监听页面卸载
  126 + */
  127 + onUnload: function () {
  128 +
  129 + },
  130 +
  131 + /**
  132 + * 页面相关事件处理函数--监听用户下拉动作
  133 + */
  134 + onPullDownRefresh: function () {
  135 +
  136 + },
  137 +
  138 + /**
  139 + * 页面上拉触底事件的处理函数
  140 + */
  141 + onReachBottom: function () {
  142 + this.scrollToLower('/api/weshop/rebateLog/commissionlist', this.data.currentQuery);
  143 + },
  144 +
  145 + /**
  146 + * 用户点击右上角分享
  147 + */
  148 + onShareAppMessage: function () {
  149 +
  150 + },
  151 +
  152 + /**
  153 + * 点击下拉菜单
  154 + */
  155 + clickDropdown() {
  156 + this.setData({
  157 + isHiddenDropdown: !this.data.isHiddenDropdown,
  158 + });
  159 + },
  160 +
  161 + /**
  162 + * 点击遮罩层
  163 + */
  164 + clickMask() {
  165 + this.setData({
  166 + isHiddenDropdown: true,
  167 + });
  168 + },
  169 +
  170 + /**
  171 + * 选择下拉菜单项
  172 + */
  173 + selectDropdown(e) {
  174 + let status = null;
  175 + let currentIndex = e.target.dataset.index;
  176 + let data = this.data.currentQuery;
  177 +
  178 + if(data.status) {//清除status
  179 + delete data.status;
  180 + };
  181 + if(data.page && data.page != 1) {//清除page
  182 + delete data.page;
  183 + };
  184 + if(data.orderField) {//清除orderField
  185 + delete data.orderField;
  186 + };
  187 + if(data.orderType) {//清除orderType
  188 + delete data.orderType;
  189 + };
  190 + if(data.key) {//清除搜索输入框
  191 + delete data.key;
  192 + };
  193 +
  194 + if(currentIndex != 0) {
  195 + status = currentIndex - 1;
  196 + data.status = status;
  197 + };
  198 +
  199 + this.setData({
  200 + list: null, //清空列表
  201 + isSort: false,//关闭排序
  202 + isDescending: false,
  203 + noMore: false,
  204 + pageNum: 1,
  205 + isHiddenDropdown: true,
  206 + currentSelect: this.data.dropdownArr[currentIndex],
  207 + currentQuery: data,//保存当前请求参数
  208 + inputVal: '',
  209 + });
  210 +
  211 + this.getData(true, '/api/weshop/rebateLog/commissionlist', data);
  212 + },
  213 +
  214 + /**
  215 + * 搜索输入框聚焦
  216 + */
  217 + inputFocus() {
  218 + this.setData({
  219 + isInputFocus: true,
  220 + });
  221 + },
  222 +
  223 + /**
  224 + * 搜索输入框失焦
  225 + */
  226 + inputBlur() {
  227 + this.setData({
  228 + isInputFocus: false,
  229 + });
  230 + },
  231 +
  232 + /**
  233 + * 搜索输入框输入内容
  234 + */
  235 + input(e) {
  236 + this.data.inputVal = e.detail.value;
  237 + },
  238 +
  239 + /**
  240 + * 搜索输入框清空内容
  241 + */
  242 + inputClear() {
  243 + let inputVal = this.data.inputVal;
  244 + if(inputVal) {
  245 + this.setData({
  246 + inputVal: '',
  247 + });
  248 + };
  249 + },
  250 +
  251 + /**
  252 + * 点击搜索
  253 + */
  254 + search() {
  255 + let data = {
  256 + store_id: app.globalData.setting.stoid,
  257 + user_id: app.globalData.user_id,
  258 + };
  259 + if(this.data.inputVal) {
  260 + data.key = this.data.inputVal;
  261 + };
  262 + this.setData({
  263 + currentQuery: data,
  264 + currentSelect: this.data.dropdownArr[0],
  265 + });
  266 + this.getData(true, '/api/weshop/rebateLog/commissionlist', this.data.currentQuery);
  267 + },
  268 +
  269 + /**
  270 + * 点击佣金排序
  271 + */
  272 + clickSort() {
  273 + let orderType = '';
  274 + let data = this.data.currentQuery;
  275 +
  276 + if(!this.data.isHiddenDropdown) {
  277 + this.setData({
  278 + isHiddenDropdown: true,
  279 + });
  280 + };
  281 +
  282 +
  283 + if(data.page && data.page != 1) {//清除page
  284 + delete data.page;
  285 + };
  286 + if(data.orderType) {//清除orderType
  287 + delete data.orderType;
  288 + };
  289 + if(data.key) {//清除搜索输入框
  290 + delete data.key;
  291 + };
  292 +
  293 + if(this.data.isDescending) {
  294 + orderType = 'desc';
  295 + } else {
  296 + orderType = 'asc';
  297 + };
  298 + data.orderField = 'money';
  299 + data.orderType = orderType;
  300 +
  301 + this.setData({
  302 + list: null,
  303 + noMore: false,
  304 + pageNum: 1,
  305 + isSort: true,
  306 + isDescending: !this.data.isDescending,
  307 + currentQuery: data,
  308 + });
  309 + this.getData(true, '/api/weshop/rebateLog/commissionlist', this.data.currentQuery);
  310 + },
  311 +
  312 + /**
  313 + * 请求数据
  314 + */
  315 + getData: function(isInit, url, data) {
  316 + app.request.promiseGet(url, {
  317 + data: data,
  318 + isShowLoading: true,
  319 + })
  320 + .then(function(res) {
  321 + // console.log('1121', res.data.code);
  322 + if(res.data.code == 0) {
  323 +
  324 + self.setData({
  325 + isLoading: false
  326 + });
  327 +
  328 + if(isInit) {// 第一次加载
  329 + self.setData({
  330 + list: res.data.data
  331 + });
  332 + } else {
  333 + self.setData({
  334 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  335 + });
  336 + };
  337 +
  338 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  339 + self.setData({
  340 + noMore: true
  341 + });
  342 + };
  343 +
  344 + } else {
  345 + self.setData({
  346 + 'list.pageData': []
  347 + });
  348 + };
  349 +
  350 + })
  351 + .catch(function(err) {
  352 + console.log('出错拉!!!!',err);
  353 + self.setData({
  354 + 'list.pageData': []
  355 + });
  356 + });
  357 + },
  358 +
  359 +
  360 + // 上拉加载
  361 + scrollToLower(url, requestData) {
  362 + // 数据总量
  363 + let total = this.data.list.total;
  364 + // 单页最大数据量
  365 + let pageSize = this.data.list.pageSize;
  366 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  367 + if((total != 0)&&(total <= pageSize)) {
  368 + this.setData({
  369 + noMore: true
  370 + });
  371 + };
  372 +
  373 + if(!this.data.isLoading && !this.data.noMore) {
  374 + this.setData({
  375 + isLoading: true,
  376 + pageNum: this.data.pageNum + 1
  377 + });
  378 + requestData.page = this.data.pageNum;
  379 + this.getData(false, url, requestData);
  380 + };
  381 + },
  382 +})
0 383 \ No newline at end of file
... ...
packageA/pages/distribution/commision/commision.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "佣金明细",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/commision/commision.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<view>
  3 + <view class="head">
  4 + <!-- 搜索 -->
  5 + <view class="flex ai-center fs26 bg-white pd20">
  6 + <view class="input-container f1">
  7 + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入会员手机号码/昵称" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input"/>
  8 + <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
  9 + <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
  10 + </view>
  11 + <view class="pd20 c-red" bindtap="search">搜索</view>
  12 + </view>
  13 + <!-- 条件筛选 -->
  14 + <view class="pr bg-white pdh20 pdb20">
  15 + <view class="flex fs26 t-c">
  16 + <view class="f1 line {{isHiddenDropdown ? '':'active'}}" bindtap="clickDropdown">{{currentSelect}}<text class="iconfont {{isHiddenDropdown ? 'icon-xia':'icon-shang'}} pdl10"></text></view>
  17 + <view class="f1" bindtap="clickSort">佣金
  18 + <text class="iconfont icon-sort2 c-c7" wx:if="{{!isSort}}"></text>
  19 + <text class="t-icon t-icon-sort-up pdl10 {{!isDescending ? 'reverse':''}}" wx:else></text>
  20 + </view>
  21 + </view>
  22 + <view class="dropdown fs26" hidden="{{isHiddenDropdown}}" bindtap="selectDropdown">
  23 + <view class="pd20" wx:for="{{dropdownArr}}" data-index="{{index}}" hover-class="hover">{{item}}</view>
  24 + </view>
  25 + </view>
  26 + <view class="mask" hidden="{{isHiddenDropdown}}" bindtap="clickMask"></view>
  27 + </view>
  28 +
  29 +
  30 + <view class="pd20">
  31 + <view class="item fs26" wx:for="{{list.pageData}}">
  32 + <view class="flex jc_sb pd20 bdb">
  33 + <view class="time">{{filter.format_time(item.create_time, 1)}}</view>
  34 + <view class="c-red">{{filter.status(item.status, statusArr)}}</view>
  35 + </view>
  36 + <view class="pd20"><text class="c-a fs24">订单号:</text>{{item.order_sn}}</view>
  37 + <view class="flex t-c">
  38 + <view class="pd20 w33">
  39 + <view class="c-a fs24">订单金额</view>
  40 + <view class="pdt10 ellipsis-1"><text class="money">{{item.goods_price}}</text></view>
  41 + </view>
  42 + <view class="pd20 w33 md">
  43 + <view class="c-a fs24">分成金额</view>
  44 + <view class="pdt10 ellipsis-1"><text class="money">{{item.money}}</text></view>
  45 + </view>
  46 + <view class="pd20 w33">
  47 + <view class="c-a fs24">购买者</view>
  48 + <view class="pdt10 ellipsis-1"><text>{{item.nickname}}</text></view>
  49 + </view>
  50 + </view>
  51 + </view>
  52 + </view>
  53 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  54 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  55 +
  56 +</view>
0 57 \ No newline at end of file
... ...
packageA/pages/distribution/commision/commision.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.input-container {
  6 + position: relative;
  7 + background-color: #f0f0f0;
  8 + border-radius: 6rpx;
  9 +}
  10 +.input-container::before {
  11 + content: '\e618';
  12 + font-family: iconfont;
  13 + position: absolute;
  14 + top: 50%;
  15 + left: 16rpx;
  16 + transform: translateY(-40%);
  17 + color: #aaa;
  18 +}
  19 +.input-container .icon-guanbi {
  20 + position: absolute;
  21 + top: 50%;
  22 + right: 16rpx;
  23 + transform: translateY(-40%);
  24 + font-size: 28rpx;
  25 + color: #aaa;
  26 + padding: 10rpx;
  27 + z-index: 2;
  28 +}
  29 +.input {
  30 + padding: 10rpx 50rpx;
  31 +}
  32 +
  33 +.time::before {
  34 + content: '\e64c';
  35 + font-family: iconfont;
  36 + padding-right: 10rpx;
  37 + color: #FF6768;
  38 +}
  39 +
  40 +.icon-xia,
  41 +.icon-shang {
  42 + font-size: 16rpx;
  43 +}
  44 +.icon-sort2 {
  45 + font-size: 24rpx;
  46 +}
  47 +
  48 +.line {
  49 + position: relative;
  50 +}
  51 +.line::after {
  52 + content: '';
  53 + position: absolute;
  54 + right: 0;
  55 + background-color: #f4f4f4;
  56 + width: 2rpx;
  57 + height: 30rpx;
  58 + top: 50%;
  59 + transform: translateY(-50%);
  60 +}
  61 +
  62 +.item {
  63 + border-radius: 12rpx;
  64 + background-color: white;
  65 +}
  66 +
  67 +.item ~ .item {
  68 + margin-top: 20rpx;
  69 +}
  70 +
  71 +.money {
  72 + /* word-break: break-all;
  73 + word-wrap: break-word; */
  74 +}
  75 +
  76 +.money::before {
  77 + content: '¥';
  78 + font-size: 22rpx;
  79 +}
  80 +
  81 +.md {
  82 + position: relative;
  83 +}
  84 +.md::before,
  85 +.md::after {
  86 + content: '';
  87 + position: absolute;
  88 + top: 50%;
  89 + transform: translateY(-50%);
  90 + width: 2rpx;
  91 + height: 40%;
  92 + background-color: #f4f4f4;
  93 +}
  94 +.md::before {
  95 + left: 0;
  96 +}
  97 +.md::after {
  98 + right: 0;
  99 +}
  100 +
  101 +.noMore {
  102 + padding: 20rpx;
  103 + color: #bbb;
  104 + text-align: center;
  105 + font-size: 26rpx;
  106 + background-color: transparent !important;
  107 +}
  108 +
  109 +.head {
  110 + position: sticky;
  111 + top: 0;
  112 + z-index: 1;
  113 +}
  114 +
  115 +.dropdown {
  116 + border-top: 2rpx solid #f8f8f8;
  117 + position: absolute;
  118 + width: 100%;
  119 + top: 54rpx;
  120 + left: 0;
  121 + background-color: white;
  122 + z-index: 1;
  123 +}
  124 +
  125 +
  126 +.active {
  127 + color: #FF6768;
  128 + font-weight: bold;
  129 + position: relative;
  130 +}
  131 +
  132 +
  133 +.mask {
  134 + position: fixed;
  135 + width: 100%;
  136 + height: 100%;
  137 + background-color: rgba(0,0,0,.5);
  138 +}
  139 +
  140 +.hover {
  141 + background-color: #eee;
  142 +}
  143 +
  144 +.t-icon-sort-up {
  145 + width: 12px;
  146 + height: 12px;
  147 + position: relative;
  148 + top: 2rpx;
  149 + right: 0;
  150 + background-repeat: no-repeat;
  151 + box-sizing: border-box;
  152 +}
  153 +
  154 +.t-icon-sort-up.reverse {
  155 + transform: rotateZ(-180deg);
  156 +}
  157 +
  158 +
  159 +
... ...
packageA/pages/distribution/goods/goods.js 0 → 100644
  1 +// packageA//pages/distribution/commision/commision.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + isInputFocus: false,//记录搜索输入框是否聚焦
  12 + inputVal: '',//记录搜索输入框的内容
  13 + isSort: false,//控制排序开关状态,true开启排序
  14 + isDescending: false, //isDescending降序,ascending升序
  15 +
  16 +
  17 + tabArr: [],
  18 + currentTabIndex: 0,
  19 + isShowRow: false,//控制视图切换状态
  20 + isHiddenDropdown: true,//控制筛选下拉菜单显隐
  21 +
  22 + list: null,
  23 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  24 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  25 + pageNum: 1, // 当前页数
  26 +
  27 + isCheckAll: false, //记录是否全选
  28 + currentQuery: {
  29 + store_id: app.globalData.setting.stoid,
  30 + },
  31 + },
  32 +
  33 + /**
  34 + * 生命周期函数--监听页面加载
  35 + */
  36 + onLoad: function (options) {
  37 + self = this;//保存全局指针
  38 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  39 + self.setData({
  40 + userInfo: data,
  41 + });
  42 + });
  43 +
  44 +
  45 + //动态设置标题:0选择商品,1上架商品
  46 + let title = '';
  47 + let tabArr = [];
  48 + if(options.index == 0) {
  49 + title = '选择上架商品';
  50 + tabArr = ['最新','销量','评论','价格'];
  51 + } else {
  52 + title = '选择下架商品';
  53 + tabArr = ['已选','必营','销量','价格'];
  54 + };
  55 + wx.setNavigationBarTitle({
  56 + title,
  57 + });
  58 + this.setData({
  59 + options,
  60 + tabArr,
  61 + });
  62 +
  63 +
  64 +
  65 +
  66 + },
  67 +
  68 + /**
  69 + * 生命周期函数--监听页面初次渲染完成
  70 + */
  71 + onReady: function () {
  72 +
  73 + },
  74 +
  75 + /**
  76 + * 生命周期函数--监听页面显示
  77 + */
  78 + onShow: function () {
  79 + let url = '/api/weshop/goods/page';
  80 + let currentQuery = this.data.currentQuery;
  81 + if(app.globalData.userInfo) {
  82 + if(!this.data.isLogin) {
  83 + this.setData({
  84 + userInfo: app.globalData.userInfo,
  85 + imghost: app.globalData.setting.imghost,
  86 + isLogin: true,
  87 + 'currentQuery.user_id': app.globalData.user_id,
  88 + });
  89 +
  90 + if(this.data.options.index == 0) {//上架商品
  91 + // 请求数据
  92 + currentQuery.is_mainshow = 1;
  93 + currentQuery.isonsale = 1;
  94 + // url = '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1';
  95 + // this.getData(true, '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1', this.data.currentQuery);
  96 + } else {//下架商品
  97 + currentQuery.searchtype = 1;
  98 + // url = '/api/weshop/goods/page?dis_type=1';
  99 + // this.getData(true, '/api/weshop/goods/page?dis_type=1', this.data.currentQuery);
  100 + };
  101 + currentQuery.dis_type = 1;
  102 + this.getData(true, url, currentQuery);
  103 +
  104 + // 加载筛选条件:国别
  105 + app.request.promiseGet('/api/weshop/goods/listGroupnation', {
  106 + data: currentQuery,
  107 + // isShowLoading: true,
  108 + }).then(function(res) {
  109 + console.log('nation=====>', res.data.data);
  110 + self.setData({
  111 + nationList: res.data.data,
  112 + });
  113 + });
  114 + // 加载筛选条件:品牌
  115 + app.request.promiseGet('/api/weshop/goods/listGroupbrand', {
  116 + data: currentQuery,
  117 + // isShowLoading: true,
  118 + }).then(function(res) {
  119 + console.log('brand=====>', res.data.data);
  120 + self.setData({
  121 + brandList: res.data.data,
  122 + });
  123 + });
  124 + };
  125 + };
  126 + },
  127 +
  128 + /**
  129 + * 生命周期函数--监听页面隐藏
  130 + */
  131 + onHide: function () {
  132 +
  133 + },
  134 +
  135 + /**
  136 + * 生命周期函数--监听页面卸载
  137 + */
  138 + onUnload: function () {
  139 +
  140 + },
  141 +
  142 + /**
  143 + * 页面相关事件处理函数--监听用户下拉动作
  144 + */
  145 + onPullDownRefresh: function () {
  146 +
  147 + },
  148 +
  149 + /**
  150 + * 页面上拉触底事件的处理函数
  151 + */
  152 + onReachBottom: function () {
  153 + let data = this.data.currentQuery;
  154 + let options = this.data.options;
  155 + let url = '';
  156 +
  157 + if(options.index == 0) {
  158 + url = '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1';
  159 + } else {
  160 + url = '/api/weshop/goods/page';
  161 + };
  162 +
  163 +
  164 + this.scrollToLower(url, data, function() {
  165 + let items = self.data.list.pageData;
  166 + let values = self.data.checkedArr;
  167 + let isCheckAll = self.data.isCheckAll;
  168 +
  169 + if(items.length == values.length) {
  170 + if(!isCheckAll) {
  171 + isCheckAll = !isCheckAll;
  172 + };
  173 + } else {
  174 + if(isCheckAll) {
  175 + isCheckAll = !isCheckAll;
  176 + };
  177 + };
  178 +
  179 + self.setData({
  180 + isCheckAll,
  181 + });
  182 + });
  183 +
  184 + },
  185 +
  186 + /**
  187 + * 用户点击右上角分享
  188 + */
  189 + onShareAppMessage: function () {
  190 +
  191 + },
  192 +
  193 + /**
  194 + * 点击下拉菜单
  195 + */
  196 + clickDropdown() {
  197 + this.setData({
  198 + isHiddenDropdown: !this.data.isHiddenDropdown,
  199 + });
  200 + },
  201 +
  202 + /**
  203 + * 点击遮罩层
  204 + */
  205 + clickMask() {
  206 + this.setData({
  207 + isHiddenDropdown: true,
  208 + });
  209 + },
  210 +
  211 + /**
  212 + * 选择下拉菜单项
  213 + */
  214 + selectDropdown(e) {
  215 + let currentIndex = e.target.dataset.index;
  216 + this.setData({
  217 + isHiddenDropdown: true,
  218 + currentSelect: this.data.dropdownArr[currentIndex],
  219 + });
  220 + },
  221 +
  222 + /**
  223 + * 搜索输入框聚焦
  224 + */
  225 + inputFocus() {
  226 + this.setData({
  227 + isInputFocus: true,
  228 + });
  229 + },
  230 +
  231 + /**
  232 + * 搜索输入框失焦
  233 + */
  234 + inputBlur() {
  235 + this.setData({
  236 + isInputFocus: false,
  237 + });
  238 + },
  239 +
  240 + /**
  241 + * 搜索输入框输入内容
  242 + */
  243 + input(e) {
  244 + this.data.inputVal = e.detail.value;
  245 + },
  246 +
  247 + /**
  248 + * 搜索输入框清空内容
  249 + */
  250 + inputClear() {
  251 + let inputVal = this.data.inputVal;
  252 + console.log('input', inputVal);
  253 + if(inputVal) {
  254 + this.setData({
  255 + inputVal: '',
  256 + });
  257 + };
  258 + },
  259 +
  260 + /**
  261 + * 点击搜索
  262 + */
  263 + search(callback) {
  264 + let url = '';
  265 + let data = this.data.currentQuery;
  266 + if(data.orderField) delete data.orderField;
  267 + if(data.orderType) delete data.orderType;
  268 + if(this.data.inputVal) {
  269 + data.key = this.data.inputVal;
  270 + };
  271 + if(this.data.isHiddenDropdown) {
  272 + if(data.nation_id) delete data.nation_id;
  273 + if(data.brand_id) delete data.brand_id;
  274 + if(data.startprice) delete data.startprice;
  275 + if(data.endprice) delete data.endprice;
  276 + };
  277 + this.setData({
  278 + list: null,
  279 + currentTabIndex: 5
  280 + });
  281 + // console.log('data', data);
  282 +
  283 +
  284 + if(this.data.options.index == 0) {//上架商品
  285 + url = '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1';
  286 + } else {//下架商品
  287 + data.dis_type = 1;
  288 + url = '/api/weshop/goods/page?searchtype=1';
  289 + };
  290 + this.getData(true, url, data)
  291 + .then(function() {
  292 + callback();
  293 + });
  294 + },
  295 +
  296 + /**
  297 + * 点击排序
  298 + */
  299 + clickSort() {
  300 + let data = this.data.currentQuery;
  301 + if(!this.data.isSort) {
  302 + this.setData({
  303 + isSort: true,
  304 + });
  305 + } else {
  306 + this.setData({
  307 + isDescending: !this.data.isDescending,
  308 + });
  309 + };
  310 + if(this.data.isDescending) {
  311 + data.orderType = 'desc';
  312 + } else {
  313 + data.orderType = 'asc';
  314 + };
  315 + },
  316 +
  317 + /**
  318 + * 点击视图切换按钮
  319 + */
  320 + change() {
  321 + this.setData({
  322 + isShowRow: !this.data.isShowRow
  323 + });
  324 + },
  325 +
  326 + /**
  327 + * 点击Tab
  328 + */
  329 + clickTab(e) {
  330 + let url = '';
  331 + let isSort = this.data.isSort;
  332 + let data = this.data.currentQuery;
  333 + let isDescending = this.data.isDescending;
  334 + let currentIndex = e.target.dataset.index;
  335 + let options = this.data.options;
  336 +
  337 + if(currentIndex != 3) {
  338 + if(isSort) {
  339 + isSort = false;
  340 + };
  341 + if(isDescending) {
  342 + isDescending = false;
  343 + };
  344 + };
  345 + if(data.page) delete data.page;
  346 + if(data.key) delete data.key;
  347 +
  348 + this.setData({
  349 + currentTabIndex: currentIndex,
  350 + isSort,
  351 + isDescending,
  352 + list: null,
  353 + noMore: false,
  354 + pageNum: 1,
  355 + isCheckAll: false, //清除全选状态
  356 + });
  357 +
  358 + switch(currentIndex) {
  359 + case 0: {
  360 + if(data.orderField) delete data.orderField;
  361 + if(data.orderType) delete data.orderType;
  362 + if(options.index == 1) {//下架:已选
  363 + data.searchtype = 1;
  364 + data.dis_type = 1;
  365 + };
  366 + break;
  367 + };
  368 + case 1: {
  369 + if(options.index == 0) {//上架:销量排序
  370 + if(data.orderType) delete data.orderType;
  371 + data.orderField = 'sales_sum';
  372 + } else {//下架:必营
  373 + if(data.searchtype) delete data.searchtype;
  374 + if(data.orderField) delete data.orderField;
  375 + if(data.orderType) delete data.orderType;
  376 + data.dis_type = 0;
  377 + };
  378 + break;
  379 + };
  380 + case 2: {
  381 + if(options.index == 0) {//上架:评论排序
  382 + if(data.orderType) delete data.orderType;
  383 + data.orderField = 'comment_count';
  384 + } else {//下架:销量排序
  385 + if(data.orderType) delete data.orderType;
  386 + data.orderField = 'sales_sum';
  387 + data.dis_type = 1;
  388 + data.searchtype = 1;
  389 + };
  390 + break;
  391 + };
  392 + case 3: {
  393 + data.orderField = 'shop_price';
  394 + data.dis_type = 1;
  395 + break;
  396 + };
  397 + };
  398 +
  399 + if(options.index == 0) {
  400 + url = '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1';
  401 + } else {
  402 + url = '/api/weshop/goods/page';
  403 + };
  404 + this.getData(true, url, data);
  405 + },
  406 +
  407 + /**
  408 + * 点击筛选
  409 + */
  410 + clickFilter() {
  411 + this.setData({
  412 + isHiddenDropdown: !this.data.isHiddenDropdown,
  413 + });
  414 + },
  415 +
  416 + /**
  417 + * 点击遮罩层,关闭筛选下拉菜单
  418 + */
  419 + clickMask() {
  420 + if(!this.data.isHiddenDropdown) {
  421 + this.setData({
  422 + isHiddenDropdown: true,
  423 + });
  424 + }
  425 + },
  426 +
  427 + /**
  428 + * promiseGet请求数据
  429 + */
  430 + getData: function(isInit, url, data) {
  431 + return new Promise(function(resolve, reject) {
  432 +
  433 + app.request.promiseGet(url, {
  434 + data: data,
  435 + isShowLoading: true,
  436 + })
  437 + .then(function(res) {
  438 + // console.log('1121', res.data.code);
  439 + if(res.data.code == 0) {
  440 +
  441 + self.setData({
  442 + isLoading: false
  443 + });
  444 +
  445 + if(isInit) {// 第一次加载
  446 + self.setData({
  447 + list: res.data.data
  448 + });
  449 + } else {
  450 + self.setData({
  451 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  452 + });
  453 + };
  454 +
  455 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  456 + self.setData({
  457 + noMore: true
  458 + });
  459 + };
  460 +
  461 + } else {
  462 + self.setData({
  463 + 'list.pageData': []
  464 + });
  465 + };
  466 + resolve();
  467 + })
  468 + .catch(function(err) {
  469 + console.log('出错拉!!!!',err);
  470 + self.setData({
  471 + 'list.pageData': []
  472 + });
  473 + });
  474 +
  475 + });
  476 +
  477 + },
  478 +
  479 +
  480 + /**
  481 + * 上拉加载数据
  482 + */
  483 + scrollToLower(url, requestData, callback) {
  484 + // 数据总量
  485 + let total = this.data.list.total;
  486 + // 单页最大数据量
  487 + let pageSize = this.data.list.pageSize;
  488 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  489 + if((total != 0)&&(total <= pageSize)) {
  490 + this.setData({
  491 + noMore: true
  492 + });
  493 + };
  494 +
  495 + if(!this.data.isLoading && !this.data.noMore) {
  496 + this.setData({
  497 + isLoading: true,
  498 + pageNum: this.data.pageNum + 1
  499 + });
  500 + requestData.page = this.data.pageNum;
  501 +
  502 + this.getData(false, url, requestData)
  503 + .then(function() {
  504 + callback();
  505 + });
  506 + };
  507 + },
  508 +
  509 + /**
  510 + * 点击多选框
  511 + */
  512 + checkboxChange(e) {
  513 + // 全选的情况下,取消选择某个单项,全选状态取消
  514 + // 手动选择所有单项,全选状态点亮
  515 + let items = this.data.list.pageData;
  516 + let values = e.detail.value;
  517 + let isCheckAll = this.data.isCheckAll;
  518 +
  519 + if(items.length == values.length) {
  520 + if(!isCheckAll) {
  521 + isCheckAll = !isCheckAll;
  522 + };
  523 + } else {
  524 + if(isCheckAll) {
  525 + isCheckAll = !isCheckAll;
  526 + };
  527 + };
  528 +
  529 + this.setData({
  530 + isCheckAll,
  531 + checkedArr: values,
  532 + });
  533 + // console.log('选择的数组1',values);
  534 + },
  535 +
  536 + /**
  537 + * 全选
  538 + */
  539 + clickCheckAll(e) {
  540 + let checkedArr = [];
  541 + let items = this.data.list.pageData;
  542 + for(let i = 0, length = items.length; i < length; i++) {
  543 + items[i].checked = !this.data.isCheckAll;
  544 + if(items[i].checked) {
  545 + checkedArr.push(items[i].goods_id);
  546 + };
  547 + };
  548 + this.setData({
  549 + 'list.pageData': items,
  550 + isCheckAll: !this.data.isCheckAll,
  551 + checkedArr,
  552 + });
  553 + // console.log('选择的数组',checkedArr);
  554 + },
  555 +
  556 + /**
  557 + * 处理多选的e.detail.value
  558 + */
  559 + handleValues(arr) {
  560 + if(arr) {
  561 + let newArr = [];
  562 + arr.forEach(function(item, index) {
  563 + newArr.push({'goods_id': item});
  564 + });
  565 + // console.log('newArr', newArr);
  566 + return newArr;
  567 + };
  568 + },
  569 +
  570 + /**
  571 + * 一键上架
  572 + */
  573 + putOn() {
  574 + let checkedArr = this.data.checkedArr;
  575 + let checkedList = this.handleValues(checkedArr);
  576 +
  577 + app.request.promisePost('/api/weshop/users/distribut/UpGoods', {
  578 + is_json: true,
  579 + data: {
  580 + storeId: app.globalData.setting.stoid,
  581 + userId: app.globalData.user_id,
  582 + goods: checkedList,
  583 + },
  584 + }).then(function() {
  585 + self.setData({
  586 + isCheckAll: false,
  587 + });
  588 + self.getData(true, '/api/weshop/goods/page?is_mainshow=1&isonsale=1&dis_type=1', self.data.currentQuery);
  589 + });
  590 + },
  591 +
  592 + /**
  593 + * 一键下架
  594 + */
  595 + pullOff() {
  596 + let data = {
  597 + storeId: app.globalData.setting.stoid,
  598 + userId: app.globalData.user_id,
  599 + };
  600 + let isCheckAll = this.data.isCheckAll;
  601 +
  602 + if(isCheckAll) {
  603 + // console.log('全选啦~');
  604 + data.type = 1;
  605 + } else {
  606 + let checkedArr = this.data.checkedArr;
  607 + let checkedList = this.handleValues(checkedArr);
  608 + data.goods = checkedList;
  609 + };
  610 +
  611 + app.request.promisePost('/api/weshop/users/distribut/DownGoods', {
  612 + is_json: true,
  613 + data: data,
  614 + }).then(function() {
  615 + // console.log('data', self.data.currentQuery);
  616 + self.setData({
  617 + isCheckAll: false,
  618 + });
  619 + self.getData(true, '/api/weshop/goods/page?dis_type=1&searchtype=1', self.data.currentQuery);
  620 + });
  621 + },
  622 +
  623 + /**
  624 + * 点击跳转
  625 + */
  626 + goto(e) {
  627 + let url = '';
  628 + if(e.target.dataset.name == 'checkbox') {
  629 + return;
  630 + } else {
  631 + if(e.target.dataset.url) {
  632 + url = e.target.dataset.url;
  633 + } else {
  634 + url = e.currentTarget.dataset.url;
  635 + }
  636 + app.goto(url);
  637 + };
  638 + },
  639 +
  640 +
  641 + /**
  642 + * 筛选:选择
  643 + */
  644 + select(e) {
  645 + let currentIndex = e.target.dataset.index;
  646 + let name = e.target.dataset.name;
  647 + let id = e.target.dataset.id;
  648 + let currentQuery = this.data.currentQuery;
  649 +
  650 + switch(name) {
  651 + case 'nation': {
  652 + this.setData({
  653 + nationIndex: currentIndex,
  654 + });
  655 + currentQuery.nation_id = id;
  656 + break;
  657 + };
  658 + case 'brand': {
  659 + this.setData({
  660 + brandIndex: currentIndex,
  661 + });
  662 + currentQuery.brand_id = id;
  663 + break;
  664 + };
  665 + };
  666 +
  667 + },
  668 +
  669 +
  670 + /**
  671 + * 筛选:获取价格区间
  672 + */
  673 + getPrice(e) {
  674 + let isMax = e.target.dataset.ismax;
  675 + let price = e.detail.value;
  676 + let currentQuery = this.data.currentQuery;
  677 +
  678 + if(isMax == 0) {
  679 + currentQuery.startprice = price;
  680 + } else {
  681 + currentQuery.endprice = price;
  682 + };
  683 + },
  684 +
  685 + /**
  686 + * 筛选:点击确定
  687 + */
  688 + startFilter() {
  689 + let data = this.data.currentQuery;
  690 + let startprice = parseFloat(data.startprice);
  691 + let endprice = parseFloat(data.endprice);
  692 +
  693 + // 如果筛选条件为空,按确定按钮不发送请求
  694 + if(!data.nation_id && !data.brand_id && !startprice && !endprice && !this.data.inputVal) {
  695 + this.setData({
  696 + isHiddenDropdown: true,
  697 + });
  698 + return;
  699 + };
  700 +
  701 + if(startprice && endprice) {
  702 + if(startprice > endprice) {
  703 + wx.showToast({
  704 + title: '最低价不能高于最高价',
  705 + icon: 'none',
  706 + duration: 2000
  707 + });
  708 + return;
  709 + };
  710 + };
  711 + if(!this.data.inputVal) {
  712 + if(data.key) delete data.key;
  713 + };
  714 +
  715 + this.search(function() {
  716 + self.setData({
  717 + isHiddenDropdown: true,
  718 + });
  719 + });
  720 + },
  721 +
  722 + /**
  723 + * 筛选:重置
  724 + */
  725 + reset() {
  726 + let data = this.data.currentQuery;
  727 +
  728 + if(data.nation_id) delete data.nation_id;
  729 + if(data.brand_id) delete data.brand_id;
  730 + if(data.startprice) delete data.startprice;
  731 + if(data.endprice) delete data.endprice;
  732 + if(data.key) delete data.key;
  733 +
  734 + this.setData({
  735 + nationIndex: null,
  736 + brandIndex: null,
  737 + price: null,
  738 + inputVal: null,
  739 + });
  740 + }
  741 +})
0 742 \ No newline at end of file
... ...
packageA/pages/distribution/goods/goods.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "我的名片",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/goods/goods.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<view>
  3 + <view class="head pr">
  4 + <!-- 搜索 -->
  5 + <view class="flex ai-center fs26 bg-white pd20">
  6 + <view class="input-container f1">
  7 + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" confirm-type="search" bindconfirm="search"/>
  8 + <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
  9 + <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
  10 + </view>
  11 + <view class="pd20 filter {{isHiddenDropdown ? '':'c-red'}}" bindtap="clickFilter">筛选</view>
  12 +
  13 + <view class="dropdown {{isHiddenDropdown ? '':'show'}}" hidden="{{isHiddenDropdown}}">
  14 + <view class="dropdown-wrapper">
  15 + <view class="pd20 bsbb">
  16 + <view class="pdb20">国家</view>
  17 + <view class="flex wrap t-c" bindtap="select">
  18 + <view class="w25 pdt20" wx:for="{{nationList}}"><text class="label {{nationIndex == index ? 'selected':''}}" data-id="{{item.nation_id}}" data-name="nation" data-index="{{index}}">{{item.name}}</text></view>
  19 + </view>
  20 + </view>
  21 + <view class="pd20 bsbb" >
  22 + <view class="pdb20">品牌</view>
  23 + <view class="flex wrap t-c" bindtap="select">
  24 + <view class="w25 pdt20" wx:for="{{brandList}}"><text class="label {{brandIndex == index ? 'selected':''}}" data-id="{{item.brand_id}}" data-name="brand" data-index="{{index}}">{{item.name}}</text></view>
  25 + </view>
  26 + </view>
  27 + <view class="pd20 bsbb">
  28 + <view class="pdb20">价格区间</view>
  29 + <view class="flex t-c ai-center jc-center">
  30 + <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最低价" class="input-price" bindinput="getPrice" data-ismax="0"/></view>
  31 + <view class="mgh20">-</view>
  32 + <view class="w30 pdh20"><input type="number" value="{{price}}" placeholder="最高价" class="input-price" bindinput="getPrice" data-ismax="1"/></view>
  33 + <!-- <view class="w25 pdt20"><text class="label">品牌一</text></view> -->
  34 + </view>
  35 + </view>
  36 + <!-- <view>
  37 + <view class="pd20 bold">价格</view>
  38 + <view class="flex">
  39 + <view>价格一</view>
  40 + <view>价格二</view>
  41 + <view>价格三</view>
  42 + </view>
  43 + </view> -->
  44 + </view>
  45 + <view class="flex t-c">
  46 + <view class="pd30 f1 bg-f0" bindtap="reset">重置</view>
  47 + <view class="pd30 f1 l-red white" bindtap="startFilter">确定</view>
  48 + </view>
  49 + </view>
  50 + <view class="mask" bindtap="clickMask"></view>
  51 + </view>
  52 +
  53 +
  54 + <view class="flex t-c fs26 bg-white bdb" bindtap="clickTab">
  55 + <block wx:for="{{tabArr}}">
  56 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">{{item}}</view>
  57 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort">
  58 + {{item}}<text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}" data-index="{{index}}"></text>
  59 + <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" data-index="{{index}}" wx:else></text>
  60 + </view>
  61 + </block>
  62 + <view class="f1 pd20" catchtap="change">
  63 + <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>
  64 + </view>
  65 + </view>
  66 +
  67 + </view>
  68 +
  69 +
  70 + <view class="content">
  71 + <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange">
  72 + <view class="item bg-white flex ai-center pd20" wx:for="{{list.pageData}}">
  73 + <!-- <label>
  74 +
  75 + </label> -->
  76 + <checkbox value="{{item.goods_id}}" checked="{{item.checked}}"/>
  77 + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  78 + <view class="pdr20"><image class="img" src="{{imghost + item.original_img}}" lazy-load/></view>
  79 + <view class="flex fdc jc_sb">
  80 + <view class="ellipsis-2">{{item.goods_name}}</view>
  81 + <view>
  82 + <!-- 判断是否有活动价 -->
  83 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  84 + <view class="flex xc-wc ai-center" >
  85 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  86 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  87 + <!-- 活动价 -->
  88 + <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">
  89 + <view class="fs24">¥</view>
  90 + <view class="fs35">{{item.prom_price}}</view>
  91 + </view>
  92 + </view>
  93 + <view class="flex" style="line-height: 28rpx;">
  94 + <!-- 原价 -->
  95 + <view class="price flex xc-ash line_th">
  96 + <view class="fs22">¥</view>
  97 + <view class="fs22">{{item.market_price}}</view>
  98 + </view>
  99 + </view>
  100 + </block>
  101 + <block wx:else>
  102 + <!-- 商品价格,先判断下是后⼜等级价-->
  103 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  104 + <!-- 当会员是等级卡的时候 -->
  105 + <block wx:if="{{card_field}}">
  106 + <!-- 等级价>0 -->
  107 + <block wx:if="{{item[card_field]>0}}">
  108 + <view class="flex">
  109 + <!-- 办卡价 -->
  110 + <view class="flex xc-wc ai-center">
  111 + <view class="fs24">¥</view>
  112 + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view>
  113 + <view class="card_bg ellipsis-1">
  114 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  115 + <text class="card_name">{{card_name}}</text>
  116 + </view>
  117 + </view>
  118 + </view>
  119 + <view class="flex" style="line-height: 28rpx;">
  120 + <!-- 原价 -->
  121 + <view class="price flex xc-ash line_th">
  122 + <view class="fs22">¥</view>
  123 + <view class="fs22">{{item.market_price}}</view>
  124 + </view>
  125 + </view>
  126 + </block>
  127 + <blocK wx:else>
  128 + <view class="flex">
  129 + <!-- 办卡价 -->
  130 + <view class="flex xc-wc ai-center">
  131 + <view class="fs24">¥</view>
  132 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  133 + </view>
  134 + </view>
  135 + <view class="flex" style="line-height: 28rpx;">
  136 + <!-- 原价 -->
  137 + <view class="price flex xc-ash line_th">
  138 + <view class="fs22">¥</view>
  139 + <view class="fs22">{{item.market_price}}</view>
  140 + </view>
  141 + </view>
  142 + </blocK>
  143 + </block>
  144 + <block wx:else>
  145 + <!-- 如果商品有设置等级价⼤于0的 -->
  146 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  147 + <view class="flex">
  148 + <!-- 办卡价 -->
  149 + <view class="flex xc-wc ai-center">
  150 + <view class="fs24">¥</view>
  151 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  152 + </view>
  153 + <!-- 原价 -->
  154 + <view class="price flex xc-ash line_th">
  155 + <view class="fs22">¥</view>
  156 + <view class="fs22">{{item.market_price}}</view>
  157 + </view>
  158 + </view>
  159 + <view class="flexr" style="">
  160 + <!-- 等级价 -->
  161 + <view class="price flex ai-center">
  162 + <view class="fs22">¥</view>
  163 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  164 + <view class="card_bg ellipsis-1">
  165 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>
  166 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  167 + </view>
  168 + </view>
  169 + </view>
  170 + </block>
  171 + <block wx:else>
  172 + <view class="flex">
  173 + <!-- 办卡价 -->
  174 + <view class="flex xc-wc ai-center">
  175 + <view class="fs24">¥</view>
  176 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  177 + </view>
  178 + </view>
  179 + <view class="flex" style="line-height: 28rpx;">
  180 + <!-- 原价 -->
  181 + <view class="price flex xc-ash line_th">
  182 + <view class="fs22">¥</view>
  183 + <view class="fs22">{{item.market_price}}</view>
  184 + </view>
  185 + </view>
  186 + </block>
  187 + </block>
  188 + </block>
  189 + <!-- 商品压根就没有等级价 -->
  190 + <block wx:else>
  191 + <view class="flex">
  192 + <!-- 办卡价 -->
  193 + <view class="flex xc-wc ai-center">
  194 + <view class="fs24">¥</view>
  195 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  196 + </view>
  197 + </view>
  198 + <view class="flex" style="line-height: 28rpx;">
  199 + <!-- 原价 -->
  200 + <view class="price flex xc-ash line_th">
  201 + <view class="fs22">¥</view>
  202 + <view class="fs22">{{item.market_price}}</view>
  203 + </view>
  204 + </view>
  205 + </block>
  206 + </block>
  207 + <!-- <view class="money fs32 c-red">{{item.market_price}}</view> -->
  208 + <view class="fs24 c-a">分成金额:<text class="money c-red">{{item.commission}}</text></view>
  209 + </view>
  210 + </view>
  211 + </view>
  212 + </view>
  213 + </checkbox-group>
  214 +
  215 + <checkbox-group class="fs26 flex pd20 wrap" catchchange="checkboxChange" wx:else>
  216 + <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  217 + <image class="img2" src="{{imghost + item.original_img}}" mode="aspectFit" lazy-load/>
  218 + <view class="pd20 fs26 flex jc_sb fdc f1">
  219 + <view class="ellipsis-2">{{item.goods_name}}</view>
  220 + <view class="flex ai-center jc_sb pdt20">
  221 + <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox"/>
  222 + <view class="t-r">
  223 + <!-- 判断是否有活动价 -->
  224 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  225 + <view class="flex xc-wc ai-center" >
  226 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  227 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  228 + <!-- 活动价 -->
  229 + <view class="flex xc-wc ai-center" wx:if="{{item.prom_price}}">
  230 + <view class="fs24">¥</view>
  231 + <view class="fs35">{{item.prom_price}}</view>
  232 + </view>
  233 + </view>
  234 + <view class="flex" style="line-height: 28rpx;">
  235 + <!-- 原价 -->
  236 + <view class="price flex xc-ash line_th">
  237 + <view class="fs22">¥</view>
  238 + <view class="fs22">{{item.market_price}}</view>
  239 + </view>
  240 + </view>
  241 + </block>
  242 + <block wx:else>
  243 + <!-- 商品价格,先判断下是后⼜等级价-->
  244 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  245 + <!-- 当会员是等级卡的时候 -->
  246 + <block wx:if="{{card_field}}">
  247 + <!-- 等级价>0 -->
  248 + <block wx:if="{{item[card_field]>0}}">
  249 + <view class="flex">
  250 + <!-- 办卡价 -->
  251 + <view class="flex xc-wc ai-center">
  252 + <view class="fs24">¥</view>
  253 + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view>
  254 + <view class="card_bg ellipsis-1">
  255 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  256 + <text class="card_name">{{card_name}}</text>
  257 + </view>
  258 + </view>
  259 + </view>
  260 + <view class="flex" style="line-height: 28rpx;">
  261 + <!-- 原价 -->
  262 + <view class="price flex xc-ash line_th">
  263 + <view class="fs22">¥</view>
  264 + <view class="fs22">{{item.market_price}}</view>
  265 + </view>
  266 + </view>
  267 + </block>
  268 + <blocK wx:else>
  269 + <view class="flex">
  270 + <!-- 办卡价 -->
  271 + <view class="flex xc-wc ai-center">
  272 + <view class="fs24">¥</view>
  273 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  274 + </view>
  275 + </view>
  276 + <view class="flex" style="line-height: 28rpx;">
  277 + <!-- 原价 -->
  278 + <view class="price flex xc-ash line_th">
  279 + <view class="fs22">¥</view>
  280 + <view class="fs22">{{item.market_price}}</view>
  281 + </view>
  282 + </view>
  283 + </blocK>
  284 + </block>
  285 + <block wx:else>
  286 + <!-- 如果商品有设置等级价⼤于0的 -->
  287 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  288 + <view class="flex">
  289 + <!-- 办卡价 -->
  290 + <view class="flex xc-wc ai-center">
  291 + <view class="fs24">¥</view>
  292 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  293 + </view>
  294 + <!-- 原价 -->
  295 + <view class="price flex xc-ash line_th">
  296 + <view class="fs22">¥</view>
  297 + <view class="fs22">{{item.market_price}}</view>
  298 + </view>
  299 + </view>
  300 + <view class="flexr" style="">
  301 + <!-- 等级价 -->
  302 + <view class="price flex ai-center">
  303 + <view class="fs22">¥</view>
  304 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  305 + <view class="card_bg ellipsis-1">
  306 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>
  307 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  308 + </view>
  309 + </view>
  310 + </view>
  311 + </block>
  312 + <block wx:else>
  313 + <view class="flex">
  314 + <!-- 办卡价 -->
  315 + <view class="flex xc-wc ai-center">
  316 + <view class="fs24">¥</view>
  317 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  318 + </view>
  319 + </view>
  320 + <view class="flex" style="line-height: 28rpx;">
  321 + <!-- 原价 -->
  322 + <view class="price flex xc-ash line_th">
  323 + <view class="fs22">¥</view>
  324 + <view class="fs22">{{item.market_price}}</view>
  325 + </view>
  326 + </view>
  327 + </block>
  328 + </block>
  329 + </block>
  330 + <!-- 商品压根就没有等级价 -->
  331 + <block wx:else>
  332 + <view class="flex">
  333 + <!-- 办卡价 -->
  334 + <view class="flex xc-wc ai-center">
  335 + <view class="fs24">¥</view>
  336 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  337 + </view>
  338 + </view>
  339 + <view class="flex" style="line-height: 28rpx;">
  340 + <!-- 原价 -->
  341 + <view class="price flex xc-ash line_th">
  342 + <view class="fs22">¥</view>
  343 + <view class="fs22">{{item.market_price}}</view>
  344 + </view>
  345 + </view>
  346 + </block>
  347 + </block>
  348 + <!-- <view class="money c-red fs32">{{item.market_price}}</view> -->
  349 + <view class="c-a">分成金额:<text class="money c-red">{{item.commission}}</text></view>
  350 + </view>
  351 + </view>
  352 + </view>
  353 + </view>
  354 + </checkbox-group>
  355 +
  356 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
  357 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  358 + </view>
  359 +
  360 +
  361 +
  362 +
  363 +
  364 + <view class="bottomBar flex pd20 jc_sb fs26 ai-center">
  365 + <!-- <view> -->
  366 + <label class="flex ai-center" bindtap="clickCheckAll">
  367 + <checkbox checked="{{isCheckAll}}"/>全选
  368 + </label>
  369 + <!-- </view> -->
  370 + <view class="pd20 btn" wx:if="{{options.index == 0}}" bindtap="putOn">一键上架</view>
  371 + <view class="pd20 btn" wx:else bindtap="pullOff">一键下架</view>
  372 + </view>
  373 +
  374 +
  375 +
  376 +</view>
... ...
packageA/pages/distribution/goods/goods.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.input-container {
  6 + position: relative;
  7 + background-color: #f0f0f0;
  8 + border-radius: 6rpx;
  9 +}
  10 +.input-container::before {
  11 + content: '\e618';
  12 + font-family: iconfont;
  13 + position: absolute;
  14 + top: 50%;
  15 + left: 16rpx;
  16 + transform: translateY(-40%);
  17 + color: #aaa;
  18 +}
  19 +.input-container .icon-guanbi {
  20 + position: absolute;
  21 + top: 50%;
  22 + right: 16rpx;
  23 + transform: translateY(-40%);
  24 + font-size: 28rpx;
  25 + color: #aaa;
  26 + padding: 10rpx;
  27 + z-index: 2;
  28 +}
  29 +.input {
  30 + padding: 10rpx 50rpx;
  31 +}
  32 +
  33 +.time::before {
  34 + content: '\e64c';
  35 + font-family: iconfont;
  36 + padding-right: 10rpx;
  37 + color: #FF6768;
  38 +}
  39 +
  40 +.icon-xia,
  41 +.icon-shang {
  42 + font-size: 16rpx;
  43 +}
  44 +.icon-sort2 {
  45 + font-size: 24rpx;
  46 +}
  47 +
  48 +/* .line {
  49 + position: relative;
  50 +}
  51 +.line::after {
  52 + content: '';
  53 + position: absolute;
  54 + right: 0;
  55 + background-color: #f4f4f4;
  56 + width: 2rpx;
  57 + height: 30rpx;
  58 + top: 50%;
  59 + transform: translateY(-50%);
  60 +} */
  61 +
  62 +/* .item {
  63 + border-radius: 12rpx;
  64 + background-color: white;
  65 +} */
  66 +
  67 +/* .item ~ .item {
  68 + margin-top: 20rpx;
  69 +} */
  70 +
  71 +.money {
  72 + /* word-break: break-all;
  73 + word-wrap: break-word; */
  74 +}
  75 +
  76 +.money::before {
  77 + content: '¥';
  78 + font-size: 22rpx;
  79 +}
  80 +
  81 +.md {
  82 + position: relative;
  83 +}
  84 +.md::before,
  85 +.md::after {
  86 + content: '';
  87 + position: absolute;
  88 + top: 50%;
  89 + transform: translateY(-50%);
  90 + width: 2rpx;
  91 + height: 40%;
  92 + background-color: #f4f4f4;
  93 +}
  94 +.md::before {
  95 + left: 0;
  96 +}
  97 +.md::after {
  98 + right: 0;
  99 +}
  100 +
  101 +.noMore {
  102 + padding: 20rpx;
  103 + color: #bbb;
  104 + text-align: center;
  105 + font-size: 26rpx;
  106 + background-color: transparent !important;
  107 +}
  108 +
  109 +.head {
  110 + position: sticky;
  111 + top: 0;
  112 + z-index: 1;
  113 +}
  114 +
  115 +.dropdown {
  116 + border-top: 2rpx solid #f8f8f8;
  117 + position: absolute;
  118 + width: 100%;
  119 + top: 54rpx;
  120 + left: 0;
  121 + background-color: white;
  122 + z-index: 1;
  123 +}
  124 +
  125 +
  126 +.active {
  127 + color: #FF6768;
  128 + font-weight: bold;
  129 + position: relative;
  130 +}
  131 +
  132 +.active::after {
  133 + content: '';
  134 + width: 30%;
  135 + height: 2rpx;
  136 + background-color: #FF6768;
  137 + position: absolute;
  138 + left: 0;
  139 + right: 0;
  140 + bottom: 0;
  141 + margin: 0 auto;
  142 +}
  143 +
  144 +
  145 +.mask {
  146 + position: fixed;
  147 + width: 100%;
  148 + height: 100%;
  149 + background-color: rgba(0,0,0,.5);
  150 +}
  151 +
  152 +.hover {
  153 + background-color: #eee;
  154 +}
  155 +
  156 +.t-icon-sort-up {
  157 + width: 12px;
  158 + height: 12px;
  159 + position: relative;
  160 + top: 2rpx;
  161 + right: 0;
  162 + background-repeat: no-repeat;
  163 + box-sizing: border-box;
  164 +}
  165 +
  166 +.t-icon-sort-up.reverse {
  167 + transform: rotateZ(-180deg);
  168 +}
  169 +
  170 +
  171 +
  172 +
  173 +.img {
  174 + width: 240rpx;
  175 + height: 240rpx;
  176 + background-color: #eee;
  177 +}
  178 +
  179 +.img2 {
  180 + display: block;
  181 + width: 100%;
  182 + height: 340rpx;
  183 + /* height: auto; */
  184 + /* width: 200rpx;
  185 + height: 200rpx; */
  186 + background-color: white;
  187 +}
  188 +
  189 +
  190 +/*checkbox 整体大小 */
  191 +checkbox {
  192 + /* width: 240rpx;
  193 + height: 90rpx; */
  194 +}
  195 +/*checkbox 选项框大小 */
  196 +checkbox .wx-checkbox-input {
  197 + width: 34rpx;
  198 + height: 34rpx;
  199 + border-radius: 50%;
  200 +
  201 +}
  202 +/*checkbox选中后样式 */
  203 +checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  204 + background-color: #FF6768;
  205 + border-color: #FF6768;
  206 + /* color: white; */
  207 +}
  208 +/*checkbox选中后图标样式 */
  209 +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  210 + width: 34rpx;
  211 + height: 34rpx;
  212 + line-height: 34rpx;
  213 + text-align: center;
  214 + font-size: 24rpx;
  215 + color: #fff;
  216 + background: transparent;
  217 + transform: translate(-50%, -50%) scale(1);
  218 + -webkit-transform: translate(-50%, -50%) scale(1);
  219 +}
  220 +
  221 +.bottomBar {
  222 + box-sizing: border-box;
  223 + position: fixed;
  224 + bottom: 0;
  225 + width: 100%;
  226 + background-color: white;
  227 + border-radius: 20rpx 20rpx 0 0;
  228 +}
  229 +
  230 +.btn {
  231 + color: white;
  232 + background-color: #FF6768;
  233 + border-radius: 6rpx;
  234 +}
  235 +
  236 +/* .item {
  237 + border-radius: 10rpx;
  238 +} */
  239 +
  240 +.item2 {
  241 + width: calc((100% - 20rpx)/2);
  242 + box-sizing: border-box;
  243 + border-radius: 12rpx;
  244 + overflow: hidden;
  245 + margin-bottom: 20rpx;
  246 + display: flex;
  247 + flex-direction: column;
  248 +}
  249 +
  250 +.item2:nth-child(even) {
  251 + margin-left: 20rpx;
  252 +}
  253 +
  254 +.content {
  255 + padding-bottom: 110rpx;
  256 +}
  257 +
  258 +.dropdown {
  259 + position: absolute;
  260 + left: 0;
  261 + top: 114rpx;
  262 + width: 100%;
  263 + background-color: white;
  264 + box-sizing: border-box;
  265 +}
  266 +
  267 +.label {
  268 + display: inline-block;
  269 + padding: 5rpx 20rpx;
  270 + color: #aaa;
  271 + border: 2rpx solid #eee;
  272 + background-color: #f8f8f8;
  273 + border-radius: 6rpx;
  274 + box-sizing: border-box;
  275 + text-align: center;
  276 +}
  277 +
  278 +
  279 +.mask {
  280 + display: none;
  281 + position: fixed;
  282 + left: 0;
  283 + right: 0;
  284 + top: 0;
  285 + bottom: 0;
  286 + background-color: rgba(0,0,0,.5);
  287 + z-index: -1;
  288 +}
  289 +
  290 +.bsbb {
  291 + box-sizing: border-box;
  292 +}
  293 +
  294 +.l-red {
  295 + background-image: linear-gradient(-225deg, #FF6060, #FF6768);
  296 +}
  297 +
  298 +.bgf0 {
  299 + background-color: #f0f0f0;
  300 +}
  301 +
  302 +.filter::after {
  303 + content: '\e68a';
  304 + font-family: iconfont;
  305 +}
  306 +
  307 +.dropdown.show ~ .mask {
  308 + display: block;
  309 +}
  310 +
  311 +.input-price {
  312 + background-color: #f0f0f0;
  313 + border-radius: 30rpx;
  314 + height: 60rpx;
  315 +}
  316 +
  317 +.dropdown-wrapper {
  318 + max-height: 1000rpx;
  319 + overflow-y: auto;
  320 +}
  321 +
  322 +.label.selected {
  323 + color: #FF6768;
  324 + border: 2rpx solid #FF6768;
  325 +}
  326 +
  327 +.line_th {
  328 + text-decoration: line-through;
  329 +}
  330 +
  331 +
  332 +
... ...
packageA/pages/distribution/main/main.js 0 → 100644
  1 +// packageA//pages/distribution/main/main.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 +
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + self = this;//保存全局指针
  19 +
  20 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  21 + self.setData({
  22 + userInfo: data,
  23 + });
  24 + });
  25 +
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面初次渲染完成
  30 + */
  31 + onReady: function () {
  32 +
  33 + },
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面显示
  37 + */
  38 + onShow: function () {
  39 + console.log('onshow');
  40 + let url = '/api/weshop/users/distribut/getMoney';
  41 + if(app.globalData.userInfo) {
  42 + if(!this.data.isLogin) {
  43 + this.setData({
  44 + userInfo: app.globalData.userInfo,
  45 + imghost: app.globalData.setting.imghost,
  46 + isLogin: true,
  47 + });
  48 +
  49 + // 请求数据
  50 + app.request.get(url + '/' + this.data.userInfo.store_id + '/' + this.data.userInfo.user_id, {
  51 + success: function(res) {
  52 + console.log('success~~`', self.data.userInfo);
  53 + if(res.data.code == 0){
  54 +
  55 + self.setData({
  56 + data: res.data.data,
  57 + });
  58 +
  59 + } else {
  60 + // if(!res.data.data.is_distribut) {//如果不是分销商:0不是,1是
  61 +
  62 + app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {
  63 + data: {
  64 + storeId: self.data.userInfo.store_id,
  65 + userId: self.data.userInfo.user_id,
  66 + first_leader: self.data.userInfo.first_leader,
  67 + },
  68 + isShowLoading: true,
  69 + }).then(function(res) {
  70 + console.log('!!!===>', res);
  71 + self.setData({
  72 + fenxiao: res.data.data,
  73 + });
  74 + });
  75 +
  76 + // };
  77 + };
  78 + },
  79 +
  80 + });
  81 +
  82 +
  83 + };
  84 + };
  85 +
  86 +
  87 + },
  88 +
  89 + /**
  90 + * 生命周期函数--监听页面隐藏
  91 + */
  92 + onHide: function () {
  93 +
  94 + },
  95 +
  96 + /**
  97 + * 生命周期函数--监听页面卸载
  98 + */
  99 + onUnload: function () {
  100 +
  101 + },
  102 +
  103 + /**
  104 + * 页面相关事件处理函数--监听用户下拉动作
  105 + */
  106 + onPullDownRefresh: function () {
  107 +
  108 + },
  109 +
  110 + /**
  111 + * 页面上拉触底事件的处理函数
  112 + */
  113 + onReachBottom: function () {
  114 +
  115 + },
  116 +
  117 + /**
  118 + * 用户点击右上角分享
  119 + */
  120 + onShareAppMessage: function () {
  121 +
  122 + },
  123 +
  124 + /**
  125 + * 点击跳转
  126 + */
  127 + goto(e) {
  128 + let url = '';
  129 + if(e.target.dataset.url) {
  130 + url = e.target.dataset.url;
  131 + } else {
  132 + url = e.currentTarget.dataset.url;
  133 + }
  134 + console.log(url);
  135 + app.goto(url);
  136 + },
  137 +
  138 +
  139 +
  140 + /**
  141 + * 获取输入框
  142 + */
  143 + getInput(e) {
  144 + this.setData({
  145 + inputValue: e.detail.value,
  146 + });
  147 + },
  148 +
  149 +
  150 + /**
  151 + * 验证
  152 + */
  153 + verify(e) {
  154 + let pass = e.target.dataset.pass;
  155 + let mobile = 0;
  156 + if(this.data.inputValue) {
  157 + mobile = this.data.inputValue;
  158 + if(!pass) {
  159 + app.request.put('/api/weshop/users/distribut/updateUserRecommender', {
  160 + data: {
  161 + storeId: self.data.userInfo.store_id,
  162 + userId: self.data.userInfo.user_id,
  163 + mobile: mobile,
  164 + },
  165 + success: function (res) {
  166 + if(res.code = -1) {
  167 + wx.showToast({
  168 + title: res.data.msg,
  169 + icon: 'none',
  170 + duration: 2000
  171 + });
  172 + };
  173 + console.log('!!!===>', res);
  174 +
  175 + if(res.data.msg == '绑定上下级关系成功!') {
  176 + app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {
  177 + data: {
  178 + storeId: self.data.userInfo.store_id,
  179 + userId: self.data.userInfo.user_id,
  180 + first_leader: self.data.userInfo.first_leader,
  181 + },
  182 + isShowLoading: true,
  183 + }).then(function(res) {
  184 + console.log('!!!===>', res);
  185 + self.setData({
  186 + fenxiao: res.data.data,
  187 + });
  188 + });
  189 + };
  190 +
  191 + }
  192 + });
  193 +
  194 + }
  195 + } else {
  196 + wx.showToast({
  197 + title: '手机号码不能为空',
  198 + icon: 'none',
  199 + duration: 2000
  200 + });
  201 + };
  202 +
  203 + },
  204 +})
0 205 \ No newline at end of file
... ...
packageA/pages/distribution/main/main.json 0 → 100644
  1 +{
  2 + "usingComponents": {},
  3 + "navigationBarTitleText": "我的分销",
  4 + "enablePullDownRefresh": false
  5 +}
0 6 \ No newline at end of file
... ...
packageA/pages/distribution/main/main.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<view class="main">
  3 + <!-- 头像 -->
  4 + <view class="avatar-container t-c pdv40">
  5 + <view class="pdb20">
  6 + <image class="avatar" src="{{userInfo.head_pic}}"/>
  7 + </view>
  8 + <view class="fs26"><text class="nickname">{{filter.show_default(userInfo.nickname)}}</text></view>
  9 + </view>
  10 + <!-- 金额 -->
  11 + <view>
  12 + <view class="flex ai-center jc_sb pd2622 bdb arrow-r" bindtap="goto">
  13 + <view><text class="iconfont icon-jine pdr10 ctb"></text>可提现金额</view>
  14 + <view class="ctb money" data-url="/pages/user/member/menber">{{filter.show_default(data.liudong_money)}}</view>
  15 + </view>
  16 +
  17 + <view class="flex jc_sa t-c">
  18 + <view class="pd20 f1">
  19 + <view class="money fs40">{{filter.show_default(data.today_money)}}</view>
  20 + <view class="fs24 pdt10 cb">今日收入</view>
  21 + </view>
  22 + <view class="pd20 f1">
  23 + <view class="money fs40">{{filter.show_default(data.sales_volume)}}</view>
  24 + <view class="fs24 pdt10 cb">总销售额</view>
  25 + </view>
  26 + <view class="pd20 f1">
  27 + <view class="money fs40">{{filter.show_default(data.distribut_money)}}</view>
  28 + <view class="fs24 pdt10 cb">累计佣金</view>
  29 + </view>
  30 + </view>
  31 + </view>
  32 + <!-- 商品 -->
  33 + <view class="flex t-c mgv20 fs30" bindtap="goto">
  34 + <view class="f1 pd20 line" data-url="/packageA/pages/distribution/goods/goods?index=0"><text class="iconfont icon-shangjia pdr10 cf79"></text>上架商品</view>
  35 + <view class="f1 pd20" data-url="/packageA/pages/distribution/goods/goods?index=1"><text class="iconfont icon-xiajia pdr10 c29f"></text>下架商品</view>
  36 + </view>
  37 + <!-- 图标列表 -->
  38 + <view class="flex wrap pdv20">
  39 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/order/order">
  40 + <view class="circle bgBlue"><text class="iconfont icon-order fs40"></text></view>
  41 + <view class="fs24 pdt10">分销订单</view>
  42 + </view>
  43 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/rank/rank">
  44 + <view class="circle bgRed"><text class="iconfont icon-paihangbang fs40"></text></view>
  45 + <view class="fs24 pdt10">分销排行</view>
  46 + </view>
  47 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/myteam/myteam">
  48 + <view class="circle bgPink"><text class="iconfont icon-tuandui fs40"></text></view>
  49 + <view class="fs24 pdt10">我的团队</view>
  50 + </view>
  51 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/commision/commision">
  52 + <view class="circle bgRed"><text class="iconfont icon-yongjin fs40"></text></view>
  53 + <view class="fs24 pdt10">佣金明细</view>
  54 + </view>
  55 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/card/card">
  56 + <view class="circle bgPurple"><text class="iconfont icon-mingpian fs40"></text></view>
  57 + <view class="fs24 pdt10">我的名片</view>
  58 + </view>
  59 + <view class="pd20 t-c w25">
  60 + <view class="circle bgYellow" bindtap="goto" data-url="/pages/user/index/index"><text class="iconfont icon-huiyuan fs40"></text></view>
  61 + <view class="fs24 pdt10">会员中心</view>
  62 + </view>
  63 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/shop/shop">
  64 + <view class="circle bgBlue"><text class="iconfont icon-shop fs40"></text></view>
  65 + <view class="fs24 pdt10">我的小店</view>
  66 + </view>
  67 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/rookie/rookie">
  68 + <view class="circle bgGreen"><text class="iconfont icon-xinshouyindao fs40"></text></view>
  69 + <view class="fs24 pdt10">新手必看</view>
  70 + </view>
  71 + </view>
  72 + <!-- 分销商验证 -->
  73 + <!-- <view class="popup" wx:if="{{!1}}"> -->
  74 + <view class="popup" wx:if="{{!data.is_distribut}}">
  75 + <view class="t-c pd20 title">分销规则说明<text class="iconfont icon-close" bindtap="goto" data-url="/pages/user/index/index"></text></view>
  76 + <!-- <view class="t-c pd20 title">分销规则说明</view> -->
  77 + <view wx:if="{{fenxiao}}">
  78 + <block wx:for="{{fenxiao}}">
  79 + <view class="item" wx:if="{{item.type == 1}}">
  80 + <view class="left f1">
  81 + <view class="icon-container"><text class="iconfont icon-huiyuan1"></text></view>
  82 + <view>仅限PLUS卡({{item.conditonRemark}})的会员, <text class="c-red" bindtap="goto" data-url="/pages/user/cardinfo/cardinfo">立即升级</text></view>
  83 + </view>
  84 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  85 + </view>
  86 + <view class="item" wx:if="{{item.type == 2}}">
  87 + <view class="left f1">
  88 + <view class="icon-container"><text class="iconfont icon-renzheng"></text></view>
  89 + <view class="flex ali-c">
  90 + <input class="bg-f0 pdh10 input" type="number" value="{{item.inviter ? item.inviter:''}}" placeholder="请输入推荐人手机号码" disabled="{{item.pass}}" bindinput="getInput"/>
  91 + <view class="verify" wx:if="{{!item.pass}}" bindtap="verify" data-pass="{{item.pass}}">验证</view>
  92 + </view>
  93 + </view>
  94 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  95 + </view>
  96 + <view class="item" wx:if="{{item.type == 3}}">
  97 + <view class="left f1">
  98 + <view class="icon-container"><text class="iconfont icon-gouwu"></text></view>
  99 + <text>{{item.conditonRemark}}</text>
  100 + </view>
  101 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  102 + </view>
  103 + </block>
  104 + <view class="item" data-url="1">
  105 + <view class="left f1">
  106 + <view class="icon-container"><text class="iconfont icon-yongjin"></text></view>
  107 + <text>成功成为分销商,分享商品给好友即可获得相应收益</text>
  108 + </view>
  109 + </view>
  110 +
  111 + </view>
  112 + <view class="t-c pd20 fs30 bdt co-red bold" bindtap="goto" data-url="/pages/index/index/index">去购买</view>
  113 + <!-- <view class="t-c pd20 fs30 bdt co-red bold">确定</view> -->
  114 + </view>
  115 + <!-- 遮罩 -->
  116 + <!-- <view class="mask" wx:if="{{!1}}"></view> -->
  117 + <view class="mask" wx:if="{{!data.is_distribut}}"></view>
  118 +</view>
  119 +
... ...
packageA/pages/distribution/main/main.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.main > view {
  6 + background-color: white;
  7 +}
  8 +
  9 +.avatar-container {
  10 + padding-top: 60rpx;
  11 + padding-bottom: 60rpx;
  12 + background: url(https://mshopimg.yolipai.net/miniapp/images/user_index_powder.jpg) no-repeat 100% 100%;
  13 + /* background-size: 100%; */
  14 +}
  15 +
  16 +.avatar {
  17 + width: 160rpx;
  18 + height: 160rpx;
  19 + border-radius: 50%;
  20 + background-color: #eee;
  21 +}
  22 +
  23 +.nickname {
  24 + display: inline-block;
  25 + background-color: rgba(0,0,0,.5);
  26 + padding: 4rpx 20rpx;
  27 + color: white;
  28 + border-radius: 24rpx;
  29 +}
  30 +
  31 +.pd2622 {
  32 + padding: 20rpx 60rpx 20rpx 20rpx;
  33 +}
  34 +
  35 +.money::before {
  36 + content: '¥';
  37 + font-size: 24rpx;
  38 +}
  39 +
  40 +/* .bdb {
  41 + border-bottom: 2rpx solid #f8f8f8;
  42 +} */
  43 +
  44 +.arrow-r {
  45 + /* display: relative; */
  46 +}
  47 +
  48 +.arrow-r::after {
  49 + font-family: iconfont;
  50 + content: '\e61f';
  51 + position: absolute;
  52 + right: 20rpx;
  53 + color: #ddd;
  54 +}
  55 +.line {
  56 + position: relative;
  57 +}
  58 +.line::after {
  59 + content: '';
  60 + position: absolute;
  61 + right: 0;
  62 + background-color: #f8f8f8;
  63 + width: 2rpx;
  64 + height: 30rpx;
  65 + top: 50%;
  66 + transform: translateY(-50%);
  67 +}
  68 +
  69 +.circle {
  70 + width: 80rpx;
  71 + height: 80rpx;
  72 + line-height: 80rpx;
  73 + border-radius: 50%;
  74 + color: white;
  75 + margin: 0 auto;
  76 + background-color: red;
  77 +}
  78 +
  79 +.fs40 {
  80 + font-size: 40rpx;
  81 +}
  82 +
  83 +
  84 +.bgBlue {
  85 + background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%);
  86 +}
  87 +.bgPink {
  88 + background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);
  89 +}
  90 +.bgRed {
  91 + background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);
  92 +}
  93 +.bgYellow {
  94 + background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
  95 +}
  96 +.bgGreen {
  97 + background-image: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
  98 +}
  99 +.bgPurple {
  100 + background-image: linear-gradient(to top, #9795f0 0%, #fbc8d4 100%);
  101 +}
  102 +
  103 +.mask {
  104 + position: fixed;
  105 + top: 0;
  106 + left: 0;
  107 + width: 100%;
  108 + height: 100%;
  109 + background-color: rgba(0,0,0,.5) !important;
  110 +}
  111 +
  112 +.popup {
  113 + position: fixed;
  114 + z-index: 1;
  115 + top: 50%;
  116 + left: 50%;
  117 + transform: translate(-50%, -50%);
  118 + width: 90%;
  119 + border-radius: 12rpx;
  120 + overflow: hidden;
  121 +}
  122 +
  123 +.icon-container {
  124 + border-radius: 50%;
  125 + background-color: #FCEA0D;
  126 + width: 50rpx;
  127 + line-height: 50rpx;
  128 + height: 50rpx;
  129 + text-align: center;
  130 + font-size: 28rpx !important;
  131 + margin-right: 10rpx;
  132 + flex-shrink: 0;
  133 +}
  134 +
  135 +.item {
  136 + padding: 20rpx;
  137 + display: flex;
  138 + align-items: center;
  139 + font-size: 26rpx;
  140 + position: relative;
  141 +}
  142 +
  143 +.title {
  144 + background-image: linear-gradient( 135deg, #FF6768 10%, #EA5455 100%);
  145 + color: white;
  146 + font-size: 28rpx;
  147 + position: relative;
  148 +}
  149 +
  150 +.icon-close {
  151 + position: absolute;
  152 + right: 20rpx;
  153 + color: white;
  154 +}
  155 +
  156 +.verify {
  157 + color: white;
  158 + background-color: #FF6768;
  159 + padding: 0 20rpx;
  160 + border-radius: 6rpx;
  161 + display: flex;
  162 + align-items: center;
  163 + margin-left: 10rpx;
  164 +}
  165 +
  166 +.input {
  167 + border-radius: 6rpx;
  168 + height: 50rpx;
  169 +}
  170 +
  171 +.item ~ .item .left::before {
  172 + content: '';
  173 + position: absolute;
  174 + left: 45rpx;
  175 + top: -45rpx;
  176 + width: 2rpx;
  177 + height: 100%;
  178 + background: linear-gradient(to bottom, #eee, #eee 8rpx, transparent 8rpx, transparent);
  179 + background-size: 100% 16rpx;
  180 + z-index: -1;
  181 +}
  182 +
  183 +.left {
  184 + display: flex;
  185 + align-items: center;
  186 + padding-right: 20rpx;
  187 +}
  188 +
  189 +
  190 +/*checkbox 整体大小 */
  191 +checkbox {
  192 + /* width: 240rpx;
  193 + height: 90rpx; */
  194 +}
  195 +/*checkbox 选项框大小 */
  196 +checkbox .wx-checkbox-input {
  197 + width: 34rpx;
  198 + height: 34rpx;
  199 + border-radius: 50%;
  200 +
  201 +}
  202 +/*checkbox选中后样式 */
  203 +checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  204 + background-color: #FF6768;
  205 + border-color: #FF6768;
  206 + /* color: white; */
  207 +}
  208 +/*checkbox选中后图标样式 */
  209 +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  210 + width: 34rpx;
  211 + height: 34rpx;
  212 + line-height: 34rpx;
  213 + text-align: center;
  214 + font-size: 24rpx;
  215 + color: #fff;
  216 + background: transparent;
  217 + transform: translate(-50%, -50%) scale(1);
  218 + -webkit-transform: translate(-50%, -50%) scale(1);
  219 +}
  220 +
  221 +.item:not(:last-of-type) {
  222 + display: flex;
  223 + justify-content: space-between;
  224 +}
  225 +
  226 +
... ...
packageA/pages/distribution/myteam/myteam.js 0 → 100644
  1 +// packageA//pages/distribution/myteam/myteam.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + tabArr: ['A级分销','B级分销','C级分销'],
  12 + currentTabIndex: 0, //记录当前点击的Tab索引
  13 +
  14 + list: null,
  15 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  16 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  17 + pageNum: 1, // 当前页数
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面加载
  22 + */
  23 + onLoad: function (options) {
  24 + self = this;//保存全局指针
  25 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  26 + self.setData({
  27 + userInfo: data,
  28 + });
  29 + });
  30 + // 判断会员是否授权登录,
  31 + // 没有登录则跳转到登录页,
  32 + // 已登录则设置已登录状态,请求加载签到数据
  33 + // isLogin记录登录状态
  34 + // app.isLogin().then(function(data) {
  35 + // console.log('data', data);
  36 + // // 1.登录成功
  37 + // self.setData({
  38 + // isLogin: true,
  39 + // userInfo: data,
  40 + // });
  41 + // // 2.请求数据
  42 + // // 默认请求A级分销
  43 + // self.getData(true, '/api/weshop/users/distribut/teamlist', {
  44 + // store_id: app.globalData.setting.stoid,
  45 + // user_id: app.globalData.user_id,
  46 + // level: 1,
  47 + // });
  48 + // // 默认请求佣金用户排行
  49 + // // this.get('/api/weshop/users/distribut/rankingUser', {
  50 + // // store_id: app.globalData.setting.stoid,
  51 + // // user_id: app.globalData.user_id,
  52 + // // });
  53 +
  54 + // });
  55 + },
  56 +
  57 + /**
  58 + * 生命周期函数--监听页面初次渲染完成
  59 + */
  60 + onReady: function () {
  61 +
  62 + },
  63 +
  64 + /**
  65 + * 生命周期函数--监听页面显示
  66 + */
  67 + onShow: function () {
  68 + if(app.globalData.userInfo) {
  69 + if(!this.data.isLogin) {
  70 + this.setData({
  71 + userInfo: app.globalData.userInfo,
  72 + imghost: app.globalData.setting.imghost,
  73 + isLogin: true,
  74 + });
  75 +
  76 + // 请求数据
  77 + // 默认请求A级分销
  78 + this.getData(true, '/api/weshop/users/distribut/teamlist', {
  79 + store_id: app.globalData.setting.stoid,
  80 + user_id: app.globalData.user_id,
  81 + level: 1,
  82 + });
  83 +
  84 + };
  85 + };
  86 +
  87 +
  88 + // if(app.globalData.userInfo instanceof Object) {
  89 + // this.setData({
  90 + // userInfo: app.globalData.userInfo,
  91 + // imghost: app.globalData.setting.imghost,
  92 + // });
  93 + // // 检测从登录页返回后的登录状态
  94 + // if(this.data.isLogin) {
  95 + // // 初次就授权登录
  96 + // return;
  97 + // } else {
  98 + // // 初次未授权登录,过后才授权
  99 + // this.setData({
  100 + // isLogin: true
  101 + // });
  102 + // // 请求数据
  103 + // // 默认请求A级分销
  104 + // this.getData(true, '/api/weshop/users/distribut/teamlist', {
  105 + // store_id: app.globalData.setting.stoid,
  106 + // user_id: app.globalData.user_id,
  107 + // level: 1,
  108 + // });
  109 + // // 默认请求佣金用户排行
  110 + // // this.get('/api/weshop/users/distribut/rankingUser', {
  111 + // // store_id: app.globalData.setting.stoid,
  112 + // // user_id: app.globalData.user_id,
  113 + // // });
  114 + // };
  115 + // };
  116 + },
  117 +
  118 + /**
  119 + * 生命周期函数--监听页面隐藏
  120 + */
  121 + onHide: function () {
  122 +
  123 + },
  124 +
  125 + /**
  126 + * 生命周期函数--监听页面卸载
  127 + */
  128 + onUnload: function () {
  129 +
  130 + },
  131 +
  132 + /**
  133 + * 页面相关事件处理函数--监听用户下拉动作
  134 + */
  135 + onPullDownRefresh: function () {
  136 +
  137 + },
  138 +
  139 + /**
  140 + * 页面上拉触底事件的处理函数
  141 + */
  142 + onReachBottom: function () {
  143 + this.scrollToLower('/api/weshop/users/distribut/teamlist', {
  144 + store_id: app.globalData.setting.stoid,
  145 + user_id: app.globalData.user_id,
  146 + level: currentIndex + 1,
  147 + });
  148 + },
  149 +
  150 + /**
  151 + * 用户点击右上角分享
  152 + */
  153 + onShareAppMessage: function () {
  154 +
  155 + },
  156 +
  157 + /**
  158 + * 点击Tab项
  159 + */
  160 + clickTab(e) {
  161 + let currentIndex = e.target.dataset.index;
  162 +
  163 + this.setData({
  164 + currentTabIndex: currentIndex,
  165 + list: null, //清空列表
  166 + noMore: false,
  167 + pageNum: 1,
  168 + });
  169 +
  170 + this.getData(true, '/api/weshop/users/distribut/teamlist', {
  171 + store_id: app.globalData.setting.stoid,
  172 + user_id: app.globalData.user_id,
  173 + level: currentIndex + 1,
  174 + });
  175 + },
  176 +
  177 + /**
  178 + * get请求数据
  179 + */
  180 + // get(url, data) {
  181 + // app.request.get(url + '/' + data.store_id + '/' + data.user_id, {
  182 + // success: function(res) {
  183 + // if(res.data.code == 0){
  184 + // console.log('success',res.data.data);
  185 + // self.setData({
  186 + // userRanking: res.data.data,
  187 + // });
  188 + // }else{
  189 + // wx.showToast({
  190 + // title: "网络繁忙,请重试",
  191 + // icon: 'none',
  192 + // duration: 2000
  193 + // })
  194 + // }
  195 + // },
  196 + // fail: function() {},
  197 + // });
  198 + // },
  199 +
  200 +
  201 + /**
  202 + * promiseGet请求数据
  203 + */
  204 + getData: function(isInit, url, data) {
  205 + app.request.promiseGet(url, {
  206 + data: data,
  207 + isShowLoading: true,
  208 + })
  209 + .then(function(res) {
  210 + // console.log('1121', res.data.code);
  211 + if(res.data.code == 0) {
  212 +
  213 + self.setData({
  214 + isLoading: false
  215 + });
  216 +
  217 + if(isInit) {// 第一次加载
  218 + self.setData({
  219 + list: res.data.data
  220 + });
  221 + } else {
  222 + self.setData({
  223 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  224 + });
  225 + };
  226 +
  227 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  228 + self.setData({
  229 + noMore: true
  230 + });
  231 + };
  232 +
  233 + } else {
  234 + self.setData({
  235 + 'list.pageData': []
  236 + });
  237 + };
  238 +
  239 + })
  240 + .catch(function(err) {
  241 + console.log('出错拉!!!!',err);
  242 + self.setData({
  243 + 'list.pageData': []
  244 + });
  245 + });
  246 + },
  247 +
  248 +
  249 + // 上拉加载
  250 + scrollToLower(url, requestData) {
  251 + // 数据总量
  252 + let total = this.data.list.total;
  253 + // 单页最大数据量
  254 + let pageSize = this.data.list.pageSize;
  255 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  256 + if((total != 0)&&(total <= pageSize)) {
  257 + this.setData({
  258 + noMore: true
  259 + });
  260 + };
  261 +
  262 + if(!this.data.isLoading && !this.data.noMore) {
  263 + this.setData({
  264 + isLoading: true,
  265 + pageNum: this.data.pageNum + 1
  266 + });
  267 + requestData.page = this.data.pageNum;
  268 + this.getData(false, url, requestData);
  269 + };
  270 + },
  271 +
  272 +})
0 273 \ No newline at end of file
... ...
packageA/pages/distribution/myteam/myteam.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "我的团队",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/myteam/myteam.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<view class="main">
  3 + <view class="tab-head flex t-c bdb fs26" bindtap="clickTab">
  4 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  5 + </view>
  6 +
  7 + <view class="tab-content">
  8 + <view class="flex jc_sb pd20 ai-center" wx:for="{{list.pageData}}">
  9 + <view class="flex ai-center">
  10 + <view class="pdr20"><image class="avatar" src="{{item.head_pic}}"/></view>
  11 + <view>
  12 + <view>{{item.nickname}}</view>
  13 + <view class="fs24 c-a">{{filter.format_time(item.reg_time)}}</view>
  14 + </view>
  15 + </view>
  16 + <view class="c-red fs26 money">{{item.distribut_money}}</view>
  17 + </view>
  18 +
  19 +
  20 + </view>
  21 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  22 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  23 +</view>
... ...
packageA/pages/distribution/myteam/myteam.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.main > view {
  6 + background-color: white;
  7 +}
  8 +
  9 +.active {
  10 + color: #FF6768;
  11 + font-weight: bold;
  12 + position: relative;
  13 +}
  14 +
  15 +.active::after {
  16 + content: '';
  17 + position: absolute;
  18 + bottom: 0;
  19 + left: 50%;
  20 + transform: translateX(-50%);
  21 + width: 50%;
  22 + height: 4rpx;
  23 + background-color: #FF6768;
  24 +}
  25 +
  26 +.avatar {
  27 + width: 120rpx;
  28 + height: 120rpx;
  29 + border-radius: 50%;
  30 + background-color: #eee;
  31 +}
  32 +
  33 +.c-a {
  34 + color: #aaa;
  35 +}
  36 +
  37 +.noMore {
  38 + padding: 20rpx;
  39 + color: #bbb;
  40 + text-align: center;
  41 + font-size: 26rpx;
  42 + background-color: transparent !important;
  43 +}
  44 +
  45 +.tab-head {
  46 + position: fixed;
  47 + width: 100%;
  48 + top: 0;
  49 +}
  50 +
  51 +.tab-content {
  52 + box-sizing: border-box;
  53 + padding-top: 76rpx;
  54 +}
  55 +
  56 +.money::before {
  57 + content: '¥';
  58 + font-size: 22rpx;
  59 +}
0 60 \ No newline at end of file
... ...
packageA/pages/distribution/order/order.js 0 → 100644
  1 +// packageA//pages/distribution/myteam/myteam.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + tabArr: ['未付款','已付款','已完成'],
  12 + statusArr: ['未付款','已付款','等待分成(已收货)','已完成'],
  13 + commisionArr: ['一级分成','二级分成','三级分成'],
  14 + currentTabIndex: 0, //记录当前点击的Tab索引
  15 + imghost: '',
  16 + status: 0,
  17 +
  18 + list: null,
  19 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  20 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  21 + pageNum: 1, // 当前页数
  22 + },
  23 +
  24 + /**
  25 + * 生命周期函数--监听页面加载
  26 + */
  27 + onLoad: function (options) {
  28 + self = this;//保存全局指针
  29 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  30 + self.setData({
  31 + userInfo: data,
  32 + });
  33 + });
  34 +
  35 + // 判断会员是否授权登录,
  36 + // 没有登录则跳转到登录页,
  37 + // 已登录则设置已登录状态,请求加载签到数据
  38 + // isLogin记录登录状态
  39 + // app.isLogin().then(function(data) {
  40 + // console.log('data', data);
  41 + // // 1.登录成功
  42 + // self.setData({
  43 + // isLogin: true,
  44 + // userInfo: data,
  45 + // });
  46 + // // 2.请求数据
  47 + // // status: 0=未付款 1=已付款 3=已完成, 默认加载0
  48 + // app.request.promiseGet('/api/weshop/rebateLog/pageOrder', {
  49 + // data: {
  50 + // store_id: app.globalData.setting.stoid,
  51 + // user_id: app.globalData.user_id,
  52 + // status: 0,
  53 + // },
  54 + // isShowLoading: true,
  55 + // }).then(function(res) {
  56 + // self.setData({
  57 + // list: res.data.data,
  58 + // });
  59 + // });
  60 + // });
  61 + },
  62 +
  63 + /**
  64 + * 生命周期函数--监听页面初次渲染完成
  65 + */
  66 + onReady: function () {
  67 +
  68 + },
  69 +
  70 + /**
  71 + * 生命周期函数--监听页面显示
  72 + */
  73 + onShow: function () {
  74 + if(app.globalData.userInfo) {
  75 + if(!this.data.isLogin) {
  76 + this.setData({
  77 + userInfo: app.globalData.userInfo,
  78 + imghost: app.globalData.setting.imghost,
  79 + isLogin: true,
  80 + });
  81 +
  82 + // 请求数据
  83 + app.request.promiseGet('/api/weshop/rebateLog/pageOrder', {
  84 + data: {
  85 + store_id: app.globalData.setting.stoid,
  86 + user_id: app.globalData.user_id,
  87 + status: 0,
  88 + },
  89 + isShowLoading: true,
  90 + }).then(function(res) {
  91 + self.setData({
  92 + list: res.data.data,
  93 + });
  94 + });
  95 +
  96 + };
  97 + };
  98 +
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 生命周期函数--监听页面隐藏
  104 + */
  105 + onHide: function () {
  106 +
  107 + },
  108 +
  109 + /**
  110 + * 生命周期函数--监听页面卸载
  111 + */
  112 + onUnload: function () {
  113 +
  114 + },
  115 +
  116 + /**
  117 + * 页面相关事件处理函数--监听用户下拉动作
  118 + */
  119 + onPullDownRefresh: function () {
  120 +
  121 + },
  122 +
  123 + /**
  124 + * 页面上拉触底事件的处理函数
  125 + */
  126 + onReachBottom: function () {
  127 + this.scrollToLower('/api/weshop/rebateLog/pageOrder', {
  128 + store_id: app.globalData.setting.stoid,
  129 + user_id: app.globalData.user_id,
  130 + status: this.data.status,
  131 + });
  132 + },
  133 +
  134 + /**
  135 + * 用户点击右上角分享
  136 + */
  137 + onShareAppMessage: function () {
  138 +
  139 + },
  140 +
  141 + /**
  142 + * 点击跳转
  143 + */
  144 + goto(e) {
  145 + let url = '';
  146 + if(e.target.dataset.url) {
  147 + url = e.target.dataset.url;
  148 + } else {
  149 + url = e.currentTarget.dataset.url;
  150 + }
  151 + app.goto(url);
  152 + },
  153 +
  154 + /**
  155 + * 点击Tab项
  156 + */
  157 + clickTab(e) {
  158 + if(this.data.isLogin) {
  159 +
  160 + let status = 0;
  161 + let currentIndex = e.target.dataset.index;
  162 +
  163 + switch(currentIndex) {
  164 + case 0: {
  165 + status = 0;
  166 + break;
  167 + };
  168 + case 1: {
  169 + status = 1;
  170 + break;
  171 + };
  172 + case 2: {
  173 + status = 3;
  174 + break;
  175 + };
  176 + };
  177 +
  178 + this.setData({
  179 + list: null, //清空列表
  180 + noMore: false,
  181 + pageNum: 1,
  182 + currentTabIndex: currentIndex,
  183 + status,
  184 + });
  185 +
  186 + app.request.promiseGet('/api/weshop/rebateLog/pageOrder', {
  187 + data: {
  188 + store_id: app.globalData.setting.stoid,
  189 + user_id: app.globalData.user_id,
  190 + status,
  191 + },
  192 + isShowLoading: true,
  193 + }).then(function(res) {
  194 + self.setData({
  195 + list: res.data.data,
  196 + });
  197 + });
  198 +
  199 + }
  200 +
  201 + },
  202 +
  203 + /**
  204 + * 请求数据
  205 + */
  206 + getData: function(isInit, url, data) {
  207 + app.request.promiseGet(url, {
  208 + data: data,
  209 + isShowLoading: true,
  210 + })
  211 + .then(function(res) {
  212 + // console.log('1121', res.data.code);
  213 + if(res.data.code == 0) {
  214 +
  215 + self.setData({
  216 + isLoading: false
  217 + });
  218 +
  219 + if(isInit) {// 第一次加载
  220 + self.setData({
  221 + list: res.data.data
  222 + });
  223 + } else {
  224 + self.setData({
  225 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  226 + });
  227 + };
  228 +
  229 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  230 + self.setData({
  231 + noMore: true
  232 + });
  233 + };
  234 +
  235 + } else {
  236 + self.setData({
  237 + 'list.pageData': []
  238 + });
  239 + };
  240 +
  241 + })
  242 + .catch(function(err) {
  243 + console.log('出错拉!!!!',err);
  244 + self.setData({
  245 + 'list.pageData': []
  246 + });
  247 + });
  248 + },
  249 +
  250 +
  251 + // 上拉加载
  252 + scrollToLower(url, requestData) {
  253 + // 数据总量
  254 + let total = this.data.list.total;
  255 + // 单页最大数据量
  256 + let pageSize = this.data.list.pageSize;
  257 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  258 + if((total != 0)&&(total <= pageSize)) {
  259 + this.setData({
  260 + noMore: true
  261 + });
  262 + };
  263 +
  264 + if(!this.data.isLoading && !this.data.noMore) {
  265 + this.setData({
  266 + isLoading: true,
  267 + pageNum: this.data.pageNum + 1
  268 + });
  269 + requestData.page = this.data.pageNum;
  270 + this.getData(false, url, requestData);
  271 + };
  272 + },
  273 +
  274 +
  275 +})
0 276 \ No newline at end of file
... ...
packageA/pages/distribution/order/order.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "分销订单",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/order/order.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<view class="main">
  3 + <view class="tab-head flex t-c bdb fs26" bindtap="clickTab">
  4 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" data-index="{{index}}">{{item}}</view>
  5 + </view>
  6 +
  7 + <view class="tab-content">
  8 + <view class="fs26 item" wx:for="{{list.pageData}}">
  9 + <view class="flex ai-center jc_sb pd20 bdb">
  10 + <view class="flex ai-center">
  11 + <image class="avatar" src="{{item.head_pic}}" wx:if="{{item.head_pic}}"/>
  12 + <text class="iconfont icon-ren" wx:else></text>
  13 + <text class="pdl10">{{item.nickname}}</text>
  14 + </view>
  15 + <view class="c-a">{{filter.status(item.status, statusArr)}}</view>
  16 + </view>
  17 + <view class="flex jc_sb ai-center pd20" wx:for="{{item.goods}}" wx:for-item="it" bindtap="goto" data-url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id' + item.goods}}">
  18 + <view class="flex pdr20">
  19 + <view class="pdr20"><image class="img" src="{{imghost + it.original_img}}" lazy-load/></view>
  20 + <view class="fs24">
  21 + <view class="ellipsis-2">{{it.goods_name}}</view>
  22 + <view class="c-a pdt20">规格:<text style="color: black;">{{it.goods_price}}</text></view>
  23 + <view wx:if="{{item.dis_moshi == 1}}">
  24 + <view class="c-a pdr10">最新佣金比例:<text class="c-red">{{filter.toFix(it.commission/it.goods_price*100, 1)}}%</text></view>
  25 + <view class="c-a">佣金:<text class="money c-red">{{it.commission}}</text></view>
  26 + </view>
  27 + <view class="c-a pdt10" wx:else>{{filter.status((item.level-1), commisionArr)}}:<text class="money c-red">{{it.commission}}</text></view>
  28 + </view>
  29 + </view>
  30 + <view><text class="money c-red">{{it.goods_price}}</text></view>
  31 + </view>
  32 + <view class="flex jc_sb pd20 ai-center fs24 bdt">
  33 + <view>
  34 + <view><text class="c-a">订单号:</text>{{item.order_sn}}</view>
  35 + <view class="c-a fs24 pdt10">{{filter.format_time(item.create_time, 1)}}</view>
  36 + </view>
  37 + <view class="c-red">获得分成:<text class="money fs32">{{item.money}}</text></view>
  38 + </view>
  39 + </view>
  40 + </view>
  41 +
  42 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  43 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  44 +</view>
... ...
packageA/pages/distribution/order/order.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.main > view {
  6 + /* background-color: white; */
  7 +}
  8 +
  9 +.active {
  10 + color: #FF6768;
  11 + font-weight: bold;
  12 + position: relative;
  13 +}
  14 +
  15 +.active::after {
  16 + content: '';
  17 + position: absolute;
  18 + bottom: 0;
  19 + left: 50%;
  20 + transform: translateX(-50%);
  21 + width: 50%;
  22 + height: 4rpx;
  23 + background-color: #FF6768;
  24 +}
  25 +
  26 +.avatar {
  27 + display: block;
  28 + width: 60rpx;
  29 + height: 60rpx;
  30 + background-color: #eee;
  31 + border-radius: 50%;
  32 +}
  33 +
  34 +.img {
  35 + display: block;
  36 + width: 200rpx;
  37 + height: 200rpx;
  38 + background-color: #eee;
  39 +}
  40 +
  41 +
  42 +
  43 +
  44 +
  45 +.money::before {
  46 + content: '¥';
  47 + font-size: 22rpx;
  48 +}
  49 +
  50 +.noMore {
  51 + padding: 20rpx;
  52 + color: #bbb;
  53 + text-align: center;
  54 + font-size: 26rpx;
  55 + background-color: transparent !important;
  56 +}
  57 +
  58 +.tab-head {
  59 + position: fixed;
  60 + width: 100%;
  61 + top: 0;
  62 +}
  63 +
  64 +.tab-content {
  65 + box-sizing: border-box;
  66 + padding: 96rpx 20rpx 20rpx 20rpx;
  67 +}
  68 +
  69 +.tab-head,
  70 +.item {
  71 + background-color: white;
  72 +}
  73 +
  74 +.item {
  75 + border-radius: 12rpx;
  76 +}
  77 +
  78 +.item ~ .item {
  79 + margin-top: 20rpx;
  80 +}
  81 +
  82 +.icon-ren {
  83 + font-size: 60rpx;
  84 + line-height: 60rpx;
  85 + color: #ccc;
  86 +}
0 87 \ No newline at end of file
... ...
packageA/pages/distribution/rank/rank.js 0 → 100644
  1 +// packageA//pages/distribution/rank/rank.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + currentTabIndex:0,
  12 + tabArr:['佣金排行','下线排行'],
  13 +
  14 + list: null,
  15 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  16 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  17 + pageNum: 1, // 当前页数
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面加载
  22 + */
  23 + onLoad: function (options) {
  24 + self = this;//保存全局指针
  25 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  26 + self.setData({
  27 + userInfo: data,
  28 + });
  29 + });
  30 + // 判断会员是否授权登录,
  31 + // 没有登录则跳转到登录页,
  32 + // 已登录则设置已登录状态,请求加载签到数据
  33 + // isLogin记录登录状态
  34 + // app.isLogin().then(function(data) {
  35 + // console.log('data', data);
  36 + // // 1.登录成功
  37 + // self.setData({
  38 + // isLogin: true,
  39 + // userInfo: data,
  40 + // });
  41 + // // 2.请求数据
  42 + // // 默认请求佣金排行列表
  43 + // self.getData(true, '/api/weshop/users/distribut/rankinglist', {
  44 + // store_id: app.globalData.setting.stoid,
  45 + // });
  46 + // // 默认请求佣金用户排行
  47 + // self.get('/api/weshop/users/distribut/rankingUser', {
  48 + // store_id: app.globalData.setting.stoid,
  49 + // user_id: app.globalData.user_id,
  50 + // });
  51 +
  52 + // });
  53 + },
  54 +
  55 + /**
  56 + * 生命周期函数--监听页面初次渲染完成
  57 + */
  58 + onReady: function () {
  59 +
  60 + },
  61 +
  62 + /**
  63 + * 生命周期函数--监听页面显示
  64 + */
  65 + onShow: function () {
  66 + if(app.globalData.userInfo) {
  67 + if(!this.data.isLogin) {
  68 + this.setData({
  69 + userInfo: app.globalData.userInfo,
  70 + imghost: app.globalData.setting.imghost,
  71 + isLogin: true,
  72 + });
  73 +
  74 + // 请求数据
  75 + // 默认请求佣金排行列表
  76 + this.getData(true, '/api/weshop/users/distribut/rankinglist', {
  77 + store_id: app.globalData.setting.stoid,
  78 + });
  79 + // 默认请求佣金用户排行
  80 + this.get('/api/weshop/users/distribut/rankingUser', {
  81 + store_id: app.globalData.setting.stoid,
  82 + user_id: app.globalData.user_id,
  83 + });
  84 +
  85 + };
  86 + };
  87 +
  88 +
  89 + // if(app.globalData.userInfo instanceof Object) {
  90 + // this.setData({
  91 + // userInfo: app.globalData.userInfo,
  92 + // imghost: app.globalData.setting.imghost,
  93 + // });
  94 + // // 检测从登录页返回后的登录状态
  95 + // if(this.data.isLogin) {
  96 + // // 初次就授权登录
  97 + // return;
  98 + // } else {
  99 + // // 初次未授权登录,过后才授权
  100 + // this.setData({
  101 + // isLogin: true
  102 + // });
  103 + // // 请求数据
  104 + // // 默认请求佣金排行列表
  105 + // this.getData(true, '/api/weshop/users/distribut/rankinglist', {
  106 + // store_id: app.globalData.setting.stoid,
  107 + // });
  108 + // // 默认请求佣金用户排行
  109 + // this.get('/api/weshop/users/distribut/rankingUser', {
  110 + // store_id: app.globalData.setting.stoid,
  111 + // user_id: app.globalData.user_id,
  112 + // });
  113 + // };
  114 + // };
  115 + },
  116 +
  117 + /**
  118 + * 生命周期函数--监听页面隐藏
  119 + */
  120 + onHide: function () {
  121 +
  122 + },
  123 +
  124 + /**
  125 + * 生命周期函数--监听页面卸载
  126 + */
  127 + onUnload: function () {
  128 +
  129 + },
  130 +
  131 + /**
  132 + * 页面相关事件处理函数--监听用户下拉动作
  133 + */
  134 + onPullDownRefresh: function () {
  135 +
  136 + },
  137 +
  138 + /**
  139 + * 页面上拉触底事件的处理函数
  140 + */
  141 + onReachBottom: function () {
  142 + this.scrollToLower(this.data.listUrl, {
  143 + store_id: app.globalData.setting.stoid,
  144 + });
  145 + },
  146 +
  147 + /**
  148 + * 用户点击右上角分享
  149 + */
  150 + onShareAppMessage: function () {
  151 +
  152 + },
  153 +
  154 + /**
  155 + * 点击Tab
  156 + */
  157 + clickTab(e) {
  158 + let currentIndex = e.target.dataset.index;
  159 + let listUrl = '';//排行列表
  160 + let userUrl = '';//用户当前排名
  161 +
  162 +
  163 + if(currentIndex == 0) {
  164 + listUrl = '/api/weshop/users/distribut/rankinglist';
  165 + userUrl = '/api/weshop/users/distribut/rankingUser';
  166 + } else {
  167 + listUrl = '/api/weshop/users/distribut/underlinglist';
  168 + userUrl = '/api/weshop/users/distribut/underlingUser';
  169 + };
  170 +
  171 + this.setData({
  172 + list: null, //清空列表
  173 + noMore: false,
  174 + pageNum: 1,
  175 + currentTabIndex: currentIndex,
  176 + listUrl,
  177 + userUrl,
  178 + });
  179 +
  180 + // 请求排行列表
  181 + this.getData(true, listUrl, {
  182 + store_id: app.globalData.setting.stoid,
  183 + });
  184 +
  185 + // 请求用户排行
  186 + this.get(userUrl, {
  187 + store_id: app.globalData.setting.stoid,
  188 + user_id: app.globalData.user_id,
  189 + });
  190 + },
  191 +
  192 +
  193 + /**
  194 + * get请求数据
  195 + */
  196 + get(url, data) {
  197 + app.request.get(url + '/' + data.store_id + '/' + data.user_id, {
  198 + success: function(res) {
  199 + if(res.data.code == 0){
  200 + console.log('success',res.data.data);
  201 + self.setData({
  202 + userRanking: res.data.data,
  203 + });
  204 + }else{
  205 + wx.showToast({
  206 + title: "网络繁忙,请重试",
  207 + icon: 'none',
  208 + duration: 2000
  209 + })
  210 + }
  211 + },
  212 + fail: function() {},
  213 + });
  214 + },
  215 +
  216 +
  217 + /**
  218 + * promiseGet请求数据
  219 + */
  220 + getData: function(isInit, url, data) {
  221 + app.request.promiseGet(url, {
  222 + data: data,
  223 + isShowLoading: true,
  224 + })
  225 + .then(function(res) {
  226 + // console.log('1121', res.data.code);
  227 + if(res.data.code == 0) {
  228 +
  229 + self.setData({
  230 + isLoading: false
  231 + });
  232 +
  233 + if(isInit) {// 第一次加载
  234 + self.setData({
  235 + list: res.data.data
  236 + });
  237 + } else {
  238 + self.setData({
  239 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  240 + });
  241 + };
  242 +
  243 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  244 + self.setData({
  245 + noMore: true
  246 + });
  247 + };
  248 +
  249 + } else {
  250 + self.setData({
  251 + 'list.pageData': []
  252 + });
  253 + };
  254 +
  255 + })
  256 + .catch(function(err) {
  257 + console.log('出错拉!!!!',err);
  258 + self.setData({
  259 + 'list.pageData': []
  260 + });
  261 + });
  262 + },
  263 +
  264 +
  265 + // 上拉加载
  266 + scrollToLower(url, requestData) {
  267 + // 数据总量
  268 + let total = this.data.list.total;
  269 + // 单页最大数据量
  270 + let pageSize = this.data.list.pageSize;
  271 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  272 + if((total != 0)&&(total <= pageSize)) {
  273 + this.setData({
  274 + noMore: true
  275 + });
  276 + };
  277 +
  278 + if(!this.data.isLoading && !this.data.noMore) {
  279 + this.setData({
  280 + isLoading: true,
  281 + pageNum: this.data.pageNum + 1
  282 + });
  283 + requestData.page = this.data.pageNum;
  284 + this.getData(false, url, requestData);
  285 + };
  286 + },
  287 +})
0 288 \ No newline at end of file
... ...
packageA/pages/distribution/rank/rank.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "分销排行榜",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/rank/rank.wxml 0 → 100644
  1 +<view>
  2 + <view>
  3 + <view class="flex jc_sb pd bg-red ai-center">
  4 + <view>
  5 + <view class="t1">排行榜</view>
  6 + <view class="t2 pdt10 pdr40" wx:if="{{userRanking.rownum == 1}}">恭喜您当前排名第一!</view>
  7 + <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.mindistribut_money}}">您距离前一名还差<text class="money">{{userRanking.mindistribut_money - userRanking.distribut_money}}</text></view>
  8 + <view class="t2 pdt10 pdr40" wx:elif="{{userRanking.underling_number}}">您距离前一名还差{{userRanking.underling_number}}人</view>
  9 + <view class="t2 pdt10 pdr40" wx:else>好好努力,天天向上!</view>
  10 + </view>
  11 + <view><image class="badge" src="../../../images/badge.png"/></view>
  12 + </view>
  13 +
  14 + <view class="tab-head flex t-c bg-red2 fs26">
  15 + <view class="tab-head-item pd20 f1 {{currentTabIndex == index ? 'active':''}}" wx:for="{{tabArr}}" bindtap="clickTab" data-index="{{index}}">{{item}}</view>
  16 + </view>
  17 +
  18 + <view class="pd20 flex ai-center fs26 arrow-r bdb">
  19 + <view class="pdr20"><image class="avatar" src="{{userInfo.head_pic}}"/></view>
  20 + <view>
  21 + <view class="fs30">{{userInfo.nickname}}</view>
  22 + <view class="pdt10 c-a" wx:if="{{currentTabIndex == 0}}">当前排名:<text class="c-red fs32">{{userRanking.rownum}}</text>,获得佣金:<text class="money c-red fs32">{{userRanking.distribut_money}}</text></view>
  23 + <view class="pdt10 c-a" wx:else>当前排名:<text class="c-red fs32">{{userRanking.rownum}}</text>,下线人数:<text class="c-red fs32">{{userRanking.underling_number}}</text></view>
  24 + </view>
  25 + </view>
  26 + </view>
  27 +
  28 + <view class="tab-content">
  29 + <view class="flex ai-center pd20 fs26" wx:for="{{list.pageData}}">
  30 + <view class="badge2-container pd20">
  31 + <image wx:if="{{index < 3}}" src="../../../images/no{{index + 1}}.png" class="badge2" data-num="{{index+1}}"/>
  32 + <text wx:else>{{index + 1}}</text>
  33 + </view>
  34 + <view class="pdr20"><image class="avatar2" src="{{item.head_pic}}"/></view>
  35 + <view>
  36 + <view class="fs30">{{item.nickname}}</view>
  37 + <view class="pdt10 c-a" wx:if="{{currentTabIndex == 0}}">获得佣金:<text class="money c-red fs32">{{item.distribut_money}}</text></view>
  38 + <view class="pdt10 c-a" wx:else>下线人数:<text class="c-red">{{item.underling_number}}</text></view>
  39 + </view>
  40 + </view>
  41 + </view>
  42 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  43 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 || list == null}}"></nodata>
  44 +</view>
0 45 \ No newline at end of file
... ...
packageA/pages/distribution/rank/rank.wxss 0 → 100644
  1 +.badge {
  2 + width: 260rpx;
  3 + height: 180rpx;
  4 +}
  5 +
  6 +.pd {
  7 + padding: 70rpx 40rpx;
  8 +}
  9 +
  10 +.bg-red {
  11 + background-color: #FF6666;
  12 +}
  13 +
  14 +.bg-red2 {
  15 + background-color: #FF5758;
  16 +}
  17 +
  18 +.t1 {
  19 + font-family: '微软雅黑';
  20 + font-size: 60rpx;
  21 + font-weight: bold;
  22 + color: white;
  23 +}
  24 +
  25 +.t2 {
  26 + font-size: 28rpx;
  27 + font-weight: bold;
  28 + color: rgba(255,255,255,.6);
  29 +}
  30 +
  31 +.money::before {
  32 + content: '¥';
  33 + font-size: 22rpx;
  34 +}
  35 +
  36 +.active {
  37 + color: white;
  38 + font-weight: bold;
  39 +}
  40 +
  41 +.tab-head {
  42 + color: rgba(255,255,255,.5);
  43 +}
  44 +
  45 +.tab-head-item {
  46 + position: relative;
  47 +}
  48 +.tab-head-item.active::after {
  49 + content: '';
  50 + position: absolute;
  51 + bottom: 0;
  52 + left: 0;
  53 + right: 0;
  54 + margin: 0 auto;
  55 + width: 0;
  56 + height: 0;
  57 + border: 12rpx solid;
  58 + border-color: transparent transparent #ffffff transparent;
  59 +}
  60 +
  61 +.avatar,
  62 +.avatar2 {
  63 +
  64 + border-radius: 50%;
  65 + background-color: #eee;
  66 +}
  67 +
  68 +.avatar {
  69 + width: 140rpx;
  70 + height: 140rpx;
  71 +}
  72 +
  73 +.avatar2 {
  74 + width: 120rpx;
  75 + height: 120rpx;
  76 +}
  77 +
  78 +
  79 +.arrow-r::after {
  80 + font-family: iconfont;
  81 + content: '\e61f';
  82 + position: absolute;
  83 + right: 20rpx;
  84 + color: #ccc;
  85 +}
  86 +
  87 +.bdb {
  88 + border-bottom: 20rpx solid #f0f0f0;
  89 +}
  90 +
  91 +.badge2-container {
  92 + /* margin: auto; */
  93 + width: 56rpx;
  94 + text-align: center;
  95 + font-size: 32rpx;
  96 + /* box-sizing: border-box; */
  97 +}
  98 +
  99 +.badge2 {
  100 + width: 56rpx;
  101 + height: 76rpx;
  102 + position: relative;
  103 +}
  104 +
  105 +.badge2::after {
  106 + content: attr(data-num);
  107 + color: white;
  108 + font-weight: bold;
  109 + text-align: center;
  110 + position: absolute;
  111 + left: 0;
  112 + top: 26rpx;
  113 + right: 0;
  114 + bottom: 0;
  115 +}
  116 +
  117 +.noMore {
  118 + padding: 20rpx;
  119 + color: #bbb;
  120 + text-align: center;
  121 + font-size: 26rpx;
  122 + /* background-color: #f4f4f4; */
  123 +}
0 124 \ No newline at end of file
... ...
packageA/pages/distribution/rookie/rookie.js 0 → 100644
  1 +var WxParse = require('../../../../utils/wxParse/wxParse.js');
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + list: null,
  12 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  13 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  14 + pageNum: 1, // 当前页数
  15 + },
  16 +
  17 + /**
  18 + * 生命周期函数--监听页面加载
  19 + */
  20 + onLoad: function (options) {
  21 + self = this;
  22 +
  23 + // 判断会员是否授权登录,
  24 + // 没有登录则跳转到登录页,
  25 + // 已登录则设置已登录状态,请求加载数据
  26 + // isLogin记录登录状态
  27 + app.isLogin().then(function(data) {
  28 + // console.log('data', data);
  29 + // 1.登录成功
  30 + self.setData({
  31 + isLogin: true,
  32 + userInfo: data,
  33 + // currentQuery: {
  34 + // store_id: app.globalData.setting.stoid,
  35 + // user_id: app.globalData.user_id,
  36 + // },
  37 + });
  38 + // 2.请求数据
  39 + self.get('/api/weshop/storeDistribut/get', {
  40 + store_id: app.globalData.setting.stoid,
  41 + });
  42 +
  43 + });
  44 +
  45 + },
  46 +
  47 + /**
  48 + * 生命周期函数--监听页面初次渲染完成
  49 + */
  50 + onReady: function () {
  51 +
  52 + },
  53 +
  54 + /**
  55 + * 生命周期函数--监听页面显示
  56 + */
  57 + onShow: function () {
  58 + if(app.globalData.userInfo instanceof Object) {
  59 + this.setData({
  60 + userInfo: app.globalData.userInfo,
  61 + imghost: app.globalData.setting.imghost,
  62 + });
  63 + // 检测从登录页返回后的登录状态
  64 + if(this.data.isLogin) {
  65 + // 初次就授权登录
  66 + return;
  67 + } else {
  68 + // 初次未授权登录,过后才授权
  69 + this.setData({
  70 + isLogin: true
  71 + });
  72 + // 请求数据
  73 + this.get('/api/weshop/storeDistribut/get', {
  74 + store_id: app.globalData.setting.stoid,
  75 + });
  76 +
  77 + };
  78 + };
  79 + },
  80 +
  81 + /**
  82 + * 生命周期函数--监听页面隐藏
  83 + */
  84 + onHide: function () {
  85 +
  86 + },
  87 +
  88 + /**
  89 + * 生命周期函数--监听页面卸载
  90 + */
  91 + onUnload: function () {
  92 +
  93 + },
  94 +
  95 + /**
  96 + * 页面相关事件处理函数--监听用户下拉动作
  97 + */
  98 + onPullDownRefresh: function () {
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 页面上拉触底事件的处理函数
  104 + */
  105 + onReachBottom: function () {
  106 +
  107 + },
  108 +
  109 + /**
  110 + * 用户点击右上角分享
  111 + */
  112 + onShareAppMessage: function () {
  113 +
  114 + },
  115 +
  116 + /**
  117 + * get请求数据
  118 + */
  119 + get(url, data) {
  120 + app.request.get(url + '/' + data.store_id, {
  121 + success: function(res) {
  122 + if(res.data.code == 0){
  123 + console.log('success~~~~~~~~~~~',res);
  124 + self.setData({
  125 + content: res.data.data.distriRule,
  126 + });
  127 + /**
  128 + * WxParse.wxParse(bindName , type, data, target,imagePadding)
  129 + * 1.bindName绑定的数据名(必填)
  130 + * 2.type可以为html或者md(必填)
  131 + * 3.data为传入的具体数据(必填)
  132 + * 4.target为Page对象,一般为this(必填)
  133 + * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
  134 + */
  135 + WxParse.wxParse('content', 'html', self.data.content, self);
  136 + }else{
  137 + wx.showToast({
  138 + title: "网络繁忙,请重试",
  139 + icon: 'none',
  140 + duration: 2000
  141 + })
  142 + }
  143 + },
  144 + fail: function() {},
  145 + });
  146 + },
  147 +
  148 + /**
  149 + * 请求数据
  150 + */
  151 + // getData: function(isInit, url, data) {
  152 + // app.request.promiseGet(url, {
  153 + // data: data,
  154 + // isShowLoading: true,
  155 + // })
  156 + // .then(function(res) {
  157 + // // console.log('1121', res.data.code);
  158 + // if(res.data.code == 0) {
  159 +
  160 + // self.setData({
  161 + // isLoading: false
  162 + // });
  163 +
  164 + // if(isInit) {// 第一次加载
  165 + // self.setData({
  166 + // list: res.data.data
  167 + // });
  168 + // } else {
  169 + // self.setData({
  170 + // 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  171 + // });
  172 + // };
  173 +
  174 + // if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  175 + // self.setData({
  176 + // noMore: true
  177 + // });
  178 + // };
  179 +
  180 + // } else {
  181 + // self.setData({
  182 + // 'list.pageData': []
  183 + // });
  184 + // };
  185 +
  186 + // })
  187 + // .catch(function(err) {
  188 + // console.log('出错拉!!!!',err);
  189 + // self.setData({
  190 + // 'list.pageData': []
  191 + // });
  192 + // });
  193 + // },
  194 +
  195 +
  196 + /**
  197 + * 上拉加载
  198 + */
  199 + // scrollToLower(url, requestData) {
  200 + // // 数据总量
  201 + // let total = this.data.list.total;
  202 + // // 单页最大数据量
  203 + // let pageSize = this.data.list.pageSize;
  204 + // // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  205 + // if((total != 0)&&(total <= pageSize)) {
  206 + // this.setData({
  207 + // noMore: true
  208 + // });
  209 + // };
  210 +
  211 + // if(!this.data.isLoading && !this.data.noMore) {
  212 + // this.setData({
  213 + // isLoading: true,
  214 + // pageNum: this.data.pageNum + 1
  215 + // });
  216 + // requestData.page = this.data.pageNum;
  217 + // this.getData(false, url, requestData);
  218 + // };
  219 + // },
  220 +
  221 +})
0 222 \ No newline at end of file
... ...
packageA/pages/distribution/rookie/rookie.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "新手必看",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/rookie/rookie.wxml 0 → 100644
  1 +<view class="pd20">
  2 + <!-- <image src="../../../images/cloud.jpg" mode="widthFix" style="width: 100%;"></image> -->
  3 + <view class="fs28 taj">
  4 + <import src="../../../../utils/wxParse/wxParse.wxml"/>
  5 + <template is="wxParse" data="{{wxParseData:content.nodes}}"/>
  6 + </view>
  7 +</view>
... ...
packageA/pages/distribution/rookie/rookie.wxss 0 → 100644
  1 +/* packageA//pages/distribution/rookie/rookie.wxss */
0 2 \ No newline at end of file
... ...
packageA/pages/distribution/shop/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + //-- 判断是不是有等级价 --
  3 + is_has_rank:function(rank_switch,item){
  4 + if(!rank_switch) return false;
  5 + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
  6 + return false;
  7 + },
  8 +
  9 + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
  10 + get_card_price:function(goods,all_card,type){
  11 + var price1=parseFloat(goods['cardprice1']);
  12 + var price2 = parseFloat(goods['cardprice2']);
  13 + var price3 = parseFloat(goods['cardprice3']);
  14 + if(!all_card){
  15 + if(type==0) return 0;
  16 + return "";
  17 + }
  18 +
  19 + var min_price=null;
  20 + var min_name=null;
  21 + //---设置对应的价格名字----
  22 + for(var i=0;i<3;i++) {
  23 + var vl=all_card[i];
  24 + if(!vl) continue;
  25 +
  26 + if(vl['CorrPrice']=="Price1" && price1>0)
  27 + {
  28 + if(min_price==null) {
  29 + min_price=price1;min_name=vl['CardName'];
  30 + }
  31 + else if(price1<min_price) {
  32 + min_price=price1;min_name=vl['CardName'];
  33 + }
  34 + }
  35 + if(vl['CorrPrice']=="Price2" && price2>0)
  36 + {
  37 + if(min_price==null) {
  38 + min_price=price2;min_name=vl['CardName'];
  39 + }
  40 + else if(price2<min_price) {
  41 + min_price=price2;min_name=vl['CardName'];
  42 + }
  43 + }
  44 +
  45 + if(vl['CorrPrice']=="Price3" && price3>0)
  46 + {
  47 + if(min_price==null) {
  48 + min_price=price3;min_name=vl['CardName'];
  49 + }
  50 + else if(price3<min_price) {
  51 + min_price=price3;min_name=vl['CardName'];
  52 + }
  53 + }
  54 +
  55 + }
  56 + if(min_price==null){
  57 + if(type==0) return 0;
  58 + return "";
  59 + }
  60 +
  61 + if(type==0) return min_price;
  62 + if(min_name.length>4 ) min_name=min_name.substring(0, 8);
  63 + return min_name;
  64 + },
  65 +}
  66 +module.exports = {
  67 + is_has_rank:g_filters.is_has_rank,
  68 + get_card_price:g_filters.get_card_price,
  69 +}
0 70 \ No newline at end of file
... ...
packageA/pages/distribution/shop/shop.js 0 → 100644
  1 +// packageA//pages/distribution/commision/commision.js
  2 +const app = getApp();
  3 +let self = null;
  4 +var os = app.globalData.setting,
  5 + ut= require("../../../../utils/util.js");
  6 +
  7 +
  8 +Page({
  9 +
  10 + /**
  11 + * 页面的初始数据
  12 + */
  13 + data: {
  14 + isInputFocus: false,//记录搜索输入框是否聚焦
  15 + inputVal: '',//记录搜索输入框的内容
  16 + isSort: false,//控制排序开关状态,true开启排序
  17 + isDescending: false, //isDescending降序,ascending升序
  18 + imghost: '',
  19 + url: os.imghost,
  20 +
  21 + tabArr: ['最新','销量','评论','价格'],
  22 + currentTabIndex: 0,
  23 + isShowRow: false,//控制视图切换状态
  24 + isHiddenDropdown: true,//控制筛选下拉菜单显隐
  25 +
  26 + list: null,
  27 + isLoading: false, // 检测是否已经发送请求,防止重复发送请求
  28 + noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据
  29 + pageNum: 1, // 当前页数
  30 +
  31 +
  32 + rank_switch: false,
  33 + card_field: "",
  34 + card_name: "",
  35 + max_card_field: "",
  36 + card_list: null,
  37 +
  38 + isAll: true,
  39 +
  40 + },
  41 +
  42 + /**
  43 + * 生命周期函数--监听页面加载
  44 + */
  45 + onLoad: function (options) {
  46 + self = this;//保存全局指针
  47 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  48 + self.setData({
  49 + userInfo: data,
  50 + });
  51 + });
  52 +
  53 + //从别人的分享的跳转过来
  54 + var first_leader = decodeURIComponent(options.scene);
  55 + if(first_leader && first_leader!='undefined'){
  56 + getApp().globalData.first_leader=first_leader;
  57 + this.data.first_leader=first_leader;
  58 +
  59 + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + first_leader, {
  60 + isShowLoading:false,
  61 + data:{r:Math.random()},
  62 + success: function (e) {
  63 + if(e.data.code==0){
  64 + self.setData({
  65 + userInfo2: e.data.data,
  66 + });
  67 + } ;
  68 +
  69 + },
  70 + });
  71 +
  72 + }
  73 +
  74 +
  75 + // 判断会员是否授权登录,
  76 + // 没有登录则跳转到登录页,
  77 + // 已登录则设置已登录状态,请求加载签到数据
  78 + // isLogin记录登录状态
  79 + // app.isLogin().then(function(data) {
  80 + // // 1.登录成功
  81 + // self.setData({
  82 + // isLogin: true,
  83 + // userInfo: data,
  84 + // currentQuery: {
  85 + // store_id: app.globalData.setting.stoid,
  86 + // user_id: app.globalData.user_id,
  87 + // },
  88 + // });
  89 + // // 2.请求全部商品数据
  90 + // self.getData(true, '/api/weshop/users/distribut/pagemyshop', self.data.currentQuery);
  91 + // // 3.请求新品
  92 + // app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', {
  93 + // data: self.data.currentQuery,
  94 + // }).then(function(res) {
  95 + // self.setData({
  96 + // newList: res.data.data,
  97 + // });
  98 + // })
  99 + // });
  100 + },
  101 +
  102 + /**
  103 + * 生命周期函数--监听页面初次渲染完成
  104 + */
  105 + onReady: function () {},
  106 +
  107 + /**
  108 + * 生命周期函数--监听页面显示
  109 + */
  110 + onShow: function () {
  111 + //自己登录的
  112 + if(app.globalData.userInfo && !this.data.first_leader) {
  113 + if(!this.data.isLogin) {
  114 + this.setData({
  115 + userInfo: app.globalData.userInfo,
  116 + imghost: app.globalData.setting.imghost,
  117 + currentQuery: {
  118 + store_id: app.globalData.setting.stoid,
  119 + user_id: app.globalData.user_id,
  120 + },
  121 + isLogin: true,
  122 + });
  123 +
  124 + // 请求数据
  125 + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop', {
  126 + data: this.data.currentQuery,
  127 + }).then(res => {
  128 + self.setData({
  129 + list: res.data.data,
  130 + total: res.data.data.total,
  131 + });
  132 + });
  133 +
  134 + // 新品
  135 + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', {
  136 + data: self.data.currentQuery,
  137 + }).then(res => {
  138 + self.setData({
  139 + newList: res.data.data,
  140 + });
  141 + });
  142 + // 广告banner
  143 + app.request.promiseGet("/api/weshop/ad/page", {
  144 + data: {
  145 + pid: 401,
  146 + enabled: 1,
  147 + store_id: app.globalData.setting.stoid,
  148 + }
  149 + }).then(res => {
  150 + if(res.data.code == 0 && res.data.data) {
  151 + let item = res.data.data.pageData[0];
  152 + if(item && item.ad_code) {
  153 + self.setData({
  154 + ad_img: item.ad_code,
  155 + });
  156 + };
  157 + };
  158 + });
  159 +
  160 + };
  161 + }
  162 + //被人分享点击开的
  163 + else if(this.data.first_leader){
  164 + this.setData({
  165 + imghost: app.globalData.setting.imghost,
  166 + currentQuery: {
  167 + store_id: app.globalData.setting.stoid,
  168 + user_id: this.data.first_leader,
  169 + },
  170 + isLogin: true,
  171 + });
  172 +
  173 + // 请求数据
  174 + this.getData(true, '/api/weshop/users/distribut/pagemyshop', this.data.currentQuery);
  175 + // 新品
  176 + app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', {
  177 + data: self.data.currentQuery,
  178 + }).then(res => {
  179 + self.setData({
  180 + newList: res.data.data,
  181 + });
  182 + });
  183 + // 广告banner
  184 + app.request.promiseGet("/api/weshop/ad/page", {
  185 + data: {
  186 + pid: 401,
  187 + enabled: 1,
  188 + store_id: app.globalData.setting.stoid,
  189 + }
  190 + }).then(res => {
  191 + if(res.data.code == 0 && res.data.data) {
  192 + let item = res.data.data.pageData[0];
  193 + if(item && item.ad_code) {
  194 + self.setData({
  195 + ad_img: item.ad_code,
  196 + });
  197 + };
  198 + };
  199 + });
  200 + }
  201 + var th=this;
  202 + //更新一下会员的信息
  203 + if(getApp().globalData.user_id) {
  204 + if(!getApp().globalData.userInfo['is_distribut']){
  205 + th.setData({ishidden_comise:1})
  206 + }
  207 + getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
  208 + isShowLoading:false,
  209 + success: function (e) {
  210 + getApp().globalData.userInfo = e.data.data;
  211 + getApp().getConfig2(function (e) {
  212 + var swithc_list = e.switch_list;
  213 + var sw_arr = JSON.parse(swithc_list);
  214 + //---如果后台有开等级卡的开关---
  215 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  216 + th.setData({
  217 + rank_switch: true
  218 + });
  219 + //---回调卡的列表---
  220 + th.getPlusCardType(function (ob) {
  221 + th.setData({
  222 + card_list: ob.card_list
  223 + });
  224 + var ti = setInterval(function () {
  225 + var user = getApp().globalData.userInfo;
  226 + if (!user) return false;
  227 + clearInterval(ti);
  228 + if (user.card_field && user['card_expiredate']) {
  229 + var str = user['card_expiredate'].replace(/-/g, '/');
  230 + var end = new Date(str);
  231 + end = Date.parse(end) / 1000;
  232 + var now = ut.gettimestamp();
  233 + //--- 判断是等级会员,且在有效期范围内 ---
  234 + if (user.card_field && now < end) {
  235 + var card_name = ob.name_map.get(user.card_field);
  236 + if (card_name.length > 4) card_name = card_name.substring(0, 8);
  237 + th.setData({
  238 + card_field: user.card_field,
  239 + card_name: card_name,
  240 + card_list: ob.card_list
  241 + });
  242 + }
  243 + }
  244 + }, 500)
  245 + })
  246 + }
  247 + })
  248 + }
  249 + })
  250 + }
  251 +
  252 +
  253 + },
  254 +
  255 + /**
  256 + * 生命周期函数--监听页面隐藏
  257 + */
  258 + onHide: function () {
  259 +
  260 + },
  261 +
  262 + /**
  263 + * 生命周期函数--监听页面卸载
  264 + */
  265 + onUnload: function () {
  266 +
  267 + },
  268 +
  269 + /**
  270 + * 页面相关事件处理函数--监听用户下拉动作
  271 + */
  272 + onPullDownRefresh: function () {
  273 +
  274 + },
  275 +
  276 + /**
  277 + * 页面上拉触底事件的处理函数
  278 + */
  279 + onReachBottom: function () {
  280 + let url = '';
  281 + if(this.data.isAll) {
  282 + url = '/api/weshop/users/distribut/pagemyshop';
  283 + } else {
  284 + url = '/api/weshop/users/distribut/pagemyshop?type=2';
  285 + };
  286 + this.scrollToLower(url, this.data.currentQuery);
  287 + },
  288 +
  289 + /**
  290 + * 用户点击右上角分享
  291 + *--点击分享事件--分享我的小店
  292 + *--*/
  293 + onShareAppMessage: function(t) {
  294 +
  295 + var th = this;
  296 + var title= "我的小店";
  297 + var user_id=this.data.first_leader;
  298 + if(!user_id){
  299 + user_id=getApp().globalData.user_id
  300 + }
  301 + var url="/packageA/pages/distribution/shop/shop?scene=" + user_id;
  302 + if(getApp().globalData.user_id){
  303 + url+="&first_leader="+getApp().globalData.user_id;
  304 + }
  305 +
  306 + var ob={
  307 + title: title,
  308 + path:url,
  309 + };
  310 + return ob;
  311 +
  312 + },
  313 +
  314 + /**
  315 + * 点击下拉菜单
  316 + */
  317 + clickDropdown() {
  318 + this.setData({
  319 + isHiddenDropdown: !this.data.isHiddenDropdown,
  320 + });
  321 + },
  322 +
  323 + /**
  324 + * 点击遮罩层
  325 + */
  326 + clickMask() {
  327 + this.setData({
  328 + isHiddenDropdown: true,
  329 + });
  330 + },
  331 +
  332 + /**
  333 + * 选择下拉菜单项
  334 + */
  335 + selectDropdown(e) {
  336 + let currentIndex = e.target.dataset.index;
  337 + this.setData({
  338 + isHiddenDropdown: true,
  339 + currentSelect: this.data.dropdownArr[currentIndex],
  340 + });
  341 + },
  342 +
  343 + /**
  344 + * 搜索输入框聚焦
  345 + */
  346 + inputFocus() {
  347 + this.setData({
  348 + isInputFocus: true,
  349 + });
  350 + },
  351 +
  352 +
  353 + /**
  354 + * 搜索输入框失焦
  355 + */
  356 + inputBlur() {
  357 + this.setData({
  358 + isInputFocus: false,
  359 + });
  360 + },
  361 +
  362 + /**
  363 + * 获取搜索输入框输入的内容
  364 + */
  365 + input(e) {
  366 + this.data.inputVal = e.detail.value;
  367 + },
  368 +
  369 + /**
  370 + * 搜索输入框清空内容
  371 + */
  372 + inputClear() {
  373 + let inputVal = this.data.inputVal;
  374 + console.log('input', inputVal);
  375 + if(inputVal) {
  376 + this.setData({
  377 + inputVal: '',
  378 + });
  379 + };
  380 + },
  381 +
  382 + /**
  383 + * 搜索输入框聚焦
  384 + */
  385 + search() {
  386 + let data = this.data.currentQuery;
  387 + data.key = this.data.inputVal;
  388 + if(data.orderField) {
  389 + delete data.orderField;
  390 + };
  391 + if(data.page) {
  392 + delete data.page;
  393 + };
  394 + this.setData({
  395 + currentTabIndex: 4,
  396 + isSort: false,
  397 + isDescending: false,
  398 + currentQuery: data,
  399 + pageNum: 1,
  400 + });
  401 + this.getData(true, '/api/weshop/users/distribut/pagemyshop', data);
  402 + },
  403 +
  404 + /**
  405 + * 点击排序
  406 + */
  407 + clickSort(e) {
  408 + let data = this.data.currentQuery;
  409 + data.orderField = 'shop_price';
  410 + if(data.page) {
  411 + delete data.page;
  412 + };
  413 + if(!this.data.isSort) {
  414 + this.setData({
  415 + isSort: true,
  416 + });
  417 + data.orderType = 'asc';
  418 + } else {
  419 + this.setData({
  420 + isDescending: !this.data.isDescending,
  421 + });
  422 +
  423 + if(this.data.isDescending) {
  424 + data.orderType = 'desc';
  425 + } else {
  426 + data.orderType = 'asc';
  427 + };
  428 +
  429 + };
  430 + console.log('当前参数:', data);
  431 +
  432 + this.setData({
  433 + currentQuery: data,
  434 + noMore: false,
  435 + });
  436 +
  437 + // 请求数据
  438 + this.getData(true, '/api/weshop/users/distribut/pagemyshop', data);
  439 + },
  440 +
  441 + /**
  442 + * 点击视图切换按钮
  443 + */
  444 + change() {
  445 + this.setData({
  446 + isShowRow: !this.data.isShowRow
  447 + });
  448 + },
  449 +
  450 + /**
  451 + * 点击Tab
  452 + */
  453 + clickTab(e) {
  454 + let data = this.data.currentQuery;
  455 + let isSort = this.data.isSort;
  456 + let currentIndex = e.target.dataset.index;
  457 + if(currentIndex != 3) {
  458 + if(isSort) {
  459 + isSort = false;
  460 + };
  461 + if(data.orderType) {// 清除orderType
  462 + delete data.orderType;
  463 + };
  464 + };
  465 + this.setData({
  466 + list: null,
  467 + currentTabIndex: currentIndex,
  468 + isSort,
  469 + pageNum: 1,
  470 + noMore: false,
  471 + });
  472 + if(data.page) {// 清除page
  473 + delete data.page;
  474 + };
  475 +
  476 +
  477 +
  478 + if(currentIndex == 0) {
  479 + if(data.orderField) {// 清除orderField
  480 + delete data.orderField;
  481 + };
  482 + };
  483 + if(currentIndex == 1) {
  484 + data.orderField = 'sales_sum';
  485 + };
  486 + if(currentIndex == 2) {
  487 + data.orderField = 'comment_count';
  488 + };
  489 +
  490 + if(currentIndex == 3) {
  491 + // console.log('点击价格');
  492 + return;
  493 + };
  494 +
  495 + this.data.currentQuery = data;
  496 + this.getData(true, '/api/weshop/users/distribut/pagemyshop', data);
  497 + },
  498 +
  499 + /**
  500 + * 点击筛选
  501 + */
  502 + clickFilter() {
  503 + this.setData({
  504 + isHiddenDropdown: !this.data.isHiddenDropdown,
  505 + });
  506 + },
  507 +
  508 + /**
  509 + * 点击遮罩层,关闭筛选下拉菜单
  510 + */
  511 + clickMask() {
  512 + if(!this.data.isHiddenDropdown) {
  513 + this.setData({
  514 + isHiddenDropdown: true,
  515 + });
  516 + }
  517 + },
  518 +
  519 + /**
  520 + * 请求数据
  521 + */
  522 + getData: function(isInit, url, data) {
  523 +
  524 + app.request.promiseGet(url, {
  525 + data: data,
  526 + isShowLoading: true,
  527 + })
  528 + .then(function(res) {
  529 + // console.log('1121', res.data.code);
  530 + if(res.data.code == 0) {
  531 +
  532 + self.setData({
  533 + isLoading: false
  534 + });
  535 +
  536 + if(isInit) {// 第一次加载
  537 + self.setData({
  538 + list: res.data.data,
  539 + });
  540 + } else {
  541 + self.setData({
  542 + 'list.pageData': self.data.list.pageData.concat(res.data.data.pageData)
  543 + });
  544 + };
  545 +
  546 + if((res.data.data.pageData.length == 0) || (res.data.data.pageSize * res.data.data.page >= res.data.data.total)) {
  547 + self.setData({
  548 + noMore: true
  549 + });
  550 + };
  551 +
  552 + } else {
  553 + self.setData({
  554 + 'list.pageData': []
  555 + });
  556 + };
  557 +
  558 + })
  559 + .catch(function(err) {
  560 + console.log('出错拉!!!!',err);
  561 + self.setData({
  562 + 'list.pageData': []
  563 + });
  564 + });
  565 + },
  566 +
  567 +
  568 + /**
  569 + * 上拉加载
  570 + */
  571 + scrollToLower(url, requestData) {
  572 +
  573 + // 数据总量
  574 + let total = this.data.list.total;
  575 + // 单页最大数据量
  576 + let pageSize = this.data.list.pageSize;
  577 + // 如果数据总量不为0且小于或等于单页最大数据量,说明数据已全部加载,显示‘没有更多了’
  578 + if((total != 0)&&(total <= pageSize)) {
  579 + this.setData({
  580 + noMore: true
  581 + });
  582 + };
  583 +
  584 + if(!this.data.isLoading && !this.data.noMore) {
  585 + this.setData({
  586 + isLoading: true,
  587 + pageNum: this.data.pageNum + 1
  588 + });
  589 + requestData.page = this.data.pageNum;
  590 + console.log('滚动data:', requestData);
  591 + this.getData(false, url, requestData);
  592 + };
  593 + },
  594 +
  595 + /**
  596 + * 点击跳转
  597 + */
  598 + goto(e) {
  599 + let url = '';
  600 + if(e.target.dataset.url) {
  601 + url = e.target.dataset.url;
  602 + } else {
  603 + url = e.currentTarget.dataset.url;
  604 + }
  605 + app.goto(url);
  606 + },
  607 +
  608 +
  609 + //--- 获取卡类列表 ---
  610 + getPlusCardType: function (func) {
  611 + var storid = os.stoid;
  612 + var th = this;
  613 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid,
  614 + {}).then(res => {
  615 +
  616 + if(res.data.code!=0 || !res.data.data){
  617 + var ob = {
  618 + "card_list": [],
  619 + "name_map": ""
  620 + };
  621 + func(ob);
  622 + return false;
  623 + }
  624 +
  625 + var plusCard = res.data.data;
  626 + var arr = [1219, 2089, 3031];
  627 + var new_arr = new Array();
  628 + var card_name_map = new Map();
  629 +
  630 + var user = getApp().globalData.userInfo;
  631 + if(plusCard) {
  632 + for (var i = 0; i < plusCard.length; i++) {
  633 + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  634 + continue;
  635 + }
  636 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  637 + card_name_map.set(name, plusCard[i].CardName);
  638 + new_arr.push(plusCard[i]);
  639 +
  640 + }
  641 + }
  642 + var ob = {
  643 + "card_list": new_arr,
  644 + "name_map": card_name_map
  645 + };
  646 + func(ob);
  647 + })
  648 + },
  649 +
  650 +
  651 + /**
  652 + * 点击全部
  653 + */
  654 + clickAll() {
  655 + let data = this.data.currentQuery;
  656 +
  657 + if(data.page) delete data.page;
  658 + if(data.orderField) delete data.orderField;
  659 + if(data.orderType) delete data.orderType;
  660 + if(data.key) delete data.key;
  661 +
  662 + this.setData({
  663 + pageNum: 1,
  664 + noMore: false,
  665 + isAll: true,
  666 + });
  667 +
  668 + this.getData(true, '/api/weshop/users/distribut/pagemyshop', data);
  669 + },
  670 +
  671 + /**
  672 + * 点击新品
  673 + */
  674 + clickNew() {
  675 + let data = this.data.currentQuery;
  676 +
  677 + if(data.page) delete data.page;
  678 + if(data.orderField) delete data.orderField;
  679 + if(data.orderType) delete data.orderType;
  680 + if(data.key) delete data.key;
  681 +
  682 + this.setData({
  683 + pageNum: 1,
  684 + noMore: false,
  685 + isAll: false,
  686 + });
  687 +
  688 + this.getData(true, '/api/weshop/users/distribut/pagemyshop?type=2', data);
  689 + // app.request.promiseGet('/api/weshop/users/distribut/pagemyshop?type=2', {
  690 + // data: data,
  691 + // }).then(res => {
  692 + // self.setData({
  693 + // list: res.data.data,
  694 + // });
  695 + // });
  696 + },
  697 +
  698 +
  699 +
  700 +})
0 701 \ No newline at end of file
... ...
packageA/pages/distribution/shop/shop.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata"
  4 + },
  5 + "navigationBarTitleText": "我的小店",
  6 + "enablePullDownRefresh": false
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/distribution/shop/shop.wxml 0 → 100644
  1 +<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
  2 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  3 +<view>
  4 + <view class="head pr">
  5 + <view class="bdb">
  6 + <!-- <view><image src="../../../images/jfbuy.jpg" mode="widthFix" class="banner"/></view> -->
  7 + <view><image src="{{imghost + (ad_img ? ad_img:'/miniapp/images/user_index_powder.jpg')}}" mode="widthFix" class="banner"/></view>
  8 + <view class="flex bg-white pdh20 jc_sb pr">
  9 + <!-- 分享人的头像 -->
  10 + <view class="avatar-container" wx:if="{{userInfo2}}">
  11 + <image class="avatar" src="{{userInfo2.head_pic}}"/>
  12 + <view class="pdt20"><text class="nickname">{{userInfo2.nickname}}</text></view>
  13 + </view>
  14 + <!-- 自己的头像 -->
  15 + <view class="avatar-container" wx:else>
  16 + <image class="avatar" src="{{userInfo.head_pic}}"/>
  17 + <view class="pdt20"><text class="nickname">{{userInfo.nickname}}</text></view>
  18 + </view>
  19 +
  20 +
  21 + <view class="flex t-c fs24 f1 jc_fe">
  22 + <view class="pdv20 pdh40 {{isAll ? 'selected':''}}" bindtap="clickAll">
  23 + <view class="fs30">{{filter.show_default(total)}}</view>
  24 + <view>全部商品</view>
  25 + </view>
  26 + <view class="pdv20 pdh40 {{!isAll ? 'selected':''}}" bindtap="clickNew">
  27 + <view class="fs30">{{filter.show_default(newList.total)}}</view>
  28 + <view>新品</view>
  29 + </view>
  30 + <view class="pdv20 pdh40" bindtap="goto" data-url="/pages/user/index/index">
  31 + <view class="fs26"><text class="iconfont icon-ren1 bold"></text></view>
  32 + <view>会员中心</view>
  33 + </view>
  34 + </view>
  35 + </view>
  36 + </view>
  37 +
  38 + <!-- 搜索 -->
  39 + <view class="flex ai-center fs26 bg-white pd20">
  40 + <view class="input-container f1">
  41 + <input class="input" type="text" value="{{inputVal}}" placeholder="请输入商品关键字" confirm-type="search" bindfocus="inputFocus" bindblur="inputBlur" bindinput="input" bindconfirm="search"/>
  42 + <text class="iconfont icon-guanbi" hidden="{{!isInputFocus}}" catchtap="inputClear"></text>
  43 + <!-- 搜索输入框聚焦时显示关闭按钮,否则隐藏关闭按钮 -->
  44 + </view>
  45 + <view class="pd20 c-red" bindtap="search">搜索</view>
  46 + </view>
  47 +
  48 + </view>
  49 +
  50 + <view class="flex t-c fs26 bg-white bdb sticky c-a" catchtap="clickTab">
  51 + <block wx:for="{{tabArr}}">
  52 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:if="{{index != 3}}">{{item}}</view>
  53 + <view class="f1 pd20 {{currentTabIndex == index ? 'active':''}}" data-index="{{index}}" wx:else bindtap="clickSort">
  54 + {{item}}
  55 + <text class="iconfont icon-sort2 c-db" wx:if="{{!isSort}}"></text>
  56 + <text class="t-icon t-icon-sort-up {{isDescending ? 'reverse':''}}" wx:else></text>
  57 + </view>
  58 + </block>
  59 + <view class="f1 pd20" catchtap="change">
  60 + <text class="iconfont {{isShowRow ? 'icon-fenxiang':'icon-fenlie'}}"></text>
  61 + </view>
  62 + </view>
  63 +
  64 +
  65 + <view class="content">
  66 +
  67 + <view class="fs26" wx:if="{{isShowRow}}">
  68 + <view class="item bg-white flex ai-center pd20" wx:for="{{list.pageData}}">
  69 + <view class="flex pdl10" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  70 + <view class="img-container pdr20" data-txt="已售:{{item.sales_sum}}"><image class="img" src="{{imghost + item.original_img}}" lazy-load mode="aspectFit"/></view>
  71 + <view class="flex fdc jc_sb">
  72 + <view class="ellipsis-2">{{item.goods_name}}</view>
  73 +
  74 + <!-- 判断是否有活动价 -->
  75 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  76 + <view class="money flex xc-wc" >
  77 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  78 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  79 + <!-- 活动价 -->
  80 + <view class="flex xc-wc ai_and" wx:if="{{item.prom_price}}">
  81 + <view class="fs24">¥</view>
  82 + <view class="fs35">{{item.prom_price}}</view>
  83 + </view>
  84 + </view>
  85 + <view class="flex" style="line-height: 28rpx;">
  86 + <!-- 原价 -->
  87 + <view class="price flex xc-ash line_th">
  88 + <view class="fs22">¥</view>
  89 + <view class="fs22">{{item.market_price}}</view>
  90 + </view>
  91 + </view>
  92 + </block>
  93 + <block wx:else>
  94 + <!-- 商品价格,先判断下是后⼜等级价-->
  95 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  96 + <!-- 当会员是等级卡的时候 -->
  97 + <block wx:if="{{card_field}}">
  98 + <!-- 等级价>0 -->
  99 + <block wx:if="{{item[card_field]>0}}">
  100 + <view class="money flex">
  101 + <!-- 办卡价 -->
  102 + <view class="flex xc-wc ai_and">
  103 + <view class="fs24">¥</view>
  104 + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view>
  105 + <view class="card_bg ellipsis-1">
  106 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  107 + <text class="card_name">{{card_name}}</text>
  108 + </view>
  109 + </view>
  110 + </view>
  111 + <view class="flex" style="line-height: 28rpx;">
  112 + <!-- 原价 -->
  113 + <view class="price flex xc-ash line_th">
  114 + <view class="fs22">¥</view>
  115 + <view class="fs22">{{item.market_price}}</view>
  116 + </view>
  117 + </view>
  118 + </block>
  119 + <blocK wx:else>
  120 + <view class="money flex">
  121 + <!-- 办卡价 -->
  122 + <view class="flex xc-wc">
  123 + <view class="fs24">¥</view>
  124 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  125 + </view>
  126 + </view>
  127 + <view class="flex" style="line-height: 28rpx;">
  128 + <!-- 原价 -->
  129 + <view class="price flex xc-ash line_th">
  130 + <view class="fs22">¥</view>
  131 + <view class="fs22">{{item.market_price}}</view>
  132 + </view>
  133 + </view>
  134 + </blocK>
  135 + </block>
  136 + <block wx:else>
  137 + <!-- 如果商品有设置等级价⼤于0的 -->
  138 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  139 + <view class="money flex">
  140 + <!-- 办卡价 -->
  141 + <view class="flex xc-wc">
  142 + <view class="fs24">¥</view>
  143 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  144 + </view>
  145 + <!-- 原价 -->
  146 + <view class="price flex xc-ash line_th">
  147 + <view class="fs22">¥</view>
  148 + <view class="fs22">{{item.market_price}}</view>
  149 + </view>
  150 + </view>
  151 + <view class="flexr" style="">
  152 + <!-- 等级价 -->
  153 + <view class="price flex ai-center">
  154 + <view class="fs22">¥</view>
  155 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  156 + <view class="card_bg ellipsis-1">
  157 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>
  158 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  159 + </view>
  160 + </view>
  161 + </view>
  162 + </block>
  163 + <block wx:else>
  164 + <view class="money flex">
  165 + <!-- 办卡价 -->
  166 + <view class="flex xc-wc">
  167 + <view class="fs24">¥</view>
  168 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  169 + </view>
  170 + </view>
  171 + <view class="flex" style="line-height: 28rpx;">
  172 + <!-- 原价 -->
  173 + <view class="price flex xc-ash line_th">
  174 + <view class="fs22">¥</view>
  175 + <view class="fs22">{{item.market_price}}</view>
  176 + </view>
  177 + </view>
  178 + </block>
  179 + </block>
  180 + </block>
  181 + <!-- 商品压根就没有等级价 -->
  182 + <block wx:else>
  183 + <view class="money flex">
  184 + <!-- 办卡价 -->
  185 + <view class="flex xc-wc">
  186 + <view class="fs24">¥</view>
  187 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  188 + </view>
  189 + </view>
  190 + <view class="flex" style="line-height: 28rpx;">
  191 + <!-- 原价 -->
  192 + <view class="price flex xc-ash line_th">
  193 + <view class="fs22">¥</view>
  194 + <view class="fs22">{{item.market_price}}</view>
  195 + </view>
  196 + </view>
  197 + </block>
  198 + </block>
  199 + <!-- 分层金额 -->
  200 + <view hidden="{{ishidden_comise}}" class="fs24 c-a">分成金额:<text class="money c-red">{{item.fcommission}}</text></view>
  201 +
  202 +
  203 + </view>
  204 + </view>
  205 + </view>
  206 + </view>
  207 +
  208 +
  209 +
  210 + <view class="fs26 flex pd20 wrap" wx:else>
  211 + <view class="item2 bg-white" wx:for="{{list.pageData}}" bindtap="goto" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  212 + <view class="img-container" data-txt="已售:{{item.sales_sum}}"><image class="img2" src="{{imghost + item.original_img}}" mode="aspectFit" lazy-load/></view>
  213 + <view class="pd20 fs26">
  214 + <view class="ellipsis-2">{{item.goods_name}}</view>
  215 + <!-- 判断是否有活动价 -->
  216 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  217 + <view class="money flex xc-wc" >
  218 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  219 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  220 + <!-- 活动价 -->
  221 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
  222 + <view class="fs24">¥</view>
  223 + <view class="fs35">{{item.prom_price}}</view>
  224 + </view>
  225 + </view>
  226 + <view class="flex" style="line-height: 28rpx;">
  227 + <!-- 原价 -->
  228 + <view class="price flex xc-ash line_th">
  229 + <view class="fs22">¥</view>
  230 + <view class="fs22">{{item.market_price}}</view>
  231 + </view>
  232 + </view>
  233 + </block>
  234 + <block wx:else>
  235 + <!-- 商品价格,先判断下是后⼜等级价-->
  236 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  237 + <!-- 当会员是等级卡的时候 -->
  238 + <block wx:if="{{card_field}}">
  239 + <!-- 等级价>0 -->
  240 + <block wx:if="{{item[card_field]>0}}">
  241 + <view class="money flex">
  242 + <!-- 办卡价 -->
  243 + <view class="flex xc-wc ai_and">
  244 + <view class="fs24">¥</view>
  245 + <view class="fs35">{{filter.toFix(item[card_field],2)}}</view>
  246 + <view class="card_bg ellipsis-1">
  247 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  248 + <text class="card_name">{{card_name}}</text>
  249 + </view>
  250 + </view>
  251 + </view>
  252 + <view class="flex" style="line-height: 28rpx;">
  253 + <!-- 原价 -->
  254 + <view class="price flex xc-ash line_th">
  255 + <view class="fs22">¥</view>
  256 + <view class="fs22">{{item.market_price}}</view>
  257 + </view>
  258 + </view>
  259 + </block>
  260 + <blocK wx:else>
  261 + <view class="money flex">
  262 + <!-- 办卡价 -->
  263 + <view class="flex xc-wc ai_and">
  264 + <view class="fs24">¥</view>
  265 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  266 + </view>
  267 + </view>
  268 + <view class="flex" style="line-height: 28rpx;">
  269 + <!-- 原价 -->
  270 + <view class="price flex xc-ash line_th">
  271 + <view class="fs22">¥</view>
  272 + <view class="fs22">{{item.market_price}}</view>
  273 + </view>
  274 + </view>
  275 + </blocK>
  276 + </block>
  277 + <block wx:else>
  278 + <!-- 如果商品有设置等级价⼤于0的 -->
  279 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  280 + <view class="money flex">
  281 + <!-- 办卡价 -->
  282 + <view class="flex xc-wc ai_and">
  283 + <view class="fs24">¥</view>
  284 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  285 + </view>
  286 + <!-- 原价 -->
  287 + <view class="price flex xc-ash line_th">
  288 + <view class="fs22">¥</view>
  289 + <view class="fs22">{{item.market_price}}</view>
  290 + </view>
  291 + </view>
  292 + <view class="flexr" style="">
  293 + <!-- 等级价 -->
  294 + <view class="price flex ai-center">
  295 + <view class="fs22">¥</view>
  296 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  297 + <view class="card_bg ellipsis-1">
  298 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></ image>
  299 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  300 + </view>
  301 + </view>
  302 + </view>
  303 + </block>
  304 + <block wx:else>
  305 + <view class="money flex">
  306 + <!-- 办卡价 -->
  307 + <view class="flex xc-wc ai_and">
  308 + <view class="fs24">¥</view>
  309 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  310 + </view>
  311 + </view>
  312 + <view class="flex" style="line-height: 28rpx;">
  313 + <!-- 原价 -->
  314 + <view class="price flex xc-ash line_th">
  315 + <view class="fs22">¥</view>
  316 + <view class="fs22">{{item.market_price}}</view>
  317 + </view>
  318 + </view>
  319 + </block>
  320 + </block>
  321 + </block>
  322 + <!-- 商品压根就没有等级价 -->
  323 + <block wx:else>
  324 + <view class="money flex">
  325 + <!-- 办卡价 -->
  326 + <view class="flex xc-wc ai_and">
  327 + <view class="fs24">¥</view>
  328 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  329 + </view>
  330 + </view>
  331 + <view class="flex" style="line-height: 28rpx;">
  332 + <!-- 原价 -->
  333 + <view class="price flex xc-ash line_th">
  334 + <view class="fs22">¥</view>
  335 + <view class="fs22">{{item.market_price}}</view>
  336 + </view>
  337 + </view>
  338 + </block>
  339 + </block>
  340 + <!-- 分层金额 -->
  341 + <view class="fs24 c-a">分成金额:<text class="money c-red">1.00</text></view>
  342 + </view>
  343 + </view>
  344 + </view>
  345 +
  346 +
  347 + <nodata class="t-c" wx:if="{{list.pageData.length == 0 && list.pageData}}"></nodata>
  348 + <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">- 已经到底了 -</view>
  349 + </view>
  350 +
  351 +
  352 +
  353 +</view>
  354 +
  355 +
  356 +
  357 +
  358 +
... ...
packageA/pages/distribution/shop/shop.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.avatar-container {
  6 + display: flex;
  7 + /* align-items: center; */
  8 + position: absolute;
  9 + margin-top: -80rpx;
  10 + color: white;
  11 +}
  12 +
  13 +.avatar {
  14 + width: 160rpx;
  15 + height: 160rpx;
  16 + border-radius: 50%;
  17 + background-color: #eee;
  18 + margin-right: 10rpx;
  19 +}
  20 +
  21 +.nickname {
  22 + font-size: 28rpx;
  23 + padding-top: 30rpx;
  24 + background-color: rgba(0,0,0,.6);
  25 + padding: 4rpx 10rpx;
  26 + border-radius: 8rpx 8rpx 8rpx 0;
  27 + overflow: hidden;
  28 + color: #f8f8f8;
  29 +}
  30 +
  31 +.banner {
  32 + display: block;
  33 + width: 100%;
  34 + background-color: white;
  35 +}
  36 +
  37 +.input-container {
  38 + position: relative;
  39 + background-color: #f0f0f0;
  40 + border-radius: 6rpx;
  41 +}
  42 +.input-container::before {
  43 + content: '\e618';
  44 + font-family: iconfont;
  45 + position: absolute;
  46 + top: 50%;
  47 + left: 16rpx;
  48 + transform: translateY(-40%);
  49 + color: #aaa;
  50 +}
  51 +.input-container .icon-guanbi {
  52 + position: absolute;
  53 + top: 50%;
  54 + right: 16rpx;
  55 + transform: translateY(-40%);
  56 + font-size: 28rpx;
  57 + color: #aaa;
  58 + padding: 10rpx;
  59 + z-index: 2;
  60 +}
  61 +.input {
  62 + padding: 10rpx 50rpx;
  63 +}
  64 +
  65 +.time::before {
  66 + content: '\e64c';
  67 + font-family: iconfont;
  68 + padding-right: 10rpx;
  69 + color: #FF6768;
  70 +}
  71 +
  72 +.icon-xia,
  73 +.icon-shang {
  74 + font-size: 16rpx;
  75 +}
  76 +.icon-sort2 {
  77 + font-size: 24rpx;
  78 +}
  79 +
  80 +/* .line {
  81 + position: relative;
  82 +}
  83 +.line::after {
  84 + content: '';
  85 + position: absolute;
  86 + right: 0;
  87 + background-color: #f4f4f4;
  88 + width: 2rpx;
  89 + height: 30rpx;
  90 + top: 50%;
  91 + transform: translateY(-50%);
  92 +} */
  93 +
  94 +/* .item {
  95 + border-radius: 12rpx;
  96 + background-color: white;
  97 +} */
  98 +
  99 +/* .item ~ .item {
  100 + margin-top: 20rpx;
  101 +} */
  102 +
  103 +.money {
  104 + /* word-break: break-all;
  105 + word-wrap: break-word; */
  106 +}
  107 +.md {
  108 + position: relative;
  109 +}
  110 +.md::before,
  111 +.md::after {
  112 + content: '';
  113 + position: absolute;
  114 + top: 50%;
  115 + transform: translateY(-50%);
  116 + width: 2rpx;
  117 + height: 40%;
  118 + background-color: #f4f4f4;
  119 +}
  120 +.md::before {
  121 + left: 0;
  122 +}
  123 +.md::after {
  124 + right: 0;
  125 +}
  126 +
  127 +.noMore {
  128 + padding: 20rpx;
  129 + color: #bbb;
  130 + text-align: center;
  131 + font-size: 26rpx;
  132 + background-color: transparent !important;
  133 +}
  134 +
  135 +.sticky {
  136 + position: sticky;
  137 + top: 0;
  138 + z-index: 1;
  139 +}
  140 +
  141 +.dropdown {
  142 + border-top: 2rpx solid #f8f8f8;
  143 + position: absolute;
  144 + width: 100%;
  145 + top: 54rpx;
  146 + left: 0;
  147 + background-color: white;
  148 + z-index: 1;
  149 +}
  150 +
  151 +.selected {
  152 + color: #FF6768;
  153 +}
  154 +
  155 +
  156 +.active {
  157 + color: #FF6768;
  158 + font-weight: bold;
  159 + position: relative;
  160 +}
  161 +
  162 +.active::after {
  163 + content: '';
  164 + width: 30%;
  165 + height: 2rpx;
  166 + background-color: #FF6768;
  167 + position: absolute;
  168 + left: 0;
  169 + right: 0;
  170 + bottom: 0;
  171 + margin: 0 auto;
  172 +}
  173 +
  174 +
  175 +.mask {
  176 + position: fixed;
  177 + width: 100%;
  178 + height: 100%;
  179 + background-color: rgba(0,0,0,.5);
  180 +}
  181 +
  182 +.hover {
  183 + background-color: #eee;
  184 +}
  185 +
  186 +.t-icon-sort-up {
  187 + width: 12px;
  188 + height: 12px;
  189 + position: relative;
  190 + top: 2rpx;
  191 + right: 0;
  192 + background-repeat: no-repeat;
  193 + box-sizing: border-box;
  194 +}
  195 +
  196 +.t-icon-sort-up.reverse {
  197 + transform: rotateZ(-180deg);
  198 +}
  199 +
  200 +
  201 +.img-container {
  202 + position: relative;
  203 +}
  204 +.img-container::after {
  205 + content: attr(data-txt);
  206 + position: absolute;
  207 + left: 0;
  208 + bottom: 0;
  209 + background-color: rgba(0,0,0,.4);
  210 + color: white;
  211 + font-size: 20rpx;
  212 + padding: 4rpx;
  213 + border-radius: 6rpx 6rpx 6rpx 0;
  214 +}
  215 +
  216 +.img {
  217 + display: block;
  218 + width: 240rpx;
  219 + height: 240rpx;
  220 + background-color: #eee;
  221 +}
  222 +
  223 +.img2 {
  224 + display: block;
  225 + width: 100%;
  226 + height: 340rpx;
  227 + /* height: auto; */
  228 + /* width: 200rpx;
  229 + height: 200rpx; */
  230 + background-color: white;
  231 +}
  232 +
  233 +
  234 +/*checkbox 整体大小 */
  235 +checkbox {
  236 + /* width: 240rpx;
  237 + height: 90rpx; */
  238 +}
  239 +/*checkbox 选项框大小 */
  240 +checkbox .wx-checkbox-input {
  241 + width: 34rpx;
  242 + height: 34rpx;
  243 + border-radius: 50%;
  244 +
  245 +}
  246 +/*checkbox选中后样式 */
  247 +checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  248 + background-color: #FF6768;
  249 + border-color: #FF6768;
  250 + /* color: white; */
  251 +}
  252 +/*checkbox选中后图标样式 */
  253 +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  254 + width: 34rpx;
  255 + height: 34rpx;
  256 + line-height: 34rpx;
  257 + text-align: center;
  258 + font-size: 24rpx;
  259 + color: #fff;
  260 + background: transparent;
  261 + transform: translate(-50%, -50%) scale(1);
  262 + -webkit-transform: translate(-50%, -50%) scale(1);
  263 +}
  264 +
  265 +.bottomBar {
  266 + box-sizing: border-box;
  267 + position: fixed;
  268 + bottom: 0;
  269 + width: 100%;
  270 + background-color: white;
  271 + border-radius: 20rpx 20rpx 0 0;
  272 +}
  273 +
  274 +.btn {
  275 + color: white;
  276 + background-color: #FF6768;
  277 + border-radius: 6rpx;
  278 +}
  279 +
  280 +/* .item {
  281 + border-radius: 10rpx;
  282 +} */
  283 +
  284 +.item2 {
  285 + width: calc((100% - 20rpx)/2);
  286 + box-sizing: border-box;
  287 + border-radius: 12rpx;
  288 + overflow: hidden;
  289 + margin-bottom: 20rpx;
  290 +}
  291 +
  292 +.item2:nth-child(even) {
  293 + margin-left: 20rpx;
  294 +}
  295 +
  296 +/* .content {
  297 + padding-bottom: 110rpx;
  298 +} */
  299 +
  300 +.dropdown {
  301 + position: absolute;
  302 + left: 0;
  303 + top: 114rpx;
  304 + width: 100%;
  305 + background-color: white;
  306 + box-sizing: border-box;
  307 +}
  308 +
  309 +.label {
  310 + display: inline-block;
  311 + padding: 5rpx 20rpx;
  312 + color: #aaa;
  313 + border: 2rpx solid #eee;
  314 + background-color: #f0f0f0;
  315 + border-radius: 6rpx;
  316 + box-sizing: border-box;
  317 + text-align: center;
  318 +}
  319 +
  320 +
  321 +.mask {
  322 + display: none;
  323 + position: fixed;
  324 + left: 0;
  325 + right: 0;
  326 + top: 0;
  327 + bottom: 0;
  328 + background-color: rgba(0,0,0,.5);
  329 + z-index: -1;
  330 +}
  331 +
  332 +.bsbb {
  333 + box-sizing: border-box;
  334 +}
  335 +
  336 +.l-red {
  337 + background-image: linear-gradient(-225deg, #FF6060, #FF6768);
  338 +}
  339 +
  340 +.bgf0 {
  341 + background-color: #f0f0f0;
  342 +}
  343 +
  344 +.filter::after {
  345 + content: '\e68a';
  346 + font-family: iconfont;
  347 +}
  348 +
  349 +.dropdown.show ~ .mask {
  350 + display: block;
  351 +}
  352 +
  353 +.icon-badge {
  354 + font-size: 19rpx;
  355 + padding-right: 4rpx;
  356 +}
  357 +
  358 +
  359 +
  360 +
  361 +
  362 +
  363 +
  364 +.github-badge {
  365 + display: inline-block;
  366 + border-radius: 4px;
  367 + text-shadow: none;
  368 + font-size: 12px;
  369 + color: #fff;
  370 + line-height: 24rpx;
  371 + background-color: #ABBAC3;
  372 + margin-bottom: 5px;
  373 + font-size: 20rpx;
  374 +}
  375 +.github-badge .badge-subject {
  376 + display: inline-block;
  377 + background-color: #FFA500;
  378 + padding: 0 4px 0 6px;
  379 + border-top-left-radius: 4px;
  380 + border-bottom-left-radius: 4px;
  381 +}
  382 +.github-badge .badge-value {
  383 + display: inline-block;
  384 + padding: 0 6px 0 4px;
  385 + border-top-right-radius: 4px;
  386 + border-bottom-right-radius: 4px;
  387 + font-size: 20rpx;
  388 + background-color: #4D4D4D !important;
  389 +}
  390 +
  391 +
  392 +.collects {
  393 + margin-top: 40rpx;
  394 + margin-bottom: 40rpx;
  395 +}
  396 +
  397 +.ai-center{
  398 + align-items: center;
  399 +}
  400 +
  401 +.ib {
  402 + display: inline-block;
  403 +}
  404 +
  405 +.fs20 {
  406 + font-size: 20rpx;
  407 +}
  408 +
  409 +.fs22 {
  410 + font-size: 22rpx;
  411 +}
  412 +
  413 +.fs24 {
  414 + font-size: 24rpx;
  415 +}
  416 +
  417 +.fs26 {
  418 + font-size: 26rpx;
  419 +}
  420 +
  421 +.fs28 {
  422 + font-size: 28rpx;
  423 +}
  424 +
  425 +.fs35 {
  426 + font-size: 35rpx; position: relative;top:5rpx
  427 +}
  428 +
  429 +.flex-center {
  430 + display: flex;
  431 + justify-content: center;
  432 + align-items: center;
  433 +}
  434 +
  435 +.ellipsis-1 {
  436 + overflow: hidden;
  437 + white-space: nowrap;
  438 + text-overflow: ellipsis;
  439 +}
  440 +
  441 +/* .ellipsis-1x {
  442 + overflow: hidden;
  443 + text-overflow: ellipsis;
  444 + display: -webkit-box;
  445 + -webkit-box-orient: vertical;
  446 + -webkit-line-clamp: 1;
  447 +} */
  448 +
  449 +.xc-wc {
  450 + color: #d60021;
  451 +}
  452 +
  453 +.xc-ash {
  454 + color: #b9b9b9;
  455 +}
  456 +
  457 +.choice_box .choice_list .choice_footer .price {
  458 + color: #f23030;
  459 + height: 10px;
  460 +}
  461 +
  462 +.flex {
  463 + display: flex;
  464 +}
  465 +
  466 +.ellipsis-2 {
  467 + overflow: hidden;
  468 + text-overflow: ellipsis;
  469 + display: -webkit-box;
  470 + -webkit-box-orient: vertical;
  471 + -webkit-line-clamp: 2;
  472 +}
  473 +
  474 +.goods_name {
  475 + height: 62rpx;
  476 + margin-top: 6rpx;
  477 + line-height: 30rpx;
  478 +}
  479 +
  480 +.hang {
  481 + width: 100%;
  482 + margin: auto;
  483 + padding-left: 21rpx;
  484 +}
  485 +
  486 +.hang .collect {
  487 + width: 347rpx;
  488 + height: 520rpx;
  489 + border-radius: 25rpx;
  490 + border: 1rpx solid rgb(214, 214, 214);
  491 + overflow: hidden;
  492 + margin-right: 14rpx;
  493 + margin-bottom: 5rpx;
  494 +}
  495 +
  496 +.collect .bottom {
  497 + padding: 0rpx 20rpx;
  498 +}
  499 +
  500 +.collect .sp {
  501 + width: 100%;
  502 + height: 326rpx;
  503 +}
  504 +
  505 +.collect .money {
  506 + margin-top: 28rpx;
  507 + margin-bottom: 8rpx;
  508 + line-height: 28rpx;
  509 + align-items: baseline;
  510 +}
  511 +
  512 +.collect .money view {
  513 + line-height: 28rpx;
  514 +}
  515 +
  516 +.collect .money .flex {
  517 + font-weight: bold;
  518 +}
  519 +
  520 +.collect .money .flex .fs24 {
  521 + padding-top: 5rpx;
  522 +}
  523 +
  524 +.collect .Discount {
  525 + width: 156rpx;
  526 + height: 28rpx;
  527 + border-radius: 20rpx;
  528 + background-color: rgb(56, 56, 56);
  529 + font-size: 18rpx;
  530 + color: rgb(255, 255, 255);
  531 +}
  532 +
  533 +.collect .Discount image {
  534 + height: 18rpx;
  535 + width: 18rpx;
  536 + line-height: 28rpx;
  537 + margin-right: 3rpx;
  538 +}
  539 +
  540 +.collect.ml20 {
  541 + margin-left: 13rpx;
  542 +}
  543 +
  544 +.fs24.dollar {
  545 + padding: 0rpx;
  546 +}
  547 +
  548 +.money .price {
  549 + margin-left: 12rpx;
  550 + text-decoration: line-through;
  551 + line-height: 23rpx;
  552 +}
  553 +
  554 +.province {
  555 + line-height: 26rpx;
  556 +}
  557 +
  558 +.nothing {
  559 + height: 75rpx;
  560 + width: 100%;
  561 +}
  562 +
  563 +.nothing .no_content {
  564 + margin: 0rpx 11rpx;
  565 + color: rgb(138, 138, 138);
  566 +}
  567 +
  568 +.nothing .Foil {
  569 + width: 80rpx;
  570 + height: 2rpx;
  571 + background-color: rgb(138, 138, 138);
  572 +}
  573 +
  574 +.line_th {
  575 + text-decoration: line-through;
  576 +}
  577 +
  578 +.card_bg {
  579 + box-sizing: border-box;
  580 + padding: 2rpx 10rpx;
  581 + height: 28rpx;
  582 + border-radius: 26rpx;
  583 + font-size: 18rpx;
  584 + line-height: 28rpx;
  585 + max-width: 210rpx;
  586 + background: #333;
  587 + color: #fff;
  588 + margin-left: 8rpx;
  589 + display: flex;
  590 + align-items: center;
  591 + position: relative;
  592 + top: -4rpx;
  593 +}
  594 +
  595 +.card_bg image {
  596 + width: 19rpx;
  597 + height: 19rpx;
  598 + margin-right: 8rpx;
  599 +}
  600 +
  601 +/* .card_bg .card_name {
  602 + max-width: 76rpx;
  603 + width: auto;
  604 + overflow: hidden;
  605 + white-space: nowrap;
  606 +} */
  607 +
  608 +
  609 +
  610 +
  611 +
  612 +
  613 +
  614 +
  615 +
  616 +
... ...
packageA/pages/service_share/service_share.js 0 → 100644
  1 +// packageA//pages/service_share/service_share.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
0 67 \ No newline at end of file
... ...
packageA/pages/service_share/service_share.json 0 → 100644
  1 +{
  2 + "usingComponents": {}
  3 +}
0 4 \ No newline at end of file
... ...
packageA/pages/service_share/service_share.wxml 0 → 100644
  1 +<!--packageA//pages/service_share/service_share.wxml-->
  2 +<text>packageA//pages/service_share/service_share.wxml</text>
... ...
packageA/pages/service_share/service_share.wxss 0 → 100644
  1 +/* packageA//pages/service_share/service_share.wxss */
0 2 \ No newline at end of file
... ...
pages/cart/cart2/cart2.js
... ... @@ -1797,8 +1797,19 @@ Page({
1797 1797 item.coupon_price=0;
1798 1798 }
1799 1799  
1800   -
1801   -
  1800 + //老会员成为分销下线需要的参数
  1801 + if(getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader){
  1802 + //判断一下分享人是不是分享商
  1803 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  1804 + if(res.data.code==0){
  1805 + var user= res.data.data;
  1806 + if(user.is_distribut==1){
  1807 + item.first_leader=parseInt(getApp().globalData.first_leader);
  1808 + }
  1809 + }
  1810 + })
  1811 + }
  1812 +
1802 1813 var goods={
1803 1814 'goods_id': gg.goods_id,
1804 1815 'goods_name': gg.goods_name,
... ... @@ -1997,6 +2008,20 @@ Page({
1997 2008 }
1998 2009 if(Object.keys(order_prom_list).length>0)
1999 2010 item.order_prom_list=order_prom_list;
  2011 +
  2012 + //老会员成为分销下线需要的参数
  2013 + if(getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader){
  2014 + //判断一下分享人是不是分享商
  2015 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  2016 + if(res.data.code==0){
  2017 + var user= res.data.data;
  2018 + if(user.is_distribut==1){
  2019 + item.first_leader=parseInt(getApp().globalData.first_leader);
  2020 + }
  2021 + }
  2022 + })
  2023 + }
  2024 +
2000 2025  
2001 2026 //房间号的ids
2002 2027 var room_ids="";
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -621,6 +621,20 @@ Page({
621 621 if(gg.room_id && gg.room_id>0){
622 622 item.room_ids=gg.room_id;
623 623 }
  624 +
  625 + //老会员成为分销下线需要的参数
  626 + if(getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader){
  627 + //判断一下分享人是不是分享商
  628 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  629 + if(res.data.code==0){
  630 + var user= res.data.data;
  631 + if(user.is_distribut==1){
  632 + item.first_leader=parseInt(getApp().globalData.first_leader);
  633 + }
  634 + }
  635 + })
  636 + }
  637 +
624 638  
625 639 var goods={
626 640 'goods_id': gg.goods_id,
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -524,9 +524,19 @@ Page({
524 524 if(!th.data.bn_goods.is_normal){
525 525 item.is_zsorder=th.data.kt_type+1; //开团类型
526 526 }
  527 + //老会员成为分销下线需要的参数
  528 + if(getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader){
  529 + //判断一下分享人是不是分享商
  530 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+getApp().globalData.first_leader,{}).then(res=>{
  531 + if(res.data.code==0){
  532 + var user= res.data.data;
  533 + if(user.is_distribut==1){
  534 + item.first_leader=parseInt(getApp().globalData.first_leader);
  535 + }
  536 + }
  537 + })
  538 + }
527 539  
528   -
529   -
530 540 if(th.data.qh!='')
531 541 {
532 542 item.team_qh=th.data.qh;
... ...
pages/distribution/distribution.js 0 → 100644
  1 +// packageA//pages/distribution/main/main.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 +
  12 + },
  13 +
  14 + /**
  15 + * 生命周期函数--监听页面加载
  16 + */
  17 + onLoad: function (options) {
  18 + self = this;//保存全局指针
  19 +
  20 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  21 + self.setData({
  22 + userInfo: data,
  23 + });
  24 + });
  25 +
  26 + },
  27 +
  28 + /**
  29 + * 生命周期函数--监听页面初次渲染完成
  30 + */
  31 + onReady: function () {
  32 +
  33 + },
  34 +
  35 + /**
  36 + * 生命周期函数--监听页面显示
  37 + */
  38 + onShow: function () {
  39 + console.log('onshow');
  40 + let url = '/api/weshop/users/distribut/getMoney';
  41 + if(app.globalData.userInfo) {
  42 + if(!this.data.isLogin) {
  43 + this.setData({
  44 + userInfo: app.globalData.userInfo,
  45 + imghost: app.globalData.setting.imghost,
  46 + isLogin: true,
  47 + });
  48 +
  49 + // 请求数据
  50 + app.request.get(url + '/' + this.data.userInfo.store_id + '/' + this.data.userInfo.user_id, {
  51 + success: function(res) {
  52 + console.log('success~~`', self.data.userInfo);
  53 + if(res.data.code == 0) {
  54 +
  55 + self.setData({
  56 + data: res.data.data,
  57 + });
  58 +
  59 + } else {
  60 + // if(!res.data.data.is_distribut) {//如果不是分销商:0不是,1是
  61 +
  62 + app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {
  63 + data: {
  64 + storeId: self.data.userInfo.store_id,
  65 + userId: self.data.userInfo.user_id,
  66 + first_leader: self.data.userInfo.first_leader,
  67 + },
  68 + isShowLoading: true,
  69 + }).then(function(res) {
  70 + console.log('!!!===>', res);
  71 + if(res.data.code == 0) {
  72 + self.setData({
  73 + fenxiao: res.data.data,
  74 + });
  75 + } else {
  76 + self.setData({
  77 + msg: res.data.msg,
  78 + });
  79 + }
  80 +
  81 + });
  82 +
  83 + // };
  84 + };
  85 + },
  86 +
  87 + });
  88 +
  89 +
  90 + };
  91 + };
  92 +
  93 +
  94 + },
  95 +
  96 + /**
  97 + * 生命周期函数--监听页面隐藏
  98 + */
  99 + onHide: function () {
  100 +
  101 + },
  102 +
  103 + /**
  104 + * 生命周期函数--监听页面卸载
  105 + */
  106 + onUnload: function () {
  107 +
  108 + },
  109 +
  110 + /**
  111 + * 页面相关事件处理函数--监听用户下拉动作
  112 + */
  113 + onPullDownRefresh: function () {
  114 +
  115 + },
  116 +
  117 + /**
  118 + * 页面上拉触底事件的处理函数
  119 + */
  120 + onReachBottom: function () {
  121 +
  122 + },
  123 +
  124 + /**
  125 + * 用户点击右上角分享
  126 + */
  127 + onShareAppMessage: function () {
  128 +
  129 + },
  130 +
  131 + /**
  132 + * 点击跳转
  133 + */
  134 + goto(e) {
  135 + let url = '';
  136 + if(e.target.dataset.url) {
  137 + url = e.target.dataset.url;
  138 + } else {
  139 + url = e.currentTarget.dataset.url;
  140 + }
  141 + console.log(url);
  142 + app.goto(url);
  143 + },
  144 +
  145 +
  146 +
  147 + /**
  148 + * 获取输入框
  149 + */
  150 + getInput(e) {
  151 + this.setData({
  152 + inputValue: e.detail.value,
  153 + });
  154 + },
  155 +
  156 +
  157 + /**
  158 + * 验证
  159 + */
  160 + verify(e) {
  161 + let pass = e.target.dataset.pass;
  162 + let mobile = 0;
  163 + if(this.data.inputValue) {
  164 + mobile = this.data.inputValue;
  165 + if(!pass) {
  166 + app.request.put('/api/weshop/users/distribut/updateUserRecommender', {
  167 + data: {
  168 + storeId: self.data.userInfo.store_id,
  169 + userId: self.data.userInfo.user_id,
  170 + mobile: mobile,
  171 + },
  172 + success: function (res) {
  173 + if(res.code = -1) {
  174 + wx.showToast({
  175 + title: res.data.msg,
  176 + icon: 'none',
  177 + duration: 2000
  178 + });
  179 + };
  180 + console.log('!!!===>', res);
  181 +
  182 + if(res.data.msg == '绑定上下级关系成功!') {
  183 + app.request.promiseGet('/api/weshop/users/distribut/getIsDistribut', {
  184 + data: {
  185 + storeId: self.data.userInfo.store_id,
  186 + userId: self.data.userInfo.user_id,
  187 + first_leader: self.data.userInfo.first_leader,
  188 + },
  189 + isShowLoading: true,
  190 + }).then(function(res) {
  191 + console.log('!!!===>', res);
  192 + self.setData({
  193 + fenxiao: res.data.data,
  194 + });
  195 + });
  196 + };
  197 +
  198 + }
  199 + });
  200 +
  201 + }
  202 + } else {
  203 + wx.showToast({
  204 + title: '手机号码不能为空',
  205 + icon: 'none',
  206 + duration: 2000
  207 + });
  208 + };
  209 +
  210 + },
  211 +})
0 212 \ No newline at end of file
... ...
pages/distribution/distribution.json 0 → 100644
  1 +{
  2 + "usingComponents": {},
  3 + "navigationBarTitleText": "我的分销",
  4 + "enablePullDownRefresh": false
  5 +}
0 6 \ No newline at end of file
... ...
pages/distribution/distribution.wxml 0 → 100644
  1 +<wxs src="../../utils/filter.wxs" module="filter"></wxs>
  2 +<view class="main">
  3 + <!-- 头像 -->
  4 + <view class="avatar-container t-c pdv40">
  5 + <view class="pdb20">
  6 + <image class="avatar" src="{{userInfo.head_pic}}"/>
  7 + </view>
  8 + <view class="fs26"><text class="nickname">{{filter.show_default(userInfo.nickname)}}</text></view>
  9 + </view>
  10 + <!-- 金额 -->
  11 + <view>
  12 + <view class="flex ai-center jc_sb pd2622 bdb arrow-r" bindtap="goto">
  13 + <view><text class="iconfont icon-jine pdr10 ctb"></text>可提现金额</view>
  14 + <view class="ctb money" data-url="/pages/user/member/menber">{{filter.show_default(data.liudong_money)}}</view>
  15 + </view>
  16 +
  17 + <view class="flex jc_sa t-c">
  18 + <view class="pd20 f1">
  19 + <view class="money fs40">{{filter.show_default(data.today_money)}}</view>
  20 + <view class="fs24 pdt10 cb">今日收入</view>
  21 + </view>
  22 + <view class="pd20 f1">
  23 + <view class="money fs40">{{filter.show_default(data.sales_volume)}}</view>
  24 + <view class="fs24 pdt10 cb">总销售额</view>
  25 + </view>
  26 + <view class="pd20 f1">
  27 + <view class="money fs40">{{filter.show_default(data.distribut_money)}}</view>
  28 + <view class="fs24 pdt10 cb">累计佣金</view>
  29 + </view>
  30 + </view>
  31 + </view>
  32 + <!-- 商品 -->
  33 + <view class="flex t-c mgv20 fs30" bindtap="goto">
  34 + <view class="f1 pd20 line" data-url="/packageA/pages/distribution/goods/goods?index=0"><text class="iconfont icon-shangjia pdr10 cf79"></text>上架商品</view>
  35 + <view class="f1 pd20" data-url="/packageA/pages/distribution/goods/goods?index=1"><text class="iconfont icon-xiajia pdr10 c29f"></text>下架商品</view>
  36 + </view>
  37 + <!-- 图标列表 -->
  38 + <view class="flex wrap pdv20">
  39 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/order/order">
  40 + <view class="circle bgBlue"><text class="iconfont icon-order fs40"></text></view>
  41 + <view class="fs24 pdt10">分销订单</view>
  42 + </view>
  43 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/rank/rank">
  44 + <view class="circle bgRed"><text class="iconfont icon-paihangbang fs40"></text></view>
  45 + <view class="fs24 pdt10">分销排行</view>
  46 + </view>
  47 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/myteam/myteam">
  48 + <view class="circle bgPink"><text class="iconfont icon-tuandui fs40"></text></view>
  49 + <view class="fs24 pdt10">我的团队</view>
  50 + </view>
  51 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/commision/commision">
  52 + <view class="circle bgRed"><text class="iconfont icon-yongjin fs40"></text></view>
  53 + <view class="fs24 pdt10">佣金明细</view>
  54 + </view>
  55 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/card/card">
  56 + <view class="circle bgPurple"><text class="iconfont icon-mingpian fs40"></text></view>
  57 + <view class="fs24 pdt10">我的名片</view>
  58 + </view>
  59 + <view class="pd20 t-c w25">
  60 + <view class="circle bgYellow" bindtap="goto" data-url="/pages/user/index/index"><text class="iconfont icon-huiyuan fs40"></text></view>
  61 + <view class="fs24 pdt10">会员中心</view>
  62 + </view>
  63 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/shop/shop">
  64 + <view class="circle bgBlue"><text class="iconfont icon-shop fs40"></text></view>
  65 + <view class="fs24 pdt10">我的小店</view>
  66 + </view>
  67 + <view class="pd20 t-c w25" bindtap="goto" data-url="/packageA/pages/distribution/rookie/rookie">
  68 + <view class="circle bgGreen"><text class="iconfont icon-xinshouyindao fs40"></text></view>
  69 + <view class="fs24 pdt10">新手必看</view>
  70 + </view>
  71 + </view>
  72 + <!-- 分销商验证 -->
  73 + <!-- <view class="popup" wx:if="{{!1}}"> -->
  74 + <view class="popup" wx:if="{{!data.is_distribut}}">
  75 + <block wx:if="{{msg}}">
  76 + <view class="t-c pd20 title">提示<text class="iconfont icon-close" bindtap="goto" data-url="/pages/user/index/index"></text></view>
  77 + <view class="t-c pd20">
  78 + <image src="{{imghost + 'miniapp/images/user/nodistribut.png'}}" class="img"/>
  79 + <view class="fs28 pdt40">{{msg}}</view>
  80 + </view>
  81 + </block>
  82 + <block wx:else>
  83 + <view class="t-c pd20 title">分销规则说明<text class="iconfont icon-close" bindtap="goto" data-url="/pages/user/index/index"></text></view>
  84 + <view wx:if="{{fenxiao}}">
  85 + <block wx:for="{{fenxiao}}">
  86 + <view class="item" wx:if="{{item.type == 1}}">
  87 + <view class="left f1">
  88 + <view class="icon-container"><text class="iconfont icon-huiyuan1"></text></view>
  89 + <view>仅限PLUS卡({{item.conditonRemark}})的会员, <text class="c-red" bindtap="goto" data-url="/pages/user/cardinfo/cardinfo">立即升级</text></view>
  90 + </view>
  91 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  92 + </view>
  93 + <view class="item" wx:if="{{item.type == 2}}">
  94 + <view class="left f1">
  95 + <view class="icon-container"><text class="iconfont icon-renzheng"></text></view>
  96 + <view class="flex ali-c">
  97 + <input class="bg-f0 pdh10 input" type="number" value="{{item.inviter ? item.inviter:''}}" placeholder="请输入推荐人手机号码" disabled="{{item.pass}}" bindinput="getInput"/>
  98 + <view class="verify" wx:if="{{!item.pass}}" bindtap="verify" data-pass="{{item.pass}}">验证</view>
  99 + </view>
  100 + </view>
  101 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  102 + </view>
  103 + <view class="item" wx:if="{{item.type == 3}}">
  104 + <view class="left f1">
  105 + <view class="icon-container"><text class="iconfont icon-gouwu"></text></view>
  106 + <text>{{item.conditonRemark}}</text>
  107 + </view>
  108 + <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
  109 + </view>
  110 + </block>
  111 + <view class="item" data-url="1">
  112 + <view class="left f1">
  113 + <view class="icon-container"><text class="iconfont icon-yongjin"></text></view>
  114 + <text>成功成为分销商,分享商品给好友即可获得相应收益</text>
  115 + </view>
  116 + </view>
  117 +
  118 + <view class="t-c pd20 fs30 bdt co-red bold" bindtap="goto" data-url="/pages/index/index/index">去购买</view>
  119 + </view>
  120 + </block>
  121 +
  122 +
  123 + <!-- <view class="t-c pd20 fs30 bdt co-red bold">确定</view> -->
  124 + </view>
  125 + <!-- 遮罩 -->
  126 + <!-- <view class="mask" wx:if="{{!1}}"></view> -->
  127 + <view class="mask" wx:if="{{!data.is_distribut}}"></view>
  128 +</view>
  129 +
... ...
pages/distribution/distribution.wxss 0 → 100644
  1 +page {
  2 + background-color: #f4f4f4;
  3 +}
  4 +
  5 +.main > view {
  6 + background-color: white;
  7 +}
  8 +
  9 +.avatar-container {
  10 + padding-top: 60rpx;
  11 + padding-bottom: 60rpx;
  12 + background: url(https://mshopimg.yolipai.net/miniapp/images/user_index_powder.jpg) no-repeat 100% 100%;
  13 + /* background-size: 100%; */
  14 +}
  15 +
  16 +.avatar {
  17 + width: 160rpx;
  18 + height: 160rpx;
  19 + border-radius: 50%;
  20 + background-color: #eee;
  21 +}
  22 +
  23 +.nickname {
  24 + display: inline-block;
  25 + background-color: rgba(0,0,0,.5);
  26 + padding: 4rpx 20rpx;
  27 + color: white;
  28 + border-radius: 24rpx;
  29 +}
  30 +
  31 +.pd2622 {
  32 + padding: 20rpx 60rpx 20rpx 20rpx;
  33 +}
  34 +
  35 +.money::before {
  36 + content: '¥';
  37 + font-size: 24rpx;
  38 +}
  39 +
  40 +/* .bdb {
  41 + border-bottom: 2rpx solid #f8f8f8;
  42 +} */
  43 +
  44 +.arrow-r {
  45 + /* display: relative; */
  46 +}
  47 +
  48 +.arrow-r::after {
  49 + font-family: iconfont;
  50 + content: '\e61f';
  51 + position: absolute;
  52 + right: 20rpx;
  53 + color: #ddd;
  54 +}
  55 +.line {
  56 + position: relative;
  57 +}
  58 +.line::after {
  59 + content: '';
  60 + position: absolute;
  61 + right: 0;
  62 + background-color: #f8f8f8;
  63 + width: 2rpx;
  64 + height: 30rpx;
  65 + top: 50%;
  66 + transform: translateY(-50%);
  67 +}
  68 +
  69 +.circle {
  70 + width: 80rpx;
  71 + height: 80rpx;
  72 + line-height: 80rpx;
  73 + border-radius: 50%;
  74 + color: white;
  75 + margin: 0 auto;
  76 + background-color: red;
  77 +}
  78 +
  79 +.fs40 {
  80 + font-size: 40rpx;
  81 +}
  82 +
  83 +
  84 +.bgBlue {
  85 + background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%);
  86 +}
  87 +.bgPink {
  88 + background-image: linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%);
  89 +}
  90 +.bgRed {
  91 + background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%);
  92 +}
  93 +.bgYellow {
  94 + background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
  95 +}
  96 +.bgGreen {
  97 + background-image: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
  98 +}
  99 +.bgPurple {
  100 + background-image: linear-gradient(to top, #9795f0 0%, #fbc8d4 100%);
  101 +}
  102 +
  103 +.mask {
  104 + position: fixed;
  105 + top: 0;
  106 + left: 0;
  107 + width: 100%;
  108 + height: 100%;
  109 + background-color: rgba(0,0,0,.5) !important;
  110 +}
  111 +
  112 +.popup {
  113 + position: fixed;
  114 + z-index: 1;
  115 + top: 50%;
  116 + left: 50%;
  117 + transform: translate(-50%, -50%);
  118 + width: 90%;
  119 + border-radius: 12rpx;
  120 + overflow: hidden;
  121 +}
  122 +
  123 +.icon-container {
  124 + border-radius: 50%;
  125 + background-color: #FCEA0D;
  126 + width: 50rpx;
  127 + line-height: 50rpx;
  128 + height: 50rpx;
  129 + text-align: center;
  130 + font-size: 28rpx !important;
  131 + margin-right: 10rpx;
  132 + flex-shrink: 0;
  133 +}
  134 +
  135 +.item {
  136 + padding: 20rpx;
  137 + display: flex;
  138 + align-items: center;
  139 + font-size: 26rpx;
  140 + position: relative;
  141 +}
  142 +
  143 +.title {
  144 + background-image: linear-gradient( 135deg, #FF6768 10%, #EA5455 100%);
  145 + color: white;
  146 + font-size: 28rpx;
  147 + position: relative;
  148 +}
  149 +
  150 +.icon-close {
  151 + position: absolute;
  152 + right: 20rpx;
  153 + color: white;
  154 +}
  155 +
  156 +.verify {
  157 + color: white;
  158 + background-color: #FF6768;
  159 + padding: 0 20rpx;
  160 + border-radius: 6rpx;
  161 + display: flex;
  162 + align-items: center;
  163 + margin-left: 10rpx;
  164 +}
  165 +
  166 +.input {
  167 + border-radius: 6rpx;
  168 + height: 50rpx;
  169 +}
  170 +
  171 +.item ~ .item .left::before {
  172 + content: '';
  173 + position: absolute;
  174 + left: 45rpx;
  175 + top: -45rpx;
  176 + width: 2rpx;
  177 + height: 100%;
  178 + background: linear-gradient(to bottom, #eee, #eee 8rpx, transparent 8rpx, transparent);
  179 + background-size: 100% 16rpx;
  180 + z-index: -1;
  181 +}
  182 +
  183 +.left {
  184 + display: flex;
  185 + align-items: center;
  186 + padding-right: 20rpx;
  187 +}
  188 +
  189 +
  190 +/*checkbox 整体大小 */
  191 +checkbox {
  192 + /* width: 240rpx;
  193 + height: 90rpx; */
  194 +}
  195 +/*checkbox 选项框大小 */
  196 +checkbox .wx-checkbox-input {
  197 + width: 34rpx;
  198 + height: 34rpx;
  199 + border-radius: 50%;
  200 +
  201 +}
  202 +/*checkbox选中后样式 */
  203 +checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  204 + background-color: #FF6768;
  205 + border-color: #FF6768;
  206 + /* color: white; */
  207 +}
  208 +/*checkbox选中后图标样式 */
  209 +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  210 + width: 34rpx;
  211 + height: 34rpx;
  212 + line-height: 34rpx;
  213 + text-align: center;
  214 + font-size: 24rpx;
  215 + color: #fff;
  216 + background: transparent;
  217 + transform: translate(-50%, -50%) scale(1);
  218 + -webkit-transform: translate(-50%, -50%) scale(1);
  219 +}
  220 +
  221 +.item:not(:last-of-type) {
  222 + display: flex;
  223 + justify-content: space-between;
  224 +}
  225 +
  226 +.img {
  227 + width: 400rpx;
  228 + height: 400rpx;
  229 +}
  230 +
  231 +
... ...
pages/goods/goodsInfo/buy_pt.wxml
... ... @@ -47,7 +47,7 @@
47 47 <view style="margin-top: 20rpx">
48 48 <view class="flex-space-between address ai_end xc-width ">
49 49  
50   - <view class="flex ai_end" wx:if="{{def_pick_store}}">
  50 + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}">
51 51 <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
52 52  
53 53  
... ... @@ -70,7 +70,7 @@
70 70 </view>
71 71 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
72 72 <view class="no_store" wx:elif="{{is_normal && def_pick_store && def_pick_store.CanOutQty<=0}}">(库存不足)</view>
73   - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  73 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store && def_pick_store.pickup_name}}">地址:{{def_pick_store.fulladdress}}</view>
74 74 </view>
75 75 <!----商品的属性项目---->
76 76 <view>
... ...
pages/index/index/index.js
... ... @@ -79,6 +79,8 @@ Page({
79 79 },
80 80  
81 81 onLoad: async function(tt) {
  82 + console.log("进入首页-------------");
  83 + console.log(tt);
82 84  
83 85 var th = this;
84 86 var first_leader=tt.first_leader;
... ... @@ -564,8 +566,6 @@ Page({
564 566 },
565 567 onPageScroll: function(e) {
566 568 this.data.scrollTop=e.scrollTop;
567   -
568   -
569 569 var t = getCurrentPages();
570 570 "pages/index/index/index" == t[t.length - 1].route;
571 571 /*--(e.scrollTop > 10 ? wx.setNavigationBarColor({
... ... @@ -582,7 +582,19 @@ Page({
582 582 url: "/pages/goods/search/search"
583 583 });
584 584 },
585   - onShareAppMessage: function(e) {
  585 + onShareAppMessage: function(e) {
  586 + var url="/pages/index/index/index";
  587 + var userInfo=getApp().globalData.userInfo;
  588 + //是分销商才带
  589 + if(userInfo && userInfo['is_distribut']==1){
  590 + url+="?first_leader="+userInfo.user_id;
  591 + }
  592 + console.log("---首页---分享--");
  593 + console.log(url);
  594 + var ob={
  595 + title: getApp().globalData.config.store_name,
  596 + path:url,
  597 + };
586 598 return o.share;
587 599 },
588 600  
... ...
pages/togoin/togoin.js
1 1 var t = require("../../utils/common.js");
2   -var app=getApp();
  2 +const app=getApp();
3 3 var os = app.globalData.setting;
  4 +var regeneratorRuntime = require('../../utils/runtime.js');
4 5  
5 6 Page({
6 7 data: {
... ... @@ -14,6 +15,9 @@ Page({
14 15 //--判断是否有接受到邀请人的ID--
15 16 if(options.first_leader){
16 17 this.setData({first_leader:options.first_leader});
  18 + }else if(getApp().globalData.first_leader){
  19 + this.setData({first_leader:getApp().globalData.first_leader});
  20 +
17 21 }
18 22 var th=this;
19 23 app.getConfig(function (e) {
... ... @@ -41,52 +45,67 @@ Page({
41 45 //-- 会员授权 --
42 46 bindGetUserInfo: function(ee) {
43 47 var that = this;
44   - var user=ee.detail.userInfo;
45   - //此处授权得到userInfo
46   - getApp().globalData.getu = user;
47   -
48   - //--拿下code--
49   - wx.login({
50   - success: function (o) {
51   - var dd = {
52   - js_code:o.code,
53   - store_id: os.stoid,
54   - nickname: app.clear_word(app.globalData.getu.nickName),
55   - head_pic: app.clear_word(app.globalData.getu.avatarUrl)
56   - };
57   -
58   - //-- 导购会员ID --
59   - if(getApp().globalData.guide_id){
60   - dd.guide_id=getApp().globalData.guide_id;
61   - }
62   -
63   - getApp().request.get("/api/weshop/users/openidandkey", {
64   - data: dd,
65   - success: function (e) {
66   - if(e.data.code==0){
67   - that.setData({user:user})
68   - //如果有会员的话,没有sessionKey
69   - if(!e.data.data.sessionKey){
70   - getApp().showWarning("登录成功");
71   - getApp().globalData.userInfo=e.data.data;
72   - getApp().globalData.user_id=e.data.data.user_id;
73   - getApp().globalData.openid = e.data.data.weapp_openid;
74   -
75   - setTimeout(function () {
76   - wx.navigateBack({ delta: 1}) //返回上一页
77   - },1000)
78   - }else{
79   - getApp().globalData.sessionKey=e.data.data.sessionKey;
80   - getApp().globalData.openid=e.data.data.openid;;
81   - that.setData({show_bind:1})
82   - }
83   - }else{
84   - getApp().confirmBox(e.data.msg);
85   - }
86   - }
87   - });
88   - }
89   - })
  48 + //-- 点击授权 --
  49 + that.getUserProfile(function(res){
  50 + var user=res;
  51 + //--拿下code--
  52 + wx.login({
  53 + success: function (o) {
  54 + var dd = {
  55 + js_code:o.code,
  56 + store_id: os.stoid,
  57 + nickname: app.clear_word(app.globalData.getu.nickName),
  58 + head_pic: app.clear_word(app.globalData.getu.avatarUrl)
  59 + };
  60 + //-- 导购会员ID --
  61 + if(getApp().globalData.guide_id){
  62 + dd.guide_id=getApp().globalData.guide_id;
  63 + }
  64 +
  65 + getApp().request.get("/api/weshop/users/openidandkey", {
  66 + data: dd,
  67 + success: function (e) {
  68 + if(e.data.code==0){
  69 + that.setData({user:user})
  70 + //如果有会员的话,没有sessionKey
  71 + if(!e.data.data.sessionKey){
  72 + getApp().showWarning("登录成功");
  73 + getApp().globalData.userInfo=e.data.data;
  74 + getApp().globalData.user_id=e.data.data.user_id;
  75 + getApp().globalData.openid = e.data.data.weapp_openid;
  76 + //把会员的信息存在内存
  77 + wx.setStorageSync("userinfo",e.data.data);
  78 +
  79 + setTimeout(function () {
  80 + wx.navigateBack({ delta: 1}) //返回上一页
  81 + },1000)
  82 + }else{
  83 + getApp().globalData.sessionKey=e.data.data.sessionKey;
  84 + getApp().globalData.openid=e.data.data.openid;
  85 + that.setData({show_bind:1});
  86 + }
  87 + }else{
  88 + getApp().confirmBox(e.data.msg);
  89 + }
  90 + }
  91 + });
  92 + }
  93 + })
  94 + })
  95 + },
  96 +
  97 + //-- 调整后的获取会员信息 --
  98 + getUserProfile:function(func){
  99 + var that=this;
  100 + wx.getUserProfile({
  101 + desc:'获取用户相关信息',
  102 + success:res=>{
  103 + console.log("getUserProfile",res);
  104 + //此处授权得到userInfo
  105 + getApp().globalData.getu = res.userInfo;
  106 + func(res.userInfo);
  107 + }
  108 + });
90 109 },
91 110  
92 111 //暂不登录,返回上一页
... ... @@ -101,7 +120,7 @@ Page({
101 120 this.setData({show_bind:1})
102 121 },
103 122  
104   - save_the_data:function (r,e,sessionKey,openid) {
  123 + save_the_data: async function (r,e,sessionKey,openid) {
105 124 var app=getApp(),a=app,th=this;
106 125 var dd = {
107 126 oauth: "miniapp",
... ... @@ -117,13 +136,22 @@ Page({
117 136 };
118 137 //--如果有邀请人的时候--
119 138 if(th.data.first_leader){
120   - dd.first_leader=th.data.first_leader;
  139 + //判断一下分享人是不是分享商
  140 + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid+"/"+th.data.first_leader,{}).then(res=>{
  141 + if(res.data.code==0){
  142 + var user= res.data.data;
  143 + if(user.is_distribut==1){
  144 + dd.first_leader=th.data.first_leader;
  145 + }
  146 + }
  147 + })
121 148 }
122 149 //-- 导购会员ID --
123 150 if(getApp().globalData.guide_id){
124 151 dd.guide_id=getApp().globalData.guide_id;
125 152 }
126   -
  153 +
  154 + console.log("-----会员注册的信息-------");
127 155 console.log(dd);
128 156 app.request.get("/api/weshop/users/thirdLogin", {
129 157 data: dd,
... ...
pages/togoin/togoin.wxml
... ... @@ -15,7 +15,7 @@
15 15 <view>
16 16 <view class="phones">
17 17 <!-- 授权获取基础信息 -->
18   - <button hidden="{{user}}" class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">
  18 + <button hidden="{{user}}" class="getPhoneNumber" bindtap="bindGetUserInfo">
19 19 <view class="flex flex-center2 ali-c">
20 20 <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image>
21 21 <view>微信账号快捷登录</view>
... ...
utils/filter.wxs
... ... @@ -58,9 +58,28 @@ var filters = {
58 58 },
59 59  
60 60  
  61 + // show_default: function (value, placeholder, multiple) {
  62 + // if(typeof value === 'number') {
  63 + // if(isNaN(value) || value === 0) {
  64 + // return placeholder || '0';
  65 + // } else {
  66 + // if(multiple) {
  67 + // return value / multiple;
  68 + // } else {
  69 + // return value;
  70 + // }
  71 + // };
  72 + // } else if(value === '' || value === undefined || value === null) {
  73 + // return placeholder || '-';
  74 + // } else {
  75 + // return value;
  76 + // }
  77 + // },
61 78 show_default: function (value, placeholder, multiple) {
62 79 if(typeof value === 'number') {
63   - if(isNaN(value) || value === 0) {
  80 + if(isNaN(value)) {
  81 + return placeholder || '-';
  82 + } else if(value === 0) {
64 83 return placeholder || '0';
65 84 } else {
66 85 if(multiple) {
... ... @@ -77,6 +96,25 @@ var filters = {
77 96 },
78 97  
79 98  
  99 + // 根据状态值返回相应的状态文字
  100 + // num:状态数值,
  101 + // arr: 状态文字数组,
  102 + // 文字顺序必须跟状态数值对应
  103 + status: function(num, arr) {
  104 + // var text = '';
  105 + // if(num == 0) {
  106 + // text = '未付款';
  107 + // } else if(num == 1) {
  108 + // text = '已付款';
  109 + // } else if(num == 2) {
  110 + // text = '等待分成(已收货)';
  111 + // } else if(num == 3) {
  112 + // text = '已完成';
  113 + // };
  114 + return arr[num];
  115 + },
  116 +
  117 +
80 118  
81 119  
82 120 };
... ... @@ -89,4 +127,5 @@ module.exports = {
89 127 pInt: filters.pInt,
90 128 show_gui_ge: filters.show_gui_ge,
91 129 show_default: filters.show_default,
  130 + status: filters.status,
92 131 }
93 132 \ No newline at end of file
... ...
utils/weapp-icon.wxss 0 → 100644
  1 +
  2 +.t-icon {
  3 + display: inline-block;
  4 + width: 16px;
  5 + height: 16px;
  6 + background-repeat: no-repeat;
  7 + background-position: center;
  8 + background-size: 100%;
  9 +}
  10 +
  11 +
  12 +
  13 +.t-icon-sort-up {
  14 + background: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20width%3D%27100%25%27%20height%3D%27100%25%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22t-icon-sort-up%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20d%3D%22M-109.37837037-109.37837037h1242.75674074v1242.75674074H-109.37837037z%22%20fill%3D%22%23FFFFFF%22%20fill-opacity%3D%220%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M242.7360391%20615.56306132h538.5279218a20.71261275%2020.71261275%200%200%201%2016.57008947%2033.14018016l-269.2639609%20359.05313542a20.71261275%2020.71261275%200%200%201-33.14017894%200L226.16594963%20648.70324148A20.71261275%2020.71261275%200%200%201%20242.7360391%20615.56306132z%22%20fill%3D%22%23C7C7C7%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M528.57008947%2016.2436231l269.2639609%20359.05313542A20.71261275%2020.71261275%200%200%201%20781.2639609%20408.43693868H242.7360391a20.71261275%2020.71261275%200%200%201-16.57008947-33.14018016l269.2639609-359.05313542a20.71261275%2020.71261275%200%200%201%2033.14017894%200z%22%20fill%3D%22%235A5A5A%22%20%3E%3C%2Fpath%3E%3C%2Fsvg%3E);
  15 +}
... ...