Compare commits

..

No commits in common. "d83cdba4689a447853714d2a8cf1a7f95b051542" and "515ae4e78c55ead98bdb1348df93ea0765f7fb53" have entirely different histories.

14 changed files with 69 additions and 340 deletions

46
App.vue
View File

@ -1,36 +1,36 @@
<script setup> <script setup>
import { onLaunch, onShow, onHide, onLoad } from "@dcloudio/uni-app"; import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { checkPhone } from "@/manager/LoginManager"; import { checkPhone } from "@/manager/LoginManager";
import { goLogin } from "@/hooks/useGoLogin"; import { goLogin } from "@/hooks/useGoLogin";
import { goHome } from "@/hooks/useGoHome"; import { goHome } from "@/hooks/useGoHome";
onLaunch(async () => { onLaunch(async () => {
console.log("App Launch"); console.log("App Launch");
const token = uni.getStorageSync("token"); const token = uni.getStorageSync("token");
// token // token
if (!token) { if (!token) {
goLogin(); goLogin();
return; return;
} }
if (token) { if (token) {
const res = await checkPhone(); const res = await checkPhone();
if (res.data) { if (res.data) {
goHome(); goHome();
}
} }
}
}); });
onShow(() => { onShow(() => {
console.log("App Show"); console.log("App Show");
}); });
onHide(() => { onHide(() => {
console.log("App Hide"); console.log("App Hide");
}); });
</script> </script>
@ -41,18 +41,18 @@ onHide(() => {
page, page,
body, body,
#app { #app {
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
background-color: #e9f3f7; background-color: #e9f3f7;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
} }
/*每个页面公共css */ /*每个页面公共css */
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none;
} }
.mb12 { .mb12 {
margin-bottom: 12px; margin-bottom: 12px;
} }
</style> </style>

View File

