| @@ -1,8 +1,8 @@ | |||||
| var config = { | var config = { | ||||
| // url: "https://ciformall.youlane.cn/C/api", | // url: "https://ciformall.youlane.cn/C/api", | ||||
| // url:"https://c.malls.iformall.com/C/api", | // url:"https://c.malls.iformall.com/C/api", | ||||
| // url:'https://ctest.malls.iformall.com/C/api', | |||||
| url:'http://10.100.33.66:7000/C/api', | |||||
| url:'https://ctest.malls.iformall.com/C/api', | |||||
| // url:'http://10.100.33.66:7000/C/api', | |||||
| api: { | api: { | ||||
| /** | /** | ||||
| * 接口用途:login | * 接口用途:login | ||||
| @@ -172,7 +172,7 @@ var config = { | |||||
| }, | }, | ||||
| weapp: { | weapp: { | ||||
| AppId: "wxea71200db93d756b" | |||||
| AppId: "wx649b3be73c1afe47" | |||||
| }, | }, | ||||
| ErrorCode: { | ErrorCode: { | ||||
| NICK_NOT_AUTH: 11004, | NICK_NOT_AUTH: 11004, | ||||
| @@ -6,7 +6,42 @@ Page({ | |||||
| data: { | data: { | ||||
| code: "", | code: "", | ||||
| //存储计时器 | //存储计时器 | ||||
| setInter: "" | |||||
| setInter: "", | |||||
| staticGamedata: {}, | |||||
| showIf: false, | |||||
| }, | |||||
| gotogame: function () { | |||||
| let that = this; | |||||
| wx.navigateTo({ | |||||
| url: '/pages/game/index?url=' + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, | |||||
| }) | |||||
| }, | |||||
| // 获取游戏 | |||||
| getStaticGame(token) { | |||||
| let _this = this; | |||||
| Http.get({ | |||||
| url: config.api.getGame, | |||||
| data: { | |||||
| triggleAction: 4 | |||||
| } | |||||
| }).then(res => { | |||||
| if (res.data.id) { | |||||
| _this.setData({ | |||||
| showIf: true | |||||
| }) | |||||
| } | |||||
| _this.setData({ | |||||
| staticGamedata: res.data | |||||
| }) | |||||
| }) | |||||
| .catch(err => { | |||||
| wx.showToast({ | |||||
| title: err.errMsg, | |||||
| icon: 'none', | |||||
| duration: 2000, | |||||
| mask: false | |||||
| }); | |||||
| }) | |||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| let that = this; | let that = this; | ||||
| @@ -38,6 +73,7 @@ Page({ | |||||
| /** | /** | ||||
| * 动态改变上一级页面的核销状态 | * 动态改变上一级页面的核销状态 | ||||
| */ | */ | ||||
| that.getStaticGame() | |||||
| var pages = getCurrentPages(); | var pages = getCurrentPages(); | ||||
| var prevPage = pages[pages.length - 2]; //上一个页面 | var prevPage = pages[pages.length - 2]; //上一个页面 | ||||
| //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 | //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 | ||||
| @@ -29,4 +29,11 @@ | |||||
| <view class="mai">购买须知:</view> | <view class="mai">购买须知:</view> | ||||
| <view class="remark">{{remark}}</view> | <view class="remark">{{remark}}</view> | ||||
| </view> | </view> | ||||
| </view> | |||||
| <view class='game' bindtap="gotogame" wx-if="{{showIf}}"> | |||||
| <view class='game-entry'> | |||||
| <image src="{{staticGamedata.imgUrl}}" class='gameimg' mode='widthFix'></image> | |||||
| <text>用户专享神秘礼物</text> | |||||
| <text>独家福利,抢完即止</text> | |||||
| </view> | |||||
| </view> | </view> | ||||
| @@ -150,3 +150,47 @@ z-index:10000000000; | |||||
| letter-spacing: 0; | letter-spacing: 0; | ||||
| line-height: 42rpx; | line-height: 42rpx; | ||||
| } | } | ||||
| /* 小游戏入口 | |||||
| */ | |||||
| .game-entry{ | |||||
| width: 690rpx; | |||||
| height: 140rpx; | |||||
| margin: 0 auto; | |||||
| border-radius: 14rpx; | |||||
| box-shadow: 1px 4px 20px #C4C4C4; | |||||
| background: #fff; | |||||
| } | |||||
| .game { | |||||
| position: relative; | |||||
| width: 750rpx; | |||||
| height: 200rpx; | |||||
| margin: 0 auto; | |||||
| padding-top: 30rpx; | |||||
| box-sizing: border-box; | |||||
| } | |||||
| .gameimg{ | |||||
| position: absolute; | |||||
| right: 25rpx; | |||||
| top: -14rpx; | |||||
| width: 250rpx; | |||||
| } | |||||
| .game text { | |||||
| display: block; | |||||
| position: relative; | |||||
| } | |||||
| .game text:nth-of-type(1) { | |||||
| display: inline-block; | |||||
| padding-top: 39rpx; | |||||
| padding-left: 70rpx; | |||||
| font-size: 32rpx; | |||||
| color: #333; | |||||
| line-height: 36rpx; | |||||
| } | |||||
| .game text:nth-of-type(2) { | |||||
| font-size: 24rpx; | |||||
| color: #999; | |||||
| line-height: 24rpx; | |||||
| padding-left: 70rpx; | |||||
| } | |||||
| @@ -12,7 +12,7 @@ | |||||
| }, | }, | ||||
| "compileType": "miniprogram", | "compileType": "miniprogram", | ||||
| "libVersion": "2.0.9", | "libVersion": "2.0.9", | ||||
| "appid": "wxea71200db93d756b", | |||||
| "appid": "wx649b3be73c1afe47", | |||||
| "projectname": "C", | "projectname": "C", | ||||
| "isGameTourist": false, | "isGameTourist": false, | ||||
| "condition": { | "condition": { | ||||