diff --git a/TUIKit/assets/icon/icon-c2c.svg b/TUIKit/assets/icon/icon-c2c.svg
index e33ef15..b049662 100644
--- a/TUIKit/assets/icon/icon-c2c.svg
+++ b/TUIKit/assets/icon/icon-c2c.svg
@@ -1,36 +1 @@
-
-
+
\ No newline at end of file
diff --git a/TUIKit/assets/icon/scan.svg b/TUIKit/assets/icon/scan.svg
new file mode 100644
index 0000000..082ae1a
--- /dev/null
+++ b/TUIKit/assets/icon/scan.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/TUIKit/components/TUIChat/chat-header/index.vue b/TUIKit/components/TUIChat/chat-header/index.vue
index 0d305e2..63fcc95 100644
--- a/TUIKit/components/TUIChat/chat-header/index.vue
+++ b/TUIKit/components/TUIChat/chat-header/index.vue
@@ -28,9 +28,13 @@
import Icon from '../../common/Icon.vue'
import More from '../../../assets/icon/more.svg'
import backSVG from '../../../assets/icon/back.svg'
+ import { useUI } from '../../../../utils/use-ui'
+ import { endUserService } from '../../../../api/my-index'
+
+ const { showDialog, showToast } = useUI()
const emits = defineEmits(['openGroupManagement'])
- const props = defineProps(['isGroup'])
+ const props = defineProps(['isGroup', 'serviceID'])
const currentConversation = ref()
const typingStatus = ref(false)
@@ -86,8 +90,17 @@
}
}
- function back() {
- uni.navigateBack()
+ const back = async () => {
+ if (props.serviceID) {
+ const show = await showDialog('提示', '确定要退出当前会话吗?')
+ if (show) {
+ await endUserService(props.serviceID)
+ await showToast('结束服务成功')
+ uni.navigateBack()
+ }
+ } else {
+ uni.navigateBack()
+ }
}
diff --git a/TUIKit/components/TUIChat/index.vue b/TUIKit/components/TUIChat/index.vue
index 149b196..928938f 100644
--- a/TUIKit/components/TUIChat/index.vue
+++ b/TUIKit/components/TUIChat/index.vue
@@ -14,9 +14,11 @@
+
{
+ serviceID.value = options?.id || ''
initChat(options)
})
@@ -136,7 +139,8 @@
// @End uniapp use Chat only
const emits = defineEmits(['closeChat'])
-
+ /** 客服 id */
+ const serviceID = ref('')
const groupID = ref(undefined)
const isGroup = ref(false)
const isNotInGroup = ref(false)
@@ -163,7 +167,7 @@
}
uni.onWindowResize(windowResizeCallback)
- onMounted(() => {
+ onMounted(e => {
TUIStore.watch(StoreName.CONV, {
currentConversation: onCurrentConversationUpdate
})
diff --git a/TUIKit/components/TUIConversation/conversation-header/index.vue b/TUIKit/components/TUIConversation/conversation-header/index.vue
index 6932526..92cd651 100644
--- a/TUIKit/components/TUIConversation/conversation-header/index.vue
+++ b/TUIKit/components/TUIConversation/conversation-header/index.vue
@@ -1,26 +1,15 @@
-