Commit 7ad6348074a69447e2aa5995d95f37aad420d822
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
35 changed files
with
1429 additions
and
279 deletions
app.js
| ... | ... | @@ -51,7 +51,7 @@ App({ |
| 51 | 51 | config: null, //门店参数 |
| 52 | 52 | config2: null, //门店配置 |
| 53 | 53 | code: null, |
| 54 | - user_id:null,//6520390,//6520352 | |
| 54 | + user_id:null,//15240065,//6520352,//6520390,//6520352 | |
| 55 | 55 | // user_id:6520314,// qa-6519858,// |
| 56 | 56 | // user_id:14148118,// qa-6519858,// |
| 57 | 57 | buy_now: null, |
| ... | ... | @@ -764,6 +764,7 @@ App({ |
| 764 | 764 | th.globalData.storeFooter = null; //底部的导航 |
| 765 | 765 | th.globalData.full_screen = null; //全屏 |
| 766 | 766 | th.globalData.guide_pick_id = null; //分享导购门店的优化 |
| 767 | + th.globalData.fuiou_pay = null; //分享导购门店的优化 | |
| 767 | 768 | } else { |
| 768 | 769 | th.globalData.no_clear = 0; |
| 769 | 770 | } |
| ... | ... | @@ -1539,8 +1540,72 @@ App({ |
| 1539 | 1540 | } |
| 1540 | 1541 | //没有等级卡和新人有礼的时候 |
| 1541 | 1542 | if(func) func(); |
| 1543 | + }, | |
| 1544 | + | |
| 1545 | + //content是映射的标题,goods_content是富文本的内容, | |
| 1546 | + //a是wxpares插件 e是common.js th是页面的指针 | |
| 1547 | + async deal_iframe(a,e,content,goods_content,th){ | |
| 1548 | + | |
| 1549 | + if (goods_content == null) goods_content = ""; | |
| 1550 | + //-----商品详情--- | |
| 1551 | + if (!goods_content) goods_content = " "; | |
| 1552 | + | |
| 1553 | + //用内存对象 | |
| 1554 | + var ob={text:''}; | |
| 1555 | + if(goods_content){ | |
| 1556 | + ob.text=goods_content; | |
| 1557 | + await this.deal_iframe_next(ob) | |
| 1558 | + } | |
| 1559 | + a.wxParse(content, "html", ut.format_content(ob.text), th, 6); | |
| 1560 | + e.wxParseAddFullImageUrl(th, content); | |
| 1561 | + }, | |
| 1562 | + | |
| 1563 | + async deal_iframe_next(ob){ | |
| 1564 | + for(let i = 1; i > 0; i++){ | |
| 1565 | + //如果没有iframe语句的时候,就跳出循环 | |
| 1566 | + if(ob.text.indexOf('<iframe')<0) break | |
| 1567 | + var start=ob.text.indexOf('<iframe'); | |
| 1568 | + var end=ob.text.indexOf('</iframe>'); | |
| 1569 | + //截取iframe的dom元素 | |
| 1570 | + var str=ob.text.substring(start, end+9); | |
| 1571 | + | |
| 1572 | + var arr = str.split('vid='); | |
| 1573 | + var arrs = arr[1].split('"'); | |
| 1574 | + /* console.log("截取&前面的的"+arrs[0]);*/ | |
| 1575 | + var vipid = arrs[0]; | |
| 1576 | + | |
| 1577 | + //-- 用vipid调用接口,转换视频 -- | |
| 1578 | + var url = "https://vv.video.qq.com/getinfo?vid=" + vipid + "&platform=101001&charge=0&otype=json"; | |
| 1579 | + var res=await getApp().promiseGet(url,{}) | |
| 1580 | + if(res && res.data){ | |
| 1581 | + var dataJson = res.data.replace(/QZOutputJson=/, '') + "qwe"; | |
| 1582 | + var dataJson1 = dataJson.replace(/;qwe/, ''); | |
| 1583 | + var data = JSON.parse(dataJson1); | |
| 1584 | + if (data.vl != undefined) { | |
| 1585 | + var host1 = data['vl']['vi'][0]; | |
| 1586 | + var host2=host1['ul']['ui']; | |
| 1587 | + var len=host2.length-1; | |
| 1588 | + var host= host2[len]['url']; | |
| 1589 | + | |
| 1590 | + var fn = data.vl.vi[0].fn; | |
| 1591 | + var fvkey = data.vl.vi[0].fvkey; | |
| 1592 | + /* console.log("有参数吗"+fn+"有参数吗"+fvkey);*/ | |
| 1593 | + var wxapp_url = host + fn + '?vkey=' + fvkey; | |
| 1594 | + var frame='<video src="'+wxapp_url+'" controls="controls"></video>'; | |
| 1595 | + ob.text=ob.text.replaceAll(str,frame) | |
| 1596 | + } | |
| 1597 | + continue; | |
| 1598 | + }else{ | |
| 1599 | + break; | |
| 1600 | + } | |
| 1601 | + } | |
| 1542 | 1602 | } |
| 1543 | 1603 | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1544 | 1609 | }); |
| 1545 | 1610 | |
| 1546 | 1611 | ... | ... |
components/diy_seckill/diy_seckill.js
packageB/pages/luckactivity/luckinfo/luckinfo.js
| ... | ... | @@ -1356,6 +1356,12 @@ Page({ |
| 1356 | 1356 | url = `/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&orderSn=${ordersn}&lbId=${buyreceive_id}`; |
| 1357 | 1357 | break; |
| 1358 | 1358 | }; |
| 1359 | + //-- 每月礼包的优化,去列表领取 -- | |
| 1360 | + case 7: { | |
| 1361 | + url = `/packageE/pages/user/monthgiftbag/monthgiftbag`; | |
| 1362 | + break; | |
| 1363 | + }; | |
| 1364 | + | |
| 1359 | 1365 | }; |
| 1360 | 1366 | app.goto(url); |
| 1361 | 1367 | }, | ... | ... |
packageB/pages/luckactivity/luckinfo/luckinfo.wxml
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | <view class="list-item" wx:for="{{award}}"> |
| 51 | 51 | <view class="img-container"> |
| 52 | 52 | <image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image> |
| 53 | - <image src="{{imghost + tool.showDefaultImg(item.lbtype)}}" class="img" mode="aspectFit" wx:else></image> | |
| 53 | + <image src="{{imghost + tool.showDefaultImg(item.lbtype)}}" class="img {{item.lbtype==7?'small_set':''}} " mode="aspectFit" wx:else></image> | |
| 54 | 54 | </view> |
| 55 | 55 | <view class="item-r"> |
| 56 | 56 | <view class="fs28">{{item.luck_goods_name}}</view> |
| ... | ... | @@ -135,7 +135,7 @@ |
| 135 | 135 | <view class="popup-item" wx:for="{{list.pageData}}"> |
| 136 | 136 | <view class="img-container"> |
| 137 | 137 | <image wx:if="{{item.luck_goods_img}}" src="{{imghost + item.luck_goods_img}}" class="img" mode="aspectFit"></image> |
| 138 | - <image wx:else src="{{imghost + tool.showDefaultImg(item.luck_type)}}" class="img" mode="aspectFit"></image> | |
| 138 | + <image wx:else src="{{imghost + tool.showDefaultImg(item.luck_type)}}" class="img {{item.luck_type==7?'small_set':''}} " mode="aspectFit"></image> | |
| 139 | 139 | </view> |
| 140 | 140 | <view class="flex fdc f1"> |
| 141 | 141 | <view class="ellipsis-2 fs28">{{item.luck_name}}</view> | ... | ... |
packageB/pages/luckactivity/luckinfo/luckinfo.wxss
| ... | ... | @@ -68,7 +68,10 @@ page, |
| 68 | 68 | width: 140rpx; |
| 69 | 69 | height: 140rpx; |
| 70 | 70 | margin-right: 20rpx; |
| 71 | - /* background-color: #f5f5f5; */ | |
| 71 | + /* background-color: #f5f5f5; */ | |
| 72 | + display: flex; | |
| 73 | + align-items: center; | |
| 74 | + justify-content: center; | |
| 72 | 75 | } |
| 73 | 76 | |
| 74 | 77 | .img { |
| ... | ... | @@ -76,6 +79,10 @@ page, |
| 76 | 79 | width: 100%; |
| 77 | 80 | height: 100%; |
| 78 | 81 | } |
| 82 | +.small_set{ | |
| 83 | + width: 84rpx; | |
| 84 | + height: 84rpx; | |
| 85 | +} | |
| 79 | 86 | |
| 80 | 87 | .item-r { |
| 81 | 88 | display: flex; | ... | ... |
packageB/pages/luckactivity/luckinfo/tool.wxs
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| ... | ... | @@ -467,18 +467,20 @@ Page({ |
| 467 | 467 | ee.init(gid); |
| 468 | 468 | //------几人评价------- |
| 469 | 469 | //n.init(th, "", "comments"); |
| 470 | - //商品详情广告---- | |
| 471 | - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 472 | - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 470 | + | |
| 471 | + if(e && e.goods_bottomconent){ | |
| 472 | + //商品详情广告---- | |
| 473 | + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 474 | + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 475 | + } | |
| 476 | + | |
| 477 | + | |
| 473 | 478 | //------- |
| 474 | 479 | th.requestCardNum(), wx.pageScrollTo && th.setData({ |
| 475 | 480 | supportPageScroll: !0 |
| 476 | 481 | }); |
| 477 | 482 | |
| 478 | 483 | |
| 479 | - | |
| 480 | - | |
| 481 | - | |
| 482 | 484 | //计算等级价相关 |
| 483 | 485 | var swithc_list = e.switch_list; |
| 484 | 486 | var sw_arr = JSON.parse(swithc_list); | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
| ... | ... | @@ -402,10 +402,14 @@ Page({ |
| 402 | 402 | appoint_pick_keyid: json_d.appoint_pick_keyid |
| 403 | 403 | |
| 404 | 404 | }); |
| 405 | - //商品详情广告---- | |
| 406 | - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 407 | - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 408 | - //------- | |
| 405 | + | |
| 406 | + if(e && e.goods_bottomconent){ | |
| 407 | + //商品详情广告---- | |
| 408 | + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 409 | + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 410 | + //------- | |
| 411 | + } | |
| 412 | + | |
| 409 | 413 | // ee.init(gid); |
| 410 | 414 | //------几人评价------- |
| 411 | 415 | //n.init(th, "", "comments"); |
| ... | ... | @@ -2857,8 +2861,15 @@ Page({ |
| 2857 | 2861 | th.setData({ |
| 2858 | 2862 | g_buy_num: map, |
| 2859 | 2863 | }); |
| 2864 | + | |
| 2865 | + | |
| 2866 | + let t_prom_id=gd.prom_id; | |
| 2867 | + if(th.data.presellForm){ | |
| 2868 | + t_prom_id=th.data.presellForm.id; | |
| 2869 | + } | |
| 2870 | + | |
| 2860 | 2871 | getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum", { |
| 2861 | - data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id }, | |
| 2872 | + data: { store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: t_prom_id }, | |
| 2862 | 2873 | success: function (e) { |
| 2863 | 2874 | if (e.data.code == 0) { |
| 2864 | 2875 | th.setData({ prom_buy_num: e.data.data.sumgoodsnum }) | ... | ... |
packageD/pages/user/deposit/prepaid/msg/msg.js
| ... | ... | @@ -9,6 +9,7 @@ Page({ |
| 9 | 9 | // timer: '',//定时器名字 |
| 10 | 10 | // countDownNum: '3'//倒计时初始值 |
| 11 | 11 | iurl: o.imghost, |
| 12 | + is_nd_pw:0 | |
| 12 | 13 | }, |
| 13 | 14 | |
| 14 | 15 | |
| ... | ... | @@ -16,7 +17,11 @@ Page({ |
| 16 | 17 | * 生命周期函数--监听页面加载 |
| 17 | 18 | */ |
| 18 | 19 | onLoad: function (options) { |
| 19 | - | |
| 20 | + | |
| 21 | + if(options.is_nd_pw){ | |
| 22 | + this.data.is_nd_pw=options.is_nd_pw; | |
| 23 | + } | |
| 24 | + | |
| 20 | 25 | }, |
| 21 | 26 | |
| 22 | 27 | /** |
| ... | ... | @@ -30,37 +35,43 @@ Page({ |
| 30 | 35 | * 生命周期函数--监听页面显示 |
| 31 | 36 | */ |
| 32 | 37 | onShow: function () { |
| 33 | - getApp().check_can_share(); | |
| 34 | - wx.setNavigationBarTitle({ | |
| 35 | - title: "支付成功", | |
| 36 | - }) | |
| 38 | + getApp().check_can_share(); | |
| 39 | + wx.setNavigationBarTitle({ | |
| 40 | + title: "支付成功", | |
| 41 | + }) | |
| 42 | + | |
| 43 | + let th=this; | |
| 44 | + //判断密码是不是有开始 | |
| 45 | + if(this.data.is_nd_pw){ | |
| 46 | + getApp().request.get("/api/weshop/users/getAndUpdateUser/" + os.stoid + "/" + getApp().globalData.user_id, { | |
| 47 | + success: function (src) { | |
| 48 | + var a = src.data.data; | |
| 49 | + if(!a.vipnopwd) { | |
| 50 | + | |
| 51 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
| 52 | + my_confirm.open( | |
| 53 | + "是否启用消费时密码验证?", | |
| 54 | + "否", | |
| 55 | + "是", | |
| 56 | + function () { | |
| 57 | + my_confirm.open_cancel(0); | |
| 58 | + }, | |
| 59 | + function () { | |
| 60 | + let url = '/pages/user/userinfo/userinfo?isstcsp=1'; | |
| 61 | + wx.redirectTo({url: url,}) //跳到非tabbar页 | |
| 62 | + } | |
| 63 | + ); | |
| 64 | + } | |
| 65 | + | |
| 66 | + } | |
| 67 | + }) | |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 37 | 72 | }, |
| 38 | - // countDown: function () { | |
| 39 | - // let that = this; | |
| 40 | - // let countDownNum = that.data.countDownNum;//获取倒计时初始值 | |
| 41 | - // //如果将定时器设置在外面,那么用户就看不到countDownNum的数值动态变化,所以要把定时器存进data里面 | |
| 42 | - // that.setData({ | |
| 43 | - // timer: setInterval(function () {//这里把setInterval赋值给变量名为timer的变量 | |
| 44 | - // //每隔一秒countDownNum就减一,实现同步 | |
| 45 | - // countDownNum--; | |
| 46 | - // //然后把countDownNum存进data,好让用户知道时间在倒计着 | |
| 47 | - // that.setData({ | |
| 48 | - // countDownNum: countDownNum | |
| 49 | - // }) | |
| 50 | - // //在倒计时还未到0时,这中间可以做其他的事情,按项目需求来 | |
| 51 | - // if (countDownNum == 0) { | |
| 52 | - // //这里特别要注意,计时器是始终一直在走的,如果你的时间为0,那么就要关掉定时器!不然相当耗性能 | |
| 53 | - // //因为timer是存在data里面的,所以在关掉时,也要在data里取出后再关闭 | |
| 54 | - // clearInterval(that.data.timer); | |
| 55 | - // //关闭定时器之后,可作其他处理codes go here | |
| 56 | - // //--跳到绑定页面-- | |
| 57 | - // wx.navigateTo({ | |
| 58 | - // url: '../../../integral/jf', | |
| 59 | - // }) | |
| 60 | - // } | |
| 61 | - // }, 500) | |
| 62 | - // }) | |
| 63 | - | |
| 73 | + | |
| 74 | + | |
| 64 | 75 | click:function(){ |
| 65 | 76 | wx.redirectTo({ |
| 66 | 77 | //url: '../../../integral/jf', | ... | ... |
packageD/pages/user/deposit/prepaid/msg/msg.json
packageD/pages/user/deposit/prepaid/msg/msg.wxml
packageD/pages/user/deposit/prepaid/prepaid.js
| ... | ... | @@ -117,7 +117,7 @@ Page({ |
| 117 | 117 | t_pay.set_fir(); |
| 118 | 118 | |
| 119 | 119 | //-- 通联的第三方支付的返回优化 -- |
| 120 | - ut.is_pay_ok(th.data.ok_order_sn,"/packageD/pages/user/deposit/prepaid/msg/msg","none",function (){ | |
| 120 | + ut.is_pay_ok(th.data.ok_order_sn,"/packageD/pages/user/deposit/prepaid/msg/msg?is_nd_pw=1","none",function (){ | |
| 121 | 121 | if(!th.data.ok_order_sn) return false; |
| 122 | 122 | var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; |
| 123 | 123 | getApp().request.promiseGet(ck_url,{}).then(res=>{ |
| ... | ... | @@ -127,7 +127,7 @@ Page({ |
| 127 | 127 | //支付支付,返回首页 |
| 128 | 128 | ut.m_toast('支付成功'); |
| 129 | 129 | setTimeout(()=>{ |
| 130 | - getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg"); | |
| 130 | + getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg?is_nd_pw=1"); | |
| 131 | 131 | },1000) |
| 132 | 132 | |
| 133 | 133 | }else{ |
| ... | ... | @@ -183,8 +183,8 @@ Page({ |
| 183 | 183 | |
| 184 | 184 | var buynum = 1; |
| 185 | 185 | console.log(money, "有进来吗预存劵", advancek, user_id, store_id ); |
| 186 | - var e = this, | |
| 187 | - perpaid = ""; | |
| 186 | + var e = this, perpaid = ""; | |
| 187 | + let th=this; | |
| 188 | 188 | await getApp().request.promiseGet("/api/weshop/users/getPay", { |
| 189 | 189 | data: { |
| 190 | 190 | account: money, |
| ... | ... | @@ -220,7 +220,7 @@ Page({ |
| 220 | 220 | e.jumpPaymentPage(); |
| 221 | 221 | }, function (e) { |
| 222 | 222 | |
| 223 | - this.data.paying=0; | |
| 223 | + th.data.paying=0; | |
| 224 | 224 | wx.showToast({ |
| 225 | 225 | title: e, |
| 226 | 226 | icon: 'none', |
| ... | ... | @@ -248,10 +248,11 @@ Page({ |
| 248 | 248 | // }) |
| 249 | 249 | }) |
| 250 | 250 | }, |
| 251 | + | |
| 251 | 252 | //------支付成功页面-------- |
| 252 | 253 | jumpPaymentPage: function () { |
| 253 | 254 | wx.redirectTo({ |
| 254 | - url:"msg/msg", | |
| 255 | + url:"msg/msg?is_nd_pw=1", | |
| 255 | 256 | }); |
| 256 | 257 | }, |
| 257 | 258 | ... | ... |
packageE/pages/cart/cart2/cart2.js
| ... | ... | @@ -2367,7 +2367,7 @@ Page({ |
| 2367 | 2367 | if (get_data.gift_id && parseInt(get_data.zp_mode) != 1 |
| 2368 | 2368 | && (get_data.zp_num * item_map.bs <= get_data.limit_num-other_gift || !get_data.limit_num) |
| 2369 | 2369 | && get_data.zp_num * item_map.bs <= get_data.gift_storecount |
| 2370 | - && get_data.zp_num>get_data.must_num //增加一个超量 | |
| 2370 | + && get_data.zp_num>=get_data.must_num //增加一个超量 | |
| 2371 | 2371 | ) { |
| 2372 | 2372 | |
| 2373 | 2373 | item_map.gift_id = get_data.gift_id; |
| ... | ... | @@ -7823,7 +7823,9 @@ Page({ |
| 7823 | 7823 | var index = e.index; |
| 7824 | 7824 | |
| 7825 | 7825 | var collocationList = this.data.cartlist[cart_index].collocationList; |
| 7826 | - var item = collocationList[index]; | |
| 7826 | + var item =JSON.parse(JSON.stringify(collocationList[index])); | |
| 7827 | + | |
| 7828 | + | |
| 7827 | 7829 | var goods = this.data.cartlist[cart_index].goods; |
| 7828 | 7830 | var txt = 'cartlist[' + cart_index + '].goods'; |
| 7829 | 7831 | var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected'; |
| ... | ... | @@ -7889,6 +7891,8 @@ Page({ |
| 7889 | 7891 | item.prom_type = 5; |
| 7890 | 7892 | item.is_collocation = 1; |
| 7891 | 7893 | item.is_post_temp = 1; |
| 7894 | + if(!item.original_img) item.original_img=1; | |
| 7895 | + else item.original_img=th.data.imgUrl+item.original_img; | |
| 7892 | 7896 | |
| 7893 | 7897 | goods.push(item); |
| 7894 | 7898 | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxml
| ... | ... | @@ -34,18 +34,25 @@ |
| 34 | 34 | <text>{{items.giftTitle}}</text> |
| 35 | 35 | </view> |
| 36 | 36 | <view class="content_ware_type flex"> |
| 37 | - <block wx:if="{{items.payMoney>0}}"> | |
| 38 | - <text>{{"¥"+items.payMoney}}</text> | |
| 37 | + <block wx:if="{{items.money_type>0}}"> | |
| 38 | + {{"¥"+items.payMoney}}+{{items.payIntegral}}积分 | |
| 39 | 39 | </block> |
| 40 | - <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}"> | |
| 41 | - <text>/</text> | |
| 42 | - </block> | |
| 43 | - <block wx:if="{{items.payIntegral>0}}"> | |
| 44 | - <view class="flex"> | |
| 45 | - <text class="ellipsis-1">{{items.payIntegral}}</text> | |
| 46 | - <view>积分</view> | |
| 47 | - </view> | |
| 40 | + <block wx:else> | |
| 41 | + <block wx:if="{{items.payMoney>0}}"> | |
| 42 | + <text>{{"¥"+items.payMoney}}</text> | |
| 43 | + </block> | |
| 44 | + <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}"> | |
| 45 | + <text>/</text> | |
| 46 | + </block> | |
| 47 | + <block wx:if="{{items.payIntegral>0}}"> | |
| 48 | + <view class="flex"> | |
| 49 | + <text class="ellipsis-1">{{items.payIntegral}}</text> | |
| 50 | + <view>积分</view> | |
| 51 | + </view> | |
| 52 | + </block> | |
| 48 | 53 | </block> |
| 54 | + | |
| 55 | + | |
| 49 | 56 | </view> |
| 50 | 57 | <view class="content_ware_price no_line_c"> |
| 51 | 58 | <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text> |
| ... | ... | @@ -69,17 +76,10 @@ |
| 69 | 76 | </view> |
| 70 | 77 | <block wx:if="{{now > items.starTime1}}"> |
| 71 | 78 | <view class="flex-vertical"> |
| 72 | - <block wx:if="{{items.payMoney>0 && items.payIntegral>0}}"> | |
| 73 | - <block wx:if="{{items.payMoney>0}}"> | |
| 74 | - <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}"> | |
| 79 | + <block wx:if="{{items.money_type>0}}"> | |
| 80 | + <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}"> | |
| 75 | 81 | <button class="box_button_dui">立即购买</button> |
| 76 | 82 | </view> |
| 77 | - </block> | |
| 78 | - <block wx:if="{{items.payIntegral>0}}"> | |
| 79 | - <view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}"> | |
| 80 | - <button class="box_button_dui box_button_buy">立即兑换</button> | |
| 81 | - </view> | |
| 82 | - </block> | |
| 83 | 83 | </block> |
| 84 | 84 | <block wx:else> |
| 85 | 85 | <block wx:if="{{items.payMoney>0}}"> | ... | ... |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
| ... | ... | @@ -99,11 +99,56 @@ Page({ |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| 102 | + var th = this; | |
| 103 | + this.setData({ | |
| 104 | + getUserID: d.user_id, | |
| 105 | + getStorageID: a.stoid, | |
| 106 | + }) | |
| 107 | + | |
| 108 | + if(!options.lbId && options.scene){ | |
| 109 | + var gid_str = decodeURIComponent(options.scene); | |
| 110 | + gid_str = gid_str.split("_"); | |
| 111 | + options.lbId=gid_str[0]; | |
| 112 | + options.id=gid_str[0]; | |
| 113 | + options.first_leader=gid_str[1]; | |
| 114 | + options.isBuy=1; | |
| 115 | + } | |
| 116 | + | |
| 102 | 117 | this.setData({ |
| 103 | 118 | params: options, |
| 104 | 119 | getGiftID:options.id |
| 105 | 120 | }) |
| 106 | 121 | |
| 122 | + | |
| 123 | + this.setData({ | |
| 124 | + isBuy: options.isBuy, | |
| 125 | + getGiftID: options.lbId, | |
| 126 | + orderSn: options.orderSn, | |
| 127 | + flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 | |
| 128 | + record_list_id:options.record_list_id, | |
| 129 | + is_receive:options.is_receive | |
| 130 | + }) | |
| 131 | + if (options.lbId) th.data.lbId = options.lbId; | |
| 132 | + //-- 获取分享人的ID -- | |
| 133 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 134 | + if (first_leader) { | |
| 135 | + this.setData({ | |
| 136 | + first_leader, | |
| 137 | + }) | |
| 138 | + //-- user_id代过来免登录 -- | |
| 139 | + getApp().globalData.first_leader = first_leader; | |
| 140 | + //调用接口判断是不是会员 | |
| 141 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 142 | + if (res.data.code == 0) { | |
| 143 | + getApp().globalData.guide_id = res.data.data.id; | |
| 144 | + getApp().globalData.guide_pick_id= res.data.data.pickup_id | |
| 145 | + } | |
| 146 | + }) | |
| 147 | + } | |
| 148 | + th.close(); | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 107 | 152 | getApp().getConfig(function (e) { |
| 108 | 153 | th.setData({sto_sele_name_1: e.store_name}) |
| 109 | 154 | }) |
| ... | ... | @@ -148,7 +193,7 @@ Page({ |
| 148 | 193 | // sele_g:monthgiftbag, |
| 149 | 194 | // def_pick_store:monthgiftba_defpick |
| 150 | 195 | // }) |
| 151 | - let scene = wx.getLaunchOptionsSync().scene; | |
| 196 | + let scene=wx.getLaunchOptionsSync().scene; | |
| 152 | 197 | if (scene==1154) { |
| 153 | 198 | this.setData({ |
| 154 | 199 | scene |
| ... | ... | @@ -157,50 +202,8 @@ Page({ |
| 157 | 202 | } |
| 158 | 203 | }, |
| 159 | 204 | init() { |
| 160 | - let options = this.data?.params; // this.data == null ? undefined:this.data.params | |
| 161 | - var th = this; | |
| 162 | - this.setData({ | |
| 163 | - getUserID: d.user_id, | |
| 164 | - getStorageID: a.stoid, | |
| 165 | - }) | |
| 166 | - | |
| 167 | - if(!options.lbId && options.scene){ | |
| 168 | - var gid_str = decodeURIComponent(options.scene); | |
| 169 | - gid_str = gid_str.split("_"); | |
| 170 | - | |
| 171 | - options.lbId=gid_str[0]; | |
| 172 | - options.first_leader=gid_str[1]; | |
| 173 | - options.isBuy=1; | |
| 174 | - } | |
| 175 | - | |
| 176 | 205 | |
| 177 | - this.setData({ | |
| 178 | - isBuy: options.isBuy, | |
| 179 | - getGiftID: options.lbId, | |
| 180 | - orderSn: options.orderSn, | |
| 181 | - flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 | |
| 182 | - record_list_id:options.record_list_id, | |
| 183 | - is_receive:options.is_receive | |
| 184 | - }) | |
| 185 | - if (options.lbId) th.data.lbId = options.lbId; | |
| 186 | - //-- 获取分享人的ID -- | |
| 187 | - var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 188 | - if (first_leader) { | |
| 189 | - this.setData({ | |
| 190 | - first_leader, | |
| 191 | - }) | |
| 192 | - //-- user_id代过来免登录 -- | |
| 193 | - getApp().globalData.first_leader = first_leader; | |
| 194 | - //调用接口判断是不是会员 | |
| 195 | - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 196 | - if (res.data.code == 0) { | |
| 197 | - getApp().globalData.guide_id = res.data.data.id; | |
| 198 | - getApp().globalData.guide_pick_id= res.data.data.pickup_id | |
| 199 | - } | |
| 200 | - }) | |
| 201 | - } | |
| 202 | - th.close(); | |
| 203 | - | |
| 206 | + var th=this; | |
| 204 | 207 | //-- 检测一下有没有门店 -- |
| 205 | 208 | th.check_guide(function (){ |
| 206 | 209 | com.wait_for_store_config(th); |
| ... | ... | @@ -944,12 +947,16 @@ Page({ |
| 944 | 947 | //--- 分享设置 -- |
| 945 | 948 | onShareAppMessage: function (e) { |
| 946 | 949 | getApp().globalData.no_clear = 1; |
| 950 | + | |
| 951 | + var ee=this; | |
| 947 | 952 | var curPage = this; |
| 948 | 953 | var pagePath = curPage.route; //当前页面url |
| 949 | 954 | if (pagePath.indexOf('/') != 0) { |
| 950 | 955 | pagePath = '/' + pagePath; |
| 951 | 956 | } |
| 952 | - pagePath += "?isBuy=1" + "&id=" + this.data.options.id + "&first_leader=" + this.data.getUserID; | |
| 957 | + | |
| 958 | + | |
| 959 | + pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; | |
| 953 | 960 | console.log('分享路径'); |
| 954 | 961 | console.log(pagePath); |
| 955 | 962 | // if (this.data.isBuy == 0) { |
| ... | ... | @@ -958,9 +965,14 @@ Page({ |
| 958 | 965 | // pagePath += "&lbId=" + this.data.getGiftID; |
| 959 | 966 | // } |
| 960 | 967 | // console.log('pagePath', pagePath); |
| 968 | + | |
| 969 | + var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); | |
| 970 | + | |
| 971 | + | |
| 961 | 972 | return { |
| 962 | 973 | title: "礼包详情", |
| 963 | 974 | path: pagePath, |
| 975 | + imageUrl: img, | |
| 964 | 976 | } |
| 965 | 977 | }, |
| 966 | 978 | |
| ... | ... | @@ -970,13 +982,17 @@ Page({ |
| 970 | 982 | onShareTimeline() { |
| 971 | 983 | getApp().globalData.no_clear = 1; |
| 972 | 984 | |
| 973 | - var pagePath = "&isBuy=1" + "&id=" + this.data.options.id + "&first_leader=" + this.data.getUserID; | |
| 985 | + var ee=this; | |
| 986 | + var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; | |
| 974 | 987 | var user_id = getApp().globalData.user_id; |
| 975 | 988 | if (!user_id) user_id = 0; |
| 976 | 989 | |
| 990 | + var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); | |
| 991 | + | |
| 977 | 992 | return { |
| 978 | 993 | title: "礼包详情", |
| 979 | - query: 'first_leader=' + user_id + pagePath | |
| 994 | + query: 'first_leader=' + user_id + pagePath, | |
| 995 | + imageUrl: img, | |
| 980 | 996 | } |
| 981 | 997 | }, |
| 982 | 998 | |
| ... | ... | @@ -1489,7 +1505,7 @@ Page({ |
| 1489 | 1505 | |
| 1490 | 1506 | var app = getApp(); |
| 1491 | 1507 | var unit = that.data.screenWidth / 750 * 1.35; //基础单位, |
| 1492 | - var scene = th.data.lbId + ""; | |
| 1508 | + var scene = th.data.sele_g.id + ""; | |
| 1493 | 1509 | |
| 1494 | 1510 | var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; |
| 1495 | 1511 | if (user_id > 0) { |
| ... | ... | @@ -1497,7 +1513,7 @@ Page({ |
| 1497 | 1513 | } |
| 1498 | 1514 | ///二微码 |
| 1499 | 1515 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
| 1500 | - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/giftpack/giftpacklist/giftpacklist"; | |
| 1516 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo"; | |
| 1501 | 1517 | |
| 1502 | 1518 | // 读取文件成功则OK-- |
| 1503 | 1519 | wx.getImageInfo({ |
| ... | ... | @@ -1606,7 +1622,7 @@ Page({ |
| 1606 | 1622 | let src = ''; |
| 1607 | 1623 | context.beginPath(); |
| 1608 | 1624 | if (type == 0) { // 普通 |
| 1609 | - src = '../../../images/share/q_tj.png'; | |
| 1625 | + src = '/images/share/q_tj.png'; | |
| 1610 | 1626 | context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit); |
| 1611 | 1627 | context.setFontSize(16 * unit) |
| 1612 | 1628 | context.setFillStyle("white") |
| ... | ... | @@ -1615,8 +1631,8 @@ Page({ |
| 1615 | 1631 | } |
| 1616 | 1632 | |
| 1617 | 1633 | |
| 1618 | - let price = this.data.giftPrice; | |
| 1619 | - let giftIntegral = this.data.giftIntegral; | |
| 1634 | + let price = this.data.sele_g.payMoney; | |
| 1635 | + let giftIntegral = this.data.sele_g.payIntegral; | |
| 1620 | 1636 | context.setFontSize(32 * unit); |
| 1621 | 1637 | context.setFillStyle('#DE1117'); |
| 1622 | 1638 | |
| ... | ... | @@ -1624,11 +1640,17 @@ Page({ |
| 1624 | 1640 | if(price || giftIntegral){ |
| 1625 | 1641 | if(price){ |
| 1626 | 1642 | price_txt='¥' + price; |
| 1627 | - if(giftIntegral) price_txt+='+'; | |
| 1643 | + if(giftIntegral){ | |
| 1644 | + if(this.data.sele_g.money_type>0){ | |
| 1645 | + price_txt+='+'; | |
| 1646 | + }else{ | |
| 1647 | + price_txt+='或'; | |
| 1648 | + } | |
| 1649 | + } | |
| 1628 | 1650 | } |
| 1629 | 1651 | if(giftIntegral) price_txt+=giftIntegral+'积分'; |
| 1630 | 1652 | }else{ |
| 1631 | - price_txt="¥0"; | |
| 1653 | + price_txt="免费领取"; | |
| 1632 | 1654 | } |
| 1633 | 1655 | |
| 1634 | 1656 | context.fillText(price_txt, 54 * unit, 735 * unit); |
| ... | ... | @@ -1683,7 +1705,8 @@ Page({ |
| 1683 | 1705 | tt(); |
| 1684 | 1706 | return false; |
| 1685 | 1707 | } |
| 1686 | - var img_url = ee.data.giftImageCover ? ee.data.giftImageCover : ee.data.giftImage; | |
| 1708 | + var img_url =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); | |
| 1709 | + | |
| 1687 | 1710 | //获取商品是分享图信息 |
| 1688 | 1711 | wx.getImageInfo({ |
| 1689 | 1712 | src: img_url, | ... | ... |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
| ... | ... | @@ -10,13 +10,12 @@ |
| 10 | 10 | </view> |
| 11 | 11 | |
| 12 | 12 | <view class="top_title data-v-3a5b7e36"> |
| 13 | - <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{monthgiftbag.giftTitle}}</text> | |
| 14 | - | |
| 13 | + <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{monthgiftbag.giftTitle}}</text> | |
| 15 | 14 | <!-- 这个是分享按钮 --> |
| 16 | - <!-- <view wx:if="{{c_state<2}}" class="xc-share-frame t-c" bindtap="clickShare"> | |
| 15 | + <view wx:if="{{c_state<2}}" class="xc-share-frame t-c" bindtap="clickShare"> | |
| 17 | 16 | <view class="iconfont icon-share fs40" ></view> |
| 18 | 17 | <view class="fs22 c-7b">分享</view> |
| 19 | - </view> --> | |
| 18 | + </view> | |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | </view> |
| ... | ... | @@ -45,16 +44,21 @@ |
| 45 | 44 | |
| 46 | 45 | <view class="top_price data-v-3a5b7e36"> |
| 47 | 46 | |
| 47 | + <block wx:if="{{monthgiftbag.money_type>0}}"> | |
| 48 | + {{"¥"+monthgiftbag.lbPrice}}+{{monthgiftbag.payIntegral+"积分"}} | |
| 49 | + </block> | |
| 50 | + <block wx:else> | |
| 51 | + <block wx:if="{{monthgiftbag.lbPrice>0}}"> | |
| 52 | + <text class="data-v-3a5b7e36">{{"¥"+monthgiftbag.lbPrice}}</text> | |
| 53 | + </block> | |
| 54 | + <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> | |
| 55 | + <text class="data-v-3a5b7e36">/</text> | |
| 56 | + </block> | |
| 57 | + <block wx:if="{{monthgiftbag.payIntegral>0}}"> | |
| 58 | + <text class="data-v-3a5b7e36">{{monthgiftbag.payIntegral+"积分"}}</text> | |
| 59 | + </block> | |
| 60 | + </block> | |
| 48 | 61 | |
| 49 | - <block wx:if="{{monthgiftbag.lbPrice>0}}"> | |
| 50 | - <text class="data-v-3a5b7e36">{{"¥"+monthgiftbag.lbPrice}}</text> | |
| 51 | - </block> | |
| 52 | - <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> | |
| 53 | - <text class="data-v-3a5b7e36">/</text> | |
| 54 | - </block> | |
| 55 | - <block wx:if="{{monthgiftbag.payIntegral>0}}"> | |
| 56 | - <text class="data-v-3a5b7e36">{{monthgiftbag.payIntegral+"积分"}}</text> | |
| 57 | - </block> | |
| 58 | 62 | <!-- <block wx:if="{{giftType>0}}"> |
| 59 | 63 | <text class="data-v-3a5b7e36">{{actTitle}}</text> |
| 60 | 64 | </block> --> |
| ... | ... | @@ -154,37 +158,33 @@ |
| 154 | 158 | <block wx:if="{{getUserID && monthgiftbag.giftTitle}}"> |
| 155 | 159 | <block wx:if="{{isStart==1}}"> |
| 156 | 160 | <view class="foot_button data-v-3a5b7e36"> |
| 157 | - <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> | |
| 158 | - <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_left data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
| 159 | - <text class="data-v-3a5b7e36 ">立即购买</text> | |
| 160 | - </view> | |
| 161 | - <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 162 | - <text class="data-v-3a5b7e36">立即兑换</text> | |
| 163 | - </view> | |
| 164 | - </block> | |
| 165 | - <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral<=0}}"> | |
| 166 | - <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_buy data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
| 167 | - <text class="data-v-3a5b7e36">立即购买</text> | |
| 168 | - </view> | |
| 169 | - </block> | |
| 170 | - <block wx:if="{{monthgiftbag.lbPrice<=0 && monthgiftbag.payIntegral>0}}"> | |
| 171 | - <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 172 | - <text class="data-v-3a5b7e36">立即兑换</text> | |
| 173 | - </view> | |
| 174 | - </block> | |
| 175 | - <block wx:if="{{monthgiftbag.lbPrice<=0 && monthgiftbag.payIntegral<=0}}"> | |
| 176 | - <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_buy data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}"> | |
| 177 | - <text class="data-v-3a5b7e36">免费领取</text> | |
| 178 | - </view> | |
| 179 | - </block> | |
| 180 | - <!-- <block > | |
| 181 | - <view class="foot_button_intalge data-v-3a5b7e36 " wx:if="{{!is_receive}}" bindtap="getGift" data-id="{{lbId}}"> | |
| 182 | - <text class="data-v-3a5b7e36">领取</text> | |
| 183 | - </view> | |
| 184 | - <view class="foot_button_intalge data-v-3a5b7e36 " wx:if="{{is_receive}}" data-id="{{lbId}}"> | |
| 185 | - <text class="data-v-3a5b7e36">已领取</text> | |
| 186 | - </view> | |
| 187 | - </block> --> | |
| 161 | + | |
| 162 | + <block wx:if="{{monthgiftbag.money_type>0}}"> | |
| 163 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_left data-v-3a5b7e36" data-money="{{monthgiftbag.lbPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
| 164 | + <text class="data-v-3a5b7e36 ">立即购买</text> | |
| 165 | + </view> | |
| 166 | + </block> | |
| 167 | + <block wx:else> | |
| 168 | + <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}"> | |
| 169 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_left data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice"> | |
| 170 | + <text class="data-v-3a5b7e36 ">立即购买</text> | |
| 171 | + </view> | |
| 172 | + <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 173 | + <text class="data-v-3a5b7e36">立即兑换</text> | |
| 174 | + </view> | |
| 175 | + </block> | |
| 176 | + <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral<=0}}"> | |
| 177 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_buy data-v-3a5b7e36 " data-money="{{monthgiftbag.lbPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}"> | |
| 178 | + <text class="data-v-3a5b7e36">立即购买</text> | |
| 179 | + </view> | |
| 180 | + </block> | |
| 181 | + <block wx:if="{{monthgiftbag.lbPrice<=0 && monthgiftbag.payIntegral>0}}"> | |
| 182 | + <view style="{{scene==1154 ? 'background:#b9b5b5':''}}" class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}"> | |
| 183 | + <text class="data-v-3a5b7e36">立即兑换</text> | |
| 184 | + </view> | |
| 185 | + </block> | |
| 186 | + </block> | |
| 187 | + | |
| 188 | 188 | </view> |
| 189 | 189 | </block> |
| 190 | 190 | <block wx:else> | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
| ... | ... | @@ -59,6 +59,9 @@ |
| 59 | 59 | <block wx:if="{{item.payMoney>0}}"> |
| 60 | 60 | <text>{{"¥"+item.payMoney}}</text> |
| 61 | 61 | </block> |
| 62 | + | |
| 63 | + <block wx:if="{{item.payMoney>0 && item.payIntegral>0}}">+</block> | |
| 64 | + | |
| 62 | 65 | <block wx:if="{{item.payIntegral>0}}"> |
| 63 | 66 | <text>{{item.payIntegral+"积分"}}</text> |
| 64 | 67 | </block> | ... | ... |
packageE/pages/user/monthgiftbag/public/buy_com.js
| ... | ... | @@ -244,7 +244,11 @@ module.exports = { |
| 244 | 244 | //-- 分享导购要记录 -- |
| 245 | 245 | if (getApp().globalData.guide_id) { |
| 246 | 246 | json.guide_id = getApp().globalData.guide_id; |
| 247 | - } | |
| 247 | + } | |
| 248 | + //-- 如果是且的购买每月礼包的话 -- | |
| 249 | + if(th.data.sele_g.money_type>0){ | |
| 250 | + json.exchangeintegral=th.data.sele_g.payIntegral | |
| 251 | + } | |
| 248 | 252 | |
| 249 | 253 | // var url ="/api/weshop/marketing/buy/receive/gift/record/insert"; |
| 250 | 254 | var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder"; | ... | ... |
packageE/pages/user/monthgiftbag/public/buy_com.wxml
| ... | ... | @@ -157,19 +157,26 @@ |
| 157 | 157 | <view class="spec-goods-name ellipsis-2">{{sele_g.giftTitle}}</view> |
| 158 | 158 | <view class="flex ai_end xc-val-money"> |
| 159 | 159 | <view class="spec-goods-price"> |
| 160 | - <block wx:if="{{sele_g.payMoney>0}}"> | |
| 161 | - <text>{{"¥"+sele_g.payMoney}}</text> | |
| 162 | - </block> | |
| 163 | - <block wx:if="{{sele_g.payMoney>0&&sele_g.payIntegral>0}}"> | |
| 164 | - <text>/</text> | |
| 160 | + | |
| 161 | + <block wx:if="{{sele_g.money_type>0}}"> | |
| 162 | + {{"¥"+sele_g.payMoney}}+{{sele_g.payIntegral}}积分 | |
| 165 | 163 | </block> |
| 166 | - <block wx:if="{{sele_g.payIntegral>0}}"> | |
| 167 | - <view class="flex"> | |
| 168 | - <text class="ellipsis-1">{{sele_g.payIntegral}}</text> | |
| 169 | - <view>积分</view> | |
| 170 | - </view> | |
| 164 | + <block wx:else> | |
| 165 | + <block wx:if="{{sele_g.payMoney>0}}"> | |
| 166 | + <text>{{"¥"+sele_g.payMoney}}</text> | |
| 167 | + </block> | |
| 168 | + <block wx:if="{{sele_g.payMoney>0&&sele_g.payIntegral>0}}"> | |
| 169 | + <text>/</text> | |
| 170 | + </block> | |
| 171 | + <block wx:if="{{sele_g.payIntegral>0}}"> | |
| 172 | + <view class="flex"> | |
| 173 | + <text class="ellipsis-1">{{sele_g.payIntegral}}</text> | |
| 174 | + <view>积分</view> | |
| 175 | + </view> | |
| 176 | + </block> | |
| 171 | 177 | </block> |
| 172 | 178 | |
| 179 | + | |
| 173 | 180 | </view> |
| 174 | 181 | </view> |
| 175 | 182 | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| ... | ... | @@ -144,7 +144,16 @@ Page({ |
| 144 | 144 | navigateTo: function (e) { |
| 145 | 145 | var th = this; |
| 146 | 146 | var url = e.currentTarget.dataset.url; |
| 147 | - getApp().goto(url); | |
| 147 | + let is_back = e.currentTarget.dataset.is_back | |
| 148 | + if (is_back==1) { | |
| 149 | + wx.showToast({ | |
| 150 | + title: '该礼包已退款', | |
| 151 | + icon: 'none', | |
| 152 | + duration: 2000 | |
| 153 | + }) | |
| 154 | + }else { | |
| 155 | + getApp().goto(url); | |
| 156 | + } | |
| 148 | 157 | }, |
| 149 | 158 | //下拉事件 |
| 150 | 159 | onReachBottom: function () { | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxml
| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | </view> |
| 24 | 24 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| 25 | 25 | <view class="content_box"> |
| 26 | - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> | |
| 26 | + <view class="content_box_ware" bindtap="navigateTo" data-is_back="{{item.is_back}}" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> | |
| 27 | 27 | <view class="content_box_img"> |
| 28 | 28 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> |
| 29 | 29 | <image wx:if="{{item.cover_img}}" src="{{iurl+item.cover_img}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].cover_img"></image> |
| ... | ... | @@ -93,9 +93,10 @@ |
| 93 | 93 | |
| 94 | 94 | </view> |
| 95 | 95 | </view> |
| 96 | - <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> | |
| 96 | + <view wx:if="{{item.is_back !=1}}" class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.orderSn}}"> | |
| 97 | 97 | <button>立即使用</button> |
| 98 | 98 | </view> |
| 99 | + <view class="content_box_button" style="color:#b9b5b5;" wx:else>已退款</view> | |
| 99 | 100 | </view> |
| 100 | 101 | </block> |
| 101 | 102 | <block wx:if="{{is_read && wareCard.length<1 && is_get}}"> | ... | ... |
pages/giftpack/public/buy_com.js
pages/giftpack/public/buy_com.wxml
| ... | ... | @@ -155,7 +155,7 @@ |
| 155 | 155 | <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{iurl+(sele_g.cover_img?sele_g.cover_img:sele_g.lbUrl)}}" binderror="pop_err_img" data-errorimg=""></image> |
| 156 | 156 | <view class="spec-goods-info"> |
| 157 | 157 | <view class="spec-goods-name ellipsis-2">{{sele_g.giftTitle}}</view> |
| 158 | - <view class="flex ai_end xc-val-money"> | |
| 158 | + <view class="flex ai_end xc-val-money" wx:if="{{buyType<4}}"> | |
| 159 | 159 | <view class="spec-goods-price"> |
| 160 | 160 | <block wx:if="{{sele_g.payMoney>0}}"> |
| 161 | 161 | <text>{{"¥"+sele_g.payMoney}}</text> |
| ... | ... | @@ -174,14 +174,15 @@ |
| 174 | 174 | </view> |
| 175 | 175 | |
| 176 | 176 | |
| 177 | - <view class="flex"> | |
| 177 | + <view class="flex" wx:if="{{buyType<4}}"> | |
| 178 | 178 | <view class="spec-goods-stock" >已售:{{sele_g.giftQty}}</view> |
| 179 | 179 | <view class="spec-goods-stock">可售:{{sele_g.lbnum-sele_g.giftQty+(sele_g.virtualsales?sele_g.virtualsales:0)}}</view> |
| 180 | 180 | </view> |
| 181 | - | |
| 182 | 181 | </view> |
| 182 | + | |
| 183 | + <view style="clear:both;" ></view> | |
| 183 | 184 | <!-- 选择门店模块 --> |
| 184 | - <view class="flex-space-between address ai_end xc-width "> | |
| 185 | + <view class="flex-space-between address ai_end xc-width {{buyType>3?'mgt20':''}}"> | |
| 185 | 186 | <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> |
| 186 | 187 | <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text> |
| 187 | 188 | <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> |
| ... | ... | @@ -249,6 +250,7 @@ |
| 249 | 250 | <text wx:if="{{buyType==1}}">立即兑换</text> |
| 250 | 251 | <text wx:if="{{buyType==2}}">立即购买</text> |
| 251 | 252 | <text wx:if="{{buyType==3}}">立即领取</text> |
| 253 | + <text wx:if="{{buyType==4}}">确认选择</text> | |
| 252 | 254 | </button> |
| 253 | 255 | </block> |
| 254 | 256 | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -489,10 +489,13 @@ Page({ |
| 489 | 489 | // goods_bottomconent:e.goods_bottomconent |
| 490 | 490 | }); |
| 491 | 491 | |
| 492 | - //商品详情广告---- | |
| 493 | - a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 494 | - common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 495 | - //------- | |
| 492 | + //判断商品详情要有东西 | |
| 493 | + if(e && e.goods_bottomconent) { | |
| 494 | + //商品详情广告---- | |
| 495 | + a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); | |
| 496 | + common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); | |
| 497 | + //------- | |
| 498 | + } | |
| 496 | 499 | |
| 497 | 500 | //------几人评价------- |
| 498 | 501 | //n.init(th, "", "comments"); |
| ... | ... | @@ -504,6 +507,7 @@ Page({ |
| 504 | 507 | //计算等级价相关 |
| 505 | 508 | var swithc_list = e.switch_list; |
| 506 | 509 | var sw_arr = JSON.parse(swithc_list); |
| 510 | + console.log('plus-111') | |
| 507 | 511 | //---如果后台又开等级卡的开关--- |
| 508 | 512 | ut.get_plus_name_price(sw_arr, th); |
| 509 | 513 | |
| ... | ... | @@ -1121,13 +1125,13 @@ Page({ |
| 1121 | 1125 | if (t.data.data.original_img.indexOf(o.imghost) == -1) |
| 1122 | 1126 | t.data.data.original_img = o.imghost + t.data.data.original_img; |
| 1123 | 1127 | |
| 1128 | + /* -----商品详情--- | |
| 1124 | 1129 | if (t.data.data.goods_content == null) t.data.data.goods_content = ""; |
| 1125 | - | |
| 1126 | - //-----商品详情--- | |
| 1127 | 1130 | if (!t.data.data.goods_content) t.data.data.goods_content = " "; |
| 1128 | - | |
| 1129 | 1131 | a.wxParse("content", "html", ut.format_content(t.data.data.goods_content), ee, 6); |
| 1130 | - e.wxParseAddFullImageUrl(ee, "content"); | |
| 1132 | + e.wxParseAddFullImageUrl(ee, "content");--*/ | |
| 1133 | + | |
| 1134 | + getApp().deal_iframe(a,e,'content',t.data.data.goods_content,ee); | |
| 1131 | 1135 | |
| 1132 | 1136 | //if (ee.data.prom_type) { |
| 1133 | 1137 | t.data.data.prom_type = ee.data.prom_type; |
| ... | ... | @@ -5318,6 +5322,21 @@ Page({ |
| 5318 | 5322 | }, |
| 5319 | 5323 | |
| 5320 | 5324 | //-----------------拼单生成方法--------------------- |
| 5325 | + // addCart_pt: function () { | |
| 5326 | + // var th = this; | |
| 5327 | + // if (this.data.is_normal == 0) { | |
| 5328 | + // //看一下有没有起购数,如果有起购数,要计算起购数 | |
| 5329 | + // var qnum = parseFloat(th.data.prom_act.minbuynum); | |
| 5330 | + // if (qnum > 0 && th.data.goodsInputNum < qnum) { | |
| 5331 | + // getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | |
| 5332 | + // return false; | |
| 5333 | + // } | |
| 5334 | + // } | |
| 5335 | + // th.addcart_pt_func(); | |
| 5336 | + // | |
| 5337 | + // }, | |
| 5338 | + | |
| 5339 | + //-----------------拼单生成方法--------------------- | |
| 5321 | 5340 | addCart_pt: function () { |
| 5322 | 5341 | var th = this; |
| 5323 | 5342 | if (this.data.is_normal == 0) { |
| ... | ... | @@ -5327,12 +5346,45 @@ Page({ |
| 5327 | 5346 | getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); |
| 5328 | 5347 | return false; |
| 5329 | 5348 | } |
| 5330 | - } | |
| 5331 | 5349 | |
| 5332 | - th.addcart_pt_func(); | |
| 5350 | + th.addcart_pt_func(); | |
| 5351 | + | |
| 5352 | + } else { | |
| 5353 | + | |
| 5354 | + //如果是线下库存的时候 | |
| 5355 | + if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { | |
| 5356 | + var pick = th.get_pick_from_list(th.data.sto_sele_id) | |
| 5357 | + //---通过接口获取门店的线下库存信息-- | |
| 5358 | + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { | |
| 5359 | + if (CanOutQty) { | |
| 5360 | + if (CanOutQty < e.data.goodsInputNum) { | |
| 5361 | + wx.hideLoading(); | |
| 5362 | + th.data.adding = 0; | |
| 5363 | + wx.showToast({ | |
| 5364 | + title: '库存不足!', | |
| 5365 | + icon: 'none', | |
| 5366 | + }); | |
| 5367 | + return false; | |
| 5368 | + } | |
| 5333 | 5369 | |
| 5370 | + //-- 成功才来下一步 -- | |
| 5371 | + th.addcart_pt_func(); | |
| 5372 | + } else { | |
| 5373 | + wx.hideLoading(); | |
| 5374 | + wx.showToast({ | |
| 5375 | + title: '库存不足!', | |
| 5376 | + icon: 'none', | |
| 5377 | + }); | |
| 5378 | + return false; | |
| 5379 | + } | |
| 5380 | + }) | |
| 5381 | + }else{ | |
| 5382 | + th.addcart_pt_func(); | |
| 5383 | + } | |
| 5384 | + } | |
| 5334 | 5385 | }, |
| 5335 | 5386 | |
| 5387 | + | |
| 5336 | 5388 | addcart_pt_func: function () { |
| 5337 | 5389 | if (oo.user_id == null) { |
| 5338 | 5390 | s.my_warnning("还未登录!", 0, this); |
| ... | ... | @@ -7644,6 +7696,7 @@ Page({ |
| 7644 | 7696 | }) |
| 7645 | 7697 | }, |
| 7646 | 7698 | |
| 7699 | + | |
| 7647 | 7700 | go_plus: function () { |
| 7648 | 7701 | getApp().goto("/pages/user/plus/plus"); |
| 7649 | 7702 | }, | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -509,12 +509,20 @@ Page({ |
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | console.log("11-11"+pagePath); |
| 512 | - let share_imgurl=this.data.iurl + this.data.share_imgurl | |
| 513 | - return { | |
| 512 | + | |
| 513 | + | |
| 514 | + //分享的数组 | |
| 515 | + let share_dd={ | |
| 514 | 516 | title: "商品列表", |
| 515 | 517 | path:pagePath, |
| 516 | - imageUrl:share_imgurl | |
| 517 | 518 | } |
| 519 | + //有图片才分享图片 | |
| 520 | + if(this.data.share_imgurl){ | |
| 521 | + let share_imgurl=this.data.iurl + this.data.share_imgurl; | |
| 522 | + share_dd.imageUrl=share_imgurl; | |
| 523 | + } | |
| 524 | + | |
| 525 | + return share_dd; | |
| 518 | 526 | }, |
| 519 | 527 | //---图片失败,默认图片--- |
| 520 | 528 | bind_bnerr2: function (e) { | ... | ... |
pages/user/assistance/task_assistance.js
| ... | ... | @@ -9,6 +9,9 @@ var e = getApp(), |
| 9 | 9 | app_d = e.globalData; |
| 10 | 10 | var invalidSetTime = null |
| 11 | 11 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 12 | +var com = require("../../giftpack/public/buy_com.js"); | |
| 13 | + | |
| 14 | + | |
| 12 | 15 | Page({ |
| 13 | 16 | /** |
| 14 | 17 | * 页面的初始数据 |
| ... | ... | @@ -85,7 +88,46 @@ Page({ |
| 85 | 88 | font_color:'', |
| 86 | 89 | |
| 87 | 90 | //-- 屏幕实际的高度 -- |
| 88 | - r_heght:'' | |
| 91 | + r_heght:'', | |
| 92 | + | |
| 93 | + | |
| 94 | + //门店相关 | |
| 95 | + ismend: 0, | |
| 96 | + is_sec_mend: 0, | |
| 97 | + sto_sele_name: "", //选中的门店名称 | |
| 98 | + sto_sele_id: "", //选中的门店id | |
| 99 | + sto_sele_distr: "", //选择的门店的配送方式 | |
| 100 | + is_show_sto_cat: 1, //是否显示门店分类 | |
| 101 | + only_pk: null, | |
| 102 | + all_sto: null, | |
| 103 | + sec_sto: null, //选择了的门店分类 | |
| 104 | + pickpu_list: null, //读出的所有门店list | |
| 105 | + def_pickpu_list: null, //一开始5个门店list | |
| 106 | + sec_pick_index: 0, //第二级门店选择ID | |
| 107 | + fir_pick_index: 0, //第一级门店选择ID | |
| 108 | + all_pick_list: null,//所有的门店先记录起来 | |
| 109 | + | |
| 110 | + select_store: 0, //选择更多 | |
| 111 | + index: 1, | |
| 112 | + more_store: 0, //选择门店 | |
| 113 | + sort_store: 0, //门店分类 | |
| 114 | + choice_sort_store: 0, //选择分类门店 | |
| 115 | + new_user: 0, //新用户 | |
| 116 | + | |
| 117 | + def_pick_store: null, // 默认的门店 | |
| 118 | + fir_def_store: null, //客户默认的门店的 | |
| 119 | + lat: null, //维度 | |
| 120 | + lon: null, //经度 | |
| 121 | + | |
| 122 | + is_get_local_ok: 0, //获取坐标是否完成 | |
| 123 | + region_name: "门店分类", //区域的名字 | |
| 124 | + is_gps: 1, | |
| 125 | + open_ind_store: 0, //哪里打开的门店列表的控制属性 | |
| 126 | + default_store: {}, //创建添加默认门店地址的对象 | |
| 127 | + | |
| 128 | + store: 0, | |
| 129 | + openSpecModal: 0, | |
| 130 | + | |
| 89 | 131 | |
| 90 | 132 | }, |
| 91 | 133 | |
| ... | ... | @@ -99,7 +141,8 @@ Page({ |
| 99 | 141 | var nav_b = th.selectComponent("#nav_b"); //组件的id |
| 100 | 142 | nav_b.set_name("助力", "/pages/user/assistance/assistance"); |
| 101 | 143 | th.setData({ |
| 102 | - help_id: help_id | |
| 144 | + help_id: help_id, | |
| 145 | + buyType:4 | |
| 103 | 146 | }); |
| 104 | 147 | //start 钱 |
| 105 | 148 | if (options.gid != undefined) { |
| ... | ... | @@ -111,27 +154,106 @@ Page({ |
| 111 | 154 | th.setData({taskid:options.taskid}) |
| 112 | 155 | } |
| 113 | 156 | |
| 157 | + //-- 获取分享人的ID -- | |
| 158 | + var first_leader = options.first_leader || getApp().globalData.first_leader; | |
| 159 | + if (first_leader) { | |
| 160 | + this.setData({ | |
| 161 | + first_leader, | |
| 162 | + }) | |
| 163 | + //-- user_id代过来免登录 -- | |
| 164 | + getApp().globalData.first_leader = first_leader; | |
| 165 | + //调用接口判断是不是会员 | |
| 166 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 167 | + if (res.data.code == 0) { | |
| 168 | + getApp().globalData.guide_id = res.data.data.id; | |
| 169 | + getApp().globalData.guide_pick_id= res.data.data.pickup_id | |
| 170 | + } | |
| 171 | + }) | |
| 172 | + } | |
| 173 | + | |
| 114 | 174 | console.log('aaaa'); |
| 115 | 175 | th.syinfo(); |
| 116 | 176 | th.close(); |
| 117 | 177 | th.imageinfo(); |
| 118 | 178 | |
| 179 | + getApp().getConfig2(function (e) { | |
| 180 | + var json_d = JSON.parse(e.switch_list); | |
| 181 | + th.setData({ | |
| 182 | + bconfig: e, | |
| 183 | + sys_switch: json_d, | |
| 184 | + is_retail_price: json_d.is_retail_price || 0 | |
| 185 | + }); | |
| 186 | + }) | |
| 187 | + | |
| 119 | 188 | }, |
| 120 | 189 | |
| 190 | + check_guide(func){ | |
| 191 | + var first_leader=this.data.first_leader; | |
| 192 | + if(!first_leader){ | |
| 193 | + func(); | |
| 194 | + return false; | |
| 195 | + } | |
| 196 | + if(this.data.is_geted_guide_pick){ | |
| 197 | + func(); | |
| 198 | + return false; | |
| 199 | + } | |
| 200 | + if(getApp().globalData.guide_pick_id){ | |
| 201 | + func(); | |
| 202 | + return false; | |
| 203 | + } | |
| 204 | + var th=this; | |
| 205 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 206 | + if (res.data.code == 0) { | |
| 207 | + getApp().globalData.guide_pick_id= res.data.data.pickup_id; | |
| 208 | + } | |
| 209 | + th.data.is_geted_guide_pick=1; | |
| 210 | + func(); | |
| 211 | + }) | |
| 212 | + }, | |
| 213 | + | |
| 214 | + | |
| 215 | + //选中任务 | |
| 216 | + add_onlicke:function (e){ | |
| 217 | + this.data.tg_dd=e; | |
| 218 | + var th=this; | |
| 219 | + if(this.data.is_nd_pk){ | |
| 220 | + th.setData({ openSpecModal: 1 }) | |
| 221 | + th.pp_bacK_func=th.add_onlicke_next; //设置回调函数 | |
| 222 | + }else{ | |
| 223 | + th.add_onlicke_next(); | |
| 224 | + } | |
| 225 | + }, | |
| 226 | + | |
| 227 | + | |
| 228 | + //选中任务保存下一步 | |
| 229 | + add_onlicke_next: function () { | |
| 230 | + | |
| 231 | + if(!this.data.tg_dd){ | |
| 232 | + return false; | |
| 233 | + } | |
| 234 | + | |
| 235 | + let e=JSON.parse(JSON.stringify(this.data.tg_dd)); | |
| 236 | + this.data.tg_dd=null; | |
| 121 | 237 | |
| 122 | - //选中任务保存 | |
| 123 | - add_onlicke: function (e) { | |
| 124 | 238 | var th = this; |
| 125 | 239 | var taskid = e.target.dataset.taskid; |
| 126 | 240 | var help_id = th.data.help_id; |
| 127 | 241 | var user_id = getApp().globalData.user_id; |
| 128 | 242 | var stoid = os.stoid |
| 129 | - getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", { | |
| 243 | + | |
| 244 | + var insert_dd={ | |
| 130 | 245 | helpId: help_id, |
| 131 | 246 | userId: user_id, |
| 132 | 247 | storeId: stoid, |
| 133 | 248 | taskId: taskid |
| 134 | - }, | |
| 249 | + }; | |
| 250 | + | |
| 251 | + //-- 如果需要门店的时候 -- | |
| 252 | + if( th.data.is_nd_pk==1){ | |
| 253 | + insert_dd.pickupId=th.data.def_pick_store.pickup_id; | |
| 254 | + } | |
| 255 | + | |
| 256 | + getApp().request.json_post("/api/weshop/marketing/help/help/task/insert", insert_dd, | |
| 135 | 257 | function (res) { |
| 136 | 258 | if (res.data.code == 0) { |
| 137 | 259 | getApp().my_warnning(res.data.data, 1, th); |
| ... | ... | @@ -142,6 +264,8 @@ Page({ |
| 142 | 264 | } else { |
| 143 | 265 | getApp().my_warnning(res.data.msg, 0, th); |
| 144 | 266 | } |
| 267 | + th.setData({submit:0}) | |
| 268 | + th.closeSpecModal(); | |
| 145 | 269 | } |
| 146 | 270 | |
| 147 | 271 | ) |
| ... | ... | @@ -175,14 +299,76 @@ Page({ |
| 175 | 299 | success: function (res) { |
| 176 | 300 | if (res.data.code == 0) { |
| 177 | 301 | var help_data = res.data.data; |
| 178 | - th.setData({ | |
| 302 | + | |
| 303 | + help_data.giftTitle=help_data.actName; | |
| 304 | + help_data.lbUrl=help_data.imageUrl; | |
| 305 | + | |
| 306 | + let sData={ | |
| 179 | 307 | endDate: help_data.endDate, |
| 180 | - | |
| 181 | - btn_color: help_data.btn_color, | |
| 182 | - bg_color: help_data.bg_color, | |
| 183 | - font_color: help_data.font_color, | |
| 184 | - imageUrl: help_data.imageUrl, | |
| 185 | - }); | |
| 308 | + btn_color: help_data.btn_color, | |
| 309 | + bg_color: help_data.bg_color, | |
| 310 | + font_color: help_data.font_color, | |
| 311 | + imageUrl: help_data.imageUrl, | |
| 312 | + sele_g:help_data | |
| 313 | + }; | |
| 314 | + | |
| 315 | + if(help_data.is_pickup){ | |
| 316 | + sData.pickup_list=help_data.pickup_list; | |
| 317 | + } | |
| 318 | + | |
| 319 | + th.setData(sData); | |
| 320 | + | |
| 321 | + /*-----获取助力活动的任务-----*/ | |
| 322 | + rq.get("/api/weshop/marketing/help/help/task/page", { | |
| 323 | + data: { | |
| 324 | + helpId: help_id, | |
| 325 | + storeId: os.stoid | |
| 326 | + }, | |
| 327 | + success: function (su) { | |
| 328 | + var data = su.data; | |
| 329 | + if (data.code != 0) { | |
| 330 | + getApp().my_warnning(data.msg, 0, th); | |
| 331 | + return false; | |
| 332 | + } | |
| 333 | + if (data.code == 0 && data.data && data.data.pageData && data.data.pageData.length>0) { | |
| 334 | + //轮播图的数据 | |
| 335 | + var data_aissa = data.data.pageData; | |
| 336 | + //当前时间戳 | |
| 337 | + var nt = ut.gettimestamp(); | |
| 338 | + | |
| 339 | + data_aissa.forEach(function (val, ind) { | |
| 340 | + //已开始 | |
| 341 | + if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; | |
| 342 | + //未开始 | |
| 343 | + else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; | |
| 344 | + //已结束 | |
| 345 | + else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; | |
| 346 | + }); | |
| 347 | + var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; | |
| 348 | + var taskid = data_aissa[0].id; | |
| 349 | + if(th.data.taskid) { | |
| 350 | + th.setData({ | |
| 351 | + aitem: data_aissa, | |
| 352 | + task_number: task_number, | |
| 353 | + giftQty:data_aissa[0].giftQty, | |
| 354 | + }); | |
| 355 | + th.go_to_task(th.data.taskid); | |
| 356 | + | |
| 357 | + }else{ | |
| 358 | + th.setData({ | |
| 359 | + aitem: data_aissa, | |
| 360 | + task_number: task_number, | |
| 361 | + taskid: taskid, | |
| 362 | + giftQty:data_aissa[0].giftQty, | |
| 363 | + }); | |
| 364 | + //判断是不是领取的任务 | |
| 365 | + th.get_user_task(); | |
| 366 | + th.get_user_task_num(); | |
| 367 | + } | |
| 368 | + } | |
| 369 | + | |
| 370 | + } | |
| 371 | + }) | |
| 186 | 372 | |
| 187 | 373 | //任务时间 设置全局定时器 |
| 188 | 374 | th.setData({ |
| ... | ... | @@ -191,65 +377,11 @@ Page({ |
| 191 | 377 | }, 1000) |
| 192 | 378 | }) |
| 193 | 379 | |
| 194 | - | |
| 195 | 380 | } |
| 196 | 381 | } |
| 197 | 382 | }); |
| 198 | 383 | |
| 199 | 384 | |
| 200 | - /*-----获取助力活动的任务-----*/ | |
| 201 | - rq.get("/api/weshop/marketing/help/help/task/page", { | |
| 202 | - data: { | |
| 203 | - helpId: help_id, | |
| 204 | - storeId: os.stoid | |
| 205 | - }, | |
| 206 | - success: function (su) { | |
| 207 | - var data = su.data; | |
| 208 | - if (data.code != 0) { | |
| 209 | - getApp().my_warnning(data.msg, 0, th); | |
| 210 | - return false; | |
| 211 | - } | |
| 212 | - if (data.code == 0 && data.data && data.data.pageData && data.data.pageData.length>0) { | |
| 213 | - //轮播图的数据 | |
| 214 | - var data_aissa = data.data.pageData; | |
| 215 | - //当前时间戳 | |
| 216 | - var nt = ut.gettimestamp(); | |
| 217 | - | |
| 218 | - data_aissa.forEach(function (val, ind) { | |
| 219 | - //已开始 | |
| 220 | - if (val.start_time < nt && val.end_time > nt) data_aissa[ind].status = 0; | |
| 221 | - //未开始 | |
| 222 | - else if (val.start_time > nt && val.end_time > nt) data_aissa[ind].status = 1; | |
| 223 | - //已结束 | |
| 224 | - else if (val.start_time < nt && val.end_time < nt) data_aissa[ind].status = 2; | |
| 225 | - }); | |
| 226 | - var task_number = data_aissa[0].giftQty - data_aissa[0].useGiftQty; | |
| 227 | - var taskid = data_aissa[0].id; | |
| 228 | - if(th.data.taskid) { | |
| 229 | - th.setData({ | |
| 230 | - aitem: data_aissa, | |
| 231 | - task_number: task_number, | |
| 232 | - giftQty:data_aissa[0].giftQty, | |
| 233 | - }); | |
| 234 | - th.go_to_task(th.data.taskid); | |
| 235 | - | |
| 236 | - }else{ | |
| 237 | - th.setData({ | |
| 238 | - aitem: data_aissa, | |
| 239 | - task_number: task_number, | |
| 240 | - taskid: taskid, | |
| 241 | - giftQty:data_aissa[0].giftQty, | |
| 242 | - }); | |
| 243 | - //判断是不是领取的任务 | |
| 244 | - th.get_user_task(); | |
| 245 | - th.get_user_task_num(); | |
| 246 | - } | |
| 247 | - } | |
| 248 | - | |
| 249 | - } | |
| 250 | - }) | |
| 251 | - | |
| 252 | - | |
| 253 | 385 | //会员任务列表 |
| 254 | 386 | this.user_task_list(); |
| 255 | 387 | //获取助力活动参与的人数 |
| ... | ... | @@ -468,6 +600,27 @@ Page({ |
| 468 | 600 | var aitem = th.data.aitem; |
| 469 | 601 | var sw_index = th.data.sw_index; |
| 470 | 602 | var taskid = aitem[sw_index].id |
| 603 | + | |
| 604 | + //-- 判断一下要不要弹出框,选择门店,只有在礼包含有礼品的时候 -- | |
| 605 | + getApp().promiseGet('/api/weshop/marketing/help/help/task/getlbtype?storeId='+os.stoid+'&Id='+taskid,{}).then(gNew=>{ | |
| 606 | + if(gNew && gNew.data.code==0 && gNew.data.data){ | |
| 607 | + if(th.data.pickup_list && gNew.data.data.lb_type.indexOf(',1,')>-1){ | |
| 608 | + th.data.is_nd_pk=1; | |
| 609 | + //-- 检测一下有没有门店 -- | |
| 610 | + th.check_guide(function (){ | |
| 611 | + com.wait_for_store_config(th); | |
| 612 | + com.set_user_mo_store(th, os, function () { | |
| 613 | + if (sele_g.pickup_list && th.data.def_pick_store) { | |
| 614 | + com.check_def_pk(th); | |
| 615 | + } | |
| 616 | + }); | |
| 617 | + com.get_sto(th, os); | |
| 618 | + }) | |
| 619 | + } | |
| 620 | + } | |
| 621 | + }) | |
| 622 | + | |
| 623 | + | |
| 471 | 624 | rq.get("/api/weshop/marketing/help/help/task/get", { |
| 472 | 625 | data: { |
| 473 | 626 | storeId: os.stoid, |
| ... | ... | @@ -489,7 +642,8 @@ Page({ |
| 489 | 642 | }, |
| 490 | 643 | //获取失效时间 |
| 491 | 644 | getInvalidTime(taskid){ |
| 492 | - let th = this | |
| 645 | + let th = this; | |
| 646 | + let _this2=this; | |
| 493 | 647 | rq.get("/api/weshop/marketing/giftbag/helpinfo/get", { |
| 494 | 648 | data: { |
| 495 | 649 | storeId: os.stoid, |
| ... | ... | @@ -497,7 +651,7 @@ Page({ |
| 497 | 651 | taskId: taskid, |
| 498 | 652 | helpId:th.data.help_id |
| 499 | 653 | }, |
| 500 | - success: function (res) { | |
| 654 | + success:async function (res) { | |
| 501 | 655 | console.log('获取失效时间------'); |
| 502 | 656 | console.log(res); |
| 503 | 657 | if (res.data.code == 0) { |
| ... | ... | @@ -507,6 +661,7 @@ Page({ |
| 507 | 661 | if (openTime && validTime > 0) { |
| 508 | 662 | invalidTime = openTime*1 + validTime*60*60 |
| 509 | 663 | } |
| 664 | + | |
| 510 | 665 | th.setData({ |
| 511 | 666 | invalidTime |
| 512 | 667 | }); |
| ... | ... | @@ -1146,7 +1301,7 @@ Page({ |
| 1146 | 1301 | is_dismantle: 0, |
| 1147 | 1302 | bc_page: 1, |
| 1148 | 1303 | }) |
| 1149 | - this.get_user_task_num(); | |
| 1304 | + this.get_user_task_num(); | |
| 1150 | 1305 | |
| 1151 | 1306 | }, |
| 1152 | 1307 | |
| ... | ... | @@ -1174,4 +1329,380 @@ Page({ |
| 1174 | 1329 | }; |
| 1175 | 1330 | }, |
| 1176 | 1331 | |
| 1332 | + buy_libao: function () { | |
| 1333 | + com.buy_libao(this) | |
| 1334 | + }, | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + //-- 选择门店 -- | |
| 1338 | + choice_store: function (ee) { | |
| 1339 | + this.setData({ | |
| 1340 | + keyword:'' | |
| 1341 | + }) | |
| 1342 | + | |
| 1343 | + //--先判断会员状态-- | |
| 1344 | + var user_info = getApp().globalData.userInfo; | |
| 1345 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 1346 | + wx.navigateTo({ | |
| 1347 | + url: '/packageE/pages/togoin/togoin', | |
| 1348 | + }) | |
| 1349 | + return false; | |
| 1350 | + } | |
| 1351 | + | |
| 1352 | + var th = this; | |
| 1353 | + var ind = ee.currentTarget.dataset.ind; | |
| 1354 | + var bconfig = th.data.bconfig; | |
| 1355 | + | |
| 1356 | + //如果开启了,则不在选择门店 | |
| 1357 | + // if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { | |
| 1358 | + // return false; | |
| 1359 | + // } | |
| 1360 | + // if (!th.data.only_pk && !th.data.def_pickpu_list) { | |
| 1361 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 1362 | + // return false; | |
| 1363 | + // } | |
| 1364 | + | |
| 1365 | + if (th.data.only_pk && !th.data.only_pk.length) { | |
| 1366 | + getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 1367 | + return false; | |
| 1368 | + } | |
| 1369 | + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { | |
| 1370 | + getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 1371 | + return false; | |
| 1372 | + } | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + if (bconfig && bconfig.is_sort_storage) { | |
| 1376 | + wx.getLocation({ | |
| 1377 | + type: 'gcj02', | |
| 1378 | + success: function (res) { | |
| 1379 | + | |
| 1380 | + th.data.lat = res.latitude; | |
| 1381 | + th.data.lon = res.longitude; | |
| 1382 | + th.data.is_get_local_ok = 1; | |
| 1383 | + th.setData({ | |
| 1384 | + is_gps: 1 | |
| 1385 | + }); | |
| 1386 | + //th.onShow(); | |
| 1387 | + com.get_sto(th, os); | |
| 1388 | + }, | |
| 1389 | + fail: function (res) { | |
| 1390 | + //th.onShow(); | |
| 1391 | + th.data.is_get_local_ok = 1; | |
| 1392 | + com.get_sto(th, os); | |
| 1393 | + if (res.errCode == 2) { | |
| 1394 | + th.setData({ | |
| 1395 | + is_gps: 0 | |
| 1396 | + }); | |
| 1397 | + if (th.data.is_gps == 0) { | |
| 1398 | + getApp().confirmBox("请开启GPS定位", null, 25000, !1); | |
| 1399 | + } | |
| 1400 | + } else { | |
| 1401 | + th.setData({ | |
| 1402 | + is_gps: "3" | |
| 1403 | + }); | |
| 1404 | + } | |
| 1405 | + | |
| 1406 | + } | |
| 1407 | + }) | |
| 1408 | + } else { | |
| 1409 | + th.data.is_get_local_ok = 1; | |
| 1410 | + com.get_sto(th, os); | |
| 1411 | + } | |
| 1412 | + | |
| 1413 | + if (ind != undefined && ind != null) { | |
| 1414 | + this.setData({ | |
| 1415 | + open_ind_store: ind, | |
| 1416 | + store: 1, | |
| 1417 | + openSpecModal: !1, | |
| 1418 | + openSpecModal_pt: !1, | |
| 1419 | + openSpecModal_flash_normal: !1, | |
| 1420 | + }) | |
| 1421 | + } else { | |
| 1422 | + this.setData({ | |
| 1423 | + store: 1, | |
| 1424 | + openSpecModal: !1, | |
| 1425 | + openSpecModal_pt: !1, | |
| 1426 | + openSpecModal_flash_normal: !1 | |
| 1427 | + | |
| 1428 | + }) | |
| 1429 | + } | |
| 1430 | + }, | |
| 1431 | + //关闭选择门店 | |
| 1432 | + close_popup: function (e) { | |
| 1433 | + var th = this; | |
| 1434 | + this.setData({ | |
| 1435 | + store: 0, | |
| 1436 | + choice_sort_store: 0, | |
| 1437 | + sort_store: 0, | |
| 1438 | + fir_pick_index: 0, | |
| 1439 | + sec_pick_index: 0 | |
| 1440 | + }) | |
| 1441 | + | |
| 1442 | + var openindstore = this.data.open_ind_store; | |
| 1443 | + if (openindstore == 1) { | |
| 1444 | + th.setData({ | |
| 1445 | + openSpecModal: !0, | |
| 1446 | + openSpecModal_ind: openindstore, | |
| 1447 | + }); | |
| 1448 | + } else if (openindstore == 2) { | |
| 1449 | + th.setData({ | |
| 1450 | + openSpecModal: !0, | |
| 1451 | + openSpecModal_ind: openindstore, | |
| 1452 | + }); | |
| 1453 | + } else if (openindstore == 4) { //4就是拼团 | |
| 1454 | + th.setData({ | |
| 1455 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 1456 | + store: 0, //关闭门店 | |
| 1457 | + choice_sort_store: 0, //关闭门店2级 | |
| 1458 | + sort_store: 0, //关闭门店2级 | |
| 1459 | + }); | |
| 1460 | + } else { | |
| 1461 | + th.setData({ | |
| 1462 | + store: 0, | |
| 1463 | + choice_sort_store: 0, | |
| 1464 | + sort_store: 0 | |
| 1465 | + }) | |
| 1466 | + } | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + }, | |
| 1470 | + //选择更多门店 | |
| 1471 | + more_store: function () { | |
| 1472 | + this.setData({ | |
| 1473 | + sort_store: 1 | |
| 1474 | + }); | |
| 1475 | + }, | |
| 1476 | + // 返回按钮 | |
| 1477 | + returns: function () { | |
| 1478 | + this.setData({ | |
| 1479 | + sort_store: 0, | |
| 1480 | + choice_sort_store: 0 | |
| 1481 | + }); | |
| 1482 | + }, | |
| 1483 | + //---选择分类门店--- | |
| 1484 | + choice_sort_store: function (e) { | |
| 1485 | + var index = e.currentTarget.dataset.index; | |
| 1486 | + var region_name = e.currentTarget.dataset.region; | |
| 1487 | + var item = this.data.all_sto[index]; | |
| 1488 | + this.setData({ | |
| 1489 | + region_name: region_name, | |
| 1490 | + sort_store: 0, | |
| 1491 | + choice_sort_store: 1, | |
| 1492 | + sec_i:index, | |
| 1493 | + sec_sto: item, | |
| 1494 | + sec_pick_index: 0 | |
| 1495 | + }); | |
| 1496 | + }, | |
| 1497 | + choose_for_store_fir: function (e) { | |
| 1498 | + var index_c = e.currentTarget.dataset.ind; | |
| 1499 | + var th = this; | |
| 1500 | + th.setData({ | |
| 1501 | + fir_pick_index: index_c | |
| 1502 | + }) | |
| 1503 | + | |
| 1504 | + }, | |
| 1505 | + //确定def_pick为选择的门店 | |
| 1506 | + sure_pick: function (e) { | |
| 1507 | + var th = this; | |
| 1508 | + var item = null; | |
| 1509 | + var openindstore = th.data.open_ind_store; | |
| 1510 | + | |
| 1511 | + if (th.data.choice_sort_store == 0) { | |
| 1512 | + var index = th.data.fir_pick_index; | |
| 1513 | + if (th.data.is_show_sto_cat == 1) { | |
| 1514 | + item = th.data.def_pickpu_list[index]; | |
| 1515 | + } else { | |
| 1516 | + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 | |
| 1517 | + } | |
| 1518 | + | |
| 1519 | + } else { | |
| 1520 | + var index = th.data.sec_pick_index; | |
| 1521 | + item = th.data.sec_sto.s_arr[index]; | |
| 1522 | + } | |
| 1523 | + | |
| 1524 | + if(!item) return false; | |
| 1525 | + | |
| 1526 | + if (!th.data.sele_g) return false; | |
| 1527 | + | |
| 1528 | + th.setData({ | |
| 1529 | + def_pick_store: item, | |
| 1530 | + sto_sele_name: item.pickup_name, | |
| 1531 | + sto_sele_id: item.pickup_id, | |
| 1532 | + sto_sele_distr: item.distr_type, | |
| 1533 | + store: 0, | |
| 1534 | + choice_sort_store: 0, | |
| 1535 | + fir_pick_index: 0, | |
| 1536 | + openSpecModal: !0, | |
| 1537 | + }); | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + }, | |
| 1541 | + //---点击二级之后的选择--- | |
| 1542 | + choose_for_store: function (e) { | |
| 1543 | + var index_c = e.currentTarget.dataset.ind; | |
| 1544 | + var th = this; | |
| 1545 | + th.setData({ | |
| 1546 | + sec_pick_index: index_c, | |
| 1547 | + fir_pick_index: index_c | |
| 1548 | + }) | |
| 1549 | + | |
| 1550 | + }, | |
| 1551 | + //把选择的门店设置成默认的门店def_pick | |
| 1552 | + set_def_pick: function (e) { | |
| 1553 | + var th = this; | |
| 1554 | + var item = null; | |
| 1555 | + if (th.data.choice_sort_store == 0) { | |
| 1556 | + var index = th.data.fir_pick_index; | |
| 1557 | + if (th.data.is_show_sto_cat == 1) { | |
| 1558 | + item = th.data.def_pickpu_list[index]; | |
| 1559 | + } else { | |
| 1560 | + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 | |
| 1561 | + } | |
| 1562 | + } else { | |
| 1563 | + var index = th.data.sec_pick_index; | |
| 1564 | + item = th.data.sec_sto.s_arr[index]; | |
| 1565 | + } | |
| 1566 | + | |
| 1567 | + if(!item) return false; | |
| 1568 | + | |
| 1569 | + th.setData({ | |
| 1570 | + def_pick_store: item, | |
| 1571 | + sto_sele_name: item.pickup_name, | |
| 1572 | + sto_sele_id: item.pickup_id, | |
| 1573 | + sto_sele_distr: item.distr_type, | |
| 1574 | + store: 0, | |
| 1575 | + choice_sort_store: 0, | |
| 1576 | + openSpecModal: !0, | |
| 1577 | + }); | |
| 1578 | + | |
| 1579 | + var user_id = getApp().globalData.user_id; | |
| 1580 | + var def_pickup_id = item.pickup_id; | |
| 1581 | + getApp().request.put('/api/weshop/users/update', { | |
| 1582 | + data: { | |
| 1583 | + user_id: user_id, | |
| 1584 | + def_pickup_id: def_pickup_id | |
| 1585 | + }, | |
| 1586 | + success: function (res) { | |
| 1587 | + if (res.data.code == 0) { | |
| 1588 | + if (th.data.choice_sort_store == 0) th.setData({ | |
| 1589 | + fir_pick_index: 0 | |
| 1590 | + }); | |
| 1591 | + getApp().globalData.pk_store = item; | |
| 1592 | + } else { | |
| 1593 | + getApp().my_warnning("设置默认门店地址失败", 0, th) | |
| 1594 | + } | |
| 1595 | + | |
| 1596 | + } | |
| 1597 | + }); | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + }, | |
| 1601 | + closeSpecModal: function () { | |
| 1602 | + this.setData({openSpecModal: 0}); | |
| 1603 | + }, | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + //获取搜索门店输入的值 | |
| 1607 | + input_store: function(e) { | |
| 1608 | + this.setData({ | |
| 1609 | + keyword: e.detail.value | |
| 1610 | + }) | |
| 1611 | + }, | |
| 1612 | + | |
| 1613 | + //-- 搜索门店 -- | |
| 1614 | + searchfn(){ | |
| 1615 | + let choice_sort_store = this.data.choice_sort_store | |
| 1616 | + if (choice_sort_store==0) { //全局搜索 | |
| 1617 | + let all_pick_list = this.data.all_pick_list | |
| 1618 | + let def_pickpu_list = this.data.def_pickpu_list | |
| 1619 | + let keyword = this.data.keyword | |
| 1620 | + if (keyword) { | |
| 1621 | + let arr=all_pick_list.filter( item =>{ | |
| 1622 | + let i = item.pickup_name.indexOf(keyword) | |
| 1623 | + if (i > -1) { | |
| 1624 | + return true | |
| 1625 | + }else{ | |
| 1626 | + return false | |
| 1627 | + } | |
| 1628 | + }) | |
| 1629 | + if (arr && arr.length>0) { | |
| 1630 | + if(this.data.is_show_sto_cat==1){ | |
| 1631 | + this.setData({ | |
| 1632 | + def_pickpu_list:arr | |
| 1633 | + }) | |
| 1634 | + }else{ | |
| 1635 | + this.setData({ | |
| 1636 | + only_pk:arr | |
| 1637 | + }) | |
| 1638 | + } | |
| 1639 | + }else{ | |
| 1640 | + wx.showToast({ | |
| 1641 | + title: '没有搜索到门店', | |
| 1642 | + icon: 'none', | |
| 1643 | + duration: 2000 | |
| 1644 | + }) | |
| 1645 | + } | |
| 1646 | + }else{ | |
| 1647 | + if (this.data.is_show_sto_cat==1) { | |
| 1648 | + this.setData({ | |
| 1649 | + def_pickpu_list:all_pick_list.slice(0,10) | |
| 1650 | + }) | |
| 1651 | + }else{ | |
| 1652 | + this.setData({ | |
| 1653 | + only_pk:all_pick_list | |
| 1654 | + }) | |
| 1655 | + } | |
| 1656 | + | |
| 1657 | + } | |
| 1658 | + }else{ //分类下搜索 | |
| 1659 | + let sec_i=this.data.sec_i | |
| 1660 | + let all_sto = this.data.all_sto | |
| 1661 | + let old_all_sto = this.data.old_all_sto | |
| 1662 | + if (!old_all_sto) { | |
| 1663 | + this.setData({ | |
| 1664 | + old_all_sto:JSON.parse(JSON.stringify(all_sto)) | |
| 1665 | + }) | |
| 1666 | + } | |
| 1667 | + let sec_sto= this.data.sec_sto | |
| 1668 | + let sec_arr = this.data.old_all_sto[sec_i].s_arr | |
| 1669 | + let keyword = this.data.keyword | |
| 1670 | + let text='sec_sto.s_arr' | |
| 1671 | + if (keyword) { | |
| 1672 | + let arr=sec_arr.filter( item =>{ | |
| 1673 | + let i = item.pickup_name.indexOf(keyword) | |
| 1674 | + if (i > -1) { | |
| 1675 | + return true | |
| 1676 | + }else{ | |
| 1677 | + return false | |
| 1678 | + } | |
| 1679 | + }) | |
| 1680 | + if (arr && arr.length>0) { | |
| 1681 | + this.setData({ | |
| 1682 | + [text]:arr | |
| 1683 | + }) | |
| 1684 | + }else{ | |
| 1685 | + wx.showToast({ | |
| 1686 | + title: '没有搜索到门店', | |
| 1687 | + icon: 'none', | |
| 1688 | + duration: 2000 | |
| 1689 | + }) | |
| 1690 | + } | |
| 1691 | + }else{ | |
| 1692 | + if(this.data.old_all_sto){ | |
| 1693 | + this.setData({ | |
| 1694 | + [text]: this.data.old_all_sto[sec_i].s_arr | |
| 1695 | + }) | |
| 1696 | + }else{ | |
| 1697 | + this.setData({ | |
| 1698 | + [text]: all_sto[sec_i].s_arr | |
| 1699 | + }) | |
| 1700 | + } | |
| 1701 | + | |
| 1702 | + } | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + } | |
| 1706 | + }, | |
| 1707 | + | |
| 1177 | 1708 | }) | ... | ... |
pages/user/assistance/task_assistance.wxml
pages/user/assistance/task_assistance.wxss
| 1 | + | |
| 1 | 2 | page { |
| 2 | 3 | /* background: #d01119; */ |
| 3 | 4 | width: 100%; |
| ... | ... | @@ -277,4 +278,363 @@ image{ |
| 277 | 278 | display: flex; |
| 278 | 279 | align-items: center; |
| 279 | 280 | justify-content: space-around; |
| 281 | +} | |
| 282 | + | |
| 283 | + | |
| 284 | +/*-- 和弹出框的组件有关系 --*/ | |
| 285 | +.xc-width { | |
| 286 | + width: 100%; | |
| 287 | +} | |
| 288 | +.spec-model { | |
| 289 | + position: fixed; | |
| 290 | + bottom: 0; | |
| 291 | + z-index: 20; | |
| 292 | + background: white; | |
| 293 | + width: 100%; | |
| 294 | + /* padding: 0 30rpx; */ | |
| 295 | + font-size: 32rpx; | |
| 296 | + box-sizing: border-box; | |
| 297 | + border-radius: 20rpx 20rpx 0 0; | |
| 298 | + /* height: 72%; */ | |
| 299 | +} | |
| 300 | + | |
| 301 | +.spec-model .pding { | |
| 302 | + padding: 0 20rpx; | |
| 303 | +} | |
| 304 | +.pding { | |
| 305 | + padding-top: 20rpx; | |
| 306 | + padding-left: 20rpx; | |
| 307 | + height: 81%; | |
| 308 | + padding-right: 20rpx; | |
| 309 | + font-size: 26rpx; | |
| 310 | + color: #ea120f | |
| 311 | +} | |
| 312 | + | |
| 313 | +.spec-goods { | |
| 314 | + padding: 30rpx 0 20rpx; | |
| 315 | + /* float: left; */ | |
| 316 | + width: 100%; | |
| 317 | + /* border-bottom:2rpx solid #eee; */ | |
| 318 | +} | |
| 319 | + | |
| 320 | +.spec-img { | |
| 321 | + float: left; | |
| 322 | + height: 186rpx; | |
| 323 | + width: 186rpx; | |
| 324 | + border: 4rpx solid #eee | |
| 325 | +} | |
| 326 | + | |
| 327 | +.spec-goods-info { | |
| 328 | + float: left; | |
| 329 | + padding: 0 25rpx; | |
| 330 | + width: 400rpx; | |
| 331 | +} | |
| 332 | + | |
| 333 | +.spec-goods-name { | |
| 334 | + font-size: 30rpx; | |
| 335 | + line-height: 35rpx; | |
| 336 | + height: 70rpx; | |
| 337 | + margin: 15rpx 20rpx 25rpx 0; | |
| 338 | + overflow: hidden; | |
| 339 | + text-overflow: ellipsis; | |
| 340 | + color: #333; | |
| 341 | +} | |
| 342 | + | |
| 343 | +.spec-goods-price { | |
| 344 | + color: #d60021; | |
| 345 | + font-size: 33rpx; | |
| 346 | + font-weight: bold; | |
| 347 | + /* display: flex; */ | |
| 348 | +} | |
| 349 | + | |
| 350 | +.spec-goods-stock { | |
| 351 | + margin-top: 3rpx; | |
| 352 | + font-size: 24rpx; | |
| 353 | + color: #999999; | |
| 354 | + margin-right: 15rpx; | |
| 355 | +} | |
| 356 | + | |
| 357 | +.spec-name { | |
| 358 | + clear: both; | |
| 359 | + padding: 20rpx 0; | |
| 360 | + font-size: 30rpx; | |
| 361 | + color: #333; | |
| 362 | +} | |
| 363 | +.spec-name+view{ | |
| 364 | + flex-wrap: wrap; | |
| 365 | +} | |
| 366 | +.stores-img { | |
| 367 | + width: 28rpx; | |
| 368 | + height: 28rpx; | |
| 369 | + margin-right: 10rpx; | |
| 370 | +} | |
| 371 | +.right-arrow { | |
| 372 | + width: 15rpx; | |
| 373 | + height: 15rpx; | |
| 374 | + border-top: 2rpx solid #d70026; | |
| 375 | + border-right: 2rpx solid #d70026; | |
| 376 | + transform: rotate(45deg); | |
| 377 | + display: inline-block; | |
| 378 | + margin-bottom: 3rpx; | |
| 379 | +} | |
| 380 | + | |
| 381 | + | |
| 382 | +.spec-btn { | |
| 383 | + color: black; | |
| 384 | + background-color: white; | |
| 385 | + padding: 10rpx 10rpx; | |
| 386 | + font-size: 26rpx; | |
| 387 | + line-height: 28rpx; | |
| 388 | + float: left; | |
| 389 | + border: 1rpx solid #dedede; | |
| 390 | + margin: 4rpx 10rpx 4rpx 0; | |
| 391 | + border-radius: 4rpx; | |
| 392 | +} | |
| 393 | + | |
| 394 | +.spec-btn-click { | |
| 395 | + color: white; | |
| 396 | + background-color: #f23030; | |
| 397 | + border: 1rpx solid #f23030; | |
| 398 | +} | |
| 399 | + | |
| 400 | +.spec-cart-btns { | |
| 401 | + /* width: 92%; */ | |
| 402 | + line-height: 70rpx; | |
| 403 | + /* margin: 0rpx auto; | |
| 404 | + margin-top: 160rpx; */ | |
| 405 | + /* border-radius: 20rpx; */ | |
| 406 | + /* position: fixed; */ | |
| 407 | + /* bottom: 50rpx; */ | |
| 408 | + /* left: 4%; */ | |
| 409 | + padding: 20rpx; | |
| 410 | +} | |
| 411 | + | |
| 412 | +.spec-cart-btn { | |
| 413 | + | |
| 414 | + width: 100%; | |
| 415 | + font-size: 30rpx; | |
| 416 | + text-align: center; | |
| 417 | + color: white; | |
| 418 | + border-radius: 40rpx; | |
| 419 | +} | |
| 420 | + | |
| 421 | +.spec-cart-btn.w40 { | |
| 422 | + width: 46%; | |
| 423 | +} | |
| 424 | + | |
| 425 | +.spec-add-cart { | |
| 426 | + background-color: #ffb03f; | |
| 427 | +} | |
| 428 | + | |
| 429 | +.spec-buy { | |
| 430 | + background-color: #f23030; | |
| 431 | + /* margin-left: 34rpx; */ | |
| 432 | +} | |
| 433 | + | |
| 434 | +.spec-cart-disable { | |
| 435 | + background: #bbbbbb; | |
| 436 | +} | |
| 437 | + | |
| 438 | +.spec-cart-btn-lg { | |
| 439 | + width: 614rpx; | |
| 440 | +} | |
| 441 | + | |
| 442 | + | |
| 443 | +/* 选择门店的弹窗 */ | |
| 444 | +.mongolia-layer { | |
| 445 | + position: fixed; | |
| 446 | + left: 0; | |
| 447 | + top: 0; | |
| 448 | + right: 0; | |
| 449 | + bottom: 0; | |
| 450 | + z-index: 11; | |
| 451 | + background: rgba(0, 0, 0, 0.4); | |
| 452 | + width: 100%; | |
| 453 | + height: 91.9%; | |
| 454 | + | |
| 455 | +} | |
| 456 | + | |
| 457 | +.popup-frame { | |
| 458 | + position: fixed; | |
| 459 | + z-index: 20; | |
| 460 | + background: white; | |
| 461 | + width: 100%; | |
| 462 | + border-radius: 20rpx 20rpx 0 0; | |
| 463 | + height: auto; | |
| 464 | + bottom: 0; | |
| 465 | +} | |
| 466 | + | |
| 467 | +.popup-top { | |
| 468 | + border-bottom: 1rpx solid #eee; | |
| 469 | + height: 155rpx; | |
| 470 | + width: 95%; | |
| 471 | + margin: auto; | |
| 472 | + line-height: 155rpx; | |
| 473 | + | |
| 474 | +} | |
| 475 | + | |
| 476 | +.bg_rights { | |
| 477 | + border-top: 2rpx solid; | |
| 478 | + border-right: 2rpx solid; | |
| 479 | + transform: rotate(45deg); | |
| 480 | + display: inline-block; | |
| 481 | + width: 15rpx; | |
| 482 | + height: 15rpx; | |
| 483 | + border-color: #da0b31; | |
| 484 | +} | |
| 485 | + | |
| 486 | +.modal-closes { | |
| 487 | + position: absolute; | |
| 488 | + right: 30rpx; | |
| 489 | + top: -15rpx; | |
| 490 | + height: 25rpx; | |
| 491 | + | |
| 492 | +} | |
| 493 | + | |
| 494 | +.choose_more { | |
| 495 | + margin-top: 40rpx; | |
| 496 | + margin-right: 20rpx; | |
| 497 | + | |
| 498 | +} | |
| 499 | + | |
| 500 | +.choose_mores { | |
| 501 | + margin-top: 30rpx; | |
| 502 | + margin-right: 15rpx; | |
| 503 | + | |
| 504 | +} | |
| 505 | + | |
| 506 | +.store-list { | |
| 507 | + width: 95%; | |
| 508 | + min-height: 700rpx; | |
| 509 | + overflow-y: scroll; | |
| 510 | + margin: auto; | |
| 511 | + max-height: 700rpx; | |
| 512 | +} | |
| 513 | + | |
| 514 | +.store-list .store_choose { | |
| 515 | + width: 100%; | |
| 516 | + height: 120rpx; | |
| 517 | + line-height: 125rpx; | |
| 518 | + border-bottom: 1rpx solid #eee; | |
| 519 | + padding: 10rpx 0; | |
| 520 | +} | |
| 521 | + | |
| 522 | +.store-list .store_choose .store { | |
| 523 | + width: 100%; | |
| 524 | + margin: auto; | |
| 525 | + line-height: 37rpx; | |
| 526 | + padding-left: 20rpx; | |
| 527 | + | |
| 528 | +} | |
| 529 | + | |
| 530 | +.xc-hook { | |
| 531 | + width: 35rpx; | |
| 532 | + height: 35rpx; | |
| 533 | + transform: rotate(-145deg); | |
| 534 | + line-height: 37rpx; | |
| 535 | + text-align: center; | |
| 536 | +} | |
| 537 | + | |
| 538 | +.xc-hooks { | |
| 539 | + width: 30rpx; | |
| 540 | + height: 30rpx; | |
| 541 | + border: 1rpx solid #999; | |
| 542 | +} | |
| 543 | + | |
| 544 | +.address-frame { | |
| 545 | + width: 93%; | |
| 546 | + margin-left: 7rpx; | |
| 547 | + | |
| 548 | +} | |
| 549 | + | |
| 550 | +.nearby_store { | |
| 551 | + margin-left: 17rpx; | |
| 552 | +} | |
| 553 | + | |
| 554 | +.address_name { | |
| 555 | + margin-right: 10rpx; | |
| 556 | + width: 360rpx; | |
| 557 | + | |
| 558 | +} | |
| 559 | + | |
| 560 | +.address-val { | |
| 561 | + height: 38rpx; | |
| 562 | + line-height: 38rpx; | |
| 563 | + | |
| 564 | +} | |
| 565 | + | |
| 566 | +.store-bottom { | |
| 567 | + width: 85%; | |
| 568 | + margin: auto; | |
| 569 | + height: 90rpx; | |
| 570 | +} | |
| 571 | + | |
| 572 | +.searchbar { | |
| 573 | + height: 95rpx; | |
| 574 | + border-bottom: 2rpx solid rgb(238, 238, 238); | |
| 575 | +} | |
| 576 | +.storeListpadd { | |
| 577 | + padding: 0rpx 31rpx; | |
| 578 | +} | |
| 579 | +.search { | |
| 580 | + width: 125rpx; | |
| 581 | + height: 45rpx; | |
| 582 | + line-height: 45rpx; | |
| 583 | + background-color: rgb(219, 27, 52); | |
| 584 | + border-radius: 30rpx; | |
| 585 | + color: rgb(255, 255, 255); | |
| 586 | +} | |
| 587 | +.inputstore { | |
| 588 | + width: 510rpx; | |
| 589 | + height: 43rpx; | |
| 590 | + line-height: 43rpx; | |
| 591 | + border-radius: 30rpx; | |
| 592 | + border: 2rpx solid rgb(238, 238, 238); | |
| 593 | + padding-left: 30rpx; | |
| 594 | +} | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | +.determine { | |
| 599 | + width: 260rpx; | |
| 600 | + height: 55rpx; | |
| 601 | + border-radius: 50rpx; | |
| 602 | + line-height: 55rpx; | |
| 603 | +} | |
| 604 | + | |
| 605 | +.default { | |
| 606 | + width: 260rpx; | |
| 607 | + height: 55rpx; | |
| 608 | + border: 3rpx solid #c8c8c8; | |
| 609 | + border-radius: 50rpx; | |
| 610 | + line-height: 55rpx; | |
| 611 | +} | |
| 612 | + | |
| 613 | +.store-bottom-frame { | |
| 614 | + width: 95%; | |
| 615 | + margin: auto; | |
| 616 | + | |
| 617 | +} | |
| 618 | + | |
| 619 | +/* 门店分类列表 */ | |
| 620 | +.sort_store_list { | |
| 621 | + max-height: 700rpx; | |
| 622 | + min-height: 700rpx; | |
| 623 | + overflow: hidden; | |
| 624 | + overflow-y: scroll; | |
| 625 | + width: 95%; | |
| 626 | + margin: auto; | |
| 627 | +} | |
| 628 | + | |
| 629 | +.sort_store_list .sort-store-frame { | |
| 630 | + width: 100%; | |
| 631 | + height: 100rpx; | |
| 632 | + line-height: 100rpx; | |
| 633 | + border-bottom: 1rpx solid #eee; | |
| 634 | + | |
| 635 | +} | |
| 636 | + | |
| 637 | +.sort_store_list .sort-store-frame .sort-store { | |
| 638 | + width: 94.5%; | |
| 639 | + margin: auto; | |
| 280 | 640 | } |
| 281 | 641 | \ No newline at end of file | ... | ... |
pages/user/order_detail/order_detail.js
pages/user/order_list/order_list.js
| ... | ... | @@ -1130,7 +1130,6 @@ Page({ |
| 1130 | 1130 | if(good.prom_type != gg.prom_type && good.prom_id != gg.prom_id){ |
| 1131 | 1131 | //如果商品有单独的活动的是偶 |
| 1132 | 1132 | switch (gg.prom_type){ |
| 1133 | - case 5: | |
| 1134 | 1133 | case 10: |
| 1135 | 1134 | var content = gg.goods_name + '商品的活动发生了变化,请取消订单重新购买'; |
| 1136 | 1135 | th.toast(content); | ... | ... |
pages/user/userinfo/userinfo.js
| ... | ... | @@ -75,7 +75,8 @@ Page({ |
| 75 | 75 | canIUseGetUserProfile: false, |
| 76 | 76 | getusercode_vailtime:10,//会员二维码时效 |
| 77 | 77 | |
| 78 | - sele_ing:0 | |
| 78 | + sele_ing:0, | |
| 79 | + set_isstcsp:0 | |
| 79 | 80 | |
| 80 | 81 | }, |
| 81 | 82 | //通过路径跳转到其他页面 |
| ... | ... | @@ -654,6 +655,10 @@ Page({ |
| 654 | 655 | canIUseGetUserProfile: true |
| 655 | 656 | }) |
| 656 | 657 | } |
| 658 | + //如果有指定要启用密码的时候 | |
| 659 | + if(t.isstcsp){ | |
| 660 | + this.setData({set_isstcsp:1,ispwhid:0}); | |
| 661 | + } | |
| 657 | 662 | |
| 658 | 663 | }, |
| 659 | 664 | |
| ... | ... | @@ -797,6 +802,9 @@ Page({ |
| 797 | 802 | a.staffTel=choice_guide.Tel; |
| 798 | 803 | } |
| 799 | 804 | |
| 805 | + if(e.data.set_isstcsp){ | |
| 806 | + a.vipnopwd=1; | |
| 807 | + } | |
| 800 | 808 | |
| 801 | 809 | e.setData({ |
| 802 | 810 | phone: a.mobile, | ... | ... |
pages/user/userinfo/userinfo.wxml
| ... | ... | @@ -78,7 +78,7 @@ |
| 78 | 78 | <input bindblur="lose_focus" class="fs28 hion user-txt-right" value="{{consumption}}" password="true" type="number"/> |
| 79 | 79 | </block> |
| 80 | 80 | <block wx:else> |
| 81 | - <input bindblur="lose_focus" class="fs28 hion user-txt-right" value="{{consumption}}" type="number"/> | |
| 81 | + <input bindblur="lose_focus" focus="{{set_isstcsp?true:false}}" class="fs28 hion user-txt-right" value="{{consumption}}" type="number"/> | |
| 82 | 82 | </block> |
| 83 | 83 | |
| 84 | 84 | <block wx:if="{{ispwhid}}"> | ... | ... |
utils/pay.js
| ... | ... | @@ -42,6 +42,8 @@ module.exports = { |
| 42 | 42 | |
| 43 | 43 | console.log(dd,'支付场景'); |
| 44 | 44 | |
| 45 | + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 | |
| 46 | + | |
| 45 | 47 | wx.showLoading(); |
| 46 | 48 | n.post(this.url, { |
| 47 | 49 | data: dd, |
| ... | ... | @@ -150,6 +152,8 @@ module.exports = { |
| 150 | 152 | return false; |
| 151 | 153 | } |
| 152 | 154 | |
| 155 | + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 | |
| 156 | + | |
| 153 | 157 | wx.openEmbeddedMiniProgram({ |
| 154 | 158 | appId: 'wxef277996acc166c3', |
| 155 | 159 | extraData: p_data, |
| ... | ... | @@ -204,6 +208,9 @@ module.exports = { |
| 204 | 208 | fail('支付参数错误'); |
| 205 | 209 | return false; |
| 206 | 210 | } |
| 211 | + | |
| 212 | + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 | |
| 213 | + | |
| 207 | 214 | //富友插件的优化 |
| 208 | 215 | if(ob.is_fuioupay){ |
| 209 | 216 | const plugin = requirePlugin('fuiou-pay') |
| ... | ... | @@ -234,6 +241,7 @@ module.exports = { |
| 234 | 241 | //-- 通联的支付插件 -- |
| 235 | 242 | else if(ob.is_pos_pay){ |
| 236 | 243 | |
| 244 | + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 | |
| 237 | 245 | var p_data=t.data.data; |
| 238 | 246 | delete p_data.is_pos_pay; //清理掉,不然签名不通过 |
| 239 | 247 | wx.openEmbeddedMiniProgram({ | ... | ... |
utils/pay2.js
| ... | ... | @@ -15,6 +15,9 @@ module.exports = { |
| 15 | 15 | if(this.wx_paying) return false; |
| 16 | 16 | this.wx_paying=1; |
| 17 | 17 | wx.showLoading(); |
| 18 | + | |
| 19 | + getApp().globalData.is_tonglian_pay=0; //是通联支付的时候 | |
| 20 | + | |
| 18 | 21 | var i = this; |
| 19 | 22 | n.post(this.url, { |
| 20 | 23 | data: dd, |
| ... | ... | @@ -69,6 +72,8 @@ module.exports = { |
| 69 | 72 | th.data.ok_order_sn=ordno; |
| 70 | 73 | } |
| 71 | 74 | |
| 75 | + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 | |
| 76 | + | |
| 72 | 77 | wx.openEmbeddedMiniProgram({ |
| 73 | 78 | appId: 'wxef277996acc166c3', |
| 74 | 79 | extraData: p_data, |
| ... | ... | @@ -113,6 +118,9 @@ module.exports = { |
| 113 | 118 | fail('支付参数错误'); |
| 114 | 119 | return false; |
| 115 | 120 | } |
| 121 | + | |
| 122 | + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 | |
| 123 | + | |
| 116 | 124 | if(ob.is_fuioupay){ |
| 117 | 125 | const plugin = requirePlugin('fuiou-pay') |
| 118 | 126 | |
| ... | ... | @@ -153,6 +161,8 @@ module.exports = { |
| 153 | 161 | get_order(p_data.reqsn); //把单号返回 |
| 154 | 162 | } |
| 155 | 163 | |
| 164 | + getApp().globalData.is_tonglian_pay=1; //是通联支付的时候 | |
| 165 | + | |
| 156 | 166 | wx.openEmbeddedMiniProgram({ |
| 157 | 167 | appId: 'wxef277996acc166c3', |
| 158 | 168 | extraData: p_data, | ... | ... |
utils/util.js
| ... | ... | @@ -895,6 +895,10 @@ module.exports = { |
| 895 | 895 | */ |
| 896 | 896 | is_pay_ok(ok_order_sn,back_url,err_url,func,success,fail,is_navigateTo){ |
| 897 | 897 | |
| 898 | + //如果不是通联支付,立即返回 | |
| 899 | + if(!getApp().globalData.is_tonglian_pay) return false; | |
| 900 | + getApp().globalData.is_tonglian_pay=0; | |
| 901 | + | |
| 898 | 902 | if(!ok_order_sn) { |
| 899 | 903 | return false; |
| 900 | 904 | } | ... | ... |