完成调整

wk-dev
Wkang921 2 years ago
parent 987dcbb4d1
commit 74f9cb9902

@ -84,13 +84,13 @@ Page({
/**获取形象对应的图片 */ /**获取形象对应的图片 */
getXxObj(){ getXxObj(){
const horoscopes = wx.getStorageSync('xy-static-img') const horoscopes = wx.getStorageSync('xy-static-img')
const type = this.data.userInfo.horoscope.name const userType = this.data.userInfo.constellation
console.log(horoscopes) const loveType = this.data.loverInfo.constellation
this.setData({ this.setData({
xingxiangtu: horoscopes[type].sprite, xingxiangtu: horoscopes[userType].sprite,
elfAvatar: horoscopes[type][`elf-avatar`] xingxiangtuLove: horoscopes[loveType].sprite,
elfAvatar: horoscopes[userType][`elf-avatar`]
}) })
console.log(this.data.elfAvatar);
}, },
ShowOrNotLogo(){ ShowOrNotLogo(){
this.setData({showSexLogo:!this.data.showSexLogo}) this.setData({showSexLogo:!this.data.showSexLogo})

@ -51,7 +51,7 @@
</view> </view>
<!--右侧人形象--> <!--右侧人形象-->
<view class="xxtr" bindtap="ShowOrNotLogoL"> <view class="xxtr" bindtap="ShowOrNotLogoL">
<image mode="heightFix" src="{{xingxiangtu[loverInfo.spriteType]}}"></image> <image mode="heightFix" src="{{xingxiangtuLove[loverInfo.spriteType]}}"></image>
<!-- 形态切换 --> <!-- 形态切换 -->
<view class="xxtr-xt2" wx:if="{{loverShow}}"> <view class="xxtr-xt2" wx:if="{{loverShow}}">
<view class="yanql4" bindtap="doSetXxtFemaleS"> <view class="yanql4" bindtap="doSetXxtFemaleS">
@ -231,7 +231,7 @@
<view class="bkg4"> <view class="bkg4">
<view class="bkg5"> <view class="bkg5">
<view class="xxt" bindtap="ShowOrNotLogo"> <view class="xxt" bindtap="ShowOrNotLogo">
<image mode="heightFix" src="{{xingxiangtu[loverInfo.spriteType]}}"></image> <image mode="heightFix" src="{{xingxiangtuLove[loverInfo.spriteType]}}"></image>
</view> </view>
</view> </view>
</view> </view>

@ -504,7 +504,7 @@ page {
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
flex-direction: column; flex-direction: column;
z-index: 3; z-index: 9999;
} }
.xxtr-xt2 { .xxtr-xt2 {
@ -1050,18 +1050,20 @@ picker-view-column {
position: absolute; position: absolute;
top: 646rpx; top: 646rpx;
left: 10rpx; left: 10rpx;
width: 100rpx; width: 30rpx;
height: 150rpx; height: 90rpx;
background-size: cover; background-size: cover;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/if-curved-left.png); opacity: 0.5;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/curved-left.png);
} }
.swiper-btn-right { .swiper-btn-right {
position: absolute; position: absolute;
top: 646rpx; top: 646rpx;
right: 10rpx; right: 10rpx;
width: 100rpx; width: 30rpx;
height: 150rpx; height: 90rpx;
background-size: cover; background-size: cover;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/if-curved-right.png); opacity: 0.5;
} background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/curved-right.png);
}

@ -11,29 +11,29 @@ Page({
image: '' image: ''
}, },
go2Reback(){ go2Reback(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/lindex/lindex' url: '/pages/home/xx/lindex/lindex'
}) })
}, },
go2Xz(){ go2Xz(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/index' url: '/pages/home/xx/hy/index'
}) })
}, },
go2Yx(){ go2Yx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/yx/yx' url: '/pages/home/xx/hy/yx/yx'
}) })
}, },
go2Hx(){ go2Hx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/hx/hx' url: '/pages/home/xx/hy/hx/hx'
}) })
}, },
go2Zt(){ go2Zt(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/zt/zt' url: '/pages/home/xx/hy/zt/zt'
}) })
}, },
blockClick(e){ blockClick(e){
console.log(e.target.dataset.url); console.log(e.target.dataset.url);

@ -10,32 +10,50 @@ Page({
list: [] list: []
}, },
go2Reback(){ go2Reback(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/lindex/lindex' url: '/pages/home/xx/lindex/lindex'
}) })
}, },
go2Xz(){ go2Xz(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/index' url: '/pages/home/xx/hy/index'
}) })
}, },
go2Yx(){ go2Yx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/yx/yx' url: '/pages/home/xx/hy/yx/yx'
}) })
}, },
go2Hx(){ go2Hx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/hx/hx' url: '/pages/home/xx/hy/hx/hx'
}) })
}, },
go2Zt(){ go2Zt(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/zt/zt' url: '/pages/home/xx/hy/zt/zt'
}) })
}, },
delLetter(){ delLetter(e){
console.log('删除'); const id = e.currentTarget.dataset.item.id
const isSelf = e.currentTarget.dataset.item.isSelf
if (isSelf) {
req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => {
console.log(res);
if (res.data.code === 200) {
wx.showToast({
title: '删除成功',
icon: 'success'
})
this.getList()
}
})
}else{
wx.showToast({
title: '只能删除自己的信札',
icon: 'none'
})
}
}, },
getList(){ getList(){
req.getRequest('/api/user/curt/message/lover',{ req.getRequest('/api/user/curt/message/lover',{
@ -55,8 +73,12 @@ Page({
const minute = date.getMinutes(); const minute = date.getMinutes();
const second = date.getSeconds(); const second = date.getSeconds();
// 补零
const formattedHours = hour < 10 ? `0${hour}` : hour
const formattedMinutes = minute < 10 ? `0${minute}` : minute
// 格式化时间 // 格式化时间
const formattedDate = `${year}${month}${day}${hour}:${minute}`; const formattedDate = `${year}${month}${day}${formattedHours}:${formattedMinutes}`;
item.createdAt = formattedDate item.createdAt = formattedDate
}) })
@ -65,12 +87,21 @@ Page({
}) })
}, },
getLoveInfo(){ getLoveInfo(){
req.getRequest('/api/user/curt/lover',{}).then(res => { const userInfo = wx.getStorageSync('xinyuan-userInfo')
console.log(res); const loveInfo = wx.getStorageSync('xinyuan-userLoveInfo')
this.setData({ this.setData({
avatar: res.data.data.avatar, myAvatar: userInfo.avatar,
nick: res.data.data.nick loveAvatar: loveInfo.avatar,
}) myNick: userInfo.nick,
loveNick: loveInfo.nick
})
},
getMsgDetail(e){
const id = e.currentTarget.dataset.id
console.log(id);
wx.redirectTo({
url: `/pages/home/xx/lindex/lxz/lxz?id=${id}&&hy=1`
}) })
}, },

