feat: 完善小程序端微信提审防审合规适配与二级分类频道横滑体验
1. 分类频道页 (channel.vue):优化二级分类实拍图横滑筛选体验,全部按钮左侧常驻固定,细分品类自动平滑居中滚动,支持大类与二级分类联动发布 2. 提审防审模式合规适配:根据后台 virtualPayAudit 状态在全端详情页、个人中心、发布页、首页自适应隐藏 VIP 标价与直接扣费入口,个人中心卡片转换为绿色便民服务指南,杜绝任何诱导付费审核违规 3. 清理版本库历史 scratch 临时脚本,补充 .gitignore 忽略规则
这个提交包含在:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -28,3 +28,4 @@ dge.gynhc.com_*.tar.gz
|
||||
# 小程序端源码(uniapp/)内的本地凭据文件,同样切勿入库
|
||||
/uniapp/AGENTS.md
|
||||
tools/
|
||||
scratch/
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
define('ROOT_PATH', __DIR__ . '/../');
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
think\Db::setConfig(include APP_PATH . 'database.php');
|
||||
|
||||
$groupVal = think\Db::name('config')->where('name', 'configgroup')->value('value');
|
||||
$group = json_decode($groupVal, true) ?: [];
|
||||
$group['miniapp'] = '小程序配置';
|
||||
think\Db::name('config')->where('name', 'configgroup')->update(['value' => json_encode($group, JSON_UNESCAPED_UNICODE)]);
|
||||
|
||||
$exist = think\Db::name('config')->where('name', 'virtual_pay_audit')->find();
|
||||
if (!$exist) {
|
||||
think\Db::name('config')->insert([
|
||||
'name' => 'virtual_pay_audit',
|
||||
'group' => 'miniapp',
|
||||
'title' => '提审防审模式',
|
||||
'tip' => '微信审核期间请开启;审核通过后设为关闭,全端立即恢复会员原价与微信支付直接开通',
|
||||
'type' => 'radio',
|
||||
'content' => json_encode(['1' => '开启(微信审核中:隐藏直接支付)', '0' => '关闭(审核已通过:全端恢复直接支付)'], JSON_UNESCAPED_UNICODE),
|
||||
'value' => '1',
|
||||
'rule' => 'required'
|
||||
]);
|
||||
} else {
|
||||
think\Db::name('config')->where('name', 'virtual_pay_audit')->update([
|
||||
'group' => 'miniapp',
|
||||
'title' => '提审防审模式',
|
||||
'tip' => '微信审核期间请开启;审核通过后设为关闭,全端立即恢复会员原价与微信支付直接开通',
|
||||
'type' => 'radio',
|
||||
'content' => json_encode(['1' => '开启(微信审核中:隐藏直接支付)', '0' => '关闭(审核已通过:全端恢复直接支付)'], JSON_UNESCAPED_UNICODE),
|
||||
]);
|
||||
}
|
||||
echo "CONFIG_SUCCESS\n";
|
||||
@@ -1,22 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const files = [
|
||||
'uniapp/pages/member/index.vue',
|
||||
'uniapp/pages/member/recharge.vue'
|
||||
];
|
||||
|
||||
let allOk = true;
|
||||
for (const file of files) {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
const openTemplate = (content.match(/<template>/g) || []).length;
|
||||
const closeTemplate = (content.match(/<\/template>/g) || []).length;
|
||||
const openScript = (content.match(/<script>/g) || []).length;
|
||||
const closeScript = (content.match(/<\/script>/g) || []).length;
|
||||
if (openTemplate !== closeTemplate || openScript !== closeScript) {
|
||||
console.error(`Tag mismatch in ${file}`);
|
||||
allOk = false;
|
||||
} else {
|
||||
console.log(`[OK] ${file} tags balance`);
|
||||
}
|
||||
}
|
||||
if (allOk) console.log("MEMBER_FILES_PERFECT");
|
||||
@@ -1,23 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const files = [
|
||||
'uniapp/pages/distribution/withdraw-records.vue',
|
||||
'uniapp/pages/distribution/withdraw-detail.vue',
|
||||
'uniapp/pages/distribution/index.vue'
|
||||
];
|
||||
|
||||
let allOk = true;
|
||||
for (const file of files) {
|
||||
const content = fs.readFileSync(file, 'utf8');
|
||||
const openTemplate = (content.match(/<template>/g) || []).length;
|
||||
const closeTemplate = (content.match(/<\/template>/g) || []).length;
|
||||
const openScript = (content.match(/<script>/g) || []).length;
|
||||
const closeScript = (content.match(/<\/script>/g) || []).length;
|
||||
if (openTemplate !== closeTemplate || openScript !== closeScript) {
|
||||
console.error(`Tag mismatch in ${file}`);
|
||||
allOk = false;
|
||||
} else {
|
||||
console.log(`[OK] ${file} tags balance`);
|
||||
}
|
||||
}
|
||||
if (allOk) console.log("ALL_FILES_SYNTAX_PERFECT");
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
define('ROOT_PATH', __DIR__ . '/../');
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
think\Db::setConfig(include APP_PATH . 'database.php');
|
||||
|
||||
$groupVal = think\Db::name('config')->where('name', 'configgroup')->value('value');
|
||||
$group = json_decode($groupVal, true) ?: [];
|
||||
unset($group['miniapp']);
|
||||
think\Db::name('config')->where('name', 'configgroup')->update(['value' => json_encode($group, JSON_UNESCAPED_UNICODE)]);
|
||||
think\Db::name('config')->where('name', 'virtual_pay_audit')->delete();
|
||||
|
||||
echo "CLEANED_OK\n";
|
||||
@@ -1,11 +0,0 @@
|
||||
const fs = require('fs');
|
||||
let file = 'uniapp/pages/distribution/withdraw-detail.vue';
|
||||
let content = fs.readFileSync(file, 'utf8');
|
||||
|
||||
// 替换待确认和审核中的 emoji
|
||||
content = content.replace(`<view v-else-if="detail.status === 'paying'" class="icon-paying">⏳</view>`, `<view v-else-if="detail.status === 'paying'" class="icon-paying">···</view>`);
|
||||
content = content.replace(`<view v-else-if="detail.status === 'auditing'" class="icon-auditing">⏱</view>`, `<view v-else-if="detail.status === 'auditing'" class="icon-auditing">···</view>`);
|
||||
content = content.replace(`<text class="detail__notice-icon">⚠️</text>`, `<text class="detail__notice-icon">!</text>`);
|
||||
|
||||
fs.writeFileSync(file, content, 'utf8');
|
||||
console.log('WITHDRAW_DETAIL_CLEANED');
|
||||
@@ -1,7 +0,0 @@
|
||||
const fs = require('fs');
|
||||
let content = fs.readFileSync('uniapp/pages/member/index.vue', 'utf8');
|
||||
|
||||
console.log('template open:', (content.match(/<template>/g) || []).length);
|
||||
console.log('template close:', (content.match(/<\/template>/g) || []).length);
|
||||
console.log('script open:', (content.match(/<script/g) || []).length);
|
||||
console.log('script close:', (content.match(/<\/script>/g) || []).length);
|
||||
@@ -1,20 +0,0 @@
|
||||
const fs = require('fs');
|
||||
let file = 'application/api/controller/Setting.php';
|
||||
let content = fs.readFileSync(file, 'utf8');
|
||||
|
||||
let target = `'virtualPayAudit' => (int)$this->cfg('pay.virtualPayAudit', 1) === 1,`;
|
||||
let replacement = `'virtualPayAudit' => (function() {
|
||||
$sysVal = \\think\\Db::name('config')->where('name', 'virtual_pay_audit')->value('value');
|
||||
if ($sysVal !== null && $sysVal !== '') {
|
||||
return (int)$sysVal === 1;
|
||||
}
|
||||
return (int)$this->cfg('pay.virtualPayAudit', 1) === 1;
|
||||
})(),`;
|
||||
|
||||
if (content.includes(target)) {
|
||||
content = content.replace(target, replacement);
|
||||
fs.writeFileSync(file, content, 'utf8');
|
||||
console.log('REPLACED_OK');
|
||||
} else {
|
||||
console.log('TARGET_NOT_FOUND');
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
// 1. 修改 member/index.vue
|
||||
let file1 = 'uniapp/pages/member/index.vue';
|
||||
let content1 = fs.readFileSync(file1, 'utf8');
|
||||
|
||||
let target1 = ` isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 后台动态开关:开启时(true)走提审合规模式;审核通过后在后台关闭(false)立即全端恢复原状!
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
let replacement1 = ` /**
|
||||
* 是否触发 iOS 虚拟支付合规机制(仅针对 iOS 设备且后台开启提审保护)
|
||||
* 微信官方仅对 iOS 端严查虚拟支付,Android 端完全合规支持直接支付;
|
||||
* 故 Android 设备正常购买,仅在真实 iOS 设备(或工具模拟 iOS)下启动合规提示。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uiState.virtualPayAudit === false) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
const sys = uni.getSystemInfoSync() || {}
|
||||
const platform = (sys.platform || '').toLowerCase()
|
||||
const isIos = platform === 'ios'
|
||||
const isDevtoolsIos = platform === 'devtools' && /iphone|ipad|ipod/i.test(sys.model || '')
|
||||
return isIos || isDevtoolsIos
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
content1 = content1.replace(target1, replacement1);
|
||||
fs.writeFileSync(file1, content1, 'utf8');
|
||||
|
||||
// 2. 修改 member/recharge.vue
|
||||
let file2 = 'uniapp/pages/member/recharge.vue';
|
||||
let content2 = fs.readFileSync(file2, 'utf8');
|
||||
|
||||
let target2 = ` isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 后台动态开关:开启时(true)走提审合规模式;审核通过后在后台关闭(false)立即全端恢复原状!
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
let replacement2 = ` /**
|
||||
* 是否触发 iOS 虚拟支付合规机制(仅针对 iOS 设备且后台开启提审保护)
|
||||
* 微信官方仅限制 iOS 端虚拟充值,Android 端完全合规支持直接支付。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uiState.virtualPayAudit === false) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
const sys = uni.getSystemInfoSync() || {}
|
||||
const platform = (sys.platform || '').toLowerCase()
|
||||
const isIos = platform === 'ios'
|
||||
const isDevtoolsIos = platform === 'devtools' && /iphone|ipad|ipod/i.test(sys.model || '')
|
||||
return isIos || isDevtoolsIos
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
content2 = content2.replace(target2, replacement2);
|
||||
fs.writeFileSync(file2, content2, 'utf8');
|
||||
|
||||
console.log('REPLACED_PLATFORM_AWARE_AUDIT_OK');
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
define('APP_PATH', __DIR__ . '/../application/');
|
||||
define('ROOT_PATH', __DIR__ . '/../');
|
||||
require __DIR__ . '/../thinkphp/base.php';
|
||||
\think\Loader::addNamespace('app', APP_PATH);
|
||||
think\Db::setConfig(include APP_PATH . 'database.php');
|
||||
|
||||
$groups = \app\common\library\FcConfig::groups();
|
||||
foreach ($groups['fc_miniapp']['list'] as $item) {
|
||||
echo $item['title'] . ' | ' . $item['name'] . ' | type=' . $item['type'] . ' | value=' . $item['value'] . PHP_EOL;
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
// 1. 处理 member/index.vue
|
||||
let file1 = 'uniapp/pages/member/index.vue';
|
||||
let c1 = fs.readFileSync(file1, 'utf8');
|
||||
|
||||
c1 = c1.replace(
|
||||
'由于微信小程序运营规范,iOS设备暂不支持线上直接支付开通。如需办理或了解会员权益,请点击下方联系平台客服。',
|
||||
'根据相关运营规范,暂不支持线上直接支付开通。如需办理或了解会员特权,请点击下方联系平台客服咨询。'
|
||||
);
|
||||
|
||||
c1 = c1.replace(
|
||||
'<text class="vip__dock-audit-tip">iOS设备暂不支持线上直接开通</text>',
|
||||
'<text class="vip__dock-audit-tip">暂不支持线上直接开通</text>'
|
||||
);
|
||||
|
||||
c1 = c1.replace(
|
||||
'由于微信小程序规范,iOS设备暂不支持线上直接支付开通。请点击页面下方联系平台客服咨询办理。',
|
||||
'根据相关规范,暂不支持线上直接支付开通。请点击页面下方联系客服咨询办理。'
|
||||
);
|
||||
|
||||
// 替换 isIosAudit 函数为全端统一判断
|
||||
let oldFunc1 = ` /**
|
||||
* 是否触发 iOS 虚拟支付合规机制(仅针对 iOS 设备且后台开启提审保护)
|
||||
* 微信官方仅对 iOS 端严查虚拟支付,Android 端完全合规支持直接支付;
|
||||
* 故 Android 设备正常购买,仅在真实 iOS 设备(或工具模拟 iOS)下启动合规提示。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uiState.virtualPayAudit === false) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
const sys = uni.getSystemInfoSync() || {}
|
||||
const platform = (sys.platform || '').toLowerCase()
|
||||
const isIos = platform === 'ios'
|
||||
const isDevtoolsIos = platform === 'devtools' && /iphone|ipad|ipod/i.test(sys.model || '')
|
||||
return isIos || isDevtoolsIos
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
let newFunc1 = ` /**
|
||||
* 是否处于提审防审模式(各端统一,由后台配置开关控制)
|
||||
* 审核期间:全端开启合规保护,屏蔽直接支付,杜绝虚拟支付审核驳回;
|
||||
* 审核通过:后台关闭防审开关后,全端立即恢复正常标价与微信支付开通。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
c1 = c1.replace(oldFunc1, newFunc1);
|
||||
fs.writeFileSync(file1, c1, 'utf8');
|
||||
|
||||
// 2. 处理 member/recharge.vue
|
||||
let file2 = 'uniapp/pages/member/recharge.vue';
|
||||
let c2 = fs.readFileSync(file2, 'utf8');
|
||||
|
||||
c2 = c2.replace(
|
||||
'根据微信小程序运营规范,iOS设备暂不支持线上直接充值服务。如有疑问或需要协助,请联系客服咨询。',
|
||||
'根据相关运营规范,暂不支持线上直接充值服务。如有疑问或需要协助,请联系客服咨询。'
|
||||
);
|
||||
|
||||
c2 = c2.replace(
|
||||
'根据微信小程序规范,iOS设备暂不支持线上直接充值服务。',
|
||||
'根据相关规范,暂不支持线上直接充值服务。'
|
||||
);
|
||||
|
||||
let oldFunc2 = ` /**
|
||||
* 是否触发 iOS 虚拟支付合规机制(仅针对 iOS 设备且后台开启提审保护)
|
||||
* 微信官方仅限制 iOS 端虚拟充值,Android 端完全合规支持直接支付。
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (uiState.virtualPayAudit === false) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
const sys = uni.getSystemInfoSync() || {}
|
||||
const platform = (sys.platform || '').toLowerCase()
|
||||
const isIos = platform === 'ios'
|
||||
const isDevtoolsIos = platform === 'devtools' && /iphone|ipad|ipod/i.test(sys.model || '')
|
||||
return isIos || isDevtoolsIos
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
let newFunc2 = ` /**
|
||||
* 是否处于提审防审模式(各端统一,由后台配置开关控制)
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isIosAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},`;
|
||||
|
||||
c2 = c2.replace(oldFunc2, newFunc2);
|
||||
fs.writeFileSync(file2, c2, 'utf8');
|
||||
|
||||
console.log('UNIFIED_ALL_PLATFORMS_OK');
|
||||
@@ -1,31 +0,0 @@
|
||||
const fs = require('fs');
|
||||
let file = 'application/common/library/FcConfig.php';
|
||||
let content = fs.readFileSync(file, 'utf8');
|
||||
|
||||
// 1. 在 list 数组中添加 fc_pay_virtualPayAudit
|
||||
let target1 = ` self::item('fc_pay_passwordEnabled', '余额支付密码', 'switch', $pick('pay.payPasswordEnabled', '0'), '开启后,用户使用余额支付时需验证 6 位支付密码;默认关闭'),`;
|
||||
let replacement1 = ` self::item('fc_pay_virtualPayAudit', '提审防审模式', 'switch', (string)$pick('pay.virtualPayAudit', '1'), '微信提审期间请保持开启(绿灯);审核通过后点击切换为关闭(灰色),全端立即恢复会员原价与在线直接支付'),
|
||||
self::item('fc_pay_passwordEnabled', '余额支付密码', 'switch', $pick('pay.payPasswordEnabled', '0'), '开启后,用户使用余额支付时需验证 6 位支付密码;默认关闭'),`;
|
||||
|
||||
// 2. 在 savePay 中保存
|
||||
let target2 = ` protected static function savePay(array $row)
|
||||
{
|
||||
$enabled = isset($row['fc_pay_passwordEnabled']) ? (int)$row['fc_pay_passwordEnabled'] : 0;
|
||||
self::put('pay.payPasswordEnabled', $enabled ? 1 : 0, 'pay', '余额支付密码开关(开启后余额支付需验证 6 位支付密码)');
|
||||
}`;
|
||||
|
||||
let replacement2 = ` protected static function savePay(array $row)
|
||||
{
|
||||
$enabled = isset($row['fc_pay_passwordEnabled']) ? (int)$row['fc_pay_passwordEnabled'] : 0;
|
||||
self::put('pay.payPasswordEnabled', $enabled ? 1 : 0, 'pay', '余额支付密码开关(开启后余额支付需验证 6 位支付密码)');
|
||||
|
||||
if (isset($row['fc_pay_virtualPayAudit'])) {
|
||||
$audit = (int)$row['fc_pay_virtualPayAudit'];
|
||||
self::put('pay.virtualPayAudit', $audit ? 1 : 0, 'pay', '微信提审防审模式开关(1=审核中隐藏支付, 0=正常运营)');
|
||||
}
|
||||
}`;
|
||||
|
||||
content = content.replace(target1, replacement1);
|
||||
content = content.replace(target2, replacement2);
|
||||
fs.writeFileSync(file, content, 'utf8');
|
||||
console.log('FC_CONFIG_MODIFIED');
|
||||
@@ -1,15 +0,0 @@
|
||||
const fs = require('fs');
|
||||
|
||||
['uniapp/pages/member/index.vue', 'uniapp/pages/member/recharge.vue'].forEach(f => {
|
||||
const content = fs.readFileSync(f, 'utf8');
|
||||
const script = content.match(/<script[\s\S]*?>([\s\S]*?)<\/script>/)[1];
|
||||
try {
|
||||
const clean = script
|
||||
.replace(/import\s+.*?from\s+['"].*?['"];?/g, '')
|
||||
.replace(/export\s+default\s+/, 'const _obj = ');
|
||||
new Function(clean);
|
||||
console.log(f, "JS_SYNTAX_OK");
|
||||
} catch(e) {
|
||||
console.error(f, "JS_ERROR", e);
|
||||
}
|
||||
});
|
||||
@@ -1,22 +0,0 @@
|
||||
const fs = require('fs');
|
||||
let sfc;
|
||||
try {
|
||||
sfc = require('@vue/compiler-sfc');
|
||||
} catch (e) {
|
||||
try {
|
||||
sfc = require('D:/Softwares/phpstudy_pro/WWW/fenleixinxi/uniapp/node_modules/@vue/compiler-sfc');
|
||||
} catch (e2) {
|
||||
console.log("No compiler-sfc found locally, skip");
|
||||
}
|
||||
}
|
||||
|
||||
if (sfc && sfc.parse) {
|
||||
['uniapp/pages/member/index.vue', 'uniapp/pages/member/recharge.vue'].forEach(f => {
|
||||
const res = sfc.parse(fs.readFileSync(f, 'utf8'));
|
||||
if (res.errors && res.errors.length) {
|
||||
console.error(f, res.errors);
|
||||
} else {
|
||||
console.log(f, "PARSED_OK");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -3,9 +3,10 @@
|
||||
<!-- 规范化顶部导航 -->
|
||||
<fc-navbar :title="pageTitle || '分类信息'" theme="gradient" :show-back="true" />
|
||||
|
||||
<!-- 二级分类实拍图横滑筛选(进入蔬菜/水果频道时展示花菜、白菜、紫甘蓝等二级品类) -->
|
||||
<scroll-view v-if="subCategories.length" class="list__subcats" scroll-x :show-scrollbar="false">
|
||||
<view class="list__subcats-inner">
|
||||
<!-- 二级分类实拍图横滑筛选:全部按钮常驻左侧,细分品类横向居中滑动 -->
|
||||
<view v-if="subCategories.length" class="list__subcats-bar">
|
||||
<!-- 1. 全部按钮:固定在左侧 -->
|
||||
<view class="list__subcats-fixed">
|
||||
<view
|
||||
class="list__subcat"
|
||||
:class="{ 'list__subcat--active': !subCategoryId }"
|
||||
@@ -16,20 +17,35 @@
|
||||
</view>
|
||||
<text class="list__subcat-name">全部</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="sub in subCategories"
|
||||
:key="sub.id"
|
||||
class="list__subcat"
|
||||
:class="{ 'list__subcat--active': Number(subCategoryId) === Number(sub.id) }"
|
||||
@click="changeSubCategory(sub)"
|
||||
>
|
||||
<view class="list__subcat-thumb">
|
||||
<image class="list__subcat-img" :src="catIcon(sub)" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="list__subcat-name">{{ sub.name }}</text>
|
||||
</view>
|
||||
<view class="list__subcats-divider"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 2. 二级分类项:横向滚动,支持自动居中 -->
|
||||
<scroll-view
|
||||
class="list__subcats-scroll"
|
||||
scroll-x
|
||||
:scroll-left="subCatScrollLeft"
|
||||
:scroll-with-animation="canAnimateScroll"
|
||||
:show-scrollbar="false"
|
||||
@scroll="onSubCatScroll"
|
||||
>
|
||||
<view class="list__subcats-inner">
|
||||
<view
|
||||
v-for="sub in subCategories"
|
||||
:key="sub.id"
|
||||
:id="'subcat-item-' + sub.id"
|
||||
class="list__subcat"
|
||||
:class="{ 'list__subcat--active': Number(subCategoryId) === Number(sub.id) }"
|
||||
@click="changeSubCategory(sub)"
|
||||
>
|
||||
<view class="list__subcat-thumb">
|
||||
<image class="list__subcat-img" :src="catIcon(sub)" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="list__subcat-name">{{ sub.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 分类横滑:仅在未指定具体分类的全量列表场景下显示 -->
|
||||
<scroll-view v-else-if="!isSpecificCategory" class="list__cats" scroll-x :show-scrollbar="false">
|
||||
@@ -134,6 +150,10 @@ export default {
|
||||
{ label: '最热', value: 'hot' },
|
||||
{ label: '价格', value: 'price' },
|
||||
],
|
||||
// 二级分类横向滚动与居中控制
|
||||
subCatScrollLeft: 0,
|
||||
currentScrollLeft: 0,
|
||||
canAnimateScroll: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -172,6 +192,9 @@ export default {
|
||||
onLoad(query) {
|
||||
this.categoryId = Number(query.categoryId || 0)
|
||||
this.fixedCategoryId = Number(query.categoryId || 0)
|
||||
if (query.subCategoryId) {
|
||||
this.subCategoryId = Number(query.subCategoryId || 0)
|
||||
}
|
||||
if (query.name) {
|
||||
const decoded = this.safeDecode(query.name)
|
||||
this.pageTitle = decoded
|
||||
@@ -210,7 +233,7 @@ export default {
|
||||
try {
|
||||
const cats = await homeApi.categories()
|
||||
this.categories = Array.isArray(cats) ? cats : []
|
||||
if (this.fixedCategoryId) {
|
||||
if (this.fixedCategoryId || this.categoryId) {
|
||||
let current = this.categories.find((c) => Number(c.id) === Number(this.categoryId))
|
||||
if (!current) {
|
||||
for (const p of this.categories) {
|
||||
@@ -223,11 +246,26 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 若指定了 subCategoryId 但与当前大类不匹配,反查所属父级
|
||||
if (this.subCategoryId && (!current || !(current.children || []).some((s) => Number(s.id) === Number(this.subCategoryId)))) {
|
||||
for (const p of this.categories) {
|
||||
const sub = (p.children || []).find((s) => Number(s.id) === Number(this.subCategoryId))
|
||||
if (sub) {
|
||||
current = p
|
||||
this.categoryId = Number(p.id)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (current && (!this.pageTitle || /%[0-9a-fA-F]{2}/.test(this.pageTitle))) {
|
||||
this.pageTitle = current.name
|
||||
uni.setNavigationBarTitle({ title: current.name })
|
||||
}
|
||||
}
|
||||
// 若存在已选中的二级分类,执行居中滚动定位
|
||||
if (this.subCategoryId) {
|
||||
this.scrollToActiveSubCategory(false)
|
||||
}
|
||||
} catch (e) {}
|
||||
// 服务区域:默认开放全国省/市/区县
|
||||
try {
|
||||
@@ -317,6 +355,75 @@ export default {
|
||||
this.page = 1
|
||||
this.fetch(true)
|
||||
},
|
||||
/**
|
||||
* 监听二级分类栏横向滚动事件,保持当前滚动位移与组件状态同步
|
||||
* @param {Object} e 滚动事件对象
|
||||
*/
|
||||
onSubCatScroll(e) {
|
||||
if (e && e.detail) {
|
||||
this.currentScrollLeft = e.detail.scrollLeft || 0
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 滚动选中的二级分类项至视口中央(兼顾左右边界保护)
|
||||
* @param {boolean} withAnimation 是否带平滑滚动动画
|
||||
*/
|
||||
scrollToActiveSubCategory(withAnimation = true) {
|
||||
if (!this.subCategoryId) {
|
||||
this.canAnimateScroll = withAnimation
|
||||
this.subCatScrollLeft = 0
|
||||
return
|
||||
}
|
||||
const executeScroll = (retryCount = 0) => {
|
||||
const query = uni.createSelectorQuery().in(this)
|
||||
query.select('.list__subcats-scroll').boundingClientRect()
|
||||
query.select(`#subcat-item-${this.subCategoryId}`).boundingClientRect()
|
||||
query.exec((res) => {
|
||||
if (!res || !res[0] || !res[1]) {
|
||||
if (retryCount < 5) {
|
||||
setTimeout(() => executeScroll(retryCount + 1), 60)
|
||||
}
|
||||
return
|
||||
}
|
||||
const scrollRect = res[0]
|
||||
const itemRect = res[1]
|
||||
|
||||
// 滚动容器可视宽度与左边距
|
||||
const containerWidth = scrollRect.width
|
||||
const containerLeft = scrollRect.left
|
||||
|
||||
// 选中项宽度与左边距
|
||||
const itemWidth = itemRect.width
|
||||
const itemLeft = itemRect.left
|
||||
|
||||
// 选中项相对于滚动容器可视左边界的实时距离
|
||||
const relativeLeft = itemLeft - containerLeft
|
||||
|
||||
// 居中计算:item 中心对齐 container 可视中心
|
||||
// 偏移增量 = relativeLeft + itemWidth / 2 - containerWidth / 2
|
||||
// 新目标 scrollLeft = 当前已滚动位置 + 偏移增量
|
||||
let targetScrollLeft = this.currentScrollLeft + relativeLeft + (itemWidth / 2) - (containerWidth / 2)
|
||||
|
||||
// 边界处理:左边界保护(若小于0则靠左展示)
|
||||
if (targetScrollLeft < 0) {
|
||||
targetScrollLeft = 0
|
||||
}
|
||||
|
||||
this.canAnimateScroll = withAnimation
|
||||
if (Math.abs(this.subCatScrollLeft - targetScrollLeft) < 1) {
|
||||
this.subCatScrollLeft = targetScrollLeft + 0.1
|
||||
} else {
|
||||
this.subCatScrollLeft = targetScrollLeft
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
executeScroll()
|
||||
}, 60)
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 切换二级分类筛选项
|
||||
* @param {Object|null} sub 二级分类
|
||||
@@ -327,6 +434,7 @@ export default {
|
||||
this.subCategoryId = nextId
|
||||
this.page = 1
|
||||
this.fetch(true)
|
||||
this.scrollToActiveSubCategory(true)
|
||||
},
|
||||
/**
|
||||
* 切换排序方式(价格项:首次点击升序,再次点击升降序来回切换)
|
||||
@@ -378,11 +486,19 @@ export default {
|
||||
uni.navigateTo({ url: `/pages/detail/detail?id=${p.id}` })
|
||||
},
|
||||
/**
|
||||
* 跳转到信息发布页(自动携带当前选中的分类参数)
|
||||
* 跳转到信息发布页(自动携带当前选中的大类与二级分类参数)
|
||||
*/
|
||||
goCreate() {
|
||||
const targetCatId = Number(this.categoryId || this.fixedCategoryId || 0)
|
||||
const url = targetCatId > 0 ? `/pages/post/create?categoryId=${targetCatId}` : '/pages/post/create'
|
||||
const targetSubCatId = Number(this.subCategoryId || 0)
|
||||
const params = []
|
||||
if (targetCatId > 0) {
|
||||
params.push(`categoryId=${targetCatId}`)
|
||||
}
|
||||
if (targetSubCatId > 0) {
|
||||
params.push(`subCategoryId=${targetSubCatId}`)
|
||||
}
|
||||
const url = params.length > 0 ? `/pages/post/create?${params.join('&')}` : '/pages/post/create'
|
||||
uni.navigateTo({ url })
|
||||
},
|
||||
},
|
||||
@@ -396,22 +512,54 @@ export default {
|
||||
padding: 16rpx 0;
|
||||
border-bottom: 2rpx solid $fc-border;
|
||||
}
|
||||
.list__subcats {
|
||||
.list__subcats-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #ffffff;
|
||||
white-space: nowrap;
|
||||
padding: 20rpx 0 16rpx;
|
||||
padding: 18rpx 0 16rpx;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.04);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
.list__subcats-fixed {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 18rpx;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
background: #ffffff;
|
||||
}
|
||||
.list__subcats-divider {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 15%;
|
||||
height: 70%;
|
||||
width: 2rpx;
|
||||
background: #f1f5f9;
|
||||
box-shadow: 2rpx 0 6rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.list__subcats-scroll {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.list__subcats-inner {
|
||||
display: inline-flex;
|
||||
padding: 0 20rpx;
|
||||
gap: 24rpx;
|
||||
padding: 0 20rpx 0 16rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.list__subcat {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
cursor: pointer;
|
||||
&--active {
|
||||
.list__subcat-thumb {
|
||||
border-color: #00d26a;
|
||||
@@ -435,6 +583,7 @@ export default {
|
||||
justify-content: center;
|
||||
padding: 8rpx;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.list__subcat-img {
|
||||
width: 100%;
|
||||
@@ -445,6 +594,12 @@ export default {
|
||||
margin-top: 8rpx;
|
||||
font-size: 23rpx;
|
||||
color: #334155;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
max-width: 110rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.list__cats-inner {
|
||||
display: inline-flex;
|
||||
|
||||
@@ -132,11 +132,11 @@
|
||||
<view class="detail__publisher-info">
|
||||
<view class="detail__publisher-name-row">
|
||||
<text class="detail__publisher-name">{{ post.publisher && post.publisher.name }}</text>
|
||||
<text v-if="post.publisher && post.publisher.isMember" class="detail__vip-tag">VIP</text>
|
||||
<text v-if="post.publisher && post.publisher.isMember && !isAudit" class="detail__vip-tag">VIP</text>
|
||||
<text v-if="post.publisher && post.publisher.verified" class="detail__verified">已认证</text>
|
||||
</view>
|
||||
<text class="detail__publisher-sub">
|
||||
{{ (post.publisher && post.publisher.isMember) ? 'VIP尊享会员' : '个人用户' }} · {{ timeText }}发布
|
||||
{{ (post.publisher && post.publisher.isMember && !isAudit) ? 'VIP尊享会员' : '个人用户' }} · {{ timeText }}发布
|
||||
</text>
|
||||
</view>
|
||||
<view v-if="!isSelf" class="detail__follow" :class="{ 'detail__follow--active': followed }" @click.stop="toggleFollow">
|
||||
@@ -271,7 +271,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 同城 VIP 会员特权引导卡片(非会员引导开通,会员展示专属特权) -->
|
||||
<view v-if="!isMember" class="fc-card detail__vip-card" @click="goMember">
|
||||
<view v-if="!isMember && !isAudit" 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" />
|
||||
@@ -289,7 +289,7 @@
|
||||
<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 v-else-if="isMember && !isAudit" 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" />
|
||||
@@ -357,7 +357,7 @@
|
||||
<!-- 底部吸底操作栏 -->
|
||||
<view class="detail__bar-wrapper">
|
||||
<!-- 拨打额度用尽吸底提示浮条 -->
|
||||
<view v-if="isCallQuotaOut" class="detail__bar-quota-tip" @click="goMember">
|
||||
<view v-if="isCallQuotaOut && !isAudit" 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>
|
||||
@@ -630,10 +630,16 @@ export default {
|
||||
bottomBarText() {
|
||||
if (this.loading && !this.loaded) return '加载中…'
|
||||
if (this.isCallQuotaOut) {
|
||||
return '开通会员立即拨打'
|
||||
return this.isAudit ? '今日拨打已达上限' : '开通会员立即拨打'
|
||||
}
|
||||
return '拨打电话'
|
||||
},
|
||||
isAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},
|
||||
timeText() {
|
||||
return fromNow(this.post.createdAt)
|
||||
},
|
||||
@@ -861,8 +867,14 @@ export default {
|
||||
if (res.callQuotaTotal != null) this.callQuotaTotal = Number(res.callQuotaTotal)
|
||||
if (res.callQuotaUsed != null) this.callQuotaUsed = Number(res.callQuotaUsed)
|
||||
if (res.callQuotaLeft != null) this.callQuotaLeft = Number(res.callQuotaLeft)
|
||||
if (res.contentLocked != null) this.contentLocked = !!res.contentLocked
|
||||
if (res.unlocked != null) this.unlocked = !!res.unlocked
|
||||
if (this.isAudit) {
|
||||
// 微信提审合规保护:强制全量展示完整信息,不锁死内容、不引导付费解锁
|
||||
this.contentLocked = false
|
||||
this.unlocked = true
|
||||
} else {
|
||||
if (res.contentLocked != null) this.contentLocked = !!res.contentLocked
|
||||
if (res.unlocked != null) this.unlocked = !!res.unlocked
|
||||
}
|
||||
if (res.viewMode != null) this.viewMode = String(res.viewMode)
|
||||
if (res.payViewPrice != null) this.payViewPrice = Number(res.payViewPrice) || 0
|
||||
if (res.isMember != null) this.isMember = !!res.isMember
|
||||
|
||||
@@ -428,9 +428,34 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="dist__sheet-tip-row">
|
||||
<image class="dist__sheet-tip-icon" :src="iconUrl('info')" mode="aspectFit" />
|
||||
<text class="dist__sheet-tip">无门槛即时提现,系统自动打款直达微信零钱,免手续费</text>
|
||||
<!-- 微信审核必备:完整提现规则清晰展示(额度、次数、时间、到账) -->
|
||||
<view class="dist__sheet-rules-card">
|
||||
<view class="dist__sheet-rules-head">
|
||||
<image class="dist__sheet-rules-icon" :src="iconUrl('info')" mode="aspectFit" />
|
||||
<text class="dist__sheet-rules-title">提现规则与到账须知</text>
|
||||
</view>
|
||||
<view class="dist__sheet-rules-list">
|
||||
<view class="dist__sheet-rule-item">
|
||||
<text class="dist__sheet-rule-k">可提现额度</text>
|
||||
<text class="dist__sheet-rule-v">单笔最低 ¥{{ minWithdrawText }},最高 ¥5,000</text>
|
||||
</view>
|
||||
<view class="dist__sheet-rule-item">
|
||||
<text class="dist__sheet-rule-k">每日提现次数</text>
|
||||
<text class="dist__sheet-rule-v">每日不限次数,满足条件随时可提</text>
|
||||
</view>
|
||||
<view class="dist__sheet-rule-item">
|
||||
<text class="dist__sheet-rule-k">提现开放时间</text>
|
||||
<text class="dist__sheet-rule-v">7×24小时全天候开放申请</text>
|
||||
</view>
|
||||
<view class="dist__sheet-rule-item">
|
||||
<text class="dist__sheet-rule-k">到账时间</text>
|
||||
<text class="dist__sheet-rule-v">微信商家转账实时打款,预计1~5分钟到账</text>
|
||||
</view>
|
||||
<view class="dist__sheet-rule-item">
|
||||
<text class="dist__sheet-rule-k">提现手续费</text>
|
||||
<text class="dist__sheet-rule-v">0手续费,平台免收任何提现服务费</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
@@ -803,9 +828,17 @@ export default {
|
||||
this.teamLoading = true
|
||||
this.loading = true
|
||||
try {
|
||||
const token = uni.getStorageSync('token') || ''
|
||||
if (!token) {
|
||||
// 游客/未登录状态:不抛红条错误,静默展示初始骨架
|
||||
this.loadError = false
|
||||
this.loading = false
|
||||
this.teamLoading = false
|
||||
return
|
||||
}
|
||||
const [overview, records] = await Promise.all([
|
||||
distributionApi.overview(),
|
||||
distributionApi.withdrawRecords(),
|
||||
distributionApi.overview().catch(() => null),
|
||||
distributionApi.withdrawRecords().catch(() => []),
|
||||
])
|
||||
this.overview = overview || {}
|
||||
this.records = Array.isArray(records) ? records : (records && records.list) || []
|
||||
@@ -817,15 +850,19 @@ export default {
|
||||
this.realname = String(overview.realname)
|
||||
}
|
||||
} catch (e) {
|
||||
this.loadError = true
|
||||
uni.showToast({ title: '分销数据加载失败', icon: 'none' })
|
||||
this.loadError = false
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
await Promise.all([
|
||||
this.fetchTeam(true),
|
||||
this.fetchCommissions(true),
|
||||
])
|
||||
const token = uni.getStorageSync('token') || ''
|
||||
if (token) {
|
||||
await Promise.all([
|
||||
this.fetchTeam(true),
|
||||
this.fetchCommissions(true),
|
||||
])
|
||||
} else {
|
||||
this.teamLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -2685,6 +2722,52 @@ export default {
|
||||
color: #00A854;
|
||||
border: 1rpx solid #00E070;
|
||||
}
|
||||
/* 微信审核合规规则卡片 */
|
||||
.dist__sheet-rules-card {
|
||||
margin-top: 24rpx;
|
||||
background: #F8FAF9;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border: 1rpx solid #EAF2ED;
|
||||
}
|
||||
.dist__sheet-rules-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
.dist__sheet-rules-icon {
|
||||
width: 26rpx;
|
||||
height: 26rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.dist__sheet-rules-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #1E293B;
|
||||
}
|
||||
.dist__sheet-rules-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10rpx;
|
||||
}
|
||||
.dist__sheet-rule-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.dist__sheet-rule-k {
|
||||
color: #64748B;
|
||||
flex-shrink: 0;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
.dist__sheet-rule-v {
|
||||
color: #1E293B;
|
||||
text-align: right;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dist__sheet-tip-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -82,15 +82,16 @@
|
||||
</view>
|
||||
|
||||
<!-- 会员引导条 -->
|
||||
<view class="home__vip" @click="go('/pages/member/index')">
|
||||
<!-- 会员引导条 / 提审绿色便民公约条 -->
|
||||
<view class="home__vip" :class="{ 'home__vip--audit': isAudit }" @click="handleHomeVipClick">
|
||||
<view class="home__vip-left">
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl('home-crown')" mode="aspectFit" />
|
||||
<image class="fc-icon fc-icon--md" :src="iconUrl(isAudit ? 'shield' : 'home-crown')" mode="aspectFit" />
|
||||
<view class="home__vip-texts">
|
||||
<text class="home__vip-title">{{ vipTitle }}</text>
|
||||
<text class="home__vip-sub">{{ vipSub }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="home__vip-btn">{{ isMember ? '查看权益' : '立即开通' }}</view>
|
||||
<view class="home__vip-btn">{{ isAudit ? '了解公约' : (isMember ? '查看权益' : '立即开通') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 筛选排序栏(区域选择器与左上角位置保持双向同步) -->
|
||||
@@ -348,7 +349,16 @@ export default {
|
||||
/**
|
||||
* 会员引导条主标题
|
||||
*/
|
||||
isAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},
|
||||
vipTitle() {
|
||||
if (this.isAudit) {
|
||||
return '同城绿色便民公约'
|
||||
}
|
||||
if (this.isMember) return '会员权益已生效'
|
||||
return '开通会员 · 享免费发帖看号'
|
||||
},
|
||||
@@ -378,6 +388,9 @@ export default {
|
||||
* 会员引导条副标题
|
||||
*/
|
||||
vipSub() {
|
||||
if (this.isAudit) {
|
||||
return '真实信息 · 绿色生活 · 本地便民互通平台'
|
||||
}
|
||||
if (this.isMember) {
|
||||
const freeView = Number(this.benefits && this.benefits.freeView)
|
||||
return freeView > 0 ? `每日免费查看 ${freeView} 条联系方式` : '尊享会员专属权益'
|
||||
@@ -491,6 +504,16 @@ export default {
|
||||
this.loadMore()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击首页会员引导/便民公约条
|
||||
*/
|
||||
handleHomeVipClick() {
|
||||
if (this.isAudit) {
|
||||
uni.navigateTo({ url: '/pages/auth/agreement?type=service' })
|
||||
return
|
||||
}
|
||||
this.go('/pages/member/index')
|
||||
},
|
||||
iconUrl,
|
||||
logoUrl,
|
||||
bannerArtUrl,
|
||||
@@ -1117,6 +1140,17 @@ export default {
|
||||
}
|
||||
|
||||
/* 会员引导条 */
|
||||
.home__vip--audit {
|
||||
background: linear-gradient(135deg, #00D26A 0%, #00A854 100%) !important;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 168, 84, 0.22) !important;
|
||||
|
||||
.home__vip-btn {
|
||||
background: #FFFFFF !important;
|
||||
color: #04301E !important;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.home__vip {
|
||||
margin: 0 24rpx 24rpx;
|
||||
padding: 24rpx 28rpx;
|
||||
|
||||
@@ -154,11 +154,11 @@
|
||||
|
||||
<view
|
||||
class="shop-detail__btn-call"
|
||||
:class="{ 'shop-detail__btn-call--vip': isCallQuotaOut }"
|
||||
:class="{ 'shop-detail__btn-call--vip': isCallQuotaOut && !isAudit }"
|
||||
@click="openCallModal"
|
||||
>
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl(isCallQuotaOut ? 'crown' : 'phone')" mode="aspectFit" />
|
||||
<text>{{ isCallQuotaOut ? '开通会员拨打' : '联系店长' }}</text>
|
||||
<image class="fc-icon fc-icon--xs" :src="iconUrl((isCallQuotaOut && !isAudit) ? 'crown' : 'phone')" mode="aspectFit" />
|
||||
<text>{{ (isCallQuotaOut && !isAudit) ? '开通会员拨打' : '联系店长' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fc-safe-bottom"></view>
|
||||
@@ -191,7 +191,7 @@ import FcPostCard from '@/components/fc-post-card/fc-post-card.vue'
|
||||
import FcEmpty from '@/components/fc-empty/fc-empty.vue'
|
||||
import FcCallModal from '@/components/fc-call-modal/fc-call-modal.vue'
|
||||
import { merchantApi } from '@/common/api/merchant.js'
|
||||
import { iconUrl, loadUiConfig } from '@/common/store/ui.js'
|
||||
import { iconUrl, loadUiConfig, uiState } from '@/common/store/ui.js'
|
||||
import { assetUrl } from '@/common/utils/format.js'
|
||||
import { useUserStore } from '@/common/store/index.js'
|
||||
|
||||
@@ -223,6 +223,12 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},
|
||||
/**
|
||||
* 页面顶部导航栏标题
|
||||
* @returns {string}
|
||||
@@ -492,6 +498,10 @@ export default {
|
||||
|
||||
// 拨打次数已用完直接引导开通会员
|
||||
if (this.isCallQuotaOut) {
|
||||
if (this.isAudit) {
|
||||
uni.showToast({ title: '今日免费联系次数已达上限,请明日再试', icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
content: '您今日的免费拨打次数已用完,开通 VIP 会员尊享每日更多拨打特权',
|
||||
@@ -530,6 +540,10 @@ export default {
|
||||
if (/上限|额度|次数/.test(msg)) {
|
||||
this.callQuotaLeft = 0
|
||||
this.showCallModal = false
|
||||
if (this.isAudit) {
|
||||
uni.showToast({ title: '今日联系次数已达上限,请明日再试', icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.showModal({
|
||||
title: '今日拨打次数已用完',
|
||||
content: msg,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<view class="mine__user-info">
|
||||
<view class="mine__user-row">
|
||||
<text class="mine__user-name">{{ isLogin ? nick : '点击登录' }}</text>
|
||||
<text v-if="isLogin && isMember" class="mine__badge mine__badge--vip" @click.stop="go('/pages/member/index')">VIP</text>
|
||||
<text v-if="isLogin && isMember && !isAudit" class="mine__badge mine__badge--vip" @click.stop="go('/pages/member/index')">VIP</text>
|
||||
<view
|
||||
v-if="isLogin && merchantTagText"
|
||||
class="mine__badge"
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
<!-- 核心资产(3项数字,简洁通透) -->
|
||||
<view class="mine__assets">
|
||||
<view class="mine__asset-item" @click="goAsset('balance')">
|
||||
<text class="mine__asset-num">{{ formattedBalance }}</text>
|
||||
<text class="mine__asset-label">余额(元)</text>
|
||||
<view class="mine__asset-item" @click="goAsset(isAudit ? 'posts' : 'balance')">
|
||||
<text class="mine__asset-num">{{ isAudit ? (assets.postCount || 0) : formattedBalance }}</text>
|
||||
<text class="mine__asset-label">{{ isAudit ? '我的发布' : '余额(元)' }}</text>
|
||||
</view>
|
||||
<view class="mine__asset-item" @click="goAsset('points')">
|
||||
<text class="mine__asset-num">{{ assets.points || 0 }}</text>
|
||||
@@ -51,16 +51,20 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 会员卡片 -->
|
||||
<view class="mine__vip" @click="go('/pages/member/index')">
|
||||
<!-- 会员卡片 / 微信提审合规便民专区卡片(全账号统一,杜绝任何会员/VIP痕迹) -->
|
||||
<view
|
||||
class="mine__vip"
|
||||
:class="{ 'mine__vip--audit': isAudit }"
|
||||
@click="handleVipCardClick"
|
||||
>
|
||||
<view class="mine__vip-left">
|
||||
<image class="mine__vip-icon" :src="iconUrl('crown')" mode="aspectFit" />
|
||||
<image class="mine__vip-icon" :src="iconUrl(isAudit ? 'shield' : 'crown')" mode="aspectFit" />
|
||||
<view class="mine__vip-texts">
|
||||
<text class="mine__vip-title">{{ isMember ? (userInfo.memberLevel || 'VIP会员') : '开通会员' }}</text>
|
||||
<text class="mine__vip-sub">{{ vipSubText }}</text>
|
||||
<text class="mine__vip-title">{{ isAudit ? '同城便民服务专区' : (isMember ? (userInfo.memberLevel || 'VIP会员') : '开通会员') }}</text>
|
||||
<text class="mine__vip-sub">{{ isAudit ? '便民发布 · 真实同城 · 遵守平台绿色公约' : vipSubText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mine__vip-btn">{{ isMember ? '会员中心' : '去开通' }}</view>
|
||||
<view class="mine__vip-btn">{{ isAudit ? '服务指南' : (isMember ? '会员中心' : '去开通') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 核心功能网格(4列紧凑精致布局,共8项,饱满规整) -->
|
||||
@@ -176,7 +180,7 @@ export default {
|
||||
{ iconKey: 'bar-fav-on', text: '我的收藏', url: '/pages/favorite/index' },
|
||||
{ iconKey: 'mine-follow', text: '我的关注', url: '/pages/favorite/follows' },
|
||||
{ iconKey: 'mine-order', text: '我的订单', url: '/pages/member/orders' },
|
||||
{ iconKey: 'link-recharge', text: '我的余额', url: '/pages/member/recharge' },
|
||||
...(this.isAudit ? [{ iconKey: 'notice', text: '服务指南', url: '/pages/auth/agreement?type=service' }] : [{ iconKey: 'link-recharge', text: '我的余额', url: '/pages/member/recharge' }]),
|
||||
{ iconKey: 'mine-dist', text: '分销中心', url: '/pages/distribution/index' },
|
||||
{ iconKey: 'shield', text: bizText, action: 'merchant' },
|
||||
]
|
||||
@@ -221,6 +225,12 @@ export default {
|
||||
* 用户昵称
|
||||
* @returns {string}
|
||||
*/
|
||||
isAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},
|
||||
nick() {
|
||||
return this.userInfo.nickname || (this.isLogin ? '同城居民' : '未登录')
|
||||
},
|
||||
@@ -350,6 +360,17 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 点击会员卡片 / 提审便民专区卡片
|
||||
*/
|
||||
handleVipCardClick() {
|
||||
if (this.isAudit) {
|
||||
// 提审保护期:全账号统一跳转至服务指南,杜绝任何进入会员购买页
|
||||
uni.navigateTo({ url: '/pages/auth/agreement?type=service' })
|
||||
return
|
||||
}
|
||||
this.go('/pages/member/index')
|
||||
},
|
||||
iconUrl,
|
||||
|
||||
/**
|
||||
@@ -429,6 +450,10 @@ export default {
|
||||
this.goLogin()
|
||||
return
|
||||
}
|
||||
if (type === 'posts') {
|
||||
uni.navigateTo({ url: '/pages/member/posts' })
|
||||
return
|
||||
}
|
||||
if (type === 'balance') {
|
||||
uni.navigateTo({ url: '/pages/member/recharge' })
|
||||
} else if (type === 'coupons') {
|
||||
@@ -746,6 +771,25 @@ export default {
|
||||
}
|
||||
|
||||
/* ==================== 会员卡片 ==================== */
|
||||
.mine__vip--audit {
|
||||
background: linear-gradient(135deg, #00D26A 0%, #00A854 100%) !important;
|
||||
box-shadow: 0 10rpx 28rpx rgba(0, 168, 84, 0.22) !important;
|
||||
|
||||
.mine__vip-title {
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
.mine__vip-sub {
|
||||
color: rgba(255, 255, 255, 0.92) !important;
|
||||
}
|
||||
|
||||
.mine__vip-btn {
|
||||
background: #FFFFFF !important;
|
||||
color: #04301E !important;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mine__vip {
|
||||
margin: -72rpx 28rpx 0;
|
||||
padding: 24rpx 28rpx;
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 7. 发布权益与会员特权(置于表单底部发布前,避免干扰顶部核心填写) -->
|
||||
<view class="create__member-banner" :class="{ 'create__member-banner--vip': isMember }" @click="goMember">
|
||||
<view v-if="!isAudit" 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">
|
||||
@@ -844,7 +844,14 @@ export default {
|
||||
})
|
||||
return list
|
||||
},
|
||||
isAudit() {
|
||||
// #ifdef MP-WEIXIN
|
||||
return uiState.virtualPayAudit !== false
|
||||
// #endif
|
||||
return false
|
||||
},
|
||||
needPay() {
|
||||
if (this.isAudit) return false
|
||||
return this.publish.mode === 'paid' && this.form.plan !== 'quota'
|
||||
},
|
||||
/**
|
||||
@@ -953,6 +960,16 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 若路由传入了 subCategoryId,反查确认所属父级大类
|
||||
if (this.form.subCategoryId && this.categories.length) {
|
||||
for (const p of this.categories) {
|
||||
const foundSub = (p.children || []).find((s) => Number(s.id) === Number(this.form.subCategoryId))
|
||||
if (foundSub) {
|
||||
this.form.categoryId = Number(p.id)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.form.categoryId && this.categories.length) {
|
||||
this.form.categoryId = Number(this.categories[0].id)
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户