Commit 8a8c90a327799a84c844d840e95036eeb498ff0e
1 parent
a0b2db68
预售的部分定金支付和尾款支付的优化
Showing
6 changed files
with
298 additions
and
70 deletions
packageC/pages/presell/cart/cart.js
| @@ -123,7 +123,7 @@ Page({ | @@ -123,7 +123,7 @@ Page({ | ||
| 123 | bconfig: null, | 123 | bconfig: null, |
| 124 | showFold:true, | 124 | showFold:true, |
| 125 | 125 | ||
| 126 | - is_wfk:0, //-- 是不是服务卡项的购买 -- | 126 | + is_fwk:0, //-- 是不是服务卡项的购买 -- |
| 127 | }, | 127 | }, |
| 128 | 128 | ||
| 129 | 129 | ||
| @@ -156,8 +156,8 @@ Page({ | @@ -156,8 +156,8 @@ Page({ | ||
| 156 | if (t.order_id) this.data.order_id = t.order_id; | 156 | if (t.order_id) this.data.order_id = t.order_id; |
| 157 | if (t.order_sn) this.data.order_sn = t.order_sn; | 157 | if (t.order_sn) this.data.order_sn = t.order_sn; |
| 158 | 158 | ||
| 159 | - if(t.is_wfk){ | ||
| 160 | - this.data.is_wfk=1; | 159 | + if(t.is_fwk){ |
| 160 | + this.setData({is_fwk:1}); | ||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | wx.setNavigationBarTitle({ title: "订单详情", }) | 163 | wx.setNavigationBarTitle({ title: "订单详情", }) |
| @@ -239,7 +239,7 @@ Page({ | @@ -239,7 +239,7 @@ Page({ | ||
| 239 | //-- 如果是服务卡项的时候 -- | 239 | //-- 如果是服务卡项的时候 -- |
| 240 | if(th.data.is_fwk){ | 240 | if(th.data.is_fwk){ |
| 241 | ord_url="/api/weshop/recharge/user/page"; | 241 | ord_url="/api/weshop/recharge/user/page"; |
| 242 | - ord_req={store_id:os.stoid,rder_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; | 242 | + ord_req={store_id:os.stoid,order_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; |
| 243 | }else{ | 243 | }else{ |
| 244 | ord_url="/api/weshop/order/page"; | 244 | ord_url="/api/weshop/order/page"; |
| 245 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; | 245 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; |
| @@ -486,6 +486,14 @@ Page({ | @@ -486,6 +486,14 @@ Page({ | ||
| 486 | 486 | ||
| 487 | //-----获取商品------ | 487 | //-----获取商品------ |
| 488 | async get_buy_goods(ord, o_sn) { | 488 | async get_buy_goods(ord, o_sn) { |
| 489 | + | ||
| 490 | + | ||
| 491 | + | ||
| 492 | + if(this.data.is_fwk){ | ||
| 493 | + this.get_buy_card(ord); | ||
| 494 | + return false; | ||
| 495 | + } | ||
| 496 | + | ||
| 489 | var order = null, | 497 | var order = null, |
| 490 | order_goods = null, | 498 | order_goods = null, |
| 491 | goods = null, | 499 | goods = null, |
| @@ -497,12 +505,6 @@ Page({ | @@ -497,12 +505,6 @@ Page({ | ||
| 497 | act = null, //订单内容 | 505 | act = null, //订单内容 |
| 498 | th = this; | 506 | th = this; |
| 499 | 507 | ||
| 500 | - | ||
| 501 | - if(this.data.is_fwk){ | ||
| 502 | - get_buy_card(ord); | ||
| 503 | - return false; | ||
| 504 | - } | ||
| 505 | - | ||
| 506 | if (o_sn) { | 508 | if (o_sn) { |
| 507 | //获取order信息根据订单编号order_sn | 509 | //获取order信息根据订单编号order_sn |
| 508 | await getApp().request.promiseGet("/api/weshop/order/page", { | 510 | await getApp().request.promiseGet("/api/weshop/order/page", { |
| @@ -822,13 +824,25 @@ Page({ | @@ -822,13 +824,25 @@ Page({ | ||
| 822 | } | 824 | } |
| 823 | }, | 825 | }, |
| 824 | 826 | ||
| 827 | + | ||
| 828 | + //-- 服务卡项购买的时候 -- | ||
| 825 | async get_buy_card(ord){ | 829 | async get_buy_card(ord){ |
| 826 | 830 | ||
| 831 | + let order = null, | ||
| 832 | + order_goods = null, | ||
| 833 | + goods = null, | ||
| 834 | + pickup = null, | ||
| 835 | + distr_type = 0, | ||
| 836 | + exp_type = 0, | ||
| 837 | + presell = null, //订单从表 | ||
| 838 | + pre_arr = null, //订单内容 | ||
| 839 | + act = null, //订单内容 | ||
| 840 | + th = this; | ||
| 827 | 841 | ||
| 828 | let url = '/api/weshop/recharge/user/page' | 842 | let url = '/api/weshop/recharge/user/page' |
| 829 | let data = { | 843 | let data = { |
| 830 | - store_id: app.globalData.setting.stoid, | ||
| 831 | - user_id: this.data.userInfo.user_id, | 844 | + store_id: os.stoid, |
| 845 | + user_id: getApp().globalData.user_id, | ||
| 832 | order_id: ord, | 846 | order_id: ord, |
| 833 | }; | 847 | }; |
| 834 | 848 | ||
| @@ -837,6 +851,166 @@ Page({ | @@ -837,6 +851,166 @@ Page({ | ||
| 837 | data: data, | 851 | data: data, |
| 838 | }); | 852 | }); |
| 839 | 853 | ||
| 854 | + if(!ut.ajax_ok(res)){ | ||
| 855 | + getApp().confirmBox("未找到订单"); | ||
| 856 | + return false; | ||
| 857 | + } | ||
| 858 | + | ||
| 859 | + order= res.data.data.pageData[0]; | ||
| 860 | + //---获取订单从表--- | ||
| 861 | + await getApp().request.promiseGet("/api/weshop/rechargeServicelist/page", { | ||
| 862 | + data: { | ||
| 863 | + store_id: os.stoid, | ||
| 864 | + order_id: ord | ||
| 865 | + } | ||
| 866 | + }).then(res => { | ||
| 867 | + order_goods = res.data.data.pageData[0]; | ||
| 868 | + }); | ||
| 869 | + | ||
| 870 | + order_goods.goods_num=order_goods.qty; | ||
| 871 | + | ||
| 872 | + await getApp().request.promiseGet("/api/weshop/recharge/rechargePresell/get/" + oo.stoid + "/" + order.order_id, {}).then(res => { | ||
| 873 | + presell = res.data.data; | ||
| 874 | + }); | ||
| 875 | + | ||
| 876 | + //等待定金 | ||
| 877 | + if (order.order_status < 2 && presell.deposit_pay_time <= 0) { | ||
| 878 | + th.setData({ wait_dj: 1 }) | ||
| 879 | + } | ||
| 880 | + //等待尾款 | ||
| 881 | + if (order.order_status < 2 && presell.deposit_pay_time > 0 && presell.tail_pay_state == 0 && presell.presell_type != 1) { | ||
| 882 | + th.setData({ wait_wk: 1 }) | ||
| 883 | + wx.setNavigationBarTitle({ title: "支付尾款", }) | ||
| 884 | + } | ||
| 885 | + //等待发货 | ||
| 886 | + if (order.pay_status == 1 && order.shipping_status == 0) { | ||
| 887 | + th.setData({ wait_fh: 1 }) | ||
| 888 | + } | ||
| 889 | + | ||
| 890 | + if (order.pay_status == 1 && order.shipping_status == 1 && order.order_status < 2) { | ||
| 891 | + th.setData({ wait_sh: 1 }) | ||
| 892 | + } | ||
| 893 | + //------获取预售主表---------- | ||
| 894 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellForm/get/" + os.stoid + "/" + presell.prom_id, {}).then(res => { | ||
| 895 | + if (res.data.code == 0 && res.data.data) { | ||
| 896 | + act = res.data.data; | ||
| 897 | + th.setData({ | ||
| 898 | + act: res.data.data, | ||
| 899 | + }); | ||
| 900 | + } | ||
| 901 | + }) | ||
| 902 | + | ||
| 903 | + //-- 判断一下会员的身份 -- | ||
| 904 | + if (order.pay_status == 0) { | ||
| 905 | + var pre_data = { store_id: os.stoid, presell_id: presell.prom_id, timetype: 12, goods_id: order_goods.card_id }; | ||
| 906 | + pre_data.user_id = order.user_id; | ||
| 907 | + var isok = 1; | ||
| 908 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { | ||
| 909 | + data: pre_data, | ||
| 910 | + }).then(e => { | ||
| 911 | + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { | ||
| 912 | + pre_arr = e.data.data.pageData[0]; | ||
| 913 | + } else { | ||
| 914 | + isok = 0; | ||
| 915 | + } | ||
| 916 | + }) | ||
| 917 | + | ||
| 918 | + if (!isok) { | ||
| 919 | + getApp().confirmBox("会员身份不符合"); | ||
| 920 | + return false; | ||
| 921 | + } | ||
| 922 | + | ||
| 923 | + if (th.data.wait_dj) { | ||
| 924 | + if (act.is_end) { | ||
| 925 | + getApp().confirmBox("活动已经结束"); | ||
| 926 | + return false; | ||
| 927 | + } | ||
| 928 | + if (!act.isuse) { | ||
| 929 | + getApp().confirmBox("活动未启用"); | ||
| 930 | + return false; | ||
| 931 | + } | ||
| 932 | + if (th.data.act.end_time < ut.gettimestamp()) { | ||
| 933 | + getApp().confirmBox("活动的定金时间已经结束", function () { | ||
| 934 | + ut.wx_back(); | ||
| 935 | + }); | ||
| 936 | + return false; | ||
| 937 | + } | ||
| 938 | + | ||
| 939 | + } | ||
| 940 | + if (th.data.wait_wk) { | ||
| 941 | + if (th.data.act.pay_enddate < ut.gettimestamp()) { | ||
| 942 | + getApp().confirmBox("活动的尾款时间已经结束", function () { | ||
| 943 | + ut.wx_back(); | ||
| 944 | + }); | ||
| 945 | + return false; | ||
| 946 | + } | ||
| 947 | + } | ||
| 948 | + } | ||
| 949 | + else { | ||
| 950 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/list", { | ||
| 951 | + data: { store_id: os.stoid, goods_id: order_goods.goods_id, presell_id: order_goods.prom_id } | ||
| 952 | + }).then(re => { | ||
| 953 | + if (re.data.code == 0 && re.data.data && re.data.data.length > 0) { | ||
| 954 | + pre_arr = re.data.data[0]; | ||
| 955 | + } | ||
| 956 | + }) | ||
| 957 | + | ||
| 958 | + if (!pre_arr) { | ||
| 959 | + getApp().confirmBox("未找到商品"); | ||
| 960 | + return false; | ||
| 961 | + } | ||
| 962 | + } | ||
| 963 | + | ||
| 964 | + //---获取商品--- | ||
| 965 | + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + order_goods.card_id, {}).then(res => { | ||
| 966 | + goods = res.data.data; | ||
| 967 | + order.market_price = goods.show_price; | ||
| 968 | + order.show_img = oo.imghost + goods.imgUrl; | ||
| 969 | + goods.original_img =goods.imgUrl; | ||
| 970 | + }); | ||
| 971 | + | ||
| 972 | + var g_url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + order_goods.card_id + "&pre_id=" + pre_arr.id; | ||
| 973 | + if (act.is_end || th.data.act.end_time < ut.gettimestamp()) { | ||
| 974 | + g_url = "/packageA/pages/goods/goodsInfo/goodsInfo?goods_id=" + order_goods.card_id; | ||
| 975 | + } | ||
| 976 | + | ||
| 977 | + //---获取门店--- | ||
| 978 | + await getApp().request.promiseGet("/api/weshop/pickup/get/" + oo.stoid + "/" + order.pickup_id, {}).then(res => { | ||
| 979 | + pickup = res.data.data; | ||
| 980 | + }); | ||
| 981 | + | ||
| 982 | + order['is_all_return'] = 0; | ||
| 983 | + var price = presell.presell_price; | ||
| 984 | + if (!goods) return false; | ||
| 985 | + | ||
| 986 | + | ||
| 987 | + //等待发货的时候 | ||
| 988 | + if (th.data.wait_fh) { | ||
| 989 | + var send_time = th.data.act.delivery_date; | ||
| 990 | + if (th.data.act.delivery_type == 2) { | ||
| 991 | + send_time = ut.gettimestamp() + th.data.act.delivery_daynum * 3600 * 24; | ||
| 992 | + } | ||
| 993 | + } | ||
| 994 | + | ||
| 995 | + order.order_goods = order_goods; | ||
| 996 | + var tail_pay = pre_arr.presell_price * order_goods.goods_num - presell.presell_deposit; | ||
| 997 | + this.setData({ | ||
| 998 | + order: order, | ||
| 999 | + pickup: pickup, | ||
| 1000 | + goods: goods, | ||
| 1001 | + presell: presell, | ||
| 1002 | + pre_arr: pre_arr, | ||
| 1003 | + userInfo: getApp().globalData.userInfo, | ||
| 1004 | + tail_pay: tail_pay, | ||
| 1005 | + order_goods: order_goods, | ||
| 1006 | + all_price: pre_arr.presell_price * order_goods.goods_num, | ||
| 1007 | + pickup_id: pickup.pickup_id, | ||
| 1008 | + send_time: send_time, | ||
| 1009 | + g_url: g_url | ||
| 1010 | + }); | ||
| 1011 | + th.get_diff(); | ||
| 1012 | + //统一进行计算金额 | ||
| 1013 | + th.calculatePrice2(); | ||
| 840 | }, | 1014 | }, |
| 841 | 1015 | ||
| 842 | async calculatePrice2() { | 1016 | async calculatePrice2() { |
| @@ -2562,14 +2736,21 @@ Page({ | @@ -2562,14 +2736,21 @@ Page({ | ||
| 2562 | tail_pay_type: ind,//0微信支付 1余额支付 | 2736 | tail_pay_type: ind,//0微信支付 1余额支付 |
| 2563 | }; | 2737 | }; |
| 2564 | 2738 | ||
| 2565 | - if (th.data.exp_type == 0 || th.data.exp_type==2 ) { | ||
| 2566 | - var index = th.data.index; | ||
| 2567 | - dd.shipping_code = th.data.wu_arr[index].code; | ||
| 2568 | - dd.shipping_name = th.data.wu_arr[index].name; | ||
| 2569 | - dd.shipping_price = parseFloat(th.data.exp_price); | ||
| 2570 | - dd.addressid = th.data.user_addr.address_id; | ||
| 2571 | - } | ||
| 2572 | 2739 | ||
| 2740 | + //尾款支付的网址 | ||
| 2741 | + var wk_url=oo.url + '/api/weshop/order/pay/payPresellWk'; | ||
| 2742 | + if(!th.data.is_fwk){ | ||
| 2743 | + if (th.data.exp_type == 0 || th.data.exp_type==2 ) { | ||
| 2744 | + var index = th.data.index; | ||
| 2745 | + dd.shipping_code = th.data.wu_arr[index].code; | ||
| 2746 | + dd.shipping_name = th.data.wu_arr[index].name; | ||
| 2747 | + dd.shipping_price = parseFloat(th.data.exp_price); | ||
| 2748 | + dd.addressid = th.data.user_addr.address_id; | ||
| 2749 | + } | ||
| 2750 | + }else{ | ||
| 2751 | + delete dd.exp_type; | ||
| 2752 | + wk_url=oo.url + '/api/weshop/order/pay/payPresellWkCard'; | ||
| 2753 | + } | ||
| 2573 | 2754 | ||
| 2574 | if(dd.exp_type==2){ | 2755 | if(dd.exp_type==2){ |
| 2575 | dd.lon=th.data.lon?th.data.lon:0; | 2756 | dd.lon=th.data.lon?th.data.lon:0; |
| @@ -2609,7 +2790,7 @@ Page({ | @@ -2609,7 +2790,7 @@ Page({ | ||
| 2609 | 2790 | ||
| 2610 | console.log(JSON.stringify(dd)); | 2791 | console.log(JSON.stringify(dd)); |
| 2611 | wx.request({ | 2792 | wx.request({ |
| 2612 | - url: oo.url + '/api/weshop/order/pay/payPresellWk', | 2793 | + url: wk_url, |
| 2613 | data: JSON.stringify(dd), | 2794 | data: JSON.stringify(dd), |
| 2614 | method: 'POST', | 2795 | method: 'POST', |
| 2615 | header: { | 2796 | header: { |
packageC/pages/presell/cart/cart.wxml
| @@ -108,7 +108,7 @@ | @@ -108,7 +108,7 @@ | ||
| 108 | </view> | 108 | </view> |
| 109 | </view>--> | 109 | </view>--> |
| 110 | 110 | ||
| 111 | - <block wx:if="{{wait_wk && show_submit}}"> | 111 | + <block wx:if="{{wait_wk && show_submit && !is_fwk}}"> |
| 112 | <!-- 立即购买的时候 --> | 112 | <!-- 立即购买的时候 --> |
| 113 | <view class="tab-wrapper"> | 113 | <view class="tab-wrapper"> |
| 114 | <view hidden="{{distr_type==2}}" bindtap='set_wuliu' data-type='1' | 114 | <view hidden="{{distr_type==2}}" bindtap='set_wuliu' data-type='1' |
| @@ -129,7 +129,7 @@ | @@ -129,7 +129,7 @@ | ||
| 129 | </view> | 129 | </view> |
| 130 | <!----要进行判断地址是否显示----> | 130 | <!----要进行判断地址是否显示----> |
| 131 | <view bindtap="enterAddressPage" class="user-mes mgt20" | 131 | <view bindtap="enterAddressPage" class="user-mes mgt20" |
| 132 | - hidden='{{exp_type==1 }}'> | 132 | + hidden='{{exp_type==1 || is_fwk }}'> |
| 133 | <!-----默认地址显示----> | 133 | <!-----默认地址显示----> |
| 134 | <block wx:if="{{user_addr!=null}}"> | 134 | <block wx:if="{{user_addr!=null}}"> |
| 135 | <view class="user-contact"> | 135 | <view class="user-contact"> |
| @@ -158,7 +158,7 @@ | @@ -158,7 +158,7 @@ | ||
| 158 | </view> | 158 | </view> |
| 159 | </block> | 159 | </block> |
| 160 | 160 | ||
| 161 | - <view class="user-mes" style="margin-top: 20rpx" wx:if="{{order.pay_status==1 && order.exp_type==0}}"> | 161 | + <view class="user-mes" style="margin-top: 20rpx" wx:if="{{order.pay_status==1 && order.exp_type==0 && !is_fwk}}"> |
| 162 | <view class="user-contact" style=" margin-left: 20rpx"> | 162 | <view class="user-contact" style=" margin-left: 20rpx"> |
| 163 | {{order.consignee}}{{' '}}{{order.mobile}} | 163 | {{order.consignee}}{{' '}}{{order.mobile}} |
| 164 | </view> | 164 | </view> |
packageC/pages/presell/cart/cart2.js
| @@ -233,7 +233,7 @@ Page({ | @@ -233,7 +233,7 @@ Page({ | ||
| 233 | //如果是服务卡项的时候 | 233 | //如果是服务卡项的时候 |
| 234 | if(th.data.is_fwk){ | 234 | if(th.data.is_fwk){ |
| 235 | ord_url="/api/weshop/recharge/user/page"; | 235 | ord_url="/api/weshop/recharge/user/page"; |
| 236 | - ord_req={store_id:os.stoid,rder_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; | 236 | + ord_req={store_id:os.stoid,order_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; |
| 237 | }else{ | 237 | }else{ |
| 238 | ord_url="/api/weshop/order/page" | 238 | ord_url="/api/weshop/order/page" |
| 239 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; | 239 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; |
packageC/pages/presell/cart/cart2_pre.js
| @@ -359,7 +359,7 @@ Page({ | @@ -359,7 +359,7 @@ Page({ | ||
| 359 | //如果是服务卡项的时候 | 359 | //如果是服务卡项的时候 |
| 360 | if(th.data.is_fwk){ | 360 | if(th.data.is_fwk){ |
| 361 | ord_url="/api/weshop/recharge/user/page"; | 361 | ord_url="/api/weshop/recharge/user/page"; |
| 362 | - ord_req={store_id:os.stoid,rder_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; | 362 | + ord_req={store_id:os.stoid,order_sn:th.data.ok_order_sn,user_id:getApp().globalData.user_id}; |
| 363 | }else{ | 363 | }else{ |
| 364 | ord_url="/api/weshop/order/page"; | 364 | ord_url="/api/weshop/order/page"; |
| 365 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; | 365 | ord_req={store_id:os.stoid,parent_sn:th.data.ok_order_sn}; |
pages/user/order_list/order_list.js
| @@ -2511,7 +2511,7 @@ Page({ | @@ -2511,7 +2511,7 @@ Page({ | ||
| 2511 | 2511 | ||
| 2512 | app.request.promiseGet(url, { | 2512 | app.request.promiseGet(url, { |
| 2513 | data: data | 2513 | data: data |
| 2514 | - }).then(res => { | 2514 | + }).then(async res => { |
| 2515 | // 关闭加载状态 | 2515 | // 关闭加载状态 |
| 2516 | th.data.is_load2 = 0; | 2516 | th.data.is_load2 = 0; |
| 2517 | // 请求成功 | 2517 | // 请求成功 |
| @@ -2530,15 +2530,38 @@ Page({ | @@ -2530,15 +2530,38 @@ Page({ | ||
| 2530 | }; | 2530 | }; |
| 2531 | if (currentIndex == 2) { // 卡项订单 | 2531 | if (currentIndex == 2) { // 卡项订单 |
| 2532 | list = th.data.cardList; | 2532 | list = th.data.cardList; |
| 2533 | - var new_data= data.map((item,index)=>{ | ||
| 2534 | - if(item.list && item.list.length){ | ||
| 2535 | - item.pt_status=item.list[0].pt_status; | ||
| 2536 | - item.pt_tail_money=item.list[0].pt_tail_money; | ||
| 2537 | - item.prom_id=item.list[0].prom_id; | ||
| 2538 | - item.prom_type=item.list[0].prom_type; | ||
| 2539 | - } | ||
| 2540 | - return item; | ||
| 2541 | - }) | 2533 | + // var new_data= data.map((item,index)=>{ |
| 2534 | + // if(item.list && item.list.length){ | ||
| 2535 | + // item.pt_status=item.list[0].pt_status; | ||
| 2536 | + // item.pt_tail_money=item.list[0].pt_tail_money; | ||
| 2537 | + // item.prom_id=item.list[0].prom_id; | ||
| 2538 | + // item.prom_type=item.list[0].prom_type; | ||
| 2539 | + // } | ||
| 2540 | + // return item; | ||
| 2541 | + // }) | ||
| 2542 | + | ||
| 2543 | + var new_data=[]; | ||
| 2544 | + for (let ir = 0; ir <data.length ; ir++) { | ||
| 2545 | + var item=data[ir]; | ||
| 2546 | + if(item.list && item.list.length){ | ||
| 2547 | + item.pt_status=item.list[0].pt_status; | ||
| 2548 | + item.pt_tail_money=item.list[0].pt_tail_money; | ||
| 2549 | + item.prom_id=item.list[0].prom_id; | ||
| 2550 | + item.prom_type=item.list[0].prom_type; | ||
| 2551 | + } | ||
| 2552 | + | ||
| 2553 | + if(item.prom_type==8){ | ||
| 2554 | + await getApp().request.promiseGet('/api/weshop/recharge/rechargePresell/get/' + os.stoid + '/' + item.order_id, { | ||
| 2555 | + }).then(rr => { | ||
| 2556 | + if (rr.data.code == 0) { | ||
| 2557 | + item['presell'] = rr.data.data; | ||
| 2558 | + item['ord_url'] = '/packageC/pages/presell/cart/cart'; | ||
| 2559 | + } | ||
| 2560 | + }) | ||
| 2561 | + } | ||
| 2562 | + | ||
| 2563 | + new_data.push(item); | ||
| 2564 | + } | ||
| 2542 | 2565 | ||
| 2543 | list = list.concat(new_data); | 2566 | list = list.concat(new_data); |
| 2544 | th.setData({ cardList: list }); | 2567 | th.setData({ cardList: list }); |
pages/user/order_list/order_list.wxml
| @@ -321,45 +321,63 @@ | @@ -321,45 +321,63 @@ | ||
| 321 | <view class="Commodity_number flex-vertical-between fs24 padding border_bottom"> | 321 | <view class="Commodity_number flex-vertical-between fs24 padding border_bottom"> |
| 322 | <!--商品编号 --> | 322 | <!--商品编号 --> |
| 323 | <text selectable='true'>订单编号:{{item.order_sn}}</text> | 323 | <text selectable='true'>订单编号:{{item.order_sn}}</text> |
| 324 | - <!-- 订单状态 --> | ||
| 325 | - <view class="flex-center c-r"> | ||
| 326 | - <view wx:if="{{item.pay_status == 0 && item.order_status<2 }}"> | ||
| 327 | - <block wx:if="{{item.prom_type==6}}"> | ||
| 328 | - <block wx:if="{{item.pt_status==0}}" >未支付</block> | ||
| 329 | - <block wx:if="{{item.pt_status==1}}" >组团中</block> | ||
| 330 | - | ||
| 331 | - </block> | ||
| 332 | - <block wx:else> | ||
| 333 | - 待支付 | ||
| 334 | - </block> | ||
| 335 | - </view> | ||
| 336 | - <view wx:if="{{item.order_status<2}}"> | ||
| 337 | - <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block> | ||
| 338 | - </view> | ||
| 339 | 324 | ||
| 340 | - <view wx:if="{{item.order_status == 1 && item.pay_status==1}}" class="flex-center">待评价 | ||
| 341 | - <view class="lin"></view> | ||
| 342 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" | ||
| 343 | - data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"> | ||
| 344 | 325 | ||
| 345 | - </image> | ||
| 346 | - </view> | ||
| 347 | - <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价 | ||
| 348 | - <view class="lin"></view> | ||
| 349 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | ||
| 350 | - data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | 326 | + <!-- 这是预售的 --> |
| 327 | + <block wx:if="{{item.presell}}"> | ||
| 328 | + <block wx:if="{{item.order_status==3}}"> | ||
| 329 | + <text wx:if="{{item.presell.tail_pay_state==2}}">尾款支付失败</text> | ||
| 330 | + </block> | ||
| 331 | + <block wx:else> | ||
| 332 | + <text wx:if="{{item.presell.presell_type==0 && !item.presell.deposit_pay_time}}">待支付定金</text> | ||
| 333 | + <text wx:if="{{item.presell.presell_type!=1 && item.presell.deposit_pay_time && !item.presell.tail_pay_state}}">待尾款</text> | ||
| 334 | + <text wx:if="{{item.presell.presell_type==1 && item.order_status<2 && item.pay_status<1 }}">未支付</text> | ||
| 335 | + </block> | ||
| 336 | + </block> | ||
| 337 | + | ||
| 338 | + <block wx:else> | ||
| 339 | + <!-- 订单状态 --> | ||
| 340 | + <view class="flex-center c-r"> | ||
| 341 | + <view wx:if="{{item.pay_status == 0 && item.order_status<2 }}"> | ||
| 342 | + <block wx:if="{{item.prom_type==6}}"> | ||
| 343 | + <block wx:if="{{item.pt_status==0}}" >未支付</block> | ||
| 344 | + <block wx:if="{{item.pt_status==1}}" >组团中</block> | ||
| 345 | + | ||
| 346 | + </block> | ||
| 347 | + <block wx:else> | ||
| 348 | + 待支付 | ||
| 349 | + </block> | ||
| 350 | + </view> | ||
| 351 | + <view wx:if="{{item.order_status<2}}"> | ||
| 352 | + <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block> | ||
| 353 | + </view> | ||
| 354 | + | ||
| 355 | + <view wx:if="{{item.order_status == 1 && item.pay_status==1}}" class="flex-center">待评价 | ||
| 356 | + <view class="lin"></view> | ||
| 357 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" | ||
| 358 | + data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"> | ||
| 359 | + | ||
| 360 | + </image> | ||
| 361 | + </view> | ||
| 362 | + <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价 | ||
| 363 | + <view class="lin"></view> | ||
| 364 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | ||
| 365 | + data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | ||
| 366 | + </view> | ||
| 367 | + | ||
| 368 | + | ||
| 369 | + <!-- 要判断支付尾款失败 --> | ||
| 370 | + <view wx:if="{{item.order_status == 3 && item.pt_status!=6}}" class="c-a9" class="flex-center">已取消 | ||
| 371 | + <view class="lin"></view> | ||
| 372 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | ||
| 373 | + data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | ||
| 374 | + </view> | ||
| 375 | + <view wx:if="{{item.order_status == 5}}">已作废</view> | ||
| 376 | + <view wx:if="{{item.pt_status==6}}"><text style="font-size: 26rpx;">支付尾款失败</text></view> | ||
| 351 | </view> | 377 | </view> |
| 378 | + </block> | ||
| 352 | 379 | ||
| 353 | 380 | ||
| 354 | - <!-- 要判断支付尾款失败 --> | ||
| 355 | - <view wx:if="{{item.order_status == 3 && item.pt_status!=6}}" class="c-a9" class="flex-center">已取消 | ||
| 356 | - <view class="lin"></view> | ||
| 357 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | ||
| 358 | - data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | ||
| 359 | - </view> | ||
| 360 | - <view wx:if="{{item.order_status == 5}}">已作废</view> | ||
| 361 | - <view wx:if="{{item.pt_status==6}}"><text style="font-size: 26rpx;">支付尾款失败</text></view> | ||
| 362 | - </view> | ||
| 363 | </view> | 381 | </view> |
| 364 | 382 | ||
| 365 | <!-- 商品详情集合 --> | 383 | <!-- 商品详情集合 --> |
| @@ -440,8 +458,14 @@ | @@ -440,8 +458,14 @@ | ||
| 440 | url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.list[0].card_id}}&order_id={{item.list[0].order_id}}&price={{item.list[0].price}}">评价</navigator> | 458 | url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.list[0].card_id}}&order_id={{item.list[0].order_id}}&price={{item.list[0].price}}">评价</navigator> |
| 441 | </block> | 459 | </block> |
| 442 | 460 | ||
| 461 | + | ||
| 462 | + <block wx:if="{{item.presell && item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0}}"> | ||
| 463 | + <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageC/pages/presell/cart/cart?order_id={{item.order_id}}&is_fwk=1" data-idx="{{index}}" >支付尾款</navigator> | ||
| 464 | + | ||
| 465 | + </block> | ||
| 466 | + | ||
| 443 | <navigator class="commodity_To_evaluate flex-level comment_go" | 467 | <navigator class="commodity_To_evaluate flex-level comment_go" |
| 444 | - bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.pay_status==0 && item.order_status<2}}">立即支付</navigator> | 468 | + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}">立即支付</navigator> |
| 445 | 469 | ||
| 446 | <navigator class="commodity_To_evaluate flex-level comment_go" | 470 | <navigator class="commodity_To_evaluate flex-level comment_go" |
| 447 | bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> | 471 | bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> |