| openid: "",//OPENID | openid: "",//OPENID | ||||
| session_key: "",//session_key | session_key: "",//session_key | ||||
| openidSuccessFuc: null,//方法回调 | openidSuccessFuc: null,//方法回调 | ||||
| nowPage:'1',//当前tabBar | |||||
| nowPage:'3',//当前tabBar | |||||
| isRegister:false,//是否已注册 | isRegister:false,//是否已注册 | ||||
| userMobile:null,//用户手机号 | userMobile:null,//用户手机号 | ||||
| isFirstLogin:true,//是否为第一次登录 | isFirstLogin:true,//是否为第一次登录 |
| "pages/everyday/everyday", | "pages/everyday/everyday", | ||||
| "pages/logs/logs", | "pages/logs/logs", | ||||
| "pages/myCenter/myCenter", | "pages/myCenter/myCenter", | ||||
| "pages/luckyStar/luckyStar", | |||||
| "pages/scout/register/register", | "pages/scout/register/register", | ||||
| "pages/scout/share/share" | "pages/scout/share/share" | ||||
| ], | ], |
| onLoad: function () { | onLoad: function () { | ||||
| if (app.globalData.isFirstLogin) { | if (app.globalData.isFirstLogin) { | ||||
| this.getStartAdvertising(); | this.getStartAdvertising(); | ||||
| }else{ | |||||
| if (app.globalData.openid) { | |||||
| this.loadFun(); | |||||
| } else { | |||||
| app.globalData.openidSuccessFuc = this.loadFun; | |||||
| } | |||||
| } | } | ||||
| }, | }, | ||||
| loadFun: function () { | loadFun: function () { | ||||
| }, | }, | ||||
| getStartAdvertising: function () {//获取开屏广告 | getStartAdvertising: function () {//获取开屏广告 | ||||
| app.wxRequest(app.globalData.urlRoot +"home/getStartAdvertising",{},res=>{ | app.wxRequest(app.globalData.urlRoot +"home/getStartAdvertising",{},res=>{ | ||||
| if (app.globalData.openid) { | |||||
| this.loadFun(); | |||||
| } else { | |||||
| app.globalData.openidSuccessFuc = this.loadFun; | |||||
| } | |||||
| if(res.code==200){ | if(res.code==200){ | ||||
| if (app.globalData.openid) { | |||||
| this.loadFun(); | |||||
| } else { | |||||
| app.globalData.openidSuccessFuc = this.loadFun; | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| startAdvertisingUrl: res.data.picurl, | startAdvertisingUrl: res.data.picurl, | ||||
| mainShow:true | mainShow:true |
| // pages/luckyStar/luckyStar.js | |||||
| const app = getApp() | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| imgUrl: app.globalData.urlStatic,//图片路径 | |||||
| ruleShow: false,//是否显示游戏玩法 | |||||
| ruleCloseShow: true,//是否显示游戏玩法关闭按钮 | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide: function () { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh: function () { | |||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| }, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage: function () { | |||||
| }, | |||||
| closeRule:function(){//关闭游戏玩法 | |||||
| this.setData({ | |||||
| ruleShow:false | |||||
| }) | |||||
| }, | |||||
| openGameRule: function () {//打开游戏玩法 | |||||
| this.setData({ | |||||
| ruleShow: true | |||||
| }) | |||||
| }, | |||||
| strolClaw:function(){//开始控制爪子方向 | |||||
| }, | |||||
| endClaw:function(){//结束爪子动作 | |||||
| } | |||||
| }) |
| { | |||||
| "navigationBarTitleText": "幸运星抓手", | |||||
| "usingComponents": { | |||||
| "tabBar": "../component/tabBar/index" | |||||
| } | |||||
| } |
| <!--pages/luckyStar/luckyStar.wxml--> | |||||
| <view class="all"> | |||||
| <view class="main"> | |||||
| <view class="gameMain"> | |||||
| <image class="gameStarBg" src="{{imgUrl+'/images/gameStarBg.png'}}"></image> | |||||
| <view class="gameTitle">幸运星抓手</view> | |||||
| <view class="downTime">00:29</view> | |||||
| <image class="gameClaw" src="{{imgUrl+'/images/gameClaw.png'}}"></image> | |||||
| <image class="prizeIcon2" src="{{imgUrl+'/images/prizeIcon2.png'}}"></image> | |||||
| <image class="prizeIcon1" src="{{imgUrl+'/images/prizeIcon1.png'}}"></image> | |||||
| <view class="scrollText"> | |||||
| <view class="scrollFrame"> | |||||
| <view class="scrollView">恭喜XXX获得头等舱机票一张,恭喜XX获得20元美团代金券一张</view> | |||||
| <view class="scrollView">恭喜XXX获得头等舱机票一张,恭喜XX获得20元美团代金券一张</view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="gameControlFrame"> | |||||
| <view class="gameControlGroup"> | |||||
| <view class="btnControlL" bindtouchstart="strolClaw" bindtouchend="endClaw" data-direction="L"></view> | |||||
| <view class="btnControlR" bindtouchstart="strolClaw" bindtouchend="endClaw" data-direction="R"></view> | |||||
| <view class="btnControlT" bindtouchstart="strolClaw" bindtouchend="endClaw" data-direction="T"></view> | |||||
| <view class="btnControlB" bindtouchstart="strolClaw" bindtouchend="endClaw" data-direction="B"></view> | |||||
| </view> | |||||
| </view> | |||||
| <view class="gameGetBtn"></view> | |||||
| <view class="prizeLook">活动奖品</view> | |||||
| </view> | |||||
| <view bindtap="openGameRule" class="gameRuleBtn {{ruleShow?'gameRuleBtn2':''}}">游戏玩法</view> | |||||
| <view class="gameTip">500元待领取</view> | |||||
| <view class="gameRuleDesc" wx:if="{{ruleShow}}"> | |||||
| <view class="ruleGroup"> | |||||
| <image class="gameRuleIcon" src="{{imgUrl+'/images/gameRuleDesc.png'}}"></image> | |||||
| <image class="gameRuleClose" wx:if="{{ruleCloseShow}}" bindtap="closeRule" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | |||||
| <view class="gameStrat">开始游戏</view> | |||||
| </view> | |||||
| </view> | |||||
| </view> | |||||
| <tabBar></tabBar> | |||||
| </view> |
| /* pages/luckyStar/luckyStar.wxss */ | |||||
| image{ | |||||
| display: block; | |||||
| } | |||||
| .main{ | |||||
| height: calc(100vh - 150rpx); | |||||
| overflow: auto; | |||||
| } | |||||
| .gameRuleBtn{ | |||||
| width:200rpx; | |||||
| height:50rpx; | |||||
| background-color:rgba(000,000,000,0.63); | |||||
| position: fixed; | |||||
| right: 0; | |||||
| top: 164rpx; | |||||
| border-top-left-radius: 30rpx; | |||||
| border-bottom-left-radius: 30rpx; | |||||
| font-size:26rpx; | |||||
| font-family:PingFangSC; | |||||
| font-weight:400; | |||||
| color:rgba(255,255,255,1); | |||||
| text-align: center; | |||||
| line-height: 50rpx; | |||||
| } | |||||
| .gameRuleBtn2{ | |||||
| background-color: #28568B; | |||||
| } | |||||
| .gameTip{ | |||||
| width:200rpx; | |||||
| height:50rpx; | |||||
| background-color:rgba(000,000,000,0.63); | |||||
| position: fixed; | |||||
| right: 0; | |||||
| top: 240rpx; | |||||
| border-top-left-radius: 30rpx; | |||||
| border-bottom-left-radius: 30rpx; | |||||
| font-size:26rpx; | |||||
| font-family:PingFangSC; | |||||
| font-weight:400; | |||||
| color:rgba(255,255,255,1); | |||||
| text-align: center; | |||||
| line-height: 50rpx; | |||||
| } | |||||
| .gameRuleDesc{ | |||||
| position: fixed; | |||||
| left: 0; | |||||
| top: 0; | |||||
| width: 100%; | |||||
| height: calc(100vh - 150rpx); | |||||
| background-color: rgba( 000, 000, 000, 0.3); | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| } | |||||
| .ruleGroup{ | |||||
| position: relative; | |||||
| width: 487rpx; | |||||
| height: 459rpx; | |||||
| } | |||||
| .gameRuleIcon{ | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| .gameRuleClose{ | |||||
| position: absolute; | |||||
| top: 0rpx; | |||||
| right: -10rpx; | |||||
| width: 31rpx; | |||||
| height: 29rpx; | |||||
| } | |||||
| .gameStrat{ | |||||
| width:277rpx; | |||||
| height:50rpx; | |||||
| background-color: #355483; | |||||
| font-size:21rpx; | |||||
| font-family:PingFangSC; | |||||
| font-weight:400; | |||||
| color:rgba(255,255,255,1); | |||||
| line-height:50rpx; | |||||
| text-align: center; | |||||
| border-radius: 10rpx; | |||||
| position: absolute; | |||||
| bottom: 50rpx; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| } | |||||
| .gameMain{ | |||||
| position: relative; | |||||
| width: 750rpx; | |||||
| height: 1471rpx; | |||||
| } | |||||
| .gameStarBg{ | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| } | |||||
| .gameTitle{ | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| top: 10rpx; | |||||
| transform: translateX(-50%); | |||||
| width: 342rpx; | |||||
| height: 124rpx; | |||||
| line-height: 124rpx; | |||||
| font-size:40rpx; | |||||
| font-family:PingFangSC; | |||||
| color:rgba(35,33,34,1); | |||||
| text-align: center; | |||||
| font-weight: bold; | |||||
| } | |||||
| .downTime{ | |||||
| position: absolute; | |||||
| top: 58rpx; | |||||
| right: 80rpx; | |||||
| font-size:34rpx; | |||||
| line-height: 34rpx; | |||||
| font-family:NissanBrand; | |||||
| color:rgba(35,33,34,1); | |||||
| font-weight: 500; | |||||
| } | |||||
| .gameClaw{ | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| top: 130rpx; | |||||
| width: 164rpx; | |||||
| height: 259rpx; | |||||
| } | |||||
| .scrollText{ | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| bottom: 428rpx; | |||||
| width: 700rpx; | |||||
| height: 30rpx; | |||||
| overflow: hidden; | |||||
| } | |||||
| .scrollFrame{ | |||||
| width: 100%; | |||||
| height: 100%; | |||||
| position: relative; | |||||
| overflow: hidden; | |||||
| } | |||||
| .scrollView{ | |||||
| position: absolute; | |||||
| width: auto; | |||||
| height: 30rpx; | |||||
| line-height: 30rpx; | |||||
| font-size:20rpx; | |||||
| font-family:PingFangSC; | |||||
| font-weight:600; | |||||
| color:rgba(255,255,255,1); | |||||
| left: 60%; | |||||
| } | |||||
| .prizeLook{ | |||||
| position: absolute; | |||||
| left: 50%; | |||||
| transform: translateX(-50%); | |||||
| bottom: 161rpx; | |||||
| width:710rpx; | |||||
| height:70rpx; | |||||
| background-color: #355483; | |||||
| line-height: 70rpx; | |||||
| text-align: center; | |||||
| font-size:30rpx; | |||||
| font-family:PingFangSC; | |||||
| font-weight:400; | |||||
| color:rgba(255,255,255,1); | |||||
| border-radius: 20rpx; | |||||
| } | |||||
| .prizeIcon2{ | |||||
| position: absolute; | |||||
| left: 115rpx; | |||||
| top: 610rpx; | |||||
| width: 523rpx; | |||||
| height: 171rpx; | |||||
| } | |||||
| .prizeIcon1{ | |||||
| position: absolute; | |||||
| left: 72rpx; | |||||
| top: 640rpx; | |||||
| width: 624rpx; | |||||
| height: 265rpx; | |||||
| } | |||||
| .gameGetBtn{ | |||||
| position: absolute; | |||||
| right: 70rpx; | |||||
| top: 1086rpx; | |||||
| width: 304rpx; | |||||
| height: 80rpx; | |||||
| } | |||||
| .gameControlFrame{ | |||||
| position: absolute; | |||||
| left: 130rpx; | |||||
| top: 1078rpx; | |||||
| width: 174rpx; | |||||
| height: 106rpx; | |||||
| } | |||||
| .gameControlGroup{ | |||||
| widows: 100%; | |||||
| height: 100%; | |||||
| position: relative; | |||||
| } | |||||
| .btnControlL{ | |||||
| position: absolute; | |||||
| left: 0; | |||||
| top: 38rpx; | |||||
| width: 60rpx; | |||||
| height: 30rpx; | |||||
| /* background-color: rgba( 000, 000, 000, 0.3); */ | |||||
| } | |||||
| .btnControlR{ | |||||
| position: absolute; | |||||
| right: 0; | |||||
| top: 38rpx; | |||||
| width: 64rpx; | |||||
| height: 30rpx; | |||||
| /* background-color: rgba(228, 15, 15, 0.849); */ | |||||
| } | |||||
| .btnControlT{ | |||||
| position: absolute; | |||||
| left: 65rpx; | |||||
| top: 0; | |||||
| width: 48rpx; | |||||
| height: 44rpx; | |||||
| /* background-color: rgba(209, 135, 45, 0.5); */ | |||||
| } | |||||
| .btnControlB{ | |||||
| position: absolute; | |||||
| left: 60rpx; | |||||
| bottom: 0; | |||||
| width: 50rpx; | |||||
| height: 47rpx; | |||||
| /* background-color: rgba(233, 222, 111, 0.5); */ | |||||
| } |
| recordNow: 1,//现在的记录类型 | recordNow: 1,//现在的记录类型 | ||||
| taskList: [],//任务列表 | taskList: [],//任务列表 | ||||
| shareFriendList:[],//星探小分队列表 | shareFriendList:[],//星探小分队列表 | ||||
| recordList:[],//获奖记录列表 | |||||
| provinceArr: [],//省 | provinceArr: [],//省 | ||||
| provinceValue: 0,//选中的省下标 | provinceValue: 0,//选中的省下标 | ||||
| storeArr: [],//店铺 | storeArr: [],//店铺 | ||||
| this.getUserInfo(); | this.getUserInfo(); | ||||
| this.getTaskProgress(); | this.getTaskProgress(); | ||||
| this.getShareList(); | this.getShareList(); | ||||
| this.getMyAwardList(); | |||||
| if (app.globalData.myCenterData) { | if (app.globalData.myCenterData) { | ||||
| this.setData({ | this.setData({ | ||||
| provinceArr: app.globalData.indexData.provinceArr, | |||||
| storeArr: app.globalData.indexData.storeArr, | |||||
| provinceValue: app.globalData.indexData.provinceValue, | |||||
| storeValue: app.globalData.indexData.storeValue, | |||||
| provinceArr: app.globalData.myCenterData.provinceArr, | |||||
| storeArr: app.globalData.myCenterData.storeArr, | |||||
| provinceValue: app.globalData.myCenterData.provinceValue, | |||||
| storeValue: app.globalData.myCenterData.storeValue, | |||||
| isRegister: app.globalData.isRegister | isRegister: app.globalData.isRegister | ||||
| }) | }) | ||||
| this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province; | this.data.subscribeData.province = this.data.provinceArr[this.data.provinceValue].province; | ||||
| }) | }) | ||||
| }, | }, | ||||
| selectRecord: function (e) { | selectRecord: function (e) { | ||||
| if (this.data.recordNow == e.currentTarget.dataset.type) { | |||||
| return; | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| recordList:[], | |||||
| recordNow: e.currentTarget.dataset.type | recordNow: e.currentTarget.dataset.type | ||||
| }) | }) | ||||
| this.getMyAwardList(); | |||||
| }, | }, | ||||
| getUserLocation: function (e) { | getUserLocation: function (e) { | ||||
| wx.getLocation({ | wx.getLocation({ | ||||
| if (!this.data.sendCode) { | if (!this.data.sendCode) { | ||||
| return; | return; | ||||
| } | } | ||||
| app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: '18831849567' }, res => { | |||||
| console.log(res); | |||||
| app.wxRequest(app.globalData.urlRoot + "captcha/sendCaptcha", { mobile: this.data.subscribeData.mobile}, res => { | |||||
| if (res.code == 200) { | if (res.code == 200) { | ||||
| this.countDown(); | this.countDown(); | ||||
| wx.showToast({ | wx.showToast({ | ||||
| }, | }, | ||||
| getShareList: function () {//星探小分队 | getShareList: function () {//星探小分队 | ||||
| app.wxRequest(app.globalData.urlRoot + "share/getFriendRegisterList", this.data.parames,res=>{ | app.wxRequest(app.globalData.urlRoot + "share/getFriendRegisterList", this.data.parames,res=>{ | ||||
| console.log(res); | |||||
| if(res.code==200){ | if(res.code==200){ | ||||
| for(let i=0;i<res.data.length;i++){ | for(let i=0;i<res.data.length;i++){ | ||||
| this.data.shareFriendList.push(res.data[i]); | this.data.shareFriendList.push(res.data[i]); | ||||
| noData: true | noData: true | ||||
| }) | }) | ||||
| } | } | ||||
| console.log(this.data.shareFriendList); | |||||
| } | } | ||||
| },this); | },this); | ||||
| }, | }, | ||||
| this.data.parames.page+=1; | this.data.parames.page+=1; | ||||
| this.getShareList(); | this.getShareList(); | ||||
| } | } | ||||
| }, | |||||
| getMyAwardList: function () {//获取获奖记录 | |||||
| app.wxRequest(app.globalData.urlRoot + "award/getMyAwardList", { awardType: this.data.recordNow},res=>{ | |||||
| console.log(res); | |||||
| if(res.code == 200){ | |||||
| this.setData({ | |||||
| recordList:res.data | |||||
| }) | |||||
| } | |||||
| },this) | |||||
| } | } | ||||
| }) | }) |
| <view bindtap="selectRecord" data-type='3' class="taskText recordText {{recordNow==3?'taskText2':''}}">幸运星抓手奖品</view> | <view bindtap="selectRecord" data-type='3' class="taskText recordText {{recordNow==3?'taskText2':''}}">幸运星抓手奖品</view> | ||||
| </view> | </view> | ||||
| <view class="recordFrame"> | <view class="recordFrame"> | ||||
| <view class="recordGroup"> | |||||
| <view class="recordGroup" wx:for="{{recordList}}" wx:key="index"> | |||||
| <view class="recordGroupLeft"> | <view class="recordGroupLeft"> | ||||
| <view class="recordHeadGroup"> | <view class="recordHeadGroup"> | ||||
| <image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | <image class="recordUserImg" src="{{imgUrl+'/images/defaultHead.png'}}"></image> | ||||
| </view> | </view> | ||||
| <view class="recordMainGroup"> | <view class="recordMainGroup"> | ||||
| <view class="rewardName">头等舱机票一张</view> | |||||
| <view class="rewardTerm">2020.04.05</view> | |||||
| <view class="rewardName">{{item.awardName}}</view> | |||||
| <view class="rewardTerm">{{item.cdate}}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="recordPic"> | <view class="recordPic"> | ||||
| </view> | </view> | ||||
| <view class="subscribeGroup" wx:if="{{selectNow==4 && !isRegister}}"> | <view class="subscribeGroup" wx:if="{{selectNow==4 && !isRegister}}"> | ||||
| <view class="inputGroup"> | <view class="inputGroup"> | ||||
| <input class="inputCode" bindinput="getCaptcha" placeholder="请输入您的姓名"></input> | |||||
| <input class="inputCode" bindinput="getRealname" placeholder="请输入您的姓名"></input> | |||||
| </view> | </view> | ||||
| <view class="inputGroup"> | <view class="inputGroup"> | ||||
| <input class="inputCode" bindinput="getCaptcha" placeholder="请输入您的联系电话"></input> | |||||
| <input class="inputCode" bindinput="getMobile" type="number" value="{{subscribeData.mobile}}" maxlength='11' placeholder="请输入您的联系电话"></input> | |||||
| </view> | </view> | ||||
| <view class="inputGroup"> | <view class="inputGroup"> | ||||
| <input class="inputCode" style="width:500rpx;" bindinput="getCaptcha" placeholder="请输入验证码"></input> | <input class="inputCode" style="width:500rpx;" bindinput="getCaptcha" placeholder="请输入验证码"></input> |
| "name": "个人中心", | "name": "个人中心", | ||||
| "pathName": "pages/myCenter/myCenter", | "pathName": "pages/myCenter/myCenter", | ||||
| "query": "" | "query": "" | ||||
| } | |||||
| }, | |||||
| { | |||||
| "id": -1, | |||||
| "name": "幸运星抓手", | |||||
| "pathName": "pages/luckyStar/luckyStar", | |||||
| "query": "" | |||||
| } | |||||
| ] | ] | ||||
| } | } | ||||
| } | } |