Commit 140515e532944f259fe7429d501d9984d90b96ee
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
11 changed files
with
113 additions
and
67 deletions
app.js
... | ... | @@ -50,7 +50,7 @@ App({ |
50 | 50 | config: null, //门店参数 |
51 | 51 | config2: null, //门店配置 |
52 | 52 | code: null, |
53 | - user_id:null,// 6519870,//5682094, | |
53 | + user_id:null,//1564704,// 10153869,// 6453964,//5682094, | |
54 | 54 | buy_now:null, |
55 | 55 | picklist:null, //门店列表 |
56 | 56 | wuliuprice: null, //物流价格表 |
... | ... | @@ -78,6 +78,10 @@ App({ |
78 | 78 | onLaunch: function() { |
79 | 79 | wx.hideTabBar(); |
80 | 80 | this.initExt(); |
81 | + | |
82 | + //检查更新 | |
83 | + this.checkUpdateVersion(); | |
84 | + | |
81 | 85 | var t = this.globalData.setting; |
82 | 86 | //console.log(t) |
83 | 87 | t.resourceUrl = t.url + "/template/mobile/rainbow"; |
... | ... | @@ -665,6 +669,7 @@ App({ |
665 | 669 | this.globalData.dis_buy_obj=null; //等级卡的购买记录 |
666 | 670 | this.globalData.storeFooter=null; //底部的导航 |
667 | 671 | this.globalData.full_screen=null; //全屏 |
672 | + | |
668 | 673 | }, |
669 | 674 | |
670 | 675 | clear_word:function (word) { |
... | ... | @@ -767,6 +772,42 @@ App({ |
767 | 772 | }, |
768 | 773 | |
769 | 774 | |
775 | + checkUpdateVersion() { | |
776 | + //判断微信版本是否 兼容小程序更新机制API的使用 | |
777 | + if (wx.canIUse('getUpdateManager')) { | |
778 | + //创建 UpdateManager 实例 | |
779 | + const updateManager = wx.getUpdateManager(); | |
780 | + console.log('是否进入模拟更新'); | |
781 | + //检测版本更新 | |
782 | + updateManager.onCheckForUpdate(function(res) { | |
783 | + console.log('是否获取版本'); | |
784 | + // 请求完新版本信息的回调 | |
785 | + if (res.hasUpdate) { | |
786 | + //监听小程序有版本更新事件 | |
787 | + updateManager.onUpdateReady(function() { | |
788 | + | |
789 | + //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作) | |
790 | + updateManager.applyUpdate(); | |
791 | + }) | |
792 | + updateManager.onUpdateFailed(function() { | |
793 | + // 新版本下载失败 | |
794 | + wx.showModal({ | |
795 | + title: '已经有新版本喽~', | |
796 | + content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开哦~', | |
797 | + }) | |
798 | + }) | |
799 | + } | |
800 | + }) | |
801 | + } else { | |
802 | + //TODO 此时微信版本太低(一般而言版本都是支持的) | |
803 | + wx.showModal({ | |
804 | + title: '溫馨提示', | |
805 | + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' | |
806 | + }) | |
807 | + } | |
808 | + }, | |
809 | + | |
810 | + | |
770 | 811 | |
771 | 812 | |
772 | 813 | ... | ... |
packageA/pages/quan_pro/quan_pro.wxml
... | ... | @@ -16,9 +16,9 @@ |
16 | 16 | <view class="fs30 flex" wx:if="{{q_data}}" style="height: 100rpx;justify-content: space-between;"> |
17 | 17 | <view class="flex ai-center"> |
18 | 18 | <view class="t_circle"></view> |
19 | - <view> | |
19 | + <view class="ellipsis-2" style="width: 400rpx;"> | |
20 | 20 | <text wx:if="{{q_data.useobjecttype==0}}">全场通用</text> |
21 | - <text wx:else>仅限{{q_data.useobjectname}}使用</text> | |
21 | + <text wx:else >仅限{{q_data.useobjectname}}使用</text> | |
22 | 22 | </view> |
23 | 23 | </view> |
24 | 24 | <view> | ... | ... |
packageA/pages/quan_pro/quan_pro.wxss
... | ... | @@ -10,7 +10,7 @@ page{background-color: #f8f8f8;} |
10 | 10 | .q_content{ position: absolute;top: 0; left: 0; width: calc(100% - 40rpx); height: 450rpx;padding: 0 20rpx; } |
11 | 11 | .upper{ height:330rpx;} |
12 | 12 | .lower{ height: 120rpx; line-height: 170rpx;color:#7a668f} |
13 | -.quan_box {display: flex;flex-direction: column;justify-content: flex-start; box-sizing: border-box;} | |
13 | +.quan_box {display: flex;flex-direction: column; box-sizing: border-box;} | |
14 | 14 | .upper .left{ margin-left:30rpx; margin-top: 30rpx } |
15 | 15 | .t_circle{ width: 10rpx; height: 10rpx; border-radius: 50%; background-color: #fff; margin-right: 8rpx} |
16 | 16 | |
... | ... | @@ -27,5 +27,5 @@ page{background-color: #f8f8f8;} |
27 | 27 | } |
28 | 28 | |
29 | 29 | .btn.gray{background-color: #dcdcdc; color: #adb3be;} |
30 | -.coupon_remark{padding: 20rpx 0; box-sizing: border-box; overflow: hidden;} | |
30 | +.coupon_remark{padding: 30rpx 0 10rpx 0; box-sizing: border-box; overflow: hidden;} | |
31 | 31 | ... | ... |
packageB/pages/zuhegou/index/index.js
... | ... | @@ -1017,12 +1017,12 @@ Page({ |
1017 | 1017 | if (th.data.c_guide_id) { |
1018 | 1018 | newd['guide_id'] = th.data.c_guide_id; |
1019 | 1019 | newd['guide_type'] = 2; |
1020 | - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; | |
1020 | + newd['guide_type'] = 3; | |
1021 | 1021 | } else { |
1022 | 1022 | if (getApp().globalData.guide_id) { |
1023 | 1023 | newd['guide_id'] = getApp().globalData.guide_id; |
1024 | 1024 | newd['guide_type'] = 0; |
1025 | - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; | |
1025 | + newd['guide_type'] = 1; | |
1026 | 1026 | } |
1027 | 1027 | } |
1028 | 1028 | |
... | ... | @@ -1990,11 +1990,12 @@ Page({ |
1990 | 1990 | // be=be-bz_num_ok; |
1991 | 1991 | if(num % vv.zhqty == 0){ |
1992 | 1992 | be=num/vv.zhqty; |
1993 | - bz_num_ok=num; | |
1993 | + // bz_num_ok=num; | |
1994 | 1994 | }else{ |
1995 | 1995 | be = Math.floor(num/vv.zhqty) |
1996 | - bz_num_ok=num - (be * vv.zhqty); | |
1996 | + // bz_num_ok=be * vv.zhqty ; | |
1997 | 1997 | } |
1998 | + bz_num_ok=be * vv.zhqty ; | |
1998 | 1999 | } |
1999 | 2000 | for(let i=0;i<zhqty_bz.length;i++){ |
2000 | 2001 | var vv=zhqty_bz[i]; |
... | ... | @@ -2024,13 +2025,13 @@ Page({ |
2024 | 2025 | // be=be-bz_num_ok; |
2025 | 2026 | if(num % vv.zhqty == 0){ |
2026 | 2027 | be=num/vv.zhqty; |
2027 | - bz_num_ok=num; | |
2028 | + // bz_num_ok=num; | |
2028 | 2029 | }else{ |
2029 | 2030 | be = Math.floor(num/vv.zhqty) |
2030 | - bz_num_ok=num - (be * vv.zhqty); | |
2031 | + // bz_num_ok=be * vv.zhqty; | |
2031 | 2032 | } |
2033 | + bz_num_ok=be * vv.zhqty; | |
2032 | 2034 | } |
2033 | - // be=vv.num; | |
2034 | 2035 | for(let j=0;j<bz_num_ok;j++){ |
2035 | 2036 | let index= no_in_arr.findIndex(i=>{ |
2036 | 2037 | return vv.goods_id===i.goods_id | ... | ... |
packageB/pages/zuhegou/list/list.js
pages/activity/pind_list/pind_list.js
... | ... | @@ -61,7 +61,12 @@ Page({ |
61 | 61 | }); |
62 | 62 | } |
63 | 63 | }) |
64 | - | |
64 | + // var user_id=getApp().globalData.user_id; | |
65 | + // if(!user_id) user_id=0; | |
66 | + // this.setData({ | |
67 | + // user_id, | |
68 | + // }) | |
69 | + this.requestSalelist(); | |
65 | 70 | }, |
66 | 71 | |
67 | 72 | onShow: function (t) { |
... | ... | @@ -69,13 +74,15 @@ Page({ |
69 | 74 | this.data.currentPage = 1; |
70 | 75 | this.data.ismore = 1; |
71 | 76 | var th = this; |
72 | - var userInfo = wx.getStorageSync('userinfo'); | |
73 | - if (userInfo && th.data.goodlist.length==0) { | |
74 | - //调用列表 | |
75 | - this.requestSalelist(userInfo.user_id); | |
76 | - } else { | |
77 | - getApp().goto("/pages/togoin/togoin"); | |
78 | - } | |
77 | + // var userInfo = wx.getStorageSync('userinfo'); | |
78 | + // if (userInfo) { | |
79 | + // //调用列表 | |
80 | + // this.requestSalelist(userInfo.user_id); | |
81 | + // } else { | |
82 | + // getApp().goto("/pages/togoin/togoin"); | |
83 | + // } | |
84 | + | |
85 | + | |
79 | 86 | //设置全局定时器 |
80 | 87 | th.data.timer = setInterval(function () { |
81 | 88 | th.countDown(); |
... | ... | @@ -129,7 +136,7 @@ Page({ |
129 | 136 | }, |
130 | 137 | |
131 | 138 | //读取数据 |
132 | - async requestSalelist(user_id) { | |
139 | + async requestSalelist() { | |
133 | 140 | if (!this.data.ismore) return false; |
134 | 141 | var e = this, |
135 | 142 | th = e, |
... | ... | @@ -143,7 +150,7 @@ Page({ |
143 | 150 | store_id: os.stoid, |
144 | 151 | is_end: 0, |
145 | 152 | is_show: 1, |
146 | - user_id, | |
153 | + user_id:getApp().globalData.user_id, | |
147 | 154 | } |
148 | 155 | }).then(res => { |
149 | 156 | plist = res.data.data.pageData; |
... | ... | @@ -178,7 +185,7 @@ Page({ |
178 | 185 | this.reloadGoodList(); |
179 | 186 | }, |
180 | 187 | reloadGoodList: function () { |
181 | - this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist(); | |
188 | + this.data.goodlist = [], this.data.currentPage = 1, this.requestSalelist(); | |
182 | 189 | }, |
183 | 190 | onReachBottom: function () { |
184 | 191 | this.requestSalelist(); | ... | ... |
pages/activity/seckill_list/seckill_list.js
pages/cart/cart2/cart2.js
... | ... | @@ -1542,7 +1542,7 @@ Page({ |
1542 | 1542 | cart_item.shipping_price = 0; |
1543 | 1543 | |
1544 | 1544 | //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- |
1545 | - if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) && out_of_weight > 0) { | |
1545 | + if (no_ex_id && freight_free > 0 && (o_price - quan_price) >= freight_free && cart_item.exp_type == 0 && (by_qc.region_list || by_qc.goods_list) && out_of_weight >= 0) { | |
1546 | 1546 | //如果有设置不包邮区域的时候 |
1547 | 1547 | if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { |
1548 | 1548 | if (th.check_by_area(by_qc.region_list)) { |
... | ... | @@ -2481,8 +2481,8 @@ Page({ |
2481 | 2481 | //调用接口判断是不是会员 |
2482 | 2482 | await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { |
2483 | 2483 | if (res.data.code == 0) { |
2484 | - g_goods.guide_name = is_vip.salesman; | |
2485 | - g_goods.guide_sn = is_vip.salesman_no; | |
2484 | + g_goods.guide_name = res.data.salesman; | |
2485 | + g_goods.guide_sn = res.data.salesman_no; | |
2486 | 2486 | } |
2487 | 2487 | }) |
2488 | 2488 | } |
... | ... | @@ -3037,7 +3037,7 @@ Page({ |
3037 | 3037 | var price = 0, th = this; |
3038 | 3038 | price += parseFloat(o_shipping_price); |
3039 | 3039 | //如果是包邮 |
3040 | - if (freight_free > 0 && o_price >= freight_free && out_of_weight>0) { | |
3040 | + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0) { | |
3041 | 3041 | return 0; |
3042 | 3042 | } |
3043 | 3043 | if (user_addr == null) { |
... | ... | @@ -3067,8 +3067,13 @@ Page({ |
3067 | 3067 | if(out_of_weight < 0){ |
3068 | 3068 | fw_price = parseFloat(item['money']); |
3069 | 3069 | var out_of_weight = Math.abs(out_of_weight); |
3070 | - var n = Math.ceil(out_of_weight / item['second_weight']) | |
3071 | - fw_price = fw_price + n * parseFloat(item['add_money']); | |
3070 | + // var n = Math.ceil(out_of_weight / item['second_weight']) | |
3071 | + // fw_price = fw_price + n * parseFloat(item['add_money']); | |
3072 | + if (out_of_weight > item['first_weight']) { | |
3073 | + var fw = out_of_weight - item['first_weight']; | |
3074 | + var n = Math.ceil(fw / item['second_weight']) | |
3075 | + fw_price = fw_price + n * parseFloat(item['add_money']); | |
3076 | + } | |
3072 | 3077 | } |
3073 | 3078 | //------按件数---------- |
3074 | 3079 | if (goods_piece > 0 && item['piecemoney']) { | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -3439,7 +3439,7 @@ Page({ |
3439 | 3439 | return false |
3440 | 3440 | } |
3441 | 3441 | |
3442 | - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ | |
3442 | + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2",{ | |
3443 | 3443 | data:{ |
3444 | 3444 | store_id: os.stoid, |
3445 | 3445 | is_end: 0, | ... | ... |
pages/team/team_show/team_show.js
... | ... | @@ -433,11 +433,36 @@ Page({ |
433 | 433 | //获取活动表的信息根据活动team_id |
434 | 434 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, { |
435 | 435 | data: {} |
436 | - }).then(res => { | |
436 | + }).then(async res => { | |
437 | + var flag=null; | |
437 | 438 | if (res.data.code == 0) { |
438 | 439 | teamlist = res.data.data; |
439 | 440 | goods_id = res.data.data.goods_id; |
440 | 441 | |
442 | + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ | |
443 | + data:{ | |
444 | + store_id: os.stoid, | |
445 | + is_end: 0, | |
446 | + is_show: 1, | |
447 | + user_id: getApp().globalData.user_id, | |
448 | + pageSize:1000 | |
449 | + } | |
450 | + }).then(res=>{ | |
451 | + let pd_list=res.data.data.pageData; | |
452 | + if(res.data.code==0 && pd_list.length>0){ | |
453 | + flag =pd_list.some(pd=>{ | |
454 | + return pd.goods_id==teamlist['goods_id'] | |
455 | + }) | |
456 | + } | |
457 | + }) | |
458 | + if(!flag){ | |
459 | + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); | |
460 | + // setTimeout(function () { | |
461 | + ut.wx_back(); | |
462 | + // }, 2000) | |
463 | + return false; | |
464 | + } | |
465 | + | |
441 | 466 | //----------查看阶梯团------------ |
442 | 467 | if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) { |
443 | 468 | var ct_rylist = JSON.parse(teamlist.ct_rylist); | ... | ... |
pages/team/team_success/team_success.js
... | ... | @@ -182,40 +182,8 @@ Page({ |
182 | 182 | //获取活动表的信息根据活动pt_prom_id |
183 | 183 | await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { |
184 | 184 | data: { } |
185 | - }).then(async res => { | |
186 | - var flag=null; | |
187 | - if (res.data.code==0){ | |
188 | - teamlist = res.data.data; | |
189 | - this.setData({teamlist: teamlist}); | |
190 | - //获取当前时间,并且判断剩余时间 | |
191 | - var nt = ut.gettimestamp(); | |
192 | - teamlist.status = 0; | |
193 | - | |
194 | - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ | |
195 | - data:{ | |
196 | - store_id: os.stoid, | |
197 | - is_end: 0, | |
198 | - is_show: 1, | |
199 | - user_id: getApp().globalData.user_id, | |
200 | - pageSize:1000 | |
201 | - } | |
202 | - }).then(res=>{ | |
203 | - let pd_list=res.data.data.pageData; | |
204 | - if(res.data.code==0 && pd_list.length>0){ | |
205 | - flag =pd_list.some(pd=>{ | |
206 | - return pd.goods_id==teamlist['goods_id'] | |
207 | - }) | |
208 | - } | |
209 | - }) | |
210 | - if(!flag){ | |
211 | - wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); | |
212 | - setTimeout(function () { | |
213 | - ut.wx_back(); | |
214 | - }, 2000) | |
215 | - return false; | |
216 | - } | |
185 | + }).then(res => { | |
217 | 186 | if (nt >= teamlist.start_time) teamlist.status = 1; |
218 | - | |
219 | 187 | goods_id = res.data.data.goods_id; |
220 | 188 | id = res.data.data.id; |
221 | 189 | share_img = ee.data.imageurl + res.data.data.share_imgurl; |
... | ... | @@ -856,7 +824,7 @@ Page({ |
856 | 824 | if(th.data.teamlist.share_title){ |
857 | 825 | share_title=th.data.teamlist.share_title; |
858 | 826 | } |
859 | - | |
827 | + console.log(url,3000); | |
860 | 828 | return { |
861 | 829 | path:url, |
862 | 830 | title: share_title, | ... | ... |