From 9917390e9b4e848412e05d8ef87fe2abd3090785 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com>
Date: Sun, 12 Mar 2023 21:57:00 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=B8=88=E5=82=85=E6=B3=A8?=
=?UTF-8?q?=E5=86=8C=E7=99=BB=E5=BD=95=E3=80=81=E9=83=A8=E5=88=86=E5=9F=BA?=
=?UTF-8?q?=E7=A1=80=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 59 +++++++-
src/components/auth/login-box.vue | 74 ++++++++++
src/components/layout/layout.vue | 18 ++-
src/components/widgets/modal.vue | 10 +-
src/core/apis.js | 23 +++-
src/core/config.js | 4 +-
src/core/libs/request.js | 17 ---
src/core/{ => libs}/utils.js | 103 ++++++++++++--
src/core/models/user.js | 219 +++++++++++++++++++++++-------
src/core/request.js | 70 ++++++++++
src/core/storage.js | 17 +++
src/main.js | 8 +-
src/manifest.json | 69 +++++-----
src/pages.json | 6 +
src/pages/auth/auth.vue | 92 +++++++++++--
src/pages/auth/find-password.vue | 148 ++++++++++++++++++++
src/pages/member/member.vue | 108 ++++++++++-----
src/store/modules/system.js | 35 +----
src/store/modules/user.js | 49 ++++---
19 files changed, 910 insertions(+), 219 deletions(-)
create mode 100644 src/components/auth/login-box.vue
delete mode 100644 src/core/libs/request.js
rename src/core/{ => libs}/utils.js (66%)
create mode 100644 src/core/request.js
create mode 100644 src/core/storage.js
create mode 100644 src/pages/auth/find-password.vue
diff --git a/src/App.vue b/src/App.vue
index c0ff84c..ed0eb48 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,7 +1,25 @@
+
+
\ No newline at end of file
diff --git a/src/components/layout/layout.vue b/src/components/layout/layout.vue
index 92d1124..0a41cce 100644
--- a/src/components/layout/layout.vue
+++ b/src/components/layout/layout.vue
@@ -29,11 +29,14 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/member/member.vue b/src/pages/member/member.vue
index a084ed6..24960a4 100644
--- a/src/pages/member/member.vue
+++ b/src/pages/member/member.vue
@@ -6,30 +6,40 @@
-
-
-
-
-
- {{ userInfo.username }}
- {{
- models.worker.getWorkerTypeText(userInfo.type)
- }}
+
+
+
- ID:{{ userInfo.id }}
- 注册时间:{{ userInfo.registerAt }}
-
-
-
- {{ acceptOrderState ? "正在" : "暂停" }}接单
-
+
+
+ {{ userInfo.username }}
+ {{ models.worker.getWorkerTypeText(userInfo.workerType) }}
+
+ ID:{{ userInfo.id }}
+ 注册时间:{{ userInfo.createTime }}
+
+
+
+ {{ acceptOrderState ? "正在" : "暂停" }}接单
+
+
+
+
+ 立即登录
+ 需要登录后操作
+
+
-
+
服务:
@@ -58,7 +68,7 @@
-
+
我要提现
@@ -76,7 +86,7 @@
-
+
设置服务信息
@@ -84,11 +94,11 @@
我的评价
-
+
在线客服
-
+
设置
@@ -101,6 +111,7 @@
@@ -139,6 +163,20 @@ export default {
.member-container {
width: 100%;
}
+.login-tips {
+ width: 100%;
+ text-align: center;
+ color: #ffffff;
+ margin-bottom: 50rpx;
+ .title {
+ font-size: 40rpx;
+ font-weight: bold;
+ }
+ .desc {
+ margin-top: 20rpx;
+ font-size: 32rpx;
+ }
+}
.head {
width: 100%;
display: flex;
diff --git a/src/store/modules/system.js b/src/store/modules/system.js
index a7a6353..1c098f1 100644
--- a/src/store/modules/system.js
+++ b/src/store/modules/system.js
@@ -1,34 +1,7 @@
export default {
namespaced: true,
- state: {
- config: {},
- },
- getters: {
- config(state) {
- return state.config;
- },
- },
- mutations: {
- setConfig(state, data) {
- state.config = { ...state.config, ...data };
- },
- },
- actions: {
- initConfig(context) {
- let config = uni.getStorageSync('system_config');
- if (!config) {
- const { windowWidth, windowHeight, statusBarHeight, safeAreaInsets } = uni.getSystemInfoSync();
- // #ifndef H5
- const { height, top } = uni.getMenuButtonBoundingClientRect();
- const headerHeight = height + ((top - statusBarHeight) * 2);
- // #endif
- // #ifdef H5
- const headerHeight = 40; // 乘2再使用rpx2px转px使用
- // #endif
- config = { windowWidth, windowHeight, statusBarHeight, headerHeight, safeAreaInsets };
- uni.setStorageSync('system_config', config);
- }
- context.commit('setConfig', config);
- }
- }
+ state: {},
+ getters: {},
+ mutations: {},
+ actions: {}
}
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 9a9982f..53c7275 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,35 +1,50 @@
-import user from '@/core/models/user'
-
+import user from "@/core/models/user";
export default {
namespaced: true,
state: {
showLoginModal: false,
- userInfo: null,
+ openId: "",
+ token: "",
+ info: {
+ id: 0,
+ avatar: "",
+ nickname: "",
+ openid: "",
+ mobile: "",
+ createTime: 0,
+ finishInfo: false,
+ },
},
getters: {
- showLoginModal(state) {
- return state.showLoginModal;
- },
- userInfo(state) {
- return state.userInfo;
+ isLogin(state) {
+ return state.token.length > 0;
},
+ finishInfo(state) {
+ return state.info.finishInfo;
+ }
},
mutations: {
showLoginModal(state, data) {
state.showLoginModal = data;
},
- userInfo(state, data) {
- state.userInfo = data;
+ openId(state, data) {
+ state.openId = data;
+ },
+ token(state, data) {
+ state.token = data;
+ },
+ info(state, data) {
+ state.info = data;
}
},
actions: {
- logout(context) {
- context.commit('userInfo', null);
- },
- userInfo(context) {
- user.getInfo().then(info => {
- context.commit('userInfo', info);
+ info(context) {
+ user.info().then(info => {
+ context.commit('info', info);
});
- }
+ },
+ logout(context) {
+ context.commit('info', null);
+ },
}
}