完成第三版修改

wk-dev
Wkang921 2 years ago
parent 2c84bdb967
commit 562bf3a979

BIN
.DS_Store vendored

Binary file not shown.

@ -11,10 +11,8 @@
"pages/index/out/out", "pages/index/out/out",
"pages/xz/index", "pages/xz/index",
"pages/home/xx/xz/xz", "pages/home/xx/xz/xz",
"pages/home/xx/xz/index",
"pages/home/me/manual/manual", "pages/home/me/manual/manual",
"pages/home/me/member/member", "pages/home/me/member/member",
"pages/home/me/member2/member",
"pages/home/me/gw/gw", "pages/home/me/gw/gw",
"pages/home/me/ysxy/ysxy", "pages/home/me/ysxy/ysxy",
"pages/home/me/yhsyxy/yhsyxy", "pages/home/me/yhsyxy/yhsyxy",
@ -26,14 +24,12 @@
"pages/home/xyc/wdyw/wdyw", "pages/home/xyc/wdyw/wdyw",
"pages/home/xyc/tdyw/tdyw", "pages/home/xyc/tdyw/tdyw",
"pages/home/me/grzl/grzl", "pages/home/me/grzl/grzl",
"pages/home/jl/jlai",
"pages/home/jl/jlai/jlai", "pages/home/jl/jlai/jlai",
"pages/home/xx/hy/index", "pages/home/xx/hy/index",
"pages/home/xx/hy/hx/hx", "pages/home/xx/hy/hx/hx",
"pages/home/xx/hy/yx/yx", "pages/home/xx/hy/yx/yx",
"pages/home/xx/hy/zt/zt", "pages/home/xx/hy/zt/zt",
"pages/home/xx/lindex/lindex", "pages/home/xx/lindex/lindex",
"pages/home/xx/lindex/xz/xz",
"pages/home/xx/lindex/lxz/lxz" "pages/home/xx/lindex/lxz/lxz"
], ],
"window": { "window": {

@ -1,40 +0,0 @@
Component({
relations: {
'./popover': {
type: 'parent'
}
},
/**
* 组件的属性列表
*/
properties: {
// 是否有底线
hasline: {
type: Boolean,
value: false
}
},
/**
* 组件的初始数据
*/
data: {
// 每项的高度
height: 40
},
/**
* 组件的方法列表
*/
methods: {
onClick: function() {
let { index } = this.properties;
let eventDetail = {
index: index
};
let eventOption = {};
this.triggerEvent('tap', eventDetail, eventOption);
}
}
})

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

@ -1,3 +0,0 @@
<view class='popover-item {{hasline ? "underline" : ""}}' hover-class='popover-item-hover' catchtap='onClick' style='height:{{height}}px;line-height:{{height}}px;'>
<slot/>
</view>

@ -1,14 +0,0 @@
.popover-item {
width: 100%;
font-size: 14px;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.popover-item-hover {
background-color: #EEE;
}
.underline{
border-bottom:1px #EEE solid;
}

@ -1,99 +0,0 @@
const { windowWidth, windowHeight } = wx.getSystemInfoSync();
// 三角形箭头的高度
const trangleHeight = 12;
Component({
relations: {
'./popover-item': {
type: 'child'
}
},
data: {
// 当前显隐状态
visible: false,
// popover 宽
pw: 100,
// popover 高
ph: 120,
// popover 距左距离
px: 0,
// popover 距上距离
py: 0,
// 垂直方向 top/bottom
vertical: '',
// 水平方向 left/center/right
align: ''
},
methods: {
onDisplay: function(e) {
let self = this;
if (self.last && self.last === e.id) {
self.setData({
visible: !self.data.visible
});
} else {
wx.createSelectorQuery().selectViewport().scrollOffset(view => {
let { pw, ph, px, py, vertical, align } = self.data;
let pOverW = (pw - e.width) / 2;
let offsetL = e.left,
offsetR = windowWidth - e.right,
offsetB = windowHeight - e.bottom;
if (offsetL >= pOverW && offsetR >= pOverW) {
align = 'center';
px = e.left - pOverW;
} else if (offsetL > pOverW && offsetR < pOverW) {
align = 'left';
px = windowWidth - (offsetR + pw);
// 如果向右贴边了,设置一点距离
if ((windowWidth - pw) == px) px -= 5;
} else if (offsetL < pOverW && offsetR > pOverW) {
align = 'right';
px = e.left;
// 如果向左贴边了,设置一点距离
if (px == 0) px += 5;
}
if (offsetB >= (ph + trangleHeight)) {
vertical = 'bottom';
py = view.scrollTop + e.bottom + trangleHeight;
} else {
vertical = 'top';
py = view.scrollTop + e.top - ph - trangleHeight;
}
self.setData({
visible: true,
px: px,
py: py,
ph: self.getItemsHeight(),
vertical: vertical,
align: align
});
}).exec();
}
// 记录上一次点击的元素
self.last = e.id;
},
onHide: function() {
this.setData({
visible: false
});
},
// 获取所有子元素
getItems: function() {
return this.getRelationNodes('./popover-item');
},
// 获取所有子元素的总高度
getItemsHeight() {
return this.getItems().map(item => item.data.height).reduce((a, b) => a + b, 0);
}
}
})

@ -1,4 +0,0 @@
{
"component": true,
"usingComponents": {}
}

@ -1,6 +0,0 @@
<view
wx:if='{{visible}}'
class='popover-view {{vertical}} {{align}}'
style='width:{{pw}}px;height:{{ph}}px;left:{{px}}px;top:{{py}}px;'>
<slot />
</view>

@ -1,40 +0,0 @@
.popover-view {
position: absolute;
background-color: white;
box-shadow: 0 0 2px 2px #ddd;
border-radius: 6rpx;
}
/* 实现三角形 */
.popover-view::before {
position: absolute;
display: inline-block;
width: 0;
height: 0px;
content: '';
border-style: solid;
border-width: 6px;
border-color: #fff #fff transparent transparent;
box-shadow: 2px -2px 2px #ddd;
}
/* 上 */
.popover-view.top::before {
bottom: -6px;
transform: rotate(135deg);
}
/* 下 */
.popover-view.bottom::before {
top: -6px;
transform: rotate(-45deg);
}
/* 左 */
.popover-view.left::before {
right: 20px;
}
/* 中 */
.popover-view.center::before {
left: 47px;
}
/* 右 */
.popover-view.right::before {
left: 20px;
}

@ -18,7 +18,7 @@ Page({
minutes:0, minutes:0,
pickerValue: [0, 0], pickerValue: [0, 0],
swiperIndex: 0, swiperIndex: 0,
prayTime:0, //祈祷时间 prayTime:'00:00:00', //祈祷时间
prayTimeStr: '选择祈祷时长' , prayTimeStr: '选择祈祷时长' ,
prayerContent:'', //祈祷内容 prayerContent:'', //祈祷内容
showSexLogo:false,//不展示形象修改按钮 showSexLogo:false,//不展示形象修改按钮
@ -35,7 +35,10 @@ Page({
jmEnergy:false, jmEnergy:false,
jmEnergy2: true, jmEnergy2: true,
showInjectBkc: false, //显示注入能量按钮动画 showInjectBkc: false, //显示注入能量按钮动画
inPrayer: true inPrayer: true,
qdTime: '',
ysTime: ''
}, },
ShowOrNotLogoS(){ ShowOrNotLogoS(){
this.setData({singleShow:!this.data.singleShow}) this.setData({singleShow:!this.data.singleShow})
@ -106,26 +109,7 @@ Page({
if(res.data.code==200){ if(res.data.code==200){
this.setData({loverInfo:res.data.data}) this.setData({loverInfo:res.data.data})
// 获取已经祈祷时间 this.getQdTime(res.data.data)
const now = new Date();
const startTime = new Date(res.data.data.prayerStartTime)
const diff = now.getTime() - startTime.getTime();
const hour = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
const formattedTime = `${hour.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
// 获取结束祈祷返回能量
const nowTime = new Date();
const endTime = new Date(res.data.data.prayerEndTime)
const TimeDiff = endTime.getTime() - nowTime.getTime();
// 判断是否正在祈祷
if (res.data.data.isInPrayer) {
this.setData({
prayTime: formattedTime,
energy: Math.floor(TimeDiff / 360000),
})
}
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -162,7 +146,8 @@ Page({
}else{ }else{
this.setData({ this.setData({
showPray:!this.data.showPray, showPray:!this.data.showPray,
prayerContent:'' prayerContent:'',
prayTimeStr: '选择祈祷时长'
}) })
} }
this.setData({showTiming: false}) this.setData({showTiming: false})
@ -229,8 +214,8 @@ Page({
crystallineEnergy: this.data.userInfo.crystallineEnergy crystallineEnergy: this.data.userInfo.crystallineEnergy
}) })
req.patchRequest('/api/user/curt/inject-energy-to-pendant',{}).then((res)=>{ req.patchRequest('/api/user/curt/inject-energy-to-pendant',{}).then((res)=>{
console.log('能量注入成功'); if (res.data.code === 200) {
}) console.log(res, '能量注入成功');
setTimeout(()=>{ setTimeout(()=>{
this.setData({ this.setData({
showInEnergy:!this.data.showInEnergy, showInEnergy:!this.data.showInEnergy,
@ -238,6 +223,8 @@ Page({
}) })
this.getUserInfo() this.getUserInfo()
},2000) },2000)
}
})
// 计算守护时长 // 计算守护时长
const energy = (this.data.userInfo.pendantEnergy + this.data.userInfo.crystallineEnergy) * 4.8 const energy = (this.data.userInfo.pendantEnergy + this.data.userInfo.crystallineEnergy) * 4.8
let minute = 0 let minute = 0
@ -266,40 +253,7 @@ Page({
getUserInfo(){ getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{ req.getRequest('/api/user/curt',{}).then((res)=>{
if(res.data.code===200){ if(res.data.code===200){
// 获取已经祈祷时间 this.getQdTime(res.data.data)
const now = new Date();
const startTime = new Date(res.data.data.prayerStartTime)
const diff = now.getTime() - startTime.getTime();
const hour = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
const formattedTime = `${hour.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
// 获取结束祈祷返回能量
const nowTime = new Date();
const endTime = new Date(res.data.data.prayerEndTime)
const TimeDiff = endTime.getTime() - nowTime.getTime();
// 判断是否正在祈祷
if (res.data.data.isInPrayer) {
this.setData({
prayTime: formattedTime,
energy: Math.floor(TimeDiff / 360000),
})
}
const pendantEnergy = res.data.data.crystallineEnergy
const hours = Math.floor(pendantEnergy * 6 / 60); // 计算小时数
const minute = pendantEnergy * 6 - hours * 60
if(hours>0){
this.setData({
minutes:59
})
}
if(hours<=0){
this.setData({
minutes:minute
})
}
// 能量集满显示提示 // 能量集满显示提示
if(res.data.data.crystallineEnergy >= 100){ if(res.data.data.crystallineEnergy >= 100){
@ -308,9 +262,6 @@ Page({
this.setData({ this.setData({
userInfo:res.data.data, userInfo:res.data.data,
hours:hours,
minute:minute,
pendantEnergy:pendantEnergy
}) })
// 判断运势加持是否结束 // 判断运势加持是否结束
@ -321,7 +272,6 @@ Page({
} }
this.getXxObj() this.getXxObj()
// console.log(this.data.userInfo);
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -331,6 +281,8 @@ Page({
// 计算运势已加持时间 // 计算运势已加持时间
getYsTime(milliseconds){ getYsTime(milliseconds){
const statrSeconds = new Date(milliseconds) const statrSeconds = new Date(milliseconds)
const ysTime = setInterval(() => {
const nowSeconds = new Date() const nowSeconds = new Date()
const nowTime = nowSeconds - statrSeconds const nowTime = nowSeconds - statrSeconds
@ -345,11 +297,65 @@ Page({
const time = `${formattedHours}:${formattedMinutes}:${formattedSeconds}` const time = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`
this.setData({ydTime: time}) this.setData({ydTime: time})
}, 1000)
this.setData({ysTime: ysTime})
},
// 计算祈祷时间
getQdTime(data){
if (!data.prayerStartTime) {
return
}
const qdTime = setInterval(() => {
// 获取已经祈祷时间
const now = new Date();
const startTime = new Date(data.prayerStartTime)
const diff = now.getTime() - startTime.getTime();
const hour = Math.floor(diff / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
const formattedTime = `${hour.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
// 获取结束祈祷返回能量
const nowTime = new Date();
const endTime = new Date(data.prayerEndTime)
const TimeDiff = endTime.getTime() - nowTime.getTime();
// 判断是否正在祈祷
if (data.isInPrayer) {
this.setData({
prayTime: formattedTime,
energy: Math.floor(TimeDiff / 360000),
})
}
const pendantEnergy = data.crystallineEnergy
const hours = Math.floor(pendantEnergy * 6 / 60); // 计算小时数
const minute = pendantEnergy * 6 - hours * 60
if(hours>0){
this.setData({
minutes:59
})
}
if(hours<=0){
this.setData({
minutes:minute
})
}
this.setData({
hours:hours,
minute:minute,
pendantEnergy:pendantEnergy
})
}, 1000);
this.setData({qdTime: qdTime})
}, },
go2Jlai(){ go2Jlai(){
wx.navigateTo({ wx.redirectTo({
url: '/pages/home/jl/jlai/jlai' url: '/pages/home/jl/jlai/jlai',
}) })
}, },
btnOK(){ btnOK(){
@ -391,11 +397,10 @@ Page({
} }
if(res.data.code === 200){ if(res.data.code === 200){
Toast({ wx.showToast({
context: this, title: '祈祷成功',
selector: '#t-toast', icon: 'success'
message: '祈祷成功', })
});
} }
this.getUserInfo() this.getUserInfo()
@ -406,15 +411,23 @@ Page({
this.setData({showTiming: false}) this.setData({showTiming: false})
}, },
btnCancel(){ btnCancel(){
console.log('111');
req.patchRequest('/api/user/curt/prayer/stop',{}).then((res)=>{ req.patchRequest('/api/user/curt/prayer/stop',{}).then((res)=>{
Toast({ console.log(res,'2222');
context: this, if(res.data.code === 200){
selector: '#t-toast', wx.showToast({
message: '已结束祈祷', title: '已结束祈祷',
}); icon: 'success'
})
this.openPray() this.openPray()
this.getUserInfo() this.getUserInfo()
clearInterval(this.data.qdTime)
this.setData({prayTime : '00:00:00'})
}else {
wx.showToast({
title: '结束祈祷失败',
icon: 'error'
})
}
}) })
}, },
btnShare(){ btnShare(){
@ -502,15 +515,6 @@ Page({
onShow() { onShow() {
this.getUserInfo() this.getUserInfo()
this.getXxObj() this.getXxObj()
const time = setInterval(() => {
this.getUserInfo()
this.getUserLoverInfo()
}, 1000);
this.setData({
setInterval: time
})
}, },
/** /**
@ -518,7 +522,8 @@ Page({
*/ */
onHide() { onHide() {
this.getUserInfo() this.getUserInfo()
clearInterval(this.data.setInterval) clearInterval(this.data.ysTime)
clearInterval(this.data.qdTime)
}, },
/** /**

@ -124,7 +124,7 @@
<!-- 运势加持 --> <!-- 运势加持 -->
<view class="ysjc" wx:if="{{userInfo.pendantLuckInBlessing}}"> <view class="ysjc" wx:if="{{userInfo.pendantLuckInBlessing}}">
<t-icon name="chevron-right-double" size="24" color="#DE868F"/> <t-icon name="chevron-right-double" size="24" color="#DE868F"/>
<view class="ys-time">运势已加持 {{ydTime}}</view> <!-- <view class="ys-time">运势已加持{{ydTime}}</view> -->
<t-icon name="chevron-right-double" size="24" color="#DE868F"/> <t-icon name="chevron-right-double" size="24" color="#DE868F"/>
</view> </view>
</view> </view>
@ -271,7 +271,7 @@
</swiper> </swiper>
<!-- 单人页面 甲方说要固定页面不让左右滑动 不能使用swiper组件渲染 --> <!-- 单人页面 甲方说要固定页面不让左右滑动 不能使用swiper组件渲染 -->
<view> <view bindtap="closeEnergy" wx:if="{{!userInfo.loverId}}">
<!--单人页面--> <!--单人页面-->
<swiper-item class="call1"> <swiper-item class="call1">
<!--头像名字--> <!--头像名字-->

@ -1106,7 +1106,7 @@ picker-view-column {
.ysjc { .ysjc {
position: absolute; position: absolute;
top: 80rpx; top: 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }

@ -1,66 +0,0 @@
// pages/home/jl/jlai.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

@ -1,2 +0,0 @@
<!--pages/home/jl/jlai.wxml-->
<text>pages/home/jl/jlai.wxml</text>

@ -1 +0,0 @@
/* pages/home/jl/jlai.wxss */

@ -18,10 +18,8 @@ Page({
showChatToast:false showChatToast:false
}, },
addClick(){ addClick(){
console.log('点击了加号11')
this.setData({ this.setData({
isAdd:true, isAdd: !this.data.isAdd
showChat: !this.data.showChat
}) })
}, },
noaddClick(){ noaddClick(){
@ -31,9 +29,6 @@ Page({
showChat: !this.data.showChat showChat: !this.data.showChat
}) })
}, },
dovipTips(){
this.setData({showChatToast: !this.data.showChatToast})
},
go2Member(){ go2Member(){
wx.navigateTo({ wx.navigateTo({
url: '/pages/home/me/member/member' url: '/pages/home/me/member/member'
@ -42,14 +37,20 @@ Page({
go2BB(e){/**鼠标回显事件 */ go2BB(e){/**鼠标回显事件 */
// this.setData({ltinfo:e.detail.value}) // this.setData({ltinfo:e.detail.value})
}, },
go2Send(e){/**发送消息 */ // 发送消息
this.setData({isBlank:false}) go2Send(e){
// 非vip并且聊天次数为0
if (!this.data.userInfo.isChatVip && !this.data.times) {
return this.setData({showChatToast: true})
}
if(e.target.dataset.lt==''){ if(e.target.dataset.lt==''){
wx: wx.showToast({ wx.showToast({
title: '聊天内容不能为空', title: '聊天内容不能为空',
icon:'none', icon:'none',
}) })
}else{ }else{
this.setData({isBlank:false})
this.setData({ this.setData({
chatList:this.data.chatList.concat({'type':1,'value':e.target.dataset.lt}) chatList:this.data.chatList.concat({'type':1,'value':e.target.dataset.lt})
}) })
@ -59,7 +60,7 @@ Page({
console.log(res.data) console.log(res.data)
if(res.data.code==500){ if(res.data.code==500){
console.log('500状态码') console.log('500状态码')
wx: wx.showToast({ wx.showToast({
title: '获取星座精灵AI聊天消息超时', title: '获取星座精灵AI聊天消息超时',
icon:'none', icon:'none',
}) })
@ -77,7 +78,6 @@ Page({
}) })
this.setData({ltinfo:''}) this.setData({ltinfo:''})
} }
}, },
getUserInfo(){ getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{ req.getRequest('/api/user/curt',{}).then((res)=>{
@ -86,15 +86,15 @@ Page({
if(!res.data.data.isChatVip){ if(!res.data.data.isChatVip){
this.setData({times:res.data.data.freeChatCount}) this.setData({times:res.data.data.freeChatCount})
} }
console.log(this.data.times)
} }
console.log(this.userInfo);
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/jl/index',
})
}, },
// 获取聊天气泡内容 // 获取聊天气泡内容
getContent(e){ getContent(e){

@ -1,77 +1,72 @@
<!--pages/home/jl/jlai/jlai.wxml--> <!--pages/home/jl/jlai/jlai.wxml-->
<view class="ai-container">
<view class="header">
<view class="reback" bindtap="go2Reback"></view><!--左上角返回图标--> <view class="reback" bindtap="go2Reback"></view><!--左上角返回图标-->
<view class="title">星座精灵AI</view><!--标题星座精灵AI--> <view class="title">星座精灵AI</view><!--标题星座精灵AI-->
<view wx:if="{{!userInfo.isChatVip}}" class="mfcs">免费次数剩余:{{times}}条</view><!--非会员展示剩余免费次数--> </view>
<view wx:if="{{showChat}}">
<!--非会员展示剩余免费次数-->
<view wx:if="{{!userInfo.isChatVip}}" class="mfcs">免费次数剩余:{{times}}条</view>
<view wx:if="{{showChat}}" class="main">
<!--没有聊天初次展示--> <!--没有聊天初次展示-->
<view class="ltkjj" wx:if="{{isBlank&&times!=0}}"> <view class="ltkjj" wx:if="{{isBlank}}">
<view class="ltat ltxzys" data-lt="星座运势" bindtap="getContent" data-ctn="1">星座运势</view> <view class="ltkjj-item">
<view class="ltat ltxzzb" data-lt="星座占卜" bindtap="getContent" data-ctn="2">星座占卜</view> <view class="ltat" data-lt="星座运势" bindtap="getContent" data-ctn="1">星座运势</view>
<view class="ltat lttlzb" data-lt="塔罗占卜" bindtap="getContent" data-ctn="3">塔罗占卜</view> <view class="ltat" data-lt="星座占卜" bindtap="getContent" data-ctn="2">星座占卜</view>
<view class="ltat ltqgqs" data-lt="情感倾诉" bindtap="getContent" data-ctn="4">情感倾诉</view> <view class="ltat" data-lt="塔罗占卜" bindtap="getContent" data-ctn="3">塔罗占卜</view>
<view class="ltat ltwm" data-lt="我和Ta未来会怎样" bindtap="getContent" data-ctn="5">我和Ta未来会怎样</view>
<view class="ltat wzmxyx" data-lt="文字冒险游戏" bindtap="getContent" data-ctn="6">文字冒险游戏</view>
<view class="ltat ltqs" data-lt="帮我写一封情书" bindtap="getContent" data-ctn="7">帮我写一封情书</view>
<t-image src="https://wish-assets.windymuse.com.cn/xy/jlaitx.png" shape="circle" class="tximg"></t-image>
<view class="ltwzk">你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧!
</view>
</view>
<!--不是会员,进来就没有聊天次数了-->
<view class="ltkjj1" wx:if="{{isBlank&&userInfo.freeChatCount==0&&!isChatVip}}">
<view class="ltat ltxzys" bindtap="getContent" data-ctn="1" >星座运势</view>
<view class="ltat ltxzzb" bindtap="getContent" data-ctn="2" >星座占卜</view>
<view class="ltat lttlzb" bindtap="getContent" data-ctn="3" >塔罗占卜</view>
<view class="ltat ltqgqs" bindtap="getContent" data-ctn="4" >情感倾诉</view>
<view class="ltat ltwm" bindtap="getContent" data-ctn="5" >我和Ta未来会怎样</view>
<view class="ltat wzmxyx" bindtap="getContent" data-ctn="6" >文字冒险游戏</view>
<view class="ltat ltqs" bindtap="getContent" data-ctn="7" >帮我写一封情书</view>
<t-image src="https://wish-assets.windymuse.com.cn/xy/jlaitx.png" shape="circle" class="tximg"></t-image>
<view class="ltwzk">你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧!
</view>
<view class="kthybtn" bindtap="go2Member">开通会员</view>
<view class="kthytips" >开通会员享不限次畅聊</view>
<view class="hyhgtx" bindtap="go2Member"></view>
</view> </view>
<view class="ltkjj-item">
<view class="ltwm" data-lt="情感倾诉" bindtap="getContent" data-ctn="4">情感倾诉</view>
<view class="wzmxyx" data-lt="我和Ta未来会怎样" bindtap="getContent" data-ctn="5">我和Ta未来会怎样</view>
</view> </view>
<view class="ltkjj-item">
<view class="chatbox" wx:if="{{chatList&&(!isBlank)}}"><!--聊天内容--> <view class="ltqsfaf" data-lt="文字冒险游戏" bindtap="getContent" data-ctn="6">文字冒险游戏</view>
<view class="chatbox1" wx:for="{{chatList}}" wx:key="index"> <view class="lltqsfeaf" data-lt="帮我写一封情书" bindtap="getContent" data-ctn="7">帮我写一封情书</view>
<t-image src="https://wish-assets.windymuse.com.cn/xy/jlaitx.png" shape="circle" class="chattoux" wx:if="{{item.type==2}}"></t-image>
<t-image src="{{userInfo.avatar}}" class="chattoux" wx:if="{{item.type==1}}"></t-image>
<view class="chatinfo">{{item.value}}</view>
</view> </view>
<view class="dd1"></view>
<view class="ltkjj-btm">
<t-image src="https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/touxiang1.png" shape="circle" class="tximg"></t-image>
<view class="ltwzk">你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧!</view>
</view> </view>
<!--不是会员且聊天次数为0--> <!-- 没有聊天次数 并且不是会员 -->
<view class="ltk1" wx:if="{{!isAdd && times === 0}}" bindtap="dovipTips"> <view class="ltkjj-btn" wx:if="{{!userInfo.isChatVip && !times}}">
<view class="ltk1txt"> <view class="kthybtn" bindtap="go2Member">
<t-textarea class="ltk1txt1" model:value="{{ltinfo}}" placeholder="请开通会员或购买次数" bindblur="go2BB" data-lt="{{ltinfo}}" disabled></t-textarea> <view class="hyhgtx" bindtap="go2Member"></view>
开通会员
</view> </view>
<view class="fsan" data-lt="{{ltinfo}}"></view><!--发送按钮--> <view class="kthytips" >开通会员享不限次畅聊</view>
<view class="addbtn"></view><!--加号按钮-->
</view> </view>
<!--是会员或者剩余聊天次数不为0 加号缩回-->
<view class="ltk1" wx:if="{{!isAdd && times !== 0}}">
<view class="ltk1txt">
<t-textarea class="ltk1txt1" model:value="{{ltinfo}}" placeholder="输入聊天内容" bindblur="go2BB" data-lt="{{ltinfo}}" bindchange="go2BB"></t-textarea>
</view> </view>
<view class="fsan" bindtap="go2Send" data-lt="{{ltinfo}}"></view><!--发送按钮-->
<view class="addbtn" bindtap="addClick"></view><!--加号按钮--> <!--聊天内容-->
<view class="chatbox" wx:else>
<view class="{{item.type === 1 ? 'chatbox1' : 'chatbox2'}}" wx:for="{{chatList}}" wx:key="index">
<image src="https://wish-assets.windymuse.com.cn/xy/jlaitx.png" shape="circle" class="chattoux" wx:if="{{item.type==2}}"></image>
<view class="chattoux" wx:if="{{item.type==1}}">
<image src="{{userInfo.avatar}}" ></image>
</view>
<view class="chatinfo">{{item.value}}</view>
</view>
</view>
</view> </view>
<!--是会员或者剩余聊天次数不为0 加号没有缩回--> <!-- 底部按钮 -->
<view class="ltk112" wx:if="{{isAdd}}"> <view class="ai-btm">
<view class="ltk1">
<view class="ltk1txt"> <view class="ltk1txt">
<t-textarea class="ltk1txt1" model:value="{{ltinfo}}" placeholder="输入聊天内容" bindblur="go2BB" data-lt="{{ltinfo}}" bindchange="go2BB"></t-textarea> <t-textarea disabled="{{showChatToast}}" class="ltk1txt1" model:value="{{ltinfo}}" placeholder="输入聊天内容" bindblur="go2BB" data-lt="{{ltinfo}}" bindchange="go2BB"></t-textarea>
</view> </view>
<view class="fsan" bindtap="go2Send" data-lt="{{ltinfo}}"></view> <view class="addbtn" bindtap="addClick"></view><!--加号按钮-->
<view class="addbtn" bindtap="noaddClick"></view> <view class="fsan" bindtap="go2Send" data-lt="{{ltinfo}}"></view><!--发送按钮-->
</view> </view>
<!--是会员或者剩余聊天次数不为0 加号没有缩回 快捷键--> <!--快捷键-->
<view class="myshkjj" wx:if="{{isAdd}}"> <view class="myshkjj" wx:if="{{isAdd}}">
<view class="myshkjj-container"> <view class="myshkjj-container">
<view class="myshkjjco myshkjjxzys" data-lt="星座运势" bindtap="getContent" data-ctn="1" >星座运势</view> <view class="myshkjjco myshkjjxzys" data-lt="星座运势" bindtap="getContent" data-ctn="1" >星座运势</view>
@ -83,6 +78,10 @@
<view class="myshkjjco myshkjjqgqs" data-lt="情感倾诉" bindtap="getContent" data-ctn="7" >情感倾诉</view> <view class="myshkjjco myshkjjqgqs" data-lt="情感倾诉" bindtap="getContent" data-ctn="7" >情感倾诉</view>
</view> </view>
</view> </view>
</view>
</view>
<!-- 没有免费次数提示 --> <!-- 没有免费次数提示 -->
<view class="noChat" wx:if="{{showChatToast}}"> <view class="noChat" wx:if="{{showChatToast}}">

@ -1,14 +1,24 @@
/* pages/home/jl/jlai/jlai.wxss */ /* pages/home/jl/jlai/jlai.wxss */
page { .ai-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; display: flex;
flex-direction: column;
}
.header {
position: relative;
width: 100%;
height: 176rpx;
padding-top: 88rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.reback{ .reback{
position: absolute; position: absolute;
margin-left: 20rpx; left: 20rpx;
margin-top:108rpx;
width:48rpx; width:48rpx;
height:48rpx; height:48rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -17,45 +27,47 @@ page {
} }
.title{ .title{
position: absolute;
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;
font-family: SourceHanSansSC-regular; }
.main {
flex: 1;
width: 100%;
overflow: hidden;
} }
.mfcs{ .mfcs{
position: absolute;
left: 0px;
top: 188rpx;
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
line-height: 88rpx;
opacity: 0.8;
background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%);
text-align: center;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 14px; font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.ltkjj{ .ltkjj{
position: absolute; margin: 0 auto;
left: 32rpx; margin-top: 64rpx;
top: 328rpx;
width: 686rpx; width: 686rpx;
height: 764rpx; padding: 0 38rpx;
line-height: 40rpx; border-radius: 30rpx;
opacity: 0.9;
border-radius: 15px;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
color: rgba(16, 16, 16, 1); color: rgba(16, 16, 16, 1);
font-size: 14px; font-size: 28rpx;
text-align: center; box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.2);
box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.2); }
font-family: Arial;
.ltkjj-item {
width: 100%;
height: 164rpx;
padding-top: 64rpx;
display: flex;
justify-content: space-between;
} }
@ -77,75 +89,82 @@ page {
} }
.ltat{ .ltat{
position: absolute; width: 176rpx;
height: 100rpx; height: 100rpx;
line-height: 100rpx;
opacity: 0.9; opacity: 0.9;
border-radius: 50rpx; border-radius: 50rpx;
background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%); background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%);
color: rgba(16, 16, 16, 1); color: #fff;
font-size: 12px; font-size: 24rpx;
text-align: center; box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); display: flex;
font-family: Arial; align-items: center;
color: rgba(255, 255, 255, 1); justify-content: center;
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.ltxzys{
left: 38rpx;
top: 64rpx;
width: 196rpx;
}
.ltxzzb{
left: 250rpx;
top: 64rpx;
width: 196rpx;
} }
.lttlzb{
top: 64rpx;
width: 196rpx;
left: 462rpx;
}
.ltqgqs{
width:236rpx;
left:38rpx;
top:228rpx;
}
.ltwm { .ltwm {
left:320rpx; width: 236rpx;
top:228rpx; height: 100rpx;
width:335rpx; opacity: 0.9;
border-radius: 50rpx;
background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%);
color: #fff;
font-size: 24rpx;
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
} }
.wzmxyx { .wzmxyx {
left:38rpx; width: 334rpx;
height: 100rpx;
opacity: 0.9;
border-radius: 50rpx;
background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%);
color: #fff;
font-size: 24rpx;
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
}
.ltqsfaf {
width: 274rpx; width: 274rpx;
top:392rpx; height: 100rpx;
opacity: 0.9;
border-radius: 50rpx;
background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%);
color: #fff;
font-size: 24rpx;
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
} }
.ltqs{
left:344rpx; .lltqsfeaf {
width: 306rpx; width: 306rpx;
top:392rpx; height: 100rpx;
opacity: 0.9;
border-radius: 50rpx;
background: linear-gradient(222.69deg, rgba(248,99,42,1) 14.04%,rgba(249,135,89,1) 88.56%);
color: #fff;
font-size: 24rpx;
box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
} }
.tximg{ .tximg{
position: absolute;
left: 38rpx;
top: 556rpx;
width: 84rpx; width: 84rpx;
height: 84rpx; height: 84rpx;
border: 3px solid rgba(161, 134, 81, 1); margin-top: 64rpx;
background-color: coral;
} }
.ltwzk{ .ltwzk{
position: absolute; margin-top: 64rpx;
left: 154rpx;
top: 556rpx;
width: 482rpx; width: 482rpx;
height: 144rpx; height: 144rpx;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
@ -155,30 +174,45 @@ page {
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.ltkjj-btm {
width: 100%;
height: 272rpx;
display: flex;
justify-content: space-between;
}
.ltkjj-btn {
width: 100%;
height: 236rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.ai-btm {
margin-bottom: 64rpx;
}
.ltk1{ .ltk1{
position: absolute;
left: 0px;
top: 1444rpx;
width: 100%; width: 100%;
height: 180rpx; height: 112rpx;
line-height: 20px; padding: 14rpx 32rpx;
background-color: rgba(248, 248, 248, 1); display: flex;
text-align: center; align-items: center;
border: 1px solid rgba(255, 0, 0, 0); justify-content: space-between;
background-color: #F8F8F8;
} }
.ltk1txt{ .ltk1txt{
position: absolute;
left: 32rpx;
top: 14rpx;
width: 530rpx; width: 530rpx;
height: 84rpx; height: 84rpx;
border-radius: 5px; border-radius: 10rpx;
color: rgba(136, 136, 136, 1); color: rgba(136, 136, 136, 1);
font-size: 14px; font-size: 28rpx;
text-align: left; text-align: left;
font-family: Arial; padding-left: 20rpx;
border: 1px solid rgba(255, 0, 0, 0); background-color: #fff;
} }
.t-textarea{ .t-textarea{
margin: 0!important; margin: 0!important;
@ -197,9 +231,6 @@ page {
} }
.fsan{ .fsan{
position: absolute;
left: 664rpx;
top: 32rpx;
width: 54rpx; width: 54rpx;
height: 54rpx; height: 54rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -208,9 +239,6 @@ page {
} }
.addbtn{ .addbtn{
position: absolute;
left: 586rpx;
top: 30rpx;
width: 54rpx; width: 54rpx;
height: 54rpx; height: 54rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -219,24 +247,36 @@ page {
} }
.chatbox{ .chatbox{
position: absolute;
top:264rpx;
width: 750rpx; width: 750rpx;
height:1360rpx; height: 100%;
overflow: auto; overflow-y: scroll;
} }
.chatbox1{ .chatbox1{
width:750rpx; width:750rpx;
height:148rpx; height:166rpx;
display: block; display: block;
} }
.chatbox2{
width:750rpx;
height:166rpx;
display: block;
background-color: rgba(248, 99, 42, 0.05);
}
.chattoux{ .chattoux{
margin-left: 32rpx; margin-left: 32rpx;
margin-top: 32rpx; margin-top: 32rpx;
border-radius: 50%;
overflow: hidden;
width: 84rpx; width: 84rpx;
height: 84rpx; height: 84rpx;
display: online; }
.chattoux image {
width: 100%;
height: 100%;
} }
.chatinfo{ .chatinfo{
@ -250,65 +290,37 @@ page {
font-family: SourceHanSansSC-regular; font-family: SourceHanSansSC-regular;
} }
.dd1{
width:750rpx;
height:160rpx;
}
.kthybtn{ .kthybtn{
position: absolute; position: relative;
left: 224rpx;
top: 826rpx;
width: 240rpx; width: 240rpx;
height: 70rpx; height: 70rpx;
line-height: 70rpx; border-radius: 20rpx;
border-radius: 10px;
background: linear-gradient(222.54deg, rgba(248,99,42,1) 14.03%,rgba(249,135,89,1) 85.21%); 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); color: rgba(16, 16, 16, 1);
font-size: 12px;
text-align: center;
font-family: Arial;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 14px; font-size: 28rpx;
text-align: center; display: flex;
font-family: SourceHanSansSC-medium; align-items: center;
justify-content: center;
} }
.kthytips{ .kthytips{
position: absolute;
top: 898rpx;
width: 686rpx;
height: 20px;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 12px; font-size: 24rpx;
text-align: center;
font-family: SourceHanSansSC-regular;
} }
.hyhgtx{ .hyhgtx{
position: absolute; position: absolute;
left: 392rpx; top: -80rpx;
top: 742rpx; right: -40rpx;
width: 120rpx; width: 120rpx;
height: 127rpx; height: 127rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/hyhg.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/hyhg.png);
} }
.ltk112{
position: absolute;
left: 0;
top: 1224rpx;
width: 100%;
height: 110rpx;
line-height: 40rpx;
background-color: rgba(248, 248, 248, 1);
text-align: center;
border: 1px solid rgba(255, 0, 0, 0);
}
.myshkjj{ .myshkjj{
position: absolute;
top: 1340rpx;
width: 100%; /* 容器宽度 */ width: 100%; /* 容器宽度 */
overflow-x: scroll; /* 横向滚动 */ overflow-x: scroll; /* 横向滚动 */
} }

@ -112,7 +112,9 @@ Page({
}) })
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/me/indexx',
})
}, },
// 自定义头像 // 自定义头像

@ -98,7 +98,7 @@
} }
.txcheck{ .txcheck{
width: 844rpx; /* width: 844rpx; */
height: 164rpx; height: 164rpx;
text-align: center; text-align: center;
overflow: auto; overflow: auto;

@ -27,7 +27,8 @@ Page({
isHavePhone: true, isHavePhone: true,
existPhone: false, existPhone: false,
findAccount: false, //账号账号数据 findAccount: false, //账号账号数据
openLogout: false //退出登入 openLogout: false, //退出登入
deadline: 0
}, },
// 手机号码校验 // 手机号码校验
getPhone(e){ getPhone(e){
@ -62,7 +63,7 @@ Page({
retrieveAccount(){ retrieveAccount(){
req.patchRequest('/api/user/retrieve-data',{ req.patchRequest('/api/user/retrieve-data',{
phone:this.data.phone, phone:this.data.phone,
phoneVerificationCode:this.data.phoneVerificationCode code:this.data.phoneVerificationCode
}).then(res => { }).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
wx.showToast({ wx.showToast({
@ -74,6 +75,11 @@ Page({
url: '/pages/index/index', url: '/pages/index/index',
}) })
}, 1000); }, 1000);
}else {
wx.showToast({
title: res.data.msg,
icon: 'error'
})
} }
}).catch(res => { }).catch(res => {
console.log(res, '找回账号数据失败'); console.log(res, '找回账号数据失败');
@ -99,7 +105,9 @@ Page({
showPhone: true, showPhone: true,
isHavePhone: false, isHavePhone: false,
phone: '', phone: '',
phoneVerificationCode: '' phoneVerificationCode: '',
isCxHq: false,
countdown: 60
}) })
}, },
getCode(){ getCode(){
@ -110,8 +118,16 @@ Page({
icon: 'none' icon: 'none'
}); });
} }
// if(this.data.phone === this.data.userInfo.phone){
// return wx.showToast({
// title: '您已绑定该号码',
// icon: 'error'
// })
// }
if(this.data.countdown === 60 || this.data.countdown === '重新获取'){ if(this.data.countdown === 60 || this.data.countdown === '重新获取'){
req.postRequest('/api/user/send-authentication-code',{phone:this.data.phone}).then((res)=>{ req.postRequest('/api/user/send-authentication-code',{
phone:this.data.phone
}).then((res)=>{
if (res.data.code === 200) { if (res.data.code === 200) {
wx.showToast({ wx.showToast({
title: '验证码已发送,请在手机上查收', title: '验证码已发送,请在手机上查收',
@ -158,9 +174,19 @@ Page({
clearTimeout(this.data.timerId); clearTimeout(this.data.timerId);
}, },
bdSuccessBtn(){ bdSuccessBtn(){
this.setData({bdsjhVisible: false}) this.setData({
bdsjhVisible: false,
showPhone: true,
bdSuccess: false
})
}, },
doEXecSjh(){ doEXecSjh(){
if (this.data.phone === this.data.userInfo.phone) {
return wx.showToast({
title: '已绑定该手机号',
icon: 'error'
})
}
if (this.data.phoneVerificationCode.length !== 6) { if (this.data.phoneVerificationCode.length !== 6) {
return wx.showToast({ return wx.showToast({
title: '验证码格式不正确', title: '验证码格式不正确',
@ -210,14 +236,10 @@ Page({
url: '/pages/home/me/grzl/grzl' url: '/pages/home/me/grzl/grzl'
}) })
}, },
go2Member(){/**跳转到会员购买页面 */ // 跳转到会员购买页面
wx.redirectTo({ go2Member(){
url: '/pages/home/me/member/member'
})
},
go2Member2(){/**跳转到会员续费页面 */
wx.redirectTo({ wx.redirectTo({
url: '/pages/home/me/member2/member' url: '/pages/home/me/member/member?isChatVip=' + this.data.userInfo.isChatVip
}) })
}, },
go2Gw(){ go2Gw(){
@ -279,7 +301,12 @@ Page({
userInfo:res.data.data, userInfo:res.data.data,
phone:res.data.data.phone, phone:res.data.data.phone,
}) })
this.getDetele() // 获取默认头像
this.getDetaile()
// 获取vip截止日期
if (res.data.data.isChatVip) {
this.getVipDeadline(res.data.data.chatVipEndTime)
}
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -294,7 +321,7 @@ Page({
}, },
// 获取默认头像 // 获取默认头像
getDetele(){ getDetaile(){
const list = wx.getStorageSync('xy-static-img') const list = wx.getStorageSync('xy-static-img')
const type = this.data.userInfo.constellation const type = this.data.userInfo.constellation
this.setData({ this.setData({
@ -302,6 +329,19 @@ Page({
}) })
}, },
// 获取vip截止日期
getVipDeadline(time){
const endTime = new Date(time)
const newTime = new Date()
// 判断时间是否已经到期
if (endTime > newTime) {
const deadTime = endTime - newTime
const deadline = Math.floor(deadTime / 1000 / 60 / 60 / 24)
this.setData({deadline: deadline})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

@ -7,8 +7,8 @@
<view class="nickname">{{userInfo.nick}}</view><!--用户昵称--> <view class="nickname">{{userInfo.nick}}</view><!--用户昵称-->
<view class="unhybs" wx:if="{{!userInfo.isChatVip}}" bindtap="go2Member"></view><!--非会员图标--> <view class="unhybs" wx:if="{{!userInfo.isChatVip}}" bindtap="go2Member"></view><!--非会员图标-->
<view class="hydqr" wx:if="{{!userInfo.isChatVip}}"> 开通VIP会员</view><!--非会员提示--> <view class="hydqr" wx:if="{{!userInfo.isChatVip}}"> 开通VIP会员</view><!--非会员提示-->
<view class="hybs" wx:if="{{userInfo.isChatVip}}" bindtap="go2Member2"></view><!--会员图标--> <view class="hybs" wx:if="{{userInfo.isChatVip}}" bindtap="go2Member"></view><!--会员图标-->
<view class="hydqr" wx:if="{{userInfo.isChatVip}}"> 还有21天到期</view><!--会员提示--> <view class="hydqr" wx:if="{{userInfo.isChatVip}}"> 还有{{deadline}}天到期</view><!--会员提示-->
<view class="gnk"> <view class="gnk">
<view class="smst" >说明书</view> <view class="smst" >说明书</view>
@ -28,19 +28,19 @@
<!--功能操作框--> <!--功能操作框-->
<view class="mycell" bindtap="ljXzjl" > <view class="mycell" bindtap="ljXzjl" >
<t-cell hover arrow bindtap="go2Gw"> <!-- <t-cell hover arrow bindtap="go2Gw">
<t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-triangles.png" size="50rpx"/> <t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-triangles.png" size="50rpx"/>
<text slot="title" class="mycelltext" >了解星座精灵</text> <text slot="title" class="mycelltext" >了解星座精灵</text>
</t-cell> </t-cell> -->
<t-cell hover bindtap="doBdsjh" > <t-cell hover bindtap="doBdsjh" >
<t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-phone.png" size="50rpx"/> <t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-phone.png" size="50rpx"/>
<text slot="title" class="mycelltext" >绑定手机号</text> <text slot="title" class="mycelltext" >绑定手机号</text>
<text slot="note" wx:if="{{userInfo.hasPhone}}">{{userInfo.phone}}</text> <text slot="note" wx:if="{{userInfo.hasPhone}}">{{userInfo.phone}}</text>
</t-cell> </t-cell>
<t-cell hover arrow bindtap="go2Cjwt"> <!-- <t-cell hover arrow bindtap="go2Cjwt">
<t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-help%402x.png" size="50rpx"/> <t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-help%402x.png" size="50rpx"/>
<text slot="title" class="mycelltext" >常见问题</text> <text slot="title" class="mycelltext" >常见问题</text>
</t-cell> </t-cell> -->
<t-cell hover arrow bindtap="go2Yjfk"> <t-cell hover arrow bindtap="go2Yjfk">
<t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-edit%402x.png" size="50rpx"/> <t-icon slot="left-icon" name="https://wish-assets.windymuse.com.cn/xy/iconPark-edit%402x.png" size="50rpx"/>
<text slot="title" class="mycelltext" >意见反馈</text> <text slot="title" class="mycelltext" >意见反馈</text>

@ -12,7 +12,9 @@ Page({
showDialog:false showDialog:false
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/me/indexx',
})
}, },
// 长按解除羁绊 // 长按解除羁绊
handleLongPress() { handleLongPress() {

@ -9,7 +9,7 @@ Page({
}, },
go2Reback(){ go2Reback(){
wx.redirectTo({ wx.switchTab({
url: '/pages/home/me/indexx', url: '/pages/home/me/indexx',
}) })
}, },

@ -10,7 +10,9 @@ Page({
data: { data: {
yhy:true, yhy:true,
openid:'', openid:'',
showToast:false showToast:false,
isChatVip:false,
deadline: ''
}, },
doKtHy() { doKtHy() {
@ -27,6 +29,7 @@ Page({
signType: 'MD5', signType: 'MD5',
paySign: res.data.data.paySign, paySign: res.data.data.paySign,
success: res => { success: res => {
console.log(res, '支付返回数据');
//支付成功的回调这里面写支付成功后跳转的路径 //支付成功的回调这里面写支付成功后跳转的路径
wx.showToast({ wx.showToast({
title: '支付成功', // 标题 title: '支付成功', // 标题
@ -39,24 +42,21 @@ Page({
}, 1000) }, 1000)
}, },
fail: () => { fail: () => {
// uni.showToast({ wx.showToast({
// icon: 'none', icon: 'none',
// title: '支付失败' title: '支付失败'
// }); });
} }
}); });
}) })
/**开通会员操作 */
console.log('开通会员')
},
go2Week(){
this.setData({yhy:false})
}, },
go2Month(){ go2Month(){
this.setData({yhy:true}) this.setData({yhy: !this.data.yhy})
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/me/indexx',
})
}, },
tQuest(){ tQuest(){
this.setData({showToast:true}) this.setData({showToast:true})
@ -66,6 +66,34 @@ Page({
console.log('点击了'); console.log('点击了');
}, },
getuserInfo(){
req.getRequest('/api/user/curt',{}).then(res => {
if (res.data.code === 200) {
console.log(res.data.data.isChatVip);
this.setData({isChatVip: res.data.data.isChatVip})
if (res.data.data.isChatVip) {
this.getVipDeadline(res.data.data.chatVipEndTime)
}
}
})
},
// 获取vip截止日期
getVipDeadline(time){
console.log(time);
const endTime = new Date(time)
const newTime = new Date()
// 判断时间是否已经到期
if (endTime > newTime) {
const year = endTime.getFullYear()
const mouth = endTime.getMonth() + 1
const day = endTime.getDate()
const deadline = `${year}${mouth}${day}`
this.setData({ deadline : deadline})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -74,7 +102,6 @@ Page({
provider: 'weixin', provider: 'weixin',
success: loginRes => { success: loginRes => {
//loginRes中有code拿着code再请求自己服务器以获取openid //loginRes中有code拿着code再请求自己服务器以获取openid
console.log(loginRes.code, 888888888888);
req.getRequest(`/api/v1/chat-service-order/js-code2-session`, { req.getRequest(`/api/v1/chat-service-order/js-code2-session`, {
code: loginRes.code code: loginRes.code
}).then((res) => { }).then((res) => {
@ -86,6 +113,8 @@ Page({
}) })
} }
}); });
this.getuserInfo()
}, },
/** /**

@ -1,11 +1,51 @@
<!--返回图标--> <view class="member-container">
<!--头部-->
<view class="header">
<view class="reback" bindtap="go2Reback"></view> <view class="reback" bindtap="go2Reback"></view>
<view class="title">VIP会员</view> <view class="title">VIP会员</view>
<view class="sftp"></view><!--上方图片--> </view>
<view class="main">
<!--上方图片-->
<view class="sftp"></view>
<!--皇冠图标-->
<view class="hgpng">
<!--问号图标-->
<view class="question" bindtap="tQuest"></view>
</view>
<view class="hydqr" wx:if="{{!isChatVip}}">即刻解锁无限次星座精灵AI无限畅聊</view>
<view class="hydqr" wx:else>您的会员将于{{deadline}}到期</view>
<view class="member-btn">
<view class="member-btn-left">
<view class="{{yhy ? 'week1' : 'month1'}}" bindtap="go2Month">
<text class="text1">¥29</text>
<text class="text2"> / 周</text>
</view>
<view class="zhytxt">周会员</view>
</view>
<view class="member-btn-right">
<view class="{{yhy ? 'month1' : 'week1'}}" bindtap="go2Month">
<text class="text1">¥69</text>
<text class="text2"> / 月</text>
</view>
<view class="yhytxt">月会员</view>
</view>
</view>
<view class="viphyqy">VIP会员权益</view>
<view class="introd">
<view>1、星座精灵AI服务无限次畅聊</view>
<view>2、不定期商品及新品折扣优惠</view>
<view>3、其他权益陆续增加中......</view>
</view>
<view class="hybtn" bindtap="doKtHy">{{isChatVip ? '续费会员' : '开通会员'}}</view>
<!--底部图片--> <!--底部图片-->
<view class="hybt"></view> <view class="hybt"></view>
<view class="hgpng"></view><!--皇冠图标-->
<view class="question" bindtap="tQuest"></view><!--问号图标-->
<!-- 提示 --> <!-- 提示 -->
<view class="bgc" bindtap="closeTaost" wx:if="{{showToast}}"> <view class="bgc" bindtap="closeTaost" wx:if="{{showToast}}">
@ -15,20 +55,5 @@
索内心世界。</view> 索内心世界。</view>
</view> </view>
<t-toast id="t-toast" /><!--弹出问号图标-->
<view class="hybtn" bindtap="doKtHy">开通会员</view>
<view class="viphyqy">VIP会员权益</view>
<view class="introd">
<view>1、星座精灵AI服务无限次畅聊</view>
<view>2、不定期商品及新品折扣优惠</view>
<view>3、 其他权益陆续增加中......</view>
</view> </view>
<view class="zhytxt">周会员</view> </view>
<view class="yhytxt">月会员</view>
<view class="hydqr">即刻解锁无限次星座精灵AI无限畅聊</view>
<view class="week1" wx:if="{{yhy}}" bindtap="go2Week"><text class="text1 tcolor1">¥29</text><text class="text2 tcolor1"> / 周</text></view>
<view class="month1" wx:if="{{yhy}}" bindtap="go2Month"><text class="text1 tcolor2">¥69</text><text class="text2 tcolor2"> / 月</text></view>
<view class="week2" wx:if="{{!yhy}}" bindtap="go2Week"><text class="text1 tcolor2">¥29</text><text class="text2 tcolor2"> / 周</text></view>
<view class="month2" wx:if="{{!yhy}}" bindtap="go2Month"><text class="text1 tcolor1">¥69</text><text class="text2 tcolor1"> / 月</text></view>

@ -1,7 +1,23 @@
.member-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.header {
position: relative;
width: 100%;
height: 88rpx;
margin-top: 88rpx;
display: flex;
justify-content: center;
align-items: center;
}
.reback{ .reback{
position: absolute; position: absolute;
margin-left: 20rpx; left: 20rpx;
margin-top:108rpx;
width:48rpx; width:48rpx;
height:48rpx; height:48rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -10,82 +26,91 @@
} }
.title{ .title{
position: absolute;
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;
font-family: SourceHanSansSC-regular;
} }
.hybt{ .main {
position: absolute; position: relative;
left: 30rpx; flex: 1;
top: 1326rpx; display: flex;
align-items: center;
flex-direction: column;
}
.sftp{
width: 690rpx; width: 690rpx;
height: 230rpx; height: 230rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/hybt.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/sftp.png);
} }
.sftp{ .hybt{
position: absolute; position: absolute;
left: 30rpx; bottom: 44rpx;
top: 164rpx;
width: 690rpx; width: 690rpx;
height: 230rpx; height: 230rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/sftp.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/hybt.png);
} }
.hgpng{ .hgpng{
position: absolute; position: absolute;
left: 220rpx; top: 72rpx;
top: 248rpx;
width: 314rpx; width: 314rpx;
height: 348rpx; height: 348rpx;
display: flex;
justify-content: flex-end;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size:100% 100%; background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/hgpng.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/hgpng.png);
} }
.question{ .question{
position: absolute;
left: 472rpx;
top: 248rpx;
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
z-index: 999; z-index: 999;
background-size: cover; background-size: cover;
background-image: url(https://wish-assets.windymuse.com.cn/xy/qqest.png); background-image: url(https://wish-assets.windymuse.com.cn/xy/qqest.png);
} }
.member-btn {
margin-top: 88rpx;
width: 100%;
height: 180rpx;
display: flex;
justify-content: space-evenly;
}
.member-btn-left, .member-btn-right {
width: 280rpx;
height: 100%;
}
.hybtn{ .hybtn{
position: absolute; margin-top: 64rpx;
left: 236rpx;
top: 1290rpx;
width: 280rpx; width: 280rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%); 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); box-shadow: 0px 4rpx 12rpx 0px rgba(0, 0, 0, 0.4);
border: 3px solid rgba(255, 255, 255, 1); border: 6rpx solid rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 32rpx; font-size: 32rpx;
text-align: center; display: flex;
font-family: SourceHanSansSC-medium; align-items: center;
justify-content: center;
} }
.viphyqy{ .viphyqy{
position: absolute; margin-top: 78rpx;
top: 1004rpx; width: 100%;
width: 750rpx;
height: 40rpx; height: 40rpx;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 28rpx; font-size: 28rpx;
@ -93,10 +118,9 @@
} }
.introd{ .introd{
position: absolute; margin-top: 32rpx;
left:180rpx; padding-left: 180rpx;
top: 1076rpx; width: 100%;
width: 750rpx;
height: 150rpx; height: 150rpx;
line-height: 50rpx; line-height: 50rpx;
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
@ -106,32 +130,21 @@
} }
.zhytxt{ .zhytxt{
position: absolute; width: 100%;
left: 82px;
top: 442px;
width: 42px;
height: 21px;
color: rgba(154, 154, 154, 1); color: rgba(154, 154, 154, 1);
font-size: 14px; font-size: 28rpx;
text-align: center; text-align: center;
font-family: SourceHanSansSC-regular;
} }
.yhytxt{ .yhytxt{
position: absolute; width: 100%;
left: 506rpx;
top: 442px;
width: 42px;
height: 21px;
color: rgba(154, 154, 154, 1); color: rgba(154, 154, 154, 1);
font-size: 14px; font-size: 28rpx;
text-align: center; text-align: center;
font-family: SourceHanSansSC-regular;
} }
.hydqr{ .hydqr{
position: absolute; margin-top: 234rpx;
top: 628rpx;
width: 750rpx; width: 750rpx;
height: 40rpx; height: 40rpx;
color: rgba(248, 99, 42, 1); color: rgba(248, 99, 42, 1);
@ -140,11 +153,9 @@ font-family: SourceHanSansSC-regular;
} }
.week1{ .week1{
position: absolute;
left: 64rpx;
top: 748rpx;
width: 280rpx; width: 280rpx;
height: 120rpx; height: 120rpx;
margin-bottom: 10rpx;
line-height: 120rpx; line-height: 120rpx;
border-radius: 30rpx; border-radius: 30rpx;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
@ -155,12 +166,14 @@ font-family: SourceHanSansSC-regular;
border: 4rpx solid rgba(248, 99, 42, 1); border: 4rpx solid rgba(248, 99, 42, 1);
} }
.week1 .text1, .month1 .text2 {
color: #4f4f4f;
}
.month1{ .month1{
position: absolute;
left: 406rpx;
top: 748rpx;
width: 280rpx; width: 280rpx;
height: 120rpx; height: 120rpx;
margin-bottom: 10rpx;
line-height: 120rpx; line-height: 120rpx;
border-radius: 30rpx; border-radius: 30rpx;
background-color: rgba(248, 99, 42, 1); background-color: rgba(248, 99, 42, 1);
@ -171,13 +184,16 @@ font-family: SourceHanSansSC-regular;
border: 4rpx solid rgba(248, 99, 42, 1); border: 4rpx solid rgba(248, 99, 42, 1);
} }
.month1 .text1, .month1 .text2 {
color: #fff;
}
.text1{ .text1{
margin-left: 2px; margin-left: 2px;
top: 384px; top: 384px;
width: 60px; width: 60px;
height: 41px; height: 41px;
font-size: 28px; font-size: 28px;
font-family: SourceHanSansSC-regular;
} }
.text2{ .text2{
@ -187,66 +203,21 @@ font-family: SourceHanSansSC-regular;
height: 17px; height: 17px;
font-size: 16px; font-size: 16px;
text-align: left; text-align: left;
font-family: SourceHanSansSC-regular;
}
.tcolor1{
color: rgba(79, 79, 79, 1);
}
.tcolor2{
color: rgba(255, 255, 255, 1);
}
.week2{
position: absolute;
left: 32px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(248, 99, 42, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 1px solid rgba(248, 99, 42, 1);
}
.month2{
position: absolute;
left: 203px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(255, 255, 255, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 2px solid rgba(248, 99, 42, 1);
} }
.toast { .toast {
position: absolute; margin-top: 168rpx;
top: 344rpx;
left: 64rpx;
width: 622rpx; width: 622rpx;
height: 316rpx; height: 316rpx;
line-height: 150%;
padding: 32rpx; padding: 32rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 15px; border-radius: 30rpx;
background-color: rgba(255, 255, 255, 0.9); background-color: rgba(255, 255, 255, 0.9);
color: rgba(108, 108, 108, 1); color: rgba(108, 108, 108, 1);
font-size: 28rpx; font-size: 28rpx;
text-align: center; box-shadow: 2rpx 4rpx 12rpx 0px rgba(0, 0, 0, 0.2);
box-shadow: 1px 2px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 999; z-index: 999;
text-align: justify;
} }
.bgc { .bgc {
@ -254,4 +225,6 @@ font-family: SourceHanSansSC-regular;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 1; z-index: 1;
display: flex;
justify-content: center;
} }

@ -1,87 +0,0 @@
// pages/home/me/member/member.js
import Toast from 'tdesign-miniprogram/toast/index';
Page({
/**
* 页面的初始数据
*/
data: {
yhy:true
},
doKtHy(){/**开通会员操作 */
console.log('开通会员')
},
go2Week(){
this.setData({yhy:false})
},
go2Month(){
this.setData({yhy:true})
},
go2Reback(){
wx.navigateBack({ changed: true });
},
tQuest(){
Toast({
context: this,
selector: '#t-toast',
message: '星座精灵AI的付费会员服务基于OpenAI的GPT-3.5 Turbo模型为您提供高智能情感咨询服务以及星座、星骰和塔罗牌等娱乐服务。利用人工智能技术和高质量的自然语言响应星座精灵AI可以更好的帮助您深入探索内心世界。',
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,5 +0,0 @@
{
"usingComponents": {
"t-toast": "tdesign-miniprogram/toast/toast"
}
}

@ -1,26 +0,0 @@
<!--返回图标-->
<view class="reback" bindtap="go2Reback"></view>
<view class="title">VIP会员</view>
<view class="sftp"></view><!--上方图片-->
<!--底部图片-->
<view class="hybt"></view>
<view class="hgpng"></view><!--皇冠图标-->
<view class="question" bindtap="tQuest"></view><!--问号图标-->
<t-toast id="t-toast" /><!--弹出问号图标-->
<view class="hybtn" bindtap="doKtHy">开通会员</view>
<view class="viphyqy">VIP会员权益</view>
<view class="introd">
<view>1、星座精灵AI服务无限次畅聊</view>
<view>2、不定期商品及新品折扣优惠</view>
<view>3、 其他权益陆续增加中......</view>
</view>
<view class="zhytxt">周会员</view>
<view class="yhytxt">月会员</view>
<view class="hydqr">您的会员将于 2023年5月20日到期</view>
<view class="week1" wx:if="{{yhy}}" bindtap="go2Week"><text class="text1 tcolor1">¥29</text><text class="text2 tcolor1"> / 周</text></view>
<view class="month1" wx:if="{{yhy}}" bindtap="go2Month"><text class="text1 tcolor2">¥69</text><text class="text2 tcolor2"> / 月</text></view>
<view class="week2" wx:if="{{!yhy}}" bindtap="go2Week"><text class="text1 tcolor2">¥29</text><text class="text2 tcolor2"> / 周</text></view>
<view class="month2" wx:if="{{!yhy}}" bindtap="go2Month"><text class="text1 tcolor1">¥69</text><text class="text2 tcolor1"> / 月</text></view>

@ -1,232 +0,0 @@
.reback{
position: absolute;
margin-left: 20rpx;
margin-top:108rpx;
width:48rpx;
height:48rpx;
background-repeat: no-repeat;
background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/reback.png);
}
.title{
position: absolute;
left: 278rpx;
top: 108rpx;
width: 196rpx;
height: 48rpx;
color: rgba(108, 108, 108, 1);
font-size: 32rpx;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.hybt{
position: absolute;
left: 30rpx;
top: 1326rpx;
width: 690rpx;
height: 230rpx;
background-repeat: no-repeat;
background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/hybt.png);
}
.sftp{
position: absolute;
left: 15px;
top: 82px;
width: 345px;
height: 115px;
background-repeat: no-repeat;
background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/sftp.png);
}
.hgpng{
position: absolute;
left: 109px;
top: 124px;
width: 157px;
height: 174px;
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;
background-image: url(https://wish-assets.windymuse.com.cn/xy/qqest.png);
}
.hybtn{
position: absolute;
left: 118px;
top: 645px;
width: 140px;
height: 40px;
line-height: 80rpx;
border-radius: 10px;
background: linear-gradient(233.49deg, rgba(248,99,42,1) 10.48%,rgba(249,135,89,1) 89.2%);
text-align: center;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
border: 3px solid rgba(255, 255, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 32rpx;
text-align: center;
font-family: SourceHanSansSC-medium;
}
.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;
}
.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;
}
.zhytxt{
position: absolute;
left: 82px;
top: 442px;
width: 42px;
height: 21px;
color: rgba(154, 154, 154, 1);
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.yhytxt{
position: absolute;
left: 506rpx;
top: 442px;
width: 42px;
height: 21px;
color: rgba(154, 154, 154, 1);
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.hydqr{
position: absolute;
top: 314px;
width: 750rpx;
height: 20px;
color: rgba(248, 99, 42, 1);
font-size: 14px;
text-align: center;
font-family: SourceHanSansSC-regular;
}
.week1{
position: absolute;
left: 32px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(255, 255, 255, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 2px solid rgba(248, 99, 42, 1);
}
.month1{
position: absolute;
left: 203px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(248, 99, 42, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 1px solid rgba(248, 99, 42, 1);
}
.text1{
margin-left: 2px;
top: 384px;
width: 60px;
height: 41px;
font-size: 28px;
font-family: SourceHanSansSC-regular;
}
.text2{
left: 130px;
top: 401px;
width: 16px;
height: 17px;
font-size: 16px;
text-align: left;
font-family: SourceHanSansSC-regular;
}
.tcolor1{
color: rgba(79, 79, 79, 1);
}
.tcolor2{
color: rgba(255, 255, 255, 1);
}
.week2{
position: absolute;
left: 32px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(248, 99, 42, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 1px solid rgba(248, 99, 42, 1);
}
.month2{
position: absolute;
left: 203px;
top: 374px;
width: 140px;
height: 60px;
line-height: 60px;
border-radius: 15px;
background-color: rgba(255, 255, 255, 1);
color: rgba(16, 16, 16, 1);
font-size: 14px;
text-align: center;
font-family: Arial;
border: 2px solid rgba(248, 99, 42, 1);
}

@ -29,7 +29,9 @@ Page({
}) })
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/me/indexx',
})
}, },
doDevQuery(){ doDevQuery(){
req.getRequest('/api/user/curt/equipments',{}).then((res)=>{ req.getRequest('/api/user/curt/equipments',{}).then((res)=>{

@ -9,7 +9,7 @@ Page({
}, },
go2Reback(){ go2Reback(){
wx.redirectTo({ wx.switchTab({
url: '/pages/home/me/indexx', url: '/pages/home/me/indexx',
}) })
}, },

@ -15,7 +15,9 @@ Page({
}, },
go2Reback(){ go2Reback(){
wx.navigateBack({ changed: true }); wx.switchTab({
url: '/pages/home/me/indexx',
})
}, },
doExecYjfk(e){ doExecYjfk(e){
const contactWay = e.detail.value.contactWay; const contactWay = e.detail.value.contactWay;

@ -9,7 +9,7 @@ Page({
}, },
go2Reback(){ go2Reback(){
wx.redirectTo({ wx.switchTab({
url: '/pages/home/me/indexx', url: '/pages/home/me/indexx',
}) })
}, },

@ -93,7 +93,8 @@
公司信息:深圳市腾讯计算机系统有限公司 公司信息:深圳市腾讯计算机系统有限公司
获取信息以及目的:提供第三方登录分享服务; 获取信息以及目的:提供第三方登录分享服务;
微信公众平台服务协议: 微信公众平台服务协议:
https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1503979103&version=1&lang=zh_CN&platform=2 https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=
1503979103&version=1&lang=zh_CN&platform=2
12.1.2. 支付宝 12.1.2. 支付宝
公司名称:支付宝(中国)网络技术有限公司 公司名称:支付宝(中国)网络技术有限公司
用途目的:用于集成支付宝支付功能及生成设备标识 用途目的:用于集成支付宝支付功能及生成设备标识

@ -30,6 +30,7 @@
.user-main { .user-main {
flex: 1; flex: 1;
width: 100%;
padding: 48rpx 64rpx; padding: 48rpx 64rpx;
overflow-y: scroll; overflow-y: scroll;
} }

@ -99,9 +99,8 @@ Page({
getMsgDetail(e){ getMsgDetail(e){
const id = e.currentTarget.dataset.id const id = e.currentTarget.dataset.id
console.log(id);
wx.redirectTo({ wx.redirectTo({
url: `/pages/home/xx/lindex/lxz/lxz?id=${id}&&hy=1` url: '/pages/xz/index?id=' + id + '&hy=1'
}) })
}, },

@ -178,8 +178,22 @@ Page({
} }
}, },
toSend(){ toSend(){
// 获取信札 有内容跳转到预览页面 没有跳转编辑页面
req.getRequest('/api/user/curt/letter',{}).then(res => {
console.log(res);
if (res.data.code === 200) {
// 判断是否空信札
if (res.data.data.isEmpty) {
wx.redirectTo({
url: '/pages/home/xx/xz/xz'
})
}else{
console.log('2222222');
wx.redirectTo({ wx.redirectTo({
url: '/pages/xz/index?open=' + true url: '/pages/xz/index?open=' + true
}) })
} }
}
})
}
}) })

@ -39,7 +39,9 @@ Page({
hasLover:false,// 是否单身 hasLover:false,// 是否单身
userInfo:{}, userInfo:{},
savePicture: false, // 保存图片成功 savePicture: false, // 保存图片成功
soundData:{} //音频数据 soundData:{}, //音频数据
userImg: '', //用户默认头像
loveImg: '' //情侣默认头像
}, },
doLuYINBoF(e){ doLuYINBoF(e){
// 判断点击的是否为对方的语音 // 判断点击的是否为对方的语音
@ -454,7 +456,6 @@ Page({
console.log(err); console.log(err);
}) })
} }
}, },
go2Huiyi(){/**跳转到回忆页面 */ go2Huiyi(){/**跳转到回忆页面 */
wx.redirectTo({ wx.redirectTo({
@ -495,12 +496,43 @@ Page({
} }
}) })
// 把双方信札添加到消息页面头部
req.getRequest('/api/user/curt/letter',{}).then(res => {
if (!res.data.data.isEmpty) {
list.push({
type: 'letter',
isSelf: true,
id: -1,
status: res.data.data.status
})
}
req.getRequest('/api/user/curt/lover/letter',{}).then(res1 => {
if (!res1.data.data.isEmpty) {
list.push({
type: 'letter',
isSelf: false,
id: -2,
status: res.data.data.status
})
}
this.setData({messages:list.reverse()}) this.setData({messages:list.reverse()})
this.getDeteleImg()
})
})
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
}, },
// 获取情侣双方信札
getMyLetter(){
req.getRequest('/api/user/curt/letter',{}).then(res => {
return res.data.data.isEmpty
})
},
doQueryInit(){ doQueryInit(){
req.getRequest('/api/user/curt',{}).then((res)=>{ req.getRequest('/api/user/curt',{}).then((res)=>{
if(res.data.code==200){ if(res.data.code==200){
@ -594,10 +626,11 @@ Page({
}) })
}, },
// 点击了信札
getLetter(e){ getLetter(e){
const id = e.currentTarget.dataset.item.id const id = e.currentTarget.dataset.item.id
wx.redirectTo({ wx.redirectTo({
url: '/pages/home/xx/lindex/lxz/lxz?id=' + id url: '/pages/xz/index?id=' + id
}) })
}, },
@ -605,6 +638,14 @@ Page({
this.setData({xinzhaVisible:false}) this.setData({xinzhaVisible:false})
}, },
// 获取默认图片
getDeteleImg(){
const img = wx.getStorageSync('xy-static-img')
const userImg = img[this.data.userInfo.constellation]
const loveImg = img[this.data.loverInfo.constellation]
this.setData({userImg: userImg['elf-avatar'], loveImg: loveImg['elf-avatar']})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

@ -15,9 +15,9 @@
<view class="bkgfs" id="button"> <view class="bkgfs" id="button">
<!--最上方的两个头像--> <!--最上方的两个头像-->
<view class="bkgfs-img"> <view class="bkgfs-img">
<t-image class="txl" shape="circle" src="{{userInfo.avatar}}"></t-image><!--当前用户头像--> <t-image class="txl" shape="circle" src="{{userInfo.avatar ? userInfo.avatar : userImg}}"></t-image><!--当前用户头像-->
<view class="bkgfs-img-middle" /> <view class="bkgfs-img-middle" />
<t-image class="txr" shape="circle" src="{{loverInfo.avatar}}"></t-image><!--当前用户头像--> <t-image class="txr" shape="circle" src="{{loverInfo.avatar ? loverInfo.avatar : loveImg}}"></t-image><!--当前用户头像-->
</view> </view>
<view class="bkgfstxt"> <view class="bkgfstxt">
@ -45,7 +45,7 @@
<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>
</view> </view>
<!--自己的头像框--> <!--自己的头像框-->
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image> <t-image src="{{userInfo.avatar ? userInfo.avatar : userImg}}" class="zjtx1" shape="circle" ></t-image>
</view> </view>
<!--发送音频消息--> <!--发送音频消息-->
<view class="zjtablea2" wx:if="{{item.type=='audio'}}"> <view class="zjtablea2" wx:if="{{item.type=='audio'}}">
@ -78,7 +78,7 @@
</view> </view>
<view class="zjypwz1">{{item.extra.ssec}}</view> <view class="zjypwz1">{{item.extra.ssec}}</view>
</view> </view>
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框--> <t-image src="{{userInfo.avatar ? userInfo.avatar : userImg}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
</view> </view>
<!--发送文字消息--> <!--发送文字消息-->
<view class="zjtable3" wx:if="{{item.type=='text'}}"> <view class="zjtable3" wx:if="{{item.type=='text'}}">
@ -96,7 +96,7 @@
{{item.content}} {{item.content}}
</view> </view>
</view> </view>
<t-image src="{{userInfo.avatar}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框--> <t-image src="{{userInfo.avatar ? userInfo.avatar : userImg}}" class="zjtx1" shape="circle" ></t-image><!--自己的头像框-->
</view> </view>
<!--发送信札消息--> <!--发送信札消息-->
<view class="zjtable4" wx:if="{{item.type ==='letter'}}"> <view class="zjtable4" wx:if="{{item.type ==='letter'}}">
@ -111,7 +111,7 @@
<!--图片信息--> <!--图片信息-->
<view wx:if="{{item.type=='graphic'}}" class="zjtableatp3"> <view wx:if="{{item.type=='graphic'}}" class="zjtableatp3">
<view class="zttp12" wx:if="{{item.type=='graphic'}}"> <view class="zttp12" wx:if="{{item.type=='graphic'}}">
<t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框--> <t-image src="{{loverInfo.avatar ? loverInfo.avatar : loveImg}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框-->
<!-- <view class="zjxftp3"></view> --> <!-- <view class="zjxftp3"></view> -->
<t-image <t-image
bindlongpress="changAn" bindlongpress="changAn"
@ -121,25 +121,25 @@
data-id="{{item.id}}" data-id="{{item.id}}"
data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}" data-tp="{{'https://xzjl-api.windymuse.cn/api/resource/'+item.resourceId+'?k='+userInfo.id}}"
></t-image> ></t-image>
<view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> <!-- <view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> -->
</view> </view>
</view> </view>
<!-- 文本内容 --> <!-- 文本内容 -->
<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 ? loverInfo.avatar : loveImg}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框-->
<view bindtap="dKztDetial" data-xq="{{item}}" data-id="{{item.id}}" class="dftext"wx:if="{{item.type=='text'}}" bindlongpress="changAn"> <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> -->
</view> </view>
</view> </view>
<!-- 音频内容 --> <!-- 音频内容 -->
<view wx:if="{{item.type=='audio'}}" class="zjtableatp2"> <view wx:if="{{item.type=='audio'}}" class="zjtableatp2">
<view class="zttp12" wx:if="{{item.type=='audio'}}"> <view class="zttp12" wx:if="{{item.type=='audio'}}">
<t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框--> <t-image src="{{loverInfo.avatar ? loverInfo.avatar : loveImg}}" class="wchattxk11" shape="circle" ></t-image><!--对方的的头像框-->
<view <view
data-bf="{{!item.extra.isBf}}" data-bf="{{!item.extra.isBf}}"
class="zjypk1" wx:if="{{!item.extra.isBf}}" class="zjypk1" wx:if="{{!item.extra.isBf}}"
@ -169,15 +169,15 @@
</view> </view>
<view class="zjypwz1">{{item.extra.ssec}}</view> <view class="zjypwz1">{{item.extra.ssec}}</view>
</view> </view>
<view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> <!-- <view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> -->
</view> </view>
</view> </view>
<!--信札消息--> <!--信札消息-->
<view class="zjtableatp4" wx:if="{{item.type ==='letter'}}"> <view class="zjtableatp4" wx:if="{{item.type ==='letter'}}">
<t-image src="{{loverInfo.avatar}}" class="wchattxk11" shape="circle" ></t-image> <t-image src="{{loverInfo.avatar ? loverInfo.avatar : loveImg}}" class="wchattxk11" shape="circle" ></t-image>
<view class="xz-box" bindtap="getLetter" data-item="{{item}}" data-id="{{item.id}}"></view> <view class="xz-box" bindtap="getLetter" data-item="{{item}}" data-id="{{item.id}}"></view>
<view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> <!-- <view class="zjydwdtp3">{{item.status=='unread'?'未读':'已读'}}</view> -->
</view> </view>
</view> </view>
</view> </view>

@ -116,12 +116,14 @@
.txl{ .txl{
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
background-color: #fff;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
} }
.txr{ .txr{
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
background-color: #fff;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
} }

@ -36,6 +36,28 @@ Page({
isPlaying: false // 是否正在播放语音 isPlaying: false // 是否正在播放语音
}, },
already(){ already(){
// 校验
if (this.data.from === '') {
wx.showToast({
title: '寄件人不能为空',
icon: 'error'
})
return this.setData({showSend: false})
}
if (this.data.to === '') {
wx.showToast({
title: '收件人不能为空',
icon: 'error'
})
return this.setData({showSend: false})
}
if (this.data.messageList.length <= 1) {
wx.showToast({
title: '写点东西吧',
icon: 'error'
})
return this.setData({showSend: false})
}
const list = [] const list = []
this.data.messageList.forEach(item => { this.data.messageList.forEach(item => {
const obj = {} const obj = {}
@ -143,17 +165,18 @@ Page({
}, },
// 上传图片 // 上传图片
addImg(){ addImg(){
console.log('添加图片'); wx.chooseImage({
wx.chooseMedia({
mediaType: 'image',
count: 9, count: 9,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => { success: (res) => {
console.log(res);
const files = res.tempFiles const files = res.tempFiles
files.forEach(item => { files.forEach(item => {
if(item.size > 5 * 1024 * 1024 ){ if(item.size > 5 * 1024 * 1024 ){
return this.setData({showImgBig:true}) return this.setData({showImgBig:true})
} }
this.uploadFile(item.tempFilePath,'poster') this.uploadFile(item.path,'poster')
}) })
} }
}) })
@ -384,48 +407,6 @@ Page({
}) })
}, },
// 获取信札消息
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'
})
}
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */

@ -82,7 +82,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- showSoundMore -->
<view class="taost" wx:if="{{showSoundMore}}"> <view class="taost" wx:if="{{showSoundMore}}">
<view class="taost-box"> <view class="taost-box">
<view class="taost-box-text">最多只能添加</view> <view class="taost-box-text">最多只能添加</view>
@ -101,7 +101,7 @@
<view class="taost" wx:if="{{showSend}}"> <view class="taost" wx:if="{{showSend}}">
<view class="taost-box2"> <view class="taost-box2">
<view class="taost-box-text">确定要寄出吗?</view> <view class="taost-box-text2">确定要寄出吗?</view>
<view class="Send-btn"> <view class="Send-btn">
<view class="taost-box-btn" bindtap="closeShowSend">取消</view> <view class="taost-box-btn" bindtap="closeShowSend">取消</view>
<view class="taost-box-btn" bindtap="already">确定</view> <view class="taost-box-btn" bindtap="already">确定</view>

@ -451,6 +451,16 @@ textarea {
} }
.taost-box-text { .taost-box-text {
margin-bottom: 20rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: rgba(108, 108, 108, 1);
font-size: 38rpx;
}
.taost-box-text2 {
margin-bottom: 20rpx; margin-bottom: 20rpx;
width: 100%; width: 100%;
height: 200rpx; height: 200rpx;

@ -1,66 +0,0 @@
// pages/home/xx/lindex/xz/xz.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

@ -1,2 +0,0 @@
<!--pages/home/xx/lindex/xz/xz.wxml-->
<text>pages/home/xx/lindex/xz/xz.wxml</text>

@ -1 +0,0 @@
/* pages/home/xx/lindex/xz/xz.wxss */

@ -1,66 +0,0 @@
// pages/home/xx/xz/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -1,3 +0,0 @@
{
"usingComponents": {}
}

@ -1,2 +0,0 @@
<!--pages/home/xx/xz/index.wxml-->
<text>pages/home/xx/xz/index.wxml</text>

@ -1 +0,0 @@
/* pages/home/xx/xz/index.wxss */

@ -130,18 +130,18 @@ Page({
}, },
// 上传图片 // 上传图片
addImg(){ addImg(){
console.log('添加图片'); wx.chooseImage({
wx.chooseMedia({
mediaType: 'image',
count: 9, count: 9,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => { success: (res) => {
console.log(res);
const files = res.tempFiles const files = res.tempFiles
console.log(res.tempFiles, '这里');
files.forEach(item => { files.forEach(item => {
if(item.size > 5 * 1024 * 1024 ){ if(item.size > 5 * 1024 * 1024 ){
return this.setData({showImgBig:true}) return this.setData({showImgBig:true})
} }
this.uploadFile(item.tempFilePath,'poster') this.uploadFile(item.path,'poster')
}) })
} }
}) })
@ -213,7 +213,7 @@ Page({
} }
}), }),
fail(res) { fail(res) {
console.log('上传失败'); console.log(res, '上传失败');
} }
}); });
}, },

@ -447,6 +447,7 @@ startDraw() {
*/ */
onShow() { onShow() {
this.getMyWish() this.getMyWish()
this.initXy()
}, },
/** /**

@ -52,16 +52,16 @@
margin-left: 98rpx; margin-left: 98rpx;
margin-top: 193rpx; margin-top: 193rpx;
width: 200rpx; width: 200rpx;
height: 67.495rpx; height: 70rpx;
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%); 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);
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); border: 6rpx solid rgba(255, 255, 255, 1);
border: 3px solid rgba(255, 255, 255, 1);
line-height: 67.495rpx;
color: aliceblue; color: aliceblue;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
font-size: 30rpx; font-size: 30rpx;
display: flex;
justify-content: center;
align-items: center;
} }
.qlxybtn2{ .qlxybtn2{
@ -126,17 +126,16 @@
margin-left: 452rpx; margin-left: 452rpx;
margin-top: 193rpx; margin-top: 193rpx;
width: 200rpx; width: 200rpx;
height: 67.495rpx; height: 70rpx;
line-height: 67.495rpx;
text-align: center;
color: aliceblue; color: aliceblue;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
font-size: 30rpx; font-size: 30rpx;
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%); 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);
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4); border: 6rpx solid rgba(255, 255, 255, 1);
border: 3px solid rgba(255, 255, 255, 1); display: flex;
align-items: center;
justify-content: center;
} }
.bgt3{ .bgt3{

@ -104,6 +104,9 @@
font-size: 28rpx; font-size: 28rpx;
font-weight: 700; font-weight: 700;
width: 320rpx; width: 320rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.qwsjbox{ .qwsjbox{

@ -106,9 +106,7 @@
width: 320rpx; width: 320rpx;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; /* 使用旧的 WebKit 内核的浏览器需要添加此属性 */ white-space: nowrap;
-webkit-box-orient: vertical; /* 设置为垂直方向排列 */
-webkit-line-clamp: 2; /* 最多显示的行数 */
} }
.qwsjbox{ .qwsjbox{

@ -141,6 +141,7 @@ Page({
header: {'Authorization': wx.getStorageSync('token')}, header: {'Authorization': wx.getStorageSync('token')},
method: 'GET', method: 'GET',
success: res => { success: res => {
console.log(res,'111');
const letterStatus = res.data.data.letterStatus const letterStatus = res.data.data.letterStatus
// 这里可以判断是否有未读信札 // 这里可以判断是否有未读信札
if (letterStatus === 'sending') { if (letterStatus === 'sending') {

@ -6,6 +6,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
overflow-y: scroll;
} }
.bg{ .bg{

@ -13,10 +13,13 @@ Page({
showLetter: true, showLetter: true,
showMore: false, showMore: false,
showDel:false, showDel:false,
showEdit: true,
imgList:[], imgList:[],
audioList:[], audioList:[],
messageList: [], messageList: [],
playVideos: true playVideos: true,
letterId: 0,
hy: false
}, },
openLetter(){ openLetter(){
this.setData({showLetter: !this.data.showLetter}), this.setData({showLetter: !this.data.showLetter}),
@ -76,17 +79,82 @@ Page({
}, },
// 重置信札 // 重置信札
resetLetter(){ resetLetter(){
const id = this.data.letterId
// 判断单人状态信札跳转还是情侣状态
if (id) {
// 删除消息
console.log('删除消息');
if (id == -1) {
// 重置信札
req.putRequest('/api/user/curt/letter/reset',{}).then( res => { req.putRequest('/api/user/curt/letter/reset',{}).then( res => {
console.log(res, '重置成功'); if (res.data.code === 200) {
wx.switchTab({
url: '/pages/home/xx/lindex/lindex'
})
}
})
}else if(id == -2) {
wx.showToast({
title: '不能烧毁情侣信札',
icon: 'none'
})
this.setData({showDel : false})
}else {
req.deleteRequest(`/api/user/curt/message/${id}`,{}).then(res => {
console.log(res);
if (res.data.code === 200) {
wx.showToast({
title: '信件已烧毁',
icon: 'success'
})
setTimeout(() => {
if (this.data.hy) {
wx.redirectTo({
url: '/pages/home/xx/hy/index'
})
}else {
wx.redirectTo({
url: '/pages/home/xx/lindex/lindex'
})
}
}, 1000);
}
if (res.data.code === 1007) {
wx.showToast({
title: '不能删除情侣信札',
icon: 'none'
}) })
this.setData({showDel : false})
}
})
}
}else {
// 重置信札
req.putRequest('/api/user/curt/letter/reset',{}).then( res => {
if (res.data.code === 200) {
wx.switchTab({ wx.switchTab({
url: '/pages/home/xy/index' url: '/pages/home/xy/index'
}) })
}
})
}
}, },
go2Back(){ go2Back(){
if (this.data.letterId) {
if (this.data.hy) {
wx.redirectTo({
url: '/pages/home/xx/hy/index'
})
}else {
wx.redirectTo({
url: '/pages/home/xx/lindex/lindex'
})
}
}else {
wx.switchTab({ wx.switchTab({
url: '/pages/home/xy/index' url: '/pages/home/xy/index'
}) })
}
}, },
// 修改信札 // 修改信札
@ -96,6 +164,90 @@ Page({
}) })
}, },
// 获取情侣状态下信札内容
getLetterDetail(id){
if (id == -1) {
this.getUserInfo()
}else if (id == -2) {
console.log('获取情侣信札内容');
this.getLoveLetter()
}else {
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
})
// 判断是否为情侣信札 是就更改信札状态
const userInfo = wx.getStorageSync('xinyuan-userInfo')
const id = userInfo.id
if (res.data.data.fromUserid !== id && res.data.data.status === 'unread') {
req.patchRequest(`/api/user/curt/message/${id}/read`)
}
}else{
wx.showToast({
title: '获取信札内容失败',
icon: 'error'
})
}
})
}
},
// 获取情侣内容
getLoveLetter(){
const userInfo = wx.getStorageSync('xinyuan-userInfo')
const id = userInfo.loverId
req.getRequest('/api/user/curt/lover/letter',{}).then(res => {
console.log(res);
const { messageList } = res.data.data
// 获取创建时间
const date = new Date(res.header.Date);
// 获取年月日时分秒等信息
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const formattedDate = `${year}${month}${day}${hour}:${minute}`;
this.setData({
letterMsg: res.data.data,
time: formattedDate
})
// 判断是否有图片
console.log(messageList);
messageList.forEach(item => {
if(item.type === 'graphic') {
item.img = `https://xzjl-api.windymuse.cn/api/resource/${item.resourceId}?k=${id}`
}else if(item.type === 'audio') {
item.audio = `https://xzjl-api.windymuse.cn/api/resource/${item.resourceId}?k=${id}`
}
})
this.setData({messageList: messageList})
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
@ -103,10 +255,18 @@ Page({
if (options.open) { if (options.open) {
// 单人状态下点击【信札】跳转的页面 // 单人状态下点击【信札】跳转的页面
this.setData({showLetter: false}) this.setData({showLetter: false})
this.getUserInfo()
}else if (options.id) { }else if (options.id) {
// 情侣状态下点击【信札】跳转的页面 this.getLetterDetail(options.id)
console.log(options.id, '111'); this.setData({
this.setData({showLetter: false}) showLetter: false,
showEdit: false,
letterId: options.id
})
// 判断是否回忆页面跳转
if (options.hy) {
this.setData({hy: true})
}
}else { }else {
this.getUserInfo() this.getUserInfo()
} }

@ -51,7 +51,7 @@
<image src="https://wish-assets.windymuse.com.cn/xy/md-more_horiz%20Copy%401x.png" /> <image src="https://wish-assets.windymuse.com.cn/xy/md-more_horiz%20Copy%401x.png" />
</view> </view>
<view class="btm-img-more modify" wx:if="{{showMore}}" bindtap="openDel">烧毁</view> <view class="btm-img-more modify" wx:if="{{showMore}}" bindtap="openDel">烧毁</view>
<view class="btm-img-more del" bindtap="editXz" wx:if="{{showMore}}">修改</view> <view class="btm-img-more del" bindtap="editXz" wx:if="{{showMore && showEdit}}">修改</view>
</view> </view>
</view> </view>

@ -10,14 +10,28 @@
"list": [ "list": [
{ {
"name": "", "name": "",
"pathName": "pages/home/xx/lindex/lxz/lxz", "pathName": "pages/home/jl/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "", "name": "",
"pathName": "pages/home/xx/hy/hx/hx", "pathName": "pages/home/me/indexx",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/home/jl/jlai/jlai",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/home/me/ysxy/ysxy",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

Loading…
Cancel
Save