This commit is contained in:
zengBin 2024-10-08 10:24:03 +08:00
parent 37b64095f6
commit f9337ceb25
6 changed files with 173 additions and 36 deletions

View File

@ -38,7 +38,7 @@
}, },
searchName: { searchName: {
type: String, type: String,
default: '搜索...' default: '搜索昵称'
} }
}, },
data: { data: {

View File

@ -786,6 +786,7 @@ wepy.page({
vm.$showToast('请输入聊天内容') vm.$showToast('请输入聊天内容')
return return
} }
let msg = vm.msg
if (/\[[^\]]+\]/.test(vm.msg)) { if (/\[[^\]]+\]/.test(vm.msg)) {
vm.msg = vm.transitionMsg(vm.msg) vm.msg = vm.transitionMsg(vm.msg)
} }
@ -807,7 +808,7 @@ wepy.page({
app.globalData.nim.msg.sendTextMsg({ app.globalData.nim.msg.sendTextMsg({
scene: 'p2p', scene: 'p2p',
to: vm.otherUserId, to: vm.otherUserId,
body: vm.msg, body: msg,
isSend: 0, isSend: 0,
onSendBefore: function (msg) { onSendBefore: function (msg) {
console.log('get msg before', msg) console.log('get msg before', msg)

View File

@ -1057,9 +1057,8 @@ wepy.page({
vm.lastTime = format(item.time) vm.lastTime = format(item.time)
// 获取成员头像后再循环获取数据 // 获取成员头像后再循环获取数据
app.globalData.nim.user.getUsersNameCardFromServer({ app.globalData.nim.user.getUsersNameCardFromServer({
accounts: [item.from] accounts: [`${item.id}`]
}).then((res) => { }).then((res) => {
item.avatar = res[0].avatar
if (index + 1 == data.length) { if (index + 1 == data.length) {
vm.lastMsgId = data[data.length - 1].id vm.lastMsgId = data[data.length - 1].id
vm.beginTime = data[data.length - 1].time vm.beginTime = data[data.length - 1].time

View File

@ -0,0 +1,117 @@
<style lang="less" scoped>
@import url(../../styles/theme.less);
page {
background-color: #ffffff;
}
</style>
<template>
<view class="ui-newsSearch"></view>
</template>
<script>
import wepy from '@wepy/core'
import https from '../../mixins/https'
import base from '../../mixins/base'
import {service} from '../../config'
wepy.page({
config: {},
mixins: [https, base],
data: {
},
methods: {
getList() {
let vm = this
let data = {
page: vm.page
}
vm.$showLoading('加载中...')
vm.$get({url: `${service.host}/chat/linkmen`, data}).then(({code, data}) => {
if (code === 0) {
vm.teamAtList = wx.getStorageSync('teamAtList') || []
vm.groupSessionsCount = wx.getStorageSync('teamsSessionsCount') || []
let arrList = []
if (data.data && data.data.length > 0) {
data.data.forEach((item) => {
if (item.chat_type == 'group_chat') {
arrList.push({
chat_type: item.chat_type,
icon: item.other_photo,
title: item.other_nickname,
is_top: item.is_top,
content: item.last_user_nickname + '' + item.content,
last_time: item.last_time_str,
id: item.join_to_id,
hidden_profile: 'NONE',
msgId: item.id,
isTouchMove: false,
new_count: wx.getStorageSync('muteNotList') && wx.getStorageSync('muteNotList').length > 0 ? 0 : vm.getGroupCount(item.join_to_id)
})
} else {
arrList.push({
chat_type: item.chat_type,
icon: item.other_photo,
title: item.other_nickname,
is_top: item.is_top,
content: item.content,
last_time: item.last_time_str,
id: item.join_to_id,
hidden_profile: '',
type: item.other_type,
msgId: item.last_id,
isTouchMove: false,
new_count: item.new_count
})
}
})
}
vm.list = [...arrList]
// 赋值所在群组已开启消息免打扰字段
if (wx.getStorageSync('muteNotList') && wx.getStorageSync('muteNotList').length > 0) {
let arr = wx.getStorageSync('muteNotList')
arr.forEach((i) => {
vm.list.forEach((j) => {
if (j.chat_type == 'group_chat' && i.teamId == j.id && !j.muteState) {
j.new_count = 0
j.muteTeam = i.muteTeam
j.muteState = true
} else if (j.chat_type == 'group_chat') {
j.new_count = vm.getGroupCount(j.id)
}
})
})
}
console.log(vm.list, '777')
if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true
}
}
setTimeout(() => {
vm.loading = true
}, 500)
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
vm.loading = true
console.log(err)
})
}
},
onShow() {
let vm = this
vm.getList()
},
onLoad() {}
})
</script>
<config>
{
navigationBarTitleText: '',
enablePullDownRefresh: true,
backgroundColorTop: '#ffffff',
backgroundColorBottom: '#ffffff',
usingComponents: { }
}
</config>

View File

@ -281,7 +281,7 @@ page {
} }
</style> </style>
<template> <template>
<view class="ui-home"> <view class="ui-home" v-if="pageLoading">
<cuCustom :searchName="'寻找心仪的Ta'" @tap="jumpPath('/pages/home/searchUsers')"></cuCustom> <cuCustom :searchName="'寻找心仪的Ta'" @tap="jumpPath('/pages/home/searchUsers')"></cuCustom>
<view class="f-fbc ui-pl-30 ui-pt-40 ui-pr-30"> <view class="f-fbc ui-pl-30 ui-pt-40 ui-pr-30">
<view class="font_34 color333 bold">置顶推荐</view> <view class="font_34 color333 bold">置顶推荐</view>
@ -303,7 +303,7 @@ page {
<view class="ui-prefecture-mask font_28 colorF bold f-fcc">{{item.title}}</view> <view class="ui-prefecture-mask font_28 colorF bold f-fcc">{{item.title}}</view>
</view> </view>
</view> </view>
<block v-if="referrals && referrals.length > 0"> <block v-if="referrals && referrals.length > 1">
<view class="f-fbc ui-referrals-box"> <view class="f-fbc ui-referrals-box">
<view class="font_34 color333 bold">为你推荐</view> <view class="font_34 color333 bold">为你推荐</view>
<image class="ui-require-icon" src="https://image.fulllinkai.com/202409/24/4f52d791e75a7e89a5696754f37e51f7.png" mode="widthFix" @tap="jumpPath('/pages/users/selfTextarea?text=期望对方&placeText=写下你心中理想的对象')"></image> <image class="ui-require-icon" src="https://image.fulllinkai.com/202409/24/4f52d791e75a7e89a5696754f37e51f7.png" mode="widthFix" @tap="jumpPath('/pages/users/selfTextarea?text=期望对方&placeText=写下你心中理想的对象')"></image>
@ -442,6 +442,7 @@ wepy.page({
mixins: [https, base], mixins: [https, base],
data: { data: {
pageLoading: false,
loginShow: false, loginShow: false,
perfectModal: false, perfectModal: false,
userInfo: {}, userInfo: {},
@ -465,8 +466,10 @@ wepy.page({
if (code === 0) { if (code === 0) {
vm.topList = data || [] vm.topList = data || []
} }
vm.pageLoading = true
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
vm.pageLoading = true
wx.hideLoading() wx.hideLoading()
console.log(err) console.log(err)
}) })

View File

@ -38,6 +38,15 @@ page {
} }
.ui-container{ .ui-container{
.ui-no-data-box {
text-align: center;
.ui-no-data-icon {
width: 440rpx;
height: 360rpx;
margin: 160rpx auto -10rpx auto;
}
}
.ui-touch-item { .ui-touch-item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -150,33 +159,39 @@ page {
</view> </view>
</view> </view>
<view class="ui-container"> <view class="ui-container">
<view class="ui-touch-item" :class="{'touch-move-active' : item.isTouchMove}" data-index="{{index}}" bindtouchstart="touchstart" bindtouchmove="touchmove" v-for="(item,index) in list" :key="index" @tap="jumpChatPath(item)"> <view class="ui-no-data-box" v-if="loading && list.length == 0">
<view class="ui-content"> <image class="ui-no-data-icon" src="https://image.fulllinkai.com/202410/08/d1bf2764cef610125120a0465f108e71.png" mode="widthFix"></image>
<image class="cu-avatar round lg flo_l" :src="item.icon" mode="aspectFit" @tap.stop="jumpDetailPath(item)"></image> <view class="font_32 color999">暂无聊天消息</view>
<view class="ui-messageBox flo_l">
<view class="font_30 color333 ui-name ellipsis_1 f-fcl">
{{item.title}}
<view v-if="item.is_top == 1" class="ui-is-top font_20 white">已置顶</view>
</view>
<view class="ui-message ellipsis_1 font_24 color666">
<span v-if="item.at_show" class="red">[有人@你]</span>
{{item.content}}
</view>
</view>
<view class="ui-unreadBox color999 text-right">
<view class="ui-lastTime font_22">{{item.last_time}}</view>
<block v-if="item.muteTeam">
<image class="ui-no-disturbing" src="https://image.fulllinkai.com/202406/29/c682c95e835831195a5af75c303a9720.png" mode="widthFix"></image>
</block>
<block v-else>
<view class="ui-unreadNum" v-if="item.new_count && item.new_count <= 99">{{item.new_count}}</view>
<view class="ui-unreadNum_1" v-if="item.new_count && item.new_count > 99">{{item.new_count}}</view>
</block>
</view>
</view>
<view v-if="item.chat_type == 'linkmen'" class="ui-del-box" @tap="quitGroup(item, index)">退出</view>
<view v-else class="ui-del-box" @tap="deleteList(item, index)">删除</view>
</view> </view>
<block v-else>
<view class="ui-touch-item" :class="{'touch-move-active' : item.isTouchMove}" data-index="{{index}}" bindtouchstart="touchstart" bindtouchmove="touchmove" v-for="(item,index) in list" :key="index" @tap="jumpChatPath(item)">
<view class="ui-content">
<image class="cu-avatar round lg flo_l" :src="item.icon" mode="aspectFit" @tap.stop="jumpDetailPath(item)"></image>
<view class="ui-messageBox flo_l">
<view class="font_30 color333 ui-name ellipsis_1 f-fcl">
{{item.title}}
<view v-if="item.is_top == 1" class="ui-is-top font_20 white">已置顶</view>
</view>
<view class="ui-message ellipsis_1 font_24 color666">
<span v-if="item.at_show" class="red">[有人@你]</span>
{{item.content}}
</view>
</view>
<view class="ui-unreadBox color999 text-right">
<view class="ui-lastTime font_22">{{item.last_time}}</view>
<block v-if="item.muteTeam">
<image class="ui-no-disturbing" src="https://image.fulllinkai.com/202406/29/c682c95e835831195a5af75c303a9720.png" mode="widthFix"></image>
</block>
<block v-else>
<view class="ui-unreadNum" v-if="item.new_count && item.new_count <= 99">{{item.new_count}}</view>
<view class="ui-unreadNum_1" v-if="item.new_count && item.new_count > 99">{{item.new_count}}</view>
</block>
</view>
</view>
<view v-if="item.chat_type == 'linkmen'" class="ui-del-box" @tap="quitGroup(item, index)">退出</view>
<view v-else class="ui-del-box" @tap="deleteList(item, index)">删除</view>
</view>
</block>
</view> </view>
<loginDialog :loginShow="loginShow" @hiddenLogin="hiddenLogin"></loginDialog> <loginDialog :loginShow="loginShow" @hiddenLogin="hiddenLogin"></loginDialog>
</view> </view>
@ -194,6 +209,7 @@ wepy.page({
data: { data: {
loginShow: false, loginShow: false,
loading: false,
menuList: [ menuList: [
{ {
icon: 'https://image.fulllinkai.com/202201/21/a2a7445a8b70694056dd7795ef5ecc4e.png', icon: 'https://image.fulllinkai.com/202201/21/a2a7445a8b70694056dd7795ef5ecc4e.png',
@ -290,16 +306,17 @@ wepy.page({
}) })
} }
console.log(vm.list, '777') console.log(vm.list, '777')
if (vm.list.length < 15 || session.data.length < 15) { if (vm.list.length < 15 || data.data.length < 15) {
vm.no_more = true vm.no_more = true
} }
setTimeout(() => {
vm.loading = true
}, 500)
} }
setTimeout(() => {
vm.loading = true
}, 500)
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
vm.loading = true
console.log(err) console.log(err)
}) })
}, },