| | |
| | | <template> |
| | | <view> |
| | | <view class="wrap"> |
| | | |
| | | <image src="@/static/logo.png" mode="widthFix" class="tip_img"></image> |
| | | <view class="login_tip"> |
| | | 为了提供更优质的服务,需要获取您的头像和昵称。 |
| | | </view> |
| | | <view class="login_btn"> |
| | | <!-- #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU --> |
| | | <button v-if="canIUseGetUserProfile" type="primary" class="uni-tip-button" @click="login">授权并登录</button> |
| | | <button v-else type="primary" open-type="getUserInfo" @getuserinfo="login" |
| | | <!-- <button v-if="canIUseGetUserProfile" type="primary" class="uni-tip-button" @click="login">授权并登录</button> --> |
| | | <button type="primary" open-type="getUserInfo" @getuserinfo="login" |
| | | class="uni-tip-button">授权并登录</button> |
| | | <view class="no_login" @click="back"> |
| | | 暂不授权 |
| | |
| | | <!-- #endif --> |
| | | <checkbox-group @change="changeAgree"> |
| | | <view class="regisiter-agreement"> |
| | | |
| | | <label> |
| | | <checkbox value="1" :checked="isChecked" color="#35A6FF" style="transform:scale(0.7)" /> |
| | | |
| | | 已阅读并同意以下协议 |
| | | <text class="color-base-text" @click.stop="openPopup(1)">《用户服务协议》</text>和 <text |
| | | class="color-base-text" @click.stop="openPopup(2)">《隐私政策》</text> |
| | |
| | | title: '加载中', |
| | | mask: true |
| | | }) |
| | | this.$api.sendRequest({ |
| | | url: '/api.php/user/info', |
| | | this.$api.temLogin({ |
| | | data: { |
| | | uid: uni.getStorageSync('authInfo').id |
| | | }, |
| | |
| | | uni.removeStorageSync('wx_openid_set'); |
| | | uni.removeStorageSync('source_member'); |
| | | uni.removeStorageSync('authInfo'); |
| | | this.$api.sendRequest({ |
| | | url: "/api.php/user/is_perfect", |
| | | this.$api.temLogin({ |
| | | data: { |
| | | uid: res.data.id, |
| | | }, |
| | |
| | | if (this.isSub) return; |
| | | this.isSub = true; |
| | | |
| | | this.$api.sendRequest({ |
| | | url: '/api.php/login/binding_mobile', |
| | | this.$api.temLogin({ |
| | | data, |
| | | success: res => { |
| | | if (res.code == 1) { |
| | |
| | | uni.removeStorageSync('wx_openid_set'); |
| | | uni.removeStorageSync('source_member'); |
| | | uni.removeStorageSync('authInfo'); |
| | | this.$api.sendRequest({ |
| | | url: "/api.php/user/is_perfect", |
| | | this.$api.temLogin({ |
| | | data: { |
| | | uid: res.data.id, |
| | | }, |
| | |
| | | avatar: userInfo.avatarUrl, |
| | | |
| | | } |
| | | if (uni.getStorageSync('source_member')) { |
| | | data.source_member = uni.getStorageSync('source_member') |
| | | } |
| | | if (res.code) { |
| | | this.$api.sendRequest({ |
| | | url: '/api.php/login/wx_login', |
| | | data, |
| | | success: res => { |
| | | if (res.code >= 0) { |
| | | // if (res.data.openid) this.authInfo.weapp_openid = res.data.openid; |
| | | // if (res.data.unionid) this.authInfo.wx_unionid = res.data.unionid; |
| | | typeof callback == 'function' && callback(res); |
| | | } else { |
| | | this.$util.showToast({ |
| | | title: '小程序配置错误' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | // if (uni.getStorageSync('source_member')) { |
| | | // data.source_member = uni.getStorageSync('source_member') |
| | | // } |
| | | // if (res.code) { |
| | | // this.$api.temLogin(data) |
| | | // } |
| | | }, |
| | | fail: () => { |
| | | this.$util.showToast({ |
| | |
| | | }, |
| | | login(e) { |
| | | if (!this.isChecked) { |
| | | return this.$util.showToast({ |
| | | return this.$common.showToast({ |
| | | title: "请先同意协议" |
| | | }) |
| | | } |
| | |
| | | uni.removeStorageSync( |
| | | 'source_member'); |
| | | uni.removeStorageSync('authInfo'); |
| | | this.$api.sendRequest({ |
| | | url: "/api.php/user/is_perfect", |
| | | this.$api.temLogin({ |
| | | data: { |
| | | uid: data.data.id, |
| | | }, |
| | |
| | | uni.removeStorageSync('wx_openid_set'); |
| | | uni.removeStorageSync('source_member'); |
| | | uni.removeStorageSync('authInfo'); |
| | | this.$api.sendRequest({ |
| | | url: "/api.php/user/is_perfect", |
| | | this.$api.temLogin({ |
| | | data: { |
| | | uid: data.data.id, |
| | | }, |