From b7eb30ac13aa2696d754537881e9850e0948a8d1 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 15 Dec 2023 18:18:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/modules/parner.js | 5 + apis/modules/user.js | 3 - pages/login/login.vue | 88 ++-------- pages/person/person.vue | 283 +++++++++++++++++---------------- team/personAuth/personAuth.vue | 2 +- team/setting/setting.vue | 28 +--- 6 files changed, 179 insertions(+), 230 deletions(-) diff --git a/apis/modules/parner.js b/apis/modules/parner.js index c3a3f0b..21e03bb 100644 --- a/apis/modules/parner.js +++ b/apis/modules/parner.js @@ -39,4 +39,9 @@ export const editProvinceCity = data => { export const getPartnerTeamRates = data => { return post(`nakadai/nakadai/partner-team/getPartnerTeamRates`, data) +} + +// new +export const getTeamsByPlatformId = data => { + return get(`nakadai/kindergarten/platformTeamAccount/getTeamsByPlatformId`, data) } \ No newline at end of file diff --git a/apis/modules/user.js b/apis/modules/user.js index 02adbb8..fc588cb 100644 --- a/apis/modules/user.js +++ b/apis/modules/user.js @@ -10,9 +10,6 @@ export const kindergartenWeChatApplication = (data) => { export const realNameAuthentication = (data) => { return post(`users/users/autonym/realNameAuthentication`, data) } -export const faceAuthenticationByObject = (data) => { - return post(`users/users/autonym/faceAuthenticationByObject`, data) -} export const faceAuthentication = (data) => { return post(`users/users/autonym/faceAuthentication?imgFile=${data.imgFile}&side=${data.side}`) } diff --git a/pages/login/login.vue b/pages/login/login.vue index 65f6c62..a15453e 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -31,19 +31,19 @@ - + 我是幼儿园 - + 我是供应商 - + @@ -72,6 +72,7 @@ openid: '', unionid: '', code: '', + phone: '', submiting: false } }, @@ -112,38 +113,18 @@ }).then(({ data }) => { const { sessionKey, state } = data this.submiting = false - // 用户不存在,则让用户授权手机号,直接去注册 + // 用户不存在,则让用户授权手机号,直接让用户选择角色注册 if (state === 'bind') { this.code = code this.openid = sessionKey.openid + this.sessionKey = sessionKey.session_key this.isLogin = true this.isReg = true - // 这里需要再调一次uni的login,因为code用过了一次,已经失效了 - // uni.login({ - // success: ({ code }) => { - // getSessionKey({ - // code, - // }).then(({ sessionKey }) => { - // this.sessionKey = sessionKey.session_key - // this.openid = sessionKey.openid - // }).catch(e => {}) - // this.isReg = true - // } - // }) } else { const e = data.sessionKey - this.sessionKey = e.session_key - this.openid = e.openid - this.unionid = e.unionid - uni.setStorageSync('sessionKey', e.session_key) - uni.setStorageSync('openid', e.openid) - // 如果没有绑定手机号,则显示绑定按钮,引导用户绑定,否则,直接跳到首页 - if (data.state === 'login') { - this.toIndex() - uni.setStorageSync('token', data.token) - } else { - this.isLogin = true - } + uni.setStorageSync('token', data.token) + uni.setStorageSync('platformId', data.platformId) + this.toIndex() } }).catch(e => { this.submiting = false @@ -174,6 +155,7 @@ const data = pc.decryptData(encryptedData , iv) this.submiting = true const phone = data.phoneNumber + this.phone = phone if (this.isReg) { // 注册 this.$refs.popup.open('bottom') } else { // 登录绑定手机号 @@ -213,52 +195,16 @@ } }, // 注册申请授权 - async toReg() { - const res = await kindergartenWeChatApplication({ + async toReg(platformId) { + const { data } = await kindergartenWeChatApplication({ code: this.code, openId: this.openid, - platformId: 7 + platformId, + phone: this.phone }) - // this.isReg = true - // if (this.agree.length) { - // const that = this - // uni.getUserProfile({ - // lang: 'zh_CN', - // desc: '登录', - // success: ({ userInfo }) => { - // console.log(22, userInfo) - // uni.setStorageSync('userName', userInfo.nickName) - // uni.setStorageSync('avatar', userInfo.avatarUrl) - // uni.login({ - // success: ({ code }) => { - // if (code) { - // this.submiting = true - // getSessionKey({ - // code, - // }).then(({ sessionKey }) => { - // console.log(11, sessionKey) - // this.sessionKey = sessionKey.session_key - // this.openid = sessionKey.openid - // this.submiting = false - // this.isLogin = true - - // }).catch(e => { - // this.submiting = false - // }) - // } else { - // this.submiting = false - // that.$util.errMsg('登录失败!') - // } - // } - // }) - // }, - // fail(res) { - // that.$util.errMsg('登录授权失败!') - // } - // }) - // } else { - // this.$util.errMsg('请先阅读勾选协议!') - // } + uni.setStorageSync('token', data.token) + uni.setStorageSync('platformId', platformId) + this.toIndex() }, toAgreement(id) { this.$util.openFile(id) diff --git a/pages/person/person.vue b/pages/person/person.vue index 3faa47e..1a23aa2 100644 --- a/pages/person/person.vue +++ b/pages/person/person.vue @@ -2,13 +2,20 @@ + + + + + + + - {{ info.realName }} + {{ info.realName || userName }} 1369641301 @@ -49,14 +56,40 @@ - + + + - 我是供应商 - 供应商负责人 + 我是{{ platformName }} + {{ platformName }}负责人 未认证 - + + 立即开通 @@ -68,9 +101,9 @@
  • - 供应商认证 + {{ platformName }}认证
  • -
  • +
  • 商品管理
  • @@ -80,9 +113,9 @@
  • - 订单管理 + {{ isSupplier ? '订单管理' : '我的订单' }}
  • -
  • +
  • 活动管理
  • @@ -90,40 +123,27 @@ 信息维护 +
  • + + 我要采购 +
  • 对账管理
  • -
  • - - 商机线索 -
  • -
  • - - 发票管理 -
  • +
- - @@ -138,14 +158,15 @@