From b6d31ccb2915e41bb71813e465edc656a2ce57a9 Mon Sep 17 00:00:00 2001 From: corala <18339694416@163.com> Date: Mon, 25 Apr 2022 16:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E4=BA=AB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 14 +++--- app.json | 1 + pages/AR/index.js | 8 ++-- pages/login/index.js | 32 +++++-------- pages/login/index.wxml | 6 --- pages/login/index.wxss | 19 +------- pages/out/index.json | 3 +- pages/share/index.js | 101 +++++++++++++++++++++++++++++++++++++++++ pages/share/index.json | 4 ++ pages/share/index.wxml | 15 ++++++ pages/share/index.wxss | 75 ++++++++++++++++++++++++++++++ 11 files changed, 221 insertions(+), 57 deletions(-) create mode 100644 pages/share/index.js create mode 100644 pages/share/index.json create mode 100644 pages/share/index.wxml create mode 100644 pages/share/index.wxss diff --git a/app.js b/app.js index 2d0bb0e..c270d1a 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,5 @@ // app.js import './utils/umtrack-wx'; -// import "./components/umtrack-wx"; -// require('umtrack-wx'); App({ umengConfig: { appKey: '6260d691d024421570c69177', //由友盟分配的APP_KEY @@ -20,14 +18,14 @@ App({ logs.unshift(Date.now()) wx.setStorageSync('logs', logs) // 登录 - wx.login({ - success: res => { - // 发送 res.code 到后台换取 openId, sessionKey, unionId - } - }) + // wx.login({ + // success: res => { + // // 发送 res.code 到后台换取 openId, sessionKey, unionId + // } + // }) }, globalData: { userInfo: null, - token: '' + token: '1212121212' } }) diff --git a/app.json b/app.json index c99c57c..b4a582a 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,7 @@ { "pages": [ "pages/index/index", + "pages/share/index", "pages/login/index", "pages/out/index", "pages/middle/index", diff --git a/pages/AR/index.js b/pages/AR/index.js index 6b38b0a..4ac648a 100644 --- a/pages/AR/index.js +++ b/pages/AR/index.js @@ -66,11 +66,15 @@ Page({ console.info(err); }); }, + onHide(){ + console.log('tuichu') + clearInterval(timer); + }, daojishi(){ var t = 10; var timer = setInterval(function(){ t--; - if(t<4){ + if(t<2){ wx.showToast({ icon: 'none', title: '扫描时间过长,请退出后重新扫描!', @@ -95,9 +99,7 @@ Page({ showLoading: false, }); }, - //图像识别部分: - onShow: function () { if (this.listener) this.listener.start(); //页面隐藏时相机帧的监听会自动停止,但恢复展示时不会自动启动,这里手动启动 this.scan() diff --git a/pages/login/index.js b/pages/login/index.js index b9c58fb..90800c1 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -4,8 +4,6 @@ const app = getApp() Page({ data: { - ischecked: true, - bindInfo: false, avatarModal: false, phoneModal: false, phoneModal1: false, @@ -25,15 +23,15 @@ Page({ url: '/pages/index/index' }) }, - checkFun(){ - this.setData({ - ischecked: !this.data.ischecked - }) - }, - // 协议 - toxieyi(){ - }, + shouquan(){ + let userInfo = wx.getStorageSync('userInfo') + if(userInfo.phone){ + wx.showToast({ + icon: 'none', + title: '您已完成授权', + }) + } if(this.data.step==1){ this.setData({ avatarModal: true, @@ -54,7 +52,7 @@ Page({ }, leave(){ wx.navigateTo({ - url: '../out/index?index=1&userid='+ this.data.userid+'&gameid=1'+'&type=2', + url: '/pages/out/index?index=1&userid='+ this.data.userid+'&gameid=1'+'&type=2', }) }, //登录-获取token @@ -80,12 +78,12 @@ Page({ userid: userInfo.id, userInfo: userInfo }) + wx.setStorageSync('token', res1.data.access_token) + wx.setStorageSync('userInfo', userInfo) if(!!userInfo.userWxName&&!!userInfo.phone){ that.leave() return; } - // console.log(userInfo) - if(!userInfo.userWxName||!userInfo.phone){ that.setData({ showBg: true @@ -147,14 +145,6 @@ Page({ }) }, getUserInfo(){ - // if(!this.data.ischecked){ - // wx.showToast({ - // title: '请勾选协议', - // icon: 'none', - // duration: 2000 - // }) - // return; - // } let that = this wx.getUserProfile({ desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 211dc3c..6ebaf88 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -5,12 +5,6 @@ - 微信一键授权 返回游戏 diff --git a/pages/login/index.wxss b/pages/login/index.wxss index 4caf96f..9e7c5d1 100644 --- a/pages/login/index.wxss +++ b/pages/login/index.wxss @@ -42,24 +42,7 @@ height: 58rpx; margin-bottom: 42rpx; } -.agreement{ - display: flex; - align-items: center; - justify-content: flex-start; - margin-bottom: 30rpx; -} -.checked{ - width: 28rpx; - height: 28rpx; - margin-right: 8rpx; -} -.nocheck{ - width: 24rpx; - height: 24rpx; - margin-right: 8rpx; - border: 2rpx #CE592E solid; - border-radius: 5rpx; -} + .text{ height: 32rpx; font-size: 24rpx; diff --git a/pages/out/index.json b/pages/out/index.json index 8835af0..965b8e8 100644 --- a/pages/out/index.json +++ b/pages/out/index.json @@ -1,3 +1,4 @@ { - "usingComponents": {} + "usingComponents": {}, + "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/share/index.js b/pages/share/index.js new file mode 100644 index 0000000..fc4b29e --- /dev/null +++ b/pages/share/index.js @@ -0,0 +1,101 @@ +// pages/out/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + backGame(){ + wx.navigateBack({ + delta: 1 + }) + // let userInfo = wx.getStorageSync('userInfo') + // wx.navigateTo({ + // url: `/pages/out/index?index=1&userid=${userInfo.id}&gameid=1&type=2`, + // }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function (e) { + console.log(e) + this.shareFun() + return { + title: '5.5元购新房万份好礼免费兑', + imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', + path: '/pages/index/index' + } + }, + shareFun(){ + let token = wx.getStorageSync('token') + wx.request({ + url: 'https://cktest.2weisou.com/meta/ar/user/share', + method: "POST", + data: {}, + header: { + Authorization: 'bearer '+ token + }, + success(res) { + console.log(res) + if (res.data.code == 0) { + + }else{ + wx.showToast({ + icon: 'none', + title: res.data.msg + }) + return ; + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/share/index.json b/pages/share/index.json new file mode 100644 index 0000000..965b8e8 --- /dev/null +++ b/pages/share/index.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/share/index.wxml b/pages/share/index.wxml new file mode 100644 index 0000000..bb62200 --- /dev/null +++ b/pages/share/index.wxml @@ -0,0 +1,15 @@ + + + + + + 邀请好友 + 每邀请1位好友参与游戏,可增加1次游戏机会 + + + + + + + + \ No newline at end of file diff --git a/pages/share/index.wxss b/pages/share/index.wxss new file mode 100644 index 0000000..0dd822f --- /dev/null +++ b/pages/share/index.wxss @@ -0,0 +1,75 @@ +.container{ + background: url('https://static.quhouse.com/7f51a916a2fb4eb983f65295963bddd8.png') no-repeat; + width: 750rpx; + height: 1624rpx; + background-size: 750rpx 1624rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +.contbox{ + width: 564rpx; + height: 434rpx; + background: #CE592E; + box-shadow: inset 0px 1rpx 3rpx 0px #FFFFFF; + position: relative; + box-sizing: content-box; + border-radius: 100rpx 100rpx 72rpx 72rpx; + display: flex; + align-items: center; + justify-content: center; +} +.insetbox{ + width: 538rpx; + height: 402rpx; + background: #F8F8F8; + box-shadow: 0px -1rpx 2rpx 0px #C85931, inset 0px 0px 16rpx 2rpx #CE592E; + border-radius: 100rpx 100rpx 72rpx 72rpx; + border: 1rpx solid #91320F; +} +.close{ + position: absolute; + right: 0; + top: -20rpx; + width: 86rpx; + height: 86rpx; +} +.topcont{ + display: flex; + margin: 82rpx 0 40rpx 55rpx; +} +.topcont .avatar{ + width: 128rpx; + height: 128rpx; + margin-right: 24rpx; +} +.title{ + flex:1; + height: 44rpx; + font-size: 32rpx; + font-family: PingFangSC-Semibold, PingFang SC; + font-weight: 600; + color: #CE592E; + line-height: 44rpx; +} +.title .text{ + margin-top: 12rpx; + width:298rpx; + height: 74rpx; + font-size: 26rpx; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #CE592E; + line-height: 37rpx; +} +.insetbox .btn{ + width: 280rpx; + height: 92rpx; + margin-left: 130rpx; + background: url('https://static.quhouse.com/cbbbda43ce244fe39c235f59c2b1e8fa.png') no-repeat; + background-size: cover; + padding: 0; +} + +