| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import { defineStore } from 'pinia'
- interface SysState {
- /**
- * 状态栏高度
- */
- statusBarHeight: number
- /**
- * 胶囊按钮高度
- */
- MenuButtonHeight: number
- /**
- * 支付成功页面查看订单按钮跳转路径
- *
- */
- paySuccessPath: string
- /**
- * 支付成功页面返回首页按钮跳转路径
- */
- payBackIndexPath: string
- /**
- * 支付失败页面返回首页按钮跳转路径
- */
- payFailPath: string
- /**
- * 透明度
- */
- opcity: number
- /**
- * 是否上线审核
- */
- isOnlineAudit: boolean
- }
- export const useSysStore = defineStore('system', {
- state: (): SysState => ({
- statusBarHeight: 0,
- MenuButtonHeight: 0,
- paySuccessPath: '',
- payBackIndexPath: '',
- payFailPath: '',
- opcity: 0,
- isOnlineAudit: true,
- }),
- actions: {
- getSystemData() {
- const { statusBarHeight } = uni.getSystemInfoSync()
- const { height } = uni.getMenuButtonBoundingClientRect()
- this.statusBarHeight = Number(statusBarHeight)
- this.MenuButtonHeight = height
- },
- /**
- *
- * @param payBackIndexPath 支付成功页面返回首页按钮跳转路径
- *
- * @param paySuccessPath 支付成功页面查看订单按钮跳转路径
- */
- setPaySuccessPath(paySuccessPath: string, payBackIndexPath: string) {
- this.paySuccessPath = paySuccessPath
- this.payBackIndexPath = payBackIndexPath
- },
- async getAudit() {
- const res = await Apis.sys.dictPage({ data: { typeCode: 'sys_applet' } })
- this.isOnlineAudit = res.data?.list[0].value === '0'
- console.log(res.data?.list[0].value === '0')
- },
- },
- })
|