From 81b001208a10370f2d158d931e92a8bea5f3fb98 Mon Sep 17 00:00:00 2001 From: Wkang921 Date: Fri, 7 Jul 2023 17:36:11 +0800 Subject: [PATCH] no msg --- app.wxss | 5 + pages/home/xx/lindex/lindex.js | 35 ++++ pages/home/xx/lindex/lindex.wxml | 132 +++++++++------ pages/home/xx/lindex/lindex.wxss | 277 ++++++++++++++++--------------- pages/home/xx/lindex/lxz/lxz.js | 10 +- pages/home/xx/xz/xz.js | 11 +- pages/home/xyc/index.js | 12 +- pages/home/xyc/index.wxml | 123 +++++++------- pages/home/xyc/index.wxss | 96 +++++------ pages/home/xyc/wdyw/wdyw.js | 4 +- project.config.json | 2 +- project.private.config.json | 6 +- 12 files changed, 411 insertions(+), 302 deletions(-) diff --git a/app.wxss b/app.wxss index 40a8d80..4f44d2a 100644 --- a/app.wxss +++ b/app.wxss @@ -13,4 +13,9 @@ width: 0; height: 0; color: transparent; +} + +page { + width: 100%; + height: 100%; } \ No newline at end of file diff --git a/pages/home/xx/lindex/lindex.js b/pages/home/xx/lindex/lindex.js index dc3858f..e0d9bd6 100644 --- a/pages/home/xx/lindex/lindex.js +++ b/pages/home/xx/lindex/lindex.js @@ -40,6 +40,15 @@ Page({ userInfo:{} }, doLuYINBoF(e){ + // 判断点击的是否为对方的语音 + if(e.currentTarget.dataset.item){ + const id = e.currentTarget.dataset.item.id + console.log(id); + // 改变语音状态 + req.patchRequest(`/api/user/curt/message/${id}/read`,{}).then(res => { + console.log(res); + }) + } //先判断是开是关 if(!e.currentTarget.dataset.bf){//此时点击为关闭 //设置当前状态为关闭,并关闭 @@ -380,6 +389,10 @@ Page({ 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); + }) }, //bindtap="dKztDetial" data-xq="{{item}}" dKztDetial(e){/**查看详情 */ @@ -446,6 +459,21 @@ Page({ const minutes = date.getMinutes() item.createdAt = `${year}年${month}月${day}日 ${hours}:${minutes}` }) + + // 塞选出对方的消息 + const noSelfList = list.filter(item => { + return !item.isSelf + }) + // 文本和图片消息全都改为已读 + noSelfList.forEach(item => { + if (item.type === 'text' && item.status === 'unread') { + console.log('发送请求'); + req.patchRequest(`/api/user/curt/message/${item.id}/read`,{}).then(res => { + console.log(res); + }) + } + }) + this.setData({messages:list.reverse()}) } }).catch((err)=>{ @@ -572,6 +600,12 @@ Page({ onReady() { this.doQueryInit() this.doMessageInfo() + + const time = setInterval(() => { + this.doMessageInfo() + console.log('1111'); + }, 2000); + this.setData({time: time}) }, /** @@ -586,6 +620,7 @@ Page({ */ onHide() { 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 c121451..69a8869 100644 --- a/pages/home/xx/lindex/lindex.wxml +++ b/pages/home/xx/lindex/lindex.wxml @@ -1,20 +1,31 @@ - + + + + + 回忆 + + 星讯 + + + + + + + + + + - 欢迎来到你们的专属情侣树洞 - 在这里,你可以将你的心意传递给ta - 所有美好的回忆都将被精灵记录 + 欢迎来到你们的专属情侣树洞 + 在这里,你可以将你的心意传递给ta + 所有美好的回忆都将被精灵记录 - - - - - @@ -101,55 +112,77 @@ bindlongpress="changAn" src="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" class="zjxftp3" mode="heightFix" - bindtap="go2SeeHxDetail" + bindtap="go2SeeHxDetail" + data-id="{{item.id}}" data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" > {{item.status=='unread'?'未读':'已读'}} + + + + + + {{item.content}} + + {{item.status=='unread'?'未读':'已读'}} + + - - - - - - {{item.status=='unread'?'未读':'已读'}} - - - {{item.content}} + + + + + + + {{item.extra.ssec}} + + + + + + + + {{item.extra.ssec}} + + {{item.status=='unread'?'未读':'已读'}} + - {{item.status=='unread'?'未读':'已读'}} - - - - - 2222 - {{item.status=='unread'?'未读':'已读'}} - - + + + + + + + {{item.status=='unread'?'未读':'已读'}} + {{item.status=='unread'?'未读':'已读'}} + + + + -回忆 - - - -星讯 - @@ -175,13 +208,14 @@ - - - - + + 画像 - 保存 + + + + 保存 diff --git a/pages/home/xx/lindex/lindex.wxss b/pages/home/xx/lindex/lindex.wxss index fbc0dc7..5884528 100644 --- a/pages/home/xx/lindex/lindex.wxss +++ b/pages/home/xx/lindex/lindex.wxss @@ -1,55 +1,150 @@ /* pages/home/xx/lindex/lindex.wxss */ /* pages/home/xx/index.wxss */ /* pages/home/xyc/wdyw/wdyw.wxss */ -.reback{ + +.allTap { + position: relative; + width: 100%; + height: 100%; +} + +.allTap-header { position: fixed; - margin-left: 20rpx; - margin-top:108rpx; + top: 0; + width: 100%; + height: 166rpx; + padding-bottom: 20rpx; + box-sizing: border-box; + display: flex; + align-items: flex-end; + justify-content: center; + z-index: 1; + background-color: #fff; +} + +.reback{ width:48rpx; height:48rpx; + position: absolute; + left: 20rpx; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://oss.wish.ydxxkj.top/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; - font-family: SourceHanSansSC-regular; } + +.hybtn{ + position: fixed; + left: 0; + top: 210rpx; + width: 166rpx; + height: 70rpx; + line-height: 70rpx; + opacity: 0.7; + border-radius: 0px 20rpx 20rpx 0px; + 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 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + color: rgba(255, 255, 255, 1); + font-size: 28rpx; + text-align: center; +} + +.ltinfo{ + width: 100%; + margin-top: 224rpx; +} + .bkgfs{ - position: absolute; - left: 96rpx; - top: 70rpx; - width: 558rpx; - height: 256rpx; + position: relative; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; line-height: 40rpx; border-radius: 30rpx; - background-color: rgba(253, 190, 196, 1); text-align: center; } -.bkg{ +.bkgfs-img { position: absolute; - width: 691.33rpx; - height: 1326rpx; + top: 28rpx; + width: 100%; display: flex; - flex-direction: column; - background-repeat: no-repeat; - background-size:100% 100%; - margin-left:29.33rpx; - margin-top: 98rpx; - background-image: url(https://oss.wish.ydxxkj.top/xy/bkg.png); - color:#9A9A9A; + justify-content: center; + align-items: center; +} + +.bkgfs-img-middle { + width: 60rpx; + height: 32rpx; + margin: 0 30rpx; + background-size: contain; + background-image: url(https://oss.wish.ydxxkj.top/xy/qlzjt.png); +} + +.bkgfstxt{ + width: 560rpx; + height: 256rpx; + margin-top: 56rpx; + line-height: 20px; + border-radius: 30rpx; + color: #fff; + font-size: 28rpx; + text-align: center; + padding: 74rpx 56rpx 0 56rpx; + box-sizing: border-box; + background-color: rgba(253, 190, 196, 1); +} + +.bkgfstxt .txt { + margin-bottom: 14rpx; +} + +.txl{ + width: 80rpx; + height: 80rpx; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); +} + +.txr{ + width: 80rpx; + height: 80rpx; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); +} + + + +.ltxinxi{ + width: 100%; +} + +.wchatfor{ + width: 100%; + padding: 0 64rpx; + box-sizing: border-box; +} + +.wchattime{ + width: 100%; + margin-top: 32rpx; + color: rgba(153, 153, 153, 1); + font-size: 24rpx; text-align: center; - font-size: 27rpx; } + + + + + .xzt{ position: absolute; width: 398rpx; @@ -130,24 +225,6 @@ font-size: 27rpx; } -.hybtn{ - position: fixed; - left: 0px; -top: 104px; -width: 83px; -height: 35px; -line-height: 70rpx; -opacity: 0.7; -border-radius: 0px 10px 10px 0px; -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); -color: rgba(255, 255, 255, 1); -font-size: 14px; -text-align: center; -font-family: SourceHanSansSC-regular; -} - .xfgjl{ position: fixed; bottom: 30rpx; @@ -158,58 +235,6 @@ font-family: SourceHanSansSC-regular; justify-content: space-evenly; } -.ltinfo{ - position: absolute; - width: 750rpx; - height: 2000rpx; - margin-top:200rpx; -} -.h1{ - position: fixed; - left: 0px; -width: 375px; -height: 88px; -line-height: 20px; -background-color: rgba(255, 255, 255, 1); -text-align: center; -} - -.txl{ - position: absolute; - left: 244rpx; - top: 30rpx; - width: 72rpx; - height: 72rpx; -} -.txr{ - position: absolute; - top: 30rpx; - left:434rpx; - width: 72rpx; - height: 72rpx; -} -.qlzjt{ - position: absolute; - left: 346rpx; - top: 50rpx; - width: 60rpx; - height: 32rpx; - background-image: url(https://oss.wish.ydxxkj.top/xy/qlzjt.png); - color:#9A9A9A; - text-align: center; - font-size: 27rpx; -} -.bkgfstxt{ - position: absolute; - left: 56rpx; - top: 74rpx; - width: 446rpx; - height: 146rpx; - color: rgba(255, 255, 255, 1); - font-size: 28rpx; - text-align: center; - font-family: SourceHanSansSC-regular; -} .xxqlcd{ /* position: absolute; */ /* top: 32rpx; */ @@ -241,23 +266,7 @@ text-align: center; left: 299px; } -.ltxinxi{ - position: absolute; - margin-top:360rpx; - width: 750rpx; -} -.wchatfor{ - width: 750rpx; - padding: 0 64rpx; - box-sizing: border-box; -} -.wchattime{ - width: 750rpx; - margin-top: 32rpx; - color: rgba(153, 153, 153, 1); - font-size: 24rpx; - text-align: center; -} + .wchattxk{ display: inline-block; margin-left: 317px; @@ -591,7 +600,7 @@ background-image: url(https://oss.wish.ydxxkj.top/xy/xtreturn.png); .zjtableatp2{ width: 100%; - height: 220rpx; + height: 150rpx; box-sizing: border-box; display: flex; align-items: center; @@ -645,7 +654,8 @@ background-image: url(https://oss.wish.ydxxkj.top/xy/xtreturn.png); } .zttp12{ - height: 200rpx; + width: 100%; + height: 100%; display: flex; align-items: center; } @@ -655,14 +665,17 @@ background-image: url(https://oss.wish.ydxxkj.top/xy/xtreturn.png); align-items: flex-end; color: rgba(206, 206, 206, 1); font-size: 24rpx; + margin: 0 0 60rpx 10rpx; } .zjxftp3{ height: 200rpx; max-width: 480rpx; } .wchattxk11{ - width: 72rpx; - height: 72rpx; + width: 84rpx; + height: 84rpx; + margin-right: 24rpx; + box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); } .tppp1{ @@ -673,28 +686,39 @@ background-image: url(https://oss.wish.ydxxkj.top/xy/xtreturn.png); margin-top: 300rpx; } .ztPop1{ - position: absolute; - width:750rpx ; + position: relative; + width: 750rpx ; height: 1624rpx; margin: 0!important; padding: 0!important; display: table-cell; vertical-align: middle; } + +.ztPop1-header { + width: 100%; + margin-top: 88rpx; + padding: 20rpx; + box-sizing: border-box; + display: flex; + justify-content: center; +} + + .tpBcan1{ position: absolute; - left: 304px; -top: 727px; - width: 55px; - height: 35px; + top: 1400rpx; + right: 32rpx; + width: 110rpx; + height: 70rpx; line-height: 70rpx; - border-radius: 10px; + 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); border: 3px solid rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1); - font-size: 14px; + font-size: 28rpx; text-align: center; font-family: SourceHanSansSC-medium; } @@ -721,13 +745,6 @@ top: 727px; height: 116rpx; } - .title { - flex: 1; - text-align: center; - font-weight: 600; - font-size: 36rpx; - } - .btn { font-size: 32rpx; padding: 32rpx; diff --git a/pages/home/xx/lindex/lxz/lxz.js b/pages/home/xx/lindex/lxz/lxz.js index 82693cf..a28c6c5 100644 --- a/pages/home/xx/lindex/lxz/lxz.js +++ b/pages/home/xx/lindex/lxz/lxz.js @@ -32,7 +32,8 @@ Page({ btn2:false, btn3:false, btn4:false, - showSoundImg:true + showSoundImg:true, + isPlaying: false, // 是否正在播放语音 }, already(){ console.log('确定寄出'); @@ -309,6 +310,9 @@ Page({ }, // 点击音频试听 listen(e){ + if (this.data.isPlaying) { + return; // 如果正在播放语音,则不触发事件 + } const id = e.currentTarget.dataset.url.resourceId const videoSrc = this.data.audioList.find(item => { return item.resourceId === id @@ -317,6 +321,10 @@ Page({ const innerAudioContext = wx.createInnerAudioContext() innerAudioContext.src = videoSrc innerAudioContext.play() // 播放 + this.setData({ isPlaying: true }); // 设置为正在播放语音 + innerAudioContext.onEnded(() => { + this.setData({ isPlaying: false }); // 播放完毕后设置为非播放状态 + }); }, getUserInfo(){ req.getRequest('/api/user/curt',{}).then(res => { diff --git a/pages/home/xx/xz/xz.js b/pages/home/xx/xz/xz.js index 82693cf..379a19c 100644 --- a/pages/home/xx/xz/xz.js +++ b/pages/home/xx/xz/xz.js @@ -32,7 +32,8 @@ Page({ btn2:false, btn3:false, btn4:false, - showSoundImg:true + showSoundImg:true, + isPlaying: false, // 是否正在播放语音 }, already(){ console.log('确定寄出'); @@ -309,6 +310,9 @@ Page({ }, // 点击音频试听 listen(e){ + if (this.data.isPlaying) { + return; // 如果正在播放语音,则不触发事件 + } const id = e.currentTarget.dataset.url.resourceId const videoSrc = this.data.audioList.find(item => { return item.resourceId === id @@ -317,6 +321,11 @@ Page({ const innerAudioContext = wx.createInnerAudioContext() innerAudioContext.src = videoSrc innerAudioContext.play() // 播放 + console.log('播放'); + this.setData({ isPlaying: true }); // 设置为正在播放语音 + innerAudioContext.onEnded(() => { + this.setData({ isPlaying: false }); // 播放完毕后设置为非播放状态 + }); }, getUserInfo(){ req.getRequest('/api/user/curt',{}).then(res => { diff --git a/pages/home/xyc/index.js b/pages/home/xyc/index.js index 81bde32..ccc237e 100644 --- a/pages/home/xyc/index.js +++ b/pages/home/xyc/index.js @@ -68,13 +68,9 @@ Page({ }, success: async res => { let data = JSON.parse(res.data); - console.log(data, '111111'); if (data.code == 200) { - this.setData({imgUrl:data.data.abUrl}) - console.log('打印1111') - console.log(this.data.imgUrl) + this.setData({imgUrl:data.data.abUrl}) res.data = JSON.parse(res.data); - console.log(res.data); if (res.data.code == 1) { console.log(res.data.data.url); this.img = this.baseUrl + res.data.data.url; @@ -102,7 +98,6 @@ Page({ }, doXzTime(){ this.setData({ cvisible: true }); - console.log('执行选择时间') }, // 显示提示 showToast(){ @@ -183,6 +178,7 @@ Page({ showDetail:true, item:res.data.data }) + wx.hideTabBar() },2000) }else{ console.log('额外情况') @@ -226,12 +222,14 @@ Page({ this.setData({ showDetail: false }) + wx.showTabBar() }, // 分享 - openShare(){ + openShare(event){ this.setData({ shareVisible:!this.data.shareVisible }) + wx.hideTabBar() }, shareQQ(){ console.log('分享到qq') diff --git a/pages/home/xyc/index.wxml b/pages/home/xyc/index.wxml index 1641f74..af3d30f 100644 --- a/pages/home/xyc/index.wxml +++ b/pages/home/xyc/index.wxml @@ -22,7 +22,6 @@ 许愿链接 许愿图片 - - - - - - - 愿望 - {{item.content}} - 期望时间 - {{item.deadline}} - - - + + + + + + + 愿望 + {{item.content}} + 期望时间 + {{item.deadline}} - 分享 - - - - - - - - 分享到 - - - - - - 微信 - - - - - - 朋友圈 + + + - - - - - 微博 - - - - - - QQ - - - - - - QQ空间 + 分享 + + + + + + + + 分享到 + - - - - - 生成图片 + + + + 微信 + + + + + + 朋友圈 + + + + + + 微博 + + + + + + QQ + + + + + + QQ空间 + + + + + + 生成图片 + + + - \ No newline at end of file + \ No newline at end of file diff --git a/pages/home/xyc/index.wxss b/pages/home/xyc/index.wxss index 1b1af83..71d5cee 100644 --- a/pages/home/xyc/index.wxss +++ b/pages/home/xyc/index.wxss @@ -404,82 +404,81 @@ font-family: SourceHanSansSC-medium; } /* 许愿成功回显 */ -.wishdetail{ +.wishdetail-box { position: absolute; + width: 100%; + height: 100%; +} + +.wishdetail{ + position: relative; width:100%; height:100%; - background-color: rgba(255, 255, 255, 0.7); + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + background-color: rgba(255, 255, 255, 0.9); } .popbox{ - position: absolute; - left: 66rpx; - top: 206rpx; width: 620rpx; height: 1080rpx; + display: flex; + align-items: center; + flex-direction: column; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://oss.wish.ydxxkj.top/xy/detailbkg.png); } +.popbox .t-image { + width: 70rpx; + height: 70rpx; + margin-top: 20rpx; +} + .yximg{ - position: absolute; - left: 146rpx; - top: 330rpx; width: 460rpx; height: 308rpx; - border-radius: 10px; + margin-top: 74rpx; + border-radius: 20rpx; + overflow: hidden; background-color: #767686; } + +.yximg .t-image { + width: 100%; + height: 100%; + margin: 0; +} + .ywwz2{ - position: absolute; - left: 328rpx; - top: 706rpx; - /* width: 96rpx; */ - height: 66rpx; + margin-top: 78rpx; color: rgba(248, 99, 42, 1); - font-size: 24px; - text-align: left; - font-family: SourceHanSansSC-bold; + font-size: 48rpx; + font-weight: 700; } .ywxq2{ - position: absolute; - left: 182rpx; - top: 798rpx; - width: 388rpx; - height: 150rpx; + margin-top: 40rpx; color: rgba(108, 108, 108, 1); - font-size: 18px; - text-align: center; - font-family: SourceHanSansSC-regular; + font-size: 36rpx; } .qwsj2{ - position: absolute; - left: 280rpx; - top: 980rpx; - /* width: 192rpx; */ - height: 66rpx; + margin-top: 100rpx; + font-weight: 700; color: rgba(248, 99, 42, 1); - font-size: 24px; - text-align: center; - font-family: SourceHanSansSC-regular; + font-size: 48rpx; } .qwsjtxt2{ - position: absolute; - left: 250rpx; - top: 1072rpx; - width: 254rpx; - height: 50rpx; + margin-top: 40rpx; color: rgba(108, 108, 108, 1); - font-size: 18px; - text-align: center; - font-family: SourceHanSansSC-regular; + font-size: 36rpx; } .anwz1 { - position: absolute; - bottom: 0; - margin-left: 315rpx; + width: 100%; + margin-top: 42rpx; } .anwz1 .anwz1-tb { @@ -506,8 +505,8 @@ font-family: SourceHanSansSC-medium; } .anwz1 .anzmlogo1 { - width: 100rpx; - height: 100rpx; + width: 80rpx; + height: 80rpx; } .xyctoast { @@ -530,6 +529,9 @@ font-family: SourceHanSansSC-medium; } .popup-main { + position: absolute; + bottom: 0; + width: 100%; height: 462rpx; margin-bottom: 68rpx; background-color: #fff; @@ -556,7 +558,7 @@ font-family: SourceHanSansSC-medium; .popup-main .main-box { height: 100%; - padding-top:70rpx; + padding-top:56rpx; box-sizing: border-box; display: flex; flex-wrap: wrap; diff --git a/pages/home/xyc/wdyw/wdyw.js b/pages/home/xyc/wdyw/wdyw.js index 9d0e38f..a031492 100644 --- a/pages/home/xyc/wdyw/wdyw.js +++ b/pages/home/xyc/wdyw/wdyw.js @@ -97,7 +97,7 @@ Page({ if(res.data.code==200){ this.setData({wishes:res.data.data.records}) } - }).catch((err)=>{ + }).catch((err)=>{ console.log(err); }) }, @@ -120,14 +120,12 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - }, /** * 生命周期函数--监听页面隐藏 */ onHide() { - }, /** diff --git a/project.config.json b/project.config.json index 1b426ab..799d98e 100644 --- a/project.config.json +++ b/project.config.json @@ -47,5 +47,5 @@ "ignore": [], "include": [] }, - "appid": "wxa0d7db44777041f7" + "appid": "wx810346b5136c83ef" } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index afcc415..1b18006 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,6 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "xzjl-ui", + "projectname": "xzjl-ui%202", "setting": { "compileHotReLoad": true, "urlCheck": false @@ -10,14 +10,14 @@ "list": [ { "name": "", - "pathName": "pages/home/jl/index", + "pathName": "pages/home/xx/lindex/lindex", "query": "", "launchMode": "default", "scene": null }, { "name": "", - "pathName": "pages/home/xx/lindex/lindex", + "pathName": "pages/home/xx/lindex/lxz/lxz", "query": "", "launchMode": "default", "scene": null