diff --git a/app.js b/app.js index 95fab52..3a6d23c 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ App({ config2: null, code: null, heigth:0, - user_id: 5682068,// 4379287,// null,// 5682068, + user_id: null,// 4379287,// null,// 5682068, buy_now:null, picklist:null, //门店列表 wuliuprice: null, //物流价格表 diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 852fe1c..9ec8f0a 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -329,9 +329,10 @@ - 有图({{categories3[1].num}}) - 好评({{categories3[2].num}}) - 差评({{categories3[4].num}}) + 有图({{categories3[1].num}}) + 好评({{categories3[2].num}}) + 中评({{categories3[3].num}}) + 差评({{categories3[4].num}}) diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index 8df96a5..b14758a 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -1143,7 +1143,7 @@ left:31rpx;} } .xc_comment-have-pictures{ - width: 154rpx; + width: 153rpx; height: 42rpx; line-height: 42rpx; text-align: center; @@ -1153,7 +1153,7 @@ left:31rpx;} font-size: 28rpx; } .xc_comment-discuss{ - width: 154rpx; + width: 152rpx; height: 42rpx; line-height: 42rpx; text-align: center; diff --git a/pages/user/member/bring/bring.js b/pages/user/member/bring/bring.js index 3bed896..e0b7d16 100644 --- a/pages/user/member/bring/bring.js +++ b/pages/user/member/bring/bring.js @@ -223,6 +223,7 @@ Page({ delete user_infor.distribut_min; delete user_infor.type; + user_infor.source_type=1; var str = JSON.stringify(user_infor); // wx.showLoading({ title: "加载中" }); wx.request({ diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index ae16b54..9fa5676 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -8,10 +8,17 @@ Page({ iurl: os.imghost, order: null, optionIsGoup: !1, - user_note: "" + user_note: "", + conf:null, }, onLoad: function(e) { + var th=this; var r = void 0 !== e.isGoup && e.isGoup; + + getApp().getConfig2(function (e) { + th.setData({conf:e}); + }) + this.setData({ optionIsGoup: r }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); @@ -21,7 +28,7 @@ Page({ this.requestOrderDetail(this.data.order.order_id)); }, requestOrderDetail: function(e) { - var o = this,oid=e; + var o = this,oid=e,th=this; r.get(o.data.url + "/api/weshop/order/get/"+os.stoid+"/"+e, { success: function(e) { var r = e.data.data; @@ -75,9 +82,14 @@ Page({ //----没有相关的退款记录---- if (ttd.data.data.total==0){ r['is_all_return'] = 0; + goodslist.forEach(function (ee, ii) { - if (r['order_status'] == 1 && r['pay_status'] == 1 && gtype_num>1) - goodslist[ii]['return_btn']=1; + if (r['order_status'] == 1 && r['pay_status'] == 1 && gtype_num>1){ + //是不是可以单个商品退款 + if(th.check_for_return_btn(r) ) { + goodslist[ii]['return_btn']=1; + } + } }); }else{ //--------整单退-------- @@ -348,6 +360,34 @@ Page({ }); }, + //--判断是不是可以单个商品退-- + check_for_return_btn:function (item) { + if(item.coupon_no) return false; //有用优惠券 + if(item.order_prom_id) return false; //有订单优惠 + if(item.order_status>=2) return false; //订单状态>2 + var istrue=true; + //----判断是不是有优惠活动和赠送商品---- + for (var g in item.order_goods) { + var g_item=item.order_goods[g]; + if ((g_item.prom_type == 3 && g_item.discount_amount> 0) + || (g_item.prom_type== 3 && g_item.goods_price <= 0) + ) { + istrue=false; break + } + if (g_item.prom_type== 5) { + istrue=false; break + } + } + if(!istrue) return false; + var conf=this.data.conf; + //判断是不是原路退回 + if(conf.refund_type==1) return true; + else{ + if(item.order_amount==0 || item.user_money==0) return true; + } + return false; + } + }); \ 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 310ecec..98c1682 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -28,12 +28,17 @@ Page({ //已经读取过接口 is_get:0, + conf:null, }, onLoad: function(t) { + var th=this; //var e = void 0 === t.type ? this.data.activeCategoryId : t.type; if(t.type!=undefined) this.setData({activeCategoryId:t.type}) s.init(this, "", "orderList"); //this.requestOrderList(e), wx.removeStorageSync("order:order_list:update"); + getApp().getConfig2(function (e) { + th.setData({conf:e}); + }) }, onShow: function() { //wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1), @@ -60,6 +65,7 @@ Page({ case "4": r +="&order_status=2"; break; } + this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; s.request(r, function(t) { @@ -83,12 +89,22 @@ Page({ var gtype_num = tt.data.data.total; if(ttd.data.data.pageData == undefined) return false; var goodslist = tt.data.data.pageData; + //----没有相关的退款记录---- if (ttd.data.data.total==0){ data[ind]['is_all_return'] = 0; goodslist.forEach(function (ee, ii) { - if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num>1) - goodslist[ii]['return_btn']=1; + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num>1){ + + //empty($list.coupon_no) && empty($list.order_prom_id) && $list.order_status lt 2 && empty($list.is_prom) + //&& ($tpshop_config['refund_type'] eq 0 || ($tpshop_config['refund_type'] eq 1 && ($list['order_amount'] eq 0 + // || $list['user_money'] eq 0))) + item.goodslist=goodslist; + if(th.check_for_return_btn(item) ) { + goodslist[ii]['return_btn'] = 1; + } + } + }); }else{ //--------整单退-------- @@ -367,5 +383,36 @@ Page({ url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, }); + }, + + //--判断是不是可以单个商品退-- + check_for_return_btn:function (item) { + if(item.coupon_no) return false; //有用优惠券 + if(item.order_prom_id) return false; //有订单优惠 + if(item.order_status>=2) return false; //订单状态>2 + var istrue=true; + //----判断是不是有优惠活动和赠送商品---- + for (var g in item.goodslist) { + var g_item=item.goodslist[g]; + if ((g_item.prom_type == 3 && g_item.discount_amount> 0) + || (g_item.prom_type== 3 && g_item.goods_price <= 0) + ) { + istrue=false; break + } + if (g_item.prom_type== 5) { + istrue=false; break + } + } + if(!istrue) return false; + var conf=this.data.conf; + //判断是不是原路退回 + if(conf.refund_type==1) return true; + else{ + if(item.order_amount==0 || item.user_money==0) return true; + } + return false; } + + + }); \ No newline at end of file diff --git a/pages/user/return_goods_info/return_goods_info.wxml b/pages/user/return_goods_info/return_goods_info.wxml index 4a76fb9..898b382 100644 --- a/pages/user/return_goods_info/return_goods_info.wxml +++ b/pages/user/return_goods_info/return_goods_info.wxml @@ -1,3 +1,4 @@ + 订单编号:{{return_goods.order_sn}} @@ -10,9 +11,14 @@ {{item.goods_name}} - 退款金额 : ¥{{return_goods.back_money}} + 退款金额 : ¥{{return_goods.back_money}} + + + 退款金额 : ¥{{return_goods.back_money}} + + 售后信息 @@ -51,10 +57,12 @@ 亲爱的客户,您的服务正在处理中 + {{filters.format_time(return_goods.handle_time,1)}} 操作人:卖家 亲爱的客户,您的服务单已完成 + {{filters.format_time(return_goods.ok_time,1)}} 操作人:卖家