feat(audit): 审核模式资料选项化——行业/家乡/专长改预设picker、隐藏头像上传/公司/自定义标签/参与者标签,规避UGC类目认定
This commit is contained in:
@@ -20,6 +20,7 @@ Page({
|
||||
isJoined: false,
|
||||
isCreator: false,
|
||||
joining: false,
|
||||
auditMode: false,
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -29,6 +30,25 @@ Page({
|
||||
this.loadActivityDetail();
|
||||
}
|
||||
this.checkLoginStatus();
|
||||
this.checkAuditMode();
|
||||
},
|
||||
|
||||
// 审核模式:隐藏参与者自定义标签(规避 UGC 类目认定)
|
||||
async checkAuditMode() {
|
||||
const cached = wx.getStorageSync('audit_mode');
|
||||
if (cached === true || cached === false) {
|
||||
this.setData({ auditMode: cached });
|
||||
if (cached) return;
|
||||
}
|
||||
try {
|
||||
const app = getApp();
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
wx.request({ url: `${app.globalData.apiBaseUrl}/api/settings/audit-mode`, method: 'GET', timeout: 5000, success: resolve, fail: reject });
|
||||
});
|
||||
const audit = !!(res.statusCode === 200 && res.data && res.data.success && res.data.data.auditMode);
|
||||
this.setData({ auditMode: audit });
|
||||
wx.setStorageSync('audit_mode', audit);
|
||||
} catch (e) { this.setData({ auditMode: false }); }
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<text class="ai-badge ai-badge-level" wx:if="{{item.level && item.level !== '非会员'}}">{{item.level}}</text>
|
||||
</view>
|
||||
<text class="ai-participant-company-position" wx:if="{{item.company || item.position}}">{{item.company || item.name}}{{item.position ? ' · ' + item.position : ''}}</text>
|
||||
<view class="ai-participant-tags" wx:if="{{item.tags && item.tags.length > 0}}">
|
||||
<view class="ai-participant-tags" wx:if="{{!auditMode && item.tags && item.tags.length > 0}}">
|
||||
<text class="ai-tag" wx:for="{{item.tags}}" wx:for-item="tag" wx:key="*this">{{tag}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -18,6 +18,11 @@ Page({
|
||||
expertise: '',
|
||||
},
|
||||
chaishuLevelOptions: ['非会员', '一级拆书家', '二级拆书家', '三级拆书家'],
|
||||
// 审核模式:自由输入字段选项化(规避 UGC 类目认定)
|
||||
auditMode: false,
|
||||
industryOptions: ['互联网/IT', '教育/培训', '金融/保险', '医疗健康', '制造业', '零售/电商', '文化传媒', '法律', '财务/咨询', '政府/事业单位', '自由职业', '学生', '其他'],
|
||||
hometownOptions: ['北京', '上海', '广州', '深圳', '杭州', '成都', '武汉', '西安', '南京', '重庆', '长沙', '郑州', '青岛', '苏州', '天津', '其他'],
|
||||
expertiseOptions: ['阅读引导', '演讲表达', '写作', '产品设计', '程序开发', '市场营销', '人力资源', '运营管理', '财务法务', '心理学', '项目管理', '其他'],
|
||||
loading: false,
|
||||
submitting: false,
|
||||
chaishu: null,
|
||||
@@ -31,11 +36,25 @@ Page({
|
||||
emailOtpCountdown: 0,
|
||||
},
|
||||
|
||||
// 审核模式检测:与 collaboration-analysis 同一模式(GET /api/settings/audit-mode)
|
||||
async checkAuditMode() {
|
||||
try {
|
||||
const app = getApp();
|
||||
const res = await new Promise((resolve, reject) => {
|
||||
wx.request({ url: `${app.globalData.apiBaseUrl}/api/settings/audit-mode`, method: 'GET', timeout: 5000, success: resolve, fail: reject });
|
||||
});
|
||||
const audit = !!(res.statusCode === 200 && res.data && res.data.success && res.data.data.auditMode);
|
||||
this.setData({ auditMode: audit });
|
||||
wx.setStorageSync('audit_mode', audit);
|
||||
} catch (e) { this.setData({ auditMode: false }); }
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
// 合规整改:游客不强制跳登录——展示登录引导卡片,可自由返回浏览
|
||||
const { isLoggedIn } = require('../../utils/auth');
|
||||
const loggedIn = isLoggedIn();
|
||||
this.setData({ needLogin: !loggedIn });
|
||||
this.checkAuditMode();
|
||||
if (!loggedIn) return;
|
||||
this.loadProfile();
|
||||
this.loadBranches();
|
||||
@@ -98,6 +117,14 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 审核模式:选项化字段统一 picker 处理(optionsKey 取 data 中对应 *Options 数组)
|
||||
onOptionPickerChange(e) {
|
||||
const { optionsKey, field } = e.currentTarget.dataset;
|
||||
const options = this.data[optionsKey] || [];
|
||||
const index = Number(e.detail.value);
|
||||
this.setData({ [`form.${field}`]: options[index] || '' });
|
||||
},
|
||||
|
||||
async loadBranches() {
|
||||
try {
|
||||
const res = await getChaishuBranches();
|
||||
@@ -283,6 +310,10 @@ Page({
|
||||
},
|
||||
|
||||
async handleChooseAvatar() {
|
||||
if (this.data.auditMode) {
|
||||
wx.showToast({ title: '当前版本暂不支持自定义头像', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const [tempFilePath] = await chooseImages(1);
|
||||
if (!tempFilePath) {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
</view>
|
||||
|
||||
<block wx:else>
|
||||
<!-- 头像 -->
|
||||
<view class="avatar-section" bindtap="handleChooseAvatar">
|
||||
<!-- 头像(审核模式隐藏自定义上传,规避 UGC 类目认定) -->
|
||||
<view class="avatar-section" wx:if="{{!auditMode}}" bindtap="handleChooseAvatar">
|
||||
<text class="section-label">头像</text>
|
||||
<view class="avatar-wrapper">
|
||||
<image class="avatar-img" src="{{form.avatarUrl || '/assets/icons/default-avatar.png'}}" mode="aspectFill" />
|
||||
@@ -33,8 +33,8 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 标签(拆书帮身份;点文字改、点 × 删、+添加) -->
|
||||
<view class="form-item form-item-column nickname-tags-block" wx:if="{{chaishu}}">
|
||||
<!-- 标签(拆书帮身份;点文字改、点 × 删、+添加;审核模式隐藏自定义标签) -->
|
||||
<view class="form-item form-item-column nickname-tags-block" wx:if="{{chaishu && !auditMode}}">
|
||||
<text class="form-label">标签</text>
|
||||
<view class="chaishu-tags-wrap">
|
||||
<view class="chaishu-tag-chip" wx:for="{{chaishu.tags}}" wx:key="*this">
|
||||
@@ -97,7 +97,7 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="form-item" wx:if="{{!auditMode}}">
|
||||
<text class="form-label">公司</text>
|
||||
<input
|
||||
class="form-input"
|
||||
@@ -111,34 +111,67 @@
|
||||
<view class="form-item">
|
||||
<text class="form-label">行业</text>
|
||||
<input
|
||||
wx:if="{{!auditMode}}"
|
||||
class="form-input"
|
||||
value="{{form.industry}}"
|
||||
placeholder="请输入行业"
|
||||
data-field="industry"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
<picker
|
||||
wx:else
|
||||
mode="selector"
|
||||
range="{{industryOptions}}"
|
||||
bindchange="onOptionPickerChange"
|
||||
data-options-key="industryOptions"
|
||||
data-field="industry"
|
||||
>
|
||||
<view class="form-input picker-value">{{form.industry || '请选择行业'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">家乡</text>
|
||||
<input
|
||||
wx:if="{{!auditMode}}"
|
||||
class="form-input"
|
||||
value="{{form.hometown}}"
|
||||
placeholder="请输入家乡"
|
||||
data-field="hometown"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
<picker
|
||||
wx:else
|
||||
mode="selector"
|
||||
range="{{hometownOptions}}"
|
||||
bindchange="onOptionPickerChange"
|
||||
data-options-key="hometownOptions"
|
||||
data-field="hometown"
|
||||
>
|
||||
<view class="form-input picker-value">{{form.hometown || '请选择家乡'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">专长</text>
|
||||
<input
|
||||
wx:if="{{!auditMode}}"
|
||||
class="form-input"
|
||||
value="{{form.expertise}}"
|
||||
placeholder="请输入专长"
|
||||
data-field="expertise"
|
||||
bindinput="onInput"
|
||||
/>
|
||||
<picker
|
||||
wx:else
|
||||
mode="selector"
|
||||
range="{{expertiseOptions}}"
|
||||
bindchange="onOptionPickerChange"
|
||||
data-options-key="expertiseOptions"
|
||||
data-field="expertise"
|
||||
>
|
||||
<view class="form-input picker-value">{{form.expertise || '请选择专长'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -321,3 +321,8 @@
|
||||
.ll-btn { flex: 1; font-size: 28rpx; border-radius: 40rpx; padding: 18rpx 0; line-height: 1.4; }
|
||||
.ll-primary { background: #4f6ef7; color: #fff; }
|
||||
.ll-ghost { background: #f3f5f9; color: #4f6ef7; }
|
||||
|
||||
/* 审核模式选项化 picker 展示值 */
|
||||
.picker-value {
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user