diff --git a/app.js b/app.js index 6280ec0..57c6283 100644 --- a/app.js +++ b/app.js @@ -51,7 +51,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - user_id:null,//6520390,//6520352 + user_id:null,//15240065,//6520352,//6520390,//6520352 // user_id:6520314,// qa-6519858,// // user_id:14148118,// qa-6519858,// buy_now: null, @@ -764,6 +764,7 @@ App({ th.globalData.storeFooter = null; //底部的导航 th.globalData.full_screen = null; //全屏 th.globalData.guide_pick_id = null; //分享导购门店的优化 + th.globalData.fuiou_pay = null; //分享导购门店的优化 } else { th.globalData.no_clear = 0; } @@ -1539,8 +1540,72 @@ App({ } //没有等级卡和新人有礼的时候 if(func) func(); + }, + + //content是映射的标题,goods_content是富文本的内容, + //a是wxpares插件 e是common.js th是页面的指针 + async deal_iframe(a,e,content,goods_content,th){ + + if (goods_content == null) goods_content = ""; + //-----商品详情--- + if (!goods_content) goods_content = " "; + + //用内存对象 + var ob={text:''}; + if(goods_content){ + ob.text=goods_content; + await this.deal_iframe_next(ob) + } + a.wxParse(content, "html", ut.format_content(ob.text), th, 6); + e.wxParseAddFullImageUrl(th, content); + }, + + async deal_iframe_next(ob){ + for(let i = 1; i > 0; i++){ + //如果没有iframe语句的时候,就跳出循环 + if(ob.text.indexOf(''); + //截取iframe的dom元素 + var str=ob.text.substring(start, end+9); + + var arr = str.split('vid='); + var arrs = arr[1].split('"'); + /* console.log("截取&前面的的"+arrs[0]);*/ + var vipid = arrs[0]; + + //-- 用vipid调用接口,转换视频 -- + var url = "https://vv.video.qq.com/getinfo?vid=" + vipid + "&platform=101001&charge=0&otype=json"; + var res=await getApp().promiseGet(url,{}) + if(res && res.data){ + var dataJson = res.data.replace(/QZOutputJson=/, '') + "qwe"; + var dataJson1 = dataJson.replace(/;qwe/, ''); + var data = JSON.parse(dataJson1); + if (data.vl != undefined) { + var host1 = data['vl']['vi'][0]; + var host2=host1['ul']['ui']; + var len=host2.length-1; + var host= host2[len]['url']; + + var fn = data.vl.vi[0].fn; + var fvkey = data.vl.vi[0].fvkey; + /* console.log("有参数吗"+fn+"有参数吗"+fvkey);*/ + var wxapp_url = host + fn + '?vkey=' + fvkey; + var frame=''; + ob.text=ob.text.replaceAll(str,frame) + } + continue; + }else{ + break; + } + } } + + + + + }); diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index 992772e..a4c43be 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -245,7 +245,7 @@ Component({ } //控制已售罄是否显示 - if (!th.data.object.hide_sold_out_items) { + if (th.data.object.column_action_name && !th.data.object.hide_sold_out_items) { all_array=empty } 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/packageB/pages/luckactivity/luckinfo/luckinfo.wxml b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml index 46af456..362ab9a 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.wxml +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxml @@ -50,7 +50,7 @@ - + {{item.luck_goods_name}} @@ -135,7 +135,7 @@ - + {{item.luck_name}} diff --git a/packageB/pages/luckactivity/luckinfo/luckinfo.wxss b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss index 66b8197..c6217b6 100644 --- a/packageB/pages/luckactivity/luckinfo/luckinfo.wxss +++ b/packageB/pages/luckactivity/luckinfo/luckinfo.wxss @@ -68,7 +68,10 @@ page, width: 140rpx; height: 140rpx; margin-right: 20rpx; - /* background-color: #f5f5f5; */ + /* background-color: #f5f5f5; */ + display: flex; + align-items: center; + justify-content: center; } .img { @@ -76,6 +79,10 @@ page, width: 100%; height: 100%; } +.small_set{ + width: 84rpx; + height: 84rpx; +} .item-r { display: flex; diff --git a/packageB/pages/luckactivity/luckinfo/tool.wxs b/packageB/pages/luckactivity/luckinfo/tool.wxs index 28771b5..b5cebd0 100644 --- a/packageB/pages/luckactivity/luckinfo/tool.wxs +++ b/packageB/pages/luckactivity/luckinfo/tool.wxs @@ -26,6 +26,10 @@ var tools = { src = 'miniapp/images/luckDraw/lb.png'; break; }; + case 7: { //礼包 + src = 'miniapp/images/luckDraw/ylb.png'; + break; + }; }; return src; }, diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 5f6dd91..853fc10 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -467,18 +467,20 @@ Page({ ee.init(gid); //------几人评价------- //n.init(th, "", "comments"); - //商品详情广告---- - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); + + if(e && e.goods_bottomconent){ + //商品详情广告---- + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); + } + + //------- th.requestCardNum(), wx.pageScrollTo && th.setData({ supportPageScroll: !0 }); - - - //计算等级价相关 var swithc_list = e.switch_list; var sw_arr = JSON.parse(swithc_list); diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 8020c24..be5d872 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -402,10 +402,14 @@ Page({ appoint_pick_keyid: json_d.appoint_pick_keyid }); - //商品详情广告---- - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); - //------- + + if(e && e.goods_bottomconent){ + //商品详情广告---- + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); + //------- + } + // ee.init(gid); //------几人评价------- //n.init(th, "", "comments"); @@ -2857,8 +2861,15 @@ Page({ th.setData({ g_buy_num: map, }); + + + let t_prom_id=gd.prom_id; + if(th.data.presellForm){ + t_prom_id=th.data.presellForm.id; + } + getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum", { - data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id }, + data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: t_prom_id }, success: function (e) { if (e.data.code == 0) { th.setData({ prom_buy_num: e.data.data.sumgoodsnum }) 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..dde257f 100644 --- a/packageD/pages/user/deposit/prepaid/prepaid.js +++ b/packageD/pages/user/deposit/prepaid/prepaid.js @@ -117,7 +117,7 @@ Page({ t_pay.set_fir(); //-- 通联的第三方支付的返回优化 -- - ut.is_pay_ok(th.data.ok_order_sn,"/packageD/pages/user/deposit/prepaid/msg/msg","none",function (){ + ut.is_pay_ok(th.data.ok_order_sn,"/packageD/pages/user/deposit/prepaid/msg/msg?is_nd_pw=1","none",function (){ if(!th.data.ok_order_sn) return false; var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; getApp().request.promiseGet(ck_url,{}).then(res=>{ @@ -127,7 +127,7 @@ Page({ //支付支付,返回首页 ut.m_toast('支付成功'); setTimeout(()=>{ - getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg"); + getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg?is_nd_pw=1"); },1000) }else{ @@ -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/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 4ea8332..b548567 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -2367,7 +2367,7 @@ Page({ if (get_data.gift_id && parseInt(get_data.zp_mode) != 1 && (get_data.zp_num * item_map.bs <= get_data.limit_num-other_gift || !get_data.limit_num) && get_data.zp_num * item_map.bs <= get_data.gift_storecount - && get_data.zp_num>get_data.must_num //增加一个超量 + && get_data.zp_num>=get_data.must_num //增加一个超量 ) { item_map.gift_id = get_data.gift_id; @@ -7823,7 +7823,9 @@ Page({ var index = e.index; var collocationList = this.data.cartlist[cart_index].collocationList; - var item = collocationList[index]; + var item =JSON.parse(JSON.stringify(collocationList[index])); + + var goods = this.data.cartlist[cart_index].goods; var txt = 'cartlist[' + cart_index + '].goods'; var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected'; @@ -7889,6 +7891,8 @@ Page({ item.prom_type = 5; item.is_collocation = 1; item.is_post_temp = 1; + if(!item.original_img) item.original_img=1; + else item.original_img=th.data.imgUrl+item.original_img; goods.push(item); 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..012c6f1 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'); @@ -1624,11 +1640,17 @@ Page({ if(price || giftIntegral){ if(price){ price_txt='¥' + price; - if(giftIntegral) price_txt+='+'; + if(giftIntegral){ + if(this.data.sele_g.money_type>0){ + price_txt+='+'; + }else{ + price_txt+='或'; + } + } } if(giftIntegral) price_txt+=giftIntegral+'积分'; }else{ - price_txt="¥0"; + price_txt="免费领取"; } context.fillText(price_txt, 54 * unit, 735 * unit); @@ -1683,7 +1705,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/monthgiftbag.wxml b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml index 97e4ca7..ae95d7b 100644 --- a/packageE/pages/user/monthgiftbag/monthgiftbag.wxml +++ b/packageE/pages/user/monthgiftbag/monthgiftbag.wxml @@ -59,6 +59,9 @@ {{"¥"+item.payMoney}} + + + + {{item.payIntegral+"积分"}} 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/giftpack/public/buy_com.js b/pages/giftpack/public/buy_com.js index 112d068..3f9ed74 100644 --- a/pages/giftpack/public/buy_com.js +++ b/pages/giftpack/public/buy_com.js @@ -218,6 +218,11 @@ module.exports = { if(th.data.submit) return false; th.setData({submit:1}) + if(th.pp_bacK_func){ + th.pp_bacK_func(); + return false; + } + var id=th.data.sele_g.lbId; var that=th; var json = { diff --git a/pages/giftpack/public/buy_com.wxml b/pages/giftpack/public/buy_com.wxml index 95748af..278e882 100644 --- a/pages/giftpack/public/buy_com.wxml +++ b/pages/giftpack/public/buy_com.wxml @@ -155,7 +155,7 @@ {{sele_g.giftTitle}} - + {{"¥"+sele_g.payMoney}} @@ -174,14 +174,15 @@ - + 已售:{{sele_g.giftQty}} 可售:{{sele_g.lbnum-sele_g.giftQty+(sele_g.virtualsales?sele_g.virtualsales:0)}} - + + - + {{def_pick_store.pickup_name}} @@ -249,6 +250,7 @@ 立即兑换 立即购买 立即领取 + 确认选择 diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 7c90395..113eafc 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -489,10 +489,13 @@ Page({ // goods_bottomconent:e.goods_bottomconent }); - //商品详情广告---- - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); - //------- + //判断商品详情要有东西 + if(e && e.goods_bottomconent) { + //商品详情广告---- + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); + //------- + } //------几人评价------- //n.init(th, "", "comments"); @@ -504,6 +507,7 @@ Page({ //计算等级价相关 var swithc_list = e.switch_list; var sw_arr = JSON.parse(swithc_list); + console.log('plus-111') //---如果后台又开等级卡的开关--- ut.get_plus_name_price(sw_arr, th); @@ -1121,13 +1125,13 @@ Page({ if (t.data.data.original_img.indexOf(o.imghost) == -1) t.data.data.original_img = o.imghost + t.data.data.original_img; + /* -----商品详情--- if (t.data.data.goods_content == null) t.data.data.goods_content = ""; - - //-----商品详情--- if (!t.data.data.goods_content) t.data.data.goods_content = " "; - a.wxParse("content", "html", ut.format_content(t.data.data.goods_content), ee, 6); - e.wxParseAddFullImageUrl(ee, "content"); + e.wxParseAddFullImageUrl(ee, "content");--*/ + + getApp().deal_iframe(a,e,'content',t.data.data.goods_content,ee); //if (ee.data.prom_type) { t.data.data.prom_type = ee.data.prom_type; @@ -5318,6 +5322,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 +5346,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); @@ -7644,6 +7696,7 @@ Page({ }) }, + go_plus: function () { getApp().goto("/pages/user/plus/plus"); }, 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/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index d219c76..061af84 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -9,6 +9,9 @@ var e = getApp(), app_d = e.globalData; var invalidSetTime = null var regeneratorRuntime = require('../../../utils/runtime.js'); +var com = require("../../giftpack/public/buy_com.js"); + + Page({ /** * 页面的初始数据 @@ -85,7 +88,46 @@ Page({ font_color:'', //-- 屏幕实际的高度 -- - r_heght:'' + r_heght:'', + + + //门店相关 + ismend: 0, + is_sec_mend: 0, + sto_sele_name: "", //选中的门店名称 + sto_sele_id: "", //选中的门店id + sto_sele_distr: "", //选择的门店的配送方式 + is_show_sto_cat: 1, //是否显示门店分类 + only_pk: null, + all_sto: null, + sec_sto: null, //选择了的门店分类 + pickpu_list: null, //读出的所有门店list + def_pickpu_list: null, //一开始5个门店list + sec_pick_index: 0, //第二级门店选择ID + fir_pick_index: 0, //第一级门店选择ID + all_pick_list: null,//所有的门店先记录起来 + + select_store: 0, //选择更多 + index: 1, + more_store: 0, //选择门店 + sort_store: 0, //门店分类 + choice_sort_store: 0, //选择分类门店 + new_user: 0, //新用户 + + def_pick_store: null, // 默认的门店 + fir_def_store: null, //客户默认的门店的 + lat: null, //维度 + lon: null, //经度 + + is_get_local_ok: 0, //获取坐标是否完成 + region_name: "门店分类", //区域的名字 + is_gps: 1, + open_ind_store: 0, //哪里打开的门店列表的控制属性 + default_store: {}, //创建添加默认门店地址的对象 + + store: 0, + openSpecModal: 0, + }, @@ -99,7 +141,8 @@ Page({ var nav_b = th.selectComponent("#nav_b"); //组件的id nav_b.set_name("助力", "/pages/user/assistance/assistance"); th.setData({ - help_id: help_id + help_id: help_id, + buyType:4 }); //start 钱 if (options.gid != undefined) { @@ -111,27 +154,106 @@ Page({ th.setData({taskid:options.taskid}) } + //-- 获取分享人的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 + } + }) + } + console.log('aaaa'); th.syinfo(); th.close(); th.imageinfo(); + getApp().getConfig2(function (e) { + var json_d = JSON.parse(e.switch_list); + th.setData({ + bconfig: e, + sys_switch: json_d, + is_retail_price: json_d.is_retail_price || 0 + }); + }) + }, + check_guide(func){ + var first_leader=this.data.first_leader; + if(!first_leader){ + func(); + return false; + } + if(this.data.is_geted_guide_pick){ + func(); + return false; + } + if(getApp().globalData.guide_pick_id){ + func(); + return false; + } + var th=this; + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { + if (res.data.code == 0) { + getApp().globalData.guide_pick_id= res.data.data.pickup_id; + } + th.data.is_geted_guide_pick=1; + func(); + }) + }, + + + //选中任务 + add_onlicke:function (e){ + this.data.tg_dd=e; + var th=this; + if(this.data.is_nd_pk){ + th.setData({ openSpecModal: 1 }) + th.pp_bacK_func=th.add_onlicke_next; //设置回调函数 + }else{ + th.add_onlicke_next(); + } + }, + + + //选中任务保存下一步 + add_onlicke_next: function () { + + if(!this.data.tg_dd){ + return false; + } + + let e=JSON.parse(JSON.stringify(this.data.tg_dd)); + this.data.tg_dd=null; - //选中任务保存 - add_onlicke: function (e) { var th = this; var taskid = e.target.dataset.taskid; var help_id = th.data.help_id; var user_id = getApp().globalData.user_id; var stoid = os.stoid - getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", { + + var insert_dd={ helpId: help_id, userId: user_id, storeId: stoid, taskId: taskid - }, + }; + + //-- 如果需要门店的时候 -- + if( th.data.is_nd_pk==1){ + insert_dd.pickupId=th.data.def_pick_store.pickup_id; + } + + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", insert_dd, function (res) { if (res.data.code == 0) { getApp().my_warnning(res.data.data, 1, th); @@ -142,6 +264,8 @@ Page({ } else { getApp().my_warnning(res.data.msg, 0, th); } + th.setData({submit:0}) + th.closeSpecModal(); } ) @@ -175,14 +299,76 @@ Page({ success: function (res) { if (res.data.code == 0) { var help_data = res.data.data; - th.setData({ + + help_data.giftTitle=help_data.actName; + help_data.lbUrl=help_data.imageUrl; + + let sData={ endDate: help_data.endDate, - - btn_color: help_data.btn_color, - bg_color: help_data.bg_color, - font_color: help_data.font_color, - imageUrl: help_data.imageUrl, - }); + btn_color: help_data.btn_color, + bg_color: help_data.bg_color, + font_color: help_data.font_color, + imageUrl: help_data.imageUrl, + sele_g:help_data + }; + + if(help_data.is_pickup){ + sData.pickup_list=help_data.pickup_list; + } + + th.setData(sData); + + /*-----获取助力活动的任务-----*/ + rq.get("/api/weshop/marketing/help/help/task/page", { + data: { + helpId: help_id, + storeId: os.stoid + }, + success: function (su) { + var data = su.data; + if (data.code != 0) { + getApp().my_warnning(data.msg, 0, th); + return false; + } + if (data.code == 0 && data.data && data.data.pageData && data.data.pageData.length>0) { + //轮播图的数据 + var data_aissa = data.data.pageData; + //当前时间戳 + var nt = ut.gettimestamp(); + + data_aissa.forEach(function (val, ind) { + //已开始 + if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; + //未开始 + else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; + //已结束 + else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; + }); + var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; + var taskid = data_aissa[0].id; + if(th.data.taskid) { + th.setData({ + aitem: data_aissa, + task_number: task_number, + giftQty:data_aissa[0].giftQty, + }); + th.go_to_task(th.data.taskid); + + }else{ + th.setData({ + aitem: data_aissa, + task_number: task_number, + taskid: taskid, + giftQty:data_aissa[0].giftQty, + }); + //判断是不是领取的任务 + th.get_user_task(); + th.get_user_task_num(); + } + } + + } + }) //任务时间 设置全局定时器 th.setData({ @@ -191,65 +377,11 @@ Page({ }, 1000) }) - } } }); - /*-----获取助力活动的任务-----*/ - rq.get("/api/weshop/marketing/help/help/task/page", { - data: { - helpId: help_id, - storeId: os.stoid - }, - success: function (su) { - var data = su.data; - if (data.code != 0) { - getApp().my_warnning(data.msg, 0, th); - return false; - } - if (data.code == 0 && data.data && data.data.pageData && data.data.pageData.length>0) { - //轮播图的数据 - var data_aissa = data.data.pageData; - //当前时间戳 - var nt = ut.gettimestamp(); - - data_aissa.forEach(function (val, ind) { - //已开始 - if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; - //未开始 - else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; - //已结束 - else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; - }); - var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; - var taskid = data_aissa[0].id; - if(th.data.taskid) { - th.setData({ - aitem: data_aissa, - task_number: task_number, - giftQty:data_aissa[0].giftQty, - }); - th.go_to_task(th.data.taskid); - - }else{ - th.setData({ - aitem: data_aissa, - task_number: task_number, - taskid: taskid, - giftQty:data_aissa[0].giftQty, - }); - //判断是不是领取的任务 - th.get_user_task(); - th.get_user_task_num(); - } - } - - } - }) - - //会员任务列表 this.user_task_list(); //获取助力活动参与的人数 @@ -468,6 +600,27 @@ Page({ var aitem = th.data.aitem; var sw_index = th.data.sw_index; var taskid = aitem[sw_index].id + + //-- 判断一下要不要弹出框,选择门店,只有在礼包含有礼品的时候 -- + getApp().promiseGet('/api/weshop/marketing/help/help/task/getlbtype?storeId='+os.stoid+'&Id='+taskid,{}).then(gNew=>{ + if(gNew && gNew.data.code==0 && gNew.data.data){ + if(th.data.pickup_list && gNew.data.data.lb_type.indexOf(',1,')>-1){ + th.data.is_nd_pk=1; + //-- 检测一下有没有门店 -- + th.check_guide(function (){ + com.wait_for_store_config(th); + com.set_user_mo_store(th, os, function () { + if (sele_g.pickup_list && th.data.def_pick_store) { + com.check_def_pk(th); + } + }); + com.get_sto(th, os); + }) + } + } + }) + + rq.get("/api/weshop/marketing/help/help/task/get", { data: { storeId: os.stoid, @@ -489,7 +642,8 @@ Page({ }, //获取失效时间 getInvalidTime(taskid){ - let th = this + let th = this; + let _this2=this; rq.get("/api/weshop/marketing/giftbag/helpinfo/get", { data: { storeId: os.stoid, @@ -497,7 +651,7 @@ Page({ taskId: taskid, helpId:th.data.help_id }, - success: function (res) { + success:async function (res) { console.log('获取失效时间------'); console.log(res); if (res.data.code == 0) { @@ -507,6 +661,7 @@ Page({ if (openTime && validTime > 0) { invalidTime = openTime*1 + validTime*60*60 } + th.setData({ invalidTime }); @@ -1146,7 +1301,7 @@ Page({ is_dismantle: 0, bc_page: 1, }) - this.get_user_task_num(); + this.get_user_task_num(); }, @@ -1174,4 +1329,380 @@ Page({ }; }, + buy_libao: function () { + com.buy_libao(this) + }, + + + //-- 选择门店 -- + choice_store: function (ee) { + this.setData({ + keyword:'' + }) + + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/packageE/pages/togoin/togoin', + }) + return false; + } + + var th = this; + var ind = ee.currentTarget.dataset.ind; + var bconfig = th.data.bconfig; + + //如果开启了,则不在选择门店 + // if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { + // return false; + // } + // if (!th.data.only_pk && !th.data.def_pickpu_list) { + // getApp().confirmBox("门店库存不足", null, 25000, !1); + // return false; + // } + + if (th.data.only_pk && !th.data.only_pk.length) { + getApp().confirmBox("门店库存不足", null, 25000, !1); + return false; + } + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { + getApp().confirmBox("门店库存不足", null, 25000, !1); + return false; + } + + + if (bconfig && bconfig.is_sort_storage) { + wx.getLocation({ + type: 'gcj02', + success: function (res) { + + th.data.lat = res.latitude; + th.data.lon = res.longitude; + th.data.is_get_local_ok = 1; + th.setData({ + is_gps: 1 + }); + //th.onShow(); + com.get_sto(th, os); + }, + fail: function (res) { + //th.onShow(); + th.data.is_get_local_ok = 1; + com.get_sto(th, os); + if (res.errCode == 2) { + th.setData({ + is_gps: 0 + }); + if (th.data.is_gps == 0) { + getApp().confirmBox("请开启GPS定位", null, 25000, !1); + } + } else { + th.setData({ + is_gps: "3" + }); + } + + } + }) + } else { + th.data.is_get_local_ok = 1; + com.get_sto(th, os); + } + + if (ind != undefined && ind != null) { + this.setData({ + open_ind_store: ind, + store: 1, + openSpecModal: !1, + openSpecModal_pt: !1, + openSpecModal_flash_normal: !1, + }) + } else { + this.setData({ + store: 1, + openSpecModal: !1, + openSpecModal_pt: !1, + openSpecModal_flash_normal: !1 + + }) + } + }, + //关闭选择门店 + close_popup: function (e) { + var th = this; + this.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0, + fir_pick_index: 0, + sec_pick_index: 0 + }) + + var openindstore = this.data.open_ind_store; + if (openindstore == 1) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + } else if (openindstore == 2) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + } else if (openindstore == 4) { //4就是拼团 + th.setData({ + openSpecModal_pt: 1, //打开拼团购买界面 + store: 0, //关闭门店 + choice_sort_store: 0, //关闭门店2级 + sort_store: 0, //关闭门店2级 + }); + } else { + th.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0 + }) + } + + + }, + //选择更多门店 + more_store: function () { + this.setData({ + sort_store: 1 + }); + }, + // 返回按钮 + returns: function () { + this.setData({ + sort_store: 0, + choice_sort_store: 0 + }); + }, + //---选择分类门店--- + choice_sort_store: function (e) { + var index = e.currentTarget.dataset.index; + var region_name = e.currentTarget.dataset.region; + var item = this.data.all_sto[index]; + this.setData({ + region_name: region_name, + sort_store: 0, + choice_sort_store: 1, + sec_i:index, + sec_sto: item, + sec_pick_index: 0 + }); + }, + choose_for_store_fir: function (e) { + var index_c = e.currentTarget.dataset.ind; + var th = this; + th.setData({ + fir_pick_index: index_c + }) + + }, + //确定def_pick为选择的门店 + sure_pick: function (e) { + var th = this; + var item = null; + var openindstore = th.data.open_ind_store; + + if (th.data.choice_sort_store == 0) { + var index = th.data.fir_pick_index; + if (th.data.is_show_sto_cat == 1) { + item = th.data.def_pickpu_list[index]; + } else { + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 + } + + } else { + var index = th.data.sec_pick_index; + item = th.data.sec_sto.s_arr[index]; + } + + if(!item) return false; + + if (!th.data.sele_g) return false; + + th.setData({ + def_pick_store: item, + sto_sele_name: item.pickup_name, + sto_sele_id: item.pickup_id, + sto_sele_distr: item.distr_type, + store: 0, + choice_sort_store: 0, + fir_pick_index: 0, + openSpecModal: !0, + }); + + + }, + //---点击二级之后的选择--- + choose_for_store: function (e) { + var index_c = e.currentTarget.dataset.ind; + var th = this; + th.setData({ + sec_pick_index: index_c, + fir_pick_index: index_c + }) + + }, + //把选择的门店设置成默认的门店def_pick + set_def_pick: function (e) { + var th = this; + var item = null; + if (th.data.choice_sort_store == 0) { + var index = th.data.fir_pick_index; + if (th.data.is_show_sto_cat == 1) { + item = th.data.def_pickpu_list[index]; + } else { + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 + } + } else { + var index = th.data.sec_pick_index; + item = th.data.sec_sto.s_arr[index]; + } + + if(!item) return false; + + th.setData({ + def_pick_store: item, + sto_sele_name: item.pickup_name, + sto_sele_id: item.pickup_id, + sto_sele_distr: item.distr_type, + store: 0, + choice_sort_store: 0, + openSpecModal: !0, + }); + + var user_id = getApp().globalData.user_id; + var def_pickup_id = item.pickup_id; + getApp().request.put('/api/weshop/users/update', { + data: { + user_id: user_id, + def_pickup_id: def_pickup_id + }, + success: function (res) { + if (res.data.code == 0) { + if (th.data.choice_sort_store == 0) th.setData({ + fir_pick_index: 0 + }); + getApp().globalData.pk_store = item; + } else { + getApp().my_warnning("设置默认门店地址失败", 0, th) + } + + } + }); + + + }, + closeSpecModal: function () { + this.setData({openSpecModal: 0}); + }, + + + //获取搜索门店输入的值 + input_store: function(e) { + this.setData({ + keyword: e.detail.value + }) + }, + + //-- 搜索门店 -- + searchfn(){ + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store==0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr=all_pick_list.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + if(this.data.is_show_sto_cat==1){ + this.setData({ + def_pickpu_list:arr + }) + }else{ + this.setData({ + only_pk:arr + }) + } + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if (this.data.is_show_sto_cat==1) { + this.setData({ + def_pickpu_list:all_pick_list.slice(0,10) + }) + }else{ + this.setData({ + only_pk:all_pick_list + }) + } + + } + }else{ //分类下搜索 + let sec_i=this.data.sec_i + let all_sto = this.data.all_sto + let old_all_sto = this.data.old_all_sto + if (!old_all_sto) { + this.setData({ + old_all_sto:JSON.parse(JSON.stringify(all_sto)) + }) + } + let sec_sto= this.data.sec_sto + let sec_arr = this.data.old_all_sto[sec_i].s_arr + let keyword = this.data.keyword + let text='sec_sto.s_arr' + if (keyword) { + let arr=sec_arr.filter( item =>{ + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + }else{ + return false + } + }) + if (arr && arr.length>0) { + this.setData({ + [text]:arr + }) + }else{ + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + }else{ + if(this.data.old_all_sto){ + this.setData({ + [text]: this.data.old_all_sto[sec_i].s_arr + }) + }else{ + this.setData({ + [text]: all_sto[sec_i].s_arr + }) + } + + } + + + } + }, + }) diff --git a/pages/user/assistance/task_assistance.wxml b/pages/user/assistance/task_assistance.wxml index 2568c34..8a1d3a8 100644 --- a/pages/user/assistance/task_assistance.wxml +++ b/pages/user/assistance/task_assistance.wxml @@ -195,4 +195,5 @@ + diff --git a/pages/user/assistance/task_assistance.wxss b/pages/user/assistance/task_assistance.wxss index 287d9eb..32e47f1 100644 --- a/pages/user/assistance/task_assistance.wxss +++ b/pages/user/assistance/task_assistance.wxss @@ -1,3 +1,4 @@ + page { /* background: #d01119; */ width: 100%; @@ -277,4 +278,363 @@ image{ display: flex; align-items: center; justify-content: space-around; +} + + +/*-- 和弹出框的组件有关系 --*/ +.xc-width { + width: 100%; +} +.spec-model { + position: fixed; + bottom: 0; + z-index: 20; + background: white; + width: 100%; + /* padding: 0 30rpx; */ + font-size: 32rpx; + box-sizing: border-box; + border-radius: 20rpx 20rpx 0 0; + /* height: 72%; */ +} + +.spec-model .pding { + padding: 0 20rpx; +} +.pding { + padding-top: 20rpx; + padding-left: 20rpx; + height: 81%; + padding-right: 20rpx; + font-size: 26rpx; + color: #ea120f +} + +.spec-goods { + padding: 30rpx 0 20rpx; + /* float: left; */ + width: 100%; + /* border-bottom:2rpx solid #eee; */ +} + +.spec-img { + float: left; + height: 186rpx; + width: 186rpx; + border: 4rpx solid #eee +} + +.spec-goods-info { + float: left; + padding: 0 25rpx; + width: 400rpx; +} + +.spec-goods-name { + font-size: 30rpx; + line-height: 35rpx; + height: 70rpx; + margin: 15rpx 20rpx 25rpx 0; + overflow: hidden; + text-overflow: ellipsis; + color: #333; +} + +.spec-goods-price { + color: #d60021; + font-size: 33rpx; + font-weight: bold; + /* display: flex; */ +} + +.spec-goods-stock { + margin-top: 3rpx; + font-size: 24rpx; + color: #999999; + margin-right: 15rpx; +} + +.spec-name { + clear: both; + padding: 20rpx 0; + font-size: 30rpx; + color: #333; +} +.spec-name+view{ + flex-wrap: wrap; +} +.stores-img { + width: 28rpx; + height: 28rpx; + margin-right: 10rpx; +} +.right-arrow { + width: 15rpx; + height: 15rpx; + border-top: 2rpx solid #d70026; + border-right: 2rpx solid #d70026; + transform: rotate(45deg); + display: inline-block; + margin-bottom: 3rpx; +} + + +.spec-btn { + color: black; + background-color: white; + padding: 10rpx 10rpx; + font-size: 26rpx; + line-height: 28rpx; + float: left; + border: 1rpx solid #dedede; + margin: 4rpx 10rpx 4rpx 0; + border-radius: 4rpx; +} + +.spec-btn-click { + color: white; + background-color: #f23030; + border: 1rpx solid #f23030; +} + +.spec-cart-btns { + /* width: 92%; */ + line-height: 70rpx; + /* margin: 0rpx auto; + margin-top: 160rpx; */ + /* border-radius: 20rpx; */ + /* position: fixed; */ + /* bottom: 50rpx; */ + /* left: 4%; */ + padding: 20rpx; +} + +.spec-cart-btn { + + width: 100%; + font-size: 30rpx; + text-align: center; + color: white; + border-radius: 40rpx; +} + +.spec-cart-btn.w40 { + width: 46%; +} + +.spec-add-cart { + background-color: #ffb03f; +} + +.spec-buy { + background-color: #f23030; + /* margin-left: 34rpx; */ +} + +.spec-cart-disable { + background: #bbbbbb; +} + +.spec-cart-btn-lg { + width: 614rpx; +} + + +/* 选择门店的弹窗 */ +.mongolia-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0, 0, 0, 0.4); + width: 100%; + height: 91.9%; + +} + +.popup-frame { + position: fixed; + z-index: 20; + background: white; + width: 100%; + border-radius: 20rpx 20rpx 0 0; + height: auto; + bottom: 0; +} + +.popup-top { + border-bottom: 1rpx solid #eee; + height: 155rpx; + width: 95%; + margin: auto; + line-height: 155rpx; + +} + +.bg_rights { + border-top: 2rpx solid; + border-right: 2rpx solid; + transform: rotate(45deg); + display: inline-block; + width: 15rpx; + height: 15rpx; + border-color: #da0b31; +} + +.modal-closes { + position: absolute; + right: 30rpx; + top: -15rpx; + height: 25rpx; + +} + +.choose_more { + margin-top: 40rpx; + margin-right: 20rpx; + +} + +.choose_mores { + margin-top: 30rpx; + margin-right: 15rpx; + +} + +.store-list { + width: 95%; + min-height: 700rpx; + overflow-y: scroll; + margin: auto; + max-height: 700rpx; +} + +.store-list .store_choose { + width: 100%; + height: 120rpx; + line-height: 125rpx; + border-bottom: 1rpx solid #eee; + padding: 10rpx 0; +} + +.store-list .store_choose .store { + width: 100%; + margin: auto; + line-height: 37rpx; + padding-left: 20rpx; + +} + +.xc-hook { + width: 35rpx; + height: 35rpx; + transform: rotate(-145deg); + line-height: 37rpx; + text-align: center; +} + +.xc-hooks { + width: 30rpx; + height: 30rpx; + border: 1rpx solid #999; +} + +.address-frame { + width: 93%; + margin-left: 7rpx; + +} + +.nearby_store { + margin-left: 17rpx; +} + +.address_name { + margin-right: 10rpx; + width: 360rpx; + +} + +.address-val { + height: 38rpx; + line-height: 38rpx; + +} + +.store-bottom { + width: 85%; + margin: auto; + height: 90rpx; +} + +.searchbar { + height: 95rpx; + border-bottom: 2rpx solid rgb(238, 238, 238); +} +.storeListpadd { + padding: 0rpx 31rpx; +} +.search { + width: 125rpx; + height: 45rpx; + line-height: 45rpx; + background-color: rgb(219, 27, 52); + border-radius: 30rpx; + color: rgb(255, 255, 255); +} +.inputstore { + width: 510rpx; + height: 43rpx; + line-height: 43rpx; + border-radius: 30rpx; + border: 2rpx solid rgb(238, 238, 238); + padding-left: 30rpx; +} + + + +.determine { + width: 260rpx; + height: 55rpx; + border-radius: 50rpx; + line-height: 55rpx; +} + +.default { + width: 260rpx; + height: 55rpx; + border: 3rpx solid #c8c8c8; + border-radius: 50rpx; + line-height: 55rpx; +} + +.store-bottom-frame { + width: 95%; + margin: auto; + +} + +/* 门店分类列表 */ +.sort_store_list { + max-height: 700rpx; + min-height: 700rpx; + overflow: hidden; + overflow-y: scroll; + width: 95%; + margin: auto; +} + +.sort_store_list .sort-store-frame { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border-bottom: 1rpx solid #eee; + +} + +.sort_store_list .sort-store-frame .sort-store { + width: 94.5%; + margin: auto; } \ No newline at end of file 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 @@ - + diff --git a/utils/pay.js b/utils/pay.js index d841749..3aabead 100644 --- a/utils/pay.js +++ b/utils/pay.js @@ -42,6 +42,8 @@ module.exports = { console.log(dd,'支付场景'); + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 + wx.showLoading(); n.post(this.url, { data: dd, @@ -150,6 +152,8 @@ module.exports = { return false; } + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 + wx.openEmbeddedMiniProgram({ appId: 'wxef277996acc166c3', extraData: p_data, @@ -204,6 +208,9 @@ module.exports = { fail('支付参数错误'); return false; } + + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 + //富友插件的优化 if(ob.is_fuioupay){ const plugin = requirePlugin('fuiou-pay') @@ -234,6 +241,7 @@ module.exports = { //-- 通联的支付插件 -- else if(ob.is_pos_pay){ + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 var p_data=t.data.data; delete p_data.is_pos_pay; //清理掉,不然签名不通过 wx.openEmbeddedMiniProgram({ diff --git a/utils/pay2.js b/utils/pay2.js index 8382532..25decb8 100644 --- a/utils/pay2.js +++ b/utils/pay2.js @@ -15,6 +15,9 @@ module.exports = { if(this.wx_paying) return false; this.wx_paying=1; wx.showLoading(); + + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 + var i = this; n.post(this.url, { data: dd, @@ -69,6 +72,8 @@ module.exports = { th.data.ok_order_sn=ordno; } + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 + wx.openEmbeddedMiniProgram({ appId: 'wxef277996acc166c3', extraData: p_data, @@ -113,6 +118,9 @@ module.exports = { fail('支付参数错误'); return false; } + + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 + if(ob.is_fuioupay){ const plugin = requirePlugin('fuiou-pay') @@ -153,6 +161,8 @@ module.exports = { get_order(p_data.reqsn); //把单号返回 } + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 + wx.openEmbeddedMiniProgram({ appId: 'wxef277996acc166c3', extraData: p_data, diff --git a/utils/util.js b/utils/util.js index 1a9bd6f..7987d9e 100644 --- a/utils/util.js +++ b/utils/util.js @@ -895,6 +895,10 @@ module.exports = { */ is_pay_ok(ok_order_sn,back_url,err_url,func,success,fail,is_navigateTo){ + //如果不是通联支付,立即返回 + if(!getApp().globalData.is_tonglian_pay) return false; + getApp().globalData.is_tonglian_pay=0; + if(!ok_order_sn) { return false; }