wk-dev
Wkang921 2 years ago
parent 27e1e363d3
commit 6baf76bb7d

@ -15,7 +15,9 @@ Page({
userInfo:{},
stxx:false,
showChat:true,
showChatToast:false
showChatToast:false,
list: [], // 默认头像
isShow: false
},
addClick(){
this.setData({
@ -82,10 +84,14 @@ Page({
getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{
if(res.data.code==200){
this.setData({userInfo:res.data.data})
this.setData({
userInfo:res.data.data,
isShow: true
})
if(!res.data.data.isChatVip){
this.setData({times:res.data.data.freeChatCount})
}
this.getDetaile()
}
}).catch((err)=>{
console.log(err);
@ -122,6 +128,17 @@ Page({
this.setData({ltinfo: '我需要写一封情书,但我不太会表达。我会告诉你我们之间的经历和我想表达的心意,你可以帮我整理成一封动人的情书吗?'})
}
},
// 获取默认头像
getDetaile(){
const list = wx.getStorageSync('xy-static-img')
const type = this.data.userInfo.constellation
this.setData({
list: list[type]
})
console.log(this.data.list);
},
/**
* 生命周期函数--监听页面加载
*/

@ -1,5 +1,5 @@
<!--pages/home/jl/jlai/jlai.wxml-->
<view class="ai-container">
<view class="ai-container" wx:if="{{isShow}}">
<view class="header">
<view class="reback" bindtap="go2Reback"></view><!--左上角返回图标-->
@ -28,7 +28,7 @@
</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>
<t-image src="https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/headimg-25.png" shape="circle" class="tximg"></t-image>
<view class="ltwzk">你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧!</view>
</view>
@ -46,9 +46,9 @@
<!--聊天内容-->
<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>
<image src="https://wish-assets.oss-cn-hangzhou.aliyuncs.com/xy/headimg-25.png" shape="circle" class="chattoux" wx:if="{{item.type==2}}"></image>
<view class="chattoux" wx:if="{{item.type==1}}">
<image src="{{userInfo.avatar}}" ></image>
<image src="{{userInfo.avatar ? userInfo.avatar : list['elf-avatar']}}" ></image>
</view>
<view class="chatinfo">{{item.value}}</view>
</view>

@ -254,20 +254,17 @@
.chatbox1{
width:750rpx;
height:166rpx;
display: block;
display: flex;
}
.chatbox2{
width:750rpx;
height:166rpx;
display: block;
display: flex;
background-color: rgba(248, 99, 42, 0.05);
}
.chattoux{
margin-left: 32rpx;
margin-top: 32rpx;
margin: 32rpx;
border-radius: 50%;
overflow: hidden;
width: 84rpx;
@ -280,14 +277,11 @@
}
.chatinfo{
margin-left: 74px;
margin-top: -70rpx;
margin-top: 50rpx;
margin-bottom: 20rpx;
width: 280px;
height: 90px;
color: rgba(79, 79, 79, 1);
font-size: 17px;
text-align: justify;
font-family: SourceHanSansSC-regular;
font-size: 34rpx;
}
.kthybtn{

@ -238,7 +238,7 @@ Page({
},
// 跳转到会员购买页面
go2Member(){
wx.redirectTo({
wx.navigateTo({
url: '/pages/home/me/member/member?isChatVip=' + this.data.userInfo.isChatVip
})
},
@ -292,7 +292,7 @@ Page({
go2Jcjb(){
wx.redirectTo({
url: '/pages/home/me/jcjb/jcjb'
})
})
},
getUserInfo(){
req.getRequest('/api/user/curt',{}).then((res)=>{
@ -360,7 +360,6 @@ Page({
*/
onShow() {
this.getUserInfo()
},
/**

@ -15,7 +15,6 @@ Page({
deadline: ''
},
doKtHy() {
req.postRequest(`/api/v1/chat-service-order/prepare/${this.data.yhy?'2':'1'}`, {
openid: this.data.openid
}).then((res) => {
@ -36,9 +35,7 @@ Page({
icon: 'success', // 图标类型默认success 图标支持开发文档的icon
})
setTimeout(() => {
wx.switchTab({
url: '/pages/home/me/indexx',
})
wx.navigateBack()
}, 1000)
},
fail: () => {
@ -54,9 +51,7 @@ Page({
this.setData({yhy: !this.data.yhy})
},
go2Reback(){
wx.switchTab({
url: '/pages/home/me/indexx',
})
wx.navigateBack()
},
tQuest(){
this.setData({showToast:true})

@ -57,6 +57,7 @@
background-repeat: no-repeat;
background-size:100% 100%;
background-image: url(https://wish-assets.windymuse.com.cn/xy/hybt.png);
pointer-events: none;
}
.hgpng{

@ -42,6 +42,13 @@
"query": "id=225",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/home/jl/jlai/jlai",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

Loading…
Cancel
Save