diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.js b/packageB/pages/luckactivity/luckinfo/luckinfo.js index b4d65f6..a3962aa 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.js +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.js @@ -1356,6 +1356,12 @@ Page({ url = `/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&orderSn=${ordersn}&lbId=${buyreceive_id}`; break; }; + //-- 每月礼包的优化,去列表领取 -- + case 7: { + url = `/packageE/pages/user/monthgiftbag/monthgiftbag`; + break; + }; + }; app.goto(url); }, diff --git a/packageD/pages/user/deposit/prepaid/msg/msg.js b/packageD/pages/user/deposit/prepaid/msg/msg.js index 96a717e..8888876 100644 --- a/packageD/pages/user/deposit/prepaid/msg/msg.js +++ b/packageD/pages/user/deposit/prepaid/msg/msg.js @@ -9,6 +9,7 @@ Page({ // timer: '',//定时器名字 // countDownNum: '3'//倒计时初始值 iurl: o.imghost, + is_nd_pw:0 }, @@ -16,7 +17,11 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + + if(options.is_nd_pw){ + this.data.is_nd_pw=options.is_nd_pw; + } + }, /** @@ -30,37 +35,43 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - getApp().check_can_share(); - wx.setNavigationBarTitle({ - title: "支付成功", - }) + getApp().check_can_share(); + wx.setNavigationBarTitle({ + title: "支付成功", + }) + + let th=this; + //判断密码是不是有开始 + if(this.data.is_nd_pw){ + getApp().request.get("/api/weshop/users/getAndUpdateUser/" + os.stoid + "/" + getApp().globalData.user_id, { + success: function (src) { + var a = src.data.data; + if(!a.vipnopwd) { + + var my_confirm = th.selectComponent("#my_confirm"); //组件的id + my_confirm.open( + "是否启用消费时密码验证?", + "否", + "是", + function () { + my_confirm.open_cancel(0); + }, + function () { + let url = '/pages/user/userinfo/userinfo?isstcsp=1'; + wx.redirectTo({url: url,}) //跳到非tabbar页 + } + ); + } + + } + }) + } + + + }, - // countDown: function () { - // let that = this; - // let countDownNum = that.data.countDownNum;//获取倒计时初始值 - // //如果将定时器设置在外面,那么用户就看不到countDownNum的数值动态变化,所以要把定时器存进data里面 - // that.setData({ - // timer: setInterval(function () {//这里把setInterval赋值给变量名为timer的变量 - // //每隔一秒countDownNum就减一,实现同步 - // countDownNum--; - // //然后把countDownNum存进data,好让用户知道时间在倒计着 - // that.setData({ - // countDownNum: countDownNum - // }) - // //在倒计时还未到0时,这中间可以做其他的事情,按项目需求来 - // if (countDownNum == 0) { - // //这里特别要注意,计时器是始终一直在走的,如果你的时间为0,那么就要关掉定时器!不然相当耗性能 - // //因为timer是存在data里面的,所以在关掉时,也要在data里取出后再关闭 - // clearInterval(that.data.timer); - // //关闭定时器之后,可作其他处理codes go here - // //--跳到绑定页面-- - // wx.navigateTo({ - // url: '../../../integral/jf', - // }) - // } - // }, 500) - // }) - + + click:function(){ wx.redirectTo({ //url: '../../../integral/jf', diff --git a/packageD/pages/user/deposit/prepaid/msg/msg.json b/packageD/pages/user/deposit/prepaid/msg/msg.json index 8835af0..ff7d662 100644 --- a/packageD/pages/user/deposit/prepaid/msg/msg.json +++ b/packageD/pages/user/deposit/prepaid/msg/msg.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents": {}, + "usingComponents": { + "my_confirm": "/components/my_confirm/my_confirm" + } } \ No newline at end of file diff --git a/packageD/pages/user/deposit/prepaid/msg/msg.wxml b/packageD/pages/user/deposit/prepaid/msg/msg.wxml index 819e186..81ea55e 100644 --- a/packageD/pages/user/deposit/prepaid/msg/msg.wxml +++ b/packageD/pages/user/deposit/prepaid/msg/msg.wxml @@ -10,3 +10,4 @@ 返回首页 + \ No newline at end of file diff --git a/packageD/pages/user/deposit/prepaid/prepaid.js b/packageD/pages/user/deposit/prepaid/prepaid.js index 4b97d93..f484102 100644 --- a/packageD/pages/user/deposit/prepaid/prepaid.js +++ b/packageD/pages/user/deposit/prepaid/prepaid.js @@ -183,8 +183,8 @@ Page({ var buynum = 1; console.log(money, "有进来吗预存劵", advancek, user_id, store_id ); - var e = this, - perpaid = ""; + var e = this, perpaid = ""; + let th=this; await getApp().request.promiseGet("/api/weshop/users/getPay", { data: { account: money, @@ -220,7 +220,7 @@ Page({ e.jumpPaymentPage(); }, function (e) { - this.data.paying=0; + th.data.paying=0; wx.showToast({ title: e, icon: 'none', @@ -248,10 +248,11 @@ Page({ // }) }) }, + //------支付成功页面-------- jumpPaymentPage: function () { wx.redirectTo({ - url:"msg/msg", + url:"msg/msg?is_nd_pw=1", }); }, diff --git a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml index 236948d..f3e7128 100644 --- a/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml +++ b/packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml @@ -34,18 +34,25 @@ {{items.giftTitle}} - - {{"¥"+items.payMoney}} + + {{"¥"+items.payMoney}}+{{items.payIntegral}}积分 - - / - - - - {{items.payIntegral}} - 积分 - + + + {{"¥"+items.payMoney}} + + + / + + + + {{items.payIntegral}} + 积分 + + + + {{"零售价:¥"+items.giftPosPrice}} @@ -69,17 +76,10 @@ - - - + + - - - - - - diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js index 85fbbe5..1cb22f3 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js @@ -99,11 +99,56 @@ Page({ } + var th = this; + this.setData({ + getUserID: d.user_id, + getStorageID: a.stoid, + }) + + if(!options.lbId && options.scene){ + var gid_str = decodeURIComponent(options.scene); + gid_str = gid_str.split("_"); + options.lbId=gid_str[0]; + options.id=gid_str[0]; + options.first_leader=gid_str[1]; + options.isBuy=1; + } + this.setData({ params: options, getGiftID:options.id }) + + this.setData({ + isBuy: options.isBuy, + getGiftID: options.lbId, + orderSn: options.orderSn, + flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 + record_list_id:options.record_list_id, + is_receive:options.is_receive + }) + if (options.lbId) th.data.lbId = options.lbId; + //-- 获取分享人的ID -- + var first_leader = options.first_leader || getApp().globalData.first_leader; + if (first_leader) { + this.setData({ + first_leader, + }) + //-- user_id代过来免登录 -- + getApp().globalData.first_leader = first_leader; + //调用接口判断是不是会员 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { + if (res.data.code == 0) { + getApp().globalData.guide_id = res.data.data.id; + getApp().globalData.guide_pick_id= res.data.data.pickup_id + } + }) + } + th.close(); + + + getApp().getConfig(function (e) { th.setData({sto_sele_name_1: e.store_name}) }) @@ -148,7 +193,7 @@ Page({ // sele_g:monthgiftbag, // def_pick_store:monthgiftba_defpick // }) -   let scene = wx.getLaunchOptionsSync().scene; + let scene=wx.getLaunchOptionsSync().scene; if (scene==1154) { this.setData({ scene @@ -157,50 +202,8 @@ Page({ } }, init() { - let options = this.data?.params; // this.data == null ? undefined:this.data.params - var th = this; - this.setData({ - getUserID: d.user_id, - getStorageID: a.stoid, - }) - - if(!options.lbId && options.scene){ - var gid_str = decodeURIComponent(options.scene); - gid_str = gid_str.split("_"); - - options.lbId=gid_str[0]; - options.first_leader=gid_str[1]; - options.isBuy=1; - } - - this.setData({ - isBuy: options.isBuy, - getGiftID: options.lbId, - orderSn: options.orderSn, - flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 - record_list_id:options.record_list_id, - is_receive:options.is_receive - }) - if (options.lbId) th.data.lbId = options.lbId; - //-- 获取分享人的ID -- - var first_leader = options.first_leader || getApp().globalData.first_leader; - if (first_leader) { - this.setData({ - first_leader, - }) - //-- user_id代过来免登录 -- - getApp().globalData.first_leader = first_leader; - //调用接口判断是不是会员 - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { - if (res.data.code == 0) { - getApp().globalData.guide_id = res.data.data.id; - getApp().globalData.guide_pick_id= res.data.data.pickup_id - } - }) - } - th.close(); - + var th=this; //-- 检测一下有没有门店 -- th.check_guide(function (){ com.wait_for_store_config(th); @@ -944,12 +947,16 @@ Page({ //--- 分享设置 -- onShareAppMessage: function (e) { getApp().globalData.no_clear = 1; + + var ee=this; var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { pagePath = '/' + pagePath; } - pagePath += "?isBuy=1" + "&id=" + this.data.options.id + "&first_leader=" + this.data.getUserID; + + + pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; console.log('分享路径'); console.log(pagePath); // if (this.data.isBuy == 0) { @@ -958,9 +965,14 @@ Page({ // pagePath += "&lbId=" + this.data.getGiftID; // } // console.log('pagePath', pagePath); + + var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); + + return { title: "礼包详情", path: pagePath, + imageUrl: img, } }, @@ -970,13 +982,17 @@ Page({ onShareTimeline() { getApp().globalData.no_clear = 1; - var pagePath = "&isBuy=1" + "&id=" + this.data.options.id + "&first_leader=" + this.data.getUserID; + var ee=this; + var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; var user_id = getApp().globalData.user_id; if (!user_id) user_id = 0; + var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); + return { title: "礼包详情", - query: 'first_leader=' + user_id + pagePath + query: 'first_leader=' + user_id + pagePath, + imageUrl: img, } }, @@ -1489,7 +1505,7 @@ Page({ var app = getApp(); var unit = that.data.screenWidth / 750 * 1.35; //基础单位, - var scene = th.data.lbId + ""; + var scene = th.data.sele_g.id + ""; var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; if (user_id > 0) { @@ -1497,7 +1513,7 @@ Page({ } ///二微码 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/giftpack/giftpacklist/giftpacklist"; + os.stoid + "?sceneValue=" + scene + "&pageValue=packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo"; // 读取文件成功则OK-- wx.getImageInfo({ @@ -1606,7 +1622,7 @@ Page({ let src = ''; context.beginPath(); if (type == 0) { // 普通 - src = '../../../images/share/q_tj.png'; + src = '/images/share/q_tj.png'; context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit); context.setFontSize(16 * unit) context.setFillStyle("white") @@ -1615,8 +1631,8 @@ Page({ } - let price = this.data.giftPrice; - let giftIntegral = this.data.giftIntegral; + let price = this.data.sele_g.payMoney; + let giftIntegral = this.data.sele_g.payIntegral; context.setFontSize(32 * unit); context.setFillStyle('#DE1117'); @@ -1683,7 +1699,8 @@ Page({ tt(); return false; } - var img_url = ee.data.giftImageCover ? ee.data.giftImageCover : ee.data.giftImage; + var img_url =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); + //获取商品是分享图信息 wx.getImageInfo({ src: img_url, diff --git a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml index b320f66..a67bb6b 100644 --- a/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml +++ b/packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml @@ -10,13 +10,12 @@ - {{monthgiftbag.giftTitle}} - + {{monthgiftbag.giftTitle}} - + @@ -45,16 +44,21 @@ + + {{"¥"+monthgiftbag.lbPrice}}+{{monthgiftbag.payIntegral+"积分"}} + + + + {{"¥"+monthgiftbag.lbPrice}} + + + / + + + {{monthgiftbag.payIntegral+"积分"}} + + - - {{"¥"+monthgiftbag.lbPrice}} - - - / - - - {{monthgiftbag.payIntegral+"积分"}} - @@ -154,37 +158,33 @@ - - - 立即购买 - - - 立即兑换 - - - - - 立即购买 - - - - - 立即兑换 - - - - - 免费领取 - - - + + + + 立即购买 + + + + + + 立即购买 + + + 立即兑换 + + + + + 立即购买 + + + + + 立即兑换 + + + + diff --git a/packageE/pages/user/monthgiftbag/public/buy_com.js b/packageE/pages/user/monthgiftbag/public/buy_com.js index 0b6c428..6a53a8e 100644 --- a/packageE/pages/user/monthgiftbag/public/buy_com.js +++ b/packageE/pages/user/monthgiftbag/public/buy_com.js @@ -244,7 +244,11 @@ module.exports = { //-- 分享导购要记录 -- if (getApp().globalData.guide_id) { json.guide_id = getApp().globalData.guide_id; - } + } + //-- 如果是且的购买每月礼包的话 -- + if(th.data.sele_g.money_type>0){ + json.exchangeintegral=th.data.sele_g.payIntegral + } // var url ="/api/weshop/marketing/buy/receive/gift/record/insert"; var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder"; diff --git a/packageE/pages/user/monthgiftbag/public/buy_com.wxml b/packageE/pages/user/monthgiftbag/public/buy_com.wxml index ea69ed4..68e0e47 100644 --- a/packageE/pages/user/monthgiftbag/public/buy_com.wxml +++ b/packageE/pages/user/monthgiftbag/public/buy_com.wxml @@ -157,19 +157,26 @@ {{sele_g.giftTitle}} - - {{"¥"+sele_g.payMoney}} - - - / + + + {{"¥"+sele_g.payMoney}}+{{sele_g.payIntegral}}积分 - - - {{sele_g.payIntegral}} - 积分 - + + + {{"¥"+sele_g.payMoney}} + + + / + + + + {{sele_g.payIntegral}} + 积分 + + + diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 3ff1ea1..d61eab4 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -144,7 +144,16 @@ Page({ navigateTo: function (e) { var th = this; var url = e.currentTarget.dataset.url; - getApp().goto(url); + let is_back = e.currentTarget.dataset.is_back + if (is_back==1) { + wx.showToast({ + title: '该礼包已退款', + icon: 'none', + duration: 2000 + }) + }else { + getApp().goto(url); + } }, //下拉事件 onReachBottom: function () { diff --git a/pages/giftpack/mygiftpack/mygiftpack.wxml b/pages/giftpack/mygiftpack/mygiftpack.wxml index 97f0626..cf605e9 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.wxml +++ b/pages/giftpack/mygiftpack/mygiftpack.wxml @@ -23,7 +23,7 @@ - + @@ -93,9 +93,10 @@ - + + 已退款 diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 7c90395..fe8e5a0 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -5318,6 +5318,21 @@ Page({ }, //-----------------拼单生成方法--------------------- + // addCart_pt: function () { + // var th = this; + // if (this.data.is_normal == 0) { + // //看一下有没有起购数,如果有起购数,要计算起购数 + // var qnum = parseFloat(th.data.prom_act.minbuynum); + // if (qnum > 0 && th.data.goodsInputNum < qnum) { + // getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); + // return false; + // } + // } + // th.addcart_pt_func(); + // + // }, + + //-----------------拼单生成方法--------------------- addCart_pt: function () { var th = this; if (this.data.is_normal == 0) { @@ -5327,12 +5342,45 @@ Page({ getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); return false; } - } - th.addcart_pt_func(); + th.addcart_pt_func(); + + } else { + + //如果是线下库存的时候 + if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { + var pick = th.get_pick_from_list(th.data.sto_sele_id) + //---通过接口获取门店的线下库存信息-- + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { + if (CanOutQty) { + if (CanOutQty < e.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + //-- 成功才来下一步 -- + th.addcart_pt_func(); + } else { + wx.hideLoading(); + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + }) + }else{ + th.addcart_pt_func(); + } + } }, + addcart_pt_func: function () { if (oo.user_id == null) { s.my_warnning("还未登录!", 0, this); diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 2cd84fd..4f5b0b5 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -509,12 +509,20 @@ Page({ } } console.log("11-11"+pagePath); - let share_imgurl=this.data.iurl + this.data.share_imgurl - return { + + + //分享的数组 + let share_dd={ title: "商品列表", path:pagePath, - imageUrl:share_imgurl } + //有图片才分享图片 + if(this.data.share_imgurl){ + let share_imgurl=this.data.iurl + this.data.share_imgurl; + share_dd.imageUrl=share_imgurl; + } + + return share_dd; }, //---图片失败,默认图片--- bind_bnerr2: function (e) { diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 35c4f5f..7706973 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -812,7 +812,6 @@ Page({ if(good.prom_type != gg.prom_type && good.prom_id != gg.prom_id){ //如果商品有单独的活动的是偶 switch (gg.prom_type){ - case 5: case 10: var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; th.toast(content); diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 606bf3e..8f8f5c2 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -1130,7 +1130,6 @@ Page({ if(good.prom_type != gg.prom_type && good.prom_id != gg.prom_id){ //如果商品有单独的活动的是偶 switch (gg.prom_type){ - case 5: case 10: var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; th.toast(content); diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index eaf272c..2c8e0f8 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -75,7 +75,8 @@ Page({ canIUseGetUserProfile: false, getusercode_vailtime:10,//会员二维码时效 - sele_ing:0 + sele_ing:0, + set_isstcsp:0 }, //通过路径跳转到其他页面 @@ -654,6 +655,10 @@ Page({ canIUseGetUserProfile: true }) } + //如果有指定要启用密码的时候 + if(t.isstcsp){ + this.setData({set_isstcsp:1,ispwhid:0}); + } }, @@ -797,6 +802,9 @@ Page({ a.staffTel=choice_guide.Tel; } + if(e.data.set_isstcsp){ + a.vipnopwd=1; + } e.setData({ phone: a.mobile, diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml index 54e81aa..f88590c 100644 --- a/pages/user/userinfo/userinfo.wxml +++ b/pages/user/userinfo/userinfo.wxml @@ -78,7 +78,7 @@ - +