| @@ -31,8 +31,7 @@ | |||
| "pages/managelicenseplate/managelicenseplate", | |||
| "pages/payrule/payrule", | |||
| "pages/game/index", | |||
| "pages/grade/grade", | |||
| "pages/index/gameentry/gentry" | |||
| "pages/grade/grade" | |||
| ], | |||
| "tabBar": { | |||
| "color": "#9F9F9F", | |||
| @@ -0,0 +1,35 @@ | |||
| // pages/index/sw/index.js | |||
| Component({ | |||
| properties: { | |||
| gamedata: { | |||
| type: Object, | |||
| value: {} | |||
| } | |||
| }, | |||
| data: { | |||
| flag: false, | |||
| gameUrl: '' | |||
| }, | |||
| methods:{ | |||
| gotogame: function (e) { | |||
| wx.navigateTo({ | |||
| url: '/pages/game/index?url=' + e.target.dataset.data.url + "&id=" + e.target.dataset.data.id + "&gameId=" + e.target.dataset.data.gameId, | |||
| }) | |||
| }, | |||
| a: function () { | |||
| this.setData({ flag: false }) | |||
| }, | |||
| closeGame: function () { | |||
| this.setData({ flag: true }) | |||
| }, | |||
| }, | |||
| onReady: function () { | |||
| console.log(this.gamedata, 999999999) | |||
| }, | |||
| onLoad: function (options) { | |||
| console.log(this.gamedata, 999999999) | |||
| }, | |||
| onShow: function () { | |||
| console.log(this.gamedata, 999999999) | |||
| } | |||
| }); | |||
| @@ -3,7 +3,7 @@ | |||
| <view class="t_w"> | |||
| <view class="b2"> | |||
| <icon type="cancel" size="40" color="rgb(0,255,255)" class='cancel_icon' bindtap="closeGame"/> | |||
| <image class="t_image" mode='widthFix' src="../../../assets/img/gameentry.png" bindtap="gotogame"></image> | |||
| <image class="t_image" data-data="{{gamedata}}" mode='widthFix' src="{{gamedata.imgUrl}}" bindtap="gotogame" /> | |||
| </view> | |||
| </view> | |||
| </view> | |||
| @@ -4,7 +4,7 @@ let app = getApp(); | |||
| Page({ | |||
| data: { | |||
| token:'', | |||
| url:'https://game.youlane.cn/luckCard/index.html' | |||
| url:'' | |||
| }, | |||
| bindGetMsg(e){ | |||
| console.log(e,1234565432) | |||
| @@ -36,18 +36,18 @@ Page({ | |||
| if (options.share){ | |||
| // wx.onShareAppMessage(); | |||
| }else{ | |||
| Http.get({ | |||
| url: config.api.getGame, | |||
| data: { | |||
| token: app.globalData.token, | |||
| } | |||
| }) | |||
| .then(res => { | |||
| console.log(res.data, 333); | |||
| }) | |||
| // Http.get({ | |||
| // url: config.api.getGame, | |||
| // data: { | |||
| // token: app.globalData.token, | |||
| // } | |||
| // }) | |||
| // .then(res => { | |||
| // console.log(res.data, 333); | |||
| // }) | |||
| this.setData({ | |||
| url:"https://game.youlane.cn/luckCard/index.html?token="+app.globalData.token, | |||
| // url: "http://10.11.195.31:8080/luckCard/?token=" + app.globalData.token | |||
| // url: options.url + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id, | |||
| url: "http://10.11.195.31:8080/luckCard/" + "?token=" + app.globalData.token + "&gameId=" + options.gameId + "&id=" + options.id, | |||
| }); | |||
| } | |||
| } | |||
| @@ -1,18 +0,0 @@ | |||
| var app = getApp() | |||
| Page({ | |||
| data: { | |||
| flag: false | |||
| }, | |||
| gotogame: function () { | |||
| wx.navigateTo({ | |||
| url: '../game/index', | |||
| }) | |||
| }, | |||
| a: function () { | |||
| this.setData({ flag: false }) | |||
| }, | |||
| closeGame: function () { | |||
| this.setData({ flag: true }) | |||
| } | |||
| }) | |||
| @@ -10,6 +10,9 @@ Page({ | |||
| desc:'', | |||
| scrollTop: 0, | |||
| showGame:false, | |||
| gamedata:{}, | |||
| couponId:'',//游戏返回时传回的字段 | |||
| played:false,//从游戏页面跳回首页返回true | |||
| page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | |||
| }, | |||
| swiperChange: function(e) { | |||
| @@ -27,6 +30,12 @@ Page({ | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| onLoad: function(options) { | |||
| console.log(options,2222222) | |||
| if(options.played=="true"){ | |||
| this.setData({ | |||
| played:true | |||
| }) | |||
| } | |||
| var that = this; | |||
| console.log(options); | |||
| console.log("这是options") | |||
| @@ -34,8 +43,8 @@ Page({ | |||
| that.setData({ | |||
| scene:scene | |||
| }); | |||
| console.log(that.data.scene) | |||
| console.log(scene); | |||
| // console.log(that.data.scene) | |||
| // console.log(scene); | |||
| app.getLocation(); | |||
| if (options.couponChannelId && options.couponId){ | |||
| that.userLogin(options.couponChannelId, options.couponId); | |||
| @@ -49,9 +58,9 @@ Page({ | |||
| } | |||
| }) | |||
| .then(res=>{ | |||
| console.log(res.data.weapNote); | |||
| // console.log(res.data.weapNote); | |||
| let weapNote = JSON.parse(res.data.weapNote); | |||
| console.log(weapNote.firstpage); | |||
| // console.log(weapNote.firstpage); | |||
| that.setData({ | |||
| desc: weapNote.firstpage.desc, | |||
| title: weapNote.firstpage.title | |||
| @@ -72,11 +81,11 @@ Page({ | |||
| onPullDownRefresh: function(e) { | |||
| let that = this; | |||
| that.userLogin(); | |||
| console.log(this.data.code); | |||
| // console.log(this.data.code); | |||
| if (that.data.code == 0 || that.data.code == undefined) { | |||
| that.selectComponent("#lists").getList(0, 1); | |||
| wx.stopPullDownRefresh(); | |||
| console.log("下拉刷新"); | |||
| // console.log("下拉刷新"); | |||
| } else { | |||
| that.selectComponent("#lists").getList(that.data.code, 1); | |||
| wx.stopPullDownRefresh(); | |||
| @@ -103,7 +112,7 @@ Page({ | |||
| }) => { | |||
| wx.getSystemInfo({ | |||
| success: function (res) { | |||
| console.log(JSON.stringify(res)) | |||
| // console.log(JSON.stringify(res)) | |||
| that.setData({ | |||
| systemInfo: JSON.stringify(res) | |||
| }) | |||
| @@ -142,6 +151,7 @@ Page({ | |||
| that.setData({ | |||
| showGame: true | |||
| }) | |||
| that.getGameOne(res.data.token) | |||
| } | |||
| Http.setToken(res.data.token); | |||
| that.checkUserCarStatus(); | |||
| @@ -176,7 +186,20 @@ Page({ | |||
| } | |||
| }); | |||
| }, | |||
| getGameOne:function(token){ | |||
| let _this=this; | |||
| Http.get({ | |||
| url: config.api.getGame, | |||
| data:{ | |||
| token: token | |||
| } | |||
| }).then(res => { | |||
| console.log(res.data,77777) | |||
| _this.setData({ | |||
| gamedata:res.data | |||
| }) | |||
| }) | |||
| }, | |||
| /** | |||
| * banner | |||
| */ | |||
| @@ -189,7 +212,6 @@ Page({ | |||
| pageSize: 7 | |||
| } | |||
| }).then(res => { | |||
| console.log(res); | |||
| that.setData({ | |||
| list: res.data.list | |||
| }); | |||
| @@ -231,7 +253,6 @@ Page({ | |||
| app.globalData.parkVendor = res.data.vendor; | |||
| if (res.data.token != "undefined") { | |||
| app.globalData.etcpToken = res.data.token; | |||
| console.log("etcpToken", app.globalData.etcpToken); | |||
| } | |||
| }); | |||
| } | |||
| @@ -243,7 +264,6 @@ Page({ | |||
| // 获取用户信息 | |||
| wx.getSetting({ | |||
| success: res => { | |||
| console.log("getSetting", res); | |||
| if (res.authSetting["scope.userInfo"]) { | |||
| // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | |||
| wx.getUserInfo({ | |||
| @@ -263,7 +283,7 @@ Page({ | |||
| that.setData({ | |||
| page: that.data.page | |||
| }); | |||
| console.log("我是第" + that.data.page + "几页") | |||
| // console.log("我是第" + that.data.page + "几页") | |||
| //父组件获得子组件的方法 | |||
| //如果code == 0 | |||
| if (that.data.code == 0 || that.data.code == undefined) { | |||
| @@ -3,7 +3,7 @@ | |||
| "c-banner": "../../components/banner/index", | |||
| "c-rushToBuy": "./rushToBuy/index", | |||
| "c-coupons": "./coupons/index", | |||
| "g-entry": "./gameentry/gentry" | |||
| "g-entry": "../../components/gameentry/gentry" | |||
| }, | |||
| "navigationBarTitleText": "首页", | |||
| "enablePullDownRefresh": true | |||
| @@ -7,5 +7,5 @@ | |||
| <text>独家福利,抢完即止</text> | |||
| </view> | |||
| <c-coupons id="lists" bind:myevent="onGetCode" /> | |||
| <g-entry id="lists" wx:if="{{showGame}}" bind:myevent="" /> | |||
| <g-entry id="listss" wx:if="{{showGame&&!played}}" gamedata="{{gamedata}}" bind:myevent="" /> | |||
| </view> | |||