diff --git a/components/wechat-auth/wechat-auth.vue b/components/wechat-auth/wechat-auth.vue
new file mode 100644
index 0000000..0b077aa
--- /dev/null
+++ b/components/wechat-auth/wechat-auth.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+ 为了更好的提供服务请授权您的微信昵称
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/packageBuy/pages/shopDetail/shopDetail.vue b/packages/packageBuy/pages/shopDetail/shopDetail.vue
index 46a0ce8..75eaa5f 100644
--- a/packages/packageBuy/pages/shopDetail/shopDetail.vue
+++ b/packages/packageBuy/pages/shopDetail/shopDetail.vue
@@ -138,7 +138,7 @@
{{arrRegion[rindex]}}
-
@@ -194,6 +194,21 @@
+ 跳过>>
+
+
+
+
+
+
+ 为了更好的提供服务请授权您的微信昵称
+
+
+
+
+
@@ -216,6 +231,7 @@
})
return {
id: "",
+ showPass: false,
info: {},
dataList: [],
form: {
@@ -256,6 +272,7 @@
poster: "",
showUser: false,
showPhone: false,
+
}
},
onShareAppMessage() {
@@ -267,20 +284,26 @@
}
},
onShow() {
+
var that = this;
weixin.getOpenidInfo(info => {
-
that.user_info = info.user_info;
that.openid = that.user_info.openid;
that.form.member_name = that.user_info.name || that.user_info.wechat_nickname;
that.form.phone = that.user_info.phone;
- }, true);
+ if (weixin.isNull(info.user_info.wechat_nickname) || weixin.isNull(info.user_info.avatar)) {
+ that.showUser = true;
+ } else {
+ that.form.member_name = info.user_info.wechat_nickname;
+ }
+
+ that.loadInfo();
+ that.loadPage();
+ }, true);
- this.loadInfo();
- this.loadPage();
},
onLoad(options) {
var that = this;
@@ -307,6 +330,45 @@
},
methods: {
+ toPassGetPhone() {
+ this.showPhone = false;
+ this.showPop = true;
+ },
+ touserInfoClose() {
+ this.showUser = false;
+ },
+ getUserProfile() {
+ var that = this;
+ weixin.getUserProfile((res) => {
+ console.log(res)
+ weixin.request({
+ api: '/api/member/update-wechat-info',
+ method: 'POST',
+ data: {
+ nickname: res.nickName,
+ avatar: res.avatarUrl
+ },
+ utilSuccess: function(r) {
+ console.log(r)
+ if (r.status == 1) {
+ weixin.getOpenidInfo(openidInfo => {
+ that.user_info.wechat_nickname = openidInfo.user_info
+ .wechat_nickname;
+ that.user_info.avatar = openidInfo.user_info.avatar;
+ }, true)
+ that.showUser = false;
+ } else {
+ uni.showToast({
+ title: r.data.msg,
+ duration: 2000,
+ icon: 'none'
+ })
+ }
+ }
+
+ })
+ })
+ },
getPhoneNumber(e) {
let that = this;
if (e.detail.iv) {
@@ -324,6 +386,7 @@
},
success: (r) => {
if (r.data.status == 1) {
+ that.showPass = false;
weixin.getOpenidInfo(openidInfo => {
uni.setStorageSync("userInfo", openidInfo)
that.form.phone = openidInfo.user_info.phone;
@@ -334,9 +397,10 @@
duration: 2000,
icon: 'none'
})
- }
-
- that.showPhone = false;
+ that.showPass = true;
+ }
+
+ that.showPhone = false;
that.showPop = true;
}
})
@@ -758,6 +822,12 @@
border: none
}
+ .userBoxBottomPass {
+ font-size: 28rpx;
+ text-align: center;
+ padding: 20rpx 0rpx;
+ }
+
.payBtn {
width: 90%;
height: 100rpx;