@ -1,5 +1,15 @@
.create-service-order {
// margin-left: 12px;
// margin-right: 12px;
}
.create-service-wrapper { .create-service-wrapper {
// box-sizing: border-box;
padding: 12px 0; padding: 12px 0;
// background-color: #eff6fa;
// box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.1);
// border-radius: 4px 20px 20px 20px;
// border: 1px solid #fff;
} }
.order-header { .order-header {
@ -106,7 +116,7 @@
} }
.order-button { .order-button {
width: 300px; width: 280px;
height: 42px; height: 42px;
background: linear-gradient(90deg, #ff7e00, #ffba00); background: linear-gradient(90deg, #ff7e00, #ffba00);
color: #fff; color: #fff;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 844 B

View File

@ -1,140 +0,0 @@
<template>
<view class="create-service-order">
<view class="create-service-wrapper">
<view class="order-header">
<text>反馈意见</text>
</view>
<view class="order-content">
<view class="detail-item">
<text class="detail-label">联系电话</text>
<input
v-if="!isCallSuccess"
class="detail-input"
placeholder="请填写联系电话"
v-model="contactPhone"
/>
<text v-else class="detail-value">{{ contactPhone }}</text>
</view>
<view class="detail-item">
<text class="detail-label">意见内容</text>
<textarea
v-if="!isCallSuccess"
class="detail-textarea"
placeholder="请输入反馈意见"
v-model="contactText"
/>
<text v-else class="detail-value">{{ contactText }}</text>
</view>
<button
v-if="!isCallSuccess"
class="order-button submit-button"
@click="handleCall"
>
立即提交
</button>
<button v-else class="order-button look-button" @click="viewWorkOrder">
查看意见
</button>
</view>
</view>
<view class="footer-help">
<image src="./images/icon_volume.png" class="help-icon"></image>
<text class="help-text">朵朵收到您的意见将第一时间为您处理!</text>
</view>
</view>
</template>
<script setup>
import { ref, onMounted, nextTick } from "vue";
import { SCROLL_TO_BOTTOM } from "@/constant/constant";
import { createWorkOrder } from "@/request/api/OrderApi";
const workOrderTypeId = ref("");
const contactPhone = ref("");
const contactText = ref("");
const isCallSuccess = ref(false); //
const workOrderId = ref(0); // ID
const handleCall = async () => {
if (!contactPhone.value.trim()) {
uni.showToast({
title: "请填写联系电话",
icon: "none",
duration: 2000,
});
return;
}
if (!contactText.value.trim()) {
uni.showToast({
title: "请填写意见内容",
icon: "none",
duration: 2000,
});
return;
}
sendCreateWorkOrder();
};
///
const sendCreateWorkOrder = async () => {
try {
const res = await createWorkOrder({
contactName: contactText.value,
contactPhone: contactPhone.value,
workOrderTypeId: workOrderTypeId.value,
});
if (res.code === 0) {
// ID
workOrderId.value = res.data?.id || "";
//
isCallSuccess.value = true;
uni.showToast({
title: "工单创建成功",
icon: "success",
duration: 2000,
});
} else {
uni.showToast({
title: res.message || "创建工单失败",
icon: "none",
duration: 2000,
});
}
} catch (error) {
console.error("创建工单失败:", error);
uni.showToast({
title: "网络错误,请重试",
icon: "none",
duration: 2000,
});
}
};
//
const viewWorkOrder = () => {
console.log("查看工单:", workOrderId.value);
//
uni.navigateTo({
url: `/pages/order/list?id=${workOrderId.value}`,
});
};
onMounted(() => {
nextTick(() => {
setTimeout(() => {
uni.$emit(SCROLL_TO_BOTTOM, true);
}, 200);
});
});
</script>
<style scoped lang="scss">
@import "./styles/index.scss";
</style>

View File

@ -1,95 +0,0 @@
.create-service-wrapper {
padding: 6px 0 12px;
}
.order-header {
font-size: 14px;
font-weight: 500;
margin-bottom: 10px;
color: #333;
}
.order-content {
width: 100%;
box-sizing: border-box;
background-color: #fff;
padding: 12px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.detail-item {
display: flex;
align-items: start;
margin-bottom: 12px;
font-size: 14px;
color: #333;
}
.detail-label {
width: 70px;
white-space: nowrap;
}
.detail-value {
font-size: 14px;
color: #333;
}
.detail-textarea {
width: 100%;
font-size: 14px;
color: #333;
border-radius: 4px;
border: 1px solid #ddd;
padding: 8px;
}
.detail-input {
border: none;
outline: none;
width: 100%;
font-size: 14px;
color: #333;
border-bottom: 1px solid #ddd;
padding-left: 8px;
}
.order-button {
width: 300px;
height: 42px;
color: #fff;
font-size: 14px;
font-weight: 600;
border-radius: 21px;
margin-top: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.submit-button {
background: linear-gradient(90deg, #ff7e00, #ffba00);
}
.look-button {
background: linear-gradient(90deg, #0256ff, #00a6ff);
}
.footer-help {
margin-bottom: 12px;
display: flex;
align-items: center;
font-size: 14px;
color: #ed6a0c;
}
.help-icon {
width: 16px;
height: 14px;
margin-right: 5px;
}
.help-text {
margin-right: 5px;
}

View File

@ -12,8 +12,7 @@ export const MessageType = {
export const CompName = { export const CompName = {
quickBookingCard: "quickBookingCard", quickBookingCard: 'quickBookingCard',
createWorkOrderCard: "createWorkOrderCard", createWorkOrderCard: 'createWorkOrderCard',
feedbackCard: "feedbackCard", discoveryCard: 'discoveryCard',
discoveryCard: "discoveryCard", }
};

View File

@ -5,8 +5,7 @@
<image <image
v-if="isLoading" v-if="isLoading"
class="loading-img" class="loading-img"
src="/static/chat_msg_loading.gif" src="/static/msg_loading.svg"
mode="aspectFit"
/> />
<!-- <loading v-if="isLoading" /> --> <!-- <loading v-if="isLoading" /> -->
<ChatMarkdown :key="textKey" :text="processedText" /> <ChatMarkdown :key="textKey" :text="processedText" />
@ -95,8 +94,8 @@ watch(
} }
.loading-img { .loading-img {
margin-right: 8px; margin-left: -4px;
width: 30px; width: 32px;
height: 25px; height: 32px;
} }
</style> </style>

View File

@ -61,12 +61,6 @@
item.toolCall.componentName === CompName.createWorkOrderCard item.toolCall.componentName === CompName.createWorkOrderCard
" "
/> />
<Feedback
v-else-if="
item.toolCall.componentName === CompName.feedbackCard
"
:toolCall="item.toolCall"
/>
<DetailCardCompontent <DetailCardCompontent
v-else-if="item.toolCall.componentName === ''" v-else-if="item.toolCall.componentName === ''"
:toolCall="item.toolCall" :toolCall="item.toolCall"
@ -154,7 +148,6 @@ import ActivityListComponent from "../module/banner/ActivityListComponent.vue";
import RecommendPostsComponent from "../module/recommend/RecommendPostsComponent.vue"; import RecommendPostsComponent from "../module/recommend/RecommendPostsComponent.vue";
import AttachListComponent from "../module/attach/AttachListComponent.vue"; import AttachListComponent from "../module/attach/AttachListComponent.vue";
import CreateServiceOrder from "@/components/CreateServiceOrder/index.vue"; import CreateServiceOrder from "@/components/CreateServiceOrder/index.vue";
import Feedback from "@/components/Feedback/index.vue";
import DetailCardCompontent from "../module/detail/DetailCardCompontent.vue"; import DetailCardCompontent from "../module/detail/DetailCardCompontent.vue";
import { mainPageData } from "@/request/api/MainPageDataApi"; import { mainPageData } from "@/request/api/MainPageDataApi";
import { import {
@ -164,9 +157,7 @@ import {
import WebSocketManager from "@/utils/WebSocketManager"; import WebSocketManager from "@/utils/WebSocketManager";
import TypewriterManager from "@/utils/TypewriterManager"; import TypewriterManager from "@/utils/TypewriterManager";
import { IdUtils } from "@/utils"; import { IdUtils } from "@/utils";
import { useAppStore } from "@/store";
const appStore = useAppStore();
/// ///
const statusBarHeight = ref(20); const statusBarHeight = ref(20);
/// ///
@ -191,6 +182,8 @@ const chatMsgList = ref([]);
/// ///
const inputMessage = ref(""); const inputMessage = ref("");
///
const sceneId = ref("");
/// agentId /// agentId
const agentId = ref("1"); const agentId = ref("1");
/// ID /// ID
@ -390,9 +383,7 @@ const loadConversationMsgList = async () => {
// //
const getMainPageData = async () => { const getMainPageData = async () => {
/// const res = await mainPageData(sceneId.value);
const sceneId = appStore.sceneId || "";
const res = await mainPageData(sceneId);
if (res.code === 0) { if (res.code === 0) {
mainPageDataModel.value = res.data; mainPageDataModel.value = res.data;
agentId.value = res.data.agentId; agentId.value = res.data.agentId;

View File

@ -58,8 +58,8 @@ const initData = () => {
}, },
{ {
icon: "/static/quick/quick_icon_call.png", icon: "/static/quick/quick_icon_call.png",
title: "反馈意见", title: "呼叫服务",
content: "有意见告诉朵朵", content: "加水、客房服务等",
type: "Command.createWorkOrder", type: "Command.createWorkOrder",
}, },
]; ];

View File

@ -5,24 +5,21 @@
<!-- 日历组件 --> <!-- 日历组件 -->
<Calender <Calender
:visible="calendarVisible" :visible="calendarVisible"
mode="single" mode="single"
:default-value="selectedDate" :default-value="selectedDate"
@close="handleCalendarClose" @close="handleCalendarClose"
@select="handleDateSelect" @select="handleDateSelect"
/> />
</template> </template>
<script setup> <script setup>
import { ref, onMounted, onUnmounted } from "vue"; import { ref, onMounted, onUnmounted } from "vue";
import ChatMainList from "../chat/ChatMainList.vue"; import ChatMainList from "../chat/ChatMainList.vue";
import Calender from "@/components/Calender/index.vue"; import Calender from "@/components/Calender/index.vue";
import { onLoad } from "@dcloudio/uni-app";
import { GetWxMiniProgramUrlParam } from "@/utils/UrlParams";
import { useAppStore } from "@/store";
const appStore = useAppStore();
const calendarVisible = ref(false); const calendarVisible = ref(false);
const selectedDate = ref(""); const selectedDate = ref("");
@ -38,28 +35,17 @@ const handleDateSelect = (data) => {
calendarVisible.value = false; calendarVisible.value = false;
console.log("选择的日期:", data.date); console.log("选择的日期:", data.date);
uni.$emit("selectCalendarDate", selectedDate.value); // uni.$emit("selectCalendarDate", selectedDate.value); //
}; };
uni.$on("openCalendar", () => { uni.$on("openCalendar", () => {
calendarVisible.value = true; calendarVisible.value = true;
}); });
const getWeixinMiniProgramParams = (e) => {
console.log("Params:", e);
if (e.q && e.q != "undefined") {
const qrUrl = decodeURIComponent(e.q); //
const params = GetWxMiniProgramUrlParam(qrUrl);
appStore.setSceneId(params.sceneId);
}
};
onLoad((e) => {
getWeixinMiniProgramParams(e);
});
onUnmounted(() => { onUnmounted(() => {
// uni.$off('openCalendar') // uni.$off('openCalendar')
}); })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

View File

@ -4,7 +4,6 @@ export const useAppStore = defineStore("app", {
state() { state() {
return { return {
title: "", title: "",
sceneId: "",
}; };
}, },
getters: {}, getters: {},
@ -13,9 +12,6 @@ export const useAppStore = defineStore("app", {
setData(data) { setData(data) {
this.title = data; this.title = data;
}, },
setSceneId(data) {
this.sceneId = data;
},
}, },
unistorage: true, unistorage: true,

View File

@ -94,15 +94,15 @@ export default {
const fontFamily = this.fontFamily const fontFamily = this.fontFamily
let zeroStyle = { let zeroStyle = {
p: ` p: `
margin:4px 0; margin:6px 0;
font-size: 15px; font-size: 15px;
line-height:1.65; line-height:1.65;
font-family: ${fontFamily}; font-family: ${fontFamily};
`, `,
// //
h1: ` h1: `
margin:4px 0; margin:6px 0;
font-size: 20px; font-size: 24px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
color: ${themeColor}; color: ${themeColor};
@ -115,8 +115,8 @@ export default {
`, `,
// //
h2: ` h2: `
margin:4px 0; margin:6px 0;
font-size: 18px; font-size: 20px;
text-align:center; text-align:center;
color:${themeColor}; color:${themeColor};
font-family: ${fontFamily}; font-family: ${fontFamily};
@ -126,8 +126,8 @@ export default {
`, `,
// //
h3: ` h3: `
margin:4px 0; margin:6px 0;
font-size: 16px; font-size: 18px;
color: ${themeColor}; color: ${themeColor};
font-family: ${fontFamily}; font-family: ${fontFamily};
padding-left:10px; padding-left:10px;
@ -135,7 +135,7 @@ export default {
`, `,
// //
blockquote: ` blockquote: `
margin:4px 0; margin:6px 0;
font-size:15px; font-size:15px;
font-family: ${fontFamily}; font-family: ${fontFamily};
color: #777777; color: #777777;
@ -144,7 +144,7 @@ export default {
`, `,
// //
ul: ` ul: `
margin: 4px 0; margin: 6px 0;
color: #555; color: #555;
`, `,
li: ` li: `
@ -208,7 +208,7 @@ export default {
const fontFamily = this.fontFamily const fontFamily = this.fontFamily
let zeroStyle = { let zeroStyle = {
p: ` p: `
margin:4px 0; margin:6px 0;
font-size: 15px; font-size: 15px;
line-height:1.55; line-height:1.55;
font-family: ${fontFamily}; font-family: ${fontFamily};

View File

@ -1,17 +0,0 @@
export function GetWxMiniProgramUrlParam(url) {
let theRequest = {};
if(url.indexOf("#") != -1){
const str=url.split("#")[1];
const strs=str.split("&");
for (let i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
}
}else if(url.indexOf("?") != -1){
const str=url.split("?")[1];
const strs=str.split("&");
for (let i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
}
}
return theRequest;
}