| }) | }) | ||||
| }, | }, | ||||
| globalData: { | globalData: { | ||||
| // urlRoot: "https://dongfengqichen.jiyou-tech.com/",//测试接口根目录 | |||||
| urlRoot: "https://xing.venucia.com/api/",//接口根目录 | |||||
| // urlStatic: "https://www.jiyou-tech.com/2020/496_qichen/static",//测试静态资源根目录 | |||||
| urlStatic: "https://xingb.venucia.com/resource",//静态资源根目录 | |||||
| urlRoot: "https://dongfengqichen.jiyou-tech.com/",//测试接口根目录 | |||||
| // urlRoot: "https://xing.venucia.com/api/",//接口根目录 | |||||
| urlStatic: "https://www.jiyou-tech.com/2020/496_qichen/static",//测试静态资源根目录 | |||||
| // urlStatic: "https://xingb.venucia.com/resource",//静态资源根目录 | |||||
| openid: "",//OPENID | openid: "",//OPENID | ||||
| parentOpenid:"",//推荐人的openid | parentOpenid:"",//推荐人的openid | ||||
| session_key: "",//session_key | session_key: "",//session_key |
| }) | }) | ||||
| }, | }, | ||||
| placingControl:function(){ | placingControl:function(){ | ||||
| if(this.data.buyState && !this.data.drawNum){ | |||||
| this.maskNewControl(); | |||||
| return; | |||||
| console.log("是否已支付"+app.globalData.getBuyState.success); | |||||
| console.log("抽奖机会次数"+app.globalData.luckyTokenList.length); | |||||
| if(app.globalData.getBuyState.success && app.globalData.luckyTokenList.length){ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/rotaryDraw/rotaryDraw', | |||||
| }) | |||||
| }else{ | |||||
| if(app.globalData.getBuyState.success && !app.globalData.luckyTokenList.length && !this.data.placing){ | |||||
| this.maskNewControl(); | |||||
| }else{ | |||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| } | |||||
| } | } | ||||
| return | |||||
| if(app.globalData.getBuyState){ | |||||
| if(!app.globalData.getBuyState.success){ | |||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| } | |||||
| } | |||||
| if (this.data.buyState && !this.data.placing){ | if (this.data.buyState && !this.data.placing){ | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/rotaryDraw/rotaryDraw', | url: '/pages/rotaryDraw/rotaryDraw', | ||||
| }) | }) | ||||
| }else{ | }else{ | ||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| if(this.data.buyState && !this.data.drawNum){ | |||||
| this.maskNewControl(); | |||||
| return; | |||||
| }else{ | |||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| } | |||||
| } | } | ||||
| console.log("是否打开了支付页面"+this.data.placing); | |||||
| console.log("是否已支付"+this.data.buyState); | |||||
| console.log("抽奖机会次数"+this.data.drawNum); | |||||
| }, | }, | ||||
| swiperChange:function(e){ | swiperChange:function(e){ | ||||
| var num = e.currentTarget.dataset.num; | var num = e.currentTarget.dataset.num; |
| paySuccess: function (e) {//支付成功 | paySuccess: function (e) {//支付成功 | ||||
| // app.wxRequest(app.globalData.urlRoot + "wxPay/buyStateTime", { source:2,trade_id:e},res=>{ | // app.wxRequest(app.globalData.urlRoot + "wxPay/buyStateTime", { source:2,trade_id:e},res=>{ | ||||
| // if(res.code==200){ | // if(res.code==200){ | ||||
| // wx.showToast({ | |||||
| // title: '下订成功', | |||||
| // mask:true | |||||
| // }) | |||||
| wx.showToast({ | |||||
| title: '下订成功', | |||||
| mask:true | |||||
| }) | |||||
| app.globalData.getBuyState = {}; | app.globalData.getBuyState = {}; | ||||
| app.globalData.getBuyState.success = true; | app.globalData.getBuyState.success = true; | ||||
| // app.globalData.getBuyState.cdate = "2020-06-05"; | // app.globalData.getBuyState.cdate = "2020-06-05"; |
| if (res.code == 200) { | if (res.code == 200) { | ||||
| if (res.data) { | if (res.data) { | ||||
| res.data.cdate = res.data.cdate ? res.data.cdate : ""; | res.data.cdate = res.data.cdate ? res.data.cdate : ""; | ||||
| app.globalData.getBuyState = res.data.success; | |||||
| app.globalData.getBuyState = res.data; | |||||
| if (res.data.luckyTokenList) { | if (res.data.luckyTokenList) { | ||||
| app.globalData.luckyTokenList = res.data.luckyTokenList; | app.globalData.luckyTokenList = res.data.luckyTokenList; | ||||
| } | } |
| "ignore": [] | "ignore": [] | ||||
| }, | }, | ||||
| "setting": { | "setting": { | ||||
| "urlCheck": true, | |||||
| "urlCheck": false, | |||||
| "es6": true, | "es6": true, | ||||
| "postcss": true, | "postcss": true, | ||||
| "minified": true, | "minified": true, |