diff --git a/manifest.json b/manifest.json index 647b95a..ec7c5bc 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "惠农生活", "appid" : "__UNI__3A527D1", "description" : "", - "versionName" : "1.9.7", - "versionCode" : 197, + "versionName" : "1.9.8", + "versionCode" : 198, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/users/login/login_copy.vue b/pages/users/login/login_copy.vue index dd2b1d8..1c5aeaf 100644 --- a/pages/users/login/login_copy.vue +++ b/pages/users/login/login_copy.vue @@ -13,14 +13,16 @@ 微信一键登录 - - - 我已同意《用户协议》《隐私政策》 - +
+ + + 我已同意《用户协议》《隐私政策》 + +
-
+
@@ -96,7 +98,6 @@ class="font_pro">《隐私政策》
-
注册账号
@@ -166,9 +167,20 @@ + + +
+ 其他方式登录 + 微信快捷登录 +
+
+ + 首次登录 + 需要绑定手机号码 + = 13) { @@ -332,7 +353,7 @@ import { Toast } from "../../../libs/uniApi"; this.getVersion(); }, mounted: function() { - + }, onReady() { let that = this @@ -538,8 +559,9 @@ import { Toast } from "../../../libs/uniApi"; onlyAuthorize: true, success: function(loginRes) { console.log(loginRes); + uni.hideLoading() self.appUserInfo = loginRes; - self.wxLoginApi() + self.weixinLoginApi() }, fail(error) { console.log(error); @@ -563,11 +585,6 @@ import { Toast } from "../../../libs/uniApi"; commonAuth({ auth: { type: 'app_wechat', - // auth: { - // code: that.appUserInfo.authResult.access_token, - // openid: that.appUserInfo.authResult.openid, - // phone: this.account, - // } auth: { code: that.appUserInfo.authResult.access_token, openid: that.appUserInfo.authResult.openid, @@ -620,6 +637,62 @@ import { Toast } from "../../../libs/uniApi"; }); }); }, + weixinLoginApi() { + const that = this + commonAuth({ + auth: { + type: 'app_wechat', + auth: { + code: that.appUserInfo.code + } + } + }).then(res => { + console.log('--', res); + const data = res.data; + if (res.data.status == 200) { + const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; + that.$Cache.clear(BACK_URL); + that.$Cache.clear('login_back_url_weixin'); + that.$store.commit("LOGIN", { + 'token': data.result.token, + 'time': data.result.exp + }); + that.$store.commit("SETUID", data.result.user.uid); + that.$store.commit('UPDATE_USERINFO', data.result.user); + let method + let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', + '/pages/goods_cate/goods_cate', + '/pages/user/index', '/pages/plant_grass/index' + ] + if (indexPat.includes(this.getPath(backUrl))) { + method = 'switchTab' + } else { + method = 'navigateTo' + } + if (this.getPath(backUrl) === '/pages/users/login/index') { + uni.switchTab({ + url: '/pages/index/index' + }); + return + } + uni[method]({ + url: backUrl + }); + } else { + that.auth_token = res.data.result.key; + that.bindStatus = true; + } + uni.hideLoading(); + }).catch(res => { + console.log( '错误', res); + uni.hideLoading(); + uni.showToast({ + title: res.message || res, + icon: 'none', + duration: 2000 + }); + }); + }, getAgreement() { let that = this getAgreementApi('sys_user_agree').then(res => { @@ -773,7 +846,10 @@ import { Toast } from "../../../libs/uniApi"; method = 'navigateTo' } uni[method]({ - url: backUrl + url: backUrl, + success:()=>{ + this.auth_token = '' + } }); }) .catch(res => { @@ -979,6 +1055,15 @@ import { Toast } from "../../../libs/uniApi"; /deep/uni-checkbox .uni-checkbox-input { border-radius: 100%; } + + .ChangePassword{ + .title{ + width: 580rpx; + margin: 180rpx auto 0 auto; + font-size: 46rpx; + color: #7f7f7f; + } + } .ChangePassword .phone { font-size: 32rpx; @@ -1280,7 +1365,8 @@ import { Toast } from "../../../libs/uniApi"; .whiteBg { margin-top: 100rpx; - + transition: 300ms; + .list { border-radius: 16rpx; overflow: hidden;