| getSecondGuessInfoV2:null,//第二轮价格竞猜结果 | getSecondGuessInfoV2:null,//第二轮价格竞猜结果 | ||||
| phonebolb:false, | phonebolb:false, | ||||
| isStar:null,//是否为星探 | isStar:null,//是否为星探 | ||||
| luckyTokenList:[],//可用抽奖token列表 | |||||
| }, | }, | ||||
| // 获取openId | // 获取openId | ||||
| getOpenid: function (code) { | getOpenid: function (code) { | ||||
| },this) | },this) | ||||
| }, | }, | ||||
| getBuyState: function () {//查询是否已下订 | getBuyState: function () {//查询是否已下订 | ||||
| // this.wxRequest(this.globalData.urlRoot + "wxPay/getBuyState", {source:2}, res => { | |||||
| // if (res.code == 200) { | |||||
| // if (res.data) { | |||||
| // res.data.cdate = res.data.cdate ? res.data.cdate : ""; | |||||
| // this.globalData.getBuyState = res.data; | |||||
| // if (this.globalData.buyStateSuccessFuc){ | |||||
| // this.globalData.buyStateSuccessFuc(); | |||||
| // } | |||||
| // } | |||||
| // } | |||||
| // }, this); | |||||
| this.wxRequest(this.globalData.urlRoot + "wxPay/v3/getLuckyTokenList", {source:2}, res => { | |||||
| if (res.code == 200) { | |||||
| if (res.data) { | |||||
| res.data.cdate = res.data.cdate ? res.data.cdate : ""; | |||||
| this.globalData.getBuyState = res.data; | |||||
| if (this.globalData.buyStateSuccessFuc){ | |||||
| this.globalData.buyStateSuccessFuc(); | |||||
| } | |||||
| if(res.data.luckyTokenList){ | |||||
| this.globalData.luckyTokenList = res.data.luckyTokenList; | |||||
| } | |||||
| } | |||||
| } | |||||
| }, this); | |||||
| }, | }, | ||||
| addAppEnter: function () {//小程序整体pv统计 | addAppEnter: function () {//小程序整体pv统计 | ||||
| this.wxRequest(this.globalData.urlRoot + "statistics/addAppEnter", { scene:this.globalData.sceneSource}, res => { | this.wxRequest(this.globalData.urlRoot + "statistics/addAppEnter", { scene:this.globalData.sceneSource}, res => { |
| yuyueShow: false, | yuyueShow: false, | ||||
| }, | }, | ||||
| attached:function(){ | attached:function(){ | ||||
| this.setData({ | |||||
| nowPage:app.globalData.nowPage, | |||||
| buyState: app.globalData.getBuyState?app.globalData.getBuyState.success:false | |||||
| }) | |||||
| setTimeout(()=>{ | |||||
| this.setData({ | |||||
| nowPage:app.globalData.nowPage, | |||||
| buyState: app.globalData.getBuyState?app.globalData.getBuyState.success:false | |||||
| }) | |||||
| },50) | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 组件的方法列表 | * 组件的方法列表 |
| showMaskNum:0,//要显示的弹窗 | showMaskNum:0,//要显示的弹窗 | ||||
| addressShow:false, | addressShow:false, | ||||
| isAddress:false,//是否有地址 | isAddress:false,//是否有地址 | ||||
| drawNum:0,//可用抽奖次数 | |||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| if (app.globalData.isFirstLogin) { | if (app.globalData.isFirstLogin) { | ||||
| } | } | ||||
| }, | }, | ||||
| loadFun: function () { | loadFun: function () { | ||||
| if(app.globalData.luckyTokenList && app.globalData.luckyTokenList.length){ | |||||
| this.setData({ | |||||
| drawNum:app.globalData.luckyTokenList.length | |||||
| }) | |||||
| } | |||||
| if (!app.globalData.addPageEnterState.index) { | if (!app.globalData.addPageEnterState.index) { | ||||
| app.addPageEnter("2AF7D5B88BBFF4159C8079E963E72C9B"); | app.addPageEnter("2AF7D5B88BBFF4159C8079E963E72C9B"); | ||||
| app.globalData.addPageEnterState.index = true; | app.globalData.addPageEnterState.index = true; | ||||
| }) | }) | ||||
| this.getFirstMsg(); | this.getFirstMsg(); | ||||
| }, | }, | ||||
| onShow: function () { | |||||
| onShow:function () { | |||||
| if(app.globalData.luckyTokenList && app.globalData.luckyTokenList.length){ | |||||
| this.setData({ | |||||
| drawNum:app.globalData.luckyTokenList.length | |||||
| }) | |||||
| } | |||||
| if (app.globalData.getBuyState) { | if (app.globalData.getBuyState) { | ||||
| this.getBuyStates(); | this.getBuyStates(); | ||||
| } else { | } else { | ||||
| // buyState: app.globalData.getBuyState.success | // buyState: app.globalData.getBuyState.success | ||||
| // }) | // }) | ||||
| // } | // } | ||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| if(this.data.buyState){ | |||||
| wx.navigateTo({ | |||||
| url: '/pages/rotaryDraw/rotaryDraw', | |||||
| }) | |||||
| }else{ | |||||
| this.setData({ | |||||
| placing: !this.data.placing | |||||
| }) | |||||
| } | |||||
| }, | }, | ||||
| swiperChange:function(e){ | swiperChange:function(e){ | ||||
| var num = e.currentTarget.dataset.num; | var num = e.currentTarget.dataset.num; |
| <view class="main" wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"> | <view class="main" wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"> | ||||
| <view class="contentFrame"> | <view class="contentFrame"> | ||||
| <view class="newImages2-76"> | <view class="newImages2-76"> | ||||
| <image style="width:750rpx;height:11693rpx;" src="{{imgUrl+'/newImages8/newHome/newHomeBg.png'}}"></image> | |||||
| <!-- <image style="width:750rpx;height:11693rpx;" src="{{imgUrl+'/newImages8/newHome/newHomeBg.png'}}"></image> --> | |||||
| <!-- <image style="width:750rpx;height:10368rpx;" src="{{imgUrl+'/newImages4/16.png'}}"></image> --> | <!-- <image style="width:750rpx;height:10368rpx;" src="{{imgUrl+'/newImages4/16.png'}}"></image> --> | ||||
| <!-- <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_01.png?v=002'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_02.png?v=004'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_03.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_04.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_05.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages6/images/newImg_06.png'}}"></image> | |||||
| <image style="width:750rpx;height:768rpx;" src="{{imgUrl+'/newImages6/images/newImg_07.png'}}"></image> --> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_01.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_02.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_03.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_04.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_05.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_06.png'}}"></image> | |||||
| <image style="width:750rpx;height:1600rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_07.png'}}"></image> | |||||
| <image style="width:750rpx;height:493rpx;" src="{{imgUrl+'/newImages8/newHome/newHome_08.png'}}"></image> | |||||
| </view> | </view> | ||||
| <view class="videoGroup" bindtap="playVideo"> | <view class="videoGroup" bindtap="playVideo"> | ||||
| <image class="newImages2-108" animation="{{playBtnDeg}}" src="{{imgUrl+'/newImages8/10.png'}}"></image> | <image class="newImages2-108" animation="{{playBtnDeg}}" src="{{imgUrl+'/newImages8/10.png'}}"></image> | ||||
| </view> | </view> | ||||
| <image class="computeBtn" bindtap="compute" src="{{imgUrl+'/newImages7/19.png'}}"></image> | <image class="computeBtn" bindtap="compute" src="{{imgUrl+'/newImages7/19.png'}}"></image> | ||||
| <!-- <image class="newImages2-11" bindtap="placingControl" wx:if="{{!buyState}}" src="{{imgUrl+'/newImages8/5.png'}}"></image> --> | <!-- <image class="newImages2-11" bindtap="placingControl" wx:if="{{!buyState}}" src="{{imgUrl+'/newImages8/5.png'}}"></image> --> | ||||
| <image class="newImages2-11" bindtap="placingControl" src="{{imgUrl+'/newImages8/5.png'}}"></image> | |||||
| <image class="newImages2-11" bindtap="placingControl" wx:if="{{!buyState || drawNum}}" src="{{imgUrl+'/newImages8/5.png'}}"></image> | |||||
| <image class="newImages2-12" bindtap="lookConfigure" src="{{imgUrl+'/newImages2/98.png'}}"></image> | <image class="newImages2-12" bindtap="lookConfigure" src="{{imgUrl+'/newImages2/98.png'}}"></image> | ||||
| <image class="newImages2-13" bindtap="vrLookCar" src="{{imgUrl+'/newImages2/99.png'}}"></image> | <image class="newImages2-13" bindtap="vrLookCar" src="{{imgUrl+'/newImages2/99.png'}}"></image> | ||||
| <swiper class="swiper1" bindchange="swiperChange" data-num="1" current="{{swiperGroup.one.current}}"> | <swiper class="swiper1" bindchange="swiperChange" data-num="1" current="{{swiperGroup.one.current}}"> |
| <view class="all"> | <view class="all"> | ||||
| <view class="main"> | <view class="main"> | ||||
| <view class="titleText">兑换详情</view> | <view class="titleText">兑换详情</view> | ||||
| <view class="lineSty"></view> | |||||
| <view class="lineSty" wx:if="{{lookIndex.awardId!=19 && lookIndex.awardId!=20 && lookIndex.awardId!=23}}"></view> | |||||
| <image class="closeXieyi" bindtap="closeXieyi" src="{{imgUrl+'/images/closeXieyi.png'}}"></image> | <image class="closeXieyi" bindtap="closeXieyi" src="{{imgUrl+'/images/closeXieyi.png'}}"></image> | ||||
| <view wx:if="{{lookIndex.awardId<6}}" style="position: relative;"> | |||||
| <image src="{{imgUrl+'/newImages3/prizeDetail2/'+lookIndex.awardId+'.png'}}" style="width:750rpx;" mode="widthFix"></image> | |||||
| <image class="confirm" bindtap="closeXieyi" src="{{imgUrl+'/newImages3/35.png'}}"></image> | |||||
| <view wx:if="{{lookIndex.awardId<6 || lookIndex.awardId==19 || lookIndex.awardId==20 || lookIndex.awardId==23}}" style="position: relative;"> | |||||
| <image wx:if="{{lookIndex.awardId==19 || lookIndex.awardId==20 || lookIndex.awardId==23}}" src="{{imgUrl+'/newImages3/prizeDetail2/'+lookIndex.awardId+'.jpg'}}" style="width:750rpx;" mode="widthFix"></image> | |||||
| <image wx:if="{{lookIndex.awardId<6}}" src="{{imgUrl+'/newImages3/prizeDetail2/'+lookIndex.awardId+'.png'}}" style="width:750rpx;" mode="widthFix"></image> | |||||
| <image class="confirm" wx:if="{{lookIndex.awardId!=19 && lookIndex.awardId!=20 && lookIndex.awardId!=23}}" bindtap="closeXieyi" src="{{imgUrl+'/newImages3/35.png'}}"></image> | |||||
| </view> | </view> | ||||
| <view wx:if="{{lookIndex.awardId == 6 || lookIndex.awardId == 7 || lookIndex.awardId == 8 || lookIndex.awardId == 18}}"> | <view wx:if="{{lookIndex.awardId == 6 || lookIndex.awardId == 7 || lookIndex.awardId == 8 || lookIndex.awardId == 18}}"> | ||||
| <image src="{{imgUrl+'/newImages3/prizeDetail2/'+lookIndex.awardId+'_1.png'}}" style="width:750rpx;" mode="widthFix"></image> | <image src="{{imgUrl+'/newImages3/prizeDetail2/'+lookIndex.awardId+'_1.png'}}" style="width:750rpx;" mode="widthFix"></image> |
| isAddress:false,//是否有地址 | isAddress:false,//是否有地址 | ||||
| configure:{ | configure:{ | ||||
| page:1, | page:1, | ||||
| count:10 | |||||
| count:10, | |||||
| awardSource:1 | |||||
| }, | }, | ||||
| gameAwardList:"", | gameAwardList:"", | ||||
| gameAwardListArr:"", | gameAwardListArr:"", | ||||
| }) | }) | ||||
| }, | }, | ||||
| getBuyState: function () {//查询是否已下订 | getBuyState: function () {//查询是否已下订 | ||||
| app.wxRequest(app.globalData.urlRoot + "wxPay/getBuyState", {source:2}, res => { | |||||
| app.wxRequest(app.globalData.urlRoot + "wxPay/v3/getLuckyTokenList", {source:2}, res => { | |||||
| if (res.code == 200) { | if (res.code == 200) { | ||||
| if (res.data) { | if (res.data) { | ||||
| this.setData({ | this.setData({ |
| starMoveShow:false, | starMoveShow:false, | ||||
| cash1Show:false, | cash1Show:false, | ||||
| cash2Show:false, | cash2Show:false, | ||||
| fanShow:false, | |||||
| lookPrizeDetail:false, | lookPrizeDetail:false, | ||||
| lookIndex:null, | lookIndex:null, | ||||
| buyStateCouponCode:"", | buyStateCouponCode:"", | ||||
| app.wxRequest(app.globalData.urlRoot +"/bag/getMyCouponList",this.data.parames3,res=>{ | app.wxRequest(app.globalData.urlRoot +"/bag/getMyCouponList",this.data.parames3,res=>{ | ||||
| wx.hideLoading(); | wx.hideLoading(); | ||||
| if(res.code==200){ | if(res.code==200){ | ||||
| // res.data.list[3].couponId = "186618"; | |||||
| // res.data.list[3].couponCode = "186618"; | |||||
| if(res.data){ | if(res.data){ | ||||
| for(let i=0;i<res.data.list.length;i++){ | for(let i=0;i<res.data.list.length;i++){ | ||||
| this.data.couponList.push(res.data.list[i]); | this.data.couponList.push(res.data.list[i]); | ||||
| wx.showLoading({ | wx.showLoading({ | ||||
| title: '获取数据中' | title: '获取数据中' | ||||
| }) | }) | ||||
| this.data.parames2.awardSource = this.data.recordNow; | |||||
| this.data.parames2.awardSource = this.data.recordNow==2?4:this.data.recordNow; | |||||
| app.wxRequest(app.globalData.urlRoot + "award/getMyAwardList", this.data.parames2, res => { | app.wxRequest(app.globalData.urlRoot + "award/getMyAwardList", this.data.parames2, res => { | ||||
| wx.hideLoading(); | wx.hideLoading(); | ||||
| if(res.code == 200){ | if(res.code == 200){ | ||||
| // res.data[0].awardState = 0; | // res.data[0].awardState = 0; | ||||
| // res.data = this.data.testData; | // res.data = this.data.testData; | ||||
| // res.data = [{ | |||||
| // awardDetailPicContentHeight: 0, | |||||
| // awardName: "500元现金", //奖品名称 | |||||
| // awardPicurl: "https://xingb.venucia.com/award/10_1.png",//奖品小图 | |||||
| // couponCode: "我是卡号",//卡号 | |||||
| // couponSecret:"我是卡密",//卡密 | |||||
| // dead_date:"我是有效期",//有效期 | |||||
| // awardState: 1, | |||||
| // cdate: "2020-03-23", | |||||
| // awardId: 16 | |||||
| // }] | |||||
| // res.data = [ | |||||
| // { | |||||
| // awardDetailPicContentHeight: 0, | |||||
| // awardName: "九阳破壁机", //奖品名称 | |||||
| // awardPicurl: "https://xingb.venucia.com/award/10_1.png",//奖品小图 | |||||
| // couponCode: "我是卡号",//卡号 | |||||
| // couponSecret:"我是卡密",//卡密 | |||||
| // dead_date:"我是有效期",//有效期 | |||||
| // awardState: 1, | |||||
| // cdate: "2020-03-23", | |||||
| // awardId: 15 | |||||
| // } | |||||
| // ] | |||||
| // if(this.data.parames2.page<3){ | // if(this.data.parames2.page<3){ | ||||
| // for(let i=0;i<20;i++){ | // for(let i=0;i<20;i++){ | ||||
| // res.data.push(res.data[0]) | // res.data.push(res.data[0]) | ||||
| this.cashHide1(); | this.cashHide1(); | ||||
| }else if(this.data.couponList[index].couponId=="185382"){ | }else if(this.data.couponList[index].couponId=="185382"){ | ||||
| this.cashHide2(); | this.cashHide2(); | ||||
| }else if(this.data.couponList[index].couponId=="186618"){ | |||||
| this.fanHide(); | |||||
| } | } | ||||
| }, | }, | ||||
| vipDetailHide:function(){ | vipDetailHide:function(){ | ||||
| cash2Show:!this.data.cash2Show | cash2Show:!this.data.cash2Show | ||||
| }) | }) | ||||
| }, | }, | ||||
| fanHide:function(){ | |||||
| this.setData({ | |||||
| fanShow:!this.data.fanShow | |||||
| }) | |||||
| }, | |||||
| cardCodeCopy:function(){ | cardCodeCopy:function(){ | ||||
| this.contentCopy(this.data.couponListCode); | this.contentCopy(this.data.couponListCode); | ||||
| }, | }, |
| </view> | </view> | ||||
| <image class="orderCard" data-index="{{index}}" bindtap="vipDetailControl" src="{{imgUrl+'/newImages3/48.png'}}"></image> | <image class="orderCard" data-index="{{index}}" bindtap="vipDetailControl" src="{{imgUrl+'/newImages3/48.png'}}"></image> | ||||
| </view> | </view> | ||||
| <view class="placingOrder" wx:if="{{item.couponId=='185382'}}"> | |||||
| <view style="display:flex;align-items:center;"> | |||||
| <image class="orderHead" src="https://xingb.venucia.com/award/17_1.png" mode="aspectFit"></image> | |||||
| <view style="margin-left:15rpx;margin-right:101rpx;"> | |||||
| <view class="cardTitle">1000元现金卡</view> | |||||
| <view class="cardCtime">{{item.cdate}}</view> | |||||
| </view> | |||||
| </view> | |||||
| <image class="orderCard" data-index="{{index}}" bindtap="vipDetailControl" src="{{imgUrl+'/newImages3/48.png'}}"></image> | |||||
| </view> | |||||
| <view class="placingOrder" wx:if="{{item.couponId=='186618'}}"> | |||||
| <view style="display:flex;align-items:center;"> | |||||
| <image class="orderHead" src="{{imgUrl+'/newImages8/19.png'}}" mode="aspectFit"></image> | |||||
| <view style="margin-left:15rpx;margin-right:101rpx;"> | |||||
| <view class="cardTitle">SOLOVE素乐 超静音小风扇</view> | |||||
| <view class="cardCtime">{{item.cdate}}</view> | |||||
| </view> | |||||
| </view> | |||||
| <image class="orderCard" data-index="{{index}}" bindtap="vipDetailControl" src="{{imgUrl+'/newImages3/48.png'}}"></image> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </scroll-view> | </scroll-view> | ||||
| </view> | </view> | ||||
| <view class="cardCode" style="left:170rpx;top:400rpx;color:white;" wx:if="{{couponListCode}}">{{couponListCode}}<view bindtap="cardCodeCopy" class="cardCodeCopy">复制</view></view> | <view class="cardCode" style="left:170rpx;top:400rpx;color:white;" wx:if="{{couponListCode}}">{{couponListCode}}<view bindtap="cardCodeCopy" class="cardCodeCopy">复制</view></view> | ||||
| </view> | </view> | ||||
| <view class="prizeDesc" style="background-color:white;display:block;overflow:auto;" wx:if="{{fanShow}}"> | |||||
| <view class="titleText">查看详情</view> | |||||
| <view class="lineSty"></view> | |||||
| <image class="closeXieyi" bindtap="fanHide" src="{{imgUrl+'/images/closeXieyi.png'}}"></image> | |||||
| <view style="position:relative;"> | |||||
| <image style="width:750rpx;height:4926rpx;" src="{{imgUrl+'/newImages8/20.png'}}"></image> | |||||
| </view> | |||||
| <view class="cardCode" style="left:auto;right:20rpx;top:785rpx;color:white;font-size:24rpx;" wx:if="{{couponListCode}}">{{couponListCode}}<view bindtap="cardCodeCopy" class="cardCodeCopy">复制</view></view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class="ruleFrame ruleFrame2" wx:if="{{tipWindow2}}"> | <view class="ruleFrame ruleFrame2" wx:if="{{tipWindow2}}"> | ||||
| <view class="tipWindowRule"> | <view class="tipWindowRule"> |
| package: res.data.jsSubmit.package, | package: res.data.jsSubmit.package, | ||||
| paySign: res.data.jsSubmit.paySign, | paySign: res.data.jsSubmit.paySign, | ||||
| success:(option)=>{ | success:(option)=>{ | ||||
| this.paySuccess(res.data.trade_id); | |||||
| this.paySuccess(); | |||||
| }, | }, | ||||
| fail: (option) => { | fail: (option) => { | ||||
| this.data.appointment = true; | this.data.appointment = true; | ||||
| }, this, "POST") | }, this, "POST") | ||||
| }, | }, | ||||
| paySuccess: function (e) {//支付成功 | paySuccess: function (e) {//支付成功 | ||||
| // app.wxRequest(app.globalData.urlRoot + "wxPay/paySuccess", { 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.coupon_code = "123456"; | |||||
| // app.globalData.getBuyState.cdate = "2020-06-05"; | |||||
| // app.globalData.getBuyState.coupon_code = "123456"; | |||||
| // app.globalData.getBuyState.cdate = res.data.cdate; | // app.globalData.getBuyState.cdate = res.data.cdate; | ||||
| // app.globalData.getBuyState.coupon_code = res.data.coupon_code; | // app.globalData.getBuyState.coupon_code = res.data.coupon_code; | ||||
| setTimeout(()=>{ | setTimeout(()=>{ |
| <image class="closeTip" bindtap="tipShowControl" src="{{imgUrl+'/newImages4/15.png'}}"></image> | <image class="closeTip" bindtap="tipShowControl" src="{{imgUrl+'/newImages4/15.png'}}"></image> | ||||
| <image class="tipGroupBg" src="{{imgUrl+'/newImages8/7.png'}}"></image> | <image class="tipGroupBg" src="{{imgUrl+'/newImages8/7.png'}}"></image> | ||||
| <view class="tipGroupContent"> | <view class="tipGroupContent"> | ||||
| <image class="tipGroupContentImg" src="{{imgUrl+'/newImages8/8.png'}}"></image> | |||||
| <image class="tipGroupContentImg" src="{{imgUrl+'/newImages8/8.png?v=002'}}"></image> | |||||
| <!-- <image class="tipGroupContentBtn" bindtap="tipShowControl2" src="{{imgUrl+'/newImages4/14.png'}}"></image> --> | <!-- <image class="tipGroupContentBtn" bindtap="tipShowControl2" src="{{imgUrl+'/newImages4/14.png'}}"></image> --> | ||||
| </view> | </view> | ||||
| </view> | </view> |
| } | } | ||||
| .tipGroupContentImg{ | .tipGroupContentImg{ | ||||
| width: 601rpx; | width: 601rpx; | ||||
| height: 1949rpx; | |||||
| height: 2061rpx; | |||||
| margin: 0 auto; | margin: 0 auto; | ||||
| } | } | ||||
| .tipGroupContentBtn{ | .tipGroupContentBtn{ |
| // pages/rotaryDraw/rotaryDraw.js | // pages/rotaryDraw/rotaryDraw.js | ||||
| const app = getApp() | const app = getApp() | ||||
| let timekeeping = true; | |||||
| let dataList = [ | let dataList = [ | ||||
| {prizeName:"华为P40",nickName:"啦啦啦"}, | |||||
| {prizeName:"小米扫拖机器人",nickName:"啦啦啦"}, | |||||
| {prizeName:"小米空调",nickName:"啦啦啦"}, | |||||
| {prizeName:"九阳破壁机",nickName:"啦啦啦"}, | |||||
| {prizeName:"USMILE电动牙刷",nickName:"啦啦啦"}, | |||||
| {awardName:"华为P40",nickName:"啦啦啦"}, | |||||
| {awardName:"小米扫拖机器人",nickName:"啦啦啦"}, | |||||
| {awardName:"小米空调",nickName:"啦啦啦"}, | |||||
| {awardName:"九阳破壁机",nickName:"啦啦啦"}, | |||||
| {awardName:"USMILE电动牙刷",nickName:"啦啦啦"}, | |||||
| ] | ] | ||||
| let btnOpen = false;//是否正在抽奖 | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| ani4:null | ani4:null | ||||
| }, | }, | ||||
| page:1, | page:1, | ||||
| count:5, | |||||
| drawAni:null | |||||
| count:20, | |||||
| drawAni:null, | |||||
| prizeShow2:false,//是否显示未中奖 | |||||
| awardId:0,//中奖id | |||||
| addressShow:false, | |||||
| isAddress:false,//是否有地址 | |||||
| }, | }, | ||||
| /** | /** | ||||
| } | } | ||||
| }, | }, | ||||
| loadFun() { | loadFun() { | ||||
| // this.getRecordData(); | |||||
| this.getRecordData(); | |||||
| this.getAddress(); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 生命周期函数--监听页面卸载 | * 生命周期函数--监听页面卸载 | ||||
| */ | */ | ||||
| onUnload: function () { | onUnload: function () { | ||||
| timekeeping = false; | |||||
| }, | }, | ||||
| /** | /** | ||||
| return app.sharePack(); | return app.sharePack(); | ||||
| }, | }, | ||||
| getRecordData(){//获取中将记录数据 | getRecordData(){//获取中将记录数据 | ||||
| return; | |||||
| app.wxRequest(app.globalData.urlRoot + "", {}, res => { | |||||
| app.wxRequest(app.globalData.urlRoot + "award/getGameAwardList", {page:this.data.page,count:this.data.count,awardSource:4}, res => { | |||||
| if (res.code == 200 && res.data) { | if (res.code == 200 && res.data) { | ||||
| this.data.totalNum = res.total; | this.data.totalNum = res.total; | ||||
| for(let i=0;i<res.data.length;i++){ | for(let i=0;i<res.data.length;i++){ | ||||
| this.data.recordDataAll.push(res.data[i]); | this.data.recordDataAll.push(res.data[i]); | ||||
| } | } | ||||
| if(this.data.page==1){ | if(this.data.page==1){ | ||||
| timekeeping = true; | |||||
| for(let i=1;i<=4;i++){ | for(let i=1;i<=4;i++){ | ||||
| setTimeout(()=>{ | setTimeout(()=>{ | ||||
| this.aniFun(4000,"-40rpx","ani"+i); | this.aniFun(4000,"-40rpx","ani"+i); | ||||
| }, this) | }, this) | ||||
| }, | }, | ||||
| aniFun(duration,top,that,loop = true){ | aniFun(duration,top,that,loop = true){ | ||||
| if(!timekeeping) return; | |||||
| var animation = wx.createAnimation({ | var animation = wx.createAnimation({ | ||||
| duration: duration | duration: duration | ||||
| }); | }); | ||||
| this.data.page++; | this.data.page++; | ||||
| this.getRecordData(); | this.getRecordData(); | ||||
| } | } | ||||
| this.data.ani[that].recordText = "恭喜"+this.data.recordDataAll[this.data.recordNowNum].nickName+"获得"+this.data.recordDataAll[this.data.recordNowNum].prizeName; | |||||
| this.data.ani[that].recordText = "恭喜"+this.data.recordDataAll[this.data.recordNowNum].nickName+"获得"+this.data.recordDataAll[this.data.recordNowNum].awardName; | |||||
| if(this.data.recordNowNum+1<this.data.recordDataAll.length){ | if(this.data.recordNowNum+1<this.data.recordDataAll.length){ | ||||
| this.data.recordNowNum++; | this.data.recordNowNum++; | ||||
| }else{ | }else{ | ||||
| } | } | ||||
| }, | }, | ||||
| startDraw(){//开始抽奖 | startDraw(){//开始抽奖 | ||||
| this.drawAniFun(2000,360); | |||||
| // this.drawAniFun(5500,660); | |||||
| // return; | |||||
| if(!app.globalData.luckyTokenList.length){ | |||||
| wx.showToast({ | |||||
| title: '抽奖次数不足', | |||||
| icon:"none" | |||||
| }) | |||||
| return; | |||||
| } | |||||
| if(btnOpen){ | |||||
| return; | |||||
| } | |||||
| btnOpen=true; | |||||
| this.getLucky(); | |||||
| }, | }, | ||||
| drawAniFun(duration,rotate,loop=true){ | drawAniFun(duration,rotate,loop=true){ | ||||
| var animation = wx.createAnimation({ | var animation = wx.createAnimation({ | ||||
| this.setData({ | this.setData({ | ||||
| drawAni:animation.export() | drawAni:animation.export() | ||||
| }) | }) | ||||
| if(loop){ | |||||
| setTimeout(()=>{ | |||||
| this.drawAniFun(2000,rotate+360); | |||||
| },duration) | |||||
| }, | |||||
| getLucky(){ | |||||
| app.wxRequest(app.globalData.urlRoot + "wxPay/v3/getLucky", {token:app.globalData.luckyTokenList[0].token}, res => { | |||||
| console.log(res); | |||||
| if (res.code == 200) { | |||||
| app.globalData.luckyTokenList.splice(0,1); | |||||
| // res.data.lucky = true; | |||||
| // res.data.awardData = {}; | |||||
| // res.data.awardData.awardId = 19 | |||||
| if(res.data.lucky){ | |||||
| let timeNum = 0; | |||||
| let timeRotate = 0; | |||||
| if(res.data.awardData.awardId==19){ | |||||
| timeNum = 3500; | |||||
| timeRotate = 420; | |||||
| }else if(res.data.awardData.awardId==20){ | |||||
| timeNum = 4000; | |||||
| timeRotate = 480; | |||||
| }else if(res.data.awardData.awardId==23){ | |||||
| timeNum = 5000; | |||||
| timeRotate = 600; | |||||
| } | |||||
| this.drawAniFun(timeNum,timeRotate); | |||||
| setTimeout(() => { | |||||
| this.setData({ | |||||
| awardId:res.data.awardData.awardId | |||||
| }) | |||||
| }, timeNum+400); | |||||
| }else{ | |||||
| //1 0.12 | |||||
| this.drawAniFun(5500,660); | |||||
| setTimeout(() => { | |||||
| btnOpen = false; | |||||
| this.prizeControl2(); | |||||
| }, 6600+400); | |||||
| } | |||||
| console.log(app.globalData.luckyTokenList); | |||||
| }else{ | |||||
| btnOpen = false; | |||||
| wx.showToast({ | |||||
| title: res.msg, | |||||
| icon:"none" | |||||
| }) | |||||
| } | |||||
| }, this) | |||||
| }, | |||||
| prizeControl2(){//控制获奖弹窗显示状态 | |||||
| this.setData({ | |||||
| prizeShow2:!this.data.prizeShow2 | |||||
| }) | |||||
| }, | |||||
| backPage(){ | |||||
| wx.navigateBack({ | |||||
| delta:1 | |||||
| }) | |||||
| }, | |||||
| addressControl(){//立即领取 | |||||
| this.setData({ | |||||
| addressShow: !this.data.addressShow | |||||
| }) | |||||
| if (this.data.addressShow) { | |||||
| app.globalData.skipType = 'mycenter'; | |||||
| } | } | ||||
| }, | |||||
| getAddress: function () {//获取地址 | |||||
| app.wxRequest(app.globalData.urlRoot + "address/getAddressV2", {}, res => { | |||||
| if (res.code == 200) { | |||||
| if (res.data) { | |||||
| this.setData({ | |||||
| isAddress:true | |||||
| }) | |||||
| } | |||||
| } | |||||
| }, this) | |||||
| } | } | ||||
| }) | }) |
| { | { | ||||
| "navigationBarTitleText": "幸运大转盘", | "navigationBarTitleText": "幸运大转盘", | ||||
| "usingComponents": { | "usingComponents": { | ||||
| "userMsg": "/pages/userMsg/userMsg", | |||||
| "tabBar": "../component/tabBar/index" | "tabBar": "../component/tabBar/index" | ||||
| } | } | ||||
| } | } |
| <view class="gameFrame"> | <view class="gameFrame"> | ||||
| <view class="gameGroup"> | <view class="gameGroup"> | ||||
| <image class="gameDial" animation="{{drawAni}}" src="{{imgUrl+'/newImages8/14.png'}}"></image> | <image class="gameDial" animation="{{drawAni}}" src="{{imgUrl+'/newImages8/14.png'}}"></image> | ||||
| <image class="gamePointer" bindtap="startDraw" src="{{imgUrl+'/newImages8/13.png'}}"></image> | |||||
| <!-- <image class="gamePointer" bindtap="startDraw" src="{{imgUrl+'/newImages8/13.png'}}"></image> --> | |||||
| <image class="gamePointer2" bindtap="startDraw" src="{{imgUrl+'/newImages8/13_2.png'}}"></image> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="recordFrame"> | <view class="recordFrame"> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="ruleMask" wx:if="{{prizeShow2}}"> | |||||
| <view class="ruleGroup" style="width:570rpx;height:556rpx;"> | |||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/newImages8/18.png?v=002'}}"></image> | |||||
| <image class="closeRule" style="top:-30rpx;right:-30rpx;" src="{{imgUrl+'/newImages8/3.png'}}" bindtap="backPage"></image> | |||||
| <view class="getNow" bindtap="backPage"></view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="ruleMask" wx:if="{{awardId}}"> | |||||
| <view class="ruleGroup" style="width:570rpx;height:557rpx;"> | |||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/newImages8/award/'+awardId+'.png'}}"></image> | |||||
| <image class="closeRule" style="top:-30rpx;right:-30rpx;" src="{{imgUrl+'/newImages8/3.png'}}" bindtap="backPage"></image> | |||||
| <image class="getNow" wx:if="{{!isAddress}}" bindtap="addressControl" src="{{imgUrl+'/newImages8/award/btns.png'}}"></image> | |||||
| </view> | |||||
| </view> | |||||
| </view> | </view> | ||||
| <userMsg bindaddress="addressControl" wx:if="{{addressShow}}"></userMsg> | |||||
| <tabBar></tabBar> | <tabBar></tabBar> | ||||
| </view> | </view> |
| .main{ | .main{ | ||||
| height: calc(100vh - 120rpx); | height: calc(100vh - 120rpx); | ||||
| overflow: auto; | overflow: auto; | ||||
| overflow-x: hidden; | |||||
| position: relative; | position: relative; | ||||
| } | } | ||||
| .pageBg{ | .pageBg{ | ||||
| } | } | ||||
| .gamePointer{ | .gamePointer{ | ||||
| position: absolute; | position: absolute; | ||||
| top: 207rpx; | |||||
| top: 200rpx; | |||||
| left: 50%; | left: 50%; | ||||
| transform: translateX(-50%); | transform: translateX(-50%); | ||||
| width: 119rpx; | width: 119rpx; | ||||
| height: 181rpx; | height: 181rpx; | ||||
| } | } | ||||
| .gamePointer2{ | |||||
| position: absolute; | |||||
| top: 270rpx; | |||||
| left: 270rpx; | |||||
| width: 119rpx; | |||||
| height: 120rpx; | |||||
| } | |||||
| .recordFrame{ | .recordFrame{ | ||||
| position: absolute; | position: absolute; | ||||
| top: 0; | top: 0; | ||||
| height: 40rpx; | height: 40rpx; | ||||
| line-height: 40rpx; | line-height: 40rpx; | ||||
| color: white; | color: white; | ||||
| } | |||||
| .ruleMask{ | |||||
| position: fixed; | |||||
| top: 0; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: calc(100vh - 120rpx); | |||||
| background-color: rgba( 000, 000, 000, 0.6); | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| z-index: 99; | |||||
| } | |||||
| .ruleGroup{ | |||||
| position: relative; | |||||
| width: 641rpx; | |||||
| height: 995rpx; | |||||
| } | |||||
| .closeRule{ | |||||
| position: absolute; | |||||
| top: -27rpx; | |||||
| right: -28rpx; | |||||
| width: 38rpx; | |||||
| height: 37rpx; | |||||
| } | |||||
| .getNow{ | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| top: 435rpx; | |||||
| width: 366rpx; | |||||
| height: 56rpx; | |||||
| } | |||||
| .gameDialAni{ | |||||
| animation:rotateAni 3s linear infinite; | |||||
| } | |||||
| @keyframes rotateAni | |||||
| { | |||||
| 0% {rotate:0;} | |||||
| 100% {rotate:360deg;} | |||||
| 100% {rotate:0;} | |||||
| } | } |
| */ | */ | ||||
| data: { | data: { | ||||
| prizeShow:false,//是否显示获奖弹窗 | prizeShow:false,//是否显示获奖弹窗 | ||||
| prizeShow2:false,//是否显示未获奖弹窗 | |||||
| ruleShow:true,//是否显示规则 | ruleShow:true,//是否显示规则 | ||||
| imgUrl: app.globalData.urlStatic,//图片路径 | imgUrl: app.globalData.urlStatic,//图片路径 | ||||
| agreement:false, | agreement:false, | ||||
| scene: app.globalData.sceneSource | scene: app.globalData.sceneSource | ||||
| }, | }, | ||||
| mobileType:2, | mobileType:2, | ||||
| addressShow:false, | |||||
| isAddress:false,//是否有地址 | |||||
| userData:null | userData:null | ||||
| }, | }, | ||||
| ready:function(){ | ready:function(){ | ||||
| }) | }) | ||||
| } | } | ||||
| this.getUserLocation();//获取用户当前位置 | this.getUserLocation();//获取用户当前位置 | ||||
| this.getAddress(); | |||||
| }, | }, | ||||
| getDistributorList: function (longitude, latitude) {//获取经销商列表 | getDistributorList: function (longitude, latitude) {//获取经销商列表 | ||||
| app.wxRequest(app.globalData.urlRoot + "agent/getAgentList", { longitude: longitude, latitude: latitude }, res => { | app.wxRequest(app.globalData.urlRoot + "agent/getAgentList", { longitude: longitude, latitude: latitude }, res => { | ||||
| }) | }) | ||||
| return; | return; | ||||
| } | } | ||||
| this.prizeControl(); | |||||
| if(res.data.awardResult){ | |||||
| this.prizeControl(); | |||||
| }else{ | |||||
| this.prizeControl2(); | |||||
| } | |||||
| // wx.showToast({ | // wx.showToast({ | ||||
| // title: '预约成功', | // title: '预约成功', | ||||
| // mask:true | // mask:true | ||||
| prizeShow:!this.data.prizeShow | prizeShow:!this.data.prizeShow | ||||
| }) | }) | ||||
| }, | }, | ||||
| getNow(){//立即领取 | |||||
| prizeControl2(){//控制获奖弹窗显示状态 | |||||
| this.setData({ | |||||
| prizeShow2:!this.data.prizeShow2 | |||||
| }) | |||||
| }, | |||||
| addressControl(){//立即领取 | |||||
| this.setData({ | |||||
| addressShow: !this.data.addressShow | |||||
| }) | |||||
| if (this.data.addressShow) { | |||||
| app.globalData.skipType = 'mycenter'; | |||||
| } | |||||
| }, | |||||
| getAddress: function () {//获取地址 | |||||
| app.wxRequest(app.globalData.urlRoot + "address/getAddressV2", {}, res => { | |||||
| if (res.code == 200) { | |||||
| if (res.data) { | |||||
| this.setData({ | |||||
| isAddress:true | |||||
| }) | |||||
| } | |||||
| } | |||||
| }, this) | |||||
| } | } | ||||
| } | } | ||||
| }) | }) |
| { | { | ||||
| "component": true, | "component": true, | ||||
| "usingComponents": { | "usingComponents": { | ||||
| "userMsg": "/pages/userMsg/userMsg", | |||||
| "agreement": "/pages/agreement/agreement" | "agreement": "/pages/agreement/agreement" | ||||
| } | } | ||||
| } | } |
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="ruleMask" wx:if="{{prizeShow}}"> | <view class="ruleMask" wx:if="{{prizeShow}}"> | ||||
| <view class="ruleGroup" style="width:570rpx;height:558rpx;"> | |||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/newImages8/9.png'}}"></image> | |||||
| <view class="ruleGroup" style="width:570rpx;height:556rpx;"> | |||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/newImages8/17.png'}}"></image> | |||||
| <image class="closeRule" style="top:-30rpx;right:-30rpx;" src="{{imgUrl+'/newImages8/3.png'}}" bindtap="closeXieyi"></image> | <image class="closeRule" style="top:-30rpx;right:-30rpx;" src="{{imgUrl+'/newImages8/3.png'}}" bindtap="closeXieyi"></image> | ||||
| <view class="getNow" bindtap="getNow"></view> | |||||
| <image class="getNow" wx:if="{{!isAddress}}" bindtap="addressControl" src="{{imgUrl+'/newImages8/16.png'}}"></image> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="ruleMask" wx:if="{{prizeShow2}}"> | |||||
| <view class="ruleGroup" style="width:570rpx;height:556rpx;"> | |||||
| <image style="width:100%;height:100%;" src="{{imgUrl+'/newImages8/18.png'}}"></image> | |||||
| <image class="closeRule" style="top:-30rpx;right:-30rpx;" src="{{imgUrl+'/newImages8/3.png'}}" bindtap="closeXieyi"></image> | |||||
| <view class="getNow" bindtap="closeXieyi"></view> | |||||
| </view> | |||||
| </view> | |||||
| <userMsg bindaddress="addressControl" wx:if="{{addressShow}}"></userMsg> | |||||
| <agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | <agreement bindmyevent="agreementControl" wx:if="{{agreement}}"></agreement> | ||||
| </view> | </view> |
| .ruleGroup{ | .ruleGroup{ | ||||
| position: relative; | position: relative; | ||||
| width: 641rpx; | width: 641rpx; | ||||
| height: 995rpx; | |||||
| height: 1028rpx; | |||||
| } | } | ||||
| .closeRule{ | .closeRule{ | ||||
| position: absolute; | position: absolute; | ||||
| left: 50%; | left: 50%; | ||||
| transform: translateX(-50%); | transform: translateX(-50%); | ||||
| top: 435rpx; | top: 435rpx; | ||||
| width: 368rpx; | |||||
| height: 60rpx; | |||||
| width: 366rpx; | |||||
| height: 56rpx; | |||||
| } | } |