This commit is contained in:
LinCyJang
2026-08-02 11:02:16 +08:00
11 changed files with 704 additions and 139 deletions
+8
View File
@@ -10,6 +10,14 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') {
enableDebug: false
})
}
if (NODE_ENV === 'fix') {
BASE_URL = 'https://shop-pre.xdd618.com/api'
SERVICE_URL = 'https://service-pre.xdd618.com/api'
SERVICE_WS_URL = 'wss://service-pre.xdd618.com/ws'
wx.setEnableDebug({
enableDebug: false
})
}
if (NODE_ENV === 'prod') {
BASE_URL = 'https://wxapp.xdd618.com/api'
SERVICE_URL = 'https://service.xdd618.com/api'
+11
View File
@@ -133,6 +133,17 @@
"CUSTOM-CONST": true
}
},
"mp-weixin-fix": {
"title": "微信小程序(Fix环境)",
"env": {
"UNI_PLATFORM": "mp-weixin",
"VUE_APP_ENV": "fix",
"UNI_OUTPUT_DIR": "dist"
},
"define": {
"CUSTOM-CONST": true
}
},
"mp-weixin": {
"title": "微信小程序(生产环境)",
"env": {
+10 -13
View File
@@ -384,20 +384,17 @@ export default {
this.mescroll && this.mescroll.triggerDownScroll()
},
search() {
if(this.keyword === '') return
const matchIndex = this.listGroup.findIndex((group, index) => {
let result
group.city.forEach(item => {
result = item.cityName.indexOf(this.keyword, 0)
if (result !== -1) {
this.asideTap(index);
return null;
}
})
if (result !== -1) {
return result
}
const keyword = (this.keyword || '').trim()
if (!keyword) return
const matchIndex = this.listGroup.findIndex(group => {
const cityList = Array.isArray(group.city) ? group.city : []
return cityList.some(item => item && item.cityName && item.cityName.indexOf(keyword) !== -1)
})
if (matchIndex !== -1) {
this.keyword = keyword
this.asideTap(matchIndex)
return
}
if (matchIndex === -1) {
uni.showToast({
title: '未找到该城市,请重新输入城市名称',
+486 -95
View File
@@ -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">
@@ -254,22 +285,22 @@
<image
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.combinationId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.bargainId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.seckillId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
</view>
<view class="text" style="margin-top: 0 !important;">
@@ -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) {
@@ -1299,9 +1672,39 @@ export default {
}
}
},
gotoGoodDetail(cart, type, query){
gotoGoodDetail(orderOrIndex, cartOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
const cartList = Array.isArray(order && order.cartInfo) ? order.cartInfo : []
const cart = typeof cartOrIndex === 'number' ? cartList[cartOrIndex] : cartOrIndex
if (!cart) {
uni.showToast({
title: '未获取到商品信息',
icon: 'none'
})
return
}
const productInfo = cart.productInfo || {}
let type = 1
let id = productInfo.id || cart.productId || ''
if (Number(cart.combinationId) > 0) {
type = 2
id = cart.combinationId
} else if (Number(cart.bargainId) > 0) {
type = 3
id = cart.bargainId
} else if (Number(cart.seckillId) > 0) {
type = 4
id = cart.seckillId
}
if (!id) {
uni.showToast({
title: '未获取到商品详情参数',
icon: 'none'
})
return
}
// isProductStillExist:0-不存在,1-存在
const isProductStillExist = cart.isProductStillExist || 0
const isProductStillExist = Number(cart.isProductStillExist || 0)
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
@@ -1321,7 +1724,17 @@ export default {
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
if (!path) {
uni.showToast({
title: '未找到商品详情页',
icon: 'none'
})
return
}
this.$yrouter.push({
path,
query: { id }
})
},
getOrderData() {
getOrderData().then(res => {
@@ -1376,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({
@@ -1428,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,
+17 -4
View File
@@ -732,6 +732,7 @@ export default {
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
uni.removeStorageSync('couponId')
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
const from = options.from
const id = options.id
switch (from) {
@@ -779,10 +780,10 @@ export default {
if (url && url.productId) {
this.id = url.productId
} else if (options.id) {
this.id = options.id || null
this.partnerId = options.partnerId || null
this.activityId = this._route.query.activityId
this.source = this._route.query.from || ''
this.id = pageQuery.id || options.id || null
this.partnerId = pageQuery.partnerId || options.partnerId || null
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
this.source = pageQuery.from || ''
} else {
const obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) {
@@ -847,6 +848,18 @@ export default {
}
},
methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
gift() {
this.goCat(2)
},
+105 -15
View File
@@ -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) {
+3 -3
View File
@@ -6,21 +6,21 @@
mode="scaleToFill"
/>
<image
v-show="partnerType === 'province_partner' || partnerType === ''"
v-show="partnerType === 'province_partner' || partnerType === '' || partnerType === 'county_agent'"
:src="images.goodSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('goods_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
:src="images.wenwanSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('wenwan_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === ''"
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
:src="images.hotelImage"
class="img-item"
mode="widthFix"
+11
View File
@@ -24,6 +24,7 @@
:src="countyFamousTopImage"
class="img"
mode="widthFix"
:lazy-load="true"
/>
<view v-if="list.length > 0" class="province-wrap" id="province-wrap">
<view
@@ -39,6 +40,7 @@
<image
:src="item.icon"
class="img"
:lazy-load="true"
/>
<view class="name one-t">
{{ item.provinceName }}
@@ -61,6 +63,7 @@
<image
:src="webUrl + '/page/qianxian/icon-06.png'"
class="icon"
:lazy-load="true"
/>
</view>
</view>
@@ -95,11 +98,13 @@
<image
:src="county.logo"
class="county-img"
:lazy-load="true"
/>
<view class="county-name">
<image
:src="webUrl + '/home/icon-location.png'"
class="icon"
:lazy-load="true"
/>
<view class="county-txt one-t">
{{ county.countyName }}
@@ -118,11 +123,13 @@
<image
:src="county.logo"
class="county-img"
:lazy-load="true"
/>
<view class="county-name">
<image
:src="webUrl + '/home/icon-location.png'"
class="icon"
:lazy-load="true"
/>
<view class="county-txt one-t">
{{ county.countyName }}
@@ -140,11 +147,13 @@
<image
:src="county.logo"
class="county-img"
:lazy-load="true"
/>
<view class="county-name">
<image
:src="webUrl + '/home/icon-location.png'"
class="icon"
:lazy-load="true"
/>
<view class="county-txt one-t">
{{ county.countyName }}
@@ -160,6 +169,7 @@
:src="webUrl + '/home/no-data-bg.png'"
mode="widthFix"
class="loadend"
:lazy-load="true"
/>
</view>
<image
@@ -167,6 +177,7 @@
:src="webUrl + '/orderIcon/nodata.png'"
class="img-nodata v12-mt-16"
mode="scaleToFill"
:lazy-load="true"
/>
</view>
<goo-skeleton
@@ -184,7 +184,7 @@ export default {
.banner-swiper,
.banner-fallback {
width: 100%;
height: 500rpx;
height: 750rpx;
}
.banner-image {
@@ -218,7 +218,7 @@ export default {
margin-top: 20rpx;
padding: 20rpx 0rpx;
border-radius: 16rpx;
font-size: 28rpx;
font-size: 30rpx;
line-height: 44rpx;
color: #333;
font-weight: bold;
@@ -241,7 +241,7 @@ export default {
display: flex;
align-items: center;
margin-top: 16rpx;
font-size: 26rpx;
font-size: 30rpx;
line-height: 40rpx;
color: #333;
font-weight: bold;
@@ -267,7 +267,7 @@ export default {
.detail-image {
width: 280rpx;
height: 220rpx;
height: 280rpx;
margin-right: 16rpx;
border-radius: 16rpx;
display: block;
+13 -1
View File
@@ -224,7 +224,7 @@
@click.stop="handleInfoHotelClick(item)"
>
<view class="info-shop-logo">
<image :src="item.linkHotelLogo" mode="aspectFill" />
<image :src="item.linkHotelLogo" mode="aspectFill" :lazy-load="true" />
</view>
<view class="info-shop-main">
<view class="info-shop-name">
@@ -245,6 +245,7 @@
<image
:src="webUrl + '/20230803152147141807.png'"
class="icon"
:lazy-load="true"
/>
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
</view>
@@ -253,12 +254,14 @@
v-if="!item.hasZan"
:src="webUrl + '/page/hotel/zan-off-2.png'"
class="zan-off-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan + 1, true)"
/>
<image
v-else
:src="webUrl + '/page/hotel/zan-on-2.png'"
class="zan-on-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan - 1, false)"
/>
<text
@@ -390,6 +393,7 @@
<image
:src="item"
class="img"
:lazy-load="true"
@click="showPic(index)"
/>
</view>
@@ -413,6 +417,7 @@
:src="item.image"
mode="widthFix"
class="img"
:lazy-load="true"
/>
<view class="info-wrap">
<view class="time">
@@ -470,6 +475,7 @@
<image
:src="webUrl + '/page/qianxian/icon-02.png'"
class="icon"
:lazy-load="true"
/>
重点项目
</view>
@@ -486,6 +492,7 @@
<image
:src="webUrl + '/page/qianxian/icon-05.png'"
class="icon"
:lazy-load="true"
/>
</view>
</view>
@@ -503,6 +510,7 @@
<image
:src="webUrl + '/page/qianxian/icon-02.png'"
class="icon"
:lazy-load="true"
/>
招商政策
</view>
@@ -525,6 +533,7 @@
<image
:src="webUrl + '/page/qianxian/icon-05.png'"
class="icon"
:lazy-load="true"
/>
</view>
</view>
@@ -605,11 +614,13 @@
<image
:src="shop.cover + (shop.coverType === 2 ? '?vframe/jpg/offset/1' : '')"
class="img"
:lazy-load="true"
/>
<view class="location">
<image
:src="webUrl + '/page/qianxian/icon-08.png'"
class="icon"
:lazy-load="true"
/>
<view class="addr one-t">
{{ shop.address }}
@@ -624,6 +635,7 @@
<image
:src="shop.logo"
class="logo"
:lazy-load="true"
/>
<view class="name one-t">
{{ shop.name }}
+36 -4
View File
@@ -299,11 +299,12 @@ export default {
}
},
onLoad(opts) {
this.cartId = opts.cartId
this.isGroupBuy = opts.isGroupBuy === '1'
this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
const pageQuery = Object.assign({}, this.resolvePageQuery(), opts || {})
this.cartId = pageQuery.cartId
this.isGroupBuy = pageQuery.isGroupBuy === '1'
this.isCountyLotteryGift = pageQuery.from === 'countyLottery' || pageQuery.isCountyLotteryGift === '1' || !!pageQuery.drawActivityId
// this.couponId = opts.couponId || 0
this.discount = opts.discount
this.discount = pageQuery.discount
if(this.isGroupBuy) {
this.getGroupBuyInfo()
} else {
@@ -332,10 +333,39 @@ export default {
}
},
methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
getCouponId() {
if (this.isCountyLotteryGift) return 0
return this.couponId || 0
},
isCountyLotteryCartItem(item) {
return Number(
(item && item.drawActivityId) ||
(item && item.productInfo && item.productInfo.drawActivityId) ||
0
) > 0
},
syncCountyLotteryGiftFlag(item) {
if (!this.isCountyLotteryGift && this.isCountyLotteryCartItem(item)) {
this.isCountyLotteryGift = true
}
if (!this.isCountyLotteryGift) return
this.couponTitle = ''
if (Number(this.couponId || 0) !== 0) {
this.couponId = 0
}
},
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
if (!productInfo || !productInfo.productStory) {
return {
@@ -436,6 +466,7 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
console.log(this.defaultIndex, 'defaultIndex');
@@ -522,6 +553,7 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.selectedCover = template.cover
this.giftImage = template.image