|
|
|
@ -58,10 +58,12 @@
|
|
|
|
|
<block v-if="item.state == 2">
|
|
|
|
|
<!-- <view class="pay" @tap="onConfirmOrder(item)" :style="'color:#fff;background:' + colors+ ';border-color:' + colors">确认收货</view> -->
|
|
|
|
|
<!-- <view class="pay shouhou" @tap="onRefund(item)">申请退款</view> -->
|
|
|
|
|
<view class="pay shouhou" @tap="handleRepeatOrder(item)">再次下单</view>
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">订单评价</view>
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">申请售后</view>
|
|
|
|
|
</block>
|
|
|
|
|
<block v-if="item.state == 3">
|
|
|
|
|
<view class="pay shouhou" @tap="handleRepeatOrder(item)">再次下单</view>
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">订单评价</view>
|
|
|
|
|
<view class="pay shouhou" @tap="jumpDetails(item)">申请售后</view>
|
|
|
|
|
</block>
|
|
|
|
@ -86,7 +88,8 @@
|
|
|
|
|
import loading from "../../commponent/public/loading";
|
|
|
|
|
import navBar from '../../commponent/public/navBar.vue'
|
|
|
|
|
import { ORDER_NAVS } from '@/config/order.js'
|
|
|
|
|
import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
|
import { getUserInfo, setSalesGoods, getCart,
|
|
|
|
|
resetCart, } from '@/utils/auth';
|
|
|
|
|
const app = getApp();
|
|
|
|
|
let timer = null
|
|
|
|
|
export default {
|
|
|
|
@ -181,6 +184,60 @@ import { getUserInfo, setSalesGoods } from '@/utils/auth';
|
|
|
|
|
*/
|
|
|
|
|
onShareAppMessage: function() {},
|
|
|
|
|
methods: {
|
|
|
|
|
handleRepeatOrder(item) {
|
|
|
|
|
const cartList = getCart().map(v => {
|
|
|
|
|
v.current = false
|
|
|
|
|
return v
|
|
|
|
|
})
|
|
|
|
|
const goodsList = item.orderDetailList.map(v => {
|
|
|
|
|
v.imgList = v.url.split(',')
|
|
|
|
|
v.number = 1
|
|
|
|
|
v.id = v.goodsId
|
|
|
|
|
v.current = true
|
|
|
|
|
v._selectedSku = [{
|
|
|
|
|
id: v.goodsId,
|
|
|
|
|
imgs: '',
|
|
|
|
|
money: v.price,
|
|
|
|
|
number: 1,
|
|
|
|
|
tagname: v.goodsName
|
|
|
|
|
}]
|
|
|
|
|
v._skus = [
|
|
|
|
|
{
|
|
|
|
|
sku_id: v.goodsId,
|
|
|
|
|
skuname: '规格',
|
|
|
|
|
child: [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
imgs: '',
|
|
|
|
|
money: v.price,
|
|
|
|
|
number: 1,
|
|
|
|
|
tagname: v.goodsName
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
return v
|
|
|
|
|
})
|
|
|
|
|
const cartIds = cartList.map(v => v.id)
|
|
|
|
|
const goodsIds = goodsList.map(v => v.id)
|
|
|
|
|
|
|
|
|
|
const goodsNotHasCart = goodsList.filter(v => !cartIds.includes(v.id))
|
|
|
|
|
const cartHasGoodsList = cartList.filter(v => goodsIds.includes(v.id)).map(v => {
|
|
|
|
|
v.number += 1
|
|
|
|
|
v.current = true
|
|
|
|
|
return v
|
|
|
|
|
})
|
|
|
|
|
const cartNotHasGoodsList = cartList.filter(v => !goodsIds.includes(v.id))
|
|
|
|
|
const lastList = [...goodsNotHasCart, ...cartHasGoodsList, ...cartNotHasGoodsList]
|
|
|
|
|
resetCart(lastList)
|
|
|
|
|
this.$toast('添加成功')
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/views/tabBar/cart'
|
|
|
|
|
})
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleLoadMore() {
|
|
|
|
|
if (this.isNoMore) return
|
|
|
|
|
this.pageNo++
|
|
|
|
|