feat: 发送命令的组件与发送调整
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
class="item border-box border-bottom pt-20 pb-20"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="close"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<view class="flex flex-items-center flex-justify-center">
|
||||
<image v-if="item.icon" class="left" :src="item.icon" />
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { Command } from "@/model/ChatModel";
|
||||
import { SEND_COMMAND_TYPE } from "@/constant/constant";
|
||||
|
||||
const popup = ref(null);
|
||||
|
||||
@@ -48,35 +50,35 @@ const list = ref([
|
||||
title: "快速预定",
|
||||
content: "预定门票、房间、餐食",
|
||||
btnText: "去预定",
|
||||
type: "Command.quickBooking",
|
||||
type: Command.quickBooking,
|
||||
},
|
||||
{
|
||||
icon: "https://oss.nianxx.cn/mp/static/version_101/home/tsfx.png",
|
||||
title: "探索发现",
|
||||
content: "发现景点、活动、特色内容",
|
||||
btnText: "去探索",
|
||||
type: "Command.discovery",
|
||||
type: Command.discovery,
|
||||
},
|
||||
{
|
||||
icon: "https://oss.nianxx.cn/mp/static/version_101/home/mddd.png",
|
||||
title: "我的订单",
|
||||
content: "查看门票、住宿、餐饮等订单",
|
||||
btnText: "去查看",
|
||||
type: "Command.myOrder",
|
||||
type: Command.myOrder,
|
||||
},
|
||||
{
|
||||
icon: "https://oss.nianxx.cn/mp/static/version_101/home/wdgd.png",
|
||||
title: "我的工单",
|
||||
content: "查看服务工单、进度与处理情况",
|
||||
btnText: "去查看",
|
||||
type: "Command.myWorkOrder",
|
||||
type: Command.myWorkOrder,
|
||||
},
|
||||
{
|
||||
icon: "https://oss.nianxx.cn/mp/static/version_101/home/fkyj.png",
|
||||
title: "反馈意见",
|
||||
content: "提交使用问题、建议与需求",
|
||||
btnText: "去反馈",
|
||||
type: "Command.feedbackCard",
|
||||
type: Command.feedbackCard,
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -84,6 +86,11 @@ const open = () => {
|
||||
popup.value && popup.value.open();
|
||||
};
|
||||
|
||||
const handleClick = (item) => {
|
||||
uni.$emit(SEND_COMMAND_TYPE, item);
|
||||
close();
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
popup.value && popup.value.close();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user