|
@@ -7,6 +7,9 @@
|
|
@touchend="handleTouchEnd"
|
|
@touchend="handleTouchEnd"
|
|
>
|
|
>
|
|
<TUISearch searchType="global" />
|
|
<TUISearch searchType="global" />
|
|
|
|
+ <!-- <div class="header" @click="myGourp">我的群聊</div> -->
|
|
|
|
+ <div class="header" @click="createGroup">创建粉丝群</div>
|
|
|
|
+
|
|
<!-- <ConversationHeader
|
|
<!-- <ConversationHeader
|
|
v-if="isShowConversationHeader"
|
|
v-if="isShowConversationHeader"
|
|
ref="headerRef"
|
|
ref="headerRef"
|
|
@@ -24,7 +27,12 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { TUIStore, StoreName } from "@tencentcloud/chat-uikit-engine";
|
|
|
|
|
|
+import * as MesApi from "../../../api/message";
|
|
|
|
+import {
|
|
|
|
+ TUIStore,
|
|
|
|
+ StoreName,
|
|
|
|
+ TUIConversationService,
|
|
|
|
+} from "@tencentcloud/chat-uikit-engine";
|
|
import { TUIGlobal } from "@tencentcloud/universal-api";
|
|
import { TUIGlobal } from "@tencentcloud/universal-api";
|
|
import { ref } from "../../adapter-vue";
|
|
import { ref } from "../../adapter-vue";
|
|
import TUISearch from "../TUISearch/index.vue";
|
|
import TUISearch from "../TUISearch/index.vue";
|
|
@@ -77,6 +85,37 @@ const closeChildren = () => {
|
|
headerRef?.value?.closeChildren();
|
|
headerRef?.value?.closeChildren();
|
|
conversationListDomRef?.value?.closeChildren();
|
|
conversationListDomRef?.value?.closeChildren();
|
|
};
|
|
};
|
|
|
|
+const shopInfo = ref({});
|
|
|
|
+const myGourp = () => {
|
|
|
|
+ TUIGlobal?.navigateTo({
|
|
|
|
+ url: "/TUIKit-House/components/TUIContact/index",
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+const createGroup = async () => {
|
|
|
|
+ const ownerAccount = uni.getStorageSync('id');
|
|
|
|
+ // TUIConversationService.switchConversation(
|
|
|
|
+ // "GROUP17527216214421942041809035223041"
|
|
|
|
+ // );
|
|
|
|
+ let res = await MesApi.default.getInfoByUserId();
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ shopInfo.value = res.data;
|
|
|
|
+ let create = await MesApi.default.createGroup({
|
|
|
|
+ shopId: res.data.id ,
|
|
|
|
+ ownerAccount:ownerAccount,
|
|
|
|
+ agentType:uni.getStorageSync('agentType')
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ console.log(create);
|
|
|
|
+ if (create.code == 200) {
|
|
|
|
+ TUIConversationService.switchConversation(
|
|
|
|
+ `GROUP${create.data.groupId}`
|
|
|
|
+ );
|
|
|
|
+ uni.$u.toast(create.msg);
|
|
|
|
+ } else {
|
|
|
|
+ uni.$u.toast(create.msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
const handleClickConv = () => {
|
|
const handleClickConv = () => {
|
|
closeChildren();
|
|
closeChildren();
|
|
@@ -118,4 +157,15 @@ const getPassingRef = (ref) => {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.header {
|
|
|
|
+ height: 25px;
|
|
|
|
+ background: white;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ padding: 0px 10px 10px 10px;
|
|
|
|
+}
|
|
|
|
+</style>
|
|
<style lang="scss" scoped src="./style/index.scss"></style>
|
|
<style lang="scss" scoped src="./style/index.scss"></style>
|