Commit 6543f8b6b1754393abde3623ef777a5157107f13

Authored by 后端研发-苏明海
2 parents 2199d2f6 3e80d9d6

Merge branch 'dev' into 'test'

Dev

See merge request !441
components/share_box/share_box.js 0 → 100644
  1 +var t = getApp(),os =t.globalData.setting;
  2 +Component({
  3 + properties: {
  4 + },
  5 + data: {
  6 + iurl:os.imghost,
  7 + },
  8 + ready: function() {
  9 + },
  10 + methods: {
  11 + //--- 分享 ---
  12 + go_share:function () {
  13 + this.triggerEvent('go_share')
  14 + }
  15 +
  16 + }
  17 +
  18 +})
0 \ No newline at end of file 19 \ No newline at end of file
components/share_box/share_box.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 \ No newline at end of file 5 \ No newline at end of file
components/share_box/share_box.wxml 0 → 100644
  1 +<button class="box_main" style="background-image:url({{iurl}}/miniapp/images/shareimg.png)" data-id="shareBtn" open-type="share" plain="true">
  2 +</button>
  3 +
components/share_box/share_box.wxss 0 → 100644
  1 +.box_main{
  2 + width: 80rpx;height: 80rpx; background-color: #fff; border-radius: 50%; border: 1rpx solid #adadad; position: fixed;right: 0; top:50%;
  3 + background-repeat: no-repeat;background-position: center center; background-size: cover;
  4 +}
  5 +button.control[plain] {
  6 + border: 0;
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
packageA/pages/prom_list/prom_list.js
@@ -370,6 +370,20 @@ Page({ @@ -370,6 +370,20 @@ Page({
370 prom_id:o.prom_id 370 prom_id:o.prom_id
371 }; 371 };
372 372
  373 + //---是不是从收藏夹出来的---
  374 + if(th.data.c_guide_id){
  375 + newd['guide_id'] = th.data.c_guide_id;
  376 + newd['guide_type']=2;
  377 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  378 + }else{
  379 + if(getApp().globalData.guide_id){
  380 + newd['guide_id'] = getApp().globalData.guide_id;
  381 + newd['guide_type']=0;
  382 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  383 + }
  384 + }
  385 +
  386 +
373 //-----如果是秒杀,团购,积分购,拼团----- 387 //-----如果是秒杀,团购,积分购,拼团-----
374 if (th.data.data.prom_type != 5) { 388 if (th.data.data.prom_type != 5) {
375 return s.my_warnning("商品不是搭配活动!", 0, th); 389 return s.my_warnning("商品不是搭配活动!", 0, th);
pages/cart/cart/cart.js
@@ -57,9 +57,12 @@ Page({ @@ -57,9 +57,12 @@ Page({
57 var th = this; 57 var th = this;
58 //调用底部导航 58 //调用底部导航
59 t.editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url); 59 t.editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url);
60 -  
61 this.getCardList(); 60 this.getCardList();
62 - if(getApp().globalData.user_id) getApp().requestCardNum(); 61 + //--强行等待,让购物车的数量能够正确的线上
  62 + setTimeout(function () {
  63 + if(getApp().globalData.user_id) getApp().requestCardNum(th);
  64 + },500)
  65 +
63 //--获取是否又秒杀活动-- 66 //--获取是否又秒杀活动--
64 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { 67 getApp().request.promiseGet("/api/ms/flash_sale/spikepage", {
65 data: { 68 data: {
@@ -657,10 +660,11 @@ Page({ @@ -657,10 +660,11 @@ Page({
657 e.doCheckAll(); 660 e.doCheckAll();
658 661
659 t.goods_num=false_data.false_data.buy_limit; 662 t.goods_num=false_data.false_data.buy_limit;
660 - e.update_cart(t, pitem, item);  
661 - 663 + e.update_cart(t, pitem, item);
662 return false; 664 return false;
663 } 665 }
  666 + e.update_cart(t, pitem, item);
  667 +
664 }else{ 668 }else{
665 //--- 看一下是不是线下库存 --- 669 //--- 看一下是不是线下库存 ---
666 if(th.data.sales_rules==2){ 670 if(th.data.sales_rules==2){
@@ -789,6 +793,7 @@ Page({ @@ -789,6 +793,7 @@ Page({
789 e.check_prom_activity(i) 793 e.check_prom_activity(i)
790 } 794 }
791 e.doCheckAll(); 795 e.doCheckAll();
  796 + getApp().requestCardNum(e);
792 } 797 }
793 }); 798 });
794 }, 799 },
pages/cart/cart2/cart2.js
@@ -152,6 +152,7 @@ Page({ @@ -152,6 +152,7 @@ Page({
152 console.log("getuser_addr") 152 console.log("getuser_addr")
153 console.log(ie) 153 console.log(ie)
154 154
  155 +
155 //地址切换要把包邮券清空 156 //地址切换要把包邮券清空
156 if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ 157 if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
157 var using_quan=th.data.using_quan; 158 var using_quan=th.data.using_quan;
@@ -167,6 +168,7 @@ Page({ @@ -167,6 +168,7 @@ Page({
167 168
168 //更换地址回来要重新调用计算价钱的接口 169 //更换地址回来要重新调用计算价钱的接口
169 if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ 170 if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
  171 + th.setData({user_addr: ie });
170 if (th.data.is_b_now == 1) { 172 if (th.data.is_b_now == 1) {
171 if(th.data.bn_goods) { 173 if(th.data.bn_goods) {
172 th.calculatePrice2(); 174 th.calculatePrice2();
@@ -176,9 +178,9 @@ Page({ @@ -176,9 +178,9 @@ Page({
176 th.calculatePrice(); 178 th.calculatePrice();
177 } 179 }
178 } 180 }
  181 + }else{
  182 + th.setData({user_addr: ie });
179 } 183 }
180 -  
181 - th.setData({user_addr: ie });  
182 var going=0; 184 var going=0;
183 185
184 186
@@ -280,7 +282,7 @@ Page({ @@ -280,7 +282,7 @@ Page({
280 success: function (su) { 282 success: function (su) {
281 if (su.data.code == 0) { 283 if (su.data.code == 0) {
282 var yuer = parseFloat(th.data.userinfo.user_money - 284 var yuer = parseFloat(th.data.userinfo.user_money -
283 - th.data.userinfo.frozen_money - su.data.data.summoney).toFixed(2); 285 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
284 th.setData({ txmon: su.data.data.summoney, yuer: yuer }); 286 th.setData({ txmon: su.data.data.summoney, yuer: yuer });
285 } 287 }
286 } 288 }
@@ -596,7 +598,7 @@ Page({ @@ -596,7 +598,7 @@ Page({
596 var all_cutprice=0; //所有的优惠减件 598 var all_cutprice=0; //所有的优惠减件
597 var all_order_prom=0; //所有的订单优惠 599 var all_order_prom=0; //所有的订单优惠
598 600
599 - var umoney = th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money; 601 + var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money?th.data.userinfo.frozen_money:0);
600 var freight_free = ee.freight_free; //全场满多少包邮 602 var freight_free = ee.freight_free; //全场满多少包邮
601 var no_ex_id=ee.no_ex_id; 603 var no_ex_id=ee.no_ex_id;
602 var no_ex_good=null; 604 var no_ex_good=null;
@@ -1423,7 +1425,20 @@ Page({ @@ -1423,7 +1425,20 @@ Page({
1423 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 1425 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
1424 'prom_id': th.data.bn_goods.prom_id, //促销活动id 1426 'prom_id': th.data.bn_goods.prom_id, //促销活动id
1425 }; 1427 };
1426 - 1428 +
  1429 + //-- 把导购的信息填入--
  1430 + if(gg.guide_id){
  1431 + goods.guide_id=gg.guide_id;
  1432 + goods.guide_type=gg.guide_type;
  1433 + //调用接口判断是不是会员
  1434 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  1435 + if(res.data.code==0){
  1436 + goods.guide_name=res.data.data.salesman;
  1437 + goods.guide_sn=res.data.data.salesman_no;
  1438 + }
  1439 + })
  1440 + }
  1441 +
1427 //如果不立即购买或者秒杀,如果是线下库存购买的时候 1442 //如果不立即购买或者秒杀,如果是线下库存购买的时候
1428 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){ 1443 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){
1429 var isok=1; 1444 var isok=1;
@@ -1610,6 +1625,19 @@ Page({ @@ -1610,6 +1625,19 @@ Page({
1610 return false; 1625 return false;
1611 } 1626 }
1612 } 1627 }
  1628 +
  1629 + //导购ID
  1630 + if(g_item.guide_id){
  1631 + goods.guide_id=g_item.guide_id;
  1632 + goods.guide_type=g_item.guide_type;
  1633 + //调用接口判断是不是会员
  1634 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{
  1635 + if(res.data.code==0){
  1636 + goods.guide_name=res.data.data.salesman;
  1637 + goods.guide_sn=res.data.data.salesman_no;
  1638 + }
  1639 + })
  1640 + }
1613 1641
1614 item.order_goods.push(goods); 1642 item.order_goods.push(goods);
1615 } 1643 }
@@ -1620,6 +1648,7 @@ Page({ @@ -1620,6 +1648,7 @@ Page({
1620 1648
1621 if (pdata.length==0) return; 1649 if (pdata.length==0) return;
1622 var str = JSON.stringify(pdata); 1650 var str = JSON.stringify(pdata);
  1651 +
1623 1652
1624 wx.showLoading({title: "加载中"}); 1653 wx.showLoading({title: "加载中"});
1625 wx.request({ 1654 wx.request({
pages/cart/cart2_pt/cart2_pt.js
@@ -56,7 +56,8 @@ Page({ @@ -56,7 +56,8 @@ Page({
56 qh:'', //期号 56 qh:'', //期号
57 pt_listno:'',//期号 57 pt_listno:'',//期号
58 is_normal:0, 58 is_normal:0,
59 - is_express:0,//选择物流的控制器 59 + is_express:0,//选择物流的控制器
  60 + yuer:0,
60 }, 61 },
61 onLoad: function(t) { 62 onLoad: function(t) {
62 console.log("onLoad_pt_cart"); 63 console.log("onLoad_pt_cart");
@@ -128,6 +129,18 @@ Page({ @@ -128,6 +129,18 @@ Page({
128 th.setData({ userinfo: to.globalData.userInfo}); 129 th.setData({ userinfo: to.globalData.userInfo});
129 //获取立即购买的商品信息 130 //获取立即购买的商品信息
130 th.get_buy_goods(); 131 th.get_buy_goods();
  132 +
  133 + //获取提现金额
  134 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  135 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  136 + success: function (su) {
  137 + if (su.data.code == 0) {
  138 + var yuer = parseFloat(th.data.userinfo.user_money -
  139 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  140 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  141 + }
  142 + }
  143 + });
131 }, 144 },
132 145
133 //-----获取立即购买的商品信息---- 146 //-----获取立即购买的商品信息----
@@ -325,12 +338,12 @@ Page({ @@ -325,12 +338,12 @@ Page({
325 var txt2 = "formData.order_amount"; 338 var txt2 = "formData.order_amount";
326 //--------------如果使用余额--------------------- 339 //--------------如果使用余额---------------------
327 if (th.data.bn_use_money == 1) { 340 if (th.data.bn_use_money == 1) {
328 - if (th.data.userinfo.user_money > total_m) { 341 + if ( parseFloat(th.data.yuer) > total_m) {
329 th.setData({ [txt]: total_m, [txt2]:0 }) 342 th.setData({ [txt]: total_m, [txt2]:0 })
330 }else{ 343 }else{
331 - order_m = order_m - th.data.userinfo.user_money; 344 + order_m = order_m - parseFloat(th.data.yuer);
332 order_m = order_m.toFixed(2); 345 order_m = order_m.toFixed(2);
333 - th.setData({ [txt]: th.data.userinfo.user_money, [txt2]: order_m }) 346 + th.setData({ [txt]: th.data.userinfo.yuer, [txt2]: order_m })
334 } 347 }
335 }else{ 348 }else{
336 th.setData({ [txt]: 0, [txt2]: order_m }) 349 th.setData({ [txt]: 0, [txt2]: order_m })
@@ -422,6 +435,13 @@ Page({ @@ -422,6 +435,13 @@ Page({
422 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 435 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
423 'prom_id': th.data.bn_goods.prom_id, //促销活动id 436 'prom_id': th.data.bn_goods.prom_id, //促销活动id
424 }; 437 };
  438 +
  439 + //--导购分享过来的id--
  440 + if(gg.guide_id){
  441 + goods.guide_id=gg.guide_id;
  442 + goods.guide_type=gg.guide_type;
  443 + }
  444 +
425 item.order_goods.push(goods); 445 item.order_goods.push(goods);
426 pdata.push(item); 446 pdata.push(item);
427 447
pages/cart/cart2_pt/cart2_pt.wxml
@@ -105,7 +105,7 @@ @@ -105,7 +105,7 @@
105 <view class="set-mes" wx:if="{{userinfo.user_money>0}}"> 105 <view class="set-mes" wx:if="{{userinfo.user_money>0}}">
106 <view class="use-item" bindtap='set_bn_useyuer'> 106 <view class="use-item" bindtap='set_bn_useyuer'>
107 <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> 107 <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
108 - <view class="yu_er">使用余额 :¥{{userinfo.user_money}} </view> 108 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
109 109
110 </view> 110 </view>
111 </view> 111 </view>
pages/cart/cart_wk/cart_wk.js
@@ -389,7 +389,7 @@ Page({ @@ -389,7 +389,7 @@ Page({
389 getApp().my_warnning("支付成功",1,th); 389 getApp().my_warnning("支付成功",1,th);
390 setTimeout(function () { 390 setTimeout(function () {
391 th.setData({ isclose: 0 }); 391 th.setData({ isclose: 0 });
392 - wx.navigateTo({ 392 + wx.redirectTo({
393 url: "/pages/user/order_list/order_list" 393 url: "/pages/user/order_list/order_list"
394 }) 394 })
395 }, 1000) 395 }, 1000)
pages/giftpack/birthdaygift/birthdaygift.js
@@ -123,6 +123,14 @@ Page({ @@ -123,6 +123,14 @@ Page({
123 th.GetList(); 123 th.GetList();
124 }, 124 },
125 onShow: function onShow() { 125 onShow: function onShow() {
  126 + //--先判断会员状态--
  127 + var user_info = getApp().globalData.userInfo;
  128 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  129 + wx.navigateTo({
  130 + url: '/pages/getphone/getphone',
  131 + })
  132 + return false;
  133 + }
126 134
127 }, 135 },
128 GetReceive: function() { 136 GetReceive: function() {
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -37,6 +37,14 @@ Page({ @@ -37,6 +37,14 @@ Page({
37 th.getList(); 37 th.getList();
38 }, 38 },
39 onShow: function() { 39 onShow: function() {
  40 + //--先判断会员状态--
  41 + var user_info = getApp().globalData.userInfo;
  42 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  43 + wx.navigateTo({
  44 + url: '/pages/getphone/getphone',
  45 + })
  46 + return false;
  47 + }
40 48
41 }, 49 },
42 50
pages/giftpack/evaluategift/evaluategift.js
@@ -136,6 +136,14 @@ Page({ @@ -136,6 +136,14 @@ Page({
136 th.GetList(); 136 th.GetList();
137 }, 137 },
138 onShow: function() { 138 onShow: function() {
  139 + //--先判断会员状态--
  140 + var user_info = getApp().globalData.userInfo;
  141 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  142 + wx.navigateTo({
  143 + url: '/pages/getphone/getphone',
  144 + })
  145 + return false;
  146 + }
139 147
140 }, 148 },
141 GetReceive: function() { 149 GetReceive: function() {
pages/giftpack/festival/festival.js
@@ -130,6 +130,14 @@ Page({ @@ -130,6 +130,14 @@ Page({
130 }); 130 });
131 }, 131 },
132 onShow: function() { 132 onShow: function() {
  133 + //--先判断会员状态--
  134 + var user_info = getApp().globalData.userInfo;
  135 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  136 + wx.navigateTo({
  137 + url: '/pages/getphone/getphone',
  138 + })
  139 + return false;
  140 + }
133 141
134 }, 142 },
135 GetReceive: function() { 143 GetReceive: function() {
pages/giftpack/giftpacklist/giftpacklist.js
@@ -44,6 +44,14 @@ Page({ @@ -44,6 +44,14 @@ Page({
44 th.close(); 44 th.close();
45 }, 45 },
46 onShow: function() { 46 onShow: function() {
  47 + //--先判断会员状态--
  48 + var user_info = getApp().globalData.userInfo;
  49 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  50 + wx.navigateTo({
  51 + url: '/pages/getphone/getphone',
  52 + })
  53 + return false;
  54 + }
47 55
48 }, 56 },
49 GetBuyPrice: function(e) { 57 GetBuyPrice: function(e) {
pages/giftpack/mygiftpack/mygiftpack.js
@@ -38,6 +38,14 @@ Page({ @@ -38,6 +38,14 @@ Page({
38 th.getList(); 38 th.getList();
39 }, 39 },
40 onShow: function() { 40 onShow: function() {
  41 + //--先判断会员状态--
  42 + var user_info = getApp().globalData.userInfo;
  43 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  44 + wx.navigateTo({
  45 + url: '/pages/getphone/getphone',
  46 + })
  47 + return false;
  48 + }
41 49
42 }, 50 },
43 getList: function() { 51 getList: function() {
pages/giftpack/newvipgift/newvipgift.js
@@ -122,6 +122,14 @@ Page({ @@ -122,6 +122,14 @@ Page({
122 th.GetList(); 122 th.GetList();
123 }, 123 },
124 onShow: function() { 124 onShow: function() {
  125 + //--先判断会员状态--
  126 + var user_info = getApp().globalData.userInfo;
  127 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  128 + wx.navigateTo({
  129 + url: '/pages/getphone/getphone',
  130 + })
  131 + return false;
  132 + }
125 133
126 }, 134 },
127 GetReceive: function() { 135 GetReceive: function() {
pages/goods/categoryList/categoryList.js
1 var t = getApp(), e = t.request, oo = t.globalData.setting; 1 var t = getApp(), e = t.request, oo = t.globalData.setting;
2 -  
3 var i = function (i) { 2 var i = function (i) {
4 return i && i.__esModule ? i : { 3 return i && i.__esModule ? i : {
5 default: i 4 default: i
@@ -7,65 +6,87 @@ var i = function (i) { @@ -7,65 +6,87 @@ var i = function (i) {
7 }(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js"); 6 }(require("../../../utils/LoadMore.js")), a = new i.default(), ut = require("../../../utils/util.js");
8 //t = i,e = t 7 //t = i,e = t
9 Page({ 8 Page({
10 - data: {  
11 - is_date:true,  
12 - scrollHeight: 0,  
13 - currentTab:-1,  
14 - abc:0,  
15 - windowHeight:0,  
16 - windowWidth: 0,  
17 - eachLetterHeight:0,  
18 - lettersPosition:0,  
19 - catelist:null, //分类读取  
20 - nationlist: null,//国家读取  
21 - groups: null, //品牌读取  
22 - iurl: oo.imghost,//图片地址  
23 -  
24 - // 当前选择的导航字母  
25 - selected: 0,  
26 - // 选择字母视图滚动的位置id  
27 - scrollIntoView: 'A',  
28 - // 导航字母  
29 - letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',  
30 - 'U', 'V', 'W', 'X', 'Y', 'Z'],  
31 - //控制新旧分类版本  
32 - is_used_share:0,  
33 - //国家的控制属性  
34 - is_country:1,  
35 - //品牌的控制属性  
36 - is_brand:1,  
37 - //选择分类的控制属性  
38 - select_classify_on:223,  
39 - index:223,  
40 - classify_name:"国家",//项目类型  
41 - brand_list:null,//品牌列表  
42 -  
43 - one_level_classify:[],// 新的版本左边的边分类1级  
44 - is_level_three:0,//判断有没有3级  
45 - cat_id:0,  
46 - pl_timer: null,//只有品类的定时器  
47 - is_pl_time:0,  
48 - requestData:null, //风格三的商品数据列表 分页  
49 - stylePage:1, //商品列表分页标识  
50 -  
51 - //风格三使用  
52 - url: t.globalData.setting.imghost,  
53 - currentPage: 1,  
54 - requestData: null,  
55 - allData: null,  
56 - openFilterModal: !1,  
57 - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1",  
58 - requestUrl: "",  
59 - tabname: "goods_id", //排序的字段  
60 - adname: "desc", //升降的字段  
61 - is_new: 0,  
62 - is_hot: 0,  
63 - msgStatus:false, //页面显示暂无数据状态  
64 - countDownNum: 3,  
65 - timer: '', //定时器  
66 - lastMsg:false,  
67 - toView:"",  
68 - }, 9 + data: {
  10 + is_date:true,
  11 + scrollHeight: 0,
  12 + currentTab:-1,
  13 + abc:0,
  14 + windowHeight:0,
  15 + windowWidth: 0,
  16 + eachLetterHeight:0,
  17 + lettersPosition:0,
  18 + catelist:null, //分类读取
  19 + nationlist: null,//国家读取
  20 + groups: null, //品牌读取
  21 + iurl: oo.imghost,//图片地址
  22 +
  23 + // 当前选择的导航字母
  24 + selected: 0,
  25 + // 选择字母视图滚动的位置id
  26 + scrollIntoView: 'A',
  27 + // 导航字母
  28 + letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
  29 + 'U', 'V', 'W', 'X', 'Y', 'Z'],
  30 + //控制新旧分类版本
  31 + is_used_share:0,
  32 + //国家的控制属性
  33 + is_country:1,
  34 + //品牌的控制属性
  35 + is_brand:1,
  36 + //选择分类的控制属性
  37 + select_classify_on:223,
  38 + index:223,
  39 + classify_name:"国家",//项目类型
  40 + brand_list:null,//品牌列表
  41 +
  42 + one_level_classify:[],// 新的版本左边的边分类1级
  43 + is_level_three:0,//判断有没有3级
  44 + cat_id:0,
  45 + pl_timer: null,//只有品类的定时器
  46 + is_pl_time:0,
  47 + requestData:null, //风格三的商品数据列表 分页
  48 + stylePage:1, //商品列表分页标识
  49 +
  50 + //风格三使用
  51 + url: t.globalData.setting.imghost,
  52 + currentPage: 1,
  53 + allData: null,
  54 + openFilterModal: !1,
  55 + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1",
  56 + requestUrl: "",
  57 + tabname: "goods_id", //排序的字段
  58 + adname: "desc", //升降的字段
  59 + is_new: 0,
  60 + is_hot: 0,
  61 + msgStatus:false, //页面显示暂无数据状态
  62 + countDownNum: 3,
  63 + timer: '', //定时器
  64 + lastMsg:false,
  65 + toView:"",
  66 + is_show_class:false,//是否添加新样式
  67 + status_show:0,
  68 + currentTab: 0, //预设当前项的值
  69 + },
  70 +
  71 +
  72 + //判断当前滚动超过一屏时,设置tab标题滚动条。
  73 + checkCor: function() {
  74 + let that = this;
  75 + //这里计算按照实际情况进行修改,动态数据要进行动态分析
  76 + //思路:窗体高度/单个分类高度 200rpx 转px计算 =>得到一屏幕所显示的个数,结合后台传回分类总数进行计算
  77 + //数据很多可以多次if判断然后进行滚动距离计算即可
  78 + if (that.data.currentTab > 7) {
  79 + that.setData({
  80 + scrollTop: 500
  81 + })
  82 + } else {
  83 + that.setData({
  84 + scrollTop: 0
  85 + })
  86 + }
  87 + },
  88 +
  89 +
69 onLoad: function(tt) { 90 onLoad: function(tt) {
70 var that = this; 91 var that = this;
71 that.get_brand(); 92 that.get_brand();
@@ -156,8 +177,11 @@ Page({ @@ -156,8 +177,11 @@ Page({
156 //调用底部导航 177 //调用底部导航
157 t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url); 178 t.editTabBar(that,getApp().globalData.setting.stoid,getApp().globalData.url);
158 //this.requestFirstCategoris(); 179 //this.requestFirstCategoris();
159 - if(getApp().globalData.user_id) getApp().requestCardNum();  
160 - getApp().getConfig2(function (e) { 180 + setTimeout(function () {
  181 + if (getApp().globalData.user_id) getApp().requestCardNum(that);
  182 + },500)
  183 +
  184 + getApp().getConfig2(function (e) {
161 185
162 var data=e; 186 var data=e;
163 var switch_list_data = data.switch_list; 187 var switch_list_data = data.switch_list;
@@ -189,10 +213,14 @@ Page({ @@ -189,10 +213,14 @@ Page({
189 } 213 }
190 that.setData({ is_level_three: is_lev_thr }); 214 that.setData({ is_level_three: is_lev_thr });
191 if (is_lev_thr!=1) { 215 if (is_lev_thr!=1) {
192 - that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name, goodslist: item.array });  
193 - } else {  
194 - that.setData({ select_classify_on: 0, index: 0, goodslist: arr });  
195 - } 216 + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: item.array });
  217 + console.log("id:="+item.items.id)
  218 + that.style(that.data.stylePage,that.data.cat_id);
  219 + } else {
  220 + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name,cat_id: item.items.id,goodslist: arr });
  221 + console.log("id:="+item.items.id)
  222 + that.style(that.data.stylePage,that.data.cat_id);
  223 + }
196 } 224 }
197 else{ 225 else{
198 that.setData({ select_classify_on: 0, index: 0, goodslist: null,classify_name:item.items.name,is_level_three: 0}); 226 that.setData({ select_classify_on: 0, index: 0, goodslist: null,classify_name:item.items.name,is_level_three: 0});
@@ -222,6 +250,12 @@ Page({ @@ -222,6 +250,12 @@ Page({
222 } else if (that.data.is_show_pl) { 250 } else if (that.data.is_show_pl) {
223 that.setData({ currentTab: 0 }); 251 that.setData({ currentTab: 0 });
224 } 252 }
  253 + // 获取默认选中的第一个
  254 + if(that.data.is_show_gb && that.data.select_classify_on == 223){
  255 + that.setData({ status_show: 1 });
  256 + }else if(that.data.is_show_pp && that.data.select_classify_on == 220){
  257 + that.setData({ status_show: 2 });
  258 + }
225 }) 259 })
226 260
227 }, 261 },
@@ -291,8 +325,18 @@ Page({ @@ -291,8 +325,18 @@ Page({
291 } 325 }
292 } 326 }
293 } 327 }
294 -  
295 } 328 }
  329 + for(var i=0;i<arr.length;i++){
  330 + arr[i]['items']['is_show_class'] = false;
  331 + var mobile_name = arr[i]['items']['name']
  332 + if(mobile_name.length > 4){
  333 + arr[i]['items']['name'] = mobile_name.substring(0, 4)
  334 + }
  335 + }
  336 + if(t.data.is_show_pl==1 && t.data.is_show_pp != 1 && t.data.is_show_gb != 1){
  337 + arr[0]['items']['is_show_class'] = true;
  338 + }
  339 + //console.log(arr)
296 t.setData({one_level_classify:arr}); 340 t.setData({one_level_classify:arr});
297 341
298 } 342 }
@@ -557,6 +601,37 @@ Page({ @@ -557,6 +601,37 @@ Page({
557 }, 601 },
558 // 新的版本分类点击一级分类 602 // 新的版本分类点击一级分类
559 click_classify:function(e){ 603 click_classify:function(e){
  604 + let cur = e.currentTarget.dataset.current;
  605 + if (this.data.currentTab == cur) {
  606 + return false;
  607 + } else {
  608 + wx.pageScrollTo({
  609 + scrollTop: 0
  610 + })
  611 + this.setData({
  612 + currentTab: cur,
  613 + select_classify_on:cur
  614 + })
  615 + this.checkCor();
  616 + }
  617 + // if(e.currentTarget.dataset.index == 223){
  618 + // this.setData({ status_show: 1});
  619 + // }else if(e.currentTarget.dataset.index == 220){
  620 + // this.setData({ status_show: 2});
  621 + // }else{
  622 + // this.setData({ status_show: 0});
  623 + // }
  624 + var arr2 = this.data.one_level_classify
  625 + for(var i=0;i<arr2.length;i++){
  626 + if(i == e.currentTarget.dataset.index){
  627 + arr2[i]['items']['is_show_class'] = true
  628 + }else{
  629 + arr2[i]['items']['is_show_class'] = false
  630 + }
  631 + }
  632 + this.setData({ one_level_classify: arr2});
  633 + //this.data.one_level_classify[e.currentTarget.dataset.index]['items']['is_show_class'] = true
  634 + console.log(e.currentTarget.dataset.index)
560 clearInterval(this.data.timer); 635 clearInterval(this.data.timer);
561 this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0}); 636 this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0});
562 this.data.ishaf_three = 0; 637 this.data.ishaf_three = 0;
@@ -565,12 +640,13 @@ Page({ @@ -565,12 +640,13 @@ Page({
565 var cid = e.currentTarget.dataset.cid; 640 var cid = e.currentTarget.dataset.cid;
566 var pid = e.currentTarget.dataset.pid; 641 var pid = e.currentTarget.dataset.pid;
567 var arr = e.currentTarget.dataset.arr; 642 var arr = e.currentTarget.dataset.arr;
568 - console.log("cid:=" + cid) 643 + console.log("cid:=" + name)
569 if (indexs == 220) { this.get_brand(); } 644 if (indexs == 220) { this.get_brand(); }
570 //==2的时候 请求数据为商品,不为分类 645 //==2的时候 请求数据为商品,不为分类
571 if (this.data.is_used_share == 2) { 646 if (this.data.is_used_share == 2) {
572 - this.style(this.data.stylePage, cid)  
573 - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,lastMsg: false, }); 647 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,lastMsg: false, });
  648 + console.log("edqdqw:="+this.data.select_classify_on)
  649 + this.style(this.data.stylePage, cid)
574 }else{ 650 }else{
575 if (arr != "undefined" && arr != undefined) { 651 if (arr != "undefined" && arr != undefined) {
576 if (arr.length == 0) { 652 if (arr.length == 0) {
@@ -588,10 +664,10 @@ Page({ @@ -588,10 +664,10 @@ Page({
588 this.setData({ is_level_three: is_lev_thr }); 664 this.setData({ is_level_three: is_lev_thr });
589 665
590 if (this.data.is_level_three != 1) { 666 if (this.data.is_level_three != 1) {
591 - this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });  
592 - } else {  
593 - this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr });  
594 - } 667 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });
  668 + } else {
  669 + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr });
  670 + }
595 } 671 }
596 } 672 }
597 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,}); 673 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,});
@@ -756,6 +832,8 @@ Page({ @@ -756,6 +832,8 @@ Page({
756 if (page != 1) { 832 if (page != 1) {
757 var dataArray = s.data.one_level_classify 833 var dataArray = s.data.one_level_classify
758 var index = s.data.index 834 var index = s.data.index
  835 + dataArray[index]['items']['is_show_class'] = false
  836 + dataArray[index+1]['items']['is_show_class'] = true
759 console.log(dataArray[index + 1]['items']) 837 console.log(dataArray[index + 1]['items'])
760 s.setData({ 838 s.setData({
761 msgStatus: true, 839 msgStatus: true,
@@ -763,7 +841,8 @@ Page({ @@ -763,7 +841,8 @@ Page({
763 index: index + 1, 841 index: index + 1,
764 select_classify_on: index + 1, 842 select_classify_on: index + 1,
765 cat_id: dataArray[index + 1]['items']['id'], 843 cat_id: dataArray[index + 1]['items']['id'],
766 - classify_name: dataArray[index + 1]['items']['name'] 844 + classify_name: dataArray[index + 1]['items']['name'],
  845 + one_level_classify: dataArray
767 }); 846 });
768 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']) 847 s.style(s.data.stylePage, dataArray[index + 1]['items']['id'])
769 }else{ 848 }else{
@@ -798,12 +877,15 @@ Page({ @@ -798,12 +877,15 @@ Page({
798 lastMsg: true 877 lastMsg: true
799 }); 878 });
800 }else{ 879 }else{
  880 + dataArray[index]['items']['is_show_class'] = false
  881 + dataArray[index+1]['items']['is_show_class'] = true
801 s.setData({ 882 s.setData({
802 stylePage: 1, 883 stylePage: 1,
803 index: index + 1, 884 index: index + 1,
804 select_classify_on: index + 1, 885 select_classify_on: index + 1,
805 cat_id: dataArray[index + 1]['items']['id'], 886 cat_id: dataArray[index + 1]['items']['id'],
806 - classify_name: dataArray[index + 1]['items']['name'] 887 + classify_name: dataArray[index + 1]['items']['name'],
  888 + one_level_classify:dataArray
807 }); 889 });
808 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); 890 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']);
809 } 891 }
@@ -813,6 +895,15 @@ Page({ @@ -813,6 +895,15 @@ Page({
813 s.setData({ 895 s.setData({
814 countDownNum: countDownNum 896 countDownNum: countDownNum
815 }) 897 })
  898 + var arr2 = s.data.one_level_classify
  899 + for(var i=0;i<arr2.length;i++){
  900 + if(i == s.data.index){
  901 + arr2[i]['items']['is_show_class'] = true
  902 + }else{
  903 + arr2[i]['items']['is_show_class'] = false
  904 + }
  905 + }
  906 + s.setData({ one_level_classify: arr2});
816 }, 1000) 907 }, 1000)
817 } 908 }
818 909
pages/goods/categoryList/categoryList.wxml
1 -<!-- 风格1 --> 1 +<!-- 风格1 -->
2 <block wx:if="{{is_used_share==0}}"> 2 <block wx:if="{{is_used_share==0}}">
3 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> 3 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
4 <view class="swiper-tab" > 4 <view class="swiper-tab" >
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 <block wx:elif="{{is_used_share == 1}}"> 98 <block wx:elif="{{is_used_share == 1}}">
99 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> 99 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
100 <!-- 新版分类头部 --> 100 <!-- 新版分类头部 -->
101 - <view class="xc-search-box flex-center white_b"> 101 + <view class="xc-search-box flex-center white_b" style="position:fixed;top:0;z-index:99999">
102 <view class="share-height t-c" bindtap="getScancode" > 102 <view class="share-height t-c" bindtap="getScancode" >
103 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> 103 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
104 <view class="fs24"> 104 <view class="fs24">
@@ -113,46 +113,46 @@ @@ -113,46 +113,46 @@
113 </view> 113 </view>
114 </view> 114 </view>
115 115
116 - <!-- 分类项目内容 -->  
117 - <view class="flex project_height" style="margin-left:-10rpx;margin-bottom:120rpx"> 116 +
  117 + <!-- 分类项目内容 22 -->
  118 + <view class="flex project_height" style="margin-left:-10rpx;margin-bottom:120rpx" id="two_type">
118 <!-- 分类项目的类型 --> 119 <!-- 分类项目的类型 -->
119 - <view class="project_type" style="background-color:#eee">  
120 - <view class="project_type-frame" style="margin-bottom:120rpx">  
121 - <view wx:if="{{is_show_gb}}">  
122 - <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}">  
123 - <text>国</text><text>家</text> 120 + <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:126rpx;">
  121 + <view class="project_type-frame" style="margin-bottom:120rpx;">
  122 + <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">
  123 + <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  124 + <view bindtap="click_classify" style="{{status_show == 1?'margin-top:0':'margin-top:40rpx'}}" class="fs30 flex-space-between {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}">
  125 +
  126 + <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view>
124 127
125 </view> 128 </view>
126 </view> 129 </view>
127 - <view wx:if="{{is_show_pp}}">  
128 - <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs30 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"data-name="品牌">  
129 - <text>品</text><text>牌</text> 130 + <view wx:if="{{is_show_pp}}" class="{{status_show == 2?'':''}}">
  131 + <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  132 + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30 flex-space-between " wx:if="{{is_brand}}"data-index="220"data-name="品牌">
  133 +
  134 + <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view>
130 </view> 135 </view>
131 </view> 136 </view>
132 <view wx:if="{{is_show_pl}}"> 137 <view wx:if="{{is_show_pl}}">
133 138
134 <view wx:for="{{one_level_classify}}" wx:for-item="ittms" > 139 <view wx:for="{{one_level_classify}}" wx:for-item="ittms" >
135 - <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.name}}">  
136 - <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">  
137 - <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">  
138 - <view>  
139 - {{name}}  
140 - </view>  
141 - </view>  
142 -  
143 - </view>  
144 - <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}  
145 - </view> 140 + <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">
  141 + <!-- 添加左边红色条 -->
  142 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  143 + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} fs30 t-c {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">
  144 +
  145 + <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>
146 </view> 146 </view>
147 147
148 </view> 148 </view>
149 - 149 + </view>
150 </view> 150 </view>
151 </view> 151 </view>
152 152
153 </view> 153 </view>
154 <!-- 分类项目的内容 --> 154 <!-- 分类项目的内容 -->
155 - <view class="classify_content"> 155 + <view class="classify_content" style="margin-left:27%;margin-top:130rpx">
156 <!-- 国家的样式 --> 156 <!-- 国家的样式 -->
157 <block wx:if="{{select_classify_on==223&&is_show_gb}}"> 157 <block wx:if="{{select_classify_on==223&&is_show_gb}}">
158 <view class="classify_name fs28 flex-space-between"> 158 <view class="classify_name fs28 flex-space-between">
@@ -288,21 +288,25 @@ @@ -288,21 +288,25 @@
288 <!-- 分类项目内容 --> 288 <!-- 分类项目内容 -->
289 <view class="flex project_height" style="margin-left:-10rpx;"> 289 <view class="flex project_height" style="margin-left:-10rpx;">
290 <!-- 分类项目的类型 --> 290 <!-- 分类项目的类型 -->
291 - <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;"> 291 + <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:126rpx;" id="thress_type3">
292 <view class="project_type-frame" style="margin-bottom:120rpx;"> 292 <view class="project_type-frame" style="margin-bottom:120rpx;">
293 <view wx:if="{{is_show_gb}}"> 293 <view wx:if="{{is_show_gb}}">
294 - <view bindtap="click_classify" class="share_type fs30 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}">  
295 - <text>国</text><text>家</text> 294 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-current="223" data-index="223" data-name="国家" wx:if="{{is_country}}">
  295 + <text style="letter-spacing:50rpx;">国家</text>
296 </view> 296 </view>
297 </view> 297 </view>
298 <view wx:if="{{is_show_pp}}"> 298 <view wx:if="{{is_show_pp}}">
299 - <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs30 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"data-name="品牌">  
300 - <text>品</text><text>牌</text> 299 +
  300 + <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-current="220" data-index="220" data-name="品牌">
  301 + <text style="letter-spacing:50rpx;">品牌</text>
301 </view> 302 </view>
302 </view> 303 </view>
303 <view wx:if="{{is_show_pl}}"> 304 <view wx:if="{{is_show_pl}}">
304 - <view wx:for="{{one_level_classify}}" wx:for-item="ittms" >  
305 - <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.name}}"> 305 + <!-- <view wx:for="{{one_level_classify}}" wx:for-item="ittms" class="class_set_height"> -->
  306 + <!-- <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}"> -->
  307 + <!-- 添加左边红色条 -->
  308 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  309 + <!-- <view bindtap="click_classify" style="{{status_show == 0 && ittms == 0 ?'margin-top:0':'margin-top:0rpx'}}" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs30 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">
306 <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> 310 <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">
307 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> 311 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
308 <view> 312 <view>
@@ -311,11 +315,26 @@ @@ -311,11 +315,26 @@
311 </view> 315 </view>
312 </view> 316 </view>
313 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view> 317 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view>
  318 + </view> -->
  319 + <!-- </view> -->
  320 + <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">
  321 + <view wx:for="{{one_level_classify}}" wx:for-item="ittms" wx:key="{{index}}" class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}" data-current="{{index}}" catchtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" data-index="{{index}}"data-name="{{ittms.items.mobile_name}}">
  322 + <text>{{ittms.items.name}}</text>
  323 + <!-- <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">
  324 + <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
  325 + <text>
  326 + {{name}}
  327 + </text>
  328 + </view>
  329 + </view>
  330 + <text wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</text> -->
314 </view> 331 </view>
315 - </view>  
316 - </view> 332 + </scroll-view>
  333 +
  334 + <!-- </view> -->
317 </view> 335 </view>
318 </view> 336 </view>
  337 + </view>
319 <!-- 分类项目的内容 --> 338 <!-- 分类项目的内容 -->
320 <view class="classify_content" style="margin-left:27%;margin-top:130rpx"> 339 <view class="classify_content" style="margin-left:27%;margin-top:130rpx">
321 <!-- 国家的样式 --> 340 <!-- 国家的样式 -->
@@ -364,7 +383,7 @@ @@ -364,7 +383,7 @@
364 </block> 383 </block>
365 <!-- 品类--> 384 <!-- 品类-->
366 <block wx:if="{{is_show_pl}}"> 385 <block wx:if="{{is_show_pl}}">
367 - <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> 386 + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}">
368 <view style="width:100%;height:100%;"> 387 <view style="width:100%;height:100%;">
369 <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:130rpx;width:70%;background-color:#ffffff;left:27%;padding:0 10rpx;"> 388 <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:130rpx;width:70%;background-color:#ffffff;left:27%;padding:0 10rpx;">
370 <view class="classify_title ellipsis-1">{{classify_name}}</view> 389 <view class="classify_title ellipsis-1">{{classify_name}}</view>
@@ -377,7 +396,7 @@ @@ -377,7 +396,7 @@
377 <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> 396 <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->
378 397
379 <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> 398 <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> -->
380 - <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:120rpx;bottom:0;rigth:0;left:26%;width:73%;margin-bottom:50px;"> 399 + <scroll-view scroll-y scroll-top="{{scrollTop}}" bindscrolltolower='scrollLower' style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:140rpx;bottom:0;rigth:0;left:26%;width:73%;margin-bottom:100rpx;">
381 <view class="null" style="width:100%;height:1px;"></view> 400 <view class="null" style="width:100%;height:1px;"></view>
382 <!-- goodslist --> 401 <!-- goodslist -->
383 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> 402 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
pages/goods/categoryList/categoryList.wxss
@@ -20,7 +20,7 @@ page{height: 100%; background: #fff;} @@ -20,7 +20,7 @@ page{height: 100%; background: #fff;}
20 } 20 }
21 .active{ 21 .active{
22 color:#F65959; 22 color:#F65959;
23 - border-bottom: 4rpx solid #F65959; 23 + /* border-bottom: 4rpx solid #F65959; */
24 } 24 }
25 swiper{ 25 swiper{
26 text-align: center; 26 text-align: center;
@@ -223,7 +223,7 @@ overflow-y: scroll; @@ -223,7 +223,7 @@ overflow-y: scroll;
223 .share_type{ 223 .share_type{
224 margin: auto; 224 margin: auto;
225 width: 58%; 225 width: 58%;
226 - margin-top: 40rpx; 226 + /* margin-top: 40rpx; */
227 } 227 }
228 .xc-letter-spacing{ 228 .xc-letter-spacing{
229 padding-left: 20rpx; 229 padding-left: 20rpx;
@@ -231,10 +231,29 @@ padding-right: 29rpx; @@ -231,10 +231,29 @@ padding-right: 29rpx;
231 width: 58%; 231 width: 58%;
232 margin: auto; 232 margin: auto;
233 margin-top: 40rpx; 233 margin-top: 40rpx;
234 -margin-left:28rpx; 234 +margin-left:28rpx;
  235 +}
235 236
236 237
  238 +#two_type .xc-letter-spacing{
  239 + padding-left: 20rpx;
  240 + padding-right: 29rpx;
  241 + width: 58%;
  242 + margin: auto;
  243 + margin-top: 40rpx;
  244 + margin-left:28rpx;
  245 + }
  246 +
  247 +/* 左边菜单点击样式 20200601 luca */
  248 +.is_show_class{
  249 +width: 100%;
  250 +background-color: white;
  251 +height: 50rpx;
  252 +line-height: 50rpx;
  253 +color:black;
  254 +font-weight: 700;
237 } 255 }
  256 +
238 .world_sn{ 257 .world_sn{
239 white-space: nowrap; 258 white-space: nowrap;
240 overflow: hidden; 259 overflow: hidden;
@@ -243,25 +262,28 @@ width: 58%; @@ -243,25 +262,28 @@ width: 58%;
243 margin: auto; 262 margin: auto;
244 margin-top: 35rpx; 263 margin-top: 35rpx;
245 } 264 }
246 -.select_classify{  
247 - /* 20200530 update */  
248 -/* background: #d60021; */  
249 -background:white;  
250 -/* border-radius: 30rpx; */  
251 -/* color: #fff; */  
252 -color:black; 265 +/* .select_classify{ */
  266 + /* 20200530 update 转用.is_show_class*/
  267 +/* background: #d60021;
  268 +border-radius: 30rpx;
  269 +color: #fff;
253 height: 48rpx; 270 height: 48rpx;
254 -line-height: 45rpx;  
255 -font-weight:700; 271 +line-height: 45rpx; */
  272 +/* font-weight:700; */
256 273
257 -}  
258 -.select_classify.width80{ 274 +/* } */
  275 +/* .select_classify.width80{ */
259 /* 20200530updata */ 276 /* 20200530updata */
260 /* width: 74.5%; */ 277 /* width: 74.5%; */
261 - width: 100%;  
262 - height: 100rpx;  
263 - line-height: 100rpx; 278 + /* height: 100rpx;
  279 + line-height: 100rpx; */
  280 +/* } */
  281 +.class_set_height{
  282 + height: 50rpx;
  283 + line-height: 50rpx;
  284 + padding: 20rpx 0;
264 } 285 }
  286 +
265 .select_classify.width80.text-indent{ 287 .select_classify.width80.text-indent{
266 text-indent: 38rpx; 288 text-indent: 38rpx;
267 padding-right: 20px; 289 padding-right: 20px;
@@ -412,5 +434,89 @@ margin: auto; @@ -412,5 +434,89 @@ margin: auto;
412 434
413 .brand_img_name {color: #666;} 435 .brand_img_name {color: #666;}
414 436
  437 +
  438 +.tab-view {
  439 + /* height: 100%; */
  440 + width: 200rpx;
  441 + /* position: fixed;
  442 + left: 0;
  443 + top: 92rpx;
  444 + z-index: 10; */
  445 +}
  446 +
  447 +#thress_type3 .tab-bar-item {
  448 + width: 200rpx;
  449 + height: 110rpx;
  450 + box-sizing: border-box;
  451 + display: flex;
  452 + align-items: center;
  453 + justify-content: left;
  454 + font-size: 30rpx;
  455 + padding-left: 30rpx;
  456 + color: #444;
  457 + font-weight: 400;
  458 +}
  459 +
  460 +#thress_type3 .active {
  461 + position: relative;
  462 + color: #000;
  463 + font-size: 30rpx;
  464 + font-weight: 600;
  465 + background: #fff;
  466 +}
  467 +
  468 +#thress_type3 .active::before {
  469 + content: "";
  470 + position: absolute;
  471 + border-left: 8rpx solid #E41F19;
  472 + height: 50rpx;
  473 + left: 0;
  474 +}
  475 +
  476 +
  477 +
  478 +
  479 +
  480 +
  481 +#two_type .tab-bar-item {
  482 + width: 200rpx;
  483 + height: 110rpx;
  484 + box-sizing: border-box;
  485 + display: flex;
  486 + align-items: center;
  487 + justify-content: left;
  488 + font-size: 30rpx;
  489 + padding-left: 30rpx;
  490 + color: #444;
  491 + font-weight: 400;
  492 +}
  493 +#two_type .select_classify {
  494 + position: relative;
  495 + color: #000;
  496 + font-size: 30rpx;
  497 + font-weight: 600;
  498 + background: #fff;
  499 +}
  500 +
  501 +#two_type .select_classify::before {
  502 + content: "";
  503 + position: absolute;
  504 + border-left: 8rpx solid #E41F19;
  505 + height: 50rpx;
  506 + left: 0;
  507 + top:26rpx;
  508 +}
  509 +
  510 +
  511 +
  512 +#two_type .is_show_class{
  513 + width: 100%;
  514 + background-color: white;
  515 + color:black;
  516 + font-weight: 700;
  517 + height: 110rpx;
  518 +
  519 + }
  520 +
415 /* 风格三商品列表样式引入 */ 521 /* 风格三商品列表样式引入 */
416 @import "../goodsList/goodsList.wxss"; 522 @import "../goodsList/goodsList.wxss";
417 \ No newline at end of file 523 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.js
@@ -251,14 +251,34 @@ Page({ @@ -251,14 +251,34 @@ Page({
251 var ee = this, 251 var ee = this,
252 that = ee, 252 that = ee,
253 th = ee, 253 th = ee,
254 - gid = t.goods_id; 254 + gid = t.goods_id,
  255 + first_leader=t.first_leader;
255 256
256 //---获取手机地址坐标-- 257 //---获取手机地址坐标--
257 //--如果tg_id是空的话,分享回来-- 258 //--如果tg_id是空的话,分享回来--
258 if (gid == undefined || gid == null || gid == "") { 259 if (gid == undefined || gid == null || gid == "") {
259 - gid = decodeURIComponent(t.scene); 260 + var gid_str = decodeURIComponent(t.scene);
  261 + gid_str.split("_");
  262 + gid=gid_str[0];
  263 + if(gid_str.length>1){
  264 + first_leader=gid_str[1];
  265 + }
260 } 266 }
261 ee.setData({ gid: gid}); 267 ee.setData({ gid: gid});
  268 + if(first_leader){
  269 + getApp().globalData.first_leader=first_leader;
  270 + //调用接口判断是不是会员
  271 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  272 + if(res.data.code==0){
  273 + getApp().globalData.guide_id=res.data.data.bind_user_id;
  274 + }
  275 + })
  276 + }
  277 +
  278 + var c_guide_id=t.c_guide_id;
  279 + if(c_guide_id){
  280 + th.data.c_guide_id=c_guide_id;
  281 + }
262 282
263 //----获取系统参数----- 283 //----获取系统参数-----
264 getApp().getConfig2(function(e) { 284 getApp().getConfig2(function(e) {
@@ -932,6 +952,19 @@ Page({ @@ -932,6 +952,19 @@ Page({
932 sku: o.sku, 952 sku: o.sku,
933 }; 953 };
934 954
  955 + //---是不是从收藏夹出来的---
  956 + if(th.data.c_guide_id){
  957 + newd['guide_id'] = th.data.c_guide_id;
  958 + newd['guide_type']=2;
  959 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  960 + }else{
  961 + if(getApp().globalData.guide_id){
  962 + newd['guide_id'] = getApp().globalData.guide_id;
  963 + newd['guide_type']=0;
  964 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  965 + }
  966 + }
  967 +
935 //如果是积分够,is_integral_normal就要有积分购普通购买字段 968 //如果是积分够,is_integral_normal就要有积分购普通购买字段
936 if(o.prom_type==4){ 969 if(o.prom_type==4){
937 newd.is_integral_normal=1; 970 newd.is_integral_normal=1;
@@ -1028,8 +1061,6 @@ Page({ @@ -1028,8 +1061,6 @@ Page({
1028 } 1061 }
1029 } 1062 }
1030 } 1063 }
1031 -  
1032 -  
1033 1064
1034 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); 1065 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
1035 if ("add" == t.currentTarget.dataset.action) { 1066 if ("add" == t.currentTarget.dataset.action) {
@@ -1064,7 +1095,6 @@ Page({ @@ -1064,7 +1095,6 @@ Page({
1064 return s.my_warnning("库存不足!", 0, th); 1095 return s.my_warnning("库存不足!", 0, th);
1065 } 1096 }
1066 } 1097 }
1067 -  
1068 1098
1069 var updata = { 1099 var updata = {
1070 id: item.id, 1100 id: item.id,
@@ -1073,7 +1103,18 @@ Page({ @@ -1073,7 +1103,18 @@ Page({
1073 member_goods_price:newd.goods_price, 1103 member_goods_price:newd.goods_price,
1074 store_id: th.data.stoid, 1104 store_id: th.data.stoid,
1075 }; 1105 };
1076 - 1106 +
  1107 + //---是不是从收藏夹出来的---
  1108 + if(th.data.c_guide_id){
  1109 + updata['guide_id'] = th.data.c_guide_id;
  1110 + updata['guide_type']=3; //加入购物车之后就变成了3
  1111 + }else {
  1112 + if (getApp().globalData.guide_id) {
  1113 + updata['guide_id'] = getApp().globalData.guide_id;
  1114 + updata['guide_type'] = 0;
  1115 + }
  1116 + }
  1117 +
1077 i.put("/api/weshop/cart/update", { 1118 i.put("/api/weshop/cart/update", {
1078 data: updata, 1119 data: updata,
1079 success: function(t) { 1120 success: function(t) {
@@ -1086,6 +1127,8 @@ Page({ @@ -1086,6 +1127,8 @@ Page({
1086 } 1127 }
1087 }); 1128 });
1088 } else { 1129 } else {
  1130 +
  1131 +
1089 i.post("/api/weshop/cart/save", { 1132 i.post("/api/weshop/cart/save", {
1090 data: newd, 1133 data: newd,
1091 success: function(t) { 1134 success: function(t) {
@@ -1124,7 +1167,7 @@ Page({ @@ -1124,7 +1167,7 @@ Page({
1124 break; 1167 break;
1125 } 1168 }
1126 } 1169 }
1127 - 1170 +
1128 } 1171 }
1129 1172
1130 newd['pick_name'] = th.data.sto_sele_name; 1173 newd['pick_name'] = th.data.sto_sele_name;
@@ -1133,9 +1176,7 @@ Page({ @@ -1133,9 +1176,7 @@ Page({
1133 } 1176 }
1134 }, 1177 },
1135 1178
1136 -  
1137 -  
1138 - 1179 +
1139 //----------购买虚拟商品------ 1180 //----------购买虚拟商品------
1140 buyVirtualGoods: function(e) { 1181 buyVirtualGoods: function(e) {
1141 Object.assign(e, { 1182 Object.assign(e, {
@@ -1319,6 +1360,12 @@ Page({ @@ -1319,6 +1360,12 @@ Page({
1319 store_id: o.stoid, 1360 store_id: o.stoid,
1320 add_time: timestamp, 1361 add_time: timestamp,
1321 }; 1362 };
  1363 + //加入收藏夹就是导购的ID
  1364 + if(getApp().globalData.guide_id){
  1365 + d.guide_id=getApp().globalData.guide_id;
  1366 + d.guide_type=2;
  1367 + }
  1368 +
1322 i.post("/api/weshop/goodscollect/save", { //添加收藏 1369 i.post("/api/weshop/goodscollect/save", { //添加收藏
1323 data: d, 1370 data: d,
1324 success: function(e) { 1371 success: function(e) {
@@ -1438,10 +1485,14 @@ Page({ @@ -1438,10 +1485,14 @@ Page({
1438 title=th.data.prom_act.share_title; 1485 title=th.data.prom_act.share_title;
1439 img=th.data.iurl+th.data.prom_act.share_imgurl; 1486 img=th.data.iurl+th.data.prom_act.share_imgurl;
1440 } 1487 }
  1488 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  1489 + if(getApp().globalData.user_id){
  1490 + url+="&first_leader="+getApp().globalData.user_id;
  1491 + }
1441 1492
1442 return { 1493 return {
1443 title: price + "元 " +title, 1494 title: price + "元 " +title,
1444 - path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, 1495 + path:url,
1445 imageUrl: img, 1496 imageUrl: img,
1446 } 1497 }
1447 1498
@@ -3126,7 +3177,12 @@ Page({ @@ -3126,7 +3177,12 @@ Page({
3126 var app = getApp(); 3177 var app = getApp();
3127 var unit = that.data.screenWidth / 750 * 1.35; 3178 var unit = that.data.screenWidth / 750 * 1.35;
3128 var path2 = that.data.data.original_img; 3179 var path2 = that.data.data.original_img;
3129 - var scene = th.data.gid; 3180 + var scene = th.data.gid+"";
  3181 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  3182 + if(user_id>0){
  3183 + scene+="_"+user_id;
  3184 + }
  3185 +
3130 ///二微码 3186 ///二微码
3131 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 3187 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
3132 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; 3188 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
pages/goods/goodsList/goodsList.js
@@ -24,6 +24,19 @@ Page({ @@ -24,6 +24,19 @@ Page({
24 }, 24 },
25 25
26 onLoad: function(t) { 26 onLoad: function(t) {
  27 +
  28 + //接受有没有导购的参数
  29 + var first_leader=t.first_leader;
  30 + if(first_leader){
  31 + getApp().globalData.first_leader=first_leader;
  32 + //调用接口判断是不是会员
  33 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  34 + if(res.data.code==0){
  35 + getApp().globalData.guide_id=res.data.data.bind_user_id;
  36 + }
  37 + })
  38 + }
  39 +
27 var th=this; 40 var th=this;
28 a.init(this, "", "requestData"); 41 a.init(this, "", "requestData");
29 var url = this.data.baseUrl; 42 var url = this.data.baseUrl;
@@ -194,9 +207,23 @@ Page({ @@ -194,9 +207,23 @@ Page({
194 }, 207 },
195 //---------分享配置-------- 208 //---------分享配置--------
196 onShareAppMessage: function (e) { 209 onShareAppMessage: function (e) {
197 - return {  
198 - title: "商品列表",  
199 - } 210 + var curPage=this;
  211 + var pagePath = curPage.route; //当前页面url
  212 + if (pagePath.indexOf('/') != 0) {
  213 + pagePath = '/' + pagePath;
  214 + }
  215 + if(getApp().globalData.user_id){
  216 +
  217 + if(pagePath.indexOf("?")>0){
  218 + pagePath+="&first_leader="+getApp().globalData.user_id;
  219 + }else{
  220 + pagePath+="?first_leader="+getApp().globalData.user_id;
  221 + }
  222 + }
  223 + return {
  224 + title: "商品列表",
  225 + path:pagePath,
  226 + }
200 }, 227 },
201 //---图片失败,默认图片--- 228 //---图片失败,默认图片---
202 bind_bnerr2: function (e) { 229 bind_bnerr2: function (e) {
pages/goods/goodsList/goodsList.json
1 { 1 {
2 - "navigationBarTitleText": "商品列表" 2 + "navigationBarTitleText": "商品列表",
  3 + "usingComponents": {
  4 + "share_box": "/components/share_box/share_box"
  5 + }
3 } 6 }
4 \ No newline at end of file 7 \ No newline at end of file
pages/goods/goodsList/goodsList.wxml
@@ -164,4 +164,6 @@ @@ -164,4 +164,6 @@
164 </view> 164 </view>
165 </view> 165 </view>
166 </view> 166 </view>
167 - </view>  
168 \ No newline at end of file 167 \ No newline at end of file
  168 + </view>
  169 +
  170 +<share_box id="share"></share_box>
169 \ No newline at end of file 171 \ No newline at end of file
pages/goods/search/search.js
@@ -23,6 +23,18 @@ Page({ @@ -23,6 +23,18 @@ Page({
23 adname: "desc", //升降的字段 23 adname: "desc", //升降的字段
24 }, 24 },
25 onLoad: function(t) { 25 onLoad: function(t) {
  26 + //接受有没有导购的参数
  27 + var first_leader=t.first_leader;
  28 + if(first_leader){
  29 + getApp().globalData.first_leader=first_leader;
  30 + //调用接口判断是不是会员
  31 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  32 + if(res.data.code==0){
  33 + getApp().globalData.guide_id=res.data.data.bind_user_id;
  34 + }
  35 + })
  36 + }
  37 +
26 var th=this; 38 var th=this;
27 a.getConfig2(function(rs){ 39 a.getConfig2(function(rs){
28 var arr=new Array(),arr2=new Array(); 40 var arr=new Array(),arr2=new Array();
pages/index/index/index.js
@@ -112,7 +112,6 @@ Page({ @@ -112,7 +112,6 @@ Page({
112 t.editTabBar(th,o.stoid,th.data.url); 112 t.editTabBar(th,o.stoid,th.data.url);
113 113
114 114
115 - if (getApp().globalData.user_id) getApp().requestCardNum();  
116 await this.init_load(); 115 await this.init_load();
117 //显示的时候要开启计时器 116 //显示的时候要开启计时器
118 this.data.is_timer = 1; 117 this.data.is_timer = 1;
@@ -125,6 +124,9 @@ Page({ @@ -125,6 +124,9 @@ Page({
125 if (new_nav == "") { 124 if (new_nav == "") {
126 th.is_new(); 125 th.is_new();
127 } 126 }
  127 + setTimeout(function () {
  128 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  129 + },500)
128 130
129 }); 131 });
130 } else { 132 } else {
@@ -405,6 +407,11 @@ Page({ @@ -405,6 +407,11 @@ Page({
405 if (new_nav == "") { 407 if (new_nav == "") {
406 th.is_new(); 408 th.is_new();
407 } 409 }
  410 +
  411 + setTimeout(function () {
  412 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  413 + },500)
  414 +
408 415
409 }); 416 });
410 var goods_list = this.selectComponent("#goods_list"); //组件的id 417 var goods_list = this.selectComponent("#goods_list"); //组件的id
pages/tabbar/tabbar.wxml
1 <!--pages/tabbar.wxml--> 1 <!--pages/tabbar.wxml-->
2 <template name="tabBar"> 2 <template name="tabBar">
3 <!-- 如果是自定义的话 --> 3 <!-- 如果是自定义的话 -->
4 - <view hidden="{{tabBar.iscustom=='2'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; bottom: 0;z-index:9999999;padding:2px 0;"> 4 + <view hidden="{{tabBar.iscustom=='2'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '168rpx' : '100rpx'}};position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; bottom: 0;z-index:9999999;">
5 <block wx:for="{{tabBar.list}}" wx:key="weappurl"> 5 <block wx:for="{{tabBar.list}}" wx:key="weappurl">
6 6
7 <block wx:if="{{!item.active}}"> 7 <block wx:if="{{!item.active}}">
8 - <navigator url="{{item.weappurl}}" open-type="redirect" class="tabbar_item {{item.clas}}" style="position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:2px 0;">  
9 - <view wx:if="{{item.nav_name=='购物车'}}" style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: absolute;z-index: 100;right: 0"> 8 + <navigator url="{{item.weappurl}}" open-type="redirect" class="tabbar_item {{item.clas}}" style="position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:5px 0;">
  9 + <view wx:if="{{item.nav_name=='购物车'}}" class="menu_red">
10 {{tabBar.cartGoodsNum}} 10 {{tabBar.cartGoodsNum}}
11 </view> 11 </view>
12 <view style="width:35%;height:30px;margin-left:33%;"> 12 <view style="width:35%;height:30px;margin-left:33%;">
@@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
16 </navigator> 16 </navigator>
17 </block> 17 </block>
18 <block wx:else> 18 <block wx:else>
19 - <view class="tabbar_item {{item.clas}}" style="color: {{item.selectedColor? item.selectedColor :tabBar.selectedColor}};position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:2px 0;">  
20 - <view wx:if="{{item.nav_name=='购物车'}}" style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: absolute;z-index: 100;right:0"> 19 + <view class="tabbar_item {{item.clas}}" style="color: {{item.selectedColor? item.selectedColor :tabBar.selectedColor}};position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:5px 0;">
  20 + <view wx:if="{{item.nav_name=='购物车'}}" class="menu_red">
21 {{tabBar.cartGoodsNum}} 21 {{tabBar.cartGoodsNum}}
22 </view> 22 </view>
23 <view style="width:35%;height:30px;margin-left:33%;"> 23 <view style="width:35%;height:30px;margin-left:33%;">
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 <!-- 3 --> 81 <!-- 3 -->
82 <block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}"> 82 <block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}">
83 <navigator url="/pages/cart/cart/cart" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 83 <navigator url="/pages/cart/cart/cart" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
84 - <view style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: fixed;z-index: 100;left:63%"> 84 + <view class="menu_default_red">
85 {{tabBar.cartGoodsNum}} 85 {{tabBar.cartGoodsNum}}
86 </view><view style="width:30%;height:57rpx;margin-left:35%;"> 86 </view><view style="width:30%;height:57rpx;margin-left:35%;">
87 <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image> 87 <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image>
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 </block> 91 </block>
92 <block wx:else> 92 <block wx:else>
93 <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 93 <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
94 - <view style="background-color: red;color: #fff;font-size: 20rpx;border-radius: 40rpx;width: 50rpx;height: 30rpx;padding: 5rpx;position: fixed;z-index: 100;left:63%"> 94 + <view class="menu_default_red">
95 {{tabBar.cartGoodsNum}} 95 {{tabBar.cartGoodsNum}}
96 </view><view style="width:30%;height:57rpx;margin-left:35%;"> 96 </view><view style="width:30%;height:57rpx;margin-left:35%;">
97 <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image> 97 <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image>
pages/tabbar/tabbar.wxss
  1 +.menu_red{
  2 +
  3 + top:0;background-color: red;color: #fff;font-size: 20rpx;border-radius: 50%;width: 40rpx;line-height:40rpx;height: 40rpx;position: absolute;z-index: 100;right:30rpx;
  4 +}
  5 +
  6 +.menu_default_red{
  7 + background-color: red;color: #fff;font-size: 20rpx;border-radius: 50%;width: 40rpx;height: 40rpx;line-heith:40rpx;position: fixed;z-index: 100;left:63%
  8 +}
0 \ No newline at end of file 9 \ No newline at end of file
pages/team/team_show/team_show.js
@@ -66,12 +66,29 @@ Page({ @@ -66,12 +66,29 @@ Page({
66 wx.setNavigationBarTitle({ title: "拼团订单",}) 66 wx.setNavigationBarTitle({ title: "拼团订单",})
67 //var postdata=getApp().globalData.to_group; 67 //var postdata=getApp().globalData.to_group;
68 var postdata=options; 68 var postdata=options;
69 - var tg_id = postdata.tg_id; 69 + var tg_id = postdata.tg_id, first_leader=t.first_leader;
70 //如果tg_id是空的话 70 //如果tg_id是空的话
71 if(tg_id==undefined || tg_id==null || tg_id==""){ 71 if(tg_id==undefined || tg_id==null || tg_id==""){
72 - tg_id=decodeURIComponent(postdata.scene); 72 + var tg_id_str=decodeURIComponent(postdata.scene);
  73 + tg_id_str=tg_id_str.split("_");
  74 + tg_id=tg_id_str[0];
  75 + if(tg_id_str.length>1){
  76 + first_leader=tg_id_str[1];
  77 + }
73 } 78 }
74 - this.setData({tg_id: tg_id }); 79 + //--判断一下是不是导购--
  80 + if(first_leader){
  81 + getApp().globalData.first_leader=first_leader;
  82 + //调用接口判断是不是会员
  83 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  84 + if(res.data.code==0){
  85 + getApp().globalData.guide_id=res.data.data.bind_user_id;
  86 + }
  87 + })
  88 + }
  89 +
  90 +
  91 + this.setData({tg_id: tg_id });
75 getApp().globalData.to_group=null; 92 getApp().globalData.to_group=null;
76 }, 93 },
77 94
@@ -767,8 +784,12 @@ Page({ @@ -767,8 +784,12 @@ Page({
767 } 784 }
768 newd['pick_dis'] = th.data.pick_dis; 785 newd['pick_dis'] = th.data.pick_dis;
769 786
770 - s.set_b_now(newd); 787 + if(getApp().globalData.guide_id){
  788 + newd['guide_id'] = getApp().globalData.guide_id;
  789 + newd['guide_type']=0;
  790 + }
771 791
  792 + s.set_b_now(newd);
772 wx.navigateTo({ 793 wx.navigateTo({
773 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id, 794 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id,
774 }); 795 });
@@ -882,4 +903,30 @@ Page({ @@ -882,4 +903,30 @@ Page({
882 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 903 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
883 }, 904 },
884 905
  906 + //------ 分享配置 --------
  907 + onShareAppMessage: function (e) {
  908 + var curPage=this;
  909 + var pagePath = curPage.route; //当前页面url
  910 + if (pagePath.indexOf('/') != 0) {
  911 + pagePath = '/' + pagePath;
  912 + }
  913 + var url=pagePath;
  914 +
  915 + //--分享图片--
  916 + img=th.data.iurl+th.data.teamlist.share_imgurl;
  917 + //--把会员分享出去--
  918 + if(getApp().globalData.user_id){
  919 + if(url.indexOf("?")>0)
  920 + url+="&first_leader="+getApp().globalData.user_id;
  921 + else
  922 + url+="?first_leader="+getApp().globalData.user_id;
  923 + }
  924 +
  925 + return {
  926 + path:url,
  927 + title: "商品分类",
  928 + imageUrl: img,
  929 + }
  930 + },
  931 +
885 }) 932 })
886 \ No newline at end of file 933 \ No newline at end of file
pages/team/team_success/team_success.js
@@ -355,6 +355,12 @@ Page({ @@ -355,6 +355,12 @@ Page({
355 var app = getApp(); 355 var app = getApp();
356 var unit = that.data.screenWidth / 750 * 1.35; 356 var unit = that.data.screenWidth / 750 * 1.35;
357 var scene=th.data.teamgroup.id; 357 var scene=th.data.teamgroup.id;
  358 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  359 + if(user_id>0){
  360 + scene+="_"+user_id;
  361 + }
  362 +
  363 +
358 //二微码 364 //二微码
359 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+ 365 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
360 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show"; 366 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
@@ -667,7 +673,30 @@ Page({ @@ -667,7 +673,30 @@ Page({
667 ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif"; 673 ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif";
668 this.setData(ob); 674 this.setData(ob);
669 675
670 - } 676 + },
  677 +
  678 +
  679 + //------ 分享配置 --------
  680 + onShareAppMessage: function (e) {
  681 + var scene=th.data.teamgroup.id;
  682 + var url="/pages/team/team_show/team_show?tg_id="+scene;
  683 + //--分享图片--
  684 + img=th.data.iurl+th.data.teamlist.share_imgurl;
  685 + //--把会员分享出去--
  686 + if(getApp().globalData.user_id){
  687 + if(url.indexOf("?")>0)
  688 + url+="&first_leader="+getApp().globalData.user_id;
  689 + else
  690 + url+="?first_leader="+getApp().globalData.user_id;
  691 + }
  692 +
  693 + return {
  694 + path:url,
  695 + title: "商品分类",
  696 + imageUrl: img,
  697 + }
  698 + },
  699 +
671 700
672 }) 701 })
673 702
pages/user/assistance/friend_assistance.js
@@ -54,6 +54,16 @@ Page({ @@ -54,6 +54,16 @@ Page({
54 * 生命周期函数--监听页面显示 54 * 生命周期函数--监听页面显示
55 */ 55 */
56 onShow: function() { 56 onShow: function() {
  57 + //--先判断会员状态--
  58 + var user_info = getApp().globalData.userInfo;
  59 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  60 + wx.navigateTo({
  61 + url: '/pages/getphone/getphone',
  62 + })
  63 + return false;
  64 + }
  65 +
  66 +
57 var th=this; 67 var th=this;
58 if (!th.data.user) th.setData({ user: getApp().globalData.userInfo}); 68 if (!th.data.user) th.setData({ user: getApp().globalData.userInfo});
59 if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking != 69 if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking !=
pages/user/collect_list/collect_list.js
@@ -8,6 +8,7 @@ var t = function(t) { @@ -8,6 +8,7 @@ var t = function(t) {
8 o = new t.default(); 8 o = new t.default();
9 var oo = e.globalData.setting, 9 var oo = e.globalData.setting,
10 app_d = e.globalData; 10 app_d = e.globalData;
  11 +var ut = require('../../../utils/util.js');
11 12
12 Page({ 13 Page({
13 data: { 14 data: {
@@ -153,6 +154,19 @@ Page({ @@ -153,6 +154,19 @@ Page({
153 iconClick: function(e) { 154 iconClick: function(e) {
154 var th = this.data; 155 var th = this.data;
155 var index = e.currentTarget.dataset.index; 156 var index = e.currentTarget.dataset.index;
  157 + var url = e.currentTarget.dataset.url;
  158 +
  159 + var item=this.data.collects[index];
  160 + if(url){
  161 + console.log("---");
  162 + console.log(item.add_time);
  163 + console.log(ut.gettimestamp());
  164 +
  165 + if(ut.gettimestamp()-item.add_time<3600*24 && item.guide_id>0)
  166 + url+="&c_guide_id="+item.guide_id;
  167 + getApp().goto(url);
  168 + return false;
  169 + }
156 var collect = "collects[" + index + "].checked"; 170 var collect = "collects[" + index + "].checked";
157 if (this.data.collects[index].checked == true) { 171 if (this.data.collects[index].checked == true) {
158 this.setData({ 172 this.setData({
pages/user/collect_list/collect_list.wxml
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 </view> 21 </view>
22 <!-- 商品集合 --> 22 <!-- 商品集合 -->
23 <view class="{{editEd?'collects_max colls_max':'collects_max'}}"> 23 <view class="{{editEd?'collects_max colls_max':'collects_max'}}">
24 - <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}" url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}"> 24 + <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}"
  25 + data-url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}">
25 26
26 <view class="radioCheck iconClick" wx:if="{{editEd}}"> 27 <view class="radioCheck iconClick" wx:if="{{editEd}}">
27 <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio> 28 <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio>
pages/user/index/index.js
@@ -84,10 +84,12 @@ Page({ @@ -84,10 +84,12 @@ Page({
84 need_money = 0, 84 need_money = 0,
85 cur_g_num = 0; 85 cur_g_num = 0;
86 86
87 - //调用底部导航  
88 - getApp().editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url); 87 + //调用底部导航
  88 + getApp().editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url);
89 getApp().get_isbuy(th.setappdata); 89 getApp().get_isbuy(th.setappdata);
90 - if (getApp().globalData.user_id) getApp().requestCardNum(); 90 + setTimeout(function () {
  91 + if (getApp().globalData.user_id) getApp().requestCardNum(th);
  92 + },500)
91 /*------会员登录------*/ 93 /*------会员登录------*/
92 app.getUserFir(async function(e) { 94 app.getUserFir(async function(e) {
93 if (e != undefined && e != null && e.mobile) { 95 if (e != undefined && e != null && e.mobile) {
pages/user/order_detail/order_detail.js
@@ -522,7 +522,9 @@ Page({ @@ -522,7 +522,9 @@ Page({
522 522
523 zfwk:function(){ 523 zfwk:function(){
524 var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id; 524 var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.order.order_id;
525 - getApp().goto(url); 525 + wx.redirectTo({
  526 + url:url,
  527 + })
526 }, 528 },
527 529
528 //--------跳转到退款详情----------- 530 //--------跳转到退款详情-----------
utils/LoadMore.js
@@ -87,7 +87,7 @@ var e = function() { @@ -87,7 +87,7 @@ var e = function() {
87 g[ii].original_img = oo.imghost + g[ii].original_img; 87 g[ii].original_img = oo.imghost + g[ii].original_img;
88 } 88 }
89 89
90 - if (g[ii].add_time != undefined){ 90 + if (g[ii].add_time != undefined && rurl.indexOf("goodscollect")<0){
91 var tx = g[ii].add_time + ""; 91 var tx = g[ii].add_time + "";
92 if (tx.indexOf('-') == -1) { 92 if (tx.indexOf('-') == -1) {
93 g[ii].add_time = ut.formatTime(g[ii].add_time, 'yyyy-MM-dd hh:mm:ss'); 93 g[ii].add_time = ut.formatTime(g[ii].add_time, 'yyyy-MM-dd hh:mm:ss');
utils/pay.js
@@ -34,7 +34,7 @@ module.exports = { @@ -34,7 +34,7 @@ module.exports = {
34 if(t.data.code==0){ 34 if(t.data.code==0){
35 i.weixinPay(t.data.data, e, a); 35 i.weixinPay(t.data.data, e, a);
36 }else{ 36 }else{
37 - getApp().showWarning(t.data.msg); 37 + getApp().confirmBox(t.data.msg);
38 setTimeout(function(){ 38 setTimeout(function(){
39 wx.redirectTo({ 39 wx.redirectTo({
40 url: "/pages/user/order_list/order_list", 40 url: "/pages/user/order_list/order_list",
@@ -62,7 +62,8 @@ module.exports = { @@ -62,7 +62,8 @@ module.exports = {
62 console.log(n), t.showSuccess("支付成功!", e); 62 console.log(n), t.showSuccess("支付成功!", e);
63 }, 63 },
64 fail: function(n) { 64 fail: function(n) {
65 - console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") : t.showWarning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)), 65 + console.log(n), "requestPayment:fail" == n.errMsg ? t.showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? t.showWarning("您已取消支付") :
  66 + t.confirmBox("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
66 "function" == typeof a && a(); 67 "function" == typeof a && a();
67 } 68 }
68 }); 69 });