diff --git a/pages/order/apply-details.vue b/pages/order/apply-details.vue index 132fdaf..d0cd717 100644 --- a/pages/order/apply-details.vue +++ b/pages/order/apply-details.vue @@ -108,7 +108,7 @@ hostImg: '', // 已上传服务器的图片名称 serverImg:'', - orderId:1, + order_id:1, orderDetails: {}, checkArea: '', images: [] @@ -118,14 +118,14 @@ }, onLoad(e) { - this.orderId = e.orderid - if(this.orderId) { + this.order_id = e.order_id + if(this.order_id) { this.getOrderDetails() } }, methods: { getOrderDetails() { - this.$http(this.API.API_APPLYPAGE_DETAILS, {order_id: this.orderId}).then(res => { + this.$http(this.API.API_APPLYPAGE_DETAILS, {order_id: this.order_id}).then(res => { if(res.code == 0) { this.orderDetails = res.data.refund this.checkArea = res.data.agreement.title diff --git a/pages/order/apply-refund.vue b/pages/order/apply-refund.vue index d78d648..c1dffd1 100644 --- a/pages/order/apply-refund.vue +++ b/pages/order/apply-refund.vue @@ -133,7 +133,7 @@ hostImg: '', // 已上传服务器的图片名称 serverImg:'', - orderId: 1, + order_id: 1, applyDetails: {}, applyInfo: '', imageOnline: '', @@ -145,8 +145,8 @@ }, onLoad(e) { - this.orderId = e.orderId - if(this.orderId) { + this.order_id = e.order_id + if(this.order_id) { this.getApplyDetails() } setTimeout(()=>{ @@ -155,7 +155,7 @@ }, methods: { getApplyDetails() { - this.$http(this.API.API_APPLY_DETAILS, {order_id: this.orderId}).then(res => { + this.$http(this.API.API_APPLY_DETAILS, {order_id: this.order_id}).then(res => { if(res.code == 0) { this.applyDetails = res.data this.skeletonLoading = false @@ -261,6 +261,10 @@ uploads.push(upload_img); } } + if(uploads.length == 0) { + that.realSubmitInfo([]); + return + } Promise.all(uploads).then((result) => { console.log('图片上传...', result) let img_url_list = []; @@ -286,18 +290,24 @@ // 提交反馈 realSubmitInfo(img_url_list){ let that = this; + let params = {order_id: that.order_id,comment: that.applyInfo,images:img_url_list} + if(img_url_list.length == 0) { + delete params.images; + } uni.showToast({ title: '请求中', icon: "loading", duration: 10000 }) - that.$http(that.API.API_SUBMIT_APPLY, {order_id: that.orderId,comment: that.applyInfo,images:img_url_list}).then(res => { + that.$http(that.API.API_SUBMIT_APPLY, params).then(res => { if(res.code == 0) { that.$msg('提交成功') that.img_list = [] that.applyInfo = '' + console.log(that.order_id) setTimeout(() => { - that.$routerGo('/pages/order/apply-details?orderId='+that.orderId) + console.log(that.order_id) + that.$url('/pages/order/apply-details?order_id='+that.order_id,{type:'launch'}) },1000) } diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index 9f96ece..dab4fbe 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -174,7 +174,7 @@ goods_specs_id: this.goods_specs_id, number: this.num, }).then(res => { - console.log(res) + this.order_id = res.data.order_id uni.requestPayment({ orderInfo: res.data.order_num, timeStamp: res.data.timeStamp, @@ -183,10 +183,10 @@ signType: res.data.signType, paySign: res.data.paySign, success: (res) => { - this.$url('/pages/order/pay-success?ifSuccess='+1,{type: 'redirect'}) + this.$url('/pages/order/pay-success?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) }, fail: (err) => { - this.$url('/pages/order/pay-success?ifSuccess='+2,{type: 'redirect'}) + this.$url('/pages/order/pay-success?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) }, }) @@ -201,7 +201,7 @@ pay(){ console.log("this.order_id", this.order_id) this.$http(this.API.API_PAYMENT_DIRECT, {order_id: this.order_id}).then(res => { - console.log("res") + this.order_id = res.data.order_id uni.requestPayment({ orderInfo: res.data.order_num, timeStamp: res.data.timeStamp, @@ -210,10 +210,10 @@ signType: res.data.signType, paySign: res.data.paySign, success: (res) => { - this.$url('/pages/order/pay-success?ifSuccess='+1,{type: 'redirect'}) + this.$url('/pages/order/pay-success?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'}) }, fail: (err) => { - this.$url('/pages/order/pay-success?ifSuccess='+2,{type: 'redirect'}) + this.$url('/pages/order/pay-success?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'}) }, }) }) diff --git a/pages/order/index.vue b/pages/order/index.vue index 07174bc..5438e62 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -24,7 +24,7 @@ {{item.selling_price}} - + @@ -131,16 +131,16 @@ this.getUserOrder(); }, goDetails(tabIndex,index) { - // this.$routerGo('/pages/order/order-details?orderid=55') + // this.$routerGo('/pages/order/order-details?order_id=55') console.log(tabIndex,index) let item = this.tab_list[tabIndex].list[index] if (item.state == 1) { - this.$routerGo('/pages/order/unpay-details?orderid=' + item.id) + this.$routerGo('/pages/order/unpay-details?order_id=' + item.id) } else if(item.state == 4){ - this.$routerGo('/pages/order/apply-details?orderid=' + item.id) + this.$routerGo('/pages/order/apply-details?order_id=' + item.id) }else { - this.$routerGo('/pages/order/order-details?orderid=' + item.id) + this.$routerGo('/pages/order/order-details?order_id=' + item.id) } }, diff --git a/pages/order/order-details.vue b/pages/order/order-details.vue index 62fcd40..f8dad9a 100644 --- a/pages/order/order-details.vue +++ b/pages/order/order-details.vue @@ -18,7 +18,7 @@ {{Number(orderDetails.selling_price || 0)}} - + @@ -110,7 +110,7 @@ base64Img: '', // skeletonLoading: true, loading: false, - orderId:1, + order_id:1, orderDetails: {}, checkArea: '0' } @@ -126,8 +126,8 @@ } }, onLoad(e) { - this.orderId = e.orderid - if(this.orderId) { + this.order_id = e.order_id + if(this.order_id) { this.getOrderDetails() } }, @@ -140,7 +140,7 @@ this.base64Img = data; }, getOrderDetails() { - this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => { + this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => { if(res.code == 0) { this.orderDetails = res.data this.checkArea = res.data.confirm_code diff --git a/pages/order/pay-success.vue b/pages/order/pay-success.vue index b1513a3..a78eb7f 100644 --- a/pages/order/pay-success.vue +++ b/pages/order/pay-success.vue @@ -20,7 +20,7 @@ - @@ -37,7 +37,8 @@ export default { data() { return { - ifpaySuccess:1 + ifpaySuccess:1, + order_id: 1 } }, methods: { @@ -49,6 +50,7 @@ }, onLoad(e) { this.ifpaySuccess = e.ifSuccess + this.order_id = e.order_id } } diff --git a/pages/order/unpay-details.vue b/pages/order/unpay-details.vue index 0941c0e..d5d225a 100644 --- a/pages/order/unpay-details.vue +++ b/pages/order/unpay-details.vue @@ -73,7 +73,7 @@ base64Img: '', // skeletonLoading: true, loading: false, - orderId:1, + order_id:1, orderDetails: {}, } }, @@ -88,14 +88,14 @@ } }, onLoad(e) { - this.orderId = e.orderid - if(this.orderId) { + this.order_id = e.order_id + if(this.order_id) { this.getOrderDetails() } }, methods: { getOrderDetails() { - this.$http(this.API.API_ORDER_DETAILS, {order_id: this.orderId}).then(res => { + this.$http(this.API.API_ORDER_DETAILS, {order_id: this.order_id}).then(res => { if(res.code == 0) { this.orderDetails = res.data this.skeletonLoading = false diff --git a/pages/shopOrder/index.vue b/pages/shopOrder/index.vue index 6f86c54..2ef4c41 100644 --- a/pages/shopOrder/index.vue +++ b/pages/shopOrder/index.vue @@ -24,7 +24,7 @@ {{item.selling_price}} - + @@ -123,16 +123,16 @@ this.getUserOrder(); }, goDetails(tabIndex,index) { - // this.$routerGo('/pages/order/order-details?orderid=55') + // this.$routerGo('/pages/order/order-details?order_id=55') console.log(tabIndex,index) let item = this.tab_list[tabIndex].list[index] if (item.state == 1) { - this.$routerGo('/pages/order/unpay-details?orderid=' + item.id) + this.$routerGo('/pages/order/unpay-details?order_id=' + item.id) } else if(item.state == 4){ - this.$routerGo('/pages/order/apply-details?orderid=' + item.id) + this.$routerGo('/pages/order/apply-details?order_id=' + item.id) }else { - this.$routerGo('/pages/order/order-details?orderid=' + item.id) + this.$routerGo('/pages/order/order-details?order_id=' + item.id) } },