This commit is contained in:
qiuyuan 2025-08-01 09:34:21 +08:00
parent ef0b041232
commit 9efdb48938
4 changed files with 847 additions and 746 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,180 +1,216 @@
<template> <template>
<view class="aiHelper">
<view class="aiHelper"> <view class="aiHelperContainer">
<!-- 标题区域 -->
<view class="aiHelperContainer"> <view class="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">
{{ aiHelperTitle }}
<view class="aiHelperTitle" :style="{'background-image': `url(${aiHelperTitleBackground})`}">{{aiHelperTitle}}</view> </view>
<view class="aiBox">
<view class="aiType" v-for="(item,index) in aiType" :key="item.id" @click="goAiType(item)"> <!-- AI类型卡片容器 -->
<view class="aiTypeContainer" :style="{'background-image': `url(${item.background})`}"> <view class="aiBox">
<view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}"> <view class="aiType" v-for="(item, index) in aiType" :key="item.id" @click="goAiType(item)">
<view class="aiLeftTitle">{{item.name}}</view> <view class="aiTypeContainer" :style="{'background-image': `url(${item.background})`}">
</view> <view class="aiLeft" :style="{'background-image': `url(${item.imagePath})`}">
<view class="aiRight"> <view class="aiLeftTitle">{{ item.name }}</view>
<view class="aiRightTitle"><text>{{item.description}}</text></view> </view>
<view class="aiDescription"><text>开始对话></text></view> <view class="aiRight">
</view> <view class="aiRightTitle"><text>{{ item.description }}</text></view>
</view> <view class="aiDescription"><text>开始对话></text></view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
<view><Footer></Footer></view>
<view><Footer></Footer></view>
</view> </view>
</template> </template>
<script> <script>
import Footer from '@/components/footer_common.vue'; import Footer from '@/components/footer_common.vue';
import {get,post} from '@/utils/request'; import { get, post } from '@/utils/request';
import {IMAGE_BASE_URL,BASE_URL} from '@/utils/config'; import { IMAGE_BASE_URL, BASE_URL } from '@/utils/config';
export default{ export default {
name:'aiHelper', name: 'aiHelper',
components:{Footer}, components: { Footer },
data(){ data() {
return{ return {
aiHelperTitle:'AI智能助手', aiHelperTitle: 'AI智能助手',
aiHelperTitleBackground:'../../static/imgs/ai/title.png', aiHelperTitleBackground: '../../static/imgs/ai/title.png',
aiType:[], aiType: [],
} }
}, },
mounted() { mounted() {
this.getData(); this.getData();
}, },
methods:{ methods: {
goAiType(item){ goAiType(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/chatPage?serviceUrl=${item.serviceUrl}&apiKey=${item.apiKey}&id=${item.id}&name=${item.name}&icon=${item.icon}` url: `/pages/chat/chatPage?serviceUrl=${item.serviceUrl}&apiKey=${item.apiKey}&id=${item.id}&name=${item.name}&icon=${item.icon}`
}); });
}, },
async getData(){ async getData() {
let params = { let params = {
current: 1, current: 1,
pageSize: 10, pageSize: 10,
}; };
try { try {
const res = await get('/api/v1/apps/ai_request', params); const res = await get('/api/v1/apps/ai_request', params);
if (!res || !res.success) { if (!res || !res.success) {
throw new Error('获取AI助手失败'); throw new Error('获取AI助手失败');
} }
if(res.data.length>0){ if (res.data.length > 0) {
res.data.forEach((item)=>{ res.data.forEach((item) => {
item.background=IMAGE_BASE_URL+item.background item.background = IMAGE_BASE_URL + item.background
item.imagePath=IMAGE_BASE_URL+item.imagePath item.imagePath = IMAGE_BASE_URL + item.imagePath
item.icon=IMAGE_BASE_URL+item.icon item.icon = IMAGE_BASE_URL + item.icon
}) })
} }
this.aiType=res.data this.aiType = res.data
} catch (err) { } catch (err) {
console.error('获取AI助手失败:', err); console.error('获取AI助手失败:', err);
} }
} }
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.aiHelper{ //
// margin-top: 90rpx; // @import "@/styles/variables.scss"; //
.aiHelperContainer {
padding: 2%; .aiHelper {
padding-bottom: 50%; // 使
padding-bottom: constant(safe-area-inset-bottom);
.aiHelperTitle { padding-bottom: env(safe-area-inset-bottom);
font-size: 1rem;
font-weight: 600; .aiHelperContainer {
letter-spacing: 0; padding: 30rpx; // 使rpx
line-height: 1.5; box-sizing: border-box; // padding
color: rgba(0, 0, 0, 1);
text-align: center; .aiHelperTitle {
vertical-align: top; font-size: 36rpx;
margin-bottom: 3%; font-weight: 600;
// background-image: url('../../static/imgs/ai/title.png'); color: #000;
background-repeat: no-repeat; text-align: center;
background-position: 50% 80%; // padding: 20rpx 0 30rpx; //
background-size: 30%; background-repeat: no-repeat;
} background-position: 50% 80%;
background-size: 30%;
.aiBox { line-height: 1.5;
.aiType { }
margin-bottom: 3%;
width: 100%; .aiBox {
height: 310rpx; //
display: flex; padding: 10rpx 0;
justify-content: center;
.aiType {
.aiTypeContainer { // 使
display: flex; margin-bottom: 30rpx;
margin: 1%; width: 100%;
border-radius: 0.5rem; display: flex;
background-size: cover; justify-content: center;
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.25);
background-position: 30% 50%; .aiTypeContainer {
background-repeat: no-repeat; display: flex;
width: 96%; border-radius: 20rpx; //
aspect-ratio: 2.1/1; background-size: cover;
background-position: 30% 50%;
.aiLeft { background-repeat: no-repeat;
border-radius: 0.5rem; width: 100%;
padding: 5% 0; // 使aspect-ratio
margin-right: 12%; height: 320rpx;
background-size: cover; box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15); //
background-position: center; overflow: hidden; //
background-repeat: no-repeat;
width: 35%; .aiLeft {
// height: 100%; border-radius: 16rpx;
/* margin-left: -5%;*/ padding: 5% 0;
position: relative; margin-right: 12%;
background-size: cover;
.aiLeftTitle { background-position: center;
font-size: 0.8rem; background-repeat: no-repeat;
font-weight: 900; width: 35%;
letter-spacing: 0; position: relative;
line-height: 1.4; //
color: rgba(255, 255, 255, 1); padding: 20rpx;
text-align: left;
position: absolute; .aiLeftTitle {
bottom: 10%; font-size: 30rpx;
left: 10%; font-weight: 900;
} color: #fff;
} text-align: left;
position: absolute;
.aiRight { bottom: 20rpx;
flex: 1; left: 20rpx;
display: flex; text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3); //
flex-direction: column; }
justify-content: normal; }
.aiRightTitle { .aiRight {
font-size: 0.8rem; flex: 1;
font-weight: 700; display: flex;
letter-spacing: 0; flex-direction: column;
line-height: 1.4; justify-content: center;
color: rgba(0, 0, 0, 1); padding-right: 30rpx; //
text-align: left;
margin-bottom: 5%; .aiRightTitle {
margin-top: 22%; font-size: 30rpx;
} font-weight: 700;
color: #000;
.aiDescription { text-align: left;
font-size: 26rpx; margin-bottom: 20rpx;
font-weight: 700; line-height: 1.5; //
letter-spacing: 0; //
line-height: 2.5; max-width: 100%;
color: #999; overflow: hidden;
text-align: right; text-overflow: ellipsis;
width: 90%; display: -webkit-box;
} -webkit-line-clamp: 2;
} -webkit-box-orient: vertical;
} }
}
} .aiDescription {
} font-size: 26rpx;
} font-weight: 700;
color: #999;
text-align: right;
width: 100%;
padding-top: 10rpx;
//
transition: color 0.3s ease;
}
}
}
// hover
&:active .aiTypeContainer {
transform: scale(0.98);
transition: transform 0.2s ease;
}
&:active .aiDescription {
color: #666;
}
}
}
}
}
//
@media screen and (min-width: 750rpx) {
.aiTypeContainer {
height: 340rpx !important;
}
}
@media screen and (max-width: 375rpx) {
.aiTypeContainer {
height: 280rpx !important;
}
.aiRightTitle {
font-size: 28rpx !important;
}
}
</style> </style>

View File

@ -157,8 +157,7 @@
{ {
key: 5, key: 5,
url: "/static/imgs/service/service_notice.png", url: "/static/imgs/service/service_notice.png",
name: '设置', name: '设置'
pageUrl: 'serviceNoticeList'
}, },
{ {
key: 6, key: 6,
@ -560,22 +559,28 @@
}, },
// //
goPage(item) { //
if (item.key === 6) { // goPage(item) {
this.handleContactCommunity(); if (item.key === 6) { //
return; this.handleContactCommunity();
} return;
}
if (!this.checkLogin()) {
this.showEditModal = true; if (item.key === 5) { //
return; this.handleEditClick(); //
} return;
}
if (item.pageUrl) {
uni.navigateTo({ if (!this.checkLogin()) {
url: `/pages/${item.pageUrl}/index` this.showEditModal = true;
}); return;
} }
if (item.pageUrl) {
uni.navigateTo({
url: `/pages/${item.pageUrl}/index`
});
}
}, },
// //

View File

@ -3,16 +3,20 @@
<view class="content"> <view class="content">
<!-- 选择区域 --> <!-- 选择区域 -->
<view class="form-item"> <view class="form-item">
<view class="label" @click="showSelect = true" style="margin-bottom: 0;"> <view class="label" @click="showTypeSelect = true" style="margin-bottom: 0;">
<u-icon name="list" color="#3B8CFF" size="38"></u-icon> <u-icon name="list" color="#3B8CFF" size="38"></u-icon>
选择区域 选择区域
<view class="select-box"> <view class="select-box">
{{ workOrderArea || '请选择' }} {{ workOrderArea || '请选择' }}
<u-icon name="arrow-down" color="#999" size="30"></u-icon> <u-icon name="arrow-down" color="#999" size="30"></u-icon>
</view> </view>
</view> </view>
<u-picker :show="showSelect" :columns="areaList" keyName="label" @confirm="handleConfirm" <u-picker
@cancel="handleCancel"> :show="showTypeSelect"
:columns="areaList"
keyName="title"
@confirm="handleTypeConfirm"
@cancel="showTypeSelect = false">
</u-picker> </u-picker>
</view> </view>
@ -116,17 +120,22 @@
fileList: [], fileList: [],
workOrderCategory: '', workOrderCategory: '',
workOrderCategoryID: '', workOrderCategoryID: '',
workOrderArea:'',
workOrderAreaID:'',
showSelect: false, showSelect: false,
showTypeSelect:false,
categoryList: [], categoryList: [],
workOrderLocation: '', workOrderLocation: '',
expectedTime: '', expectedTime: '',
uploadedImages: [], uploadedImages: [],
uploadedVideos: [], uploadedVideos: [],
videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv'] videoFormats: ['mp4', 'mov', 'avi', 'wmv', 'mpeg', '3gp', 'flv', 'mkv'],
areaList:[],
}; };
}, },
mounted() { mounted() {
this.getOrderList(); this.getOrderList();
this.getOrderTypeList();
}, },
methods: { methods: {
handleBack() { handleBack() {
@ -298,6 +307,7 @@
concatName: this.concatName, // concatName: this.concatName, //
customerPhone: this.customerPhone, // customerPhone: this.customerPhone, //
orderTypeId: this.workOrderCategoryID, orderTypeId: this.workOrderCategoryID,
orderAreaId:this.workOrderAreaID,
address: this.workOrderLocation, address: this.workOrderLocation,
images: this.uploadedImages, images: this.uploadedImages,
videos: this.uploadedVideos, videos: this.uploadedVideos,
@ -340,6 +350,8 @@
this.fileList = []; this.fileList = [];
this.uploadedImages = []; this.uploadedImages = [];
this.uploadedVideos = []; this.uploadedVideos = [];
this.workOrderArea = '';
this.workOrderAreaID = '';
}, },
handleConfirm(e) { handleConfirm(e) {
@ -347,6 +359,12 @@
this.workOrderCategoryID = e.value[0].id; this.workOrderCategoryID = e.value[0].id;
this.showSelect = false; this.showSelect = false;
}, },
handleTypeConfirm(e) {
this.workOrderArea = e.value[0].title;
this.workOrderAreaID = e.value[0].id;
this.showTypeSelect = false;
},
handleCancel() { handleCancel() {
this.showSelect = false; this.showSelect = false;
@ -368,6 +386,24 @@
}); });
} }
}, },
//
async getOrderTypeList(){
try {
const res = await get('/api/v1/apps/work-order-area');
if (res?.success) {
this.areaList = [
[...res.data]
]
}
} catch (err) {
console.error('获取工作区域失败:', err);
uni.showToast({
title: '获取工作区域失败',
icon: 'none'
});
}
}
} }
}; };
</script> </script>