diff --git a/pages/home/jl/index.js b/pages/home/jl/index.js index f05f831..effd944 100644 --- a/pages/home/jl/index.js +++ b/pages/home/jl/index.js @@ -200,7 +200,7 @@ Page({ this.getUserInfo() },2000) // 计算守护时长 - const energy = this.data.userInfo.pendantEnergy * 4.8 + const energy = (this.data.userInfo.pendantEnergy + this.data.userInfo.crystallineEnergy) * 4.8 let minute = 0 let hour = 0 if (energy >= 60) { diff --git a/pages/home/jl/index.wxml b/pages/home/jl/index.wxml index 9f24a21..259aede 100644 --- a/pages/home/jl/index.wxml +++ b/pages/home/jl/index.wxml @@ -5,7 +5,7 @@ - + {{userInfo.nick ? userInfo.nick : userInfo.constellation}} diff --git a/pages/home/jl/jlai/jlai.js b/pages/home/jl/jlai/jlai.js index 511e055..7ccc4aa 100644 --- a/pages/home/jl/jlai/jlai.js +++ b/pages/home/jl/jlai/jlai.js @@ -14,31 +14,30 @@ Page({ isBlank:true,//没有聊天 userInfo:{}, stxx:false, + showChat:true, + showChatToast:false }, addClick(){ - console.log('点击了加号') - this.setData({isAdd:true}) + console.log('点击了加号11') + this.setData({ + isAdd:true, + showChat: !this.data.showChat + }) }, noaddClick(){ console.log('点击了加号') - this.setData({isAdd:false}) + this.setData({ + isAdd:false, + showChat: !this.data.showChat + }) }, dovipTips(){ - wx: wx.showToast({ - title: '请购买会员或聊天次数', - icon:'none', - }) + this.setData({showChatToast: !this.data.showChatToast}) }, go2Member(){ - console.log('一天啊啊啊') wx.navigateTo({ url: '/pages/home/me/member/member' - }) - }, - doLt(e){/**点击快捷选项 */ - console.log('到此一游') - this.setData({ltinfo:e.target.dataset.lt}) - + }) }, go2BB(e){/**鼠标回显事件 */ // this.setData({ltinfo:e.detail.value}) @@ -97,6 +96,25 @@ Page({ go2Reback(){ wx.navigateBack({ changed: true }); }, + // 获取聊天气泡内容 + getContent(e){ + const ctn = e.currentTarget.dataset.ctn + if (ctn === '1') { + this.setData({ltinfo: '请告诉我未来一个月的星座运势'}) + }else if(ctn === '2'){ + this.setData({ltinfo: '你可以帮我占卜星骰吗?'}) + }else if(ctn === '3'){ + this.setData({ltinfo: '你可以帮我占卜塔罗吗?'}) + }else if(ctn === '4'){ + this.setData({ltinfo: '我有一些情感上的问题,你能帮我解答吗?'}) + }else if(ctn === '5'){ + this.setData({ltinfo: '我和ta未来会怎样?'}) + }else if(ctn === '6'){ + this.setData({ltinfo: '请跟我一起玩文字冒险游戏吧'}) + }else if(ctn === '7'){ + this.setData({ltinfo: '我需要写一封情书,但我不太会表达。我会告诉你我们之间的经历和我想表达的心意,你可以帮我整理成一封动人的情书吗?'}) + } + }, /** * 生命周期函数--监听页面加载 */ @@ -115,7 +133,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + this.getUserInfo() }, /** diff --git a/pages/home/jl/jlai/jlai.wxml b/pages/home/jl/jlai/jlai.wxml index 229c2b2..941ebd3 100644 --- a/pages/home/jl/jlai/jlai.wxml +++ b/pages/home/jl/jlai/jlai.wxml @@ -2,34 +2,36 @@ 星座精灵AI 免费次数剩余:{{times}}条 - - - 星座运势 - 星座占卜 - 塔罗占卜 - 情感倾诉 - 我和Ta未来会怎样 - 文字冒险游戏 - 帮我写一封情书 - - 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + + + + 星座运势 + 星座占卜 + 塔罗占卜 + 情感倾诉 + 我和Ta未来会怎样 + 文字冒险游戏 + 帮我写一封情书 + + 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + - - - - 星座运势 - 星座占卜 - 塔罗占卜 - 情感倾诉 - 我和Ta未来会怎样 - 文字冒险游戏 - 帮我写一封情书 - - 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + + + 星座运势 + 星座占卜 + 塔罗占卜 + 情感倾诉 + 我和Ta未来会怎样 + 文字冒险游戏 + 帮我写一封情书 + + 你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧! + + 开通会员 + 开通会员享不限次畅聊 + - 开通会员 - 开通会员享不限次畅聊 - @@ -43,16 +45,16 @@ - + - + - + @@ -61,22 +63,46 @@ - + - - + + + - 星座运势 - 星座占卜 - 塔罗占卜 - 文字冒险游戏 - 帮我写一封情书 - 我和Ta未来会怎样 - 情感倾诉 + 星座运势 + 星座占卜 + 塔罗占卜 + 文字冒险游戏 + 帮我写一封情书 + 我和Ta未来会怎样 + 情感倾诉 + + + + + + + + + + 没有免费次数啦~ + 开通会员,可享无限次畅聊哦! + + + + + + + 开通会员 + + + + 开通会员享不限次畅聊 + diff --git a/pages/home/jl/jlai/jlai.wxss b/pages/home/jl/jlai/jlai.wxss index 6a5b0e8..3e5d228 100644 --- a/pages/home/jl/jlai/jlai.wxss +++ b/pages/home/jl/jlai/jlai.wxss @@ -190,6 +190,7 @@ page { width: 530rpx; height: 84rpx; } + .t-textarea__label{ height:84rpx; line-height: 84rpx!important; @@ -352,4 +353,93 @@ page { } .myshkjjqgqs{ width: 236rpx; +} + +.noChat { + position: absolute; + top: 276rpx; + width: 100%; + height: 1180rpx; + background-color: rgba(255, 255, 255, 0.7); +} + +.noChat-taost { + width: 686rpx; + height: 540rpx; + margin: 278rpx auto; + padding: 96rpx 40rpx; + box-sizing: border-box; + border-radius: 30rpx; + background-color: rgba(255, 255, 255, 1); + color: rgba(16, 16, 16, 1); + font-size: 28px; + box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.2); +} + +.noChat-taost-top { + width: 100%; + height: 106rpx; + display: flex; + align-items: center; + justify-content: space-between; +} + +.taost-top-left { + width: 84rpx; + height: 84rpx; + border-radius: 50%; + border: 6rpx solid #A18651; +} + +.taost-top-right { + color: rgba(108, 108, 108, 1); + font-size: 34rpx; +} + +.noChat-taost-btm { + width: 100%; + height: 110rpx; + margin-top: 164rpx; +} + +.taost-btm-btn { + width: 100%; + height: 70rpx; + display: flex; + justify-content: center; + align-items: center; +} + +.taost-btm-btn .btn { + position: relative; + width: 240rpx; + height: 70rpx; + border-radius: 20rpx; + background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); + color: rgba(16, 16, 16, 1); + display: flex; + justify-content: center; + align-items: center; + color: rgba(255, 255, 255, 1); + font-size: 28rpx; +} + +.taost-btm-btn .btn-img { + position: absolute; + top: -80rpx; + right: -50rpx; + width: 120rpx; + height: 127rpx; + background-repeat: no-repeat; + background-size:100% 100%; + background-image: url(https://wish-assets.windymuse.com.cn/xy/hyhg.png); +} + +.taost-btm-text { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + color: rgba(108, 108, 108, 1); + font-size: 24rpx; } \ No newline at end of file diff --git a/pages/home/me/grzl/grzl.js b/pages/home/me/grzl/grzl.js index 3635f07..81f285a 100644 --- a/pages/home/me/grzl/grzl.js +++ b/pages/home/me/grzl/grzl.js @@ -114,6 +114,46 @@ Page({ go2Reback(){ wx.navigateBack({ changed: true }); }, + + // 自定义头像 + editAvatar(){ + wx.chooseMedia({ + count: 1, + mediaType: 'image', + sourceType: ['album', 'camera'], + camera: 'front', + success: (res) => { + wx.uploadFile({ + url: 'https://xzjl-api.windymuse.cn/api/resource', + filePath: res.tempFiles[0].tempFilePath, + name: 'file', + header: { + 'Authorization': wx.getStorageSync('token'), + 'Content-Type': 'multipart/form-data' + }, + formData: { + type: 'poster' + }, + success: (res) => { + const result = JSON.parse(res.data) + req.patchRequest('/api/user/curt',{avatar:result.data.abUrl}).then((res)=>{ + if(res.data.code==200){ + this.setData({userInfo:res.data.data}) + wx.showToast({ + title:'修改成功', + icon: 'none', + duration: 1000 + }) + } + }).catch((err)=>{ + console.log(err); + }) + } + }) + } + }) + }, + /** * 生命周期函数--监听页面加载 */ diff --git a/pages/home/me/grzl/grzl.wxml b/pages/home/me/grzl/grzl.wxml index 9238310..3817733 100644 --- a/pages/home/me/grzl/grzl.wxml +++ b/pages/home/me/grzl/grzl.wxml @@ -7,7 +7,7 @@ - + diff --git a/pages/home/me/indexx.js b/pages/home/me/indexx.js index e14c452..b105c93 100644 --- a/pages/home/me/indexx.js +++ b/pages/home/me/indexx.js @@ -17,11 +17,16 @@ Page({ avatar:"", nick:"", isChatVip:false,//是否会员 - phone:'123', + phone:'', hasPhone:false }, phone:'', - phoneVerificationCode:'' + phoneVerificationCode:'', + bdSuccess: false, //绑定成功 + showPhone: true, //更改手机号码 + isHavePhone: true, + existPhone: false, + findAccount: false //账号账号数据 }, // 手机号码校验 getPhone(e){ @@ -44,16 +49,52 @@ Page({ return; } }, + // 找回数据 + findData(){ + this.setData({ + existPhone: false, + findAccount: true, + showPhone: false + }) + }, + closeFindData(){ + this.setData({ + existPhone: true, + showPhone: false, + findAccount: false + }) + }, + closeExistPhone(){ + this.setData({ + existPhone: false, + showPhone: true + }) + }, + bindinNewPhone(){ + this.setData({ + existPhone: false, + showPhone: true, + isHavePhone: false, + phone: '' + }) + }, getCode(){ - console.log(this.data.phone); + // 请求前校验 + if (!/^1[3456789]\d{9}$/.test(this.data.phone)) { + 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 !== 200) { - return wx.showToast({ - title: res.data.msg, - icon: 'none' - }); + if (res.data.code === 500) { + return this.setData({ + existPhone: true, + showPhone: false + }) } if (this.data.countdown === '重新获取') { this.setData({countdown: 60}) @@ -76,14 +117,22 @@ Page({ this.setData({bdsjhVisible:true}) }, doCancelSjh(){ - this.setData({bdsjhVisible:false}) + this.setData({ + bdsjhVisible:false, + showPhone: true, //更改手机号码 + isHavePhone: false, + existPhone: false, + findAccount: false //账号账号数据 + }) + }, + bdSuccessBtn(){ + this.setData({bdsjhVisible: false}) }, doEXecSjh(){ req.patchRequest('/api/user/curt',{ phone:this.data.phone, phoneVerificationCode:this.data.phoneVerificationCode }).then((res)=>{ - console.log(res); if(res.data.code !== 200){ wx.showToast({ title:res.data.msg, @@ -91,11 +140,10 @@ Page({ }) return }else { - this.setData({bdsjhVisible:false}) this.getUserInfo() - wx.showToast({ - title:'绑定成功', - icon:'none' + this.setData({ + bdSuccess: true, + showPhone: false }) } }) @@ -176,7 +224,7 @@ Page({ if(res.data.code==200){ this.setData({ userInfo:res.data.data, - phone:res.data.data.phone + phone:res.data.data.phone, }) } console.log(this.userInfo); diff --git a/pages/home/me/indexx.wxml b/pages/home/me/indexx.wxml index 1f2b1a8..8920cba 100644 --- a/pages/home/me/indexx.wxml +++ b/pages/home/me/indexx.wxml @@ -1,5 +1,6 @@ - + + @@ -70,23 +71,68 @@ + + + + 更改手机号码 + 验证手机号码 + 如设备丢失,可凭手机号码找回账号 + 请勿将验证码告知他人 + 手机号码 + + + + - - - 绑定手机号码 - 如设备丢失,可凭手机号码找回账号 - 手机号码 - 验证码 - - - - - - - - - {{isCxHq?countdown:'立即获取'}} - 取消 - 完成 - - + 验证码 + + + {{isCxHq?countdown:'立即获取'}} + + + + 取消 + 完成 + + + + + + + 已成功绑定 + 可在我的设备中查看 + + + 好的 + + + + + + 此手机号已存在 + 如设备丢失,可在此页面找回账号 + 如需要绑定新设备请点击下方选项 + 找回账号数据 + 绑定新设备 + 取消 + + + + + 找回账号数据 + 为保护用户数据隐私 + 找回操作将会使[原设备]失效 + 找回后,只有新设备可登录账号 + 此操作将无法撤销 + 确定要找回吗? + + 取消 + 确定 + + + \ No newline at end of file diff --git a/pages/home/me/indexx.wxss b/pages/home/me/indexx.wxss index 436ec09..7a594ed 100644 --- a/pages/home/me/indexx.wxss +++ b/pages/home/me/indexx.wxss @@ -224,41 +224,36 @@ height: 140rpx!important; display: flex!important; flex-direction: column!important; + border-radius: 50%; + border: 6rpx solid #A48A57; + box-sizing: border-box; } .bdsjh{ width:660rpx; height:786rpx; + padding: 96rpx 64rpx; + box-sizing: border-box; border-radius: 30rpx; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); } .bdsjhm1{ - position: absolute; - left: 64rpx; - top: 96rpx; - width: 108px; - height: 26px; - color: rgba(51, 51, 51, 1); - font-size: 18px; + color: #333333; + font-weight: 700; + font-size: 36rpx; text-align: left; - font-family: SourceHanSansSC-medium; } .bdsjhm2{ - position: absolute; - left: 64rpx; - top: 156rpx; - width: 224px; - height: 21px; + margin-top: 8rpx; color: rgba(154, 154, 154, 1); - font-size: 14px; + font-size: 28rpx; text-align: left; - font-family: SourceHanSansSC-regular; } .qxSjh{ - position: absolute; - left: 64rpx; -top: 620rpx; width: 105px; height: 35px; line-height: 70rpx; @@ -274,9 +269,6 @@ font-family: SourceHanSansSC-medium; } .wcSjh{ - position: absolute; - left: 386rpx; - top: 620rpx; width: 105px; height: 35px; line-height: 70rpx; @@ -292,27 +284,17 @@ font-family: SourceHanSansSC-medium; } .sjhm1{ - position: absolute; - left: 64rpx; -top: 284rpx; -width: 48px; -height: 18px; -color: rgba(102, 102, 102, 1); -font-size: 12px; -text-align: left; -font-family: SourceHanSansSC-medium; + margin-top: 86rpx; + color: rgba(102, 102, 102, 1); + font-size: 24rpx; + text-align: left; } .yzm1{ - position: absolute; - left: 64rpx; -top: 422rpx; -width: 36px; -height: 18px; -color: rgba(102, 102, 102, 1); -font-size: 12px; -text-align: left; -font-family: SourceHanSansSC-medium; + margin-top: 36rpx; + color: rgba(102, 102, 102, 1); + font-size: 24rpx; + text-align: left; } .t-input{ padding: 0!important; @@ -323,48 +305,195 @@ font-family: SourceHanSansSC-medium; padding-bottom: 10rpx!important; } .sjhminput1{ + margin-top: 14rpx; padding: 0!important; - position: absolute; - left:64rpx; - top:330rpx; --td-input-border-color: rgba(75, 75, 75, 1); --td-input-border-color: rgba(255, 255, 255, 1); --td-input-default-text-color: rgba(248, 99, 42, 1); } .sjhbkx{ - position: absolute; - left: 64rpx; - top: 384rpx; - width: 266px; - border: 1rpx solid rgba(248, 99, 42, 1); + width: 532rpx; + border: 2rpx solid rgba(248, 99, 42, 1); } .yzmbkx{ - position: absolute; - left: 64rpx; - top: 532rpx; - width: 266px; - border: 1rpx solid rgba(237, 238, 242, 1); + width: 532rpx; + border: 2rpx solid rgba(237, 238, 242, 1); } .sjhminput2{ + position: relative; + margin-top: 14rpx; padding: 0!important; - position: absolute; - left:64rpx; - top:480rpx; --td-input-border-color: rgba(75, 75, 75, 1); --td-input-border-color: rgba(255, 255, 255, 1); } .cxhq{ position: absolute; - left: 500rpx; -top: 478rpx; -width: 48px; -height: 17px; -color: rgba(248, 99, 42, 1); -font-size: 12px; -text-align: left; -font-family: PingFangSC-regular; + top: 10rpx; + right: 0; + color: rgba(248, 99, 42, 1); + font-size: 24rpx; + text-align: left; + z-index: 1; +} + +.bdsjhVisible { + position: absolute; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(255, 255, 255, 0.8); +} + +.bdsjh-btn { + width: 100%; + margin-top: 96rpx; + display: flex; + justify-content: space-evenly; +} + +.bd-success { + width: 586rpx; + height: 434rpx; + line-height: 40rpx; + border-radius: 30rpx; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); +} + +.bd-success-text { + margin-top: 122rpx; + width: 100%; + height: 110rpx; +} + +.bd-success-text .text1 { + color: rgba(79, 79, 79, 1); + font-size: 36rpx; +} + +.bd-success-text .text2 { + margin-top: 16rpx; + color: rgba(248, 99, 42, 1); + font-size: 28rpx; +} + +.bd-success-btn { + width: 100%; + display: flex; + justify-content: center; +} + +.bd-success-btn .btn { + margin-top: 86rpx; + width: 210rpx; + height: 70rpx; + border-radius: 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 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + color: #fff; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.phoneCode { + width: 60%; +} + +.exist-phone { + width: 660rpx; + height: 786rpx; + line-height: 40rpx; + border-radius: 30rpx; + background-color: rgba(255, 255, 255, 1); + text-align: center; + box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); +} + +.exist-phone-text1 { + margin-top: 96rpx; + color: #333333; + font-size: 36rpx; +} + +.exist-phone-text2 { + margin-top: 38rpx; + color: rgba(154, 154, 154, 1); + font-size: 28rpx; +} +.exist-phone-text3 { + margin-top: 10rpx; + color: rgba(154, 154, 154, 1); + font-size: 28rpx; + margin-bottom: 136rpx; +} +.exist-phone-text4 { + margin-top: 96rpx; + color: rgba(248, 99, 42, 1); + font-size: 32rpx; +} +.exist-phone-text5 { + margin-top: 20rpx; + color: rgba(248, 99, 42, 1); + font-size: 32rpx; +} + +.exist-phone-btn { + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.exist-phone-btn .btn { + width: 300rpx; + height: 70rpx; + margin-bottom: 32rpx; + border-radius: 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 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + color: #fff; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.exist-btn { + width: 100%; + margin-top: 96rpx; + display: flex; + justify-content: space-around; + align-items: center; +} + +.exist-btn .btn { + width: 210rpx; + height: 70rpx; + margin-bottom: 32rpx; + border-radius: 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 4rpx 12rpx 0px rgba(0, 0, 0, 0.4); + border: 6rpx solid rgba(255, 255, 255, 1); + box-sizing: border-box; + color: #fff; + font-size: 28rpx; + display: flex; + align-items: center; + justify-content: center; } \ No newline at end of file diff --git a/pages/home/me/member/member.wxss b/pages/home/me/member/member.wxss index 3595347..6c92e32 100644 --- a/pages/home/me/member/member.wxss +++ b/pages/home/me/member/member.wxss @@ -34,10 +34,10 @@ .sftp{ position: absolute; - left: 15px; - top: 82px; - width: 345px; - height: 115px; + left: 30rpx; + top: 164rpx; + width: 690rpx; + height: 230rpx; background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/sftp.png); @@ -45,35 +45,36 @@ .hgpng{ position: absolute; - left: 109px; -top: 124px; -width: 157px; -height: 174px; -background-repeat: no-repeat; + left: 220rpx; + top: 248rpx; + width: 314rpx; + height: 348rpx; + background-repeat: no-repeat; background-size:100% 100%; background-image: url(https://wish-assets.windymuse.com.cn/xy/hgpng.png); } .question{ position: absolute; - left: 236px; - top: 124px; - width: 30px; - height: 30px; + left: 472rpx; + top: 248rpx; + width: 60rpx; + height: 60rpx; z-index: 999; + background-size: cover; background-image: url(https://wish-assets.windymuse.com.cn/xy/qqest.png); } .hybtn{ position: absolute; - left: 118px; - top: 645px; - width: 140px; - height: 40px; + left: 236rpx; + top: 1290rpx; + width: 280rpx; + height: 80rpx; line-height: 80rpx; - border-radius: 10px; + border-radius: 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); + 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: 32rpx; @@ -83,26 +84,25 @@ background-repeat: no-repeat; .viphyqy{ position: absolute; -top: 502px; -width: 750rpx; -height: 20px; -color: rgba(108, 108, 108, 1); -font-size: 14px; -text-align: center; -font-family: SourceHanSansSC-regular; + top: 1004rpx; + width: 750rpx; + height: 40rpx; + color: rgba(108, 108, 108, 1); + font-size: 28rpx; + text-align: center; } .introd{ - left:180rpx; position: absolute; -top: 538px; -width: 750rpx; -height: 75px; -line-height: 50rpx; -color: rgba(108, 108, 108, 1); -font-size: 14px; -text-align: left; -font-family: SourceHanSansSC-regular; + left:180rpx; + top: 1076rpx; + width: 750rpx; + height: 150rpx; + line-height: 50rpx; + color: rgba(108, 108, 108, 1); + font-size: 28rpx; + text-align: left; + font-family: SourceHanSansSC-regular; } .zhytxt{ @@ -131,45 +131,44 @@ font-family: SourceHanSansSC-regular; .hydqr{ position: absolute; - top: 314px; + top: 628rpx; width: 750rpx; - height: 20px; + height: 40rpx; color: rgba(248, 99, 42, 1); - font-size: 14px; + font-size: 28rpx; text-align: center; - font-family: SourceHanSansSC-regular; } .week1{ position: absolute; - left: 32px; - top: 374px; - width: 140px; - height: 60px; - line-height: 60px; - border-radius: 15px; + left: 64rpx; + top: 748rpx; + width: 280rpx; + height: 120rpx; + line-height: 120rpx; + border-radius: 30rpx; background-color: rgba(255, 255, 255, 1); color: rgba(16, 16, 16, 1); - font-size: 14px; + font-size: 28rpx; text-align: center; font-family: Arial; - border: 2px solid rgba(248, 99, 42, 1); + border: 4rpx solid rgba(248, 99, 42, 1); } .month1{ position: absolute; - left: 203px; - top: 374px; - width: 140px; - height: 60px; - line-height: 60px; - border-radius: 15px; + left: 406rpx; + top: 748rpx; + width: 280rpx; + height: 120rpx; + line-height: 120rpx; + border-radius: 30rpx; background-color: rgba(248, 99, 42, 1); color: rgba(16, 16, 16, 1); - font-size: 14px; + font-size: 28rpx; text-align: center; font-family: Arial; - border: 1px solid rgba(248, 99, 42, 1); + border: 4rpx solid rgba(248, 99, 42, 1); } .text1{ diff --git a/pages/home/xx/hy/hx/hx.js b/pages/home/xx/hy/hx/hx.js index 486ed35..5d73cb4 100644 --- a/pages/home/xx/hy/hx/hx.js +++ b/pages/home/xx/hy/hx/hx.js @@ -42,6 +42,58 @@ Page({ image: [e.target.dataset.url] }) }, + downloadBtn(){ + wx.downloadFile({ + url: this.data.image[0], + success: (res) => { + if (res.statusCode === 200) { + const tempFilePath = res.tempFilePath; + console.log('下载图片成功', tempFilePath); + // 在这里可以使用 tempFilePath 进行后续操作,比如保存到相册 + this.downloadImg(tempFilePath) + } else { + console.log('下载图片失败', res); + } + }, + fail: function (err) { + console.log('下载图片失败', err); + } + }); + }, + // 保存图片 + downloadImg(src){ + wx.authorize({ + scope: 'scope.writePhotosAlbum', + success: () => { + // 用户已经同意授权 + // 在这里调用保存图片的代码 + wx.saveImageToPhotosAlbum({ + filePath: src, + success: (res) => { + console.log('保存图片成功', res); + wx.showToast({ + title: '保存成功', + icon: 'success', + duration: 2000 + }); + this.setData({visible: false}) + }, + fail: (err) => { + console.log('保存图片失败', err); + wx.showToast({ + title: '保存失败', + icon: 'none', + duration: 2000 + }); + } + }); + }, + fail() { + // 用户拒绝授权或尚未授权 + // 可以在这里给出提示或引导用户打开设置页面进行授权 + } + }); + }, onClose(){ this.setData({visible: false}) }, diff --git a/pages/home/xx/hy/hx/hx.wxml b/pages/home/xx/hy/hx/hx.wxml index ba3d03a..3b3f22b 100644 --- a/pages/home/xx/hy/hx/hx.wxml +++ b/pages/home/xx/hy/hx/hx.wxml @@ -18,18 +18,18 @@ - - + diff --git a/pages/home/xx/hy/hx/hx.wxss b/pages/home/xx/hy/hx/hx.wxss index 2c3eeff..53a4505 100644 --- a/pages/home/xx/hy/hx/hx.wxss +++ b/pages/home/xx/hy/hx/hx.wxss @@ -107,12 +107,13 @@ width: 100%; height: 100%; z-index: 100; + display: flex; + align-items: center; background-color: #fff; } .viewer image { width: 100%; - margin-top: 400rpx; z-index: 999; } diff --git a/pages/home/xx/hy/yx/yx.js b/pages/home/xx/hy/yx/yx.js index 92c999c..51fec54 100644 --- a/pages/home/xx/hy/yx/yx.js +++ b/pages/home/xx/hy/yx/yx.js @@ -7,7 +7,8 @@ Page({ * 页面的初始数据 */ data: { - + userInfo:{}, + isPlay: true }, go2Reback(){ wx.navigateTo({ @@ -51,6 +52,7 @@ Page({ limit:-1, type: 'audio' }).then(res => { + console.log(res); const list = res.data.data.records list.forEach(item => { // 将时间字符串转为Date对象 @@ -81,12 +83,32 @@ Page({ }) }) }, + // 播放音频 + playAudio(e){ + if (this.data.isPlay) { + this.setData({isPlay: false}) + const resourceId = e.currentTarget.dataset.item.resourceId + const id = this.data.userInfo.id + const playSrc = `https://xzjl-api.windymuse.cn/api/resource/${resourceId}?k=${id}` + const innerAudioContext = wx.createInnerAudioContext() + innerAudioContext.src = playSrc + innerAudioContext.play() + console.log('22222'); + innerAudioContext.onEnded(() => { + console.log('111'); + this.setData({isPlay: true}) + }) + } + }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { this.getList() this.getLoveInfo() + this.setData({ + userInfo: wx.getStorageSync('xinyuan-userInfo') + }) }, /** diff --git a/pages/home/xx/hy/yx/yx.wxml b/pages/home/xx/hy/yx/yx.wxml index 539a83a..f2af2a8 100644 --- a/pages/home/xx/hy/yx/yx.wxml +++ b/pages/home/xx/hy/yx/yx.wxml @@ -13,9 +13,9 @@ {{nick}} {{item.createdAt}} - + - 2′24″ + {{item.extra.ssec}} 删除 diff --git a/pages/home/xy/index.js b/pages/home/xy/index.js index 74cb192..365d835 100644 --- a/pages/home/xy/index.js +++ b/pages/home/xy/index.js @@ -36,6 +36,7 @@ Page({ req.getRequest('/api/user/curt',{}).then((res)=>{ if(res.data.code==200){ this.setData({userInfo:res.data.data}) + wx.setStorageSync('xinyuan-userInfo',res.data.data) this.isFirst() } }).catch((err)=>{ diff --git a/project.private.config.json b/project.private.config.json index 9b95b39..afa7bfa 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -8,13 +8,6 @@ "condition": { "miniprogram": { "list": [ - { - "name": "", - "pathName": "pages/home/jl/index", - "query": "", - "launchMode": "default", - "scene": null - }, { "name": "", "pathName": "pages/home/me/indexx", @@ -24,21 +17,14 @@ }, { "name": "", - "pathName": "pages/home/me/yjfk/yjfk", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "", - "pathName": "pages/home/jl/jlai/jlai", + "pathName": "pages/home/xx/hy/yx/yx", "query": "", "launchMode": "default", "scene": null }, { "name": "", - "pathName": "pages/home/me/grzl/grzl", + "pathName": "pages/home/xx/hy/hx/hx", "query": "", "launchMode": "default", "scene": null