|
|
|
@ -34,16 +34,13 @@ |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<view class="cellphone"> |
|
|
|
<!-- <view class="cellphone"> |
|
|
|
<view class="cellphone-box"> |
|
|
|
<view class="cellphone-minBox" v-if="cellphone == 2" @click="apple()"> <image src="../../static/img/AppleD.png" mode=""></image></view> |
|
|
|
<!-- v-if="cellphone == 2" --> |
|
|
|
<view class="cellphone-minBox" @click="facebook()"><image src="../../static/img/FacebookD.png" mode=""></image></view> |
|
|
|
<view class="cellphone-minBox" v-if="cellphone == 1" @click="google()"> <image src="../../static/img/GoogleD.png" mode=""></image></view> |
|
|
|
<!-- v-if="cellphone == 1" --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
<view class="login" v-show="current==1"> |
|
|
|
<input type="text" class="login_input" placeholder="name" @input="verificationReg" |
|
|
|
@ -68,15 +65,13 @@ |
|
|
|
</text> and <text class="text" @click="gotonewpage(2)"> privacy policy</text>. |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="cellphone" style="padding-top: 15px;"> |
|
|
|
<!-- <view class="cellphone" style="padding-top: 15px;"> |
|
|
|
<view class="cellphone-box"> |
|
|
|
<view class="cellphone-minBox" v-if="cellphone == 2" @click="apple()"> <image src="../../static/img/AppleZ.png" mode=""></image></view> |
|
|
|
<!-- v-if="cellphone == 2" --> |
|
|
|
<view class="cellphone-minBox" @click="facebook()"><image src="../../static/img/facebookZ.png" mode=""></image></view> |
|
|
|
<view class="cellphone-minBox" v-if="cellphone == 1" @click="google()"> <image src="../../static/img/GoogleZ.png" mode=""></image></view> |
|
|
|
<!-- v-if="cellphone == 1" --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <view class="mode"> |
|
|
|
@ -298,8 +293,8 @@ |
|
|
|
ap_user_last_name: oauth.target.appleInfo.familyName, |
|
|
|
ap_user_email: oauth.target.appleInfo.email |
|
|
|
} |
|
|
|
uni.setStorageSync('user_info', {nickname: oauth.target.appleInfo.familyName}) |
|
|
|
uni.setStorageSync('user_info', {email: oauth.target.appleInfo.email}) |
|
|
|
// uni.setStorageSync('user_info', {nickname: oauth.target.appleInfo.familyName}) |
|
|
|
// uni.setStorageSync('user_info', {email: oauth.target.appleInfo.email}) |
|
|
|
defaultRequest(data).then(res => { |
|
|
|
console.info(res) |
|
|
|
if (res.error == 0) { |
|
|
|
@ -339,11 +334,17 @@ |
|
|
|
this.errMsg = res.message |
|
|
|
console.log(this.errMsg); |
|
|
|
} |
|
|
|
uni.showToast({ |
|
|
|
title:'Login is successful, please reopen the App to load information', |
|
|
|
icon:'none', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中' |
|
|
|
}); |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}); |
|
|
|
// uni.showToast({ |
|
|
|
// title:'Login is successful, please reopen the App to load information', |
|
|
|
// icon:'none', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
} |
|
|
|
}) |
|
|
|
// defaultRequest(data).then(res => { |
|
|
|
@ -448,59 +449,67 @@ |
|
|
|
fb_user_last_name: '', |
|
|
|
fb_user_email: info.userInfo.email |
|
|
|
} |
|
|
|
uni.setStorageSync('user_info', {nickname: info.userInfo.nickName}) |
|
|
|
uni.setStorageSync('user_info', {email: info.userInfo.email}) |
|
|
|
// uni.setStorageSync('user_info', {nickname: info.userInfo.nickName}) |
|
|
|
// uni.setStorageSync('user_info', {email: info.userInfo.email}) |
|
|
|
// uni.setStorageSync('user_info', 'info.userInfo'); |
|
|
|
defaultRequest(data).then(res => { |
|
|
|
console.info(res) |
|
|
|
if (res.error == 0) { |
|
|
|
this.loginErr = false |
|
|
|
res.data.isLogin = true |
|
|
|
uni.showLoading({ |
|
|
|
title: 'Logining', |
|
|
|
}) |
|
|
|
console.log(this.loginDate) |
|
|
|
defaultRequest1(this.loginDate).then(res => { |
|
|
|
app.globalData.error = res.error |
|
|
|
console.log('======================', res.error) |
|
|
|
|
|
|
|
if (res.error == 0) { |
|
|
|
this.loginErr = false |
|
|
|
res.data.isLogin = true |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
uni.hideLoading() |
|
|
|
uni.showToast({ |
|
|
|
title: 'Login successful', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
setTimeout(() => { |
|
|
|
uni.hideLoading() |
|
|
|
uni.showToast({ |
|
|
|
title: 'Login successful', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
let list = { |
|
|
|
email: res.data.email, |
|
|
|
cartlist: [] |
|
|
|
} |
|
|
|
let list2 = [] |
|
|
|
list2.push(list) |
|
|
|
uni.setStorageSync('cartlist', list2) |
|
|
|
uni.setStorageSync('isLogin', 1) |
|
|
|
uni.setStorageSync('user_info', res.data) |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
let list = { |
|
|
|
email: res.data.email, |
|
|
|
cartlist: [] |
|
|
|
} |
|
|
|
let list2 = [] |
|
|
|
list2.push(list) |
|
|
|
uni.setStorageSync('cartlist', list2) |
|
|
|
uni.setStorageSync('isLogin', 1) |
|
|
|
uni.setStorageSync('user_info', res.data) |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
// uni.switchTab({ |
|
|
|
// delta: 1 |
|
|
|
// url:'../index/index' |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
if (res.data) { |
|
|
|
this.$refs.alertDialog.open() |
|
|
|
this.query.username = this.loginDate.username |
|
|
|
// uni.switchTab({ |
|
|
|
// delta: 1 |
|
|
|
// url:'../index/index' |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
this.loginErr = true |
|
|
|
this.errMsg = res.message |
|
|
|
console.log(this.errMsg); |
|
|
|
if (res.data) { |
|
|
|
this.$refs.alertDialog.open() |
|
|
|
this.query.username = this.loginDate.username |
|
|
|
} else { |
|
|
|
this.loginErr = true |
|
|
|
this.errMsg = res.message |
|
|
|
console.log(this.errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中' |
|
|
|
}); |
|
|
|
}) |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}); |
|
|
|
// uni.showLoading({ |
|
|
|
// title: '脸书用户登录成功', |
|
|
|
// icon: 'none', |
|
|
|
// duration: 2000 |
|
|
|
// }) |
|
|
|
uni.showLoading({ |
|
|
|
title: '脸书用户登录成功', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
@ -547,8 +556,8 @@ |
|
|
|
gg_user_last_name: '', |
|
|
|
gg_user_email: googleOauth.authResult.email |
|
|
|
} |
|
|
|
uni.setStorageSync('user_info', {email: googleOauth.authResult.email}) |
|
|
|
uni.setStorageSync('user_info', {nickname: googleOauth.authResult.nickName}) |
|
|
|
// uni.setStorageSync('user_info', {email: googleOauth.authResult.email}) |
|
|
|
// uni.setStorageSync('user_info', {nickname: googleOauth.authResult.nickName}) |
|
|
|
// uni.setStorageSync('user_info.data.nickname', 'googleOauth.authResult.nickName'); |
|
|
|
defaultRequest(data).then(res => { |
|
|
|
console.info(res) |
|
|
|
|