| gameSign: null, //游戏结束时需要 | gameSign: null, //游戏结束时需要 | ||||
| gameState:false,//游戏状态 | gameState:false,//游戏状态 | ||||
| endGameData:null,//中奖数据 | endGameData:null,//中奖数据 | ||||
| isRegister:false,//是否已注册 | |||||
| isAddress:false,//是否有地址 | |||||
| }, | }, | ||||
| /** | /** | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| app.globalData.nowPage = 3; | app.globalData.nowPage = 3; | ||||
| if (app.globalData.openid) { | if (app.globalData.openid) { | ||||
| this.getOrderInfo(); | |||||
| this.endGame(); | |||||
| this.getAddress(); | |||||
| } else { | } else { | ||||
| app.globalData.openidSuccessFuc = this.getOrderInfo; | |||||
| app.globalData.openidSuccessFuc = this.getAddress; | |||||
| } | } | ||||
| }, | }, | ||||
| pizeTip: 1 | pizeTip: 1 | ||||
| }) | }) | ||||
| } else { | } else { | ||||
| if (this.data.isRegister) { | |||||
| if (this.data.isAddress) { | |||||
| this.setData({ | this.setData({ | ||||
| pizeTip: 2 | pizeTip: 2 | ||||
| }) | }) | ||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| getOrderInfo: function () {//查询是否已注册 | |||||
| app.wxRequest(app.globalData.urlRoot +"userInfo/getOrderInfo",{},res=>{ | |||||
| if(res.code==200){ | |||||
| getAddress: function () {//获取地址 | |||||
| app.wxRequest(app.globalData.urlRoot + "userInfo/getOrderInfo", {}, res => { | |||||
| if (res.code == 200) { | |||||
| if (res.data) { | if (res.data) { | ||||
| this.data.isRegister = true; | |||||
| this.data.isAddress = true; | |||||
| } | } | ||||
| } | } | ||||
| },this) | |||||
| }, this) | |||||
| }, | }, | ||||
| receive:function(){//立即领取 | receive:function(){//立即领取 | ||||
| wx.redirectTo({ | wx.redirectTo({ |