|
@@ -22,14 +22,18 @@
|
|
<view class="info">
|
|
<view class="info">
|
|
<text class="name">种类:{{ orderItem.type }}{{ ', ' }}</text>
|
|
<text class="name">种类:{{ orderItem.type }}{{ ', ' }}</text>
|
|
<text class="num">数量:{{ orderItem.total }}{{ ', ' }}</text>
|
|
<text class="num">数量:{{ orderItem.total }}{{ ', ' }}</text>
|
|
- <text class="price">共计金额:<text class="basecolor">¥{{ orderItem.money }}.00</text></text>
|
|
|
|
|
|
+ <text class="price">共计金额:<text class="basecolor">¥{{ orderItem.money }}</text></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bottom-bar">
|
|
<view class="bottom-bar">
|
|
- <view class="btn" v-if="!orderItem.is_deleted && !orderItem.pay_status" @click.stop="changeOrder(orderItem)">修改订单</view>
|
|
|
|
- <view class="btn" @click.stop="buyAgain(orderItem)">再次购买</view>
|
|
|
|
- <view class="btn bg" v-if="!orderItem.is_deleted && !orderItem.pay_status" @click.stop="payNow(orderItem)">立即付款</view>
|
|
|
|
- <view class="btn border" v-if="!orderItem.is_deleted && orderItem.status == 3" @click.stop="received(orderItem)">确认收货</view>
|
|
|
|
|
|
+ <text></text>
|
|
|
|
+ <!-- <view class="btn" v-if="!orderItem.is_deleted && !orderItem.pay_status" @click.stop="changeOrder(orderItem)">修改订单</view> -->
|
|
|
|
+ <view class="btns">
|
|
|
|
+ <view class="btn" @click.stop="buyAgain(orderItem)">再次购买</view>
|
|
|
|
+ <view v-if="orderItem.express" class="btn" @click.stop="express(orderItem.express)">查看物流</view>
|
|
|
|
+ <view class="btn bg" v-if="!orderItem.is_deleted && !orderItem.pay_status" @click.stop="payNow(orderItem)">立即付款</view>
|
|
|
|
+ <view class="btn border" v-if="!orderItem.is_deleted && orderItem.pay_status && orderItem.status == 3" @click.stop="received(orderItem)">确认收货</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<custom-reach-bottom v-if="lists[typeKey].length" :nomore="page[typeKey] === 0" />
|
|
<custom-reach-bottom v-if="lists[typeKey].length" :nomore="page[typeKey] === 0" />
|
|
@@ -50,7 +54,7 @@
|
|
import pulldownRefresher from '@/components/public/pulldown-refresher.vue'
|
|
import pulldownRefresher from '@/components/public/pulldown-refresher.vue'
|
|
import customReachBottom from '@/components/public/custom-reach-bottom.vue'
|
|
import customReachBottom from '@/components/public/custom-reach-bottom.vue'
|
|
// import { _API_OrderMyExamine, _API_OrderMySended, _API_OrderMyCompleted, _API_OrderReceiveGoods } from '@/apis/order.js'
|
|
// import { _API_OrderMyExamine, _API_OrderMySended, _API_OrderMyCompleted, _API_OrderReceiveGoods } from '@/apis/order.js'
|
|
- import { _API_OrderMy1, _API_OrderMy2, _API_OrderMy3, _API_OrderMy4, _API_OrderMy5, _API_OrderAgain, _API_OrderDel, _API_OrderDetail1, _API_OrderCancel } from '@/apis/order.js'
|
|
|
|
|
|
+ import { _API_OrderMy1, _API_OrderMy2, _API_OrderMy3, _API_OrderMy4, _API_OrderMy5, _API_OrderAgain, _API_OrderDel, _API_OrderDetail1, _API_OrderCancel, _API_OrderReceiveGoods1 } from '@/apis/order.js'
|
|
export default {
|
|
export default {
|
|
mixins: [MIXIN],
|
|
mixins: [MIXIN],
|
|
components: { swiperStatus, customReachBottom, pulldownRefresher },
|
|
components: { swiperStatus, customReachBottom, pulldownRefresher },
|
|
@@ -66,7 +70,7 @@
|
|
filters: {
|
|
filters: {
|
|
orderStatus(orderItem) { // 计算订单总金额过滤器
|
|
orderStatus(orderItem) { // 计算订单总金额过滤器
|
|
if (orderItem.is_deleted) {
|
|
if (orderItem.is_deleted) {
|
|
- return '已删除'
|
|
|
|
|
|
+ return '已作废'
|
|
} else if (!orderItem.pay_status) {
|
|
} else if (!orderItem.pay_status) {
|
|
return '待支付订单'
|
|
return '待支付订单'
|
|
} else if (orderItem.status == 3) {
|
|
} else if (orderItem.status == 3) {
|
|
@@ -78,7 +82,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
orderStatusClass(status) {
|
|
orderStatusClass(status) {
|
|
- if (status == '已删除' || status == '已完成') {
|
|
|
|
|
|
+ if (status == '已完成') {
|
|
return ''
|
|
return ''
|
|
} else {
|
|
} else {
|
|
return 'basecolor'
|
|
return 'basecolor'
|
|
@@ -138,16 +142,13 @@
|
|
console.log(res)
|
|
console.log(res)
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
},
|
|
},
|
|
- toDetail(gooItem) { // 点击查看订单
|
|
|
|
- const { order_num, is_deleted, pay_status } = gooItem
|
|
|
|
|
|
+ toDetail(goodItem) { // 点击查看订单
|
|
|
|
+ const { order_num, order_id, is_deleted, pay_status, money, created_at } = goodItem
|
|
let str = ''
|
|
let str = ''
|
|
if (!is_deleted && !pay_status) {
|
|
if (!is_deleted && !pay_status) {
|
|
str = '&nopay=1'
|
|
str = '&nopay=1'
|
|
}
|
|
}
|
|
- uni.navigateTo({ url: `../order-detail1/order-detail1?status=${this.$options.filters.orderStatus(gooItem)}&order_num=${order_num}${str}` })
|
|
|
|
- },
|
|
|
|
- toForward(order_num) { // 点击查看转单
|
|
|
|
- uni.navigateTo({ url: `../order-detail/order-detail?order_num=${order_num}&forward=1` })
|
|
|
|
|
|
+ uni.navigateTo({ url: `../order-detail1/order-detail1?created_at=${created_at}&status=${this.$options.filters.orderStatus(goodItem)}&order_id=${order_id}&order_num=${order_num}${str}&money=${money}` })
|
|
},
|
|
},
|
|
changeOrder({ order_num }) { // 取消订单
|
|
changeOrder({ order_num }) { // 取消订单
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -156,37 +157,39 @@
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
uni.loading()
|
|
uni.loading()
|
|
- _API_GoodList().then(({ data: { list: list1 } }) => {
|
|
|
|
- uni.loading()
|
|
|
|
- list1.forEach(e => e.cart = Array(e.size.length).fill(0))
|
|
|
|
- _API_OrderDetail1({ order_num }).then(({ data: { list: list2 } }) => {
|
|
|
|
|
|
+ _API_OrderCancel({ order_num }).then(({ code, message }) => {
|
|
|
|
+ if (code != 200) {
|
|
|
|
+ uni.toast(message)
|
|
|
|
+ } else {
|
|
uni.loading()
|
|
uni.loading()
|
|
- this.$store.commit('cart/CLEAR')
|
|
|
|
- list1.forEach((item, index) => {
|
|
|
|
- const findRes = list2.find(e => e.attr_id == item.attr_id)
|
|
|
|
- if (findRes) {
|
|
|
|
- findRes.size.forEach((size, sizeIndex) => {
|
|
|
|
- const goodItemSizeIndex = list1[index].size.findIndex(e => e === size)
|
|
|
|
- list1[index].cart[goodItemSizeIndex] = findRes.num[sizeIndex]
|
|
|
|
|
|
+ _API_GoodList().then(({ data: { list: list1 } }) => {
|
|
|
|
+ uni.loading()
|
|
|
|
+ list1.forEach(e => e.cart = Array(e.size.length).fill(0))
|
|
|
|
+ _API_OrderDetail1({ order_num }).then(({ data: { list: list2 } }) => {
|
|
|
|
+ uni.loading()
|
|
|
|
+ this.$store.commit('cart/CLEAR')
|
|
|
|
+ list1.forEach((item, index) => {
|
|
|
|
+ const findRes = list2.find(e => e.attr_id == item.attr_id)
|
|
|
|
+ if (findRes) {
|
|
|
|
+ findRes.size.forEach((size, sizeIndex) => {
|
|
|
|
+ const goodItemSizeIndex = list1[index].size.findIndex(e => e === size)
|
|
|
|
+ list1[index].cart[goodItemSizeIndex] = findRes.num[sizeIndex]
|
|
|
|
+ })
|
|
|
|
+ item.choosed = true
|
|
|
|
+ item.sizeChoosed = Array(item.size.length).fill(true)
|
|
|
|
+ this.$store.commit('cart/ADD', item)
|
|
|
|
+ uni.switchTab({ url: '../shop-car1/shop-car1' })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- item.choosed = true
|
|
|
|
- item.sizeChoosed = Array(item.size.length).fill(true)
|
|
|
|
- this.$store.commit('cart/ADD', item)
|
|
|
|
- uni.switchTab({ url: '../shop-car1/shop-car1' })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- _API_OrderCancel({ order_num }).then(({ code, message }) => {
|
|
|
|
- if (code != 200) {
|
|
|
|
- uni.toast(message)
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- buyAgain({ order_num, money }) { // 点击再次购买
|
|
|
|
|
|
+ buyAgain({ order_num }) { // 点击再次购买
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '确定要再次购买?',
|
|
content: '确定要再次购买?',
|
|
@@ -217,11 +220,26 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- payNow({ order_num, money }) { // 点击立即付款
|
|
|
|
- uni.navigateTo({ url: `../pay-order/pay-order?order_num=${order_num}&money=${money}` })
|
|
|
|
|
|
+ express(express) {
|
|
|
|
+ uni.navigateTo({ url: `../express-detail/express-detail?express_order=${express.split('&')[1].split('=')[1]}` })
|
|
},
|
|
},
|
|
- received(orderItem) { // 点击确认收货
|
|
|
|
- console.log(orderItem)
|
|
|
|
|
|
+ payNow({ order_num, money, order_id }) { // 点击立即付款
|
|
|
|
+ // console.log(order_id)
|
|
|
|
+ uni.navigateTo({ url: `../pay-order/pay-order?order_num=${order_num}&money=${money}&order_id=${order_id}` })
|
|
|
|
+ },
|
|
|
|
+ received({ order_num }) { // 点击确认收货
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认收到货物?',
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ uni.loading()
|
|
|
|
+ _API_OrderReceiveGoods1({ order_num }).then(() => {
|
|
|
|
+ uni.startPullDownRefresh()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -279,25 +297,28 @@
|
|
@include flex();
|
|
@include flex();
|
|
height: 90rpx;
|
|
height: 90rpx;
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
- justify-content: flex-end;
|
|
|
|
|
|
+ justify-content: space-between;
|
|
background: #FFFFFF;
|
|
background: #FFFFFF;
|
|
- .btn {
|
|
|
|
|
|
+ .btns {
|
|
@include flex();
|
|
@include flex();
|
|
- width: 156rpx;
|
|
|
|
- height: 54rpx;
|
|
|
|
- font-size: 28rpx;
|
|
|
|
- margin-left: 24rpx;
|
|
|
|
- color: #181818;
|
|
|
|
- border-radius: 54rpx;
|
|
|
|
- border: 1px solid rgba(24,24,24,1);
|
|
|
|
- &.bg {
|
|
|
|
- color: #FFFFFF;
|
|
|
|
- border-color: $app-base-color;
|
|
|
|
- background: $app-base-color;
|
|
|
|
- }
|
|
|
|
- &.border {
|
|
|
|
- color: $app-base-color;
|
|
|
|
- border-color: $app-base-color;
|
|
|
|
|
|
+ .btn {
|
|
|
|
+ @include flex();
|
|
|
|
+ width: 156rpx;
|
|
|
|
+ height: 54rpx;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ margin-left: 24rpx;
|
|
|
|
+ color: #181818;
|
|
|
|
+ border-radius: 54rpx;
|
|
|
|
+ border: 1px solid rgba(24,24,24,1);
|
|
|
|
+ &.bg {
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ border-color: $app-base-color;
|
|
|
|
+ background: $app-base-color;
|
|
|
|
+ }
|
|
|
|
+ &.border {
|
|
|
|
+ color: $app-base-color;
|
|
|
|
+ border-color: $app-base-color;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|