| this.globalData.userInfoData.avatarUrl = userInfoData.avatarUrl; | this.globalData.userInfoData.avatarUrl = userInfoData.avatarUrl; | ||||
| this.globalData.userInfoData.nickName = userInfoData.nickName; | this.globalData.userInfoData.nickName = userInfoData.nickName; | ||||
| } | } | ||||
| var userPhoneType = wx.getStorageSync('userPhoneType'); | |||||
| if (userPhoneType) { | |||||
| this.globalData.userPhoneType = userPhoneType; | |||||
| } else { | |||||
| this.getPhoneType(); | |||||
| } | |||||
| }, | |||||
| getPhoneType() {//获取手机类型 | |||||
| wx.getSystemInfo({ | |||||
| success: res => { | |||||
| wx.setStorageSync("userPhoneType", res.platform); | |||||
| this.globalData.userPhoneType = res.platform; | |||||
| } | |||||
| }) | |||||
| }, | }, | ||||
| wxLogin() { | wxLogin() { | ||||
| wx.login({ | wx.login({ | ||||
| userInfoData:null, | userInfoData:null, | ||||
| certificationState:0,//1车主,2合伙人,3同事 | certificationState:0,//1车主,2合伙人,3同事 | ||||
| mobileData:null, | mobileData:null, | ||||
| userPhoneType:null, | |||||
| }, | }, | ||||
| // 获取openId | // 获取openId | ||||
| getOpenid: function (code) { | getOpenid: function (code) { |
| }, | }, | ||||
| isAddress: false,//是否有地址 | isAddress: false,//是否有地址 | ||||
| phoneInputShow: false,//是否显示电话输入框 | phoneInputShow: false,//是否显示电话输入框 | ||||
| marginT:0, | |||||
| }, | }, | ||||
| /** | /** | ||||
| */ | */ | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| app.globalData.nowPage = 4; | app.globalData.nowPage = 4; | ||||
| if (app.globalData.userPhoneType=="ios"){ | |||||
| this.setData({ | |||||
| marginT:-20 | |||||
| }) | |||||
| } | |||||
| if (app.globalData.openid) { | if (app.globalData.openid) { | ||||
| this.loadFun(); | this.loadFun(); | ||||
| } else { | } else { |
| </view> | </view> | ||||
| <view class="msgGroup addressDetail"> | <view class="msgGroup addressDetail"> | ||||
| <view class="msgTitle">详细地址:</view> | <view class="msgTitle">详细地址:</view> | ||||
| <textarea class="msgInput addressTextarea" style="margin:-1rpx;padding:1rpx;" bindinput="getAddressDetail" value="{{submitData.addressDetail}}"></textarea> | |||||
| <textarea class="msgInput addressTextarea" style="margin-top:{{marginT}}rpx;" bindinput="getAddressDetail" value="{{submitData.addressDetail}}"></textarea> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class="saveAddress" bindtap="submitAddress">保存</view> | <view class="saveAddress" bindtap="submitAddress">保存</view> |
| }) | }) | ||||
| }, | }, | ||||
| openGameRule: function () {//打开游戏玩法 | openGameRule: function () {//打开游戏玩法 | ||||
| console.log(this.data.gameState); | |||||
| if(!this.data.gameState){ | if(!this.data.gameState){ | ||||
| this.setData({ | this.setData({ | ||||
| ruleShow: true | ruleShow: true | ||||
| app.wxRequest(app.globalData.urlRoot + "address/getAddress", {}, res => { | app.wxRequest(app.globalData.urlRoot + "address/getAddress", {}, res => { | ||||
| if (res.code == 200) { | if (res.code == 200) { | ||||
| if (res.data) { | if (res.data) { | ||||
| this.data.isAddress = true; | |||||
| this.setData({ | |||||
| isAddress:true | |||||
| }) | |||||
| } | } | ||||
| } | } | ||||
| }, this) | }, this) |
| <!-- <view class="prizeName">头等舱机票一张</view> --> | <!-- <view class="prizeName">头等舱机票一张</view> --> | ||||
| <image class="prizePic" src="{{endGameData.awardPicUrl}}" mode="aspectFit"></image> | <image class="prizePic" src="{{endGameData.awardPicUrl}}" mode="aspectFit"></image> | ||||
| <view class="prizeName">{{endGameData.awardName}}</view> | <view class="prizeName">{{endGameData.awardName}}</view> | ||||
| <view class="startRegister" wx:if="{{isAddress}}" bindtap="receive">立即领取</view> | |||||
| <view class="startRegister" wx:if="{{!isAddress}}" bindtap="userRegister">立即注册</view> | |||||
| <view class="startRegister" wx:if="{{(isAddress || endGameData.needAddress==0)}}" bindtap="receive">立即领取</view> | |||||
| <view class="startRegister" wx:if="{{(!isAddress && endGameData.needAddress!=0)}}" bindtap="userRegister">立即注册</view> | |||||
| </view> | </view> | ||||
| <view class="successGroup" wx:if="{{pizeTip==2 || pizeTip==3}}"> | <view class="successGroup" wx:if="{{pizeTip==2 || pizeTip==3}}"> | ||||
| <image class="gameRuleClose" style="top:-31rpx;right:-29rpx;" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | |||||
| <image class="gameRuleClose" bindtap="closeWindow" style="top:-31rpx;right:-29rpx;" src="{{imgUrl+'/images/gameRuleClose.png'}}"></image> | |||||
| <image class="successIcon" src="{{imgUrl+'/images/failIcon.png'}}"></image> | <image class="successIcon" src="{{imgUrl+'/images/failIcon.png'}}"></image> | ||||
| <view class="titleGroup"></view> | <view class="titleGroup"></view> | ||||
| <view class="failText" style="margin-top:113rpx;">运气就差一点点</view> | <view class="failText" style="margin-top:113rpx;">运气就差一点点</view> |
| wx.canvasToTempFilePath({ | wx.canvasToTempFilePath({ | ||||
| width:scale*444, | width:scale*444, | ||||
| height: scale * 817, | height: scale * 817, | ||||
| // width: scale*this.data.windowW, | |||||
| // height: scale *this.data.windowH, | |||||
| canvasId: 'myCanvas', | canvasId: 'myCanvas', | ||||
| success: res => { | success: res => { | ||||
| this.data.posterUrl.push(res.tempFilePath); | this.data.posterUrl.push(res.tempFilePath); |
| z-index: 2; | z-index: 2; | ||||
| } | } | ||||
| .canvasDraw{ | .canvasDraw{ | ||||
| /* width:1776rpx; | |||||
| height:3268rpx; */ | |||||
| width:400%; | |||||
| height:400%; | |||||
| width:1776rpx; | |||||
| height:3268rpx; | |||||
| position: fixed; | position: fixed; | ||||
| top: 0; | top: 0; | ||||
| left: -1776rpx; | left: -1776rpx; | ||||
| background-color: black; | |||||
| } | } | ||||
| .lookBigPic{ | .lookBigPic{ | ||||
| display: flex; | display: flex; |