77 Commits
Author SHA1 Message Date
lifizer b348412c74 Refactor(千县):图片增加懒加载,优化渲染速度
(cherry picked from commit 23f3d8b994)
2026-07-29 17:44:40 +08:00
linxi 82455f87ce Fix:抽奖送礼还能选择优惠券
(cherry picked from commit 80078cae78)
2026-07-28 11:15:21 +08:00
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
lifizer 5d4ad3f427 Chore(入驻):解决合并冲突未完全解决问题 2026-04-27 10:44:38 +08:00
lifizer fd583b7a2e Style(云灵AI):标题调整
(cherry picked from commit 8c1aa62024)
2026-04-27 10:35:06 +08:00
linxi 7dedcf773f Fix:体验店显示判断调整 2026-04-24 18:18:25 +08:00
linxi a8907717b2 Fix:体验店显示判断调整 2026-04-24 14:21:19 +08:00
linxi ed23d2e220 Style:资讯店铺链接优化
(cherry picked from commit a863ee7c85)
2026-04-24 09:18:14 +08:00
linxi 7d55bdf879 Style:体验店封面优化
(cherry picked from commit 49580bc511)
2026-04-24 09:18:09 +08:00
linxi 4b56c2cce7 Fix:订单列表商品图片调大
(cherry picked from commit 341d4d5c70)
2026-04-24 09:18:04 +08:00
linxi 77e900e02c Fix:团购订单核销后没有同步弹出体验券领取弹窗,用户首次进入该团购订单详情页才会显示弹窗
(cherry picked from commit a86b416ed8)
2026-04-24 09:17:58 +08:00
LinCyJang 75e9c404fc Fix:旅居订单增加轮询 2026-04-24 09:17:49 +08:00
linxi 0a70e4af6c Fix:5126 【商城小程序】地址被驳回状态的提示词修改 2026-04-22 15:50:05 +08:00
linxi 11e294bcdc Fix:5173 【商城小程序】首页甄选好礼的轮播,长时间熄屏再打开,首页甄选好礼的轮播会异常卡顿,目前发现有这个现象的机型:iPhone XR、iPhone 16Pro
(cherry picked from commit b4b6fed1ab)
2026-04-22 15:36:24 +08:00
linxi 3e0e1542b6 Fix:5168 【商城小程序】文化图片改为非必填,去除必填标识
(cherry picked from commit 9dc63c2207)
2026-04-22 15:36:18 +08:00
linxi ae3fbf914b Fix:5172 【商城小程序】将左右间距加宽一点
(cherry picked from commit 9fa58286e8)
2026-04-22 15:36:13 +08:00
linxi 8ee399823d Fix:5126 【商城小程序】地址被驳回状态的提示词修改
(cherry picked from commit 3e0940f42c)
2026-04-22 15:36:06 +08:00
LinCyJang dac7c96189 Fix:5168 【商城小程序】文化图片改为非必填,去除必填标识 2026-04-21 20:45:50 +08:00
LinCyJang 458d2b8b65 Fix:5115 【商城小程序】店铺链接数据显示混乱
(cherry picked from commit 505d383bff)
2026-04-21 20:28:35 +08:00
LinCyJang 33a1125294 Fix:5126 【商城小程序】地址被驳回状态的提示词修改
(cherry picked from commit 23af0da8fa)
2026-04-21 20:28:30 +08:00
linxi a2d0ef8dfa Fix:5162 【商城小程序】待收货订单申请退款,退款中状态地址信息部分显示null 2026-04-21 20:27:44 +08:00
LinCyJang b0c4a5621e Fix:5160 【商城小程序】在订单列表购物“正在加载中”状态下快速切换旅居标签,出现数据错位
(cherry picked from commit e3316844e3)
2026-04-21 20:27:10 +08:00
linxi 8c83e0a1bc Fix:5147 【商城小程序】修改地址审核中状态下申请退款,订单详情页只需显示原地址 2026-04-16 10:25:02 +08:00
linxi 97c4d7fe4f Fix:5149 【商城小程序】商品详情页,点击「联系商家」弹出的商家电话弹窗,号码显示空白但可正常跳转拨号 2026-04-16 10:18:53 +08:00
linxi 29827b250a Fix:5148 【商城小程序】列表体验店卡片页面样式调整 2026-04-16 10:16:01 +08:00
linxi edaba70c6e Fix:5150 【商城小程序】体验券按钮栏左右滑动时,按钮内容被异常遮挡,显示不完整 2026-04-16 10:13:29 +08:00
linxi e5c7900b89 Fix:5128 【商城小程序】修改申请被驳回后订单详情只需显示原地址 2026-04-13 19:48:03 +08:00
linxi d69cf4c9e2 Fix:5075 【商城小程序】点击体验店,链接跳转的体验店详情数据错误,获取的是旅居店铺的数据,应获取体验店数据
(cherry picked from commit 1d8b75e2d2)
2026-04-13 19:37:44 +08:00
linxi 4a29b1cd27 Fix:5085 【商城小程序】用户多笔订单支付成功后,自动跳转到"我的订单"-"待发货"页面
(cherry picked from commit 8f6b2a23d1)
2026-04-13 19:37:39 +08:00
linxi df1c6dfb73 Fix:5081 【商城小程序】用户订单创建后未支付,自动跳转到"我的订单"-“待付款”页面
(cherry picked from commit 8c4d588ffa)
2026-04-13 19:37:34 +08:00
linxi 13201d251b Fix:5145 【商城小程序】首页海报状态未实时更新,需重启小程序才生效
(cherry picked from commit 9cbf35d693)
2026-04-13 19:37:29 +08:00
lifizer be90572388 Merge branch 'dev' into test 2026-04-13 15:32:21 +08:00
lifizer 335793676b Merge branch 'dev' into test 2026-02-25 10:23:01 +08:00
lifizer 377852a65f Merge branch 'dev' into test 2026-01-20 10:04:02 +08:00
LinCyJang f202fca716 Merge branch 'dev' into test 2026-01-19 21:44:44 +08:00
lifizer d288547259 Merge branch 'dev' into test 2026-01-07 09:48:46 +08:00
lifizer 5568cf039e Merge branch 'dev' into test 2025-12-22 16:29:14 +08:00
linxi ef66206182 Fix:收礼页调整
(cherry picked from commit e05eb3e389)
2025-12-15 10:09:18 +08:00
linxi d00fe87625 Fix:康养搜索增加 shopType=wellness
(cherry picked from commit a6735d284e)
2025-12-15 10:09:11 +08:00
linxi 749e3901f8 Fix:旅居分享问题
(cherry picked from commit 1f4ea5c0c8)
2025-12-15 10:09:06 +08:00
lifizer 1710f4809c Fix(专题页):尖货&节日分享朋友圈进入小程序渲染错误
(cherry picked from commit eaa36dcf44)
2025-12-15 10:08:55 +08:00
lifizer 38545cd76e Merge branch 'dev' into test 2025-12-09 16:39:27 +08:00
linxi b9dcbe6560 Fix:4004 【商城小程序】在互动消息列表回复资讯评论,内容被顶至屏幕之外
(cherry picked from commit 7a44ed3265)
2025-11-22 16:25:47 +08:00
linxi 50e143f13c Fix:4628 【旅居商城小程序】团购订单提交页面——输入框内容,未固定位置。
(cherry picked from commit b2121e71ef)
2025-11-22 16:25:39 +08:00
linxi 7c65d839d9 Fix:4646 【旅居商城小程序】团购礼包退款后,收礼方领取时的提示信息改为“礼品卡已失效”(iOS需修改提示,安卓需增加提示)
(cherry picked from commit d43fc253c9)
2025-11-22 16:25:35 +08:00
linxi f29ca88ab3 Fix:4643 【旅居商城小程序】没开转赠的团购礼包领取页面需要单独关闭右上角转发功能
(cherry picked from commit c9f3767cbd)
2025-11-21 12:34:20 +08:00
linxi 56402e37f3 Fix:4601 【旅居管理后台,商城小程序】旅居商户管理—修改所属分类为“康养分类”,在前端小程序中不显示
(cherry picked from commit 889b0de9b7)
2025-11-21 12:34:15 +08:00
linxi c39f2a4da8 Fix:4629 【旅居供应链小程序】供应链小程序/PC端修改资讯,将图片资讯改为视频后,视频无法正常播放
(cherry picked from commit 6e316a9f2c)
2025-11-21 12:34:11 +08:00
linxi c894689365 Fix:4634 【旅居商城小程序】播放资讯视频时,旅居店铺封面视频未暂停
(cherry picked from commit 4686c6d87a)
2025-11-21 12:34:06 +08:00
linxi 5c23dc9773 Fix:4632 【旅居商城小程序】团购详情轮播图循环逻辑错误
(cherry picked from commit 896f8dee7f)
2025-11-21 12:34:02 +08:00
linxi bad10982b7 Fix:4639 【旅居商城小程序】预约日期包含以下几个时间段时无法预约:1.31-2.1,3.31-4.1,5.31-6.1,8.31-9.1,10.31-11.1(应改为:只要选择的时间段可预约、并且等于团购天数,就可以预约成功)
(cherry picked from commit d9ee41d8f3)
2025-11-21 12:33:56 +08:00
linxi fe0397a483 Fix:4623 【旅居商城小程序】新增的视频资讯无法正常播放 2025-11-19 10:26:32 +08:00
linxi a535c8192e Fix:4613 【旅居商城小程序】待支付订单进行支付时,取消订单状态导航栏可点击状态 2025-11-18 14:28:34 +08:00
linxi 2e1fa524fa Fix:4598 【旅居商城小程序】供应链小程序新增视频资讯,前端视频未显示 2025-11-18 14:22:41 +08:00
linxi 48284adb6b Fix:4610 【旅居商城小程序】资讯正文的文本格式(换行、字体加粗等)在前端未生效 2025-11-18 14:19:19 +08:00
linxi 2af9fe99ee Fix:4260 【旅居商城小程序】管理后台新增旅居商户后,相应的用户进入商城小程序点击入驻入口,弹出提示窗,即将打开供应链小程序。确认后打开供应链小程序,如下图所示
(cherry picked from commit f884d1c764)
2025-11-17 15:36:09 +08:00
linxi 5caa9b176a Fix:4432 【旅居商城小程序】订单状态列表,待确认订单未显示确认倒计时
(cherry picked from commit 31ce97db6a)
2025-11-17 15:36:04 +08:00
linxi 438b7a98e4 Fix:4373 【旅居商城小程序】审核中状态下无法撤销入驻申请(参考供应商和特色店铺的入驻流程,【审核中】状态标识提到顶部显示,底部改成【撤销申请】)/接口
(cherry picked from commit 7786f88896)
2025-11-17 15:36:00 +08:00
linxi a2f1d9f59e Fix:4373 【旅居商城小程序】审核中状态下无法撤销入驻申请(参考供应商和特色店铺的入驻流程,【审核中】状态标识提到顶部显示,底部改成【撤销申请】)
(cherry picked from commit b260bb9e34)
2025-11-17 15:35:55 +08:00
linxi c4787b56e8 Fix:4519 【旅居商城小程序】送礼—礼包订单类型改为“礼包订单”
(cherry picked from commit 51ff86e4f8)
2025-11-17 15:35:51 +08:00
linxi 0937a32bce Fix:4388 【旅居商城小程序】管理后台配置商家号码在前端小程序未生效
(cherry picked from commit 3d8df506e0)
2025-11-17 15:35:47 +08:00
linxi cfef9c5b39 Fix:4600 【旅居管理后台,商城小程序】旅居商户管理—修改所属分类为“康养顶部”,在前端小程序所有康养城市顶部都会显示
(cherry picked from commit 2d8f2b16a9)
2025-11-17 15:35:43 +08:00
linxi 85906cbe44 Fix:4602 【旅居商城小程序】提交团购订单页面,联系商家-点击立即拨打按钮无效
(cherry picked from commit 1d34f4dd08)
2025-11-17 15:35:39 +08:00
42 changed files with 789 additions and 3372 deletions
+1 -1
View File
@@ -372,7 +372,7 @@ export const chatMixins = {
const _this = this
console.log('------------------创建连接')
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: {
'content-type': 'application/json'
},
+1 -14
View File
@@ -334,7 +334,7 @@ export const chatMixinsV2 = {
const _this = this
console.log('------------------创建连接')
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: {
'content-type': 'application/json'
},
@@ -885,18 +885,6 @@ export const chatMixinsV2 = {
this.currentGiftStepIndex--
}
},
clearCurrentGiftStepData() {
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
if (!currentStep) return
if (currentStep.type === 'option_card') {
const nextSelections = { ...this.giftSelections }
delete nextSelections[currentStep.id]
this.giftSelections = nextSelections
} else if (currentStep.type === 'price_input') {
this.giftBudget = ''
}
},
nextGiftStep() {
const currentStep = this.giftBuyOptions[this.currentGiftStepIndex]
let hasSelection = false
@@ -924,7 +912,6 @@ export const chatMixinsV2 = {
}
},
skipGiftStep() {
this.clearCurrentGiftStepData()
if (this.currentGiftStepIndex < this.giftBuyOptions.length - 1) {
this.currentGiftStepIndex++
} else {
+3 -16
View File
@@ -184,12 +184,7 @@
<view v-if="item.type === 'price_input'" class="gift-price-input">
<view class="input-wrap">
<text class="label">价格预算</text>
<input
v-model="giftBudget"
:placeholder="item.guideContent || '例如100以内/300~500元'"
class="input-budget"
placeholder-style="color: #ccc;"
/>
<input v-model="giftBudget" placeholder="例如100以内/300~500元" class="input-budget" placeholder-style="color: #ccc;" />
</view>
</view>
</view>
@@ -862,18 +857,10 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: calc(100vh - 240rpx);
height: auto;
height: calc(100vh - 240rpx);
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;
overflow: visible;
}
.gift-steps-wrap {
padding-bottom: 40rpx;
padding-bottom: calc(40rpx + constant(safe-area-inset-bottom));
padding-bottom: calc(40rpx + env(safe-area-inset-bottom));
overflow-y: auto;
}
.focus-guide-wrap {
display: flex;
-36
View File
@@ -124,39 +124,3 @@ export function computedSojoumGroupBuyGiftOrderPrice(params) {
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
})
}
/**
* 获取商品以前使用过的AI礼品卡图片
* @param {*} params
* @returns
*/
export function aiGiftImageHistory(params) {
return request.get("/giftCard/aiGiftImages/history?productId=" + params.productId, {
login: true
})
}
+2 -32
View File
@@ -17,8 +17,8 @@ export function getShopData(params) {
// 查看商户申请
// 1-特产供应商 2-店铺 3-文玩供应商
export function getShopInfo(params) {
return request.get("/merchantApply/info", params, {login: true})
export function getShopInfo() {
return request.get("/merchantApply/info", {}, {login: true})
}
// 4-采购批发商
@@ -38,18 +38,6 @@ export function saveShop(hotelInfo, partnerId = '', promoterUid = '') {
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 = '') {
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})
}
// 保存供应商入驻草稿(特产/文玩共用)
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) {
let param = {wholesalerInfo, captcha: wholesalerInfo.captcha};
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) {
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 })
}
// 获取千县名品县城图文攻略详情
export function getCountyFamousGraphicGuideContent(param) {
return request.get('/countyFamous/guide/graphic/content', param, { login: true })
}
// 获取千县名品县城重点产业列表
export function getCountyFamousIndustry(param) {
return request.get('/countyFamous/industry', param, { login: true })
-8
View File
@@ -603,11 +603,3 @@ export function queryUserGuide(params) {
export function setUserGuide(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;
}
.fix-tabbar-page {
position: relative;
z-index: 0;
min-height: 100vh;
background: transparent;
isolation: isolate;
&::before {
content: '';
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
pointer-events: none;
background: linear-gradient(155deg, rgba(61, 76, 241, 0.15) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,1) 75%, rgba(61, 76, 241, 0.15) 100%);
}
position: relative;
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-color: #fff;
// background-size: 100% calc(100vh - 160rpx);
// background-image: url(https://wxapp.xdd618.com/api/file/pic/aiChat/bg.png);
// background-repeat: no-repeat;
// background-attachment: fixed;
&.new-chat {
background-size: 100% calc(100vh - 160rpx);
background-repeat: no-repeat;
}
.fix-tabbar-header {
position: fixed;
top: 0;
-19
View File
@@ -127,25 +127,6 @@
height: 52vh;
overflow-y: auto;
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 {
-11
View File
@@ -42,20 +42,9 @@ export default {
},
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({
appId: "wx9ca93d1f2a9c8156",
path: "pages/auth/login",
envVersion,
success(msg) {
console.log("success", msg)
},
+5 -4
View File
@@ -35,7 +35,8 @@
v-for="(subItem, subIndex) in item.attrValue"
:key="subIndex"
:class="{
'actived': subItem.check
'actived': subItem.check,
'disabled': !subItem.canUsed
}"
class="itemn v12-radius-40"
@click="tapAttr(index, subIndex, subItem)"
@@ -217,9 +218,9 @@ export default {
},
tapAttr(index, subIndex, subItem) {
// 缺货的点击了没效果
// if (!subItem.canUsed || subItem.check) {
// return
// }
if (!subItem.canUsed || subItem.check) {
return
}
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => {
subItem.check= false
if (subIndex === subIdx) {
+1 -8
View File
@@ -355,7 +355,7 @@
{
"path": "views/wholesaler",
"style": {
"navigationBarTitleText": "礼品集采中心入驻"
"navigationBarTitleText": "采购批发商入驻"
}
},
{
@@ -532,13 +532,6 @@
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianGraphicGuide",
"style": {
"navigationBarTitleText": "攻略详情",
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianVillageShop",
"style": {
+16 -9
View File
@@ -49,18 +49,21 @@ export default {
// 注释下面一行,会停留在启动页
setTimeout(() => {
this.toLaunch();
}, 5000)
}, 2000)
return;
}
// 未登录:静默处理登录,5秒后跳转业务页面
cookie.get("spread");
if (this.$deviceType != "app") {
//检查授权信息
this.checkUserInfo();
// this.toLaunch();
if (this.$deviceType == "app") {
// this.toLaunch();
this.$yrouter.switchTab({
path: "/pages/home/index"
});
return;
}
setTimeout(() => {
this.toLaunch();
}, 5000);
//检查授权信息
this.checkUserInfo();
},
methods: {
...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 class="list" v-show="hasList">
<view class="list" v-if="list.length">
<view class="video-waterfalls-wrap">
<view class="waterfalls-column">
<view class="item" v-for="(lItem,lIndex) in leftList" :key="lIndex" @click="goDetail(lItem)">
<image class="cover" :src="lItem.cover" mode="widthFix" lazy-load></image>
<custom-waterfalls-flow :value="list" imageKey="cover">
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}" @click="goDetail(item)">
<image class="cover" :src="item.cover" mode="widthFix"></image>
<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="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="lItem.storeLogo" mode="scaleToFill"></image>
{{ lItem.storeName }}
<image class="icon" style="margin-right: 8rpx" :src="item.storeLogo" mode="scaleToFill"></image>
{{ item.storeName }}
</view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view>
</view>
</view>
</view>
<view class="waterfalls-column">
<view class="item" v-for="(rItem,rIndex) in rightList" :key="rIndex" @click="goDetail(rItem)">
<image class="cover" :src="rItem.cover" mode="widthFix" lazy-load></image>
<view class="content">
<view class="title more-t">{{ rItem.title }}</view>
<view class="footer flex jc-between ai-center">
<view class="visit flex ai-center">
<image class="icon" style="margin-right: 8rpx" :src="rItem.storeLogo" mode="scaleToFill"></image>
{{ rItem.storeName }}
</view>
<image class="icon flex-0" :src="webUrl+'/20210806121203835373.png'" mode="scaleToFill"></image>
</view>
</view>
</view>
</view>
</custom-waterfalls-flow>
</view>
</view>
<view class="loading-more" v-show="isWait">加载中...</view>
<view class="v4-nodata" v-show="showEmpty">
<view class="v4-nodata" v-else>
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<view class="text">暂无数据</view>
</view>
@@ -55,11 +38,6 @@ import {getStoreVideoType, getArticleList} from '@/api/public'
import {getVideoList} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
// 封面固定宽度(rpx
const COVER_WIDTH = 332
// 每项除封面外的文字内容预估高度(rpx)
const TEXT_HEIGHT = 120
export default {
mixins: [pageListenMixins],
data() {
@@ -70,23 +48,11 @@ export default {
page: 1,
limit: 10,
keyword: '',
leftList: [],
rightList: [],
leftHeight: 0,
rightHeight: 0,
list: [],
isWait: false,
requestId: 0,
pageKeyId: Object.freeze('findVideoList')
}
},
computed: {
hasList() {
return this.leftList.length + this.rightList.length > 0
},
showEmpty() {
return !this.isWait && !this.hasList
}
},
onLoad(options) {
if (!options.click) {
uni.switchTab({ url: '/pages/home/index' })
@@ -112,73 +78,27 @@ export default {
changeType(item) {
this.type = item.value
this.page = 1
// 使进行中的请求失效并解锁,避免切换时被上一次请求阻塞
this.requestId++
this.isWait = false
this.list = []
this.fetchList()
},
resetList() {
this.leftList = []
this.rightList = []
this.leftHeight = 0
this.rightHeight = 0
},
async fetchList() {
fetchList() {
if (this.isWait) return
const requestId = ++this.requestId
this.isWait = true
const params = {
type: this.type,
page: this.page,
limit: this.limit
}
try {
const res = await getVideoList(params)
// 请求已被更新的请求(如切换分类)取代,丢弃本次结果
if (requestId !== this.requestId) return
getVideoList(params).then(res => {
if (res.status === 200) {
const items = res.data
for (let i = 0; i < items.length; i++) {
items[i].hide = true
for (let i = 0; i < res.data.length; i++) {
res.data[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) {
// 忽略请求或图片尺寸获取失败
} 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)
}
})
this.isWait = false
})
},
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) {
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id + '&click=1')
}
@@ -209,22 +129,25 @@ export default {
margin: 28rpx 32rpx;
.video-waterfalls-wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
}
direction: ltr;
.waterfalls-column {
width: 332rpx;
/deep/ .waterfalls-flow {
direction: ltr;
text-align: left;
}
/deep/ .waterfalls-flow-column {
float: left !important;
}
}
.item {
margin-bottom: 20rpx;
border-radius: 4rpx;
background: #fff;
.cover {
width: 332rpx;
//height: 200rpx;
vertical-align: middle;
}
@@ -267,11 +190,4 @@ export default {
}
}
}
.loading-more {
padding: 24rpx 0;
text-align: center;
font-size: 24rpx;
color: #999;
}
</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>
</view>
<goo-skeleton v-if="!townLoaded" :show-avatar="false"/>
<view class="v4-nodata" v-else-if="townList.length === 0">
<view class="v4-nodata" v-if="townList.length === 0">
<image src="@/static/images/img_nodata.png" mode="scaleToFill"/>
<view class="text">暂无数据</view>
</view>
@@ -204,7 +203,6 @@ export default {
isNext: false,
townConfig: {},
townList: [],
townLoaded: false,
randomSeed: null,
hotelBanner: [],
goodCityId: '',
@@ -521,8 +519,6 @@ export default {
}
getAncientTownList(params).then(res => {
this.townList = res.data.records
}).finally(() => {
this.townLoaded = true
})
return
}
+2 -23
View File
@@ -916,18 +916,6 @@ export default {
}
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 = {}) {
const drawEntranceConfig = data.drawEntranceConfig || {}
this.$set(this, 'drawEntranceConfig', drawEntranceConfig)
@@ -944,19 +932,10 @@ export default {
(data.lotteryCanDraw || false)
)
this.isDrawPosterVisible = shouldShowDrawPoster
const shouldShowOldUserPopup =
!shouldShowDrawPoster &&
!hasShownDrawPosterInSession &&
this.canShowOldPoster &&
!this.hasShownOldUserPopupInSession()
if (shouldShowOldUserPopup) {
this.markOldUserPopupShownInSession()
}
this.isOldUser = shouldShowOldUserPopup
this.isOldUser = !shouldShowDrawPoster && !hasShownDrawPosterInSession && this.canShowOldPoster
},
showNextPoster() {
if (!this.isDrawPosterVisible && this.canShowOldPoster && !this.hasShownOldUserPopupInSession()) {
this.markOldUserPopupShownInSession()
if (!this.isDrawPosterVisible && this.canShowOldPoster) {
this.isOldUser = true
}
},
+96 -512
View File
@@ -12,7 +12,7 @@
v-model="keyword"
:inputStyle="inputStyle"
:showAction="false"
:placeholder="searchPlaceholder"
placeholder="请输入商品名/订单号/团购名称"
shape="round"
bgColor="#FFF"
@search="changeType"
@@ -76,28 +76,28 @@
</view>
</view>
<view
v-if="getOrderStoreName(order) && !order.experienceOrderInfo"
v-if="order.merName && !order.experienceOrderInfo"
class="shop-info flex jc-between ai-center"
style="padding-bottom: 0"
@click="handleOrderStoreClick(orderListIndex)"
@click="goStore(orderListIndex)"
>
<view class="flex ai-center">
<image
:src="webUrl+'/orderIcon/shop.png'"
style="width: 32rpx;height: 32rpx"
/>
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ getOrderStoreName(order) }}</text>
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName }}</text>
<image
:src="webUrl+'/orderIcon/arrow.png'"
style="width: 24rpx;height: 24rpx; margin-top: 5rpx"
/>
</view>
<view v-if="getOrderCityName(order)" class="flex ai-center">
<view class="flex ai-center">
<image
:src="webUrl+'/orderIcon/map.png'"
style="width: 28rpx;height: 28rpx"
/>
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ getOrderCityName(order) }}</text>
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</text>
</view>
</view>
<view v-if="order.experienceOrderInfo" class="title acea-row row-between-wrapper" style="padding: 0 0 0 16rpx !important;">
@@ -131,7 +131,7 @@
<view
v-else
class="font-color-white statusTag v12-primary"
>{{ getOrderStatusTagText(order) }}</view>
>{{ (order.isGiftCardSend || order.isGiftCardReceive) ? '礼包' : (getStatus(order) || (order._status && order._status._title) || '已完成') }}</view>
</view>
<view @click="goOrderDetails(orderListIndex)">
<view
@@ -186,44 +186,6 @@
</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 class="item-info acea-row row-between row-top draw-order-info">
<view class="pictrue">
@@ -282,7 +244,7 @@
</view>
</view>
</view>
<view v-else-if="!(isCollectiveCenterMode && isBlindBoxGiftOrder(order))">
<view v-else>
<view
v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex"
@@ -338,8 +300,8 @@
<span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span>
</view>
<view class="v12-font-24 v12-dark1-text">
{{ getOrderTotalNum(order) }}件商品
<text v-if="order.isGiftCardReceiveBlind === 0 && shouldShowOrderTotalAmount(order)">
{{ order.totalNum || 0 }}件商品
<text v-if="order.isGiftCardReceiveBlind === 0">
<text class="v12-dark-text v12-font-28 v12-font-bold">
总金额
</text>
@@ -347,7 +309,7 @@
</text>
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">
{{ force2Decimal(getOrderPayPrice(order)) }}
{{ force2Decimal(order.payPrice) }}
</text>
</text>
</view>
@@ -389,101 +351,63 @@
v-if="!order.isGiftCardSend && !order.experienceOrderInfo"
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
v-if="order.isDrawOrder > 0"
class="bnt service"
@click.stop="callMerPhone(orderListIndex)"
>联系客服
</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"
@click="goRoom(orderListIndex)"
>联系商家</view>
</view>
<view class="flex">
<view class="v12-justify-between">
<view
v-if="showCollectiveModifyAddress(order)"
class="bnt service"
@click="addressTap(orderListIndex)"
>修改地址</view>
<view
v-if="showCollectiveDetail(order)"
class="bnt service"
@click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view>
<view
v-if="showCollectiveRefund(order)"
class="bnt service"
@click="goRefund(orderListIndex)"
>申请退款</view>
<view
v-if="showCollectiveTakeOrder(order)"
class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40"
@click="takeOrder(orderListIndex)"
>确认收货</view>
<view
v-if="showCollectiveDelete(order)"
class="bnt service"
@click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view>
</view>
</view>
</template>
<template v-else>
<view
v-if="[2, 3].includes(parseInt(order._status._type)) && order.isTickets === 0 && order.isDrawOrder === 0"
class="group-btn"
>
<text
class="btn-more v12-font-28 v12-font-bold"
@click.stop="tapShowMore(orderListIndex)"
>更多</text>
<view class="group-float" v-show="order.showMore">
<view
v-if="order.merName && order.isGiftCardReceiveBlind === 0"
class="btn btn-service flex jc-center ai-center v12-font-24"
@click="goRoom(orderListIndex)"
>联系商家</view>
<view
v-if="order.isTravelGroup === 0 && order.refundSystemStatus !== 2"
class="btn flex jc-center ai-center v12-font-24"
@click="goRefund(orderListIndex)"
>申请退款</view>
</view>
</view>
<template v-else>
<view class="v12-justify-between" style="width: 100%">
<view
v-if="order.isDrawOrder > 0"
class="bnt service"
@click.stop="callMerPhone(orderListIndex)"
>联系客服
</view>
<view>
<view
v-if="order.isGiftCardReceiveBlind === 0 &&
order.merName &&
parseInt(order._status._type) !== 0 &&
parseInt(order._status._type) !== 9
"
class="bnt service"
@click="goRoom(orderListIndex)"
>联系商家</view>
</view>
<view class="v12-justify-between">
<view
class="bnt service"
@click="goOrderDetails(orderListIndex)"
v-if="[-1, -2, -3].includes(parseInt(order._status._type))"
>查看详情</view>
<view
class="bnt service"
@click="delOrder(orderListIndex)"
v-if="[9].includes(parseInt(order._status._type))"
>删除订单</view>
</view>
</view>
</template>
</template>
<view v-if="!isCollectiveCenterMode" class="flex">
<view class="flex">
<template v-if="parseInt(order._status._type) === 0">
<view
class="bnt cancelBnt v12-dark-text v12-dark-border"
@@ -743,7 +667,6 @@ export default {
mixins: [pageListenMixins, orderPaySuccessToCheckDrawStatus],
data() {
return {
collectiveOrderType: 'wholesaler',
giftItem: {},
isShowPayPwdPop: false,
inputStyle: {
@@ -770,15 +693,14 @@ export default {
{ name: '全部' },
{ name: '待付款' },
{ name: '待发货' },
{ name: '待收货/待核销' },
{ name: '待收货' },
{ name: '退款/售后' },
{ name: '待评价' },
{ name: '已完成' }
],
orderTypeTabList: [
{ name: '购物', orderType: 'shop' },
{ name: '旅居', orderType: 'travel' },
{ name: '集采中心', orderType: 'wholesaler' }
{ name: '旅居', orderType: 'travel' }
],
orderTypeTabIndex: 0,
orderType: 'shop',
@@ -804,8 +726,7 @@ export default {
dateRange: [],
userLatitude: null,
userLongitude: null,
orderListRequestId: 0,
savedScrollTop: 0
orderListRequestId: 0
}
},
components: {
@@ -814,15 +735,7 @@ export default {
passkeyborad,
DateRangePicker
},
computed: {
...mapGetters(["userInfo"]),
isCollectiveCenterMode() {
return this.orderType === this.collectiveOrderType
},
searchPlaceholder() {
return this.isCollectiveCenterMode ? '请输入商品名称/订单号' : '请输入商品名/订单号/团购名称'
}
},
computed: mapGetters(["userInfo"]),
onShow() {
const _this = this
const needRefreshOrderList = uni.getStorageSync('needRefreshMyOrderList')
@@ -863,20 +776,17 @@ export default {
})
} else if (needRefreshOrderList) {
uni.removeStorageSync('needRefreshMyOrderList')
this.getOrderData()
this.refreshOrderListKeepPosition()
this.changeType()
}
},
onLoad() {
const query = this.getPageQuery()
this.type = this.type || parseInt(query.type) || 0
this.orderTypeTabIndex = parseInt(query.tabIndex) || 0
const currentOrderTypeTab = this.orderTypeTabList[this.orderTypeTabIndex] || this.orderTypeTabList[0]
this.type = this.type || parseInt(this.$yroute.query.type) || 0
this.orderTypeTabIndex = parseInt(this.$yroute.query.tabIndex) || 0
this.initUserLocation()
this.orderTypeTabChange({
...currentOrderTypeTab,
index: this.orderTypeTabList[this.orderTypeTabIndex] ? this.orderTypeTabIndex : 0
}, { resetFilters: false })
...this.orderTypeTabList[this.orderTypeTabIndex],
index: this.orderTypeTabIndex
})
},
onShareAppMessage() {
uni.updateShareMenu({
@@ -890,298 +800,6 @@ export default {
}
},
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) {
if (!order) {
return false
@@ -1398,13 +1016,6 @@ export default {
}
return orderOrIndex
},
handleOrderStoreClick(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order || this.isCollectiveCenterMode) {
return
}
this.goStore(order)
},
delOrder(orderOrIndex) {
const order = this.getOrderByIndex(orderOrIndex)
if (!order) {
@@ -1415,11 +1026,7 @@ export default {
return
}
delOrderHandle(order.orderId).then(() => {
this.getOrderData()
const index = this.orderList.indexOf(order)
if (index > -1) {
this.orderList.splice(index, 1)
}
this.changeType()
})
},
goStore(orderOrIndex) {
@@ -1802,50 +1409,44 @@ export default {
}
result.push({
...item,
showMore: false,
// 盲盒订单确认收货后需展示真实商品,后端字段未随状态更新,按订单状态兜底修正
isGiftCardReceiveBlind: this.resolveBlindBoxDisplayFlag(item)
showMore: false
})
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) {
this.type = item.index
const query = this.getPageQuery()
query.type = this.type
this.$yroute.query.type = this.type
this.changeType()
},
orderTypeTabChange(item, options = {}) {
const { resetFilters = true } = options
orderTypeTabChange(item) {
this.orderTypeTabIndex = item.index
this.orderType = item.orderType
const query = this.getPageQuery()
query.tabIndex = this.orderTypeTabIndex
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)
},
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() {
this.$yrouter.switchTab({
@@ -1867,15 +1468,23 @@ export default {
uni.showLoading({
mask: true,
})
const typeMap = this.getRequestTypeMapByOrderType()
const type = typeMap[this.type]
const types = {
0: 0,
1: 1,
2: 2,
3: 3,
4: -3,
5: 4,
6: 5,
}
const type = types[this.type]
const {
page,
limit,
keyword,
orderType
} = this
return getOrderList({
getOrderList({
page,
limit,
type,
@@ -1898,24 +1507,6 @@ export default {
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) {
const order = this.getOrderByIndex(index)
if (!order) {
@@ -2026,9 +1617,6 @@ export default {
},
onReachBottom() {
!this.loading && this.getOrderListReq()
},
onPageScroll(e) {
this.savedScrollTop = e.scrollTop
}
};
</script>
@@ -2211,10 +1799,6 @@ page {
.my-order .list .item .item-info .attr-wrap {
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 {
width: calc(100% - 120rpx);
}
+49 -24
View File
@@ -309,7 +309,7 @@
</view>
</view>
<!-- 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="title bold flex ai-center">
<view>
@@ -579,7 +579,6 @@ export default {
mixins: [pageListenMixins],
data: function () {
return {
appProductHideMerchant: '0',
isGift: false,
giftBg: '',
// 商品信息是否展开
@@ -733,7 +732,6 @@ export default {
console.log("getLaunchOptionsSync", uni.getLaunchOptionsSync())
console.log("getEnterOptionsSync", uni.getEnterOptionsSync())
uni.removeStorageSync('couponId')
const pageQuery = Object.assign({}, this.resolvePageQuery(), options || {})
const from = options.from
const id = options.id
switch (from) {
@@ -781,10 +779,10 @@ export default {
if (url && url.productId) {
this.id = url.productId
} else if (options.id) {
this.id = pageQuery.id || options.id || null
this.partnerId = pageQuery.partnerId || options.partnerId || null
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
this.source = pageQuery.from || ''
this.id = options.id || null
this.partnerId = options.partnerId || null
this.activityId = this._route.query.activityId
this.source = this._route.query.from || ''
} else {
const obj = uni.getEnterOptionsSync()
if (options.scene != null || obj.query.scene != null) {
@@ -849,18 +847,6 @@ export default {
}
},
methods: {
resolvePageQuery() {
if (this.$yroute && this.$yroute.query) {
return this.$yroute.query
}
if (this.$route && this.$route.query) {
return this.$route.query
}
if (this._route && this._route.query) {
return this._route.query
}
return {}
},
gift() {
this.goCat(2)
},
@@ -901,14 +887,14 @@ export default {
handleLoginFailure()
return
}
console.log(this.attr);
console.log(this.storeInfo);
const params = {
goodsId: this.id,
goodsName: this.attr.productSelect.store_name,
skuStr: this.attrValue,
price: this.attr.productSelect.price,
seckillId: this.activityId,
cover: this.attr.productSelect.image || this.storeInfo.image,
cover: this.attr.productSelect.image,
goodsData: '',
seckillData: '',
isNegotiable: this.storeInfo.isNegotiable
@@ -1211,7 +1197,6 @@ export default {
this.posterData.price = this.storeInfo.price
this.posterData.code = this.storeInfo.codeBase
this.systemStore = data.systemStore
this.appProductHideMerchant = data.appProductHideMerchant
const good_list = data.goodList || []
const goodArray = []
const count = Math.ceil(good_list.length / 6)
@@ -1278,7 +1263,7 @@ export default {
'store_name',
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, 'otPrice', productSelect.otPrice)
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
@@ -1405,7 +1390,7 @@ export default {
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, 'otPrice', productSelect.otPrice)
this.$set(this.attr.productSelect, 'stock', productSelect.stock)
@@ -2296,3 +2281,43 @@ export default {
word-break: keep-all;
}
</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 {getCity} from "@/api/user";
import {chooseImage, isWeixin} from "@/utils";
import {getHomeData} from "@/api/public";
import {VUE_APP_API_URL} from "@/config"
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) {
this.$dialog.error("请选择店铺所在省市区");
return;
+51 -169
View File
@@ -93,7 +93,7 @@
</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
v-for="(delivery, index) in orderInfo.deliveryInfo"
:key="index"
@@ -203,31 +203,31 @@
<view style="margin-top: 30rpx;border-radius:20rpx;overflow: hidden;" class="v12-white">
<!-- <OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []" title="商品信息"></OrderGoods> -->
<view class="v12-radius-20 v12-pa-3" v-for="(cart, d) in getOrderDetailDisplayItems(orderInfo)" :key="d" @click="goGoodsCon(cart, orderInfo.isGiftCardReceiveBlind, orderInfo.isDrawOrder, orderInfo.scenarioCode)">
<view class="v12-justify-between" v-if="!isBlindBoxOrder(orderInfo)">
<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="orderInfo.isGiftCardReceiveBlind === 0">
<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 class="v12-justify-between v12-flex-column v12-ml-2" style="flex: 2">
<view class="v12-font-28 v12-dark-text v12-font-bold more-t">
{{ cart.name }}
{{ cart.productInfo.storeName }}
</view>
<view v-if="cart.sku && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ cart.sku }}
<view v-if="cart.productInfo.attrInfo && orderInfo.isDrawOrder !== 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ cart.productInfo.attrInfo.sku || '' }}
</view>
<view v-if="orderInfo.isDrawOrder === 1" class="more-t v12-secondary-dark-text v12-font-24">
{{ orderInfo.drawOrderInfo.prizeAttrName || '' }}
</view>
</view>
<view class="v12-justify-between v12-flex-column v12-dark-text v12-text-right">
<view class=" " v-if="orderInfo.isDrawOrder === 0 && cart.showPrice">
<view class=" " v-if="orderInfo.isDrawOrder === 0">
<text class="v12-font-22">
</text>
<text class="v12-font-28">{{ force2Decimal(cart.price) }}</text>
<text class="v12-font-28">{{ cart.truePrice }}</text>
</view>
<view class="v12-font-22">
<text>x{{ cart.qty }}</text>
<text>x{{ cart.cartNum }}</text>
</view>
</view>
</view>
@@ -244,29 +244,16 @@
</view>
</view>
</view>
<view class="" v-if="getOrderDetailDisplayItems(orderInfo).length && (d === getOrderDetailDisplayItems(orderInfo).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="isCustomGiftOrder(orderInfo)">
<view class="v12-font-24 v12-dark-text" v-if="orderInfo.customGiftInfo.isShowValue">
{{ '礼品价值' }}
</view>
<view class="v12-text-right" v-if="orderInfo.customGiftInfo.isShowValue">
<text class="v12-font-22"></text>
<text class="v12-font-28" v-if="orderInfo.customGiftInfo && orderInfo.customGiftInfo.isShowValue">
{{ force2Decimal(orderInfo.customGiftInfo.giftValue) }}
</text>
</view>
<view class="" v-if="orderInfo.cartInfo &&( d === orderInfo.cartInfo.length - 1) && orderInfo.isDrawOrder === 0">
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-if="orderInfo.isGiftCardReceiveBlind === 0">
<view class="v12-font-24 v12-dark-text">
商品总价
</view>
<view class="v12-justify-between v12-align-center v12-mt-3 v12-dark-text" v-else>
<view class="v12-font-24 v12-dark-text">
{{ '商品总价' }}
</view>
<view class="v12-text-right">
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.totalPrice) }}
</text>
</view>
<view class="v12-text-right">
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.totalPrice) }}
</text>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-mt-3" v-if="orderInfo.payPostage > 0">
@@ -317,7 +304,7 @@
</view>
</view>
<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>
@@ -367,11 +354,11 @@
<view class="flex-0">订单类型</view>
<view class="v12-text-right">{{ orderTypeName }}</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="v12-text-right">{{ orderInfo.paid ? "已支付" : "未支付" }}</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="v12-text-right">{{ orderInfo._status._payType }}</view>
</view>
@@ -498,31 +485,22 @@
<text class="v12-font-22 v12-dark1-text">
{{ orderInfo.totalNum }}件商品
</text>
<template v-if="!isCustomGiftOrder(orderInfo)">
<text class="v12-font-bold v12-dark-text v12-font-28 v12-mx-2">
实付款
</text>
<text class="v12-font-bold v12-primary-text v12-font-22">
</text>
<text class="v12-font-bold v12-primary-text v12-font-28">
{{ force2Decimal(orderInfo.payPrice) }}
</text>
</template>
<text class="v12-font-bold v12-dark-text v12-font-28 v12-mx-2">
实付款
</text>
<text class="v12-font-bold v12-primary-text v12-font-22">
</text>
<text class="v12-font-bold v12-primary-text v12-font-28">
{{ force2Decimal(orderInfo.payPrice) }}
</text>
</view>
<view class="bnt v12-primary-text v12-primary-border v12-ml-1" @click="subscribePay">立即付款</view>
</view>
</view>
</template>
<template v-if="status.type == 1" >
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%">
<view
v-if="canShowModifyAddress(orderInfo) && orderInfo.isDrawOrder === 0"
class="bnt v12-dark-text v12-dark-border cancel"
@click="goAddress"
>修改地址</view>
</view>
<view v-else class="v12-justify-between " style="width: 100%">
<view class="v12-justify-between " style="width: 100%">
<view class="v12-justify-between ">
<view v-if="orderInfo.isDrawOrder > 0" class="bnt v12-dark-text v12-dark-border cancel" @click.stop="callMerPhone">联系客服</view>
<view v-if="orderInfo.isGiftCardReceiveBlind === 0 && orderInfo.isDrawOrder === 0" class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
@@ -537,10 +515,7 @@
</view>
</template>
<template v-if="status.type == 2">
<view v-if="isCustomGiftOrder(orderInfo)" class="v12-justify-end" style="width: 100%">
<view class="bnt v12-primary-text v12-primary-border" @click="takeOrder">确认收货</view>
</view>
<view v-else class="v12-justify-between " style="width: 100%">
<view class="v12-justify-between " style="width: 100%">
<view v-if="orderInfo.isGiftCardReceiveBlind === 0" class="bnt v12-dark-text v12-dark-border cancel" @click.stop="callMerPhone">联系客服</view>
<view class="" v-else></view>
<view class="v12-justify-between">
@@ -573,12 +548,8 @@
<view class="btn flex jc-center ai-center v12-font-24" @click="goGoodsReturn(orderInfo)">申请退款</view>
</view>
</view>
<view v-if="!isCollectiveOrder(orderInfo)" class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view
v-if="canShowOrderEvaluate(orderInfo)"
class="bnt v12-primary-text v12-primary-border"
@click="routerGo(orderInfo.cartInfo[0])"
>立即评价</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
</view>
</view>
</template>
@@ -591,17 +562,17 @@
<template v-if="status.type == -2">
<view class="v12-justify-between " style="width: 100%">
<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>
</template>
<template v-if="status.type == -3">
<view class="v12-justify-between " style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<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
v-if="canShowOrderEvaluate(orderInfo)"
v-if="!isGiftOrder(orderInfo)"
class="bnt v12-primary-text v12-primary-border"
@click="routerGo(orderInfo.cartInfo[0])"
>立即评价</view>
@@ -879,12 +850,9 @@ export default {
}
})
},
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder) {
if(isGiftCardReceiveBlind) return
if(isDrawOrder) return
// 采购批发订单(集采中心)商品卡片不跳转批发商品详情页
if (Number(scenarioCode) === 22) return
if (Number(scenarioCode) === 24) return
const activityId = Number(
item.drawActivityId ||
(item.productInfo && item.productInfo.drawActivityId) ||
@@ -1061,83 +1029,6 @@ export default {
}
return status;
},
getOrderScenarioCode(order = this.orderInfo) {
return Number(order && order.scenarioCode)
},
isWholesalerOrder(order = this.orderInfo) {
return this.getOrderScenarioCode(order) === 22
},
isCustomGiftOrder(order = this.orderInfo) {
return this.getOrderScenarioCode(order) === 24
},
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) {
const type = parseInt(order._status._type);
let imgUrl = "";
@@ -1170,6 +1061,9 @@ export default {
}
return imgUrl;
},
isGiftOrder(order = {}) {
return Number(order.isGiftCardSend || 0) === 1 || Number(order.isGiftCardReceive || 0) === 1
},
subscribePay() {
uni.requestSubscribeMessage({
tmplIds: settings.SubscribeMessageTmplIds,
@@ -1260,17 +1154,16 @@ export default {
});
},
goBack() {
// 从订单列表进入时直接返回原页面,保留列表页主/子tab及滚动位置
const pages = getCurrentPages()
const prevPage = pages && pages[pages.length - 2]
const prevRoute = prevPage && prevPage.route
if (prevRoute && prevRoute.indexOf('order/MyOrder') > -1) {
if (this.name === "MyOrder") {
this.$yrouter.back();
return;
} else {
console.log(this);
this.$yrouter.replace({
path: "/pages/order/MyOrder/index"
});
return;
}
this.$yrouter.replace({
path: "/pages/order/MyOrder/index"
});
},
cancelOrder() {
cancelOrderHandle(this.orderInfo.orderId)
@@ -1386,19 +1279,8 @@ export default {
orderDetail(id).then(res => {
this.orderInfo = res.data
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()
if (this.isWholesalerOrder(this.orderInfo)) {
this.orderTypeName = "采购批发订单"
this.orderTypeNameStatus = false
} else if (this.isCustomGiftOrder(this.orderInfo)) {
this.orderTypeName = "自建礼品订单"
this.orderTypeNameStatus = false
} else if (this.orderInfo.combinationId > 0) {
if (this.orderInfo.combinationId > 0) {
this.orderTypeName = "拼团订单"
this.orderTypeNameStatus = false
} else if (this.orderInfo.bargainId > 0) {
+2 -2
View File
@@ -23,7 +23,7 @@
<view class="item acea-row row-between-wrapper">
<view class="name">提现</view>
<view class="input">
<input v-model="post.money" />
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
</view>
</view>
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
@@ -45,7 +45,7 @@
<view class="item acea-row row-between-wrapper">
<view class="name">提现</view>
<view class="input">
<input placeholder="请输入提现金额" v-model="post.money" />
<input :placeholder="'最低提现金额' + minPrice" v-model="post.money" />
</view>
</view>
<view class="tip">当前可提现金额: {{ commissionCount }}</view>
+40 -99
View File
@@ -11,9 +11,9 @@
<view class="name one-t">{{ item.username }}</view>
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
<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>
@@ -22,7 +22,7 @@
<view class="name one-t">{{ item.username }}</view>
<text class="msg" v-if="item.msg_type===0">{{ item.msg_content }}</text>
<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 class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)">
<view class="goods-logo">
@@ -108,11 +108,8 @@ export default {
uploadToken: null, //上传token
socketOpen: false,
socketConnecting: false, // 是否正在建连
socketTask: null,
socketMsgQueue: [],
hasConnected: false, // 是否成功建过连接
reconnectHistory: false, // 重连后用服务端历史整体替换本地列表,防止消息重复
roomId: null, //房间ID
content: "", //消息内容
@@ -139,22 +136,30 @@ export default {
},
onShow() {
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
// 已连接/连接中不重复建连;清空 list 会导致图片操作(触发 onHide/onShow)后页面白屏
if (!this.socketOpen && !this.socketConnecting) {
this.connectSocketInit();
}
this.connectSocketInit();
this.list = []
},
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)
},
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)
},
methods: {
toGoods(item) {
const itemJson = this.wsJson(item.msg_content)
const itemJson = JSON.parse(item.msg_content)
if(!itemJson.goodsId) {
// 提示数据错误
// uni.showToast({
@@ -172,18 +177,7 @@ export default {
})
},
wsJson(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
return JSON.parse(json)
},
getUploadToken() {
let that = this;
@@ -255,68 +249,33 @@ export default {
});
},
// 进入页面时创建websocket连接【整个页面随时使用】
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
connectSocketInit() {
if (this.socketOpen || this.socketConnecting) return;
this.socketConnecting = true;
// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
const task = uni.connectSocket({
this.socketTask = uni.connectSocket({
url: this.$SOCKET_URL,
success: () => {
}
})
if (!task) {
this.socketConnecting = false;
return;
}
this.socketTask = task;
// 任务级回调:全局 uni.onSocket* 每次进页面都会重复注册,导致消息重复处理、连接串台
const isCurrent = () => this.socketTask === task;
task.onOpen(() => {
if (!isCurrent()) return;
uni.onSocketOpen(res => {
console.log('WebSocket连接已打开!', res);
this.socketOpen = true;
this.socketConnecting = false;
// 断线重连后重新加入房间;本地已有历史时用服务端历史整体替换,避免重复
this.reconnectHistory = this.hasConnected && this.list.length > 0;
this.hasConnected = true;
this.createRoom();
// 补发连接未就绪期间排队的消息(如发图片时连接被隐藏页关闭)
if (this.socketMsgQueue.length) {
const queue = this.socketMsgQueue.splice(0);
queue.forEach(msg => this.sendSocketMessage(msg));
}
});
task.onMessage(res => {
if (!isCurrent()) return;
uni.onSocketError(err => {
console.log('WebSocket连接打开失败,请检查!', err);
});
uni.onSocketMessage(res => {
console.log('收到服务器内容:', res.data);
this.handleMessage(res.data);
});
task.onError(err => {
console.log('WebSocket连接打开失败,请检查', err);
if (!isCurrent()) return;
this.socketOpen = false;
this.socketConnecting = false;
uni.onSocketClose(res => {
console.log('WebSocket 已关闭', res);
});
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) {
@@ -356,14 +315,11 @@ export default {
},
sendSocketMessage(msg) {
if (this.socketOpen && this.socketTask) {
this.socketTask.send({
if (this.socketOpen) {
uni.sendSocketMessage({
data: msg,
fail: () => {
// 发送失败说明连接可能已断开,重新排队并尝试重连后补发
this.socketMsgQueue.push(msg);
this.closeSocket();
this.connectSocketInit();
success(res) {
console.log("消息发送成功", res,msg);
}
});
} else {
@@ -372,12 +328,7 @@ export default {
},
handleMessage(str) {
let data;
try {
data = JSON.parse(str);
} catch (e) {
return;
}
let data = JSON.parse(str);
switch (data.type) {
case "room_id":
this.roomId = data.msg_content;
@@ -387,23 +338,13 @@ export default {
case "leave":
break;
case "msg":
if (data.msg_content) {
this.list.push(data.msg_content);
this.scrollLast();
}
this.list.push(data.msg_content);
this.scrollLast();
break;
case "msg_history": {
const history = data.msg_content || [];
if (this.reconnectHistory) {
// 重连后服务端重发历史:整体替换,避免消息重复
this.reconnectHistory = false;
this.list = history;
} else {
this.list = history.concat(this.list);
}
case "msg_history":
this.list = data.msg_content.concat(this.list);
this.scrollLast();
break;
}
default:
break;
}
+7 -47
View File
@@ -396,7 +396,7 @@
/>
</view>
</view>
<view v-if="form.reviewStatus !== 1">
<view v-if="form.isDraft === 0 && form.reviewStatus !== 1">
<view
class="v12-primary v12-white-text submit-btn"
:style="{'background': form.reviewStatus === 0 ? '#FA979F !important' : '#4A97FC'}"
@@ -405,19 +405,19 @@
{{ form.reviewStatus === 0 ? '撤销申请' : form.reviewStatus === 2 ? '重新提交' : '提交审核' }}
</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
class="v12-primary v12-white-text submit-btn"
@click="submitForm"
>
提交审核
</view>
</view> -->
</view>
<u-popup
:show="show"
mode="center"
round="10"
@close="handlePopupClose"
@close="show=false"
>
<view class="popup-body">
<view class="tc bold">
@@ -440,6 +440,7 @@
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="savePopup"
/>
</view>
@@ -450,7 +451,7 @@
<script>
import CitySelect from '@/components/CitySelect'
import { getCity, registerVerify } from '@/api/user'
import { uploadVideo, uploadImage, formatRichText } from '@/utils'
import { uploadVideo, uploadImage } from '@/utils'
import {
getShopData,
saveExperienceStore,
@@ -520,10 +521,9 @@ export default {
onLoad(opts) {
this.partnerId = opts.partnerId || ''
this.promoterUid = opts.promoterUid || ''
uni.showLoading({ title: '加载中...', mask: true })
this.queryCity()
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({ data }) => {
this.notice = formatRichText(data.merchantApplyNotice)
this.notice = data.merchantApplyNotice
})
getExperienceStoreCategoryList().then(({ data }) => {
this.experienceStoreCategoryList = data || []
@@ -531,8 +531,6 @@ export default {
this.experienceStoreCategoryIndex = 0
}
this.initInfo()
}).catch(() => {
uni.hideLoading()
})
},
onUnload() {
@@ -579,31 +577,12 @@ export default {
}).catch(() => {
this.form.isDraft = 1
this.show = true
}).finally(() => {
uni.hideLoading()
})
},
changeAgree(e) {
this.isAgree = e.detail.value.includes('yes')
},
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
},
stringToMapArr(str, split = ',') {
@@ -886,25 +865,6 @@ export default {
height: 52vh;
overflow-y: auto;
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 {
margin: 60rpx 0;
+5 -8
View File
@@ -6,32 +6,32 @@
mode="scaleToFill"
/>
<image
v-show="partnerType === 'province_partner' || partnerType === '' || partnerType === 'county_agent'"
v-show="partnerType === 'province_partner' || partnerType === ''"
:src="images.goodSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('goods_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.wenwanSupplierImage"
class="img-item"
mode="widthFix"
@click="goto('wenwan_supplier')"
/>
<image
v-show="partnerType === 'pioneer' || partnerType === '' || partnerType === 'county_agent'"
v-show="partnerType === 'pioneer' || partnerType === ''"
:src="images.hotelImage"
class="img-item"
mode="widthFix"
@click="goto('shop')"
/>
<image
<!-- <image
:src="images.wholesalerImage"
class="img-item"
mode="widthFix"
@click="goto('wholesaler')"
/>
/> -->
<image
:src="images.travelImage"
class="img-item"
@@ -74,9 +74,6 @@ export default {
this.partnerId = options.partnerId || ''
this.promoterUid = options.promoterUid || ''
getImages().then(({data}) => this.images = data)
},
onShow() {
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.partnerType = data.partnerType
this.hotelId = data.hotelId
+73 -130
View File
@@ -6,7 +6,7 @@
labelWidth="216rpx"
>
<view
v-if="stateTitle"
v-if="stateTitle && isDraft !== 1"
class="box-state"
>
<u-alert
@@ -77,19 +77,11 @@
v-if="!form.cover"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="form.cover"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('cover')"
>
x
</view>
</view>
<image
v-else
:src="form.cover"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -110,23 +102,14 @@
v-if="!form.coverVideo"
class="btn-upload"
>上传视频</view>
<view v-else class="img-wrap">
<video
:src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
<view
v-if="!reviewing"
style="position: absolute; top: 0; right: 0;"
class="delete-badge"
@click.stop="deleteVideo"
>
x
</view>
</view>
<video
v-else
:src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
</view>
</template>
</u-cell>
@@ -160,19 +143,11 @@
v-if="!form.logo"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="form.logo"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('logo')"
>
x
</view>
</view>
<image
v-else
:src="form.logo"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -440,7 +415,7 @@
:show="show"
mode="center"
round="10"
@close="handlePopupClose"
@close="show=false"
>
<view class="popup-body">
<view class="tc bold">入驻申请须知</view>
@@ -458,6 +433,7 @@
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="handleAgree"
/>
</view>
@@ -474,7 +450,6 @@ import {
getShopInfo,
removeApply,
saveShop,
saveHotelDraft,
getHotelInfo,
getCountyFamousHotelType
} from '@/api/join'
@@ -486,8 +461,7 @@ import {
chooseImage,
moreImage,
uploadImage,
chooseVideoToUpload,
formatRichText
chooseVideoToUpload
} from '@/utils'
export default {
@@ -632,33 +606,45 @@ export default {
onLoad(options) {
this.partnerId = options.partnerId || ''
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()
},
onUnload() {
this.saveDraft()
uni.setStorageSync('merchantApplyHotel'+'_quaPics', this.quaPics)
uni.setStorageSync('merchantApplyHotel' + '_form', this.form)
},
onReady() {
this.$refs.shopForm.setRules(this.rules)
},
methods: {
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
},
timeRange(e) {
@@ -707,14 +693,13 @@ export default {
}
},
init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => {
this.district = data
})
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.hotelTypeList = data.hotelTypeList || []
this.columnsType = this.hotelTypeList
this.notice = formatRichText(data.merchantApplyNotice)
this.notice = data.merchantApplyNotice
getCountyFamousHotelType({
page: 1,
limit: 9999
@@ -727,8 +712,6 @@ export default {
}).catch(() => {
this.initInfo()
})
}).catch(() => {
uni.hideLoading()
})
},
@@ -744,20 +727,22 @@ export default {
this.show = true
}
}
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break
case 1:
this.reviewing = false
break
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break
if (data.isDraft !== 1) {
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break
case 1:
this.reviewing = false
break
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break
}
}
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.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
}
}).finally(() => {
uni.hideLoading()
})
},
chooseLogoImg(target) {
@@ -812,15 +795,6 @@ export default {
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() {
if (this.reviewing) return
chooseVideoToUpload(path => {
@@ -828,12 +802,6 @@ export default {
this.$forceUpdate()
})
},
// 删除视频封面
deleteVideo() {
if (this.reviewing) return
this.form.coverVideo = ''
this.$forceUpdate()
},
chooseShopImg() {
if (this.reviewing) return
const _this = this
@@ -970,16 +938,17 @@ export default {
duration: 3000,
success: () => {
this.showRemove = false
this.reviewing = false
setTimeout(() => {
uni.navigateBack()
}, 3000)
}
})
this.initInfo()
})
},
changeAgree(event) {
this.isAgree = event.detail.value.length > 0
},
buildPostData() {
save() {
this.form.pics = ''
const picsLength = this.pics.length
if (picsLength > 0) {
@@ -1002,10 +971,6 @@ export default {
if (postData.coverType === 2) {
postData.cover = postData.coverVideo
}
return postData
},
save() {
const postData = this.buildPostData()
saveShop(postData, this.partnerId, this.promoterUid).then(res => {
if (res.status === 200) {
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-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 {
width: 80px;
height: 80px;
+120 -182
View File
@@ -7,7 +7,7 @@
labelWidth="216rpx"
>
<view
v-if="stateTitle"
v-if="stateTitle && isDraft !== 1"
class="box-state"
>
<u-alert
@@ -59,19 +59,11 @@
v-if="!formSupplier.avatar"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="formSupplier.avatar"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('supplier')"
>
x
</view>
</view>
<image
v-else
:src="formSupplier.avatar"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -279,19 +271,11 @@
v-if="!form.cover"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="form.cover"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('cover')"
>
x
</view>
</view>
<image
v-else
:src="form.cover"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -309,23 +293,14 @@
v-if="!form.coverVideo"
class="btn-upload"
>上传视频</view>
<view v-else class="img-wrap">
<video
:src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
<view
v-if="!reviewing"
style="position: absolute; top: 0; right: 0;"
class="delete-badge"
@click.stop="deleteVideo"
>
x
</view>
</view>
<video
v-else
:src="form.coverVideo"
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
:controls="false"
play-btn-position="center"
class="video-item"
/>
</view>
</template>
</u-cell>
@@ -364,19 +339,11 @@
v-if="!form.logo"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="form.logo"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('logo')"
>
x
</view>
</view>
<image
v-else
:src="form.logo"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -546,7 +513,7 @@
@cancel="changeRemove(false)"
@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="tc bold">入驻申请须知</view>
<view class="content">
@@ -563,6 +530,7 @@
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="handlAgree"
/>
</view>
@@ -578,16 +546,14 @@ import {
getShopInfo,
removeApply,
saveSupplier,
saveWenwanSupplier,
saveSupplierDraft
saveWenwanSupplier
} from '@/api/join'
import {getCity, registerVerify} from '@/api/user'
import {
chooseImage,
moreImage,
uploadImage,
chooseVideoToUpload,
formatRichText
chooseVideoToUpload
} from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins'
@@ -715,8 +681,7 @@ export default {
// 是否为审核中
reviewing: false,
pageKeyId: '',
showUpload: false,
pageType: ''
showUpload: false
}
},
computed: {
@@ -801,8 +766,49 @@ export default {
this.partnerId = options.partnerId || ''
this.promoterUid = options.promoterUid || ''
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
if (type === 'goods_supplier') {
this.infoTitle = '特产'
this.pageKeyId = 'merchantApplyGoodsSupplier'
@@ -816,7 +822,9 @@ export default {
this.init()
},
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() {
this.$refs.shopForm.setRules(this.rules)
@@ -824,23 +832,6 @@ export default {
},
methods: {
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
},
timeRange(e) {
@@ -889,26 +880,19 @@ export default {
}
},
init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => {
this.district = data
})
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.columnsType = data.hotelTypeList
this.columnsSupplierType = data.supplierTypeList
this.notice = formatRichText(data.merchantApplyNotice)
this.notice = data.merchantApplyNotice
this.initInfo()
}).catch(() => {
uni.hideLoading()
})
},
initInfo() {
// 是否缺少参数区分文玩和特产?
// 2026-08-25 BUG 5882 确实需要区分参数
const params = {
subType: this.pageType
}
getShopInfo(params).then((res) => {
getShopInfo().then((res) => {
this.showUpload = true
const {data} = res
// console.log(res, 'initInfo--------');
@@ -921,26 +905,28 @@ export default {
if(data.isDraft === null || data.isDraft === 1) {
this.show = true
}
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break
case 1:
this.reviewing = false
break
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break
if (data.isDraft !== 1) {
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break
case 1:
this.reviewing = false
break
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break
}
}
if (data.hotelInfo) {
// 店铺图片
this.pics = []
this.form = data.hotelInfo
const picsTemp = (this.form.pics || '').split(',')
const picsTemp = this.form.pics.split(',')
if (picsTemp.length > 0) {
picsTemp.map(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.formSupplier.qualification || '').split(',')
const quaPicsTemp = this.form.qualification && this.form.qualification.split(',') || []
if (quaPicsTemp.length > 0) {
console.log(quaPicsTemp, 'quaPicsTemp--------');
this.quaPics = []
quaPicsTemp.map(item => {
if (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.formSupplier.typeText = this.indexSupplierType > -1 ? this.columnsSupplierType[this.indexSupplierType].value : ''
this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6)
this.formSupplier.area = `${this.formSupplier.provinceName || ''} ${this.formSupplier.cityName || ''} ${this.formSupplier.areaName || ''}`
console.log(this.formSupplier);
}
}).finally(() => {
uni.hideLoading()
})
},
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() {
if (this.reviewing) return
chooseVideoToUpload(path => {
@@ -1024,12 +995,6 @@ export default {
this.$forceUpdate()
})
},
// 删除视频封面
deleteVideo() {
if (this.reviewing) return
this.form.coverVideo = ''
this.$forceUpdate()
},
chooseShopImg() {
if (this.reviewing) return
const _this = this
@@ -1164,16 +1129,17 @@ export default {
duration: 3000,
success: () => {
this.showRemove = false
this.reviewing = false
setTimeout(() => {
uni.navigateBack()
}, 3000)
}
})
this.initInfo()
})
},
changeAgree(event) {
this.isAgree = event.detail.value.length > 0
},
buildPostData() {
save() {
this.form.pics = ''
const picsLength = this.pics.length
if (picsLength > 0) {
@@ -1196,10 +1162,6 @@ export default {
if (postData.coverType === 2) {
postData.cover = postData.coverVideo
}
return postData
},
save() {
const postData = this.buildPostData()
if (this.infoTitle === '特产') {
saveSupplier(postData, this.formSupplier, this.partnerId, this.promoterUid).then(res => {
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-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 {
display: flex;
align-items: center;
+4 -45
View File
@@ -344,7 +344,7 @@
{{ '提交审核' }}
</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="tc bold">入驻申请须知</view>
@@ -362,6 +362,7 @@
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="save"
/>
</view>
@@ -375,8 +376,7 @@ import {getCity, registerVerify} from '@/api/user'
import {
chooseImage,
uploadVideo,
uploadImage,
formatRichText
uploadImage
} from '@/utils'
import {
getShopData,
@@ -469,13 +469,10 @@ export default {
onLoad(opts) {
this.partnerId = opts.partnerId || ''
this.promoterUid = opts.promoterUid || ''
uni.showLoading({ title: '加载中...', mask: true })
this.queryCity()
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.notice = formatRichText(data.merchantApplyNotice)
this.notice = data.merchantApplyNotice
this.initInfo()
}).catch(() => {
uni.hideLoading()
})
},
// onShow() {
@@ -495,23 +492,6 @@ export default {
this.isAgree = e.detail.value.includes('yes')
},
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
},
/**
@@ -574,8 +554,6 @@ export default {
}
}).catch(err => {
// uni.$u.toast(err.msg)
}).finally(() => {
uni.hideLoading()
})
},
/**
@@ -882,25 +860,6 @@ export default {
height: 52vh;
overflow-y: auto;
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 {
margin: 60rpx 0;
+75 -175
View File
@@ -6,7 +6,8 @@
labelWidth="216rpx"
>
<view
v-if="stateTitle"
v-if="stateTitle && isDraft!==1 && applyType === 4"
class="box-state"
>
<u-alert
:center="stateType === 'primary'"
@@ -16,11 +17,11 @@
</view>
<u-cell-group
:border="false"
:customStyle="{'fontSize':'40rpx', 'backgroundColor':'#fff'}"
title="礼品集采中心基本信息"
:customStyle="{'fontSize':'40rpx'}"
title="采购批发商基本信息"
>
<u-form-item prop="name">
<u-cell title="中心名称" :border="false">
<u-cell title="批发商名称" :border="false">
<template #icon>
<text class="required">*</text>
</template>
@@ -29,22 +30,7 @@
v-model="form.name"
:disabled="reviewing"
border="none"
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="请填写营业执照名称"
placeholder="请填写批发商名称"
/>
</template>
</u-cell>
@@ -58,19 +44,11 @@
v-if="!form.avatar"
class="btn-upload"
>上传图片</view>
<view v-else class="img-wrap">
<image
:src="form.avatar"
class="img-preview"
/>
<view
v-if="!reviewing"
class="delete-badge"
@click.stop="deleteImg('avatar')"
>
x
</view>
</view>
<image
v-else
:src="form.avatar"
class="img-preview"
/>
</view>
</template>
</u-cell>
@@ -122,7 +100,7 @@
placeholder="请填写验证码"
/>
</view>
<view class="captcha-wrap-ft" v-if="!reviewing">
<view class="captcha-wrap-ft">
<u-code
ref="uCode"
seconds="30"
@@ -141,7 +119,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="qualification">
<view class="full-title">
<view class="licence-section">
<u-cell :border="false">
<template #icon>
<text class="required">*</text>
@@ -154,16 +132,22 @@
<view class="licence-image">
<u-cell :border="false">
<template #title>
<u-upload
:maxCount="9"
:fileList="quaPics"
:disabled="reviewing"
:deletable="!reviewing"
name="quaPics"
multiple
@afterRead="quaAfterRead"
@delete="quaDeletePic"
/>
<view class="box-upload" @click="chooseLogoImg('licence')">
<view
v-if="!form.qualification"
class="btn-upload"
>上传图片</view>
<view v-else>
<view v-if="qualificationArr.length > 0" class="flex">
<image
v-for="(item, index) in qualificationArr"
:key="index"
:src="item"
class="img-preview"
/>
</view>
</view>
</view>
</template>
</u-cell>
</view>
@@ -210,7 +194,7 @@
撤销申请
</view>
<view
v-else-if="reviewStatus !== 1"
v-else
class="btn-submit"
@click="onSubmit"
>
@@ -223,7 +207,7 @@
@cancel="changeRemove(false)"
@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="tc bold">入驻申请须知</view>
<view class="content">
@@ -240,6 +224,7 @@
<u-button
type="error"
text="确定"
:disabled="!isAgree"
@click="save"
/>
</view>
@@ -249,9 +234,9 @@
<script>
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 {chooseImage, uploadImage, formatRichText} from '@/utils'
import {chooseImage} from '@/utils'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
@@ -265,7 +250,6 @@ export default {
tips: '获取验证码',
form: {
name: '',
businessLicense: '',
avatar: '',
contact: '',
phone: '',
@@ -326,7 +310,7 @@ export default {
},
district: [],
address: {},
quaPics: [],
qualificationArr: [],
isAgree: false,
show: false,
notice: '',
@@ -348,9 +332,6 @@ export default {
this.promoterUid = options.promoterUid || ''
this.init()
},
onUnload() {
this.saveDraft()
},
onReady() {
this.$refs.wholesalerForm.setRules(this.rules)
},
@@ -393,90 +374,65 @@ export default {
}
},
init() {
uni.showLoading({ title: '加载中...', mask: true })
getCity().then(({data}) => {
this.district = data
})
getShopData({partnerId: this.partnerId, promoterUid: this.promoterUid}).then(({data}) => {
this.notice = formatRichText(data.merchantApplyNotice)
this.notice = data.merchantApplyNotice
this.initInfo()
}).catch(() => {
uni.hideLoading()
})
},
initInfo() {
getWholesaler().then(({data}) => {
this.applyType = data.applyType
this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus
if (data.applyType === 4) {
this.isDraft = data.isDraft
this.reviewStatus = data.reviewStatus
}
if(data.isDraft === null || data.isDraft === 1) {
this.show = true
}
console.log(data.reviewStatus);
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break;
case 1:
this.stateTitle = '审核通过'
this.stateType = 'success'
this.reviewing = false
break;
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break;
if (data.isDraft !== 1) {
switch (data.reviewStatus) {
case 0:
this.stateTitle = '审核中'
this.stateType = 'primary'
this.reviewing = true
break;
case 1:
this.reviewing = false
break;
case 2:
this.stateTitle = '审核驳回:' + data.reviewMsg
this.stateType = 'error'
this.reviewing = false
break;
}
}
if (data.wholesalerInfo) {
this.form = data.wholesalerInfo
this.quaPics = []
if (this.form.qualification) {
this.form.qualification.split(',').map(item => {
if (item) {
this.quaPics.push({url: item})
}
})
this.qualificationArr = this.form.qualification.split(',')
}
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) {
if (this.reviewing) return
chooseImage(img => {
if (target === 'avatar') {
this.form.avatar = img
switch (target) {
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) {
this.address = {
@@ -493,7 +449,7 @@ export default {
this.form.areaId = values.district.id
},
onSubmit() {
this.buildQualification()
this.$refs.wholesalerForm.validate().then(res => {
// 校验通过
saveWholesaler(this.form).then(res => {
@@ -529,10 +485,11 @@ export default {
duration: 3000,
success: () => {
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
},
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
},
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">
@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 {
.item {
@@ -603,26 +518,14 @@ export default {
}
}
/deep/ .licence-section{
.u-cell__title{
width: 650rpx!important;
}
}
.font-color-red{
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 {
display: flex;
align-items: center;
@@ -630,7 +533,4 @@ export default {
flex: 1;
}
}
.btn-submit{
position: sticky !important;
}
</style>
@@ -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 -20
View File
@@ -592,11 +592,7 @@
{{ tab.name }}
</view>
</view>
<scroll-view
class="village-wrap v12-pt-3"
scroll-y
@scrolltolower="getShopList()"
>
<view class="village-wrap v12-pt-3">
<view class="v12-pa-2 sale-wrap">
<view
v-for="(type, typeIndex) in shopTypeList"
@@ -649,7 +645,7 @@
</view>
</view>
<view v-else class="no-data">暂无店铺</view>
</scroll-view>
</view>
</view>
</view>
<view v-if="shopList.length > 0" class="load-more-status">
@@ -674,13 +670,9 @@
{{ tab.name }}
</view>
</view>
<scroll-view
class="village-wrap"
scroll-y
@scrolltolower="getJiaLouListReq()"
>
<view class="village-wrap">
<view class="v12-pa-2 sale-wrap">
</view>
<view v-if="jiaLouList.length > 0" class="village-list">
<view
@@ -721,7 +713,7 @@
</view>
</view>
<view v-else class="no-data">暂无数据</view>
</scroll-view>
</view>
</view>
</view>
<view v-if="jiaLouList.length > 0" class="load-more-status">
@@ -1840,13 +1832,7 @@ export default {
this.hotelItemClick({ id: linkHotelId })
},
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
uni.navigateTo({ url: `/pkg_product/views/famousQianxianTheme?id=${item.id}` })
},
+37 -98
View File
@@ -7,16 +7,16 @@
<view class="v12-font-28 v12-font-bold">退款金额</view>
<view class="return-method">退回原支付方</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>
<u-divider></u-divider>
<view class="order-amount">
<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 class="deduction-amount v12-mt-2">
<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>
@@ -49,26 +49,19 @@
<!-- 提交按钮 -->
<view class="v12-mt-3">
<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>
<button class="submit-btn v12-primary v12-white-text v12-radius-100 v12-font-32" block @click="submitRefund">点击确认退款</button>
</view>
</view>
</template>
<script>
import { fetchSojoumOrderDetail, sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js'
import { sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js'
export default {
data() {
return {
refundAmount: '',
orderAmount: '',
deductionAmount: '',
refundStatus: 0,
refundReasons: [
'行程变更',
'定错时间/地址',
@@ -79,22 +72,7 @@ export default {
],
selectedReason: '',
otherReason: '',
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
key: ''
}
},
onLoad(opts) {
@@ -102,63 +80,21 @@ export default {
this.getRefundInfo(opts.id)
},
methods: {
async getRefundInfo(id) {
try {
const [refundRes, orderRes] = await Promise.all([
sojoumOrderRefundInfo({
orderId: id
}),
fetchSojoumOrderDetail({
key: id
})
])
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) {
}
getRefundInfo(id) {
sojoumOrderRefundInfo({
orderId: id
}).then(res => {
if (res.status === 200) {
this.refundAmount = res.data.refundPrice
this.orderAmount = res.data.payPrice
this.deductionAmount = res.data.penalty
}
})
},
selectReason(reason) {
if (this.isSubmitDisabled) {
return
}
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() {
if (this.isSubmitDisabled) {
uni.showToast({
title: '退款申请已被驳回',
icon: 'none'
})
return
}
// TODO: 实现退款提交逻辑
// orderId string 订单号
// refundReasonWap string 选择的退款原因
@@ -186,7 +122,6 @@ export default {
title: '加载中...',
mask: true,
})
this.submitting = true
sojoumOrderRefund(refundData).then(res => {
if (res.status === 200) {
uni.showToast({
@@ -198,7 +133,6 @@ export default {
})
}
}).finally(() => {
this.submitting = false
uni.hideLoading();
})
}
@@ -295,22 +229,27 @@ export default {
}
}
.submit-btn {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #fff;
font-size: 28rpx;
border-radius: 40rpx;
border: none;
letter-spacing: 4rpx;
font-weight: 500;
}
.submit-section {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 30rpx;
background-color: #fff;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
.submit-btn-disabled {
background-color: #c0c4cc !important;
color: #ffffff !important;
.submit-btn {
width: 100%;
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({
path: "/pages/order/MyOrder/index",
query: {
type: 1,
tabIndex: 1
type: 1
}
});
break;
@@ -356,8 +355,7 @@ export default {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1,
tabIndex: 1
type: 1
}
})
break;
@@ -367,8 +365,7 @@ export default {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1,
tabIndex: 1
type: 1
}
})
})
@@ -379,8 +376,7 @@ export default {
this.$yrouter.replace({
path: "/pages/order/MyOrder/index",
query: {
type: 1,
tabIndex: 1
type: 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>
@@ -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>
<view class="dialog-conent" v-show="isLogin">
<view class="gift-card-modal" :class="{'ios-cover': isIOS}">
<image
class="bg-image"
:src="!card.isBlind ? card.cover : card.blindBoxImage"
mode="widthFix"
lazy-load="false"
/>
<view
v-if="card.isBlind !== 1 && !card.isUseAiCoverImg"
:style="{
top: card.productImageY*2 + 'rpx',
left: card.productImageX*2+ 'rpx'
}"
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"
/>
<image class="bg-image" :src="!card.isBlind ? card.cover : card.blindBoxImage" mode="widthFix" lazy-load="false"></image>
<view v-if="card.isBlind !== 1" class="image-wrap" :style="{
top: card.productImageY*2 + 'rpx',
left: card.productImageX*2+ 'rpx'
}">
<image v-if="!isTravelGroup" class="pro-image" :src="card.giftProducts[0].productImage" mode="aspectFit|aspectFill|widthFix" lazy-load="false">
</image>
<image v-if="isTravelGroup" class="pro-image" :src="card.travelGroupProduct.mainImage" mode="aspectFit|aspectFill|widthFix" lazy-load="false">
</image>
</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="{
right: (card.productStoryX*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>
+40 -628
View File
@@ -1,134 +1,9 @@
<template>
<view
v-if="isLoad && ((goodsInfo.productInfo && goodsInfo.productInfo.storeName) || isGroupBuy)"
class="gift-page"
>
<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"
>
<view class="gift-page" v-if="(goodsInfo.productInfo && goodsInfo.productInfo.storeName) || isGroupBuy">
<view class="top-card" v-if="!isPayOk ">
<view class="v12-justify-between" @click="handleShowCover">
<image class="popCover" :src="popupCover" mode="widthFix" lazy-load="false"></image>
</view>
<view
v-if="selectCoverType === 'ai'"
class="ai-cover-wrap"
>
<view class="ai-cover-body">
<view class="ai-cover-container">
<view v-if="!showAiImgHistoryListSelect">
<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 ai-img-list-wrap">
<view
v-for="(item, index) in aiCoverImgsList"
:key="index"
class="img-item"
>
<image
:src="item.cover"
:class="{
'active': item.id === selectedAiCoverImage.id
}"
mode="heightFix"
class="img-image"
@click="handleSelectAiCover(item)"
/>
</view>
</view>
</view>
<view v-else>
<view
:class="{'scrollable': aiHistoryCoverImgsList.length > 3}"
class="imgs-list-wrap"
>
<view
v-for="(item, index) in aiHistoryCoverImgsList"
:key="index"
class="img-item"
>
<image
:src="item.cover"
:class="{
'active': item.id === selectedAiCoverImage.id
}"
mode="heightFix"
class="img-image"
@click="handleSelectAiHistoryCover(item)"
/>
</view>
</view>
</view>
</view>
<view class="ai-cover-bottom">
<block v-if="!showAiImgHistoryListSelect">
<view v-if="showGenerateBtn" class="btn-wrap">
<view
v-if="!aiCoverGenerateLoading && aiHistoryCoverImgsList.length > 0"
class="btn btn2"
@click="toggleShowAiImgHistoryListSelect(true)"
>
历史图片
</view>
<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>
</block>
<block v-else>
<view class="btn-wrap">
<view class="btn" @click="handleShowAiHistoryCoverPicker">
预览
</view>
<view class="btn btn2" @click="toggleShowAiImgHistoryListSelect(false)">
使用AI生成
</view>
</view>
</block>
</view>
</view>
</view>
</view>
<view class="gift-good-card">
<view class="v12-align-center v12-justify-start">
@@ -255,7 +130,7 @@
</view>
</button>
<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 class="btn-wrap v12-mt-14 v12-justify-center" v-if="isPayOk && !isGroupBuy">
<view class="gift-submit" @click="makeAgain">再送一份</view>
@@ -273,18 +148,6 @@
:index="defaultIndex"
:message="message"
/>
<AiCoverPicker
:show.sync="showAiCoverPicker"
:list="aiCoverImgsList"
:index="aiDefaultIndex"
@confirm="onAiCoverConfirm"
/>
<AiHistoryCoverPicker
:show.sync="showAiHistoryCoverPicker"
:list="aiHistoryCoverImgsList"
:index="aiHistoryDefaultIndex"
@confirm="onAiHistoryCoverConfirm"
/>
<passkeyborad
ref='payPwdPop'
showMoney
@@ -353,28 +216,18 @@ import {
createGroupBuyGift,
createSojoumGroupBuyGift,
fetchSojoumGroupBuyGiftCarousel,
computedSojoumGroupBuyGiftOrderPrice,
aiGiftImageGenerate,
aiGiftImageStatus,
aiGiftImageHistory
computedSojoumGroupBuyGiftOrderPrice
} from '@/api/gift'
import {
getAiSystemInfoSetting
} from '@/api/public'
import { weappPay } from "@/libs/wechat";
import {mapGetters} from "vuex";
import giftTips from './components/giftTips.vue'
import CoverPicker from './components/CoverPicker.vue'
import AiCoverPicker from './components/AiCoverPicker.vue'
import AiHistoryCoverPicker from './components/AiHistoryCoverPicker.vue'
import PayPicker from './components/PayPicker.vue';
import CouponsPopup from "@/components/CouponsPopup.vue"
export default {
components: {
giftTips,
CoverPicker,
AiCoverPicker,
AiHistoryCoverPicker,
PayPicker,
passkeyborad,
CouponsPopup
@@ -382,13 +235,9 @@ export default {
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
loading: true,
// 盲盒礼包
isBlind: false,
// 一人领取所有礼品
isOneRecipient: false,
// 是否支持好友转赠
canTransfer: false,
message: '',
cartId: '',
@@ -409,7 +258,6 @@ export default {
isShowPayPwdPop: false,
payPassword: '',
payType: '',
// 是否支付成功
isPayOk: false,
giftKey: '',
payPrice: 0,
@@ -417,65 +265,23 @@ export default {
defaultIndex:0,
discount: null,
computedResult: {},
skipCouponIdWatch: false,
couponList: {
unusable: [],
usable: []
},
couponTitle: '',
showPopup: false,
// 盲盒礼包图片
blindImage: '',
// 是否为旅居团购礼品
isGroupBuy: false,
popupCover: '',
showInput: true,
// 是否为县区抽奖礼品
isCountyLotteryGift: false,
// 县域抽奖弹窗
showLotteryGiftPopup: 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,
aiHistoryDefaultIndex: 0,
showAiHistoryCoverPicker: false,
aiHistoryCoverImgsList: [],
showAiImgHistoryListSelect: false
isEligibleForDraw: false
}
},
watch: {
async couponId(value) {
if (this.skipCouponIdWatch) {
this.skipCouponIdWatch = false
return
}
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (Number(value || 0) !== 0) {
@@ -493,12 +299,11 @@ export default {
}
},
onLoad(opts) {
const pageQuery = Object.assign({}, this.resolvePageQuery(), opts || {})
this.cartId = pageQuery.cartId
this.isGroupBuy = pageQuery.isGroupBuy === '1'
this.isCountyLotteryGift = pageQuery.from === 'countyLottery' || pageQuery.isCountyLotteryGift === '1' || !!pageQuery.drawActivityId
this.cartId = opts.cartId
this.isGroupBuy = opts.isGroupBuy === '1'
this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
// this.couponId = opts.couponId || 0
this.discount = pageQuery.discount
this.discount = opts.discount
if(this.isGroupBuy) {
this.getGroupBuyInfo()
} else {
@@ -507,16 +312,6 @@ export default {
fetchSojoumGroupBuyGiftCarousel().then(res => {
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: {
...mapGetters(["userInfo"]),
@@ -537,149 +332,10 @@ export default {
}
},
methods: {
// 封面类型切换
toggleSelectCoverType(type) {
if (this.selectCoverType === type) return
this.selectCoverType = type
},
// 获取商品以前使用过的AI礼品卡图片
aiGiftImageHistoryReq() {
aiGiftImageHistory({
productId: this.goodsInfo.productId
}).then(res => {
const { success, data } = res
if (success && data) {
this.aiHistoryCoverImgsList = data || []
this.aiHistoryCoverImgsList.map(historyItem => {
historyItem.cover = historyItem.coverUrl,
historyItem.image = historyItem.shareUrl,
historyItem.name = historyItem.name || ''
})
}
})
},
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
},
setCouponIdSilently(value) {
if (this.couponId === value) return
this.skipCouponIdWatch = true
this.couponId = value
},
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.setCouponIdSilently(0)
}
},
adjustCoverListForProductStory(coverList, productInfo, defaultTemplate) {
if (!productInfo || !productInfo.productStory) {
return {
@@ -722,40 +378,16 @@ export default {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.setCouponIdSilently(0)
this.couponId = 0
}
} else if(useDefaultCouponId) {
this.setCouponIdSilently(res.data.result.defaultCouponId || 0)
this.couponId = res.data.result.defaultCouponId || 0
}
})
},
handleShowCover() {
this.showCoverPicker = true
},
handleShowAiCover() {
this.showAiCoverPicker = true
},
handleShowAiHistoryCoverPicker() {
this.showAiHistoryCoverPicker = true
},
toggleShowAiImgHistoryListSelect(show) {
this.showAiImgHistoryListSelect = show
this.selectedAiCoverImage = {}
this.selectedCover = ''
this.giftImage = ''
this.templateId = ''
this.aiHistoryDefaultIndex = 0
this.aiDefaultIndex = 0
if (show) {
if (this.aiHistoryCoverImgsList.length > 0 && this.aiHistoryDefaultIndex === 0) {
const index = this.aiHistoryCoverImgsList.findIndex(item => item.isLastSelected)
if (index !== -1) {
this.aiHistoryDefaultIndex = index
}
this.handleSelectAiHistoryCover(this.aiHistoryCoverImgsList[this.aiHistoryDefaultIndex])
}
}
},
showCouponsPopup() {
if (this.isCountyLotteryGift) return
if (this.couponList.usable && this.couponList.usable.length === 0) return
@@ -771,7 +403,7 @@ export default {
if (this.couponList.usable && this.couponList.usable.length === 0) return
this.showPopup = !this.showPopup
if(!item.id) {
this.setCouponIdSilently(0)
this.couponId = 0
this.couponTitle = ''
if(this.isGroupBuy) {
this.computedTravelGroupPrice(false)
@@ -780,7 +412,7 @@ export default {
}
return
}
this.setCouponIdSilently(item.id)
this.couponId = item.id
this.couponTitle = item.couponTitle
if(this.isGroupBuy) {
this.computedTravelGroupPrice(false)
@@ -804,18 +436,12 @@ export default {
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
console.log(this.defaultIndex, 'defaultIndex');
this.selectedCover = template.cover
this.giftImage = template.image
if (this.selectCoverType === 'ai') {
this.selectedCover = this.selectedAiCoverImage.cover
this.giftImage = this.selectedAiCoverImage.image
this.templateId = this.selectedAiCoverImage.id
}
this.setCouponIdSilently('')
this.couponId = ''
this.computedPrice(this.goodsInfo.cartNum)
})
},
@@ -852,10 +478,10 @@ export default {
if (this.isCountyLotteryGift) {
this.couponTitle = ''
if (this.couponId !== 0) {
this.setCouponIdSilently(0)
this.couponId = 0
}
} else if(!f) {
this.setCouponIdSilently(res.data.result.defaultCouponId || 0)
this.couponId = res.data.result.defaultCouponId || 0
this.$forceUpdate()
}
this.payPrice = res.data.result.payPrice
@@ -863,24 +489,6 @@ export default {
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) {
this.payPassword = payPwd;
this.confirmGift(true);
@@ -892,44 +500,8 @@ export default {
onCoverConfirm(cover) {
this.cover = cover.name
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)
}
},
onAiHistoryCoverConfirm(cover) {
// 封面图片
this.selectedCover = cover.cover
// 分享对话图片
this.giftImage = cover.image
if (this.selectCoverType === 'ai') {
this.selectedAiCoverImage = cover
this.aiHistoryDefaultIndex = this.aiHistoryCoverImgsList.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.giftImage = cover.image
this.templateId = cover.id
},
handleSelectAiHistoryCover(cover) {
this.selectedAiCoverImage = cover
this.aiHistoryDefaultIndex = this.aiHistoryCoverImgsList.findIndex(item => item.id === cover.id)
this.selectedCover = cover.cover
this.giftImage = cover.image
this.templateId = cover.id
},
showTips() {
this.$refs.giftTips.showTips = true
@@ -941,28 +513,24 @@ export default {
}
this.loading = true
getGiftCardSendOrderConfirm(params).then(res => {
const data = res.data
const temp = this.isGroupBuy ? data.giftCardTemplates : data.giftCardTemplates.filter(e => e.isTravelGroup === 0)
const hasSpecial = data.giftCardTemplates.map(e => e.id).includes(data.specialGiftCardTemplate.id)
const initialCoverList = hasSpecial ? [...temp] : [...temp, data.specialGiftCardTemplate]
const goodsInfo = data.cartInfo[0]
const { coverList, template } = this.adjustCoverListForProductStory(initialCoverList, goodsInfo && goodsInfo.productInfo, data.specialGiftCardTemplate)
const temp = this.isGroupBuy ? res.data.giftCardTemplates : res.data.giftCardTemplates.filter(e => e.isTravelGroup === 0)
const hasSpecial = res.data.giftCardTemplates.map(e => e.id).includes(res.data.specialGiftCardTemplate.id)
const initialCoverList = hasSpecial ? [...temp] : [...temp, res.data.specialGiftCardTemplate]
const goodsInfo = res.data.cartInfo[0]
const { coverList, template } = this.adjustCoverListForProductStory(initialCoverList, goodsInfo && goodsInfo.productInfo, res.data.specialGiftCardTemplate)
this.coverList = coverList
this.giftNotice = data.giftCardGiftNotice
this.orderKey = data.orderKey
this.giftNotice = res.data.giftCardGiftNotice
this.orderKey = res.data.orderKey
this.goodsInfo = goodsInfo
this.syncCountyLotteryGiftFlag(goodsInfo)
this.templateId = template.id
this.selectedCover = template.cover
this.giftImage = template.image
this.blindImage = data.giftCardBlindBoxShareImage
this.blindImage = res.data.giftCardBlindBoxShareImage
this.defaultIndex = this.coverList.findIndex(item => item.id === this.templateId)
// if(!this.couponId) {
// this.couponId = data.couponList.usable[0] && data.couponList.usable[0].id || ''
// this.couponId = res.data.couponList.usable[0] && res.data.couponList.usable[0].id || ''
// }
this.computedPrice(this.goodsInfo.cartNum)
this.aiGiftImageHistoryReq()
this.isLoad = true
}).finally(() => {
this.loading = false
})
@@ -970,17 +538,12 @@ export default {
isDrawEligible(flag) {
return flag === true || flag === 1 || flag === '1' || flag === 'true'
},
handleGiftPaySuccess(data) {
if (data.giftCard) {
this.selectedCover = data.giftCard.cover || this.selectedCover
this.giftImage = data.giftCard.giftCardImage || this.giftImage
}
handleGiftPaySuccess(isEligibleForDraw = false) {
this.isPayOk = true
this.isEligibleForDraw = this.isDrawEligible(data.isEligibleForDraw)
this.isEligibleForDraw = this.isDrawEligible(isEligibleForDraw)
if (this.isCountyLotteryGift && this.isEligibleForDraw) {
this.showLotteryGiftPopup = true
}
this.aiGiftImageHistoryReq()
},
closeLotteryGiftPopup() {
this.showLotteryGiftPopup = false
@@ -1021,9 +584,7 @@ export default {
key: this.orderKey,
from: 'routine',
cartId: this.cartId,
templateId: this.selectCoverType === 'default' ? this.templateId : '',
aiGiftImageId: this.selectCoverType === 'default' ? '' : this.selectedAiCoverImage.id,
cover: this.selectedCover,
templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意',
canTransfer: this.canTransfer ? 1 : 0,
passwordPay: this.payPassword || '',
@@ -1035,8 +596,7 @@ export default {
cartId: this.cartId,
couponId: this.getCouponId(),
recipientsNum: this.goodsInfo.cartNum,
templateId: this.selectCoverType === 'default' ? this.templateId : '',
aiGiftImageId: this.selectCoverType === 'default' ? '' : this.selectedAiCoverImage.id,
templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意',
cover: this.selectedCover,
canTransfer: this.canTransfer ? 1 : 0,
@@ -1084,7 +644,7 @@ export default {
icon: "none",
duration: 2000
});
this.handleGiftPaySuccess(data);
this.handleGiftPaySuccess(data.isEligibleForDraw);
break;
case "WECHAT_H5_PAY":
// H5支付
@@ -1101,7 +661,7 @@ export default {
icon: "none",
duration: 2000
});
this.handleGiftPaySuccess(data);
this.handleGiftPaySuccess(data.isEligibleForDraw);
}).catch(err => {
// this.makeAgain()
@@ -1122,7 +682,7 @@ export default {
});
break;
}
}).catch(err => {
}) .catch(err => {
console.log(err);
uni.hideLoading();
uni.showToast({
@@ -1130,14 +690,6 @@ export default {
icon: "none",
duration: 2000
});
// Fix bug#6073-订单超时后需自动刷新该页面
if (err.res.statusCode === 5113) {
if(this.isGroupBuy) {
this.getGroupBuyInfo()
} else {
this.getGift()
}
}
}).finally(() => {
this.isShowPayPwdPop = false;
this.$refs.payPwdPop.clear();//清空支付密码
@@ -1148,7 +700,6 @@ export default {
const params = {
travelGroupProductId: this.cartId
}
this.isLoad = false
createGroupBuyGift(params).then(res => {
if (res.status === 200) {
this.coverList = res.data.giftCardTemplates || []
@@ -1164,7 +715,6 @@ export default {
}
this.giftNotice = res.data.giftCardGiftNotice
this.computedTravelGroupPrice(true)
this.isLoad = true
}
})
}
@@ -1232,7 +782,11 @@ export default {
border-radius: 16rpx;
}
.tip-wrap{
margin: 32rpx auto 68rpx auto;
position: absolute;
bottom: 50rpx;
left: 0;
margin: auto;
right: 0;
align-items: center;
}
.tip-text{
@@ -1258,6 +812,7 @@ export default {
}
.top-card{
// height: 280rpx;
background: #fff;
border-radius: 16rpx;
}
.line{
@@ -1310,6 +865,7 @@ export default {
}
.popCover{
width: 100%;
border-radius: 16rpx;
}
.lottery-gift-popup{
background: #fff;
@@ -1385,148 +941,4 @@ export default {
.lottery-gift-btn.send::after{
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: center;
align-items: baseline;
gap: 40rpx;
padding: 20rpx 0;
box-sizing: border-box;
&.scrollable {
justify-content: flex-start;
flex-wrap: nowrap;
overflow-x: auto;
}
}
.img-image {
display: block;
height: 176rpx;
flex-shrink: 0;
&.active {
transform: scale(1.2) translateY(-16rpx);
}
}
.ai-img-list-wrap {
padding: 28rpx 0 20rpx 0;
}
}
.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>
+1 -2
View File
@@ -5,8 +5,7 @@
:card="giftCard"
:isTravelGroup="isTravelGroup"
:addr="giftChooseAddress"
@receive="onReceive($event)"
/>
@receive="onReceive($event)" />
<view v-else>
<view class="no-img-wrap" v-if="isExpire">
<view class="wrap-box" >
+11 -98
View File
@@ -18,16 +18,11 @@
<view v-if="cateIndex === 0" class="list-body">
<block v-if="sendList.length > 0">
<view
v-for="(item, index) in sendList"
: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
v-for="(cart, cartIndex) in item.giftInfo"
:key="cartIndex"
@@ -140,16 +135,10 @@
<view
v-for="(item, index) in receiveList"
: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
v-for="(cart, cartIndex) in item._renderGiftInfos"
v-for="(cart, cartIndex) in item.giftInfos"
:key="cartIndex"
class="gift-body"
@click="giftItemClickHanlde(item)"
@@ -157,20 +146,20 @@
>
<view class="gift-img">
<image
:src="cart._displayImage"
:src="cart.productInfo.image"
class="img"
/>
</view>
<view class="gift-good-info">
<view class="name more-t">
{{ cart._displayName }}
{{ cart.productInfo.storeName }}
</view>
<view v-if="cart._displaySku" class="attr-txt">
<view class="txt">{{ cart._displaySku }}</view>
<view v-if="cart.productInfo.attrInfo" class="attr-txt">
<view class="txt">{{ cart.productInfo.attrInfo.sku }}</view>
</view>
<view v-if="cart._showPrice" class="price-wrap">
<view class="price-wrap">
<view class="price">
<text class="prefix"></text>{{ cart._displayPrice }}
<text class="prefix"></text>{{ cart.productInfo.attrInfo.price }}
</view>
</view>
</view>
@@ -453,8 +442,7 @@ export default {
const { success, data } = res
if (success) {
const { list, hasMore } = this.getListResult(data, page)
const formatList = list.map(item => this.normalizeReceiveGiftItem(item))
this.receiveList = page === 1 ? formatList : this.receiveList.concat(formatList)
this.receiveList = page === 1 ? list : this.receiveList.concat(list)
this.receiveHasMore = hasMore
this.receivePage = page + 1
this.receiveInited = true
@@ -538,51 +526,6 @@ export default {
}
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() {
this.$refs.giftTips.showTips = true
},
@@ -653,40 +596,10 @@ export default {
z-index: 2;
padding: 84rpx 0 80rpx 0;
.gift-item {
position: relative;
padding: 16rpx;
margin: 0 0 24rpx;
border-radius: 16rpx;
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 {
display: flex;
align-items: center;
+6 -51
View File
@@ -17,16 +17,13 @@
</view>
<view class="amount-box">
<view class="v12-justify-between">
<view class="title bold">提现金额</view>
<view class="title" @click="showRules">提现规则</view>
</view>
<view class="title bold">提现金额</view>
<view class="item acea-row row-middle">
<view class="dollar bold"></view>
<view class="input">
<u--input
v-model="amout"
placeholder="请输入提现金额"
:placeholder="'最低提现金额' + minPrice"
:maxlength="-1"
:customStyle="{
'border': 0
@@ -71,25 +68,18 @@
</block>
</blPaymentPasswordInput>
</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>
</template>
<script>
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 uniPopup from '@/components/uni-popup/uni-popup.vue';
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import { pageListenMixins } from '@/mixins/pageListenMixins'
import { formatRichText } from '@/utils'
export default {
mixins: [pageListenMixins],
@@ -107,8 +97,7 @@ export default {
gdLimit: 0, //最低固定费率额度
feeRate: 0, //手续费费率
remark: "", //提现说明
pageKeyId: Object.freeze('userExtractIndex'),
withdrawalRules: '',
pageKeyId: Object.freeze('userExtractIndex')
}
},
components: {
@@ -146,12 +135,6 @@ export default {
}
},
methods: {
showRules() {
getWithdrawalRules().then(res => {
this.withdrawalRules = formatRichText(res.data);
this.$refs.rulesPopup.open();
})
},
calculateSxf: function (amout) {
var sxf = 0;
if (amout == 0) {
@@ -494,32 +477,4 @@ export default {
line-height: 40rpx;
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 {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) {
time = +time * 1000;
const d = new Date(time);
-12
View File
@@ -34,7 +34,6 @@ export default {
pages: 0, // 总页数
list: [],
os: '',
isClick: false, // 防止连续点击重复请求/跳转
pageKeyId: Object.freeze('investmentList')
}
},
@@ -42,10 +41,6 @@ export default {
this.getOS()
this.getData()
},
onShow() {
// 从文件阅读页返回时解锁,允许再次点击
this.isClick = false
},
onReachBottom() {
if (this.pages >= this.page) this.getData()
},
@@ -72,8 +67,6 @@ export default {
})
},
getDetail(id) {
if (this.isClick) return
this.isClick = true
investmentInfo(id).then(({data}) => {
const file = data.contents[0];
if (file.suffix === 'pdf' && this.os === 'android') {
@@ -84,8 +77,6 @@ export default {
url: '/pkg_common/views/pdf?path=' + encodeURI(path) + '&id=' + id
})
}
}).catch(() => {
this.isClick = false
})
},
viewPdf(url) {
@@ -98,10 +89,8 @@ export default {
fileType: 'pdf',
success: result => {
//成功
this.isClick = false
},
fail: err => {
this.isClick = false
uni.showModal({
title: 'openDocument fail',
content: JSON.stringify(err)
@@ -110,7 +99,6 @@ export default {
})
},
fail: err => {
this.isClick = false
uni.showModal({
title: 'downloadFile fail',
content: JSON.stringify(err)
+2 -2
View File
@@ -9,8 +9,8 @@
<view class="location-box flex ai-center">
<!-- @click="goCity"-->
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image>
<text class="city-name">当前城市{{ cityName }}</text>
<text></text>
<text class="city-name">{{ cityName }}</text>
<text>当前定位</text>
</view>
<view class="more-box flex ai-center">
<text @click="goClass">全部商品列表</text>