feat: 完成二级分类真实实拍图替换与功能优化
本次提交内容包括: 1. 替换13个二级分类为真实商业实拍图,同步更新本地与线上数据库 2. 新增会员拨打额度耗尽引导开通会员功能 3. 优化发布页分类选择逻辑,增加会员权益展示 4. 修复分类名称显示问题,完善相关交互逻辑 5. 新增图片同步工具脚本,确保线上线下数据一致性
这个提交包含在:
@@ -13,19 +13,29 @@
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('phone-orange')" mode="aspectFit" />
|
||||
<text class="call-modal__phone">{{ contactLabel }}</text>
|
||||
</view>
|
||||
<text class="call-modal__quota">
|
||||
<text class="call-modal__quota" :class="{ 'call-modal__quota--warn': isQuotaEmpty }">
|
||||
{{ quotaText }}
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<!-- 额度耗尽引导开通会员 -->
|
||||
<view v-if="isQuotaEmpty" class="call-modal__vip-box" @click="goMember">
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<view class="call-modal__vip-info">
|
||||
<text class="call-modal__vip-title">开通同城 VIP 会员</text>
|
||||
<text class="call-modal__vip-desc">每日无限次拨打 · 免费浏览 · 极速发布</text>
|
||||
</view>
|
||||
<text class="call-modal__vip-arrow">去开通 ›</text>
|
||||
</view>
|
||||
|
||||
<!-- 风险提示 -->
|
||||
<view class="call-modal__warn">
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('info')" mode="aspectFit" />
|
||||
<text class="call-modal__warn-text">请自行鉴别农产品信息真伪,在未核实清楚前不要提前给对方转账,慎防诈骗!</text>
|
||||
</view>
|
||||
|
||||
<!-- 免责声明勾选 -->
|
||||
<view class="call-modal__agree" @click="agree = !agree">
|
||||
<!-- 免责声明勾选(额度耗尽无需勾选) -->
|
||||
<view v-if="!isQuotaEmpty" class="call-modal__agree" @click="agree = !agree">
|
||||
<view class="call-modal__checkbox" :class="{ 'call-modal__checkbox--on': agree }">
|
||||
<text v-if="agree" class="call-modal__checkbox-tick">✓</text>
|
||||
</view>
|
||||
@@ -33,14 +43,17 @@
|
||||
<text class="call-modal__agree-link" @click.stop="goDisclaimer">《平台免责声明》</text>
|
||||
</view>
|
||||
|
||||
<!-- 主拨打按钮 -->
|
||||
<!-- 主操作按钮:有额度显示立即拨打,耗尽显示开通会员 -->
|
||||
<view
|
||||
class="call-modal__btn"
|
||||
:class="{ 'call-modal__btn--disabled': loading }"
|
||||
:class="{
|
||||
'call-modal__btn--disabled': loading && !isQuotaEmpty,
|
||||
'call-modal__btn--vip': isQuotaEmpty
|
||||
}"
|
||||
@click="handleDial"
|
||||
>
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('phone')" mode="aspectFit" />
|
||||
<text>{{ loading ? '连接中…' : '立即拨打' }}</text>
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl(isQuotaEmpty ? 'crown' : 'phone')" mode="aspectFit" />
|
||||
<text>{{ isQuotaEmpty ? '开通会员立即拨打' : (loading ? '连接中…' : '立即拨打') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -83,12 +96,25 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
/**
|
||||
* 联系对象名称脱敏或提示
|
||||
*/
|
||||
contactLabel() {
|
||||
return this.contactName ? `联系 ${this.contactName}` : '确认后直接拨打'
|
||||
},
|
||||
/**
|
||||
* 额度是否已用尽
|
||||
*/
|
||||
isQuotaEmpty() {
|
||||
return !this.unlimited && Number(this.quotaTotal) > 0 && Number(this.quotaLeft) <= 0
|
||||
},
|
||||
/**
|
||||
* 额度展示文案
|
||||
*/
|
||||
quotaText() {
|
||||
if (this.unlimited || this.quotaTotal === 0) return '会员尊享 · 不限拨打次数'
|
||||
const left = Math.max(0, Number(this.quotaLeft) || 0)
|
||||
if (left <= 0) return '今日拨打额度已用完(0 次)'
|
||||
return `今日剩余 ${left} 次拨打机会`
|
||||
},
|
||||
},
|
||||
@@ -101,9 +127,13 @@ export default {
|
||||
this.$emit('close')
|
||||
},
|
||||
/**
|
||||
* 点击拨打:先校验免责声明勾选,再交由父级执行拨打接口
|
||||
* 点击拨打或引导开通会员
|
||||
*/
|
||||
handleDial() {
|
||||
if (this.isQuotaEmpty) {
|
||||
this.goMember()
|
||||
return
|
||||
}
|
||||
if (this.loading) return
|
||||
if (!this.agree) {
|
||||
uni.showToast({ title: '请先勾选同意平台免责声明', icon: 'none' })
|
||||
@@ -111,6 +141,13 @@ export default {
|
||||
}
|
||||
this.$emit('confirm')
|
||||
},
|
||||
/**
|
||||
* 跳转会员中心开通特权
|
||||
*/
|
||||
goMember() {
|
||||
this.handleClose()
|
||||
uni.navigateTo({ url: '/pages/member/index' })
|
||||
},
|
||||
/**
|
||||
* 查看平台免责声明详情
|
||||
*/
|
||||
@@ -185,6 +222,44 @@ export default {
|
||||
margin-top: 12rpx;
|
||||
font-size: 22rpx;
|
||||
color: #64748b;
|
||||
|
||||
&--warn {
|
||||
color: #e65100;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.call-modal__vip-box {
|
||||
margin-top: 20rpx;
|
||||
padding: 18rpx 20rpx;
|
||||
border-radius: 18rpx;
|
||||
background: linear-gradient(135deg, #f0fdf4, #fff8e8);
|
||||
border: 1rpx solid #ffe3a6;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
.call-modal__vip-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.call-modal__vip-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #8a5a00;
|
||||
}
|
||||
.call-modal__vip-desc {
|
||||
margin-top: 4rpx;
|
||||
font-size: 20rpx;
|
||||
color: #b45309;
|
||||
}
|
||||
.call-modal__vip-arrow {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #f5a623;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.call-modal__warn {
|
||||
@@ -266,5 +341,11 @@ export default {
|
||||
&--disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&--vip {
|
||||
background: linear-gradient(135deg, #00e070, #00d26a 45%, #f5a623);
|
||||
color: #04301e;
|
||||
box-shadow: 0 8rpx 24rpx rgba(245, 166, 35, 0.35);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<view class="cat-subgrid__thumb">
|
||||
<image class="cat-subgrid__img" :src="catIcon(currentCategory)" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="cat-subgrid__name">全部{{ currentCategory ? currentCategory.name : '' }}</text>
|
||||
<text class="cat-subgrid__name">全部</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="sub in currentSubCategories"
|
||||
|
||||
@@ -270,6 +270,44 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 同城 VIP 会员特权引导卡片(非会员引导开通,会员展示专属特权) -->
|
||||
<view v-if="!isMember" class="fc-card detail__vip-card" @click="goMember">
|
||||
<view class="detail__vip-card-left">
|
||||
<view class="detail__vip-card-badge">
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="detail__vip-card-info">
|
||||
<view class="detail__vip-card-title-row">
|
||||
<text class="detail__vip-card-title">开通同城 VIP 会员</text>
|
||||
<text class="detail__vip-card-pill">尊享特权</text>
|
||||
</view>
|
||||
<text class="detail__vip-card-desc">每日免费浏览 · 无限拨打电话 · 专属尊贵标识</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail__vip-card-btn">
|
||||
<text class="detail__vip-card-btn-txt">立即开通</text>
|
||||
<text class="detail__vip-card-btn-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="fc-card detail__vip-card detail__vip-card--active" @click="goMember">
|
||||
<view class="detail__vip-card-left">
|
||||
<view class="detail__vip-card-badge detail__vip-card-badge--active">
|
||||
<image class="fc-icon fc-icon--sm" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="detail__vip-card-info">
|
||||
<view class="detail__vip-card-title-row">
|
||||
<text class="detail__vip-card-title">VIP 尊享特权生效中</text>
|
||||
<text class="detail__vip-card-pill detail__vip-card-pill--active">VIP 会员</text>
|
||||
</view>
|
||||
<text class="detail__vip-card-desc">您已享今日免费浏览与不限拨打电话特权</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail__vip-card-btn detail__vip-card-btn--active">
|
||||
<text class="detail__vip-card-btn-txt">会员中心</text>
|
||||
<text class="detail__vip-card-btn-arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 联系方式卡已移除:号码不展示,直接通过底部「拨打电话」按钮联系 -->
|
||||
|
||||
<!-- 基础档案信息(信息编号与安全提示) -->
|
||||
@@ -317,23 +355,37 @@
|
||||
<view class="detail__bar-space"></view>
|
||||
|
||||
<!-- 底部吸底操作栏 -->
|
||||
<view class="detail__bar">
|
||||
<view class="detail__bar-item" @click="toggleFav">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl(faved ? 'bar-fav-on' : 'bar-fav')" mode="aspectFit" />
|
||||
<text class="detail__bar-text" :class="{ 'detail__bar-text--active': faved }">{{ faved ? '已收藏' : '收藏' }}</text>
|
||||
<view class="detail__bar-wrapper">
|
||||
<!-- 拨打额度用尽吸底提示浮条 -->
|
||||
<view v-if="isCallQuotaOut" class="detail__bar-quota-tip" @click="goMember">
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<text class="detail__bar-quota-txt">今日拨打次数已用完,开通 VIP 尊享不限次拨打</text>
|
||||
<text class="detail__bar-quota-go">去开通 ›</text>
|
||||
</view>
|
||||
<!-- 微信原生转发好友按钮 -->
|
||||
<button class="detail__bar-item detail__bar-item--btn" open-type="share">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('bar-share')" mode="aspectFit" />
|
||||
<text class="detail__bar-text">分享</text>
|
||||
</button>
|
||||
<!-- 生成海报按钮 -->
|
||||
<view class="detail__bar-item" @click="openPosterModal">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('bar-poster')" mode="aspectFit" />
|
||||
<text class="detail__bar-text">海报</text>
|
||||
</view>
|
||||
<view class="detail__bar-main" @click="onMainAction">
|
||||
<text>{{ bottomBarText }}</text>
|
||||
|
||||
<view class="detail__bar">
|
||||
<view class="detail__bar-item" @click="toggleFav">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl(faved ? 'bar-fav-on' : 'bar-fav')" mode="aspectFit" />
|
||||
<text class="detail__bar-text" :class="{ 'detail__bar-text--active': faved }">{{ faved ? '已收藏' : '收藏' }}</text>
|
||||
</view>
|
||||
<!-- 微信原生转发好友按钮 -->
|
||||
<button class="detail__bar-item detail__bar-item--btn" open-type="share">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('bar-share')" mode="aspectFit" />
|
||||
<text class="detail__bar-text">分享</text>
|
||||
</button>
|
||||
<!-- 生成海报按钮 -->
|
||||
<view class="detail__bar-item" @click="openPosterModal">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('bar-poster')" mode="aspectFit" />
|
||||
<text class="detail__bar-text">海报</text>
|
||||
</view>
|
||||
<view
|
||||
class="detail__bar-main"
|
||||
:class="{ 'detail__bar-main--vip': isCallQuotaOut }"
|
||||
@click="onMainAction"
|
||||
>
|
||||
<image v-if="isCallQuotaOut" class="fc-icon fc-icon--xs detail__bar-vip-icon" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<text>{{ bottomBarText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -563,12 +615,23 @@ export default {
|
||||
callQuotaUnlimited() {
|
||||
return Number(this.callQuotaTotal) === 0
|
||||
},
|
||||
/**
|
||||
* 今日拨打额度是否已用完(非不限次数且总额度>0,剩余额度<=0)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isCallQuotaOut() {
|
||||
if (this.callQuotaUnlimited) return false
|
||||
return Number(this.callQuotaTotal) > 0 && Number(this.callQuotaLeft) <= 0
|
||||
},
|
||||
/**
|
||||
* 底部主操作栏文案
|
||||
* @returns {string}
|
||||
*/
|
||||
bottomBarText() {
|
||||
if (this.loading && !this.loaded) return '加载中…'
|
||||
if (this.isCallQuotaOut) {
|
||||
return '开通会员立即拨打'
|
||||
}
|
||||
return '拨打电话'
|
||||
},
|
||||
timeText() {
|
||||
@@ -828,10 +891,31 @@ export default {
|
||||
} catch (e) {}
|
||||
},
|
||||
/**
|
||||
* 底部主按钮响应:打开免责声明拨打弹窗
|
||||
* 底部主按钮响应:拨打电话或引导开通会员
|
||||
*/
|
||||
onMainAction() {
|
||||
if (this.loading && !this.loaded) return
|
||||
if (!this.hasPhone) {
|
||||
uni.showToast({ title: '发布者未预留联系电话', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!this.ensureLogin()) return
|
||||
// 当额度用尽时直接引导开通会员,杜绝无效点击
|
||||
if (this.isCallQuotaOut) {
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
content: this.isMember
|
||||
? '您今日的 VIP 拨打次数已达上限,明日将自动恢复,或可升级更高规格会员套餐'
|
||||
: '您今日的免费拨打次数已用完,开通 VIP 会员尊享无限次拨打与每日免费浏览特权',
|
||||
confirmText: '去开通会员',
|
||||
cancelText: '知道了',
|
||||
confirmColor: '#00E070',
|
||||
success: (r) => {
|
||||
if (r.confirm) uni.navigateTo({ url: '/pages/member/index' })
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
this.openCallModal()
|
||||
},
|
||||
/**
|
||||
@@ -936,8 +1020,9 @@ export default {
|
||||
}
|
||||
} catch (e) {
|
||||
const msg = (e && e.message) || '拨打失败,请稍后重试'
|
||||
// 当日拨打次数超限(后端 403):引导开通 VIP 会员提升每日拨打次数
|
||||
if (/上限/.test(msg)) {
|
||||
// 当日拨打次数超限(后端 403):同步本地额度并引导开通 VIP 会员提升每日拨打次数
|
||||
if (/上限|额度|次数/.test(msg)) {
|
||||
this.callQuotaLeft = 0
|
||||
this.showCallModal = false
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
@@ -2497,12 +2582,35 @@ export default {
|
||||
.detail__bar-space {
|
||||
height: calc(150rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.detail__bar {
|
||||
.detail__bar-wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
.detail__bar-quota-tip {
|
||||
background: linear-gradient(90deg, #fffbeb, #fef3c7);
|
||||
border-top: 1rpx solid #fde68a;
|
||||
padding: 12rpx 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.detail__bar-quota-txt {
|
||||
flex: 1;
|
||||
font-size: 22rpx;
|
||||
color: #92400e;
|
||||
font-weight: 500;
|
||||
}
|
||||
.detail__bar-quota-go {
|
||||
font-size: 22rpx;
|
||||
color: #d97706;
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.detail__bar {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14rpx 24rpx calc(14rpx + env(safe-area-inset-bottom));
|
||||
@@ -2550,7 +2658,123 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10rpx;
|
||||
box-shadow: 0 6rpx 20rpx rgba(0, 224, 112, 0.35);
|
||||
|
||||
&--vip {
|
||||
background: linear-gradient(135deg, #00e070, #00d26a 45%, #f5a623) !important;
|
||||
color: #04301e !important;
|
||||
box-shadow: 0 8rpx 24rpx rgba(245, 166, 35, 0.32) !important;
|
||||
}
|
||||
}
|
||||
.detail__bar-vip-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
/* 详情预览页:同城 VIP 会员特权卡片 */
|
||||
.detail__vip-card {
|
||||
margin: 20rpx 24rpx 0;
|
||||
padding: 24rpx 26rpx;
|
||||
background: linear-gradient(135deg, #f0fdf4, #ffffff 60%, #fffbf0);
|
||||
border: 2rpx solid #d4f3e3;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 168, 84, 0.05);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
&--active {
|
||||
background: linear-gradient(135deg, #f7fee7, #ffffff 60%, #ecfdf5);
|
||||
border-color: #bef264;
|
||||
}
|
||||
}
|
||||
.detail__vip-card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
.detail__vip-card-badge {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 18rpx;
|
||||
background: linear-gradient(135deg, #fef3c7, #fffbeb);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2rpx 8rpx rgba(245, 166, 35, 0.15);
|
||||
|
||||
&--active {
|
||||
background: linear-gradient(135deg, #dcfce7, #f0fdf4);
|
||||
}
|
||||
}
|
||||
.detail__vip-card-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.detail__vip-card-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
}
|
||||
.detail__vip-card-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
}
|
||||
.detail__vip-card-pill {
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 999rpx;
|
||||
background: linear-gradient(135deg, #f5a623, #d97706);
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&--active {
|
||||
background: linear-gradient(135deg, #00e070, #00d26a);
|
||||
}
|
||||
}
|
||||
.detail__vip-card-desc {
|
||||
margin-top: 6rpx;
|
||||
font-size: 22rpx;
|
||||
color: #64748b;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.detail__vip-card-btn {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
padding: 10rpx 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
border: 1rpx solid #00a854;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 168, 84, 0.08);
|
||||
|
||||
&--active {
|
||||
border-color: #00d26a;
|
||||
}
|
||||
}
|
||||
.detail__vip-card-btn-txt {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #00a854;
|
||||
}
|
||||
.detail__vip-card-btn-arrow {
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
color: #00a854;
|
||||
}
|
||||
.detail__vip-card:active {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
/* 通用弹层遮罩(评价 / 回复 / 海报等底部弹层共用) */
|
||||
|
||||
@@ -152,9 +152,13 @@
|
||||
<text>地图导航</text>
|
||||
</view>
|
||||
|
||||
<view class="shop-detail__btn-call" @click="openCallModal">
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl('phone')" mode="aspectFit" />
|
||||
<text>联系店长</text>
|
||||
<view
|
||||
class="shop-detail__btn-call"
|
||||
:class="{ 'shop-detail__btn-call--vip': isCallQuotaOut }"
|
||||
@click="openCallModal"
|
||||
>
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl(isCallQuotaOut ? 'crown' : 'phone')" mode="aspectFit" />
|
||||
<text>{{ isCallQuotaOut ? '开通会员拨打' : '联系店长' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fc-safe-bottom"></view>
|
||||
@@ -252,6 +256,14 @@ export default {
|
||||
callQuotaUnlimited() {
|
||||
return Number(this.callQuotaTotal) === 0
|
||||
},
|
||||
/**
|
||||
* 今日拨打额度是否已用完
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isCallQuotaOut() {
|
||||
if (this.callQuotaUnlimited) return false
|
||||
return Number(this.callQuotaTotal) > 0 && Number(this.callQuotaLeft) <= 0
|
||||
},
|
||||
/**
|
||||
* 免责弹窗拨打展示文案(联系人姓氏 + 脱敏手机号)
|
||||
* @returns {string}
|
||||
@@ -477,6 +489,22 @@ export default {
|
||||
return
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
// 拨打次数已用完直接引导开通会员
|
||||
if (this.isCallQuotaOut) {
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
content: '您今日的免费拨打次数已用完,开通 VIP 会员尊享每日更多拨打特权',
|
||||
confirmText: '去开通会员',
|
||||
cancelText: '知道了',
|
||||
confirmColor: '#00E070',
|
||||
success: (r) => {
|
||||
if (r.confirm) uni.navigateTo({ url: '/pages/member/index' })
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.showCallModal = true
|
||||
},
|
||||
/**
|
||||
@@ -499,7 +527,8 @@ export default {
|
||||
} catch (e) {
|
||||
const msg = (e && e.message) || '拨打失败,请稍后重试'
|
||||
// 当日拨打次数超限(后端 403):引导开通 VIP 会员提升每日拨打次数
|
||||
if (/上限/.test(msg)) {
|
||||
if (/上限|额度|次数/.test(msg)) {
|
||||
this.callQuotaLeft = 0
|
||||
this.showCallModal = false
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
@@ -883,5 +912,11 @@ export default {
|
||||
transform: scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
&--vip {
|
||||
background: linear-gradient(135deg, #00e070, #00d26a 45%, #f5a623) !important;
|
||||
color: #04301e !important;
|
||||
box-shadow: 0 8rpx 24rpx rgba(245, 166, 35, 0.32) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,16 +3,6 @@
|
||||
<!-- 统一顶部深绿质感导航栏 -->
|
||||
<fc-navbar title="发布信息" theme="gradient" :show-back="true" />
|
||||
|
||||
<!-- 非会员开通引导(会员不显示任何引导) -->
|
||||
<view v-if="!isMember" class="create__member-banner" @click="goMember">
|
||||
<image class="create__member-icon" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<view class="create__member-info">
|
||||
<text class="create__member-title">开通会员</text>
|
||||
<text class="create__member-desc">每日免费发布、免费浏览、更多拨打次数</text>
|
||||
</view>
|
||||
<text class="create__member-go">去开通 ›</text>
|
||||
</view>
|
||||
|
||||
<!-- 1. 分类选择(一级大类与二级品类拆分为两行独立输入) -->
|
||||
<view class="fc-card create__section">
|
||||
<view class="create__cell" @click="openCatStep(1)">
|
||||
@@ -33,12 +23,12 @@
|
||||
<view class="create__cell create__cell--sub" :class="{ 'create__cell--disabled': !currentCat }" @click="openCatStep(2)">
|
||||
<view class="create__cell-left">
|
||||
<text class="create__label">产品品类</text>
|
||||
<text class="create__required">*</text>
|
||||
<text v-if="hasSubCategories" class="create__required">*</text>
|
||||
</view>
|
||||
<view class="create__cell-right">
|
||||
<view v-if="currentSubCat" class="create__selected-cat">
|
||||
<image class="create__selected-cat-icon" :src="catIcon(currentSubCat)" mode="aspectFit" />
|
||||
<text class="create__selected-cat-name">{{ currentSubCat.name }}</text>
|
||||
<view v-if="selectedSubCatDisplay" class="create__selected-cat">
|
||||
<image class="create__selected-cat-icon" :src="selectedSubCatDisplay.icon" mode="aspectFit" />
|
||||
<text class="create__selected-cat-name">{{ selectedSubCatDisplay.name }}</text>
|
||||
</view>
|
||||
<text v-else class="create__cell-ph">{{ currentCat ? '请选择品类' : '请先选择大类' }}</text>
|
||||
<text class="create__arrow">›</text>
|
||||
@@ -313,6 +303,23 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 7. 发布权益与会员特权(置于表单底部发布前,避免干扰顶部核心填写) -->
|
||||
<view class="create__member-banner" :class="{ 'create__member-banner--vip': isMember }" @click="goMember">
|
||||
<image class="create__member-icon" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<view class="create__member-info">
|
||||
<view class="create__member-title-row">
|
||||
<text class="create__member-title">{{ isMember ? 'VIP 会员发帖特权生效中' : '开通同城 VIP 会员' }}</text>
|
||||
<text v-if="isMember" class="create__member-tag">已开通</text>
|
||||
</view>
|
||||
<text class="create__member-desc">
|
||||
{{ isMember ? '尊享每日海量免费发布、专属身份认证与极速展示' : '尊享每日免费发布、信息置顶折扣、更多拨打次数' }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="create__member-btn-box">
|
||||
<text class="create__member-go">{{ isMember ? '权益中心 ›' : '去开通 ›' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部固定主控操作栏 -->
|
||||
<view class="create__bar">
|
||||
<view class="create__bar-draft" @click="saveDraftManual">
|
||||
@@ -446,7 +453,7 @@
|
||||
<image class="cat-drawer__cover" :src="catIcon(currentCat || {})" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="cat-drawer__caption">
|
||||
<text class="cat-drawer__name">全部{{ currentCat ? currentCat.name : '' }}</text>
|
||||
<text class="cat-drawer__name">全部</text>
|
||||
</view>
|
||||
<view class="cat-drawer__check">✓</view>
|
||||
</view>
|
||||
@@ -520,6 +527,7 @@ export default {
|
||||
catDrawerAnim: false,
|
||||
// 分类两步选择:1 = 选一级大类,2 = 选二级品类
|
||||
catDrawerStep: 1,
|
||||
selectedAllSubCat: false, // 是否显式选中全部二级品类
|
||||
customTagInput: '',
|
||||
outputRangeOptions: [
|
||||
'1000斤以下',
|
||||
@@ -661,6 +669,35 @@ export default {
|
||||
const children = (this.currentCat && this.currentCat.children) || []
|
||||
return children.find((s) => Number(s.id) === Number(this.form.subCategoryId)) || null
|
||||
},
|
||||
/**
|
||||
* 当前一级大类是否包含二级子品类
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasSubCategories() {
|
||||
return !!(this.currentCat && Array.isArray(this.currentCat.children) && this.currentCat.children.length > 0)
|
||||
},
|
||||
/**
|
||||
* 页面回显的产品品类信息(支持具体二级分类对象或全部)
|
||||
* @returns {{ name: string, icon: string } | null}
|
||||
*/
|
||||
selectedSubCatDisplay() {
|
||||
if (!this.currentCat) return null
|
||||
// 1. 若选了具体二级分类
|
||||
if (this.currentSubCat) {
|
||||
return {
|
||||
name: this.currentSubCat.name,
|
||||
icon: this.catIcon(this.currentSubCat),
|
||||
}
|
||||
}
|
||||
// 2. 若该一级大类本身没有二级分类,或者显式选择了全部
|
||||
if (!this.hasSubCategories || this.selectedAllSubCat) {
|
||||
return {
|
||||
name: '全部',
|
||||
icon: this.catIcon(this.currentCat),
|
||||
}
|
||||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* 当前选中分类是否为农产品类(kind=farm):
|
||||
* 决定「种植面积/采摘时间/预计量产」的显隐与必填校验;历史数据无 kind 时按农产品处理
|
||||
@@ -1153,26 +1190,35 @@ export default {
|
||||
}, 200)
|
||||
},
|
||||
/**
|
||||
* 选择一级大类(蔬菜 / 水果),选中即回填并关闭
|
||||
* 选择一级大类(蔬菜 / 水果等),选中即回填并关闭
|
||||
* @param {Object} c 一级大类对象
|
||||
*/
|
||||
onSelectDrawerParentCat(c) {
|
||||
if (!c) return
|
||||
this.form.categoryId = Number(c.id)
|
||||
this.form.subCategoryId = 0
|
||||
const children = (c.children && Array.isArray(c.children)) ? c.children : []
|
||||
if (!children.length) {
|
||||
// 若该一级分类下无二级子品类,自动归为全部
|
||||
this.form.subCategoryId = 0
|
||||
this.selectedAllSubCat = true
|
||||
} else {
|
||||
this.form.subCategoryId = 0
|
||||
this.selectedAllSubCat = false
|
||||
}
|
||||
this.triggerAutoSave()
|
||||
this.closeCatDrawer()
|
||||
},
|
||||
/**
|
||||
* 第二步:仅按一级大类发布(不选具体二级品类)
|
||||
* 第二步:仅按一级大类发布(选择全部)
|
||||
*/
|
||||
onSelectDrawerParentOnly() {
|
||||
this.form.subCategoryId = 0
|
||||
this.selectedAllSubCat = true
|
||||
this.triggerAutoSave()
|
||||
this.closeCatDrawer()
|
||||
},
|
||||
/**
|
||||
* 第二步:选中二级分类(如:花菜、白菜、紫甘蓝、青甘蓝、青菜等)并完成选择
|
||||
* 第二步:选中二级分类并完成选择
|
||||
* @param {Object} sub 二级分类对象
|
||||
*/
|
||||
onSelectDrawerSubCat(sub) {
|
||||
@@ -1181,6 +1227,7 @@ export default {
|
||||
this.form.categoryId = Number(sub.pid)
|
||||
}
|
||||
this.form.subCategoryId = Number(sub.id)
|
||||
this.selectedAllSubCat = false
|
||||
this.triggerAutoSave()
|
||||
this.closeCatDrawer()
|
||||
},
|
||||
@@ -1415,8 +1462,8 @@ export default {
|
||||
* @returns {string} 错误信息,为空则验证通过
|
||||
*/
|
||||
validate() {
|
||||
if (!this.form.categoryId) return '请选择所属分类'
|
||||
if (!this.form.subCategoryId && this.drawerSubCategories.length) return '请选择二级品类'
|
||||
if (!this.form.categoryId) return '请选择所属大类'
|
||||
if (this.hasSubCategories && !this.form.subCategoryId) return '请选择产品品类'
|
||||
if (!this.form.title || !this.form.title.trim()) return '请填写标题'
|
||||
if (!this.form.content || !this.form.content.trim()) return '请填写详细内容'
|
||||
// 校验顺序与表单视觉顺序一致(价格 → 产地规格 → 区域 → 手机号),报错时用户可自上而下定位
|
||||
@@ -1562,15 +1609,21 @@ export default {
|
||||
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
/* 非会员开通引导条(仅未开通会员可见) */
|
||||
/* 会员开通/权益引导条(置于表单底部,自然顺畅) */
|
||||
.create__member-banner {
|
||||
margin: 20rpx 28rpx 0;
|
||||
padding: 22rpx 26rpx;
|
||||
margin: 24rpx 28rpx 0;
|
||||
padding: 24rpx 26rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #fff8e8, #fffdf5);
|
||||
border: 1rpx solid #ffe3a6;
|
||||
border-radius: 22rpx;
|
||||
background: linear-gradient(135deg, #f0fdf4, #ffffff 60%, #fffbf0);
|
||||
border: 2rpx solid #d4f3e3;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 168, 84, 0.05);
|
||||
|
||||
&--vip {
|
||||
background: linear-gradient(135deg, #f7fee7, #ffffff 60%, #ecfdf5);
|
||||
border-color: #bef264;
|
||||
}
|
||||
}
|
||||
.create__member-icon {
|
||||
width: 56rpx;
|
||||
@@ -1584,28 +1637,48 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.create__member-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.create__member-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #8a5a00;
|
||||
color: #1e293b;
|
||||
}
|
||||
.create__member-tag {
|
||||
margin-left: 12rpx;
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 999rpx;
|
||||
background: linear-gradient(135deg, #00e070, #00d26a);
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.create__member-desc {
|
||||
margin-top: 4rpx;
|
||||
margin-top: 6rpx;
|
||||
font-size: 22rpx;
|
||||
color: #b08a3e;
|
||||
color: #64748b;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.create__member-go {
|
||||
.create__member-btn-box {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
border: 1rpx solid #00a854;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 168, 84, 0.08);
|
||||
}
|
||||
.create__member-go {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #f5a623;
|
||||
color: #00a854;
|
||||
}
|
||||
.create__member-banner:active {
|
||||
opacity: 0.85;
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
/* 表单卡片区域 */
|
||||
|
||||
二进制
uniapp/static/categories/cat-job.png
普通文件
二进制
uniapp/static/categories/cat-job.png
普通文件
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 5.0 KiB |
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 6.5 KiB |
二进制
uniapp/static/icons/cat-poultry.png
普通文件
二进制
uniapp/static/icons/cat-poultry.png
普通文件
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 6.5 KiB |
在新工单中引用
屏蔽一个用户