|
|
|
@ -34,13 +34,12 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
bindGetUserInfo: function (e) { |
|
|
|
|
|
|
|
|
|
let { |
|
|
|
|
agree |
|
|
|
|
} = this.data; |
|
|
|
|
if (agree === false) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '请勾选隐私政策', |
|
|
|
|
title: '请勾选免责声明', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
@ -50,20 +49,16 @@ Page({
|
|
|
|
|
let att = false; |
|
|
|
|
wx.login({ |
|
|
|
|
success: (eve) => { |
|
|
|
|
console.log(eve) |
|
|
|
|
att = eve; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
wx.getUserProfile({ |
|
|
|
|
desc: '用户展示用户信息', |
|
|
|
|
success: (resT) => { |
|
|
|
|
console.log(resT) |
|
|
|
|
this.setData({ |
|
|
|
|
user: resT.userInfo, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
$api.Login('POST', 'social/token?' + 'code=MINI@' + att.code).then(res => { |
|
|
|
|
|
|
|
|
|
if (res.code == 2) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '请先注册账号', |
|
|
|
@ -82,16 +77,12 @@ Page({
|
|
|
|
|
mask: true, |
|
|
|
|
duration: 1500, |
|
|
|
|
}) |
|
|
|
|
console.log(res.access_token) |
|
|
|
|
wx.setStorageSync( |
|
|
|
|
'access_token', res.access_token |
|
|
|
|
) |
|
|
|
|
wx.switchTab({ |
|
|
|
|
url: '/pages/look/look' |
|
|
|
|
}) |
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
|
|
// }, 1500)
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -108,7 +99,6 @@ Page({
|
|
|
|
|
}, |
|
|
|
|
// 一键注册 获取手机号
|
|
|
|
|
getphonenumberFun(e) { |
|
|
|
|
console.log(e); |
|
|
|
|
let { |
|
|
|
|
agree, |
|
|
|
|
user, |
|
|
|
@ -116,14 +106,12 @@ Page({
|
|
|
|
|
} = this.data; |
|
|
|
|
if (agree === false) { |
|
|
|
|
wx.showToast({ |
|
|
|
|
title: '请勾选隐私政策', |
|
|
|
|
title: '请勾选免责声明', |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000 |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(e) |
|
|
|
|
console.log(user) |
|
|
|
|
|
|
|
|
|
$api.AJAX('POST', 'social/register-bind', { |
|
|
|
|
state: 'MINI', |
|
|
|
@ -152,10 +140,6 @@ Page({
|
|
|
|
|
wx.switchTab({ |
|
|
|
|
url: '/pages/look/look' |
|
|
|
|
}) |
|
|
|
|
// console.log(res);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
|
|
|
|
// }, 1500)
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
@ -174,10 +158,9 @@ Page({
|
|
|
|
|
*/ |
|
|
|
|
onShow: function () { |
|
|
|
|
let token = wx.getStorageSync('access_token') |
|
|
|
|
console.log(token) |
|
|
|
|
if (token && token != '') { |
|
|
|
|
wx.switchTab({ |
|
|
|
|
url: "/pages/look/look", |
|
|
|
|
url: "/pages/calendar/calendar", |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|