Merge branch 'dev' into test

This commit is contained in:
lifizer
2026-08-28 17:48:51 +08:00
30 changed files with 1705 additions and 583 deletions
+1 -1
View File
@@ -372,7 +372,7 @@ export const chatMixins = {
const _this = this const _this = this
console.log('------------------创建连接') console.log('------------------创建连接')
uni.connectSocket({ uni.connectSocket({
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`, url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
header: { header: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
+1 -1
View File
@@ -334,7 +334,7 @@ export const chatMixinsV2 = {
const _this = this const _this = this
console.log('------------------创建连接') console.log('------------------创建连接')
uni.connectSocket({ uni.connectSocket({
url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`, url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.uid}-${conversationId}`,
header: { header: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
+16 -3
View File
@@ -184,7 +184,12 @@
<view v-if="item.type === 'price_input'" class="gift-price-input"> <view v-if="item.type === 'price_input'" class="gift-price-input">
<view class="input-wrap"> <view class="input-wrap">
<text class="label">价格预算</text> <text class="label">价格预算</text>
<input v-model="giftBudget" placeholder="例如100以内/300~500元" class="input-budget" placeholder-style="color: #ccc;" /> <input
v-model="giftBudget"
:placeholder="item.guideContent || '例如100以内/300~500元'"
class="input-budget"
placeholder-style="color: #ccc;"
/>
</view> </view>
</view> </view>
</view> </view>
@@ -857,10 +862,18 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
height: calc(100vh - 240rpx); min-height: calc(100vh - 240rpx);
height: auto;
padding: 0 0 240rpx 0; padding: 0 0 240rpx 0;
padding-bottom: calc(240rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(240rpx + env(safe-area-inset-bottom));
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow: visible;
}
.gift-steps-wrap {
padding-bottom: 40rpx;
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
} }
.focus-guide-wrap { .focus-guide-wrap {
display: flex; display: flex;
+32 -2
View File
@@ -17,8 +17,8 @@ export function getShopData(params) {
// 查看商户申请 // 查看商户申请
// 1-特产供应商 2-店铺 3-文玩供应商 // 1-特产供应商 2-店铺 3-文玩供应商
export function getShopInfo() { export function getShopInfo(params) {
return request.get("/merchantApply/info", {}, {login: true}) return request.get("/merchantApply/info", params, {login: true})
} }
// 4-采购批发商 // 4-采购批发商
@@ -38,6 +38,18 @@ export function saveShop(hotelInfo, partnerId = '', promoterUid = '') {
return request.post("/merchantApply/hotel/submit", param, {login: true}) return request.post("/merchantApply/hotel/submit", param, {login: true})
} }
// 保存店铺入驻草稿
export function saveHotelDraft(hotelInfo, partnerId = '', promoterUid = '') {
let param = {hotelInfo, captcha: hotelInfo.captcha};
if (partnerId && partnerId.length > 0) {
param.partnerId = partnerId;
}
if (promoterUid && promoterUid.length > 0) {
param.promoterUid = promoterUid;
}
return request.post("/merchantApply/hotel/saveDraft", param, {login: true})
}
// 提交特产供应商入驻申请 // 提交特产供应商入驻申请
export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') { export function saveSupplier(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha}; let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
@@ -62,12 +74,30 @@ export function saveWenwanSupplier(hotelInfo, supplierInfo, partnerId = '', prom
return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true}) return request.post("/merchantApply/wenwanSupplier/submit", param, {login: true})
} }
// 保存供应商入驻草稿(特产/文玩共用)
export function saveSupplierDraft(hotelInfo, supplierInfo, partnerId = '', promoterUid = '') {
let param = {hotelInfo, supplierInfo, captcha: supplierInfo.captcha};
if (partnerId && partnerId.length > 0) {
param.partnerId = partnerId;
}
if (promoterUid && promoterUid.length > 0) {
param.promoterUid = promoterUid;
}
return request.post("/merchantApply/supplier/saveDraft", param, {login: true})
}
// 提交采购批发商入驻申请 // 提交采购批发商入驻申请
export function saveWholesaler(wholesalerInfo) { export function saveWholesaler(wholesalerInfo) {
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha}; let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
return request.post("/merchantApply/wholesaler/submit", param, {login: true}) return request.post("/merchantApply/wholesaler/submit", param, {login: true})
} }
// 保存采购批发商入驻草稿
export function saveWholesalerDraft(wholesalerInfo) {
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
return request.post("/merchantApply/wholesaler/saveDraft", param, {login: true})
}
export function saveExperienceStore(params) { export function saveExperienceStore(params) {
return request.post("/merchantApply/experienceStore/submit", params, {login: true}) return request.post("/merchantApply/experienceStore/submit", params, {login: true})
} }
+12 -8
View File
@@ -9,16 +9,20 @@ page {
} }
.fix-tabbar-page { .fix-tabbar-page {
position: relative; position: relative;
z-index: 0;
min-height: 100vh; min-height: 100vh;
background: transparent;
isolation: isolate;
&::before {
content: '';
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
pointer-events: none;
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%); background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
// background-color: #fff;
// background-size: 100% calc(100vh - 160rpx);
// background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
// background-repeat: no-repeat;
// background-attachment: fixed;
&.new-chat {
background-size: 100% calc(100vh - 160rpx);
background-repeat: no-repeat;
} }
.fix-tabbar-header { .fix-tabbar-header {
position: fixed; position: fixed;
+19
View File
@@ -127,6 +127,25 @@
height: 52vh; height: 52vh;
overflow-y: auto; overflow-y: auto;
margin: 30rpx 0; margin: 30rpx 0;
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
rich-text {
display: block;
width: 100%;
p, div, ul, ol {
display: block;
margin: 0 0 16rpx;
&:last-child {
margin-bottom: 0;
}
}
li {
margin: 0 0 8rpx;
}
}
} }
.agree-box { .agree-box {
+11
View File
@@ -42,9 +42,20 @@ export default {
}, },
goSupplierMini() { goSupplierMini() {
// 区分当前小程序环境:正式版跳正式版,体验版/开发版跳体验版
let envVersion = 'release'
try {
const accountInfo = uni.getAccountInfoSync()
if (accountInfo && accountInfo.miniProgram && accountInfo.miniProgram.envVersion !== 'release') {
envVersion = 'trial'
}
} catch (e) {
envVersion = 'release'
}
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: "wx9ca93d1f2a9c8156", appId: "wx9ca93d1f2a9c8156",
path: "pages/auth/login", path: "pages/auth/login",
envVersion,
success(msg) { success(msg) {
console.log("success", msg) console.log("success", msg)
}, },
+8
View File
@@ -10,6 +10,14 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') {
enableDebug: false 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') { if (NODE_ENV === 'prod') {
BASE_URL = 'https://wxapp.xdd618.com/api' BASE_URL = 'https://wxapp.xdd618.com/api'
SERVICE_URL = 'https://service.xdd618.com/api' SERVICE_URL = 'https://service.xdd618.com/api'
+11
View File
@@ -133,6 +133,17 @@
"CUSTOM-CONST": true "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": { "mp-weixin": {
"title": "微信小程序(生产环境)", "title": "微信小程序(生产环境)",
"env": { "env": {
+1 -1
View File
@@ -355,7 +355,7 @@
{ {
"path": "views/wholesaler", "path": "views/wholesaler",
"style": { "style": {
"navigationBarTitleText": "采购批发商入驻" "navigationBarTitleText": "礼品集采中心入驻"
} }
}, },
{ {
+8 -15
View File
@@ -49,21 +49,18 @@ export default {
// 注释下面一行,会停留在启动页 // 注释下面一行,会停留在启动页
setTimeout(() => { setTimeout(() => {
this.toLaunch(); this.toLaunch();
}, 2000) }, 5000)
return; return;
} }
// 未登录:静默处理登录,5秒后跳转业务页面
cookie.get("spread"); cookie.get("spread");
// this.toLaunch(); if (this.$deviceType != "app") {
if (this.$deviceType == "app") {
// this.toLaunch();
this.$yrouter.switchTab({
path: "/pages/home/index"
});
return;
}
//检查授权信息 //检查授权信息
this.checkUserInfo(); this.checkUserInfo();
}
setTimeout(() => {
this.toLaunch();
}, 5000);
}, },
methods: { methods: {
...mapActions(["changeAuthorization", "setUserInfo"]), ...mapActions(["changeAuthorization", "setUserInfo"]),
@@ -89,11 +86,7 @@ export default {
} }
} }
login(loginInfo).finally(() => { login(loginInfo);
this.$yrouter.switchTab({
path: "/pages/home/index"
});
});
} }
+89 -27
View File
@@ -6,27 +6,42 @@
</view> </view>
</view> </view>
<view class="list" v-if="list.length"> <view class="list" v-show="hasList">
<view class="video-waterfalls-wrap"> <view class="video-waterfalls-wrap">
<custom-waterfalls-flow :value="list" imageKey="cover"> <view class="waterfalls-column">
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)"> <view class="item" v-for="(lItem,lIndex) in leftList" :key="lIndex" @click="goDetail(lItem)">
<image class="cover" :src="item.cover" mode="widthFix"></image> <image class="cover" :src="lItem.cover" mode="widthFix" lazy-load></image>
<view class="content"> <view class="content">
<view class="title more-t">{{ item.title }}</view> <view class="title more-t">{{ lItem.title }}</view>
<view class="footer flex jc-between ai-center"> <view class="footer flex jc-between ai-center">
<view class="visit flex ai-center"> <view class="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image> <image class="icon" style="margin-right: 8rpx" :src="lItem.storeLogo" mode="scaleToFill"></image>
{{ item.storeName }} {{ lItem.storeName }}
</view> </view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image> <image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view> </view>
</view> </view>
</view> </view>
</custom-waterfalls-flow> </view>
<view class="waterfalls-column">
<view class="item" v-for="(rItem,rIndex) in rightList" :key="rIndex" @click="goDetail(rItem)">
<image class="cover" :src="rItem.cover" mode="widthFix" lazy-load></image>
<view class="content">
<view class="title more-t">{{ rItem.title }}</view>
<view class="footer flex jc-between ai-center">
<view class="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="rItem.storeLogo" mode="scaleToFill"></image>
{{ rItem.storeName }}
</view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
<view class="v4-nodata" v-else> <view class="v4-nodata" v-show="!hasList">
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/> <image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<view class="text">暂无数据</view> <view class="text">暂无数据</view>
</view> </view>
@@ -38,6 +53,11 @@ import {getStoreVideoType, getArticleList} from '@/api/public'
import {getVideoList} from '@/api/user' import {getVideoList} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins' import { pageListenMixins } from '@/mixins/pageListenMixins'
// 封面固定宽度(rpx
const COVER_WIDTH = 332
// 每项除封面外的文字内容预估高度(rpx)
const TEXT_HEIGHT = 120
export default { export default {
mixins: [pageListenMixins], mixins: [pageListenMixins],
data() { data() {
@@ -48,11 +68,19 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
keyword: '', keyword: '',
list: [], leftList: [],
rightList: [],
leftHeight: 0,
rightHeight: 0,
isWait: false, isWait: false,
pageKeyId: Object.freeze('findVideoList') pageKeyId: Object.freeze('findVideoList')
} }
}, },
computed: {
hasList() {
return this.leftList.length + this.rightList.length > 0
}
},
onLoad(options) { onLoad(options) {
if (!options.click) { if (!options.click) {
uni.switchTab({ url: '/pages/home/index' }) uni.switchTab({ url: '/pages/home/index' })
@@ -78,10 +106,16 @@ export default {
changeType(item) { changeType(item) {
this.type = item.value this.type = item.value
this.page = 1 this.page = 1
this.list = [] this.resetList()
this.fetchList() this.fetchList()
}, },
fetchList() { resetList() {
this.leftList = []
this.rightList = []
this.leftHeight = 0
this.rightHeight = 0
},
async fetchList() {
if (this.isWait) return if (this.isWait) return
this.isWait = true this.isWait = true
const params = { const params = {
@@ -89,15 +123,46 @@ export default {
page: this.page, page: this.page,
limit: this.limit limit: this.limit
} }
getVideoList(params).then(res => { try {
const res = await getVideoList(params)
if (res.status === 200) { if (res.status === 200) {
for (let i = 0; i < res.data.length; i++) { const items = res.data
res.data[i].hide = true for (let i = 0; i < items.length; i++) {
this.list.push(res.data[i]) items[i].hide = true
} }
} // 并行获取所有封面高度
this.isWait = false const heights = await Promise.all(items.map(item => this.getImageHeight(item.cover)))
items.forEach((item, i) => {
this.pushToColumn(item, heights[i] + TEXT_HEIGHT)
}) })
}
} catch (e) {
// 忽略请求或图片尺寸获取失败
} finally {
this.isWait = false
}
},
getImageHeight(src) {
return new Promise(resolve => {
uni.getImageInfo({
src,
success: res => {
resolve(res.height / res.width * COVER_WIDTH)
},
fail: () => {
resolve(COVER_WIDTH)
}
})
})
},
pushToColumn(item, height) {
if (this.leftHeight <= this.rightHeight) {
this.leftList.push(item)
this.leftHeight += height
} else {
this.rightList.push(item)
this.rightHeight += height
}
}, },
goDetail(item) { goDetail(item) {
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1') this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
@@ -129,25 +194,22 @@ export default {
margin: 28rpx 32rpx; margin: 28rpx 32rpx;
.video-waterfalls-wrap { .video-waterfalls-wrap {
direction: ltr; display: flex;
justify-content: space-between;
/deep/ .waterfalls-flow { align-items: flex-start;
direction: ltr;
text-align: left;
} }
/deep/ .waterfalls-flow-column { .waterfalls-column {
float: left !important; width: 332rpx;
}
} }
.item { .item {
margin-bottom: 20rpx;
border-radius: 4rpx; border-radius: 4rpx;
background: #fff; background: #fff;
.cover { .cover {
width: 332rpx; width: 332rpx;
//height: 200rpx;
vertical-align: middle; vertical-align: middle;
} }
+23 -2
View File
@@ -916,6 +916,18 @@ export default {
} }
app.globalData.homeDrawPosterShownInSession = true app.globalData.homeDrawPosterShownInSession = true
}, },
hasShownOldUserPopupInSession() {
const app = getApp && getApp()
return Boolean(app && app.globalData && app.globalData.homeOldUserPopupShownInSession)
},
markOldUserPopupShownInSession() {
const app = getApp && getApp()
if (!app) return
if (!app.globalData) {
app.globalData = {}
}
app.globalData.homeOldUserPopupShownInSession = true
},
initPosterPopupState(data = {}) { initPosterPopupState(data = {}) {
const drawEntranceConfig = data.drawEntranceConfig || {} const drawEntranceConfig = data.drawEntranceConfig || {}
this.$set(this, 'drawEntranceConfig', drawEntranceConfig) this.$set(this, 'drawEntranceConfig', drawEntranceConfig)
@@ -932,10 +944,19 @@ export default {
(data.lotteryCanDraw || false) (data.lotteryCanDraw || false)
) )
this.isDrawPosterVisible = shouldShowDrawPoster this.isDrawPosterVisible = shouldShowDrawPoster
this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster const shouldShowOldUserPopup =
!shouldShowDrawPoster &&
!hasShownDrawPosterInSession &&
this.canShowOldPoster &&
!this.hasShownOldUserPopupInSession()
if (shouldShowOldUserPopup) {
this.markOldUserPopupShownInSession()
}
this.isOldUser = shouldShowOldUserPopup
}, },
showNextPoster() { showNextPoster() {
if (!this.isDrawPosterVisible && this.canShowOldPoster) { if (!this.isDrawPosterVisible && this.canShowOldPoster && !this.hasShownOldUserPopupInSession()) {
this.markOldUserPopupShownInSession()
this.isOldUser = true this.isOldUser = true
} }
}, },
+476 -60
View File
@@ -12,7 +12,7 @@
v-model="keyword" v-model="keyword"
:inputStyle="inputStyle" :inputStyle="inputStyle"
:showAction="false" :showAction="false"
placeholder="请输入商品名/订单号/团购名称" :placeholder="searchPlaceholder"
shape="round" shape="round"
bgColor="#FFF" bgColor="#FFF"
@search="changeType" @search="changeType"
@@ -76,28 +76,28 @@
</view> </view>
</view> </view>
<view <view
v-if="order.merName && !order.experienceOrderInfo" v-if="getOrderStoreName(order) && !order.experienceOrderInfo"
class="shop-info flex jc-between ai-center" class="shop-info flex jc-between ai-center"
style="padding-bottom: 0" style="padding-bottom: 0"
@click="goStore(orderListIndex)" @click="handleOrderStoreClick(orderListIndex)"
> >
<view class="flex ai-center"> <view class="flex ai-center">
<image <image
:src="webUrl+'/orderIcon/shop.png'" :src="webUrl+'/orderIcon/shop.png'"
style="width: 32rpx;height: 32rpx" 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 <image
:src="webUrl+'/orderIcon/arrow.png'" :src="webUrl+'/orderIcon/arrow.png'"
style="width: 24rpx;height: 24rpx; margin-top: 5rpx" style="width: 24rpx;height: 24rpx; margin-top: 5rpx"
/> />
</view> </view>
<view class="flex ai-center"> <view v-if="getOrderCityName(order)" class="flex ai-center">
<image <image
:src="webUrl+'/orderIcon/map.png'" :src="webUrl+'/orderIcon/map.png'"
style="width: 28rpx;height: 28rpx" 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> </view>
<view v-if="order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;"> <view v-if="order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;">
@@ -131,7 +131,7 @@
<view <view
v-else v-else
class="font-color-white statusTag v12-primary" class="font-color-white statusTag v12-primary"
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view> >{{ getOrderStatusTagText(order) }}</view>
</view> </view>
<view @click="goOrderDetails(orderListIndex)"> <view @click="goOrderDetails(orderListIndex)">
<view <view
@@ -186,6 +186,44 @@
</view> </view>
</view> </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="isCollectiveWholesalerOrder(order)">
<text class="v12-font-22"></text>
<text class="v12-font-28">{{ force2Decimal(item.price) }}</text>
</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 class="v12-font-22 v12-secondary-dark-text">x{{ item.qty }}</view>
</view>
<view
v-if="isCollectiveCustomGiftOrder(order) && item.isShowValue"
class="gift-value-row v12-font-24 v12-secondary-dark-text"
>
<text>礼品价值</text>
<text class="v12-dark-text">{{ force2Decimal(item.giftValue) }}</text>
</view>
</view>
</view>
</view>
<view v-else-if="order.isDrawOrder === 1"> <view v-else-if="order.isDrawOrder === 1">
<view class="item-info acea-row row-between row-top draw-order-info"> <view class="item-info acea-row row-between row-top draw-order-info">
<view class="pictrue"> <view class="pictrue">
@@ -244,7 +282,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else> <view v-else-if="!(isCollectiveCenterMode && isBlindBoxGiftOrder(order))">
<view <view
v-for="(cart,cartInfoIndex) in order.cartInfo" v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex" :key="cartInfoIndex"
@@ -300,8 +338,8 @@
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span> <span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
</view> </view>
<view class="v12-font-24 v12-dark1-text"> <view class="v12-font-24 v12-dark1-text">
{{ order.totalNum || 0 }}件商品 {{ getOrderTotalNum(order) }}件商品
<text v-if="order.isGiftCardReceiveBlind === 0"> <text v-if="order.isGiftCardReceiveBlind === 0 && shouldShowOrderTotalAmount(order)">
<text class="v12-dark-text v12-font-28 v12-font-bold"> <text class="v12-dark-text v12-font-28 v12-font-bold">
总金额 总金额
</text> </text>
@@ -309,7 +347,7 @@
</text> </text>
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold"> <text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">
{{ force2Decimal(order.payPrice) }} {{ force2Decimal(getOrderPayPrice(order)) }}
</text> </text>
</text> </text>
</view> </view>
@@ -351,7 +389,45 @@
v-if="!order.isGiftCardSend && !order.experienceOrderInfo" v-if="!order.isGiftCardSend && !order.experienceOrderInfo"
class="bottom flex jc-between ai-center" class="bottom flex jc-between ai-center"
> >
<template v-if="isCollectiveCenterMode">
<view class="v12-justify-between" style="width: 100%">
<view>
<view
v-if="showCollectiveContact(order)"
class="bnt service"
@click="goRoom(orderListIndex)"
>联系商家</view>
</view>
<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)"
>查看详情</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)"
>删除订单</view>
</view>
</view>
</template>
<template v-else>
<view <view
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0" v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
class="group-btn" class="group-btn"
@@ -405,9 +481,9 @@
>删除订单</view> >删除订单</view>
</view> </view>
</view> </view>
</template> </template>
<view class="flex"> </template>
<view v-if="!isCollectiveCenterMode" class="flex">
<template v-if="parseInt(order._status._type) === 0"> <template v-if="parseInt(order._status._type) === 0">
<view <view
class="bnt cancelBnt v12-dark-text v12-dark-border" class="bnt cancelBnt v12-dark-text v12-dark-border"
@@ -667,6 +743,7 @@ export default {
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus], mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
data() { data() {
return { return {
collectiveOrderType: 'wholesaler',
giftItem: {}, giftItem: {},
isShowPayPwdPop: false, isShowPayPwdPop: false,
inputStyle: { inputStyle: {
@@ -693,14 +770,15 @@ export default {
{ name: '全部' }, { name: '全部' },
{ name: '待付款' }, { name: '待付款' },
{ name: '待发货' }, { name: '待发货' },
{ name: '待收货' }, { name: '待收货/待核销' },
{ name: '退款/售后' }, { name: '退款/售后' },
{ name: '待评价' }, { name: '待评价' },
{ name: '已完成' } { name: '已完成' }
], ],
orderTypeTabList: [ orderTypeTabList: [
{ name: '购物', orderType: 'shop' }, { name: '购物', orderType: 'shop' },
{ name: '旅居', orderType: 'travel' } { name: '旅居', orderType: 'travel' },
{ name: '集采中心', orderType: 'wholesaler' }
], ],
orderTypeTabIndex: 0, orderTypeTabIndex: 0,
orderType: 'shop', orderType: 'shop',
@@ -726,7 +804,8 @@ export default {
dateRange: [], dateRange: [],
userLatitude: null, userLatitude: null,
userLongitude: null, userLongitude: null,
orderListRequestId: 0 orderListRequestId: 0,
savedScrollTop: 0
} }
}, },
components: { components: {
@@ -735,7 +814,15 @@ export default {
passkeyborad, passkeyborad,
DateRangePicker DateRangePicker
}, },
computed: mapGetters(["userInfo"]), computed: {
...mapGetters(["userInfo"]),
isCollectiveCenterMode() {
return this.orderType === this.collectiveOrderType
},
searchPlaceholder() {
return this.isCollectiveCenterMode ? '请输入商品名称/订单号' : '请输入商品名/订单号/团购名称'
}
},
onShow() { onShow() {
const _this = this const _this = this
const needRefreshOrderList = uni.getStorageSync('needRefreshMyOrderList') const needRefreshOrderList = uni.getStorageSync('needRefreshMyOrderList')
@@ -776,17 +863,20 @@ export default {
}) })
} else if (needRefreshOrderList) { } else if (needRefreshOrderList) {
uni.removeStorageSync('needRefreshMyOrderList') uni.removeStorageSync('needRefreshMyOrderList')
this.changeType() this.getOrderData()
this.refreshOrderListKeepPosition()
} }
}, },
onLoad() { onLoad() {
this.type = this.type || parseInt(this.$yroute.query.type) || 0 const query = this.getPageQuery()
this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0 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.initUserLocation()
this.orderTypeTabChange({ this.orderTypeTabChange({
...this.orderTypeTabList[this.orderTypeTabIndex], ...currentOrderTypeTab,
index: this.orderTypeTabIndex index: this.orderTypeTabList[this.orderTypeTabIndex] ? this.orderTypeTabIndex : 0
}) }, { resetFilters: false })
}, },
onShareAppMessage() { onShareAppMessage() {
uni.updateShareMenu({ uni.updateShareMenu({
@@ -800,6 +890,298 @@ export default {
} }
}, },
methods: { methods: {
getPageQuery() {
return (this.$yroute && this.$yroute.query) || {}
},
resetFilterConditions({ resetType = false } = {}) {
this.keyword = ''
if (resetType) {
this.type = 0
}
},
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 ||
productInfo.storeName ||
productInfo.cateName ||
item.cateName,
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) { isRefundFlow(order) {
if (!order) { if (!order) {
return false return false
@@ -1016,6 +1398,13 @@ export default {
} }
return orderOrIndex return orderOrIndex
}, },
handleOrderStoreClick(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order || this.isCollectiveCenterMode) {
return
}
this.goStore(order)
},
delOrder(orderOrIndex) { delOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex) const order = this.getOrderByIndex(orderOrIndex)
if (!order) { if (!order) {
@@ -1026,7 +1415,11 @@ export default {
return return
} }
delOrderHandle(order.orderId).then(() => { delOrderHandle(order.orderId).then(() => {
this.changeType() this.getOrderData()
const index = this.orderList.indexOf(order)
if (index > -1) {
this.orderList.splice(index, 1)
}
}) })
}, },
goStore(orderOrIndex) { goStore(orderOrIndex) {
@@ -1409,44 +1802,50 @@ export default {
} }
result.push({ result.push({
...item, ...item,
showMore: false showMore: false,
// 盲盒订单确认收货后需展示真实商品,后端字段未随状态更新,按订单状态兜底修正
isGiftCardReceiveBlind: this.resolveBlindBoxDisplayFlag(item)
}) })
return result return result
}, []) }, [])
}, },
// 盲盒订单在确认收货后(待评价 3 / 已完成 4)应展示真实商品信息;
// 后端 isGiftCardReceiveBlind 未随收货状态更新,这里依据订单状态兜底修正
resolveBlindBoxDisplayFlag(order) {
const raw = order && order.isGiftCardReceiveBlind
if (Number(raw) !== 1) {
return raw
}
const statusType = Number(order && order._status && order._status._type)
if (statusType === 3 || statusType === 4) {
return 0
}
return 1
},
tabChange(item) { tabChange(item) {
this.type = item.index this.type = item.index
this.$yroute.query.type = this.type const query = this.getPageQuery()
query.type = this.type
this.changeType() this.changeType()
}, },
orderTypeTabChange(item) { orderTypeTabChange(item, options = {}) {
const { resetFilters = true } = options
this.orderTypeTabIndex = item.index this.orderTypeTabIndex = item.index
this.orderType = item.orderType this.orderType = item.orderType
const query = this.getPageQuery()
query.tabIndex = this.orderTypeTabIndex
this.updateTabListByOrderType() this.updateTabListByOrderType()
if (resetFilters) {
this.type = 0
this.resetFilterConditions()
} else if (this.type > this.tabList.length - 1) {
this.type = 0
}
query.type = this.type
this.changeType(this.type) this.changeType(this.type)
}, },
updateTabListByOrderType() { updateTabListByOrderType() {
if (this.orderType === 'travel') { this.tabList = this.getDefaultTabListByOrderType()
this.tabList = [
{ name: '全部' },
{ name: '待付款' },
{ name: '待确认' },
{ name: '待使用' },
{ name: '退款/售后' },
{ name: '待评价' },
{ name: '已完成' }
]
} else {
this.tabList = [
{ name: '全部' },
{ name: '待付款' },
{ name: '待发货' },
{ name: '待收货/待核销' },
{ name: '退款/售后' },
{ name: '待评价' },
{ name: '已完成' }
]
}
}, },
goUserCenter() { goUserCenter() {
this.$yrouter.switchTab({ this.$yrouter.switchTab({
@@ -1468,23 +1867,15 @@ export default {
uni.showLoading({ uni.showLoading({
mask: true, mask: true,
}) })
const types = { const typeMap = this.getRequestTypeMapByOrderType()
0: 0, const type = typeMap[this.type]
1: 1,
2: 2,
3: 3,
4: -3,
5: 4,
6: 5,
}
const type = types[this.type]
const { const {
page, page,
limit, limit,
keyword, keyword,
orderType orderType
} = this } = this
getOrderList({ return getOrderList({
page, page,
limit, limit,
type, type,
@@ -1507,6 +1898,24 @@ export default {
uni.hideLoading() uni.hideLoading()
}); });
}, },
// 保持当前主/子tab及滚动位置刷新列表(从订单详情页返回后同步删除等状态变更)
refreshOrderListKeepPosition() {
this.orderListRequestId += 1
this.page = 1
this.loaded = false
this.loading = false
const restoreScrollTop = this.savedScrollTop
this.getOrderListReq().then(() => {
if (restoreScrollTop > 0) {
this.$nextTick(() => {
uni.pageScrollTo({
scrollTop: restoreScrollTop,
duration: 0
})
})
}
})
},
tapShowMore(index) { tapShowMore(index) {
const order = this.getOrderByIndex(index) const order = this.getOrderByIndex(index)
if (!order) { if (!order) {
@@ -1617,6 +2026,9 @@ export default {
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getOrderListReq() !this.loading && this.getOrderListReq()
},
onPageScroll(e) {
this.savedScrollTop = e.scrollTop
} }
}; };
</script> </script>
@@ -1799,6 +2211,10 @@ page {
.my-order .list .item .item-info .attr-wrap { .my-order .list .item .item-info .attr-wrap {
margin: 10rpx 0 0 0; margin: 10rpx 0 0 0;
} }
.my-order .list .item .item-info .gift-value-row {
margin-top: 12rpx;
line-height: 36rpx;
}
.my-order .list .item .item-info .text .name { .my-order .list .item .item-info .text .name {
width: calc(100% - 120rpx); width: calc(100% - 120rpx);
} }
+4 -4
View File
@@ -900,14 +900,14 @@ export default {
handleLoginFailure() handleLoginFailure()
return return
} }
console.log(this.storeInfo); console.log(this.attr);
const params = { const params = {
goodsId: this.id, goodsId: this.id,
goodsName: this.attr.productSelect.store_name, goodsName: this.attr.productSelect.store_name,
skuStr: this.attrValue, skuStr: this.attrValue,
price: this.attr.productSelect.price, price: this.attr.productSelect.price,
seckillId: this.activityId, seckillId: this.activityId,
cover: this.attr.productSelect.image, cover: this.attr.productSelect.image || this.storeInfo.image,
goodsData: '', goodsData: '',
seckillData: '', seckillData: '',
isNegotiable: this.storeInfo.isNegotiable isNegotiable: this.storeInfo.isNegotiable
@@ -1276,7 +1276,7 @@ export default {
'store_name', 'store_name',
this.storeInfo.storeName this.storeInfo.storeName
) )
this.$set(this.attr.productSelect, 'image', productSelect.image) this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
this.$set(this.attr.productSelect, 'price', productSelect.price) this.$set(this.attr.productSelect, 'price', productSelect.price)
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice) this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
this.$set(this.attr.productSelect, 'stock', productSelect.stock) this.$set(this.attr.productSelect, 'stock', productSelect.stock)
@@ -1403,7 +1403,7 @@ export default {
subItem.check = true subItem.check = true
} }
}) })
this.$set(this.attr.productSelect, 'image', productSelect.image) this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image)
this.$set(this.attr.productSelect, 'price', productSelect.price) this.$set(this.attr.productSelect, 'price', productSelect.price)
this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice) this.$set(this.attr.productSelect, 'otPrice', productSelect.otPrice)
this.$set(this.attr.productSelect, 'stock', productSelect.stock) this.$set(this.attr.productSelect, 'stock', productSelect.stock)
+1 -76
View File
@@ -219,7 +219,6 @@ import CitySelect from "@/components/CitySelect";
import tmUpload from '@/components/tm-upload/tm-upload.vue'; import tmUpload from '@/components/tm-upload/tm-upload.vue';
import {getCity} from "@/api/user"; import {getCity} from "@/api/user";
import {chooseImage, isWeixin} from "@/utils"; import {chooseImage, isWeixin} from "@/utils";
import {getHomeData} from "@/api/public";
import {VUE_APP_API_URL} from "@/config" import {VUE_APP_API_URL} from "@/config"
import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js"; import {getHotelTypeList, postHotelApply, postHotelReApply} from "@/api/inn.js";
@@ -440,81 +439,7 @@ export default {
} }
}); });
}, },
getIndex(value, arr) { submit() {
var idx = -1;
for (var i = 0; i < arr.length; i++) {
if (arr[i].n == value) {
idx = i;
break;
}
}
return idx;
},
getCityList: function () {
let that = this;
getCity()
.then(res => {
that.district = res.data;
// that.ready = true;
// if(this.id){
// //设置city_id
// var pIdx = that.getIndex(that.address.province,that.district);
// if(pIdx>-1){
// var citys = that.district[pIdx].c;
// var cIdx = that.getIndex(that.address.city,citys);
// if(cIdx>-1){
// var city = citys[cIdx];
// that.address.city_id = city.v;
// console.log('city_id:'+city.v);
// }
// }
// }
})
.catch(err => {
that.$dialog.error(err.msg);
});
},
chooseQrcodeImg: function () {
chooseImage(img => {
console.log(img)
that.$set(that.innApplyInfo, 'qrcode', img);
});
},
chooseLogoImg: function () {
chooseImage(img => {
console.log(img)
that.innApplyInfo.logo = img;
});
},
chooseCoverImg: function () {
chooseImage(img => {
console.log(img)
that.innApplyInfo.cover = img;
});
},
//文件上传结果
uploadedImgChange: function (uploadedFilesList) {
this.uploadedFilesArray = uploadedFilesList;
},
submit: function () {
if (this.innApplyInfo.name.length == 0) {
this.$dialog.error("请输入店铺名称");
return;
}
if (this.innApplyInfo.type.length == 0) {
this.$dialog.error("请选择店铺类型");
return;
}
if (this.addressText.length == 0) { if (this.addressText.length == 0) {
this.$dialog.error("请选择店铺所在省市区"); this.$dialog.error("请选择店铺所在省市区");
return; return;
+148 -32
View File
@@ -93,7 +93,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="orderInfo.deliveryId !== null && ([-1, -2, 3, 4].includes(orderInfo._status._type) || (orderInfo._status._type == 2 && orderInfo.isTickets !== 1))"> <view v-if="orderInfo.deliveryId !== null && ([-1, -2, -3, 3, 4].includes(orderInfo._status._type) || (orderInfo._status._type == 2 && orderInfo.isTickets !== 1))">
<view <view
v-for="(delivery, index) in orderInfo.deliveryInfo" v-for="(delivery, index) in orderInfo.deliveryInfo"
:key="index" :key="index"
@@ -203,31 +203,31 @@
<view style="margin-top: 30rpx;border-radius:20rpx;overflow: hidden;" class="v12-white"> <view style="margin-top: 30rpx;border-radius:20rpx;overflow: hidden;" class="v12-white">
<!-- <OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []" title="商品信息"></OrderGoods> --> <!-- <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="v12-justify-between" v-if="!isBlindBoxOrder(orderInfo)">
<view class=""> <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>
<view class="v12-justify-between v12-flex-column v12-ml-2" style="flex: 2"> <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"> <view class="v12-font-28 v12-dark-text v12-font-bold more-t">
{{ cart.productInfo.storeName }} {{ cart.name }}
</view> </view>
<view v-if="cart.productInfo.attrInfo && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24"> <view v-if="cart.sku && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ cart.productInfo.attrInfo.sku || '' }} {{ cart.sku }}
</view> </view>
<view v-if="orderInfo.isDrawOrder === 1" class="more-t v12-secondary-dark-text v12-font-24"> <view v-if="orderInfo.isDrawOrder === 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ orderInfo.drawOrderInfo.prizeAttrName || '' }} {{ orderInfo.drawOrderInfo.prizeAttrName || '' }}
</view> </view>
</view> </view>
<view class="v12-justify-between v12-flex-column v12-dark-text v12-text-right"> <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 class="v12-font-22">
</text> </text>
<text class="v12-font-28">{{ cart.truePrice }}</text> <text class="v12-font-28">{{ force2Decimal(cart.price) }}</text>
</view> </view>
<view class="v12-font-22"> <view class="v12-font-22">
<text>x{{ cart.cartNum }}</text> <text>x{{ cart.qty }}</text>
</view> </view>
</view> </view>
</view> </view>
@@ -244,10 +244,22 @@
</view> </view>
</view> </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 v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-if="isCustomGiftOrder(orderInfo)">
<view class="v12-font-24 v12-dark-text" v-if="orderInfo.customGiftInfo.isShowValue">
{{ '礼品价值' }}
</view>
<view class="v12-text-right" v-if="orderInfo.customGiftInfo.isShowValue">
<text class="v12-font-22"></text>
<text class="v12-font-28" v-if="orderInfo.customGiftInfo && orderInfo.customGiftInfo.isShowValue">
{{ force2Decimal(orderInfo.customGiftInfo.giftValue) }}
</text>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-else>
<view class="v12-font-24 v12-dark-text"> <view class="v12-font-24 v12-dark-text">
商品总价 {{ '商品总价' }}
</view> </view>
<view class="v12-text-right"> <view class="v12-text-right">
<text class="v12-font-22"></text> <text class="v12-font-22"></text>
@@ -256,6 +268,7 @@
</text> </text>
</view> </view>
</view> </view>
</view>
<view class="v12-justify-between v12-align-center v12-mt-3" v-if="orderInfo.payPostage > 0"> <view class="v12-justify-between v12-align-center v12-mt-3" v-if="orderInfo.payPostage > 0">
<view class="v12-font-24 v12-dark-text"> <view class="v12-font-24 v12-dark-text">
运费 运费
@@ -354,11 +367,11 @@
<view class="flex-0">订单类型</view> <view class="flex-0">订单类型</view>
<view class="v12-text-right">{{ orderTypeName }}</view> <view class="v12-text-right">{{ orderTypeName }}</view>
</view> </view>
<view v-if="orderInfo.isDrawOrder !== 1" class="item acea-row row-between v12-font-24 v12-dark-text "> <view v-if="orderInfo.isDrawOrder !== 1 && !isCustomGiftOrder(orderInfo)" class="item acea-row row-between v12-font-24 v12-dark-text ">
<view class="flex-0">支付状态</view> <view class="flex-0">支付状态</view>
<view class="v12-text-right">{{ orderInfo.paid ? "已支付" : "未支付" }}</view> <view class="v12-text-right">{{ orderInfo.paid ? "已支付" : "未支付" }}</view>
</view> </view>
<view v-if="orderInfo.isDrawOrder !== 1" class="item acea-row row-between v12-font-24 v12-dark-text "> <view v-if="orderInfo.isDrawOrder !== 1 && !isCustomGiftOrder(orderInfo)" class="item acea-row row-between v12-font-24 v12-dark-text ">
<view class="flex-0">支付方式</view> <view class="flex-0">支付方式</view>
<view class="v12-text-right">{{ orderInfo._status._payType }}</view> <view class="v12-text-right">{{ orderInfo._status._payType }}</view>
</view> </view>
@@ -500,7 +513,14 @@
</view> </view>
</template> </template>
<template v-if="status.type == 1" > <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 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.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> <view v-if="orderInfo.isGiftCardReceiveBlind === 0 && orderInfo.isDrawOrder === 0" class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
@@ -515,7 +535,10 @@
</view> </view>
</template> </template>
<template v-if="status.type == 2"> <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 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="" v-else></view>
<view class="v12-justify-between"> <view class="v12-justify-between">
@@ -548,8 +571,12 @@
<view class="btn flex jc-center ai-center v12-font-24" @click="goGoodsReturn(orderInfo)">申请退款</view> <view class="btn flex jc-center ai-center v12-font-24" @click="goGoodsReturn(orderInfo)">申请退款</view>
</view> </view>
</view> </view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view v-if="!isCollectiveOrder(orderInfo)" 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>
</view> </view>
</template> </template>
@@ -562,7 +589,7 @@
<template v-if="status.type == -2"> <template v-if="status.type == -2">
<view class="v12-justify-between " style="width: 100%"> <view class="v12-justify-between " style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view> <view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
</view> </view>
</template> </template>
<template v-if="status.type == -3"> <template v-if="status.type == -3">
@@ -570,9 +597,9 @@
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view> <view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="v12-justify-between "> <view class="v12-justify-between ">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view <view
v-if="!isGiftOrder(orderInfo)" v-if="canShowOrderEvaluate(orderInfo)"
class="bnt v12-primary-text v12-primary-border" class="bnt v12-primary-text v12-primary-border"
@click="routerGo(orderInfo.cartInfo[0])" @click="routerGo(orderInfo.cartInfo[0])"
>立即评价</view> >立即评价</view>
@@ -850,9 +877,12 @@ export default {
} }
}) })
}, },
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder) { goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
if(isGiftCardReceiveBlind) return if(isGiftCardReceiveBlind) return
if(isDrawOrder) return if(isDrawOrder) return
// 采购批发订单(集采中心)商品卡片不跳转批发商品详情页
if (Number(scenarioCode) === 22) return
if (Number(scenarioCode) === 24) return
const activityId = Number( const activityId = Number(
item.drawActivityId || item.drawActivityId ||
(item.productInfo && item.productInfo.drawActivityId) || (item.productInfo && item.productInfo.drawActivityId) ||
@@ -1029,6 +1059,83 @@ export default {
} }
return status; 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
},
isBlindBoxOrder(order = this.orderInfo) {
return Number(order && order.isGiftCardReceiveBlind) === 1
},
isCollectiveOrder(order = this.orderInfo) {
return this.isWholesalerOrder(order) || this.isCustomGiftOrder(order)
},
canShowOrderEvaluate(order = this.orderInfo) {
// 仅排除送礼方订单(送礼人未收货不可评价);收礼方订单确认收货后可评价,与订单列表【去评价】逻辑保持一致
return Number(order.isGiftCardSend || 0) !== 1 && !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 : []
// 盲盒订单隐藏商品信息,固定展示一个盲盒礼包行(cartInfo 为空时也要展示)
if (this.isBlindBoxOrder(order)) {
return [this.normalizeOrderDetailItem(cartList[0] || {})]
}
return cartList.map(item => this.normalizeOrderDetailItem(item))
},
getStatusImg(order) { getStatusImg(order) {
const type = parseInt(order._status._type); const type = parseInt(order._status._type);
let imgUrl = ""; let imgUrl = "";
@@ -1061,9 +1168,6 @@ export default {
} }
return imgUrl; return imgUrl;
}, },
isGiftOrder(order = {}) {
return Number(order.isGiftCardSend || 0) === 1 || Number(order.isGiftCardReceive || 0) === 1
},
subscribePay() { subscribePay() {
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: settings.SubscribeMessageTmplIds, tmplIds: settings.SubscribeMessageTmplIds,
@@ -1154,16 +1258,17 @@ export default {
}); });
}, },
goBack() { goBack() {
if (this.name === "MyOrder") { // 从订单列表进入时直接返回原页面,保留列表页主/子tab及滚动位置
const pages = getCurrentPages()
const prevPage = pages && pages[pages.length - 2]
const prevRoute = prevPage && prevPage.route
if (prevRoute && prevRoute.indexOf('order/MyOrder') > -1) {
this.$yrouter.back(); this.$yrouter.back();
return; return;
} else { }
console.log(this);
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/MyOrder/index" path: "/pages/order/MyOrder/index"
}); });
return;
}
}, },
cancelOrder() { cancelOrder() {
cancelOrderHandle(this.orderInfo.orderId) cancelOrderHandle(this.orderInfo.orderId)
@@ -1279,8 +1384,19 @@ export default {
orderDetail(id).then(res => { orderDetail(id).then(res => {
this.orderInfo = res.data this.orderInfo = res.data
this.orderInfo._status._type = parseInt(this.orderInfo._status._type) this.orderInfo._status._type = parseInt(this.orderInfo._status._type)
// 盲盒订单确认收货后(待评价 3 / 已完成 4)展示真实商品信息,
// 后端 isGiftCardReceiveBlind 未随收货状态更新,按订单状态兜底修正
if (Number(this.orderInfo.isGiftCardReceiveBlind) === 1 && [3, 4].includes(this.orderInfo._status._type)) {
this.orderInfo.isGiftCardReceiveBlind = 0
}
this.getOrderStatus() 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.orderTypeName = "拼团订单"
this.orderTypeNameStatus = false this.orderTypeNameStatus = false
} else if (this.orderInfo.bargainId > 0) { } else if (this.orderInfo.bargainId > 0) {
+8 -2
View File
@@ -11,7 +11,7 @@
<view class="name one-t">{{ item.username }}</view> <view class="name one-t">{{ item.username }}</view>
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text> <text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
<view class="msg" v-if="item.msg_type===1"> <view class="msg" v-if="item.msg_type===1">
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image> <image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
</view> </view>
</view> </view>
@@ -22,7 +22,7 @@
<view class="name one-t">{{ item.username }}</view> <view class="name one-t">{{ item.username }}</view>
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text> <text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
<view class="msg" v-if="item.msg_type===1"> <view class="msg" v-if="item.msg_type===1">
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image> <image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
</view> </view>
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)"> <view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)">
<view class="goods-logo"> <view class="goods-logo">
@@ -179,6 +179,12 @@ export default {
wsJson(json) { wsJson(json) {
return JSON.parse(json) return JSON.parse(json)
}, },
// 拼接图片完整地址:七牛上传后消息里只存 key,需要补上资源域名;http 统一转 https
imgUrl(content) {
if (!content) return ''
if (/^https?:\/\//i.test(content)) return content.replace(/^http:\/\//i, 'https://')
return this.webUrl + '/' + content
},
getUploadToken() { getUploadToken() {
let that = this; let that = this;
+47 -7
View File
@@ -396,7 +396,7 @@
/> />
</view> </view>
</view> </view>
<view v-if="form.isDraft === 0 && form.reviewStatus !== 1"> <view v-if="form.reviewStatus !== 1">
<view <view
class="v12-primary v12-white-text submit-btn" class="v12-primary v12-white-text submit-btn"
:style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}" :style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}"
@@ -405,19 +405,19 @@
{{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }} {{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }}
</view> </view>
</view> </view>
<view v-if="form.reviewStatus === null || (form.isDraft === 1 && form.reviewStatus === 0)"> <!-- <view v-if="form.reviewStatus === null || (form.isDraft === 1 && form.reviewStatus === 0)">
<view <view
class="v12-primary v12-white-text submit-btn" class="v12-primary v12-white-text submit-btn"
@click="submitForm" @click="submitForm"
> >
提交审核 提交审核
</view> </view>
</view> </view> -->
<u-popup <u-popup
:show="show" :show="show"
mode="center" mode="center"
round="10" round="10"
@close="show=false" @close="handlePopupClose"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold"> <view class="tc bold">
@@ -440,7 +440,6 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="savePopup" @click="savePopup"
/> />
</view> </view>
@@ -451,7 +450,7 @@
<script> <script>
import CitySelect from '@/components/CitySelect' import CitySelect from '@/components/CitySelect'
import { getCity, registerVerify } from '@/api/user' import { getCity, registerVerify } from '@/api/user'
import { uploadVideo, uploadImage } from '@/utils' import { uploadVideo, uploadImage, formatRichText } from '@/utils'
import { import {
getShopData, getShopData,
saveExperienceStore, saveExperienceStore,
@@ -521,9 +520,10 @@ export default {
onLoad(opts) { onLoad(opts) {
this.partnerId = opts.partnerId || '' this.partnerId = opts.partnerId || ''
this.promoterUid = opts.promoterUid || '' this.promoterUid = opts.promoterUid || ''
uni.showLoading({ title: '加载中...', mask: true })
this.queryCity() this.queryCity()
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => {
this.notice = data.merchantApplyNotice this.notice = formatRichText(data.merchantApplyNotice)
}) })
getExperienceStoreCategoryList().then(({ data }) => { getExperienceStoreCategoryList().then(({ data }) => {
this.experienceStoreCategoryList = data || [] this.experienceStoreCategoryList = data || []
@@ -531,6 +531,8 @@ export default {
this.experienceStoreCategoryIndex = 0 this.experienceStoreCategoryIndex = 0
} }
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
onUnload() { onUnload() {
@@ -577,12 +579,31 @@ export default {
}).catch(() => { }).catch(() => {
this.form.isDraft = 1 this.form.isDraft = 1
this.show = true this.show = true
}).finally(() => {
uni.hideLoading()
}) })
}, },
changeAgree(e) { changeAgree(e) {
this.isAgree = e.detail.value.includes('yes') this.isAgree = e.detail.value.includes('yes')
}, },
savePopup() { savePopup() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false
},
handlePopupClose() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false this.show = false
}, },
stringToMapArr(str, split = ',') { stringToMapArr(str, split = ',') {
@@ -865,6 +886,25 @@ export default {
height: 52vh; height: 52vh;
overflow-y: auto; overflow-y: auto;
margin: 30rpx 0; margin: 30rpx 0;
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
::v-deep rich-text {
display: block;
width: 100%;
p, div, ul, ol {
display: block;
margin: 0 0 16rpx;
&:last-child {
margin-bottom: 0;
}
}
li {
margin: 0 0 8rpx;
}
}
} }
.popup-body .agree-box { .popup-body .agree-box {
margin: 60rpx 0; margin: 60rpx 0;
+5 -2
View File
@@ -26,12 +26,12 @@
mode="widthFix" mode="widthFix"
@click="goto('shop')" @click="goto('shop')"
/> />
<!-- <image <image
:src="images.wholesalerImage" :src="images.wholesalerImage"
class="img-item" class="img-item"
mode="widthFix" mode="widthFix"
@click="goto('wholesaler')" @click="goto('wholesaler')"
/> --> />
<image <image
:src="images.travelImage" :src="images.travelImage"
class="img-item" class="img-item"
@@ -74,6 +74,9 @@ export default {
this.partnerId = options.partnerId || '' this.partnerId = options.partnerId || ''
this.promoterUid = options.promoterUid || '' this.promoterUid = options.promoterUid || ''
getImages().then(({data}) => this.images = data) getImages().then(({data}) => this.images = data)
},
onShow() {
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.partnerType = data.partnerType this.partnerType = data.partnerType
this.hotelId = data.hotelId this.hotelId = data.hotelId
+100 -41
View File
@@ -77,11 +77,19 @@
v-if="!form.cover" v-if="!form.cover"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="form.cover" :src="form.cover"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('cover')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -102,14 +110,23 @@
v-if="!form.coverVideo" v-if="!form.coverVideo"
class="btn-upload" class="btn-upload"
>上传视频</view> >上传视频</view>
<view v-else class="img-wrap">
<video <video
v-else
:src="form.coverVideo" :src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'" :poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false" :controls="false"
play-btn-position="center" play-btn-position="center"
class="video-item" class="video-item"
/> />
<view
v-if="!reviewing"
style="position: absolute; top: 0; right: 0;"
class="delete-badge"
@click.stop="deleteVideo"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -143,11 +160,19 @@
v-if="!form.logo" v-if="!form.logo"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="form.logo" :src="form.logo"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('logo')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -415,7 +440,7 @@
:show="show" :show="show"
mode="center" mode="center"
round="10" round="10"
@close="show=false" @close="handlePopupClose"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
@@ -433,7 +458,6 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="handleAgree" @click="handleAgree"
/> />
</view> </view>
@@ -450,6 +474,7 @@ import {
getShopInfo, getShopInfo,
removeApply, removeApply,
saveShop, saveShop,
saveHotelDraft,
getHotelInfo, getHotelInfo,
getCountyFamousHotelType getCountyFamousHotelType
} from '@/api/join' } from '@/api/join'
@@ -461,7 +486,8 @@ import {
chooseImage, chooseImage,
moreImage, moreImage,
uploadImage, uploadImage,
chooseVideoToUpload chooseVideoToUpload,
formatRichText
} from '@/utils' } from '@/utils'
export default { export default {
@@ -606,45 +632,33 @@ export default {
onLoad(options) { onLoad(options) {
this.partnerId = options.partnerId || '' this.partnerId = options.partnerId || ''
this.promoterUid = options.promoterUid || '' this.promoterUid = options.promoterUid || ''
const local_form = uni.getStorageSync('merchantApplyHotel' + '_form') || {}
this.quaPics = uni.getStorageSync('merchantApplyHotel' + '_quaPics') || []
if(!local_form.serviceTime) {
local_form.serviceTime = '00:00'
}
if(!local_form.serviceEndTime) {
local_form.serviceEndTime = '23:59'
}
this.form = !this.reviewing ? local_form : {
name: '',
cover: '',
coverVideo: '',
coverType: 1, // coverType: 1-图片,2-视频
logo: '',
qualification: '',
type: 0,
typeText: '',
isCountyFamous: 0,
countyFamousHotelType: null,
phone: '',
captcha: '',
area: '',
address: '',
position: '',
content: '',
serviceTime: '00:00',
serviceEndTime: '23:59'
}
this.init() this.init()
}, },
onUnload() { onUnload() {
uni.setStorageSync('merchantApplyHotel'+'_quaPics', this.quaPics) this.saveDraft()
uni.setStorageSync('merchantApplyHotel' + '_form', this.form)
}, },
onReady() { onReady() {
this.$refs.shopForm.setRules(this.rules) this.$refs.shopForm.setRules(this.rules)
}, },
methods: { methods: {
handleAgree(){ handleAgree(){
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false
},
handlePopupClose() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false this.show = false
}, },
timeRange(e) { timeRange(e) {
@@ -693,13 +707,14 @@ export default {
} }
}, },
init() { init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => { getCity().then(({data}) => {
this.district = data this.district = data
}) })
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.hotelTypeList = data.hotelTypeList || [] this.hotelTypeList = data.hotelTypeList || []
this.columnsType = this.hotelTypeList this.columnsType = this.hotelTypeList
this.notice = data.merchantApplyNotice this.notice = formatRichText(data.merchantApplyNotice)
getCountyFamousHotelType({ getCountyFamousHotelType({
page: 1, page: 1,
limit: 9999 limit: 9999
@@ -712,6 +727,8 @@ export default {
}).catch(() => { }).catch(() => {
this.initInfo() this.initInfo()
}) })
}).catch(() => {
uni.hideLoading()
}) })
}, },
@@ -787,6 +804,8 @@ export default {
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6) this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}` this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
} }
}).finally(() => {
uni.hideLoading()
}) })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
@@ -795,6 +814,15 @@ export default {
this.form[target] = img this.form[target] = img
}) })
}, },
// 删除单张图片(店铺图片封面 / 店铺logo)
deleteImg(target) {
if (this.reviewing) return
if (target === 'cover') {
this.form.cover = ''
} else if (target === 'logo') {
this.form.logo = ''
}
},
chooseLogoVideo() { chooseLogoVideo() {
if (this.reviewing) return if (this.reviewing) return
chooseVideoToUpload(path => { chooseVideoToUpload(path => {
@@ -802,6 +830,12 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}) })
}, },
// 删除视频封面
deleteVideo() {
if (this.reviewing) return
this.form.coverVideo = ''
this.$forceUpdate()
},
chooseShopImg() { chooseShopImg() {
if (this.reviewing) return if (this.reviewing) return
const _this = this const _this = this
@@ -938,17 +972,16 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
setTimeout(() => { this.reviewing = false
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
save() { buildPostData() {
this.form.pics = '' this.form.pics = ''
const picsLength = this.pics.length const picsLength = this.pics.length
if (picsLength > 0) { if (picsLength > 0) {
@@ -971,6 +1004,10 @@ export default {
if (postData.coverType === 2) { if (postData.coverType === 2) {
postData.cover = postData.coverVideo postData.cover = postData.coverVideo
} }
return postData
},
save() {
const postData = this.buildPostData()
saveShop(postData, this.partnerId, this.promoterUid).then(res => { saveShop(postData, this.partnerId, this.promoterUid).then(res => {
if (res.status === 200) { if (res.status === 200) {
uni.showToast({ uni.showToast({
@@ -991,6 +1028,11 @@ export default {
} }
}) })
}) })
},
saveDraft() {
if (this.reviewing) return
const postData = this.buildPostData()
saveHotelDraft(postData, this.partnerId, this.promoterUid)
} }
} }
} }
@@ -1020,6 +1062,23 @@ export default {
.font-color-red { .font-color-red {
font-size: 22rpx; font-size: 22rpx;
} }
.img-wrap {
position: relative;
display: inline-block;
.delete-badge {
position: absolute;
top: 0;
right: 20rpx;
background: #000;
color: #fff;
padding: 2rpx 8rpx;
border-radius: 0 0 0 200rpx;
font-size: 22rpx;
z-index: 10;
text-align: center;
}
}
.video-item { .video-item {
width: 80px; width: 80px;
height: 80px; height: 80px;
+148 -84
View File
@@ -59,11 +59,19 @@
v-if="!formSupplier.avatar" v-if="!formSupplier.avatar"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="formSupplier.avatar" :src="formSupplier.avatar"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('supplier')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -271,11 +279,19 @@
v-if="!form.cover" v-if="!form.cover"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="form.cover" :src="form.cover"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('cover')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -293,14 +309,23 @@
v-if="!form.coverVideo" v-if="!form.coverVideo"
class="btn-upload" class="btn-upload"
>上传视频</view> >上传视频</view>
<view v-else class="img-wrap">
<video <video
v-else
:src="form.coverVideo" :src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'" :poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false" :controls="false"
play-btn-position="center" play-btn-position="center"
class="video-item" class="video-item"
/> />
<view
v-if="!reviewing"
style="position: absolute; top: 0; right: 0;"
class="delete-badge"
@click.stop="deleteVideo"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -339,11 +364,19 @@
v-if="!form.logo" v-if="!form.logo"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="form.logo" :src="form.logo"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('logo')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -513,7 +546,7 @@
@cancel="changeRemove(false)" @cancel="changeRemove(false)"
@confirm="onRemove" @confirm="onRemove"
/> />
<u-popup :show="show" mode="center" round="10" @close="show=false"> <u-popup :show="show" mode="center" round="10" @close="handlePopupClose">
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
<view class="content"> <view class="content">
@@ -530,7 +563,6 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="handlAgree" @click="handlAgree"
/> />
</view> </view>
@@ -546,14 +578,16 @@ import {
getShopInfo, getShopInfo,
removeApply, removeApply,
saveSupplier, saveSupplier,
saveWenwanSupplier saveWenwanSupplier,
saveSupplierDraft
} from '@/api/join' } from '@/api/join'
import {getCity, registerVerify} from '@/api/user' import {getCity, registerVerify} from '@/api/user'
import { import {
chooseImage, chooseImage,
moreImage, moreImage,
uploadImage, uploadImage,
chooseVideoToUpload chooseVideoToUpload,
formatRichText
} from '@/utils' } from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins' import { pageListenMixins } from '@/mixins/pageListenMixins'
@@ -681,7 +715,8 @@ export default {
// 是否为审核中 // 是否为审核中
reviewing: false, reviewing: false,
pageKeyId: '', pageKeyId: '',
showUpload: false showUpload: false,
pageType: ''
} }
}, },
computed: { computed: {
@@ -766,49 +801,8 @@ export default {
this.partnerId = options.partnerId || '' this.partnerId = options.partnerId || ''
this.promoterUid = options.promoterUid || '' this.promoterUid = options.promoterUid || ''
const type = options.type const type = options.type
const local = uni.getStorageSync(type) || {} this.pageType = type
const local_form = uni.getStorageSync(type + '_form') || {}
this.quaPics = uni.getStorageSync(type + '_quaPics') || []
console.log(this.quaPics, 'this.quaPics');
if(!local_form.serviceTime) {
local_form.serviceTime = '00:00'
}
if(!local_form.serviceEndTime) {
local_form.serviceEndTime = '23:59'
}
this.form = !this.reviewing && local_form || {
name: '',
cover: '',
coverVideo: '',
// coverType: 1-图片,2-视频
coverType: 1,
logo: '',
type: 0,
typeText: '',
phone: '',
area: '',
address: '',
position: '',
content: '',
serviceTime: '00:00',
serviceEndTime: '23:59'
}
this.formSupplier = !this.reviewing && local || {
name: '',
businessLicense: '',
avatar: '',
contact: '',
phone: '',
captcha: '',
qualification: '',
subType: '',
area: '',
address: '',
position: ''
}
this.formSupplier.subType = type this.formSupplier.subType = type
if (type === 'goods_supplier') { if (type === 'goods_supplier') {
this.infoTitle = '特产' this.infoTitle = '特产'
this.pageKeyId = 'merchantApplyGoodsSupplier' this.pageKeyId = 'merchantApplyGoodsSupplier'
@@ -822,9 +816,7 @@ export default {
this.init() this.init()
}, },
onUnload() { onUnload() {
uni.setStorageSync(this.formSupplier.subType, this.formSupplier) this.saveDraft()
uni.setStorageSync(this.formSupplier.subType+'_quaPics', this.quaPics)
uni.setStorageSync(this.formSupplier.subType + '_form', this.form)
}, },
onReady() { onReady() {
this.$refs.shopForm.setRules(this.rules) this.$refs.shopForm.setRules(this.rules)
@@ -832,6 +824,23 @@ export default {
}, },
methods: { methods: {
handlAgree() { handlAgree() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false
},
handlePopupClose() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false this.show = false
}, },
timeRange(e) { timeRange(e) {
@@ -880,19 +889,26 @@ export default {
} }
}, },
init() { init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => { getCity().then(({data}) => {
this.district = data this.district = data
}) })
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.columnsType = data.hotelTypeList this.columnsType = data.hotelTypeList
this.columnsSupplierType = data.supplierTypeList this.columnsSupplierType = data.supplierTypeList
this.notice = data.merchantApplyNotice this.notice = formatRichText(data.merchantApplyNotice)
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
initInfo() { initInfo() {
// 是否缺少参数区分文玩和特产? // 是否缺少参数区分文玩和特产?
getShopInfo().then((res) => { // 2026-08-25 BUG 5882 确实需要区分参数
const params = {
subType: this.pageType
}
getShopInfo(params).then((res) => {
this.showUpload = true this.showUpload = true
const {data} = res const {data} = res
// console.log(res, 'initInfo--------'); // console.log(res, 'initInfo--------');
@@ -926,7 +942,7 @@ export default {
// 店铺图片 // 店铺图片
this.pics = [] this.pics = []
this.form = data.hotelInfo this.form = data.hotelInfo
const picsTemp = this.form.pics.split(',') const picsTemp = (this.form.pics || '').split(',')
if (picsTemp.length > 0) { if (picsTemp.length > 0) {
picsTemp.map(item => { picsTemp.map(item => {
if (item) { if (item) {
@@ -934,39 +950,43 @@ export default {
} }
}) })
} }
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
this.form.typeText = this.indexType > -1 ? this.columnsType[this.indexType].name : ''
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName || ''} ${this.form.cityName || ''} ${this.form.areaName || ''}`
if (data.hotelInfo.coverType === 2) {
this.form.coverVideo = data.hotelInfo.cover
this.form.cover = ''
}
}
if (data.supplierInfo) {
// 仅在已提交且申请类型明确不匹配时跳过,草稿状态下正常回显
if (data.isDraft !== 1 && data.applyType != null) {
if (this.infoTitle === "特产" && data.applyType !== 1) return
if (this.infoTitle === "文玩" && data.applyType !== 3) return
}
this.formSupplier = data.supplierInfo
// 后端草稿可能未回传 subType,用当前页面类型补齐
if (!this.formSupplier.subType) {
this.formSupplier.subType = this.pageType
}
// 商家资质 // 商家资质
const quaPicsTemp = this.form.qualification && this.form.qualification.split(',') || []
if (quaPicsTemp.length > 0) {
console.log(quaPicsTemp, 'quaPicsTemp--------');
this.quaPics = [] this.quaPics = []
const quaPicsTemp = (this.formSupplier.qualification || '').split(',')
if (quaPicsTemp.length > 0) {
quaPicsTemp.map(item => { quaPicsTemp.map(item => {
if (item) { if (item) {
this.quaPics.push({url: item}) this.quaPics.push({url: item})
} }
}) })
} }
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
this.form.typeText = this.columnsType[this.indexType].name
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName || ''} ${this.form.cityName || ''} ${this.form.areaName || ''}`
console.log(this.form, 'form--------');
if (data.hotelInfo.coverType === 2) {
this.form.coverVideo = data.hotelInfo.cover
this.form.cover = ''
}
}
// console.log(data.supplierInfo, 'supplierInfo--------');
if (data.supplierInfo) {
if (this.infoTitle === "特产" && data.applyType !== 1) return
if (this.infoTitle === "文玩" && data.applyType !== 3) return
this.formSupplier = data.supplierInfo
this.formSupplier.typeText = this.columnsSupplierType[this.indexSupplierType].value
this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6)
this.formSupplier.area = `${this.formSupplier.provinceName || ''} ${this.formSupplier.cityName || ''} ${this.formSupplier.areaName || ''}` || ''
this.indexSupplierType = this.columnsSupplierType.findIndex(item => item.key === this.formSupplier.subType) this.indexSupplierType = this.columnsSupplierType.findIndex(item => item.key === this.formSupplier.subType)
console.log(this.formSupplier); this.formSupplier.typeText = this.indexSupplierType > -1 ? this.columnsSupplierType[this.indexSupplierType].value : ''
this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6)
this.formSupplier.area = `${this.formSupplier.provinceName || ''} ${this.formSupplier.cityName || ''} ${this.formSupplier.areaName || ''}`
} }
}).finally(() => {
uni.hideLoading()
}) })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
@@ -988,6 +1008,17 @@ export default {
} }
}) })
}, },
// 删除单张图片(供应商头像 / 店铺封面图 / 店铺logo)
deleteImg(target) {
if (this.reviewing) return
if (target === 'supplier') {
this.formSupplier.avatar = ''
} else if (target === 'cover') {
this.form.cover = ''
} else if (target === 'logo') {
this.form.logo = ''
}
},
chooseLogoVideo() { chooseLogoVideo() {
if (this.reviewing) return if (this.reviewing) return
chooseVideoToUpload(path => { chooseVideoToUpload(path => {
@@ -995,6 +1026,12 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}) })
}, },
// 删除视频封面
deleteVideo() {
if (this.reviewing) return
this.form.coverVideo = ''
this.$forceUpdate()
},
chooseShopImg() { chooseShopImg() {
if (this.reviewing) return if (this.reviewing) return
const _this = this const _this = this
@@ -1129,17 +1166,16 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
setTimeout(() => { this.reviewing = false
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
save() { buildPostData() {
this.form.pics = '' this.form.pics = ''
const picsLength = this.pics.length const picsLength = this.pics.length
if (picsLength > 0) { if (picsLength > 0) {
@@ -1162,6 +1198,10 @@ export default {
if (postData.coverType === 2) { if (postData.coverType === 2) {
postData.cover = postData.coverVideo postData.cover = postData.coverVideo
} }
return postData
},
save() {
const postData = this.buildPostData()
if (this.infoTitle === '特产') { if (this.infoTitle === '特产') {
saveSupplier(postData, this.formSupplier, this.partnerId, this.promoterUid).then(res => { saveSupplier(postData, this.formSupplier, this.partnerId, this.promoterUid).then(res => {
if (res.status === 200) { if (res.status === 200) {
@@ -1205,6 +1245,13 @@ export default {
}) })
}) })
} }
},
saveDraft() {
if (this.reviewing) return
// 确保按当前入驻类型(特产/文玩)区分保存,避免共用同一份草稿
this.formSupplier.subType = this.pageType
const postData = this.buildPostData()
saveSupplierDraft(postData, this.formSupplier, this.partnerId, this.promoterUid)
} }
} }
} }
@@ -1244,6 +1291,23 @@ export default {
.font-color-red { .font-color-red {
font-size: 22rpx; font-size: 22rpx;
} }
.img-wrap {
position: relative;
display: inline-block;
.delete-badge {
position: absolute;
top: 0;
right: 20rpx;
background: #000;
color: #fff;
padding: 2rpx 8rpx;
border-radius: 0 0 0 200rpx;
font-size: 22rpx;
z-index: 10;
text-align: center;
}
}
.captcha-wrap { .captcha-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
+45 -4
View File
@@ -344,7 +344,7 @@
{{ '提交审核' }} {{ '提交审核' }}
</view> </view>
</view> </view>
<u-popup :show="show" mode="center" round="10" @close="show=false" <u-popup :show="show" mode="center" round="10" @close="handlePopupClose"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
@@ -362,7 +362,6 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="save" @click="save"
/> />
</view> </view>
@@ -376,7 +375,8 @@ import {getCity, registerVerify} from '@/api/user'
import { import {
chooseImage, chooseImage,
uploadVideo, uploadVideo,
uploadImage uploadImage,
formatRichText
} from '@/utils' } from '@/utils'
import { import {
getShopData, getShopData,
@@ -469,10 +469,13 @@ export default {
onLoad(opts) { onLoad(opts) {
this.partnerId = opts.partnerId || '' this.partnerId = opts.partnerId || ''
this.promoterUid = opts.promoterUid || '' this.promoterUid = opts.promoterUid || ''
uni.showLoading({ title: '加载中...', mask: true })
this.queryCity() this.queryCity()
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.notice = data.merchantApplyNotice this.notice = formatRichText(data.merchantApplyNotice)
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
// onShow() { // onShow() {
@@ -492,6 +495,23 @@ export default {
this.isAgree = e.detail.value.includes('yes') this.isAgree = e.detail.value.includes('yes')
}, },
save() { save() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false
},
handlePopupClose() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false this.show = false
}, },
/** /**
@@ -554,6 +574,8 @@ export default {
} }
}).catch(err => { }).catch(err => {
// uni.$u.toast(err.msg) // uni.$u.toast(err.msg)
}).finally(() => {
uni.hideLoading()
}) })
}, },
/** /**
@@ -860,6 +882,25 @@ export default {
height: 52vh; height: 52vh;
overflow-y: auto; overflow-y: auto;
margin: 30rpx 0; margin: 30rpx 0;
// 小程序rich-text内块级标签无默认段间距,补充与后台富文本编辑器一致的段落格式
::v-deep rich-text {
display: block;
width: 100%;
p, div, ul, ol {
display: block;
margin: 0 0 16rpx;
&:last-child {
margin-bottom: 0;
}
}
li {
margin: 0 0 8rpx;
}
}
} }
.popup-body .agree-box { .popup-body .agree-box {
margin: 60rpx 0; margin: 60rpx 0;
+153 -53
View File
@@ -6,8 +6,7 @@
labelWidth="216rpx" labelWidth="216rpx"
> >
<view <view
v-if="stateTitle && isDraft!==1 && applyType === 4" v-if="stateTitle"
class="box-state"
> >
<u-alert <u-alert
:center="stateType === 'primary'" :center="stateType === 'primary'"
@@ -17,11 +16,11 @@
</view> </view>
<u-cell-group <u-cell-group
:border="false" :border="false"
:customStyle="{'fontSize':'40rpx'}" :customStyle="{'fontSize':'40rpx', 'backgroundColor':'#fff'}"
title="采购批发商基本信息" title="礼品集采中心基本信息"
> >
<u-form-item prop="name"> <u-form-item prop="name">
<u-cell title="批发商名称" :border="false"> <u-cell title="中心名称" :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
</template> </template>
@@ -30,7 +29,22 @@
v-model="form.name" v-model="form.name"
:disabled="reviewing" :disabled="reviewing"
border="none" border="none"
placeholder="请填写批发商名称" placeholder="请填写礼品集采中心名称"
/>
</template>
</u-cell>
</u-form-item>
<u-form-item prop="businessLicense">
<u-cell title="营业执照名称" :border="false">
<template #icon>
<text class="required">*</text>
</template>
<template #value>
<u-input
v-model="form.businessLicense"
:disabled="reviewing"
border="none"
placeholder="请填写营业执照名称"
/> />
</template> </template>
</u-cell> </u-cell>
@@ -44,11 +58,19 @@
v-if="!form.avatar" v-if="!form.avatar"
class="btn-upload" class="btn-upload"
>上传图片</view> >上传图片</view>
<view v-else class="img-wrap">
<image <image
v-else
:src="form.avatar" :src="form.avatar"
class="img-preview" class="img-preview"
/> />
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('avatar')"
>
x
</view>
</view>
</view> </view>
</template> </template>
</u-cell> </u-cell>
@@ -100,7 +122,7 @@
placeholder="请填写验证码" placeholder="请填写验证码"
/> />
</view> </view>
<view class="captcha-wrap-ft"> <view class="captcha-wrap-ft" v-if="!reviewing">
<u-code <u-code
ref="uCode" ref="uCode"
seconds="30" seconds="30"
@@ -119,7 +141,7 @@
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="qualification"> <u-form-item prop="qualification">
<view class="licence-section"> <view class="full-title">
<u-cell :border="false"> <u-cell :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
@@ -132,22 +154,16 @@
<view class="licence-image"> <view class="licence-image">
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<view class="box-upload" @click="chooseLogoImg('licence')"> <u-upload
<view :maxCount="9"
v-if="!form.qualification" :fileList="quaPics"
class="btn-upload" :disabled="reviewing"
>上传图片</view> :deletable="!reviewing"
<view v-else> name="quaPics"
<view v-if="qualificationArr.length > 0" class="flex"> multiple
<image @afterRead="quaAfterRead"
v-for="(item, index) in qualificationArr" @delete="quaDeletePic"
:key="index"
:src="item"
class="img-preview"
/> />
</view>
</view>
</view>
</template> </template>
</u-cell> </u-cell>
</view> </view>
@@ -194,7 +210,7 @@
撤销申请 撤销申请
</view> </view>
<view <view
v-else v-else-if="reviewStatus !== 1"
class="btn-submit" class="btn-submit"
@click="onSubmit" @click="onSubmit"
> >
@@ -207,7 +223,7 @@
@cancel="changeRemove(false)" @cancel="changeRemove(false)"
@confirm="onRemove" @confirm="onRemove"
/> />
<u-popup :show="show" mode="center" round="10" @close="show=false"> <u-popup :show="show" mode="center" round="10" @close="handlePopupClose">
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
<view class="content"> <view class="content">
@@ -224,7 +240,6 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="save" @click="save"
/> />
</view> </view>
@@ -234,9 +249,9 @@
<script> <script>
import CitySelect from '@/components/CitySelect' import CitySelect from '@/components/CitySelect'
import {getShopData, getWholesaler, removeApply, saveWholesaler} from '@/api/join' import {getShopData, getWholesaler, removeApply, saveWholesaler, saveWholesalerDraft} from '@/api/join'
import {getCity, registerVerify} from '@/api/user' import {getCity, registerVerify} from '@/api/user'
import {chooseImage} from '@/utils' import {chooseImage, uploadImage, formatRichText} from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins' import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
@@ -250,6 +265,7 @@ export default {
tips: '获取验证码', tips: '获取验证码',
form: { form: {
name: '', name: '',
businessLicense: '',
avatar: '', avatar: '',
contact: '', contact: '',
phone: '', phone: '',
@@ -310,7 +326,7 @@ export default {
}, },
district: [], district: [],
address: {}, address: {},
qualificationArr: [], quaPics: [],
isAgree: false, isAgree: false,
show: false, show: false,
notice: '', notice: '',
@@ -332,6 +348,9 @@ export default {
this.promoterUid = options.promoterUid || '' this.promoterUid = options.promoterUid || ''
this.init() this.init()
}, },
onUnload() {
this.saveDraft()
},
onReady() { onReady() {
this.$refs.wholesalerForm.setRules(this.rules) this.$refs.wholesalerForm.setRules(this.rules)
}, },
@@ -374,25 +393,27 @@ export default {
} }
}, },
init() { init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => { getCity().then(({data}) => {
this.district = data this.district = data
}) })
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => { getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.notice = data.merchantApplyNotice this.notice = formatRichText(data.merchantApplyNotice)
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
initInfo() { initInfo() {
getWholesaler().then(({data}) => { getWholesaler().then(({data}) => {
this.applyType = data.applyType this.applyType = data.applyType
if (data.applyType === 4) {
this.isDraft = data.isDraft this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus this.reviewStatus = data.reviewStatus
}
if(data.isDraft === null || data.isDraft === 1) { if(data.isDraft === null || data.isDraft === 1) {
this.show = true this.show = true
} }
if (data.isDraft !== 1) { console.log(data.reviewStatus);
switch (data.reviewStatus) { switch (data.reviewStatus) {
case 0: case 0:
this.stateTitle = '审核中' this.stateTitle = '审核中'
@@ -400,6 +421,8 @@ export default {
this.reviewing = true this.reviewing = true
break; break;
case 1: case 1:
this.stateTitle = '审核通过'
this.stateType = 'success'
this.reviewing = false this.reviewing = false
break; break;
case 2: case 2:
@@ -408,31 +431,52 @@ export default {
this.reviewing = false this.reviewing = false
break; break;
} }
}
if (data.wholesalerInfo) { if (data.wholesalerInfo) {
this.form = data.wholesalerInfo this.form = data.wholesalerInfo
this.quaPics = []
if (this.form.qualification) { if (this.form.qualification) {
this.qualificationArr = this.form.qualification.split(',') this.form.qualification.split(',').map(item => {
if (item) {
this.quaPics.push({url: item})
}
})
} }
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6) this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}` this.form.area = [this.form.provinceName, this.form.cityName, this.form.areaName].filter(Boolean).join(' ')
} }
}).finally(() => {
uni.hideLoading()
}) })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
if (this.reviewing) return if (this.reviewing) return
chooseImage(img => { chooseImage(img => {
switch (target) { if (target === 'avatar') {
case 'avatar':
this.form.avatar = img this.form.avatar = img
break
case 'licence':
this.form.qualification = img
this.qualificationArr = [img]
break
} }
}) })
}, },
// 删除头像
deleteImg(target) {
if (target === 'avatar') {
this.form.avatar = ''
}
},
// 删除商家资质图片
quaDeletePic(event) {
this[`${event.name}`].splice(event.index, 1)
},
// 商家资质批量上传
quaAfterRead(event) {
const that = this
if (event.file.length > 0) {
event.file.map(item => {
uploadImage(item.url, img => {
that.quaPics.push({url: img})
})
})
}
},
// 省市区 // 省市区
result(values) { result(values) {
this.address = { this.address = {
@@ -449,7 +493,7 @@ export default {
this.form.areaId = values.district.id this.form.areaId = values.district.id
}, },
onSubmit() { onSubmit() {
this.buildQualification()
this.$refs.wholesalerForm.validate().then(res => { this.$refs.wholesalerForm.validate().then(res => {
// 校验通过 // 校验通过
saveWholesaler(this.form).then(res => { saveWholesaler(this.form).then(res => {
@@ -485,11 +529,10 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
setTimeout(() => { this.reviewing = false
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
@@ -497,7 +540,37 @@ export default {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
save() { save() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false this.show = false
},
handlePopupClose() {
if (!this.isAgree) {
uni.showToast({
title: '请先阅读并同意入驻申请须知',
icon: 'none'
})
return
}
this.show = false
},
saveDraft() {
if (this.reviewing) return
this.buildQualification()
saveWholesalerDraft(this.form)
},
buildQualification() {
this.form.qualification = ''
const tempArr = []
this.quaPics.map(item => {
item.url && tempArr.push(item.url)
})
this.form.qualification = tempArr.join(',')
} }
} }
} }
@@ -505,6 +578,18 @@ export default {
<style lang="less"> <style lang="less">
@import "@/assets/css/pkg_join.less"; @import "@/assets/css/pkg_join.less";
/deep/ .u-cell__title-text {
white-space: nowrap !important;
}
/deep/ .full-title {
.u-cell__title {
width: 100% !important;
white-space: nowrap !important;
}
}
</style>
<style lang="less" scoped>
/deep/ .cityselect-nav { /deep/ .cityselect-nav {
.item { .item {
@@ -518,14 +603,26 @@ export default {
} }
} }
/deep/ .licence-section{
.u-cell__title{
width: 650rpx!important;
}
}
.font-color-red{ .font-color-red{
font-size: 24rpx; font-size: 24rpx;
} }
.img-wrap {
position: relative;
display: inline-block;
.delete-badge {
position: absolute;
top: 0;
right: 20rpx;
background: #000;
color: #fff;
padding: 2rpx 8rpx;
border-radius: 0 0 0 200rpx;
font-size: 22rpx;
z-index: 10;
text-align: center;
}
}
.captcha-wrap { .captcha-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -533,4 +630,7 @@ export default {
flex: 1; flex: 1;
} }
} }
.btn-submit{
position: sticky !important;
}
</style> </style>
+11
View File
@@ -24,6 +24,7 @@
:src="countyFamousTopImage" :src="countyFamousTopImage"
class="img" class="img"
mode="widthFix" mode="widthFix"
:lazy-load="true"
/> />
<view v-if="list.length > 0" class="province-wrap" id="province-wrap"> <view v-if="list.length > 0" class="province-wrap" id="province-wrap">
<view <view
@@ -39,6 +40,7 @@
<image <image
:src="item.icon" :src="item.icon"
class="img" class="img"
:lazy-load="true"
/> />
<view class="name one-t"> <view class="name one-t">
{{ item.provinceName }} {{ item.provinceName }}
@@ -61,6 +63,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-06.png'" :src="webUrl + '/page/qianxian/icon-06.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -95,11 +98,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -118,11 +123,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -140,11 +147,13 @@
<image <image
:src="county.logo" :src="county.logo"
class="county-img" class="county-img"
:lazy-load="true"
/> />
<view class="county-name"> <view class="county-name">
<image <image
:src="webUrl + '/home/icon-location.png'" :src="webUrl + '/home/icon-location.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="county-txt one-t"> <view class="county-txt one-t">
{{ county.countyName }} {{ county.countyName }}
@@ -160,6 +169,7 @@
:src="webUrl + '/home/no-data-bg.png'" :src="webUrl + '/home/no-data-bg.png'"
mode="widthFix" mode="widthFix"
class="loadend" class="loadend"
:lazy-load="true"
/> />
</view> </view>
<image <image
@@ -167,6 +177,7 @@
:src="webUrl + '/orderIcon/nodata.png'" :src="webUrl + '/orderIcon/nodata.png'"
class="img-nodata v12-mt-16" class="img-nodata v12-mt-16"
mode="scaleToFill" mode="scaleToFill"
:lazy-load="true"
/> />
</view> </view>
<goo-skeleton <goo-skeleton
@@ -218,10 +218,10 @@ export default {
margin-top: 20rpx; margin-top: 20rpx;
padding: 20rpx 0rpx; padding: 20rpx 0rpx;
border-radius: 16rpx; border-radius: 16rpx;
font-size: 30rpx; font-size: 36rpx;
line-height: 44rpx; line-height: 44rpx;
color: #333; color: #333;
font-weight: bold; // font-weight: bold;
} }
.detail-card { .detail-card {
@@ -241,7 +241,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 16rpx; margin-top: 16rpx;
font-size: 30rpx; font-size: 36rpx;
line-height: 40rpx; line-height: 40rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
+13 -1
View File
@@ -224,7 +224,7 @@
@click.stop="handleInfoHotelClick(item)" @click.stop="handleInfoHotelClick(item)"
> >
<view class="info-shop-logo"> <view class="info-shop-logo">
<image :src="item.linkHotelLogo" mode="aspectFill" /> <image :src="item.linkHotelLogo" mode="aspectFill" :lazy-load="true" />
</view> </view>
<view class="info-shop-main"> <view class="info-shop-main">
<view class="info-shop-name"> <view class="info-shop-name">
@@ -245,6 +245,7 @@
<image <image
:src="webUrl + '/20230803152147141807.png'" :src="webUrl + '/20230803152147141807.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<text class="seeNum-txt">{{ $formatCount(item.pv) }}</text> <text class="seeNum-txt">{{ $formatCount(item.pv) }}</text>
</view> </view>
@@ -253,12 +254,14 @@
v-if="!item.hasZan" v-if="!item.hasZan"
:src="webUrl + '/page/hotel/zan-off-2.png'" :src="webUrl + '/page/hotel/zan-off-2.png'"
class="zan-off-icon" class="zan-off-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan + 1, true)" @click="likeInfoItemHandle(item, index, item.zan + 1, true)"
/> />
<image <image
v-else v-else
:src="webUrl + '/page/hotel/zan-on-2.png'" :src="webUrl + '/page/hotel/zan-on-2.png'"
class="zan-on-icon" class="zan-on-icon"
:lazy-load="true"
@click="likeInfoItemHandle(item, index, item.zan - 1, false)" @click="likeInfoItemHandle(item, index, item.zan - 1, false)"
/> />
<text <text
@@ -390,6 +393,7 @@
<image <image
:src="item" :src="item"
class="img" class="img"
:lazy-load="true"
@click="showPic(index)" @click="showPic(index)"
/> />
</view> </view>
@@ -413,6 +417,7 @@
:src="item.image" :src="item.image"
mode="widthFix" mode="widthFix"
class="img" class="img"
:lazy-load="true"
/> />
<view class="info-wrap"> <view class="info-wrap">
<view class="time"> <view class="time">
@@ -470,6 +475,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-02.png'" :src="webUrl + '/page/qianxian/icon-02.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
重点项目 重点项目
</view> </view>
@@ -486,6 +492,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-05.png'" :src="webUrl + '/page/qianxian/icon-05.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -503,6 +510,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-02.png'" :src="webUrl + '/page/qianxian/icon-02.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
招商政策 招商政策
</view> </view>
@@ -525,6 +533,7 @@
<image <image
:src="webUrl + '/page/qianxian/icon-05.png'" :src="webUrl + '/page/qianxian/icon-05.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
</view> </view>
</view> </view>
@@ -605,11 +614,13 @@
<image <image
:src="shop.cover + (shop.coverType === 2 ? '?vframe/jpg/offset/1' : '')" :src="shop.cover + (shop.coverType === 2 ? '?vframe/jpg/offset/1' : '')"
class="img" class="img"
:lazy-load="true"
/> />
<view class="location"> <view class="location">
<image <image
:src="webUrl + '/page/qianxian/icon-08.png'" :src="webUrl + '/page/qianxian/icon-08.png'"
class="icon" class="icon"
:lazy-load="true"
/> />
<view class="addr one-t"> <view class="addr one-t">
{{ shop.address }} {{ shop.address }}
@@ -624,6 +635,7 @@
<image <image
:src="shop.logo" :src="shop.logo"
class="logo" class="logo"
:lazy-load="true"
/> />
<view class="name one-t"> <view class="name one-t">
{{ shop.name }} {{ shop.name }}
+83 -22
View File
@@ -7,16 +7,16 @@
<view class="v12-font-28 v12-font-bold">退款金额</view> <view class="v12-font-28 v12-font-bold">退款金额</view>
<view class="return-method">退回原支付方</view> <view class="return-method">退回原支付方</view>
</view> </view>
<view class="v12-font-32 v12-primary-text v12-font-bold">¥{{refundAmount}}</view> <view class="v12-font-32 v12-primary-text v12-font-bold">¥{{ displayRefundAmount }}</view>
</view> </view>
<u-divider></u-divider> <u-divider></u-divider>
<view class="order-amount"> <view class="order-amount">
<text class="v12-font-28 v12-font-bold">订单支付金额</text> <text class="v12-font-28 v12-font-bold">订单支付金额</text>
<text class="v12-font-32 v12-font-bold">¥{{orderAmount}}</text> <text class="v12-font-32 v12-font-bold">¥{{ displayOrderAmount }}</text>
</view> </view>
<view class="deduction-amount v12-mt-2"> <view class="deduction-amount v12-mt-2">
<text class="v12-font-24 v12-primary-text">退款违约金</text> <text class="v12-font-24 v12-primary-text">退款违约金</text>
<text class="v12-primary-text">¥{{deductionAmount}}</text> <text class="v12-primary-text">¥{{ displayDeductionAmount }}</text>
</view> </view>
</view> </view>
@@ -49,19 +49,26 @@
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="v12-mt-3"> <view class="v12-mt-3">
<button class="submit-btn v12-primary v12-white-text v12-radius-100 v12-font-32" block @click="submitRefund">点击确认退款</button> <button
class="submit-btn v12-primary v12-white-text v12-radius-100 v12-font-32"
:class="{ 'submit-btn-disabled': isSubmitDisabled }"
:disabled="isSubmitDisabled"
block
@click="submitRefund"
>点击确认退款</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js' import { fetchSojoumOrderDetail, sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js'
export default { export default {
data() { data() {
return { return {
refundAmount: '', refundAmount: '',
orderAmount: '', orderAmount: '',
deductionAmount: '', deductionAmount: '',
refundStatus: 0,
refundReasons: [ refundReasons: [
'行程变更', '行程变更',
'定错时间/地址', '定错时间/地址',
@@ -72,7 +79,22 @@ export default {
], ],
selectedReason: '', selectedReason: '',
otherReason: '', otherReason: '',
key: '' key: '',
submitting: false
}
},
computed: {
displayRefundAmount() {
return this.formatMoney(this.refundAmount)
},
displayOrderAmount() {
return this.formatMoney(this.orderAmount)
},
displayDeductionAmount() {
return this.formatMoney(this.deductionAmount)
},
isSubmitDisabled() {
return this.submitting || Number(this.refundStatus) === 3
} }
}, },
onLoad(opts) { onLoad(opts) {
@@ -80,21 +102,63 @@ export default {
this.getRefundInfo(opts.id) this.getRefundInfo(opts.id)
}, },
methods: { methods: {
getRefundInfo(id) { async getRefundInfo(id) {
try {
const [refundRes, orderRes] = await Promise.all([
sojoumOrderRefundInfo({ sojoumOrderRefundInfo({
orderId: id orderId: id
}).then(res => { }),
if (res.status === 200) { fetchSojoumOrderDetail({
this.refundAmount = res.data.refundPrice key: id
this.orderAmount = res.data.payPrice
this.deductionAmount = res.data.penalty
}
}) })
])
const refundData = refundRes && refundRes.status === 200 ? (refundRes.data || {}) : {}
const orderData = orderRes && orderRes.status === 200 ? (orderRes.data || {}) : {}
const orderAmount = this.pickFirstValidValue(refundData.payPrice, orderData.payPrice, 0)
const deductionAmount = this.pickFirstValidValue(refundData.penalty, orderData.penalty, 0)
this.refundAmount = this.resolveRefundAmount(refundData.refundPrice, orderAmount, deductionAmount)
this.orderAmount = orderAmount
this.deductionAmount = deductionAmount
this.refundStatus = Number(this.pickFirstValidValue(orderData.refundStatus, refundData.refundStatus, 0))
} catch (e) {
}
}, },
selectReason(reason) { selectReason(reason) {
if (this.isSubmitDisabled) {
return
}
this.selectedReason = reason this.selectedReason = reason
}, },
hasValidValue(value) {
return value !== '' && value !== null && value !== undefined
},
pickFirstValidValue(...values) {
for (let index = 0; index < values.length; index += 1) {
if (this.hasValidValue(values[index])) {
return values[index]
}
}
return ''
},
formatMoney(value) {
return this.$force2Decimal(Number(value || 0))
},
resolveRefundAmount(refundPrice, orderAmount, deductionAmount) {
if (this.hasValidValue(refundPrice)) {
return refundPrice
}
const orderPriceNumber = Number(orderAmount || 0)
const deductionNumber = Number(deductionAmount || 0)
return Math.max(orderPriceNumber - deductionNumber, 0)
},
submitRefund() { submitRefund() {
if (this.isSubmitDisabled) {
uni.showToast({
title: '退款申请已被驳回',
icon: 'none'
})
return
}
// TODO: 实现退款提交逻辑 // TODO: 实现退款提交逻辑
// orderId string 订单号 // orderId string 订单号
// refundReasonWap string 选择的退款原因 // refundReasonWap string 选择的退款原因
@@ -122,6 +186,7 @@ export default {
title: '加载中...', title: '加载中...',
mask: true, mask: true,
}) })
this.submitting = true
sojoumOrderRefund(refundData).then(res => { sojoumOrderRefund(refundData).then(res => {
if (res.status === 200) { if (res.status === 200) {
uni.showToast({ uni.showToast({
@@ -133,6 +198,7 @@ export default {
}) })
} }
}).finally(() => { }).finally(() => {
this.submitting = false
uni.hideLoading(); uni.hideLoading();
}) })
} }
@@ -229,15 +295,6 @@ export default {
} }
} }
.submit-section {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 30rpx;
background-color: #fff;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
.submit-btn { .submit-btn {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
@@ -250,6 +307,10 @@ export default {
letter-spacing: 4rpx; letter-spacing: 4rpx;
font-weight: 500; font-weight: 500;
} }
.submit-btn-disabled {
background-color: #c0c4cc !important;
color: #ffffff !important;
} }
} }
</style> </style>
+98 -11
View File
@@ -18,11 +18,16 @@
<view v-if="cateIndex === 0" class="list-body"> <view v-if="cateIndex === 0" class="list-body">
<block v-if="sendList.length > 0"> <block v-if="sendList.length > 0">
<view <view
v-for="(item, index) in sendList" v-for="(item, index) in sendList"
:key="index" :key="index"
class="gift-item" :class="['gift-item', item.badgeText ? 'has-badge' : '']"
> >
<view
v-if="item.badgeText"
:class="['gift-badge',['wholesalerCustom', 'wholesalerPurchase'].includes(item.sceneType) ? 'gift-badge-blue' : 'gift-badge-orange']"
>
{{ item.badgeText }}
</view>
<view <view
v-for="(cart, cartIndex) in item.giftInfo" v-for="(cart, cartIndex) in item.giftInfo"
:key="cartIndex" :key="cartIndex"
@@ -135,10 +140,16 @@
<view <view
v-for="(item, index) in receiveList" v-for="(item, index) in receiveList"
:key="index" :key="index"
class="gift-item" :class="['gift-item', item.badgeText ? 'has-badge' : '']"
> >
<view <view
v-for="(cart, cartIndex) in item.giftInfos" v-if="item.badgeText"
:class="['gift-badge', ['wholesalerCustom', 'wholesalerPurchase'].includes(item.sceneType) ? 'gift-badge-blue' : 'gift-badge-orange']"
>
{{ item.badgeText }}
</view>
<view
v-for="(cart, cartIndex) in item._renderGiftInfos"
:key="cartIndex" :key="cartIndex"
class="gift-body" class="gift-body"
@click="giftItemClickHanlde(item)" @click="giftItemClickHanlde(item)"
@@ -146,20 +157,20 @@
> >
<view class="gift-img"> <view class="gift-img">
<image <image
:src="cart.productInfo.image" :src="cart._displayImage"
class="img" class="img"
/> />
</view> </view>
<view class="gift-good-info"> <view class="gift-good-info">
<view class="name more-t"> <view class="name more-t">
{{ cart.productInfo.storeName }} {{ cart._displayName }}
</view> </view>
<view v-if="cart.productInfo.attrInfo" class="attr-txt"> <view v-if="cart._displaySku" class="attr-txt">
<view class="txt">{{ cart.productInfo.attrInfo.sku }}</view> <view class="txt">{{ cart._displaySku }}</view>
</view> </view>
<view class="price-wrap"> <view v-if="cart._showPrice" class="price-wrap">
<view class="price"> <view class="price">
<text class="prefix"></text>{{ cart.productInfo.attrInfo.price }} <text class="prefix"></text>{{ cart._displayPrice }}
</view> </view>
</view> </view>
</view> </view>
@@ -442,7 +453,8 @@ export default {
const { success, data } = res const { success, data } = res
if (success) { if (success) {
const { list, hasMore } = this.getListResult(data, page) const { list, hasMore } = this.getListResult(data, page)
this.receiveList = page === 1 ? list : this.receiveList.concat(list) const formatList = list.map(item => this.normalizeReceiveGiftItem(item))
this.receiveList = page === 1 ? formatList : this.receiveList.concat(formatList)
this.receiveHasMore = hasMore this.receiveHasMore = hasMore
this.receivePage = page + 1 this.receivePage = page + 1
this.receiveInited = true this.receiveInited = true
@@ -526,6 +538,51 @@ export default {
} }
return status return status
}, },
normalizeReceiveGiftItem(item = {}) {
return {
...item,
_renderGiftInfos: this.getReceiveGiftInfos(item)
}
},
getReceiveGiftInfos(item = {}) {
if (item.customGiftInfo && typeof item.customGiftInfo === 'object') {
const customGift = this.formatCustomGiftInfo(item.customGiftInfo)
if (customGift) {
return [customGift]
}
}
const giftInfos = Array.isArray(item.giftInfos) ? item.giftInfos : []
return giftInfos.map(gift => this.formatDefaultGiftInfo(gift))
},
formatCustomGiftInfo(customGiftInfo = {}) {
const giftImage = typeof customGiftInfo.giftImage === 'string'
? customGiftInfo.giftImage.trim()
: ''
const giftValue = customGiftInfo.giftValue
const hasGiftValue = giftValue !== '' && giftValue !== null && giftValue !== undefined
return {
...customGiftInfo,
_isCustomGift: true,
_displayImage: giftImage,
_displayName: customGiftInfo.giftName || '',
_displaySku: customGiftInfo.specName || '',
_displayPrice: hasGiftValue ? giftValue : '',
_showPrice: Number(customGiftInfo.isShowValue) === 1 && hasGiftValue
}
},
formatDefaultGiftInfo(gift = {}) {
const productInfo = gift.productInfo || {}
const attrInfo = productInfo.attrInfo || {}
const price = attrInfo.price
return {
...gift,
_displayImage: productInfo.image || '',
_displayName: productInfo.storeName || '',
_displaySku: attrInfo.sku || '',
_displayPrice: price,
_showPrice: price !== '' && price !== null && price !== undefined
}
},
showTips() { showTips() {
this.$refs.giftTips.showTips = true this.$refs.giftTips.showTips = true
}, },
@@ -596,10 +653,40 @@ export default {
z-index: 2; z-index: 2;
padding: 84rpx 0 80rpx 0; padding: 84rpx 0 80rpx 0;
.gift-item { .gift-item {
position: relative;
padding: 16rpx; padding: 16rpx;
margin: 0 0 24rpx; margin: 0 0 24rpx;
border-radius: 16rpx; border-radius: 16rpx;
background-color: #ffff; background-color: #ffff;
.gift-badge {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
height: 48rpx;
border-radius: 0rpx 16rpx 0rpx 24rpx;
font-size: 26rpx;
color: #fff;
padding: 0 12rpx;
line-height: 1;
}
.gift-badge-blue {
background: #28AAF4;
}
.gift-badge-orange {
background: #FF9644;
}
&.has-badge {
.gift-good-info {
.name {
padding-right: 160rpx;
}
}
}
.gift-body { .gift-body {
display: flex; display: flex;
align-items: center; align-items: center;
+9
View File
@@ -9,6 +9,15 @@ import stringify from "@/utils/querystring";
import {VUE_APP_API_URL} from "@/config"; import {VUE_APP_API_URL} from "@/config";
import {auth} from '@/libs/wechat' import {auth} from '@/libs/wechat'
// 富文本内容预处理:
// 纯文本内容(不含HTML标签)中的换行符\n在rich-text中会被折叠为空格,需转为<br/>以保留换行格式
export function formatRichText(content) {
if (!content) return ''
// 含HTML标签的富文本内容不做处理,避免破坏原有结构
if (/<[a-zA-Z][^>]*>/.test(content)) return content
return content.replace(/\r\n/g, '\n').replace(/\n/g, '<br/>')
}
export function dataFormat(time, option) { export function dataFormat(time, option) {
time = +time * 1000; time = +time * 1000;
const d = new Date(time); const d = new Date(time);