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

@ -15,7 +15,9 @@ Page({
userInfo:{}, userInfo:{},
stxx:false, stxx:false,
showChat:true, showChat:true,
showChatToast:false showChatToast:false,
list: [], // 默认头像
isShow: false
}, },
addClick(){ addClick(){
this.setData({ this.setData({
@ -82,10 +84,14 @@ 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.setData({userInfo:res.data.data}) this.setData({
userInfo:res.data.data,
isShow: true
})
if(!res.data.data.isChatVip){ if(!res.data.data.isChatVip){
this.setData({times:res.data.data.freeChatCount}) this.setData({times:res.data.data.freeChatCount})
} }
this.getDetaile()
} }
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
@ -122,6 +128,17 @@ Page({
this.setData({ltinfo: '我需要写一封情书,但我不太会表达。我会告诉你我们之间的经历和我想表达的心意,你可以帮我整理成一封动人的情书吗?'}) 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--> <!--pages/home/jl/jlai/jlai.wxml-->
<view class="ai-container"> <view class="ai-container" wx:if="{{isShow}}">
<view class="header"> <view class="header">
<view class="reback" bindtap="go2Reback"></view><!--左上角返回图标--> <view class="reback" bindtap="go2Reback"></view><!--左上角返回图标-->
@ -28,7 +28,7 @@
</view> </view>
<view class="ltkjj-btm"> <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 class="ltwzk">你好,我是你的星座守护精灵。除此之外,我还可以帮你解答更多问题。快来跟我聊聊吧!</view>
</view> </view>
@ -46,9 +46,9 @@
<!--聊天内容--> <!--聊天内容-->
<view class="chatbox" wx:else> <view class="chatbox" wx:else>
<view class="{{item.type === 1 ? 'chatbox1' : 'chatbox2'}}" wx:for="{{chatList}}" wx:key="index"> <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}}"> <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>
<view class="chatinfo">{{item.value}}</view> <view class="chatinfo">{{item.value}}</view>
</view> </view>

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

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

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

@ -57,6 +57,7 @@
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/hybt.png);
pointer-events: none;
} }
.hgpng{ .hgpng{

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

Loading…
Cancel
Save