| }, | }, | ||||
| globalData: { | globalData: { | ||||
| urlRoot: "https://dongfengqichen.jiyou-tech.com/",//测试接口根目录 | urlRoot: "https://dongfengqichen.jiyou-tech.com/",//测试接口根目录 | ||||
| // urlRoot: "",//接口根目录 | |||||
| urlStatic:"https://www.jiyou-tech.com/2020/496_qichen/static",//静态资源根目录 | |||||
| // 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 | ||||
| friendOpenid:"",//推荐人的openid | friendOpenid:"",//推荐人的openid | ||||
| session_key: "",//session_key | session_key: "",//session_key |
| kvurlH:0, | kvurlH:0, | ||||
| showAppointment:false, | showAppointment:false, | ||||
| placing:false, | placing:false, | ||||
| buyState:false | |||||
| buyState:false, | |||||
| isStartAdvertisingFunState:false | |||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| if (app.globalData.isFirstLogin){ | if (app.globalData.isFirstLogin){ | ||||
| app.globalData.kvurl = res.data.kvurl; | app.globalData.kvurl = res.data.kvurl; | ||||
| app.globalData.isFirstLogin = false; | app.globalData.isFirstLogin = false; | ||||
| setTimeout(() => { | setTimeout(() => { | ||||
| setTimeout(() => { | |||||
| const query = wx.createSelectorQuery() | |||||
| query.select('.kvurlImg').boundingClientRect() | |||||
| query.selectViewport().scrollOffset() | |||||
| query.exec((res)=>{ | |||||
| if (res.data && res.data[0]) { | |||||
| this.setData({ | |||||
| kvurlH: res.data[0].height | |||||
| }) | |||||
| app.globalData.kvurlH = res.data[0].height; | |||||
| } | |||||
| }) | |||||
| },200) | |||||
| this.setData({ | |||||
| isStartAdvertising: 0 | |||||
| }) | |||||
| setTimeout(()=>{ | |||||
| this.setData({ | |||||
| isStartAdvertisingShow:false, | |||||
| }) | |||||
| },1000); | |||||
| }, 3000); | |||||
| this.isStartAdvertisingFun(); | |||||
| }, 2000); | |||||
| } | } | ||||
| if (app.globalData.openid) { | if (app.globalData.openid) { | ||||
| this.loadFun(); | this.loadFun(); | ||||
| } | } | ||||
| },this); | },this); | ||||
| }, | }, | ||||
| isStartAdvertisingFun:function(){ | |||||
| if (this.data.isStartAdvertisingFunState){ | |||||
| return; | |||||
| } | |||||
| this.data.isStartAdvertisingFunState = true; | |||||
| setTimeout(() => { | |||||
| const query = wx.createSelectorQuery() | |||||
| query.select('.kvurlImg').boundingClientRect() | |||||
| query.selectViewport().scrollOffset() | |||||
| query.exec((res) => { | |||||
| if (res.data && res.data[0]) { | |||||
| this.setData({ | |||||
| kvurlH: res.data[0].height | |||||
| }) | |||||
| app.globalData.kvurlH = res.data[0].height; | |||||
| } | |||||
| }) | |||||
| }, 200) | |||||
| this.setData({ | |||||
| isStartAdvertising: 0 | |||||
| }) | |||||
| setTimeout(() => { | |||||
| this.setData({ | |||||
| isStartAdvertisingShow: false, | |||||
| }) | |||||
| }, 1000); | |||||
| }, | |||||
| getHomeBanner: function () {//获取banner | getHomeBanner: function () {//获取banner | ||||
| app.wxRequest(app.globalData.urlRoot + "home/getHomeBanner", {}, res => { | app.wxRequest(app.globalData.urlRoot + "home/getHomeBanner", {}, res => { | ||||
| if (res.code == 200) { | if (res.code == 200) { |
| </view> | </view> | ||||
| <tabBar wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"></tabBar> | <tabBar wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"></tabBar> | ||||
| <!-- <view wx:if="{{isStartAdvertisingShow}}" class='imgBg' catchtouchmove="ture"></view> --> | <!-- <view wx:if="{{isStartAdvertisingShow}}" class='imgBg' catchtouchmove="ture"></view> --> | ||||
| <image wx:if="{{isStartAdvertisingShow}}" mode="widthFix" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | |||||
| <image wx:if="{{isStartAdvertisingShow}}" bindtap="isStartAdvertisingFun" mode="widthFix" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | |||||
| </view> | </view> |
| * 用户点击右上角分享 | * 用户点击右上角分享 | ||||
| */ | */ | ||||
| onShareAppMessage: function () { | onShareAppMessage: function () { | ||||
| return app.sharePack(); | |||||
| return { | |||||
| title: '能抓到头等舱机票的神仙娃娃机,快来一起玩!', | |||||
| imageUrl: "", | |||||
| path: "/pages/luckyStar/luckyStar" | |||||
| } | |||||
| // return app.sharePack(); | |||||
| }, | }, | ||||
| closeRule:function(){//关闭游戏玩法 | closeRule:function(){//关闭游戏玩法 | ||||
| this.setData({ | this.setData({ | ||||
| }) | }) | ||||
| } | } | ||||
| }, | }, | ||||
| enterIndex:function(){ | |||||
| wx.reLaunch({ | |||||
| url: '/pages/index/index' | |||||
| }) | |||||
| }, | |||||
| getBuyState: function () {//查询是否已下订 | getBuyState: function () {//查询是否已下订 | ||||
| app.wxRequest(app.globalData.urlRoot + "wxPay/getBuyState", {}, res => { | app.wxRequest(app.globalData.urlRoot + "wxPay/getBuyState", {}, res => { | ||||
| if (res.code == 200) { | if (res.code == 200) { |
| <image class="luckyPizeType" src="{{imgUrl+'/images/luckyPizeType2.png?v=002'}}"></image> | <image class="luckyPizeType" src="{{imgUrl+'/images/luckyPizeType2.png?v=002'}}"></image> | ||||
| <image class="gameRuleClose" bindtap="closeWindow" style="top:-5rpx;right:-5rpx;" src="{{imgUrl+'/star/closebtn.png'}}"></image> | <image class="gameRuleClose" bindtap="closeWindow" style="top:-5rpx;right:-5rpx;" src="{{imgUrl+'/star/closebtn.png'}}"></image> | ||||
| <view class="btnsGroup" style="justify-content:{{buyState && certificationInfo?'center':'space-between'}}"> | <view class="btnsGroup" style="justify-content:{{buyState && certificationInfo?'center':'space-between'}}"> | ||||
| <image class="luckyBtns" wx:if="{{!buyState}}" src="{{imgUrl+'/btns/luckyBtns1.png'}}"></image> | |||||
| <image class="luckyBtns" bindtap="enterIndex" wx:if="{{!buyState}}" src="{{imgUrl+'/btns/luckyBtns1.png'}}"></image> | |||||
| <view class="startRegister" wx:if="{{buyState || certificationInfo}}"> | <view class="startRegister" wx:if="{{buyState || certificationInfo}}"> | ||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/images/luckyPizeTip2.png'}}"></image> | <image style="width:100%;height:100%;" src="{{imgUrl+'/images/luckyPizeTip2.png'}}"></image> | ||||
| <button open-type="share" class="shareBtn" style="width:100%;height:100%;margin:0;padding:0;min-height:0;"></button> | <button open-type="share" class="shareBtn" style="width:100%;height:100%;margin:0;padding:0;min-height:0;"></button> |