15 Commits
Author SHA1 Message Date
lifizer a4751dc9f6 Conf:增加Fix环境的配置
(cherry picked from commit 663d8f06fb)
2026-07-24 16:55:24 +08:00
linxi 6ab3d5cc75 Fix:5536 【商城小程序】订单详情点击商品图片区域之前是可以进入商品详情的,现在点击无法进入商品详情页
(cherry picked from commit 3cd6f29e32)
2026-07-24 11:37:47 +08:00
linxi 01c400bb7e Fix:5535 【商城小程序】全国特产、文玩艺术板块的省级导航页面搜索栏,在搜索有效名称时提示“未找到该城市,请重新输入城市名称”
(cherry picked from commit 51e9d8b966)
2026-07-24 11:37:40 +08:00
linxi cb8a4bb33c Fix: 订单列表所有按钮点击都没反应了
(cherry picked from commit 76a877f2c2)
2026-07-24 11:35:35 +08:00
linxi fb03ad9f4a Fix:5174 【商城小程序】游客身份直接点击页面底部【客服】按钮并发送文字后,页面显示空白,且未弹出登录引导提示
(cherry picked from commit 55ed80acbc)
2026-07-24 11:35:20 +08:00
linxi e7557e72a5 Fix:5176 【商城小程序】省级导航在搜索无效名称时无反馈
(cherry picked from commit 956d7bf70b)
2026-07-24 11:35:08 +08:00
linxi 6e1e6233fa Fix:5349 【商城小程序】顶部标题“特色礼品”修改为“全国礼品”
(cherry picked from commit 62e7776b64)
2026-07-24 11:35:02 +08:00
linxi ce94e5d739 Fix:5371 【商城小程序】甄选好礼对应分类下无商品不会提示
(cherry picked from commit 8f7ff49641)
2026-07-24 11:34:54 +08:00
linxi ca79a820fb Fix:5397 【商城小程序】商品链接,连续快速点击“送给朋友”,重复弹出多个送礼页面
(cherry picked from commit 6d963a5bc0)
2026-07-24 11:34:48 +08:00
linxi cb6abf4a5a Fix:5420 【商城小程序】抽奖活动已开奖后取消退款,在个人主页查看我的抽奖码,“失效原因:订单取消”改为“活动已结束,抽奖码无法恢复”
(cherry picked from commit b4c1ea20ac)
2026-07-24 11:34:41 +08:00
linxi f2aeab5c41 Fix:5451 【商城小程序】店铺查看资讯详情返回列表页时,列表自动滑动至顶部
(cherry picked from commit 47ac886d5d)
2026-07-24 11:34:31 +08:00
linxi 1fad8cae64 Fix:5452 【商城小程序】收礼方申请退款被商家拒绝后,礼包订单详情显示“立即评价”按钮
(cherry picked from commit f72a68ccc3)
2026-07-24 11:34:25 +08:00
linxi 2411ae369d Fix:5453 【商城小程序】苹果手机视频列表布局方向从右到左,应该从左到右排列,与安卓同步
(cherry picked from commit 73fa5e35d4)
2026-07-24 11:34:19 +08:00
linxi e6cf9c082c Fix:5454 【商城小程序】购买商品,微信支付下单后未支付,待付款列表显示两条相同订单记录
(cherry picked from commit ea44413ac1)
2026-07-24 11:34:13 +08:00
lifizer fcccf351bf Merge branch 'v23' into prod 2026-07-24 11:32:46 +08:00
42 changed files with 789 additions and 3104 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.uid}-${conversationId}`, url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${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.uid}-${conversationId}`, url: VUE_APP_API_URL.replace('https', 'wss') + settings.sysPrefix + `v1/chat/websocket/${_this.userInfo.unionId}-${conversationId}`,
header: { header: {
'content-type': 'application/json' 'content-type': 'application/json'
}, },
+3 -16
View File
@@ -184,12 +184,7 @@
<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 <input v-model="giftBudget" placeholder="例如100以内/300~500元" class="input-budget" placeholder-style="color: #ccc;" />
v-model="giftBudget"
:placeholder="item.guideContent || '例如100以内/300~500元'"
class="input-budget"
placeholder-style="color: #ccc;"
/>
</view> </view>
</view> </view>
</view> </view>
@@ -862,18 +857,10 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
min-height: calc(100vh - 240rpx); 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: visible; overflow-y: auto;
}
.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;
-24
View File
@@ -124,27 +124,3 @@ export function computedSojoumGroupBuyGiftOrderPrice(params) {
login: true login: true
}) })
} }
/**
* 文生图发起生成
* @param {*} data
* @returns
*/
export function aiGiftImageGenerate(data) {
return request.post("/aiGiftImage/generate", data, {
login: true
})
}
/**
* 文生图状态查询
* @param {*} params
* @returns
*/
export function aiGiftImageStatus(params) {
return request.get("/aiGiftImage/" + params.productId, {
login: true
})
}
+2 -32
View File
@@ -17,8 +17,8 @@ export function getShopData(params) {
// 查看商户申请 // 查看商户申请
// 1-特产供应商 2-店铺 3-文玩供应商 // 1-特产供应商 2-店铺 3-文玩供应商
export function getShopInfo(params) { export function getShopInfo() {
return request.get("/merchantApply/info", params, {login: true}) return request.get("/merchantApply/info", {}, {login: true})
} }
// 4-采购批发商 // 4-采购批发商
@@ -38,18 +38,6 @@ 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};
@@ -74,30 +62,12 @@ 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})
} }
-5
View File
@@ -60,11 +60,6 @@ export function getCountyFamousCityGuideContent(param) {
return request.get('/countyFamous/guide/content', param, { login: true }) return request.get('/countyFamous/guide/content', param, { login: true })
} }
// 获取千县名品县城图文攻略详情
export function getCountyFamousGraphicGuideContent(param) {
return request.get('/countyFamous/guide/graphic/content', param, { login: true })
}
// 获取千县名品县城重点产业列表 // 获取千县名品县城重点产业列表
export function getCountyFamousIndustry(param) { export function getCountyFamousIndustry(param) {
return request.get('/countyFamous/industry', param, { login: true }) return request.get('/countyFamous/industry', param, { login: true })
-8
View File
@@ -603,11 +603,3 @@ export function queryUserGuide(params) {
export function setUserGuide(params) { export function setUserGuide(params) {
return request.post('/user/guide/status', params) return request.post('/user/guide/status', params)
} }
/**
* 提现规则
*/
export function getWithdrawalRules() {
return request.get('/extract/rule')
}
+12 -16
View File
@@ -8,22 +8,18 @@ page {
justify-content: space-between; justify-content: space-between;
} }
.fix-tabbar-page { .fix-tabbar-page {
position: relative; position: relative;
z-index: 0; min-height: 100vh;
min-height: 100vh; 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: transparent; // background-color: #fff;
isolation: isolate; // background-size: 100% calc(100vh - 160rpx);
&::before { // background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
content: ''; // background-repeat: no-repeat;
position: fixed; // background-attachment: fixed;
top: 0; &.new-chat {
right: 0; background-size: 100% calc(100vh - 160rpx);
bottom: 0; background-repeat: no-repeat;
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%);
}
.fix-tabbar-header { .fix-tabbar-header {
position: fixed; position: fixed;
top: 0; top: 0;
-19
View File
@@ -127,25 +127,6 @@
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,20 +42,9 @@ 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)
}, },
+5 -4
View File
@@ -35,7 +35,8 @@
v-for="(subItem, subIndex) in item.attrValue" v-for="(subItem, subIndex) in item.attrValue"
:key="subIndex" :key="subIndex"
:class="{ :class="{
'actived': subItem.check 'actived': subItem.check,
'disabled': !subItem.canUsed
}" }"
class="itemn v12-radius-40" class="itemn v12-radius-40"
@click="tapAttr(index, subIndex, subItem)" @click="tapAttr(index, subIndex, subItem)"
@@ -217,9 +218,9 @@ export default {
}, },
tapAttr(index, subIndex, subItem) { tapAttr(index, subIndex, subItem) {
// 缺货的点击了没效果 // 缺货的点击了没效果
// if (!subItem.canUsed || subItem.check) { if (!subItem.canUsed || subItem.check) {
// return return
// } }
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => { this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
subItem.check= false subItem.check= false
if (subIndex === subIdx) { if (subIndex === subIdx) {
+1 -8
View File
@@ -355,7 +355,7 @@
{ {
"path": "views/wholesaler", "path": "views/wholesaler",
"style": { "style": {
"navigationBarTitleText": "礼品集采中心入驻" "navigationBarTitleText": "采购批发商入驻"
} }
}, },
{ {
@@ -532,13 +532,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "views/famousQianxianGraphicGuide",
"style": {
"navigationBarTitleText": "攻略详情",
"navigationStyle": "custom"
}
},
{ {
"path": "views/famousQianxianVillageShop", "path": "views/famousQianxianVillageShop",
"style": { "style": {
+16 -9
View File
@@ -49,18 +49,21 @@ export default {
// 注释下面一行,会停留在启动页 // 注释下面一行,会停留在启动页
setTimeout(() => { setTimeout(() => {
this.toLaunch(); this.toLaunch();
}, 5000) }, 2000)
return; return;
} }
// 未登录:静默处理登录,5秒后跳转业务页面
cookie.get("spread"); cookie.get("spread");
if (this.$deviceType != "app") { // this.toLaunch();
//检查授权信息 if (this.$deviceType == "app") {
this.checkUserInfo(); // this.toLaunch();
this.$yrouter.switchTab({
path: "/pages/home/index"
});
return;
} }
setTimeout(() => {
this.toLaunch(); //检查授权信息
}, 5000); this.checkUserInfo();
}, },
methods: { methods: {
...mapActions(["changeAuthorization", "setUserInfo"]), ...mapActions(["changeAuthorization", "setUserInfo"]),
@@ -86,7 +89,11 @@ export default {
} }
} }
login(loginInfo); login(loginInfo).finally(() => {
this.$yrouter.switchTab({
path: "/pages/home/index"
});
});
} }
+27 -111
View File
@@ -6,44 +6,27 @@
</view> </view>
</view> </view>
<view class="list" v-show="hasList"> <view class="list" v-if="list.length">
<view class="video-waterfalls-wrap"> <view class="video-waterfalls-wrap">
<view class="waterfalls-column"> <custom-waterfalls-flow :value="list" imageKey="cover">
<view class="item" v-for="(lItem,lIndex) in leftList" :key="lIndex" @click="goDetail(lItem)"> <view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
<image class="cover" :src="lItem.cover" mode="widthFix" lazy-load></image> <image class="cover" :src="item.cover" mode="widthFix"></image>
<view class="content"> <view class="content">
<view class="title more-t">{{ lItem.title }}</view> <view class="title more-t">{{ item.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="lItem.storeLogo" mode="scaleToFill"></image> <image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
{{ lItem.storeName }} {{ item.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>
</view> </custom-waterfalls-flow>
<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="loading-more" v-show="isWait">加载中...</view> <view class="v4-nodata" v-else>
<view class="v4-nodata" v-show="showEmpty">
<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>
@@ -55,11 +38,6 @@ 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() {
@@ -70,23 +48,11 @@ export default {
page: 1, page: 1,
limit: 10, limit: 10,
keyword: '', keyword: '',
leftList: [], list: [],
rightList: [],
leftHeight: 0,
rightHeight: 0,
isWait: false, isWait: false,
requestId: 0,
pageKeyId: Object.freeze('findVideoList') pageKeyId: Object.freeze('findVideoList')
} }
}, },
computed: {
hasList() {
return this.leftList.length + this.rightList.length > 0
},
showEmpty() {
return !this.isWait && !this.hasList
}
},
onLoad(options) { onLoad(options) {
if (!options.click) { if (!options.click) {
uni.switchTab({ url: '/pages/home/index' }) uni.switchTab({ url: '/pages/home/index' })
@@ -112,73 +78,27 @@ export default {
changeType(item) { changeType(item) {
this.type = item.value this.type = item.value
this.page = 1 this.page = 1
// 使进行中的请求失效并解锁,避免切换时被上一次请求阻塞 this.list = []
this.requestId++
this.isWait = false
this.fetchList() this.fetchList()
}, },
resetList() { fetchList() {
this.leftList = []
this.rightList = []
this.leftHeight = 0
this.rightHeight = 0
},
async fetchList() {
if (this.isWait) return if (this.isWait) return
const requestId = ++this.requestId
this.isWait = true this.isWait = true
const params = { const params = {
type: this.type, type: this.type,
page: this.page, page: this.page,
limit: this.limit limit: this.limit
} }
try { getVideoList(params).then(res => {
const res = await getVideoList(params)
// 请求已被更新的请求(如切换分类)取代,丢弃本次结果
if (requestId !== this.requestId) return
if (res.status === 200) { if (res.status === 200) {
const items = res.data for (let i = 0; i < res.data.length; i++) {
for (let i = 0; i < items.length; i++) { res.data[i].hide = true
items[i].hide = true this.list.push(res.data[i])
} }
// 并行获取所有封面高度,完成后一次性替换列表,避免闪现空列表
const heights = await Promise.all(items.map(item => this.getImageHeight(item.cover)))
if (requestId !== this.requestId) return
if (this.page === 1) this.resetList()
items.forEach((item, i) => {
this.pushToColumn(item, heights[i] + TEXT_HEIGHT)
})
} }
} catch (e) { this.isWait = false
// 忽略请求或图片尺寸获取失败
} finally {
if (requestId === this.requestId) {
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')
} }
@@ -209,22 +129,25 @@ export default {
margin: 28rpx 32rpx; margin: 28rpx 32rpx;
.video-waterfalls-wrap { .video-waterfalls-wrap {
display: flex; direction: ltr;
justify-content: space-between;
align-items: flex-start;
}
.waterfalls-column { /deep/ .waterfalls-flow {
width: 332rpx; direction: ltr;
text-align: left;
}
/deep/ .waterfalls-flow-column {
float: left !important;
}
} }
.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;
} }
@@ -267,11 +190,4 @@ export default {
} }
} }
} }
.loading-more {
padding: 24rpx 0;
text-align: center;
font-size: 24rpx;
color: #999;
}
</style> </style>
+1 -5
View File
@@ -114,8 +114,7 @@
<view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view> <view class="icon-box"><u-icon name="arrow-rightward" color="#fff" size="8"></u-icon></view>
</view> </view>
</view> </view>
<goo-skeleton v-if="!townLoaded" :show-avatar="false"/> <view class="v4-nodata" v-if="townList.length === 0">
<view class="v4-nodata" v-else-if="townList.length === 0">
<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>
@@ -204,7 +203,6 @@ export default {
isNext: false, isNext: false,
townConfig: {}, townConfig: {},
townList: [], townList: [],
townLoaded: false,
randomSeed: null, randomSeed: null,
hotelBanner: [], hotelBanner: [],
goodCityId: '', goodCityId: '',
@@ -521,8 +519,6 @@ export default {
} }
getAncientTownList(params).then(res => { getAncientTownList(params).then(res => {
this.townList = res.data.records this.townList = res.data.records
}).finally(() => {
this.townLoaded = true
}) })
return return
} }
+2 -23
View File
@@ -916,18 +916,6 @@ 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)
@@ -944,19 +932,10 @@ export default {
(data.lotteryCanDraw || false) (data.lotteryCanDraw || false)
) )
this.isDrawPosterVisible = shouldShowDrawPoster this.isDrawPosterVisible = shouldShowDrawPoster
const shouldShowOldUserPopup = this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster
!shouldShowDrawPoster &&
!hasShownDrawPosterInSession &&
this.canShowOldPoster &&
!this.hasShownOldUserPopupInSession()
if (shouldShowOldUserPopup) {
this.markOldUserPopupShownInSession()
}
this.isOldUser = shouldShowOldUserPopup
}, },
showNextPoster() { showNextPoster() {
if (!this.isDrawPosterVisible && this.canShowOldPoster && !this.hasShownOldUserPopupInSession()) { if (!this.isDrawPosterVisible && this.canShowOldPoster) {
this.markOldUserPopupShownInSession()
this.isOldUser = true this.isOldUser = true
} }
}, },
+96 -512
View File
@@ -12,7 +12,7 @@
v-model="keyword" v-model="keyword"
:inputStyle="inputStyle" :inputStyle="inputStyle"
:showAction="false" :showAction="false"
:placeholder="searchPlaceholder" placeholder="请输入商品名/订单号/团购名称"
shape="round" shape="round"
bgColor="#FFF" bgColor="#FFF"
@search="changeType" @search="changeType"
@@ -76,28 +76,28 @@
</view> </view>
</view> </view>
<view <view
v-if="getOrderStoreName(order) && !order.experienceOrderInfo" v-if="order.merName && !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="handleOrderStoreClick(orderListIndex)" @click="goStore(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">{{ getOrderStoreName(order) }}</text> <text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName }}</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 v-if="getOrderCityName(order)" class="flex ai-center"> <view 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">{{ getOrderCityName(order) }}</text> <text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</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"
>{{ getOrderStatusTagText(order) }}</view> >{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view>
</view> </view>
<view @click="goOrderDetails(orderListIndex)"> <view @click="goOrderDetails(orderListIndex)">
<view <view
@@ -186,44 +186,6 @@
</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">
@@ -282,7 +244,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-else-if="!(isCollectiveCenterMode && isBlindBoxGiftOrder(order))"> <view v-else>
<view <view
v-for="(cart,cartInfoIndex) in order.cartInfo" v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex" :key="cartInfoIndex"
@@ -338,8 +300,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">
{{ getOrderTotalNum(order) }}件商品 {{ order.totalNum || 0 }}件商品
<text v-if="order.isGiftCardReceiveBlind === 0 && shouldShowOrderTotalAmount(order)"> <text v-if="order.isGiftCardReceiveBlind === 0">
<text class="v12-dark-text v12-font-28 v12-font-bold"> <text class="v12-dark-text v12-font-28 v12-font-bold">
总金额 总金额
</text> </text>
@@ -347,7 +309,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(getOrderPayPrice(order)) }} {{ force2Decimal(order.payPrice) }}
</text> </text>
</text> </text>
</view> </view>
@@ -389,101 +351,63 @@
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
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
class="group-btn"
>
<text
class="btn-more v12-font-28 v12-font-bold"
@click.stop="tapShowMore(orderListIndex)"
>更多</text>
<view class="group-float" v-show="order.showMore">
<view
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="btn btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(orderListIndex)"
>联系商家</view>
<view
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(orderListIndex)"
>申请退款</view>
</view>
</view>
<template v-else>
<view class="v12-justify-between" style="width: 100%"> <view class="v12-justify-between" style="width: 100%">
<view
v-if="order.isDrawOrder > 0"
class="bnt service"
@click.stop="callMerPhone(orderListIndex)"
>联系客服
</view>
<view> <view>
<view <view
v-if="showCollectiveContact(order)" v-if="order.isGiftCardReceiveBlind === 0 &&
order.merName &&
parseInt(order._status._type) !== 0 &&
parseInt(order._status._type) !== 9
"
class="bnt service" class="bnt service"
@click="goRoom(orderListIndex)" @click="goRoom(orderListIndex)"
>联系商家</view> >联系商家</view>
</view> </view>
<view class="flex"> <view class="v12-justify-between">
<view <view
v-if="showCollectiveModifyAddress(order)"
class="bnt service"
@click="addressTap(orderListIndex)"
>修改地址</view>
<view
v-if="showCollectiveDetail(order)"
class="bnt service" class="bnt service"
@click="goOrderDetails(orderListIndex)" @click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view> >查看详情</view>
<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" class="bnt service"
@click="delOrder(orderListIndex)" @click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view> >删除订单</view>
</view> </view>
</view> </view>
</template> </template>
<template v-else> <view class="flex">
<view
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
class="group-btn"
>
<text
class="btn-more v12-font-28 v12-font-bold"
@click.stop="tapShowMore(orderListIndex)"
>更多</text>
<view class="group-float" v-show="order.showMore">
<view
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="btn btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(orderListIndex)"
>联系商家</view>
<view
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(orderListIndex)"
>申请退款</view>
</view>
</view>
<template v-else>
<view class="v12-justify-between" style="width: 100%">
<view
v-if="order.isDrawOrder > 0"
class="bnt service"
@click.stop="callMerPhone(orderListIndex)"
>联系客服
</view>
<view>
<view
v-if="order.isGiftCardReceiveBlind === 0 &&
order.merName &&
parseInt(order._status._type) !== 0 &&
parseInt(order._status._type) !== 9
"
class="bnt service"
@click="goRoom(orderListIndex)"
>联系商家</view>
</view>
<view class="v12-justify-between">
<view
class="bnt service"
@click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view>
<view
class="bnt service"
@click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view>
</view>
</view>
</template>
</template>
<view v-if="!isCollectiveCenterMode" class="flex">
<template v-if="parseInt(order._status._type) === 0"> <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"
@@ -743,7 +667,6 @@ export default {
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus], mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
data() { data() {
return { return {
collectiveOrderType: 'wholesaler',
giftItem: {}, giftItem: {},
isShowPayPwdPop: false, isShowPayPwdPop: false,
inputStyle: { inputStyle: {
@@ -770,15 +693,14 @@ 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',
@@ -804,8 +726,7 @@ export default {
dateRange: [], dateRange: [],
userLatitude: null, userLatitude: null,
userLongitude: null, userLongitude: null,
orderListRequestId: 0, orderListRequestId: 0
savedScrollTop: 0
} }
}, },
components: { components: {
@@ -814,15 +735,7 @@ export default {
passkeyborad, passkeyborad,
DateRangePicker DateRangePicker
}, },
computed: { computed: mapGetters(["userInfo"]),
...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')
@@ -863,20 +776,17 @@ export default {
}) })
} else if (needRefreshOrderList) { } else if (needRefreshOrderList) {
uni.removeStorageSync('needRefreshMyOrderList') uni.removeStorageSync('needRefreshMyOrderList')
this.getOrderData() this.changeType()
this.refreshOrderListKeepPosition()
} }
}, },
onLoad() { onLoad() {
const query = this.getPageQuery() this.type = this.type || parseInt(this.$yroute.query.type) || 0
this.type = this.type || parseInt(query.type) || 0 this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0
this.orderTypeTabIndex = parseInt(query.tabIndex) || 0
const currentOrderTypeTab = this.orderTypeTabList[this.orderTypeTabIndex] || this.orderTypeTabList[0]
this.initUserLocation() this.initUserLocation()
this.orderTypeTabChange({ this.orderTypeTabChange({
...currentOrderTypeTab, ...this.orderTypeTabList[this.orderTypeTabIndex],
index: this.orderTypeTabList[this.orderTypeTabIndex] ? this.orderTypeTabIndex : 0 index: this.orderTypeTabIndex
}, { resetFilters: false }) })
}, },
onShareAppMessage() { onShareAppMessage() {
uni.updateShareMenu({ uni.updateShareMenu({
@@ -890,298 +800,6 @@ 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
@@ -1398,13 +1016,6 @@ 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) {
@@ -1415,11 +1026,7 @@ export default {
return return
} }
delOrderHandle(order.orderId).then(() => { delOrderHandle(order.orderId).then(() => {
this.getOrderData() this.changeType()
const index = this.orderList.indexOf(order)
if (index > -1) {
this.orderList.splice(index, 1)
}
}) })
}, },
goStore(orderOrIndex) { goStore(orderOrIndex) {
@@ -1802,50 +1409,44 @@ 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
const query = this.getPageQuery() this.$yroute.query.type = this.type
query.type = this.type
this.changeType() this.changeType()
}, },
orderTypeTabChange(item, options = {}) { orderTypeTabChange(item) {
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() {
this.tabList = this.getDefaultTabListByOrderType() if (this.orderType === 'travel') {
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({
@@ -1867,15 +1468,23 @@ export default {
uni.showLoading({ uni.showLoading({
mask: true, mask: true,
}) })
const typeMap = this.getRequestTypeMapByOrderType() const types = {
const type = typeMap[this.type] 0: 0,
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
return getOrderList({ getOrderList({
page, page,
limit, limit,
type, type,
@@ -1898,24 +1507,6 @@ 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) {
@@ -2026,9 +1617,6 @@ export default {
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getOrderListReq() !this.loading && this.getOrderListReq()
},
onPageScroll(e) {
this.savedScrollTop = e.scrollTop
} }
}; };
</script> </script>
@@ -2211,10 +1799,6 @@ 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);
} }
+57 -42
View File
@@ -32,9 +32,9 @@
<image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image> <image :src="webUrl+'/20210806121714655368.png'" mode="" style="width: 36rpx;height: 36rpx;"></image>
</view> </view>
</view> </view>
<view v-if="(!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0) || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1"> <view v-if="couponListLimit2ToShow.length > 0 || attr.productSelect.earnPoints" class="v12-mt-1 v12-mb-1">
<view class="cell flex jc-between ai-center"> <view class="cell flex jc-between ai-center">
<view v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" class="v12-justify-start"> <view v-if="couponListLimit2ToShow.length > 0" class="v12-justify-start">
<view <view
v-for="(item, index) in couponListLimit2ToShow" v-for="(item, index) in couponListLimit2ToShow"
:key="index" :key="index"
@@ -48,7 +48,7 @@
</view> </view>
<view <view
v-if="!isCountyLotteryGoodsDetail() && couponListLimit2ToShow.length > 0" v-if="couponListLimit2ToShow.length > 0"
class="value value2 v12-font-24 v12-primary-text" class="value value2 v12-font-24 v12-primary-text"
@click="changeCoupons()" @click="changeCoupons()"
> >
@@ -201,7 +201,7 @@
</view> </view>
<!-- v9 优惠券开始 --> <!-- v9 优惠券开始 -->
<u-popup v-if="!isCountyLotteryGoodsDetail()" :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()"> <u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons()">
<CouponsPopup <CouponsPopup
:two-list="couponList" :two-list="couponList"
@ok="setCoupon" @ok="setCoupon"
@@ -309,7 +309,7 @@
</view> </view>
</view> </view>
<!-- v6服务项目结束 --> <!-- v6服务项目结束 -->
<view class="store-section goods-section" v-if="systemStore && appProductHideMerchant !== '1'"> <view class="store-section goods-section" v-if="systemStore">
<view class="flex jc-between ai-center"> <view class="flex jc-between ai-center">
<view class="title bold flex ai-center"> <view class="title bold flex ai-center">
<view> <view>
@@ -579,7 +579,6 @@ export default {
mixins: [pageListenMixins], mixins: [pageListenMixins],
data: function () { data: function () {
return { return {
appProductHideMerchant: '0',
isGift: false, isGift: false,
giftBg: '', giftBg: '',
// 商品信息是否展开 // 商品信息是否展开
@@ -733,7 +732,6 @@ export default {
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync()) console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
console.log("getEnterOptionsSync", uni.getEnterOptionsSync()) console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
uni.removeStorageSync('couponId') uni.removeStorageSync('couponId')
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
const from = options.from const from = options.from
const id = options.id const id = options.id
switch (from) { switch (from) {
@@ -781,10 +779,10 @@ export default {
if (url && url.productId) { if (url && url.productId) {
this.id = url.productId this.id = url.productId
} else if (options.id) { } else if (options.id) {
this.id = pageQuery.id || options.id || null this.id = options.id || null
this.partnerId = pageQuery.partnerId || options.partnerId || null this.partnerId = options.partnerId || null
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0) this.activityId = this._route.query.activityId
this.source = pageQuery.from || '' this.source = this._route.query.from || ''
} else { } else {
const obj = uni.getEnterOptionsSync() const obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) { if (options.scene != null || obj.query.scene != null) {
@@ -849,18 +847,6 @@ export default {
} }
}, },
methods: { methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
gift() { gift() {
this.goCat(2) this.goCat(2)
}, },
@@ -901,14 +887,14 @@ export default {
handleLoginFailure() handleLoginFailure()
return return
} }
console.log(this.attr); console.log(this.storeInfo);
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 || this.storeInfo.image, cover: this.attr.productSelect.image,
goodsData: '', goodsData: '',
seckillData: '', seckillData: '',
isNegotiable: this.storeInfo.isNegotiable isNegotiable: this.storeInfo.isNegotiable
@@ -1211,7 +1197,6 @@ export default {
this.posterData.price = this.storeInfo.price this.posterData.price = this.storeInfo.price
this.posterData.code = this.storeInfo.codeBase this.posterData.code = this.storeInfo.codeBase
this.systemStore = data.systemStore this.systemStore = data.systemStore
this.appProductHideMerchant = data.appProductHideMerchant
const good_list = data.goodList || [] const good_list = data.goodList || []
const goodArray = [] const goodArray = []
const count = Math.ceil(good_list.length / 6) const count = Math.ceil(good_list.length / 6)
@@ -1278,7 +1263,7 @@ export default {
'store_name', 'store_name',
this.storeInfo.storeName this.storeInfo.storeName
) )
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image) this.$set(this.attr.productSelect, 'image', productSelect.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)
@@ -1405,7 +1390,7 @@ export default {
subItem.check = true subItem.check = true
} }
}) })
this.$set(this.attr.productSelect, 'image', productSelect.image || this.storeInfo.image) this.$set(this.attr.productSelect, 'image', productSelect.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)
@@ -1534,17 +1519,12 @@ export default {
that.isOpen = false that.isOpen = false
that.attr.cartAttr = false that.attr.cartAttr = false
if (news === 1) { if (news === 1) {
const orderQuery = {
id: res.data.cartId,
discount: that.storeInfo.discount,
}
if (that.source === 'countyLottery') {
orderQuery.from = 'countyLottery'
orderQuery.drawActivityId = Number(that.activityId || 0)
}
that.$yrouter.push({ that.$yrouter.push({
path: "/pages/order/OrderSubmission/index", path: "/pages/order/OrderSubmission/index",
query: orderQuery query: {
id: res.data.cartId,
discount: that.storeInfo.discount,
}
}) })
setTimeout(() => { setTimeout(() => {
that.submitActionLock = false that.submitActionLock = false
@@ -1619,16 +1599,11 @@ export default {
listenerActionClose() { listenerActionClose() {
this.posters = false this.posters = false
}, },
isCountyLotteryGoodsDetail() {
return this.source === 'countyLottery' && Number(this.activityId || 0) > 0
},
// v9-2 // v9-2
changeCoupons(e) { changeCoupons(e) {
if (this.isCountyLotteryGoodsDetail()) return
this.show = !this.show this.show = !this.show
}, },
setCoupon(couponId) { setCoupon(couponId) {
if (this.isCountyLotteryGoodsDetail()) return
this.couponId = couponId this.couponId = couponId
}, },
async checkFavorite() { async checkFavorite() {
@@ -2296,3 +2271,43 @@ export default {
word-break: keep-all; word-break: keep-all;
} }
</style> </style>
}
.gift-wrap{
position: relative;
}
.gift-bg{
position: absolute;
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
.gift-img{
width: 34rpx;
height: 34rpx;
margin-right: 10rpx;
}
.gift-wrap{
position: relative;
}
.gift-bg{
position: absolute;
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
left: 0;
width: 100%;
}
.ll-text{
margin-left: 250rpx;
word-break: keep-all;
}
</style>
+76 -1
View File
@@ -219,6 +219,7 @@ 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";
@@ -439,7 +440,81 @@ export default {
} }
}); });
}, },
submit() { getIndex(value, arr) {
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;
+50 -168
View File
@@ -93,7 +93,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="orderInfo.deliveryId !== null && ([-1, -2, -3, 3, 4].includes(orderInfo._status._type) || (orderInfo._status._type == 2 && orderInfo.isTickets !== 1))"> <view v-if="orderInfo.deliveryId !== null && ([-1, -2, 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 getOrderDetailDisplayItems(orderInfo)" :key="d" @click="goGoodsCon(cart, orderInfo.isGiftCardReceiveBlind, orderInfo.isDrawOrder, orderInfo.scenarioCode)"> <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-justify-between" v-if="!isBlindBoxOrder(orderInfo)"> <view class="v12-justify-between" v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view class=""> <view class="">
<image style="width: 120rpx; height: 120rpx" class="v12-radius-8" :src="cart.image"></image> <image style="width: 120rpx; height: 120rpx" class="v12-radius-8" :src="cart.productInfo.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.name }} {{ cart.productInfo.storeName }}
</view> </view>
<view v-if="cart.sku && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24"> <view v-if="cart.productInfo.attrInfo && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ cart.sku }} {{ cart.productInfo.attrInfo.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 && cart.showPrice"> <view class=" " v-if="orderInfo.isDrawOrder === 0">
<text class="v12-font-22"> <text class="v12-font-22">
</text> </text>
<text class="v12-font-28">{{ force2Decimal(cart.price) }}</text> <text class="v12-font-28">{{ cart.truePrice }}</text>
</view> </view>
<view class="v12-font-22"> <view class="v12-font-22">
<text>x{{ cart.qty }}</text> <text>x{{ cart.cartNum }}</text>
</view> </view>
</view> </view>
</view> </view>
@@ -244,29 +244,16 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" v-if="getOrderDetailDisplayItems(orderInfo).length && (d === getOrderDetailDisplayItems(orderInfo).length - 1) && orderInfo.isDrawOrder === 0"> <view class="" v-if="orderInfo.cartInfo &&( d === orderInfo.cartInfo.length - 1) && orderInfo.isDrawOrder === 0">
<view v-if="orderInfo.isGiftCardReceiveBlind === 0"> <view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" 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">
<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>
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-else> <view class="v12-text-right">
<view class="v12-font-24 v12-dark-text"> <text class="v12-font-22"></text>
{{ '商品总价' }} <text class="v12-font-28">
</view> {{ force2Decimal(orderInfo.totalPrice) }}
<view class="v12-text-right"> </text>
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.totalPrice) }}
</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">
@@ -317,7 +304,7 @@
</view> </view>
</view> </view>
<u-divider></u-divider> <u-divider></u-divider>
<view class="v12-justify-between v12-align-center v12-mt-3" v-if="orderInfo.isGiftCardReceiveBlind === 0 && !isCustomGiftOrder(orderInfo)"> <view class="v12-justify-between v12-align-center v12-mt-3" v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view class="v12-font-28 v12-font-bold v12-dark-text"> <view class="v12-font-28 v12-font-bold v12-dark-text">
实付款 实付款
</view> </view>
@@ -367,11 +354,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 && !isCustomGiftOrder(orderInfo)" class="item acea-row row-between v12-font-24 v12-dark-text "> <view v-if="orderInfo.isDrawOrder !== 1" 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 && !isCustomGiftOrder(orderInfo)" class="item acea-row row-between v12-font-24 v12-dark-text "> <view v-if="orderInfo.isDrawOrder !== 1" 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>
@@ -498,31 +485,22 @@
<text class="v12-font-22 v12-dark1-text"> <text class="v12-font-22 v12-dark1-text">
{{ orderInfo.totalNum }}件商品 {{ orderInfo.totalNum }}件商品
</text> </text>
<template v-if="!isCustomGiftOrder(orderInfo)"> <text class="v12-font-bold v12-dark-text v12-font-28 v12-mx-2">
<text class="v12-font-bold v12-dark-text v12-font-28 v12-mx-2"> 实付款
实付款 </text>
</text> <text class="v12-font-bold v12-primary-text v12-font-22">
<text class="v12-font-bold v12-primary-text v12-font-22">
</text>
</text> <text class="v12-font-bold v12-primary-text v12-font-28">
<text class="v12-font-bold v12-primary-text v12-font-28"> {{ force2Decimal(orderInfo.payPrice) }}
{{ force2Decimal(orderInfo.payPrice) }} </text>
</text>
</template>
</view> </view>
<view class="bnt v12-primary-text v12-primary-border v12-ml-1" @click="subscribePay">立即付款</view> <view class="bnt v12-primary-text v12-primary-border v12-ml-1" @click="subscribePay">立即付款</view>
</view> </view>
</view> </view>
</template> </template>
<template v-if="status.type == 1" > <template v-if="status.type == 1" >
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%"> <view class="v12-justify-between " 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>
@@ -537,10 +515,7 @@
</view> </view>
</template> </template>
<template v-if="status.type == 2"> <template v-if="status.type == 2">
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%"> <view class="v12-justify-between " 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">
@@ -573,12 +548,8 @@
<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 v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view <view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</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>
@@ -591,7 +562,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 v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view 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">
@@ -599,9 +570,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 v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view> <view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view <view
v-if="canShowOrderEvaluate(orderInfo)" v-if="!isGiftOrder(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>
@@ -879,12 +850,9 @@ export default {
} }
}) })
}, },
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) { goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder) {
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) ||
@@ -1061,83 +1029,6 @@ 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 = "";
@@ -1170,6 +1061,9 @@ 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,
@@ -1260,17 +1154,16 @@ export default {
}); });
}, },
goBack() { goBack() {
// 从订单列表进入时直接返回原页面,保留列表页主/子tab及滚动位置 if (this.name === "MyOrder") {
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({
path: "/pages/order/MyOrder/index"
});
return;
} }
this.$yrouter.replace({
path: "/pages/order/MyOrder/index"
});
}, },
cancelOrder() { cancelOrder() {
cancelOrderHandle(this.orderInfo.orderId) cancelOrderHandle(this.orderInfo.orderId)
@@ -1386,19 +1279,8 @@ 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.isWholesalerOrder(this.orderInfo)) { if (this.orderInfo.combinationId > 0) {
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) {
+2 -2
View File
@@ -23,7 +23,7 @@
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">提现</view> <view class="name">提现</view>
<view class="input"> <view class="input">
<input v-model="post.money" /> <input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
</view> </view>
</view> </view>
<view class="tip">当前可提现金额: {{ commissionCount }}</view> <view class="tip">当前可提现金额: {{ commissionCount }}</view>
@@ -45,7 +45,7 @@
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">提现</view> <view class="name">提现</view>
<view class="input"> <view class="input">
<input placeholder="请输入提现金额" v-model="post.money" /> <input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
</view> </view>
</view> </view>
<view class="tip">当前可提现金额: {{ commissionCount }}</view> <view class="tip">当前可提现金额: {{ commissionCount }}</view>
+39 -98
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="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image> <image class="img" :src="item.msg_content" @click="preview(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="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image> <image class="img" :src="item.msg_content" @click="preview(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">
@@ -108,11 +108,8 @@ export default {
uploadToken: null, //上传token uploadToken: null, //上传token
socketOpen: false, socketOpen: false,
socketConnecting: false, // 是否正在建连
socketTask: null, socketTask: null,
socketMsgQueue: [], socketMsgQueue: [],
hasConnected: false, // 是否成功建过连接
reconnectHistory: false, // 重连后用服务端历史整体替换本地列表,防止消息重复
roomId: null, //房间ID roomId: null, //房间ID
content: "", //消息内容 content: "", //消息内容
@@ -139,22 +136,30 @@ export default {
}, },
onShow() { onShow() {
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId) this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
// 已连接/连接中不重复建连;清空 list 会导致图片操作(触发 onHide/onShow)后页面白屏 this.connectSocketInit();
if (!this.socketOpen && !this.socketConnecting) { this.list = []
this.connectSocketInit();
}
}, },
onUnload() { onUnload() {
this.closeSocket(); if (this.socketOpen) {
this.socketTask.close();
}
uni.onSocketClose(res => {
console.log('WebSocket 已关闭!', res);
});
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content) uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
}, },
onHide() { onHide() {
this.closeSocket(); if (this.socketOpen) {
this.socketTask.close();
}
uni.onSocketClose(res => {
console.log('WebSocket 已关闭!', res);
});
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content) uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
}, },
methods: { methods: {
toGoods(item) { toGoods(item) {
const itemJson = this.wsJson(item.msg_content) const itemJson = JSON.parse(item.msg_content)
if(!itemJson.goodsId) { if(!itemJson.goodsId) {
// 提示数据错误 // 提示数据错误
// uni.showToast({ // uni.showToast({
@@ -172,18 +177,7 @@ export default {
}) })
}, },
wsJson(json) { wsJson(json) {
// 兼容脏数据,避免渲染时报错导致白屏 return JSON.parse(json)
try {
return JSON.parse(json) || {}
} catch (e) {
return {}
}
},
// 拼接图片完整地址:七牛上传后消息里只存 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;
@@ -255,68 +249,33 @@ export default {
}); });
}, },
// 进入页面时创建websocket连接【整个页面随时使用】 // 进入这个页面的时候创建websocket连接【整个页面随时使用】
connectSocketInit() { connectSocketInit() {
if (this.socketOpen || this.socketConnecting) return;
this.socketConnecting = true;
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】 // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
const task = uni.connectSocket({ this.socketTask = uni.connectSocket({
url: this.$SOCKET_URL, url: this.$SOCKET_URL,
success: () => { success: () => {
} }
}) })
if (!task) {
this.socketConnecting = false;
return;
}
this.socketTask = task;
// 任务级回调:全局 uni.onSocket* 每次进页面都会重复注册,导致消息重复处理、连接串台 uni.onSocketOpen(res => {
const isCurrent = () => this.socketTask === task; console.log('WebSocket连接已打开!', res);
task.onOpen(() => {
if (!isCurrent()) return;
this.socketOpen = true; this.socketOpen = true;
this.socketConnecting = false;
// 断线重连后重新加入房间;本地已有历史时用服务端历史整体替换,避免重复
this.reconnectHistory = this.hasConnected && this.list.length > 0;
this.hasConnected = true;
this.createRoom(); this.createRoom();
// 补发连接未就绪期间排队的消息(如发图片时连接被隐藏页关闭)
if (this.socketMsgQueue.length) {
const queue = this.socketMsgQueue.splice(0);
queue.forEach(msg => this.sendSocketMessage(msg));
}
}); });
task.onMessage(res => { uni.onSocketError(err => {
if (!isCurrent()) return; console.log('WebSocket连接打开失败,请检查!', err);
});
uni.onSocketMessage(res => {
console.log('收到服务器内容:', res.data);
this.handleMessage(res.data); this.handleMessage(res.data);
}); });
task.onError(err => { uni.onSocketClose(res => {
console.log('WebSocket连接打开失败,请检查', err); console.log('WebSocket 已关闭', res);
if (!isCurrent()) return;
this.socketOpen = false;
this.socketConnecting = false;
}); });
task.onClose(() => {
if (!isCurrent()) return;
this.socketOpen = false;
this.socketConnecting = false;
});
},
closeSocket() {
this.socketOpen = false;
this.socketConnecting = false;
if (this.socketTask) {
try {
this.socketTask.close({});
} catch (e) {}
}
}, },
userInput(event) { userInput(event) {
@@ -356,14 +315,11 @@ export default {
}, },
sendSocketMessage(msg) { sendSocketMessage(msg) {
if (this.socketOpen && this.socketTask) { if (this.socketOpen) {
this.socketTask.send({ uni.sendSocketMessage({
data: msg, data: msg,
fail: () => { success(res) {
// 发送失败说明连接可能已断开,重新排队并尝试重连后补发 console.log("消息发送成功", res,msg);
this.socketMsgQueue.push(msg);
this.closeSocket();
this.connectSocketInit();
} }
}); });
} else { } else {
@@ -372,12 +328,7 @@ export default {
}, },
handleMessage(str) { handleMessage(str) {
let data; let data = JSON.parse(str);
try {
data = JSON.parse(str);
} catch (e) {
return;
}
switch (data.type) { switch (data.type) {
case "room_id": case "room_id":
this.roomId = data.msg_content; this.roomId = data.msg_content;
@@ -387,23 +338,13 @@ export default {
case "leave": case "leave":
break; break;
case "msg": case "msg":
if (data.msg_content) { this.list.push(data.msg_content);
this.list.push(data.msg_content); this.scrollLast();
this.scrollLast();
}
break; break;
case "msg_history": { case "msg_history":
const history = data.msg_content || []; this.list = data.msg_content.concat(this.list);
if (this.reconnectHistory) {
// 重连后服务端重发历史:整体替换,避免消息重复
this.reconnectHistory = false;
this.list = history;
} else {
this.list = history.concat(this.list);
}
this.scrollLast(); this.scrollLast();
break; break;
}
default: default:
break; break;
} }
+7 -47
View File
@@ -396,7 +396,7 @@
/> />
</view> </view>
</view> </view>
<view v-if="form.reviewStatus !== 1"> <view v-if="form.isDraft === 0 && 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="handlePopupClose" @close="show=false"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold"> <view class="tc bold">
@@ -440,6 +440,7 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="savePopup" @click="savePopup"
/> />
</view> </view>
@@ -450,7 +451,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, formatRichText } from '@/utils' import { uploadVideo, uploadImage } from '@/utils'
import { import {
getShopData, getShopData,
saveExperienceStore, saveExperienceStore,
@@ -520,10 +521,9 @@ 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 = formatRichText(data.merchantApplyNotice) this.notice = data.merchantApplyNotice
}) })
getExperienceStoreCategoryList().then(({ data }) => { getExperienceStoreCategoryList().then(({ data }) => {
this.experienceStoreCategoryList = data || [] this.experienceStoreCategoryList = data || []
@@ -531,8 +531,6 @@ export default {
this.experienceStoreCategoryIndex = 0 this.experienceStoreCategoryIndex = 0
} }
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
onUnload() { onUnload() {
@@ -579,31 +577,12 @@ 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 = ',') {
@@ -886,25 +865,6 @@ 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 -8
View File
@@ -6,32 +6,32 @@
mode="scaleToFill" mode="scaleToFill"
/> />
<image <image
v-show="partnerType === 'province_partner' || partnerType === '' || partnerType === 'county_agent'" v-show="partnerType === 'province_partner' || partnerType === ''"
:src="images.goodSupplierImage" :src="images.goodSupplierImage"
class="img-item" class="img-item"
mode="widthFix" mode="widthFix"
@click="goto('goods_supplier')" @click="goto('goods_supplier')"
/> />
<image <image
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'" v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.wenwanSupplierImage" :src="images.wenwanSupplierImage"
class="img-item" class="img-item"
mode="widthFix" mode="widthFix"
@click="goto('wenwan_supplier')" @click="goto('wenwan_supplier')"
/> />
<image <image
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'" v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.hotelImage" :src="images.hotelImage"
class="img-item" class="img-item"
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,9 +74,6 @@ 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
+73 -130
View File
@@ -6,7 +6,7 @@
labelWidth="216rpx" labelWidth="216rpx"
> >
<view <view
v-if="stateTitle" v-if="stateTitle && isDraft !== 1"
class="box-state" class="box-state"
> >
<u-alert <u-alert
@@ -77,19 +77,11 @@
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>
@@ -110,23 +102,14 @@
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>
@@ -160,19 +143,11 @@
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>
@@ -440,7 +415,7 @@
:show="show" :show="show"
mode="center" mode="center"
round="10" round="10"
@close="handlePopupClose" @close="show=false"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
@@ -458,6 +433,7 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="handleAgree" @click="handleAgree"
/> />
</view> </view>
@@ -474,7 +450,6 @@ import {
getShopInfo, getShopInfo,
removeApply, removeApply,
saveShop, saveShop,
saveHotelDraft,
getHotelInfo, getHotelInfo,
getCountyFamousHotelType getCountyFamousHotelType
} from '@/api/join' } from '@/api/join'
@@ -486,8 +461,7 @@ import {
chooseImage, chooseImage,
moreImage, moreImage,
uploadImage, uploadImage,
chooseVideoToUpload, chooseVideoToUpload
formatRichText
} from '@/utils' } from '@/utils'
export default { export default {
@@ -632,33 +606,45 @@ 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() {
this.saveDraft() uni.setStorageSync('merchantApplyHotel'+'_quaPics', this.quaPics)
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) {
@@ -707,14 +693,13 @@ 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 = formatRichText(data.merchantApplyNotice) this.notice = data.merchantApplyNotice
getCountyFamousHotelType({ getCountyFamousHotelType({
page: 1, page: 1,
limit: 9999 limit: 9999
@@ -727,8 +712,6 @@ export default {
}).catch(() => { }).catch(() => {
this.initInfo() this.initInfo()
}) })
}).catch(() => {
uni.hideLoading()
}) })
}, },
@@ -744,20 +727,22 @@ export default {
this.show = true this.show = true
} }
} }
switch (data.reviewStatus) { if (data.isDraft !== 1) {
case 0: switch (data.reviewStatus) {
this.stateTitle = '审核中' case 0:
this.stateType = 'primary' this.stateTitle = '审核中'
this.reviewing = true this.stateType = 'primary'
break this.reviewing = true
case 1: break
this.reviewing = false case 1:
break this.reviewing = false
case 2: break
this.stateTitle = '审核驳回:' + data.reviewMsg case 2:
this.stateType = 'error' this.stateTitle = '审核驳回:' + data.reviewMsg
this.reviewing = false this.stateType = 'error'
break this.reviewing = false
break
}
} }
if (data.hotelInfo) { if (data.hotelInfo) {
// 店铺图片 // 店铺图片
@@ -802,8 +787,6 @@ 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) {
@@ -812,15 +795,6 @@ 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 => {
@@ -828,12 +802,6 @@ 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
@@ -970,16 +938,17 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
this.reviewing = false setTimeout(() => {
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
buildPostData() { save() {
this.form.pics = '' this.form.pics = ''
const picsLength = this.pics.length const picsLength = this.pics.length
if (picsLength > 0) { if (picsLength > 0) {
@@ -1002,10 +971,6 @@ 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({
@@ -1026,11 +991,6 @@ export default {
} }
}) })
}) })
},
saveDraft() {
if (this.reviewing) return
const postData = this.buildPostData()
saveHotelDraft(postData, this.partnerId, this.promoterUid)
} }
} }
} }
@@ -1060,23 +1020,6 @@ 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;
+120 -182
View File
@@ -7,7 +7,7 @@
labelWidth="216rpx" labelWidth="216rpx"
> >
<view <view
v-if="stateTitle" v-if="stateTitle && isDraft !== 1"
class="box-state" class="box-state"
> >
<u-alert <u-alert
@@ -59,19 +59,11 @@
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>
@@ -279,19 +271,11 @@
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>
@@ -309,23 +293,14 @@
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>
@@ -364,19 +339,11 @@
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>
@@ -546,7 +513,7 @@
@cancel="changeRemove(false)" @cancel="changeRemove(false)"
@confirm="onRemove" @confirm="onRemove"
/> />
<u-popup :show="show" mode="center" round="10" @close="handlePopupClose"> <u-popup :show="show" mode="center" round="10" @close="show=false">
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
<view class="content"> <view class="content">
@@ -563,6 +530,7 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="handlAgree" @click="handlAgree"
/> />
</view> </view>
@@ -578,16 +546,14 @@ 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'
@@ -715,8 +681,7 @@ export default {
// 是否为审核中 // 是否为审核中
reviewing: false, reviewing: false,
pageKeyId: '', pageKeyId: '',
showUpload: false, showUpload: false
pageType: ''
} }
}, },
computed: { computed: {
@@ -801,8 +766,49 @@ 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
this.pageType = type const local = uni.getStorageSync(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'
@@ -816,7 +822,9 @@ export default {
this.init() this.init()
}, },
onUnload() { onUnload() {
this.saveDraft() uni.setStorageSync(this.formSupplier.subType, this.formSupplier)
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)
@@ -824,23 +832,6 @@ 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) {
@@ -889,26 +880,19 @@ 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 = formatRichText(data.merchantApplyNotice) this.notice = data.merchantApplyNotice
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
initInfo() { initInfo() {
// 是否缺少参数区分文玩和特产? // 是否缺少参数区分文玩和特产?
// 2026-08-25 BUG 5882 确实需要区分参数 getShopInfo().then((res) => {
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--------');
@@ -921,26 +905,28 @@ export default {
if(data.isDraft === null || data.isDraft === 1) { if(data.isDraft === null || data.isDraft === 1) {
this.show = true this.show = true
} }
switch (data.reviewStatus) { if (data.isDraft !== 1) {
case 0: switch (data.reviewStatus) {
this.stateTitle = '审核中' case 0:
this.stateType = 'primary' this.stateTitle = '审核中'
this.reviewing = true this.stateType = 'primary'
break this.reviewing = true
case 1: break
this.reviewing = false case 1:
break this.reviewing = false
case 2: break
this.stateTitle = '审核驳回:' + data.reviewMsg case 2:
this.stateType = 'error' this.stateTitle = '审核驳回:' + data.reviewMsg
this.reviewing = false this.stateType = 'error'
break this.reviewing = false
break
}
} }
if (data.hotelInfo) { if (data.hotelInfo) {
// 店铺图片 // 店铺图片
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) {
@@ -948,43 +934,39 @@ 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
}
// 商家资质 // 商家资质
this.quaPics = [] const quaPicsTemp = this.form.qualification && this.form.qualification.split(',') || []
const quaPicsTemp = (this.formSupplier.qualification || '').split(',')
if (quaPicsTemp.length > 0) { if (quaPicsTemp.length > 0) {
console.log(quaPicsTemp, 'quaPicsTemp--------');
this.quaPics = []
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)
this.formSupplier.typeText = this.indexSupplierType > -1 ? this.columnsSupplierType[this.indexSupplierType].value : '' console.log(this.formSupplier);
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) {
@@ -1006,17 +988,6 @@ 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 => {
@@ -1024,12 +995,6 @@ 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
@@ -1164,16 +1129,17 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
this.reviewing = false setTimeout(() => {
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event.detail.value.length > 0 this.isAgree = event.detail.value.length > 0
}, },
buildPostData() { save() {
this.form.pics = '' this.form.pics = ''
const picsLength = this.pics.length const picsLength = this.pics.length
if (picsLength > 0) { if (picsLength > 0) {
@@ -1196,10 +1162,6 @@ 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) {
@@ -1243,13 +1205,6 @@ export default {
}) })
}) })
} }
},
saveDraft() {
if (this.reviewing) return
// 确保按当前入驻类型(特产/文玩)区分保存,避免共用同一份草稿
this.formSupplier.subType = this.pageType
const postData = this.buildPostData()
saveSupplierDraft(postData, this.formSupplier, this.partnerId, this.promoterUid)
} }
} }
} }
@@ -1289,23 +1244,6 @@ 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;
+4 -45
View File
@@ -344,7 +344,7 @@
{{ '提交审核' }} {{ '提交审核' }}
</view> </view>
</view> </view>
<u-popup :show="show" mode="center" round="10" @close="handlePopupClose" <u-popup :show="show" mode="center" round="10" @close="show=false"
> >
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
@@ -362,6 +362,7 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="save" @click="save"
/> />
</view> </view>
@@ -375,8 +376,7 @@ import {getCity, registerVerify} from '@/api/user'
import { import {
chooseImage, chooseImage,
uploadVideo, uploadVideo,
uploadImage, uploadImage
formatRichText
} from '@/utils' } from '@/utils'
import { import {
getShopData, getShopData,
@@ -469,13 +469,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 = formatRichText(data.merchantApplyNotice) this.notice = data.merchantApplyNotice
this.initInfo() this.initInfo()
}).catch(() => {
uni.hideLoading()
}) })
}, },
// onShow() { // onShow() {
@@ -495,23 +492,6 @@ 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
}, },
/** /**
@@ -574,8 +554,6 @@ export default {
} }
}).catch(err => { }).catch(err => {
// uni.$u.toast(err.msg) // uni.$u.toast(err.msg)
}).finally(() => {
uni.hideLoading()
}) })
}, },
/** /**
@@ -882,25 +860,6 @@ 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;
+75 -175
View File
@@ -6,7 +6,8 @@
labelWidth="216rpx" labelWidth="216rpx"
> >
<view <view
v-if="stateTitle" v-if="stateTitle && isDraft!==1 && applyType === 4"
class="box-state"
> >
<u-alert <u-alert
:center="stateType === 'primary'" :center="stateType === 'primary'"
@@ -16,11 +17,11 @@
</view> </view>
<u-cell-group <u-cell-group
:border="false" :border="false"
:customStyle="{'fontSize':'40rpx', 'backgroundColor':'#fff'}" :customStyle="{'fontSize':'40rpx'}"
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>
@@ -29,22 +30,7 @@
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>
@@ -58,19 +44,11 @@
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>
@@ -122,7 +100,7 @@
placeholder="请填写验证码" placeholder="请填写验证码"
/> />
</view> </view>
<view class="captcha-wrap-ft" v-if="!reviewing"> <view class="captcha-wrap-ft">
<u-code <u-code
ref="uCode" ref="uCode"
seconds="30" seconds="30"
@@ -141,7 +119,7 @@
</u-cell> </u-cell>
</u-form-item> </u-form-item>
<u-form-item prop="qualification"> <u-form-item prop="qualification">
<view class="full-title"> <view class="licence-section">
<u-cell :border="false"> <u-cell :border="false">
<template #icon> <template #icon>
<text class="required">*</text> <text class="required">*</text>
@@ -154,16 +132,22 @@
<view class="licence-image"> <view class="licence-image">
<u-cell :border="false"> <u-cell :border="false">
<template #title> <template #title>
<u-upload <view class="box-upload" @click="chooseLogoImg('licence')">
:maxCount="9" <view
:fileList="quaPics" v-if="!form.qualification"
:disabled="reviewing" class="btn-upload"
:deletable="!reviewing" >上传图片</view>
name="quaPics" <view v-else>
multiple <view v-if="qualificationArr.length > 0" class="flex">
@afterRead="quaAfterRead" <image
@delete="quaDeletePic" v-for="(item, index) in qualificationArr"
/> :key="index"
:src="item"
class="img-preview"
/>
</view>
</view>
</view>
</template> </template>
</u-cell> </u-cell>
</view> </view>
@@ -210,7 +194,7 @@
撤销申请 撤销申请
</view> </view>
<view <view
v-else-if="reviewStatus !== 1" v-else
class="btn-submit" class="btn-submit"
@click="onSubmit" @click="onSubmit"
> >
@@ -223,7 +207,7 @@
@cancel="changeRemove(false)" @cancel="changeRemove(false)"
@confirm="onRemove" @confirm="onRemove"
/> />
<u-popup :show="show" mode="center" round="10" @close="handlePopupClose"> <u-popup :show="show" mode="center" round="10" @close="show=false">
<view class="popup-body"> <view class="popup-body">
<view class="tc bold">入驻申请须知</view> <view class="tc bold">入驻申请须知</view>
<view class="content"> <view class="content">
@@ -240,6 +224,7 @@
<u-button <u-button
type="error" type="error"
text="确定" text="确定"
:disabled="!isAgree"
@click="save" @click="save"
/> />
</view> </view>
@@ -249,9 +234,9 @@
<script> <script>
import CitySelect from '@/components/CitySelect' import CitySelect from '@/components/CitySelect'
import {getShopData, getWholesaler, removeApply, saveWholesaler, saveWholesalerDraft} from '@/api/join' import {getShopData, getWholesaler, removeApply, saveWholesaler} from '@/api/join'
import {getCity, registerVerify} from '@/api/user' import {getCity, registerVerify} from '@/api/user'
import {chooseImage, uploadImage, formatRichText} from '@/utils' import {chooseImage} from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins' import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
@@ -265,7 +250,6 @@ export default {
tips: '获取验证码', tips: '获取验证码',
form: { form: {
name: '', name: '',
businessLicense: '',
avatar: '', avatar: '',
contact: '', contact: '',
phone: '', phone: '',
@@ -326,7 +310,7 @@ export default {
}, },
district: [], district: [],
address: {}, address: {},
quaPics: [], qualificationArr: [],
isAgree: false, isAgree: false,
show: false, show: false,
notice: '', notice: '',
@@ -348,9 +332,6 @@ 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)
}, },
@@ -393,90 +374,65 @@ 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 = formatRichText(data.merchantApplyNotice) this.notice = 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
this.isDraft = data.isDraft if (data.applyType === 4) {
this.reviewStatus = data.reviewStatus this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus
}
if(data.isDraft === null || data.isDraft === 1) { if(data.isDraft === null || data.isDraft === 1) {
this.show = true this.show = true
} }
console.log(data.reviewStatus); if (data.isDraft !== 1) {
switch (data.reviewStatus) {
switch (data.reviewStatus) { case 0:
case 0: this.stateTitle = '审核中'
this.stateTitle = '审核中' this.stateType = 'primary'
this.stateType = 'primary' this.reviewing = true
this.reviewing = true break;
break; case 1:
case 1: this.reviewing = false
this.stateTitle = '审核通过' break;
this.stateType = 'success' case 2:
this.reviewing = false this.stateTitle = '审核驳回:' + data.reviewMsg
break; this.stateType = 'error'
case 2: this.reviewing = false
this.stateTitle = '审核驳回:' + data.reviewMsg break;
this.stateType = 'error' }
this.reviewing = false
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.form.qualification.split(',').map(item => { this.qualificationArr = this.form.qualification.split(',')
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].filter(Boolean).join(' ') this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
} }
}).finally(() => {
uni.hideLoading()
}) })
}, },
chooseLogoImg(target) { chooseLogoImg(target) {
if (this.reviewing) return if (this.reviewing) return
chooseImage(img => { chooseImage(img => {
if (target === 'avatar') { switch (target) {
this.form.avatar = img case 'avatar':
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 = {
@@ -493,7 +449,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 => {
@@ -529,10 +485,11 @@ export default {
duration: 3000, duration: 3000,
success: () => { success: () => {
this.showRemove = false this.showRemove = false
this.reviewing = false setTimeout(() => {
uni.navigateBack()
}, 3000)
} }
}) })
this.initInfo()
}) })
}, },
@@ -540,37 +497,7 @@ 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(',')
} }
} }
} }
@@ -578,18 +505,6 @@ 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 {
@@ -603,26 +518,14 @@ 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;
@@ -630,7 +533,4 @@ export default {
flex: 1; flex: 1;
} }
} }
.btn-submit{
position: sticky !important;
}
</style> </style>
-11
View File
@@ -24,7 +24,6 @@
: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
@@ -40,7 +39,6 @@
<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 }}
@@ -63,7 +61,6 @@
<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>
@@ -98,13 +95,11 @@
<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 }}
@@ -123,13 +118,11 @@
<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 }}
@@ -147,13 +140,11 @@
<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 }}
@@ -169,7 +160,6 @@
: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
@@ -177,7 +167,6 @@
: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
@@ -1,374 +0,0 @@
<template>
<view class="graphic-guide-page">
<hx-navbar
:fixed="true"
:background-color="[0,[0,0,0,0],[0,0,0,0]]"
statusBarFontColor="#ffffff"
barPlaceholder="hidden"
transparent="auto"
color="#ffffff"
/>
<view v-if="isLoad">
<swiper
v-if="bannerImages.length"
class="banner-swiper"
circular
autoplay
:interval="5000"
>
<swiper-item
v-for="(item, index) in bannerImages"
:key="index"
>
<image
:src="item"
class="banner-image"
mode="aspectFill"
/>
</swiper-item>
</swiper>
<image
v-else-if="detail.image"
:src="detail.image"
class="banner-fallback"
mode="aspectFill"
/>
<view class="article-card">
<view class="article-title">{{ detail.title || '' }}</view>
<view v-if="detail.intro" class="article-intro">
{{ detail.intro }}
</view>
</view>
<view
v-for="(item, index) in detailList"
:key="index"
class="detail-card"
>
<view v-if="item.placeName" class="section-title">
{{ item.placeName }}
</view>
<view v-if="item.content" class="rich-content">
<u-parse :content="item.content" />
</view>
<view
v-if="item.hotelId"
class="shop-card"
@click="goShop(item)"
>
<image
:src="item.hotelLogo || detail.image"
class="shop-logo"
mode="aspectFill"
/>
<view class="shop-main">
<view class="shop-name">{{ item.hotelName || '关联店铺' }}</view>
<view v-if="getServiceTime(item)" class="shop-time-pill">
经营时间{{ getServiceTime(item) }}
</view>
<view v-if="item.hotelAddress" class="shop-address">
{{ item.hotelAddress }}
</view>
</view>
<view class="shop-btn">点击进入</view>
</view>
<view v-if="item.address" class="section-address">
<text>定位{{ item.address }}</text>
</view>
<scroll-view
v-if="item.images && item.images.length"
class="image-scroll"
scroll-x
show-scrollbar="false"
>
<view class="image-list">
<image
v-for="(img, imgIndex) in item.images"
:key="imgIndex"
:src="img"
class="detail-image"
mode="aspectFill"
@click="previewImage(item.images, imgIndex)"
/>
</view>
</scroll-view>
</view>
<view v-if="!detailList.length" class="empty-text">暂无图文内容</view>
</view>
<goo-skeleton v-else />
</view>
</template>
<script>
import { getCountyFamousGraphicGuideContent } from '@/api/qianxian'
export default {
name: 'FamousQianxianGraphicGuide',
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
detail: {}
}
},
computed: {
bannerImages() {
return this.detail.bannerImages || []
},
detailList() {
return this.detail.graphicDetails || []
}
},
onLoad(options) {
const id = options.id
if (!id) {
uni.showToast({
title: '缺少攻略ID',
icon: 'none'
})
return
}
this.getDetailReq(id)
},
methods: {
getDetailReq(id) {
getCountyFamousGraphicGuideContent({
guideId: id
}).then(res => {
const { success, data } = res
if (success) {
this.detail = data || {}
uni.setNavigationBarTitle({
title: this.detail.title || '攻略详情'
})
}
}).finally(() => {
this.isLoad = true
})
},
formatDate(time) {
if (!time) return ''
return time.replace(/-/g, '.').slice(0, 10)
},
previewImage(images = [], index = 0) {
if (!images.length) return
uni.previewImage({
urls: images,
current: index
})
},
getServiceTime(item) {
const start = item.serviceTime || ''
const end = item.serviceEndTime || ''
if (start && end) return `${start}-${end}`
return start || end || ''
},
goShop(item) {
if (!item || !item.hotelId) return
this.$yrouter.push({
path: '/pagesInn/inn/innHome',
query: {
id: item.hotelId
}
})
}
}
}
</script>
<style scoped lang="less">
.graphic-guide-page {
min-height: 100vh;
background: #f6f6f6;
}
.banner-swiper,
.banner-fallback {
width: 100%;
height: 750rpx;
}
.banner-image {
display: block;
width: 100%;
height: 100%;
}
.article-card {
padding: 28rpx 24rpx 32rpx;
position: relative;
z-index: 2;
border-radius: 24rpx;
background: #fff;
}
.article-title {
font-size: 40rpx;
line-height: 56rpx;
color: #333;
font-weight: bold;
}
.article-meta {
margin-top: 12rpx;
font-size: 24rpx;
color: #333;
}
.article-intro {
margin-top: 20rpx;
padding: 20rpx 0rpx;
border-radius: 16rpx;
font-size: 36rpx;
line-height: 44rpx;
color: #333;
// font-weight: bold;
}
.detail-card {
padding: 28rpx 24rpx;
border-radius: 24rpx;
background: #fff;
}
.section-title {
font-size: 36rpx;
line-height: 50rpx;
color: #333;
font-weight: bold;
}
.section-address {
display: flex;
align-items: center;
margin-top: 16rpx;
font-size: 36rpx;
line-height: 40rpx;
color: #333;
font-weight: bold;
}
.address-icon {
width: 28rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
}
.image-list {
display: inline-flex;
flex-wrap: nowrap;
}
.image-scroll {
width: 100%;
margin-top: 24rpx;
white-space: nowrap;
}
.detail-image {
width: 280rpx;
height: 280rpx;
margin-right: 16rpx;
border-radius: 16rpx;
display: block;
}
.detail-image:last-child {
margin-right: 0;
}
.rich-content {
margin-top: 12rpx;
font-size: 28rpx;
line-height: 46rpx;
color: #333;
word-break: break-word;
}
.shop-card {
display: flex;
align-items: center;
margin-top: 12rpx;
padding: 16rpx;
border-radius: 16rpx;
background: #f4f4f4;
}
.shop-logo {
width: 140rpx;
height: 140rpx;
border-radius: 12rpx;
flex-shrink: 0;
}
.shop-main {
flex: 1;
min-width: 0;
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: center;
}
.shop-head {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.shop-name {
font-size: 32rpx;
color: #333;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.shop-time-pill {
display: inline-flex;
align-items: center;
margin-top: 10rpx;
padding: 4rpx 16rpx;
border: 2rpx solid #c52733;
border-radius: 100rpx;
color: #c52733;
font-size: 22rpx;
width: fit-content;
background: transparent;
}
.shop-time-label {
margin-right: 8rpx;
font-weight: bold;
}
.shop-address {
margin-top: 12rpx;
font-size: 24rpx;
line-height: 34rpx;
color: #666;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.shop-btn {
margin-left: 20rpx;
padding: 12rpx 24rpx;
border-radius: 100rpx;
background: #c52733;
color: #fff;
font-size: 26rpx;
font-weight: 500;
flex-shrink: 0;
}
.empty-text {
padding: 120rpx 0;
text-align: center;
font-size: 28rpx;
color: #999;
}
</style>
+6 -32
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" :lazy-load="true" /> <image :src="item.linkHotelLogo" mode="aspectFill" />
</view> </view>
<view class="info-shop-main"> <view class="info-shop-main">
<view class="info-shop-name"> <view class="info-shop-name">
@@ -245,7 +245,6 @@
<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>
@@ -254,14 +253,12 @@
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
@@ -393,7 +390,6 @@
<image <image
:src="item" :src="item"
class="img" class="img"
:lazy-load="true"
@click="showPic(index)" @click="showPic(index)"
/> />
</view> </view>
@@ -417,7 +413,6 @@
: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">
@@ -475,7 +470,6 @@
<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>
@@ -492,7 +486,6 @@
<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>
@@ -510,7 +503,6 @@
<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>
@@ -533,7 +525,6 @@
<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>
@@ -592,11 +583,7 @@
{{ tab.name }} {{ tab.name }}
</view> </view>
</view> </view>
<scroll-view <view class="village-wrap v12-pt-3">
class="village-wrap v12-pt-3"
scroll-y
@scrolltolower="getShopList()"
>
<view class="v12-pa-2 sale-wrap"> <view class="v12-pa-2 sale-wrap">
<view <view
v-for="(type, typeIndex) in shopTypeList" v-for="(type, typeIndex) in shopTypeList"
@@ -618,13 +605,11 @@
<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 }}
@@ -639,7 +624,6 @@
<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 }}
@@ -649,7 +633,7 @@
</view> </view>
</view> </view>
<view v-else class="no-data">暂无店铺</view> <view v-else class="no-data">暂无店铺</view>
</scroll-view> </view>
</view> </view>
</view> </view>
<view v-if="shopList.length > 0" class="load-more-status"> <view v-if="shopList.length > 0" class="load-more-status">
@@ -674,11 +658,7 @@
{{ tab.name }} {{ tab.name }}
</view> </view>
</view> </view>
<scroll-view <view class="village-wrap">
class="village-wrap"
scroll-y
@scrolltolower="getJiaLouListReq()"
>
<view class="v12-pa-2 sale-wrap"> <view class="v12-pa-2 sale-wrap">
</view> </view>
@@ -721,7 +701,7 @@
</view> </view>
</view> </view>
<view v-else class="no-data">暂无数据</view> <view v-else class="no-data">暂无数据</view>
</scroll-view> </view>
</view> </view>
</view> </view>
<view v-if="jiaLouList.length > 0" class="load-more-status"> <view v-if="jiaLouList.length > 0" class="load-more-status">
@@ -1840,13 +1820,7 @@ export default {
this.hotelItemClick({ id: linkHotelId }) this.hotelItemClick({ id: linkHotelId })
}, },
guideItemClickHandle(item) { guideItemClickHandle(item) {
if (!item || !item.id) return // 如果没有开启专题页,则不进入
const guideType = item.guideType || 'topic'
if (guideType === 'graphic') {
uni.navigateTo({ url: `/pkg_product/views/famousQianxianGraphicGuide?id=${item.id}` })
return
}
// topic 类型保持原逻辑
if (!item.isContentPage) return if (!item.isContentPage) return
uni.navigateTo({ url: `/pkg_product/views/famousQianxianTheme?id=${item.id}` }) uni.navigateTo({ url: `/pkg_product/views/famousQianxianTheme?id=${item.id}` })
}, },
+36 -97
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">¥{{ displayRefundAmount }}</view> <view class="v12-font-32 v12-primary-text v12-font-bold">¥{{refundAmount}}</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">¥{{ displayOrderAmount }}</text> <text class="v12-font-32 v12-font-bold">¥{{orderAmount}}</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">¥{{ displayDeductionAmount }}</text> <text class="v12-primary-text">¥{{deductionAmount}}</text>
</view> </view>
</view> </view>
@@ -49,26 +49,19 @@
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="v12-mt-3"> <view class="v12-mt-3">
<button <button class="submit-btn v12-primary v12-white-text v12-radius-100 v12-font-32" block @click="submitRefund">点击确认退款</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 { fetchSojoumOrderDetail, sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js' import { sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js'
export default { export default {
data() { data() {
return { return {
refundAmount: '', refundAmount: '',
orderAmount: '', orderAmount: '',
deductionAmount: '', deductionAmount: '',
refundStatus: 0,
refundReasons: [ refundReasons: [
'行程变更', '行程变更',
'定错时间/地址', '定错时间/地址',
@@ -79,22 +72,7 @@ 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) {
@@ -102,63 +80,21 @@ export default {
this.getRefundInfo(opts.id) this.getRefundInfo(opts.id)
}, },
methods: { methods: {
async getRefundInfo(id) { getRefundInfo(id) {
try { sojoumOrderRefundInfo({
const [refundRes, orderRes] = await Promise.all([ orderId: id
sojoumOrderRefundInfo({ }).then(res => {
orderId: id if (res.status === 200) {
}), this.refundAmount = res.data.refundPrice
fetchSojoumOrderDetail({ this.orderAmount = res.data.payPrice
key: id 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 选择的退款原因
@@ -186,7 +122,6 @@ 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({
@@ -198,7 +133,6 @@ export default {
}) })
} }
}).finally(() => { }).finally(() => {
this.submitting = false
uni.hideLoading(); uni.hideLoading();
}) })
} }
@@ -295,22 +229,27 @@ export default {
} }
} }
.submit-btn { .submit-section {
width: 100%; position: fixed;
height: 80rpx; bottom: 0;
line-height: 80rpx; left: 0;
text-align: center; right: 0;
color: #fff; padding: 30rpx;
font-size: 28rpx; background-color: #fff;
border-radius: 40rpx; box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
border: none;
letter-spacing: 4rpx;
font-weight: 500;
}
.submit-btn-disabled { .submit-btn {
background-color: #c0c4cc !important; width: 100%;
color: #ffffff !important; height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
font-size: 28rpx;
border-radius: 40rpx;
border: none;
letter-spacing: 4rpx;
font-weight: 500;
}
} }
} }
</style> </style>
+4 -8
View File
@@ -333,8 +333,7 @@ export default {
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/MyOrder/index", path: "/pages/order/MyOrder/index",
query: { query: {
type: 1, type: 1
tabIndex: 1
} }
}); });
break; break;
@@ -356,8 +355,7 @@ export default {
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/MyOrder/index", path: "/pages/order/MyOrder/index",
query: { query: {
type: 1, type: 1
tabIndex: 1
} }
}) })
break; break;
@@ -367,8 +365,7 @@ export default {
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/MyOrder/index", path: "/pages/order/MyOrder/index",
query: { query: {
type: 1, type: 1
tabIndex: 1
} }
}) })
}) })
@@ -379,8 +376,7 @@ export default {
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/MyOrder/index", path: "/pages/order/MyOrder/index",
query: { query: {
type: 1, type: 1
tabIndex: 1
} }
}); });
}) })
@@ -1,164 +0,0 @@
<template>
<u-popup
:show="show"
mode="bottom"
round="40rpx"
:customStyle="{height: '600rpx'}"
@close="close"
>
<view class="cover-picker v12-pt-4">
<swiper
:current="currentIndex"
:autoplay="false"
:circular="true"
:indicator-dots="false"
@change="onChange"
previous-margin="180rpx"
next-margin="180rpx"
class="cover-swiper"
>
<swiper-item v-for="(item, i) in list" :key="i" class="cover-swiper-item" :class="{'n-actived' : currentIndex !== i}">
<view class="cover-item" :class="{'ios-cover': isIOS}">
<view class="img-wrap">
<image :src="item.cover" class="cover-image" mode="widthFix" />
</view>
</view>
</swiper-item>
</swiper>
<view class="v12-justify-center">
<view class="cover-confirm" @click="confirm">
确定
</view>
</view>
<view class="tips">礼包封面在对方领取时展示</view>
<view class="tips tips2">*图片由云灵AI生成仅供参考</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
index: {
type: Number,
default: 0
},
show: {
type: Boolean,
default: true
},
list: {
type: Array,
default: () => []
}
},
data() {
return {
currentIndex: this.index
}
},
computed: {
isIOS() {
return uni.getSystemInfoSync().osName === 'ios'
}
},
watch: {
index(val) {
this.currentIndex = val
},
show(val) {
if (val) {
this.currentIndex = this.index
}
}
},
methods: {
close() {
this.currentIndex = 0
this.$emit('update:show', false)
},
onChange(e) {
this.currentIndex = e.detail.current
this.$forceUpdate()
},
confirm() {
this.$emit('confirm', this.list[this.currentIndex])
this.$emit('update:show', false)
}
}
}
</script>
<style lang="less" scoped>
.n-actived{
.cover-item{
transform: scale(0.8);
margin-bottom: -70rpx !important;
}
}
.cover-swiper-item{
height: fit-content !important;
bottom: 0;
overflow: visible;
}
.img-wrap{
position: relative;
overflow: visible;
}
.tips{
font-size: 24rpx;
color: #999;
text-align: center;
margin-top: 20rpx;
}
.tips2{
color: #C52733;
}
.cover-swiper{
height: 800rpx;
}
.cover-picker {
.cover-title {
padding: 30rpx;
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
}
.cover-item {
display: flex;
flex-direction: column;
align-items: center;
overflow: visible;
transition: all .3s ease-in-out;
margin-bottom: 30rpx;
.cover-image {
width: 420rpx;
// height: 580rpx;
border-radius: 16rpx;
transition: all .2s ease-in-out;
}
.cover-name {
margin-top: 20rpx;
font-size: 28rpx;
color: #333;
}
}
.cover-confirm {
margin-top: 40rpx;
width: 240rpx;
height: 80rpx;
border-radius: 16rpx;
font-size: 32rpx;
background-color: #C52733 !important;
color: #fff !important;
text-align: center;
line-height: 80rpx;
}
}
.ios-cover{
zoom: 1.01
}
</style>
+13 -30
View File
@@ -1,42 +1,25 @@
<template> <template>
<view class="dialog-conent" v-show="isLogin"> <view class="dialog-conent" v-show="isLogin">
<view class="gift-card-modal" :class="{'ios-cover': isIOS}"> <view class="gift-card-modal" :class="{'ios-cover': isIOS}">
<image <image class="bg-image" :src="!card.isBlind ? card.cover : card.blindBoxImage" mode="widthFix" lazy-load="false"></image>
class="bg-image" <view v-if="card.isBlind !== 1" class="image-wrap" :style="{
:src="!card.isBlind ? card.cover : card.blindBoxImage" top: card.productImageY*2 + 'rpx',
mode="widthFix" left: card.productImageX*2+ 'rpx'
lazy-load="false" }">
/> <image v-if="!isTravelGroup" class="pro-image" :src="card.giftProducts[0].productImage" mode="aspectFit|aspectFill|widthFix" lazy-load="false">
<view
v-if="card.isBlind !== 1 && !card.isUseAiCoverImg" </image>
:style="{ <image v-if="isTravelGroup" class="pro-image" :src="card.travelGroupProduct.mainImage" mode="aspectFit|aspectFill|widthFix" lazy-load="false">
top: card.productImageY*2 + 'rpx',
left: card.productImageX*2+ 'rpx' </image>
}"
class="image-wrap"
>
<image
v-if="!isTravelGroup"
:src="card.giftProducts[0].productImage"
mode="aspectFit|aspectFill|widthFix"
lazy-load="false"
class="pro-image"
/>
<image
v-if="isTravelGroup"
:src="card.travelGroupProduct.mainImage"
mode="aspectFit|aspectFill|widthFix"
lazy-load="false"
class="pro-image"
/>
</view> </view>
<view <view
v-if="card.isBlind !== 1 && card.giftProducts && card.giftProducts[0].productStory && card.isShowProductStory && !card.isUseAiCoverImg" class="good-story"
v-if="card.isBlind !== 1 && card.giftProducts && card.giftProducts[0].productStory && card.isShowProductStory"
:style="{ :style="{
right: (card.productStoryX*2 || 0) + 'rpx', right: (card.productStoryX*2 || 0) + 'rpx',
top: (card.productStoryY*2 || 0) + 'rpx' top: (card.productStoryY*2 || 0) + 'rpx'
}" }"
class="good-story"
> >
<view v-for="(line, j) in card.giftProducts[0].productStory.split('/n')" :key="j">{{ line }}</view> <view v-for="(line, j) in card.giftProducts[0].productStory.split('/n')" :key="j">{{ line }}</view>
</view> </view>
+31 -507
View File
@@ -1,87 +1,9 @@
<template> <template>
<view <view class="gift-page" v-if="(goodsInfo.productInfo && goodsInfo.productInfo.storeName) || isGroupBuy">
v-if="isLoad && ((goodsInfo.productInfo && goodsInfo.productInfo.storeName) || isGroupBuy)" <view class="top-card" v-if="!isPayOk ">
class="gift-page" <view class="v12-justify-between" @click="handleShowCover">
>
<view class="top-card" v-if="!isPayOk">
<view class="top-tab-nav-wrap">
<view
:class="{'active': selectCoverType === 'default'}"
class="item item1"
@click="toggleSelectCoverType('default')"
>
<view class="txt">选择礼包封面</view>
<image :src="webUrl + '/page/gift/gift-tab01.png'" class="tab-img"></image>
</view>
<view
:class="{'active': selectCoverType === 'ai'}"
class="item item2"
@click="toggleSelectCoverType('ai')"
>
<view class="txt">AI生成礼包封面</view>
<image :src="webUrl + '/page/gift/gift-tab02.png'" class="tab-img"></image>
</view>
</view>
<view
v-if="selectCoverType === 'default'"
class="v12-justify-between"
style="margin-top: -1px;"
@click="handleShowCover"
>
<image class="popCover" :src="popupCover" mode="widthFix" lazy-load="false"></image> <image class="popCover" :src="popupCover" mode="widthFix" lazy-load="false"></image>
</view> </view>
<view
v-if="selectCoverType === 'ai'"
class="ai-cover-wrap"
>
<view class="ai-cover-body">
<view class="ai-cover-container">
<view v-if="showGenerateBtn" class="prompt">
<textarea
v-model.trim="aiCoverDesc"
:maxlength="300"
placeholder="请描述你想生成的图片"
class="prompt-textarea"
/>
<p class="prompt-tips">{{ aiCoverDesc.length }}/300</p>
</view>
<view v-else class="imgs-list-wrap">
<view class="img-item" v-for="(item, index) in aiCoverImgsList" :key="index">
<image
:src="item.cover"
:class="{
'active': item.id === selectedAiCoverImage.id
}"
mode="heightFix"
class="img-image"
@click="handleSelectAiCover(item)"
/>
</view>
</view>
</view>
<view class="ai-cover-bottom">
<view v-if="showGenerateBtn" class="btn-wrap">
<view class="btn" @click="handleGenerateAiCover">
{{ aiCoverGenerateLoading ? '礼包封面生成中...' : 'AI生成礼包封面' }}
<image v-if="!aiCoverGenerateLoading" :src="webUrl + '/page/gift/gift-tab-icon01.png'" class="icon"></image>
</view>
<image
v-if="aiCoverGenerateLoading && settingInfo.giftCardT2ILoadingGif"
:src="settingInfo.giftCardT2ILoadingGif"
class="loading-img"
/>
</view>
<view v-else class="btn-wrap">
<view class="btn" @click="handleShowAiCover">
预览
</view>
<view class="btn btn2" @click="handleGenerateAgain">
重新生成
</view>
</view>
</view>
</view>
</view>
</view> </view>
<view class="gift-good-card"> <view class="gift-good-card">
<view class="v12-align-center v12-justify-start"> <view class="v12-align-center v12-justify-start">
@@ -173,7 +95,7 @@
<text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text> <text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text>
</view> </view>
</view> </view>
<view v-if="!isCountyLotteryGift" class="v12-justify-between v12-align-center v12-font-28 v12-mt-1"> <view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
<view class="v12-font-24 v12-dark-text v12-align-center"> <view class="v12-font-24 v12-dark-text v12-align-center">
<view class=""> <view class="">
优惠券 优惠券
@@ -208,7 +130,7 @@
</view> </view>
</button> </button>
<view class="btn-wrap v12-mt-12 v12-justify-center" v-if="!isPayOk"> <view class="btn-wrap v12-mt-12 v12-justify-center" v-if="!isPayOk">
<view class="gift-submit" @click="payNowToSendGift">付款并赠送</view> <view class="gift-submit" @click="showPayPicker = true">付款并赠送</view>
</view> </view>
<view class="btn-wrap v12-mt-14 v12-justify-center" v-if="isPayOk && !isGroupBuy"> <view class="btn-wrap v12-mt-14 v12-justify-center" v-if="isPayOk && !isGroupBuy">
<view class="gift-submit" @click="makeAgain">再送一份</view> <view class="gift-submit" @click="makeAgain">再送一份</view>
@@ -226,12 +148,6 @@
:index="defaultIndex" :index="defaultIndex"
:message="message" :message="message"
/> />
<AiCoverPicker
:show.sync="showAiCoverPicker"
:list="aiCoverImgsList"
:index="aiDefaultIndex"
@confirm="onAiCoverConfirm"
/>
<passkeyborad <passkeyborad
ref='payPwdPop' ref='payPwdPop'
showMoney showMoney
@@ -247,7 +163,6 @@
@confirm="onPayConfirm" @confirm="onPayConfirm"
/> />
<u-popup <u-popup
v-if="!isCountyLotteryGift"
:show="showPopup" :show="showPopup"
:round="10" :round="10"
mode="bottom" mode="bottom"
@@ -300,25 +215,18 @@ import {
createGroupBuyGift, createGroupBuyGift,
createSojoumGroupBuyGift, createSojoumGroupBuyGift,
fetchSojoumGroupBuyGiftCarousel, fetchSojoumGroupBuyGiftCarousel,
computedSojoumGroupBuyGiftOrderPrice, computedSojoumGroupBuyGiftOrderPrice
aiGiftImageGenerate,
aiGiftImageStatus
} from '@/api/gift' } from '@/api/gift'
import {
getAiSystemInfoSetting
} from '@/api/public'
import { weappPay } from "@/libs/wechat"; import { weappPay } from "@/libs/wechat";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import giftTips from './components/giftTips.vue' import giftTips from './components/giftTips.vue'
import CoverPicker from './components/CoverPicker.vue' import CoverPicker from './components/CoverPicker.vue'
import AiCoverPicker from './components/AiCoverPicker.vue'
import PayPicker from './components/PayPicker.vue'; import PayPicker from './components/PayPicker.vue';
import CouponsPopup from "@/components/CouponsPopup.vue" import CouponsPopup from "@/components/CouponsPopup.vue"
export default { export default {
components: { components: {
giftTips, giftTips,
CoverPicker, CoverPicker,
AiCoverPicker,
PayPicker, PayPicker,
passkeyborad, passkeyborad,
CouponsPopup CouponsPopup
@@ -326,13 +234,9 @@ export default {
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
loading: true, loading: true,
// 盲盒礼包
isBlind: false, isBlind: false,
// 一人领取所有礼品
isOneRecipient: false, isOneRecipient: false,
// 是否支持好友转赠
canTransfer: false, canTransfer: false,
message: '', message: '',
cartId: '', cartId: '',
@@ -353,7 +257,6 @@ export default {
isShowPayPwdPop: false, isShowPayPwdPop: false,
payPassword: '', payPassword: '',
payType: '', payType: '',
// 是否支付成功
isPayOk: false, isPayOk: false,
giftKey: '', giftKey: '',
payPrice: 0, payPrice: 0,
@@ -367,57 +270,17 @@ export default {
}, },
couponTitle: '', couponTitle: '',
showPopup: false, showPopup: false,
// 盲盒礼包图片
blindImage: '', blindImage: '',
// 是否为旅居团购礼品
isGroupBuy: false, isGroupBuy: false,
popupCover: '', popupCover: '',
showInput: true, showInput: true,
// 是否为县区抽奖礼品
isCountyLotteryGift: false, isCountyLotteryGift: false,
// 县域抽奖弹窗
showLotteryGiftPopup: false, showLotteryGiftPopup: false,
isEligibleForDraw: false, isEligibleForDraw: false
// 封面切换: default/ai
selectCoverType: 'default',
aiCoverImgsList: [
/*
{
id: 15,
cover: 'https://resource.xdd618.com/1/20251202/1764661118796_中秋 2礼品卡1202.png',
image: 'https://resource.xdd618.com/1/20251202/1764661118797_中秋2 对话框封面.png'
},
{
id: 23,
cover: 'https://resource.xdd618.com/1/20251202/1764661193306_中秋 3礼品卡1202.png',
image: 'https://resource.xdd618.com/1/20251202/1764661193306_中秋3 对话框封面.png'
},
{
id: 41,
cover: 'https://resource.xdd618.com/1/20251202/1764661506015_特色好礼礼品卡1202.png',
image: 'https://resource.xdd618.com/1/20250902/1756781423380_特色好礼对话框封面定稿.png'
}
*/
],
showGenerateBtn: true,
aiCoverGenerateLoading: false,
settingInfo: {},
aiCoverDesc: '',
selectedAiCoverImage: {},
showAiCoverPicker: false,
pollInterval: null,
aiDefaultIndex: 0
} }
}, },
watch: { watch: {
async couponId(value) { async couponId(value) {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (Number(value || 0) !== 0) {
this.couponId = 0
return
}
}
this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value) this.couponIndex = this.couponList['usable']?.findIndex(item => item.id === +value)
this.couponTitle = this.couponList['usable']?.[this.couponIndex]?.couponTitle this.couponTitle = this.couponList['usable']?.[this.couponIndex]?.couponTitle
if(this.isGroupBuy) { if(this.isGroupBuy) {
@@ -428,12 +291,11 @@ export default {
} }
}, },
onLoad(opts) { onLoad(opts) {
const pageQuery = Object.assign({}, this.resolvePageQuery(), opts || {}) this.cartId = opts.cartId
this.cartId = pageQuery.cartId this.isGroupBuy = opts.isGroupBuy === '1'
this.isGroupBuy = pageQuery.isGroupBuy === '1' this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
this.isCountyLotteryGift = pageQuery.from === 'countyLottery' || pageQuery.isCountyLotteryGift === '1' || !!pageQuery.drawActivityId
// this.couponId = opts.couponId || 0 // this.couponId = opts.couponId || 0
this.discount = pageQuery.discount this.discount = opts.discount
if(this.isGroupBuy) { if(this.isGroupBuy) {
this.getGroupBuyInfo() this.getGroupBuyInfo()
} else { } else {
@@ -442,16 +304,6 @@ export default {
fetchSojoumGroupBuyGiftCarousel().then(res => { fetchSojoumGroupBuyGiftCarousel().then(res => {
this.popupCover = res.data[0] this.popupCover = res.data[0]
}) })
getAiSystemInfoSetting().then(res => {
const { success, data } = res
if (success) {
this.settingInfo = data
this.aiCoverDesc = data.giftCardT2IPromptTemplate || ''
}
})
},
onUnload() {
this.clearIntervalPoll()
}, },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
@@ -472,128 +324,6 @@ export default {
} }
}, },
methods: { methods: {
// 將面切换
toggleSelectCoverType(type) {
if (this.selectCoverType === type) return
this.selectCoverType = type
},
handleGenerateAiCover() {
if (!this.aiCoverDesc || !this.aiCoverDesc.trim()) {
uni.showToast({
title: '请先配置文生图提示词',
icon: 'none'
})
return
}
if (this.aiCoverGenerateLoading) return
if (this.pollInterval) return
// 点击生成后,禁用按钮,防止重复点击
this.aiCoverGenerateLoading = true
aiGiftImageGenerate({
prompt: this.aiCoverDesc,
productId: this.goodsInfo.productId
}).then(res => {
const { success, data } = res
if (success) {
this.aiDefaultIndex = 0
this.selectedAiCoverImage = {}
this.aiCoverImgsList = []
// 轮询查询状态
this.pollAiImageGenerateStatus()
}
}).catch(() => {
this.aiCoverGenerateLoading = false
})
},
pollAiImageGenerateStatus() {
const _this = this
this.pollInterval = setInterval(() => {
aiGiftImageStatus({
productId: _this.goodsInfo.productId
}).then(res => {
const { success, data } = res
if (success && data) {
// status: 0=生成中 / 1=成功 / 2=失败(无任何记录时为 null)
if (data.status === 1 || data.status === 2) {
_this.clearIntervalPoll()
}
if (data.status === 1 && data.groups && data.groups.length) {
_this.selectedAiCoverImage = data.groups[0]
_this.aiCoverImgsList = []
data.groups.map(item => {
_this.aiCoverImgsList.push({
id: item.id,
cover: item.coverUrl,
image: item.shareUrl,
name: item.name || ''
})
})
_this.selectedAiCoverImage = _this.aiCoverImgsList[0]
// 封面图片
_this.selectedCover = _this.selectedAiCoverImage.cover
// 分享对话图片
_this.giftImage = _this.selectedAiCoverImage.image
console.log(_this.selectedCover)
console.log(_this.giftImage)
_this.showGenerateBtn = false
_this.aiCoverGenerateLoading = false
}
} else {
_this.aiCoverGenerateLoading = false
_this.showGenerateBtn = true
}
}).catch(() => {
_this.aiCoverGenerateLoading = false
_this.showGenerateBtn = true
})
}, 2000)
},
clearIntervalPoll() {
if (this.pollInterval) {
clearInterval(this.pollInterval)
this.pollInterval = null
}
},
handleGenerateAgain() {
this.aiDefaultIndex = 0
this.selectedAiCoverImage = {}
this.aiCoverImgsList = []
this.showGenerateBtn = true
this.aiCoverGenerateLoading = false
},
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
getCouponId() {
if (this.isCountyLotteryGift) return 0
return this.couponId || 0
},
isCountyLotteryCartItem(item) {
return Number(
(item && item.drawActivityId) ||
(item && item.productInfo && item.productInfo.drawActivityId) ||
0
) > 0
},
syncCountyLotteryGiftFlag(item) {
if (!this.isCountyLotteryGift && this.isCountyLotteryCartItem(item)) {
this.isCountyLotteryGift = true
}
if (!this.isCountyLotteryGift) return
this.couponTitle = ''
if (Number(this.couponId || 0) !== 0) {
this.couponId = 0
}
},
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) { adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
if (!productInfo || !productInfo.productStory) { if (!productInfo || !productInfo.productStory) {
return { return {
@@ -626,19 +356,14 @@ export default {
computedTravelGroupPrice(useDefaultCouponId) { computedTravelGroupPrice(useDefaultCouponId) {
const params = { const params = {
key: this.orderKey, key: this.orderKey,
couponId: this.getCouponId() couponId: this.couponId
} }
computedSojoumGroupBuyGiftOrderPrice(params).then(res => { computedSojoumGroupBuyGiftOrderPrice(params).then(res => {
this.computedResult = res.data.result this.computedResult = res.data.result
this.couponList = res.data.result.couponList this.couponList = res.data.result.couponList
this.payPrice = res.data.result.payPrice this.payPrice = res.data.result.payPrice
this.$forceUpdate() this.$forceUpdate()
if (this.isCountyLotteryGift) { if(useDefaultCouponId) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(useDefaultCouponId) {
this.couponId = res.data.result.defaultCouponId || 0 this.couponId = res.data.result.defaultCouponId || 0
} }
}) })
@@ -646,11 +371,7 @@ export default {
handleShowCover() { handleShowCover() {
this.showCoverPicker = true this.showCoverPicker = true
}, },
handleShowAiCover() {
this.showAiCoverPicker = true
},
showCouponsPopup() { showCouponsPopup() {
if (this.isCountyLotteryGift) return
if (this.couponList.usable && this.couponList.usable.length === 0) return if (this.couponList.usable && this.couponList.usable.length === 0) return
if(this.isPayOk) return if(this.isPayOk) return
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
@@ -659,7 +380,6 @@ export default {
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
}, },
changeCoupons(item) { changeCoupons(item) {
if (this.isCountyLotteryGift) return
if(!item) return if(!item) return
if (this.couponList.usable && this.couponList.usable.length === 0) return if (this.couponList.usable && this.couponList.usable.length === 0) return
this.showPopup = !this.showPopup this.showPopup = !this.showPopup
@@ -697,17 +417,11 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id this.templateId = template.id
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId) this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
console.log(this.defaultIndex, 'defaultIndex'); console.log(this.defaultIndex, 'defaultIndex');
this.selectedCover = template.cover this.selectedCover = template.cover
this.giftImage = template.image this.giftImage = template.image
if (this.selectCoverType === 'ai') {
this.selectedCover = this.selectedAiCoverImage.cover
this.giftImage = this.selectedAiCoverImage.image
this.templateId = this.selectedAiCoverImage.id
}
this.couponId = '' this.couponId = ''
this.computedPrice(this.goodsInfo.cartNum) this.computedPrice(this.goodsInfo.cartNum)
}) })
@@ -734,7 +448,7 @@ export default {
computedPrice(num, f) { computedPrice(num, f) {
const params = { const params = {
cartId: this.cartId, cartId: this.cartId,
couponId: this.getCouponId(), couponId: this.couponId,
cartNum : num cartNum : num
} }
if(this.discount) { if(this.discount) {
@@ -742,12 +456,7 @@ export default {
} }
getGiftCardSendOrderAmount(this.orderKey, params).then(res => { getGiftCardSendOrderAmount(this.orderKey, params).then(res => {
this.couponList = res.data.result.couponList this.couponList = res.data.result.couponList
if (this.isCountyLotteryGift) { if(!f) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.couponId = 0
}
} else if(!f) {
this.couponId = res.data.result.defaultCouponId || 0 this.couponId = res.data.result.defaultCouponId || 0
this.$forceUpdate() this.$forceUpdate()
} }
@@ -756,24 +465,6 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}) })
}, },
payNowToSendGift() {
if (this.selectCoverType === 'default') {
this.showPayPicker = true
return
}
if (this.selectCoverType === 'ai') {
if (!this.selectedAiCoverImage.id) {
uni.showToast({
title: '请生成礼包封面再操作',
icon: 'none'
})
return
} else {
this.showPayPicker = true
}
return
}
},
pwdPopFinish(payPwd) { pwdPopFinish(payPwd) {
this.payPassword = payPwd; this.payPassword = payPwd;
this.confirmGift(true); this.confirmGift(true);
@@ -785,27 +476,8 @@ export default {
onCoverConfirm(cover) { onCoverConfirm(cover) {
this.cover = cover.name this.cover = cover.name
this.templateId = cover.id this.templateId = cover.id
// 封面图片
this.selectedCover = cover.cover
// 分享对话图片
this.giftImage = cover.image
},
onAiCoverConfirm(cover) {
// 封面图片
this.selectedCover = cover.cover
// 分享对话图片
this.giftImage = cover.image
if (this.selectCoverType === 'ai') {
this.selectedAiCoverImage = cover
this.aiDefaultIndex = this.aiCoverImgsList.findIndex(item => item.id === cover.id)
}
},
handleSelectAiCover(cover) {
this.selectedAiCoverImage = cover
this.aiDefaultIndex = this.aiCoverImgsList.findIndex(item => item.id === cover.id)
this.selectedCover = cover.cover this.selectedCover = cover.cover
this.giftImage = cover.image this.giftImage = cover.image
this.templateId = cover.id
}, },
showTips() { showTips() {
this.$refs.giftTips.showTips = true this.$refs.giftTips.showTips = true
@@ -826,7 +498,6 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id this.templateId = template.id
this.selectedCover = template.cover this.selectedCover = template.cover
this.giftImage = template.image this.giftImage = template.image
@@ -836,7 +507,6 @@ export default {
// this.couponId = res.data.couponList.usable[0] && res.data.couponList.usable[0].id || '' // this.couponId = res.data.couponList.usable[0] && res.data.couponList.usable[0].id || ''
// } // }
this.computedPrice(this.goodsInfo.cartNum) this.computedPrice(this.goodsInfo.cartNum)
this.isLoad = true
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@@ -844,13 +514,9 @@ export default {
isDrawEligible(flag) { isDrawEligible(flag) {
return flag === true || flag === 1 || flag === '1' || flag === 'true' return flag === true || flag === 1 || flag === '1' || flag === 'true'
}, },
handleGiftPaySuccess(data) { handleGiftPaySuccess(isEligibleForDraw = false) {
if (data.giftCard) {
this.selectedCover = data.giftCard.cover || this.selectedCover
this.giftImage = data.giftCard.giftCardImage || this.giftImage
}
this.isPayOk = true this.isPayOk = true
this.isEligibleForDraw = this.isDrawEligible(data.isEligibleForDraw) this.isEligibleForDraw = this.isDrawEligible(isEligibleForDraw)
if (this.isCountyLotteryGift && this.isEligibleForDraw) { if (this.isCountyLotteryGift && this.isEligibleForDraw) {
this.showLotteryGiftPopup = true this.showLotteryGiftPopup = true
} }
@@ -894,22 +560,19 @@ export default {
key: this.orderKey, key: this.orderKey,
from: 'routine', from: 'routine',
cartId: this.cartId, cartId: this.cartId,
templateId: this.selectCoverType === 'default' ? this.templateId : '', templateId: this.templateId,
aiGiftImageId: this.selectCoverType === 'default' ? '' : this.selectedAiCoverImage.id,
cover: this.selectedCover,
message : this.message || '礼笺轻启,礼藏心意', message : this.message || '礼笺轻启,礼藏心意',
canTransfer: this.canTransfer ? 1 : 0, canTransfer: this.canTransfer ? 1 : 0,
passwordPay: this.payPassword || '', passwordPay: this.payPassword || '',
couponId: this.getCouponId(), couponId: this.couponId,
payType: this.payType, payType: this.payType,
} : { } : {
orderKey: this.orderKey, orderKey: this.orderKey,
from: 'routine', from: 'routine',
cartId: this.cartId, cartId: this.cartId,
couponId: this.getCouponId(), couponId: this.couponId,
recipientsNum: this.goodsInfo.cartNum, recipientsNum: this.goodsInfo.cartNum,
templateId: this.selectCoverType === 'default' ? this.templateId : '', templateId: this.templateId,
aiGiftImageId: this.selectCoverType === 'default' ? '' : this.selectedAiCoverImage.id,
message : this.message || '礼笺轻启,礼藏心意', message : this.message || '礼笺轻启,礼藏心意',
cover: this.selectedCover, cover: this.selectedCover,
canTransfer: this.canTransfer ? 1 : 0, canTransfer: this.canTransfer ? 1 : 0,
@@ -957,7 +620,7 @@ export default {
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
this.handleGiftPaySuccess(data); this.handleGiftPaySuccess(data.isEligibleForDraw);
break; break;
case "WECHAT_H5_PAY": case "WECHAT_H5_PAY":
// H5支付 // H5支付
@@ -974,7 +637,7 @@ export default {
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
this.handleGiftPaySuccess(data); this.handleGiftPaySuccess(data.isEligibleForDraw);
}).catch(err => { }).catch(err => {
// this.makeAgain() // this.makeAgain()
@@ -995,7 +658,7 @@ export default {
}); });
break; break;
} }
}).catch(err => { }) .catch(err => {
console.log(err); console.log(err);
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
@@ -1003,14 +666,6 @@ export default {
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
// Fix bug#6073-订单超时后需自动刷新该页面
if (err.res.statusCode === 5113) {
if(this.isGroupBuy) {
this.getGroupBuyInfo()
} else {
this.getGift()
}
}
}).finally(() => { }).finally(() => {
this.isShowPayPwdPop = false; this.isShowPayPwdPop = false;
this.$refs.payPwdPop.clear();//清空支付密码 this.$refs.payPwdPop.clear();//清空支付密码
@@ -1021,7 +676,6 @@ export default {
const params = { const params = {
travelGroupProductId: this.cartId travelGroupProductId: this.cartId
} }
this.isLoad = false
createGroupBuyGift(params).then(res => { createGroupBuyGift(params).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.coverList = res.data.giftCardTemplates || [] this.coverList = res.data.giftCardTemplates || []
@@ -1037,7 +691,6 @@ export default {
} }
this.giftNotice = res.data.giftCardGiftNotice this.giftNotice = res.data.giftCardGiftNotice
this.computedTravelGroupPrice(true) this.computedTravelGroupPrice(true)
this.isLoad = true
} }
}) })
} }
@@ -1105,7 +758,11 @@ export default {
border-radius: 16rpx; border-radius: 16rpx;
} }
.tip-wrap{ .tip-wrap{
margin: 32rpx auto 68rpx auto; position: absolute;
bottom: 50rpx;
left: 0;
margin: auto;
right: 0;
align-items: center; align-items: center;
} }
.tip-text{ .tip-text{
@@ -1131,6 +788,7 @@ export default {
} }
.top-card{ .top-card{
// height: 280rpx; // height: 280rpx;
background: #fff;
border-radius: 16rpx; border-radius: 16rpx;
} }
.line{ .line{
@@ -1183,6 +841,7 @@ export default {
} }
.popCover{ .popCover{
width: 100%; width: 100%;
border-radius: 16rpx;
} }
.lottery-gift-popup{ .lottery-gift-popup{
background: #fff; background: #fff;
@@ -1258,139 +917,4 @@ export default {
.lottery-gift-btn.send::after{ .lottery-gift-btn.send::after{
border: none; border: none;
} }
.top-tab-nav-wrap {
display: flex;
justify-content: space-between;
align-items: center;
.item1 {
.txt {
left: -24rpx;
}
}
.item2 {
.txt {
padding-left: 32rpx;
}
}
.item {
position: relative;
flex: 1;
text-align: center;
font-size: 32rpx;
color: #333;
line-height: 80rpx;
&.active {
color: #fff;
.tab-img {
display: block;
}
}
.txt {
position: relative;
z-index: 5;
}
.tab-img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 80rpx;
display: none;
}
}
}
.ai-cover-wrap {
padding: 20rpx;
margin-top: -1px;
box-sizing: border-box;
border-radius: 40rpx 0 40rpx 40rpx;
background-color: #C52932;
.ai-cover-body {
padding: 20rpx;
box-sizing: border-box;
border-radius: 40rpx;
background-color: #fff;
}
.ai-cover-container {
.prompt {
.prompt-textarea {
width: 100%;
height: 200rpx;
background: #fff;
border-radius: 16rpx;
padding: 0 20rpx 12rpx 20rpx;
box-sizing: border-box;
overflow-y: auto;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.prompt-tips {
font-size: 24rpx;
color: #999;
text-align: right;
}
}
.imgs-list-wrap {
display: flex;
justify-content: space-around;
align-items: baseline;
gap: 24rpx;
padding: 20rpx 0;
box-sizing: border-box;
}
.img-image {
display: block;
height: 176rpx;
&.active {
transform: scale(1.2);
}
}
}
.ai-cover-bottom {
margin-top: 12rpx;
.btn-wrap {
display: flex;
justify-content: center;
align-items: center;
.loading-img {
display: block;
width: 58rpx;
height: 58rpx;
margin-left: 20rpx;
}
}
.btn + .btn {
margin-left: 20rpx;
}
.btn {
display: flex;
justify-content: center;
align-items: center;
height: 54rpx;
line-height: 54rpx;
border-radius: 40rpx;
text-align: center;
font-size: 32rpx;
font-weight: 500;
box-sizing: border-box;
margin: 0;
padding: 0 32rpx;
border: 2rpx solid #c52733;
color: #fff;
background: #c52733;
.icon {
display: block;
width: 28rpx;
height: 28rpx;
margin-left: 16rpx;
}
}
.btn2 {
background: #fff;
color: #c52733;
border: 2rpx solid #c52733;
}
}
}
</style> </style>
+1 -2
View File
@@ -5,8 +5,7 @@
:card="giftCard" :card="giftCard"
:isTravelGroup="isTravelGroup" :isTravelGroup="isTravelGroup"
:addr="giftChooseAddress" :addr="giftChooseAddress"
@receive="onReceive($event)" @receive="onReceive($event)" />
/>
<view v-else> <view v-else>
<view class="no-img-wrap" v-if="isExpire"> <view class="no-img-wrap" v-if="isExpire">
<view class="wrap-box" > <view class="wrap-box" >
+11 -98
View File
@@ -18,16 +18,11 @@
<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', item.badgeText ? 'has-badge' : '']" class="gift-item"
> >
<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"
@@ -140,16 +135,10 @@
<view <view
v-for="(item, index) in receiveList" v-for="(item, index) in receiveList"
:key="index" :key="index"
:class="['gift-item', item.badgeText ? 'has-badge' : '']" class="gift-item"
> >
<view <view
v-if="item.badgeText" v-for="(cart, cartIndex) in item.giftInfos"
: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)"
@@ -157,20 +146,20 @@
> >
<view class="gift-img"> <view class="gift-img">
<image <image
:src="cart._displayImage" :src="cart.productInfo.image"
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._displayName }} {{ cart.productInfo.storeName }}
</view> </view>
<view v-if="cart._displaySku" class="attr-txt"> <view v-if="cart.productInfo.attrInfo" class="attr-txt">
<view class="txt">{{ cart._displaySku }}</view> <view class="txt">{{ cart.productInfo.attrInfo.sku }}</view>
</view> </view>
<view v-if="cart._showPrice" class="price-wrap"> <view class="price-wrap">
<view class="price"> <view class="price">
<text class="prefix"></text>{{ cart._displayPrice }} <text class="prefix"></text>{{ cart.productInfo.attrInfo.price }}
</view> </view>
</view> </view>
</view> </view>
@@ -453,8 +442,7 @@ 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)
const formatList = list.map(item => this.normalizeReceiveGiftItem(item)) this.receiveList = page === 1 ? list : this.receiveList.concat(list)
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
@@ -538,51 +526,6 @@ 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
}, },
@@ -653,40 +596,10 @@ 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;
+5 -50
View File
@@ -17,16 +17,13 @@
</view> </view>
<view class="amount-box"> <view class="amount-box">
<view class="v12-justify-between"> <view class="title bold">提现金额</view>
<view class="title bold">提现金额</view>
<view class="title" @click="showRules">提现规则</view>
</view>
<view class="item acea-row row-middle"> <view class="item acea-row row-middle">
<view class="dollar bold"></view> <view class="dollar bold"></view>
<view class="input"> <view class="input">
<u--input <u--input
v-model="amout" v-model="amout"
placeholder="请输入提现金额" :placeholder="'最低提现金额' + minPrice"
:maxlength="-1" :maxlength="-1"
:customStyle="{ :customStyle="{
'border': 0 'border': 0
@@ -71,25 +68,18 @@
</block> </block>
</blPaymentPasswordInput> </blPaymentPasswordInput>
</uni-popup> </uni-popup>
<uni-popup ref="rulesPopup" class="rules-popup" safe-area background-color="#fff" type="bottom">
<view class="rules-content">
<view class="rules-title">提现规则</view>
<rich-text v-if="withdrawalRules" class="rules-text" :nodes="withdrawalRules" />
<view v-else class="rules-text">暂无提现规则</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import { getBank, bankCardList, postCashInfo, getWithdrawalRules } from "@/api/user"; import { getBank, bankCardList, postCashInfo } from "@/api/user";
import NP from "number-precision"; import NP from "number-precision";
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import { pageListenMixins } from '@/mixins/pageListenMixins' import { pageListenMixins } from '@/mixins/pageListenMixins'
import { formatRichText } from '@/utils'
export default { export default {
mixins: [pageListenMixins], mixins: [pageListenMixins],
@@ -107,8 +97,7 @@ export default {
gdLimit: 0, //最低固定费率额度 gdLimit: 0, //最低固定费率额度
feeRate: 0, //手续费费率 feeRate: 0, //手续费费率
remark: "", //提现说明 remark: "", //提现说明
pageKeyId: Object.freeze('userExtractIndex'), pageKeyId: Object.freeze('userExtractIndex')
withdrawalRules: '',
} }
}, },
components: { components: {
@@ -146,12 +135,6 @@ export default {
} }
}, },
methods: { methods: {
showRules() {
getWithdrawalRules().then(res => {
this.withdrawalRules = formatRichText(res.data);
this.$refs.rulesPopup.open();
})
},
calculateSxf: function (amout) { calculateSxf: function (amout) {
var sxf = 0; var sxf = 0;
if (amout == 0) { if (amout == 0) {
@@ -494,32 +477,4 @@ export default {
line-height: 40rpx; line-height: 40rpx;
text-decoration: underline; text-decoration: underline;
} }
.rules-popup /deep/ .uni-popup__wrapper-box {
background: #FFFFFF;
border-radius: 24rpx 24rpx 0 0;
}
.rules-content {
padding: 32rpx;
padding-bottom: calc(32rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(32rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.rules-title {
margin-bottom: 24rpx;
color: #333333;
font-size: 32rpx;
font-weight: bold;
line-height: 44rpx;
text-align: center;
}
.rules-text {
color: #666666;
font-size: 26rpx;
line-height: 40rpx;
word-break: break-all;
}
</style> </style>
-9
View File
@@ -9,15 +9,6 @@ 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);
-12
View File
@@ -34,7 +34,6 @@ export default {
pages: 0, // 总页数 pages: 0, // 总页数
list: [], list: [],
os: '', os: '',
isClick: false, // 防止连续点击重复请求/跳转
pageKeyId: Object.freeze('investmentList') pageKeyId: Object.freeze('investmentList')
} }
}, },
@@ -42,10 +41,6 @@ export default {
this.getOS() this.getOS()
this.getData() this.getData()
}, },
onShow() {
// 从文件阅读页返回时解锁,允许再次点击
this.isClick = false
},
onReachBottom() { onReachBottom() {
if (this.pages >= this.page) this.getData() if (this.pages >= this.page) this.getData()
}, },
@@ -72,8 +67,6 @@ export default {
}) })
}, },
getDetail(id) { getDetail(id) {
if (this.isClick) return
this.isClick = true
investmentInfo(id).then(({data}) => { investmentInfo(id).then(({data}) => {
const file = data.contents[0]; const file = data.contents[0];
if (file.suffix === 'pdf' && this.os === 'android') { if (file.suffix === 'pdf' && this.os === 'android') {
@@ -84,8 +77,6 @@ export default {
url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id
}) })
} }
}).catch(() => {
this.isClick = false
}) })
}, },
viewPdf(url) { viewPdf(url) {
@@ -98,10 +89,8 @@ export default {
fileType: 'pdf', fileType: 'pdf',
success: result => { success: result => {
//成功 //成功
this.isClick = false
}, },
fail: err => { fail: err => {
this.isClick = false
uni.showModal({ uni.showModal({
title: 'openDocument fail', title: 'openDocument fail',
content: JSON.stringify(err) content: JSON.stringify(err)
@@ -110,7 +99,6 @@ export default {
}) })
}, },
fail: err => { fail: err => {
this.isClick = false
uni.showModal({ uni.showModal({
title: 'downloadFile fail', title: 'downloadFile fail',
content: JSON.stringify(err) content: JSON.stringify(err)
+2 -2
View File
@@ -9,8 +9,8 @@
<view class="location-box flex ai-center"> <view class="location-box flex ai-center">
<!-- @click="goCity"--> <!-- @click="goCity"-->
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image> <image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image>
<text class="city-name">当前城市{{ cityName }}</text> <text class="city-name">{{ cityName }}</text>
<text></text> <text>当前定位</text>
</view> </view>
<view class="more-box flex ai-center"> <view class="more-box flex ai-center">
<text @click="goClass">全部商品列表</text> <text @click="goClass">全部商品列表</text>