From 809e49fa15e607d5d8c3149ac16daccf4a5bf3c1 Mon Sep 17 00:00:00 2001 From: abson Date: Sat, 26 Mar 2022 11:40:44 +0800 Subject: [PATCH] 3.26 oa单 --- app.js | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- components/diy_goodsGroup/diy_goodsGroup.js | 5 ++--- components/diy_goodsGroup/diy_goodsGroup.json | 4 +++- components/diy_goodsGroup/diy_goodsGroup.wxml | 4 +--- packageA/pages/activity_share/activity_share.js | 2 +- packageA/pages/prom_list/prom_list.js | 2 +- packageA/pages/quan_list/quan_list.js | 332 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------- packageC/pages/presell/cart/cart.js | 4 ++-- packageC/pages/presell/goodsInfo/goodsInfo.js | 2 +- packageC/pages/presell/pregoodsInfo/goodsInfo.js | 2 +- packageD/pages/AI-test-skin/success_result/success_result.wxml | 2 +- packageD/pages/AI-test-skin/success_result/success_result.wxss | 2 +- pages/cart/cart/cart.js | 6 +++--- pages/cart/cart2/cart2.js | 4 ++-- pages/goods/goodsInfo/goodsInfo.js | 5 ++--- pages/user/index/index.js | 1802 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/order_detail/order_detail.js | 8 ++++---- pages/user/order_list/order_list.js | 6 +++--- 18 files changed, 1171 insertions(+), 1151 deletions(-) diff --git a/app.js b/app.js index 8cb325d..eca65c5 100644 --- a/app.js +++ b/app.js @@ -51,7 +51,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - user_id: null,//5682094,6520044,6520119 qa 4687 6519901 + user_id: null,//5682094,6520044,6520119 qa 4687 6519901 zs 10153869 buy_now: null, picklist: null, //门店列表 wuliuprice: null, //物流价格表 @@ -61,7 +61,6 @@ App({ getu: null, //记录会员信息 sessionKey: null,//记录会员信息 openid: null, //记录会员信息 - to_group: null, //参团传递的数据 wxapp_buy_obj: null, //微信小程序购买的Object pk_store: null, //选择的门店 @@ -363,7 +362,7 @@ App({ title: t, mask: e, duration: a, - icon: 'error', + icon: 'error', // image: "/images/gt.png", complete: function () { "function" == typeof o && setTimeout(o, a); @@ -430,12 +429,12 @@ App({ }) }, //获取场景值 判断是否是单页面 - is_Single_page(_this,func) { - let scene = wx.getLaunchOptionsSync().scene; + is_Single_page(_this, func) { + let scene = wx.getLaunchOptionsSync().scene; //--判断是否是单页面-- - if(scene !== 1154){ - typeof func =="function" && func.bind(_this)(); - }else{ + if (scene !== 1154) { + typeof func == "function" && func.bind(_this)(); + } else { return false; } // return scene == 1154? false:true; @@ -672,11 +671,11 @@ App({ //清空登录时候缓存的值 onHide: function () { - var th=this; + var th = this; setTimeout(function () { console.log("app onhide"); console.log(th.globalData.no_clear); - if(!th.globalData.no_clear) { + if (!th.globalData.no_clear) { th.globalData.is_test = 0; th.globalData.guide_id = null; //导购清空 th.globalData.first_leader = null; //分享的会员清空 @@ -691,10 +690,10 @@ App({ th.globalData.dis_buy_obj = null; //等级卡的购买记录 th.globalData.storeFooter = null; //底部的导航 th.globalData.full_screen = null; //全屏 - }else{ - th.globalData.no_clear=0; + } else { + th.globalData.no_clear = 0; } - },600) + }, 600) }, @@ -803,7 +802,7 @@ App({ if (wx.canIUse('getUpdateManager')) { //创建 UpdateManager 实例 const updateManager = wx.getUpdateManager(); - if(!updateManager) { + if (!updateManager) { return false; } //检测版本更新 @@ -836,42 +835,42 @@ App({ }, //重复函数,统一调用, - pre_img(path){ - this.globalData.no_clear=1; + pre_img(path) { + this.globalData.no_clear = 1; wx.previewImage({ //将图片预览出来 urls: [path] }); }, //b是数组,t是wxml元素返回的 - pre_img2(b,t){ - this.globalData.no_clear=1; + pre_img2(b, t) { + this.globalData.no_clear = 1; wx.previewImage({ current: b[t.currentTarget.dataset.id], urls: b }); }, - con_wx(th){ - var url=th.data.sys_switch.weapp_customertype_url; - var id=th.data.sys_switch.weapp_customertype_appid; - this.globalData.no_clear=1; + con_wx(th) { + var url = th.data.sys_switch.weapp_customertype_url; + var id = th.data.sys_switch.weapp_customertype_appid; + this.globalData.no_clear = 1; wx.openCustomerServiceChat({ - extInfo: {url: url}, + extInfo: { url: url }, corpId: id, - success(res) {} + success(res) { } }) }, - con_Service(){ - var th=this; - var oss= this.globalData.setting; - this.getConfig(function(t) { + con_Service() { + var th = this; + var oss = this.globalData.setting; + this.getConfig(function (t) { if (t.store_tel == undefined) { th.request.get("/api/weshop/store/get/" + oss.stoid, { isShowLoading: 1, data: {}, - success: function(rs) { + success: function (rs) { th.globalData.config = rs.data.data; if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { wx.showToast({ @@ -881,46 +880,65 @@ App({ }) return false; } - th.globalData.no_clear=1; + th.globalData.no_clear = 1; wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) } }) } else { - th.globalData.no_clear=1; + th.globalData.no_clear = 1; wx.makePhoneCall({ phoneNumber: t.store_tel, }) } }); }, - - com_call(self) { - self.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - getApp().globalData.no_clear = 1; - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); - }, + + user_tools_endTime(type) { + //调用接口判断商家工具有没有过期 + return this.request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=" + type + "", {}).then(res => { + if (res.data.code == 0) { + var arr = res.data.data.pageData; + if (arr.length > 0) { + var item = arr[0]; + if (item.is_sy == 0) { + var now = Date.parse(new Date()); now = now / 1000; + if (item.end_time < now) { + return 0 + } + return 1; + } + } + } + }) + }, + + com_call(self) { + self.getTel() + .then(() => { + if (self.data.store_tel) { + wx.showModal({ + title: '联系客服', + content: '客服热线:' + self.data.store_tel, + confirmText: '拨打', + success(res) { + if (res.confirm) { + getApp().globalData.no_clear = 1; + wx.makePhoneCall({ + phoneNumber: self.data.store_tel, + }) + }; + }, + }); + }; + }); + }, //检验能不能分享 - check_can_share(){ - if(!this.globalData.user_id) wx.hideShareMenu(); - else wx.showShareMenu(); + check_can_share() { + if (!this.globalData.user_id) wx.hideShareMenu(); + else wx.showShareMenu(); } - + }); diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 3092772..4680b26 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -29,7 +29,7 @@ Component({ currentPage: 1, requestData: null, requestUrl: "", - goods_array: null, + goods_array: [], total: null, prom_id: 0, classstyle_id: null, @@ -424,7 +424,7 @@ Component({ this.data.currentPage = 1; - this.setData({ goods_array: null, total: null, title_index: title_idx }); + this.setData({ goods_array: [], total: null, title_index: title_idx }); //初始化 this.init(this.data.classstyle_id, this.data.wgroup); setTimeout(function () { wx.hideLoading(); }, 1000) @@ -467,7 +467,6 @@ Component({ item.cardprice3 = val.cardprice3; item.prom_type = val.prom_type; item.prom_id = val.prom_id; - if (val.prom_price) item.prom_price = val.prom_price; if (val.prom_integral) item.prom_integral = val.prom_integral; diff --git a/components/diy_goodsGroup/diy_goodsGroup.json b/components/diy_goodsGroup/diy_goodsGroup.json index e8cfaaf..c886449 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.json +++ b/components/diy_goodsGroup/diy_goodsGroup.json @@ -1,4 +1,6 @@ { "component": true, - "usingComponents": {} + "usingComponents": { + "mp-loading": "weui-miniprogram/loading/loading" + } } \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 654704a..ddd463f 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -3,6 +3,7 @@ + @@ -10,9 +11,6 @@ - - - diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index 5ae58a4..7599850 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -397,7 +397,7 @@ Page({ get_colloction: async function(){ var list=null; //-- 获取搭配购的从商品的信息 -- - await app.request.promiseGet("/api/weshop/goods/getGoodsPromList/"+oo.stoid+"/"+this.data.hui_active.main_goods_id+"/2",{}).then(res=>{ + await app.request.promiseGet("/api/weshop/goods/getGoodsPromList/"+oo.stoid+"/"+this.data.hui_active.main_goods_id+"/2"+"/"+getApp().globalData.user_id,{}).then(res=>{ if(res.data.code==0){ list=res.data.data.collocationList; } diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index ab3cc72..6b815f2 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -268,7 +268,7 @@ Page({ if (!ee.data.collocationList) { /*---获取活动的重表---*/ //调用接口判断订单优惠, - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2", {}).then(res => { + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + ee.data.gid + "/2"+"/"+oo.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; diff --git a/packageA/pages/quan_list/quan_list.js b/packageA/pages/quan_list/quan_list.js index 3187c68..b630ced 100644 --- a/packageA/pages/quan_list/quan_list.js +++ b/packageA/pages/quan_list/quan_list.js @@ -1,160 +1,190 @@ var t = require("../../../utils/util.js"), ut = t, - e = require("../../../utils/common.js"), - oo = getApp().globalData, - os = getApp().globalData.setting; -var utils = require('../../../utils/util.js'),ut=utils; + e = require("../../../utils/common.js"), + oo = getApp().globalData, + os = getApp().globalData.setting; +var utils = require('../../../utils/util.js'), ut = utils; Page({ - data: { - stoid: os.stoid, - url: os.url, - resourceUrl: os.resourceUrl, - iurl: os.imghost, - defaultAvatar: os.resourceUrl + "/static/images/user68.jpg", - dataList: null, - config2:null, - curpage:1, - loading:0, - get_item:null, - show_success:0, - getcurday:null, - }, - //------初始化加载---------- - onLoad: function(t) { - var th=this; - getApp().getConfig2(function (conf) { - if(conf.couponset) conf.couponset=conf.couponset.replace(/\ 0 && item.lqnum >= item.everyone_num) { - getApp().my_warnning('领取失败,您已领完该券', 0, this); - return false; - } - var lq_num = item.lqnum; - var pdata = { - 'uid': oo.user_id, - 'cid': cid, - 'store_id': os.stoid, - 'type': 5 - }; - //-- 导购ID -- - if(getApp().globalData.guide_id){ - pdata.guide_id=getApp().globalData.guide_id; + data: { + stoid: os.stoid, + url: os.url, + resourceUrl: os.resourceUrl, + iurl: os.imghost, + defaultAvatar: os.resourceUrl + "/static/images/user68.jpg", + dataList: null, + config2: null, + curpage: 1, + loading: 0, + get_item: null, + show_success: 0, + getcurday: null, + }, + //------初始化加载---------- + onLoad: function (t) { + var th = this; + getApp().getConfig2(function (conf) { + if (conf.couponset) conf.couponset = conf.couponset.replace(/\ 0 && item.lqnum >= item.everyone_num) { + getApp().my_warnning('领取失败,您已领完该券', 0, this); + return false; + } + var lq_num = item.lqnum; + var pdata = { + 'uid': oo.user_id, + 'cid': cid, + 'store_id': os.stoid, + 'type': 5 + }; + if (item.useobjecttype == 20 && item.type == 1) { + getApp().request.get('/api/weshop/goods/list', { + data: { + store_id: os.stoid, + erpwareid: item.useobjectid, + }, + success(res) { + if (ut.ajax_ok2(res)) { + good = res.data.data; + } + } + }) + } + //-- 导购ID -- + if (getApp().globalData.guide_id) { + pdata.guide_id = getApp().globalData.guide_id; + } + var app = getApp(), + th = this; + app.request.post("/api/weshop/couponList/saveCouponList", { + data: pdata, + success: function (res) { + if (res.data.code == 0) { + var text = "dataList[" + index + "].is_get"; + var text2 = "dataList[" + index + "].linging"; + var text3 = "get_item"; + var obj = {}; obj[text] = 1; obj[text2] = 0; obj[text3] = item; + th.setData(obj); + if (good.length > 0) { + wx.showToast({ + title: '领取成功', + success() { + let item = good[0]; + let url = `/pages/goods/goodsInfo/goodsInfo?goods_id=${item.goods_id}&prom_type=${item.prom_type}&prom_id=${item.prom_id}` + setTimeout(()=>{ + getApp().goto(url) + },500) + } + }) + + } else { + th.setData({ + show_success: 1, + }) + } + } else { + app.confirmBox(res.data.msg); + var text2 = "dataList[" + index + "].linging"; + th.setData({ [text2]: 0 }); + } + } + }) + }, + close_show: function () { + this.setData({ show_success: 0, get_item: null }) + }, + go_quan: function () { + getApp().goto("/pages/user/coupons/coupons"); + }, + go_detail: function (e) { + var index = e.currentTarget.dataset.ind; + var item = this.data.dataList[index]; + getApp().goto("/packageA/pages/quan_pro/quan_pro?id=" + item.id); } - var app = getApp(), - th = this; - app.request.post("/api/weshop/couponList/saveCouponList", { - data: pdata, - success: function(res) { - if (res.data.code == 0) { - var text = "dataList[" + index + "].is_get"; - var text2 = "dataList[" + index + "].linging"; - var text3 = "get_item"; - var obj = {};obj[text] = 1; obj[text2] = 0;obj[text3] = item;obj['show_success']=1; - th.setData(obj); - } else { - app.confirmBox(res.data.msg); - var text2 = "dataList[" + index + "].linging"; - th.setData({[text2]:0}); - } - } - }) - }, - close_show:function () { - this.setData({show_success:0,get_item:null}) - }, - go_quan:function () { - getApp().goto("/pages/user/coupons/coupons"); - }, - go_detail:function (e) { - var index=e.currentTarget.dataset.ind; - var item=this.data.dataList[index]; - getApp().goto("/packageA/pages/quan_pro/quan_pro?id="+item.id); - } }); diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 64106b5..8475b59 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -2256,7 +2256,7 @@ Page({ //如果优惠促销和搭配购的时候 if ((good.prom_type == 3 || good.prom_type == 5) && good.is_collocation != 1 && good.is_gift != 1) { var p_ok = 1; - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (!r_data.collocationPromList && good.prom_type == 5) { @@ -2336,7 +2336,7 @@ Page({ //不是赠品的时候 if (!good.is_gift && good.prom_type != 3) { var t_ok = 1; - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; //-- 参加了全局的优惠活动 -- diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index ca13be2..b91693d 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -1281,7 +1281,7 @@ Page({ callback(); } else { //-- 判断有没有优惠活动 -- - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0", {}).then(res => { + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; th.data.prom_goods = r_data.promGoodsLists; diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index 4ed4b77..1e25130 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -1278,7 +1278,7 @@ Page({ callback(); } else { //-- 判断有没有优惠活动 -- - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0", {}).then(res => { + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; th.data.prom_goods = r_data.promGoodsLists; diff --git a/packageD/pages/AI-test-skin/success_result/success_result.wxml b/packageD/pages/AI-test-skin/success_result/success_result.wxml index 354463c..ae358c7 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.wxml +++ b/packageD/pages/AI-test-skin/success_result/success_result.wxml @@ -7,7 +7,7 @@ 泪沟 --> - + {{item.name}} diff --git a/packageD/pages/AI-test-skin/success_result/success_result.wxss b/packageD/pages/AI-test-skin/success_result/success_result.wxss index ab8f06b..3093e14 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.wxss +++ b/packageD/pages/AI-test-skin/success_result/success_result.wxss @@ -6,7 +6,7 @@ page { } .tab_scroll { - position: fixed; + position: sticky; top: 0; z-index: 99; display: flex; diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index b16ff8e..ecbf7aa 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -402,7 +402,7 @@ Page({ }) if (is_g_prom) { - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (!r_data.promGoodsLists) { @@ -611,7 +611,7 @@ Page({ else if(item.prom_type == 0) { //如果有优惠活动,要更新活动 - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (r_data.promGoodsLists) { @@ -2482,7 +2482,7 @@ Page({ //如果是优惠活动话,要看活动有没有过期 if (i_arr[j].prom_type == 3) { //判断有没有活动 - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + i_arr[j].goods_id + "/1", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + i_arr[j].goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { if (!res.data.data.promGoodsLists) { t.my_warnning(i_arr[j].goods_name + "优惠活动已经过期", 0, th); diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 3300684..894f5ef 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -1802,7 +1802,7 @@ Page({ var order_m = 0; //---判断是不是有订单优惠--- await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { - data: { store_id: os.stoid, orderAmount: o_condition } + data: { store_id: os.stoid, orderAmount: o_condition,user_id:getApp().globalData.user_id} }).then(res => { if (res.data.code == 0) { var ord_prom = res.data.data; @@ -4052,7 +4052,7 @@ Page({ if (this.data.is_b_now == 1) pick = this.data.bn_pick; //---获取订单优惠--- getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { - data: { store_id: os.stoid, orderAmount: condition } + data: { store_id: os.stoid, orderAmount: condition,user_id:getApp().globalData.user_id } }).then(res => { if (res.data.code == 0) { var data = res.data.data; diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 00e38c7..48d955b 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -2138,7 +2138,7 @@ Page({ callback(); } else { //-- 判断有没有优惠活动 -- - getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0", {}).then(res => { + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0"+"/"+usr.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; th.data.prom_goods = r_data.promGoodsLists; @@ -6118,9 +6118,8 @@ Page({ } else { //调用接口判断订单优惠, - getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + gid + "/0", { + getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + gid + "/0"+"/"+user_id, { success: function (res) { - if (res.data.code == 0 && res.data.data) { var r_data = res.data.data; var max = 0, min = 0; diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 23af5a3..b3753f6 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -1,966 +1,940 @@ var auth = require("../../../utils/auth.js"), - rq = require("../../../utils/request.js"); + rq = require("../../../utils/request.js"); var e = getApp(), - app = e, - s = e.globalData.setting, - os = s, - app_d = e.globalData; + app = e, + s = e.globalData.setting, + os = s, + app_d = e.globalData; var regeneratorRuntime = require('../../../utils/runtime.js'); const { - barcode, - qrcode + barcode, + qrcode } = require('../../../utils/index.js'); var ut = require("../../../utils/util.js"); let self = null; Page({ - /** - * 页面的初始数据 - */ - data: { - length: 150, - iurl: s.imghost, - defaultAvatar: s.imghost + "/miniapp/images/no-head.jpg", - userInfo: null, - toji: null, //统计相关 - txmon: 0, - byquan: 0, - yuer: 0, - is_no_plus:1, - currentPage: 1, - recommend_list: [], - tc_hide: true, - sw_index: 0, - qy_list: null, - gradeId: null, - is_init: 0, - cz_val: 0, - full_cz_val: 0, - is_dengji: 0, //是不是等级 - is_banner: 0, //是不是有生日活动 - giftbagid: "", //生日活动的类型 - actId: "", //生日活动的id - actImg: "", - is_assistance: 0, //助力活动 - ad_img:"", - add_card_data:'', //等级卡的内容 - - hiddenCS: true, - }, - goto_nav: function(e) { - var th = this; - var url = e.currentTarget.dataset.url; - if (th.data.userInfo != null) { - getApp().goto(url); - } else { - wx.navigateTo({ - url: '/pages/togoin/togoin', - }) - } - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function(options) { - self = this; - var th=this; - getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, { - data: { - enabled: 1 - }, - success:function(res){ - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){ - var item=res.data.data.pageData[0]; - if (item && item.ad_code) th.setData({ad_img:item.ad_code}) - } - } - }) - app.getUserFir(); - this.init_user_tool() - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function() { - getApp().check_can_share(); - //看一下小程序是不是过期了 - getApp().getConfig2(function(config2){ - if(config2 && config2.is_overdue==1){ - getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{ - var o=res; - if (o.data.code == 0) { - var ob = { isout: 0, isbuy: 1 }; - var arr = o.data.data.pageData; - var isbuy = 0; - //----如果数组不为空---- - if (arr.length > 0) { - arr.forEach(function (val, ind) { - if (val.is_sy == 0 && val.type == 5) { - isbuy = 1; - var now = ut.gettimestamp(); - if (now > val.end_time) ob.isout = 1; - return false; - } - }) - } - ob.isbuy = isbuy; - th.setappdata(ob); - } - }) - } - }) - - //调用接口判断商家plus有没有过期 - rq.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => { - if (res.data.code == 0) { - var arr = res.data.data.pageData; - if (arr.length > 0) { - var item = arr[0]; - if (item.is_sy == 0) { - var now = Date.parse(new Date()); now = now / 1000; - if (item.end_time < now) { - th.setData({ is_no_plus: 0 }) - } - } - } - } - }) - var th=this; - + /** + * 页面的初始数据 + */ + data: { + length: 150, + iurl: s.imghost, + defaultAvatar: s.imghost + "/miniapp/images/no-head.jpg", + userInfo: null, + toji: null, //统计相关 + txmon: 0, + byquan: 0, + yuer: 0, + is_no_plus: 1, + currentPage: 1, + recommend_list: [], + tc_hide: true, + sw_index: 0, + qy_list: null, + gradeId: null, + is_init: 0, + cz_val: 0, + full_cz_val: 0, + is_dengji: 0, //是不是等级 + is_banner: 0, //是不是有生日活动 + giftbagid: "", //生日活动的类型 + actId: "", //生日活动的id + actImg: "", + is_assistance: 0, //助力活动 + ad_img: "", + add_card_data: '', //等级卡的内容 + + hiddenCS: true, + }, + goto_nav: function (e) { + var th = this; + var url = e.currentTarget.dataset.url; + if (th.data.userInfo != null) { + getApp().goto(url); + } else { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + self = this; + var th = this; + getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, { + data: { + enabled: 1 + }, + success: function (res) { + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) { + var item = res.data.data.pageData[0]; + if (item && item.ad_code) th.setData({ ad_img: item.ad_code }) + } + } + }) + app.getUserFir(); + this.init_user_tool() + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + getApp().check_can_share(); + //看一下小程序是不是过期了 + getApp().getConfig2(function (config2) { + if (config2 && config2.is_overdue == 1) { + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=5", {}).then(res => { + var o = res; + if (o.data.code == 0) { + var ob = { isout: 0, isbuy: 1 }; + var arr = o.data.data.pageData; + var isbuy = 0; + //----如果数组不为空---- + if (arr.length > 0) { + arr.forEach(function (val, ind) { + if (val.is_sy == 0 && val.type == 5) { + isbuy = 1; + var now = ut.gettimestamp(); + if (now > val.end_time) ob.isout = 1; + return false; + } + }) + } + ob.isbuy = isbuy; + th.setappdata(ob); + } + }) + } + }) + + //调用接口判断商家plus有没有过期 + rq.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=3", {}).then(res => { + if (res.data.code == 0) { + var arr = res.data.data.pageData; + if (arr.length > 0) { + var item = arr[0]; + if (item.is_sy == 0) { + var now = Date.parse(new Date()); now = now / 1000; + if (item.end_time < now) { + th.setData({ is_no_plus: 0 }) + } + } + } + } + }) + var th = this; + // 判断是否开启美业 getApp().promiseGet('/api/weshop/store/getTabSys/' + os.stoid, {}).then(res => { - if(res.data.code == 0) { + if (res.data.code == 0) { th.setData({ enableMeiye: res.data.data.EnableMeiye, }); }; }); - - - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + os.stoid, {}).then(res => { - if(res.data.code==0){ - var plusCard = res.data.data; - for (var i = 0; i < plusCard.length; i++) { - if(!plusCard[i].IsStopBuy) { th.setData({show_buy_plus:1}); break; } - } - } - }) - - if (typeof this.getTabBar === 'function' && this.getTabBar()) { - var index=getApp().getPageIndex(this); - this.getTabBar().setData({ - active: index //数字是当前页面在tabbar的索引 - }); - //getApp().requestCardNum(this); - } - - - var stoid = app_d.setting.stoid; - var s = this, th = s, - need_money = 0, - cur_g_num = 0; - - /*------会员登录------*/ - var e=getApp().globalData.userInfo; - if (e != undefined && e != null && e.mobile) { - - this.birthday(); - this.is_assistance(); - - s.setData({ - userInfo: e - }); - - //-- 要调用接口,获取卡的钱 -- - var url="/api/weshop/wxuser/getWxCardInfo?storeId="+os.stoid+"&userId="+e.user_id; - rq.get(url,{ - isShowLoading:0, - success: function(su) { - if(su.data.code==0){ - s.setData({ - add_card_data: su.data.data, - }); - } + + + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + os.stoid, {}).then(res => { + if (res.data.code == 0) { + var plusCard = res.data.data; + for (var i = 0; i < plusCard.length; i++) { + if (!plusCard[i].IsStopBuy) { th.setData({ show_buy_plus: 1 }); break; } + } } + }) + + if (typeof this.getTabBar === 'function' && this.getTabBar()) { + var index = getApp().getPageIndex(this); + this.getTabBar().setData({ + active: index //数字是当前页面在tabbar的索引 + }); + //getApp().requestCardNum(this); + } + + + var stoid = app_d.setting.stoid; + var s = this, th = s, + need_money = 0, + cur_g_num = 0; + + /*------会员登录------*/ + var e = getApp().globalData.userInfo; + if (e != undefined && e != null && e.mobile) { + + this.birthday(); + this.is_assistance(); + + s.setData({ + userInfo: e + }); + + //-- 要调用接口,获取卡的钱 -- + var url = "/api/weshop/wxuser/getWxCardInfo?storeId=" + os.stoid + "&userId=" + e.user_id; + rq.get(url, { + isShowLoading: 0, + success: function (su) { + if (su.data.code == 0) { + s.setData({ + add_card_data: su.data.data, + }); + } + } + }); + + /*-----统计-----*/ + rq.get("/api/weshop/order/waitlist", { + isShowLoading: 0, + data: { + user_id: app_d.user_id + }, + success: function (su) { + s.setData({ + toji: su.data.data, + }); + } + }) + /*-----获取线下会员的预存款和优惠券的数量-----*/ + rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + e.user_id, { + isShowLoading: 0, + success: function (su) { + if (su.data.code == 0 && su.data.data) { + var data = su.data.data; + if (!data) data = {}; + data.cashcount = parseInt(data.cashcount); + s.setData({ + udata: data, + }); + } + + } + }) + /*-----获取会员提现金额-----*/ + rq.get("/api/weshop/withdrawals/summoney", { + isShowLoading: 0, + data: { + user_id: e.user_id, + store_id: os.stoid, + status: 0 + }, + success: function (su) { + if (su.data.code == 0) { + var yuer = parseFloat(th.data.userInfo.user_money - + th.data.userInfo.frozen_money - su.data.data.summoney).toFixed(2); + th.setData({ + txmon: su.data.data.summoney, + yuer: yuer + }); + } + } + }) + + /*-----获取会员包邮券的数量-----*/ + rq.get("/api/weshop/userfeemail/page", { + isShowLoading: 0, + data: { + user_id: e.user_id, + store_id: os.stoid, + pageSize: 1, + isuse: 0 + }, + success: function (su) { + if (su.data.code == 0) { + th.setData({ + byquan: parseInt(su.data.data.total) + }); + } + } + }); + + /*-----物流信息提醒-----*/ + rq.get('/api/weshop/order/countDadaOrder', { + isShowLoading: 0, + data: { + user_id: e.user_id, + store_id: os.stoid, + }, + success: function (su) { + if (su.data.code == 0) { + th.setData({ + countDadaOrder: su.data.data + }); + } + } + }); + + + + + //--初始化是否有打勾-- + getApp().request.get("/api/weshop/users/grade/vip/init/get", { + data: { + storeId: os.stoid + }, + success: function (rs) { + if (rs.data.code == 0 && rs.data.data.isBool) { + th.setData({ is_init: 1 }); + /*-----获取会员权益列表-----*/ + rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { + isShowLoading: 0, + data: { + storeId: os.stoid, + pageSize: 100 + }, + success: async function (res) { + + //判断有没有值,没有值返回 + if (!ut.ajax_ok(res)) return false; + + var arr_data = res.data.data.pageData; + var gid = null, + g_qy_list = null, + cz_vals = 0, + need_money = 0, + backClass = null, + + GradeName = ''; + + //获取成长值 + await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", { + data: { + storeId: os.stoid, + userId: app_d.user_id + } + }).then(res => { + if (res.data.code == 0 && res.data.data) { + gid = res.data.data.GradeId; + var cz_val = res.data.data.GradeSum; + cz_vals = parseInt(cz_val); + GradeName = res.data.data.GradeName; + } + //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); + }) + var obj = { + cz_val: cz_vals, + GradeName: GradeName, + gradeId: gid, + is_grad_get: 1 + }; + + // 获取最大值 + await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", { + data: { + storeId: os.stoid + } + }).then(res => { + if (res.data.data) + backClass = res.data.data.pageData; + if (backClass) { + var full_cz_val = backClass[backClass.length - 1].BuyGradeSum; + //th.setData({ full_cz_val: full_cz_val}); + obj.full_cz_val = full_cz_val + } + }) + + //--会员权益中心页的修改-- + for (var i in backClass) { + var im = backClass[i]; + if (cz_vals < im.BuyGradeSum && need_money == 0) { + need_money = im.BuyGradeSum; + obj.need_money = need_money; + } + } + + //获取当前等级的特权 + await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", { + data: { + storeId: os.stoid, + GradeId: gid, + userId: app_d.user_id, + pageSize: 100 + } + }).then(res => { + if (res.data.data) + g_qy_list = res.data.data.pageData; + }); + + for (var i in arr_data) { + var item = arr_data[i]; + var FromId = th.check_is_has_qy(item, g_qy_list); + arr_data[i].ishas = 0; + if (FromId) { + arr_data[i].ishas = 1; + arr_data[i].FromId = FromId; + } + } + arr_data.sort(function (a, b) { + return b.ishas - a.ishas + }) + + //4个4个一组 + var arr = new Array(); + for (var i = 0; i < arr_data.length; i += 4) { + arr.push(arr_data.slice(i, i + 4)); + } + //th.setData({ qy_list: arr, need_money: need_money}); + obj.qy_list = arr; + th.setData(obj); + } + }) + } + } + }) + + /*-- 获取 --*/ + th.requestRecommend(); + + /*-------系统是否开通等级卡,会员是等级卡-----*/ + getApp().getConfig2(function (e) { + var t_swi = e.switch_list; + if (t_swi) t_swi = JSON.parse(t_swi) + if (t_swi) { + th.setData({ sys_switch: t_swi }); + var user_tool = []; + if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool); + th.setData({ c_list: user_tool }) + } + if (parseInt(t_swi.rank_switch) == 2) { + var userInfo = th.data.userInfo; + if (userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") { + var now = ut.gettimestamp(); + var str = userInfo.card_expiredate; + var end = new Date(str); + end = Date.parse(end) / 1000; + //---判断是不是有过期--- + if (now < end) { + th.setData({ + is_dengji: 1 + }) + } else { + th.setData({ + is_dengji: 3 + }) + } + } else { + th.setData({ + is_dengji: 2 + }) + } + } + }) + //th.requestRecommend(); + } + + //自定义组件一定要等到页面加载完了,才来调用selectComponnent + setTimeout(function () { + if (getApp().globalData.user_id) getApp().requestCardNum(th); + var goods_list = th.selectComponent("#goods_recommend"); //组件的id + goods_list.init(); + goods_list.get_list(); + }, 800) + }, + + //判断会员是后有改服务项目 + check_is_has_qy: function (item, g_qy_list) { + if (!g_qy_list) return false; + + for (var i in g_qy_list) { + var iter = g_qy_list[i]; + if (iter.FormId == item.Id) return g_qy_list[i].FormId; + } + return false; + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + for (var i = 1; i < 100; i++) { + clearInterval(i); + } + }, + setappdata: function (t) { + var t = getApp().globalData.wxapp_buy_obj; + if (t && t.isout == 1) + wx.navigateTo({ + url: "/pages/error/error?msg=小程序已经过期", + }); + if (t && t.isbuy == 0) + wx.navigateTo({ + url: "/pages/error/error?msg=还未购买小程序", + }); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + //!this.nomore && this.requestRecommend(); + var goods_list = this.selectComponent("#goods_recommend"); //组件的id + goods_list.init(); + setTimeout(function () { + goods_list.get_list(); + }, 300) + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { getApp().globalData.no_clear = 1; }, + + //------卡片的显示和关闭-------- + show_tc: function () { + if (!this.data.userInfo) return false; + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') + var val = this.data.userInfo.mobile + "|" + ut.formatTime(); + val = "^" + ut.base64_encode(val); + + qrcode('qrcode', val, 480, 480, this); + this.setData({ + tc_hide: false, }); - - /*-----统计-----*/ - rq.get("/api/weshop/order/waitlist", { - isShowLoading:0, - data: { - user_id: app_d.user_id - }, - success: function(su) { - s.setData({ - toji: su.data.data, - }); - } - }) - /*-----获取线下会员的预存款和优惠券的数量-----*/ - rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + e.user_id, { - isShowLoading:0, - success: function(su) { - if(su.data.code==0 && su.data.data ) { - var data = su.data.data; - if(!data) data={}; - data.cashcount = parseInt(data.cashcount); - s.setData({ - udata: data, - }); - } - - } - }) - /*-----获取会员提现金额-----*/ - rq.get("/api/weshop/withdrawals/summoney", { - isShowLoading:0, - data: { - user_id: e.user_id, - store_id: os.stoid, - status: 0 - }, - success: function(su) { - if (su.data.code == 0) { - var yuer = parseFloat(th.data.userInfo.user_money - - th.data.userInfo.frozen_money - su.data.data.summoney).toFixed(2); - th.setData({ - txmon: su.data.data.summoney, - yuer: yuer - }); - } - } - }) - - /*-----获取会员包邮券的数量-----*/ - rq.get("/api/weshop/userfeemail/page", { - isShowLoading:0, - data: { - user_id: e.user_id, - store_id: os.stoid, - pageSize: 1, - isuse: 0 - }, - success: function(su) { - if (su.data.code == 0) { - th.setData({ - byquan: parseInt(su.data.data.total) - }); - } - } - }); - - /*-----物流信息提醒-----*/ - rq.get('/api/weshop/order/countDadaOrder', { - isShowLoading:0, - data: { - user_id: e.user_id, - store_id: os.stoid, - }, - success: function(su) { - if (su.data.code == 0) { - th.setData({ - countDadaOrder: su.data.data - }); - } - } - }); - - - - - //--初始化是否有打勾-- - getApp().request.get("/api/weshop/users/grade/vip/init/get", { - data: { - storeId: os.stoid - }, - success:function (rs) { - if(rs.data.code==0 && rs.data.data.isBool){ - th.setData({is_init:1}); - /*-----获取会员权益列表-----*/ - rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", { - isShowLoading:0, - data: { - storeId: os.stoid, - pageSize: 100 - }, - success: async function(res) { - - //判断有没有值,没有值返回 - if(!ut.ajax_ok(res)) return false; - - var arr_data = res.data.data.pageData; - var gid = null, - g_qy_list = null, - cz_vals = 0, - need_money = 0, - backClass = null, - - GradeName = ''; - - //获取成长值 - await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", { - data: { - storeId: os.stoid, - userId: app_d.user_id - } - }).then(res => { - if (res.data.code == 0 && res.data.data) { - gid = res.data.data.GradeId; - var cz_val = res.data.data.GradeSum; - cz_vals = parseInt(cz_val); - GradeName = res.data.data.GradeName; - } - //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid}); - }) - var obj = { - cz_val: cz_vals, - GradeName: GradeName, - gradeId: gid, - is_grad_get:1 - }; - - // 获取最大值 - await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", { - data: { - storeId: os.stoid - } - }).then(res => { - if (res.data.data) - backClass = res.data.data.pageData; - if (backClass) { - var full_cz_val = backClass[backClass.length - 1].BuyGradeSum; - //th.setData({ full_cz_val: full_cz_val}); - obj.full_cz_val = full_cz_val - } - }) - - //--会员权益中心页的修改-- - for (var i in backClass) { - var im = backClass[i]; - if (cz_vals < im.BuyGradeSum && need_money == 0) { - need_money = im.BuyGradeSum; - obj.need_money = need_money; - } - } - - //获取当前等级的特权 - await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", { - data: { - storeId: os.stoid, - GradeId: gid, - userId: app_d.user_id, - pageSize: 100 - } - }).then(res => { - if (res.data.data) - g_qy_list = res.data.data.pageData; - }); - - for (var i in arr_data) { - var item = arr_data[i]; - var FromId = th.check_is_has_qy(item, g_qy_list); - arr_data[i].ishas = 0; - if (FromId) { - arr_data[i].ishas = 1; - arr_data[i].FromId = FromId; - } - } - arr_data.sort(function(a, b) { - return b.ishas - a.ishas - }) - - //4个4个一组 - var arr = new Array(); - for (var i = 0; i < arr_data.length; i += 4) { - arr.push(arr_data.slice(i, i + 4)); - } - //th.setData({ qy_list: arr, need_money: need_money}); - obj.qy_list = arr; - th.setData(obj); - } - }) - } - } - }) - - - - /*-- 获取 --*/ - th.requestRecommend(); - - /*-------系统是否开通等级卡,会员是等级卡-----*/ - getApp().getConfig2(function(e) { - var t_swi = e.switch_list; - if (t_swi) t_swi = JSON.parse(t_swi) - if(t_swi){ - th.setData({sys_switch:t_swi}); - - var user_tool=[]; - if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool); - th.setData({c_list:user_tool}) - - } - - - if (parseInt(t_swi.rank_switch) == 2) { - var userInfo = th.data.userInfo; - if (userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") { - var now = ut.gettimestamp(); - var str = userInfo.card_expiredate; - var end = new Date(str); - end = Date.parse(end) / 1000; - //---判断是不是有过期--- - if (now < end) { - th.setData({ - is_dengji: 1 - }) - } else { - th.setData({ - is_dengji: 3 - }) - } - } else { - th.setData({ - is_dengji: 2 - }) - } - } - }) - //th.requestRecommend(); - - - - - - } - - /*-- - var t_swi= getApp().globalData.config2.switch_list - if (t_swi){ - t_swi = JSON.parse(t_swi); - var user_tool=[]; - if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool); - th.setData({c_list:user_tool}) - } --*/ - - //自定义组件一定要等到页面加载完了,才来调用selectComponnent - setTimeout(function () { - if (getApp().globalData.user_id) getApp().requestCardNum(th); - var goods_list = th.selectComponent("#goods_recommend"); //组件的id - goods_list.init(); - goods_list.get_list(); - },800) - - - - }, - - - - //判断会员是后有改服务项目 - check_is_has_qy: function(item, g_qy_list) { - if (!g_qy_list) return false; - - for (var i in g_qy_list) { - var iter = g_qy_list[i]; - if (iter.FormId == item.Id) return g_qy_list[i].FormId; - } - return false; - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function() { - for(var i = 1; i < 100; i++) { - clearInterval(i); - } - }, - setappdata: function(t) { - var t=getApp().globalData.wxapp_buy_obj; - if (t && t.isout == 1) - wx.navigateTo({ - url: "/pages/error/error?msg=小程序已经过期", - }); - if (t && t.isbuy == 0) - wx.navigateTo({ - url: "/pages/error/error?msg=还未购买小程序", - }); - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - //!this.nomore && this.requestRecommend(); - var goods_list = this.selectComponent("#goods_recommend"); //组件的id - goods_list.init(); - setTimeout(function() { - goods_list.get_list(); - }, 300) - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function() { getApp().globalData.no_clear=1; }, - - //------卡片的显示和关闭-------- - show_tc: function() { - if (!this.data.userInfo) return false; - //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') - var val=this.data.userInfo.mobile+"|"+ut.formatTime(); - val="^"+ut.base64_encode(val); - - qrcode('qrcode', val, 480, 480, this); - this.setData({ - tc_hide: false, - }); - }, - hide_tc: function() { - this.setData({ - tc_hide: true, - }); - }, - - //--跳转到预存款页面-- - deposit: function() { - if (!this.data.userInfo) return false; - wx.navigateTo({ - url: '../deposit/deposit', - }) - }, - //--跳转到余额页面-- - balance: function() { - if (!this.data.userInfo) return false; - wx.navigateTo({ - url: '../member/menber', - }) - }, - //--跳转到优惠券-- - coupon: function() { - var th = this; - if (!this.data.userInfo) return false; - // th.sendsm(); - wx.navigateTo({ - url: '../coupons/coupons', - }) - }, - //--跳转到积分-- - integral: function() { - if (!this.data.userInfo) return false; - wx.navigateTo({ - url: '../integral/integral', - }) - }, - //--跳到绑定页面-- - gobindtel: function() { - wx.navigateTo({ - url: '/pages/togoin/togoin', - }) - }, - - go_order: function(e) { - if (!this.data.userInfo) return false; - var url = e.currentTarget.dataset.url; - wx.navigateTo({ - url: url, - }) - - }, - - //--加载更多商品-- - requestRecommend: function() { - var e = this, - t = '/api/weshop/goods/page?page=' + e.data.currentPage; - var th_recommend_list = e.data.recommend_list; - getApp().request.get(t, { - data: { - is_mainshow: 1, - isonsale: 1, - is_recommend: 1, - is_on_sale: 1, - store_id: os.stoid, - pageSize: 10 - }, - success: function(ee) { - var recommend_list = ee.data.data.pageData; - if (recommend_list && recommend_list.length > 0) { - var dd = [...th_recommend_list, ...recommend_list]; - e.setData({ - recommend_list, - dd - }); - e.data.currentPage++; - } else { - e.setData({ - nomore: 1 - }); - } - } - }) - }, - - //--跳转到权益页面-- - go_qy: function() { - if (!this.data.userInfo) return false; - var url = "/pages/user/userqy/userqy"; - getApp().goto(url); - }, - - //--跳转到商品详情页面-- - go_goods: function(e) { - var gid = e.currentTarget.dataset.gid; - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; - getApp().goto(url); - }, - - click_next: function() { - var index = this.data.sw_index; - index++; - if (index >= this.data.qy_list.length) return; - this.setData({ - sw_index: index - }) - }, - - click_pre: function() { - var index = this.data.sw_index; - index--; - if (index < 0) return; - this.setData({ - sw_index: index - }) - }, - - onSli: function(e) { - var that = this; - that.setData({ - sw_index: e.detail.current - }) - }, - - //--权益使用-- - go_qy_url: function(e) { - var th = this; - var no = e.currentTarget.dataset.no; - var ind = e.currentTarget.dataset.ind; - var find = e.currentTarget.dataset.find; - var item = th.data.qy_list[find][ind]; - if (item.ishas == undefined || !item.ishas) { - var qt_txt = th.selectComponent("#pop_txt"); //组件的id - var ob = { - title: "温馨提示", - content: "当前会员暂无此权益" - }; - qt_txt.open(ob); - return false; - } - - var url = e.currentTarget.dataset.img; - if(!url || url==""){ - url=`/public/upload/userqy/quanbg.jpg` - } - switch (no) { - case "01": - getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" + - url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); - break; - case "02": - getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); - break; - case "03": - getApp().goto("/pages/user/user_spsy/user_spsy?img=" + - url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); - break; - case "10": - getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { - data: { - storeId: os.stoid, - formId: item.Id, - userId: getApp().globalData.user_id, - gradeId: th.data.gradeId - }, - success: function(res) { - var val = res.data.data.Remark; - var title = res.data.data.PrivilegeName; - var qt_txt = th.selectComponent("#pop_txt"); //组件的id - var ob = { - title: title, - content: val - }; - qt_txt.open(ob); - } - }) - break; - } - }, - - //跳转到链接 - goto: function(e) { - var url = e.currentTarget.dataset.url; - getApp().goto(url); - }, - - //---------联系客服------------ - contactService: function() { + }, + hide_tc: function () { + this.setData({ + tc_hide: true, + }); + }, + + //--跳转到预存款页面-- + deposit: function () { + if (!this.data.userInfo) return false; + wx.navigateTo({ + url: '../deposit/deposit', + }) + }, + //--跳转到余额页面-- + balance: function () { + if (!this.data.userInfo) return false; + wx.navigateTo({ + url: '../member/menber', + }) + }, + //--跳转到优惠券-- + coupon: function () { + var th = this; + if (!this.data.userInfo) return false; + // th.sendsm(); + wx.navigateTo({ + url: '../coupons/coupons', + }) + }, + //--跳转到积分-- + integral: function () { + if (!this.data.userInfo) return false; + wx.navigateTo({ + url: '../integral/integral', + }) + }, + //--跳到绑定页面-- + gobindtel: function () { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + }, + + go_order: function (e) { + if (!this.data.userInfo) return false; + var url = e.currentTarget.dataset.url; + wx.navigateTo({ + url: url, + }) + + }, + + //--加载更多商品-- + requestRecommend: function () { + var e = this, + t = '/api/weshop/goods/page?page=' + e.data.currentPage; + var th_recommend_list = e.data.recommend_list; + getApp().request.get(t, { + data: { + is_mainshow: 1, + isonsale: 1, + is_recommend: 1, + is_on_sale: 1, + store_id: os.stoid, + pageSize: 10 + }, + success: function (ee) { + var recommend_list = ee.data.data.pageData; + if (recommend_list && recommend_list.length > 0) { + var dd = [...th_recommend_list, ...recommend_list]; + e.setData({ + recommend_list, + dd + }); + e.data.currentPage++; + } else { + e.setData({ + nomore: 1 + }); + } + } + }) + }, + + //--跳转到权益页面-- + go_qy: function () { + if (!this.data.userInfo) return false; + var url = "/pages/user/userqy/userqy"; + getApp().goto(url); + }, + + //--跳转到商品详情页面-- + go_goods: function (e) { + var gid = e.currentTarget.dataset.gid; + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; + getApp().goto(url); + }, + + click_next: function () { + var index = this.data.sw_index; + index++; + if (index >= this.data.qy_list.length) return; + this.setData({ + sw_index: index + }) + }, + + click_pre: function () { + var index = this.data.sw_index; + index--; + if (index < 0) return; + this.setData({ + sw_index: index + }) + }, + + onSli: function (e) { + var that = this; + that.setData({ + sw_index: e.detail.current + }) + }, + + //--权益使用-- + go_qy_url: function (e) { + var th = this; + var no = e.currentTarget.dataset.no; + var ind = e.currentTarget.dataset.ind; + var find = e.currentTarget.dataset.find; + var item = th.data.qy_list[find][ind]; + if (item.ishas == undefined || !item.ishas) { + var qt_txt = th.selectComponent("#pop_txt"); //组件的id + var ob = { + title: "温馨提示", + content: "当前会员暂无此权益" + }; + qt_txt.open(ob); + return false; + } + + var url = e.currentTarget.dataset.img; + if (!url || url == "") { + url = `/public/upload/userqy/quanbg.jpg` + } + switch (no) { + case "01": + getApp().goto("/packageB/pages/user/user_coupon/user_coupon?img=" + + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); + break; + case "02": + getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); + break; + case "03": + getApp().goto("/pages/user/user_spsy/user_spsy?img=" + + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); + break; + case "10": + getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { + data: { + storeId: os.stoid, + formId: item.Id, + userId: getApp().globalData.user_id, + gradeId: th.data.gradeId + }, + success: function (res) { + var val = res.data.data.Remark; + var title = res.data.data.PrivilegeName; + var qt_txt = th.selectComponent("#pop_txt"); //组件的id + var ob = { + title: title, + content: val + }; + qt_txt.open(ob); + } + }) + break; + } + }, + + //跳转到链接 + goto: function (e) { + var url = e.currentTarget.dataset.url; + getApp().goto(url); + }, + + //---------联系客服------------ + contactService: function () { getApp().com_call(this); }, - + // 获取客服热线 getTel() { return new Promise((resolve, reject) => { var self = this; var s = getApp(); - s.getConfig(function(t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function(rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().showWarning("商家未设置电话"); - return false; - } else { + s.getConfig(function (t) { + if (t.store_tel == undefined) { + getApp().request.get("/api/weshop/store/get/" + os.stoid, { + isShowLoading: 1, + data: {}, + success: function (rs) { + getApp().globalData.config = rs.data.data; + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { + getApp().showWarning("商家未设置电话"); + return false; + } else { self.setData({ store_tel: rs.data.data.store_tel, }); // s.confirmBox("客服热线:" + rs.data.data.store_tel); }; - - } - }) - } else { + + } + }) + } else { self.setData({ store_tel: t.store_tel, }); - // s.confirmBox("客服热线:" + t.store_tel); - } + // s.confirmBox("客服热线:" + t.store_tel); + } resolve(); }); }); }, - - - go_info: function() { - getApp().goto("/pages/user/userinfo/userinfo"); - }, - - jump: function() { - getApp().goto("/pages/user/grow_value/grow_value") - }, - // 判断生日营销的页面是不是存在 - birthday: function() { - - var th = this; - rq.get("/api/weshop/marketing/birthday/act/judge", { - data: { storeId: os.stoid, userId: app_d.user_id }, - success: function (res) { - - var code = res.data.code; - if (code == 0) { - var giftbagid = res.data.data.giftBagId; - var actId = res.data.data.id; - var actImg = res.data.data.actImg; - th.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg }); - th.setData({is_banner:1}); - } - - } - }) - }, - clike_banne: function() { - var th = this; - var actId = th.data.actId; - var giftbagid = th.data.giftbagid; - - if (actId != "" && giftbagid != "") { - - getApp().goto("/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3); - } else { - - getApp().showWarning("请稍后重试"); - } - }, - - // 判断助力活动是不是存在 - is_assistance: function() { - var th = this,r=Math.random()*100; - rq.get("/api/weshop/marketing/help/act/judge", { - data: { - storeId: os.stoid, - userId: app_d.user_id, - r:r, - }, - success: function(res) { - var code = res.data.code; - if (code == 0) { - th.setData({ - is_assistance: 1 - }); - }else{ + + + go_info: function () { + getApp().goto("/pages/user/userinfo/userinfo"); + }, + + jump: function () { + getApp().goto("/pages/user/grow_value/grow_value") + }, + // 判断生日营销的页面是不是存在 + birthday: function () { + + var th = this; + rq.get("/api/weshop/marketing/birthday/act/judge", { + data: { storeId: os.stoid, userId: app_d.user_id }, + success: function (res) { + + var code = res.data.code; + if (code == 0) { + var giftbagid = res.data.data.giftBagId; + var actId = res.data.data.id; + var actImg = res.data.data.actImg; + th.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg }); + th.setData({ is_banner: 1 }); + } + + } + }) + }, + clike_banne: function () { + var th = this; + var actId = th.data.actId; + var giftbagid = th.data.giftbagid; + + if (actId != "" && giftbagid != "") { + + getApp().goto("/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3); + } else { + + getApp().showWarning("请稍后重试"); + } + }, + + // 判断助力活动是不是存在 + is_assistance: function () { + var th = this, r = Math.random() * 100; + rq.get("/api/weshop/marketing/help/act/judge", { + data: { + storeId: os.stoid, + userId: app_d.user_id, + r: r, + }, + success: function (res) { + var code = res.data.code; + if (code == 0) { + th.setData({ + is_assistance: 1 + }); + } else { th.setData({ is_assistance: 0 }); } - } - }) - }, - - //导航跳转 - nav_goto:function(e){ - var url=e.currentTarget.dataset.url; - if(!url || url=='') return; - if(url[0]!='/') url='/'+url; - getApp().goto(url); - }, - - //添加卡包 - addcard:function(){ - var res=this.data.add_card_data; - if(!res) return false; - - var arr = new Array(6) - arr[0] = res.code; - arr[1] = res.timestamp; - arr[2] = res.jsapiTicket; - arr[3] = res.openid; - arr[4] = res.cardid; - arr[5] = res.nonceStr; - var c=arr.sort(); - var newstr=""; - for (var i=0;i 0) { - template_id = res.data.data.pageData[0].template_id; - // //授权订阅 - wx.requestSubscribeMessage({ - tmplIds: [template_id], - success(res) { - - }, - fail(res) { - - } - }) - } - } - }) - }, - - con_weixin:function () { - getApp().con_wx(this); - }, - - //初始话按钮图标 - init_user_tool:async function () { - var d_list=null; - //读取user_tool按钮图标 - await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id="+os.stoid, { - }).then(res=>{ - if(ut.ajax_ok(res)) { - d_list=res.data.data.pageData; - } - }) - if(!d_list) return false; - //过滤掉分销关闭的 - await getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ - if(rs.data.code==0){ - var dis=rs.data.data; - for(var i in d_list){ - if(d_list[i].name=='我的分销' && (!dis || dis.switch==0)){ - d_list.splice(i,1); - } - } - } - }) - - //判断右没有开AI测肤 - await getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+os.stoid,{}).then(rs=>{ - if(rs.data.code!=0 || !rs.data.data){ - for(var i in d_list){ - if(d_list[i].name=='AI测肤'){ - d_list.splice(i,1); - } - } - } - }) - this.setData({user_tool:d_list}); - }, - - - click_contact:function () { - getApp().globalData.no_clear=1; - }, + } + }) + }, + + //导航跳转 + nav_goto: function (e) { + var url = e.currentTarget.dataset.url; + if (!url || url == '') return; + if (url[0] != '/') url = '/' + url; + getApp().goto(url); + }, + + //添加卡包 + addcard: function () { + var res = this.data.add_card_data; + if (!res) return false; + + var arr = new Array(6) + arr[0] = res.code; + arr[1] = res.timestamp; + arr[2] = res.jsapiTicket; + arr[3] = res.openid; + arr[4] = res.cardid; + arr[5] = res.nonceStr; + var c = arr.sort(); + var newstr = ""; + for (var i = 0; i < c.length; i++) { + newstr += c[i]; + } + + var sh1 = ut.sha1(newstr); + wx.addCard({ + cardList: [ + { + cardId: res.cardid, + cardExt: '{"code": "' + res.code + '", "openid": "' + res.openid + '","timestamp": "' + res.timestamp + '","nonce_str":"' + res.nonceStr + '","outer_str":"web", "signature":"' + sh1 + '"}' + } + + ], + success: function (res) { }, + cancel: function (res) { } + }); + }, + + //订阅消息提醒 + sendsm: function () { + var template_id = ""; + rq.get("/api/wx/weappSendlist/page", { + data: { + store_id: os.stoid, + typeid: "1020" + }, + success: function (res) { + if (res.data.code == 0 && res.data.data.pageData.length > 0) { + template_id = res.data.data.pageData[0].template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + + }, + fail(res) { + + } + }) + } + } + }) + }, + + con_weixin: function () { + getApp().con_wx(this); + }, + + //初始话按钮图标 + init_user_tool: async function () { + var d_list = null; + //读取user_tool按钮图标 + await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id=" + os.stoid, { + }).then(res => { + if (ut.ajax_ok(res)) { + d_list = res.data.data.pageData; + } + }) - //打开客服操作菜单 - openCS() { - // 判断会员状态 - let user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { - wx.navigateTo({ - url: '/pages/togoin/togoin', - }) - return false; - }; - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - if(this.data.sys_switch) { - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 拨打电话号码 - this.contactService(); - } else { - this.getTel() + if (!d_list) return false; + //过滤掉分销关闭的 + let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的 + await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => { + if (rs.data.code == 0) { + var dis = rs.data.data; + for (var i in d_list) { + if (d_list[i].name == '我的分销' && (!dis || dis.switch == 0) || (d_list[i].name == '我的分销' && !distribut_end_time)) { + d_list.splice(i, 1); + } + } + } + }) + + //判断有没有开AI测肤 + await getApp().promiseGet("/api/weshop/wx/weappSkin/get/" + os.stoid, {}).then(rs => { + if (rs.data.code != 0 || !rs.data.data) { + for (var i in d_list) { + if (d_list[i].name == 'AI测肤') { + d_list.splice(i, 1); + } + } + } + }) + this.setData({ user_tool: d_list }); + }, + + + click_contact: function () { + getApp().globalData.no_clear = 1; + }, + + //打开客服操作菜单 + openCS() { + // 判断会员状态 + let user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == '' || user_info.mobile == null) { + wx.navigateTo({ + url: '/pages/togoin/togoin', + }) + return false; + }; + // csType/在线客服设置: + // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 + // 1小程序客服、 + // 2企业微信客服 + if (this.data.sys_switch) { + let csType = this.data.sys_switch.weapp_customertype; + if (csType == 0) { + // 拨打电话号码 + this.contactService(); + } else { + this.getTel() .then(() => { self.setData({ hiddenCS: false, }); }); - }; }; - - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, + }; + + }, + + //关闭客服操作菜单 + closeCS() { + this.setData({ + hiddenCS: true, + }); + }, diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 960f5e0..1c1ac5f 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -464,7 +464,7 @@ Page({ } }) if(is_g_prom){ - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (!r_data.collocationPromList && good.prom_type == 5) { @@ -585,7 +585,7 @@ Page({ //不是赠品的时候 if(!good.is_gift && good.prom_type!=3){ var t_ok=1; - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0"+"/"+getApp().globalData.user_id, {}).then(res => { if(res.data.code==0){ var r_data=res.data.data; //-- 参加了全局的优惠活动 -- @@ -1047,7 +1047,7 @@ Page({ }) //调用接口判断订单优惠, - const res = await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + g_item.goods_id + "/0", {}) + const res = await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + g_item.goods_id + "/0"+"/"+getApp().globalData.user_id, {}) if (res.data.code == 0 && res.data.data) { var r_data = res.data.data; if (r_data.ladderLists) { @@ -1215,7 +1215,7 @@ Page({ } }) if(is_g_prom) { - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (r_data.promGoodsLists) { diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index aed79a2..26a8e59 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -717,7 +717,7 @@ Page({ } }) if(is_g_prom){ - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (!r_data.collocationPromList && good.prom_type == 5) { @@ -838,7 +838,7 @@ Page({ else { if (!good.is_gift && good.prom_type != 3) { var t_ok = 1; - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/0"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; //-- 参加了全局的优惠活动 -- @@ -1457,7 +1457,7 @@ Page({ } }) if(is_g_prom) { - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1", {}).then(res => { + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + good.goods_id + "/1"+"/"+getApp().globalData.user_id, {}).then(res => { if (res.data.code == 0) { var r_data = res.data.data; if (r_data.promGoodsLists) { -- libgit2 0.21.4