xuxueyang
2024-10-20 f4fd489475500b0d41dde019963307d217321d50
store/index.js
@@ -32,8 +32,15 @@
         'delivery': 0,
         'order': 0,
         'shopnum': 0,
         'coupon': 0,
         'cache_topay':0,
      },
      defaultaddress: {}
      cache: {
         coupon: {},
         goods:[],
      },
      defaultaddress: {},
      addressDesc:'',
   },
   mutations: {
@@ -55,13 +62,19 @@
         state.currentInfo = {}
         storage.removeItem('token')
         message.showToast('退出登录成功')
      },
      setOpenid(state, openid) {
         state.openid = openid
      },
      setDefaultAddress(state, defaultaddress) {
         state.defaultaddress = defaultaddress
      },
      setAddressDesc(state, addressDesc) {
         console.log('setAddressDesc',addressDesc)
         state.addressDesc = addressDesc
         storage.setItem("defaultaddress",addressDesc || "")
      },
      setTestTrue(state) {
         state.testvuex = true
@@ -119,6 +132,19 @@
         console.log('sign_clear', key)
         state.sign[key] = 0
      },
      cache_coupon_select: async function({
         commit,
         state
      }, dto) {
         state.cache['coupon'] = dto || {}
      },
      cache_goods_select: async function({
         commit,
         state
      }, goods) {
         state.cache['goods'] = goods || []
      },
      // lazy loading openid
      logout: async function({
         commit,
@@ -352,7 +378,7 @@
                  console.log("启用结果2:", ret);
               });
               // #endif
               uni.reLaunch({
                  url: '/pages/home/supplier-home'
               })