| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import { IBestToast } from '@ibestservices/ibest-ui'
- import { DelPhotoParam } from '../models'
- import { DiaLogPageEnum, DiaLogParam, YTDiaLogModel } from '../models/YTDiaLogModel'
- class YTRouter extends NavPathStack {
- private static declare instance: YTRouter
- private constructor() {
- super()
- }
- static getInstance() {
- if (!YTRouter.instance) {
- YTRouter.instance = new YTRouter()
- }
- return YTRouter.instance
- }
- router2SettingPage() {
- yTRouter.pushPathByName('SettingPage', '')
- }
- router2SuggestionPage() {
- yTRouter.pushPathByName('SuggestionPage', '')
- }
- router2AgreementPage(param: '关于我们' | '隐私政策' | '用户协议') {
- yTRouter.pushPathByName('AgreementPage', param)
- }
- /**
- * 跳转至用户协议
- */
- router2userAgreement() {
- yTRouter.pushPathByName('UserAgreementPage', '')
- }
- /**
- * 跳转至隐私政策
- */
- router2Privacy() {
- yTRouter.pushPathByName('Privacy', '')
- }
- router2AboutUS() {
- yTRouter.pushPathByName('AboutUS', '')
- }
- getAgreementPageParam() {
- return yTRouter.getParamByName('AgreementPage').pop() as '关于我们' | '隐私政策' | '用户协议'
- }
- router2LoginPage(needToast: boolean = false) {
- if (yTRouter.getAllPathName().pop() === 'LoginPage') {
- return
- }
- if (needToast) {
- IBestToast.show("请先登录哦~")
- }
- yTRouter.pushPathByName('LoginPage', '')
- }
- router2DelPhotoPage(param: DelPhotoParam) {
- yTRouter.pushPathByName('DelPhotoPage', param)
- }
- getDelPhotoParam() {
- return yTRouter.getParamByName('DelPhotoPage').pop() as DelPhotoParam
- }
- //UpdatePasswordPage
- router2UpdatePasswordPage() {
- yTRouter.pushPathByName("UpdatePasswordPage", '')
- }
- routerBack() {
- yTRouter.pop()
- }
- /**
- * DiaLog 相关
- */
- router2DiaLog(param: DiaLogParam) {
- yTRouter.pushPathByName('YTNaviDiaLog', param)
- }
- }
- export const yTRouter = YTRouter.getInstance()
|