diff --git a/app.js b/app.js index 3ba33ea..ee1bf0a 100644 --- a/app.js +++ b/app.js @@ -50,7 +50,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - user_id:null,// 6519870,//5682094, + user_id:null,//1564704,// 10153869,// 6453964,//5682094, buy_now:null, picklist:null, //门店列表 wuliuprice: null, //物流价格表 @@ -78,6 +78,10 @@ App({ onLaunch: function() { wx.hideTabBar(); this.initExt(); + + //检查更新 + this.checkUpdateVersion(); + var t = this.globalData.setting; //console.log(t) t.resourceUrl = t.url + "/template/mobile/rainbow"; @@ -665,6 +669,7 @@ App({ this.globalData.dis_buy_obj=null; //等级卡的购买记录 this.globalData.storeFooter=null; //底部的导航 this.globalData.full_screen=null; //全屏 + }, clear_word:function (word) { @@ -767,6 +772,42 @@ App({ }, + checkUpdateVersion() { + //判断微信版本是否 兼容小程序更新机制API的使用 + if (wx.canIUse('getUpdateManager')) { + //创建 UpdateManager 实例 + const updateManager = wx.getUpdateManager(); + console.log('是否进入模拟更新'); + //检测版本更新 + updateManager.onCheckForUpdate(function(res) { + console.log('是否获取版本'); + // 请求完新版本信息的回调 + if (res.hasUpdate) { + //监听小程序有版本更新事件 + updateManager.onUpdateReady(function() { + + //TODO 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 ( 此处进行了自动更新操作) + updateManager.applyUpdate(); + }) + updateManager.onUpdateFailed(function() { + // 新版本下载失败 + wx.showModal({ + title: '已经有新版本喽~', + content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开哦~', + }) + }) + } + }) + } else { + //TODO 此时微信版本太低(一般而言版本都是支持的) + wx.showModal({ + title: '溫馨提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' + }) + } + }, + + diff --git a/packageA/pages/quan_pro/quan_pro.wxml b/packageA/pages/quan_pro/quan_pro.wxml index fba5ff8..0c6bfa6 100644 --- a/packageA/pages/quan_pro/quan_pro.wxml +++ b/packageA/pages/quan_pro/quan_pro.wxml @@ -16,9 +16,9 @@ - + 全场通用 - 仅限{{q_data.useobjectname}}使用 + 仅限{{q_data.useobjectname}}使用 diff --git a/packageA/pages/quan_pro/quan_pro.wxss b/packageA/pages/quan_pro/quan_pro.wxss index 5a8df64..fcd20cb 100644 --- a/packageA/pages/quan_pro/quan_pro.wxss +++ b/packageA/pages/quan_pro/quan_pro.wxss @@ -10,7 +10,7 @@ page{background-color: #f8f8f8;} .q_content{ position: absolute;top: 0; left: 0; width: calc(100% - 40rpx); height: 450rpx;padding: 0 20rpx; } .upper{ height:330rpx;} .lower{ height: 120rpx; line-height: 170rpx;color:#7a668f} -.quan_box {display: flex;flex-direction: column;justify-content: flex-start; box-sizing: border-box;} +.quan_box {display: flex;flex-direction: column; box-sizing: border-box;} .upper .left{ margin-left:30rpx; margin-top: 30rpx } .t_circle{ width: 10rpx; height: 10rpx; border-radius: 50%; background-color: #fff; margin-right: 8rpx} @@ -27,5 +27,5 @@ page{background-color: #f8f8f8;} } .btn.gray{background-color: #dcdcdc; color: #adb3be;} -.coupon_remark{padding: 20rpx 0; box-sizing: border-box; overflow: hidden;} +.coupon_remark{padding: 30rpx 0 10rpx 0; box-sizing: border-box; overflow: hidden;} diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index fd36d68..6293095 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -1017,12 +1017,12 @@ Page({ if (th.data.c_guide_id) { newd['guide_id'] = th.data.c_guide_id; newd['guide_type'] = 2; - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; + newd['guide_type'] = 3; } else { if (getApp().globalData.guide_id) { newd['guide_id'] = getApp().globalData.guide_id; newd['guide_type'] = 0; - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; + newd['guide_type'] = 1; } } @@ -1990,11 +1990,12 @@ Page({ // be=be-bz_num_ok; if(num % vv.zhqty == 0){ be=num/vv.zhqty; - bz_num_ok=num; + // bz_num_ok=num; }else{ be = Math.floor(num/vv.zhqty) - bz_num_ok=num - (be * vv.zhqty); + // bz_num_ok=be * vv.zhqty ; } + bz_num_ok=be * vv.zhqty ; } for(let i=0;i{ return vv.goods_id===i.goods_id diff --git a/packageB/pages/zuhegou/list/list.js b/packageB/pages/zuhegou/list/list.js index 662d908..a9a7bd2 100644 --- a/packageB/pages/zuhegou/list/list.js +++ b/packageB/pages/zuhegou/list/list.js @@ -137,7 +137,7 @@ Page({ isShowLoading:1, data:{ store_id: os.stoid, - user_id: getApp().globalData.user_id + user_id: getApp().globalData.user_id, } }) if(res.code==0 && res.data.pageData.length>0){ diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index 18c2377..e6c1775 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -61,7 +61,12 @@ Page({ }); } }) - + // var user_id=getApp().globalData.user_id; + // if(!user_id) user_id=0; + // this.setData({ + // user_id, + // }) + this.requestSalelist(); }, onShow: function (t) { @@ -69,13 +74,15 @@ Page({ this.data.currentPage = 1; this.data.ismore = 1; var th = this; - var userInfo = wx.getStorageSync('userinfo'); - if (userInfo && th.data.goodlist.length==0) { - //调用列表 - this.requestSalelist(userInfo.user_id); - } else { - getApp().goto("/pages/togoin/togoin"); - } + // var userInfo = wx.getStorageSync('userinfo'); + // if (userInfo) { + // //调用列表 + // this.requestSalelist(userInfo.user_id); + // } else { + // getApp().goto("/pages/togoin/togoin"); + // } + + //设置全局定时器 th.data.timer = setInterval(function () { th.countDown(); @@ -129,7 +136,7 @@ Page({ }, //读取数据 - async requestSalelist(user_id) { + async requestSalelist() { if (!this.data.ismore) return false; var e = this, th = e, @@ -143,7 +150,7 @@ Page({ store_id: os.stoid, is_end: 0, is_show: 1, - user_id, + user_id:getApp().globalData.user_id, } }).then(res => { plist = res.data.data.pageData; @@ -178,7 +185,7 @@ Page({ this.reloadGoodList(); }, reloadGoodList: function () { - this.data.goodlist = null, this.data.currentPage = 1, this.requestSalelist(); + this.data.goodlist = [], this.data.currentPage = 1, this.requestSalelist(); }, onReachBottom: function () { this.requestSalelist(); diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index ff9b74b..93b06b0 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -73,7 +73,6 @@ Page({ onShow: function (t) { - this.data.ismore = 1; this.data.is_timer = 1; this.data.currentPage = 1; var th = this; diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 81f1105..f414b42 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1542,7 +1542,7 @@ Page({ cart_item.shipping_price = 0; //--有不包邮区域,且不免运费,全场的计算,要减到优惠金额 和券的金额-- - 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) { + 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) { //如果有设置不包邮区域的时候 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { if (th.check_by_area(by_qc.region_list)) { @@ -2481,8 +2481,8 @@ Page({ //调用接口判断是不是会员 await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { if (res.data.code == 0) { - g_goods.guide_name = is_vip.salesman; - g_goods.guide_sn = is_vip.salesman_no; + g_goods.guide_name = res.data.salesman; + g_goods.guide_sn = res.data.salesman_no; } }) } @@ -3037,7 +3037,7 @@ Page({ var price = 0, th = this; price += parseFloat(o_shipping_price); //如果是包邮 - if (freight_free > 0 && o_price >= freight_free && out_of_weight>0) { + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0) { return 0; } if (user_addr == null) { @@ -3067,8 +3067,13 @@ Page({ if(out_of_weight < 0){ fw_price = parseFloat(item['money']); var out_of_weight = Math.abs(out_of_weight); - var n = Math.ceil(out_of_weight / item['second_weight']) - fw_price = fw_price + n * parseFloat(item['add_money']); + // var n = Math.ceil(out_of_weight / item['second_weight']) + // fw_price = fw_price + n * parseFloat(item['add_money']); + if (out_of_weight > item['first_weight']) { + var fw = out_of_weight - item['first_weight']; + var n = Math.ceil(fw / item['second_weight']) + fw_price = fw_price + n * parseFloat(item['add_money']); + } } //------按件数---------- if (goods_piece > 0 && item['piecemoney']) { diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index c6b12d9..101635a 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -3439,7 +3439,7 @@ Page({ return false } - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2",{ data:{ store_id: os.stoid, is_end: 0, diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js index 4e3f654..110ef29 100644 --- a/pages/team/team_show/team_show.js +++ b/pages/team/team_show/team_show.js @@ -433,11 +433,36 @@ Page({ //获取活动表的信息根据活动team_id await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, { data: {} - }).then(res => { + }).then(async res => { + var flag=null; if (res.data.code == 0) { teamlist = res.data.data; goods_id = res.data.data.goods_id; + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ + data:{ + store_id: os.stoid, + is_end: 0, + is_show: 1, + user_id: getApp().globalData.user_id, + pageSize:1000 + } + }).then(res=>{ + let pd_list=res.data.data.pageData; + if(res.data.code==0 && pd_list.length>0){ + flag =pd_list.some(pd=>{ + return pd.goods_id==teamlist['goods_id'] + }) + } + }) + if(!flag){ + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); + // setTimeout(function () { + ut.wx_back(); + // }, 2000) + return false; + } + //----------查看阶梯团------------ if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) { var ct_rylist = JSON.parse(teamlist.ct_rylist); diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index a14f4ae..39da0c5 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -182,40 +182,8 @@ Page({ //获取活动表的信息根据活动pt_prom_id await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, { data: { } - }).then(async res => { - var flag=null; - if (res.data.code==0){ - teamlist = res.data.data; - this.setData({teamlist: teamlist}); - //获取当前时间,并且判断剩余时间 - var nt = ut.gettimestamp(); - teamlist.status = 0; - - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{ - data:{ - store_id: os.stoid, - is_end: 0, - is_show: 1, - user_id: getApp().globalData.user_id, - pageSize:1000 - } - }).then(res=>{ - let pd_list=res.data.data.pageData; - if(res.data.code==0 && pd_list.length>0){ - flag =pd_list.some(pd=>{ - return pd.goods_id==teamlist['goods_id'] - }) - } - }) - if(!flag){ - wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000}); - setTimeout(function () { - ut.wx_back(); - }, 2000) - return false; - } + }).then(res => { if (nt >= teamlist.start_time) teamlist.status = 1; - goods_id = res.data.data.goods_id; id = res.data.data.id; share_img = ee.data.imageurl + res.data.data.share_imgurl; @@ -856,7 +824,7 @@ Page({ if(th.data.teamlist.share_title){ share_title=th.data.teamlist.share_title; } - + console.log(url,3000); return { path:url, title: share_title,