diff --git a/api/admin.js b/api/admin.js index 4795d44..e3a88ee 100644 --- a/api/admin.js +++ b/api/admin.js @@ -41,7 +41,7 @@ export function postconfirm(merId, data) { return request.post("admin/" + merId + "/confirm" , data, { login: true }); } /** - * 同意先货后款 + * 先货后款订单结算 */ export function postsettle(merId, data) { return request.post("admin/" + merId + "/settle" , data, { login: true }); diff --git a/api/order.js b/api/order.js index dc62d9e..6c8e3d7 100644 --- a/api/order.js +++ b/api/order.js @@ -107,7 +107,7 @@ export function orderDel(id) { } /** - * 订单详情 + * 已付款订单详情 * @param string uni */ export function getOrderDetail(uni) { @@ -115,11 +115,11 @@ export function getOrderDetail(uni) { } /** - * 订单详情 + * 未付款订单详情 * @param string uni */ -export function groupOrderDetail(uni) { - return request.get('order/group_order_detail/' + uni); +export function groupOrderDetail(uni,product_type) { + return request.get('order/group_order_detail/' + uni+'?product_type=' + product_type); } // 支付状态订单 diff --git a/pages/admin/orderList/index.vue b/pages/admin/orderList/index.vue index 4644809..d283ee4 100644 --- a/pages/admin/orderList/index.vue +++ b/pages/admin/orderList/index.vue @@ -266,8 +266,8 @@ type:number } this.$nextTick(()=>{ - this.where.is_verify = 1; - delete this.where.status; + this.where.status = 2; + delete this.where.is_verify; this.init(); }) postconfirm(this.merId,data).then(res=>{ @@ -276,7 +276,7 @@ }, handleSearch() { this.loaded = false; - this.where.page = 1; + this.where.page = 3; this.list = []; this.getIndex(); }, diff --git a/pages/order_details/stay.vue b/pages/order_details/stay.vue index 822f198..e9a6168 100644 --- a/pages/order_details/stay.vue +++ b/pages/order_details/stay.vue @@ -270,7 +270,8 @@ add: false, }, show:false, - credit_buy:'' + credit_buy:'', + product_type:0 }; }, watch: { @@ -285,6 +286,7 @@ mapGetters(['isLogin','uid','viewColor','keyColor'])), onLoad: function(options) { this.credit_buy=options.credit_buy + if(options.product_type)this.product_type=options.product_type if (options.order_id) { this.$set(this, 'order_id', options.order_id); } @@ -440,7 +442,7 @@ uni.showLoading({ title: "正在加载中" }); - groupOrderDetail(this.order_id).then(res => { + groupOrderDetail(this.order_id,this.product_type).then(res => { let _type = 0; uni.hideLoading(); that.$set(that, 'orderInfo', res.data); diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 7aca24f..e9cfb69 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -537,7 +537,7 @@ "name": "先货后款", "icon": "tan-a-lujing17324", value: 'creditBuy', - title: `结算周期:30天 日利率:0.05%`, + title: `结算周期:${this.settle_cycle}天 日利率:${this.interest_rate}%`, payStatus: '', }, ], @@ -653,7 +653,9 @@ order_key: '', is_take: '', domain: HTTP_REQUEST_URL, - product_type:'' + product_type:'', + interest_rate:'',//利率 + settle_cycle:'',// 周期 }; }, computed: { @@ -1024,6 +1026,7 @@ use_integral: that.use_integral }).then(res => { // 默认选中 + console.log(res); that.is_take = false res.data.order.forEach(el => { if (el.order.isTake == 1) that.is_take = true @@ -1074,6 +1077,9 @@ that.allow_address = res.data.allow_address that.deliveryName = res.data.order_model == 0 ? '快递配送' : '虚拟发货' that.order_key = res.data.key + that.interest_rate = res.data.order[0].interest_rate + that.settle_cycle = res.data.order[0].settle_cycle + console.log(that.settle_cycle); if(res.data.order[0].credit_buy == 1){ this.cartArr[4].payStatus = 1 }else{ @@ -1116,7 +1122,9 @@ phone: res.data.phone } console.log(that.addressId); - this.getConfirm(that.addressId); + this.$nextTick(()=>{ + this.getConfirm(that.addressId); + }) }) } else { getAddressList().then(res => { diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue index 032e922..c7ee358 100644 --- a/pages/users/order_list/index.vue +++ b/pages/users/order_list/index.vue @@ -21,7 +21,7 @@ 全部 {{orderData.all || 0}} - + 待付款 {{orderData.noPay || 0}} @@ -61,7 +61,7 @@ - + {{item.group_order_sn}} @@ -141,6 +141,12 @@ 共{{item.total_num || 0}}件商品,总金额 ¥{{item.pay_price}} + 共{{item.orderNum || 0}}件商品,总金额 + ¥{{item.pay_price}} + + + 共{{item.total_num || 0}}件商品,结算周期到期后付款¥{{item.pay_price}} + 立即付款 @@ -238,13 +244,6 @@ 共{{item.orderNum || 0}}件商品,总金额 ¥{{item.presell_price}} - 共{{item.orderNum || 0}}件商品,总金额 - ¥{{item.pay_price}} - - - - 共1件商品,结算周期到期后付款¥100 - { that.$set(that, 'orderData', res.data); }) @@ -544,10 +543,13 @@ * */ goPay: function(pay_price, order_id) { - this.$set(this, 'pay_close', true); - this.order_id = order_id; - this.pay_order_id = order_id.toString() - this.$set(this, 'totalPrice', pay_price); + uni.navigateTo({ + url: '/pages/users/payment/payment?order_id=' + order_id + '&product_type=' + this.product_type + }); + // this.$set(this, 'pay_close', true); + // this.order_id = order_id; + // this.pay_order_id = order_id.toString() + // this.$set(this, 'totalPrice', pay_price); }, /** * 支付成功回调 @@ -573,7 +575,7 @@ /** * 去订单详情 */ - goOrderDetails: function(order_id) { + goOrderDetails: function(order_id,product_type) { let self = this if (!order_id) return that.$util.Tips({ title: '缺少订单号无法查看订单详情' @@ -586,7 +588,7 @@ uni.hideLoading(); if (self.orderStatus == 0) { uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id + url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type }) } else { uni.navigateTo({ @@ -600,7 +602,7 @@ // #ifndef MP if (self.orderStatus == 0) { uni.navigateTo({ - url: '/pages/order_details/stay?order_id=' + order_id + url: '/pages/order_details/stay?order_id=' + order_id + '&product_type=' + product_type }) } else { uni.navigateTo({ @@ -663,7 +665,7 @@ that.loadTitle = "加载更多"; if (that.isReady) { that.isReady = false - if (that.orderStatus == 20) { + if (that.orderStatus == 0) { groupOrderList({ page: that.page, limit: that.limit, @@ -766,27 +768,6 @@ this.show = true this.shouhuo.id = item.order_id this.shouhuo.index = index - // uni.showModal({ - // title: '确认收货', - // content: '为保障权益,请收到货确认无误后,再确认收货', - // success: function(res) { - // if (res.confirm) { - // orderTake(item.order_id).then(res => { - // return that.$util.Tips({ - // title: '操作成功', - // icon: 'success' - // }, function() { - // that.orderList.splice(index, 1); - // that.getOrderData(); - // }); - // }).catch(err => { - // return that.$util.Tips({ - // title: err - // }); - // }) - // } - // } - // }) }, queding() { let that = this; diff --git a/pages/users/payment/payment.vue b/pages/users/payment/payment.vue index 397a226..b2681ad 100644 --- a/pages/users/payment/payment.vue +++ b/pages/users/payment/payment.vue @@ -1,384 +1,418 @@ \ No newline at end of file