From 043b24bd2169859546fbb811c69aaec52028cb49 Mon Sep 17 00:00:00 2001 From: Wkang921 Date: Tue, 18 Jul 2023 19:56:05 +0800 Subject: [PATCH] no msg --- .DS_Store | Bin 10244 -> 10244 bytes pages/home/xy/index.js | 54 +++++++++- pages/home/xy/index.wxml | 22 ++++- pages/home/xy/index.wxss | 46 ++++++++- pages/home/xyc/index.wxml | 67 +++++++------ pages/home/xyc/index.wxss | 201 ++++++++++++++++++-------------------- pages/index/index.js | 7 +- pages/index/index.wxss | 16 +-- 8 files changed, 260 insertions(+), 153 deletions(-) diff --git a/.DS_Store b/.DS_Store index 3df66cea0897fae1c49a5da207a04a5487a90fe6..33729934e801330450946f0e7cd92f3e7c5ace2e 100644 GIT binary patch delta 40 scmZn(XbIS`MSzV_oPmL{V)8BlZPw2q*5+3NhnObEOS1x*n}mZz0RPkshX4Qo delta 33 pcmZn(XbIS`MPPEAfZ*h#0t%Bm1q3#K71+)+*-Sui^Il{ if(res.data.code==200){ this.setData({userInfo:res.data.data}) - } - if(res.data.data.horoscope){ - this.setData({visible: true}) + this.isFirst() } }).catch((err)=>{ console.log(err); @@ -46,7 +45,51 @@ Page({ }, // 关闭运势提示 closeYs(){ - this.setData({visible: !this.data.visible}) + this.setData({visible: !this.data.visible, showEnergy: true}) + if (this.data.visible) { + const time = setTimeout(() => { + this.setData({showEnergy: false}) + }, 1000); + this.setData({time : time}) + } + if (!this.data.visible) { + clearTimeout(this.data.time) + } + }, + + // 判断是否第一次登入 + isFirst(){ + const isFirst = wx.getStorageSync('isFirst') + if (isFirst) { + this.setData({ + showIsFirst: true, + visible: false + }) + }else { + if (this.data.userInfo.horoscope) { + this.setData({visible: true, showIsFirst: false}) + setTimeout(() => { + this.setData({showEnergy: false}) + }, 3000); + } + } + }, + + // 关闭第一次登入弹层 + closeFirst(){ + console.log('关闭弹层'); + this.setData({showIsFirst: false}) + }, + childTap() { + console.log('子盒子被点击'); + }, + + // 提升运势 + upImprove(){ + const mac = wx.getStorageSync('mac-key') + req.patchRequest('/api/user/curt/horoscope/improve',{mac: mac}).then(res => { + console.log(res); + }) }, /** @@ -60,6 +103,7 @@ Page({ */ onShow() { this.initXy() + this.upImprove() }, /** diff --git a/pages/home/xy/index.wxml b/pages/home/xy/index.wxml index 831f9de..1196d9e 100644 --- a/pages/home/xy/index.wxml +++ b/pages/home/xy/index.wxml @@ -7,15 +7,19 @@ - + {{userInfo.horoscope.number}} {{userInfo.horoscope.color}} 幸运数字 {{userInfo.horoscope.name}} 幸运颜色 -能量 +{{userInfo.pendantEnergy}}% -银币 +{{userInfo.silverCoin}}枚 + + + 能量 + 10% + 银币 + 0.1枚 + + @@ -26,3 +30,15 @@ 爱情指数 财运指数 + + + + + + Hi~ + 我是你的星座守护精灵 + 从今以后,就让我来守护你吧! + 之后可以在精灵页面找到我 + 还可以跟我对话哦~ + + \ No newline at end of file diff --git a/pages/home/xy/index.wxss b/pages/home/xy/index.wxss index ee8ae24..c3e45d2 100644 --- a/pages/home/xy/index.wxss +++ b/pages/home/xy/index.wxss @@ -145,7 +145,6 @@ background-size:100% 100%; margin-top:1232rpx; margin-left:316.67rpx; - background-image: url(https://wish-assets.windymuse.com.cn/xy/byz.png); } .xyysy{ @@ -301,6 +300,15 @@ font-size: 27rpx; } + .showEnergy { + transition: all 0.5s; + opacity: 1; + } + + .hide { + opacity: 0; + } + .xyj{ position: absolute; width: 240rpx; @@ -317,3 +325,39 @@ text-align: center; font-size: 27rpx; } + + .isFirst { + position: absolute; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + background-color: rgba(255, 255, 255, 0.7); + } + + .isFirst-img { + width: 328rpx; + height: 774rpx; + margin-top: 290rpx; + background-size: contain; + background-image: url(https://ydxxkj-wish.oss-cn-hangzhou.aliyuncs.com/xy/isFistImg.png); + } + + .isFirst-box { + position: absolute; + top: 600rpx; + width: 514rpx; + height: 300rpx; + padding: 40rpx 66rpx; + box-sizing: border-box; + border-radius: 30rpx; + opacity: 0.9; + background-color: rgba(255, 255, 255, 1); + color: rgba(108, 108, 108, 1); + font-size: 28rpx; + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + } + + .isFirst-box view { + margin-bottom: 6rpx; + } \ No newline at end of file diff --git a/pages/home/xyc/index.wxml b/pages/home/xyc/index.wxml index 6b6c6db..91a4327 100644 --- a/pages/home/xyc/index.wxml +++ b/pages/home/xyc/index.wxml @@ -15,41 +15,52 @@ - + - 许愿内容 - 期望时间 - 许愿链接 - 许愿图片 - - - - - - + 许愿内容 + + + + + 期望时间 + + + + + 许愿链接 + + + + + 许愿图片 + - + > + + + + + 取消 + 完成 + - - 取消 - 完成 diff --git a/pages/home/xyc/index.wxss b/pages/home/xyc/index.wxss index 98b36e7..ac2c7ee 100644 --- a/pages/home/xyc/index.wxss +++ b/pages/home/xyc/index.wxss @@ -191,126 +191,81 @@ .txypop{ margin-top: 50rpx; - width: 710rpx; - height:1300rpx; - border-radius: 30rpx!important; + width: 100%; + height: 100%; + display: flex; + justify-content: center; } .ttop1{ - margin-left: 30rpx; - width: 650rpx; - height:1240rpx; - margin-top:30rpx; - background-repeat: no-repeat; - background-size:100% 100%; - background-image: url(https://wish-assets.windymuse.com.cn/xy/xybjta.png); + width: 744rpx; + height: 1296rpx; + margin-top: 130rpx; + padding-top: 230rpx; + box-sizing: border-box; + display: flex; + align-items: center; + flex-direction: column; + background: url(https://wish-assets.windymuse.com.cn/xy/xybjta.png) no-repeat; + background-size: cover; +} + +.ttop1-item { + width: 574rpx; + margin-bottom: 42rpx; + display: flex; + align-items: center; +} + +.ttop1-item .t-input { + flex: none; } .xynr{ - position: absolute; - left: 92rpx; - top: 230rpx; - width: 72px; - height: 24px; - color: rgba(108, 108, 108, 1); - font-size: 16px; + height: 100%; + margin-right: 56rpx; + color: #6c6c6c; + font-size: 32rpx; text-align: left; - font-family: SourceHanSansSC-regular; +} + +.xynrf{ + width: 392rpx; + height: 180rpx; + padding: 12rpx !important; + border-radius: 20rpx; + color: #888888; + font-size: 28rpx; + text-align: left; + border: 1px solid rgba(187, 187, 187, 1); } .qwsj{ - position: absolute; - left: 92rpx; - top: 468rpx; - width: 72px; - height: 24px; + margin-right: 56rpx; color: rgba(108, 108, 108, 1); - font-size: 16px; + font-size: 32rpx; text-align: left; - font-family: SourceHanSansSC-regular; } .xylj{ - position: absolute; - left: 92rpx; -top: 588rpx; -width: 72px; -height: 24px; -color: rgba(108, 108, 108, 1); -font-size: 16px; -text-align: left; -font-family: SourceHanSansSC-regular; + margin-right: 56rpx; + color: rgba(108, 108, 108, 1); + font-size: 32rpx; + text-align: left; } .xytp{ - position: absolute; - left: 92rpx; -top: 692rpx; -width: 72px; -height: 24px; -color: rgba(108, 108, 108, 1); -font-size: 16px; -text-align: left; -font-family: SourceHanSansSC-regular; -} - -.qx{ - position: absolute; - left: 92rpx; -top: 994rpx; -width: 105px; -height: 35px; -line-height: 35px; -border-radius: 10px; -background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%); -text-align: center; -box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); -border: 3px solid rgba(255, 255, 255, 1); -color: rgba(255, 255, 255, 1); -font-size: 14px; -text-align: center; -font-family: SourceHanSansSC-medium; -} - -.wc{ - position: absolute; - left: 414rpx; -top: 994rpx; -width: 105px; -height: 35px; -line-height: 35px; -border-radius: 10px; -background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%); -text-align: center; -box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); -border: 3px solid rgba(255, 255, 255, 1); -color: rgba(255, 255, 255, 1); -font-size: 14px; -text-align: center; -font-family: SourceHanSansSC-medium; -} - -.xynrf{ - position: absolute; - left: 250rpx; - top: 230rpx; - width: 350rpx; - height: 180rpx; - line-height: 40rpx; - border-radius: 20rpx; - color: rgba(136, 136, 136, 1); - font-size: 28rpx; + margin-right: 56rpx; + height: 100%; + color: rgba(108, 108, 108, 1); + font-size: 32rpx; text-align: left; - border: 1px solid rgba(187, 187, 187, 1); } .xyljt{ - position: absolute; - left: 218rpx; - top: 490rpx; padding: 0 0 0 20rpx !important; box-sizing: border-box; - width: 350rpx!important; + width: 392rpx!important; height: 80rpx!important; line-height: 80rpx!important; border-radius: 20rpx; @@ -323,12 +278,9 @@ font-family: SourceHanSansSC-medium; } .qwsjt{ - position: absolute; - left: 220rpx; - top: 448rpx; padding: 0 20rpx !important; box-sizing: border-box; - width: 350rpx!important; + width: 392rpx!important; height: 80rpx!important; border-radius: 20rpx; color: rgba(136, 136, 136, 1); @@ -336,20 +288,57 @@ font-family: SourceHanSansSC-medium; border: 1px solid rgba(187, 187, 187, 1); } -.xytpt{ - position: absolute; - width:600rpx; +.t-grid-item { + width: 100% !important; +} + +/* .xytpt{ */ + /* position: absolute; */ + /* width:600rpx; height:600rpx; margin-top:530rpx; - margin-left: 210rpx!important; -} + margin-left: 210rpx!important; */ + /* width: 130rpx; + height: 130rpx; */ +/* } */ .t-upload__add-icon { background-color: #FFFFFF !important; } -.t-grid { +.t-icon-add { + font-size: 120rpx; + color: rgba(234, 234, 234, 1); +} + +.t-upload { + border: 1px solid rgba(234, 234, 234, 1); +} + +/* .t-grid { background-color: transparent!important; +} */ + +.ttop1-btn { + width: 540rpx; + margin-top: 160rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.ttop1-btn .btn{ + width: 210rpx; + height: 70rpx; + border-radius: 10px; + background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%); + box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + color: rgba(255, 255, 255, 1); + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; } .ppop{ diff --git a/pages/index/index.js b/pages/index/index.js index a86adf7..88a6a7e 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -101,7 +101,6 @@ Page({ var DEV_CODE = code var PUBLIC_KEY = "" req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{ - console.log(res,'11111111'); if(res.data.code==200){//获取公钥成功 PUBLIC_KEY = res.data.data // 实例化rsa @@ -110,10 +109,13 @@ Page({ rsa.setPublicKey(PUBLIC_KEY) // 加密 const mac = rsa.encryptLong(DEV_CODE) + wx.setStorageSync('mac-key', mac) // 此处执行登录获取token操作 req.postRequest('/api/user/login',{'mac':mac}).then((res)=>{ + console.log(res); if(res.data.code==200){ - wx.setStorageSync('token', res.data.data) + wx.setStorageSync('token', res.data.data.token) + wx.setStorageSync('isFirst', res.data.data.isFirst) // 设置当前设备码 wx.setStorageSync('code', DEV_CODE) // 设置为初次识别NFC @@ -150,7 +152,6 @@ Page({ header: {'Authorization': wx.getStorageSync('token')}, method: 'GET', success: res => { - console.log(res.data.data.letterStatus); const letterStatus = res.data.data.letterStatus // 这里可以判断是否有未读信札 if (letterStatus === 'sending') { diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 2f6ce62..2987545 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -3,13 +3,15 @@ position: absolute; width: 100%; height: 100%; - padding: 88rpx 40rpx 0 40rpx; + display: flex; + justify-content: center; box-sizing: border-box; } .bg{ - width: 100%; - height: 100%; + width: 674rpx; + height: 1418rpx; + margin-top: 114rpx; box-sizing: border-box; display: flex; flex-direction: column; @@ -32,7 +34,7 @@ .alb{ width: 432rpx; height: 192rpx; - margin-top: 258rpx; + margin-top: 240rpx; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/alb.png); @@ -41,7 +43,7 @@ .qr{ width: 152rpx; height: 152rpx; - margin-top: 100rpx; + margin-top: 120rpx; display: flex; align-items: center; justify-content: center; @@ -77,7 +79,7 @@ .jstext{ width: 400rpx; height: 242rpx; - margin-top: 118rpx; + margin-top: 120rpx; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/jstext.png); } @@ -85,7 +87,7 @@ .yx{ width: 248rpx; height: 142rpx; - margin-top: 24rpx; + margin-top: 40rpx; display: flex; align-items: center; justify-content: center;