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",