master
lion 6 days ago
parent b526869201
commit 89569d01c4

@ -22,19 +22,38 @@
export default {
data() {
return {
openidReady: false
}
},
onShareAppMessage() {},
onLoad() {
//this.login();
var that = this;
util.getOpenidInfo(function() {
that.openidReady = true;
}, true);
},
onReady() {},
onHide() {},
methods: {
getStoredOpenid: function() {
var user = uni.getStorageSync('userInfo_token') || {};
return user.openid || (user.user_info ? user.user_info.openid : '');
},
_getPhoneNumber: function(o) {
null != o.detail.iv ? this.getPhone(o) : util.alert('为了更好的为您服务,请允许访问您的手机号码');
var that = this;
if (null == o.detail.iv) {
util.alert('为了更好的为您服务,请允许访问您的手机号码');
return;
}
if (that.openidReady && that.getStoredOpenid()) {
that.getPhone(o);
return;
}
util.getOpenidInfo(function() {
that.openidReady = true;
that.getPhone(o);
}, true);
@ -88,11 +107,13 @@
getPhone: function(t) {
var that = this;
var code = t.detail.code;
var openid = this.getStoredOpenid();
console.log("code", code);
util.request({
api: 'customer/mobile',
data: {
code: code
code: code,
openid: openid
},
method: 'POST',
utilSuccess: function(e) {

Loading…
Cancel
Save