|
|
@@ -3,7 +3,7 @@
|
|
|
<view class="content" :style="userinfo.is_authentication == 1 ? 'padding-top:30rpx;' : ''">
|
|
|
<!-- 用户信息 -->
|
|
|
<view class="uerInfo mar_t16 flex_r">
|
|
|
- <view class="user_img" @click="login">
|
|
|
+ <view class="user_img" @click="updateUserInfo">
|
|
|
<image class="image" :src="
|
|
|
userinfo && userinfo.head_pic != ''
|
|
|
? userinfo.head_pic
|
|
|
@@ -18,7 +18,7 @@
|
|
|
</view>
|
|
|
<block v-if="userinfo && userinfo != ''">
|
|
|
<view class="user_con flex_c">
|
|
|
- <view class="user_name flex_r flex_ae ellipsis" @click="login">{{ userinfo.nickname
|
|
|
+ <view class="user_name flex_r flex_ae ellipsis" @click="updateUserInfo">{{ userinfo.nickname
|
|
|
}}<text>({{
|
|
|
userinfo.is_authentication == 0 ? "未实名" : "已实名"
|
|
|
}})</text></view>
|
|
|
@@ -244,7 +244,7 @@
|
|
|
<!-- 功能列表-end -->
|
|
|
|
|
|
<!-- 授权 -->
|
|
|
- <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess">
|
|
|
+ <authorize-module v-if="showAuth" :shopInfo="shopInfo" :isGetUserInfo='isGetUserInfo' @authGetTelSuccess="onauthGetTelSuccess" @authSuccess="autoGetUserInfo">
|
|
|
</authorize-module>
|
|
|
<!-- 授权-end -->
|
|
|
<!-- <newauthorize ref="newauthorize" /> -->
|
|
|
@@ -282,6 +282,8 @@
|
|
|
userinfo: undefined, // 获取用户信息
|
|
|
|
|
|
unid: "",
|
|
|
+
|
|
|
+ isGetUserInfo:false,
|
|
|
};
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
@@ -351,31 +353,38 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- login() {
|
|
|
- uni.getUserProfile({
|
|
|
- desc: '登录',
|
|
|
- success: (response) => {
|
|
|
- console.log('response', response)
|
|
|
- try {
|
|
|
- uni.showLoading({
|
|
|
- title: '登录中...'
|
|
|
- });
|
|
|
- //请求后台,成功并隐藏加载
|
|
|
- uni.hideLoading({})
|
|
|
- } catch (e) {
|
|
|
- uni.showToast({
|
|
|
- title: "微信登录失败",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- fail: (res) => {
|
|
|
- uni.showToast({
|
|
|
- title: "您已取消授权",
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ autoGetUserInfo(res){
|
|
|
+ this.showAuth = false;
|
|
|
+ this.isGetUserInfo = false
|
|
|
+ console.log(res,"获取到的用户信息")
|
|
|
+ },
|
|
|
+ updateUserInfo() {
|
|
|
+ // uni.getUserProfile({
|
|
|
+ // desc: '登录',
|
|
|
+ // success: (response) => {
|
|
|
+ // console.log('response', response)
|
|
|
+ // try {
|
|
|
+ // uni.showLoading({
|
|
|
+ // title: '登录中...'
|
|
|
+ // });
|
|
|
+ // //请求后台,成功并隐藏加载
|
|
|
+ // uni.hideLoading({})
|
|
|
+ // } catch (e) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "微信登录失败",
|
|
|
+ // icon: "none"
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // fail: (res) => {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "您已取消授权",
|
|
|
+ // icon: "none"
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });\
|
|
|
+ this.isGetUserInfo = true;
|
|
|
+ this.showAuth = true
|
|
|
},
|
|
|
getuserInfo() {
|
|
|
post("/user/userinfo").then((res) => {
|