优化页面

This commit is contained in:
pengxiaolong
2025-05-28 22:12:30 +08:00
parent e682754922
commit c747f9625c
23 changed files with 1093 additions and 207 deletions

View File

@@ -1,15 +1,18 @@
<template>
<div class="Navigation">
<div class="Navigation">
<image
src="../../../static/Navigationimg.png"
mode="scaleToFill"
class="Navigationimg"
/>
<image @click="Returnfunc" src="../../../static/Return.png" mode="scaleToFill" class="Return" />
</div>
<div class="dingweizhibox">
<image
@click="Returnfunc"
src="../../../static/Return.png"
mode="scaleToFill"
class="Return"
/>
</div>
<div class="dingweizhibox"></div>
<div class="chat">
<div :class="['tui-chat', !isPC && 'tui-chat-h5']">
<div
@@ -18,10 +21,7 @@
>
<slot />
</div>
<div
v-if="currentConversationID"
:class="['tui-chat', !isPC && 'tui-chat-h5']"
>
<div v-if="currentConversationID" :class="['tui-chat', !isPC && 'tui-chat-h5']">
<ChatHeader
:class="[
'tui-chat-header',
@@ -66,7 +66,7 @@
:class="[
'tui-chat-message-input-toolbar',
!isPC && 'tui-chat-h5-message-input-toolbar',
isUniFrameWork && 'tui-chat-uni-message-input-toolbar'
isUniFrameWork && 'tui-chat-uni-message-input-toolbar',
]"
:displayType="inputToolbarDisplayType"
@insertEmoji="insertEmoji"
@@ -92,7 +92,13 @@
</div>
<!-- Group Management -->
<div
v-if="!isNotInGroup && !isApp && isUniFrameWork && isGroup && headerExtensionList.length > 0"
v-if="
!isNotInGroup &&
!isApp &&
isUniFrameWork &&
isGroup &&
headerExtensionList.length > 0
"
class="group-profile"
@click="handleGroup"
>
@@ -102,7 +108,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, onUnmounted, computed } from '../../adapter-vue';
import { ref, onMounted, onUnmounted, computed } from "../../adapter-vue";
import TUIChatEngine, {
TUITranslateService,
TUIConversationService,
@@ -110,38 +116,54 @@ import TUIChatEngine, {
StoreName,
IMessageModel,
IConversationModel,
} from '@tencentcloud/chat-uikit-engine';
import TUICore, { TUIConstants, ExtensionInfo } from '@tencentcloud/tui-core';
import ChatHeader from './chat-header/index.vue';
import MessageList from './message-list/index.vue';
import MessageInput from './message-input/index.vue';
import MultipleSelectPanel from './mulitple-select-panel/index.vue';
import Forward from './forward/index.vue';
import MessageInputToolbar from './message-input-toolbar/index.vue';
import { isPC, isWeChat, isUniFrameWork, isMobile, isApp } from '../../utils/env';
import { ToolbarDisplayType } from '../../interface';
import TUIChatConfig from './config';
} from "@tencentcloud/chat-uikit-engine";
import TUICore, { TUIConstants, ExtensionInfo } from "@tencentcloud/tui-core";
import ChatHeader from "./chat-header/index.vue";
import MessageList from "./message-list/index.vue";
import MessageInput from "./message-input/index.vue";
import MultipleSelectPanel from "./mulitple-select-panel/index.vue";
import Forward from "./forward/index.vue";
import MessageInputToolbar from "./message-input-toolbar/index.vue";
import { isPC, isWeChat, isUniFrameWork, isMobile, isApp } from "../../utils/env";
import { ToolbarDisplayType } from "../../interface";
import TUIChatConfig from "./config";
// @Start uniapp use Chat only
import { onLoad, onUnload } from '@dcloudio/uni-app';
import { initChat, logout } from './entry-chat-only.ts';
import { onLoad, onUnload } from "@dcloudio/uni-app";
import { initChat, logout } from "./entry-chat-only.ts";
import { isEnabledMessageReadReceiptGlobal } from "./utils/utils";
import OfflinePushInfoManager from "./offlinePushInfoManager/index";
import { TUIChatService } from "@tencentcloud/chat-uikit-engine";
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
let myitem = ref();
let youritem = ref();
onLoad((options) => {
initChat(options);
if (options.myitem) {
myitem.value = JSON.parse(options.myitem);
counter.$patch({ myitem:myitem.value })
youritem.value = JSON.parse(options.youritem);
counter.$patch({ youritem:youritem.value })
setTimeout(() => {
sendCustomMessage(myitem, youritem);
}, 1000);
}
});
onUnload(() => {
// Whether logout is decided by yourself when the page is unloaded. The default is false.
logout(false).then(() => {
// Handle success result from promise.then when you set true.
}).catch(() => {
// handle error
});
logout(false)
.then(() => {
// Handle success result from promise.then when you set true.
})
.catch(() => {
// handle error
});
});
// @End uniapp use Chat only
const emits = defineEmits(['closeChat']);
const emits = defineEmits(["closeChat"]);
const groupID = ref(undefined);
const isGroup = ref(false);
@@ -149,7 +171,7 @@ const isNotInGroup = ref(false);
const notInGroupReason = ref<number>();
const currentConversationID = ref();
const isMultipleSelectMode = ref(false);
const inputToolbarDisplayType = ref<ToolbarDisplayType>('none');
const inputToolbarDisplayType = ref<ToolbarDisplayType>("none");
const messageInputRef = ref();
const messageListRef = ref<InstanceType<typeof MessageList>>();
const headerExtensionList = ref<ExtensionInfo[]>([]);
@@ -167,36 +189,82 @@ onUnmounted(() => {
});
reset();
});
//发送自定义消息
let currentConversation = ref();
TUIStore.watch(StoreName.CONV, {
currentConversation: (conversation) => {
currentConversation.value = conversation;
},
});
function sendCustomMessage(myitem, youritem) {
const payload = {
data: JSON.stringify({
businessID: "pk",
title: "PK邀请",
buttonText1: "接受邀请",
buttonText2: "拒绝邀请",
}),
description: "邀请参加PK",
extension: "邀请参加PK",
};
const options = {
to:
currentConversation?.value?.groupProfile?.groupID ||
currentConversation?.value?.userProfile?.userID,
conversationType: currentConversation?.value?.type,
payload,
needReadReceipt: isEnabledMessageReadReceiptGlobal(),
};
const offlinePushInfoCreateParams = {
conversation: currentConversation.value,
payload: options.payload,
messageType: TUIChatEngine.TYPES.MSG_CUSTOM,
};
const sendMessageOptions = {
offlinePushInfo: OfflinePushInfoManager.create(offlinePushInfoCreateParams),
};
TUIChatService.sendCustomMessage(options, sendMessageOptions);
TUIChatService.getMessageList().then((res) => {
console.log("消息列表···································",res);
});
myitem.value = null;
youritem.value = null;
currentConversation.value = null;
}
//`````````````````````````````````````````````````````````````````````
const isInputToolbarShow = computed<boolean>(() => {
return isUniFrameWork ? inputToolbarDisplayType.value !== 'none' : true;
return isUniFrameWork ? inputToolbarDisplayType.value !== "none" : true;
});
const leaveGroupReasonText = computed<string>(() => {
let text = '';
let text = "";
switch (notInGroupReason.value) {
case 4:
text = TUITranslateService.t('TUIChat.您已被管理员移出群聊');
text = TUITranslateService.t("TUIChat.您已被管理员移出群聊");
break;
case 5:
text = TUITranslateService.t('TUIChat.该群聊已被解散');
text = TUITranslateService.t("TUIChat.该群聊已被解散");
break;
case 8:
text = TUITranslateService.t('TUIChat.您已退出该群聊');
text = TUITranslateService.t("TUIChat.您已退出该群聊");
break;
default:
text = TUITranslateService.t('TUIChat.您已退出该群聊');
text = TUITranslateService.t("TUIChat.您已退出该群聊");
break;
}
return text;
});
const reset = () => {
TUIConversationService.switchConversation('');
TUIConversationService.switchConversation("");
};
const closeChat = (conversationID: string) => {
emits('closeChat', conversationID);
emits("closeChat", conversationID);
reset();
};
@@ -207,13 +275,13 @@ const insertEmoji = (emojiObj: object) => {
const handleEditor = (message: IMessageModel, type: string) => {
if (!message || !type) return;
switch (type) {
case 'reference':
case "reference":
// todo
break;
case 'reply':
case "reply":
// todo
break;
case 'reedit':
case "reedit":
if (message?.payload?.text) {
messageInputRef?.value?.reEdit(message?.payload?.text);
}
@@ -227,16 +295,16 @@ const handleGroup = () => {
headerExtensionList.value[0].listener.onClicked({ groupID: groupID.value });
};
function Returnfunc(){
function Returnfunc() {
uni.navigateBack({
delta: 1
delta: 1,
});
}
function changeToolbarDisplayType(type: ToolbarDisplayType) {
inputToolbarDisplayType.value = inputToolbarDisplayType.value === type ? 'none' : type;
if (inputToolbarDisplayType.value !== 'none' && isUniFrameWork) {
uni.$emit('scroll-to-bottom');
inputToolbarDisplayType.value = inputToolbarDisplayType.value === type ? "none" : type;
if (inputToolbarDisplayType.value !== "none" && isUniFrameWork) {
uni.$emit("scroll-to-bottom");
}
}
@@ -245,7 +313,8 @@ function scrollToLatestMessage() {
}
function toggleMultipleSelectMode(visible?: boolean) {
isMultipleSelectMode.value = visible === undefined ? !isMultipleSelectMode.value : visible;
isMultipleSelectMode.value =
visible === undefined ? !isMultipleSelectMode.value : visible;
}
function mergeForwardMessage() {
@@ -289,7 +358,7 @@ function onCurrentConversationUpdate(conversation: IConversationModel) {
if (conversationID.startsWith(TUIChatEngine.TYPES.CONV_GROUP)) {
conversationType = TUIChatEngine.TYPES.CONV_GROUP;
isGroup.value = true;
groupID.value = conversationID.replace(TUIChatEngine.TYPES.CONV_GROUP, '');
groupID.value = conversationID.replace(TUIChatEngine.TYPES.CONV_GROUP, "");
}
headerExtensionList.value = [];
@@ -297,7 +366,11 @@ function onCurrentConversationUpdate(conversation: IConversationModel) {
// Initialize chatType
TUIChatConfig.setChatType(conversationType);
// While converstaion change success, notify callkit and roomkit、or other components.
TUICore.notifyEvent(TUIConstants.TUIChat.EVENT.CHAT_STATE_CHANGED, TUIConstants.TUIChat.EVENT_SUB_KEY.CHAT_OPENED, { groupID: groupID.value });
TUICore.notifyEvent(
TUIConstants.TUIChat.EVENT.CHAT_STATE_CHANGED,
TUIConstants.TUIChat.EVENT_SUB_KEY.CHAT_OPENED,
{ groupID: groupID.value }
);
// The TUICustomerServicePlugin plugin determines if the current conversation is a customer service conversation, then sets chatType and activates the conversation.
TUICore.callService({
serviceName: TUIConstants.TUICustomerServicePlugin.SERVICE.NAME,
@@ -306,23 +379,27 @@ function onCurrentConversationUpdate(conversation: IConversationModel) {
});
// When open chat in room, close main chat ui and reset theme.
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.ROOM) {
if (TUIChatConfig.getFeatureConfig(TUIConstants.TUIChat.FEATURE.InputVoice) === true) {
TUIChatConfig.setTheme('light');
currentConversationID.value = '';
if (
TUIChatConfig.getFeatureConfig(TUIConstants.TUIChat.FEATURE.InputVoice) === true
) {
TUIChatConfig.setTheme("light");
currentConversationID.value = "";
return;
}
}
// Get chat header extensions
if (TUIChatConfig.getChatType() === TUIConstants.TUIChat.TYPE.GROUP) {
headerExtensionList.value = TUICore.getExtensionList(TUIConstants.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID);
headerExtensionList.value = TUICore.getExtensionList(
TUIConstants.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID
);
}
TUIStore.update(StoreName.CUSTOM, 'activeConversation', conversationID);
TUIStore.update(StoreName.CUSTOM, "activeConversation", conversationID);
currentConversationID.value = conversationID;
}
</script>
<style scoped lang="scss" src="./style/index.scss"></style>
<style>
.dingweizhibox{
.dingweizhibox {
width: 100%;
height: 15%;
}
@@ -336,7 +413,6 @@ function onCurrentConversationUpdate(conversation: IConversationModel) {
display: flex;
justify-content: center;
align-items: center;
}
.Navigationimg {
width: 100%;
@@ -363,4 +439,3 @@ function onCurrentConversationUpdate(conversation: IConversationModel) {
z-index: 999;
}
</style>

View File

@@ -105,14 +105,19 @@ import star from '../../../../assets/icon/star-light.png';
import TUIChatEngine, {
TUIStore,
StoreName,
} from "@tencentcloud/chat-uikit-engine";
TUIChatService,
} from '@tencentcloud/chat-uikit-engine';
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
interface Props {
messageItem: IMessageModel;
content: any;
}
//```````````````````````````````````````````````````
const currentConversation = ref('123');
// TUIChatService.getMessageList().then(() => {
// });
//```````````````````````````````````````````````````
const props = withDefaults(defineProps<Props>(), {
messageItem: undefined,

View File

@@ -1,7 +1,7 @@
export default function request(urldata) {
const { url, data, method, header, userInfo } = urldata;
const baseUrl =
"http://192.168.0.218:8086/"
"http://192.168.1.218:8086/"
+ url;
if (userInfo) {
return new Promise((resolve, reject) => {

26
main.js
View File

@@ -1,22 +1,12 @@
import App from './App'
import { createSSRApp } from 'vue';
import * as Pinia from 'pinia';
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
const app = createSSRApp(App);
app.use(Pinia.createPinia());
return {
app,
Pinia, // 此处必须将 Pinia 返回
};
}
// #endif

View File

@@ -70,14 +70,16 @@
<NewAddedPk class="createModule" ref="createModule"></NewAddedPk>
</template>
<script lang="ts">
<script>
import formatDate from "../../components/formatDate.js";
import TimeFormatting from "../../components/TimeFormatting.js";
// import VerifyLogin from "../../components/VerifyLogin.js";
import NewAddedPk from "../../pages/NewAddedPk/NewAddedPk.vue";
import request from "../../components/request.js";
import { isEnabledMessageReadReceiptGlobal } from "../../TUIKit/components/TUIChat/utils/utils.js";
import OfflinePushInfoManager from "../../TUIKit/components/TUIChat/offlinePushInfoManager/index.js";
// // import { isEnabledMessageReadReceiptGlobal } from "../../TUIKit/components/TUIChat/utils/utils.js";
// const isEnabledMessageReadReceiptGlobal = require('../../TUIKit/components/TUIChat/utils/utils.js');
// // import OfflinePushInfoManager from "../../TUIKit/components/TUIChat/offlinePushInfoManager/index.js";
// const OfflinePushInfoManager = require('../../TUIKit/components/TUIChat/offlinePushInfoManager/index.js');
import TUIChatEngine, {
TUIStore,
StoreName,
@@ -142,46 +144,21 @@ export default {
this.userlist();
},
invite() {
if (this.item.pkTime !== this.list[this.InvitingPartyEventindex].pkTime) {
uni.showToast({
icon: "none",
title: "请保持时间一致",
});
return;
}
// if (this.item.pkTime !== this.list[this.InvitingPartyEventindex].pkTime) {
// uni.showToast({
// icon: "none",
// title: "请保持时间一致",
// });
// return;
// }
// 发送邀请消息
const payload = {
data: JSON.stringify({
businessID: "pk",
title: "PK邀请",
buttonText1: "接受邀请",
buttonText2: "拒绝邀请",
}),
description: "邀请参加PK",
extension: "邀请参加PK",
};
TUIStore.watch(StoreName.CONV, {
currentConversation: (conversation) => {
this.currentConversation = conversation;
},
const conversationID = `C2C${this.item.senderId}`;
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
const youritem = JSON.stringify(this.item);
uni.redirectTo({
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}&myitem=${myitem}&youritem=${youritem}`,
});
const options = {
to: `C2C${this.list[this.InvitingPartyEventindex].senderId}`,
conversationType: this.currentConversation?.value?.type,
payload,
needReadReceipt:isEnabledMessageReadReceiptGlobal(),
};
const offlinePushInfoCreateParams = {
conversation: this.currentConversation,
payload: options.payload,
messageType: TUIChatEngine.TYPES.MSG_CUSTOM,
};
const sendMessageOptions = {
offlinePushInfo: OfflinePushInfoManager.create(offlinePushInfoCreateParams),
};
TUIChatService.sendCustomMessage(options, sendMessageOptions);
/////////
},
close() {

17
stores/counter.js Normal file
View File

@@ -0,0 +1,17 @@
import { defineStore } from 'pinia';
export const useCounterStore = defineStore('counter', {
state: () => {
return {
myitem:{},
youritem:{},
};
},
// 也可以这样定义
// state: () => ({ count: 0 })
actions: {
increment() {
this.count++;
},
},
});

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script lang=\"ts\">\r\n\r\n\r\n\r\n\r\n\r\n\r\n// Required information\r\n// You can get userSig from TencentCloud chat console for Testing TUIKit.\r\n// Deploy production environment please get it from your server.\r\n// View https://cloud.tencent.com/document/product/269/32688\r\n\r\nexport default {\r\n data() {\r\n return {\r\n info: {},\r\n userSig: \"\",\r\n chatInfo: {},\r\n };\r\n },\r\n onLoad(option) {\r\n },\r\n provide() {\r\n return {\r\n $global: {\r\n lastPage: null,\r\n },\r\n };\r\n },\r\n};\r\n</script>\r\n<style>\r\n/* common css for page */\r\nuni-page-body,\r\nhtml,\r\nbody,\r\npage {\r\n width: 100% !important;\r\n height: 100% !important;\r\n overflow: hidden;\r\n}\r\n</style>\r\n","import App from './App'\r\n\r\n// #ifndef VUE3\r\nimport Vue from 'vue'\r\nimport './uni.promisify.adaptor'\r\nVue.config.productionTip = false\r\nApp.mpType = 'app'\r\nconst app = new Vue({\r\n ...App\r\n})\r\napp.$mount()\r\n// #endif\r\n\r\n// #ifdef VUE3\r\nimport { createSSRApp } from 'vue'\r\nexport function createApp() {\r\n const app = createSSRApp(App)\r\n return {\r\n app\r\n }\r\n}\r\n// #endif"],"names":["createSSRApp","App"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,MAAe,YAAA;AAAA,EACb,OAAO;AACE,WAAA;AAAA,MACL,MAAM,CAAC;AAAA,MACP,SAAS;AAAA,MACT,UAAU,CAAC;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,OAAO,QAAQ;AAAA,EACf;AAAA,EACA,UAAU;AACD,WAAA;AAAA,MACL,SAAS;AAAA,QACP,UAAU;AAAA,MACZ;AAAA,IAAA;AAAA,EAEJ;AACF;ACdO,SAAS,YAAY;AAC1B,QAAM,MAAMA,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script lang=\"ts\">\r\n\r\n\r\n\r\n\r\n\r\n\r\n// Required information\r\n// You can get userSig from TencentCloud chat console for Testing TUIKit.\r\n// Deploy production environment please get it from your server.\r\n// View https://cloud.tencent.com/document/product/269/32688\r\n\r\nexport default {\r\n data() {\r\n return {\r\n info: {},\r\n userSig: \"\",\r\n chatInfo: {},\r\n };\r\n },\r\n onLoad(option) {\r\n },\r\n provide() {\r\n return {\r\n $global: {\r\n lastPage: null,\r\n },\r\n };\r\n },\r\n};\r\n</script>\r\n<style>\r\n/* common css for page */\r\nuni-page-body,\r\nhtml,\r\nbody,\r\npage {\r\n width: 100% !important;\r\n height: 100% !important;\r\n overflow: hidden;\r\n}\r\n</style>\r\n","import App from './App'\r\nimport { createSSRApp } from 'vue';\r\nimport * as Pinia from 'pinia';\r\n\r\nexport function createApp() {\r\n\tconst app = createSSRApp(App);\r\n\tapp.use(Pinia.createPinia());\r\n\treturn {\r\n\t\tapp,\r\n\t\tPinia, // 此处必须将 Pinia 返回\r\n\t};\r\n}"],"names":["createSSRApp","App","Pinia.createPinia","Pinia"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,MAAe,YAAA;AAAA,EACb,OAAO;AACE,WAAA;AAAA,MACL,MAAM,CAAC;AAAA,MACP,SAAS;AAAA,MACT,UAAU,CAAC;AAAA,IAAA;AAAA,EAEf;AAAA,EACA,OAAO,QAAQ;AAAA,EACf;AAAA,EACA,UAAU;AACD,WAAA;AAAA,MACL,SAAS;AAAA,QACP,UAAU;AAAA,MACZ;AAAA,IAAA;AAAA,EAEJ;AACF;ACzBO,SAAS,YAAY;AAC3B,QAAM,MAAMA,2BAAaC,SAAG;AAC5B,MAAI,IAAIC,cAAiB,YAAA,CAAE;AAC3B,SAAO;AAAA,IACN;AAAA,IACF,OAAEC,cAAK;AAAA;AAAA,EACP;AACA;AACA,YAAY,IAAI,MAAM,MAAM;;"}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"request.js","sources":["components/request.js"],"sourcesContent":["export default function request(urldata) {\r\n const { url, data, method, header, userInfo } = urldata;\r\n const baseUrl =\r\n \"http://192.168.0.218:8086/\"\r\n + url;\r\n if (userInfo) {\r\n return new Promise((resolve, reject) => {\r\n uni.getStorage({\r\n key: \"userinfo\",\r\n success: (res) => {\r\n if (res.data) {\r\n if (res.data.nickName) {\r\n uni.request({\r\n url: baseUrl,\r\n data: data,\r\n method: method,\r\n header: header,\r\n success: function (res) {\r\n console.log(\"请求成功1\", res.data);\r\n resolve(res.data);\r\n },\r\n fail: function (res) {\r\n reject(res);\r\n }\r\n });\r\n } else {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.reLaunch({ url: \"/pages/UserInformation/UserInformation\" })\r\n }\r\n } else {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.navigateTo({ url: '/pages/login/login' })\r\n }\r\n },\r\n fail: function (res) {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.navigateTo({ url: '/pages/login/login' })\r\n reject(res);\r\n }\r\n });\r\n });\r\n } else {\r\n return new Promise((resolve, reject) => {\r\n uni.request({\r\n url: baseUrl,\r\n data: data,\r\n method: method,\r\n header: header,\r\n success: function (res) {\r\n console.log(\"请求成功2\", res);\r\n resolve(res.data);\r\n },\r\n fail: function (res) {\r\n reject(res);\r\n }\r\n });\r\n });\r\n }\r\n\r\n}"],"names":["uni","res"],"mappings":";;AAAe,SAAS,QAAQ,SAAS;AACrC,QAAM,EAAE,KAAK,MAAM,QAAQ,QAAQ,SAAU,IAAG;AAChD,QAAM,UACF,+BACE;AACN,MAAI,UAAU;AACV,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACpCA,oBAAAA,MAAI,WAAW;AAAA,QACX,KAAK;AAAA,QACL,SAAS,CAAC,QAAQ;AACd,cAAI,IAAI,MAAM;AACV,gBAAI,IAAI,KAAK,UAAU;AACnBA,4BAAAA,MAAI,QAAQ;AAAA,gBACR,KAAK;AAAA,gBACL;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,SAAS,SAAUC,MAAK;AACpBD,gCAAA,MAAA,MAAA,OAAA,+BAAY,SAASC,KAAI,IAAI;AAC7B,0BAAQA,KAAI,IAAI;AAAA,gBACnB;AAAA,gBACD,MAAM,SAAUA,MAAK;AACjB,yBAAOA,IAAG;AAAA,gBACb;AAAA,cACjC,CAA6B;AAAA,YAC7B,OAA+B;AACHD,kCAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,4BAAAA,MAAI,SAAS,EAAE,KAAK,yCAAwC,CAAE;AAAA,YACjE;AAAA,UACzB,OAA2B;AACHA,gCAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,0BAAAA,MAAI,WAAW,EAAE,KAAK,qBAAoB,CAAE;AAAA,UAC/C;AAAA,QACJ;AAAA,QACD,MAAM,SAAU,KAAK;AACjBA,8BAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,wBAAAA,MAAI,WAAW,EAAE,KAAK,qBAAoB,CAAE;AAC5C,iBAAO,GAAG;AAAA,QACb;AAAA,MACjB,CAAa;AAAA,IACb,CAAS;AAAA,EACT,OAAW;AACH,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACpCA,oBAAAA,MAAI,QAAQ;AAAA,QACR,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,SAAU,KAAK;AACpBA,wBAAY,MAAA,MAAA,OAAA,+BAAA,SAAS,GAAG;AACxB,kBAAQ,IAAI,IAAI;AAAA,QACnB;AAAA,QACD,MAAM,SAAU,KAAK;AACjB,iBAAO,GAAG;AAAA,QACb;AAAA,MACjB,CAAa;AAAA,IACb,CAAS;AAAA,EACJ;AAEL;;"}
{"version":3,"file":"request.js","sources":["components/request.js"],"sourcesContent":["export default function request(urldata) {\r\n const { url, data, method, header, userInfo } = urldata;\r\n const baseUrl =\r\n \"http://192.168.1.218:8086/\"\r\n + url;\r\n if (userInfo) {\r\n return new Promise((resolve, reject) => {\r\n uni.getStorage({\r\n key: \"userinfo\",\r\n success: (res) => {\r\n if (res.data) {\r\n if (res.data.nickName) {\r\n uni.request({\r\n url: baseUrl,\r\n data: data,\r\n method: method,\r\n header: header,\r\n success: function (res) {\r\n console.log(\"请求成功1\", res.data);\r\n resolve(res.data);\r\n },\r\n fail: function (res) {\r\n reject(res);\r\n }\r\n });\r\n } else {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.reLaunch({ url: \"/pages/UserInformation/UserInformation\" })\r\n }\r\n } else {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.navigateTo({ url: '/pages/login/login' })\r\n }\r\n },\r\n fail: function (res) {\r\n uni.setStorageSync(\"lastPage\", getCurrentPages()[getCurrentPages().length - 1].route);\r\n uni.navigateTo({ url: '/pages/login/login' })\r\n reject(res);\r\n }\r\n });\r\n });\r\n } else {\r\n return new Promise((resolve, reject) => {\r\n uni.request({\r\n url: baseUrl,\r\n data: data,\r\n method: method,\r\n header: header,\r\n success: function (res) {\r\n console.log(\"请求成功2\", res);\r\n resolve(res.data);\r\n },\r\n fail: function (res) {\r\n reject(res);\r\n }\r\n });\r\n });\r\n }\r\n\r\n}"],"names":["uni","res"],"mappings":";;AAAe,SAAS,QAAQ,SAAS;AACrC,QAAM,EAAE,KAAK,MAAM,QAAQ,QAAQ,SAAU,IAAG;AAChD,QAAM,UACF,+BACE;AACN,MAAI,UAAU;AACV,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACpCA,oBAAAA,MAAI,WAAW;AAAA,QACX,KAAK;AAAA,QACL,SAAS,CAAC,QAAQ;AACd,cAAI,IAAI,MAAM;AACV,gBAAI,IAAI,KAAK,UAAU;AACnBA,4BAAAA,MAAI,QAAQ;AAAA,gBACR,KAAK;AAAA,gBACL;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,SAAS,SAAUC,MAAK;AACpBD,gCAAA,MAAA,MAAA,OAAA,+BAAY,SAASC,KAAI,IAAI;AAC7B,0BAAQA,KAAI,IAAI;AAAA,gBACnB;AAAA,gBACD,MAAM,SAAUA,MAAK;AACjB,yBAAOA,IAAG;AAAA,gBACb;AAAA,cACjC,CAA6B;AAAA,YAC7B,OAA+B;AACHD,kCAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,4BAAAA,MAAI,SAAS,EAAE,KAAK,yCAAwC,CAAE;AAAA,YACjE;AAAA,UACzB,OAA2B;AACHA,gCAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,0BAAAA,MAAI,WAAW,EAAE,KAAK,qBAAoB,CAAE;AAAA,UAC/C;AAAA,QACJ;AAAA,QACD,MAAM,SAAU,KAAK;AACjBA,8BAAI,eAAe,YAAY,gBAAiB,EAAC,gBAAiB,EAAC,SAAS,CAAC,EAAE,KAAK;AACpFA,wBAAAA,MAAI,WAAW,EAAE,KAAK,qBAAoB,CAAE;AAC5C,iBAAO,GAAG;AAAA,QACb;AAAA,MACjB,CAAa;AAAA,IACb,CAAS;AAAA,EACT,OAAW;AACH,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACpCA,oBAAAA,MAAI,QAAQ;AAAA,QACR,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,SAAU,KAAK;AACpBA,wBAAY,MAAA,MAAA,OAAA,+BAAA,SAAS,GAAG;AACxB,kBAAQ,IAAI,IAAI;AAAA,QACnB;AAAA,QACD,MAAM,SAAU,KAAK;AACjB,iBAAO,GAAG;AAAA,QACb;AAAA,MACjB,CAAa;AAAA,IACb,CAAS;AAAA,EACJ;AAEL;;"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"counter.js","sources":["stores/counter.js"],"sourcesContent":["import { defineStore } from 'pinia';\r\n\r\nexport const useCounterStore = defineStore('counter', {\r\n\tstate: () => {\r\n\t\treturn { \r\n myitem:{},\r\n youritem:{},\r\n };\r\n\t},\r\n\t// 也可以这样定义\r\n\t// state: () => ({ count: 0 })\r\n\tactions: {\r\n\t\tincrement() {\r\n\t\t\tthis.count++;\r\n\t\t},\r\n\t},\r\n});"],"names":["defineStore"],"mappings":";;AAEY,MAAC,kBAAkBA,cAAW,YAAC,WAAW;AAAA,EACrD,OAAO,MAAM;AACZ,WAAO;AAAA,MACG,QAAO,CAAE;AAAA,MACT,UAAS,CAAE;AAAA,IACvB;AAAA,EACE;AAAA;AAAA;AAAA,EAGD,SAAS;AAAA,IACR,YAAY;AACX,WAAK;AAAA,IACL;AAAA,EACD;AACF,CAAC;;"}

View File

@@ -645,7 +645,7 @@ input.data-v-04dfedea:focus, input.data-v-04dfedea:active, textarea.data-v-04dfe
min-width: 0;
}
.dingweizhibox{
.dingweizhibox {
width: 100%;
height: 15%;
}

View File

@@ -4,6 +4,7 @@ require("../../../../adapter-vue.js");
const TUIKit_utils_typeCheck = require("../../../../utils/type-check.js");
const TUIKit_constant = require("../../../../constant.js");
const common_assets = require("../../../../../common/assets.js");
const stores_counter = require("../../../../../stores/counter.js");
if (!Math) {
Icon();
}
@@ -15,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
content: { default: void 0 }
},
setup(__props) {
common_vendor.ref("123");
stores_counter.useCounterStore();
const props = __props;
const custom = common_vendor.ref();
const message = common_vendor.ref();

View File

@@ -168,7 +168,7 @@ input.data-v-04dfedea:focus, input.data-v-04dfedea:active, textarea.data-v-04dfe
min-width: 0;
}
.dingweizhibox{
.dingweizhibox {
width: 100%;
height: 15%;
}

View File

@@ -5,6 +5,9 @@ require("../adapter-vue.js");
const TUIKit_utils_env = require("../utils/env.js");
const TUIKit_components_TUIChat_config = require("./TUIChat/config.js");
const TUIKit_components_TUIChat_entryChatOnly = require("./TUIChat/entry-chat-only.js");
const TUIKit_components_TUIChat_utils_utils = require("./TUIChat/utils/utils.js");
const TUIKit_components_TUIChat_offlinePushInfoManager_index = require("./TUIChat/offlinePushInfoManager/index.js");
const stores_counter = require("../../stores/counter.js");
const TUIKit_components_TUIChat_server = require("./TUIChat/server.js");
const TUIKit_components_TUIConversation_server = require("./TUIConversation/server.js");
const TUIKit_components_TUISearch_searchTypeList = require("./TUISearch/search-type-list.js");
@@ -26,8 +29,20 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
emits: ["closeChat"],
setup(__props, { emit: __emit }) {
const counter = stores_counter.useCounterStore();
let myitem = common_vendor.ref();
let youritem = common_vendor.ref();
common_vendor.onLoad((options) => {
TUIKit_components_TUIChat_entryChatOnly.initChat(options);
if (options.myitem) {
myitem.value = JSON.parse(options.myitem);
counter.$patch({ myitem: myitem.value });
youritem.value = JSON.parse(options.youritem);
counter.$patch({ youritem: youritem.value });
setTimeout(() => {
sendCustomMessage(myitem, youritem);
}, 1e3);
}
});
common_vendor.onUnload(() => {
TUIKit_components_TUIChat_entryChatOnly.logout(false).then(() => {
@@ -57,6 +72,46 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
});
reset();
});
let currentConversation = common_vendor.ref();
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: (conversation) => {
currentConversation.value = conversation;
}
});
function sendCustomMessage(myitem2, youritem2) {
var _a, _b, _c, _d, _e;
const payload = {
data: JSON.stringify({
businessID: "pk",
title: "PK邀请",
buttonText1: "接受邀请",
buttonText2: "拒绝邀请"
}),
description: "邀请参加PK",
extension: "邀请参加PK"
};
const options = {
to: ((_b = (_a = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _a.groupProfile) == null ? void 0 : _b.groupID) || ((_d = (_c = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _c.userProfile) == null ? void 0 : _d.userID),
conversationType: (_e = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _e.type,
payload,
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
};
const offlinePushInfoCreateParams = {
conversation: currentConversation.value,
payload: options.payload,
messageType: common_vendor.qt.TYPES.MSG_CUSTOM
};
const sendMessageOptions = {
offlinePushInfo: TUIKit_components_TUIChat_offlinePushInfoManager_index.OfflinePushInfoManager.create(offlinePushInfoCreateParams)
};
common_vendor.Qt.sendCustomMessage(options, sendMessageOptions);
common_vendor.Qt.getMessageList().then((res) => {
common_vendor.index.__f__("log", "at TUIKit/components/TUIChat/index.vue:232", "消息列表···································", res);
});
myitem2.value = null;
youritem2.value = null;
currentConversation.value = null;
}
const isInputToolbarShow = common_vendor.computed(() => {
return TUIKit_utils_env.isUniFrameWork ? inputToolbarDisplayType.value !== "none" : true;
});
@@ -163,7 +218,11 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
headerExtensionList.value = [];
isMultipleSelectMode.value = false;
TUIKit_components_TUIChat_config.ChatConfig.setChatType(conversationType);
common_vendor.R.notifyEvent(common_vendor.E.TUIChat.EVENT.CHAT_STATE_CHANGED, common_vendor.E.TUIChat.EVENT_SUB_KEY.CHAT_OPENED, { groupID: groupID.value });
common_vendor.R.notifyEvent(
common_vendor.E.TUIChat.EVENT.CHAT_STATE_CHANGED,
common_vendor.E.TUIChat.EVENT_SUB_KEY.CHAT_OPENED,
{ groupID: groupID.value }
);
common_vendor.R.callService({
serviceName: common_vendor.E.TUICustomerServicePlugin.SERVICE.NAME,
method: common_vendor.E.TUICustomerServicePlugin.SERVICE.METHOD.ACTIVE_CONVERSATION,
@@ -177,7 +236,9 @@ const _sfc_main$4 = /* @__PURE__ */ common_vendor.defineComponent({
}
}
if (TUIKit_components_TUIChat_config.ChatConfig.getChatType() === common_vendor.E.TUIChat.TYPE.GROUP) {
headerExtensionList.value = common_vendor.R.getExtensionList(common_vendor.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID);
headerExtensionList.value = common_vendor.R.getExtensionList(
common_vendor.E.TUIChat.EXTENSION.CHAT_HEADER.EXT_ID
);
}
common_vendor.Jt.update(common_vendor.o.CUSTOM, "activeConversation", conversationID);
currentConversationID.value = conversationID;

View File

@@ -39,8 +39,11 @@ const _sfc_main = {
};
function createApp() {
const app = common_vendor.createSSRApp(_sfc_main);
app.use(common_vendor.createPinia());
return {
app
app,
Pinia: common_vendor.Pinia
// 此处必须将 Pinia 返回
};
}
createApp().app.mount("#app");

View File

@@ -40,7 +40,7 @@ const toTypeString$1 = (value) => objectToString$1.call(value);
const toRawType = (value) => {
return toTypeString$1(value).slice(8, -1);
};
const isPlainObject$1 = (val2) => toTypeString$1(val2) === "[object Object]";
const isPlainObject$2 = (val2) => toTypeString$1(val2) === "[object Object]";
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
const isReservedProp = /* @__PURE__ */ makeMap(
// the leading comma is intentional so empty string "" is also included
@@ -176,7 +176,7 @@ const replacer = (_key, val2) => {
};
} else if (isSymbol(val2)) {
return stringifySymbol(val2);
} else if (isObject$2(val2) && !isArray$1(val2) && !isPlainObject$1(val2)) {
} else if (isObject$2(val2) && !isArray$1(val2) && !isPlainObject$2(val2)) {
return String(val2);
}
return val2;
@@ -544,7 +544,7 @@ function getValueByDataPath(obj, path) {
}
function sortObject(obj) {
let sortObj = {};
if (isPlainObject$1(obj)) {
if (isPlainObject$2(obj)) {
Object.keys(obj).sort().forEach((key) => {
const _key = key;
sortObj[_key] = obj[_key];
@@ -565,7 +565,7 @@ function stringifyQuery(obj, encodeStr = encode) {
let val2 = obj[key];
if (typeof val2 === void 0 || val2 === null) {
val2 = "";
} else if (isPlainObject$1(val2)) {
} else if (isPlainObject$2(val2)) {
val2 = JSON.stringify(val2);
}
return encodeStr(key) + "=" + encodeStr(val2);
@@ -2839,7 +2839,7 @@ function traverse$1(value, depth, currentDepth = 0, seen) {
value.forEach((v3) => {
traverse$1(v3, depth, currentDepth, seen);
});
} else if (isPlainObject$1(value)) {
} else if (isPlainObject$2(value)) {
for (const key in value) {
traverse$1(value[key], depth, currentDepth, seen);
}
@@ -5621,7 +5621,7 @@ function initHooks$1(options, instance, publicThis) {
function applyOptions$2(options, instance, publicThis) {
initHooks$1(options, instance, publicThis);
}
function set$2(target, key, val2) {
function set$3(target, key, val2) {
return target[key] = val2;
}
function $callMethod(method, ...args) {
@@ -5733,7 +5733,7 @@ function initApp(app) {
uniIdMixin(globalProperties);
}
{
globalProperties.$set = set$2;
globalProperties.$set = set$3;
globalProperties.$applyOptions = applyOptions$2;
globalProperties.$callMethod = $callMethod;
}
@@ -5877,10 +5877,10 @@ function patchMPEvent(event, instance) {
event.detail = typeof event.detail === "object" ? event.detail : {};
event.detail.markerId = event.markerId;
}
if (isPlainObject$1(event.detail) && hasOwn$2(event.detail, "checked") && !hasOwn$2(event.detail, "value")) {
if (isPlainObject$2(event.detail) && hasOwn$2(event.detail, "checked") && !hasOwn$2(event.detail, "value")) {
event.detail.value = event.detail.checked;
}
if (isPlainObject$1(event.detail)) {
if (isPlainObject$2(event.detail)) {
event.target = extend({}, event.target, event.detail);
}
}
@@ -6239,7 +6239,7 @@ function validateProtocols(name, args, protocol2, onFail) {
}
}
function validateProp(name, value, prop, isAbsent) {
if (!isPlainObject$1(prop)) {
if (!isPlainObject$2(prop)) {
prop = { type: prop };
}
const { type, required, validator } = prop;
@@ -6377,7 +6377,7 @@ function normalizeErrMsg(errMsg, name) {
return name + errMsg.substring(errMsg.indexOf(":fail"));
}
function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
if (!isPlainObject$1(args)) {
if (!isPlainObject$2(args)) {
args = {};
}
const { success, fail, complete } = getApiCallbacks(args);
@@ -6499,7 +6499,7 @@ function invokeApi(method, api, options, params) {
return api(options, ...params);
}
function hasCallback(args) {
if (isPlainObject$1(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction$1(args[cb]))) {
if (isPlainObject$2(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction$1(args[cb]))) {
return true;
}
return false;
@@ -6696,20 +6696,20 @@ function dedupeHooks(hooks) {
return res;
}
const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
if (isString(method) && isPlainObject$1(interceptor)) {
if (isString(method) && isPlainObject$2(interceptor)) {
mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
} else if (isPlainObject$1(method)) {
} else if (isPlainObject$2(method)) {
mergeInterceptorHook(globalInterceptors, method);
}
}, AddInterceptorProtocol);
const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
if (isString(method)) {
if (isPlainObject$1(interceptor)) {
if (isPlainObject$2(interceptor)) {
removeInterceptorHook(scopedInterceptors[method], interceptor);
} else {
delete scopedInterceptors[method];
}
} else if (isPlainObject$1(method)) {
} else if (isPlainObject$2(method)) {
removeInterceptorHook(globalInterceptors, method);
}
}, RemoveInterceptorProtocol);
@@ -6928,7 +6928,7 @@ function initWrapper(protocols2) {
};
}
function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
if (isPlainObject$1(fromArgs)) {
if (isPlainObject$2(fromArgs)) {
const toArgs = keepFromArgs === true ? fromArgs : {};
if (isFunction$1(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
@@ -6943,7 +6943,7 @@ function initWrapper(protocols2) {
console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
} else if (isString(keyOption)) {
toArgs[keyOption] = fromArgs[key];
} else if (isPlainObject$1(keyOption)) {
} else if (isPlainObject$2(keyOption)) {
toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
}
} else if (CALLBACKS.indexOf(key) !== -1) {
@@ -8010,9 +8010,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "192.168.0.111,127.0.0.1";
const hosts = "192.168.1.112,127.0.0.1";
const port = "8090";
const id = "mp-weixin_rq7Z_G";
const id = "mp-weixin_Ue15K2";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();
@@ -8576,10 +8576,10 @@ function initPageProps({ properties }, rawProps) {
value: ""
};
});
} else if (isPlainObject$1(rawProps)) {
} else if (isPlainObject$2(rawProps)) {
Object.keys(rawProps).forEach((key) => {
const opts = rawProps[key];
if (isPlainObject$1(opts)) {
if (isPlainObject$2(opts)) {
let value = opts.default;
if (isFunction$1(value)) {
value = value();
@@ -8603,7 +8603,7 @@ function findPropsData(properties, isPage2) {
}
function findPagePropsData(properties) {
const propsData = {};
if (isPlainObject$1(properties)) {
if (isPlainObject$2(properties)) {
Object.keys(properties).forEach((name) => {
if (builtInProps.indexOf(name) === -1) {
propsData[name] = resolvePropValue(properties[name]);
@@ -8958,6 +8958,774 @@ const createSubpackageApp = initCreateSubpackageApp();
wx.createPluginApp = global.createPluginApp = createPluginApp;
wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
}
var isVue2 = false;
function set$2(target, key, val2) {
if (Array.isArray(target)) {
target.length = Math.max(target.length, key);
target.splice(key, 1, val2);
return val2;
}
target[key] = val2;
return val2;
}
function del$1(target, key) {
if (Array.isArray(target)) {
target.splice(key, 1);
return;
}
delete target[key];
}
/*!
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
let activePinia;
const setActivePinia = (pinia) => activePinia = pinia;
const getActivePinia = () => hasInjectionContext() && inject$1(piniaSymbol) || activePinia;
const piniaSymbol = Symbol("pinia");
function isPlainObject$1(o2) {
return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function";
}
var MutationType;
(function(MutationType2) {
MutationType2["direct"] = "direct";
MutationType2["patchObject"] = "patch object";
MutationType2["patchFunction"] = "patch function";
})(MutationType || (MutationType = {}));
const IS_CLIENT = typeof window !== "undefined";
const USE_DEVTOOLS = IS_CLIENT;
const componentStateTypes = [];
const getStoreType = (id) => "🍍 " + id;
function registerPiniaDevtools(app, pinia) {
}
function addStoreToDevtools(app, store) {
if (!componentStateTypes.includes(getStoreType(store.$id))) {
componentStateTypes.push(getStoreType(store.$id));
}
}
function patchActionForGrouping(store, actionNames, wrapWithProxy) {
const actions = actionNames.reduce((storeActions, actionName) => {
storeActions[actionName] = toRaw$1(store)[actionName];
return storeActions;
}, {});
for (const actionName in actions) {
store[actionName] = function() {
const trackedStore = wrapWithProxy ? new Proxy(store, {
get(...args) {
return Reflect.get(...args);
},
set(...args) {
return Reflect.set(...args);
}
}) : store;
const retValue = actions[actionName].apply(trackedStore, arguments);
return retValue;
};
}
}
function devtoolsPlugin({ app, store, options }) {
if (store.$id.startsWith("__hot:")) {
return;
}
store._isOptionsAPI = !!options.state;
patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);
const originalHotUpdate = store._hotUpdate;
toRaw$1(store)._hotUpdate = function(newStore) {
originalHotUpdate.apply(this, arguments);
patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);
};
addStoreToDevtools(
app,
// FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
store
);
}
function createPinia() {
const scope = effectScope$1(true);
const state = scope.run(() => ref$1({}));
let _p = [];
let toBeInstalled = [];
const pinia = markRaw$1({
install(app) {
setActivePinia(pinia);
{
pinia._a = app;
app.provide(piniaSymbol, pinia);
app.config.globalProperties.$pinia = pinia;
toBeInstalled.forEach((plugin2) => _p.push(plugin2));
toBeInstalled = [];
}
},
use(plugin2) {
if (!this._a && !isVue2) {
toBeInstalled.push(plugin2);
} else {
_p.push(plugin2);
}
return this;
},
_p,
// it's actually undefined here
// @ts-expect-error
_a: null,
_e: scope,
_s: /* @__PURE__ */ new Map(),
state
});
if (USE_DEVTOOLS && typeof Proxy !== "undefined") {
pinia.use(devtoolsPlugin);
}
return pinia;
}
const isUseStore = (fn) => {
return typeof fn === "function" && typeof fn.$id === "string";
};
function patchObject(newState, oldState) {
for (const key in oldState) {
const subPatch = oldState[key];
if (!(key in newState)) {
continue;
}
const targetValue = newState[key];
if (isPlainObject$1(targetValue) && isPlainObject$1(subPatch) && !isRef$1(subPatch) && !isReactive$1(subPatch)) {
newState[key] = patchObject(targetValue, subPatch);
} else {
{
newState[key] = subPatch;
}
}
}
return newState;
}
function acceptHMRUpdate(initialUseStore, hot) {
return (newModule) => {
const pinia = hot.data.pinia || initialUseStore._pinia;
if (!pinia) {
return;
}
hot.data.pinia = pinia;
for (const exportName in newModule) {
const useStore = newModule[exportName];
if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {
const id = useStore.$id;
if (id !== initialUseStore.$id) {
console.warn(`The id of the store changed from "${initialUseStore.$id}" to "${id}". Reloading.`);
return hot.invalidate();
}
const existingStore = pinia._s.get(id);
if (!existingStore) {
console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);
return;
}
useStore(pinia, existingStore);
}
}
};
}
const noop = () => {
};
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
subscriptions.push(callback);
const removeSubscription = () => {
const idx = subscriptions.indexOf(callback);
if (idx > -1) {
subscriptions.splice(idx, 1);
onCleanup();
}
};
if (!detached && getCurrentScope$1()) {
onScopeDispose$1(removeSubscription);
}
return removeSubscription;
}
function triggerSubscriptions(subscriptions, ...args) {
subscriptions.slice().forEach((callback) => {
callback(...args);
});
}
const fallbackRunWithContext = (fn) => fn();
function mergeReactiveObjects(target, patchToApply) {
if (target instanceof Map && patchToApply instanceof Map) {
patchToApply.forEach((value, key) => target.set(key, value));
}
if (target instanceof Set && patchToApply instanceof Set) {
patchToApply.forEach(target.add, target);
}
for (const key in patchToApply) {
if (!patchToApply.hasOwnProperty(key))
continue;
const subPatch = patchToApply[key];
const targetValue = target[key];
if (isPlainObject$1(targetValue) && isPlainObject$1(subPatch) && target.hasOwnProperty(key) && !isRef$1(subPatch) && !isReactive$1(subPatch)) {
target[key] = mergeReactiveObjects(targetValue, subPatch);
} else {
target[key] = subPatch;
}
}
return target;
}
const skipHydrateSymbol = Symbol("pinia:skipHydration");
function skipHydrate(obj) {
return Object.defineProperty(obj, skipHydrateSymbol, {});
}
function shouldHydrate(obj) {
return !isPlainObject$1(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
}
const { assign } = Object;
function isComputed(o2) {
return !!(isRef$1(o2) && o2.effect);
}
function createOptionsStore(id, options, pinia, hot) {
const { state, actions, getters } = options;
const initialState = pinia.state.value[id];
let store;
function setup() {
if (!initialState && !hot) {
{
pinia.state.value[id] = state ? state() : {};
}
}
const localState = hot ? (
// use ref() to unwrap refs inside state TODO: check if this is still necessary
toRefs$1(ref$1(state ? state() : {}).value)
) : toRefs$1(pinia.state.value[id]);
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
if (name in localState) {
console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`);
}
computedGetters[name] = markRaw$1(computed$2(() => {
setActivePinia(pinia);
const store2 = pinia._s.get(id);
return getters[name].call(store2, store2);
}));
return computedGetters;
}, {}));
}
store = createSetupStore(id, setup, options, pinia, hot, true);
return store;
}
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
let scope;
const optionsForPlugin = assign({ actions: {} }, options);
if (!pinia._e.active) {
throw new Error("Pinia destroyed");
}
const $subscribeOptions = {
deep: true
// flush: 'post',
};
{
$subscribeOptions.onTrigger = (event) => {
if (isListening) {
debuggerEvents = event;
} else if (isListening == false && !store._hotUpdating) {
if (Array.isArray(debuggerEvents)) {
debuggerEvents.push(event);
} else {
console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.");
}
}
};
}
let isListening;
let isSyncListening;
let subscriptions = [];
let actionSubscriptions = [];
let debuggerEvents;
const initialState = pinia.state.value[$id];
if (!isOptionsStore && !initialState && !hot) {
{
pinia.state.value[$id] = {};
}
}
const hotState = ref$1({});
let activeListener;
function $patch(partialStateOrMutator) {
let subscriptionMutation;
isListening = isSyncListening = false;
{
debuggerEvents = [];
}
if (typeof partialStateOrMutator === "function") {
partialStateOrMutator(pinia.state.value[$id]);
subscriptionMutation = {
type: MutationType.patchFunction,
storeId: $id,
events: debuggerEvents
};
} else {
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
subscriptionMutation = {
type: MutationType.patchObject,
payload: partialStateOrMutator,
storeId: $id,
events: debuggerEvents
};
}
const myListenerId = activeListener = Symbol();
nextTick$1().then(() => {
if (activeListener === myListenerId) {
isListening = true;
}
});
isSyncListening = true;
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
}
const $reset = isOptionsStore ? function $reset2() {
const { state } = options;
const newState = state ? state() : {};
this.$patch(($state) => {
assign($state, newState);
});
} : (
/* istanbul ignore next */
() => {
throw new Error(`🍍: Store "${$id}" is built using the setup syntax and does not implement $reset().`);
}
);
function $dispose() {
scope.stop();
subscriptions = [];
actionSubscriptions = [];
pinia._s.delete($id);
}
function wrapAction(name, action) {
return function() {
setActivePinia(pinia);
const args = Array.from(arguments);
const afterCallbackList = [];
const onErrorCallbackList = [];
function after(callback) {
afterCallbackList.push(callback);
}
function onError2(callback) {
onErrorCallbackList.push(callback);
}
triggerSubscriptions(actionSubscriptions, {
args,
name,
store,
after,
onError: onError2
});
let ret;
try {
ret = action.apply(this && this.$id === $id ? this : store, args);
} catch (error) {
triggerSubscriptions(onErrorCallbackList, error);
throw error;
}
if (ret instanceof Promise) {
return ret.then((value) => {
triggerSubscriptions(afterCallbackList, value);
return value;
}).catch((error) => {
triggerSubscriptions(onErrorCallbackList, error);
return Promise.reject(error);
});
}
triggerSubscriptions(afterCallbackList, ret);
return ret;
};
}
const _hmrPayload = /* @__PURE__ */ markRaw$1({
actions: {},
getters: {},
state: [],
hotState
});
const partialStore = {
_p: pinia,
// _s: scope,
$id,
$onAction: addSubscription.bind(null, actionSubscriptions),
$patch,
$reset,
$subscribe(callback, options2 = {}) {
const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
const stopWatcher = scope.run(() => watch$1(() => pinia.state.value[$id], (state) => {
if (options2.flush === "sync" ? isSyncListening : isListening) {
callback({
storeId: $id,
type: MutationType.direct,
events: debuggerEvents
}, state);
}
}, assign({}, $subscribeOptions, options2)));
return removeSubscription;
},
$dispose
};
const store = reactive$1(assign(
{
_hmrPayload,
_customProperties: markRaw$1(/* @__PURE__ */ new Set())
// devtools custom properties
},
partialStore
// must be added later
// setupStore
));
pinia._s.set($id, store);
const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope$1()).run(setup)));
for (const key in setupStore) {
const prop = setupStore[key];
if (isRef$1(prop) && !isComputed(prop) || isReactive$1(prop)) {
if (hot) {
set$2(hotState.value, key, toRef$1(setupStore, key));
} else if (!isOptionsStore) {
if (initialState && shouldHydrate(prop)) {
if (isRef$1(prop)) {
prop.value = initialState[key];
} else {
mergeReactiveObjects(prop, initialState[key]);
}
}
{
pinia.state.value[$id][key] = prop;
}
}
{
_hmrPayload.state.push(key);
}
} else if (typeof prop === "function") {
const actionValue = hot ? prop : wrapAction(key, prop);
{
setupStore[key] = actionValue;
}
{
_hmrPayload.actions[key] = prop;
}
optionsForPlugin.actions[key] = prop;
} else {
if (isComputed(prop)) {
_hmrPayload.getters[key] = isOptionsStore ? (
// @ts-expect-error
options.getters[key]
) : prop;
if (IS_CLIENT) {
const getters = setupStore._getters || // @ts-expect-error: same
(setupStore._getters = markRaw$1([]));
getters.push(key);
}
}
}
}
{
assign(store, setupStore);
assign(toRaw$1(store), setupStore);
}
Object.defineProperty(store, "$state", {
get: () => hot ? hotState.value : pinia.state.value[$id],
set: (state) => {
if (hot) {
throw new Error("cannot set hotState");
}
$patch(($state) => {
assign($state, state);
});
}
});
{
store._hotUpdate = markRaw$1((newStore) => {
store._hotUpdating = true;
newStore._hmrPayload.state.forEach((stateKey) => {
if (stateKey in store.$state) {
const newStateTarget = newStore.$state[stateKey];
const oldStateSource = store.$state[stateKey];
if (typeof newStateTarget === "object" && isPlainObject$1(newStateTarget) && isPlainObject$1(oldStateSource)) {
patchObject(newStateTarget, oldStateSource);
} else {
newStore.$state[stateKey] = oldStateSource;
}
}
set$2(store, stateKey, toRef$1(newStore.$state, stateKey));
});
Object.keys(store.$state).forEach((stateKey) => {
if (!(stateKey in newStore.$state)) {
del$1(store, stateKey);
}
});
isListening = false;
isSyncListening = false;
pinia.state.value[$id] = toRef$1(newStore._hmrPayload, "hotState");
isSyncListening = true;
nextTick$1().then(() => {
isListening = true;
});
for (const actionName in newStore._hmrPayload.actions) {
const action = newStore[actionName];
set$2(store, actionName, wrapAction(actionName, action));
}
for (const getterName in newStore._hmrPayload.getters) {
const getter = newStore._hmrPayload.getters[getterName];
const getterValue = isOptionsStore ? (
// special handling of options api
computed$2(() => {
setActivePinia(pinia);
return getter.call(store, store);
})
) : getter;
set$2(store, getterName, getterValue);
}
Object.keys(store._hmrPayload.getters).forEach((key) => {
if (!(key in newStore._hmrPayload.getters)) {
del$1(store, key);
}
});
Object.keys(store._hmrPayload.actions).forEach((key) => {
if (!(key in newStore._hmrPayload.actions)) {
del$1(store, key);
}
});
store._hmrPayload = newStore._hmrPayload;
store._getters = newStore._getters;
store._hotUpdating = false;
});
}
if (USE_DEVTOOLS) {
const nonEnumerable = {
writable: true,
configurable: true,
// avoid warning on devtools trying to display this property
enumerable: false
};
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p3) => {
Object.defineProperty(store, p3, assign({ value: store[p3] }, nonEnumerable));
});
}
pinia._p.forEach((extender) => {
if (USE_DEVTOOLS) {
const extensions = scope.run(() => extender({
store,
app: pinia._a,
pinia,
options: optionsForPlugin
}));
Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));
assign(store, extensions);
} else {
assign(store, scope.run(() => extender({
store,
app: pinia._a,
pinia,
options: optionsForPlugin
})));
}
});
if (store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) {
console.warn(`[🍍]: The "state" must be a plain object. It cannot be
state: () => new MyClass()
Found in store "${store.$id}".`);
}
if (initialState && isOptionsStore && options.hydrate) {
options.hydrate(store.$state, initialState);
}
isListening = true;
isSyncListening = true;
return store;
}
function defineStore(idOrOptions, setup, setupOptions) {
let id;
let options;
const isSetupStore = typeof setup === "function";
if (typeof idOrOptions === "string") {
id = idOrOptions;
options = isSetupStore ? setupOptions : setup;
} else {
options = idOrOptions;
id = idOrOptions.id;
if (typeof id !== "string") {
throw new Error(`[🍍]: "defineStore()" must be passed a store id as its first argument.`);
}
}
function useStore(pinia, hot) {
const hasContext = hasInjectionContext();
pinia = // in test mode, ignore the argument provided as we can always retrieve a
// pinia instance with getActivePinia()
pinia || (hasContext ? inject$1(piniaSymbol, null) : null);
if (pinia)
setActivePinia(pinia);
if (!activePinia) {
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.`);
}
pinia = activePinia;
if (!pinia._s.has(id)) {
if (isSetupStore) {
createSetupStore(id, setup, options, pinia);
} else {
createOptionsStore(id, options, pinia);
}
{
useStore._pinia = pinia;
}
}
const store = pinia._s.get(id);
if (hot) {
const hotId = "__hot:" + id;
const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true);
hot._hotUpdate(newStore);
delete pinia.state.value[hotId];
pinia._s.delete(hotId);
}
if (IS_CLIENT) {
const currentInstance2 = getCurrentInstance$1();
if (currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement
!hot) {
const vm = currentInstance2.proxy;
const cache = "_pStores" in vm ? vm._pStores : vm._pStores = {};
cache[id] = store;
}
}
return store;
}
useStore.$id = id;
return useStore;
}
let mapStoreSuffix = "Store";
function setMapStoreSuffix(suffix) {
mapStoreSuffix = suffix;
}
function mapStores(...stores) {
if (Array.isArray(stores[0])) {
console.warn(`[🍍]: Directly pass all stores to "mapStores()" without putting them in an array:
Replace
mapStores([useAuthStore, useCartStore])
with
mapStores(useAuthStore, useCartStore)
This will fail in production if not fixed.`);
stores = stores[0];
}
return stores.reduce((reduced, useStore) => {
reduced[useStore.$id + mapStoreSuffix] = function() {
return useStore(this.$pinia);
};
return reduced;
}, {});
}
function mapState(useStore, keysOrMapper) {
return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
reduced[key] = function() {
return useStore(this.$pinia)[key];
};
return reduced;
}, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
reduced[key] = function() {
const store = useStore(this.$pinia);
const storeKey = keysOrMapper[key];
return typeof storeKey === "function" ? storeKey.call(this, store) : store[storeKey];
};
return reduced;
}, {});
}
const mapGetters = mapState;
function mapActions(useStore, keysOrMapper) {
return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
reduced[key] = function(...args) {
return useStore(this.$pinia)[key](...args);
};
return reduced;
}, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
reduced[key] = function(...args) {
return useStore(this.$pinia)[keysOrMapper[key]](...args);
};
return reduced;
}, {});
}
function mapWritableState(useStore, keysOrMapper) {
return Array.isArray(keysOrMapper) ? keysOrMapper.reduce((reduced, key) => {
reduced[key] = {
get() {
return useStore(this.$pinia)[key];
},
set(value) {
return useStore(this.$pinia)[key] = value;
}
};
return reduced;
}, {}) : Object.keys(keysOrMapper).reduce((reduced, key) => {
reduced[key] = {
get() {
return useStore(this.$pinia)[keysOrMapper[key]];
},
set(value) {
return useStore(this.$pinia)[keysOrMapper[key]] = value;
}
};
return reduced;
}, {});
}
function storeToRefs(store) {
{
store = toRaw$1(store);
const refs = {};
for (const key in store) {
const value = store[key];
if (isRef$1(value) || isReactive$1(value)) {
refs[key] = // ---
toRef$1(store, key);
}
}
return refs;
}
}
const PiniaVuePlugin = function(_Vue2) {
_Vue2.mixin({
beforeCreate() {
const options = this.$options;
if (options.pinia) {
const pinia = options.pinia;
if (!this._provided) {
const provideCache = {};
Object.defineProperty(this, "_provided", {
get: () => provideCache,
set: (v3) => Object.assign(provideCache, v3)
});
}
this._provided[piniaSymbol] = pinia;
if (!this.$pinia) {
this.$pinia = pinia;
}
pinia._a = this;
if (IS_CLIENT) {
setActivePinia(pinia);
}
if (USE_DEVTOOLS) {
registerPiniaDevtools(pinia._a);
}
} else if (!this.$pinia && options.parent && options.parent.$pinia) {
this.$pinia = options.parent.$pinia;
}
},
destroyed() {
delete this._pStores;
}
});
};
const Pinia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
get MutationType() {
return MutationType;
},
PiniaVuePlugin,
acceptHMRUpdate,
createPinia,
defineStore,
getActivePinia,
mapActions,
mapGetters,
mapState,
mapStores,
mapWritableState,
setActivePinia,
setMapStoreSuffix,
skipHydrate,
storeToRefs
}, Symbol.toStringTag, { value: "Module" }));
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x2) {
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -30634,15 +31402,15 @@ var RefImpl2 = (
return RefImpl22;
}()
);
function createRef(options, isReadonly2, isComputed) {
function createRef(options, isReadonly2, isComputed2) {
if (isReadonly2 === void 0) {
isReadonly2 = false;
}
if (isComputed === void 0) {
isComputed = false;
if (isComputed2 === void 0) {
isComputed2 = false;
}
var r3 = new RefImpl2(options);
if (isComputed)
if (isComputed2)
r3.effect = true;
var sealed = Object.seal(r3);
if (isReadonly2)
@@ -34203,6 +34971,7 @@ exports.Fragment = Fragment;
exports.Jt = Jt;
exports.O = O;
exports.P = P;
exports.Pinia = Pinia;
exports.Qt = Qt;
exports.R = R$1;
exports.ReactiveEffect = ReactiveEffect;
@@ -34220,6 +34989,7 @@ exports.callWithErrorHandling = callWithErrorHandling;
exports.camelize = camelize;
exports.computed = computed$2;
exports.createApp = createApp$2;
exports.createPinia = createPinia;
exports.createPropsRestProxy = createPropsRestProxy;
exports.createSSRApp = createSSRApp;
exports.createVNode = createVNode;
@@ -34233,6 +35003,7 @@ exports.defineComponent = defineComponent$1;
exports.defineEmits = defineEmits;
exports.defineExpose = defineExpose;
exports.defineProps = defineProps;
exports.defineStore = defineStore;
exports.devtoolsComponentAdded = devtoolsComponentAdded;
exports.devtoolsComponentRemoved = devtoolsComponentRemoved;
exports.devtoolsComponentUpdated = devtoolsComponentUpdated;

View File

@@ -2,7 +2,7 @@
const common_vendor = require("../common/vendor.js");
function request(urldata) {
const { url, data, method, header, userInfo } = urldata;
const baseUrl = "http://192.168.0.218:8086/" + url;
const baseUrl = "http://192.168.1.218:8086/" + url;
if (userInfo) {
return new Promise((resolve, reject) => {
common_vendor.index.getStorage({

View File

@@ -3,8 +3,6 @@ const common_vendor = require("../../common/vendor.js");
const components_formatDate = require("../../components/formatDate.js");
const components_TimeFormatting = require("../../components/TimeFormatting.js");
const components_request = require("../../components/request.js");
const TUIKit_components_TUIChat_utils_utils = require("../../TUIKit/components/TUIChat/utils/utils.js");
const TUIKit_components_TUIChat_offlinePushInfoManager_index = require("../../TUIKit/components/TUIChat/offlinePushInfoManager/index.js");
const common_assets = require("../../common/assets.js");
const NewAddedPk = () => "../NewAddedPk/NewAddedPk2.js";
const _sfc_main = {
@@ -24,7 +22,7 @@ const _sfc_main = {
const eventChannel = this.getOpenerEventChannel();
eventChannel.on("itemDetail", (data) => {
this.item = data.item;
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:105", "接收到的数据:", this.item);
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:107", "接收到的数据:", this.item);
});
common_vendor.index.getStorage({
key: "userinfo",
@@ -63,44 +61,12 @@ const _sfc_main = {
this.userlist();
},
invite() {
var _a, _b;
if (this.item.pkTime !== this.list[this.InvitingPartyEventindex].pkTime) {
common_vendor.index.showToast({
icon: "none",
title: "请保持时间一致"
});
return;
}
const payload = {
data: JSON.stringify({
businessID: "pk",
title: "PK邀请",
buttonText1: "接受邀请",
buttonText2: "拒绝邀请"
}),
description: "邀请参加PK",
extension: "邀请参加PK"
};
common_vendor.Jt.watch(common_vendor.o.CONV, {
currentConversation: (conversation) => {
this.currentConversation = conversation;
}
const conversationID = `C2C${this.item.senderId}`;
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
const youritem = JSON.stringify(this.item);
common_vendor.index.redirectTo({
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}&myitem=${myitem}&youritem=${youritem}`
});
const options = {
to: `C2C${this.list[this.InvitingPartyEventindex].senderId}`,
conversationType: (_b = (_a = this.currentConversation) == null ? void 0 : _a.value) == null ? void 0 : _b.type,
payload,
needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
};
const offlinePushInfoCreateParams = {
conversation: this.currentConversation,
payload: options.payload,
messageType: common_vendor.qt.TYPES.MSG_CUSTOM
};
const sendMessageOptions = {
offlinePushInfo: TUIKit_components_TUIChat_offlinePushInfoManager_index.OfflinePushInfoManager.create(offlinePushInfoCreateParams)
};
common_vendor.Qt.sendCustomMessage(options, sendMessageOptions);
},
close() {
this.$refs.popup.close();
@@ -127,7 +93,7 @@ const _sfc_main = {
if (res.code === 200) {
if (res.data.length !== 0) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:214", "res.data", res.data);
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:191", "res.data", res.data);
this.list = res.data;
} else {
common_vendor.index.hideLoading();

View File

@@ -1,7 +1,7 @@
{
"navigationBarTitleText": "PK详情",
"usingComponents": {
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
"new-added-pk": "../NewAddedPk/NewAddedPk"
"new-added-pk": "../NewAddedPk/NewAddedPk",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

View File

@@ -0,0 +1,19 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const useCounterStore = common_vendor.defineStore("counter", {
state: () => {
return {
myitem: {},
youritem: {}
};
},
// 也可以这样定义
// state: () => ({ count: 0 })
actions: {
increment() {
this.count++;
}
}
});
exports.useCounterStore = useCounterStore;
//# sourceMappingURL=../../.sourcemap/mp-weixin/stores/counter.js.map