From 54e75e7d9617fefe4a372e7d277f686117ebdbeb Mon Sep 17 00:00:00 2001 From: FightingN <18300240052@163.com> Date: Fri, 14 Feb 2020 15:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AC=A2=E8=BF=8E=E8=BF=9B=E5=85=A5=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8E=BB=E6=8E=89=E7=94=A8=E6=88=B7=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/formid/formid.js | 89 +++++++++++++++++++++------------------- pages/formid/formid.wxml | 3 +- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/pages/formid/formid.js b/pages/formid/formid.js index e8247c2..3c3523a 100644 --- a/pages/formid/formid.js +++ b/pages/formid/formid.js @@ -63,49 +63,52 @@ Page({ }) }, bindGetUserInfo: function (e) { - if (e.detail.userInfo) { - // let wxHeadImg = e.detail.userInfo.avatarUrl - // let wxNickName = e.detail.userInfo.nickName - console.log(e) - let that = this - wx.login({ - success: function (response) { - let code = response.code; - wx.getUserInfo({ - success: function (res) { - console.log(res.encryptedData) - console.log(res.iv) - let encryptedData = res.encryptedData - let iv = res.iv - api.updateWxInfo(code, encryptedData, iv).then(function (res) { - // 跳转到首页 - console.log('跳转到首页') - wx.setStorageSync('isFirst', 'noFirst') - wx.reLaunch({ - url: '/pages/index/index' - }) - }) - } - }) - } - }) + // if (e.detail.userInfo) { + // // let wxHeadImg = e.detail.userInfo.avatarUrl + // // let wxNickName = e.detail.userInfo.nickName + // console.log(e) + // let that = this + // wx.login({ + // success: function (response) { + // let code = response.code; + // wx.getUserInfo({ + // success: function (res) { + // console.log(res.encryptedData) + // console.log(res.iv) + // let encryptedData = res.encryptedData + // let iv = res.iv + // api.updateWxInfo(code, encryptedData, iv).then(function (res) { + // // 跳转到首页 + // console.log('跳转到首页') + // wx.setStorageSync('isFirst', 'noFirst') + // wx.reLaunch({ + // url: '/pages/index/index' + // }) + // }) + // } + // }) + // } + // }) - } else { - console.log('拒绝授权') - wx.redirectTo({ - url: '/pages/index/index' - }) - // wx.showModal({ - // title: '提示', - // content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!', - // showCancel: false, - // confirmText: '返回授权', - // success: function (res) { - // if (res.confirm) { - // console.log('用户点击了“返回授权”') - // } - // } - // }) - } + // } else { + // console.log('拒绝授权') + // wx.redirectTo({ + // url: '/pages/index/index' + // }) + // // wx.showModal({ + // // title: '提示', + // // content: '您点击了拒绝授权,将无法进入小程序,请授权之后再进入!', + // // showCancel: false, + // // confirmText: '返回授权', + // // success: function (res) { + // // if (res.confirm) { + // // console.log('用户点击了“返回授权”') + // // } + // // } + // // }) + // } + wx.reLaunch({ + url: '/pages/index/index' + }) } }) diff --git a/pages/formid/formid.wxml b/pages/formid/formid.wxml index 397dfcb..93f05f7 100644 --- a/pages/formid/formid.wxml +++ b/pages/formid/formid.wxml @@ -11,6 +11,7 @@   - + + \ No newline at end of file