diff --git a/package.json b/package.json
index 858a73e..067020f 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
"pinia": "2.0.36",
+ "pinia-plugin-persistedstate": "^3.2.1",
"uview-plus": "^3.1.38",
"vue": "3.2.47",
"vue-i18n": "^9.1.9",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index eeb13e8..d7f57da 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -14,9 +14,6 @@ dependencies:
'@dcloudio/uni-components':
specifier: 3.0.0-3090920231225001
version: 3.0.0-3090920231225001(postcss@8.4.32)(vue@3.2.47)
- '@dcloudio/uni-h5':
- specifier: 3.0.0-3090920231225001
- version: 3.0.0-3090920231225001(postcss@8.4.32)(vue@3.2.47)
'@dcloudio/uni-mp-weixin':
specifier: 3.0.0-3090920231225001
version: 3.0.0-3090920231225001(postcss@8.4.32)(vue@3.2.47)
@@ -26,6 +23,9 @@ dependencies:
pinia:
specifier: 2.0.36
version: 2.0.36(typescript@5.3.2)(vue@3.2.47)
+ pinia-plugin-persistedstate:
+ specifier: ^3.2.1
+ version: 3.2.1(pinia@2.0.36)
uview-plus:
specifier: ^3.1.38
version: 3.1.41
@@ -12161,6 +12161,14 @@ packages:
engines: {node: '>=6'}
dev: true
+ /pinia-plugin-persistedstate@3.2.1(pinia@2.0.36):
+ resolution: {integrity: sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==}
+ peerDependencies:
+ pinia: ^2.0.0
+ dependencies:
+ pinia: 2.0.36(typescript@5.3.2)(vue@3.2.47)
+ dev: false
+
/pinia@2.0.36(typescript@5.3.2)(vue@3.2.47):
resolution: {integrity: sha512-4UKApwjlmJH+VuHKgA+zQMddcCb3ezYnyewQ9NVrsDqZ/j9dMv5+rh+1r48whKNdpFkZAWVxhBp5ewYaYX9JcQ==}
peerDependencies:
diff --git a/src/api/user/types.ts b/src/api/user/types.ts
index 1771c49..5f9b590 100644
--- a/src/api/user/types.ts
+++ b/src/api/user/types.ts
@@ -1,3 +1,5 @@
+import { UserState } from '@/store/modules/user/types';
+
export interface LoginParams {
// phone: string;
code: string;
@@ -10,8 +12,9 @@ export interface LoginByCodeParams {
}
export interface LoginResult {
+
+ sessionKey: string;
+ user: UserState;
+ userInfo: any;
token: string;
- user_id: number;
- user_name: string;
- avatar: string;
}
diff --git a/src/manifest.json b/src/manifest.json
index 106b349..3e1ab37 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -21,8 +21,8 @@
},
"mp-weixin":
{
-// "appid": "wx92e663dc11d0c0a8",
- "appid": "wx67a750d0ceed4d88",
+ "appid": "wx92e663dc11d0c0a8",
+// "appid": "wx67a750d0ceed4d88",
"setting":
{
"urlCheck": false
diff --git a/src/pages.json b/src/pages.json
index 6b58779..0b9af70 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -42,6 +42,12 @@
"path": "login/index",
"navigationStyle": "custom"
},
+ {
+ "path": "register/index",
+ "style": {
+ "navigationBarTitleText": "注册有礼"
+ }
+ },
{
"path": "webview/index",
"navigationBarTitleText": "网页"
diff --git a/src/pages/common/login/index.vue b/src/pages/common/login/index.vue
index 12b40a9..758b79b 100644
--- a/src/pages/common/login/index.vue
+++ b/src/pages/common/login/index.vue
@@ -92,7 +92,11 @@ function getCode() {
}
function wechatLogin() {
- userStore.authLogin();
+ uni.showLoading();
+ userStore.authLogin().then(() => {
+ uni.hideLoading();
+ uni.reLaunch({ url: '/pages/home/index' });
+ });
}
function submit() {
diff --git a/src/pages/common/register/index.vue b/src/pages/common/register/index.vue
new file mode 100644
index 0000000..592da01
--- /dev/null
+++ b/src/pages/common/register/index.vue
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ countdown }}
+
+
+ 注册领券
+
+
+
+
+
+
+
diff --git a/src/pages/home/index.vue b/src/pages/home/index.vue
index 62a5fb0..bb90f83 100644
--- a/src/pages/home/index.vue
+++ b/src/pages/home/index.vue
@@ -15,15 +15,15 @@
-
- 设计小仙女
+
+ {{ userInfo?.nickName }}
- 1000
+ {{ userInfo?.integration }}
积分
- 998.00
+ {{ userInfo?.balance }}
余额(元)
@@ -67,9 +67,10 @@ import { getCompanyInfo } from '@/api/company';
import { useUserStore } from '@/store';
import { assetsUrl } from '@/utils/assets';
import { goPath } from '@/utils';
+import { storeToRefs } from 'pinia';
const store = useUserStore();
-
+const { userInfo } = storeToRefs(store);
const bannerList = ref([]);
const currentBannerIndex = ref(0);
const recommendBannerList = ref([]);
@@ -78,7 +79,7 @@ const submenuList = [
{
title: '注册有礼',
icon: assetsUrl('ic_register_gift.png'),
- path: '/pages/order/order'
+ path: '/pages/common/register/index'
},
{
title: '团购秒杀',
@@ -102,8 +103,6 @@ onLoad(async (e) => {
const swiperChange = (e: any) => {
currentBannerIndex.value = e.detail.current;
};
-
-console.log('store.user_name', store.user_name);