-
Status changed to merged
-
mentioned in commit ab16f4f3764ba9791448dba13635c8d4d6e8d4b5
-
秒杀列表 拼单列表 搭配购 参团详情页
-
2.接口的替换
-
2. 小程序plus升降级的优化
-
2. 提示框的修改
Showing
60 changed files
components/diy_seckill/diy_seckill.js
components/goods_list/goods_list.js
| ... | ... | @@ -146,16 +146,17 @@ Component({ |
| 146 | 146 | var card_name_map = new Map(); |
| 147 | 147 | |
| 148 | 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 | 161 | var ob = { |
| 161 | 162 | "card_list": new_arr, | ... | ... |
components/goods_list/goods_list.wxss
components/my_confirm/my_confirm.js
| ... | ... | @@ -29,10 +29,13 @@ Component({ |
| 29 | 29 | }) |
| 30 | 30 | }, |
| 31 | 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 | 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 | 40 | close_yu_e: function() { |
| 38 | 41 | this.setData({ | ... | ... |
components/my_confirm/my_confirm.wxml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <view> |
| 5 | 5 | <view class="xc-qr-frame"> |
| 6 | 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 | 8 | <view class="flex jc-center ai_center" style="width: 100%;height: 75rpx;"> |
| 9 | 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 | 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
packageA/pages/prom_list/prom_list.js
| ... | ... | @@ -43,8 +43,20 @@ Page({ |
| 43 | 43 | //------初始化加载---------- |
| 44 | 44 | onLoad: function(t) { |
| 45 | 45 | var goods_id=t.goods_id; |
| 46 | - this.setData({gid:goods_id}); | |
| 46 | + this.setData({gid:goods_id}); | |
| 47 | 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 | 61 | getApp().getConfig2(function(e) { |
| 50 | 62 | var json_d = JSON.parse(e.switch_list); |
| ... | ... | @@ -216,7 +228,7 @@ Page({ |
| 216 | 228 | //--- 判断是等级会员,且在有效期范围内 --- |
| 217 | 229 | if(user.card_field && now<end){ |
| 218 | 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 | 232 | th.setData({card_field:user.card_field,card_name:card_name}); |
| 221 | 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 | 335 | a = 0, |
| 324 | 336 | o = this.data.data; |
| 325 | 337 | a = o.goods_id; |
| 326 | - | |
| 327 | 338 | //----------添加到购物车时,要判断限购数量,-------- |
| 328 | 339 | e.get_buy_num(o, function(ee) { |
| 329 | 340 | //---判断商品是否超出限购--- |
| ... | ... | @@ -383,6 +394,14 @@ Page({ |
| 383 | 394 | } |
| 384 | 395 | } |
| 385 | 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 | + | |
| 386 | 405 | |
| 387 | 406 | //-----如果是秒杀,团购,积分购,拼团----- |
| 388 | 407 | if (th.data.data.prom_type != 5) { |
| ... | ... | @@ -626,22 +645,25 @@ Page({ |
| 626 | 645 | |
| 627 | 646 | //--点击分享事件--- |
| 628 | 647 | onShareAppMessage: function(t) { |
| 629 | - var th = this; | |
| 630 | - var price = th.data.data.shop_price; | |
| 631 | - if (th.data.prom_act) { | |
| 632 | - price = th.data.prom_act.price; | |
| 633 | - } | |
| 634 | - var title= th.data.data.goods_name; | |
| 635 | - var img=th.data.data.original_img; | |
| 636 | - if(th.data.prom_type==6){ | |
| 637 | - title=th.data.prom_act.share_title; | |
| 638 | - img=th.data.iurl+th.data.prom_act.share_imgurl; | |
| 639 | - } | |
| 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); | |
| 640 | 663 | |
| 641 | 664 | return { |
| 642 | - title: price + "元 " +title, | |
| 643 | - path: "/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid, | |
| 644 | - imageUrl: img, | |
| 665 | + title: "搭配购", | |
| 666 | + path: pagePath, | |
| 645 | 667 | } |
| 646 | 668 | |
| 647 | 669 | }, | ... | ... |
pages/activity/pind_list/pind_list.js
| ... | ... | @@ -17,6 +17,24 @@ Page({ |
| 17 | 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 | 38 | onShow: function(t) { |
| 21 | 39 | |
| 22 | 40 | wx.setNavigationBarTitle({ title: "天天拼单",}) |
| ... | ... | @@ -126,12 +144,34 @@ Page({ |
| 126 | 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 | 177 | bind_bnerr2: function (e) { | ... | ... |
pages/activity/pind_list/pind_list.json
pages/activity/pind_list/pind_list.wxml
pages/activity/seckill_list/seckill_list.js
| ... | ... | @@ -12,6 +12,26 @@ Page({ |
| 12 | 12 | ismore:1, //是否可以加载更多 |
| 13 | 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 | 35 | onShow: function(t) { |
| 16 | 36 | |
| 17 | 37 | wx.setNavigationBarTitle({ title: "商品秒杀",}) |
| ... | ... | @@ -123,12 +143,31 @@ Page({ |
| 123 | 143 | this.setData({type:a,goodlist:null}); |
| 124 | 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 | 172 | bind_bnerr2: function (e) { |
| 134 | 173 | var _errImg = e.target.dataset.errorimg; | ... | ... |
pages/activity/seckill_list/seckill_list.json
pages/activity/seckill_list/seckill_list.wxml
pages/cart/cart/cart.js
| ... | ... | @@ -145,102 +145,105 @@ Page({ |
| 145 | 145 | carr = su.data.data.pageData; |
| 146 | 146 | var all_num = 0; |
| 147 | 147 | |
| 148 | - for (var i = 0; i < carr.length; i++) { | |
| 149 | - var item = carr[i]; | |
| 150 | - var good=null; | |
| 151 | - await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+item.goods_id,{}).then(res=>{ | |
| 152 | - good=res.data.data; | |
| 153 | - }) | |
| 154 | - var tt=ut.gettimestamp(); | |
| 155 | - //如果商品下架了,或者商品是赠品,一开始都要清除 | |
| 156 | - 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) { | |
| 157 | 158 | var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; |
| 158 | 159 | getApp().request.delete(url, { |
| 159 | - success: function(t) { } | |
| 160 | + success: function (t) { | |
| 161 | + } | |
| 160 | 162 | }); |
| 161 | 163 | //商品已经下架 |
| 162 | 164 | continue; |
| 163 | - } | |
| 164 | - //如果秒杀活动都去掉了,或者结束了,那么这个商品也没有必要留着 | |
| 165 | - if(item.prom_type==1){ | |
| 166 | - var prom=null; | |
| 167 | - await getApp().request.promiseGet("/api/ms/flash_sale/get/"+os.stoid+"/"+item.prom_id,{ | |
| 168 | - }).then(res=>{ | |
| 169 | - if(res.data.code==0) prom=res.data.data; | |
| 170 | - }) | |
| 171 | - //---如果有活动,不算在一起--- | |
| 172 | - if(!prom && prom.is_end==0 && prom.end_time>now && prom.start_time<now){ | |
| 173 | - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | |
| 174 | - a.delete(url, { | |
| 175 | - success: function(t) { } | |
| 176 | - }); | |
| 177 | - //商品已经下架 | |
| 178 | - continue; | |
| 179 | - } | |
| 180 | - } | |
| 181 | - //--判断优惠活动有没有过期-- | |
| 182 | - else if(item.prom_type==3){ | |
| 183 | - var isok=1; | |
| 184 | - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+item.goods_id+"/1", {}).then(res => { | |
| 185 | - if(res.data.code==0){ | |
| 186 | - var r_data=res.data.data; | |
| 187 | - if(!r_data.promGoodsLists){ | |
| 188 | - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | |
| 189 | - a.delete(url, {}); | |
| 190 | - //商品已经下架 | |
| 191 | - isok=0; | |
| 192 | - } | |
| 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) { | |
| 193 | 177 | } |
| 194 | - 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) { | |
| 195 | 190 | var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; |
| 196 | - a.delete(url, { }); | |
| 191 | + a.delete(url, {}); | |
| 197 | 192 | //商品已经下架 |
| 198 | - isok=0; | |
| 193 | + isok = 0; | |
| 199 | 194 | } |
| 195 | + } else { | |
| 196 | + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | |
| 197 | + a.delete(url, {}); | |
| 198 | + //商品已经下架 | |
| 199 | + isok = 0; | |
| 200 | + } | |
| 200 | 201 | }) |
| 201 | - if(!isok) continue; | |
| 202 | - } | |
| 202 | + if (!isok) continue; | |
| 203 | + } | |
| 203 | 204 | |
| 204 | - all_num += item.goods_num; | |
| 205 | - item.original_img = oo.imghost + item.original_img; | |
| 206 | - item.selected = 0; | |
| 205 | + all_num += item.goods_num; | |
| 206 | + item.original_img = oo.imghost + item.original_img; | |
| 207 | + item.selected = 0; | |
| 207 | 208 | |
| 208 | 209 | |
| 209 | - var pcid = item.pick_id; | |
| 210 | - var find = 0; | |
| 211 | - //---------循环查找门店--- | |
| 212 | - if (arr.length > 0) { | |
| 213 | - for (var j = 0; j < arr.length; j++) { | |
| 214 | - if (arr[j].pid == pcid) { | |
| 215 | - arr[j].goods.push(item); | |
| 216 | - find = 1; | |
| 217 | - 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 | + } | |
| 218 | 220 | } |
| 219 | 221 | } |
| 220 | - } | |
| 221 | 222 | |
| 222 | - //------如果没有找到----- | |
| 223 | - if (find == 0) { | |
| 224 | - var pikname = ''; | |
| 225 | - //找到门店名称 | |
| 226 | - for (var k = 0; k < th.data.allsto.length; k++) { | |
| 227 | - if (pcid == th.data.allsto[k].pickup_id) { | |
| 228 | - pikname = th.data.allsto[k].pickup_name; | |
| 229 | - 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 | + } | |
| 230 | 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); | |
| 231 | 242 | } |
| 232 | - var narr = new Array(); | |
| 233 | - narr.push(item); | |
| 234 | - var ie = { | |
| 235 | - pid: pcid, | |
| 236 | - pname: pikname, | |
| 237 | - goods: narr, | |
| 238 | - selected: 0 | |
| 239 | - }; | |
| 240 | - arr.push(ie); | |
| 241 | 243 | } |
| 242 | 244 | } |
| 243 | 245 | |
| 246 | + | |
| 244 | 247 | if(arr.length==0) { |
| 245 | 248 | setTimeout(function () { |
| 246 | 249 | var goods_list = th.selectComponent("#goods_list"); //组件的id |
| ... | ... | @@ -1299,4 +1302,5 @@ Page({ |
| 1299 | 1302 | getApp().goto(url); |
| 1300 | 1303 | } |
| 1301 | 1304 | |
| 1305 | + | |
| 1302 | 1306 | }); |
| 1303 | 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 | 5 | <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> |
| 3 | 6 | <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> |
| ... | ... | @@ -181,5 +184,3 @@ |
| 181 | 184 | |
| 182 | 185 | |
| 183 | 186 | <warn id="warn"></warn> |
| 184 | -<import src="../../tabbar/tabbar.wxml" /> | |
| 185 | -<template is="tabBar" data="{{tabBar}}" /> | |
| 186 | 187 | \ No newline at end of file | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -1431,7 +1431,7 @@ Page({ |
| 1431 | 1431 | goods.guide_id=gg.guide_id; |
| 1432 | 1432 | goods.guide_type=gg.guide_type; |
| 1433 | 1433 | //调用接口判断是不是会员 |
| 1434 | - await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{ | |
| 1434 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{ | |
| 1435 | 1435 | if(res.data.code==0){ |
| 1436 | 1436 | goods.guide_name=res.data.data.salesman; |
| 1437 | 1437 | goods.guide_sn=res.data.data.salesman_no; |
| ... | ... | @@ -1631,7 +1631,7 @@ Page({ |
| 1631 | 1631 | goods.guide_id=g_item.guide_id; |
| 1632 | 1632 | goods.guide_type=g_item.guide_type; |
| 1633 | 1633 | //调用接口判断是不是会员 |
| 1634 | - await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{ | |
| 1634 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+g_item.guide_id,{}).then(res=>{ | |
| 1635 | 1635 | if(res.data.code==0){ |
| 1636 | 1636 | goods.guide_name=res.data.data.salesman; |
| 1637 | 1637 | goods.guide_sn=res.data.data.salesman_no; | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
| ... | ... | @@ -353,7 +353,7 @@ Page({ |
| 353 | 353 | }); |
| 354 | 354 | }, |
| 355 | 355 | //--------------------提交订单----------------------- |
| 356 | - submitForm:function(t){ | |
| 356 | + submitForm: async function(t){ | |
| 357 | 357 | if(this.data.is_summit_ing==1) return false; //--提交中退出-- |
| 358 | 358 | this.data.is_summit_ing=1; |
| 359 | 359 | |
| ... | ... | @@ -440,6 +440,13 @@ Page({ |
| 440 | 440 | if(gg.guide_id){ |
| 441 | 441 | goods.guide_id=gg.guide_id; |
| 442 | 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 | + }) | |
| 443 | 450 | } |
| 444 | 451 | |
| 445 | 452 | item.order_goods.push(goods); | ... | ... |
pages/getphone/getphone.js
| ... | ... | @@ -26,8 +26,7 @@ Page({ |
| 26 | 26 | if (openid == "" || openid == null || r==null ){ |
| 27 | 27 | getApp().globalData.user_id=null; |
| 28 | 28 | getApp().globalData.userInfo=null; |
| 29 | - console.log("openid"); | |
| 30 | - wx.navigateTo({ url: '/pages/togoin/togoin', }) | |
| 29 | + getApp().goto('/pages/togoin/togoin') | |
| 31 | 30 | return false; |
| 32 | 31 | } |
| 33 | 32 | var user_info=getApp().globalData.userInfo; | ... | ... |
pages/giftpack/birthdaygift/birthdaygift.js
| ... | ... | @@ -115,22 +115,22 @@ Page({ |
| 115 | 115 | }, |
| 116 | 116 | |
| 117 | 117 | onLoad: function onLoad(options) { |
| 118 | + | |
| 118 | 119 | var th = this; |
| 119 | 120 | th.setData({ |
| 120 | 121 | getActId: options.actId, |
| 121 | 122 | giftID: options.giftBagId |
| 122 | 123 | }) |
| 123 | - th.GetList(); | |
| 124 | + | |
| 124 | 125 | }, |
| 125 | 126 | onShow: function onShow() { |
| 126 | 127 | //--先判断会员状态-- |
| 127 | 128 | var user_info = getApp().globalData.userInfo; |
| 128 | 129 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 129 | - wx.navigateTo({ | |
| 130 | - url: '/pages/getphone/getphone', | |
| 131 | - }) | |
| 130 | + getApp().goto('/pages/getphone/getphone'); | |
| 132 | 131 | return false; |
| 133 | 132 | } |
| 133 | + this.GetList(); | |
| 134 | 134 | |
| 135 | 135 | }, |
| 136 | 136 | GetReceive: function() { | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
| ... | ... | @@ -27,6 +27,7 @@ Page({ |
| 27 | 27 | total: 0, //总数量 |
| 28 | 28 | }, |
| 29 | 29 | onLoad: function(options) { |
| 30 | + | |
| 30 | 31 | var th = this; |
| 31 | 32 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 32 | 33 | my_confirm.open_cancel(0); |
| ... | ... | @@ -34,17 +35,16 @@ Page({ |
| 34 | 35 | getStorageID: a.stoid, |
| 35 | 36 | getUserID: d.user_id |
| 36 | 37 | }) |
| 37 | - th.getList(); | |
| 38 | + | |
| 38 | 39 | }, |
| 39 | 40 | onShow: function() { |
| 40 | 41 | //--先判断会员状态-- |
| 41 | 42 | var user_info = getApp().globalData.userInfo; |
| 42 | 43 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 43 | - wx.navigateTo({ | |
| 44 | - url: '/pages/getphone/getphone', | |
| 45 | - }) | |
| 44 | + getApp().goto('/pages/getphone/getphone'); | |
| 46 | 45 | return false; |
| 47 | 46 | } |
| 47 | + this.getList(); | |
| 48 | 48 | |
| 49 | 49 | }, |
| 50 | 50 | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.wxml
| ... | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | </block> |
| 37 | 37 | </view> |
| 38 | 38 | <view class="content_ware_price"> |
| 39 | - <text class="ellipsis-1">{{"原价:¥"+items.giftPosPrice}}</text> | |
| 39 | + <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text> | |
| 40 | 40 | </view> |
| 41 | 41 | <view class="content_ware_time"> |
| 42 | 42 | <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text> | ... | ... |
pages/giftpack/evaluategift/evaluategift.js
| ... | ... | @@ -120,6 +120,7 @@ Page({ |
| 120 | 120 | }) |
| 121 | 121 | }, |
| 122 | 122 | onLoad: function(options) { |
| 123 | + | |
| 123 | 124 | var th = this; |
| 124 | 125 | th.setData({ |
| 125 | 126 | getActId: options.actId, |
| ... | ... | @@ -133,17 +134,17 @@ Page({ |
| 133 | 134 | th.setData({ orderType: orderType}) |
| 134 | 135 | } |
| 135 | 136 | |
| 136 | - th.GetList(); | |
| 137 | + | |
| 137 | 138 | }, |
| 138 | 139 | onShow: function() { |
| 139 | 140 | //--先判断会员状态-- |
| 140 | 141 | var user_info = getApp().globalData.userInfo; |
| 141 | 142 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 142 | - wx.navigateTo({ | |
| 143 | - url: '/pages/getphone/getphone', | |
| 144 | - }) | |
| 143 | + getApp().goto('/pages/getphone/getphone'); | |
| 145 | 144 | return false; |
| 146 | 145 | } |
| 146 | + | |
| 147 | + this.GetList(); | |
| 147 | 148 | |
| 148 | 149 | }, |
| 149 | 150 | GetReceive: function() { | ... | ... |
pages/giftpack/festival/festival.js
| ... | ... | @@ -118,13 +118,13 @@ Page({ |
| 118 | 118 | }, |
| 119 | 119 | |
| 120 | 120 | onLoad: function(options) { |
| 121 | + | |
| 121 | 122 | var th = this; |
| 122 | 123 | th.setData({ |
| 123 | 124 | getActId: options.actId, |
| 124 | 125 | giftID: options.giftBagId |
| 125 | 126 | }) |
| 126 | - th.is_festival(); | |
| 127 | - th.GetList(); | |
| 127 | + | |
| 128 | 128 | wx.setNavigationBarTitle({ |
| 129 | 129 | title: "节日有礼", |
| 130 | 130 | }); |
| ... | ... | @@ -133,11 +133,11 @@ Page({ |
| 133 | 133 | //--先判断会员状态-- |
| 134 | 134 | var user_info = getApp().globalData.userInfo; |
| 135 | 135 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 136 | - wx.navigateTo({ | |
| 137 | - url: '/pages/getphone/getphone', | |
| 138 | - }) | |
| 136 | + getApp().goto('/pages/getphone/getphone'); | |
| 139 | 137 | return false; |
| 140 | 138 | } |
| 139 | + this.is_festival(); | |
| 140 | + this.GetList(); | |
| 141 | 141 | |
| 142 | 142 | }, |
| 143 | 143 | GetReceive: function() { | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
| ... | ... | @@ -30,29 +30,31 @@ Page({ |
| 30 | 30 | is_lb: 0, //是否有礼包 |
| 31 | 31 | }, |
| 32 | 32 | onLoad: function(options) { |
| 33 | + | |
| 34 | + | |
| 33 | 35 | var th = this; |
| 34 | 36 | th.setData({ |
| 35 | 37 | isBuy: options.isBuy, |
| 36 | 38 | getGiftID: options.lbId, |
| 37 | 39 | orderSn: options.orderSn |
| 38 | 40 | }) |
| 39 | - if (options.isBuy == 0) { | |
| 40 | - th.GetMyGiftList(); | |
| 41 | - } else { | |
| 42 | - th.GetBuyGiftList(); | |
| 43 | - } | |
| 41 | + | |
| 44 | 42 | th.close(); |
| 45 | 43 | }, |
| 46 | 44 | onShow: function() { |
| 47 | 45 | //--先判断会员状态-- |
| 48 | 46 | var user_info = getApp().globalData.userInfo; |
| 49 | 47 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 50 | - wx.navigateTo({ | |
| 51 | - url: '/pages/getphone/getphone', | |
| 52 | - }) | |
| 48 | + getApp().goto('/pages/getphone/getphone'); | |
| 53 | 49 | return false; |
| 54 | 50 | } |
| 55 | 51 | |
| 52 | + if (this.data.isBuy == 0) { | |
| 53 | + this.GetMyGiftList(); | |
| 54 | + } else { | |
| 55 | + this.GetBuyGiftList(); | |
| 56 | + } | |
| 57 | + | |
| 56 | 58 | }, |
| 57 | 59 | GetBuyPrice: function(e) { |
| 58 | 60 | var that = this.data; | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | </view> |
| 26 | 26 | <view class="top_foot data-v-3a5b7e36"> |
| 27 | 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 | 29 | </view> |
| 30 | 30 | <view class="top_foot_qty data-v-3a5b7e36"> |
| 31 | 31 | <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -28,6 +28,7 @@ Page({ |
| 28 | 28 | }, |
| 29 | 29 | |
| 30 | 30 | onLoad: function(options) { |
| 31 | + | |
| 31 | 32 | var th = this; |
| 32 | 33 | th.setData({ |
| 33 | 34 | getStorageID: a.stoid, |
| ... | ... | @@ -35,17 +36,16 @@ Page({ |
| 35 | 36 | loadingType: 0, |
| 36 | 37 | getDate: i.formatTime(new Date().getTime()) |
| 37 | 38 | }) |
| 38 | - th.getList(); | |
| 39 | + | |
| 39 | 40 | }, |
| 40 | 41 | onShow: function() { |
| 41 | 42 | //--先判断会员状态-- |
| 42 | 43 | var user_info = getApp().globalData.userInfo; |
| 43 | 44 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 44 | - wx.navigateTo({ | |
| 45 | - url: '/pages/getphone/getphone', | |
| 46 | - }) | |
| 45 | + getApp().goto('/pages/getphone/getphone'); | |
| 47 | 46 | return false; |
| 48 | 47 | } |
| 48 | + this.getList(); | |
| 49 | 49 | |
| 50 | 50 | }, |
| 51 | 51 | getList: function() { | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxml
pages/giftpack/newvipgift/newvipgift.js
| ... | ... | @@ -114,22 +114,22 @@ Page({ |
| 114 | 114 | }, |
| 115 | 115 | |
| 116 | 116 | onLoad: function(options) { |
| 117 | + | |
| 117 | 118 | var th = this; |
| 118 | 119 | th.setData({ |
| 119 | 120 | getActId: options.actId, |
| 120 | 121 | giftID: options.giftBagId |
| 121 | 122 | }) |
| 122 | - th.GetList(); | |
| 123 | + | |
| 123 | 124 | }, |
| 124 | 125 | onShow: function() { |
| 125 | 126 | //--先判断会员状态-- |
| 126 | 127 | var user_info = getApp().globalData.userInfo; |
| 127 | 128 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 128 | - wx.navigateTo({ | |
| 129 | - url: '/pages/getphone/getphone', | |
| 130 | - }) | |
| 129 | + getApp().goto('/pages/getphone/getphone'); | |
| 131 | 130 | return false; |
| 132 | 131 | } |
| 132 | + this.GetList(); | |
| 133 | 133 | |
| 134 | 134 | }, |
| 135 | 135 | GetReceive: function() { | ... | ... |
pages/goods/categoryList/categoryList.js
pages/goods/categoryList/categoryList.wxml
| 1 | -<!-- 风格1 --> | |
| 1 | +<import src="../../tabbar/tabbar.wxml" /> | |
| 2 | +<template is="tabBar" data="{{tabBar}}" /> | |
| 3 | + | |
| 4 | +<!-- 风格1 --> | |
| 2 | 5 | <block wx:if="{{is_used_share==0}}"> |
| 3 | 6 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
| 4 | 7 | <view class="swiper-tab" > |
| ... | ... | @@ -507,5 +510,3 @@ |
| 507 | 510 | </block> |
| 508 | 511 | |
| 509 | 512 | </block> |
| 510 | - <import src="../../tabbar/tabbar.wxml" /> | |
| 511 | - <template is="tabBar" data="{{tabBar}}" /> | |
| 512 | 513 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -270,7 +270,7 @@ Page({ |
| 270 | 270 | //调用接口判断是不是会员 |
| 271 | 271 | getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ |
| 272 | 272 | if(res.data.code==0){ |
| 273 | - getApp().globalData.guide_id=res.data.data.bind_user_id; | |
| 273 | + getApp().globalData.guide_id=res.data.data.id; | |
| 274 | 274 | } |
| 275 | 275 | }) |
| 276 | 276 | } |
| ... | ... | @@ -365,10 +365,19 @@ Page({ |
| 365 | 365 | |
| 366 | 366 | //获取用户的默认门店 |
| 367 | 367 | getApp().get_user_store(function(ee) { |
| 368 | + | |
| 368 | 369 | if(!ee) { |
| 369 | 370 | th.data.fir_def_store={}; //赋值空对象 |
| 370 | 371 | return false; |
| 371 | 372 | } |
| 373 | + var g_distr_type=th.data.data.distr_type; | |
| 374 | + | |
| 375 | + //--如果默认门店的配送方式不对,就不能被选择-- | |
| 376 | + if(ee.distr_type!=0 && g_distr_type!=0 && ee.distr_type!=g_distr_type ){ | |
| 377 | + th.data.fir_def_store={}; //赋值空对象 | |
| 378 | + return false; | |
| 379 | + } | |
| 380 | + | |
| 372 | 381 | var appd=getApp().globalData; |
| 373 | 382 | var w_time = setInterval(function() { |
| 374 | 383 | if (that.data.is_get_local_ok == 0) return false; |
| ... | ... | @@ -1708,7 +1717,7 @@ Page({ |
| 1708 | 1717 | if (th.data.is_get_local_ok == 0) return false; |
| 1709 | 1718 | var dd = null, |
| 1710 | 1719 | i = getApp().request; |
| 1711 | - var g_distr_type = th.data.data.distr_type; | |
| 1720 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 1712 | 1721 | if (g_distr_type != 0) { |
| 1713 | 1722 | dd = { |
| 1714 | 1723 | store_id: o.stoid, |
| ... | ... | @@ -1729,6 +1738,12 @@ Page({ |
| 1729 | 1738 | dd.lon = th.data.lon; |
| 1730 | 1739 | } |
| 1731 | 1740 | clearInterval(timer_get); |
| 1741 | + | |
| 1742 | + 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 ){ | |
| 1743 | + th.setData({def_pick_store:null}); | |
| 1744 | + } | |
| 1745 | + | |
| 1746 | + | |
| 1732 | 1747 | //----------获取门店---------------- |
| 1733 | 1748 | getApp().request.promiseGet("/api/weshop/pickup/list", { |
| 1734 | 1749 | data: dd, |
| ... | ... | @@ -1748,7 +1763,7 @@ Page({ |
| 1748 | 1763 | } |
| 1749 | 1764 | |
| 1750 | 1765 | //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- |
| 1751 | - if (th.data.def_pick_store) { | |
| 1766 | + if (th.data.def_pick_store && (th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){ | |
| 1752 | 1767 | for (var k = 0; k < e.data.data.pageData.length; k++) { |
| 1753 | 1768 | if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { |
| 1754 | 1769 | e.data.data.pageData.splice(k, 1); //删除 |
| ... | ... | @@ -1780,6 +1795,9 @@ Page({ |
| 1780 | 1795 | //------------处理门店--------------- |
| 1781 | 1796 | deal_pickup(e){ |
| 1782 | 1797 | var th=this; |
| 1798 | + | |
| 1799 | + var g_distr_type=th.data.sele_g.distr_type; | |
| 1800 | + | |
| 1783 | 1801 | //单总量超出5个的时候 |
| 1784 | 1802 | if (e.data.data.total > 5) { |
| 1785 | 1803 | getApp().request.get("/api/weshop/storagecategory/page", { |
| ... | ... | @@ -1883,8 +1901,8 @@ Page({ |
| 1883 | 1901 | }); |
| 1884 | 1902 | //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ |
| 1885 | 1903 | if (!th.data.def_pick_store) { |
| 1886 | - th.setData({def_pick_store:e.data.data.pageData[0]}) | |
| 1887 | - } | |
| 1904 | + th.setData({def_pick_store:e.data.data.pageData[0]}) | |
| 1905 | + } | |
| 1888 | 1906 | } |
| 1889 | 1907 | } else { |
| 1890 | 1908 | th.setData({ |
| ... | ... | @@ -1914,7 +1932,6 @@ Page({ |
| 1914 | 1932 | }) |
| 1915 | 1933 | } |
| 1916 | 1934 | } |
| 1917 | - | |
| 1918 | 1935 | }, |
| 1919 | 1936 | //------------处理线下门店库存-------- |
| 1920 | 1937 | deal_pickup_dline(e){ |
| ... | ... | @@ -1931,7 +1948,9 @@ Page({ |
| 1931 | 1948 | var o_plist=e.data.data.pageData; |
| 1932 | 1949 | var new_list=[]; |
| 1933 | 1950 | var is_find_def_store=0; |
| 1934 | - | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + var g_distr_type=th.data.sele_g.distr_type; | |
| 1935 | 1954 | var lock=[]; |
| 1936 | 1955 | //先读取门店的lock,采用链式写法,少用await |
| 1937 | 1956 | getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{ |
| ... | ... | @@ -1962,8 +1981,8 @@ Page({ |
| 1962 | 1981 | if(n_item.CanOutQty>lock_num){ |
| 1963 | 1982 | o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; |
| 1964 | 1983 | new_list.push(o_plist[kk]); |
| 1965 | - //如果找到默认门店 | |
| 1966 | - if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no){ | |
| 1984 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
| 1985 | + 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 ) ){ | |
| 1967 | 1986 | th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num; |
| 1968 | 1987 | if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id) |
| 1969 | 1988 | th.setData({def_pick_store:th.data.fir_def_store}) |
| ... | ... | @@ -1978,9 +1997,10 @@ Page({ |
| 1978 | 1997 | //数据组装下 |
| 1979 | 1998 | var em={};em.data={};em.data.data={}; |
| 1980 | 1999 | em.data.data.total=new_list.length; |
| 1981 | - em.data.data.pageData=new_list; | |
| 1982 | - | |
| 1983 | - if(th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id){ | |
| 2000 | + em.data.data.pageData=new_list; | |
| 2001 | + | |
| 2002 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
| 2003 | + 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 ) ){ | |
| 1984 | 2004 | th.data.fir_def_store.CanOutQty=0; |
| 1985 | 2005 | //--当选择的门店是客户默认的门店的时候-- |
| 1986 | 2006 | if(th.data.def_pick_store && th.data.fir_def_store.pickup_id==th.data.def_pick_store.pickup_id) { |
| ... | ... | @@ -2799,6 +2819,19 @@ Page({ |
| 2799 | 2819 | sku: o.sku, |
| 2800 | 2820 | }; |
| 2801 | 2821 | |
| 2822 | + //---是不是从收藏夹出来的--- | |
| 2823 | + if(th.data.c_guide_id){ | |
| 2824 | + newd['guide_id'] = th.data.c_guide_id; | |
| 2825 | + newd['guide_type']=2; | |
| 2826 | + | |
| 2827 | + }else{ | |
| 2828 | + if(getApp().globalData.guide_id){ | |
| 2829 | + newd['guide_id'] = getApp().globalData.guide_id; | |
| 2830 | + newd['guide_type']=0; | |
| 2831 | + | |
| 2832 | + } | |
| 2833 | + } | |
| 2834 | + | |
| 2802 | 2835 | //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ |
| 2803 | 2836 | |
| 2804 | 2837 | if(th.data.is_normal == 1){ |
| ... | ... | @@ -3196,7 +3229,7 @@ Page({ |
| 3196 | 3229 | var vpath = res.path; |
| 3197 | 3230 | var context = wx.createCanvasContext('share'); |
| 3198 | 3231 | //先画背景 |
| 3199 | - var pg_path = "/pacj/images/share/share_bg.png"; | |
| 3232 | + var pg_path = "../../../images/share/share_bg.png"; | |
| 3200 | 3233 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
| 3201 | 3234 | //--昵称--- |
| 3202 | 3235 | context.setFontSize(24 * unit) | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -241,12 +241,12 @@ |
| 241 | 241 | </view> |
| 242 | 242 | <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}} |
| 243 | 243 | <view class='yj' style="top:35rpx"> |
| 244 | - <text>原价:¥{{data.market_price}}</text> | |
| 244 | + <text>零售价:¥{{data.market_price}}</text> | |
| 245 | 245 | </view> |
| 246 | 246 | </block> |
| 247 | 247 | <block wx:else> |
| 248 | 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 | 250 | </block> |
| 251 | 251 | </view> |
| 252 | 252 | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -21,10 +21,13 @@ Page({ |
| 21 | 21 | is_new:0, |
| 22 | 22 | is_hot:0, |
| 23 | 23 | prom_goods_list:null, |
| 24 | + rq_data:null, | |
| 24 | 25 | }, |
| 25 | 26 | |
| 26 | 27 | onLoad: function(t) { |
| 27 | 28 | |
| 29 | + this.data.rq_data=t; | |
| 30 | + | |
| 28 | 31 | //接受有没有导购的参数 |
| 29 | 32 | var first_leader=t.first_leader; |
| 30 | 33 | if(first_leader){ |
| ... | ... | @@ -32,7 +35,7 @@ Page({ |
| 32 | 35 | //调用接口判断是不是会员 |
| 33 | 36 | getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{ |
| 34 | 37 | if(res.data.code==0){ |
| 35 | - getApp().globalData.guide_id=res.data.data.bind_user_id; | |
| 38 | + getApp().globalData.guide_id=res.data.data.id; | |
| 36 | 39 | } |
| 37 | 40 | }) |
| 38 | 41 | } |
| ... | ... | @@ -212,14 +215,20 @@ Page({ |
| 212 | 215 | if (pagePath.indexOf('/') != 0) { |
| 213 | 216 | pagePath = '/' + pagePath; |
| 214 | 217 | } |
| 215 | - if(getApp().globalData.user_id){ | |
| 216 | 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){ | |
| 217 | 225 | if(pagePath.indexOf("?")>0){ |
| 218 | 226 | pagePath+="&first_leader="+getApp().globalData.user_id; |
| 219 | 227 | }else{ |
| 220 | 228 | pagePath+="?first_leader="+getApp().globalData.user_id; |
| 221 | 229 | } |
| 222 | 230 | } |
| 231 | + console.log("11-11"+pagePath); | |
| 223 | 232 | return { |
| 224 | 233 | title: "商品列表", |
| 225 | 234 | path:pagePath, | ... | ... |
pages/goods/goodsList/goodsList.wxml
pages/goods/search/search.js
| ... | ... | @@ -21,8 +21,11 @@ Page({ |
| 21 | 21 | |
| 22 | 22 | tabname: "goods_id", //排序的字段 |
| 23 | 23 | adname: "desc", //升降的字段 |
| 24 | + rq_data:null, | |
| 24 | 25 | }, |
| 25 | 26 | onLoad: function(t) { |
| 27 | + this.data.rq_data=t; | |
| 28 | + | |
| 26 | 29 | //接受有没有导购的参数 |
| 27 | 30 | var first_leader=t.first_leader; |
| 28 | 31 | if(first_leader){ |
| ... | ... | @@ -30,7 +33,7 @@ Page({ |
| 30 | 33 | //调用接口判断是不是会员 |
| 31 | 34 | getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{ |
| 32 | 35 | if(res.data.code==0){ |
| 33 | - getApp().globalData.guide_id=res.data.data.bind_user_id; | |
| 36 | + getApp().globalData.guide_id=res.data.data.id; | |
| 34 | 37 | } |
| 35 | 38 | }) |
| 36 | 39 | } |
| ... | ... | @@ -52,8 +55,7 @@ Page({ |
| 52 | 55 | th.setData({ hotWords: arr}); |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | - | |
| 56 | - | |
| 58 | + | |
| 57 | 59 | //计算等级价相关 |
| 58 | 60 | var swithc_list=rs.switch_list; |
| 59 | 61 | var sw_arr=JSON.parse(swithc_list); |
| ... | ... | @@ -185,14 +187,39 @@ Page({ |
| 185 | 187 | //-----点击搜索按钮---- |
| 186 | 188 | search: function(t) { |
| 187 | 189 | if ("string" != typeof t || "" == t) return a.showWarning("请输入搜索关键词"); |
| 190 | + this.data.key_str=t; | |
| 188 | 191 | this.resetData(), this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t)); |
| 189 | 192 | }, |
| 190 | - //---------分享配置-------- | |
| 191 | - onShareAppMessage: function (e) { | |
| 192 | - return { | |
| 193 | - title: "商品分类", | |
| 194 | - } | |
| 195 | - }, | |
| 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 | + | |
| 196 | 223 | //---------图片失败,默认图片-------- |
| 197 | 224 | bind_bnerr: function (e) { |
| 198 | 225 | var _errImg = e.target.dataset.errorimg; | ... | ... |
pages/goods/search/search.json
pages/goods/search/search.wxml
| ... | ... | @@ -106,6 +106,9 @@ |
| 106 | 106 | </block> |
| 107 | 107 | </view> |
| 108 | 108 | </navigator> |
| 109 | + | |
| 110 | + <!-- 有商品列表的时候,要有分享攻击 --> | |
| 111 | + <share_box id="share"></share_box> | |
| 109 | 112 | </view> |
| 110 | 113 | <view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> |
| 111 | 114 | <image class="cart-image" src="{{url}}/miniapp/images/cart-null.png"></image> | ... | ... |
pages/index/index/index.js
pages/index/index/index.wxml
| 1 | +<import src="../../tabbar/tabbar.wxml" /> | |
| 2 | +<template is="tabBar" data="{{tabBar}}"/> | |
| 3 | + | |
| 1 | 4 | <!--普通界面--> |
| 2 | 5 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
| 3 | 6 | <view class="container rel" wx:if="{{ishow}}"> |
| ... | ... | @@ -360,8 +363,7 @@ |
| 360 | 363 | </view> |
| 361 | 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 | 2 | <!--pages/tabbar.wxml--> |
| 2 | 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;"> | |
| 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 | 6 | <block wx:for="{{tabBar.list}}" wx:key="weappurl"> |
| 6 | - | |
| 7 | 7 | <block wx:if="{{!item.active}}"> |
| 8 | 8 | <navigator url="{{item.weappurl}}" open-type="redirect" class="tabbar_item {{item.clas}}" style="position:relative;width:{{100 / tabBar.length}}%;height:100%;float:left;text-align:center;padding:5px 0;"> |
| 9 | - <view wx:if="{{item.nav_name=='购物车'}}" class="menu_red"> | |
| 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 | 10 | {{tabBar.cartGoodsNum}} |
| 11 | 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 | 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 | 17 | </navigator> |
| 17 | 18 | </block> |
| 18 | 19 | <block wx:else> |
| 19 | 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;"> |
| 20 | - <view wx:if="{{item.nav_name=='购物车'}}" class="menu_red"> | |
| 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 | 22 | {{tabBar.cartGoodsNum}} |
| 22 | 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 | 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 | 29 | </view> |
| 35 | 30 | </block> |
| 36 | 31 | |
| ... | ... | @@ -43,7 +38,7 @@ |
| 43 | 38 | <!-- 1 --> |
| 44 | 39 | <block wx:if="{{tabBar.active!='/pages/index/index/index'}}"> |
| 45 | 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 | 42 | <image src="{{tabBar.url}}/miniapp/images/bar/index.png" class="img" style="width:100%;height:100%"></image> |
| 48 | 43 | </view> |
| 49 | 44 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> |
| ... | ... | @@ -51,7 +46,7 @@ |
| 51 | 46 | </block> |
| 52 | 47 | <block wx:else> |
| 53 | 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 | 50 | <image src="{{tabBar.url}}/miniapp/images/bar/index_on.png" class="img" style="width:100%;height:100%"></image> |
| 56 | 51 | </view> |
| 57 | 52 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">首页</text></view> |
| ... | ... | @@ -62,7 +57,7 @@ |
| 62 | 57 | <!-- 2 --> |
| 63 | 58 | <block wx:if="{{tabBar.active!='/pages/goods/categoryList/categoryList'}}"> |
| 64 | 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 | 61 | <image src="{{tabBar.url}}/miniapp/images/bar/fl.png" class="img" style="width:100%;height:100%"></image> |
| 67 | 62 | </view> |
| 68 | 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 | 65 | </block> |
| 71 | 66 | <block wx:else> |
| 72 | 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 | 69 | <image src="{{tabBar.url}}/miniapp/images/bar/fl_on.png" class="img" style="width:100%;height:100%"></image> |
| 75 | 70 | </view> |
| 76 | 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 | 76 | <!-- 3 --> |
| 82 | 77 | <block wx:if="{{tabBar.active!='/pages/cart/cart/cart'}}"> |
| 83 | 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 class="menu_default_red"> | |
| 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 | 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 | 82 | <image src="{{tabBar.url}}/miniapp/images/bar/car.png" class="img" style="width:100%;height:100%"></image> |
| 88 | 83 | </view> |
| 89 | 84 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> |
| ... | ... | @@ -91,9 +86,9 @@ |
| 91 | 86 | </block> |
| 92 | 87 | <block wx:else> |
| 93 | 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 class="menu_default_red"> | |
| 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 | 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 | 92 | <image src="{{tabBar.url}}/miniapp/images/bar/car_on.png" class="img" style="width:100%;height:100%"></image> |
| 98 | 93 | </view> |
| 99 | 94 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">购物车</text></view> |
| ... | ... | @@ -103,7 +98,7 @@ |
| 103 | 98 | <!-- 4 --> |
| 104 | 99 | <block wx:if="{{tabBar.active!='/pages/user/index/index'}}"> |
| 105 | 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 | 102 | <image src="{{tabBar.url}}/miniapp/images/bar/user.png" class="img" style="width:100%;height:100%"></image> |
| 108 | 103 | </view> |
| 109 | 104 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> |
| ... | ... | @@ -111,8 +106,8 @@ |
| 111 | 106 | </block> |
| 112 | 107 | <block wx:else> |
| 113 | 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 | 111 | </view> |
| 117 | 112 | <view style="height:40rpx;line-height:22rpx;"><text class="tabbar_text" style="font-size:0.6rem">我的</text></view> |
| 118 | 113 | </view> | ... | ... |
pages/team/team_show/team_show.js
| ... | ... | @@ -66,7 +66,7 @@ Page({ |
| 66 | 66 | wx.setNavigationBarTitle({ title: "拼团订单",}) |
| 67 | 67 | //var postdata=getApp().globalData.to_group; |
| 68 | 68 | var postdata=options; |
| 69 | - var tg_id = postdata.tg_id, first_leader=t.first_leader; | |
| 69 | + var tg_id = postdata.tg_id, first_leader=options.first_leader; | |
| 70 | 70 | //如果tg_id是空的话 |
| 71 | 71 | if(tg_id==undefined || tg_id==null || tg_id==""){ |
| 72 | 72 | var tg_id_str=decodeURIComponent(postdata.scene); |
| ... | ... | @@ -82,7 +82,7 @@ Page({ |
| 82 | 82 | //调用接口判断是不是会员 |
| 83 | 83 | getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ |
| 84 | 84 | if(res.data.code==0){ |
| 85 | - getApp().globalData.guide_id=res.data.data.bind_user_id; | |
| 85 | + getApp().globalData.guide_id=res.data.data.id; | |
| 86 | 86 | } |
| 87 | 87 | }) |
| 88 | 88 | } |
| ... | ... | @@ -585,7 +585,6 @@ Page({ |
| 585 | 585 | }); |
| 586 | 586 | setTimeout(th.countDown2, 1000); |
| 587 | 587 | }, |
| 588 | - | |
| 589 | 588 | //--获取门店--- |
| 590 | 589 | async get_sto(e) { |
| 591 | 590 | var th = this, dd = null,i=getApp().request; |
| ... | ... | @@ -758,6 +757,20 @@ Page({ |
| 758 | 757 | goods_name: th.data.goods.goods_name, |
| 759 | 758 | goods_sn: th.data.goods.goods_sn, |
| 760 | 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 | + | |
| 761 | 774 | //-----拼团----- |
| 762 | 775 | newd.goods_price = th.data.teamlist.price; |
| 763 | 776 | newd.prom_type = 6; | ... | ... |
pages/team/team_success/team_success.js
| ... | ... | @@ -360,7 +360,6 @@ Page({ |
| 360 | 360 | scene+="_"+user_id; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - | |
| 364 | 363 | //二微码 |
| 365 | 364 | var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+ |
| 366 | 365 | os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show"; |
| ... | ... | @@ -675,13 +674,13 @@ Page({ |
| 675 | 674 | |
| 676 | 675 | }, |
| 677 | 676 | |
| 678 | - | |
| 679 | 677 | //------ 分享配置 -------- |
| 680 | 678 | onShareAppMessage: function (e) { |
| 681 | - var scene=th.data.teamgroup.id; | |
| 679 | + var th=this; | |
| 680 | + var scene=this.data.teamgroup.id; | |
| 682 | 681 | var url="/pages/team/team_show/team_show?tg_id="+scene; |
| 683 | 682 | //--分享图片-- |
| 684 | - img=th.data.iurl+th.data.teamlist.share_imgurl; | |
| 683 | + var img=th.data.iurl+th.data.teamlist.share_imgurl; | |
| 685 | 684 | //--把会员分享出去-- |
| 686 | 685 | if(getApp().globalData.user_id){ |
| 687 | 686 | if(url.indexOf("?")>0) |
| ... | ... | @@ -689,10 +688,11 @@ Page({ |
| 689 | 688 | else |
| 690 | 689 | url+="?first_leader="+getApp().globalData.user_id; |
| 691 | 690 | } |
| 691 | + console.log(url); | |
| 692 | 692 | |
| 693 | 693 | return { |
| 694 | 694 | path:url, |
| 695 | - title: "商品分类", | |
| 695 | + title: th.data.teamlist.title, | |
| 696 | 696 | imageUrl: img, |
| 697 | 697 | } |
| 698 | 698 | }, | ... | ... |
pages/user/assistance/assistance.js
| ... | ... | @@ -34,6 +34,7 @@ Page({ |
| 34 | 34 | * 生命周期函数--监听页面加载 |
| 35 | 35 | */ |
| 36 | 36 | onLoad: function(options) { |
| 37 | + | |
| 37 | 38 | var th = this; |
| 38 | 39 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| 39 | 40 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); |
| ... | ... | @@ -44,9 +45,17 @@ Page({ |
| 44 | 45 | * 生命周期函数--监听页面显示 |
| 45 | 46 | */ |
| 46 | 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 | 56 | var th = this; |
| 48 | 57 | // 助力活动 |
| 49 | - th.assistance(); | |
| 58 | + this.assistance(); | |
| 50 | 59 | }, |
| 51 | 60 | // 助力活动 |
| 52 | 61 | assistance() { | ... | ... |
pages/user/assistance/friend_assistance.js
| ... | ... | @@ -28,6 +28,7 @@ Page({ |
| 28 | 28 | * 生命周期函数--监听页面加载 |
| 29 | 29 | */ |
| 30 | 30 | onLoad: function(options) { |
| 31 | + | |
| 31 | 32 | var th = this; |
| 32 | 33 | |
| 33 | 34 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| ... | ... | @@ -39,7 +40,6 @@ Page({ |
| 39 | 40 | if (this.data.tasking == 0 || this.data.tasking == undefined) { |
| 40 | 41 | this.data.tasking = decodeURIComponent(options.scene); |
| 41 | 42 | } |
| 42 | - getApp().getUserFir(function() {}); | |
| 43 | 43 | |
| 44 | 44 | }, |
| 45 | 45 | |
| ... | ... | @@ -57,9 +57,7 @@ Page({ |
| 57 | 57 | //--先判断会员状态-- |
| 58 | 58 | var user_info = getApp().globalData.userInfo; |
| 59 | 59 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 60 | - wx.navigateTo({ | |
| 61 | - url: '/pages/getphone/getphone', | |
| 62 | - }) | |
| 60 | + getApp().goto('/pages/getphone/getphone'); | |
| 63 | 61 | return false; |
| 64 | 62 | } |
| 65 | 63 | ... | ... |
pages/user/assistance/giftpacklist.js
| ... | ... | @@ -38,6 +38,7 @@ Page({ |
| 38 | 38 | id: "", //一键领取的时候使用 |
| 39 | 39 | }, |
| 40 | 40 | onLoad: function(options) { |
| 41 | + | |
| 41 | 42 | var th = this; |
| 42 | 43 | if (options.is_libao == 0) { |
| 43 | 44 | th.setData({ |
| ... | ... | @@ -67,6 +68,12 @@ Page({ |
| 67 | 68 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); |
| 68 | 69 | }, |
| 69 | 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 | 25 | </view> |
| 26 | 26 | <view class="top_foot data-v-3a5b7e36"> |
| 27 | 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 | 29 | </view> |
| 30 | 30 | <view class="top_foot_qty data-v-3a5b7e36"> |
| 31 | 31 | <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | ... | ... |
pages/user/assistance/task_assistance.js
| ... | ... | @@ -69,6 +69,7 @@ Page({ |
| 69 | 69 | * 生命周期函数--监听页面加载 |
| 70 | 70 | */ |
| 71 | 71 | onLoad: function (options) { |
| 72 | + | |
| 72 | 73 | var th = this; |
| 73 | 74 | var help_id = options.help_id; |
| 74 | 75 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| ... | ... | @@ -135,6 +136,14 @@ Page({ |
| 135 | 136 | * 生命周期函数--监听页面显示 |
| 136 | 137 | */ |
| 137 | 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 | 147 | this.data.is_timer = 1; |
| 139 | 148 | var th = this; |
| 140 | 149 | var help_id = th.data.help_id; | ... | ... |
pages/user/cardinfo/cardinfo.js
| ... | ... | @@ -42,7 +42,8 @@ Page({ |
| 42 | 42 | expiryDate:"",//卡到期时间 |
| 43 | 43 | is_guoqi:0, //卡是不是过期 |
| 44 | 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 | 71 | |
| 71 | 72 | //----------------------------获取最大的卡类----------------------- |
| 72 | 73 | getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { |
| 73 | - | |
| 74 | 74 | }).then(res => { |
| 75 | 75 | var plusCard = res.data.data; |
| 76 | 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 | 80 | for (var i = 0; i < plusCard.length; i++) { |
| 79 | 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 | 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 | 116 | |
| 102 | 117 | }) |
| 103 | 118 | |
| 104 | - | |
| 105 | 119 | //获取用户设备信息,屏幕宽度 |
| 106 | 120 | wx.getSystemInfo({ |
| 107 | 121 | success: res => { |
| ... | ... | @@ -138,12 +152,46 @@ Page({ |
| 138 | 152 | end = Date.parse(end) / 1000; |
| 139 | 153 | var is_guoqi=0; |
| 140 | 154 | if(end<now) is_guoqi=1; |
| 141 | - | |
| 142 | - | |
| 155 | + var cur_card=res.data.data[0]; | |
| 156 | + | |
| 143 | 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 | 203 | }else{ |
| 156 | 204 | ee.setData({ free: 0 }); |
| 157 | 205 | } |
| 158 | - | |
| 159 | 206 | }) |
| 160 | 207 | //-----------会员的卡类------------------- |
| 161 | 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 | 211 | if (user_card.CardImg==""){ |
| 165 | 212 | var index =parseInt(user_card.CorrPrice.replace("Price","")); |
| 166 | 213 | user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1"; |
| 167 | - | |
| 168 | 214 | } |
| 169 | 215 | if (user_card.IsStopBuy==true){ |
| 170 | 216 | this.setData({IsStopBuy:1}) |
| 171 | 217 | } |
| 172 | - | |
| 173 | 218 | |
| 174 | 219 | console.log(user_card,"会员的卡类"); |
| 175 | 220 | ee.setData({user_card: user_card}); |
| ... | ... | @@ -736,9 +781,9 @@ Page({ |
| 736 | 781 | return false; |
| 737 | 782 | } |
| 738 | 783 | |
| 739 | - | |
| 740 | 784 | end_time=ut.format(end_time,'yyyy-MM-dd'); |
| 741 | 785 | var errmsg=""; |
| 786 | + | |
| 742 | 787 | //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- |
| 743 | 788 | await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", |
| 744 | 789 | { data: { storeId: os.stoid,isRenewal:1,endData: end_time,userId:getApp().globalData.user_id} }).then(res => { |
| ... | ... | @@ -746,7 +791,10 @@ Page({ |
| 746 | 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 | 799 | var item = th.data.user_card; |
| 752 | 800 | var req = {}; |
| ... | ... | @@ -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 | 884 | \ No newline at end of file | ... | ... |
pages/user/cardinfo/cardinfo.json
| ... | ... | @@ -2,8 +2,9 @@ |
| 2 | 2 | "usingComponents": { |
| 3 | 3 | "pop_txt": "/components/userqy_pop_up/userqy_pop_up", |
| 4 | 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 | 9 | "navigationBarTitleText": "plus会员" |
| 9 | 10 | } |
| 10 | 11 | \ No newline at end of file | ... | ... |
pages/user/cardinfo/cardinfo.wxml
| ... | ... | @@ -17,8 +17,20 @@ |
| 17 | 17 | <view wx:if="{{!is_guoqi}}" class="fs22 h22" style="margin-top:15rpx">会员将在{{filters.replace_time2(expiryDate)}}到期</view> |
| 18 | 18 | <view wx:else class="fs22 h22" style="margin-top:15rpx">会员已在{{filters.replace_time2(expiryDate)}}过期</view> |
| 19 | 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 | 34 | </view> |
| 23 | 35 | |
| 24 | 36 | <view class="flex-vertical-between xs fs28"> |
| ... | ... | @@ -145,6 +157,30 @@ |
| 145 | 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 | 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 | 188 | \ No newline at end of file | ... | ... |
pages/user/cardinfo/cardinfo.wxss
| ... | ... | @@ -225,4 +225,17 @@ align-items:center; |
| 225 | 225 | |
| 226 | 226 | width: 100%; |
| 227 | 227 | height: 320rpx; |
| 228 | -} | |
| 229 | 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 | 243 | \ No newline at end of file | ... | ... |
pages/user/coupons/coupons.wxml
| ... | ... | @@ -63,7 +63,7 @@ |
| 63 | 63 | <view wx:else> |
| 64 | 64 | <view class="text">有效期:不限</view> |
| 65 | 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 | 67 | </view> |
| 68 | 68 | |
| 69 | 69 | </view> | ... | ... |
pages/user/coupons/query/index.wxml
| ... | ... | @@ -102,7 +102,7 @@ |
| 102 | 102 | <view wx:else> |
| 103 | 103 | <view class="text">有效期: 不限</view> |
| 104 | 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 | 106 | </view> |
| 107 | 107 | </view> |
| 108 | 108 | </view> | ... | ... |
pages/user/index/index.wxml
| 1 | +<import src="../../tabbar/tabbar.wxml" /> | |
| 2 | +<template is="tabBar" data="{{tabBar}}" /> | |
| 3 | + | |
| 1 | 4 | <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}"> |
| 2 | 5 | <view class="xc-user"> |
| 3 | 6 | <view class="xc-head rel"> |
| ... | ... | @@ -297,5 +300,3 @@ |
| 297 | 300 | </view> |
| 298 | 301 | |
| 299 | 302 | <pop_txt id="pop_txt"></pop_txt> |
| 300 | - <import src="../../tabbar/tabbar.wxml" /> | |
| 301 | - <template is="tabBar" data="{{tabBar}}" /> | |
| 302 | 303 | \ No newline at end of file | ... | ... |
pages/user/integral/integral.wxml
| ... | ... | @@ -38,8 +38,8 @@ |
| 38 | 38 | <view class='time'>{{details.BillDate}}</view> |
| 39 | 39 | </view> |
| 40 | 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 | 43 | </view> |
| 44 | 44 | <view style="clear:both"></view> |
| 45 | 45 | </block> | ... | ... |
pages/user/integral/query/index.wxml
| ... | ... | @@ -63,8 +63,8 @@ |
| 63 | 63 | <view class='time'>{{details.BillDate}}</view> |
| 64 | 64 | </view> |
| 65 | 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 | 68 | </view> |
| 69 | 69 | </block> |
| 70 | 70 | ... | ... |
pages/user/plus/plus.js
utils/pay2.js
| ... | ... | @@ -8,7 +8,11 @@ module.exports = { |
| 8 | 8 | data: dd, |
| 9 | 9 | success: function(t) { |
| 10 | 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 | 16 | }else{ |
| 13 | 17 | "function" == typeof fail && fail(); |
| 14 | 18 | } | ... | ... |
utils/util.js
| ... | ... | @@ -401,6 +401,15 @@ function base64_encode (str) { // 编码,配合encodeURIComponent使用 |
| 401 | 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 | 413 | module.exports = { |
| 405 | 414 | formatTime: function(e, r) { |
| 406 | 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 | 514 | draw_circle:draw_circle,//绘制圆, |
| 506 | 515 | mergeArray:mergeArray, //数组合并 |
| 507 | 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 | 377 | </view> |
| 378 | 378 | </template> |
| 379 | 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 | 381 | </template> |
| 382 | 382 | <template name="wxParseVideo"> |
| 383 | 383 | <view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}"> | ... | ... |