diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 3e652a1..e8b20a8 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -449,8 +449,10 @@ Component({ var url = "/api/weshop/activitylist/getGoodActInfo"; var req_data = { store_id: os.stoid, goodsidlist: val.goods_id, is_detail: 1, user_id: user_id - }; - + }; + + item.prom_type = 0; + item.prom_id = 0; //获取商品的实际活动 await getApp().request.promiseGet(url, { data: req_data }).then(res => { if (res.data.code == 0 && res.data.data && res.data.data.length == 1) { @@ -469,12 +471,12 @@ Component({ item.cardprice1 = val.cardprice1; item.cardprice2 = val.cardprice2; item.cardprice3 = val.cardprice3; - item.prom_type = val.prom_type; - item.prom_id = val.prom_id; + // 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; - prom_id = val.prom_id; + prom_id = item.prom_id; var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购 diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 24dd633..e31af3f 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -11,8 +11,8 @@ - 全部 - {{item.title}} + 全部 + {{item.title}} @@ -33,14 +33,14 @@ - {{item.title}} + {{item.title}} - {{item.title}} + {{item.title}} diff --git a/components/diy_luckyGo/diy_luckyGo.js b/components/diy_luckyGo/diy_luckyGo.js index a40cf99..ba50a93 100644 --- a/components/diy_luckyGo/diy_luckyGo.js +++ b/components/diy_luckyGo/diy_luckyGo.js @@ -106,7 +106,7 @@ Component({ var user_id=getApp().globalData.user_id; if(!user_id){ user_id=0;} // var req={ store_id: os.stoid, is_end: 0, is_show: 1, timetype: 2,user_id:user_id}; 原来的 - var req={ store_id: os.stoid, is_end: 0, timetype: 1}; + var req={ store_id: os.stoid, is_end: 0, timetype: 1,user_id:user_id}; getApp().request.promiseGet("/api/weshop/prom/luckyActivity/page", { isShowLoading: 1, data:req } ).then(res => { diff --git a/components/diy_public/diy_public.js b/components/diy_public/diy_public.js index 1c616a5..7583dde 100644 --- a/components/diy_public/diy_public.js +++ b/components/diy_public/diy_public.js @@ -265,9 +265,9 @@ Component({ store_id:os.stoid, is_end:0, timetype:1, + user_id:user_id, // isuse:1, // page:1, - // user_id:user_id, // pageSize:9 } } diff --git a/packageA/pages/activity_share/activity_share.js b/packageA/pages/activity_share/activity_share.js index 8d774ed..19a66d9 100644 --- a/packageA/pages/activity_share/activity_share.js +++ b/packageA/pages/activity_share/activity_share.js @@ -572,7 +572,8 @@ Page({ case 7: //幸运购 url = '/api/weshop/prom/luckyActivity/page'; - req_data.is_end = 0; + req_data.is_end = 0; + req_data.user_id = user_id; req_data.timetype = 1; if(th.data.key_str && th.data.key_str.trim()){ req_data.key_str = th.data.key_str.trim(); diff --git a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js index d6c4b6f..c61c689 100644 --- a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js +++ b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js @@ -69,7 +69,8 @@ Page({ self.getData(true, '/api/weshop/prom/luckyActivity/page', { store_id: app.globalData.setting.stoid, is_end: 0, - timetype: 1, + timetype: 1, + user_id: user ? user.user_id : '0' }); @@ -97,10 +98,12 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function () { + let user = this.data.user this.scrollToLower('/api/weshop/prom/luckyActivity/page', { store_id: app.globalData.setting.stoid, is_end: 0, - timetype: 1, + timetype: 1, + user_id: user ? user.user_id : '0' }); }, diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index ffab368..2303053 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -2167,8 +2167,8 @@ Page({ var th=this; let aid = options.aid; let store_id = options.store_id; - let user_id = options.user_id; - let url = `/api/weshop/prom/luckyActivity/page?store_id=${store_id}&is_end=0&timetype=1&id=${aid}`; + let user_id = options.user_id || '0'; + let url = `/api/weshop/prom/luckyActivity/page?store_id=${store_id}&is_end=0&timetype=1&id=${aid}&user_id=${user_id}`; getApp().request.get(url, { success: function (res) { if (res.data.code == 0) { diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 57666a2..2c63d4b 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -1166,7 +1166,9 @@ Page({ var team_id; var luckyGoInfo; var user_id = getApp().globalData.user_id; - + if (!user_id) { + user_id=0 + } // 邀请链接待完善 @@ -1177,6 +1179,7 @@ Page({ is_end: 0, timetype: 1, id: th.data.param.group_id, + user_id, } }).then(res => { if(res.data.code == 0) { diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index eb01416..861a66e 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -976,6 +976,7 @@ Page({ is_end: 0, timetype: 1, id: this.data.group_id, + user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } }).then(res => { // console.log() @@ -1018,10 +1019,11 @@ Page({ if (this.data.isTimeUp) { wx.showModal({ title: '提示', - content: '活动已经暂停', + content: '活动已经暂停或者当前会员身份不符,无法参与', showCancel: false, success: function () { - wx.navigateBack(); + // wx.navigateBack(); + ut.wx_back(); } }) return false; diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index 49fa4f2..8478cba 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -1454,7 +1454,7 @@ Page({ isnew:1 }, }).then(res => { - debugger + // debugger if(res.data.code==0 && res.data.data && res.data.data.promgoodsbuynum){ item1.promgoodsbuynum = res.data.data.promgoodsbuynum; } @@ -2929,14 +2929,16 @@ Page({ cart_item.g_monthlb_num = [{ 'month_id': item_map.monthlibao, "monthnum": item_map.monthlb_num, - 'monthlbtitle': item_map.monthlbtitle + 'monthlbtitle': item_map.monthlbtitle, + 'prom_id':item_map.prom_id }]; } else { cart_item.monthlibao += "," + item_map.monthlibao; cart_item.g_monthlb_num.push({ 'month_id': item_map.monthlibao, "monthnum": item_map.monthlb_num, - 'monthlbtitle': item_map.monthlbtitle + 'monthlbtitle': item_map.monthlbtitle, + 'prom_id':item_map.prom_id }) } } @@ -5431,7 +5433,8 @@ Page({ let obj = { num: ite.monthnum, l_id: ite.month_id, - monthlbtitle: ite.monthlbtitle + monthlbtitle: ite.monthlbtitle, + prom_id: ite.prom_id, } marr.push(obj) }) @@ -5886,8 +5889,12 @@ Page({ } var str = JSON.stringify(pdata); + console.log("--str--"); + console.log(str); + // return false; + wx.showLoading({ title: "加载中" }); th.setData({ submit: 1, }) wx.request({ diff --git a/pages/index/index/index.js b/pages/index/index/index.js index 6ece82d..4796e70 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -513,6 +513,7 @@ Page({ store_id: getApp().globalData.setting.stoid, is_end: 0, timetype: 1, + user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } }).then(res => { if (res.data.code == 0) { diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs index 99bc793..d636b20 100644 --- a/pages/user/index/filter.wxs +++ b/pages/user/index/filter.wxs @@ -1,29 +1,8 @@ -var is_close = function (name,c_list) { +var is_close = function (name,c_list,map) { if(!c_list) return 0; - var map={}; - map['我的分销']="1"; - map['我的拼单']="2"; - map['秒杀活动']="3"; - map['PLUS会员']="4"; - map['我的权益']="5"; - map['联系客服']="6"; - map['收藏夹']="7"; - map['我的地址']="8"; - map['收入卡包']="9"; - map['专享礼包']="10"; - map['我的服务']="12"; - map['我的评价']="13"; - map['我的礼包']="14"; - map['助力活动']="15"; - map['充值有礼']="16"; - map['幸运大转盘']="17"; - map['幸运购']="18"; - map['套盒商品']="19"; - map['AI测肤']="20"; - map['附近门店']="21"; - map['积分签到']="22"; - map['瘦身日记']="23"; - map['每月礼包']="24"; + if(!map){ + return 0; + } var index=map[name]; //我的权益要判断5,和11 diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 0df426f..a5e90b1 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -1118,6 +1118,17 @@ Page({ }) if (!d_list) return false; + + let t_map={}; + for (let i in d_list) { + let ite=d_list[i]; + t_map[ite.name]=ite.id+''; + } + this.setData({ + tool_map:t_map + }) + + //过滤掉分销关闭的 let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的 await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => { diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index 9d43f47..0c49f85 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -316,7 +316,7 @@ - + diff --git a/pages/user/order_list/ofilter.wxs b/pages/user/order_list/ofilter.wxs index 8968b99..e10ac1a 100644 --- a/pages/user/order_list/ofilter.wxs +++ b/pages/user/order_list/ofilter.wxs @@ -4,5 +4,24 @@ module.exports = { if(item.presell && item.presell.presell_type==0 && item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0) url='/packageC/pages/presell/cart/cart?is_fwk=1&order_id='+item.order_id return url; - } + }, + for_mat_val:function (e){ + if(e===undefined) return '-'; + if(e===null) return '-'; + if(e==="null") return '-'; + if(e==="") return '-'; + return e; + }, + toFix: function (val, count) { + + if(val===undefined) return '-'; + if(val===null) return '-'; + if(val==="null") return '-'; + if(val==="") return '-'; + if (!val) { + return "0"; + } + val = parseFloat(val); + return parseFloat(val.toFixed(count)) + }, } \ No newline at end of file diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index ff01b1d..ea575e4 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -80,19 +80,19 @@ Page({ searchContent: '', ser_paying:0, + have_get_nor:0, //看一下普通订单有没有获取 }, onLoad: function (t) { self = this; // 设置日期选择器的结束时间为当前日期 var now = new Date(); - var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); + var nowDate = now.getFullYear() + '-' + this.check_is_big(now.getMonth() + 1) + '-' + this.check_is_big(now.getDate()); var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); - var startDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); - + var startDate = date.getFullYear() + '-' + this.check_is_big(date.getMonth() + 1) + '-' + this.check_is_big(date.getDate()); if (t.index) { - if(t.tabindex) t.tabindex=0; + if(!t.tabindex) t.tabindex=0; this.setData({ currentIndex: t.index, tabIndex: t.tabindex, @@ -126,6 +126,14 @@ Page({ }, + + + //判断是不是大于10补0 + check_is_big(num){ + if(num<10) num='0'+num; + return num; + }, + onShow: function () { wx.showLoading(); var th=this; @@ -252,7 +260,12 @@ Page({ r = r + "&page=" + e.data.currentPage; s.request(r, function (t) { - th.setData({ is_get: 1 }); + th.data.have_get_nor=1; + + if(t.data.data.page*t.data.data.pageSize>=t.data.data.total){ + th.setData({ iscodeall: 1 }); + } + var data = e.data.orderList; //-- 如果有值的时候 -- @@ -437,6 +450,8 @@ Page({ wx.hideLoading(); } + th.setData({ is_get: 1 }); + @@ -445,19 +460,30 @@ Page({ //滑倒底部 onReachBottom: function () { + + + if (this.data.currentIndex == 0) { if (s.data.goodsLoadFinishFlag) { this.setData({ iscodeall: 1 }) } - s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); + + if(!this.data.iscodeall){ + wx.showLoading(); + s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); + } + + } else { if (this.data.currentIndex == 1) { this.request_list({ store_id: os.stoid, user_id: oo.user_id, page: this.data.currentPage2, + BeginDate: this.data.startDate, + EndDate: this.data.endDate }); } else { // 卡项订单 this.request_list({ @@ -1643,6 +1669,7 @@ Page({ is_end: 0, timetype: 1, id: goodsinfo.prom_id, + user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } }); @@ -2646,26 +2673,60 @@ Page({ url = '/api/weshop/recharge/user/page'; }; + wx.showLoading({ + title: '', + }) + app.request.promiseGet(url, { data: data }).then(async res => { wx.hideLoading(); // 关闭加载状态 th.data.is_load2 = 0; + // 请求成功 - if (res.data.code == 0) { + if (res.data.code == 0 && res.data.data && res.data.data.pageData) { + if (res.data.data.pageData.length > 0) { th.data.currentPage2++; var data = res.data.data.pageData; // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有 - if (res.data.data.page * res.data.data.pageSize > res.data.data.total) { th.setData({ is_no_more2: 1 }); } - let list = []; + if (res.data.data.page * res.data.data.pageSize >= res.data.data.total) { th.setData({ is_no_more2: 1 }); } + + + let list = th.data.list2; + if(!list) list=[]; if (currentIndex == 1) { //list = th.data.list2; - list = list.concat(data); + var new_data= data.map((item,index)=>{ + var all_qty=0; //总数量 + var all_yh=0; //总是优惠金额 + if(item.list && item.list.length){ + for (let iv = 0; iv < item.list.length; iv++) { + var tt_ite=item.list[iv]; + all_qty+=tt_ite.Qty; + all_yh+=tt_ite.LetSum; + } + item.all_qty=all_qty; + item.all_yh=all_yh; + } + if(item.CashRepNo){ + var q_arr=item.CashRepNo.split(','); + var n_arr=[]; + for (let ix = 0; ix { @@ -2713,6 +2774,7 @@ Page({ th.setData({ is_no_more2: 1 }); } } + if (callback) callback(res); } else { // wx.showToast({ @@ -2721,14 +2783,18 @@ Page({ // duration: 2000 // }) } + + th.setData({is_get:1}) + }) }, onClickTab(e) { - let currentIndex = e.target.dataset.index; + let currentIndex = parseInt(e.target.dataset.index || 0); this.setData({ - currentIndex: currentIndex + currentIndex: currentIndex, + is_get:0 }); this.setData({ @@ -2736,14 +2802,21 @@ Page({ is_no_more2: 0, currentPage2: 1, }); - if (currentIndex == 0) { + if (currentIndex == 0 && !this.data.have_get_nor) { console.log('线上订单'); /*--- this.setData({ startDate: '选择开始时间', endDate: '选择结束时间', });--*/ + wx.showLoading({ + title: '', + }) + this.requestOrderList(this.data.activeCategoryId); + }; + + if (currentIndex == 1) { console.log('线下订单'); this.request_list({ @@ -2869,14 +2942,6 @@ Page({ let endDate = this.data.endDate; // this.data.is_no_data2 = 0; - this.setData({ - currentPage2: 1, - list2: [], - is_no_data2: 0, - is_no_more2:0 - }); - - if (startDate == '选择开始时间' || endDate == '选择结束时间') { wx.showToast({ title: '请选择完整的查询时间~', @@ -2892,6 +2957,19 @@ Page({ return; }; + this.setData({ + currentPage2: 1, + list2: [], + is_no_data2: 0, + is_no_more2:0, + is_get:0 + }); + + + wx.showLoading({ + title: '', + }) + this.request_list({ store_id: os.stoid, @@ -2960,7 +3038,7 @@ Page({ if (e) { currentIndex = e.target.dataset.index; } else { - currentIndex = this.data.tabIndex + currentIndex = this.data.currentIndex }; // let || this.data.tabIndex; @@ -2971,14 +3049,14 @@ Page({ user_id: oo.user_id, }; this.setData({ - tabIndex: currentIndex, + tabIndex: this.data.tabIndex || 0, is_no_data2: 0, is_no_more2: 0, cardList: [], }); - switch (currentIndex) { + switch (parseInt(currentIndex+'')) { case 0: { // 全部 delete data.order_status; delete data.pay_status; @@ -2987,6 +3065,11 @@ Page({ case 1: { // 待支付 data.order_status = 0; delete data.pay_status; + + data.page=1; + data.BeginDate=this.data.startDate, + data.EndDate=this.data.endDate + break; }; case 2: { // 待评价 diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index 7aff9c6..42b0670 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -38,7 +38,7 @@ 查询 - 注:读取时段内近10笔记录 + @@ -499,29 +499,73 @@ - - - 单号:{{item.No}} - {{item.states}} + + + {{item.StorageName}} + + 营业员:{{item.StaffName}} + 单号:{{item.No}} - - {{item.BillDate}} - 消费总额:¥{{item.Sum}} + + 收银员:{{ofil.for_mat_val(item.Operator)}} + {{item.BillDate}} - - {{i.BarCode}} - {{i.WareName}} - - - 数量 - {{i.Qty}} - - - 单价 - ¥{{i.Price}}({{i.PosPrice}}) + + + + + 名称/条码 + + + 数量 + 单价 + 金额 + + + + + {{i.WareName}} + + {{i.BarCode}} + + ({{i.SpecName}}/{{i.UnitName}}) + - - 金额 - ¥{{i.Sum}} + + + {{i.Qty}} + {{i.Price}} + {{ofil.toFix(i.Sum,2)}} + + + + + + + 商品总数 + {{item.all_qty}} + + + 优惠金额 + {{ofil.toFix(item.all_yh,2)}} + + + 实付金额 + {{ofil.toFix(item.FactAndBank,2)}} + + + 本次积分 + {{ofil.for_mat_val(item.PIntegral)}} + + + 会员卡号 + {{item.VIPNo}} + + + 本次使用优惠券号 + - + + {{quan}} @@ -538,7 +582,7 @@ - + diff --git a/pages/user/order_list/order_list.wxss b/pages/user/order_list/order_list.wxss index 8ba96b0..16875da 100644 --- a/pages/user/order_list/order_list.wxss +++ b/pages/user/order_list/order_list.wxss @@ -587,11 +587,19 @@ page { border-radius: 16rpx; margin-top: 20rpx; } +.item.new_d { + background-color: white; + border-radius: 12rpx; + margin-top: 20rpx; +} + .subitem { width: calc(100% / 3); text-align: center; font-size: 26rpx; } + + .name { padding: 0 20rpx; margin: 20rpx 0; @@ -609,7 +617,7 @@ page { } .offline-container { - padding: 244rpx 20rpx 20rpx; + padding: 194rpx 18rpx 20rpx; } .search-btn2 { @@ -622,3 +630,51 @@ page { } + +.sto_title{ + line-height: 32rpx;font-weight: bolder;color: #000; text-align: center;padding-top: 38rpx; +} + +.order_info_new{ + line-height: 24rpx; color:#898585; padding: 0 30rpx; margin-top: 41rpx; +} + +.line_new{ + border-bottom:1rpx #a9a9a9 dashed; + border-top:1rpx #a9a9a9 dashed; + margin: 0rpx 30rpx; + height: 6rpx; +} + +.subitem_n1 { + width:314rpx; + font-size: 24rpx; +} + + +.subitem_n2 { + width:358rpx; + font-size: 24rpx; +} + +.tab_title{ + padding: 0 30rpx;color: #000; line-height: 24rpx;margin-top: 31rpx; margin-bottom: 34rpx; +} +.val_item{ + padding: 0 30rpx; line-height: 33rpx; +} +.val_item~.val_item{ + margin-top: 38rpx; +} +.more_info{ + min-height: 52rpx;padding: 0 30rpx;color: #898585; +} + +.je_color{ + color: #f87d27; +} + +.subitem_nn { + width: calc(100% / 3); + text-align: center; +}