| @@ -1,10 +1,10 @@ | |||
| { | |||
| "pages": [ | |||
| "pages/middle/index", | |||
| "pages/index/index", | |||
| "pages/rank/index", | |||
| "pages/out/index", | |||
| "pages/login/index", | |||
| "pages/out/index", | |||
| "pages/middle/index", | |||
| "pages/rank/index", | |||
| "pages/AR/index", | |||
| "components/loading/loading" | |||
| ], | |||
| @@ -22,13 +22,15 @@ Page({ | |||
| apiSecret: '483e000a38265687c058efb7ab66cbc0917a3331b6dbf5482df46c76cb749529', // EasyAR开发中心 - API KEY - API Secret | |||
| crsAppId: '8911f4b8f03725e300ca4130c01f27e9', // EasyAR开发中心 - 云服务 - 云识别管理 - 云识别库信息 - CRS AppId | |||
| token: '', | |||
| clientHost: 'http://bd9b3490fe845642e600cf53f0cd64b8.cn1.crs.easyar.com:8080', //服务器一般不变 | |||
| clientHost: 'https://bd9b3490fe845642e600cf53f0cd64b8.cn1.crs.easyar.com:8443', //服务器一般不变 | |||
| jpegQuality: 0.7, //JPEG压缩质量,建议不低于70% | |||
| minInterval: 1000, //最短的两次CRS请求间隔 | |||
| }, | |||
| //识别到这个数组中的ID就触发内容 | |||
| targetIds: [ | |||
| "", | |||
| "6c27e0a1-e4ca-424d-9062-4c8ec676a5ad", | |||
| "ec72a9a2-20d5-4b86-82db-05f29e1c0fbb", | |||
| "f0bdba05-e610-4d1c-811a-5034ccc0d1f7", | |||
| "79014ee9-60c7-4a0c-81ed-0d5889a7ecc9" | |||
| ], | |||
| showLoading: false, | |||
| @@ -6,16 +6,23 @@ Page({ | |||
| data: { | |||
| ischecked: true, | |||
| bindInfo: false, | |||
| avatarModal: false, | |||
| phoneModal: false, | |||
| phoneModal1: false, | |||
| showBg: false, | |||
| step: 0,// 头像授权1, 手机授权2 | |||
| nickNamebind: false, | |||
| phonebind: false, | |||
| userInfo: null, | |||
| userid:'', | |||
| token: '' | |||
| }, | |||
| onLoad() { | |||
| this.loginGettoken() | |||
| console.log(getApp()) | |||
| }, | |||
| backGame(){ | |||
| backhome(){ | |||
| wx.navigateTo({ | |||
| url: '' | |||
| url: '/pages/index/index' | |||
| }) | |||
| }, | |||
| checkFun(){ | |||
| @@ -25,7 +32,30 @@ Page({ | |||
| }, | |||
| // 协议 | |||
| toxieyi(){ | |||
| }, | |||
| shouquan(){ | |||
| if(this.data.step==1){ | |||
| this.setData({ | |||
| avatarModal: true, | |||
| showBg: true | |||
| }) | |||
| } | |||
| if(this.data.step==2){ | |||
| this.setData({ | |||
| phoneModal: true, | |||
| showBg: true | |||
| }) | |||
| } | |||
| }, | |||
| closeModal(){ | |||
| this.setData({ | |||
| showBg: false | |||
| }) | |||
| }, | |||
| leave(){ | |||
| wx.navigateTo({ | |||
| url: '../out/index?index=1', | |||
| }) | |||
| }, | |||
| //登录-获取token | |||
| loginGettoken(){ | |||
| @@ -44,10 +74,38 @@ Page({ | |||
| }, | |||
| success(res1) { | |||
| if (res1.statusCode == 200) { | |||
| let userInfo = res1.data.user_info | |||
| that.setData({ | |||
| token: res1.data.access_token, | |||
| userid: res1.data.user_info.id | |||
| userid: userInfo.id, | |||
| userInfo: userInfo | |||
| }) | |||
| if(!!userInfo.userWxName&&!!userInfo.phone){ | |||
| that.leave() | |||
| return; | |||
| } | |||
| // console.log(userInfo) | |||
| if(!userInfo.userWxName||!userInfo.phone){ | |||
| that.setData({ | |||
| showBg: true | |||
| }) | |||
| }else{ | |||
| that.setData({ | |||
| showBg: false | |||
| }) | |||
| } | |||
| that.setData({ | |||
| avatarModal: !!userInfo.userWxName?false:true, | |||
| phoneModal1: !!userInfo.phone?false:true, | |||
| step: 1 | |||
| }) | |||
| if(!that.data.avatarModal){ | |||
| that.setData({ | |||
| step: 2, | |||
| phoneModal: that.data.phoneModal1 | |||
| }) | |||
| } | |||
| } | |||
| } | |||
| }) | |||
| @@ -76,27 +134,32 @@ Page({ | |||
| success(res) { | |||
| if (res.statusCode == 200) { | |||
| that.setData({ | |||
| bindInfo: true | |||
| avatarModal: false, | |||
| step: 2 | |||
| }) | |||
| console.log('绑定用户头像信息成功') | |||
| if(that.data.phoneModal1){ | |||
| that.setData({ | |||
| phoneModal: true | |||
| }) | |||
| } | |||
| } | |||
| } | |||
| }) | |||
| }, | |||
| getUserInfo(){ | |||
| if(!this.data.ischecked){ | |||
| wx.showToast({ | |||
| title: '请勾选协议', | |||
| icon: 'none', | |||
| duration: 2000 | |||
| }) | |||
| return; | |||
| } | |||
| // if(!this.data.ischecked){ | |||
| // wx.showToast({ | |||
| // title: '请勾选协议', | |||
| // icon: 'none', | |||
| // duration: 2000 | |||
| // }) | |||
| // return; | |||
| // } | |||
| let that = this | |||
| wx.getUserProfile({ | |||
| desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 | |||
| success: (res) => { | |||
| console.log(res) | |||
| // console.log(res) | |||
| that.bindNickname(res.userInfo) | |||
| } | |||
| }) | |||
| @@ -122,8 +185,14 @@ Page({ | |||
| }, | |||
| success(res) { | |||
| console.log(res) | |||
| if (res.statusCode == 200) { | |||
| if (res.data.code == 0) { | |||
| // console.log(res) | |||
| that.setData({ | |||
| phoneModal: false, | |||
| showBg: false, | |||
| step: 0 | |||
| }) | |||
| that.leave() | |||
| } | |||
| } | |||
| }) | |||
| @@ -5,15 +5,24 @@ | |||
| <image class="title" src="https://static.quhouse.com/18484fa813a24a64bd007dfca3652379.png"></image> | |||
| <image class="search" src="https://static.quhouse.com/72cac48d2d804744bd83a2a882713a6f.png"></image> | |||
| <image class="logo" src="https://static.quhouse.com/fecdef9ed6a045aaade3d48980e33a35.png"></image> | |||
| <view class="agreement"> | |||
| <image class="checked" bindtap="checkFun" | |||
| <!-- <view class="agreement"> | |||
| <image class="checked" | |||
| wx:if="{{ischecked}}" src="https://static.quhouse.com/4024a0e92b0245a7b14cc5c78cab90f7.png"></image> | |||
| <view class="nocheck" bindtap="checkFun" wx:else></view> | |||
| <view class="text" bindtap="checkFun">勾选表示您已阅读并同意</view> | |||
| <view class="text text1" bindtap="toxieyi">《隐私协议》</view> | |||
| <view class="text">勾选表示您已阅读并同意</view> | |||
| <view class="text text1">《隐私协议》</view> | |||
| </view> --> | |||
| <view class="btn" bindtap="shouquan">微信一键授权</view> | |||
| <view class="btn btn1" bindtap="backhome">返回游戏</view> | |||
| </view> | |||
| <view class="bg" wx:if="{{showBg}}"> | |||
| <view class="avatar-modal" wx:if="{{avatarModal}}"> | |||
| <view class="desc">请授权"加油新青年"获取您的昵称、头像</view> | |||
| <view class="btn" bindtap="getUserInfo">授权</view> | |||
| </view> | |||
| <view class="phope-modal" wx:if="{{phoneModal}}"> | |||
| <view class="desc">请授权"加油新青年"获取您的手机号</view> | |||
| <button class="phone-btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">授权</button> | |||
| </view> | |||
| <button class="btn" wx:if="{{bindInfo}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">绑定手机号</button> | |||
| <view class="btn" wx:else bindtap="getUserInfo">微信一键登录</view> | |||
| <view class="btn btn1" bindtap="backGame">返回游戏</view> | |||
| <image class="close" bindtap="closeModal" src="https://static.quhouse.com/e37ca20892a04e8391b611968ff6c944.png"></image> | |||
| </view> | |||
| </view> | |||
| @@ -90,4 +90,54 @@ color: #CE592E; | |||
| background:#FFFFFF; | |||
| border: 2rpx solid #CE592E; | |||
| margin-top: 30rpx; | |||
| } | |||
| } | |||
| .bg{ | |||
| position: fixed; | |||
| top: 0; | |||
| left: 0; | |||
| right: 0; | |||
| bottom: 0; | |||
| background-color: rgba(0,0,0,0.69); | |||
| display: flex; | |||
| flex-direction: column; | |||
| justify-content: center; | |||
| align-items: center; | |||
| } | |||
| .avatar-modal,.phope-modal{ | |||
| width: 650rpx; | |||
| height: 392rpx; | |||
| background: url('https://static.quhouse.com/8bf6c53566574d01ad6836a894511b95.png') no-repeat; | |||
| background-size: 650rpx 392rpx; | |||
| display: flex; | |||
| justify-content: center; | |||
| flex-direction: column; | |||
| align-items: center; | |||
| } | |||
| .desc{ | |||
| width: 434rpx; | |||
| height: 96rpx; | |||
| font-size: 32rpx; | |||
| text-align: center; | |||
| font-family: PingFangSC-Medium, PingFang SC; | |||
| font-weight: 500; | |||
| color: #000000; | |||
| line-height: 48rpx; | |||
| margin-bottom: 60rpx; | |||
| } | |||
| .phone-btn{ | |||
| width: 510rpx !important; | |||
| height: 96rpx !important; | |||
| background: #CE592E; | |||
| border-radius: 48rpx; | |||
| line-height: 96rpx !important; | |||
| color: #fff; | |||
| font-size: 32rpx; | |||
| padding: 0; | |||
| font-family: PingFangSC-Regular, PingFang SC; | |||
| font-weight: 400; | |||
| } | |||
| .bg .close{ | |||
| margin-top: 40rpx; | |||
| width: 54rpx; | |||
| height: 54rpx; | |||
| } | |||
| @@ -8,7 +8,6 @@ Page({ | |||
| web:null, | |||
| index:0, | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面加载 | |||
| */ | |||
| @@ -1,3 +1,3 @@ | |||
| <web-view wx:if="{{index==1}}" src="https://www.baidu.com/"></web-view> | |||
| <web-view wx:if="{{index==1}}" src="https://cloudcreategameoss.sxycy.games/pro/games/test/3d_dance/"></web-view> | |||
| <web-view wx:if="{{index==2}}" src="{{web}}"></web-view> | |||
| @@ -5,7 +5,7 @@ | |||
| "include": [] | |||
| }, | |||
| "setting": { | |||
| "urlCheck": false, | |||
| "urlCheck": true, | |||
| "es6": true, | |||
| "enhance": false, | |||
| "postcss": true, | |||