Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { View, Text, Image, Button, Input } from '@tarojs/components';
|
import { View, Text, Image, Button, Input, ScrollView } from '@tarojs/components';
|
||||||
import Taro, { useDidShow, usePullDownRefresh } from '@tarojs/taro';
|
import Taro, { useDidShow, usePullDownRefresh } from '@tarojs/taro';
|
||||||
import { isWxAuthorizeEnabled, type ClientRuntimeConfig } from '@dukang/shared-types';
|
import { isWxAuthorizeEnabled, type ClientRuntimeConfig } from '@dukang/shared-types';
|
||||||
import PageShell from '../../components/PageShell';
|
import PageShell from '../../components/PageShell';
|
||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
} from '../../lib/mini-wechat-profile';
|
} from '../../lib/mini-wechat-profile';
|
||||||
import { isLoggedIn, logout, request, toast, type UserProfile } from '../../lib/api';
|
import { isLoggedIn, logout, request, toast, type UserProfile } from '../../lib/api';
|
||||||
import { isWechatEnv } from '../../lib/weixin';
|
import { isWechatEnv } from '../../lib/weixin';
|
||||||
|
import qualificationDisclosureImg from '../../assets/qualification-disclosure.png';
|
||||||
|
|
||||||
const ORDER_SHORTCUTS = [
|
const ORDER_SHORTCUTS = [
|
||||||
{ tab: 'pending_pay', icon: '付', label: '待付款' },
|
{ tab: 'pending_pay', icon: '付', label: '待付款' },
|
||||||
@@ -29,6 +30,7 @@ const SERVICES = [
|
|||||||
{ icon: '址', label: '地址管理', url: '/pages/addresses/index' },
|
{ icon: '址', label: '地址管理', url: '/pages/addresses/index' },
|
||||||
{ icon: '店', label: '可用门店', tab: '/pages/stores/index' },
|
{ icon: '店', label: '可用门店', tab: '/pages/stores/index' },
|
||||||
{ icon: '服', label: '联系客服', url: '/pages/customer-service/index' },
|
{ icon: '服', label: '联系客服', url: '/pages/customer-service/index' },
|
||||||
|
{ icon: '资', label: '资质公示', action: 'qualification' as const },
|
||||||
{ icon: '关', label: '关于我们', action: 'about' as const },
|
{ icon: '关', label: '关于我们', action: 'about' as const },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
@@ -51,6 +53,7 @@ export default function MinePage() {
|
|||||||
const [draftNickname, setDraftNickname] = useState('');
|
const [draftNickname, setDraftNickname] = useState('');
|
||||||
const [savingProfile, setSavingProfile] = useState(false);
|
const [savingProfile, setSavingProfile] = useState(false);
|
||||||
const [profileLoadError, setProfileLoadError] = useState('');
|
const [profileLoadError, setProfileLoadError] = useState('');
|
||||||
|
const [qualificationOpen, setQualificationOpen] = useState(false);
|
||||||
|
|
||||||
function resetGuestState() {
|
function resetGuestState() {
|
||||||
setProfile(null);
|
setProfile(null);
|
||||||
@@ -254,6 +257,10 @@ export default function MinePage() {
|
|||||||
Taro.switchTab({ url: item.tab });
|
Taro.switchTab({ url: item.tab });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ('action' in item && item.action === 'qualification') {
|
||||||
|
setQualificationOpen(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ('action' in item && item.action === 'about') {
|
if ('action' in item && item.action === 'about') {
|
||||||
toast('杜康好客 · 传承千年酒文化');
|
toast('杜康好客 · 传承千年酒文化');
|
||||||
}
|
}
|
||||||
@@ -507,14 +514,32 @@ export default function MinePage() {
|
|||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
className={`mine-profile-sheet-save${savingProfile ? ' is-disabled' : ''}`}
|
className={`mine-profile-sheet-save${savingProfile ? ' is-disabled' : ''}`}
|
||||||
onClick={savingProfile ? undefined : () => void saveWxProfile()}
|
onClick={() => {
|
||||||
|
if (!savingProfile) void saveWxProfile();
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Text>{savingProfile ? '保存中...' : '保存'}</Text>
|
<Text>{savingProfile ? '保存中…' : '保存'}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
|
{qualificationOpen ? (
|
||||||
|
<View
|
||||||
|
className="mine-qualification-mask"
|
||||||
|
onClick={() => setQualificationOpen(false)}
|
||||||
|
>
|
||||||
|
<ScrollView scrollY className="mine-qualification-scroll" enhanced showScrollbar>
|
||||||
|
<Image
|
||||||
|
className="mine-qualification-img"
|
||||||
|
src={qualificationDisclosureImg}
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</ScrollView>
|
||||||
|
<Text className="mine-qualification-hint">点击任意处关闭</Text>
|
||||||
|
</View>
|
||||||
|
) : null}
|
||||||
</PageShell>
|
</PageShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -498,3 +498,38 @@
|
|||||||
opacity: 0.65;
|
opacity: 0.65;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mine-qualification-mask {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1200;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 24px 16px;
|
||||||
|
background: rgba(0, 0, 0, 0.72);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mine-qualification-scroll {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 420px;
|
||||||
|
max-height: calc(86vh - 36px);
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mine-qualification-img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mine-qualification-hint {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgba(255, 255, 255, 0.82);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user