邓平艺 4 years ago
parent
commit
2d3a06188d
  1. 8
      pages/order/apply-details.vue
  2. 22
      pages/order/apply-refund.vue
  3. 12
      pages/order/confirm-order.vue
  4. 10
      pages/order/index.vue
  5. 10
      pages/order/order-details.vue
  6. 6
      pages/order/pay-success.vue
  7. 8
      pages/order/unpay-details.vue
  8. 10
      pages/shopOrder/index.vue

8
pages/order/apply-details.vue

@ -108,7 +108,7 @@
hostImg: '', hostImg: '',
// //
serverImg:'', serverImg:'',
orderId:1,
order_id:1,
orderDetails: {}, orderDetails: {},
checkArea: '', checkArea: '',
images: [] images: []
@ -118,14 +118,14 @@
}, },
onLoad(e) { onLoad(e) {
this.orderId = e.orderid
if(this.orderId) {
this.order_id = e.order_id
if(this.order_id) {
this.getOrderDetails() this.getOrderDetails()
} }
}, },
methods: { methods: {
getOrderDetails() { 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) { if(res.code == 0) {
this.orderDetails = res.data.refund this.orderDetails = res.data.refund
this.checkArea = res.data.agreement.title this.checkArea = res.data.agreement.title

22
pages/order/apply-refund.vue

@ -133,7 +133,7 @@
hostImg: '', hostImg: '',
// //
serverImg:'', serverImg:'',
orderId: 1,
order_id: 1,
applyDetails: {}, applyDetails: {},
applyInfo: '', applyInfo: '',
imageOnline: '', imageOnline: '',
@ -145,8 +145,8 @@
}, },
onLoad(e) { onLoad(e) {
this.orderId = e.orderId
if(this.orderId) {
this.order_id = e.order_id
if(this.order_id) {
this.getApplyDetails() this.getApplyDetails()
} }
setTimeout(()=>{ setTimeout(()=>{
@ -155,7 +155,7 @@
}, },
methods: { methods: {
getApplyDetails() { 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) { if(res.code == 0) {
this.applyDetails = res.data this.applyDetails = res.data
this.skeletonLoading = false this.skeletonLoading = false
@ -261,6 +261,10 @@
uploads.push(upload_img); uploads.push(upload_img);
} }
} }
if(uploads.length == 0) {
that.realSubmitInfo([]);
return
}
Promise.all(uploads).then((result) => { Promise.all(uploads).then((result) => {
console.log('图片上传...', result) console.log('图片上传...', result)
let img_url_list = []; let img_url_list = [];
@ -286,18 +290,24 @@
// //
realSubmitInfo(img_url_list){ realSubmitInfo(img_url_list){
let that = this; 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({ uni.showToast({
title: '请求中', title: '请求中',
icon: "loading", icon: "loading",
duration: 10000 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) { if(res.code == 0) {
that.$msg('提交成功') that.$msg('提交成功')
that.img_list = [] that.img_list = []
that.applyInfo = '' that.applyInfo = ''
console.log(that.order_id)
setTimeout(() => { 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) },1000)
} }

12
pages/order/confirm-order.vue

@ -174,7 +174,7 @@
goods_specs_id: this.goods_specs_id, goods_specs_id: this.goods_specs_id,
number: this.num, number: this.num,
}).then(res => { }).then(res => {
console.log(res)
this.order_id = res.data.order_id
uni.requestPayment({ uni.requestPayment({
orderInfo: res.data.order_num, orderInfo: res.data.order_num,
timeStamp: res.data.timeStamp, timeStamp: res.data.timeStamp,
@ -183,10 +183,10 @@
signType: res.data.signType, signType: res.data.signType,
paySign: res.data.paySign, paySign: res.data.paySign,
success: (res) => { 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) => { 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(){ pay(){
console.log("this.order_id", this.order_id) console.log("this.order_id", this.order_id)
this.$http(this.API.API_PAYMENT_DIRECT, {order_id: this.order_id}).then(res => { 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({ uni.requestPayment({
orderInfo: res.data.order_num, orderInfo: res.data.order_num,
timeStamp: res.data.timeStamp, timeStamp: res.data.timeStamp,
@ -210,10 +210,10 @@
signType: res.data.signType, signType: res.data.signType,
paySign: res.data.paySign, paySign: res.data.paySign,
success: (res) => { 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) => { 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'})
}, },
}) })
}) })

10
pages/order/index.vue

@ -24,7 +24,7 @@
<text class="lf-font-42">{{item.selling_price}}</text> <text class="lf-font-42">{{item.selling_price}}</text>
</text> </text>
<button v-if="item.state==1" @tap.stop="$routerGo('/pages/order/confirm-order?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id)">立即付款</button> <button v-if="item.state==1" @tap.stop="$routerGo('/pages/order/confirm-order?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id)">立即付款</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm" @tap="$routerGo('/pages/order/order-details?orderid='+item.id)">立即使用</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm" @tap="$routerGo('/pages/order/order-details?order_id='+item.id)">立即使用</button>
</view> </view>
</view> </view>
</view> </view>
@ -131,16 +131,16 @@
this.getUserOrder(); this.getUserOrder();
}, },
goDetails(tabIndex,index) { goDetails(tabIndex,index) {
// this.$routerGo('/pages/order/order-details?orderid=55')
// this.$routerGo('/pages/order/order-details?order_id=55')
console.log(tabIndex,index) console.log(tabIndex,index)
let item = this.tab_list[tabIndex].list[index] let item = this.tab_list[tabIndex].list[index]
if (item.state == 1) { 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){ } 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 { }else {
this.$routerGo('/pages/order/order-details?orderid=' + item.id)
this.$routerGo('/pages/order/order-details?order_id=' + item.id)
} }
}, },

10
pages/order/order-details.vue

@ -18,7 +18,7 @@
{{Number(orderDetails.selling_price || 0)}} {{Number(orderDetails.selling_price || 0)}}
</view> </view>
<view> <view>
<button v-if="orderDetails.state == 2" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap="$routerGo('/pages/order/apply-refund?orderId='+orderDetails.id)">申请退款</button>
<button v-if="orderDetails.state == 2" class="cu-btn line-orange text-orange round margin-left-sm lf-font-28" @tap="$routerGo('/pages/order/apply-refund?order_id='+orderDetails.id)">申请退款</button>
<button v-else class="cu-btn line-gray bg-white border round margin-left-sm lf-font-28">{{orderDetails.state_text.text}}</button> <button v-else class="cu-btn line-gray bg-white border round margin-left-sm lf-font-28">{{orderDetails.state_text.text}}</button>
</view> </view>
</view> </view>
@ -110,7 +110,7 @@
base64Img: '', // base64Img: '', //
skeletonLoading: true, skeletonLoading: true,
loading: false, loading: false,
orderId:1,
order_id:1,
orderDetails: {}, orderDetails: {},
checkArea: '0' checkArea: '0'
} }
@ -126,8 +126,8 @@
} }
}, },
onLoad(e) { onLoad(e) {
this.orderId = e.orderid
if(this.orderId) {
this.order_id = e.order_id
if(this.order_id) {
this.getOrderDetails() this.getOrderDetails()
} }
}, },
@ -140,7 +140,7 @@
this.base64Img = data; this.base64Img = data;
}, },
getOrderDetails() { 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) { if(res.code == 0) {
this.orderDetails = res.data this.orderDetails = res.data
this.checkArea = res.data.confirm_code this.checkArea = res.data.confirm_code

6
pages/order/pay-success.vue

@ -20,7 +20,7 @@
</view> </view>
<view class="margin-top flex flex-direction justify-around"> <view class="margin-top flex flex-direction justify-around">
<view class="padding-top padding-lr-lg"> <view class="padding-top padding-lr-lg">
<button class="cu-btn block bg-orange lg margin-top round" @tap="$routerGo('/pages/order/order-details')">
<button class="cu-btn block bg-orange lg margin-top round" @tap="$url('/pages/order/order-details?order_id='+order_id,{type: 'launch'})">
<text class="text-df text-white">查看订单</text> <text class="text-df text-white">查看订单</text>
</button> </button>
</view> </view>
@ -37,7 +37,8 @@
export default { export default {
data() { data() {
return { return {
ifpaySuccess:1
ifpaySuccess:1,
order_id: 1
} }
}, },
methods: { methods: {
@ -49,6 +50,7 @@
}, },
onLoad(e) { onLoad(e) {
this.ifpaySuccess = e.ifSuccess this.ifpaySuccess = e.ifSuccess
this.order_id = e.order_id
} }
} }
</script> </script>

8
pages/order/unpay-details.vue

@ -73,7 +73,7 @@
base64Img: '', // base64Img: '', //
skeletonLoading: true, skeletonLoading: true,
loading: false, loading: false,
orderId:1,
order_id:1,
orderDetails: {}, orderDetails: {},
} }
}, },
@ -88,14 +88,14 @@
} }
}, },
onLoad(e) { onLoad(e) {
this.orderId = e.orderid
if(this.orderId) {
this.order_id = e.order_id
if(this.order_id) {
this.getOrderDetails() this.getOrderDetails()
} }
}, },
methods: { methods: {
getOrderDetails() { 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) { if(res.code == 0) {
this.orderDetails = res.data this.orderDetails = res.data
this.skeletonLoading = false this.skeletonLoading = false

10
pages/shopOrder/index.vue

@ -24,7 +24,7 @@
<text class="lf-font-42">{{item.selling_price}}</text> <text class="lf-font-42">{{item.selling_price}}</text>
</text> </text>
<button v-if="item.state==1" @tap.stop="$routerGo('/pages/order/confirm-order?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id)">立即付款</button> <button v-if="item.state==1" @tap.stop="$routerGo('/pages/order/confirm-order?type=1&goods_id='+item.goods_id+'&goods_specs_id='+item.goods_specs_id +'&order_id='+ item.id)">立即付款</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm" @tap="$routerGo('/pages/order/order-details?orderid='+item.id)">立即使用</button>
<button v-if="item.state==2" class="cu-btn bg-green round margin-left-sm" @tap="$routerGo('/pages/order/order-details?order_id='+item.id)">立即使用</button>
</view> </view>
</view> </view>
</view> </view>
@ -123,16 +123,16 @@
this.getUserOrder(); this.getUserOrder();
}, },
goDetails(tabIndex,index) { goDetails(tabIndex,index) {
// this.$routerGo('/pages/order/order-details?orderid=55')
// this.$routerGo('/pages/order/order-details?order_id=55')
console.log(tabIndex,index) console.log(tabIndex,index)
let item = this.tab_list[tabIndex].list[index] let item = this.tab_list[tabIndex].list[index]
if (item.state == 1) { 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){ } 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 { }else {
this.$routerGo('/pages/order/order-details?orderid=' + item.id)
this.$routerGo('/pages/order/order-details?order_id=' + item.id)
} }
}, },

Loading…
Cancel
Save