2025-09-28 聊天修改
This commit is contained in:
@@ -96,7 +96,8 @@
|
||||
</view>
|
||||
|
||||
<u-row justify="flex-end" class="u-m-r-40 btn-group">
|
||||
<u-col span="3"><u-button class="btn" type="primary">{{isChat?"继续聊":"聊一聊"}}</u-button></u-col>
|
||||
<u-col span="3"><u-button class="btn" type="primary"
|
||||
@click="handleChat">{{isChat?"继续聊":"聊一聊"}}</u-button></u-col>
|
||||
<u-col span="3"><u-button class="btn" type="success" @click="handleOpen">立刻融</u-button></u-col>
|
||||
</u-row>
|
||||
|
||||
@@ -171,6 +172,7 @@
|
||||
import { getUserInfo } from '../../util/common';
|
||||
import { programAPI } from '../../api/program';
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { groupAPI } from '../../api/group';
|
||||
|
||||
const userId = ref()
|
||||
const programId = ref()
|
||||
@@ -213,6 +215,30 @@
|
||||
loadData()
|
||||
})
|
||||
|
||||
const handleChat = () => {
|
||||
if (isChat.value) {
|
||||
// 继续聊
|
||||
groupAPI.getOne({programId: programId.value, userId: userId.value}).then(res=>{
|
||||
if(res.code==200){
|
||||
// 进入聊天
|
||||
uni.redirectTo({
|
||||
url: '/pages/message/chat?groupId=' + res.data.groupId
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 开启群组聊天
|
||||
groupAPI.add({ programId: programId.value, userId: userId.value }).then(res => {
|
||||
if(res.code==200){
|
||||
// 创建成功,进入聊天
|
||||
uni.redirectTo({
|
||||
url: '/pages/message/chat?groupId=' + res.data.groupId
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 立刻融 弹窗
|
||||
const showWarning = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user