From 59b1f0e9967902aa10f5e017d5a0bdfd1b60c9ea Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 29 四月 2026 09:42:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
small-program/store/index.js | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/small-program/store/index.js b/small-program/store/index.js
index 69f7da1..12b8d58 100644
--- a/small-program/store/index.js
+++ b/small-program/store/index.js
@@ -8,6 +8,8 @@
const userInfo = uni.getStorageSync('userInfo');
const token = uni.getStorageSync('token');
const openid = uni.getStorageSync('openid');
+const shopToken = uni.getStorageSync('shopToken');
+const shopInfo = uni.getStorageSync('shopInfo');
const store = new Vuex.Store({
@@ -17,9 +19,13 @@
userInfo: userInfo || {},
token: token || '',
openid: openid || '',
+ shopToken: shopToken || '',
+ shopInfo: shopInfo || '',
+ userType: 0, // 0:浼氬憳 1:闂ㄥ簵
latitude: '',
longitude: '',
+ cityId: '',
address:'瀹氫綅涓�'
},
mutations: {
@@ -30,13 +36,27 @@
uni.setStorageSync('navHeight', val.navHeight);
uni.setStorageSync('statusbarHeight', val.statusbarHeight);
},
- // 璁剧疆token
+ // 璁剧疆浼氬憳token
setToken(state, val) {
state.token = val
uni.setStorageSync('token', val);
},
- // 璁剧疆token
+ // 璁剧疆闂ㄥ簵token
+ setShopToken(state, shopToken) {
+ state.shopToken = shopToken
+ uni.setStorageSync('shopToken', shopToken);
+ },
+ setShopInfo(state, shopInfo) {
+ state.shopInfo = shopInfo
+ uni.setStorageSync('shopInfo', shopInfo);
+ },
+ // 璁剧疆褰撳墠鐢ㄦ埛绫诲瀷
+ setUserType(state, val) {
+ state.userType = val
+ },
+ // 璁剧疆openid
setOpenid(state, val) {
+ console.log('val', val)
state.openid = val
uni.setStorageSync('openid', val);
},
@@ -49,15 +69,21 @@
setPosition(state, obj) {
state.latitude = obj.latitude
state.longitude = obj.longitude
- state.address = obj.address
- console.log("鍦板潃璁剧疆瀹屾垚")
+ state.address = obj.address
+ state.cityId = obj.cityId
+ },
+ // 娓呴櫎鍩庡競id
+ clearCityId(state) {
+ state.cityId = ''
},
// 娓呴櫎缂撳瓨鏁版嵁
empty(state) {
state.userInfo = ''
state.token = ''
+ state.openid = ''
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
+ uni.removeStorageSync('openid');
}
},
--
Gitblit v1.9.3