Files
YGChatCS/unpackage/dist/dev/mp-weixin/pages/chat/ChatList.js
2025-06-29 23:41:37 +08:00

134 lines
5.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
if (!Math) {
(ChatTopBgImg + ChatTopNavBar + ChatTopBanner + ChatCardAI + ChatCardMine + ChatMoreTips + ChatQuickAccess)();
}
const ChatTopBanner = () => "./ChatTopBanner.js";
const ChatTopBgImg = () => "./ChatTopBgImg.js";
const ChatTopNavBar = () => "./ChatTopNavBar.js";
const ChatCardAI = () => "./ChatCardAI.js";
const ChatCardMine = () => "./ChatCardMine.js";
const ChatQuickAccess = () => "./ChatQuickAccess2.js";
const ChatMoreTips = () => "./ChatMoreTips.js";
const _sfc_main = {
__name: "ChatList",
emits: ["openDrawer"],
setup(__props, { emit: __emit }) {
const statusBarHeight = common_vendor.ref(20);
const navBgColor = common_vendor.ref("rgba(66, 173, 249, 0)");
common_vendor.ref(0);
const timer = common_vendor.ref(null);
const holdKeyboard = common_vendor.ref(false);
const holdKeyboardFlag = common_vendor.ref(true);
common_vendor.ref("");
const chatMsgList = common_vendor.ref([]);
const inputMessage = common_vendor.ref("");
const lastMsgId = common_vendor.ref("");
holdKeyboard.value = true;
const emits = __emit;
const openDrawer = () => {
emits("openDrawer");
common_vendor.index.__f__("log", "at pages/chat/ChatList.vue:112", "=============打开抽屉");
};
common_vendor.onLoad(() => {
common_vendor.index.getSystemInfo({
success: (res) => {
statusBarHeight.value = res.statusBarHeight || 20;
}
});
});
common_vendor.onMounted(() => {
initData();
});
const initData = () => {
for (let i = 0; i < 30; i++) {
chatMsgList.value.push({
mid: `msg_${i}`,
msg: `消息${i}`
});
}
};
const handleTouchEnd = () => {
clearTimeout(timer.value);
timer.value = setTimeout(() => {
if (handleNoHideKeyboard.value) {
common_vendor.index.hideKeyboard();
}
holdKeyboardFlag.value = true;
}, 50);
};
const handleNoHideKeyboard = () => {
holdKeyboardFlag.value = false;
};
const sendMessage = () => {
handleNoHideKeyboard();
chatMsgList.value.push({
mid: `msg_${chatMsgList.value.length}`,
msg: `新消息${inputMessage.value}`
});
inputMessage.value = "";
common_vendor.index.__f__("log", "at pages/chat/ChatList.vue:231", JSON.stringify(chatMsgList.value));
};
common_vendor.watch(chatMsgList, (newVal) => {
if (newVal.length > 0) {
lastMsgId.value = newVal[newVal.length - 1].mid;
common_vendor.nextTick$1(() => {
lastMsgId.value = "";
common_vendor.nextTick$1(() => {
lastMsgId.value = newVal[newVal.length - 1].mid;
});
});
}
}, { deep: true });
return (_ctx, _cache) => {
return {
a: common_vendor.o(openDrawer),
b: statusBarHeight.value + "px",
c: navBgColor.value,
d: common_vendor.f(chatMsgList.value, (item, index, i0) => {
return common_vendor.e({
a: index === 0
}, index === 0 ? {
b: common_assets._imports_0,
c: "205c7d43-3-" + i0,
d: common_vendor.p({
text: "查信息、预定下单、探索玩法、呼叫服务、我通通可以满足,快试试问我问题吧!"
})
} : index === 1 ? {
f: "205c7d43-4-" + i0,
g: common_vendor.p({
text: "查信息、预定下单、探索玩法"
})
} : index === 3 ? {
i: "205c7d43-5-" + i0,
j: common_vendor.p({
text: "推荐双卧私汤套房。【房间十设施十服务能力】房问为两室一厅两卫房问为一个2米大床房和一个标问可2加床最多可 住6人 房问内带麻将机、带汗蒸房,带阳台泡池,厨房 可烹饪; 【内容玩法】房间内可打麻将、泡汤、长形茶几 可坐10人可打德州、惯蛋等娱乐活动阳台泡池旁可加碳火进行BBQ食材需自带带小朋友的家长小朋友可玩酒店内游乐场淘气堡。 【内容玩法】饮食方面酒店自助餐不限量供应提供西餐、泰餐、中餐自助距酒店10分钟车程可达老宇号息烽正宗辣子鸡。 【特别体验】近期“有为妃作歹”主题泼水活动。"
})
} : {
k: common_vendor.t(item.msg)
}, {
e: index === 1,
h: index === 3,
l: item.mid,
m: item.mid
});
}),
e: lastMsgId.value,
f: common_assets._imports_1,
g: common_vendor.o(sendMessage),
h: common_vendor.o(handleNoHideKeyboard),
i: holdKeyboard.value,
j: inputMessage.value,
k: common_vendor.o(($event) => inputMessage.value = $event.detail.value),
l: common_assets._imports_2,
m: common_vendor.o(sendMessage),
n: common_vendor.o(handleTouchEnd)
};
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-205c7d43"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/chat/ChatList.js.map