|
@@ -61,13 +61,20 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="text-center padding-lr padding-top">
|
|
<div class="text-center padding-lr padding-top">
|
|
- <button
|
|
|
|
|
|
+ <!-- <button
|
|
class="cu-btn lg cu-btn-primary text-white text-center"
|
|
class="cu-btn lg cu-btn-primary text-white text-center"
|
|
open-type="getUserInfo"
|
|
open-type="getUserInfo"
|
|
@getuserinfo="get_Userinfo"
|
|
@getuserinfo="get_Userinfo"
|
|
:disabled="btn_disabled"
|
|
:disabled="btn_disabled"
|
|
>
|
|
>
|
|
{{ title }}
|
|
{{ title }}
|
|
|
|
+ </button> -->
|
|
|
|
+ <button
|
|
|
|
+ class="cu-btn lg cu-btn-primary text-white text-center"
|
|
|
|
+ @click='get_user_info'
|
|
|
|
+ :disabled="btn_disabled"
|
|
|
|
+ >
|
|
|
|
+ {{ title }}
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<view class="text-center text-xs protocol_text">
|
|
<view class="text-center text-xs protocol_text">
|
|
@@ -422,14 +429,30 @@ export default {
|
|
$this.time_start = $this.time_show = false;
|
|
$this.time_start = $this.time_show = false;
|
|
},
|
|
},
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- get_Userinfo(e) {
|
|
|
|
- console.log(e);
|
|
|
|
- if (e.mp.detail.errMsg == "getUserInfo:fail auth deny") {
|
|
|
|
- Toast.fail("请进行授权登录");
|
|
|
|
- } else {
|
|
|
|
- $this._userinfo = e.mp.detail.userInfo;
|
|
|
|
- $this.wechat_login();
|
|
|
|
- }
|
|
|
|
|
|
+ // get_Userinfo(e) {
|
|
|
|
+ // console.log("获取到的用户信息为:", e);
|
|
|
|
+ // if (e.mp.detail.errMsg == "getUserInfo:fail auth deny") {
|
|
|
|
+ // Toast.fail("请进行授权登录");
|
|
|
|
+ // } else {
|
|
|
|
+ // $this._userinfo = e.mp.detail.userInfo;
|
|
|
|
+ // $this.wechat_login();
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ get_user_info() {
|
|
|
|
+ wx.getUserProfile({
|
|
|
|
+ desc: "获取你的昵称、头像、地区及性别",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ let wxUserInfo = res.userInfo;
|
|
|
|
+ $this._userinfo = wxUserInfo;
|
|
|
|
+ $this.wechat_login();
|
|
|
|
+ console.log("我能获取到用户的信息吗??", $this._userinfo);
|
|
|
|
+ },
|
|
|
|
+ fail: (res) => {
|
|
|
|
+ //拒绝授权
|
|
|
|
+ Toast.fail("请进行授权登录");
|
|
|
|
+ return;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|