feat: 同步管理端、用户端与后端业务,并接通线上 Web 接口
补齐平台订阅、外部登录、CRM 同步与用户端页面;Nginx 转发用户端接口,登录页使用 Google 与 Apple 标志。 Co-authored-by: Cursor <cursoragent@cursor.com>
这个提交包含在:
@@ -55,13 +55,32 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="modules-stack">
|
||||
<!-- Module 1: Basic Profile -->
|
||||
<view class="module-card">
|
||||
<view class="module-card" :style="moduleCardStyle('basic')">
|
||||
<view class="module-card-header">
|
||||
<view class="module-title-wrap">
|
||||
<view class="module-indicator"></view>
|
||||
<text class="module-title">{{ t('basicSection') }}</text>
|
||||
</view>
|
||||
<view class="module-order-actions">
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('basic', -1)"
|
||||
:aria-label="t('moveUp')"
|
||||
@click="handleMoveModule('basic', -1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveUp') }}</text>
|
||||
</button>
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('basic', 1)"
|
||||
:aria-label="t('moveDown')"
|
||||
@click="handleMoveModule('basic', 1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveDown') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Avatar Uploader Stage -->
|
||||
@@ -127,27 +146,71 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="field field-last">
|
||||
<view class="field">
|
||||
<text class="field-label">{{ t('company') }}</text>
|
||||
<input
|
||||
class="field-input"
|
||||
:class="{ 'field-input-locked': companyLocked }"
|
||||
type="text"
|
||||
v-model="state.company"
|
||||
:placeholder="t('company')"
|
||||
:disabled="state.saving || companyLocked"
|
||||
/>
|
||||
<text v-if="companyLocked" class="field-lock-hint">{{ t('lockedHint') }}</text>
|
||||
</view>
|
||||
|
||||
<view class="field">
|
||||
<text class="field-label">{{ t('slogan') }}</text>
|
||||
<input
|
||||
class="field-input"
|
||||
:class="{ 'field-input-locked': sloganLocked }"
|
||||
type="text"
|
||||
v-model="state.slogan"
|
||||
:placeholder="t('slogan')"
|
||||
:disabled="state.saving || sloganLocked"
|
||||
/>
|
||||
<text v-if="sloganLocked" class="field-lock-hint">{{ t('lockedHint') }}</text>
|
||||
</view>
|
||||
|
||||
<view class="field field-last">
|
||||
<text class="field-label">{{ t('timezone') }}</text>
|
||||
<input
|
||||
class="field-input"
|
||||
type="text"
|
||||
v-model="state.timezone"
|
||||
:placeholder="t('timezone')"
|
||||
:disabled="state.saving"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Module 2: Social Matrix -->
|
||||
<view class="module-card">
|
||||
<view class="module-card" :style="moduleCardStyle('social')">
|
||||
<view class="module-card-header">
|
||||
<view class="module-title-wrap">
|
||||
<view class="module-indicator"></view>
|
||||
<text class="module-title">{{ t('socialSection') }}</text>
|
||||
</view>
|
||||
<text class="module-subtitle">{{ t('socialSectionDesc') }}</text>
|
||||
<view class="module-order-actions">
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('social', -1)"
|
||||
:aria-label="t('moveUp')"
|
||||
@click="handleMoveModule('social', -1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveUp') }}</text>
|
||||
</button>
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('social', 1)"
|
||||
:aria-label="t('moveDown')"
|
||||
@click="handleMoveModule('social', 1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveDown') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<text class="module-subtitle module-subtitle-block">{{ t('socialSectionDesc') }}</text>
|
||||
|
||||
<view class="field">
|
||||
<text class="field-label">{{ t('phone') }}</text>
|
||||
@@ -195,16 +258,34 @@
|
||||
</view>
|
||||
|
||||
<!-- Module 3: Privacy & Visibility -->
|
||||
<view class="module-card">
|
||||
<view class="module-card" :style="moduleCardStyle('privacy')">
|
||||
<view class="module-card-header">
|
||||
<view class="module-title-wrap">
|
||||
<view class="module-indicator"></view>
|
||||
<text class="module-title">{{ t('privacySection') }}</text>
|
||||
</view>
|
||||
<view class="gdpr-pill">
|
||||
<text class="gdpr-pill-text">{{ t('gdprBadge') }}</text>
|
||||
<view class="module-order-actions">
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('privacy', -1)"
|
||||
:aria-label="t('moveUp')"
|
||||
@click="handleMoveModule('privacy', -1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveUp') }}</text>
|
||||
</button>
|
||||
<button
|
||||
class="module-order-btn"
|
||||
:disabled="state.saving || !canMoveModule('privacy', 1)"
|
||||
:aria-label="t('moveDown')"
|
||||
@click="handleMoveModule('privacy', 1)"
|
||||
>
|
||||
<text class="module-order-btn-text">{{ t('moveDown') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gdpr-pill gdpr-pill-inline">
|
||||
<text class="gdpr-pill-text">{{ t('gdprBadge') }}</text>
|
||||
</view>
|
||||
|
||||
<!-- Visibility Options -->
|
||||
<view class="privacy-options-group">
|
||||
@@ -274,6 +355,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Error Alert Banner -->
|
||||
<view v-if="state.errorMessage !== ''" class="card-error">
|
||||
@@ -314,6 +396,8 @@ import {
|
||||
updateOwnerCard,
|
||||
fetchOwnerCardInfo,
|
||||
buildUpdatePayload,
|
||||
isFieldLocked,
|
||||
moveModuleInOrder,
|
||||
CardEditCopyKey,
|
||||
CardEditPageOptions,
|
||||
} from './useCardEdit.uts';
|
||||
@@ -337,7 +421,8 @@ type CardEditExtendedKey =
|
||||
| 'duration24h'
|
||||
| 'duration7d'
|
||||
| 'duration30d'
|
||||
| 'temporaryNote';
|
||||
| 'temporaryNote'
|
||||
| 'lockedHint';
|
||||
|
||||
const EXTENDED_COPY: Record<OmniLocale, Record<string, string>> = {
|
||||
'zh-CN': {
|
||||
@@ -525,10 +610,55 @@ const avatarActionText = computed((): string => {
|
||||
return state.avatarUrl !== '' ? resolveCardEditText('avatarChange') : resolveCardEditText('avatarUpload');
|
||||
});
|
||||
|
||||
const companyLocked = computed((): boolean => {
|
||||
return isFieldLocked(state.lockedFields, 'company');
|
||||
});
|
||||
|
||||
const sloganLocked = computed((): boolean => {
|
||||
return isFieldLocked(state.lockedFields, 'slogan');
|
||||
});
|
||||
|
||||
const deleteAriaLabel = computed((): string => {
|
||||
return getOmniText(getCurrentLocale(), 'common.delete');
|
||||
});
|
||||
|
||||
function moduleIndexOf(key: string): number {
|
||||
const order = state.moduleOrder;
|
||||
for (let i = 0; i < order.length; i++) {
|
||||
if (order[i] === key) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function moduleCardStyle(key: string): Record<string, string> {
|
||||
const index = moduleIndexOf(key);
|
||||
return {
|
||||
order: String(index >= 0 ? index : 99),
|
||||
};
|
||||
}
|
||||
|
||||
function canMoveModule(key: string, delta: number): boolean {
|
||||
const index = moduleIndexOf(key);
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
const target = index + delta;
|
||||
return target >= 0 && target < state.moduleOrder.length;
|
||||
}
|
||||
|
||||
function handleMoveModule(key: string, delta: number): void {
|
||||
if (state.saving) {
|
||||
return;
|
||||
}
|
||||
const index = moduleIndexOf(key);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
state.moduleOrder = moveModuleInOrder(state.moduleOrder, index, delta);
|
||||
}
|
||||
|
||||
function t(key: CardEditExtendedKey): string {
|
||||
const locale = getCurrentLocale();
|
||||
const dict = EXTENDED_COPY[locale];
|
||||
@@ -611,6 +741,7 @@ function handleBack(): void {
|
||||
|
||||
async function handleSave(): Promise<void> {
|
||||
const ok = await submitCardEdit(state);
|
||||
// 仅接口 code === 1000(submitCardEdit 已校验)时提示保存成功
|
||||
if (ok) {
|
||||
try {
|
||||
if (typeof uni !== 'undefined' && uni.setStorageSync != null && state.cardId != null) {
|
||||
@@ -799,6 +930,11 @@ onLoad((options: CardEditPageOptions) => {
|
||||
margin-block-end: 16px;
|
||||
}
|
||||
|
||||
.modules-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.module-card-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -811,6 +947,43 @@ onLoad((options: CardEditPageOptions) => {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.module-order-actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-inline-start: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.module-order-btn {
|
||||
height: 32px;
|
||||
min-height: 32px;
|
||||
min-width: 44px;
|
||||
padding-inline: 8px;
|
||||
background-color: var(--oc-primary-soft, #EBF5FF);
|
||||
border-width: 0;
|
||||
border-radius: 9999px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.module-order-btn:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.module-order-btn[disabled] {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.module-order-btn-text {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--oc-primary, #0B5CFF);
|
||||
}
|
||||
|
||||
.module-indicator {
|
||||
@@ -833,12 +1006,23 @@ onLoad((options: CardEditPageOptions) => {
|
||||
color: var(--oc-text-2, #667085);
|
||||
}
|
||||
|
||||
.module-subtitle-block {
|
||||
margin-block-end: 12px;
|
||||
margin-block-start: -8px;
|
||||
}
|
||||
|
||||
.gdpr-pill {
|
||||
padding: 2px 8px;
|
||||
background-color: rgba(18, 183, 106, 0.1);
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.gdpr-pill-inline {
|
||||
align-self: flex-start;
|
||||
margin-block-end: 12px;
|
||||
margin-block-start: -8px;
|
||||
}
|
||||
|
||||
.gdpr-pill-text {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
@@ -969,6 +1153,18 @@ onLoad((options: CardEditPageOptions) => {
|
||||
color: var(--oc-text, #101828);
|
||||
}
|
||||
|
||||
.field-input-locked {
|
||||
opacity: 0.72;
|
||||
color: var(--oc-text-2, #667085);
|
||||
}
|
||||
|
||||
.field-lock-hint {
|
||||
margin-block-start: 6px;
|
||||
font-size: 12px;
|
||||
color: var(--oc-text-2, #667085);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.privacy-options-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
在新工单中引用
屏蔽一个用户