@ -1,7 +1,9 @@
<!--pages/home/xx/hy/index.wxml--> <!--pages/home/xx/hy/index.wxml-->
<!--返回图标--> <!--返回图标-->
<view class="reback" bindtap="go2Reback"></view> <view class="header">
<view class="title">信札</view> <view class="reback" bindtap="go2Reback"></view>
<view class="title">纸条</view>
</view>
<!-- 中间主体 --> <!-- 中间主体 -->
<view class="main"> <view class="main">
@ -9,23 +11,25 @@
<t-swipe-cell wx:for="{{ list }}" wx:key="index"> <t-swipe-cell wx:for="{{ list }}" wx:key="index">
<view class="main-item"> <view class="main-item">
<view class="item-left"> <view class="item-left">
<view class="item-left"><image src="{{avatar}}" /></view> <view class="item-left">
<image src="{{item.isSelf ? myAvatar : loveAvatar}}" />
</view>
</view> </view>
<view class="item-text"> <view class="item-text">
<view class="item-text-name">昵称七个字昵称</view> <view class="item-text-name">{{item.isSelf ? myNick : loveNick}}</view>
<view class="item-text-time"> {{item.createdAt}} </view> <view class="item-text-time"> {{item.createdAt}} </view>
</view> </view>
<view class="item-right"> <view class="item-right" data-id="{{item.id}}" bindtap="getMsgDetail">
</view> </view>
</view> </view>
<view slot="right" class="delete-btn" bindtap="delLetter">删除</view> <view slot="right" data-item="{{item}}" class="delete-btn" bindtap="delLetter">删除</view>
</t-swipe-cell> </t-swipe-cell>
</view> </view>
<!--星讯聊天下方菜单栏--> <!--星讯聊天下方菜单栏-->
<view class="xfgjl" > <view class="xfgjl" >
<view class="xxqlcd xxqlcd1" bindtap="go2Xz">信札</view> <view class="xxqlcd xxqlcd1" bindtap="go2Xz">信札</view>
<view class="xxqlcd xxqlcd2" bindtap="go2Yx">音讯</view> <view class="xxqlcd xxqlcd2" bindtap="go2Yx">音讯</view>
<view class="xxqlcd xxqlcd3" bindtap="go2Hx">画像</view> <view class="xxqlcd xxqlcd3" bindtap="go2Hx">画像</view>
<view class="xxqlcd xxqlcd4" bindtap="go2Zt">纸条</view> <view class="xxqlcd xxqlcd4" bindtap="go2Zt">纸条</view>
</view> </view>

@ -1,31 +1,37 @@
/* pages/home/xx/hy/index.wxss */ /* pages/home/xx/hy/index.wxss */
.reback{ .header {
position: fixed; position: fixed;
margin-left: 20rpx; top: 0;
margin-top:108rpx; 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; width:48rpx;
height:48rpx; height:48rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
z-index: 1;
background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png);
} }
.title{ .title{
position: fixed;
left: 278rpx;
top: 108rpx;
width: 196rpx; width: 196rpx;
height: 48rpx; height: 48rpx;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 32rpx; font-size: 32rpx;
text-align: center; text-align: center;
z-index: 1;
font-family: SourceHanSansSC-regular;
} }
.xfgjl{ .xfgjl{
position: fixed; position: fixed;
left: 0px; bottom: 0;
left: 0;
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
margin-top: 1416rpx; margin-top: 1416rpx;
@ -51,12 +57,13 @@
} }
.main { .main {
position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 208rpx; padding-top: 208rpx;
padding-bottom: 200rpx;
box-sizing: border-box; box-sizing: border-box;
background-size: contain; background-size: contain;
overflow-y: scroll;
} }
.main-bgc { .main-bgc {

@ -11,27 +11,27 @@ Page({
isPlay: true isPlay: true
}, },
go2Reback(){ go2Reback(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/lindex/lindex' url: '/pages/home/xx/lindex/lindex'
}) })
}, },
go2Xz(){ go2Xz(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/index' url: '/pages/home/xx/hy/index'
}) })
}, },
go2Yx(){ go2Yx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/yx/yx' url: '/pages/home/xx/hy/yx/yx'
}) })
}, },
go2Hx(){ go2Hx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/hx/hx' url: '/pages/home/xx/hy/hx/hx'
}) })
}, },
go2Zt(){ go2Zt(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/zt/zt' url: '/pages/home/xx/hy/zt/zt'
}) })
}, },
@ -75,9 +75,12 @@ Page({
const hour = date.getHours(); const hour = date.getHours();
const minute = date.getMinutes(); const minute = date.getMinutes();
const second = date.getSeconds(); const second = date.getSeconds();
// 补零
const formattedHours = hour < 10 ? `0${hour}` : hour
const formattedMinutes = minute < 10 ? `0${minute}` : minute
// 格式化时间 // 格式化时间
const formattedDate = `${year}${month}${day}${hour}:${minute}`; const formattedDate = `${year}${month}${day}${formattedHours}:${formattedMinutes}`;
item.createdAt = formattedDate item.createdAt = formattedDate
}) })
console.log(list); console.log(list);

@ -12,27 +12,27 @@ Page({
userInfo: {} userInfo: {}
}, },
go2Reback(){ go2Reback(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/lindex/lindex' url: '/pages/home/xx/lindex/lindex'
}) })
}, },
go2Xz(){ go2Xz(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/index' url: '/pages/home/xx/hy/index'
}) })
}, },
go2Yx(){ go2Yx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/yx/yx' url: '/pages/home/xx/hy/yx/yx'
}) })
}, },
go2Hx(){ go2Hx(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/hx/hx' url: '/pages/home/xx/hy/hx/hx'
}) })
}, },
go2Zt(){ go2Zt(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/zt/zt' url: '/pages/home/xx/hy/zt/zt'
}) })
}, },
@ -72,8 +72,12 @@ Page({
const minute = date.getMinutes(); const minute = date.getMinutes();
const second = date.getSeconds(); const second = date.getSeconds();
// 补零
const formattedHours = hour < 10 ? `0${hour}` : hour
const formattedMinutes = minute < 10 ? `0${minute}` : minute
// 格式化时间 // 格式化时间
const formattedDate = `${year}${month}${day}${hour}:${minute}`; const formattedDate = `${year}${month}${day}${formattedHours}:${formattedMinutes}`;
item.createdAt = formattedDate item.createdAt = formattedDate
}) })

@ -27,10 +27,10 @@
<!--星讯聊天下方菜单栏--> <!--星讯聊天下方菜单栏-->
<view class="xfgjl" > <view class="xfgjl" >
<view class="xxqlcd xxqlcd1" bindtap="go2Xz">信札</view> <view class="xxqlcd xxqlcd1" bindtap="go2Xz">信札</view>
<view class="xxqlcd xxqlcd2" bindtap="go2Yx">音讯</view> <view class="xxqlcd xxqlcd2" bindtap="go2Yx">音讯</view>
<view class="xxqlcd xxqlcd3" bindtap="go2Hx">画像</view> <view class="xxqlcd xxqlcd3" bindtap="go2Hx">画像</view>
<view class="xxqlcd xxqlcd4" bindtap="go2Zt">纸条</view> <view class="xxqlcd xxqlcd4" bindtap="go2Zt">纸条</view>
</view> </view>
<!-- 打开字条 --> <!-- 打开字条 -->

