Commit d937950739f73049a6089db6a5442895e16fb73e

Authored by 后端研发-苏明海
2 parents 84104521 b5ef82dc

Merge branch 'qa' into 'master'

Qa

See merge request !448
Showing 75 changed files with 1523 additions and 479 deletions
components/diy_seckill/diy_seckill.js
@@ -57,6 +57,7 @@ Component({ @@ -57,6 +57,7 @@ Component({
57 var item = {}; 57 var item = {};
58 goodsidlist+=val.goodsid+","; 58 goodsidlist+=val.goodsid+",";
59 }) 59 })
  60 + goodsidlist=ut.sub_last(goodsidlist);
60 61
61 //--调用接口,读取秒杀-- 62 //--调用接口,读取秒杀--
62 app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" 63 app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id="
components/goods_list/goods_list.js
@@ -146,16 +146,17 @@ Component({ @@ -146,16 +146,17 @@ Component({
146 var card_name_map = new Map(); 146 var card_name_map = new Map();
147 147
148 var user = getApp().globalData.userInfo; 148 var user = getApp().globalData.userInfo;
149 -  
150 - for (var i = 0; i < plusCard.length; i++) {  
151 - if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {  
152 - continue; 149 + if(plusCard) {
  150 + for (var i = 0; i < plusCard.length; i++) {
  151 + if (user && (user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  152 + continue;
  153 + }
  154 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  155 + card_name_map.set(name, plusCard[i].CardName);
  156 + new_arr.push(plusCard[i]);
  157 +
  158 +
153 } 159 }
154 - var name = "card" + plusCard[i].CorrPrice.toLowerCase();  
155 - card_name_map.set(name, plusCard[i].CardName);  
156 - new_arr.push(plusCard[i]);  
157 -  
158 -  
159 } 160 }
160 var ob = { 161 var ob = {
161 "card_list": new_arr, 162 "card_list": new_arr,
components/goods_list/goods_list.wxss
1 .collects { 1 .collects {
2 margin-top: 40rpx; 2 margin-top: 40rpx;
  3 + margin-bottom: 40rpx;
3 } 4 }
4 5
5 .ib { 6 .ib {
components/my_confirm/my_confirm.js
@@ -29,10 +29,13 @@ Component({ @@ -29,10 +29,13 @@ Component({
29 }) 29 })
30 }, 30 },
31 go_sure: function() { 31 go_sure: function() {
32 - this.data.success(); 32 + this.setData({ yu_e_show: 0})
  33 + if(this.data.success) this.data.success();
  34 +
33 }, 35 },
34 go_cancle: function() { 36 go_cancle: function() {
35 - this.data.cancle(); 37 + this.setData({ yu_e_show: 0})
  38 + if(this.data.cancle) this.data.cancle();
36 }, 39 },
37 close_yu_e: function() { 40 close_yu_e: function() {
38 this.setData({ 41 this.setData({
components/my_confirm/my_confirm.wxml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <view> 4 <view>
5 <view class="xc-qr-frame"> 5 <view class="xc-qr-frame">
6 <view class="shut" bindtap="close_yu_e">ⅹ</view> 6 <view class="shut" bindtap="close_yu_e">ⅹ</view>
7 - <view class="fs32 xc-black3 flex jc-center ai-center" style="width:100%;height:220rpx;">{{title}}</view> 7 + <view class="fs32 xc-black3 flex jc-center ai-center" style="padding: 10rpx 20rpx;min-height:220rpx;"><text>{{title}}</text></view>
8 <view class="flex jc-center ai_center" style="width: 100%;height: 75rpx;"> 8 <view class="flex jc-center ai_center" style="width: 100%;height: 75rpx;">
9 <view bindtap="go_sure" class="fs30 white flex jc-center ai-center ck_btn color color" style="margin-right: 20rpx;">{{s_text}}</view> 9 <view bindtap="go_sure" class="fs30 white flex jc-center ai-center ck_btn color color" style="margin-right: 20rpx;">{{s_text}}</view>
10 <view bindtap='go_cancle' class="fs30 xc-ash flex jc-center ai-center ck_btn"style="background:#ececea;">{{c_text}}</view> 10 <view bindtap='go_cancle' class="fs30 xc-ash flex jc-center ai-center ck_btn"style="background:#ececea;">{{c_text}}</view>
components/my_confirm/my_confirm.wxss
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 } 40 }
41 .xc-qr-frame{ 41 .xc-qr-frame{
42 width:560rpx; 42 width:560rpx;
43 - height: 280rpx; 43 + min-zoom: 280rpx;
44 background: #fff; 44 background: #fff;
45 z-index: 55; 45 z-index: 55;
46 position: fixed; 46 position: fixed;
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
@@ -43,8 +43,20 @@ Page({ @@ -43,8 +43,20 @@ Page({
43 //------初始化加载---------- 43 //------初始化加载----------
44 onLoad: function(t) { 44 onLoad: function(t) {
45 var goods_id=t.goods_id; 45 var goods_id=t.goods_id;
46 - this.setData({gid:goods_id}); 46 + this.setData({gid:goods_id});
47 var ee=this,th=ee,that=ee; 47 var ee=this,th=ee,that=ee;
  48 + var first_leader=t.first_leader;
  49 + if(first_leader){
  50 + getApp().globalData.first_leader=first_leader;
  51 + //调用接口判断是不是会员
  52 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
  53 + if(res.data.code==0){
  54 + getApp().globalData.guide_id=res.data.data.id;
  55 + }
  56 + })
  57 + }
  58 +
  59 +
48 //----获取系统参数,并判断等级价格----- 60 //----获取系统参数,并判断等级价格-----
49 getApp().getConfig2(function(e) { 61 getApp().getConfig2(function(e) {
50 var json_d = JSON.parse(e.switch_list); 62 var json_d = JSON.parse(e.switch_list);
@@ -216,7 +228,7 @@ Page({ @@ -216,7 +228,7 @@ Page({
216 //--- 判断是等级会员,且在有效期范围内 --- 228 //--- 判断是等级会员,且在有效期范围内 ---
217 if(user.card_field && now<end){ 229 if(user.card_field && now<end){
218 var card_name=ob.name_map.get(user.card_field); 230 var card_name=ob.name_map.get(user.card_field);
219 - if(card_name.length>5) card_name=card_name.substring(0,5); 231 + if(card_name && card_name.length>5) card_name=card_name.substring(0,5);
220 th.setData({card_field:user.card_field,card_name:card_name}); 232 th.setData({card_field:user.card_field,card_name:card_name});
221 if(t.data.data[user.card_field]>0) t.data.data.shop_price=t.data.data[user.card_field]; 233 if(t.data.data[user.card_field]>0) t.data.data.shop_price=t.data.data[user.card_field];
222 } 234 }
@@ -323,7 +335,6 @@ Page({ @@ -323,7 +335,6 @@ Page({
323 a = 0, 335 a = 0,
324 o = this.data.data; 336 o = this.data.data;
325 a = o.goods_id; 337 a = o.goods_id;
326 -  
327 //----------添加到购物车时,要判断限购数量,-------- 338 //----------添加到购物车时,要判断限购数量,--------
328 e.get_buy_num(o, function(ee) { 339 e.get_buy_num(o, function(ee) {
329 //---判断商品是否超出限购--- 340 //---判断商品是否超出限购---
@@ -370,6 +381,28 @@ Page({ @@ -370,6 +381,28 @@ Page({
370 prom_id:o.prom_id 381 prom_id:o.prom_id
371 }; 382 };
372 383
  384 + //---是不是从收藏夹出来的---
  385 + if(th.data.c_guide_id){
  386 + newd['guide_id'] = th.data.c_guide_id;
  387 + newd['guide_type']=2;
  388 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  389 + }else{
  390 + if(getApp().globalData.guide_id){
  391 + newd['guide_id'] = getApp().globalData.guide_id;
  392 + newd['guide_type']=0;
  393 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  394 + }
  395 + }
  396 +
  397 + //如果有导购ID的话
  398 + if(newd['guide_id'] && th.data.sele_collocation){
  399 + for(var jj in th.data.sele_collocation ){
  400 + th.data.sele_collocation[jj]['guide_id']=newd['guide_id'];
  401 + th.data.sele_collocation[jj]['guide_type']=newd['guide_type'];
  402 + }
  403 + }
  404 +
  405 +
373 //-----如果是秒杀,团购,积分购,拼团----- 406 //-----如果是秒杀,团购,积分购,拼团-----
374 if (th.data.data.prom_type != 5) { 407 if (th.data.data.prom_type != 5) {
375 return s.my_warnning("商品不是搭配活动!", 0, th); 408 return s.my_warnning("商品不是搭配活动!", 0, th);
@@ -612,22 +645,25 @@ Page({ @@ -612,22 +645,25 @@ Page({
612 645
613 //--点击分享事件--- 646 //--点击分享事件---
614 onShareAppMessage: function(t) { 647 onShareAppMessage: function(t) {
615 - var th = this;  
616 - var price = th.data.data.shop_price;  
617 - if (th.data.prom_act) {  
618 - price = th.data.prom_act.price;  
619 - }  
620 - var title= th.data.data.goods_name;  
621 - var img=th.data.data.original_img;  
622 - if(th.data.prom_type==6){  
623 - title=th.data.prom_act.share_title;  
624 - img=th.data.iurl+th.data.prom_act.share_imgurl;  
625 - } 648 + var curPage=this;
  649 + var pagePath = curPage.route; //当前页面url
  650 + if (pagePath.indexOf('/') != 0) {
  651 + pagePath = '/' + pagePath;
  652 + }
  653 + if(getApp().globalData.user_id){
  654 + if(pagePath.indexOf("?")>0){
  655 + pagePath+="&goods_id="+this.data.gid+" &first_leader="+getApp().globalData.user_id;
  656 + }else{
  657 + pagePath+="?goods_id="+this.data.gid+"&first_leader="+getApp().globalData.user_id;
  658 + }
  659 + }
  660 +
  661 + console.log("111");
  662 + console.log(pagePath);
626 663
627 return { 664 return {
628 - title: price + "元 " +title,  
629 - path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid,  
630 - imageUrl: img, 665 + title: "搭配购",
  666 + path: pagePath,
631 } 667 }
632 668
633 }, 669 },
pages/activity/pind_list/pind_list.js
@@ -17,6 +17,24 @@ Page({ @@ -17,6 +17,24 @@ Page({
17 iurl: os.imghost, 17 iurl: os.imghost,
18 }, 18 },
19 19
  20 + //------初始化加载----------
  21 + onLoad: function(t) {
  22 + var first_leader = t.first_leader;
  23 +
  24 + console.log("------------");
  25 + console.log(first_leader);
  26 +
  27 + if (first_leader) {
  28 + getApp().globalData.first_leader = first_leader;
  29 + //调用接口判断是不是会员
  30 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  31 + if (res.data.code == 0) {
  32 + getApp().globalData.guide_id = res.data.data.id;
  33 + }
  34 + })
  35 + }
  36 + },
  37 +
20 onShow: function(t) { 38 onShow: function(t) {
21 39
22 wx.setNavigationBarTitle({ title: "天天拼单",}) 40 wx.setNavigationBarTitle({ title: "天天拼单",})
@@ -126,12 +144,34 @@ Page({ @@ -126,12 +144,34 @@ Page({
126 this.reloadGoodList(); 144 this.reloadGoodList();
127 }, 145 },
128 146
129 - //---------分享配置--------  
130 - onShareAppMessage: function (e) {  
131 - return {  
132 - title: "限时团购",  
133 - }  
134 - }, 147 +
  148 +
  149 + //---------分享配置--------
  150 + onShareAppMessage: function (e) {
  151 + var curPage=this;
  152 + var pagePath = curPage.route; //当前页面url
  153 + if (pagePath.indexOf('/') != 0) {
  154 + pagePath = '/' + pagePath;
  155 + }
  156 + if(getApp().globalData.user_id){
  157 +
  158 + if(pagePath.indexOf("?")>0){
  159 + pagePath+="&first_leader="+getApp().globalData.user_id;
  160 + }else{
  161 + pagePath+="?first_leader="+getApp().globalData.user_id;
  162 + }
  163 + }
  164 +
  165 + console.log("11"+pagePath);
  166 +
  167 + return {
  168 + title: "限时团购",
  169 + path:pagePath,
  170 + }
  171 + },
  172 +
  173 +
  174 +
135 175
136 //图片失败,默认图片 176 //图片失败,默认图片
137 bind_bnerr2: function (e) { 177 bind_bnerr2: function (e) {
pages/activity/pind_list/pind_list.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/activity/pind_list/pind_list.wxml
@@ -84,4 +84,6 @@ @@ -84,4 +84,6 @@
84 84
85 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view> 85 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
86 </view> 86 </view>
87 -</block>  
88 \ No newline at end of file 87 \ No newline at end of file
  88 +</block>
  89 +
  90 +<share_box id="share"></share_box>
89 \ No newline at end of file 91 \ No newline at end of file
pages/activity/seckill_list/seckill_list.js
@@ -12,6 +12,26 @@ Page({ @@ -12,6 +12,26 @@ Page({
12 ismore:1, //是否可以加载更多 12 ismore:1, //是否可以加载更多
13 isshow:0, 13 isshow:0,
14 }, 14 },
  15 +
  16 + //------初始化加载----------
  17 + onLoad: function(t) {
  18 + var first_leader = t.first_leader;
  19 +
  20 + console.log("------------");
  21 + console.log(first_leader);
  22 +
  23 + if (first_leader) {
  24 + getApp().globalData.first_leader = first_leader;
  25 + //调用接口判断是不是会员
  26 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  27 + if (res.data.code == 0) {
  28 + getApp().globalData.guide_id = res.data.data.id;
  29 + }
  30 + })
  31 + }
  32 + },
  33 +
  34 +
15 onShow: function(t) { 35 onShow: function(t) {
16 36
17 wx.setNavigationBarTitle({ title: "商品秒杀",}) 37 wx.setNavigationBarTitle({ title: "商品秒杀",})
@@ -123,12 +143,31 @@ Page({ @@ -123,12 +143,31 @@ Page({
123 this.setData({type:a,goodlist:null}); 143 this.setData({type:a,goodlist:null});
124 this.reloadGoodList(); 144 this.reloadGoodList();
125 }, 145 },
126 - //---------分享配置--------  
127 - onShareAppMessage: function (e) {  
128 - return {  
129 - title: "疯狂秒杀",  
130 - }  
131 - }, 146 +
  147 +
  148 + //---------分享配置--------
  149 + onShareAppMessage: function (e) {
  150 + var curPage=this;
  151 + var pagePath = curPage.route; //当前页面url
  152 + if (pagePath.indexOf('/') != 0) {
  153 + pagePath = '/' + pagePath;
  154 + }
  155 + if(getApp().globalData.user_id){
  156 +
  157 + if(pagePath.indexOf("?")>0){
  158 + pagePath+="&first_leader="+getApp().globalData.user_id;
  159 + }else{
  160 + pagePath+="?first_leader="+getApp().globalData.user_id;
  161 + }
  162 + }
  163 +
  164 + console.log("11"+pagePath);
  165 + return {
  166 + title: "限时秒杀",
  167 + path:pagePath,
  168 + }
  169 + },
  170 +
132 //图片失败,默认图片 171 //图片失败,默认图片
133 bind_bnerr2: function (e) { 172 bind_bnerr2: function (e) {
134 var _errImg = e.target.dataset.errorimg; 173 var _errImg = e.target.dataset.errorimg;
pages/activity/seckill_list/seckill_list.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/activity/seckill_list/seckill_list.wxml
@@ -73,3 +73,5 @@ @@ -73,3 +73,5 @@
73 </view> 73 </view>
74 74
75 </block> 75 </block>
  76 +
  77 +<share_box id="share"></share_box>
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: {
@@ -142,102 +145,105 @@ Page({ @@ -142,102 +145,105 @@ Page({
142 carr = su.data.data.pageData; 145 carr = su.data.data.pageData;
143 var all_num = 0; 146 var all_num = 0;
144 147
145 - for (var i = 0; i < carr.length; i++) {  
146 - var item = carr[i];  
147 - var good=null;  
148 - await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+item.goods_id,{}).then(res=>{  
149 - good=res.data.data;  
150 - })  
151 - var tt=ut.gettimestamp();  
152 - //如果商品下架了,或者商品是赠品,一开始都要清除  
153 - if((good.down_time>0 && good.down_time<tt) || good.is_on_sale==0 || item.is_gift ){ 148 + if(carr && carr.length>0) {
  149 + for (var i = 0; i < carr.length; i++) {
  150 + var item = carr[i];
  151 + var good = null;
  152 + await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + item.goods_id, {}).then(res => {
  153 + good = res.data.data;
  154 + })
  155 + var tt = ut.gettimestamp();
  156 + //如果商品下架了,或者商品是赠品,一开始都要清除
  157 + if ((good.down_time > 0 && good.down_time < tt) || good.is_on_sale == 0 || item.is_gift) {
154 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; 158 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
155 getApp().request.delete(url, { 159 getApp().request.delete(url, {
156 - success: function(t) { } 160 + success: function (t) {
  161 + }
157 }); 162 });
158 //商品已经下架 163 //商品已经下架
159 continue; 164 continue;
160 - }  
161 - //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着  
162 - if(item.prom_type==1){  
163 - var prom=null;  
164 - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+item.prom_id,{  
165 - }).then(res=>{  
166 - if(res.data.code==0) prom=res.data.data;  
167 - })  
168 - //---如果有活动,不算在一起---  
169 - if(!prom && prom.is_end==0 && prom.end_time>now && prom.start_time<now){  
170 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
171 - a.delete(url, {  
172 - success: function(t) { }  
173 - });  
174 - //商品已经下架  
175 - continue;  
176 - }  
177 - }  
178 - //--判断优惠活动有没有过期--  
179 - else if(item.prom_type==3){  
180 - var isok=1;  
181 - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+item.goods_id+"/1", {}).then(res => {  
182 - if(res.data.code==0){  
183 - var r_data=res.data.data;  
184 - if(!r_data.promGoodsLists){  
185 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;  
186 - a.delete(url, {});  
187 - //商品已经下架  
188 - isok=0;  
189 - } 165 + }
  166 + //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着
  167 + if (item.prom_type == 1) {
  168 + var prom = null;
  169 + await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + item.prom_id, {}).then(res => {
  170 + if (res.data.code == 0) prom = res.data.data;
  171 + })
  172 + //---如果有活动,不算在一起---
  173 + if (!prom && prom.is_end == 0 && prom.end_time > now && prom.start_time < now) {
  174 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  175 + a.delete(url, {
  176 + success: function (t) {
190 } 177 }
191 - else{ 178 + });
  179 + //商品已经下架
  180 + continue;
  181 + }
  182 + }
  183 + //--判断优惠活动有没有过期--
  184 + else if (item.prom_type == 3) {
  185 + var isok = 1;
  186 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1", {}).then(res => {
  187 + if (res.data.code == 0) {
  188 + var r_data = res.data.data;
  189 + if (!r_data.promGoodsLists) {
192 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; 190 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
193 - a.delete(url, { }); 191 + a.delete(url, {});
194 //商品已经下架 192 //商品已经下架
195 - isok=0; 193 + isok = 0;
196 } 194 }
  195 + } else {
  196 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  197 + a.delete(url, {});
  198 + //商品已经下架
  199 + isok = 0;
  200 + }
197 }) 201 })
198 - if(!isok) continue;  
199 - } 202 + if (!isok) continue;
  203 + }
200 204
201 - all_num += item.goods_num;  
202 - item.original_img = oo.imghost + item.original_img;  
203 - item.selected = 0; 205 + all_num += item.goods_num;
  206 + item.original_img = oo.imghost + item.original_img;
  207 + item.selected = 0;
204 208
205 209
206 - var pcid = item.pick_id;  
207 - var find = 0;  
208 - //---------循环查找门店---  
209 - if (arr.length > 0) {  
210 - for (var j = 0; j < arr.length; j++) {  
211 - if (arr[j].pid == pcid) {  
212 - arr[j].goods.push(item);  
213 - find = 1;  
214 - break; 210 + var pcid = item.pick_id;
  211 + var find = 0;
  212 + //---------循环查找门店---
  213 + if (arr.length > 0) {
  214 + for (var j = 0; j < arr.length; j++) {
  215 + if (arr[j].pid == pcid) {
  216 + arr[j].goods.push(item);
  217 + find = 1;
  218 + break;
  219 + }
215 } 220 }
216 } 221 }
217 - }  
218 222
219 - //------如果没有找到-----  
220 - if (find == 0) {  
221 - var pikname = '';  
222 - //找到门店名称  
223 - for (var k = 0; k < th.data.allsto.length; k++) {  
224 - if (pcid == th.data.allsto[k].pickup_id) {  
225 - pikname = th.data.allsto[k].pickup_name;  
226 - break; 223 + //------如果没有找到-----
  224 + if (find == 0) {
  225 + var pikname = '';
  226 + //找到门店名称
  227 + for (var k = 0; k < th.data.allsto.length; k++) {
  228 + if (pcid == th.data.allsto[k].pickup_id) {
  229 + pikname = th.data.allsto[k].pickup_name;
  230 + break;
  231 + }
227 } 232 }
  233 + var narr = new Array();
  234 + narr.push(item);
  235 + var ie = {
  236 + pid: pcid,
  237 + pname: pikname,
  238 + goods: narr,
  239 + selected: 0
  240 + };
  241 + arr.push(ie);
228 } 242 }
229 - var narr = new Array();  
230 - narr.push(item);  
231 - var ie = {  
232 - pid: pcid,  
233 - pname: pikname,  
234 - goods: narr,  
235 - selected: 0  
236 - };  
237 - arr.push(ie);  
238 } 243 }
239 } 244 }
240 245
  246 +
241 if(arr.length==0) { 247 if(arr.length==0) {
242 setTimeout(function () { 248 setTimeout(function () {
243 var goods_list = th.selectComponent("#goods_list"); //组件的id 249 var goods_list = th.selectComponent("#goods_list"); //组件的id
@@ -657,10 +663,11 @@ Page({ @@ -657,10 +663,11 @@ Page({
657 e.doCheckAll(); 663 e.doCheckAll();
658 664
659 t.goods_num=false_data.false_data.buy_limit; 665 t.goods_num=false_data.false_data.buy_limit;
660 - e.update_cart(t, pitem, item);  
661 - 666 + e.update_cart(t, pitem, item);
662 return false; 667 return false;
663 } 668 }
  669 + e.update_cart(t, pitem, item);
  670 +
664 }else{ 671 }else{
665 //--- 看一下是不是线下库存 --- 672 //--- 看一下是不是线下库存 ---
666 if(th.data.sales_rules==2){ 673 if(th.data.sales_rules==2){
@@ -789,6 +796,7 @@ Page({ @@ -789,6 +796,7 @@ Page({
789 e.check_prom_activity(i) 796 e.check_prom_activity(i)
790 } 797 }
791 e.doCheckAll(); 798 e.doCheckAll();
  799 + getApp().requestCardNum(e);
792 } 800 }
793 }); 801 });
794 }, 802 },
@@ -1294,4 +1302,5 @@ Page({ @@ -1294,4 +1302,5 @@ Page({
1294 getApp().goto(url); 1302 getApp().goto(url);
1295 } 1303 }
1296 1304
  1305 +
1297 }); 1306 });
1298 \ No newline at end of file 1307 \ No newline at end of file
pages/cart/cart/cart.wxml
  1 +<import src="../../tabbar/tabbar.wxml" />
  2 +<template is="tabBar" data="{{tabBar}}" />
  3 +
1 <!-- 广告图片 --> 4 <!-- 广告图片 -->
2 <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> 5 <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}">
3 <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> 6 <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image>
@@ -181,5 +184,3 @@ @@ -181,5 +184,3 @@
181 184
182 185
183 <warn id="warn"></warn> 186 <warn id="warn"></warn>
184 -<import src="../../tabbar/tabbar.wxml" />  
185 -<template is="tabBar" data="{{tabBar}}" />  
186 \ No newline at end of file 187 \ No newline at end of file
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 }
@@ -479,6 +481,12 @@ Page({ @@ -479,6 +481,12 @@ Page({
479 if(gg.prom_type==5){ 481 if(gg.prom_type==5){
480 t.data.data.prom_id = gg.prom_id ; 482 t.data.data.prom_id = gg.prom_id ;
481 t.data.data.prom_type =5; 483 t.data.data.prom_type =5;
  484 +
  485 + //--主商品要有导购id和导购类型--
  486 + if(gg.guide_id){
  487 + t.data.data.guide_id=gg.guide_id;
  488 + t.data.data.guide_type=gg.guide_type;
  489 + }
482 th.setData({collocation_goods:gg.collocation_goods}); 490 th.setData({collocation_goods:gg.collocation_goods});
483 491
484 var cart_arr=new Array(); 492 var cart_arr=new Array();
@@ -596,7 +604,7 @@ Page({ @@ -596,7 +604,7 @@ Page({
596 var all_cutprice=0; //所有的优惠减件 604 var all_cutprice=0; //所有的优惠减件
597 var all_order_prom=0; //所有的订单优惠 605 var all_order_prom=0; //所有的订单优惠
598 606
599 - var umoney = th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money; 607 + 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; //全场满多少包邮 608 var freight_free = ee.freight_free; //全场满多少包邮
601 var no_ex_id=ee.no_ex_id; 609 var no_ex_id=ee.no_ex_id;
602 var no_ex_good=null; 610 var no_ex_good=null;
@@ -1423,7 +1431,20 @@ Page({ @@ -1423,7 +1431,20 @@ Page({
1423 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 1431 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
1424 'prom_id': th.data.bn_goods.prom_id, //促销活动id 1432 'prom_id': th.data.bn_goods.prom_id, //促销活动id
1425 }; 1433 };
1426 - 1434 +
  1435 + //-- 把导购的信息填入--
  1436 + if(gg.guide_id){
  1437 + goods.guide_id=gg.guide_id;
  1438 + goods.guide_type=gg.guide_type;
  1439 + //调用接口判断是不是会员
  1440 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  1441 + if(res.data.code==0){
  1442 + goods.guide_name=res.data.data.salesman;
  1443 + goods.guide_sn=res.data.data.salesman_no;
  1444 + }
  1445 + })
  1446 + }
  1447 +
1427 //如果不立即购买或者秒杀,如果是线下库存购买的时候 1448 //如果不立即购买或者秒杀,如果是线下库存购买的时候
1428 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){ 1449 if(goods.prom_type!=1 && goods.prom_type!=6 && th.data.sales_rules==2){
1429 var isok=1; 1450 var isok=1;
@@ -1610,6 +1631,19 @@ Page({ @@ -1610,6 +1631,19 @@ Page({
1610 return false; 1631 return false;
1611 } 1632 }
1612 } 1633 }
  1634 +
  1635 + //导购ID
  1636 + if(g_item.guide_id){
  1637 + goods.guide_id=g_item.guide_id;
  1638 + goods.guide_type=g_item.guide_type;
  1639 + //调用接口判断是不是会员
  1640 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{
  1641 + if(res.data.code==0){
  1642 + goods.guide_name=res.data.data.salesman;
  1643 + goods.guide_sn=res.data.data.salesman_no;
  1644 + }
  1645 + })
  1646 + }
1613 1647
1614 item.order_goods.push(goods); 1648 item.order_goods.push(goods);
1615 } 1649 }
@@ -1620,7 +1654,7 @@ Page({ @@ -1620,7 +1654,7 @@ Page({
1620 1654
1621 if (pdata.length==0) return; 1655 if (pdata.length==0) return;
1622 var str = JSON.stringify(pdata); 1656 var str = JSON.stringify(pdata);
1623 - 1657 +
1624 wx.showLoading({title: "加载中"}); 1658 wx.showLoading({title: "加载中"});
1625 wx.request({ 1659 wx.request({
1626 url: oo.url + '/api/weshop/order/createWxdOrder', 1660 url: oo.url + '/api/weshop/order/createWxdOrder',
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 })
@@ -340,7 +353,7 @@ Page({ @@ -340,7 +353,7 @@ Page({
340 }); 353 });
341 }, 354 },
342 //--------------------提交订单----------------------- 355 //--------------------提交订单-----------------------
343 - submitForm:function(t){ 356 + submitForm: async function(t){
344 if(this.data.is_summit_ing==1) return false; //--提交中退出-- 357 if(this.data.is_summit_ing==1) return false; //--提交中退出--
345 this.data.is_summit_ing=1; 358 this.data.is_summit_ing=1;
346 359
@@ -422,6 +435,20 @@ Page({ @@ -422,6 +435,20 @@ 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 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  445 + if(res.data.code==0){
  446 + goods.guide_name=res.data.data.salesman;
  447 + goods.guide_sn=res.data.data.salesman_no;
  448 + }
  449 + })
  450 + }
  451 +
425 item.order_goods.push(goods); 452 item.order_goods.push(goods);
426 pdata.push(item); 453 pdata.push(item);
427 454
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/getphone/getphone.js
@@ -26,8 +26,7 @@ Page({ @@ -26,8 +26,7 @@ Page({
26 if (openid == "" || openid == null || r==null ){ 26 if (openid == "" || openid == null || r==null ){
27 getApp().globalData.user_id=null; 27 getApp().globalData.user_id=null;
28 getApp().globalData.userInfo=null; 28 getApp().globalData.userInfo=null;
29 - console.log("openid");  
30 - wx.navigateTo({ url: '/pages/togoin/togoin', }) 29 + getApp().goto('/pages/togoin/togoin')
31 return false; 30 return false;
32 } 31 }
33 var user_info=getApp().globalData.userInfo; 32 var user_info=getApp().globalData.userInfo;
pages/giftpack/birthdaygift/birthdaygift.js
@@ -115,14 +115,22 @@ Page({ @@ -115,14 +115,22 @@ Page({
115 }, 115 },
116 116
117 onLoad: function onLoad(options) { 117 onLoad: function onLoad(options) {
  118 +
118 var th = this; 119 var th = this;
119 th.setData({ 120 th.setData({
120 getActId: options.actId, 121 getActId: options.actId,
121 giftID: options.giftBagId 122 giftID: options.giftBagId
122 }) 123 })
123 - th.GetList(); 124 +
124 }, 125 },
125 onShow: function onShow() { 126 onShow: function onShow() {
  127 + //--先判断会员状态--
  128 + var user_info = getApp().globalData.userInfo;
  129 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  130 + getApp().goto('/pages/getphone/getphone');
  131 + return false;
  132 + }
  133 + this.GetList();
126 134
127 }, 135 },
128 GetReceive: function() { 136 GetReceive: function() {
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -27,6 +27,7 @@ Page({ @@ -27,6 +27,7 @@ Page({
27 total: 0, //总数量 27 total: 0, //总数量
28 }, 28 },
29 onLoad: function(options) { 29 onLoad: function(options) {
  30 +
30 var th = this; 31 var th = this;
31 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 32 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
32 my_confirm.open_cancel(0); 33 my_confirm.open_cancel(0);
@@ -34,9 +35,16 @@ Page({ @@ -34,9 +35,16 @@ Page({
34 getStorageID: a.stoid, 35 getStorageID: a.stoid,
35 getUserID: d.user_id 36 getUserID: d.user_id
36 }) 37 })
37 - th.getList(); 38 +
38 }, 39 },
39 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 + getApp().goto('/pages/getphone/getphone');
  45 + return false;
  46 + }
  47 + this.getList();
40 48
41 }, 49 },
42 50
pages/giftpack/buygiftpack/giftpackbuy.wxml
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </block> 36 </block>
37 </view> 37 </view>
38 <view class="content_ware_price"> 38 <view class="content_ware_price">
39 - <text class="ellipsis-1">{{"价:¥"+items.giftPosPrice}}</text> 39 + <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text>
40 </view> 40 </view>
41 <view class="content_ware_time"> 41 <view class="content_ware_time">
42 <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text> 42 <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text>
pages/giftpack/evaluategift/evaluategift.js
@@ -120,6 +120,7 @@ Page({ @@ -120,6 +120,7 @@ Page({
120 }) 120 })
121 }, 121 },
122 onLoad: function(options) { 122 onLoad: function(options) {
  123 +
123 var th = this; 124 var th = this;
124 th.setData({ 125 th.setData({
125 getActId: options.actId, 126 getActId: options.actId,
@@ -133,9 +134,17 @@ Page({ @@ -133,9 +134,17 @@ Page({
133 th.setData({ orderType: orderType}) 134 th.setData({ orderType: orderType})
134 } 135 }
135 136
136 - th.GetList(); 137 +
137 }, 138 },
138 onShow: function() { 139 onShow: function() {
  140 + //--先判断会员状态--
  141 + var user_info = getApp().globalData.userInfo;
  142 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  143 + getApp().goto('/pages/getphone/getphone');
  144 + return false;
  145 + }
  146 +
  147 + this.GetList();
139 148
140 }, 149 },
141 GetReceive: function() { 150 GetReceive: function() {
pages/giftpack/festival/festival.js
@@ -118,18 +118,26 @@ Page({ @@ -118,18 +118,26 @@ Page({
118 }, 118 },
119 119
120 onLoad: function(options) { 120 onLoad: function(options) {
  121 +
121 var th = this; 122 var th = this;
122 th.setData({ 123 th.setData({
123 getActId: options.actId, 124 getActId: options.actId,
124 giftID: options.giftBagId 125 giftID: options.giftBagId
125 }) 126 })
126 - th.is_festival();  
127 - th.GetList(); 127 +
128 wx.setNavigationBarTitle({ 128 wx.setNavigationBarTitle({
129 title: "节日有礼", 129 title: "节日有礼",
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 + getApp().goto('/pages/getphone/getphone');
  137 + return false;
  138 + }
  139 + this.is_festival();
  140 + this.GetList();
133 141
134 }, 142 },
135 GetReceive: function() { 143 GetReceive: function() {
pages/giftpack/giftpacklist/giftpacklist.js
@@ -30,20 +30,30 @@ Page({ @@ -30,20 +30,30 @@ Page({
30 is_lb: 0, //是否有礼包 30 is_lb: 0, //是否有礼包
31 }, 31 },
32 onLoad: function(options) { 32 onLoad: function(options) {
  33 +
  34 +
33 var th = this; 35 var th = this;
34 th.setData({ 36 th.setData({
35 isBuy: options.isBuy, 37 isBuy: options.isBuy,
36 getGiftID: options.lbId, 38 getGiftID: options.lbId,
37 orderSn: options.orderSn 39 orderSn: options.orderSn
38 }) 40 })
39 - if (options.isBuy == 0) {  
40 - th.GetMyGiftList();  
41 - } else {  
42 - th.GetBuyGiftList();  
43 - } 41 +
44 th.close(); 42 th.close();
45 }, 43 },
46 onShow: function() { 44 onShow: function() {
  45 + //--先判断会员状态--
  46 + var user_info = getApp().globalData.userInfo;
  47 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  48 + getApp().goto('/pages/getphone/getphone');
  49 + return false;
  50 + }
  51 +
  52 + if (this.data.isBuy == 0) {
  53 + this.GetMyGiftList();
  54 + } else {
  55 + this.GetBuyGiftList();
  56 + }
47 57
48 }, 58 },
49 GetBuyPrice: function(e) { 59 GetBuyPrice: function(e) {
pages/giftpack/giftpacklist/giftpacklist.wxml
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </view> 25 </view>
26 <view class="top_foot data-v-3a5b7e36"> 26 <view class="top_foot data-v-3a5b7e36">
27 <view class="top_foot_price data-v-3a5b7e36"> 27 <view class="top_foot_price data-v-3a5b7e36">
28 - <text class="data-v-3a5b7e36">{{"价:"+giftPosPrice+"元"}}</text> 28 + <text class="data-v-3a5b7e36">{{"零售价:"+giftPosPrice+"元"}}</text>
29 </view> 29 </view>
30 <view class="top_foot_qty data-v-3a5b7e36"> 30 <view class="top_foot_qty data-v-3a5b7e36">
31 <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> 31 <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text>
pages/giftpack/mygiftpack/mygiftpack.js
@@ -28,6 +28,7 @@ Page({ @@ -28,6 +28,7 @@ Page({
28 }, 28 },
29 29
30 onLoad: function(options) { 30 onLoad: function(options) {
  31 +
31 var th = this; 32 var th = this;
32 th.setData({ 33 th.setData({
33 getStorageID: a.stoid, 34 getStorageID: a.stoid,
@@ -35,9 +36,16 @@ Page({ @@ -35,9 +36,16 @@ Page({
35 loadingType: 0, 36 loadingType: 0,
36 getDate: i.formatTime(new Date().getTime()) 37 getDate: i.formatTime(new Date().getTime())
37 }) 38 })
38 - th.getList(); 39 +
39 }, 40 },
40 onShow: function() { 41 onShow: function() {
  42 + //--先判断会员状态--
  43 + var user_info = getApp().globalData.userInfo;
  44 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  45 + getApp().goto('/pages/getphone/getphone');
  46 + return false;
  47 + }
  48 + this.getList();
41 49
42 }, 50 },
43 getList: function() { 51 getList: function() {
pages/giftpack/mygiftpack/mygiftpack.wxml
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 </block> 68 </block>
69 </view> 69 </view>
70 <view class="content_ware_price"> 70 <view class="content_ware_price">
71 - <text>{{"价:¥"+item.giftPosPrice}}</text> 71 + <text>{{"零售价:¥"+item.giftPosPrice}}</text>
72 </view> 72 </view>
73 <view class="content_ware_time"> 73 <view class="content_ware_time">
74 <block wx:if="{{getDate>item.endTime}}"> 74 <block wx:if="{{getDate>item.endTime}}">
pages/giftpack/newvipgift/newvipgift.js
@@ -114,14 +114,22 @@ Page({ @@ -114,14 +114,22 @@ Page({
114 }, 114 },
115 115
116 onLoad: function(options) { 116 onLoad: function(options) {
  117 +
117 var th = this; 118 var th = this;
118 th.setData({ 119 th.setData({
119 getActId: options.actId, 120 getActId: options.actId,
120 giftID: options.giftBagId 121 giftID: options.giftBagId
121 }) 122 })
122 - th.GetList(); 123 +
123 }, 124 },
124 onShow: function() { 125 onShow: function() {
  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 + getApp().goto('/pages/getphone/getphone');
  130 + return false;
  131 + }
  132 + this.GetList();
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 }
@@ -555,8 +599,57 @@ Page({ @@ -555,8 +599,57 @@ Page({
555 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 599 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
556 600
557 }, 601 },
  602 +
  603 +
  604 + //图片失败,默认图片
  605 + bind_bnerr_t3: function (e) {
  606 + var _errImg = e.target.dataset.errorimg;
  607 + var _errObj = {};
  608 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  609 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  610 +
  611 + },
  612 +
  613 +
  614 +
558 // 新的版本分类点击一级分类 615 // 新的版本分类点击一级分类
559 click_classify:function(e){ 616 click_classify:function(e){
  617 + let cur = e.currentTarget.dataset.current;
  618 + if (this.data.currentTab == cur ) {
  619 + if(this.data.select_classify_on!=220&&this.data.select_classify_on!=223) {
  620 + return false;
  621 + }
  622 + else if(cur!=0){
  623 + return false;
  624 + }
  625 + } else {
  626 + wx.pageScrollTo({
  627 + scrollTop: 0
  628 + })
  629 + this.setData({
  630 + currentTab: cur,
  631 + select_classify_on:cur
  632 + })
  633 + this.checkCor();
  634 + }
  635 + // if(e.currentTarget.dataset.index == 223){
  636 + // this.setData({ status_show: 1});
  637 + // }else if(e.currentTarget.dataset.index == 220){
  638 + // this.setData({ status_show: 2});
  639 + // }else{
  640 + // this.setData({ status_show: 0});
  641 + // }
  642 + var arr2 = this.data.one_level_classify
  643 + for(var i=0;i<arr2.length;i++){
  644 + if(i == e.currentTarget.dataset.index){
  645 + arr2[i]['items']['is_show_class'] = true
  646 + }else{
  647 + arr2[i]['items']['is_show_class'] = false
  648 + }
  649 + }
  650 + this.setData({ one_level_classify: arr2});
  651 + //this.data.one_level_classify[e.currentTarget.dataset.index]['items']['is_show_class'] = true
  652 + console.log(e.currentTarget.dataset.index)
560 clearInterval(this.data.timer); 653 clearInterval(this.data.timer);
561 this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0}); 654 this.setData({ countDownNum: 3, stylePage: 1, scrollTop: 0});
562 this.data.ishaf_three = 0; 655 this.data.ishaf_three = 0;
@@ -565,12 +658,13 @@ Page({ @@ -565,12 +658,13 @@ Page({
565 var cid = e.currentTarget.dataset.cid; 658 var cid = e.currentTarget.dataset.cid;
566 var pid = e.currentTarget.dataset.pid; 659 var pid = e.currentTarget.dataset.pid;
567 var arr = e.currentTarget.dataset.arr; 660 var arr = e.currentTarget.dataset.arr;
568 - console.log("cid:=" + cid) 661 + console.log("cid:=" + name)
569 if (indexs == 220) { this.get_brand(); } 662 if (indexs == 220) { this.get_brand(); }
570 //==2的时候 请求数据为商品,不为分类 663 //==2的时候 请求数据为商品,不为分类
571 if (this.data.is_used_share == 2) { 664 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, }); 665 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid,lastMsg: false, });
  666 + console.log("edqdqw:="+this.data.select_classify_on)
  667 + this.style(this.data.stylePage, cid)
574 }else{ 668 }else{
575 if (arr != "undefined" && arr != undefined) { 669 if (arr != "undefined" && arr != undefined) {
576 if (arr.length == 0) { 670 if (arr.length == 0) {
@@ -588,10 +682,10 @@ Page({ @@ -588,10 +682,10 @@ Page({
588 this.setData({ is_level_three: is_lev_thr }); 682 this.setData({ is_level_three: is_lev_thr });
589 683
590 if (this.data.is_level_three != 1) { 684 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 - } 685 + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr });
  686 + } else {
  687 + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr });
  688 + }
595 } 689 }
596 } 690 }
597 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,}); 691 this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid, stylePage: 1,lastMsg: false,});
@@ -756,6 +850,8 @@ Page({ @@ -756,6 +850,8 @@ Page({
756 if (page != 1) { 850 if (page != 1) {
757 var dataArray = s.data.one_level_classify 851 var dataArray = s.data.one_level_classify
758 var index = s.data.index 852 var index = s.data.index
  853 + dataArray[index]['items']['is_show_class'] = false
  854 + dataArray[index+1]['items']['is_show_class'] = true
759 console.log(dataArray[index + 1]['items']) 855 console.log(dataArray[index + 1]['items'])
760 s.setData({ 856 s.setData({
761 msgStatus: true, 857 msgStatus: true,
@@ -763,7 +859,8 @@ Page({ @@ -763,7 +859,8 @@ Page({
763 index: index + 1, 859 index: index + 1,
764 select_classify_on: index + 1, 860 select_classify_on: index + 1,
765 cat_id: dataArray[index + 1]['items']['id'], 861 cat_id: dataArray[index + 1]['items']['id'],
766 - classify_name: dataArray[index + 1]['items']['name'] 862 + classify_name: dataArray[index + 1]['items']['name'],
  863 + one_level_classify: dataArray
767 }); 864 });
768 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']) 865 s.style(s.data.stylePage, dataArray[index + 1]['items']['id'])
769 }else{ 866 }else{
@@ -798,12 +895,15 @@ Page({ @@ -798,12 +895,15 @@ Page({
798 lastMsg: true 895 lastMsg: true
799 }); 896 });
800 }else{ 897 }else{
  898 + dataArray[index]['items']['is_show_class'] = false
  899 + dataArray[index+1]['items']['is_show_class'] = true
801 s.setData({ 900 s.setData({
802 stylePage: 1, 901 stylePage: 1,
803 index: index + 1, 902 index: index + 1,
804 select_classify_on: index + 1, 903 select_classify_on: index + 1,
805 cat_id: dataArray[index + 1]['items']['id'], 904 cat_id: dataArray[index + 1]['items']['id'],
806 - classify_name: dataArray[index + 1]['items']['name'] 905 + classify_name: dataArray[index + 1]['items']['name'],
  906 + one_level_classify:dataArray
807 }); 907 });
808 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']); 908 s.style(s.data.stylePage, dataArray[index + 1]['items']['id']);
809 } 909 }
@@ -813,6 +913,15 @@ Page({ @@ -813,6 +913,15 @@ Page({
813 s.setData({ 913 s.setData({
814 countDownNum: countDownNum 914 countDownNum: countDownNum
815 }) 915 })
  916 + var arr2 = s.data.one_level_classify
  917 + for(var i=0;i<arr2.length;i++){
  918 + if(i == s.data.index){
  919 + arr2[i]['items']['is_show_class'] = true
  920 + }else{
  921 + arr2[i]['items']['is_show_class'] = false
  922 + }
  923 + }
  924 + s.setData({ one_level_classify: arr2});
816 }, 1000) 925 }, 1000)
817 } 926 }
818 927
@@ -870,5 +979,6 @@ Page({ @@ -870,5 +979,6 @@ Page({
870 var ob = { "card_list": new_arr, "name_map": card_name_map }; 979 var ob = { "card_list": new_arr, "name_map": card_name_map };
871 func(ob); 980 func(ob);
872 }) 981 })
873 - }, 982 + }
  983 +
874 }); 984 });
875 \ No newline at end of file 985 \ No newline at end of file
pages/goods/categoryList/categoryList.wxml
  1 +<import src="../../tabbar/tabbar.wxml" />
  2 +<template is="tabBar" data="{{tabBar}}" />
  3 +
1 <!-- 风格1 --> 4 <!-- 风格1 -->
2 <block wx:if="{{is_used_share==0}}"> 5 <block wx:if="{{is_used_share==0}}">
3 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> 6 <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
@@ -98,7 +101,7 @@ @@ -98,7 +101,7 @@
98 <block wx:elif="{{is_used_share == 1}}"> 101 <block wx:elif="{{is_used_share == 1}}">
99 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> 102 <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
100 <!-- 新版分类头部 --> 103 <!-- 新版分类头部 -->
101 - <view class="xc-search-box flex-center white_b"> 104 + <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" > 105 <view class="share-height t-c" bindtap="getScancode" >
103 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> 106 <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
104 <view class="fs24"> 107 <view class="fs24">
@@ -113,46 +116,46 @@ @@ -113,46 +116,46 @@
113 </view> 116 </view>
114 </view> 117 </view>
115 118
116 - <!-- 分类项目内容 -->  
117 - <view class="flex project_height" style="margin-left:-10rpx;margin-bottom:120rpx"> 119 +
  120 + <!-- 分类项目内容 22 -->
  121 + <view class="flex project_height" style="margin-left:-10rpx;margin-bottom:120rpx" id="two_type">
118 <!-- 分类项目的类型 --> 122 <!-- 分类项目的类型 -->
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> 123 + <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:126rpx;">
  124 + <view class="project_type-frame" style="margin-bottom:120rpx;">
  125 + <view wx:if="{{is_show_gb}}" class="{{status_show == 1?'':''}}">
  126 + <!-- <view style="{{status_show == 1?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  127 + <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}}">
  128 +
  129 + <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">国家</view>
124 130
125 </view> 131 </view>
126 </view> 132 </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> 133 + <view wx:if="{{is_show_pp}}" class="{{status_show == 2?'':''}}">
  134 + <!-- <view style="{{status_show == 2?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  135 + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} fs30 flex-space-between " wx:if="{{is_brand}}"data-index="220"data-name="品牌">
  136 +
  137 + <view class="tab-bar-item sort-name ellipsis-1" style="letter-spacing:50rpx;">品牌</view>
130 </view> 138 </view>
131 </view> 139 </view>
132 <view wx:if="{{is_show_pl}}"> 140 <view wx:if="{{is_show_pl}}">
133 141
134 <view wx:for="{{one_level_classify}}" wx:for-item="ittms" > 142 <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> 143 + <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}">
  144 + <!-- 添加左边红色条 -->
  145 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  146 + <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}}">
  147 +
  148 + <view class="tab-bar-item sort-name ellipsis-1">{{ittms.items.name}}</view>
146 </view> 149 </view>
147 150
148 </view> 151 </view>
149 - 152 + </view>
150 </view> 153 </view>
151 </view> 154 </view>
152 155
153 </view> 156 </view>
154 <!-- 分类项目的内容 --> 157 <!-- 分类项目的内容 -->
155 - <view class="classify_content"> 158 + <view class="classify_content" style="margin-left:27%;margin-top:130rpx">
156 <!-- 国家的样式 --> 159 <!-- 国家的样式 -->
157 <block wx:if="{{select_classify_on==223&&is_show_gb}}"> 160 <block wx:if="{{select_classify_on==223&&is_show_gb}}">
158 <view class="classify_name fs28 flex-space-between"> 161 <view class="classify_name fs28 flex-space-between">
@@ -288,21 +291,25 @@ @@ -288,21 +291,25 @@
288 <!-- 分类项目内容 --> 291 <!-- 分类项目内容 -->
289 <view class="flex project_height" style="margin-left:-10rpx;"> 292 <view class="flex project_height" style="margin-left:-10rpx;">
290 <!-- 分类项目的类型 --> 293 <!-- 分类项目的类型 -->
291 - <view class="project_type" style="background-color:#eee;height:88%;overflow-y:auto;position:fixed;left:0;z-index:999999;top:120rpx;"> 294 + <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;"> 295 <view class="project_type-frame" style="margin-bottom:120rpx;">
293 <view wx:if="{{is_show_gb}}"> 296 <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> 297 + <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}}">
  298 + <text style="letter-spacing:50rpx;">国家</text>
296 </view> 299 </view>
297 </view> 300 </view>
298 <view wx:if="{{is_show_pp}}"> 301 <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> 302 +
  303 + <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="品牌">
  304 + <text style="letter-spacing:50rpx;">品牌</text>
301 </view> 305 </view>
302 </view> 306 </view>
303 <view wx:if="{{is_show_pl}}"> 307 <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}}"> 308 + <!-- <view wx:for="{{one_level_classify}}" wx:for-item="ittms" class="class_set_height"> -->
  309 + <!-- <view class="{{ittms.items.is_show_class == true?'is_show_class':''}}"> -->
  310 + <!-- 添加左边红色条 -->
  311 + <!-- <view style="{{ittms.items.is_show_class == true?'position: absolute;height: 52rpx;width: 6rpx;background-color: red;left: 0; margin-top: 24rpx;':''}}"></view> -->
  312 + <!-- <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}}"> 313 <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"> 314 <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
308 <view> 315 <view>
@@ -311,11 +318,26 @@ @@ -311,11 +318,26 @@
311 </view> 318 </view>
312 </view> 319 </view>
313 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view> 320 <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</view>
  321 + </view> -->
  322 + <!-- </view> -->
  323 + <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">
  324 + <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}}">
  325 + <text>{{ittms.items.name}}</text>
  326 + <!-- <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}">
  327 + <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index">
  328 + <text>
  329 + {{name}}
  330 + </text>
  331 + </view>
  332 + </view>
  333 + <text wx:else class="sort-name ellipsis-1">{{ittms.items.name}}</text> -->
314 </view> 334 </view>
315 - </view>  
316 - </view> 335 + </scroll-view>
  336 +
  337 + <!-- </view> -->
317 </view> 338 </view>
318 </view> 339 </view>
  340 + </view>
319 <!-- 分类项目的内容 --> 341 <!-- 分类项目的内容 -->
320 <view class="classify_content" style="margin-left:27%;margin-top:130rpx"> 342 <view class="classify_content" style="margin-left:27%;margin-top:130rpx">
321 <!-- 国家的样式 --> 343 <!-- 国家的样式 -->
@@ -364,7 +386,7 @@ @@ -364,7 +386,7 @@
364 </block> 386 </block>
365 <!-- 品类--> 387 <!-- 品类-->
366 <block wx:if="{{is_show_pl}}"> 388 <block wx:if="{{is_show_pl}}">
367 - <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> 389 + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}">
368 <view style="width:100%;height:100%;"> 390 <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;"> 391 <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> 392 <view class="classify_title ellipsis-1">{{classify_name}}</view>
@@ -377,13 +399,13 @@ @@ -377,13 +399,13 @@
377 <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> --> 399 <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->
378 400
379 <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> --> 401 <!-- <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;"> 402 + <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> 403 <view class="null" style="width:100%;height:1px;"></view>
382 <!-- goodslist --> 404 <!-- goodslist -->
383 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}"> 405 <view class="choice_list" style="height:{{msgStatus != true?'100%':''}}">
384 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}"> 406 <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{index}}" wx:key="{{index}}">
385 <view class="img-wrap"> 407 <view class="img-wrap">
386 - <image src="{{url+item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image> 408 + <image src="{{url+item.original_img}}" binderror="bind_bnerr_t3" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
387 </view> 409 </view>
388 <view class="item-cont"> 410 <view class="item-cont">
389 <view class="title">{{item.goods_name}}</view> 411 <view class="title">{{item.goods_name}}</view>
@@ -488,5 +510,3 @@ @@ -488,5 +510,3 @@
488 </block> 510 </block>
489 511
490 </block> 512 </block>
491 - <import src="../../tabbar/tabbar.wxml" />  
492 - <template is="tabBar" data="{{tabBar}}" />  
493 \ No newline at end of file 513 \ No newline at end of file
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.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) {
@@ -345,68 +365,81 @@ Page({ @@ -345,68 +365,81 @@ Page({
345 365
346 //获取用户的默认门店 366 //获取用户的默认门店
347 getApp().get_user_store(function(ee) { 367 getApp().get_user_store(function(ee) {
  368 +
348 if(!ee) { 369 if(!ee) {
349 th.data.fir_def_store={}; //赋值空对象 370 th.data.fir_def_store={}; //赋值空对象
350 return false; 371 return false;
351 } 372 }
352 - var appd=getApp().globalData;  
353 - var w_time = setInterval(function() {  
354 - if (that.data.is_get_local_ok == 0) return false;  
355 - clearInterval(w_time);  
356 - var distance = null;  
357 - var e=JSON.parse(JSON.stringify(ee));  
358 -  
359 - //如果有开启近距离的话,同时距离优不一样了  
360 - if (that.data.lat != null) {  
361 - //如果经纬度有变化的话  
362 - if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){  
363 - that.data.fir_def_store=e;  
364 - that.setData({  
365 - def_pick_store: e,  
366 - sto_sele_name: e.pickup_name,  
367 - sto_sele_id: e.pickup_id,  
368 - sto_sele_distr: e.distr_type  
369 - })  
370 - }else{  
371 - //要用接口是获取距离,js的计算不准  
372 - getApp().request.promiseGet("/api/weshop/pickup/list",{  
373 - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},  
374 - }).then(res=>{  
375 - if(res.data.code==0){  
376 - e=res.data.data.pageData[0];  
377 - if (e){  
378 - appd.pk_store=e;  
379 - that.data.fir_def_store=e;  
380 - that.setData({  
381 - def_pick_store: e,  
382 - sto_sele_name: e.pickup_name,  
383 - sto_sele_id: e.pickup_id,  
384 - sto_sele_distr: e.distr_type  
385 - })  
386 - }  
387 -  
388 - }  
389 - })  
390 - }  
391 -  
392 - //e.distance = distance;  
393 - appd.lat=that.data.lat;  
394 - appd.lon=that.data.lon;  
395 -  
396 - }else{  
397 - if (e) {  
398 - e.distance = null;  
399 - that.data.fir_def_store=e;  
400 - that.setData({  
401 - def_pick_store: e,  
402 - sto_sele_name: e.pickup_name,  
403 - sto_sele_id: e.pickup_id,  
404 - sto_sele_distr: e.distr_type  
405 - })  
406 - }  
407 - }  
408 -  
409 - }, 500) 373 +
  374 + //--定时器推迟一下--
  375 + setTimeout(function () {
  376 + var g_distr_type=th.data.data.distr_type;
  377 + //--如果默认门店的配送方式不对,就不能被选择--
  378 + if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){
  379 + th.data.fir_def_store={}; //赋值空对象
  380 + return false;
  381 + }
  382 +
  383 + var appd=getApp().globalData;
  384 + var w_time = setInterval(function() {
  385 + if (that.data.is_get_local_ok == 0) return false;
  386 + clearInterval(w_time);
  387 + var distance = null;
  388 + var e=JSON.parse(JSON.stringify(ee));
  389 +
  390 + //如果有开启近距离的话,同时距离优不一样了
  391 + if (that.data.lat != null) {
  392 + //如果经纬度有变化的话
  393 + if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
  394 + that.data.fir_def_store=e;
  395 + that.setData({
  396 + def_pick_store: e,
  397 + sto_sele_name: e.pickup_name,
  398 + sto_sele_id: e.pickup_id,
  399 + sto_sele_distr: e.distr_type
  400 + })
  401 + }else{
  402 + //要用接口是获取距离,js的计算不准
  403 + getApp().request.promiseGet("/api/weshop/pickup/list",{
  404 + data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon},
  405 + }).then(res=>{
  406 + if(res.data.code==0){
  407 + e=res.data.data.pageData[0];
  408 + if (e){
  409 + appd.pk_store=e;
  410 + that.data.fir_def_store=e;
  411 + that.setData({
  412 + def_pick_store: e,
  413 + sto_sele_name: e.pickup_name,
  414 + sto_sele_id: e.pickup_id,
  415 + sto_sele_distr: e.distr_type
  416 + })
  417 + }
  418 +
  419 + }
  420 + })
  421 + }
  422 +
  423 + //e.distance = distance;
  424 + appd.lat=that.data.lat;
  425 + appd.lon=that.data.lon;
  426 +
  427 + }else{
  428 + if (e) {
  429 + e.distance = null;
  430 + that.data.fir_def_store=e;
  431 + that.setData({
  432 + def_pick_store: e,
  433 + sto_sele_name: e.pickup_name,
  434 + sto_sele_id: e.pickup_id,
  435 + sto_sele_distr: e.distr_type
  436 + })
  437 + }
  438 + }
  439 +
  440 + }, 500)
  441 + },1000)
  442 +
410 }); 443 });
411 444
412 }, 445 },
@@ -932,6 +965,19 @@ Page({ @@ -932,6 +965,19 @@ Page({
932 sku: o.sku, 965 sku: o.sku,
933 }; 966 };
934 967
  968 + //---是不是从收藏夹出来的---
  969 + if(th.data.c_guide_id){
  970 + newd['guide_id'] = th.data.c_guide_id;
  971 + newd['guide_type']=2;
  972 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  973 + }else{
  974 + if(getApp().globalData.guide_id){
  975 + newd['guide_id'] = getApp().globalData.guide_id;
  976 + newd['guide_type']=0;
  977 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  978 + }
  979 + }
  980 +
935 //如果是积分够,is_integral_normal就要有积分购普通购买字段 981 //如果是积分够,is_integral_normal就要有积分购普通购买字段
936 if(o.prom_type==4){ 982 if(o.prom_type==4){
937 newd.is_integral_normal=1; 983 newd.is_integral_normal=1;
@@ -1028,8 +1074,6 @@ Page({ @@ -1028,8 +1074,6 @@ Page({
1028 } 1074 }
1029 } 1075 }
1030 } 1076 }
1031 -  
1032 -  
1033 1077
1034 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); 1078 //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d);
1035 if ("add" == t.currentTarget.dataset.action) { 1079 if ("add" == t.currentTarget.dataset.action) {
@@ -1064,7 +1108,6 @@ Page({ @@ -1064,7 +1108,6 @@ Page({
1064 return s.my_warnning("库存不足!", 0, th); 1108 return s.my_warnning("库存不足!", 0, th);
1065 } 1109 }
1066 } 1110 }
1067 -  
1068 1111
1069 var updata = { 1112 var updata = {
1070 id: item.id, 1113 id: item.id,
@@ -1073,7 +1116,18 @@ Page({ @@ -1073,7 +1116,18 @@ Page({
1073 member_goods_price:newd.goods_price, 1116 member_goods_price:newd.goods_price,
1074 store_id: th.data.stoid, 1117 store_id: th.data.stoid,
1075 }; 1118 };
1076 - 1119 +
  1120 + //---是不是从收藏夹出来的---
  1121 + if(th.data.c_guide_id){
  1122 + updata['guide_id'] = th.data.c_guide_id;
  1123 + updata['guide_type']=3; //加入购物车之后就变成了3
  1124 + }else {
  1125 + if (getApp().globalData.guide_id) {
  1126 + updata['guide_id'] = getApp().globalData.guide_id;
  1127 + updata['guide_type'] = 0;
  1128 + }
  1129 + }
  1130 +
1077 i.put("/api/weshop/cart/update", { 1131 i.put("/api/weshop/cart/update", {
1078 data: updata, 1132 data: updata,
1079 success: function(t) { 1133 success: function(t) {
@@ -1086,6 +1140,8 @@ Page({ @@ -1086,6 +1140,8 @@ Page({
1086 } 1140 }
1087 }); 1141 });
1088 } else { 1142 } else {
  1143 +
  1144 +
1089 i.post("/api/weshop/cart/save", { 1145 i.post("/api/weshop/cart/save", {
1090 data: newd, 1146 data: newd,
1091 success: function(t) { 1147 success: function(t) {
@@ -1124,7 +1180,7 @@ Page({ @@ -1124,7 +1180,7 @@ Page({
1124 break; 1180 break;
1125 } 1181 }
1126 } 1182 }
1127 - 1183 +
1128 } 1184 }
1129 1185
1130 newd['pick_name'] = th.data.sto_sele_name; 1186 newd['pick_name'] = th.data.sto_sele_name;
@@ -1133,9 +1189,7 @@ Page({ @@ -1133,9 +1189,7 @@ Page({
1133 } 1189 }
1134 }, 1190 },
1135 1191
1136 -  
1137 -  
1138 - 1192 +
1139 //----------购买虚拟商品------ 1193 //----------购买虚拟商品------
1140 buyVirtualGoods: function(e) { 1194 buyVirtualGoods: function(e) {
1141 Object.assign(e, { 1195 Object.assign(e, {
@@ -1319,6 +1373,12 @@ Page({ @@ -1319,6 +1373,12 @@ Page({
1319 store_id: o.stoid, 1373 store_id: o.stoid,
1320 add_time: timestamp, 1374 add_time: timestamp,
1321 }; 1375 };
  1376 + //加入收藏夹就是导购的ID
  1377 + if(getApp().globalData.guide_id){
  1378 + d.guide_id=getApp().globalData.guide_id;
  1379 + d.guide_type=2;
  1380 + }
  1381 +
1322 i.post("/api/weshop/goodscollect/save", { //添加收藏 1382 i.post("/api/weshop/goodscollect/save", { //添加收藏
1323 data: d, 1383 data: d,
1324 success: function(e) { 1384 success: function(e) {
@@ -1438,10 +1498,14 @@ Page({ @@ -1438,10 +1498,14 @@ Page({
1438 title=th.data.prom_act.share_title; 1498 title=th.data.prom_act.share_title;
1439 img=th.data.iurl+th.data.prom_act.share_imgurl; 1499 img=th.data.iurl+th.data.prom_act.share_imgurl;
1440 } 1500 }
  1501 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  1502 + if(getApp().globalData.user_id){
  1503 + url+="&first_leader="+getApp().globalData.user_id;
  1504 + }
1441 1505
1442 return { 1506 return {
1443 title: price + "元 " +title, 1507 title: price + "元 " +title,
1444 - path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, 1508 + path:url,
1445 imageUrl: img, 1509 imageUrl: img,
1446 } 1510 }
1447 1511
@@ -1657,7 +1721,7 @@ Page({ @@ -1657,7 +1721,7 @@ Page({
1657 if (th.data.is_get_local_ok == 0) return false; 1721 if (th.data.is_get_local_ok == 0) return false;
1658 var dd = null, 1722 var dd = null,
1659 i = getApp().request; 1723 i = getApp().request;
1660 - var g_distr_type = th.data.data.distr_type; 1724 + var g_distr_type = th.data.sele_g.distr_type;
1661 if (g_distr_type != 0) { 1725 if (g_distr_type != 0) {
1662 dd = { 1726 dd = {
1663 store_id: o.stoid, 1727 store_id: o.stoid,
@@ -1678,6 +1742,12 @@ Page({ @@ -1678,6 +1742,12 @@ Page({
1678 dd.lon = th.data.lon; 1742 dd.lon = th.data.lon;
1679 } 1743 }
1680 clearInterval(timer_get); 1744 clearInterval(timer_get);
  1745 +
  1746 + if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){
  1747 + th.setData({def_pick_store:null});
  1748 + }
  1749 +
  1750 +
1681 //----------获取门店---------------- 1751 //----------获取门店----------------
1682 getApp().request.promiseGet("/api/weshop/pickup/list", { 1752 getApp().request.promiseGet("/api/weshop/pickup/list", {
1683 data: dd, 1753 data: dd,
@@ -1697,7 +1767,7 @@ Page({ @@ -1697,7 +1767,7 @@ Page({
1697 } 1767 }
1698 1768
1699 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- 1769 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
1700 - if (th.data.def_pick_store) { 1770 + if (th.data.def_pick_store && (th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
1701 for (var k = 0; k < e.data.data.pageData.length; k++) { 1771 for (var k = 0; k < e.data.data.pageData.length; k++) {
1702 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { 1772 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
1703 e.data.data.pageData.splice(k, 1); //删除 1773 e.data.data.pageData.splice(k, 1); //删除
@@ -1729,6 +1799,9 @@ Page({ @@ -1729,6 +1799,9 @@ Page({
1729 //------------处理门店--------------- 1799 //------------处理门店---------------
1730 deal_pickup(e){ 1800 deal_pickup(e){
1731 var th=this; 1801 var th=this;
  1802 +
  1803 + var g_distr_type=th.data.sele_g.distr_type;
  1804 +
1732 //单总量超出5个的时候 1805 //单总量超出5个的时候
1733 if (e.data.data.total > 5) { 1806 if (e.data.data.total > 5) {
1734 getApp().request.get("/api/weshop/storagecategory/page", { 1807 getApp().request.get("/api/weshop/storagecategory/page", {
@@ -1832,8 +1905,8 @@ Page({ @@ -1832,8 +1905,8 @@ Page({
1832 }); 1905 });
1833 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ 1906 //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------
1834 if (!th.data.def_pick_store) { 1907 if (!th.data.def_pick_store) {
1835 - th.setData({def_pick_store:e.data.data.pageData[0]})  
1836 - } 1908 + th.setData({def_pick_store:e.data.data.pageData[0]})
  1909 + }
1837 } 1910 }
1838 } else { 1911 } else {
1839 th.setData({ 1912 th.setData({
@@ -1863,7 +1936,6 @@ Page({ @@ -1863,7 +1936,6 @@ Page({
1863 }) 1936 })
1864 } 1937 }
1865 } 1938 }
1866 -  
1867 }, 1939 },
1868 //------------处理线下门店库存-------- 1940 //------------处理线下门店库存--------
1869 deal_pickup_dline(e){ 1941 deal_pickup_dline(e){
@@ -1880,7 +1952,9 @@ Page({ @@ -1880,7 +1952,9 @@ Page({
1880 var o_plist=e.data.data.pageData; 1952 var o_plist=e.data.data.pageData;
1881 var new_list=[]; 1953 var new_list=[];
1882 var is_find_def_store=0; 1954 var is_find_def_store=0;
1883 - 1955 +
  1956 +
  1957 + var g_distr_type=th.data.sele_g.distr_type;
1884 var lock=[]; 1958 var lock=[];
1885 //先读取门店的lock,采用链式写法,少用await 1959 //先读取门店的lock,采用链式写法,少用await
1886 getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{ 1960 getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
@@ -1911,8 +1985,8 @@ Page({ @@ -1911,8 +1985,8 @@ Page({
1911 if(n_item.CanOutQty>lock_num){ 1985 if(n_item.CanOutQty>lock_num){
1912 o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; 1986 o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num;
1913 new_list.push(o_plist[kk]); 1987 new_list.push(o_plist[kk]);
1914 - //如果找到默认门店  
1915 - if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no){ 1988 + //--如果找到默认门店,同时也应该判断配送方式对不对--
  1989 + if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){
1916 th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num; 1990 th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num;
1917 if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id) 1991 if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id)
1918 th.setData({def_pick_store:th.data.fir_def_store}) 1992 th.setData({def_pick_store:th.data.fir_def_store})
@@ -1927,9 +2001,10 @@ Page({ @@ -1927,9 +2001,10 @@ Page({
1927 //数据组装下 2001 //数据组装下
1928 var em={};em.data={};em.data.data={}; 2002 var em={};em.data={};em.data.data={};
1929 em.data.data.total=new_list.length; 2003 em.data.data.total=new_list.length;
1930 - em.data.data.pageData=new_list;  
1931 -  
1932 - if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id){ 2004 + em.data.data.pageData=new_list;
  2005 +
  2006 + //--如果找到默认门店,同时也应该判断配送方式对不对--
  2007 + if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type==0 || th.data.fir_def_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type ) ){
1933 th.data.fir_def_store.CanOutQty=0; 2008 th.data.fir_def_store.CanOutQty=0;
1934 //--当选择的门店是客户默认的门店的时候-- 2009 //--当选择的门店是客户默认的门店的时候--
1935 if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) { 2010 if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) {
@@ -2748,6 +2823,19 @@ Page({ @@ -2748,6 +2823,19 @@ Page({
2748 sku: o.sku, 2823 sku: o.sku,
2749 }; 2824 };
2750 2825
  2826 + //---是不是从收藏夹出来的---
  2827 + if(th.data.c_guide_id){
  2828 + newd['guide_id'] = th.data.c_guide_id;
  2829 + newd['guide_type']=2;
  2830 +
  2831 + }else{
  2832 + if(getApp().globalData.guide_id){
  2833 + newd['guide_id'] = getApp().globalData.guide_id;
  2834 + newd['guide_type']=0;
  2835 +
  2836 + }
  2837 + }
  2838 +
2751 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ 2839 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
2752 2840
2753 if(th.data.is_normal == 1){ 2841 if(th.data.is_normal == 1){
@@ -3126,7 +3214,12 @@ Page({ @@ -3126,7 +3214,12 @@ Page({
3126 var app = getApp(); 3214 var app = getApp();
3127 var unit = that.data.screenWidth / 750 * 1.35; 3215 var unit = that.data.screenWidth / 750 * 1.35;
3128 var path2 = that.data.data.original_img; 3216 var path2 = that.data.data.original_img;
3129 - var scene = th.data.gid; 3217 + var scene = th.data.gid+"";
  3218 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  3219 + if(user_id>0){
  3220 + scene+="_"+user_id;
  3221 + }
  3222 +
3130 ///二微码 3223 ///二微码
3131 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 3224 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
3132 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; 3225 os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
@@ -3140,7 +3233,7 @@ Page({ @@ -3140,7 +3233,7 @@ Page({
3140 var vpath = res.path; 3233 var vpath = res.path;
3141 var context = wx.createCanvasContext('share'); 3234 var context = wx.createCanvasContext('share');
3142 //先画背景 3235 //先画背景
3143 - var pg_path = "/pacj/images/share/share_bg.png"; 3236 + var pg_path = "../../../images/share/share_bg.png";
3144 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); 3237 context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
3145 //--昵称--- 3238 //--昵称---
3146 context.setFontSize(24 * unit) 3239 context.setFontSize(24 * unit)
pages/goods/goodsInfo/goodsInfo.wxml
@@ -241,12 +241,12 @@ @@ -241,12 +241,12 @@
241 </view> 241 </view>
242 <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}} 242 <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}
243 <view class='yj' style="top:35rpx"> 243 <view class='yj' style="top:35rpx">
244 - <text>价:¥{{data.market_price}}</text> 244 + <text>零售价:¥{{data.market_price}}</text>
245 </view> 245 </view>
246 </block> 246 </block>
247 <block wx:else> 247 <block wx:else>
248 <text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}} 248 <text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}}
249 - <view class='yj'><text>价:¥{{data.market_price}}</text></view> 249 + <view class='yj'><text>零售价:¥{{data.market_price}}</text></view>
250 </block> 250 </block>
251 </view> 251 </view>
252 252
@@ -344,7 +344,8 @@ @@ -344,7 +344,8 @@
344 <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view> 344 <view class="word-line fs24 xc-unit-price">零售价¥{{data.market_price}}</view>
345 </view> 345 </view>
346 <view class="xc-val-price"> 346 <view class="xc-val-price">
347 - <view class="fs30" style='padding-left:13rpx;'>已抢:{{prom_act.buy_num+prom_act.virtual}}件</view> 347 + <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view>
  348 + <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view>
348 <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view> 349 <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view>
349 </view> 350 </view>
350 </view> 351 </view>
pages/goods/goodsList/goodsList.js
@@ -21,9 +21,25 @@ Page({ @@ -21,9 +21,25 @@ Page({
21 is_new:0, 21 is_new:0,
22 is_hot:0, 22 is_hot:0,
23 prom_goods_list:null, 23 prom_goods_list:null,
  24 + rq_data:null,
24 }, 25 },
25 26
26 onLoad: function(t) { 27 onLoad: function(t) {
  28 +
  29 + this.data.rq_data=t;
  30 +
  31 + //接受有没有导购的参数
  32 + var first_leader=t.first_leader;
  33 + if(first_leader){
  34 + getApp().globalData.first_leader=first_leader;
  35 + //调用接口判断是不是会员
  36 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  37 + if(res.data.code==0){
  38 + getApp().globalData.guide_id=res.data.data.id;
  39 + }
  40 + })
  41 + }
  42 +
27 var th=this; 43 var th=this;
28 a.init(this, "", "requestData"); 44 a.init(this, "", "requestData");
29 var url = this.data.baseUrl; 45 var url = this.data.baseUrl;
@@ -194,9 +210,29 @@ Page({ @@ -194,9 +210,29 @@ Page({
194 }, 210 },
195 //---------分享配置-------- 211 //---------分享配置--------
196 onShareAppMessage: function (e) { 212 onShareAppMessage: function (e) {
197 - return {  
198 - title: "商品列表",  
199 - } 213 + var curPage=this;
  214 + var pagePath = curPage.route; //当前页面url
  215 + if (pagePath.indexOf('/') != 0) {
  216 + pagePath = '/' + pagePath;
  217 + }
  218 +
  219 + if(this.data.rq_data && JSON.stringify(this.data.rq_data) != "{}") {
  220 + var parm = ut.ob_to_parm(this.data.rq_data);
  221 + pagePath += "?" + parm;
  222 + }
  223 +
  224 + if(getApp().globalData.user_id){
  225 + if(pagePath.indexOf("?")>0){
  226 + pagePath+="&first_leader="+getApp().globalData.user_id;
  227 + }else{
  228 + pagePath+="?first_leader="+getApp().globalData.user_id;
  229 + }
  230 + }
  231 + console.log("11-11"+pagePath);
  232 + return {
  233 + title: "商品列表",
  234 + path:pagePath,
  235 + }
200 }, 236 },
201 //---图片失败,默认图片--- 237 //---图片失败,默认图片---
202 bind_bnerr2: function (e) { 238 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
@@ -142,6 +142,7 @@ @@ -142,6 +142,7 @@
142 {{item.name}}</view> 142 {{item.name}}</view>
143 </view> 143 </view>
144 </view> 144 </view>
  145 +
145 <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}"> 146 <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}">
146 <view class="filter-name">{{item.name}}</view> 147 <view class="filter-name">{{item.name}}</view>
147 <view class="filter-items"> 148 <view class="filter-items">
@@ -164,4 +165,6 @@ @@ -164,4 +165,6 @@
164 </view> 165 </view>
165 </view> 166 </view>
166 </view> 167 </view>
167 - </view>  
168 \ No newline at end of file 168 \ No newline at end of file
  169 + </view>
  170 +
  171 +<share_box id="share"></share_box>
169 \ No newline at end of file 172 \ No newline at end of file
pages/goods/search/search.js
@@ -21,8 +21,23 @@ Page({ @@ -21,8 +21,23 @@ Page({
21 21
22 tabname: "goods_id", //排序的字段 22 tabname: "goods_id", //排序的字段
23 adname: "desc", //升降的字段 23 adname: "desc", //升降的字段
  24 + rq_data:null,
24 }, 25 },
25 onLoad: function(t) { 26 onLoad: function(t) {
  27 + this.data.rq_data=t;
  28 +
  29 + //接受有没有导购的参数
  30 + var first_leader=t.first_leader;
  31 + if(first_leader){
  32 + getApp().globalData.first_leader=first_leader;
  33 + //调用接口判断是不是会员
  34 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  35 + if(res.data.code==0){
  36 + getApp().globalData.guide_id=res.data.data.id;
  37 + }
  38 + })
  39 + }
  40 +
26 var th=this; 41 var th=this;
27 a.getConfig2(function(rs){ 42 a.getConfig2(function(rs){
28 var arr=new Array(),arr2=new Array(); 43 var arr=new Array(),arr2=new Array();
@@ -40,8 +55,7 @@ Page({ @@ -40,8 +55,7 @@ Page({
40 th.setData({ hotWords: arr}); 55 th.setData({ hotWords: arr});
41 } 56 }
42 57
43 -  
44 - 58 +
45 //计算等级价相关 59 //计算等级价相关
46 var swithc_list=rs.switch_list; 60 var swithc_list=rs.switch_list;
47 var sw_arr=JSON.parse(swithc_list); 61 var sw_arr=JSON.parse(swithc_list);
@@ -173,14 +187,39 @@ Page({ @@ -173,14 +187,39 @@ Page({
173 //-----点击搜索按钮---- 187 //-----点击搜索按钮----
174 search: function(t) { 188 search: function(t) {
175 if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词"); 189 if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词");
  190 + this.data.key_str=t;
176 this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); 191 this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
177 }, 192 },
178 - //---------分享配置--------  
179 - onShareAppMessage: function (e) {  
180 - return {  
181 - title: "商品分类",  
182 - }  
183 - }, 193 +
  194 + //---------分享配置--------
  195 + onShareAppMessage: function (e) {
  196 + var curPage=this;
  197 + var pagePath = curPage.route; //当前页面url
  198 + if (pagePath.indexOf('/') != 0) {
  199 + pagePath = '/' + pagePath;
  200 + }
  201 +
  202 + if(this.data.key_str) {
  203 + pagePath += "?s_key=" + this.data.key_str;
  204 + }
  205 +
  206 + if(getApp().globalData.user_id){
  207 +
  208 + if(pagePath.indexOf("?")>0){
  209 + pagePath+="&first_leader="+getApp().globalData.user_id;
  210 + }else{
  211 + pagePath+="?first_leader="+getApp().globalData.user_id;
  212 + }
  213 + }
  214 +
  215 + console.log("11-11"+pagePath);
  216 + return {
  217 + title: "商品搜索",
  218 + path:pagePath,
  219 + }
  220 + },
  221 +
  222 +
184 //---------图片失败,默认图片-------- 223 //---------图片失败,默认图片--------
185 bind_bnerr: function (e) { 224 bind_bnerr: function (e) {
186 var _errImg = e.target.dataset.errorimg; 225 var _errImg = e.target.dataset.errorimg;
pages/goods/search/search.json
1 { 1 {
2 "navigationBarTitleText": "商品搜索", 2 "navigationBarTitleText": "商品搜索",
3 - "enablePullDownRefresh": false 3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "share_box": "/components/share_box/share_box"
  6 + }
4 } 7 }
5 \ No newline at end of file 8 \ No newline at end of file
pages/goods/search/search.wxml
@@ -106,6 +106,9 @@ @@ -106,6 +106,9 @@
106 </block> 106 </block>
107 </view> 107 </view>
108 </navigator> 108 </navigator>
  109 +
  110 + <!-- 有商品列表的时候,要有分享攻击 -->
  111 + <share_box id="share"></share_box>
109 </view> 112 </view>
110 <view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> 113 <view class="no-data" wx:if="{{!requestData||requestData.length==0}}">
111 <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image> 114 <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image>
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
@@ -821,5 +828,6 @@ Page({ @@ -821,5 +828,6 @@ Page({
821 }) 828 })
822 }) 829 })
823 } 830 }
824 - 831 +
  832 +
825 }); 833 });
826 \ No newline at end of file 834 \ No newline at end of file
pages/index/index/index.wxml
  1 +<import src="../../tabbar/tabbar.wxml" />
  2 +<template is="tabBar" data="{{tabBar}}"/>
  3 +
1 <!--普通界面--> 4 <!--普通界面-->
2 <wxs module="filter" src="../../../utils/filter.wxs"></wxs> 5 <wxs module="filter" src="../../../utils/filter.wxs"></wxs>
3 <view class="container rel" wx:if="{{ishow}}"> 6 <view class="container rel" wx:if="{{ishow}}">
@@ -360,8 +363,7 @@ @@ -360,8 +363,7 @@
360 </view> 363 </view>
361 </block> 364 </block>
362 365
363 - <import src="../../tabbar/tabbar.wxml" />  
364 - <template is="tabBar" data="{{tabBar}}"/> 366 +
365 367
366 368
367 369
pages/tabbar/tabbar.wxml
  1 +
1 <!--pages/tabbar.wxml--> 2 <!--pages/tabbar.wxml-->
2 <template name="tabBar"> 3 <template name="tabBar">
3 <!-- 如果是自定义的话 --> 4 <!-- 如果是自定义的话 -->
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;"> 5 + <view hidden="{{tabBar.iscustom=='2'}}" class="tab-bar" style="width:100%;height:{{tabBar.isIpx ? '172rpx' : '104rpx'}};position:fixed;color: {{tabBar.color}}; background: {{tabBar.backgroundColor}}; bottom: 0;z-index:9999999;">
5 <block wx:for="{{tabBar.list}}" wx:key="weappurl"> 6 <block wx:for="{{tabBar.list}}" wx:key="weappurl">
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=='购物车'}}" style="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;">
10 {{tabBar.cartGoodsNum}} 10 {{tabBar.cartGoodsNum}}
11 </view> 11 </view>
12 - <view style="width:35%;height:30px;margin-left:33%;">  
13 - <image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image> 12 + <view style="width:35%;height:58rpx;margin-left:33%;display: flex; justify-content: center;align-items: center">
  13 + <!--<image src="{{item.src}}" bindload="load_nav" data-index="{{ index }}" class="img" style="max-width: 100%; width:{{item.width?item.width:0}}rpx;height:{{item.height}}rpx"></image>-->
  14 + <view class="nav_imgage" style="background-image: url({{item.src}});height: 50rpx; width: 50rpx;background-position: center;background-repeat: no-repeat;background-size: auto 85%;"></view>
14 </view> 15 </view>
15 - <view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view> 16 + <view style="height:20px;line-height:15px; position: relative; top: -8rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view>
16 </navigator> 17 </navigator>
17 </block> 18 </block>
18 <block wx:else> 19 <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"> 20 + <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;">
  21 + <view wx:if="{{item.nav_name=='购物车'}}" style="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;">
21 {{tabBar.cartGoodsNum}} 22 {{tabBar.cartGoodsNum}}
22 </view> 23 </view>
23 - <view style="width:35%;height:30px;margin-left:33%;">  
24 - <block wx:if="{{item.active}}">  
25 - <image src="{{item.src_sele}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image>  
26 - </block>  
27 - <block wx:else>  
28 - <navigator url="{{item.weappurl}}">  
29 - <image src="{{item.src}}" wx:if="{{!item.active}}" mode="widthFix" class="img" style="max-width:100%;max-height:100%"></image>  
30 - </navigator>  
31 - </block> 24 + <view style="width:35%;height:58rpx;margin-left:33%; display: flex; justify-content: center;align-items: center">
  25 + <!--<image src="{{item.src_sele}}" bindload="load_nav" data-index="{{ index }}" class="img" style="max-width: 100%;width:{{item.width?item.width:0}}rpx;height:{{item.height}}rpx"></image>-->
  26 + <view class="nav_imgage" style="background-image: url({{item.src_sele}});height: 50rpx; width: 50rpx;background-position: center;background-repeat: no-repeat;background-size: auto 85%;"></view>
32 </view> 27 </view>
33 - <view style="height:20px;line-height:15px; position: relative; top: -15rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view> 28 + <view style="height:20px;line-height:15px; position: relative; top: -8rpx"><text class="tabbar_text" wx:if="{{item.nav_name}}" style="font-size:0.6rem">{{item.nav_name}}</text></view>
34 </view> 29 </view>
35 </block> 30 </block>
36 31
@@ -43,7 +38,7 @@ @@ -43,7 +38,7 @@
43 <!-- 1 --> 38 <!-- 1 -->
44 <block wx:if="{{tabBar.active!='/pages/index/index/index'}}"> 39 <block wx:if="{{tabBar.active!='/pages/index/index/index'}}">
45 <navigator url="/pages/index/index/index" class="tabbar_item {{item.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 40 <navigator url="/pages/index/index/index" class="tabbar_item {{item.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
46 - <view style="width:30%;height:57rpx;margin-left:35%;"> 41 + <view style="width:30%;height:54rpx;margin-left:35%;">
47 <image src="{{tabBar.url}}/miniapp/images/bar/index.png" class="img" style="width:100%;height:100%"></image> 42 <image src="{{tabBar.url}}/miniapp/images/bar/index.png" class="img" style="width:100%;height:100%"></image>
48 </view> 43 </view>
49 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> 44 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view>
@@ -51,7 +46,7 @@ @@ -51,7 +46,7 @@
51 </block> 46 </block>
52 <block wx:else> 47 <block wx:else>
53 <view class="tabbar_item {{item.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 48 <view class="tabbar_item {{item.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
54 - <view style="width:30%;height:57rpx;margin-left:35%;"> 49 + <view style="width:30%;height:54rpx;margin-left:35%;">
55 <image src="{{tabBar.url}}/miniapp/images/bar/index_on.png" class="img" style="width:100%;height:100%"></image> 50 <image src="{{tabBar.url}}/miniapp/images/bar/index_on.png" class="img" style="width:100%;height:100%"></image>
56 </view> 51 </view>
57 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> 52 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view>
@@ -62,7 +57,7 @@ @@ -62,7 +57,7 @@
62 <!-- 2 --> 57 <!-- 2 -->
63 <block wx:if="{{tabBar.active!='/pages/goods/categoryList/categoryList'}}"> 58 <block wx:if="{{tabBar.active!='/pages/goods/categoryList/categoryList'}}">
64 <navigator url="/pages/goods/categoryList/categoryList" class="tabbar_item {{tabBar.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 59 <navigator url="/pages/goods/categoryList/categoryList" class="tabbar_item {{tabBar.clas}}" open-type="redirect" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
65 - <view style="width:30%;height:57rpx;margin-left:35%;"> 60 + <view style="width:30%;height:54rpx;margin-left:35%;">
66 <image src="{{tabBar.url}}/miniapp/images/bar/fl.png" class="img" style="width:100%;height:100%"></image> 61 <image src="{{tabBar.url}}/miniapp/images/bar/fl.png" class="img" style="width:100%;height:100%"></image>
67 </view> 62 </view>
68 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view> 63 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view>
@@ -70,7 +65,7 @@ @@ -70,7 +65,7 @@
70 </block> 65 </block>
71 <block wx:else> 66 <block wx:else>
72 <view class="tabbar_item {{tabBar.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 67 <view class="tabbar_item {{tabBar.clas}}" style="color:#f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
73 - <view style="width:30%;height:57rpx;margin-left:35%;"> 68 + <view style="width:30%;height:54rpx;margin-left:35%;">
74 <image src="{{tabBar.url}}/miniapp/images/bar/fl_on.png" class="img" style="width:100%;height:100%"></image> 69 <image src="{{tabBar.url}}/miniapp/images/bar/fl_on.png" class="img" style="width:100%;height:100%"></image>
75 </view> 70 </view>
76 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view> 71 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" wx:if="分类" style="font-size:0.6rem">分类</text></view>
@@ -81,9 +76,9 @@ @@ -81,9 +76,9 @@
81 <!-- 3 --> 76 <!-- 3 -->
82 <block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}"> 77 <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;"> 78 <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%"> 79 + <view style="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%">
85 {{tabBar.cartGoodsNum}} 80 {{tabBar.cartGoodsNum}}
86 - </view><view style="width:30%;height:57rpx;margin-left:35%;"> 81 + </view><view style="width:30%;height:54rpx;margin-left:35%;">
87 <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image> 82 <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image>
88 </view> 83 </view>
89 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> 84 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view>
@@ -91,9 +86,9 @@ @@ -91,9 +86,9 @@
91 </block> 86 </block>
92 <block wx:else> 87 <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;"> 88 <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%"> 89 + <view style="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%">
95 {{tabBar.cartGoodsNum}} 90 {{tabBar.cartGoodsNum}}
96 - </view><view style="width:30%;height:57rpx;margin-left:35%;"> 91 + </view><view style="width:30%;height:54rpx;margin-left:35%;">
97 <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image> 92 <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image>
98 </view> 93 </view>
99 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> 94 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view>
@@ -103,7 +98,7 @@ @@ -103,7 +98,7 @@
103 <!-- 4 --> 98 <!-- 4 -->
104 <block wx:if="{{tabBar.active!='/pages/user/index/index'}}"> 99 <block wx:if="{{tabBar.active!='/pages/user/index/index'}}">
105 <navigator url="/pages/user/index/index" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 100 <navigator url="/pages/user/index/index" open-type="redirect" class="tabbar_item {{tabBar.clas}}" style="position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
106 - <view style="width:30%;height:57rpx;margin-left:35%;"> 101 + <view style="width:30%;height:54rpx;margin-left:35%;">
107 <image src="{{tabBar.url}}/miniapp/images/bar/user.png" class="img" style="width:100%;height:100%"></image> 102 <image src="{{tabBar.url}}/miniapp/images/bar/user.png" class="img" style="width:100%;height:100%"></image>
108 </view> 103 </view>
109 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> 104 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view>
@@ -111,8 +106,8 @@ @@ -111,8 +106,8 @@
111 </block> 106 </block>
112 <block wx:else> 107 <block wx:else>
113 <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;"> 108 <view class="tabbar_item {{tabBar.clas}}" style="color: #f23030;position:relative;width:25%;height:100%;float:left;text-align:center;padding:2px 0;">
114 - <view style="width:30%;height:57rpx;margin-left:35%;">  
115 - <image src="{{tabBar.url}}/miniapp/images/bar/user_on.png" class="img" style="width:100%;height:100%"></image> 109 + <view style="width:30%;height:54rpx;margin-left:35%;">
  110 + <image src="{{tabBar.url}}/miniapp/images/bar/user_on.png" class="img" style="width:100%;height:100%"></image>
116 </view> 111 </view>
117 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> 112 <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view>
118 </view> 113 </view>
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=options.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.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
@@ -568,7 +585,6 @@ Page({ @@ -568,7 +585,6 @@ Page({
568 }); 585 });
569 setTimeout(th.countDown2, 1000); 586 setTimeout(th.countDown2, 1000);
570 }, 587 },
571 -  
572 //--获取门店--- 588 //--获取门店---
573 async get_sto(e) { 589 async get_sto(e) {
574 var th = this, dd = null,i=getApp().request; 590 var th = this, dd = null,i=getApp().request;
@@ -741,6 +757,20 @@ Page({ @@ -741,6 +757,20 @@ Page({
741 goods_name: th.data.goods.goods_name, 757 goods_name: th.data.goods.goods_name,
742 goods_sn: th.data.goods.goods_sn, 758 goods_sn: th.data.goods.goods_sn,
743 }; 759 };
  760 +
  761 + //---是不是从收藏夹出来的---
  762 + if(th.data.c_guide_id){
  763 + newd['guide_id'] = th.data.c_guide_id;
  764 + newd['guide_type']=2;
  765 +
  766 + }else{
  767 + if(getApp().globalData.guide_id){
  768 + newd['guide_id'] = getApp().globalData.guide_id;
  769 + newd['guide_type']=0;
  770 +
  771 + }
  772 + }
  773 +
744 //-----拼团----- 774 //-----拼团-----
745 newd.goods_price = th.data.teamlist.price; 775 newd.goods_price = th.data.teamlist.price;
746 newd.prom_type = 6; 776 newd.prom_type = 6;
@@ -767,8 +797,12 @@ Page({ @@ -767,8 +797,12 @@ Page({
767 } 797 }
768 newd['pick_dis'] = th.data.pick_dis; 798 newd['pick_dis'] = th.data.pick_dis;
769 799
770 - s.set_b_now(newd); 800 + if(getApp().globalData.guide_id){
  801 + newd['guide_id'] = getApp().globalData.guide_id;
  802 + newd['guide_type']=0;
  803 + }
771 804
  805 + s.set_b_now(newd);
772 wx.navigateTo({ 806 wx.navigateTo({
773 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id, 807 url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id,
774 }); 808 });
@@ -882,4 +916,30 @@ Page({ @@ -882,4 +916,30 @@ Page({
882 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; 916 this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
883 }, 917 },
884 918
  919 + //------ 分享配置 --------
  920 + onShareAppMessage: function (e) {
  921 + var curPage=this;
  922 + var pagePath = curPage.route; //当前页面url
  923 + if (pagePath.indexOf('/') != 0) {
  924 + pagePath = '/' + pagePath;
  925 + }
  926 + var url=pagePath;
  927 +
  928 + //--分享图片--
  929 + img=th.data.iurl+th.data.teamlist.share_imgurl;
  930 + //--把会员分享出去--
  931 + if(getApp().globalData.user_id){
  932 + if(url.indexOf("?")>0)
  933 + url+="&first_leader="+getApp().globalData.user_id;
  934 + else
  935 + url+="?first_leader="+getApp().globalData.user_id;
  936 + }
  937 +
  938 + return {
  939 + path:url,
  940 + title: "商品分类",
  941 + imageUrl: img,
  942 + }
  943 + },
  944 +
885 }) 945 })
886 \ No newline at end of file 946 \ No newline at end of file
pages/team/team_success/team_success.js
@@ -355,6 +355,11 @@ Page({ @@ -355,6 +355,11 @@ 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 +
358 //二微码 363 //二微码
359 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+ 364 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
360 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show"; 365 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
@@ -667,7 +672,31 @@ Page({ @@ -667,7 +672,31 @@ Page({
667 ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif"; 672 ob[err_img] = this.data.iurl + "/miniapp/images/default_g_img.gif";
668 this.setData(ob); 673 this.setData(ob);
669 674
670 - } 675 + },
  676 +
  677 + //------ 分享配置 --------
  678 + onShareAppMessage: function (e) {
  679 + var th=this;
  680 + var scene=this.data.teamgroup.id;
  681 + var url="/pages/team/team_show/team_show?tg_id="+scene;
  682 + //--分享图片--
  683 + var img=th.data.iurl+th.data.teamlist.share_imgurl;
  684 + //--把会员分享出去--
  685 + if(getApp().globalData.user_id){
  686 + if(url.indexOf("?")>0)
  687 + url+="&first_leader="+getApp().globalData.user_id;
  688 + else
  689 + url+="?first_leader="+getApp().globalData.user_id;
  690 + }
  691 + console.log(url);
  692 +
  693 + return {
  694 + path:url,
  695 + title: th.data.teamlist.title,
  696 + imageUrl: img,
  697 + }
  698 + },
  699 +
671 700
672 }) 701 })
673 702
pages/user/assistance/assistance.js
@@ -34,6 +34,7 @@ Page({ @@ -34,6 +34,7 @@ Page({
34 * 生命周期函数--监听页面加载 34 * 生命周期函数--监听页面加载
35 */ 35 */
36 onLoad: function(options) { 36 onLoad: function(options) {
  37 +
37 var th = this; 38 var th = this;
38 var nav_b = th.selectComponent("#nav_b"); //组件的id 39 var nav_b = th.selectComponent("#nav_b"); //组件的id
39 nav_b.set_name("助力", "/pages/user/assistance/assistance"); 40 nav_b.set_name("助力", "/pages/user/assistance/assistance");
@@ -44,9 +45,17 @@ Page({ @@ -44,9 +45,17 @@ Page({
44 * 生命周期函数--监听页面显示 45 * 生命周期函数--监听页面显示
45 */ 46 */
46 onShow: function() { 47 onShow: function() {
  48 +
  49 + //--先判断会员状态--
  50 + var user_info = getApp().globalData.userInfo;
  51 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  52 + getApp().goto('/pages/getphone/getphone');
  53 + return false;
  54 + }
  55 +
47 var th = this; 56 var th = this;
48 // 助力活动 57 // 助力活动
49 - th.assistance(); 58 + this.assistance();
50 }, 59 },
51 // 助力活动 60 // 助力活动
52 assistance() { 61 assistance() {
pages/user/assistance/friend_assistance.js
@@ -28,6 +28,7 @@ Page({ @@ -28,6 +28,7 @@ Page({
28 * 生命周期函数--监听页面加载 28 * 生命周期函数--监听页面加载
29 */ 29 */
30 onLoad: function(options) { 30 onLoad: function(options) {
  31 +
31 var th = this; 32 var th = this;
32 33
33 var nav_b = th.selectComponent("#nav_b"); //组件的id 34 var nav_b = th.selectComponent("#nav_b"); //组件的id
@@ -39,7 +40,6 @@ Page({ @@ -39,7 +40,6 @@ Page({
39 if (this.data.tasking == 0 || this.data.tasking == undefined) { 40 if (this.data.tasking == 0 || this.data.tasking == undefined) {
40 this.data.tasking = decodeURIComponent(options.scene); 41 this.data.tasking = decodeURIComponent(options.scene);
41 } 42 }
42 - getApp().getUserFir(function() {});  
43 43
44 }, 44 },
45 45
@@ -54,6 +54,14 @@ Page({ @@ -54,6 +54,14 @@ 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 + getApp().goto('/pages/getphone/getphone');
  61 + return false;
  62 + }
  63 +
  64 +
57 var th=this; 65 var th=this;
58 if (!th.data.user) th.setData({ user: getApp().globalData.userInfo}); 66 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 != 67 if (this.data.tasking != null && this.data.tasking != 'undefined' && this.data.tasking != "" && this.data.tasking !=
pages/user/assistance/giftpacklist.js
@@ -38,6 +38,7 @@ Page({ @@ -38,6 +38,7 @@ Page({
38 id: "", //一键领取的时候使用 38 id: "", //一键领取的时候使用
39 }, 39 },
40 onLoad: function(options) { 40 onLoad: function(options) {
  41 +
41 var th = this; 42 var th = this;
42 if (options.is_libao == 0) { 43 if (options.is_libao == 0) {
43 th.setData({ 44 th.setData({
@@ -67,6 +68,12 @@ Page({ @@ -67,6 +68,12 @@ Page({
67 nav_b.set_name("助力", "/pages/user/assistance/assistance"); 68 nav_b.set_name("助力", "/pages/user/assistance/assistance");
68 }, 69 },
69 onShow: function() { 70 onShow: function() {
  71 + //--先判断会员状态--
  72 + var user_info = getApp().globalData.userInfo;
  73 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  74 + getApp().goto('/pages/getphone/getphone');
  75 + return false;
  76 + }
70 77
71 }, 78 },
72 //助力活动查看礼包详情调用 79 //助力活动查看礼包详情调用
pages/user/assistance/giftpacklist.wxml
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </view> 25 </view>
26 <view class="top_foot data-v-3a5b7e36"> 26 <view class="top_foot data-v-3a5b7e36">
27 <view class="top_foot_price data-v-3a5b7e36"> 27 <view class="top_foot_price data-v-3a5b7e36">
28 - <text class="data-v-3a5b7e36">{{"价:"+giftPosPrice+"元"}}</text> 28 + <text class="data-v-3a5b7e36">{{"零售价:"+giftPosPrice+"元"}}</text>
29 </view> 29 </view>
30 <view class="top_foot_qty data-v-3a5b7e36"> 30 <view class="top_foot_qty data-v-3a5b7e36">
31 <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> 31 <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text>
pages/user/assistance/task_assistance.js
@@ -69,6 +69,7 @@ Page({ @@ -69,6 +69,7 @@ Page({
69 * 生命周期函数--监听页面加载 69 * 生命周期函数--监听页面加载
70 */ 70 */
71 onLoad: function (options) { 71 onLoad: function (options) {
  72 +
72 var th = this; 73 var th = this;
73 var help_id = options.help_id; 74 var help_id = options.help_id;
74 var nav_b = th.selectComponent("#nav_b"); //组件的id 75 var nav_b = th.selectComponent("#nav_b"); //组件的id
@@ -135,6 +136,14 @@ Page({ @@ -135,6 +136,14 @@ Page({
135 * 生命周期函数--监听页面显示 136 * 生命周期函数--监听页面显示
136 */ 137 */
137 onShow: function () { 138 onShow: function () {
  139 +
  140 + //--先判断会员状态--
  141 + var user_info = getApp().globalData.userInfo;
  142 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  143 + getApp().goto('/pages/getphone/getphone');
  144 + return false;
  145 + }
  146 +
138 this.data.is_timer = 1; 147 this.data.is_timer = 1;
139 var th = this; 148 var th = this;
140 var help_id = th.data.help_id; 149 var help_id = th.data.help_id;
pages/user/cardinfo/cardinfo.js
@@ -42,7 +42,8 @@ Page({ @@ -42,7 +42,8 @@ Page({
42 expiryDate:"",//卡到期时间 42 expiryDate:"",//卡到期时间
43 is_guoqi:0, //卡是不是过期 43 is_guoqi:0, //卡是不是过期
44 IsStopBuy:0, //卡是否停用 44 IsStopBuy:0, //卡是否停用
45 - yu_e_show:0,//装入余额的弹窗 45 + yu_e_show:0,//装入余额的弹窗
  46 + is_show_change_pop:0,
46 }, 47 },
47 48
48 /** 49 /**
@@ -70,23 +71,37 @@ Page({ @@ -70,23 +71,37 @@ Page({
70 71
71 //----------------------------获取最大的卡类----------------------- 72 //----------------------------获取最大的卡类-----------------------
72 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { 73 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, {
73 -  
74 }).then(res => { 74 }).then(res => {
75 var plusCard = res.data.data; 75 var plusCard = res.data.data;
76 var big_cards = null,big_card=null; 76 var big_cards = null,big_card=null;
77 - console.log(plusCard, "数据什么的", res); 77 + if(!plusCard) return false;
  78 +
  79 + var new_card_arr=[];
78 for (var i = 0; i < plusCard.length; i++) { 80 for (var i = 0; i < plusCard.length; i++) {
79 if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; 81 if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1";
80 - big_cards = Math.max(plusCard[i].CardFee)  
81 - if (plusCard[i].CardFee == big_cards) {  
82 - big_card = plusCard[i] 82 + //big_cards = Math.max(plusCard[i].CardFee)
  83 + //if (plusCard[i].CardFee == big_cards) {
  84 + // big_card = plusCard[i]
  85 + //}
  86 + if(!plusCard[i].IsStopBuy) {
  87 + new_card_arr.push(plusCard[i]);
83 } 88 }
84 } 89 }
85 -  
86 - console.log(big_cards, "是什么东西", big_card); 90 +
  91 + //对比函数
  92 + var compare = function (obj1, obj2) {
  93 + var val1 = obj1.CardFee;var val2 = obj2.CardFee;
  94 + if (val1 > val2) {
  95 + return -1;
  96 + }else if (val1 < val2) {
  97 + return 1;
  98 + }else{ return 0; }
  99 + }
  100 + new_card_arr.sort(compare);
  101 + big_card= new_card_arr[0];
87 ee.setData({ 102 ee.setData({
88 - is_plusCard: plusCard,  
89 - big_card: big_card 103 + is_plusCard: new_card_arr,
  104 + big_card: big_card,
90 }) 105 })
91 106
92 //缓存分享卡的图片 107 //缓存分享卡的图片
@@ -101,7 +116,6 @@ Page({ @@ -101,7 +116,6 @@ Page({
101 116
102 }) 117 })
103 118
104 -  
105 //获取用户设备信息,屏幕宽度 119 //获取用户设备信息,屏幕宽度
106 wx.getSystemInfo({ 120 wx.getSystemInfo({
107 success: res => { 121 success: res => {
@@ -138,12 +152,46 @@ Page({ @@ -138,12 +152,46 @@ Page({
138 end = Date.parse(end) / 1000; 152 end = Date.parse(end) / 1000;
139 var is_guoqi=0; 153 var is_guoqi=0;
140 if(end<now) is_guoqi=1; 154 if(end<now) is_guoqi=1;
141 -  
142 - 155 + var cur_card=res.data.data[0];
  156 +
143 ee.setData({cardid: GradeCardID, 157 ee.setData({cardid: GradeCardID,
144 - expiryDate: expiryDate,is_guoqi:is_guoqi, 158 + expiryDate: expiryDate,is_guoqi:is_guoqi,
145 }); 159 });
146 160
  161 + //一秒后获取是升级还是变更卡的列表,因为是异步的关系
  162 + setTimeout(function () {
  163 + if(ee.data.is_plusCard){
  164 + var new_buy_list=[];
  165 + //如果是过期,就有变更的列表
  166 + if(is_guoqi){
  167 + //--开始组装变更列表--
  168 + for(var ii in ee.data.is_plusCard){
  169 + var item=ee.data.is_plusCard[ii];
  170 + if(item.CardId!=GradeCardID && !item.IsStopBuy){
  171 + new_buy_list.push(item);
  172 + }
  173 + }
  174 + }else{
  175 + //如果是没过期,就看是不是最高级版的卡
  176 + if(GradeCardID!=ee.data.big_card.CardId){
  177 + //--开始组装升级列表--
  178 + for(var jj in ee.data.is_plusCard){
  179 + var item=ee.data.is_plusCard[jj];
  180 + //升级要那些价格比当前卡贵的卡
  181 + if(item.CardId!=GradeCardID && !item.IsStopBuy && parseFloat(item.CardFee)>parseFloat(cur_card.CardFee)){
  182 + new_buy_list.push(item);
  183 + }
  184 + }
  185 + }
  186 + }
  187 +
  188 + if(new_buy_list.length>0){
  189 + th.setData({buy_list:new_buy_list});
  190 + }
  191 + }
  192 +
  193 + },1800)
  194 +
147 195
148 }) 196 })
149 //-----------会员分佣------------------- 197 //-----------会员分佣-------------------
@@ -155,7 +203,6 @@ Page({ @@ -155,7 +203,6 @@ Page({
155 }else{ 203 }else{
156 ee.setData({ free: 0 }); 204 ee.setData({ free: 0 });
157 } 205 }
158 -  
159 }) 206 })
160 //-----------会员的卡类------------------- 207 //-----------会员的卡类-------------------
161 await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, { 208 await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, {
@@ -164,12 +211,10 @@ Page({ @@ -164,12 +211,10 @@ Page({
164 if (user_card.CardImg==""){ 211 if (user_card.CardImg==""){
165 var index =parseInt(user_card.CorrPrice.replace("Price","")); 212 var index =parseInt(user_card.CorrPrice.replace("Price",""));
166 user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1"; 213 user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1";
167 -  
168 } 214 }
169 if (user_card.IsStopBuy==true){ 215 if (user_card.IsStopBuy==true){
170 this.setData({IsStopBuy:1}) 216 this.setData({IsStopBuy:1})
171 } 217 }
172 -  
173 218
174 console.log(user_card,"会员的卡类"); 219 console.log(user_card,"会员的卡类");
175 ee.setData({user_card: user_card}); 220 ee.setData({user_card: user_card});
@@ -736,9 +781,9 @@ Page({ @@ -736,9 +781,9 @@ Page({
736 return false; 781 return false;
737 } 782 }
738 783
739 -  
740 end_time=ut.format(end_time,'yyyy-MM-dd'); 784 end_time=ut.format(end_time,'yyyy-MM-dd');
741 var errmsg=""; 785 var errmsg="";
  786 +
742 //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- 787 //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期--
743 await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", 788 await getApp().request.promiseGet("/api/weshop/plus/plus/card/register",
744 { data: { storeId: os.stoid,isRenewal:1,endData: end_time,userId:getApp().globalData.user_id} }).then(res => { 789 { data: { storeId: os.stoid,isRenewal:1,endData: end_time,userId:getApp().globalData.user_id} }).then(res => {
@@ -746,7 +791,10 @@ Page({ @@ -746,7 +791,10 @@ Page({
746 else errmsg=res.data.msg; 791 else errmsg=res.data.msg;
747 }) 792 })
748 793
749 - if (is_card == 0){ getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th);} 794 + if (is_card == 0){
  795 + getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th);
  796 + return false;
  797 + }
750 798
751 var item = th.data.user_card; 799 var item = th.data.user_card;
752 var req = {}; 800 var req = {};
@@ -762,8 +810,74 @@ Page({ @@ -762,8 +810,74 @@ Page({
762 }, 810 },
763 811
764 //--支付成功,跳转到等级卡续费页面-- 812 //--支付成功,跳转到等级卡续费页面--
765 - success:function () {  
766 - getApp().my_warnning("支付成功",0,this); 813 + success:function (ind) {
  814 + if(ind==1){
  815 + getApp().my_warnning("升级成功",0,this);
  816 + }else{
  817 + getApp().my_warnning("支付成功",0,this);
  818 + }
  819 + this.init();
767 }, 820 },
  821 +
  822 +
  823 +
  824 +
  825 + //------计算俩种卡的------
  826 + change_card:async function (e) {
  827 + var th = this,card_id =e.currentTarget.dataset.cid ,end_time=0;
  828 + await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3",
  829 + {1:1}).then(res => {
  830 + if (res.data.code == 0) {
  831 + end_time=res.data.data.pageData[0].end_time;
  832 + }
  833 + })
  834 + var now=ut.gettimestamp();
  835 + if(end_time<now){
  836 + getApp().my_warnning("请联系商家升级plus功能", 0, th);
  837 + return false;
  838 + }
  839 +
  840 + th.data.s_card_id=card_id;
  841 + var days=e.currentTarget.dataset.days;
  842 + now=now+days*24*3600;
  843 + var time=ut.formar_no_full(now);
  844 + th.setData({is_show_change_pop:0});
  845 + var my_con = this.selectComponent("#my_con"); //组件的id
  846 +
  847 + //如果是变更卡,就是显示提示喝到期时间
  848 + if(th.data.is_guoqi){
  849 + my_con.open(" \n 温馨提示:与原等级不符,是否变更!\n\n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null)
  850 + }else{
  851 + //如果是升级的话
  852 + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/updatePrice/get",
  853 + {data:{storeId: os.stoid,userId:getApp().globalData.user_id,OldCardId:th.data.user_card.CardId,NewCardId:card_id}}).then(res => {
  854 + if (res.data.code == 0) {
  855 + my_con.open("\n 温馨提示,高于当前等级,是否立即升级!\n\n 升级价格:¥"+ res.data.data.payMoney.toFixed(2)+" \n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null)
  856 + }
  857 + })
  858 + }
  859 +
  860 + },
  861 +
  862 + sure_pay:function () {
  863 + var th=this;
  864 + var req = {};
  865 + req.cardId = th.data.s_card_id;
  866 + req.rechargeType = 5;
  867 + //如果不是你导购,也不是等级会员分享
  868 + req.storeId = os.stoid;
  869 + req.oldCardId=th.data.user_card.CardId;
  870 + req.userId = getApp().globalData.user_id;
  871 + t_pay.pay(req, th.success, function () {
  872 + getApp().my_warnning("支付失败", 0, th);
  873 + });
  874 + },
  875 + //显示弹出框
  876 + show_change:function () { this.setData({is_show_change_pop:1}); },
  877 + //关闭弹出框
  878 + close_card_change_pop:function () { this.setData({is_show_change_pop:0}); }
  879 +
  880 +
  881 +
768 882
769 }) 883 })
770 \ No newline at end of file 884 \ No newline at end of file
pages/user/cardinfo/cardinfo.json
@@ -2,8 +2,9 @@ @@ -2,8 +2,9 @@
2 "usingComponents": { 2 "usingComponents": {
3 "pop_txt": "/components/userqy_pop_up/userqy_pop_up", 3 "pop_txt": "/components/userqy_pop_up/userqy_pop_up",
4 "goods_recommend": "/components/goods_list/goods_list", 4 "goods_recommend": "/components/goods_list/goods_list",
5 - "warn": "/components/long_warn/long_warn",  
6 - "nav_box": "/components/nav_box_card/nav_box" 5 + "warn": "/components/long_warn/long_warn",
  6 + "nav_box": "/components/nav_box_card/nav_box",
  7 + "my_confirm": "/components/my_confirm/my_confirm"
7 }, 8 },
8 "navigationBarTitleText": "plus会员" 9 "navigationBarTitleText": "plus会员"
9 } 10 }
10 \ No newline at end of file 11 \ No newline at end of file
pages/user/cardinfo/cardinfo.wxml
@@ -17,8 +17,20 @@ @@ -17,8 +17,20 @@
17 <view wx:if="{{!is_guoqi}}" class="fs22 h22" style="margin-top:15rpx">会员将在{{filters.replace_time2(expiryDate)}}到期</view> 17 <view wx:if="{{!is_guoqi}}" class="fs22 h22" style="margin-top:15rpx">会员将在{{filters.replace_time2(expiryDate)}}到期</view>
18 <view wx:else class="fs22 h22" style="margin-top:15rpx">会员已在{{filters.replace_time2(expiryDate)}}过期</view> 18 <view wx:else class="fs22 h22" style="margin-top:15rpx">会员已在{{filters.replace_time2(expiryDate)}}过期</view>
19 </view> 19 </view>
20 - <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}}">立即续费  
21 - </view> 20 +
  21 + <view>
  22 + <view bindtap="xufei" class="renew fs28" style="background:{{user_card.CardColor}}">立即续费</view>
  23 + <!-- 判断是不是过期,显示变更按钮,但是要看是不是多件 -->
  24 + <block wx:if="{{is_guoqi}}">
  25 + <view wx:if="{{buy_list.length>0}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}}">卡类变更</view>
  26 + </block>
  27 + <block wx:else>
  28 + <!-- 要判断是不是最高级的卡 -->
  29 + <view wx:if="{{cardid!=big_card.CardId}}" bindtap="show_change" class="renew fs28" style="background:{{user_card.CardColor}}">卡类升级</view>
  30 + </block>
  31 + </view>
  32 +
  33 +
22 </view> 34 </view>
23 35
24 <view class="flex-vertical-between xs fs28"> 36 <view class="flex-vertical-between xs fs28">
@@ -145,6 +157,30 @@ @@ -145,6 +157,30 @@
145 <goods_recommend id="goods_list"></goods_recommend> 157 <goods_recommend id="goods_list"></goods_recommend>
146 <!-- 商品列表 --> 158 <!-- 商品列表 -->
147 <!-- 画布 --> 159 <!-- 画布 -->
148 -<canvas canvas-id='myCanvas' style="width:750rpx;height:1260rpx;"wx:if='{{!canvasHidden}}'></canvas>  
149 -  
150 -<warn id="warn"></warn>  
151 \ No newline at end of file 160 \ No newline at end of file
  161 +<canvas canvas-id='myCanvas' style="width:750rpx;height:1260rpx;" wx:if='{{!canvasHidden}}'></canvas>
  162 +
  163 +<warn id="warn"></warn>
  164 +<my_confirm id="my_con"></my_confirm>
  165 +
  166 +<!-- 购买更换,升级 -->
  167 +<view class="card_change_pop" wx:if="{{is_show_change_pop==1}}">
  168 + <view class="cover-layer"></view>
  169 + <view class="content flex jc-center ai-center" bindtap="close_card_change_pop">
  170 + <view class="card_list">
  171 + <image class="hg" src="{{url}}/miniapp/images/plus/plustopimg.png"></image>
  172 + <view class="list">
  173 + <view class="item flex ai-center jc_sb" wx:for="{{buy_list}}">
  174 + <view class="flex ai-center"><image class="hg_img" src="{{url}}/miniapp/images/vip_hg0.png"></image>
  175 + <text class="ellipsis-1 card_name">{{item.CardName}}</text></view>
  176 + <view class="price_show flex ai-center">
  177 + <view style="width: 100%; line-height: 24rpx" data-days="{{item.ExpiryDate}}" catchtap="change_card" data-cid="{{item.CardId}}">
  178 + <view style="text-align: right" class="fs26">¥<text class="pri fs40">{{item.CardFee}}</text></view>
  179 + <view style="text-align: center" class="fs30" wx:if="{{is_guoqi}}">立即变更</view>
  180 + <view style="text-align: center" class="fs30" wx:else>立即升级</view>
  181 + </view>
  182 + </view>
  183 + </view>
  184 + </view>
  185 + </view>
  186 + </view>
  187 +</view>
152 \ No newline at end of file 188 \ No newline at end of file
pages/user/cardinfo/cardinfo.wxss
@@ -225,4 +225,17 @@ align-items:center; @@ -225,4 +225,17 @@ align-items:center;
225 225
226 width: 100%; 226 width: 100%;
227 height: 320rpx; 227 height: 320rpx;
228 -}  
229 \ No newline at end of file 228 \ No newline at end of file
  229 +}
  230 +
  231 +.content{ position: fixed; top: 0;left:0; width: 100%; height: 100%; z-index: 12; }
  232 +.content .card_list{ width: 700rpx; margin: 0 auto; background-color: #ffe88b; border-radius: 15rpx}
  233 +.content .card_list .hg{ width: 100%;height: 156rpx}
  234 +
  235 +.content .card_list .list{ max-height: 700rpx; padding: 0 25rpx; margin-bottom: 20rpx; overflow-y: auto}
  236 +.content .card_list .item{ margin-bottom: 10rpx; background: #fff; height: 150rpx; border-radius: 10rpx}
  237 +.content .card_list .item .hg_img{ width: 70rpx; height: 60rpx; margin-left: 40rpx; margin-right: 20rpx }
  238 +.content .card_list .item .price_show{ width: 200rpx; height: 110rpx; background: #ffd430;
  239 + border-top-left-radius: 55rpx; border-bottom-left-radius:55rpx; }
  240 + .content .card_list .list .card_name{ max-width: 230rpx}
  241 +
  242 + .price_show .thr{color: #999; text-decoration:line-through }
230 \ No newline at end of file 243 \ No newline at end of file
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/coupons/coupons.wxml
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 <view wx:else> 63 <view wx:else>
64 <view class="text">有效期:不限</view> 64 <view class="text">有效期:不限</view>
65 </view> 65 </view>
66 - <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}} 66 + <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}
67 </view> 67 </view>
68 68
69 </view> 69 </view>
pages/user/coupons/query/index.wxml
@@ -102,7 +102,7 @@ @@ -102,7 +102,7 @@
102 <view wx:else> 102 <view wx:else>
103 <view class="text">有效期: 不限</view> 103 <view class="text">有效期: 不限</view>
104 </view> 104 </view>
105 - <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{detail.UseObjectID==null?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null?"":",不包邮地区:"+region_list_name}} 105 + <view class="textss">使用说明: {{filter.getNum(detail.Sum)}}元优惠券,{{detail.UseObjectID==null || detail.UseObjectID==''?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用{{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}}
106 </view> 106 </view>
107 </view> 107 </view>
108 </view> 108 </view>
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/index/index.wxml
  1 +<import src="../../tabbar/tabbar.wxml" />
  2 +<template is="tabBar" data="{{tabBar}}" />
  3 +
1 <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}"> 4 <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}">
2 <view class="xc-user"> 5 <view class="xc-user">
3 <view class="xc-head rel"> 6 <view class="xc-head rel">
@@ -297,5 +300,3 @@ @@ -297,5 +300,3 @@
297 </view> 300 </view>
298 301
299 <pop_txt id="pop_txt"></pop_txt> 302 <pop_txt id="pop_txt"></pop_txt>
300 - <import src="../../tabbar/tabbar.wxml" />  
301 - <template is="tabBar" data="{{tabBar}}" />  
302 \ No newline at end of file 303 \ No newline at end of file
pages/user/integral/integral.wxml
@@ -38,8 +38,8 @@ @@ -38,8 +38,8 @@
38 <view class='time'>{{details.BillDate}}</view> 38 <view class='time'>{{details.BillDate}}</view>
39 </view> 39 </view>
40 </view> 40 </view>
41 - <view class="val" style='color:{{(details.InIntegral!="0")?"green":""}}'>  
42 - {{(details.OutIntegral==0)?"+":"-"}}{{(details.InIntegral==0)?details.OutIntegral:details.InIntegral}}积分 </view> 41 + <view class="val" style='color:{{(details.InOutInt>0)?"green":""}}'>
  42 + {{(details.InOutInt>0)?"+":""}}{{filter.getNum(details.InOutInt)}}积分 </view>
43 </view> 43 </view>
44 <view style="clear:both"></view> 44 <view style="clear:both"></view>
45 </block> 45 </block>
pages/user/integral/query/index.wxml
@@ -63,8 +63,8 @@ @@ -63,8 +63,8 @@
63 <view class='time'>{{details.BillDate}}</view> 63 <view class='time'>{{details.BillDate}}</view>
64 </view> 64 </view>
65 </view> 65 </view>
66 - <view class="val" style='color:{{(details.InIntegral!="0")?"green":""}}'>  
67 - {{(details.OutIntegral!=0)?"":"+"}}{{(details.InIntegral==0)?filter.getNum(details.OutIntegral):filter.getNum(details.InIntegral)}}积分 </view> 66 + <view class="val" style='color:{{(details.InOutInt>0)?"green":""}}'>
  67 + {{(details.InOutInt>0)?"+":""}}{{filter.getNum(details.InOutInt)}}积分 </view>
68 </view> 68 </view>
69 </block> 69 </block>
70 70
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 //--------跳转到退款详情-----------
pages/user/plus/plus.js
@@ -312,7 +312,8 @@ Page({ @@ -312,7 +312,8 @@ Page({
312 312
313 //--支付成功,跳转到等级卡续费页面-- 313 //--支付成功,跳转到等级卡续费页面--
314 success:function () { 314 success:function () {
315 - 315 + var u_url = "/pages/user/cardinfo/cardinfo";
  316 + wx.reLaunch({url: u_url})
316 }, 317 },
317 318
318 //--绑定邀请码的输入-- 319 //--绑定邀请码的输入--
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 });
utils/pay2.js
@@ -8,7 +8,11 @@ module.exports = { @@ -8,7 +8,11 @@ module.exports = {
8 data: dd, 8 data: dd,
9 success: function(t) { 9 success: function(t) {
10 if(t.data.code==0){ 10 if(t.data.code==0){
11 - i.weixinPay(t.data.data, succ,fail); 11 + if(t.data.data=="升级成功"){
  12 + "function" == typeof succ && succ(1);
  13 + }else{
  14 + i.weixinPay(t.data.data, succ,fail);
  15 + }
12 }else{ 16 }else{
13 "function" == typeof fail && fail(); 17 "function" == typeof fail && fail();
14 } 18 }
utils/util.js
@@ -401,6 +401,15 @@ function base64_encode (str) { // 编码,配合encodeURIComponent使用 @@ -401,6 +401,15 @@ function base64_encode (str) { // 编码,配合encodeURIComponent使用
401 return strin 401 return strin
402 } 402 }
403 403
  404 +function ob_to_parm(ob){
  405 + var parm="";
  406 + for( var key in ob){
  407 + parm+="&"+key+"="+ob[key];
  408 + }
  409 + parm = parm.substr(1);
  410 + return parm;
  411 +}
  412 +
404 module.exports = { 413 module.exports = {
405 formatTime: function(e, r) { 414 formatTime: function(e, r) {
406 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { 415 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) {
@@ -505,5 +514,6 @@ module.exports = { @@ -505,5 +514,6 @@ module.exports = {
505 draw_circle:draw_circle,//绘制圆, 514 draw_circle:draw_circle,//绘制圆,
506 mergeArray:mergeArray, //数组合并 515 mergeArray:mergeArray, //数组合并
507 isContained:isContained, //是否包含 516 isContained:isContained, //是否包含
508 - base64_encode:base64_encode //64位加密 517 + base64_encode:base64_encode, //64位加密
  518 + ob_to_parm:ob_to_parm //对象变成参数
509 }; 519 };
utils/wxParse/wxParse.wxml
@@ -377,7 +377,7 @@ @@ -377,7 +377,7 @@
377 </view> 377 </view>
378 </template> 378 </template>
379 <template name="wxParseImg"> 379 <template name="wxParseImg">
380 - <image bindload="wxParseImgLoad" bindtap="wxParseImgTap" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-idx="{{item.imgIndex}}" data-src="{{item.attr.src}}" mode="widthFix" src="{{item.attr.src}}" style="width:{{item.width}}px;"></image> 380 + <image bindload="wxParseImgLoad" bindtap="wxParseImgTap" class="{{item.classStr}} wxParse-{{item.tag}}" data-from="{{item.from}}" data-idx="{{item.imgIndex}}" data-src="{{item.attr.src}}" mode="widthFix" src="{{item.attr.src}}" style="width:100%;"></image>
381 </template> 381 </template>
382 <template name="wxParseVideo"> 382 <template name="wxParseVideo">
383 <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> 383 <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">