From f39c51e8062a91eb7a7513e854a922080b86ea52 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 9 May 2024 09:17:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=B9=E5=8F=91?= =?UTF-8?q?=E5=95=86=E6=A3=80=E9=AA=8C=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/app.js | 2 +- pages.json | 8 ++++++++ pages/code/code.vue | 31 +++++++++++++++++++++++++++++++ pages/login/login.vue | 29 +++++++++++++++++++++++++++-- store/user.js | 2 +- 5 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 pages/code/code.vue diff --git a/config/app.js b/config/app.js index 5040607..bb61008 100644 --- a/config/app.js +++ b/config/app.js @@ -8,7 +8,7 @@ let env = "prod" switch(env){ case 'prod': BASE_URL = 'https://erp.lihaink.cn';break; case 'test': BASE_URL = 'https://ceshi-erp.lihaink.cn';break; - default: BASE_URL = 'http://192.168.1.15:8546'; + default: BASE_URL = 'http://192.168.1.10:8546'; } let HTTP_REQUEST_URL diff --git a/pages.json b/pages.json index 41adc30..6cdb8e9 100644 --- a/pages.json +++ b/pages.json @@ -45,6 +45,14 @@ "enablePullDownRefresh": false, "navigationStyle": "custom" } + }, + { + "path" : "pages/code/code", + "style" : + { + "navigationBarTitleText" : "", + "enablePullDownRefresh" : false + } } ], diff --git a/pages/code/code.vue b/pages/code/code.vue new file mode 100644 index 0000000..ae833a3 --- /dev/null +++ b/pages/code/code.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/pages/login/login.vue b/pages/login/login.vue index 5816357..223258b 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -15,6 +15,10 @@ 微信快捷登录 + 使用短信验证登录 @@ -61,6 +65,7 @@ + @@ -70,6 +75,7 @@ import { userLoginApi, userLoginWeixinApi, getMobileByMnpApi } from "@/api/user.js"; import useUserStore from "@/store/user.js" import bindPhone from "@/components/bindPhone.vue" + import modal from "@/components/modal.vue" @@ -77,7 +83,26 @@ if (!userStore.userInfo.supplier) uni.reLaunch({ url: '/pages/index/index' }) - else uni.$u.toast('功能开发中') + else if(!userStore.userInfo.supplier.openid) { + return showOfficial.value = true; + } + else{ + uni.reLaunch({ + url: '/pageQuota/quotation/detail' + }) + } + } + + // 微信公众号绑定 + const officialCode = ()=>{ + uni.navigateTo({ + url: '/pages/code/code', + success: () => { + let user = userStore.userInfo; + user.supplier ? user.supplier.openid = 1 : user.supplier = {}; + userStore.setUserInfo(user); + } + }) } const userStore = useUserStore(); //使用pinia进行状态管理 @@ -118,9 +143,9 @@ }) } + const showOfficial = ref(false); const showBind = ref(false); //是否显示绑定手机号弹窗 const getPhoneNumber = (e) => { - console.log("===", e); if (e.detail?.errMsg == 'getPhoneNumber:ok') { getMobileByMnpApi({ code: e.detail.code diff --git a/store/user.js b/store/user.js index 0c11590..6cb5e27 100644 --- a/store/user.js +++ b/store/user.js @@ -24,7 +24,7 @@ const useUserStore = defineStore("user", () => { } // #ifdef H5 - token.value = "1df48a21913ef4eba488983e7b84c056" + // token.value = "6f85cbaee3341c3f2d7bb7080663ce68" // token.value = "95b24dd6d2dda836fe07854b08ba0944" userInfo.value = { avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png", From 438f2bc07cf2bbf3cd43e043449dcfc3e1dd9cb1 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 9 May 2024 09:35:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/login/login.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/login/login.vue b/pages/login/login.vue index 0ca5046..2d8740f 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -65,7 +65,7 @@ - + @@ -88,7 +88,7 @@ } else{ uni.reLaunch({ - url: '/pageQuota/quotation/detail' + url: '/pageQuota/quotation/index' }) } } @@ -96,7 +96,7 @@ // 微信公众号绑定 const officialCode = ()=>{ uni.navigateTo({ - url: '/pages/code/code', + url: `/pages/code/code?id=${userStore.userInfo.id}`, success: () => { let user = userStore.userInfo; user.supplier ? user.supplier.openid = 1 : user.supplier = {};