Compare commits

13 Commits

20 changed files with 315 additions and 55 deletions

View File

@@ -47,8 +47,32 @@
class="bg-F5F7FA border-box p-12 rounded-10 font-size-14 font-500 color-171717 mb-12" class="bg-F5F7FA border-box p-12 rounded-10 font-size-14 font-500 color-171717 mb-12"
> >
<view class="font-500 line-height-22 mb-12">照片上传</view> <view class="font-500 line-height-22 mb-12">照片上传</view>
<view <view
class="bg-white p-24 rounded-5 inline-block" class="w-80 h-80 bg-white rounded-8 overflow-hidden flex flex-items-center flex-justify-center"
>
<view
v-if="contentImgUrl"
class="w-full h-full relative inline-block"
>
<image
class="w-full h-full block"
:src="contentImgUrl"
mode="aspectFill"
/>
<uni-icons
class="close-btn absolute z-10"
type="close"
size="20"
color="#6A717F"
@click="handleDeleteImage"
>
</uni-icons>
</view>
<view
v-else
class="w-full h-full flex flex-items-center flex-justify-center"
@click="handleChooseImage" @click="handleChooseImage"
> >
<uni-icons fontFamily="znicons" size="24" color="#6A717F"> <uni-icons fontFamily="znicons" size="24" color="#6A717F">
@@ -57,6 +81,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view v-else class="border-box card-content flex flex-items-center p-12"> <view v-else class="border-box card-content flex flex-items-center p-12">
<view class="border-box left flex-full pr-20"> <view class="border-box left flex-full pr-20">
@@ -72,8 +97,9 @@
</view> </view>
<image <image
v-if="contentImgUrl"
class="right rounded-6" class="right rounded-6"
src="https://picsum.photos/300/300" :src="contentImgUrl"
mode="aspectFill" mode="aspectFill"
/> />
</view> </view>
@@ -123,12 +149,16 @@ const handleChooseImage = () => {
}); });
}; };
const handleDeleteImage = () => {
contentImgUrl.value = "";
};
const updateImagehandle = (file) => { const updateImagehandle = (file) => {
if (!file) { if (!file) {
return; return;
} }
updateImageFile(file).then((res) => { updateImageFile(file).then((res) => {
contentImgUrl.value = res.data?.url || ""; contentImgUrl.value = res.data;
}); });
}; };
@@ -165,8 +195,8 @@ const sendCreateWorkOrder = async () => {
try { try {
const res = await createWorkOrder({ const res = await createWorkOrder({
workOrderTypeId: workOrderTypeId.value, workOrderTypeId: workOrderTypeId.value,
roomId: roomId.value, roomNo: roomId.value,
contactPhone: contactPhone.value, userPhone: contactPhone.value,
content: contactText.value, content: contactText.value,
contentImgUrl: contentImgUrl.value, contentImgUrl: contentImgUrl.value,
}); });
@@ -205,7 +235,7 @@ const viewWorkOrder = () => {
console.log("查看工单:", workOrderId.value); console.log("查看工单:", workOrderId.value);
// 这里可以跳转到工单详情页面 // 这里可以跳转到工单详情页面
uni.navigateTo({ uni.navigateTo({
url: `/pages-order/order/list?id=${workOrderId.value}`, url: `/pages-service/order/list`,
}); });
}; };
@@ -220,4 +250,9 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
@import "./styles/index.scss"; @import "./styles/index.scss";
.close-btn {
top: 0;
right: 0;
}
</style> </style>

View File

@@ -52,7 +52,7 @@
</view> </view>
</scroll-view> </scroll-view>
<view class="custom-indicator"> <view class="custom-indicator" @click="handlePreviewClick">
<uni-icons fontFamily="znicons" size="10" color="#fff">{{ <uni-icons fontFamily="znicons" size="10" color="#fff">{{
zniconsMap["zn-camera"] zniconsMap["zn-camera"]
}}</uni-icons> }}</uni-icons>
@@ -68,6 +68,8 @@
<script setup> <script setup>
import { ref, computed, nextTick } from "vue"; import { ref, computed, nextTick } from "vue";
import { zniconsMap } from "@/static/fonts/znicons.js"; import { zniconsMap } from "@/static/fonts/znicons.js";
import { useAppStore } from "@/store";
const appStore = useAppStore();
// Props定义 // Props定义
const props = defineProps({ const props = defineProps({
@@ -166,6 +168,13 @@ const handleSwiperChange = (e) => {
active.value = currentIndex; active.value = currentIndex;
scrollToActiveItem(currentIndex); scrollToActiveItem(currentIndex);
}; };
const handlePreviewClick = () => {
appStore.setPreviewImageData(thumbnails.value);
uni.navigateTo({
url: `/pages/goods/album/index`,
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -25,6 +25,9 @@
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap;
max-width: 100%;
box-sizing: border-box;
} }
.custom-indicator { .custom-indicator {
@@ -32,6 +35,9 @@
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
border-radius: $uni-border-radius-50px; border-radius: $uni-border-radius-50px;
padding: 0 6px 4px 8px; padding: 0 6px 4px 8px;
flex: 0 0 auto;
flex-shrink: 0;
white-space: nowrap;
} }
.custom-indicator-text { .custom-indicator-text {
@@ -43,7 +49,9 @@
} }
.thumbnail-scroll { .thumbnail-scroll {
flex: 1; flex: 1 1 auto;
min-width: 0; // 允许在flex容器中收缩以适配剩余空间
overflow: auto; // 防止超出thumbnail-box的宽度
height: 100%; height: 100%;
white-space: nowrap; white-space: nowrap;
} }
@@ -71,7 +79,7 @@
height: 36px; height: 36px;
border-radius: 8px; border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
border: 2px solid transparent; border: 1px solid #171717;
transition: all 0.3s ease; transition: all 0.3s ease;
display: block; display: block;
} }

View File

@@ -1,8 +1,5 @@
<template> <template>
<view <view class="order-card bg-white border-box p-12 rounded-12 m-12">
class="order-card bg-white border-box p-12 rounded-12 m-12"
@click="handleCardClick"
>
<!-- 卡片头部 --> <!-- 卡片头部 -->
<view class="border-box flex flex-items-center pb-12"> <view class="border-box flex flex-items-center pb-12">
<image <image
@@ -10,50 +7,63 @@
src="https://oss.nianxx.cn/mp/static/version_101/service/service_icon.png" src="https://oss.nianxx.cn/mp/static/version_101/service/service_icon.png"
/> />
<text class="font-size-14 color-525866 line-height-20">工单</text> <text class="font-size-14 color-525866 line-height-20">工单</text>
<text class="font-size-12 color-525866 line-height-20 ml-auto" <text class="font-size-12 color-525866 line-height-20 ml-auto">{{
>已完成</text isCancelWork ? "已取消" : workOrderStatus(orderData.workOrderStatus)
> }}</text>
</view> </view>
<!-- 卡片内容 --> <!-- 卡片内容 -->
<view class="border-box card-content flex flex-items-center pb-12"> <view class="border-box card-content flex flex-items-center pb-12">
<view class="border-box left flex-full pr-20"> <view class="border-box left flex-full pr-20">
<view class="font-size-12 color-525866 line-height-20 mb-4" <view class="font-size-12 color-525866 line-height-20 mb-4"
>房间号A01</view >房间号{{ orderData.roomNo }}</view
> >
<view class="font-size-12 color-525866 line-height-20 mb-4" <view class="font-size-12 color-525866 line-height-20 mb-4"
>联系方式:173822042402</view >联系方式: {{ orderData.userPhone }}</view
> >
<view class="font-size-12 color-525866 line-height-20 ellipsis-2" <view class="font-size-12 color-525866 line-height-20 ellipsis-2"
>需求描述:我太渴了立即立刻马上现在给我送两瓶水过来我太渴了立即立刻马上现在给我送两瓶水过来我太渴了立即立刻马上现在给我送两瓶水过来我太渴了立即立刻马上现在给我送两瓶水过来</view >需求描述: {{ orderData.content }}</view
> >
</view> </view>
<image <image
v-if="orderData.contentImgUrl"
class="right rounded-6" class="right rounded-6"
src="https://picsum.photos/300/300" :src="orderData.contentImgUrl"
mode="aspectFill" mode="aspectFill"
/> />
</view> </view>
<!-- 服务人员 --> <!-- 服务人员 -->
<view <view
v-if="orderData.processMemberName && orderData.processMemberPhone"
class="service-user border-box p-8 flex flex-items-center flex-justify-between mb-12" class="service-user border-box p-8 flex flex-items-center flex-justify-between mb-12"
> >
<view class="font-size-12 line-height-16">服务人员张三</view> <view class="font-size-12 line-height-16"
>服务人员{{ orderData.processMemberName }}</view
>
<uni-icons <uni-icons
class="ml-auto mr-4" class="ml-auto mr-4"
type="phone-filled" type="phone-filled"
size="14" size="14"
color="#436799" color="#436799"
/> />
<text class="font-size-12 line-height-16">拨打电话</text> <text class="font-size-12 line-height-16" @click="callService"
>拨打电话</text
>
</view> </view>
<!-- 取消操作 --> <!-- 取消操作 -->
<view class="flex flex-items-center flex-justify-between"> <view
v-if="
!isCancelWork &&
orderData.workOrderStatus !== '2' &&
orderData.workOrderStatus !== '3'
"
class="flex flex-items-center flex-justify-between"
>
<text <text
class="cancel border-box border rounded-6 font-size-12 line-height-16 color-525866 ml-auto" class="cancel border-box border rounded-6 font-size-12 line-height-16 color-525866 ml-auto"
@click="cancelCall"
>取消呼叫</text >取消呼叫</text
> >
</view> </view>
@@ -62,18 +72,55 @@
<script setup> <script setup>
import { defineProps } from "vue"; import { defineProps } from "vue";
import { closeWorkOrder } from "@/request/api/OrderApi";
import { ref } from "vue";
const isCancelWork = ref(false);
// Props // Props
const props = defineProps({ const props = defineProps({
item: { orderData: {
type: Object, type: Object,
required: true, required: true,
default: () => ({}), default: () => ({}),
}, },
}); });
// 处理卡片点击 /// 工单状态 0-待接单 1-处理中 2-已完成 3-已关闭
const handleCardClick = () => {}; const workOrderStatus = (status) => {
if (status === "0") {
return "待处理";
} else if (status === "1") {
return "处理中";
} else if (status === "2") {
return "已完成";
} else if (status === "3") {
return "已取消";
} else {
return "";
}
};
// 拨打电话
const callService = () => {
uni.makePhoneCall({
phoneNumber: props.orderData.processMemberPhone,
});
};
// 取消呼叫
const cancelCall = async () => {
const res = await closeWorkOrder({
workOrderId: props.orderData.id,
});
if (res.data) {
isCancelWork.value = true;
}
uni.showToast({
title: res.data ? "取消呼叫成功" : res.message || "取消呼叫失败",
icon: "success",
duration: 2000,
});
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -17,6 +17,12 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/goods/album/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"subPackages": [ "subPackages": [

View File

@@ -0,0 +1,103 @@
<template>
<view class="bg-F5F7FA flex flex-col h-screen overflow-hidden">
<TopNavBar title="房间相册" backgroundColor="transparent" />
<view class="p-8">
<text class="ml-4 font-size-18 color-171717 font-500"
>全部({{ albumList.length }})</text
>
</view>
<scroll-view scroll-y class="scroll-container overflow-auto">
<view class="pl-4 pr-4 pb-24">
<view class="grid-container">
<view
class="album-item"
v-for="(item, index) in albumList"
:key="index"
>
<view class="album-image-wrapper">
<image
class="album-image"
:src="item.photoUrl"
mode="aspectFill"
@click="handlePreview(item.photoUrl)"
></image>
<view class="album-title">{{ item.name }}</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import { ref } from "vue";
import TopNavBar from "@/components/TopNavBar/index.vue";
import { onLoad } from "@dcloudio/uni-app";
import { useAppStore } from "@/store";
const appStore = useAppStore();
const albumList = ref([]);
onLoad(() => {
albumList.value = appStore.previewImageData;
appStore.setPreviewImageData([]);
});
// 处理图片预览
const handlePreview = (photoUrl) => {
uni.previewImage({
current: photoUrl,
urls: albumList.value.map((item) => item.photoUrl),
});
};
</script>
<style scoped lang="scss">
.grid-container {
display: grid;
grid-template-columns: repeat(2, 1fr); // 每行2列
grid-gap: 8px;
padding: 12px;
}
.album-item {
position: relative;
width: 100%;
}
.album-image-wrapper {
position: relative;
width: 100%;
aspect-ratio: 1 / 1; // 保持宽高1:1
border-radius: 8px;
overflow: hidden;
}
.album-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.album-title {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 8px;
background: linear-gradient(
180deg,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0.6) 100%
);
color: #fff;
font-size: 14px;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-radius: 0 0 8px 8px;
}
</style>

View File

@@ -540,7 +540,7 @@ const initTypewriterManager = () => {
} }
typewriterManager = new TypewriterManager({ typewriterManager = new TypewriterManager({
typingSpeed: 30, typingSpeed: 10,
cursorText: "", cursorText: "",
}); });

View File

@@ -16,6 +16,6 @@
} }
.tag-text { .tag-text {
color: #00a6ff; /* 蓝色文字,可根据设计调整 */ color: #2d91ff; /* 蓝色文字,可根据设计调整 */
font-size: $uni-font-size-base; font-size: $uni-font-size-base;
} }

View File

@@ -2,7 +2,7 @@
<view class="w-full"> <view class="w-full">
<template v-if="toolCall.picture && toolCall.picture.length > 0"> <template v-if="toolCall.picture && toolCall.picture.length > 0">
<ModuleTitle :title="图片详情" /> <ModuleTitle :title="图片详情" />
<ImageSwiper :images="toolCall.picture" /> <ImageSwiper :images="toolCall.picture" thumbnailBottom="12px" />
</template> </template>
<template v-if="toolCall.commodityList"> <template v-if="toolCall.commodityList">

View File

@@ -20,7 +20,7 @@
</view> </view>
<view class="card-text border-box"> <view class="card-text border-box">
<view class="color-171717 font-size-14 line-height-20"> <view class="color-171717 font-size-14 line-height-20 ellipsis-1">
{{ item.topic }} {{ item.topic }}
</view> </view>
<view class="font-size-11 color-99A0AE"> <view class="font-size-11 color-99A0AE">

View File

@@ -19,6 +19,11 @@ const createWorkOrder = (args) => {
return request.post("/hotelBiz/workOrder/createWorkOrder", args); return request.post("/hotelBiz/workOrder/createWorkOrder", args);
}; };
// 关闭工单
const closeWorkOrder = (args) => {
return request.post("/hotelBiz/workOrder/closeWorkOrder", args);
};
// 获取订单详情 // 获取订单详情
const userOrderDetail = (args) => { const userOrderDetail = (args) => {
return request.post("/hotelBiz/order/userOrderDetail", args); return request.post("/hotelBiz/order/userOrderDetail", args);
@@ -49,6 +54,7 @@ export {
userWorkOrderList, userWorkOrderList,
workOrderTypeListForBiz, workOrderTypeListForBiz,
createWorkOrder, createWorkOrder,
closeWorkOrder,
userOrderDetail, userOrderDetail,
preOrder, preOrder,
orderCancel, orderCancel,

View File

@@ -2,7 +2,7 @@ import { BASE_URL } from "@/request/base/baseUrl";
import { getCurrentConfig } from "@/constant/base"; import { getCurrentConfig } from "@/constant/base";
export const updateImageFile = (file) => { export const updateImageFile = (file) => {
const url = BASE_URL + "/common/upload"; const url = BASE_URL + "/hotelBiz/hotBizCommon/upload";
const token = uni.getStorageSync("token"); const token = uni.getStorageSync("token");
const clientId = getCurrentConfig().clientId; const clientId = getCurrentConfig().clientId;
@@ -20,8 +20,8 @@ export const updateImageFile = (file) => {
file: "file", file: "file",
}, },
success: (uploadFileRes) => { success: (uploadFileRes) => {
console.log(uploadFileRes.data); console.log("uploadFileRes: ", uploadFileRes);
resolve(uploadFileRes.data); resolve(JSON.parse(uploadFileRes.data));
}, },
fail: (err) => { fail: (err) => {
console.error("上传图片失败:", err); console.error("上传图片失败:", err);

View File

@@ -41,3 +41,7 @@
.bg-button { .bg-button {
background: linear-gradient(90deg, #2d91ff 0%, #4de4ff 100%); background: linear-gradient(90deg, #2d91ff 0%, #4de4ff 100%);
} }
.bg-transparent {
background-color: transparent;
}

View File

@@ -2,6 +2,10 @@
height: 100vh; height: 100vh;
} }
.h-full {
height: 100%;
}
.h-80 { .h-80 {
height: 80px; height: 80px;
} }

View File

@@ -2,3 +2,7 @@
.overflow-hidden { .overflow-hidden {
overflow: hidden; overflow: hidden;
} }
.overflow-auto {
overflow: auto;
}

View File

@@ -111,6 +111,14 @@
padding: 24px; padding: 24px;
} }
.pt-24 {
padding-top: 24px;
}
.pb-24 {
padding-bottom: 24px;
}
.pb-safe-area { .pb-safe-area {
padding-bottom: Max(env(safe-area-inset-bottom), 12px); padding-bottom: Max(env(safe-area-inset-bottom), 12px);
} }

View File

@@ -9,3 +9,6 @@
.w-50 { .w-50 {
width: 50%; width: 50%;
} }
.w-80 {
width: 80px;
}

View File

@@ -4,9 +4,10 @@ export const useAppStore = defineStore("app", {
state() { state() {
return { return {
title: "", title: "",
sceneId: "", sceneId: "", /// 分身场景id
hasToken: false, hasToken: false, /// 是否有token
tokenExpired: false, tokenExpired: false, /// token是否过期
previewImageData: [], /// 预览图片数据
}; };
}, },
getters: {}, getters: {},
@@ -24,6 +25,9 @@ export const useAppStore = defineStore("app", {
setTokenExpired(status) { setTokenExpired(status) {
this.tokenExpired = status; this.tokenExpired = status;
}, },
setPreviewImageData(data) {
this.previewImageData = data;
},
}, },
unistorage: true, unistorage: true,

View File

@@ -35,7 +35,7 @@ export default {
}, },
themeColor: { themeColor: {
type: String, type: String,
default: "#00A6FF", default: "#2D91FF",
}, },
codeBgColor: { codeBgColor: {
type: String, type: String,
@@ -45,6 +45,14 @@ export default {
type: String, type: String,
default: "PingFang SC, PingFang SC", default: "PingFang SC, PingFang SC",
}, },
fontColor: {
type: String,
default: "#171717",
},
fontSubColor: {
type: String,
default: "#4D4D4D",
},
aiMode: { aiMode: {
type: Boolean, type: Boolean,
default: false, default: false,
@@ -97,12 +105,15 @@ export default {
const themeColor = this.themeColor; const themeColor = this.themeColor;
const codeBgColor = this.codeBgColor; const codeBgColor = this.codeBgColor;
const fontFamily = this.fontFamily; const fontFamily = this.fontFamily;
const fontColor = this.fontColor;
const fontSubColor = this.fontSubColor;
let zeroStyle = { let zeroStyle = {
p: ` p: `
margin:4px 0; margin:4px 0;
font-size: 15px; font-size: 15px;
line-height:1.65; line-height:1.55;
font-family: ${fontFamily}; font-family: ${fontFamily};
color: ${fontColor};
`, `,
// 一级标题 // 一级标题
h1: ` h1: `
@@ -149,12 +160,14 @@ export default {
`, `,
// 列表 // 列表
ul: ` ul: `
font-size: 14px;
margin: 4px 0; margin: 4px 0;
color: #555; color: ${fontSubColor};
`, `,
li: ` li: `
font-size: 14px;
margin: 4px 0; margin: 4px 0;
color: #555; color: ${fontSubColor};
`, `,
// 链接 // 链接
a: ` a: `
@@ -168,6 +181,7 @@ export default {
`, `,
// 斜体 // 斜体
em: ` em: `
font-size: 14px;
color: ${themeColor}; color: ${themeColor};
font-family: ${fontFamily}; font-family: ${fontFamily};
letter-spacing:0.3em; letter-spacing:0.3em;
@@ -191,11 +205,11 @@ export default {
`, `,
th: ` th: `
border: 1px solid #202121; border: 1px solid #202121;
color: #555; color: ${fontSubColor};
`, `,
td: ` td: `
color:#555; color: ${fontSubColor};
border: 1px solid #555555; border: 1px solid ${fontSubColor};
`, `,
pre: ` pre: `
border-radius: 5px; border-radius: 5px;
@@ -211,12 +225,15 @@ export default {
const themeColor = this.themeColor; const themeColor = this.themeColor;
const codeBgColor = this.codeBgColor; const codeBgColor = this.codeBgColor;
const fontFamily = this.fontFamily; const fontFamily = this.fontFamily;
const fontColor = this.fontColor;
const fontSubColor = this.fontSubColor;
let zeroStyle = { let zeroStyle = {
p: ` p: `
margin:4px 0; margin:4px 0;
font-size: 15px; font-size: 15px;
line-height:1.55; line-height:1.55;
font-family: ${fontFamily}; font-family: ${fontFamily};
color: ${fontColor};
`, `,
// 一级标题 // 一级标题
h1: ` h1: `
@@ -272,11 +289,13 @@ export default {
// 列表 // 列表
ul: ` ul: `
margin: 4px 0; margin: 4px 0;
color: #555; font-size: 14px;
color: ${fontSubColor};
`, `,
li: ` li: `
margin: 4px 0; margin: 4px 0;
color: #555; font-size: 14px;
color: ${fontSubColor};
`, `,
// 链接 // 链接
a: ` a: `
@@ -311,12 +330,12 @@ export default {
border-collapse: collapse; border-collapse: collapse;
`, `,
th: ` th: `
border: 1px solid #202121; border: 1px solid ${fontSubColor};
color: #555; color: ${fontSubColor};
`, `,
td: ` td: `
color:#555; color: ${fontSubColor};
border: 1px solid #555555; border: 1px solid ${fontSubColor};
`, `,
pre: ` pre: `
border-radius: 5px; border-radius: 5px;

View File

@@ -6,7 +6,7 @@ class TypewriterManager {
constructor(options = {}) { constructor(options = {}) {
// 配置选项 // 配置选项
this.options = { this.options = {
typingSpeed: 50, // 打字速度(毫秒) typingSpeed: 10, // 打字速度(毫秒)- 调整为更快的速度
cursorText: "", // 光标样式 cursorText: "", // 光标样式
...options, ...options,
}; };