| | |
| | | import { onLoad, onShow } from '@dcloudio/uni-app' |
| | | import { getNoticeList } from '../notice/service' |
| | | import { getUserCenter } from './service' |
| | | import { createLiveRoomEntry } from '../home/service' |
| | | import { getRuntimeVersionName } from '@/utils/app-version.js' |
| | | import { hasStoredSession } from '@/utils/auth-session.js' |
| | | import manifestConfig from '../../manifest.json' |
| | |
| | | url: string |
| | | iconClass?: string |
| | | requiresLogin?: boolean |
| | | dynamicVzan?: boolean |
| | | } |
| | | |
| | | interface NoticeSummaryItem { |
| | |
| | | ] |
| | | }) |
| | | |
| | | const WEIZAN_LIVE_STATS_URL = 'https://www.vzan.com' |
| | | const WEIZAN_LIVE_STATS_URL = 'https://wzzhibo.haizhentong.com/live/m/agent/index?zbid=1247381477&v=1787212616638' |
| | | const WEIZAN_LIVE_ORDER_URL = 'https://wzzhibo.haizhentong.com/live/m/order/myorder?zbid=1247381477&tpid=0&state=0&v=1787212292181' |
| | | |
| | | const bottomMenuList = computed<MenuItem[]>(() => { |
| | |
| | | ] |
| | | const liveOrderItem = { title: '直播订单', icon: '/static/image/mine/dingdan.png', url: buildWebviewUrl(WEIZAN_LIVE_ORDER_URL, '直播订单'), iconClass: 'icon-live-order', requiresLogin: true } |
| | | const liveStatsList = Number(userCenter.value.type) === 1 |
| | | ? [{ title: '直播统计', icon: '/static/image/mine/list.png', url: '', iconClass: 'icon-live-stats', requiresLogin: true, dynamicVzan: true }] |
| | | ? [{ title: '直播统计', icon: '/static/image/mine/list.png', url: buildWebviewUrl(WEIZAN_LIVE_STATS_URL, '直播统计'), iconClass: 'icon-live-stats', requiresLogin: true }] |
| | | : [] |
| | | const agreementList = [ |
| | | { title: '用户协议', icon: '/static/image/mine/coustom.png', url: '/pages/protocol/protocol?type=user', iconClass: 'icon-user-agree' }, |
| | |
| | | /** |
| | | * 统一跳转个人中心相关页面。 |
| | | */ |
| | | async function goPage(target: string | MenuItem) { |
| | | if (typeof target !== 'string' && target.dynamicVzan) { |
| | | try { |
| | | uni.showLoading({ title: '正在进入', mask: true }) |
| | | const userId = userCenter.value.id |
| | | if (!userId) { |
| | | uni.showToast({ title: '请先登录', icon: 'none' }) |
| | | return |
| | | } |
| | | const response = await createLiveRoomEntry(userId) |
| | | const targetUrl = response?.code === 0 ? response.data?.url : '' |
| | | if (!targetUrl) { |
| | | uni.showToast({ title: response?.msg || '获取跳转地址失败', icon: 'none' }) |
| | | return |
| | | } |
| | | uni.navigateTo({ url: buildWebviewUrl(targetUrl, target.title) }) |
| | | } catch { |
| | | uni.showToast({ title: '获取跳转地址失败', icon: 'none' }) |
| | | } finally { |
| | | uni.hideLoading() |
| | | } |
| | | return |
| | | } |
| | | function goPage(target: string | MenuItem) { |
| | | const url = typeof target === 'string' ? target : target.url |
| | | if (!url) { |
| | | return |