Feat:集采中心采购订单
This commit is contained in:
+439
-88
@@ -12,7 +12,7 @@
|
||||
v-model="keyword"
|
||||
:inputStyle="inputStyle"
|
||||
:showAction="false"
|
||||
placeholder="请输入商品名/订单号/团购名称"
|
||||
:placeholder="searchPlaceholder"
|
||||
shape="round"
|
||||
bgColor="#FFF"
|
||||
@search="changeType"
|
||||
@@ -76,28 +76,28 @@
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="order.merName && !order.experienceOrderInfo"
|
||||
v-if="getOrderStoreName(order) && !order.experienceOrderInfo"
|
||||
class="shop-info flex jc-between ai-center"
|
||||
style="padding-bottom: 0"
|
||||
@click="goStore(orderListIndex)"
|
||||
@click="handleOrderStoreClick(orderListIndex)"
|
||||
>
|
||||
<view class="flex ai-center">
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/shop.png'"
|
||||
style="width: 32rpx;height: 32rpx"
|
||||
/>
|
||||
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName }}</text>
|
||||
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ getOrderStoreName(order) }}</text>
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/arrow.png'"
|
||||
style="width: 24rpx;height: 24rpx; margin-top: 5rpx"
|
||||
/>
|
||||
</view>
|
||||
<view class="flex ai-center">
|
||||
<view v-if="getOrderCityName(order)" class="flex ai-center">
|
||||
<image
|
||||
:src="webUrl+'/orderIcon/map.png'"
|
||||
style="width: 28rpx;height: 28rpx"
|
||||
/>
|
||||
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</text>
|
||||
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ getOrderCityName(order) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;">
|
||||
@@ -131,7 +131,7 @@
|
||||
<view
|
||||
v-else
|
||||
class="font-color-white statusTag v12-primary"
|
||||
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view>
|
||||
>{{ getOrderStatusTagText(order) }}</view>
|
||||
</view>
|
||||
<view @click="goOrderDetails(orderListIndex)">
|
||||
<view
|
||||
@@ -186,6 +186,37 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="isCollectiveCenterMode && !isBlindBoxGiftOrder(order)">
|
||||
<view
|
||||
v-for="(item, cartInfoIndex) in getCollectiveDisplayItems(order)"
|
||||
:key="`${order.orderId || orderListIndex}-${cartInfoIndex}`"
|
||||
class="item-info acea-row row-between row-top"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="item.image" />
|
||||
</view>
|
||||
<view class="text" style="margin-top: 0 !important;">
|
||||
<view class="acea-row name-wrap">
|
||||
<view class="name more-t v12-font-bold">{{ item.name }}</view>
|
||||
<view class="money">
|
||||
<view v-if="item.showPrice">
|
||||
<text class="v12-font-22">¥</text>
|
||||
<text class="v12-font-28">{{ force2Decimal(item.price) }}</text>
|
||||
</view>
|
||||
<view class="v12-font-22 v12-secondary-dark-text">x{{ item.qty }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="acea-row attr-wrap ">
|
||||
<view
|
||||
v-if="item.sku"
|
||||
class="attr v12-secondary-dark-text v12-font-24 "
|
||||
>
|
||||
{{ item.sku }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="order.isDrawOrder === 1">
|
||||
<view class="item-info acea-row row-between row-top draw-order-info">
|
||||
<view class="pictrue">
|
||||
@@ -300,8 +331,8 @@
|
||||
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
|
||||
</view>
|
||||
<view class="v12-font-24 v12-dark1-text">
|
||||
共{{ order.totalNum || 0 }}件商品
|
||||
<text v-if="order.isGiftCardReceiveBlind === 0">
|
||||
共{{ getOrderTotalNum(order) }}件商品
|
||||
<text v-if="order.isGiftCardReceiveBlind === 0 && shouldShowOrderTotalAmount(order)">
|
||||
<text class="v12-dark-text v12-font-28 v12-font-bold">
|
||||
,总金额
|
||||
</text>
|
||||
@@ -309,7 +340,7 @@
|
||||
¥
|
||||
</text>
|
||||
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">
|
||||
{{ force2Decimal(order.payPrice) }}
|
||||
{{ force2Decimal(getOrderPayPrice(order)) }}
|
||||
</text>
|
||||
</text>
|
||||
</view>
|
||||
@@ -351,63 +382,101 @@
|
||||
v-if="!order.isGiftCardSend && !order.experienceOrderInfo"
|
||||
class="bottom flex jc-between ai-center"
|
||||
>
|
||||
|
||||
<view
|
||||
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
|
||||
class="group-btn"
|
||||
>
|
||||
<text
|
||||
class="btn-more v12-font-28 v12-font-bold"
|
||||
@click.stop="tapShowMore(orderListIndex)"
|
||||
>更多</text>
|
||||
<view class="group-float" v-show="order.showMore">
|
||||
<view
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
|
||||
class="btn btn-service flex jc-center ai-center v12-font-24"
|
||||
@click="goRoom(orderListIndex)"
|
||||
>联系商家</view>
|
||||
<view
|
||||
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
|
||||
class="btn flex jc-center ai-center v12-font-24"
|
||||
@click="goRefund(orderListIndex)"
|
||||
>申请退款</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-else>
|
||||
<template v-if="isCollectiveCenterMode">
|
||||
<view class="v12-justify-between" style="width: 100%">
|
||||
<view
|
||||
v-if="order.isDrawOrder > 0"
|
||||
class="bnt service"
|
||||
@click.stop="callMerPhone(orderListIndex)"
|
||||
>联系客服
|
||||
</view>
|
||||
<view>
|
||||
<view
|
||||
v-if="order.isGiftCardReceiveBlind === 0 &&
|
||||
order.merName &&
|
||||
parseInt(order._status._type) !== 0 &&
|
||||
parseInt(order._status._type) !== 9
|
||||
"
|
||||
v-if="showCollectiveContact(order)"
|
||||
class="bnt service"
|
||||
@click="goRoom(orderListIndex)"
|
||||
>联系商家</view>
|
||||
</view>
|
||||
<view class="v12-justify-between">
|
||||
<view class="flex">
|
||||
<view
|
||||
v-if="showCollectiveModifyAddress(order)"
|
||||
class="bnt service"
|
||||
@click="addressTap(orderListIndex)"
|
||||
>修改地址</view>
|
||||
<view
|
||||
v-if="showCollectiveDetail(order)"
|
||||
class="bnt service"
|
||||
@click="goOrderDetails(orderListIndex)"
|
||||
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
|
||||
>查看详情</view>
|
||||
<view
|
||||
v-if="showCollectiveRefund(order)"
|
||||
class="bnt service"
|
||||
@click="goRefund(orderListIndex)"
|
||||
>申请退款</view>
|
||||
<view
|
||||
v-if="showCollectiveTakeOrder(order)"
|
||||
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
|
||||
@click="takeOrder(orderListIndex)"
|
||||
>确认收货</view>
|
||||
<view
|
||||
v-if="showCollectiveDelete(order)"
|
||||
class="bnt service"
|
||||
@click="delOrder(orderListIndex)"
|
||||
v-if="[9].includes(parseInt(order._status._type))"
|
||||
>删除订单</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<view class="flex">
|
||||
<template v-else>
|
||||
<view
|
||||
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
|
||||
class="group-btn"
|
||||
>
|
||||
<text
|
||||
class="btn-more v12-font-28 v12-font-bold"
|
||||
@click.stop="tapShowMore(orderListIndex)"
|
||||
>更多</text>
|
||||
<view class="group-float" v-show="order.showMore">
|
||||
<view
|
||||
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
|
||||
class="btn btn-service flex jc-center ai-center v12-font-24"
|
||||
@click="goRoom(orderListIndex)"
|
||||
>联系商家</view>
|
||||
<view
|
||||
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
|
||||
class="btn flex jc-center ai-center v12-font-24"
|
||||
@click="goRefund(orderListIndex)"
|
||||
>申请退款</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="v12-justify-between" style="width: 100%">
|
||||
<view
|
||||
v-if="order.isDrawOrder > 0"
|
||||
class="bnt service"
|
||||
@click.stop="callMerPhone(orderListIndex)"
|
||||
>联系客服
|
||||
</view>
|
||||
<view>
|
||||
<view
|
||||
v-if="order.isGiftCardReceiveBlind === 0 &&
|
||||
order.merName &&
|
||||
parseInt(order._status._type) !== 0 &&
|
||||
parseInt(order._status._type) !== 9
|
||||
"
|
||||
class="bnt service"
|
||||
@click="goRoom(orderListIndex)"
|
||||
>联系商家</view>
|
||||
</view>
|
||||
<view class="v12-justify-between">
|
||||
<view
|
||||
class="bnt service"
|
||||
@click="goOrderDetails(orderListIndex)"
|
||||
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
|
||||
>查看详情</view>
|
||||
<view
|
||||
class="bnt service"
|
||||
@click="delOrder(orderListIndex)"
|
||||
v-if="[9].includes(parseInt(order._status._type))"
|
||||
>删除订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<view v-if="!isCollectiveCenterMode" class="flex">
|
||||
<template v-if="parseInt(order._status._type) === 0">
|
||||
<view
|
||||
class="bnt cancelBnt v12-dark-text v12-dark-border"
|
||||
@@ -667,6 +736,7 @@ export default {
|
||||
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
|
||||
data() {
|
||||
return {
|
||||
collectiveOrderType: 'wholesaler',
|
||||
giftItem: {},
|
||||
isShowPayPwdPop: false,
|
||||
inputStyle: {
|
||||
@@ -693,14 +763,15 @@ export default {
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
],
|
||||
orderTypeTabList: [
|
||||
{ name: '购物', orderType: 'shop' },
|
||||
{ name: '旅居', orderType: 'travel' }
|
||||
{ name: '旅居', orderType: 'travel' },
|
||||
{ name: '集采中心', orderType: 'wholesaler' }
|
||||
],
|
||||
orderTypeTabIndex: 0,
|
||||
orderType: 'shop',
|
||||
@@ -735,7 +806,15 @@ export default {
|
||||
passkeyborad,
|
||||
DateRangePicker
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
computed: {
|
||||
...mapGetters(["userInfo"]),
|
||||
isCollectiveCenterMode() {
|
||||
return this.orderType === this.collectiveOrderType
|
||||
},
|
||||
searchPlaceholder() {
|
||||
return this.isCollectiveCenterMode ? '请输入商品名称/订单号' : '请输入商品名/订单号/团购名称'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
const _this = this
|
||||
const needRefreshOrderList = uni.getStorageSync('needRefreshMyOrderList')
|
||||
@@ -780,12 +859,14 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.type = this.type || parseInt(this.$yroute.query.type) || 0
|
||||
this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0
|
||||
const query = this.getPageQuery()
|
||||
this.type = this.type || parseInt(query.type) || 0
|
||||
this.orderTypeTabIndex = parseInt(query.tabIndex) || 0
|
||||
const currentOrderTypeTab = this.orderTypeTabList[this.orderTypeTabIndex] || this.orderTypeTabList[0]
|
||||
this.initUserLocation()
|
||||
this.orderTypeTabChange({
|
||||
...this.orderTypeTabList[this.orderTypeTabIndex],
|
||||
index: this.orderTypeTabIndex
|
||||
...currentOrderTypeTab,
|
||||
index: this.orderTypeTabList[this.orderTypeTabIndex] ? this.orderTypeTabIndex : 0
|
||||
})
|
||||
},
|
||||
onShareAppMessage() {
|
||||
@@ -800,6 +881,291 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPageQuery() {
|
||||
return (this.$yroute && this.$yroute.query) || {}
|
||||
},
|
||||
getDefaultTabListByOrderType(orderType = this.orderType) {
|
||||
if (orderType === 'travel') {
|
||||
return [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待确认' },
|
||||
{ name: '待使用' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
}
|
||||
if (orderType === this.collectiveOrderType) {
|
||||
return [
|
||||
{ name: '全部' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
}
|
||||
return [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
},
|
||||
getRequestTypeMapByOrderType(orderType = this.orderType) {
|
||||
if (orderType === this.collectiveOrderType) {
|
||||
return {
|
||||
0: 0,
|
||||
1: 2,
|
||||
2: 3,
|
||||
3: -3,
|
||||
4: 5,
|
||||
}
|
||||
}
|
||||
return {
|
||||
0: 0,
|
||||
1: 1,
|
||||
2: 2,
|
||||
3: 3,
|
||||
4: -3,
|
||||
5: 4,
|
||||
6: 5,
|
||||
}
|
||||
},
|
||||
getCollectiveStoreName(order) {
|
||||
return order.merName || order.storeName || order.companyName || '集采中心'
|
||||
},
|
||||
getCollectiveCity(order) {
|
||||
return order.merCityName || order.cityName || order.city || ''
|
||||
},
|
||||
getOrderStoreName(order) {
|
||||
if (this.isCollectiveCenterMode) {
|
||||
return this.getCollectiveStoreName(order)
|
||||
}
|
||||
return order.merName || order.storeName || ''
|
||||
},
|
||||
getOrderCityName(order) {
|
||||
if (this.isCollectiveCenterMode) {
|
||||
return this.getCollectiveCity(order)
|
||||
}
|
||||
return order.merCityName || ''
|
||||
},
|
||||
getOrderTotalNum(order) {
|
||||
if (this.isCollectiveCenterMode) {
|
||||
return this.getCollectiveTotalNum(order)
|
||||
}
|
||||
return Number(order && order.totalNum) || 0
|
||||
},
|
||||
shouldShowOrderTotalAmount(order) {
|
||||
if (this.isCollectiveCenterMode && this.isCollectiveCustomGiftOrder(order)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
getOrderPayPrice(order) {
|
||||
return Number(order && order.payPrice) || 0
|
||||
},
|
||||
getOrderStatusTagText(order) {
|
||||
if (this.isCollectiveCenterMode) {
|
||||
return this.getStatus(order) || (order._status && order._status._title) || '已完成'
|
||||
}
|
||||
return (order.isGiftCardSend || order.isGiftCardReceive)
|
||||
? '礼包'
|
||||
: (this.getStatus(order) || (order._status && order._status._title) || '已完成')
|
||||
},
|
||||
getCollectiveStatus(order) {
|
||||
return this.getStatus(order) || (order._status && order._status._title) || '已完成'
|
||||
},
|
||||
getCollectiveScenarioCode(order) {
|
||||
return Number(order && order.scenarioCode)
|
||||
},
|
||||
getCollectiveStatusType(order) {
|
||||
return Number(order && order._status && order._status._type)
|
||||
},
|
||||
isCollectiveWholesalerOrder(order) {
|
||||
return this.getCollectiveScenarioCode(order) === 22
|
||||
},
|
||||
isCollectiveCustomGiftOrder(order) {
|
||||
return this.getCollectiveScenarioCode(order) === 24
|
||||
},
|
||||
isBlindBoxGiftOrder(order) {
|
||||
return Number(order && order.isGiftCardReceiveBlind) === 1
|
||||
},
|
||||
getCollectiveProductList(order) {
|
||||
return Array.isArray(order && order.cartInfo) ? order.cartInfo : []
|
||||
},
|
||||
getCollectiveCustomGiftList(order) {
|
||||
const customGiftInfo = order && order.customGiftInfo
|
||||
if (!this.isCollectiveCustomGiftOrder(order)) {
|
||||
return []
|
||||
}
|
||||
if (!customGiftInfo || typeof customGiftInfo !== 'object' || Array.isArray(customGiftInfo)) {
|
||||
return []
|
||||
}
|
||||
return [customGiftInfo]
|
||||
},
|
||||
formatCollectiveImage(image) {
|
||||
const imageUrl = String(image || '').trim()
|
||||
if (!imageUrl) {
|
||||
return ''
|
||||
}
|
||||
if (/^https?:\/\//i.test(imageUrl)) {
|
||||
return imageUrl
|
||||
}
|
||||
if (imageUrl.startsWith('//')) {
|
||||
return `https:${imageUrl}`
|
||||
}
|
||||
if (imageUrl.startsWith('/')) {
|
||||
const apiBaseUrl = String(this.$VUE_APP_API_URL || '').replace(/\/api\/?$/, '')
|
||||
return `${apiBaseUrl}${imageUrl}`
|
||||
}
|
||||
return imageUrl
|
||||
},
|
||||
normalizeCollectiveDisplayItem(item = {}, isCustomGift = false) {
|
||||
if (isCustomGift) {
|
||||
return {
|
||||
image: this.formatCollectiveImage(item.giftImage),
|
||||
name: item.giftName || '商品信息',
|
||||
sku: item.specName || '',
|
||||
qty: Number(item.giftNum) || 1,
|
||||
price: 0,
|
||||
showPrice: false,
|
||||
giftValue: Number(item.giftValue) || 0,
|
||||
isShowValue: Number(item.isShowValue) || 0,
|
||||
isCustomGift: true
|
||||
}
|
||||
}
|
||||
const productInfo = item.productInfo || {}
|
||||
const attrInfo = productInfo.attrInfo || {}
|
||||
const rawPrice =
|
||||
item.truePrice ||
|
||||
item.price ||
|
||||
item.productPrice ||
|
||||
item.unitPrice ||
|
||||
attrInfo.price ||
|
||||
productInfo.price ||
|
||||
0
|
||||
const rawSku =
|
||||
item.sku ||
|
||||
item.spec ||
|
||||
item.specName ||
|
||||
item.attrValue ||
|
||||
item.attrName ||
|
||||
item.unitName ||
|
||||
item.unit ||
|
||||
attrInfo.sku ||
|
||||
''
|
||||
const rawQty =
|
||||
item.cartNum ||
|
||||
item.num ||
|
||||
item.productNum ||
|
||||
item.quantity ||
|
||||
item.qty ||
|
||||
item.giftNum ||
|
||||
1
|
||||
return {
|
||||
image: this.formatCollectiveImage(
|
||||
item.image ||
|
||||
item.productImage ||
|
||||
item.giftImage ||
|
||||
item.cover ||
|
||||
productInfo.image ||
|
||||
attrInfo.image ||
|
||||
''
|
||||
),
|
||||
name:
|
||||
item.storeName ||
|
||||
item.productName ||
|
||||
item.giftName ||
|
||||
item.name ||
|
||||
item.title ||
|
||||
'商品信息',
|
||||
price: Number(rawPrice) || 0,
|
||||
showPrice: true,
|
||||
sku: rawSku,
|
||||
qty: Number(rawQty) || 1,
|
||||
isCustomGift
|
||||
}
|
||||
},
|
||||
getCollectiveDisplayItems(order) {
|
||||
if (this.isBlindBoxGiftOrder(order)) {
|
||||
return []
|
||||
}
|
||||
if (this.isCollectiveCustomGiftOrder(order)) {
|
||||
return this.getCollectiveCustomGiftList(order).map(item => this.normalizeCollectiveDisplayItem(item, true))
|
||||
}
|
||||
if (this.isCollectiveWholesalerOrder(order)) {
|
||||
return this.getCollectiveProductList(order).map(item => this.normalizeCollectiveDisplayItem(item))
|
||||
}
|
||||
return []
|
||||
},
|
||||
getCollectiveTotalNum(order) {
|
||||
const totalNum = Number(order && order.totalNum)
|
||||
if (totalNum > 0) {
|
||||
return totalNum
|
||||
}
|
||||
return this.getCollectiveDisplayItems(order).reduce((sum, item) => sum + Number(item.qty || 0), 0)
|
||||
},
|
||||
getCollectiveProductImage(cart) {
|
||||
const productInfo = (cart && cart.productInfo) || {}
|
||||
const attrInfo = productInfo.attrInfo || {}
|
||||
return productInfo.image || attrInfo.image || ''
|
||||
},
|
||||
getCollectiveProductName(cart) {
|
||||
const productInfo = (cart && cart.productInfo) || {}
|
||||
return productInfo.storeName || cart.storeName || '商品信息'
|
||||
},
|
||||
getCollectiveProductSku(cart) {
|
||||
const productInfo = (cart && cart.productInfo) || {}
|
||||
const attrInfo = productInfo.attrInfo || {}
|
||||
return attrInfo.sku || cart.sku || ''
|
||||
},
|
||||
showCollectiveContact(order) {
|
||||
const statusType = this.getCollectiveStatusType(order)
|
||||
if (!this.isCollectiveWholesalerOrder(order)) {
|
||||
return false
|
||||
}
|
||||
return Boolean(
|
||||
(order.merName || order.storeName || order.merPhone || order.merId) &&
|
||||
[1, 2, 4, -1, -2, -3].includes(statusType)
|
||||
)
|
||||
},
|
||||
showCollectiveModifyAddress(order) {
|
||||
const statusType = this.getCollectiveStatusType(order)
|
||||
if (statusType !== 1) {
|
||||
return false
|
||||
}
|
||||
if (!(this.isCollectiveWholesalerOrder(order) || this.isCollectiveCustomGiftOrder(order))) {
|
||||
return false
|
||||
}
|
||||
return this.canShowModifyAddress(order)
|
||||
},
|
||||
showCollectiveDelete(order) {
|
||||
return Number(order._status && order._status._type) === 9
|
||||
},
|
||||
showCollectiveTakeOrder(order) {
|
||||
return this.getCollectiveStatusType(order) === 2
|
||||
},
|
||||
showCollectiveDetail(order) {
|
||||
const statusType = this.getCollectiveStatusType(order)
|
||||
if (this.isCollectiveCustomGiftOrder(order)) {
|
||||
return [1, 4].includes(statusType)
|
||||
}
|
||||
if (this.isCollectiveWholesalerOrder(order)) {
|
||||
return [1, 4, -1, -2, -3].includes(statusType)
|
||||
}
|
||||
return false
|
||||
},
|
||||
showCollectiveRefund(order) {
|
||||
const statusType = this.getCollectiveStatusType(order)
|
||||
if (!this.isCollectiveWholesalerOrder(order)) {
|
||||
return false
|
||||
}
|
||||
return statusType === 2
|
||||
},
|
||||
isRefundFlow(order) {
|
||||
if (!order) {
|
||||
return false
|
||||
@@ -1016,6 +1382,13 @@ export default {
|
||||
}
|
||||
return orderOrIndex
|
||||
},
|
||||
handleOrderStoreClick(orderOrIndex) {
|
||||
const order = this.getOrderByIndex(orderOrIndex)
|
||||
if (!order || this.isCollectiveCenterMode) {
|
||||
return
|
||||
}
|
||||
this.goStore(order)
|
||||
},
|
||||
delOrder(orderOrIndex) {
|
||||
const order = this.getOrderByIndex(orderOrIndex)
|
||||
if (!order) {
|
||||
@@ -1416,37 +1789,23 @@ export default {
|
||||
},
|
||||
tabChange(item) {
|
||||
this.type = item.index
|
||||
this.$yroute.query.type = this.type
|
||||
const query = this.getPageQuery()
|
||||
query.type = this.type
|
||||
this.changeType()
|
||||
},
|
||||
orderTypeTabChange(item) {
|
||||
this.orderTypeTabIndex = item.index
|
||||
this.orderType = item.orderType
|
||||
const query = this.getPageQuery()
|
||||
query.tabIndex = this.orderTypeTabIndex
|
||||
this.updateTabListByOrderType()
|
||||
if (this.type > this.tabList.length - 1) {
|
||||
this.type = 0
|
||||
}
|
||||
this.changeType(this.type)
|
||||
},
|
||||
updateTabListByOrderType() {
|
||||
if (this.orderType === 'travel') {
|
||||
this.tabList = [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待确认' },
|
||||
{ name: '待使用' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
} else {
|
||||
this.tabList = [
|
||||
{ name: '全部' },
|
||||
{ name: '待付款' },
|
||||
{ name: '待发货' },
|
||||
{ name: '待收货/待核销' },
|
||||
{ name: '退款/售后' },
|
||||
{ name: '待评价' },
|
||||
{ name: '已完成' }
|
||||
]
|
||||
}
|
||||
this.tabList = this.getDefaultTabListByOrderType()
|
||||
},
|
||||
goUserCenter() {
|
||||
this.$yrouter.switchTab({
|
||||
@@ -1468,16 +1827,8 @@ export default {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
})
|
||||
const types = {
|
||||
0: 0,
|
||||
1: 1,
|
||||
2: 2,
|
||||
3: 3,
|
||||
4: -3,
|
||||
5: 4,
|
||||
6: 5,
|
||||
}
|
||||
const type = types[this.type]
|
||||
const typeMap = this.getRequestTypeMapByOrderType()
|
||||
const type = typeMap[this.type]
|
||||
const {
|
||||
page,
|
||||
limit,
|
||||
|
||||
@@ -203,31 +203,31 @@
|
||||
|
||||
<view style="margin-top: 30rpx;border-radius:20rpx;overflow: hidden;" class="v12-white">
|
||||
<!-- <OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []" title="商品信息"></OrderGoods> -->
|
||||
<view class="v12-radius-20 v12-pa-3" v-for="(cart, d) in orderInfo.cartInfo" :key="d" @click="goGoodsCon(cart, orderInfo.isGiftCardReceiveBlind, orderInfo.isDrawOrder)">
|
||||
<view class="v12-radius-20 v12-pa-3" v-for="(cart, d) in getOrderDetailDisplayItems(orderInfo)" :key="d" @click="goGoodsCon(cart, orderInfo.isGiftCardReceiveBlind, orderInfo.isDrawOrder, orderInfo.scenarioCode)">
|
||||
<view class="v12-justify-between" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||
<view class="">
|
||||
<image style="width: 120rpx; height: 120rpx" class="v12-radius-8" :src="cart.productInfo.image"></image>
|
||||
<image style="width: 120rpx; height: 120rpx" class="v12-radius-8" :src="cart.image"></image>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-flex-column v12-ml-2" style="flex: 2">
|
||||
<view class="v12-font-28 v12-dark-text v12-font-bold more-t">
|
||||
{{ cart.productInfo.storeName }}
|
||||
{{ cart.name }}
|
||||
</view>
|
||||
<view v-if="cart.productInfo.attrInfo && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
|
||||
{{ cart.productInfo.attrInfo.sku || '' }}
|
||||
<view v-if="cart.sku && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
|
||||
{{ cart.sku }}
|
||||
</view>
|
||||
<view v-if="orderInfo.isDrawOrder === 1" class="more-t v12-secondary-dark-text v12-font-24">
|
||||
{{ orderInfo.drawOrderInfo.prizeAttrName || '' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-flex-column v12-dark-text v12-text-right">
|
||||
<view class=" " v-if="orderInfo.isDrawOrder === 0">
|
||||
<view class=" " v-if="orderInfo.isDrawOrder === 0 && cart.showPrice">
|
||||
<text class="v12-font-22">
|
||||
¥
|
||||
</text>
|
||||
<text class="v12-font-28">{{ cart.truePrice }}</text>
|
||||
<text class="v12-font-28">{{ force2Decimal(cart.price) }}</text>
|
||||
</view>
|
||||
<view class="v12-font-22">
|
||||
<text>x{{ cart.cartNum }}</text>
|
||||
<text>x{{ cart.qty }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -244,7 +244,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="orderInfo.cartInfo &&( d === orderInfo.cartInfo.length - 1) && orderInfo.isDrawOrder === 0">
|
||||
<view class="" v-if="getOrderDetailDisplayItems(orderInfo).length && (d === getOrderDetailDisplayItems(orderInfo).length - 1) && orderInfo.isDrawOrder === 0">
|
||||
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-if="orderInfo.isGiftCardReceiveBlind === 0">
|
||||
<view class="v12-font-24 v12-dark-text">
|
||||
商品总价
|
||||
@@ -500,7 +500,14 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="status.type == 1" >
|
||||
<view class="v12-justify-between " style="width: 100%">
|
||||
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%">
|
||||
<view
|
||||
v-if="canShowModifyAddress(orderInfo) && orderInfo.isDrawOrder === 0"
|
||||
class="bnt v12-dark-text v12-dark-border cancel"
|
||||
@click="goAddress"
|
||||
>修改地址</view>
|
||||
</view>
|
||||
<view v-else class="v12-justify-between " style="width: 100%">
|
||||
<view class="v12-justify-between ">
|
||||
<view v-if="orderInfo.isDrawOrder > 0" class="bnt v12-dark-text v12-dark-border cancel" @click.stop="callMerPhone">联系客服</view>
|
||||
<view v-if="orderInfo.isGiftCardReceiveBlind === 0 && orderInfo.isDrawOrder === 0" class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
|
||||
@@ -515,7 +522,10 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="status.type == 2">
|
||||
<view class="v12-justify-between " style="width: 100%">
|
||||
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%">
|
||||
<view class="bnt v12-primary-text v12-primary-border" @click="takeOrder">确认收货</view>
|
||||
</view>
|
||||
<view v-else class="v12-justify-between " style="width: 100%">
|
||||
<view v-if="orderInfo.isGiftCardReceiveBlind === 0" class="bnt v12-dark-text v12-dark-border cancel" @click.stop="callMerPhone">联系客服</view>
|
||||
<view class="" v-else></view>
|
||||
<view class="v12-justify-between">
|
||||
@@ -549,7 +559,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
|
||||
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
|
||||
<view
|
||||
v-if="canShowOrderEvaluate(orderInfo)"
|
||||
class="bnt v12-primary-text v12-primary-border"
|
||||
@click="routerGo(orderInfo.cartInfo[0])"
|
||||
>立即评价</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -572,7 +586,7 @@
|
||||
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
|
||||
<view
|
||||
v-if="!isGiftOrder(orderInfo)"
|
||||
v-if="canShowOrderEvaluate(orderInfo)"
|
||||
class="bnt v12-primary-text v12-primary-border"
|
||||
@click="routerGo(orderInfo.cartInfo[0])"
|
||||
>立即评价</view>
|
||||
@@ -850,9 +864,10 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder) {
|
||||
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
|
||||
if(isGiftCardReceiveBlind) return
|
||||
if(isDrawOrder) return
|
||||
if (Number(scenarioCode) === 24) return
|
||||
const activityId = Number(
|
||||
item.drawActivityId ||
|
||||
(item.productInfo && item.productInfo.drawActivityId) ||
|
||||
@@ -1029,6 +1044,75 @@ export default {
|
||||
}
|
||||
return status;
|
||||
},
|
||||
getOrderScenarioCode(order = this.orderInfo) {
|
||||
return Number(order && order.scenarioCode)
|
||||
},
|
||||
isWholesalerOrder(order = this.orderInfo) {
|
||||
return this.getOrderScenarioCode(order) === 22
|
||||
},
|
||||
isCustomGiftOrder(order = this.orderInfo) {
|
||||
return this.getOrderScenarioCode(order) === 24
|
||||
},
|
||||
isCollectiveOrder(order = this.orderInfo) {
|
||||
return this.isWholesalerOrder(order) || this.isCustomGiftOrder(order)
|
||||
},
|
||||
canShowOrderEvaluate(order = this.orderInfo) {
|
||||
return !this.isGiftOrder(order) && !this.isCollectiveOrder(order)
|
||||
},
|
||||
formatOrderDetailImage(image) {
|
||||
const imageUrl = String(image || '').trim()
|
||||
if (!imageUrl) {
|
||||
return ''
|
||||
}
|
||||
if (/^https?:\/\//i.test(imageUrl)) {
|
||||
return imageUrl
|
||||
}
|
||||
if (imageUrl.startsWith('//')) {
|
||||
return `https:${imageUrl}`
|
||||
}
|
||||
if (imageUrl.startsWith('/')) {
|
||||
const apiBaseUrl = String(this.$VUE_APP_API_URL || '').replace(/\/api\/?$/, '')
|
||||
return `${apiBaseUrl}${imageUrl}`
|
||||
}
|
||||
return imageUrl
|
||||
},
|
||||
normalizeOrderDetailItem(item = {}, isCustomGift = false) {
|
||||
if (isCustomGift) {
|
||||
return {
|
||||
image: this.formatOrderDetailImage(item.giftImage),
|
||||
name: item.giftName || '商品信息',
|
||||
sku: item.specName || '',
|
||||
qty: Number(item.giftNum) || 1,
|
||||
price: 0,
|
||||
showPrice: false,
|
||||
productId: '',
|
||||
productInfo: {}
|
||||
}
|
||||
}
|
||||
const productInfo = item.productInfo || {}
|
||||
const attrInfo = productInfo.attrInfo || {}
|
||||
return {
|
||||
...item,
|
||||
image: this.formatOrderDetailImage(item.image || productInfo.image || attrInfo.image || ''),
|
||||
name: productInfo.storeName || item.storeName || item.productName || '商品信息',
|
||||
sku: attrInfo.sku || item.sku || item.specName || '',
|
||||
qty: Number(item.cartNum || item.num || item.quantity || 1) || 1,
|
||||
price: Number(item.truePrice || item.price || attrInfo.price || productInfo.price || 0) || 0,
|
||||
showPrice: true,
|
||||
productId: item.productId || productInfo.id || ''
|
||||
}
|
||||
},
|
||||
getOrderDetailDisplayItems(order = this.orderInfo) {
|
||||
if (this.isCustomGiftOrder(order)) {
|
||||
const customGiftInfo = order && order.customGiftInfo
|
||||
if (!customGiftInfo || typeof customGiftInfo !== 'object' || Array.isArray(customGiftInfo)) {
|
||||
return []
|
||||
}
|
||||
return [this.normalizeOrderDetailItem(customGiftInfo, true)]
|
||||
}
|
||||
const cartList = Array.isArray(order && order.cartInfo) ? order.cartInfo : []
|
||||
return cartList.map(item => this.normalizeOrderDetailItem(item))
|
||||
},
|
||||
getStatusImg(order) {
|
||||
const type = parseInt(order._status._type);
|
||||
let imgUrl = "";
|
||||
@@ -1280,7 +1364,13 @@ export default {
|
||||
this.orderInfo = res.data
|
||||
this.orderInfo._status._type = parseInt(this.orderInfo._status._type)
|
||||
this.getOrderStatus()
|
||||
if (this.orderInfo.combinationId > 0) {
|
||||
if (this.isWholesalerOrder(this.orderInfo)) {
|
||||
this.orderTypeName = "采购批发订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.isCustomGiftOrder(this.orderInfo)) {
|
||||
this.orderTypeName = "自建礼品订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.orderInfo.combinationId > 0) {
|
||||
this.orderTypeName = "拼团订单"
|
||||
this.orderTypeNameStatus = false
|
||||
} else if (this.orderInfo.bargainId > 0) {
|
||||
|
||||
Reference in New Issue
Block a user