12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import { defineStore } from 'pinia';
- const modal = defineStore({
- id: 'modal',
- state: () => ({
- auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername
- isActive: '',
- share: false, // 分享弹框
- shareInfo: {
- spuId: 0,
- }, // 分享弹框信息
- signUp: false, // 签到弹框
- signUpInfo: {}, // 签到弹框信息
- subscribe: false, // 关注弹框
- getWallet: false, // 获得佣金/身价弹窗
- getWalletInfo: {
- points: 0,
- socialStatus: 0,
- }, // 获得佣金/身价弹窗信息
- menu: false, // 快捷菜单弹框
- advHistory: [], // 广告弹框记录
- payPassword: { // 支付密码弹框
- show: false,
- type: '', // 'input', 'change', 'set'
- title: '',
- callback: null,
- onCancel: null,
- step: 0,
- oldPassword: '',
- newPassword: ''
- },
- lastTimer: {
- // 短信验证码计时器,为了防止刷新请求做了持久化
- smsLogin: 0,
- // changeMobile: 0,
- changeMobileOld: 0,
- changeMobileNew: 0,
- resetPassword: 0,
- changePassword: 0,
- consumptionTransfers: 0,
- zeroBuy: 0,
- },
- }),
- persist: {
- enabled: true,
- strategies: [
- {
- key: 'modal-store',
- paths: ['lastTimer', 'advHistory'],
- },
- ],
- },
- });
- export default modal;
|