Authored by huangyi

修复获取抽奖码登陆校验

... ... @@ -348,14 +348,14 @@ App({
},
isLogin: function () {
return this.globalData.userInfo.uid > 0 ? true : false
return this.globalData.userInfo.uid > 0;
},
getUid: function () {
let uid = this.globalData.userInfo.uid
if(!uid||uid===0){
this.getUserInfo();
uid = this.globalData.userInfo.uid
let uid = this.globalData.userInfo.uid;
if(!uid || uid === 0){
let userInfo = this.getUserInfo();
uid = userInfo.uid || 0
}
return uid;
},
... ...
... ... @@ -4,7 +4,9 @@ import ZeroSellService from '../service/zero-sell'
import CommonService from '../service/common'
import router from '../router/router'
var app = null;
const event = global.event;
var app = getApp();
Component({
/**
... ... @@ -42,8 +44,6 @@ Component({
ready() {
this.service = new ZeroSellService();
this.commonService = new CommonService();
app = getApp();
},
/**
... ... @@ -54,9 +54,10 @@ Component({
wx.showLoading({
mask: true
});
let userInfo = app.getUserInfo();
event.emit('user-is-login', {logged: this.logged.bind(this), loginSuccess: this.logged.bind(this)});
},
logged(userInfo) {
debugger;
this.service.fetchCode({
shareUid: this.properties.shareUid,
uid: app.getUid(),
... ...
... ... @@ -47,7 +47,7 @@ const ACTION_BAR_STATUS = {
END: 6, // 活动结束
}
let app;
let app = getApp();
Page(Object.assign({
... ... @@ -58,7 +58,7 @@ Page(Object.assign({
show: false,
showAuth: false,
actPrizeId: '',
shareUid: '',
shareUid: 0,
scene: '',
participantCount: 0,
myPrizeCount: 0,
... ... @@ -104,7 +104,6 @@ Page(Object.assign({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
app = getApp();
this.service = new ZeroSellService();
this.commonService = new CommonService();
... ... @@ -146,8 +145,7 @@ Page(Object.assign({
});
setTimeout(() => {
app = app || getApp();
let uid = app.globalData.userInfo.uid > 0 ? app.globalData.userInfo.uid : 0;
let uid = app.getUid();
this.setData({
hasUnionID: app.globalData.WXUnion_ID !== null && app.globalData.WXUnion_ID !== '' && app.globalData.WXUnion_ID !== undefined ? true : false,
isLogin: app.isLogin(),
... ...