Commit 25dc8fad authored by Mac's avatar Mac

1

parent d02570f7
......@@ -2,7 +2,8 @@
<div class="auth-page">
<u-popup v-model="showDialog" mode="center" :mask-close-able="false" custom-style="padding:0;background:none;">
<img :src="pageinfo.pic_url" mode="widthFix" />
<button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="showLogin==true?getUserInfo():''"></button>
<!-- <button :style="sureStyle" class="hotsopt" open-type="getUserInfo" @getuserinfo="showLogin==true?getUserInfo():''"></button> -->
<button :style="sureStyle" class="hotsopt" @tap="showLogin==true?getUserProfile():''"></button>
<button :style="cancelStyle" class="hotsopt" @click="close"></button>
</u-popup>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" @goLook="goLook" @closeBtn="closeBtn"></coupon>
......@@ -35,7 +36,23 @@
this.cancelStyle = `height:${y.height}rpx;width:${y.width}rpx;left:${y.left}rpx;top:${y.top}rpx;`;
},
methods: {
getUserInfo(e) {
getUserProfile(){
var that = this;
wx.getUserProfile({
desc: '用于完善资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: info => {
console.log(info.userInfo)
that.getUserInfo(info)
},
fail: () => {
uni.showToast({
title: '微信登录授权失败',
icon: 'none'
});
}
});
},
getUserInfo(info) {
var that = this;
that.showDialog = true;
uni.getProvider({
......@@ -45,29 +62,18 @@
uni.login({
provider: 'weixin',
success: res => {
that.authorization = res.code;
uni.getUserInfo({
provider: 'weixin',
success: info => {
//这里请求接口
let obj = {
Source: 1,
OpenId: '',
Name: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl,
Moblie: '',
SuperiorId: 0,
code: res.code
};
that.getCode(obj);
},
fail: () => {
uni.showToast({
title: '微信登录授权失败',
icon: 'none'
});
}
});
//这里请求接口
let obj = {
Source: 1,
OpenId: '',
Name: info.userInfo.nickName,
Photo: info.userInfo.avatarUrl,
Moblie: '',
SuperiorId: 0,
code: res.code
};
that.getCode(obj);
},
fail: () => {
uni.showToast({
......@@ -95,26 +101,21 @@
uni.showLoading({
title: '登录中'
});
uni.getUserInfo({
provider: 'weixin',
success: info => {
//这里请求接口
var OpenId = '';
that.request2({
url: '/api/mall/GetWeChatOpenId',
data: {
Code: obj.code
}
},
res => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
that.getLogin(obj);
}
}
);
//这里请求接口
var OpenId = '';
that.request2({
url: '/api/mall/GetWeChatOpenId',
data: {
Code: obj.code
}
},
res => {
if (res.resultCode == 1) {
obj.OpenId = res.data;
that.getLogin(obj);
}
}
});
);
},
//登录
getLogin(obj) {
......
......@@ -16,7 +16,7 @@
</view>
</view>
<view style="width: 1px;flex: 1;display: flex;align-items: flex-end;color: #FF4544;font-size: 12px;justify-content: flex-end;">
余额¥ <text style="font-size: 20px;">{{x.SurplusPrice}}99999</text>
余额¥ <text style="font-size: 20px;">{{x.SurplusPrice}}</text>
</view>
<view class="chosen">
<u-radio-group v-model="currentChosen">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment