feat: 优化消息互动中心与首页Banner呈现,同步全量业务数据与高清图标

这个提交包含在:
2026-10-24 11:39:44 +08:00
父节点 0f84426c33
当前提交 d18b597010
共有 109 个文件被更改,包括 3385 次插入 和 526 次删除

查看文件

@@ -252,17 +252,18 @@
</view>
</view>
<!-- 未解锁态(普通非会员):极简纯净,无多余口号标签 -->
<!-- 未解锁态:会员特权与普通付费分流,权益真实呈现 -->
<view v-else class="detail__contact-locked">
<view class="detail__locked-row">
<text class="detail__contact-key">联系电话</text>
<text class="detail__locked-mask">{{ post.phone || post.contact || '188****5042' }}</text>
</view>
<view class="detail__locked-action-bar">
<view class="detail__btn-unlock" @click="openPayModal">
<text>解锁完整内容 (¥2)</text>
<view class="detail__btn-unlock" :class="{ 'detail__btn-unlock--vip': isVipUser && freeViewLeft > 0 }" @click="handleUnlockClick">
<text>{{ unlockBtnText }}</text>
</view>
<text class="detail__vip-link" @click="goVip">开通会员免费看 ›</text>
<text v-if="!isVipUser" class="detail__vip-link" @click="goVip">开通会员免费看 ›</text>
<text v-else class="detail__vip-link detail__vip-link--member">今日剩余 {{ freeViewLeft }} 次免费</text>
</view>
</view>
</view>
@@ -328,7 +329,7 @@
<text class="detail__bar-text">海报</text>
</view>
<view class="detail__bar-main" @click="onMainAction">
<text>{{ loading && !loaded ? '加载中…' : (unlocked ? '拨打电话' : '解锁完整内容 (¥2)') }}</text>
<text>{{ bottomBarText }}</text>
</view>
</view>
@@ -343,7 +344,7 @@
<text class="detail__cashier-target-title fc-ellipsis">{{ post.title }}</text>
<view class="detail__cashier-price-row">
<text class="detail__cashier-price-symbol">¥</text>
<text class="detail__cashier-price-val">2.00</text>
<text class="detail__cashier-price-val">{{ Number(payViewPrice).toFixed(2) }}</text>
</view>
</view>
<view class="detail__cashier-methods">
@@ -382,7 +383,7 @@
<text class="detail__cashier-vip-arrow">去开通 ›</text>
</view>
<view class="detail__cashier-btn" :class="{ 'detail__cashier-btn--disabled': submitting }" @click="confirmPay">
<text>{{ submitting ? '处理中…' : '立即支付 ¥2 解锁' }}</text>
<text>{{ submitting ? '处理中…' : `立即支付 ¥${payViewPrice} 解锁` }}</text>
</view>
</view>
</view>
@@ -506,6 +507,9 @@ export default {
id: 0,
post: { publisher: {}, tags: [] },
unlocked: false,
isVipUser: false,
freeViewLeft: 0,
payViewPrice: 2,
payType: config.defaultPayType || 'wxpay',
contact: { name: '', phone: '', wechat: '' },
comments: [],
@@ -585,6 +589,34 @@ export default {
}
return this.hasLocation
},
/**
* 联系方式卡片解锁按钮文案
* @returns {string}
*/
unlockBtnText() {
if (this.isVipUser && this.freeViewLeft > 0) {
return `VIP免费解锁 (剩${this.freeViewLeft}次)`
}
if (this.isVipUser && this.freeViewLeft === 0) {
return `免费额度已用完 (¥${this.payViewPrice}解锁)`
}
return `解锁完整内容 (¥${this.payViewPrice})`
},
/**
* 底部主操作栏文案
* @returns {string}
*/
bottomBarText() {
if (this.loading && !this.loaded) return '加载中…'
if (this.unlocked) return '拨打电话'
if (this.isVipUser && this.freeViewLeft > 0) {
return `VIP免费解锁 (今日剩余${this.freeViewLeft}次)`
}
if (this.isVipUser && this.freeViewLeft === 0) {
return `今日免费已用完 · ¥${this.payViewPrice} 解锁`
}
return `解锁完整内容 (¥${this.payViewPrice})`
},
timeText() {
return fromNow(this.post.createdAt)
},
@@ -771,11 +803,16 @@ export default {
return false
},
/**
* 回显解锁数据与联系方式
* 回显解锁数据与联系方式(支持真实会员特权与商家电话下发)
* @param {Object} res 接口返回数据
*/
applyAccess(res) {
this.unlocked = !!(res && res.unlocked)
if (res) {
if (res.isMember != null) this.isVipUser = !!res.isMember
if (res.freeViewLeft != null) this.freeViewLeft = Number(res.freeViewLeft)
if (res.payViewPrice != null) this.payViewPrice = Number(res.payViewPrice)
}
this.contact = this.unlocked
? {
name: (res && (res.contactName || res.publisher?.name)) || '',
@@ -783,6 +820,38 @@ export default {
wechat: (res && res.wechat) || '',
}
: { name: '', phone: '', wechat: '' }
// 若发帖人有关联商家,解锁态下同步刷新商家实体门店电话
if (this.unlocked && res && res.merchant && res.merchant.contact && this.post.merchant) {
this.post.merchant.contact = res.merchant.contact
}
},
/**
* 点击联系方式解锁按钮(智能区分会员免密免费解锁与非会员收银台)
*/
handleUnlockClick() {
if (!this.ensureLogin()) return
if (this.isVipUser && this.freeViewLeft > 0) {
this.unlockWithVip()
} else {
this.openPayModal()
}
},
/**
* 会员每日免密免费解锁(真实扣减会员当日权益)
*/
async unlockWithVip() {
if (this.submitting) return
this.submitting = true
try {
const res = await postApi.payView(this.id, { payType: 'free' })
this.applyAccess(res)
uni.showToast({ title: '已使用会员免费权益解锁', icon: 'none' })
} catch (e) {
uni.showToast({ title: e.message || '解锁失败', icon: 'none' })
} finally {
this.submitting = false
}
},
/**
* 页面回显静默刷新解锁权限
@@ -818,6 +887,8 @@ export default {
if (this.loading && !this.loaded) return
if (this.unlocked) {
this.callPhone()
} else if (this.isVipUser && this.freeViewLeft > 0) {
this.unlockWithVip()
} else {
this.openPayModal()
}
@@ -2083,6 +2154,9 @@ export default {
color: #f5a623;
font-weight: 600;
}
.detail__vip-link--member {
color: #00a854;
}
/* 档案与编号 */
.detail__archive {