@ -318,13 +318,8 @@ Page({
this.setData({dsQTime:this.data.dsQTime+this.data.second+1}) this.setData({dsQTime:this.data.dsQTime+this.data.second+1})
console.log(this.data.dsQTime) console.log(this.data.dsQTime)
}, },
allTap(){
this.popover.onHide();
},
// 响应popover组件中的子元素点击事件
doDelXiaoxi(){ doDelXiaoxi(){
req.deleteRequest('/api/user/curt/message/'+this.data.delId,{}).then((res)=>{ req.deleteRequest('/api/user/curt/message/'+this.data.delId,{}).then((res)=>{
this.popover.onHide();
if(res.data.code==200){ if(res.data.code==200){
wx.showToast({ wx.showToast({
title: '删除消息成功', title: '删除消息成功',
@ -351,24 +346,30 @@ Page({
icon: 'none' icon: 'none'
}); });
// 调用自定义组件 popover 中的 onHide 方法 // 调用自定义组件 popover 中的 onHide 方法
this.popover.onHide(); // this.popover.onHide();
}, },
// 删除消息
changAn(e){ changAn(e){
if(!this.popover){ const id = e.currentTarget.dataset.id
this.popover = this.selectComponent('#popover'); this.setData({delId:id})
},
deleteMsg(){
console.log(this.data.delId);
req.deleteRequest(`/api/user/curt/message/${this.data.delId}`,{}).then(res => {
console.log(res);
if (res.data.code === 200) {
wx.showToast({
title: '删除成功',
icon: 'success'
})
this.doMessageInfo()
}else {
wx.showToast({
title: '删除失败',
icon: 'error'
})
} }
console.log('执行了长按。。。')// +e.currentTarget.dataset['index'] })
console.log(e.currentTarget.dataset['id'])
this.setData({delId:e.currentTarget.dataset['id']})
// 获取按钮元素的坐标信息
let id = 'button'// 或者 e.target.id 获取点击元素的 ID 值
console.log(e.currentTarget.dataset['index'])
wx.createSelectorQuery().select('#' + e.currentTarget.dataset['index']).boundingClientRect(res => {
// 调用自定义组件 popover 中的 onDisplay 方法
this.popover.onDisplay(res);
}).exec();
}, },
go2BcPic(){/**保存图片 */ go2BcPic(){/**保存图片 */
let that= this; let that= this;
@ -442,22 +443,24 @@ Page({
duration: 1000 duration: 1000
}) })
}else{ }else{
req.postRequest('/api/user/curt/message/lover',{"type": "text","content": this.data.ztText}).then((res)=>{ req.postRequest('/api/user/curt/message/lover',{
this.onLoad() type: 'text',
if(res.data.code==200){ content: this.data.ztText
}).then((res)=>{
if(res.data.code === 200){
this.setData({ztVisible:false,ztText:''})
this.onLoad()
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
this.setData({ztVisible:false,ztText:''})
} }
}, },
go2Huiyi(){/**跳转到回忆页面 */ go2Huiyi(){/**跳转到回忆页面 */
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/xx/hy/index' url: '/pages/home/xx/hy/index'
}) })
}, },
doMessageInfo(){/**查询聊天信息 */ doMessageInfo(){/**查询聊天信息 */
req.getRequest('/api/user/curt/message/lover',{ limit:-1}).then((res)=>{ req.getRequest('/api/user/curt/message/lover',{ limit:-1}).then((res)=>{
@ -471,7 +474,12 @@ Page({
const day = date.getDate() const day = date.getDate()
const hours = date.getHours() const hours = date.getHours()
const minutes = date.getMinutes() const minutes = date.getMinutes()
item.createdAt = `${year}${month}${day}${hours}:${minutes}`
// 补零
const formattedHours = hours < 10 ? `0${hours}` : hours
const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes
item.createdAt = `${year}${month}${day}${formattedHours}:${formattedMinutes}`
}) })
// 塞选出对方的消息 // 塞选出对方的消息
@ -582,11 +590,19 @@ Page({
}, },
doClickXz(){ doClickXz(){
this.setData({xinzhaVisible:true}) this.setData({xinzhaVisible:true})
console.log('点击了信札') wx.redirectTo({
wx.navigateTo({
url: '/pages/home/xx/lindex/lxz/lxz' url: '/pages/home/xx/lindex/lxz/lxz'
}) })
}, },
getLetter(e){
console.log(e.currentTarget.dataset.item.id,'222');
const id = e.currentTarget.dataset.item.id
wx.redirectTo({
url: '/pages/home/xx/lindex/lxz/lxz?id=' + id
})
},
doCancelXz(){ doCancelXz(){
this.setData({xinzhaVisible:false}) this.setData({xinzhaVisible:false})
}, },
@ -595,17 +611,12 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log('开始。。。。')
const innerAudioContext = wx.createInnerAudioContext({ const innerAudioContext = wx.createInnerAudioContext({
useWebAudioImplement: false useWebAudioImplement: false
}) })
this.setData({innerAudioContext:innerAudioContext}) this.setData({innerAudioContext:innerAudioContext})
this.popover = this.selectComponent('#popover');
console.log('结束。。。。')
this.doQueryInit() this.doQueryInit()
this.doMessageInfo() this.doMessageInfo()
/**----------------一下为编辑器代码-----------------*/
}, },
/** /**
@ -616,11 +627,10 @@ Page({
this.doMessageInfo() this.doMessageInfo()
// 轮询获取信息 // 轮询获取信息
// const time = setInterval(() => { const time = setInterval(() => {
// this.doMessageInfo() this.doMessageInfo()
// console.log('1111'); }, 2000);
// }, 2000); this.setData({time: time})
// this.setData({time: time})
}, },
/** /**

@ -2,8 +2,6 @@
"usingComponents": { "usingComponents": {
"t-image": "tdesign-miniprogram/image/image", "t-image": "tdesign-miniprogram/image/image",
"t-popup": "tdesign-miniprogram/popup/popup", "t-popup": "tdesign-miniprogram/popup/popup",
"t-textarea": "tdesign-miniprogram/textarea/textarea", "t-textarea": "tdesign-miniprogram/textarea/textarea"
"popover": "/components/popover",
"popover-item": "/components/popover-item"
} }
} }

@ -6,7 +6,7 @@
<view class="title">星讯</view> <view class="title">星讯</view>
</view> </view>
<view catchtap="allTap" class="allTap"> <view class="allTap">
<!--聊天内容-可以滑动--> <!--聊天内容-可以滑动-->
<view class="ltinfo"> <view class="ltinfo">
@ -37,8 +37,9 @@
<view wx:if="{{item.isSelf}}" > <view wx:if="{{item.isSelf}}" >
<!--发送图片消息--> <!--发送图片消息-->
<view class="zjtableatp1" wx:if="{{item.type=='graphic'}}"> <view class="zjtableatp1" wx:if="{{item.type=='graphic'}}">
<view class="delete-btn" wx:if="{{delId === item.id}}" bindtap="deleteMsg">删除</view>
<!--聊天图片&已读未读--> <!--聊天图片&已读未读-->
<view class="zttp11" data-id="{{item.id}}" id="{{'id001'+index}}" data-index="{{'id001'+index}}" bindlongpress="changAn"> <view class="zttp11" data-id="{{item.id}}" id="{{'id001'+index}}" bindlongpress="changAn">
<view class="zjydwdtp2">{{item.status=='unread'?'未读':'已读'}}</view> <view class="zjydwdtp2">{{item.status=='unread'?'未读':'已读'}}</view>
<!--聊天图片--> <!--聊天图片-->
<t-image src="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" class="zjxftp2" mode="heightFix" bindtap="go2SeeHxDetail" data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"></t-image> <t-image src="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" class="zjxftp2" mode="heightFix" bindtap="go2SeeHxDetail" data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"></t-image>
@ -46,60 +47,64 @@
<!--自己的头像框--> <!--自己的头像框-->
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image> <t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image>
</view> </view>
<!--发送信件消息--> <!--发送音频消息-->
<view class="zjtablea1" wx:if="{{item.type=='xj'}}"> <view class="zjtablea2" wx:if="{{item.type=='audio'}}">
<view class="zjxf1"></view> <view class="delete-btn" wx:if="{{delId === item.id}}" bindtap="deleteMsg">删除</view>
<view class="zjydwd1">{{item.status=='unread'?'未读':'已读'}}</view> <view class="zjypydwd" >{{item.status=='unread'?'未读':'已读'}}</view>
<view
data-bf="{{!item.extra.isBf}}"
class="zjypk1" wx:if="{{!item.extra.isBf}}"
data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"
data-index="{{index}}"
data-id="{{item.id}}"
bindtap="doLuYINBoF"
bindlongpress="changAn"
>
<view class="zjypt1"></view>
<view class="zjypwz1">{{item.extra.ssec}}</view>
</view>
<view
data-bf="{{!item.extra.isBf}}"
class="zjypk1" wx:if="{{item.extra.isBf}}"
data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"
data-index="{{index}}"
bindtap="doLuYINBoF"
>
<view class="zjypt11">
<view class="box2" style="float: left; height: 60rpx; width: 1000px;">
<image wx:for="{{xhCstP}}" wx:key="index" style="height: 60rpx;width: 60rpx;"
src="https://wish-assets.windymuse.com.cn/xy/yppic.png" mode=""/>
</view>
</view>
<view class="zjypwz1">{{item.extra.ssec}}</view>
</view>
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框--> <t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
</view> </view>
<!--发送音频消息--> <!--发送文字消息-->
<view class="zjtablea2" wx:if="{{item.type=='audio'}}"> <view class="zjtable3" wx:if="{{item.type=='text'}}">
<view class="zjypydwd" >{{item.status=='unread'?'未读':'已读'}}</view> <view class="delete-btn" wx:if="{{delId === item.id}}" bindtap="deleteMsg">删除</view>
<view <view class="zjtextydwd1">{{item.status=='unread'?'未读':'已读'}}</view>
data-bf="{{!item.extra.isBf}}" <view class="zjxxbox1"
class="zjypk1" wx:if="{{!item.extra.isBf}}" bindlongpress="changAn"
data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" id="{{'idtext001'+index}}"
data-index="{{index}}" data-index="{{'idtext001'+index}}"
bindtap="doLuYINBoF" data-id="{{item.id}}"
> bindtap="dKztDetial"
<view class="zjypt1"></view> data-xq="{{item}}"
<view class="zjypwz1">{{item.extra.ssec}}</view> >
</view> <view class="zjtextcontent">
<view {{item.content}}
data-bf="{{!item.extra.isBf}}" </view>
class="zjypk1" wx:if="{{item.extra.isBf}}"
data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"
data-index="{{index}}"
bindtap="doLuYINBoF"
>
<view class="zjypt11">
<view class="box2" style="float: left; height: 60rpx; width: 1000px;">
<image wx:for="{{xhCstP}}" wx:key="index" style="height: 60rpx;width: 60rpx;"
src="https://wish-assets.windymuse.com.cn/xy/yppic.png" mode=""/>
</view> </view>
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
</view> </view>
<view class="zjypwz1">{{item.extra.ssec}}</view> <!--发送信札消息-->
</view> <view class="zjtable4" wx:if="{{item.type ==='letter'}}">
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框--> <view class="delete-btn" wx:if="{{delId === item.id}}" bindtap="deleteMsg">删除</view>
</view> <view class="zjtextydwd1">{{item.status=='unread'?'未读':'已读'}}</view>
<!--发送文字消息--> <view class="xz-box" bindtap="getLetter" data-item="{{item}}" data-id="{{item.id}}" bindlongpress="changAn"></view>
<view class="zjtable3" wx:if="{{item.type=='text'}}"> <t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
<view class="zjtextydwd1">{{item.status=='unread'?'未读':'已读'}}</view>
<view class="zjxxbox1"
bindlongpress="changAn"
id="{{'idtext001'+index}}"
data-index="{{'idtext001'+index}}"
data-id="{{item.id}}"
bindtap="dKztDetial"
data-xq="{{item}}"
>
<view class="zjtextcontent">
<text>{{item.content}}</text>
</view>
</view> </view>
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
</view>
</view> </view>
<!--对方发的消息--> <!--对方发的消息-->
<view wx:if="{{!item.isSelf}}" > <view wx:if="{{!item.isSelf}}" >
@ -124,7 +129,7 @@
<view wx:if="{{item.type=='text'}}" class="zjtableatp2"> <view wx:if="{{item.type=='text'}}" class="zjtableatp2">
<view class="zttp12" wx:if="{{item.type=='text'}}"> <view class="zttp12" wx:if="{{item.type=='text'}}">
<t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框--> <t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框-->
<view bindtap="dKztDetial" data-xq="{{item}}" class="dftext"wx:if="{{item.type=='text'}}"> <view bindtap="dKztDetial" data-xq="{{item}}" data-id="{{item.id}}" class="dftext"wx:if="{{item.type=='text'}}" bindlongpress="changAn">
<view class="xjtext">{{item.content}}</view> <view class="xjtext">{{item.content}}</view>
</view> </view>
<view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> <view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view>
@ -142,6 +147,8 @@
data-index="{{index}}" data-index="{{index}}"
bindtap="doLuYINBoF" bindtap="doLuYINBoF"
data-item="{{item}}" data-item="{{item}}"
data-id="{{item.id}}"
bindlongpress="changAn"
> >
<view class="zjypt1"></view> <view class="zjypt1"></view>
<view class="zjypwz1">{{item.extra.ssec}}</view> <view class="zjypwz1">{{item.extra.ssec}}</view>
@ -166,16 +173,12 @@
</view> </view>
</view> </view>
<!-- 信件内容 --> <!--信札消息-->
<view wx:if="{{item.type=='xj'}}" class="zjtableatp2"> <view class="zjtableatp4" wx:if="{{item.type ==='letter'}}">
<view class="zttp12" wx:if="{{item.type=='xj'}}"> <t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image>
<t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框--> <view class="xz-box" bindtap="getLetter" data-item="{{item}}" data-id="{{item.id}}"></view>
<view class="dfxf" wx:if="{{item.type=='xj'}}"></view> <view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view>
<view class="dfxfydwd" wx:if="{{item.type=='xj'}}">{{item.status=='unread'?'未读':'已读'}}</view>
<view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="cqlgd"></view> <view class="cqlgd"></view>
@ -202,7 +205,7 @@
<!--打开纸条弹窗--> <!--打开纸条弹窗-->
<t-popup visible="{{dkZtVisible}}" placement="top" class="ztPop"> <t-popup visible="{{dkZtVisible}}" placement="top" class="ztPop">
<view class="ztPopcenter"></view> <view class="ztPopcenter"></view>
<t-textarea model:value="{{tDetial.content}}" t-class="external-class" placeholder="在此处输入文字" class="ztwzk" disabled /> <t-textarea value="{{tDetial.content}}" t-class="external-class" placeholder="在此处输入文字" class="ztwzk" disabled />
<!--返回按钮--> <!--返回按钮-->
<view class="fhan11" bindtap="doCancelDkZt"></view> <view class="fhan11" bindtap="doCancelDkZt"></view>
<view class="fan11r" bindtap="doCancelDkZt"></view> <view class="fan11r" bindtap="doCancelDkZt"></view>
@ -224,7 +227,6 @@
<!--录音弹窗--> <!--录音弹窗-->
<view class="luying-box" wx:if="{{luyinVisible}}"> <view class="luying-box" wx:if="{{luyinVisible}}">
<!-- <t-popup visible="{{luyinVisible}}" bind:visible-change="onVisibleChange" placement="bottom"> -->
<view class="luyinblock"> <view class="luyinblock">
<view class="header"> <view class="header">
<view class="qxly" aria-role="button" bindtap="quxiaoLuyin">取消</view> <view class="qxly" aria-role="button" bindtap="quxiaoLuyin">取消</view>
@ -258,10 +260,4 @@
<view class="wlyan4"></view> <view class="wlyan4"></view>
</view> </view>
</view> </view>
<!-- </t-popup> -->
</view> </view>
<popover id='popover'>
<popover-item bindtap='doDelXiaoxi'>删除</popover-item>
</popover>

@ -326,11 +326,13 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.xjtext{ .xjtext{
margin-left: 36rpx; width: 100%;
width: 123px; padding: 0 36rpx;
text-overflow: -o-ellipsis-lastline; box-sizing: border-box;
white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
text-align: center;
} }
.dftextwd{ .dftextwd{
display: inline-block; display: inline-block;
@ -409,6 +411,7 @@
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.zjtablea2{ .zjtablea2{
position: relative;
width: 100%; width: 100%;
height: 134rpx; height: 134rpx;
display: flex; display: flex;
@ -457,6 +460,16 @@
} }
.zjtable3{ .zjtable3{
position: relative;
width: 100%;
height: 150rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.zjtable4 {
position: relative;
width: 100%; width: 100%;
height: 150rpx; height: 150rpx;
display: flex; display: flex;
@ -464,6 +477,22 @@
justify-content: flex-end; justify-content: flex-end;
} }
.zjtableatp4 {
position: relative;
width: 100%;
height: 150rpx;
display: flex;
align-items: center;
justify-content: flex-start;
}
.xz-box {
width: 186rpx;
height: 130rpx;
background-size: cover;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/xz-box.png);
}
.zjxxbox1{ .zjxxbox1{
width: 360rpx; width: 360rpx;
height: 120rpx; height: 120rpx;
@ -476,6 +505,17 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.zjtextcontent {
width: 360rpx;
padding: 0 36rpx;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
}
.zjtextydwd1{ .zjtextydwd1{
height: 100%; height: 100%;
display: flex; display: flex;
@ -485,20 +525,6 @@
margin: 0 10rpx 60rpx 0; margin: 0 10rpx 60rpx 0;
} }
.zjtextcontent{
position: absolute;
margin-left: 52rpx;
margin-top: 41rpx;
width: 126px;
height: 21px;
line-height: 42rpx;
color: rgba(51, 51, 51, 1);
font-size: 14px;
font-family: SourceHanSansSC-regular;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.ztPop{ .ztPop{
position: absolute; position: absolute;
width:750rpx ; width:750rpx ;
@ -593,9 +619,10 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png);
background-color: transparent!important; background-color: transparent!important;
} }
.zjtableatp1{ .zjtableatp1{
position: relative;
width: 100%; width: 100%;
height: 220rpx; height: 220rpx;
padding: 0 32rpx; /* padding: 0 32rpx; */
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
@ -605,7 +632,7 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png);
.zjtableatp2{ .zjtableatp2{
width: 100%; width: 100%;
height: 150rpx; height: 150rpx;
padding: 0 32rpx; /* padding: 0 32rpx; */
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
@ -615,7 +642,7 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png);
.zjtableatp3{ .zjtableatp3{
width: 100%; width: 100%;
height: 220rpx; height: 220rpx;
padding: 0 32rpx; /* padding: 0 32rpx; */
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
@ -1129,4 +1156,19 @@ background-image: url(https://wish-assets.windymuse.com.cn/xy/xtreturn.png);
align-items: flex-end; align-items: flex-end;
background-color: rgba(255, 255, 255, 0.9); background-color: rgba(255, 255, 255, 0.9);
z-index: 99999; z-index: 99999;
}
.delete-btn {
position: absolute;
top: -50rpx;
right: 120rpx;
width: 148rpx;
height: 84rpx;
color: #6c6c6c;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/del-icon.png);
} }

@ -13,13 +13,13 @@ Page({
content:'', content:'',
audioList:[], // 音频列表 audioList:[], // 音频列表
imgList:[], // 图片列表 imgList:[], // 图片列表
messageList: [{content: '', type: 'text', index: 1}], //消息列表
sound:'', sound:'',
soundTime:'00:00:00', soundTime:'00:00:00',
duration: '', duration: '',
minute:0, //分 minute:0, //分
second:0, //秒 second:0, //秒
millisecond:0, //毫秒 millisecond:0, //毫秒
showBtn:true,
showImgBig:false, //图片太大弹层 showImgBig:false, //图片太大弹层
showSoundMore:false, //语音太多提示 showSoundMore:false, //语音太多提示
showSend:false, //寄出提示 showSend:false, //寄出提示
@ -33,30 +33,48 @@ Page({
btn3:false, btn3:false,
btn4:false, btn4:false,
showSoundImg:true, showSoundImg:true,
isPlaying: false, // 是否正在播放语音 isPlaying: false // 是否正在播放语音
}, },
already(){ already(){
console.log('确定寄出'); console.log('确定寄出');
this.setData({showAlready:true}) this.setData({showAlready:true})
const list = [ ...this.data.audioList, ...this.data.imgList] const list = []
list.push({ this.data.messageList.forEach(item => {
type: 'text', const obj = {}
content: this.data.content obj.type = item.type
if (item.content) {
obj.content = item.content
}
if (item.resourceId) {
obj.resourceId = item.resourceId
}
if (item.extra) {
obj.extra = item.extra
}
if (item.videoSrc) {
obj.extra.videoSrc = item.videoSrc
}
if (item.img) {
obj.extra = {}
obj.extra.img = item.img
}
list.push(obj)
}) })
const fromData = { const formData = {
from: this.data.from, type: 'letter',
to: this.data.to, letter: {
messageList: list, from: this.data.from,
status:'unread' to: this.data.to,
messages: list
}
} }
console.log(fromData); req.postRequest('/api/user/curt/message/lover',formData).then(res =>{
// 修改信札 if (res.data.code === 200) {
req.putRequest('/api/user/curt/letter',fromData).then(res => { wx.showToast({
console.log(res,'修改信札内容成功'); title: '信札发送成功',
// 修改状态 icon: 'success'
req.patchRequest('/api/user/curt/letter/send',{}).then(res => { })
console.log(res,'信札状态修改成功'); }
})
}) })
}, },
closeShowImgBig(){ closeShowImgBig(){
@ -74,31 +92,53 @@ Page({
closeShowImgToast(){this.setData({showImgToast: false})}, closeShowImgToast(){this.setData({showImgToast: false})},
openPreview(){ openPreview(){
console.log('预览'); console.log('预览');
this.setData({Preview:true}) if (this.data.letterId) {
if (this.data.hy) {
return wx.redirectTo({
url: '/pages/home/xx/hy/index',
})
}
return wx.redirectTo({
url: '/pages/home/xx/lindex/lindex',
})
}
this.setData({Preview : !this.data.Preview})
}, },
ClearYl(e){ ClearYl(e){
console.log('清除语音'); console.log('清除语音');
const id = e.currentTarget.dataset.id const id = e.currentTarget.dataset.id
const list = this.data.audioList.filter(item => { const list = this.data.messageList.filter(item => {
return item.resourceId !== id return item.resourceId !== id
}) })
this.setData({audioList: list}) this.setData({messageList: list})
}, },
ClearImg(e){ ClearImg(e){
console.log('清除图片'); console.log('清除图片');
const id = e.currentTarget.dataset.id const id = e.currentTarget.dataset.id
const list = this.data.imgList.filter(item => { const list = this.data.messageList.filter(item => {
return item.resourceId !== id return item.resourceId !== id
}) })
this.setData({imgList: list}) this.setData({messageList: list})
}, },
goBack(){ goBack(){
if (this.data.Preview) { wx.redirectTo({
this.setData({Preview: false}) url: '/pages/home/xx/lindex/lindex',
}else{ })
console.log('返回'); },
wx.navigateBack() // 获取文本框内容
} getTextValue(e){
const index = e.currentTarget.dataset.index
const content = e.detail.value
const list = this.data.messageList.map(item => {
if (item.index === index) {
return {
...item,
content : content
}
}
return item
})
this.setData({messageList: list})
}, },
// 上传图片 // 上传图片
addImg(){ addImg(){
@ -114,6 +154,7 @@ Page({
} }
}) })
}, },
// 文件上传 // 文件上传
uploadFile(file,type) { uploadFile(file,type) {
wx.uploadFile({ wx.uploadFile({
@ -129,35 +170,53 @@ Page({
}, },
success: (async(res) => { success: (async(res) => {
const data = JSON.parse(res.data); const data = JSON.parse(res.data);
console.log(data);
if (data.data.type === 'audio') { if (data.data.type === 'audio') {
console.log('添加音频'); console.log('添加音频');
const list = this.data.audioList const list = this.data.messageList
if(list.length >= 3){ const index = list.length + 1
const audioList = list.filter(item => {
return item.type === 'audio'
})
if(audioList.length >= 3){
this.setData({showSoundMore:true ,showSoundImg:true}) this.setData({showSoundMore:true ,showSoundImg:true})
console.log('语音太多了');
}else { }else {
list.push({ list.push({
type: 'audio', type: 'audio',
resourceId: data.data.id, resourceId: data.data.id,
duration: this.data.duration, duration: this.data.duration,
videoSrc: this.data.videoSrc, videoSrc: this.data.videoSrc,
index:index,
extra: {duration : this.data.ssec} extra: {duration : this.data.ssec}
}) })
this.setData({audioList: list}) list.push({
type: 'text',
content: '',
index: index + 1
})
this.setData({messageList: list})
} }
} else if (data.data.type === 'poster') { } else if (data.data.type === 'poster') {
console.log('添加图片'); console.log('添加图片');
const list = this.data.imgList const list = this.data.messageList
if (list.length >= 9) { const migList = list.filter(item => {
return item.type === 'graphic'
})
if (migList.length >= 9) {
this.setData({showImgToast : true}) this.setData({showImgToast : true})
}else { }else {
const index = list.length + 1
list.push({ list.push({
type: 'graphic', type: 'graphic',
resourceId: data.data.id, resourceId: data.data.id,
img: data.data.abUrl, img: data.data.abUrl,
index: index
})
list.push({
type: 'text',
content: '',
index: index + 1
}) })
this.setData({imgList: list, showImg:true}) this.setData({messageList: list, showImg:true})
} }
} }
}), }),
@ -288,39 +347,27 @@ Page({
} }
}, },
logout(){ logout(){
req.deleteRequest('/api/user/logout',{}).then((res)=>{ wx.redirectTo({
if(res.data.code===200){ url: '/pages/home/xx/lindex/lindex',
wx.navigateTo({
url: '/pages/index/index'
})
wx.showToast({
title:'寄出成功'
})
}
}) })
}, },
modify(){ modify(){
this.setData({showAlready: false, showSend: false}) this.setData({showAlready: false, showSend: false})
}, },
getLetter(){
console.log('获取当前用户信札内容');
req.getRequest('/api/user/curt/letter',{}).then(res => {
console.log(res);
})
},
// 点击音频试听 // 点击音频试听
listen(e){ listen(e){
if (this.data.isPlaying) { if (this.data.isPlaying) {
return; // 如果正在播放语音,则不触发事件 return; // 如果正在播放语音,则不触发事件
} }
const id = e.currentTarget.dataset.url.resourceId const id = e.currentTarget.dataset.url.resourceId
const videoSrc = this.data.audioList.find(item => { const videoSrc = this.data.messageList.find(item => {
return item.resourceId === id return item.resourceId === id
}).videoSrc }).videoSrc
console.log(videoSrc); console.log(videoSrc);
const innerAudioContext = wx.createInnerAudioContext() const innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = videoSrc innerAudioContext.src = videoSrc
innerAudioContext.play() // 播放 innerAudioContext.play() // 播放
console.log('播放');
this.setData({ isPlaying: true }); // 设置为正在播放语音 this.setData({ isPlaying: true }); // 设置为正在播放语音
innerAudioContext.onEnded(() => { innerAudioContext.onEnded(() => {
this.setData({ isPlaying: false }); // 播放完毕后设置为非播放状态 this.setData({ isPlaying: false }); // 播放完毕后设置为非播放状态
@ -332,12 +379,68 @@ Page({
this.setData({id:id}) this.setData({id:id})
}) })
}, },
// 获取信札消息
getLetterDetail(id){
req.getRequest(`/api/user/curt/message/${id}`,{}).then(res => {
console.log(res);
if(res.data.code === 200){
const letter = res.data.data.letter
const messages = letter.messages.map(item => {
if (item.extra && item.extra.videoSrc) {
return {
...item,
videoSrc: item.extra.videoSrc
}
}
if (item.extra && item.extra.img) {
return {
...item,
img: item.extra.img
}
}
if (item.content) {
return item
}
})
this.setData({
from: letter.from,
to: letter.to,
messageList: messages
})
// 判断是否为情侣信札 是就更改信札状态
if (res.data.data.fromUserid !== this.data.id && res.data.data.status === 'unread') {
req.patchRequest(`/api/user/curt/message/${id}/read`)
}
}else{
wx.showToast({
title: '获取信札内容失败',
icon: 'error'
})
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getLetter()
this.getUserInfo() this.getUserInfo()
// 回忆页面点击信札 数据回显示
if (options.id) {
this.getLetterDetail(options.id)
this.setData({
Preview: true,
letterId: options.id
})
}
// 判断是回忆页面跳转还是聊天页面跳转
if(options.hy){
this.setData({ hy: true })
}
}, },
/** /**

@ -1,11 +1,8 @@
<!--pages/home/xx/xz/xz.wxml--> <!--pages/home/xx/xz/xz.wxml-->
<view class="bgt1"></view> <view class="bgt1"></view>
<view class="xinfo"> <view class="xinfo" wx:if="{{!Preview}}">
<scroll-view scroll-y enhanced="{{true}}" show-scrollbar="{{false}}" class="xinfo-content"> <scroll-view scroll-y enhanced="{{true}}" show-scrollbar="{{false}}" class="xinfo-content">
<view class="xinfo-yl-title" wx:if="{{Preview}}"> <view class="xinfo-title">
To: {{to}}
</view>
<view class="xinfo-title" wx:if="{{!Preview}}">
<view class="title-to"> <view class="title-to">
<view class="text">To:</view> <view class="text">To:</view>
<t-input model:value="{{to}}" /> <t-input model:value="{{to}}" />
@ -15,39 +12,38 @@
<t-input model:value="{{from}}"/> <t-input model:value="{{from}}"/>
</view> </view>
</view> </view>
<!-- 信件文本 -->
<view class="xinfo-main"> <view wx:for="{{messageList}}" wx:key="index">
<t-textarea autosize="true" model:value="{{content}}" placeholder="信件正文" /> <!-- 信件文本 -->
</view> <view class="xinfo-main" wx:if="{{item.type === 'text'}}">
<!-- 信件语音 --> <t-textarea bindblur="getTextValue" data-index="{{item.index}}" autosize="true" value="{{item.content}}" placeholder="信件正文" />
<view class="{{Preview ? 'xinfo-ltqp-yl' : 'xinfo-ltqp'}}" wx:for="{{audioList}}" wx:key="index" bindtap="listen" data-url="{{item}}"> </view>
<image class="xinfo-yuying" src="https://wish-assets.windymuse.com.cn/xy/%E8%AF%AD%E9%9F%B3.png"></image> <!-- 信件语音 -->
<view class="xinfo-ltqp-text">{{item.extra.duration}}</view> <view class="xinfo-ltqp" wx:if="{{item.type === 'audio'}}" bindtap="listen" data-url="{{item}}">
<t-icon class="xinfo-close" name="close-circle" size="48rpx" wx:if="{{!Preview}}" bindtap="ClearYl" data-id="{{item.resourceId}}"/> <image class="xinfo-yuying" src="https://wish-assets.windymuse.com.cn/xy/%E8%AF%AD%E9%9F%B3.png"></image>
</view> <view class="xinfo-ltqp-text">{{item.extra.duration}}</view>
<!-- 信件图片 --> <t-icon class="xinfo-close" name="close-circle" size="48rpx" catchtap="ClearYl" data-id="{{item.resourceId}}"/>
<view class="{{Preview ? 'xinfo-img-yl' : 'xinfo-img'}}" wx:for="{{imgList}}" wx:key="index"> </view>
<image src="{{item.img}}" mode="widthFix"></image> <!-- 信件图片 -->
<view class="xinfo-img-close" bindtap="ClearImg" data-id="{{item.resourceId}}"> <view class="xinfo-img" wx:if="{{item.type === 'graphic'}}">
<t-icon name="close-circle" size="48rpx" wx:if="{{!Preview}}"/> <image src="{{item.img}}" mode="widthFix"></image>
<view class="xinfo-img-close" bindtap="ClearImg" data-id="{{item.resourceId}}">
<t-icon name="close-circle" size="48rpx"/>
</view>
</view> </view>
</view>
<view class="xinfo-yl-form" wx:if="{{Preview}}">
From: {{from}}
</view> </view>
<view class="xinfo-yl" wx:if="{{Preview}}"></view>
</scroll-view> </scroll-view>
</view> </view>
<view class="bgt2" wx:if="{{showBtn}}">
<view class="bgt2" wx:if="{{!Preview}}">
<view class="bgt2-btn1" bindtap="goBack"> <view class="bgt2-btn1" bindtap="goBack">
<image src="https://wish-assets.windymuse.com.cn/xy/iconPark-return%401x.png"></image> <image src="https://wish-assets.windymuse.com.cn/xy/iconPark-return%401x.png"></image>
</view> </view>
<view class="bgt2-btn2" bindtap="openSound" wx:if="{{!Preview}}">音讯</view> <view class="bgt2-btn2" bindtap="openSound">音讯</view>
<view class="bgt2-btn3" bindtap="addImg" wx:if="{{!Preview}}">画像</view> <view class="bgt2-btn3" bindtap="addImg">画像</view>
<view class="bgt2-btn4" bindtap="openPreview" wx:if="{{!Preview}}">预览</view> <view class="bgt2-btn4" bindtap="openPreview">预览</view>
<view class="bgt2-btn5" bindtap="openShowSend" wx:if="{{!Preview}}">寄出</view> <view class="bgt2-btn5" bindtap="openShowSend">寄出</view>
<view class="bgt2-yz"></view> <view class="bgt2-yz"></view>
</view> </view>
@ -104,7 +100,7 @@
</view> </view>
<view class="taost" wx:if="{{showSend}}"> <view class="taost" wx:if="{{showSend}}">
<view class="taost-box"> <view class="taost-box2">
<view class="taost-box-text">确定要寄出吗?</view> <view class="taost-box-text">确定要寄出吗?</view>
<view class="taost-box-text">信件寄出后,再次使用晶石激活</view> <view class="taost-box-text">信件寄出后,再次使用晶石激活</view>
<view class="taost-box-text">将直接提示打开信件</view> <view class="taost-box-text">将直接提示打开信件</view>
@ -132,3 +128,36 @@
</view> </view>
<view class="already-bom"></view> <view class="already-bom"></view>
</view> </view>
<!-- 预览页面 -->
<view wx:if="{{Preview}}" class="preview">
<!-- 信件主体内容 -->
<view class="preview-content">
<view class="content">
<view class="preview-content-title">To{{to}}</view>
<view wx:for="{{messageList}}" wx:key="index">
<!-- 信条 -->
<view class="preview-content-main" wx:if="{{item.type === 'text' && item.content !== ''}}">
<t-textarea bindblur="getTextValue" data-index="{{item.index}}" autosize="true" value="{{item.content}}" disabled/>
</view>
<!-- 语音 -->
<view class="preview-content-ltqp" bindtap="listen" wx:if="{{item.type === 'audio'}}" data-url="{{item}}">
<image src="https://wish-assets.windymuse.com.cn/xy/%E8%AF%AD%E9%9F%B3.png"></image>
<view class="text">{{item.extra.duration}}</view>
</view>
<!-- 图片 -->
<view class="preview-content-img" wx:if="{{item.type === 'graphic'}}">
<image src="{{item.img}}" mode="widthFix"></image>
</view>
</view>
<view class="preview-content-end">Form{{from}}</view>
</view>
</view>
<view class="preview-bkg">
<view class="preview-yz"></view>
</view>
<view class="preview-btn" bindtap="openPreview"><view class="preview-btn-img" /></view>
</view>

@ -54,43 +54,26 @@ page {
.xinfo-content { .xinfo-content {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-bottom: 100rpx; padding-bottom: 300rpx;
padding-top: 60rpx;
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
position: relative; position: relative;
pointer-events: auto; pointer-events: auto;
} background-size: cover;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/zx-bkg.png);
.xinfo-yl {
width: 100%;
height: 200rpx;
} }
.xinfo-title { .xinfo-title {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
margin-top: 60rpx; margin-bottom: 60rpx;
padding-left: 64rpx; padding-left: 64rpx;
box-sizing: border-box; box-sizing: border-box;
font-size: 28rpx; font-size: 28rpx;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
} }
.xinfo-yl-title {
margin: 60rpx 0 0 50rpx;
font-size: 32rpx;
color: rgba(108, 108, 108, 1);
}
.xinfo-yl-form {
width: 100%;
text-align: end;
margin-top: 30rpx;
padding-right: 64rpx;
box-sizing: border-box;
font-size: 32rpx;
color: rgba(108, 108, 108, 1);
}
.title-to { .title-to {
display: flex; display: flex;
@ -129,7 +112,7 @@ page {
.xinfo-main { .xinfo-main {
width: 100%; width: 100%;
margin: 60rpx 0 32rpx 0; margin-bottom: 40rpx;
padding: 0 64rpx; padding: 0 64rpx;
box-sizing: border-box; box-sizing: border-box;
} }
@ -153,29 +136,13 @@ textarea {
position: relative; position: relative;
width: 382rpx; width: 382rpx;
height: 84rpx; height: 84rpx;
margin: 0 0 20rpx 64rpx; margin: 0 0 40rpx 64rpx;
display: flex;
align-items: center;
background-size: contain;
background-image: url(https://wish-assets.windymuse.com.cn/xy/ltqpp.png);
}
.xinfo-ltqp-yl {
position: relative;
width: 382rpx;
height: 84rpx;
margin: 0 0 20rpx 64rpx;
display: flex; display: flex;
align-items: center; align-items: center;
background-size: contain; background-size: contain;
background-image: url(https://wish-assets.windymuse.com.cn/xy/ltqpp.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/ltqpp.png);
} }
.xinfo-ltqp-yl image {
width: 100%;
height: 100%;
}
.xinfo-ltqp image { .xinfo-ltqp image {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -202,23 +169,11 @@ textarea {
.xinfo-img { .xinfo-img {
position: relative; position: relative;
width: 480rpx; width: 480rpx;
margin: 40rpx 0 0 64rpx; margin: 0 0 40rpx 64rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.xinfo-img-yl {
position: relative;
width: 480rpx;
margin: 40rpx 0 0 64rpx;
display: flex;
justify-content: center;
}
.xinfo-img-yl image {
width: 100%;
}
.xinfo-img image { .xinfo-img image {
width: 100%; width: 100%;
} }
@ -356,6 +311,17 @@ textarea {
box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.4); 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 { .sound {
position: relative; position: relative;
width: 100%; width: 100%;
@ -602,4 +568,139 @@ textarea {
align-items: center; align-items: center;
color: #fff; color: #fff;
z-index: 999; z-index: 999;
}
editor {
background-color: pink;
}
/* 预览页面样式 */
.preview {
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.preview-content {
width: 616rpx;
height: 1280rpx;
margin-top: 132rpx;
background-size: 100% 100%;
background-image: url(https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/zx-bkg.png);
}
.preview-content .content{
width: 616rpx;
height: 1280rpx;
margin-top: 18rpx;
overflow-y: scroll;
}
.preview-bkg {
position: absolute;
bottom: -190rpx;
width: 100%;
height: 924rpx;
background-size: 100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/bgt2.png);
pointer-events: none;
display: flex;
justify-content: center;
}
.preview-btn {
position: absolute;
left: 32rpx;
bottom: 132rpx;
width: 110rpx;
height: 110rpx;
border-radius: 50%;
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);
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
font-family: -apple-system;
border: 6rpx solid rgba(255, 255, 255, 1);
display: flex;
justify-content: center;
align-items: center;
}
.preview-btn-img {
width: 60rpx;
height: 60rpx;
background-size: cover;
background-image: url(https://wish-assets.windymuse.com.cn/xy/iconPark-return%401x.png);
}
.preview-content-title {
color: #6c6c6c;
font-size: 32rpx;
text-align: left;
font-weight: 700;
margin: 50rpx 0 32rpx 60rpx;
}
.preview-content-end {
color: #6c6c6c;
font-size: 32rpx;
text-align: right;
font-weight: 700;
margin: 50rpx 60rpx 80rpx 0;
}
.preview-content-main {
color: #6c6c6c;
font-size: 32rpx;
margin: 0 60rpx 40rpx 60rpx;
}
.preview-content-main .t-textarea {
width: 100%;
padding: 0;
font-size: 28rpx;
background-color: rgba(0, 0, 0, 0);
}
.preview-content-ltqp {
position: relative;
width: 382rpx;
height: 84rpx;
margin: 0 0 40rpx 64rpx;
display: flex;
align-items: center;
background-size: contain;
background-image: url(https://wish-assets.windymuse.com.cn/xy/ltqpp.png);
}
.preview-content-ltqp image {
margin: 0 40rpx;
width: 70rpx;
height: 70rpx;
}
.preview-content-ltqp .text {
color: rgba(79, 79, 79, 1);
font-size: 14px;
}
.preview-content-img {
display: flex;
justify-content: center;
margin-bottom: 40rpx;
}
.preview-content-img image {
width: 480rpx;
}
.preview-yz {
width: 146rpx;
height: 146rpx;
margin-top: 470rpx;
background-image: url(https://wish-assets.windymuse.com.cn/xy/%E5%8D%B0%E7%AB%A0.png);
background-size: cover;
pointer-events: auto;
} }

@ -134,7 +134,7 @@
<!-- 信件主体内容 --> <!-- 信件主体内容 -->
<view class="preview-content"> <view class="preview-content">
<view class="content"> <view class="content">
<view class="preview-content-title">To可能性的艺术</view> <view class="preview-content-title">To{{to}}</view>
<view wx:for="{{messageList}}" wx:key="index"> <view wx:for="{{messageList}}" wx:key="index">
<!-- 信条 --> <!-- 信条 -->
@ -152,7 +152,7 @@
</view> </view>
</view> </view>
<view class="preview-content-end">Form可能性的艺术</view> <view class="preview-content-end">Form{{from}}</view>
</view> </view>
</view> </view>

@ -640,7 +640,7 @@ editor {
font-size: 32rpx; font-size: 32rpx;
text-align: left; text-align: left;
font-weight: 700; font-weight: 700;
margin: 50rpx 0 0 60rpx; margin: 50rpx 0 32rpx 60rpx;
} }
.preview-content-end { .preview-content-end {
@ -654,7 +654,7 @@ editor {
.preview-content-main { .preview-content-main {
color: #6c6c6c; color: #6c6c6c;
font-size: 32rpx; font-size: 32rpx;
margin: 32rpx 60rpx 40rpx 60rpx; margin: 0 60rpx 40rpx 60rpx;
} }
.preview-content-main .t-textarea { .preview-content-main .t-textarea {

@ -97,7 +97,6 @@ Page({
upImprove(){ upImprove(){
const mac = wx.getStorageSync('mac-key') const mac = wx.getStorageSync('mac-key')
req.patchRequest('/api/user/curt/horoscope/improve',{mac: mac}).then(res => { req.patchRequest('/api/user/curt/horoscope/improve',{mac: mac}).then(res => {
console.log(res);
}) })
}, },

@ -160,12 +160,13 @@ Page({
duration: 5000 duration: 5000
}) })
}else{ }else{
console.log('图片地址', this.data.imgUrl); req.postRequest('/api/user/curt/wish',{
console.log('图片地址', this.data.xyLink); content:this.data.xyContent,
req.postRequest('/api/user/curt/wish',{content:this.data.xyContent,deadline:this.data.note,img:this.data.imgUrl,link:this.data.xyLink}).then((res)=>{ deadline:this.data.note,
console.log('许愿成功11111') img:this.data.imgUrl,
console.log(res) link:this.data.xyLink
if(res.data.code==200){ }).then((res)=>{
if(res.data.code === 200){
this.setData({ this.setData({
visible: false, visible: false,
}); });
@ -182,16 +183,14 @@ Page({
}) })
wx.hideTabBar() wx.hideTabBar()
},2000) },2000)
this.initXy()
}else{ }else{
console.log('额外情况')
wx.showToast({ wx.showToast({
title:res.data.msg, title:res.data.msg,
icon: 'none', icon: 'none',
duration: 5000 duration: 5000
}) })
} }
}).catch((err)=>{ }).catch((err)=>{
wx.showToast({ wx.showToast({
title:'出错了:'+err.data.msg, title:'出错了:'+err.data.msg,
@ -199,7 +198,6 @@ Page({
duration: 5000 duration: 5000
}) })
}) })
console.log('许愿成功111')
} }
@ -213,7 +211,6 @@ Page({
this.setData({single:false}) this.setData({single:false})
} }
} }
console.log(this.userInfo);
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })

@ -8,13 +8,6 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "",
"pathName": "pages/home/xx/index",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "", "name": "",
"pathName": "pages/home/xx/lindex/lindex", "pathName": "pages/home/xx/lindex/lindex",
@ -24,21 +17,21 @@
}, },
{ {
"name": "", "name": "",
"pathName": "pages/home/xx/xz/xz", "pathName": "pages/home/xx/lindex/lxz/lxz",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/home/xx/xz/xz", "pathName": "pages/home/xx/hy/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/xz/index", "pathName": "pages/home/jl/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

Loading…
Cancel
Save