diff --git a/pages/home/jl/index.js b/pages/home/jl/index.js index effd944..af32cae 100644 --- a/pages/home/jl/index.js +++ b/pages/home/jl/index.js @@ -17,6 +17,7 @@ Page({ minute:0, minutes:0, pickerValue: [0, 0], + swiperIndex: 0, prayTime:0, //祈祷时间 prayTimeStr: '选择祈祷时长' , prayerContent:'', //祈祷内容 @@ -284,6 +285,12 @@ Page({ }, btnOK(){ const prayerEnergy = (this.data.pickerValue[0]*60 + this.data.pickerValue[1])/6 + if(this.data.pickerValue[0] === 0 && this.data.pickerValue[1] <= 5){ + wx.showToast({ + title: '祈祷时间不能小于五分钟', + icon: 'none' + }) + } if(this.data.userInfo.crystallineEnergy < 1){ return Toast({ context: this, @@ -342,7 +349,20 @@ Page({ }) }, btnShare(){ - console.log('赠送能量'); + if (this.data.loverInfo.crystallineEnergy === 100) { + return this.setData({ + showEnergy:!this.data.showEnergy, + showEnergyToast:!this.data.showEnergyToast, + toast: '对方能量已经满啦~' + }) + } + if (this.data.userInfo.crystallineEnergy === 0) { + return this.setData({ + showEnergy:!this.data.showEnergy, + showEnergyToast:!this.data.showEnergyToast, + toast: '你剩余的能量不足~' + }) + } req.patchRequest('/api/user/curt/give-crystalline-energy-to-lover',{}).then((res)=>{ console.log(res); if(res.data.code === 200){ @@ -357,12 +377,13 @@ Page({ showEnergySuccess:!this.data.showEnergySuccess, }) },2000) + }else if(res.data.code === 500){ + return this.setData({ + showEnergy:!this.data.showEnergy, + showEnergyToast:!this.data.showEnergyToast, + toast: '对方能量已经满啦~' + }) } - this.setData({ - showEnergy:!this.data.showEnergy, - showEnergyToast:!this.data.showEnergyToast, - toast:res.data.msg - }) }).catch((err)=>{ console.log('111'); this.setData({ @@ -372,6 +393,25 @@ Page({ }) }, + // 切换轮播图 + goLeftSwiper(){ + if (this.data.swiperIndex === 0) { + this.setData({swiperIndex: 2}) + }else { + this.setData({swiperIndex: this.data.swiperIndex - 1}) + } + }, + goRightSwiper(){ + if (this.data.swiperIndex === 2){ + this.setData({swiperIndex: 0}) + }else { + this.setData({swiperIndex: this.data.swiperIndex + 1}) + } + }, + swiperChange(e){ + this.setData({swiperIndex: e.detail.current}) + }, + /** * 生命周期函数--监听页面加载 */ @@ -429,15 +469,7 @@ Page({ }, ToastDialog(e) { - const { item } = e.currentTarget.dataset; - - this.setData( - { - }, - () => { - this.setData({ visible: true }); - }, - ); + this.setData({ visible: !this.data.visible }); } , onVisibleChange(e) { diff --git a/pages/home/jl/index.wxml b/pages/home/jl/index.wxml index 259aede..b245883 100644 --- a/pages/home/jl/index.wxml +++ b/pages/home/jl/index.wxml @@ -1,111 +1,6 @@ - + - - - - - - {{userInfo.nick ? userInfo.nick : userInfo.constellation}} - - - - - - - - - - - - - - - - - - - - - - - 水晶能量 - - - - - - - - - - {{userInfo.crystallineEnergy}}% - - - - - - - - 能量注入 - - - - - - - - - - - - - - - - - - - - - - 能量已经集满啦! - 可以注入到水晶中 - 增强运势哦! - - - - - 能量已注入{{crystallineEnergy}}% - 守护时间为{{guarTime}} - - - @@ -194,7 +89,7 @@ - + 祈祷 结束祈祷 @@ -208,6 +103,7 @@ color="#00A7FF" label="" t-class-bar="dcleft1" + stroke-width="10rpx" /> @@ -216,12 +112,12 @@ - - + + - - {{loverInfo.nick ? loverInfo.nick : userInfo.constellation}} + + {{userInfo.nick ? userInfo.nick : userInfo.constellation}} @@ -230,7 +126,7 @@ - + @@ -238,51 +134,141 @@ + - - - {{loverInfo.horoscope.number}} - 幸运数字 + + + + + 水晶能量 - - - -
Ta的运势
+ + + + + + + + + {{userInfo.crystallineEnergy}}% - - - {{loverInfo.horoscope.color}} - 幸运颜色 + + + + + + + 能量注入 + + + + + + + + + + + + + + + - - - - Tips:记得提醒ta哦~ - {{loverInfo.horoscope.summary}} - - - - - - - + + + + 能量已经集满啦! + 可以注入到水晶中 + 增强运势哦! + + + + + 能量已注入{{crystallineEnergy}}% + 守护时间为{{guarTime}} - -
+
+ + + + + + {{loverInfo.nick ? loverInfo.nick : userInfo.constellation}} + + + + + + + + + + + + + + + + + + + + {{loverInfo.horoscope.number}} + 幸运数字 + + + + +
Ta的运势
+
+ + + {{loverInfo.horoscope.color}} + 幸运颜色 + + +
+
- 祈祷内容 + 祈祷内容 - 祈祷时长 + 祈祷时长 {{prayTimeStr}} @@ -314,7 +300,7 @@ - + 要结束祈祷吗? 将返还{{energy}}%星座能量 溢出能量将消失 @@ -340,7 +326,7 @@ - + @@ -391,7 +377,32 @@ 能量注入中…… + + + Tips:记得提醒ta哦~ + {{loverInfo.horoscope.summary}} + + + + + + + + + + + + + + + + + +
精灵 AI
+ + + diff --git a/pages/home/jl/index.wxss b/pages/home/jl/index.wxss index d5b2296..7ab2800 100644 --- a/pages/home/jl/index.wxss +++ b/pages/home/jl/index.wxss @@ -320,10 +320,11 @@ page { } .call1-btn-qd { - height: 130rpx; + height: 170rpx; display: flex; align-items: center; justify-content: center; + flex-direction: column; } .lovepic{ @@ -335,8 +336,6 @@ page { } .dchxtxtql{ - width:200rpx; - height:16rpx; text-align: center; color: #9a9a9a; font-size: 28rpx; @@ -345,6 +344,7 @@ page { .txl{ width:72rpx; height:72rpx; + border-radius: 50% !important; margin-left: 30rpx; background-repeat: no-repeat; background-size:100% 100%; @@ -355,6 +355,7 @@ page { width:72rpx; height:72rpx; margin-right: 30rpx; + border-radius: 50% !important; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/tx.png); @@ -684,143 +685,131 @@ page { font-size: 28rpx; } +.popup { + position: absolute; + top: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + .ttpopup{ - width: 659.33rpx; - height:804rpx; - background:rgba(255, 255, 255, 0.9); - border-radius: 36rpx; + width: 660rpx; + height: 804rpx; + border-radius: 30rpx; + background-color: rgba(255, 255, 255, 0.9); + color: rgba(16, 16, 16, 1); + font-size: 28rpx; + text-align: center; + padding: 36rpx 46rpx; + box-sizing: border-box; + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + z-index: 99999; +} + +.ttpopup-item { + margin-bottom: 24rpx; + display: flex; + align-items: center; + justify-content: space-around; } .ztys{ - position: absolute; - display: flex; - flex-direction: column; - background-repeat: no-repeat; - background-size:100% 100%; - left: 46rpx; - top:98rpx; - width: 284px; -height: 159px; -line-height: 50rpx; -color: rgba(108, 108, 108, 1); -font-size: 16px; + margin-top: 26rpx; + line-height: 160%; + color: rgba(108, 108, 108, 1); + font-size: 32rpx; + text-align: start; } .jkzs{ - position: absolute; width: 111.33rpx; height: 26.67rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - margin-left:97.33rpx; - margin-top: 589.33rpx; background-image: url(https://wish-assets.windymuse.com.cn/xy/jkzs.png); } .aqzs{ - position: absolute; width: 111.33rpx; height: 26.67rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - margin-left:97.33rpx; - margin-top: 653.33rpx; background-image: url(https://wish-assets.windymuse.com.cn/xy/aqzs.png); } .cyzs{ - position: absolute; width: 111.33rpx; height: 26.67rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - margin-left:97.33rpx; - margin-top: 717.33rpx; background-image: url(https://wish-assets.windymuse.com.cn/xy/cyzs.png); } .rjkzs{ - position: absolute; - width: 311.33rpx; - height: 26.67rpx; line-height: 26.67rpx; display: flex; flex-direction: column; - margin-left:279.33rpx; - margin-top: 580.33rpx; } .raqzs{ - position: absolute; - width: 111.33rpx; - height: 26.67rpx; line-height:26.67rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - margin-left:279.33rpx; - margin-top: 644.33rpx; } .rcyzs{ - position: absolute; - width: 111.33rpx; - height: 26.67rpx; line-height:26.67rpx; display: flex; flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; - margin-left:279.33rpx; - margin-top: 708.33rpx; } .jltxt{ position: absolute; right: 0; - top: 504px; - width: 75px; - height: 35px; + top: 1008rpx; + width: 150rpx; + height: 70rpx; line-height: 70rpx; - border-radius: 10px 0px 0px 10px; + border-radius: 20rpx 0px 0px 20rpx; 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); + 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: 14px; -text-align: center; -font-family: SourceHanSansSC-medium; + font-size: 28rpx; + text-align: center; } .tips{ - position: absolute; - left: 46rpx; -top: 36rpx; -width: 119px; -height: 18px; -color: rgba(248, 99, 42, 1); -font-size: 12px; -text-align: left; -font-family: SourceHanSansSC-regular; + color: rgba(248, 99, 42, 1); + font-size: 24rpx; + text-align: left; } .ysfgx{ - position: absolute; - left: 90rpx; -top: 486rpx; -width: 240px; -height: 11px; -background-repeat: no-repeat; -background-size:100% 100%; -background-image: url(https://wish-assets.windymuse.com.cn/xy/ysfgx.png); + margin-top: 70rpx; + width: 100%; + display: flex; + justify-content: center; + margin-bottom: 78rpx; +} + +.ysfgx image { + width: 480rpx; + height: 22rpx; } /* 弹层 */ @@ -832,16 +821,16 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/ysfgx.png); .dialog { position: absolute; bottom: 500rpx; - width: 648rpx; - height: 484rpx; + width: 586rpx; + height: 434rpx; padding: 50rpx; z-index: 999; box-sizing: border-box; line-height: 20px; - border-radius: 15px; + border-radius: 30rpx; background-color: rgba(255, 255, 255, 1); text-align: center; - box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.4); + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); } .dialog-item { @@ -864,6 +853,10 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/ysfgx.png); border: 1px solid rgba(236, 236, 236, 1); } +.dialog-item-text { + width: 144rpx; +} + .dialog-item text { padding-top: 16rpx; color: #6C6C6C; @@ -907,19 +900,33 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/ysfgx.png); } .dialog-text { - height: 300rpx; color: rgba(108, 108, 108, 1); - font-size: 18px; + font-size: 36rpx; text-align: center; font-weight: 400; padding-top: 60rpx; box-sizing: border-box; + margin-bottom: 100rpx; } .dialog-text view { margin-bottom: 30rpx; } +.dialog-text-end-pray { + color: rgba(108, 108, 108, 1); + font-size: 36rpx; + text-align: center; + font-weight: 400; + padding-top: 10rpx; + box-sizing: border-box; + margin-bottom: 100rpx; +} + +.dialog-text-end-pray view { + margin-bottom: 30rpx; +} + .timing { position: absolute; bottom: 0; @@ -1038,3 +1045,23 @@ picker-view-column { width: 200rpx; height: 200rpx; } + +.swiper-btn-left { + position: absolute; + top: 646rpx; + left: 10rpx; + width: 100rpx; + height: 150rpx; + background-size: cover; + background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/if-curved-left.png); +} + +.swiper-btn-right { + position: absolute; + top: 646rpx; + right: 10rpx; + width: 100rpx; + height: 150rpx; + background-size: cover; + background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/if-curved-right.png); +} \ No newline at end of file diff --git a/pages/home/jl/jlai/jlai.js b/pages/home/jl/jlai/jlai.js index 7ccc4aa..73a9503 100644 --- a/pages/home/jl/jlai/jlai.js +++ b/pages/home/jl/jlai/jlai.js @@ -98,6 +98,13 @@ Page({ }, // 获取聊天气泡内容 getContent(e){ + // 判断两天次数 + if (!this.data.times && !this.data.userInfo.isChatVip) { + return wx.showToast({ + title: '开通会员继续聊天', + icon: 'none' + }) + } const ctn = e.currentTarget.dataset.ctn if (ctn === '1') { this.setData({ltinfo: '请告诉我未来一个月的星座运势'}) diff --git a/pages/home/me/indexx.js b/pages/home/me/indexx.js index b105c93..bba4f11 100644 --- a/pages/home/me/indexx.js +++ b/pages/home/me/indexx.js @@ -47,7 +47,7 @@ Page({ icon: 'none' }); return; - } + } }, // 找回数据 findData(){ @@ -57,6 +57,24 @@ Page({ showPhone: false }) }, + // 找回账号数据 + retrieveAccount(){ + // req.patchRequest('/api/user/retrieve-data',{ + // phone: this.data.phone, + // code: this.data.phoneVerificationCode + // }).then(res => { + + // }) + wx.showToast({ + title: '找回数据成功,请重新登入', + icon: 'none' + }) + setTimeout(() => { + wx.redirectTo({ + url: '/pages/index/index', + }) + }, 1000); + }, closeFindData(){ this.setData({ existPhone: true, @@ -75,27 +93,21 @@ Page({ existPhone: false, showPhone: true, isHavePhone: false, - phone: '' + phone: '', + phoneVerificationCode: '' }) }, getCode(){ // 请求前校验 if (!/^1[3456789]\d{9}$/.test(this.data.phone)) { - wx.showToast({ + return wx.showToast({ title: '手机号码格式不正确', icon: 'none' }); - return; - } + } if(this.data.countdown === 60 || this.data.countdown === '重新获取'){ req.postRequest('/api/user/send-authentication-code',{phone:this.data.phone}).then((res)=>{ console.log(res); - if (res.data.code === 500) { - return this.setData({ - existPhone: true, - showPhone: false - }) - } if (this.data.countdown === '重新获取') { this.setData({countdown: 60}) } @@ -122,35 +134,40 @@ Page({ showPhone: true, //更改手机号码 isHavePhone: false, existPhone: false, - findAccount: false //账号账号数据 + findAccount: false, //账号账号数据 + phone: '', + phoneVerificationCode: '' }) }, bdSuccessBtn(){ this.setData({bdsjhVisible: false}) }, doEXecSjh(){ + if (this.data.phoneVerificationCode.length !== 6) { + return wx.showToast({ + title: '验证码格式不正确', + icon: 'none' + }); + } req.patchRequest('/api/user/curt',{ phone:this.data.phone, phoneVerificationCode:this.data.phoneVerificationCode }).then((res)=>{ - if(res.data.code !== 200){ - wx.showToast({ - title:res.data.msg, - icon:'none' + if (res.data.code === 500) { + return this.setData({ + existPhone: true, + showPhone: false, }) - return }else { this.getUserInfo() this.setData({ bdSuccess: true, - showPhone: false + showPhone: false, + phoneVerificationCode:'', + isCxHq:false }) } }) - this.setData({ - phoneVerificationCode:'', - isCxHq:false - }) }, go2Grzl(){ wx.navigateTo({ diff --git a/pages/home/me/indexx.wxml b/pages/home/me/indexx.wxml index 8920cba..22293c5 100644 --- a/pages/home/me/indexx.wxml +++ b/pages/home/me/indexx.wxml @@ -132,7 +132,7 @@ 确定要找回吗? 取消 - 确定 + 确定
\ No newline at end of file diff --git a/pages/home/xx/hy/hx/hx.js b/pages/home/xx/hy/hx/hx.js index 5d73cb4..f2df6a1 100644 --- a/pages/home/xx/hy/hx/hx.js +++ b/pages/home/xx/hy/hx/hx.js @@ -8,7 +8,7 @@ Page({ */ data: { visible:false, - image: [] + image: '' }, go2Reback(){ wx.navigateTo({ @@ -37,14 +37,20 @@ Page({ }, blockClick(e){ console.log(e.target.dataset.url); + const url = e.currentTarget.dataset.url + const arr = url.split("/"); // 将链接按照 / 分割成数组 + const last = arr[arr.length - 1]; // 取得数组中的最后一个元素 + const num = last.split("?")[0]; // 将最后一个元素按照 ? 分割成数组,取得倒数第二个元素 + console.log(num); // 输出 128 this.setData({ visible: true, - image: [e.target.dataset.url] + image: e.target.dataset.url, + resourceId:num }) }, downloadBtn(){ wx.downloadFile({ - url: this.data.image[0], + url: this.data.image, success: (res) => { if (res.statusCode === 200) { const tempFilePath = res.tempFilePath; @@ -110,14 +116,26 @@ Page({ delBtnHx(){ const hxlist = this.data.hxlist const id = hxlist.find(item => item.resourceId == this.data.resourceId).id + const isSelf = hxlist.find(item => item.resourceId == this.data.resourceId).isSelf console.log(id); - req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { - console.log(res); - if (res.data.code === 200) { - this.getList() - this.setData({delKey: ''}) - } - }) + if (isSelf) { + req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { + console.log(res); + if (res.data.code === 200) { + this.getList() + this.setData({delKey: '', visible:false}) + wx.showToast({ + title:'删除成功', + icon: 'success' + }) + } + }) + }else { + wx.showToast({ + title:'只能删除自己的回忆', + icon: 'none' + }) + } }, closeViewer(){this.setData({visible: false})}, getList(){ diff --git a/pages/home/xx/hy/hx/hx.wxml b/pages/home/xx/hy/hx/hx.wxml index 3b3f22b..3a70f31 100644 --- a/pages/home/xx/hy/hx/hx.wxml +++ b/pages/home/xx/hy/hx/hx.wxml @@ -1,7 +1,9 @@ - -画像 + + + 画像 + diff --git a/pages/home/xx/hy/hx/hx.wxss b/pages/home/xx/hy/hx/hx.wxss index 53a4505..1ac37b0 100644 --- a/pages/home/xx/hy/hx/hx.wxss +++ b/pages/home/xx/hy/hx/hx.wxss @@ -1,27 +1,32 @@ -.reback{ +.header { position: fixed; - margin-left: 20rpx; - top: 108rpx; + top: 0; + width: 100%; + height: 176rpx; + padding-top: 88rpx; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + background-color: #fff; + z-index: 1; +} +.reback{ + position: absolute; + left: 20rpx; width:48rpx; height:48rpx; - z-index: 2; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png); } - .title{ - position: fixed; - left: 278rpx; - top: 108rpx; width: 196rpx; height: 48rpx; color: rgba(108, 108, 108, 1); font-size: 32rpx; text-align: center; - z-index: 1; - font-family: SourceHanSansSC-regular; } .xfgjl{ position: fixed; @@ -53,8 +58,12 @@ } .body { + width: 100%; + height: 100%; + overflow-y: scroll; padding-top:188rpx ; padding-bottom: 200rpx; + box-sizing: border-box; } .block { diff --git a/pages/home/xx/hy/index.wxss b/pages/home/xx/hy/index.wxss index 3dcbfb7..b0a5e8a 100644 --- a/pages/home/xx/hy/index.wxss +++ b/pages/home/xx/hy/index.wxss @@ -64,6 +64,7 @@ top: 334rpx; width: 100%; height: 1000rpx; + background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/%E4%BF%A1%E6%9C%AD%E8%83%8C%E6%99%AF.png); } diff --git a/pages/home/xx/hy/yx/yx.js b/pages/home/xx/hy/yx/yx.js index 51fec54..959abc3 100644 --- a/pages/home/xx/hy/yx/yx.js +++ b/pages/home/xx/hy/yx/yx.js @@ -36,16 +36,26 @@ Page({ }) }, delLetter(e){ - const id = e.target.dataset.id - req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { - console.log(res); - if(res.data.code === 200){ - wx.showToast({ - title: '删除成功', - }) - this.getList() - } - }) + const id = e.target.dataset.item.id + const isSelf = e.target.dataset.item.isSelf + console.log(isSelf,'1111'); + if (isSelf) { + req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { + console.log(res); + if(res.data.code === 200){ + wx.showToast({ + title: '删除成功', + }) + this.getList() + } + }) + }else { + console.log('只能删除自己消息'); + wx.showToast({ + title: '只能删除自己的回忆', + icon: 'none' + }) + } }, getList(){ req.getRequest('/api/user/curt/message/lover',{ diff --git a/pages/home/xx/hy/yx/yx.wxml b/pages/home/xx/hy/yx/yx.wxml index f2af2a8..f6ef19d 100644 --- a/pages/home/xx/hy/yx/yx.wxml +++ b/pages/home/xx/hy/yx/yx.wxml @@ -1,25 +1,27 @@ - -音讯 + + + 音迅 + - - - - - - {{nick}} - {{item.createdAt}} - - - - {{item.extra.ssec}} + + + + + + {{item.isSelf ? userInfo.nick : nick}} + {{item.createdAt}} + + + + {{item.extra.ssec}} + - - 删除 - + 删除 + diff --git a/pages/home/xx/hy/yx/yx.wxss b/pages/home/xx/hy/yx/yx.wxss index c97ff36..ce44974 100644 --- a/pages/home/xx/hy/yx/yx.wxss +++ b/pages/home/xx/hy/yx/yx.wxss @@ -1,31 +1,37 @@ /* pages/home/xx/hy/index.wxss */ -.reback{ +.header { position: fixed; - margin-left: 20rpx; - margin-top:108rpx; + top: 0; + width: 100%; + height: 176rpx; + padding-top: 88rpx; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + background-color: #fff; + z-index: 1; +} +.reback{ + position: absolute; + left: 20rpx; width:48rpx; height:48rpx; background-repeat: no-repeat; background-size:100% 100%; - z-index: 1; background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png); } - .title{ - position: fixed; - left: 278rpx; - top: 108rpx; width: 196rpx; height: 48rpx; color: rgba(108, 108, 108, 1); font-size: 32rpx; text-align: center; - z-index: 1; - font-family: SourceHanSansSC-regular; } .xfgjl{ position: fixed; - left: 0px; + bottom: 0; + left: 0; display: flex; justify-content: space-evenly; margin-top: 1416rpx; @@ -51,12 +57,14 @@ } .main { - position: absolute; + /* position: absolute; */ width: 100%; height: 100%; padding-top: 208rpx; + padding-bottom: 200rpx; box-sizing: border-box; background-size: contain; + overflow-y: scroll; } .main-bgc { @@ -64,6 +72,7 @@ top: 334rpx; width: 100%; height: 1000rpx; + background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/%E4%BF%A1%E6%9C%AD%E8%83%8C%E6%99%AF.png); } diff --git a/pages/home/xx/hy/zt/zt.js b/pages/home/xx/hy/zt/zt.js index 18275b0..07c3c08 100644 --- a/pages/home/xx/hy/zt/zt.js +++ b/pages/home/xx/hy/zt/zt.js @@ -7,7 +7,9 @@ Page({ * 页面的初始数据 */ data: { - + showZt: false, + msgZt: '', + userInfo: {} }, go2Reback(){ wx.navigateTo({ @@ -35,11 +37,22 @@ Page({ }) }, delLetter(e){ - const id = e.target.dataset.id - req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { - console.log(res, '删除成功'); - this.getList() - }) + const id = e.target.dataset.item.id + const isSelf = e.target.dataset.item.isSelf + if (isSelf) { + req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => { + wx.showToast({ + title: '删除成功', + icon: 'success' + }) + this.getList() + }) + }else { + wx.showToast({ + title: '只能删除自己的回忆', + icon: 'none' + }) + } }, getList(){ req.getRequest('/api/user/curt/message/lover',{ @@ -78,12 +91,26 @@ Page({ }) }, + readingNote(e){ + console.log(e.currentTarget.dataset.content); + this.setData({ + showZt: true, + msgZt: e.currentTarget.dataset.content + }) + }, + closeRead(){ + this.setData({showZt: false}) + }, + /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getList() this.getLoveInfo() + this.setData({ + userInfo: wx.getStorageSync('xinyuan-userInfo') + }) }, /** diff --git a/pages/home/xx/hy/zt/zt.wxml b/pages/home/xx/hy/zt/zt.wxml index 3755a34..4ccab83 100644 --- a/pages/home/xx/hy/zt/zt.wxml +++ b/pages/home/xx/hy/zt/zt.wxml @@ -1,24 +1,28 @@ - -纸条 + + + 纸条 + - - - - - - {{nick}} - {{ item.createdAt }} - - - {{item.content}} + + + + + + + + {{ item.isSelf ? userInfo.nick : nick}} + {{ item.createdAt }} + + + {{item.content}} + - - 删除 - + 删除 + @@ -27,4 +31,14 @@ 音讯 画像 纸条 + + + + + + {{msgZt}} + + + + \ No newline at end of file diff --git a/pages/home/xx/hy/zt/zt.wxss b/pages/home/xx/hy/zt/zt.wxss index 5cca5db..40d8894 100644 --- a/pages/home/xx/hy/zt/zt.wxss +++ b/pages/home/xx/hy/zt/zt.wxss @@ -1,31 +1,37 @@ /* pages/home/xx/hy/index.wxss */ -.reback{ +.header { position: fixed; - margin-left: 20rpx; - margin-top:108rpx; + top: 0; + width: 100%; + height: 176rpx; + padding-top: 88rpx; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + background-color: #fff; + z-index: 1; +} +.reback{ + position: absolute; + left: 20rpx; width:48rpx; height:48rpx; background-repeat: no-repeat; background-size:100% 100%; - z-index: 1; background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png); } - .title{ - position: fixed; - left: 278rpx; - top: 108rpx; width: 196rpx; height: 48rpx; color: rgba(108, 108, 108, 1); font-size: 32rpx; text-align: center; - z-index: 1; - font-family: SourceHanSansSC-regular; } .xfgjl{ position: fixed; - left: 0px; + bottom: 0; + left: 0; display: flex; justify-content: space-evenly; margin-top: 1416rpx; @@ -51,12 +57,14 @@ } .main { - position: absolute; + /* position: absolute; */ width: 100%; + height: 100%; padding-top: 208rpx; padding-bottom: 200rpx; box-sizing: border-box; background-size: contain; + overflow-y: scroll; } .main-bgc { @@ -64,6 +72,7 @@ top: 334rpx; width: 100%; height: 1000rpx; + background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/%E4%BF%A1%E6%9C%AD%E8%83%8C%E6%99%AF.png); } @@ -84,6 +93,12 @@ box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); } +.item-left image { + width: 100%; + height: 100%; + border-radius: 50%; +} + .item-text { flex: 1; height: 100%; @@ -93,14 +108,16 @@ .item-right { width: 366rpx; height: 120rpx; + line-height: 120rpx; + padding: 0 30rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + text-align: center; box-sizing: border-box; background-size: contain; color: rgba(51, 51, 51, 1); font-size: 28rpx; - display: flex; - justify-content: center; - align-items: center; - overflow: hidden; background-image: url(https://wish-assets.windymuse.com.cn/xy/%E7%BA%B8%E6%9D%A1.png); } @@ -125,4 +142,54 @@ justify-content: center; align-items: center; color: #fff; +} + +.reading { + position: fixed; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.8); + z-index: 3; +} + +.read-box { + width: 596rpx; + height: 1084rpx; + margin-top: 222rpx; + margin-left: 96rpx; + padding: 198rpx 102rpx 0 66rpx; + box-sizing: border-box; + background-size: cover; + background-image: url(https://wish-assets.windymuse.com.cn/xy/ztbkg11.png); +} + +.read-text { + width: 100%; + height: 620rpx; + color: rgba(79, 79, 79, 1); + font-size: 36rpx; + line-height: 180%; + text-align: left; + overflow-y: scroll; +} + +.read-btn { + width: 110rpx; + height: 110rpx; + margin: 56rpx 0 0 158rpx; + border-radius: 50%; + background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); + box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + background-size: cover; + display: flex; + align-items: center; + justify-content: center; +} + +.read-btn image { + width: 60rpx; + height: 60rpx; } \ No newline at end of file diff --git a/pages/home/xx/lindex/lindex.js b/pages/home/xx/lindex/lindex.js index e0d9bd6..3d38905 100644 --- a/pages/home/xx/lindex/lindex.js +++ b/pages/home/xx/lindex/lindex.js @@ -37,7 +37,9 @@ Page({ messages:[], loverInfo:{}, hasLover:false,// 是否单身 - userInfo:{} + userInfo:{}, + savePicture: false, // 保存图片成功 + soundData:{} //音频数据 }, doLuYINBoF(e){ // 判断点击的是否为对方的语音 @@ -165,30 +167,30 @@ Page({ do2FsLuyin(){/**发送录音按钮 */ - this.data.RM.stop(); + // this.data.RM.stop(); console.log('发送录音') this.setData({luyinVisible:false}) let tt= this - this.data.RM.onStop((res)=>{ + // this.data.RM.onStop((res)=>{ //录音时长判断 console.log('发送录音了1111。。') // 先计算分钟 let fz = 0 let mz = 0 let hm = 0 - if(res.duration>=60*1000){ - fz = Math.floor(res.duration/(60*1000)) + if(this.data.soundData.duration>=60*1000){ + fz = Math.floor(this.data.soundData.duration/(60*1000)) } - if(res.duration>=1000){ - mz = Math.floor((res.duration-fz*60*1000)/(1000)) + if(this.data.soundData.duration>=1000){ + mz = Math.floor((this.data.soundData.duration-fz*60*1000)/(1000)) } - hm = res.duration - fz*60*1000-mz*1000 - let sec = Math.floor(res.duration/1000) + hm = this.data.soundData.duration - fz*60*1000-mz*1000 + let sec = Math.floor(this.data.soundData.duration/1000) let ssec = fz+'\''+mz+'\'\'' console.log(ssec) wx.uploadFile({ url: 'https://xzjl-api.windymuse.cn/api/resource', - filePath: res.tempFilePath, + filePath: this.data.soundData.tempFilePath, name: 'file', header: { 'Authorization': wx.getStorageSync('token'), @@ -217,21 +219,20 @@ Page({ fail(res) { showToast('图片上传失败'); } - }) - - - - console.log(res)//这里是必须写完成事件的,因为最后的文件,就在这里面; - res.tempFilePath;//是临时的文件地址 - res.duration;//录音的时长 - res.fileSize;//文件的大小 - }) + }) + // }) }, doStopLuyin(){ this.setData({luYinStatus:2}) clearInterval(this.data.timer) console.log('结束录音') - this.data.RM.pause() + this.data.RM.stop() + this.data.RM.onStop(res => { + console.log(res); + const innerAudioContext = wx.createInnerAudioContext() + innerAudioContext.src = res.tempFilePath + this.setData({soundData: res, innerAudio:innerAudioContext}) + }) }, doStartLuyin(){ this.setData({RM:wx.getRecorderManager()}) @@ -251,6 +252,18 @@ Page({ this.data.timer = setInterval(this.counter,50) // 开始定时器 }, + // 试听 + doListen(){ + this.setData({luYinStatus:3}) + console.log('试听'); + this.data.innerAudio.play() // 播放 + }, + // 结束试听 + doStopListen(){ + this.setData({luYinStatus:0}) + this.data.innerAudio.stop() // 播放 + }, + counter:function(){ let second = this.data.second @@ -361,15 +374,13 @@ Page({ let that= this; wx.downloadFile({ url: that.data.imgPicUrl,//图片的地址 - success:function(res){ + success:(res) => { const tempFilePath = res.tempFilePath //通过res中的tempFilePath 得到需要下载的图片地址 wx.saveImageToPhotosAlbum({ filePath: tempFilePath, //设置下载图片的地址 - success:function(){ - wx.showToast({ - title: '保存图片成功', - }) - } + success:() => { + this.setData({savePicture: true}) + } }) } }) @@ -377,22 +388,25 @@ Page({ }, go2Reback1(){ //wx.navigateBack({ changed: true }); - this.setData({dkTpVisible:false}) + this.setData({dkTpVisible:false,savePicture:false}) }, go2Reback(){ - wx.switchTab({ + wx.reLaunch({ url: '/pages/home/xy/index', }) }, go2SeeHxDetail(e){ + console.log(e,'1111'); this.setData({imgPicUrl:e.currentTarget.dataset.tp}) this.setData({dkTpVisible:true}) console.log(e.currentTarget.dataset.tp) console.log('查看图片详情') const id = e.currentTarget.dataset.id - req.patchRequest(`/api/user/curt/message/${id}/read`,{}).then(res => { - console.log(res); - }) + if (id) { + req.patchRequest(`/api/user/curt/message/${id}/read`,{}).then(res => { + console.log(res); + }) + } }, //bindtap="dKztDetial" data-xq="{{item}}" dKztDetial(e){/**查看详情 */ @@ -474,7 +488,7 @@ Page({ } }) - this.setData({messages:list.reverse()}) + this.setData({messages:list}) } }).catch((err)=>{ console.log(err); @@ -601,11 +615,12 @@ Page({ this.doQueryInit() this.doMessageInfo() - const time = setInterval(() => { - this.doMessageInfo() - console.log('1111'); - }, 2000); - this.setData({time: time}) + // 轮询获取信息 + // const time = setInterval(() => { + // this.doMessageInfo() + // console.log('1111'); + // }, 2000); + // this.setData({time: time}) }, /** @@ -629,6 +644,7 @@ Page({ onUnload() { clearInterval(this.data.timer) this.data.innerAudioContext.stop() + clearInterval(this.data.time) }, /** diff --git a/pages/home/xx/lindex/lindex.wxml b/pages/home/xx/lindex/lindex.wxml index a971d61..0036038 100644 --- a/pages/home/xx/lindex/lindex.wxml +++ b/pages/home/xx/lindex/lindex.wxml @@ -195,7 +195,7 @@ - + 取消 发送 @@ -211,11 +211,15 @@ - 画像 + 画像 + + + + + + 画像保存成功 + 保存 - - - 保存 @@ -232,9 +236,13 @@ - + + + + + diff --git a/pages/home/xx/lindex/lindex.wxss b/pages/home/xx/lindex/lindex.wxss index 9c8d92c..91848b6 100644 --- a/pages/home/xx/lindex/lindex.wxss +++ b/pages/home/xx/lindex/lindex.wxss @@ -600,7 +600,8 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); .zjtableatp2{ width: 100%; - height: 150rpx; + height: 220rpx; + padding: 0 32rpx; box-sizing: border-box; display: flex; align-items: center; @@ -679,20 +680,14 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); } .tppp1{ - position: absolute; - width: 750rpx; - height: auto; - top:50%; - margin-top: 300rpx; + width: 100%; } .ztPop1{ position: relative; - width: 750rpx ; - height: 1624rpx; + width: 100% ; + height: 100%; margin: 0!important; padding: 0!important; - display: table-cell; - vertical-align: middle; } .ztPop1-header { @@ -704,23 +699,48 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); justify-content: center; } +.ztPop1-img { + width: 100%; + height: 1270rpx; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +} -.tpBcan1{ +.ztPop1-btn { + position: relative; + width: 100%; + height: 134rpx; + padding: 32rpx; + box-sizing: border-box; + display: flex; + justify-content: flex-end; +} + +.ztPop1-btn-text { position: absolute; - top: 1400rpx; - right: 32rpx; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: rgba(108, 108, 108, 1); + font-size: 32rpx; + text-align: center; +} + + +.tpBcan1{ width: 110rpx; height: 70rpx; line-height: 70rpx; border-radius: 20rpx; background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); text-align: center; - box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); + box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); border: 3px solid rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1); font-size: 28rpx; text-align: center; - font-family: SourceHanSansSC-medium; } .block{ width: 750rpx; @@ -903,6 +923,18 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png); background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/if-ui-play%20Copy%401x.png); } +.wlyan4{ + /* position: absolute; + left: 40rpx; + top: 20rpx; */ + width: 70rpx; + height: 70rpx; + /* border-top: 50rpx solid transparent; + border-left: 60rpx solid rgba(248,99,42,1); + border-bottom: 35rpx solid transparent; */ + background-size: cover; + background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/semiDesign.png); +} .luyinlbt1{ position: absolute; width: 750rpx; diff --git a/pages/home/xx/lindex/lxz/lxz.wxml b/pages/home/xx/lindex/lxz/lxz.wxml index 906886a..8df52e7 100644 --- a/pages/home/xx/lindex/lxz/lxz.wxml +++ b/pages/home/xx/lindex/lxz/lxz.wxml @@ -90,7 +90,7 @@ 最多只能添加 - 3条语言 + 3条语音 好的 diff --git a/pages/home/xx/xz/xz.wxml b/pages/home/xx/xz/xz.wxml index 906886a..5843b1a 100644 --- a/pages/home/xx/xz/xz.wxml +++ b/pages/home/xx/xz/xz.wxml @@ -90,7 +90,7 @@ 最多只能添加 - 3条语言 + 3条语音 好的 @@ -104,7 +104,7 @@ - + 确定要寄出吗? 信件寄出后,再次使用晶石激活 将直接提示打开信件 diff --git a/pages/home/xx/xz/xz.wxss b/pages/home/xx/xz/xz.wxss index 301a116..e3ce003 100644 --- a/pages/home/xx/xz/xz.wxss +++ b/pages/home/xx/xz/xz.wxss @@ -356,6 +356,17 @@ textarea { box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.4); } +.taost-box2 { + width: 586rpx; + height: 434rpx; + padding-top: 88rpx; + box-sizing: border-box; + border-radius: 15px; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.4); +} + .sound { position: relative; width: 100%; diff --git a/pages/home/xy/index.js b/pages/home/xy/index.js index 365d835..1c7be0e 100644 --- a/pages/home/xy/index.js +++ b/pages/home/xy/index.js @@ -9,19 +9,13 @@ Page({ data: { xzInfo:{}, userInfo:{}, + loverInfo:{}, xyNfc:true, xyInfo:{}, visible:false, showEnergy:true }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - this.initXy() - this.getXzTp() - }, /**获取星座图片对应关系 */ getXzTp(){ req.getRequest('/api/dict/value/horoscope-resource',{}).then((res)=>{ @@ -32,6 +26,7 @@ Page({ console.log(err); }) }, + initXy(){ req.getRequest('/api/user/curt',{}).then((res)=>{ if(res.data.code==200){ @@ -44,6 +39,19 @@ Page({ }) this.setData({xyInfo:wx.getStorageSync('nfc')}) }, + + // 获取情侣信息 + getUserLoverInfo(){ + req.getRequest('/api/user/curt/lover',{}).then((res)=>{ + if(res.data.code==200){ + this.setData({loverInfo:res.data.data}) + wx.setStorageSync('xinyuan-userLoveInfo',res.data.data) + } + }).catch((err)=>{ + console.log(err); + }) + }, + // 关闭运势提示 closeYs(){ this.setData({visible: !this.data.visible, showEnergy: true}) @@ -100,6 +108,15 @@ Page({ }) }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.initXy() + this.getXzTp() + this.getUserLoverInfo() + }, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -113,6 +130,7 @@ Page({ this.initXy() this.upImprove() this.getDefaultAvatars() + this.getUserLoverInfo() }, /** diff --git a/pages/home/xyc/index.wxml b/pages/home/xyc/index.wxml index ead5568..ff4116e 100644 --- a/pages/home/xyc/index.wxml +++ b/pages/home/xyc/index.wxml @@ -80,20 +80,25 @@ - - - + + + + + + + + + + 愿望 {{item.content}} 期望时间 diff --git a/pages/home/xyc/index.wxss b/pages/home/xyc/index.wxss index a058ded..1cfff32 100644 --- a/pages/home/xyc/index.wxss +++ b/pages/home/xyc/index.wxss @@ -424,14 +424,23 @@ margin-top: 20rpx; } -.yximg{ +.yximg-box { position: absolute; left: 80rpx; top: 164rpx; + width: 460rpx; + height: 308rpx; + border-radius: 10px; + display: flex; + justify-content: center; +} + +.yximg{ width: 460rpx; height: 308rpx; border-radius: 10px; background-color: #767686; + text-align: center; } .yximg .t-image { diff --git a/pages/home/xyc/tdyw/tdyw.wxml b/pages/home/xyc/tdyw/tdyw.wxml index 0bb0b80..abafb17 100644 --- a/pages/home/xyc/tdyw/tdyw.wxml +++ b/pages/home/xyc/tdyw/tdyw.wxml @@ -2,7 +2,7 @@ - 我的愿望 + Ta的愿望 @@ -53,7 +53,9 @@ - + + + 愿望 {{detail.content}} 期望时间 @@ -63,11 +65,6 @@ - - - 删除 - - 修改 @@ -85,11 +82,6 @@ - - - 删除 - - 分享 @@ -97,11 +89,6 @@ - - - 删除 - - 修改 @@ -112,18 +99,6 @@ - - - diff --git a/pages/home/xyc/tdyw/tdyw.wxss b/pages/home/xyc/tdyw/tdyw.wxss index a10bf79..a810611 100644 --- a/pages/home/xyc/tdyw/tdyw.wxss +++ b/pages/home/xyc/tdyw/tdyw.wxss @@ -149,10 +149,18 @@ height: 1080rpx; } -.yximg{ +.yximg-box { position: absolute; left: 80rpx; top: 164rpx; + width: 460rpx; + height: 308rpx; + border-radius: 10px; + display: flex; + justify-content: center; +} + +.yximg{ width: 460rpx; height: 308rpx; border-radius: 10px; diff --git a/pages/home/xyc/wdyw/wdyw.wxml b/pages/home/xyc/wdyw/wdyw.wxml index 6bbf464..5a5370a 100644 --- a/pages/home/xyc/wdyw/wdyw.wxml +++ b/pages/home/xyc/wdyw/wdyw.wxml @@ -53,7 +53,10 @@ - + + + + 愿望 {{detail.content}} 期望时间 @@ -81,7 +84,7 @@ 已达成 - + @@ -95,7 +98,7 @@ 删除 - + @@ -137,7 +140,7 @@ 分享到 - + diff --git a/pages/home/xyc/wdyw/wdyw.wxss b/pages/home/xyc/wdyw/wdyw.wxss index 7230d14..b56d997 100644 --- a/pages/home/xyc/wdyw/wdyw.wxss +++ b/pages/home/xyc/wdyw/wdyw.wxss @@ -149,15 +149,23 @@ height: 1080rpx; } -.yximg{ +.yximg-box { position: absolute; left: 80rpx; top: 164rpx; + width: 460rpx; + height: 308rpx; + display: flex; + justify-content: center; +} + +.yximg{ width: 460rpx; height: 308rpx; border-radius: 10px; background-color: #767686; } + .ywwz{ position: absolute; top: 540rpx; diff --git a/pages/index/index.js b/pages/index/index.js index 88a6a7e..54c64b6 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -62,15 +62,13 @@ Page({ }, /**扫码事件 */ scanCodeEvent(){ - var that = this; - var DEV_CODE = "" //扫码代码 wx.scanCode({ onlyFromCamera: true,// 只允许从相机扫码 - success(res){ - that.login('scan',res.result) + success: (res) => { + this.login('scan',res.result) }, - }) + }) }, /** @@ -79,29 +77,11 @@ Page({ * code为用户码参数,用户码为空则代表为扫码登录 */ login(mode,code){ - console.log(mode,'模式'); - console.log(code, 'code'); - //如果有token,直接进入 - if(wx.getStorageSync('token')){ - wx.showToast({ - title:'有token'+wx.getStorageSync('token'), - icon: 'none', - duration: 5000 - }) - wx.switchTab({ - url: '/pages/home/xy/index' - }) - } - // wx.showToast({ - // title:'没有token', - // icon: 'none', - // duration: 5000 - // }) - console.log('进入登录了!!!') - var DEV_CODE = code - var PUBLIC_KEY = "" + let DEV_CODE = code + let PUBLIC_KEY = "" req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{ - if(res.data.code==200){//获取公钥成功 + if(res.data.code === 200){ + //获取公钥成功 PUBLIC_KEY = res.data.data // 实例化rsa const rsa = new WxmpRsa() @@ -110,27 +90,23 @@ Page({ // 加密 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.token) - wx.setStorageSync('isFirst', res.data.data.isFirst) - // 设置当前设备码 - wx.setStorageSync('code', DEV_CODE) - // 设置为初次识别NFC - wx.setStorageSync('nfc', false) - wx.showToast({ - title:mode=='scan'?'扫码登录成功':'NFC识别成功', - icon: 'none', - duration: 1000 - }) - this.getLetter() - }else if(res.data.code==500){ - this.loginErrorToast(mode) - }else{ - this.loginErrorToast(mode) - } + if(res.data.code === 200){ + wx.setStorageSync('token', res.data.data.token) + wx.setStorageSync('isFirst', res.data.data.isFirst) + // 设置当前设备码 + wx.setStorageSync('code', DEV_CODE) + // 设置为初次识别NFC + wx.setStorageSync('nfc', false) + // 判断用户是否有未读信札 + this.getLetter() + }else if(res.data.code==500){ + this.loginErrorToast(mode) + }else{ + this.loginErrorToast(mode) + } } ) }else{ @@ -141,12 +117,12 @@ Page({ }) } }).catch((err)=>{ - console.log(err); + console.log(err); }) }, + // 判断是否用未读信札 getLetter(){ - console.log(wx.getStorageSync('token')); wx.request({ url: 'https://xzjl-api.windymuse.cn/api/user/curt', header: {'Authorization': wx.getStorageSync('token')}, @@ -155,14 +131,13 @@ Page({ const letterStatus = res.data.data.letterStatus // 这里可以判断是否有未读信札 if (letterStatus === 'sending') { - console.log('跳转信札页面'); wx.redirectTo({ url: '/pages/xz/index' }) }else { wx.switchTab({ url: '/pages/home/xy/index' - }) + }) } } }) diff --git a/project.private.config.json b/project.private.config.json index afa7bfa..883e9bd 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -17,14 +17,7 @@ }, { "name": "", - "pathName": "pages/home/xx/hy/yx/yx", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/home/xx/hy/hx/hx", + "pathName": "pages/home/xx/lindex/lindex", "query": "", "launchMode": "default", "scene": null