|
@@ -13,7 +13,7 @@
|
|
|
<view class="order-item" v-for="(orderItem) in lists[typeKey]" :key="orderItem.order_num" @click="toDetail(orderItem)">
|
|
|
<view class="order-num">
|
|
|
<text>订单编号:{{ orderItem.order_num }}</text>
|
|
|
- <text :class="orderItem | orderStatus | orderStatusClass">{{ orderItem | orderStatus }}</text>
|
|
|
+ <text class="fsdfsd" :class="orderItem | orderStatus | orderStatusClass">{{ orderItem | orderStatus }}</text>
|
|
|
</view>
|
|
|
<view class="good-item">
|
|
|
<view class="imgs">
|
|
@@ -50,7 +50,7 @@
|
|
|
import pulldownRefresher from '@/components/public/pulldown-refresher.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_OrderMy1, _API_OrderMy2, _API_OrderMy3, _API_OrderMy4, _API_OrderMy5, _API_OrderAgain, _API_OrderDel, _API_OrderDetail1 } 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'
|
|
|
export default {
|
|
|
mixins: [MIXIN],
|
|
|
components: { swiperStatus, customReachBottom, pulldownRefresher },
|
|
@@ -160,16 +160,24 @@
|
|
|
uni.loading()
|
|
|
list1.forEach(e => e.cart = Array(e.size.length).fill(0))
|
|
|
_API_OrderDetail1({ order_num }).then(({ data: { list: list2 } }) => {
|
|
|
- // uni.loading()
|
|
|
+ uni.loading()
|
|
|
+ this.$store.commit('cart/CLEAR')
|
|
|
list1.forEach((item, index) => {
|
|
|
- if (item.id == list2[index].id) {
|
|
|
- list2[index].size.forEach((size, sizeIndex) => {
|
|
|
+ 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] = list2[index].num[sizeIndex]
|
|
|
+ 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' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ _API_OrderCancel({ order_num }).then(({ code, message }) => {
|
|
|
+ if (code != 200) {
|
|
|
+ uni.toast(message)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -185,8 +193,25 @@
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
uni.loading()
|
|
|
- _API_OrderAgain({ order_num }).then(({ data: { order_num } }) => {
|
|
|
- uni.navigateTo({ url: `../comfirm-order-success/comfirm-order-success?order_num=${order_num}&money=${money}` })
|
|
|
+ _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 } }) => {
|
|
|
+ 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' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
}
|