diff --git a/App.vue b/App.vue index a412bfb..a1e7a22 100644 --- a/App.vue +++ b/App.vue @@ -74,6 +74,7 @@ if (res.data.code == 200) { uni.setStorageSync('userInfo', JSON.stringify(res.data.data)); uni.setStorageSync('phone', res.data.data.phone); + this.doLogin(res.data.data.username, res.data.data.phone); } else { uni.showToast({ title: res.data.msg, @@ -83,6 +84,38 @@ } }) }, + //登录 + doLogin(username, phone) { + uni.showLoading({ + title: '登录中', + mask: true + }); + uni.request({ + url: this.globalData.baseUrl + '/blade-auth/getToken', + method: 'POST', + data: { + openId: this.globalData.openId, + username: username, + phone: phone + }, + header: { + 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0' + }, + success: (res) => { + if (res.data.code == 200) { + uni.setStorageSync('token', res.data.data.access_token); + } else { + uni.showToast({ + title: res.data.msg, + icon: 'none' + }) + } + }, + complete: () => { + uni.hideLoading(); + } + }) + }, //微信登陆 wxLogin() { uni.login({ diff --git a/pages.json b/pages.json index 094db33..e7e1a72 100644 --- a/pages.json +++ b/pages.json @@ -126,6 +126,22 @@ } } } + }, + { + "path": "pages/pages_zhentou/contact/contact", + "style": { + "navigationBarTitleText": "售后服务", + "app-plus": { + "titleNView": { + // "buttons": [{ + // "text": "\ue534", + // "fontSrc": "/static/uni.ttf", + // "fontSize": "22px", + // "color": "#FFFFFF" + // }] + } + } + } } ], // "subPackages": [{ diff --git a/pages/pages_zhentou/contact/contact.vue b/pages/pages_zhentou/contact/contact.vue new file mode 100644 index 0000000..8573096 --- /dev/null +++ b/pages/pages_zhentou/contact/contact.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/pages/pages_zhentou/homePage/homePage.vue b/pages/pages_zhentou/homePage/homePage.vue index d5fa7b8..e357d60 100644 --- a/pages/pages_zhentou/homePage/homePage.vue +++ b/pages/pages_zhentou/homePage/homePage.vue @@ -1,7 +1,7 @@