Lufaneng 11 months ago
parent d827e4e6c0
commit 0abb3ae117

@ -75,7 +75,8 @@
"path" : "generate-record/generate-record", "path" : "generate-record/generate-record",
"style" : "style" :
{ {
"navigationBarTitleText" : "图纸生成记录" "navigationBarTitleText" : "图纸生成记录",
"enablePullDownRefresh":true
} }
}, },
{ {
@ -119,18 +120,18 @@
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "static/tabbar/index.png", "iconPath": "static/tabbar/index.png",
"selectedIconPath": "static/tabbar/index_HL.png", "selectedIconPath": "static/tabbar/index_HL.png",
"text": "首页" "text": "图纸"
}, },
{ {
"pagePath": "pages/order/order", "pagePath": "pages/order/order",
"iconPath": "static/tabbar/appointment.png", "iconPath": "static/tabbar/order.png",
"selectedIconPath": "static/tabbar/appointment_HL.png", "selectedIconPath": "static/tabbar/order_HL.png",
"text": "订单" "text": "订单"
}, },
{ {
"pagePath": "pages/consumption/consumption", "pagePath": "pages/consumption/consumption",
"iconPath": "static/tabbar/appointment.png", "iconPath": "static/tabbar/xiaofei.png",
"selectedIconPath": "static/tabbar/appointment_HL.png", "selectedIconPath": "static/tabbar/xiaofei_HL.png",
"text": "消费" "text": "消费"
}, },
{ {

@ -1,85 +1,60 @@
<template> <template>
<view class="container"> <view class="container">
<!-- 顶部图片和标题 --> <!-- 顶部图片和标题 -->
<view class="header-section"> <view class="header-section">
<image <image class="header-image" src="/static/imgs/indexImg.png" mode="aspectFill"></image>
class="header-image" <view class="header-overlay">
src="/static/imgs/indexImg.png" <view class="header-title">生成电梯图纸</view>
mode="aspectFill" <view class="header-subtitle">
></image> 选择模板并设置参数快速生成专业电梯施工图
<view class="header-overlay"> </view>
<view class="header-title">生成电梯图纸</view> </view>
<view class="header-subtitle"> </view>
选择模板并设置参数快速生成专业电梯施工图
</view> <!-- 选择图纸模板 -->
</view> <view class="section">
</view> <view class="section-title">选择图纸模板</view>
<uv-skeletons v-if="loading" :loading="loading" :skeleton="[{
<!-- 选择图纸模板 --> type: 'flex',
<view class="section"> num: 2,
<view class="section-title">选择图纸模板</view> gap: '20rpx',
<view class="template-grid"> children:[{
<view type: 'custom',
class="template-item" num: 1,
:class="{ active: selectedTemplate === 'passenger' }" gap: '20rpx',
@click="selectTemplate('passenger')" style: 'width: 300rpx;height:200rpx;marginLeft: 10rpx;'
> },{
<u-icon name="edit-pen" color="#4285f4" size="24"></u-icon> type: 'custom',
<view class="template-name">乘客电梯标准图纸</view> num: 1,
<view class="template-desc">适用于住宅商业建筑</view> gap: '20rpx',
</view> style: 'width: 300rpx;height:200rpx;marginLeft: 10rpx;'
<view }]
class="template-item" }]"></uv-skeletons>
:class="{ active: selectedTemplate === 'freight' }" <view class="template-grid" v-else>
@click="selectTemplate('freight')" <view class="template-item" :class="{ active: currentTemplate.id === item.id }"
> @click="selectTemplate(item)" v-for="item in templateList" :key="item.id">
<u-icon name="car" color="#4285f4" size="24"></u-icon> <view class="template-name">{{item.name}}</view>
<view class="template-name">货运电梯专用图纸</view> <view class="template-desc">{{item.description}}</view>
<view class="template-desc">适用于仓库工厂</view> </view>
</view> </view>
<view </view>
class="template-item"
:class="{ active: selectedTemplate === 'medical' }" <!-- 设置参数 -->
@click="selectTemplate('medical')" <view class="section">
> <view class="section-title">设置参数</view>
<u-icon name="plus-circle" color="#4285f4" size="24"></u-icon> <uv-skeletons v-if="loading" :loading="loading" :skeleton="[{
<view class="template-name">医用电梯专业图纸</view> type: 'line',
<view class="template-desc">适用于医院医疗场所</view> num: 3,
</view> gap: '20rpx'
<view }]"></uv-skeletons>
class="template-item" <view class="form" v-else>
:class="{ active: selectedTemplate === 'sightseeing' }" <uv-form labelAlign="left" labelWidth="auto" labelPosition="left" :model="formField" :rules="rules"
@click="selectTemplate('sightseeing')" ref="form">
> <uv-form-item :prop="item.key" :label="item.name + ''" v-for="item in currentTemplate.params">
<u-icon name="eye" color="#4285f4" size="24"></u-icon> <uv-input :type="item.type === 'number' ? 'digit' : 'text'" v-model="item.value" color="#000"
<view class="template-name">观光电梯定制图纸</view> border="bottom" :placeholderStyle="{ color: '#666778' }" placeholder="请输入"></uv-input>
<view class="template-desc">适用于商场酒店</view> </uv-form-item>
</view> <!-- <uv-form-item prop="password" label="载重kg">
</view>
</view>
<!-- 设置参数 -->
<view class="section">
<view class="section-title">设置参数</view>
<view class="form">
<uv-form
labelAlign="left"
labelWidth="auto"
labelPosition="left"
:model="formField"
:rules="rules"
ref="form"
>
<uv-form-item prop="phone" label="电梯类型">
<uv-input
v-model="formField.phone"
color="#000"
border="none"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入"
></uv-input>
</uv-form-item>
<uv-form-item prop="password" label="载重kg">
<uv-input <uv-input
v-model="formField.password" v-model="formField.password"
color="#000" color="#000"
@ -134,266 +109,265 @@
v-model="formField.password" v-model="formField.password"
placeholder="请输入" placeholder="请输入"
></uv-textarea> ></uv-textarea>
</uv-form-item> </uv-form-item> -->
</uv-form> </uv-form>
</view> </view>
</view> </view>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<view class="bottom-actions"> <view class="bottom-actions">
<uv-button <uv-button :loading="generating" @click="() => modalRef.open()" text="生成图纸" color="#3F70FF"></uv-button>
:loading="generating" <uv-button @click="viewHistory" text="查看记录"></uv-button>
@click="viewHistory" </view>
text="生成图纸" <uv-modal ref="modalRef" showCancelButton content='确定生成图纸?' @confirm="confirmGenerate"></uv-modal>
color="#3F70FF" </view>
></uv-button>
<uv-button @click="viewHistory" text="查看记录"></uv-button>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue"; import {
import { ref,
onShow, onMounted
onLoad, } from "vue";
onShareAppMessage, import {
onShareTimeline, onShow,
onReachBottom, onLoad,
} from "@dcloudio/uni-app"; onShareAppMessage,
import { useAuthStore, useUserStore } from "@/store"; onShareTimeline,
import RPC from "@/utils/request"; onReachBottom,
import { usePermission } from "@/hooks/usePermission"; } from "@dcloudio/uni-app";
import {
const authStore = useAuthStore(); useAuthStore,
const userStore = useUserStore(); useUserStore
} from "@/store";
const generating = ref(false); import RPC from "@/utils/request";
import {
// usePermission
const selectedTemplate = ref("passenger"); } from "@/hooks/usePermission";
// const authStore = useAuthStore();
const selectTemplate = (template) => { const userStore = useUserStore();
selectedTemplate.value = template; const loading = ref(false)
};
const generating = ref(false);
const form = ref(null); const modalRef = ref(null)
const formField = ref({ const confirmGenerate = () => {
phone: "", const params = {}
password: "", currentTemplate.value.params.forEach(item => {
}); params[item.name] = item.value
const rules = ref({ })
// 'phone': { RPC.post('/template_create_task', {template_id:currentTemplate.value.id,template_data:params}).then(() => {
// required: true,
// message: '', uni.showToast({
// trigger: ['blur', 'change'] title: "图纸开始生成",
// }, icon: "success",
// 'password': { });
// required: true, setTimeout(() => {
// message: '', uni.navigateTo({
// trigger: ['blur', 'change'] url: "/pagesA/generate-record/generate-record",
// } });
}); }, 1000)
modalRef.value.close()
// })
const generateDrawing = async () => { }
if (!selectedTemplate.value) { const templateList = ref([])
uni.showToast({ const currentTemplate = ref({})
title: "请选择图纸模板", const getList = () => {
icon: "none", loading.value = true
}); RPC.post('/template/list', {
return; page: 1,
} limit: -1
}).then(res => {
generating.value = true; templateList.value = res.rows || []
try { currentTemplate.value = res.rows[0] ? JSON.parse(JSON.stringify(res.rows[0])) : {}
const params = {}; }).finally(() => {
loading.value = false
// API })
// const result = await RPC.post('/api/generate-drawing', params) }
getList()
uni.showToast({
title: "图纸生成中...", //
icon: "loading", const selectTemplate = (item) => {
duration: 2000, currentTemplate.value = JSON.parse(JSON.stringify(item));
}); };
// const form = ref(null);
setTimeout(() => { const formField = ref({
uni.showToast({ phone: "",
title: "图纸生成成功", password: "",
icon: "success", });
}); const rules = ref({
generating.value = false; // 'phone': {
}, 2000); // required: true,
} catch (error) { // message: '',
console.error("生成图纸失败:", error); // trigger: ['blur', 'change']
uni.showToast({ // },
title: "生成失败,请重试", // 'password': {
icon: "none", // required: true,
}); // message: '',
generating.value = false; // trigger: ['blur', 'change']
} // }
}; });
//
const viewHistory = () => {
console.log(111);
uni.navigateTo({
url: "/pagesA/generate-record/generate-record",
});
};
// //
onShareAppMessage((data) => { const viewHistory = () => {
console.log("🚀 ~ onShareAppMessage ~ data:", data); uni.navigateTo({
return { url: "/pagesA/generate-record/generate-record",
title: "电梯图纸生成平台", });
path: "/pages/index/index", };
};
}); //
onShareAppMessage((data) => {
console.log("🚀 ~ onShareAppMessage ~ data:", data);
return {
title: "电梯图纸生成平台",
path: "/pages/index/index",
};
});
// //
onShareTimeline((data) => { onShareTimeline((data) => {
console.log("🚀 ~ onShareTimeline ~ data:", data); console.log("🚀 ~ onShareTimeline ~ data:", data);
return { return {
title: "电梯图纸生成平台", title: "电梯图纸生成平台",
query: "a=1&b=2", query: "a=1&b=2",
}; };
}); });
onLoad(() => { onLoad(() => {
console.log("index-onLoad"); console.log("index-onLoad");
}); });
onShow(async () => { onShow(async () => {
console.log("test page onShow"); console.log("test page onShow");
const hasPermission = await usePermission(); const hasPermission = await usePermission();
console.log(hasPermission ? "已登录" : "跳转登录"); console.log(hasPermission ? "已登录" : "跳转登录");
// ... // ...
if(!hasPermission) { if (!hasPermission) {
authStore.signOut(); authStore.signOut();
uni.$uv.route("/pages/login/login"); uni.$uv.route("/pages/login/login");
} }
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
font-size: 14px; font-size: 14px;
min-height: 100vh; min-height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
padding-bottom: 52px; padding-bottom: 52px;
/* #ifdef H5 */ /* #ifdef H5 */
padding-bottom: 102px; /* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */ padding-bottom: 102px;
/* #endif */ /* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */
} /* #endif */
}
.header-section {
position: relative; .header-section {
height: 200px; position: relative;
overflow: hidden; height: 200px;
overflow: hidden;
.header-image {
width: 100%; .header-image {
height: 100%; width: 100%;
} height: 100%;
}
.header-overlay {
position: absolute; .header-overlay {
top: 50%; position: absolute;
right: 0; top: 50%;
background: rgba(0, 0, 0, 0.5); right: 0;
color: white; background: rgba(0, 0, 0, 0.5);
width: 70%; color: white;
transform: translate(0, -50%); width: 70%;
padding: 20px 10px; transform: translate(0, -50%);
padding: 20px 10px;
.header-title {
font-size: 16px; .header-title {
font-weight: bold; font-size: 16px;
margin-bottom: 8px; font-weight: bold;
color: #bd9e85; margin-bottom: 8px;
} color: #bd9e85;
}
.header-subtitle {
font-size: 12px; .header-subtitle {
} font-size: 12px;
} }
} }
}
.section {
margin: 16px; .section {
background: white; margin: 16px;
border-radius: 12px; background: white;
padding: 16px; border-radius: 12px;
padding: 16px;
.section-title {
font-size: 16px; .section-title {
font-weight: bold; font-size: 16px;
color: #333; font-weight: bold;
margin-bottom: 16px; color: #333;
} margin-bottom: 16px;
} }
}
.template-grid {
display: grid; .template-grid {
grid-template-columns: 1fr 1fr; display: grid;
gap: 12px; grid-template-columns: 1fr 1fr;
gap: 12px;
.template-item { max-height: 200px;
border: 1px solid #e5e5e5; overflow-y: auto;
border-radius: 8px;
padding: 16px 12px; .template-item {
text-align: center; border: 1px solid #e5e5e5;
transition: all 0.3s; border-radius: 8px;
padding: 16px 12px;
&.active { text-align: center;
border-color: #4285f4; transition: all 0.3s;
background-color: #f0f7ff;
} &.active {
border-color: #4285f4;
.template-name { background-color: #f0f7ff;
font-size: 14px; }
font-weight: 500;
color: #333; .template-name {
margin: 8px 0 4px; font-size: 14px;
} font-weight: 500;
color: #333;
.template-desc { margin: 8px 0 4px;
font-size: 12px; }
color: #999;
} .template-desc {
} font-size: 12px;
} color: #999;
}
.bottom-actions { }
z-index: 999; }
position: fixed;
bottom: 0; .bottom-actions {
left: 0; z-index: 999;
background: #fff; position: fixed;
height: 50px; bottom: 0;
border-top: 1px solid #e5e5e5; left: 0;
display: flex; background: #fff;
align-items: center; height: 50px;
gap: 12px; border-top: 1px solid #e5e5e5;
justify-content: space-between; display: flex;
padding: 0 16px; align-items: center;
box-sizing: border-box; gap: 12px;
width: 100%; justify-content: space-between;
padding: 0 16px;
/* #ifdef H5 */ box-sizing: border-box;
bottom: 50px; /* H5环境下给tabBar留出空间 */ width: 100%;
/* #endif */
} /* #ifdef H5 */
bottom: 50px;
/* H5环境下给tabBar留出空间 */
/* #endif */
}
</style> </style>
<style lang="scss"> <style lang="scss">
.bottom-actions { .bottom-actions {
.uv-button-wrapper { .uv-button-wrapper {
width: 48%; width: 48%;
} }
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -16,14 +16,14 @@
></image> --> ></image> -->
<view class="user-details"> <view class="user-details">
<view class="username"> <view class="username">
张三 {{userStore.userInfo.username}}
<u-icon <u-icon
name="checkmark-circle-fill" name="checkmark-circle-fill"
color="#ffa500" color="#ffa500"
size="16" size="16"
></u-icon> ></u-icon>
</view> </view>
<view class="user-id">用户ID: U12345678</view> <view class="user-id">用户ID: {{userStore.userInfo.id}}</view>
<view class="membership"> <view class="membership">
会员等级: 年会员 (有效期至: 2026-05-15) 会员等级: 年会员 (有效期至: 2026-05-15)
</view> </view>

@ -79,7 +79,7 @@
@click="logout" @click="logout"
:loading="logoutLoading" :loading="logoutLoading"
> >
退出登 退出登
</uv-button> </uv-button>
</view> </view>

@ -1,351 +1,278 @@
<template> <template>
<view class="container"> <view class="container">
<!-- 生成记录列表 --> <!-- 生成记录列表 -->
<view class="record-list"> <view class="record-list">
<view class="record-item" v-for="record in records" :key="record.id"> <uv-swipe-action>
<!-- 记录信息 --> <uv-swipe-action-item @click="delItem(record)" :options="options" v-for="record in list" :key="record.id">
<view class="record-info"> <view class="record-item">
<view class="record-title">{{ record.title }}</view> <!-- 记录信息 -->
<view class="record-time">生成时间: {{ record.generateTime }}</view> <view class="record-info">
</view> <view class="record-title">{{ record.file_name }}</view>
<view class="record-time">生成时间: {{ record.CreatedAt ? dayjs(record.CreatedAt).format('YYYY-MM-DD') : '' }}</view>
<!-- 状态标签 --> </view>
<view class="status-tag" :class="record.status">
{{ record.statusText }} <!-- 状态标签 -->
</view> <view class="status-tag" :class="{completed:record.status == 4,failed:record.status == 5}">
<span v-if="record.status == 4"></span>
<!-- 操作按钮 --> <span v-else-if="record.status == 5">生成失败</span>
<view class="record-actions"> <span v-else></span>
<u-button </view>
v-if="record.status === 'completed'"
type="primary" <!-- 操作按钮 -->
size="small" <view class="record-actions">
@click="downloadRecord(record)" <uv-button v-if="record.status === 4" type="primary" size="small"
> @click="downloadRecord(record)">
<u-icon <uv-icon name="download" size="14" color="white" style="margin-right: 4px"></uv-icon>
name="download" 下载
size="14" </uv-button>
color="white" <uv-button v-else type="info" size="small" disabled>
style="margin-right: 4px" <uv-icon name="download" size="14" color="#aaa" style="margin-right: 4px"></uv-icon>
></u-icon> 下载
下载 </uv-button>
</u-button>
<u-button v-else type="info" size="small" disabled> </view>
<u-icon </view>
name="download" </uv-swipe-action-item>
size="14" </uv-swipe-action>
color="white" </view>
style="margin-right: 4px"
></u-icon> <!-- 空状态 -->
下载 <view v-if="list.length === 0" class="empty-state">
</u-button> <uv-icon name="file-text" size="60" color="#ccc"></uv-icon>
<text class="empty-text">暂无生成记录</text>
<u-button </view>
v-if="record.status === 'failed'"
type="error" <!-- 加载更多 -->
size="small" <uv-load-more :status="loadingStatus" @loadmore="loadmore" />
@click="deleteRecord(record)" </view>
style="margin-left: 8px"
>
<u-icon
name="trash"
size="14"
color="white"
style="margin-right: 4px"
></u-icon>
删除
</u-button>
</view>
</view>
</view>
<!-- 空状态 -->
<view v-if="records.length === 0" class="empty-state">
<u-icon name="file-text" size="60" color="#ccc"></u-icon>
<text class="empty-text">暂无生成记录</text>
</view>
<!-- 加载更多 -->
<view v-if="hasMore && records.length > 0" class="load-more">
<u-button
type="default"
size="small"
:loading="loading"
@click="loadMore"
>
{{ loading ? "加载中..." : "加载更多" }}
</u-button>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue"; import {
import { onShow } from "@dcloudio/uni-app"; ref,
onMounted
// } from "vue";
const loading = ref(false); import RPC from "@/utils/request";
const hasMore = ref(true); import dayjs from 'dayjs'
const records = ref([ import {
{ onShow,onPullDownRefresh,onReachBottom
id: 1, } from "@dcloudio/uni-app";
title: "乘客电梯标准图纸",
generateTime: "2025-05-15 14:30", const options = ref([{
status: "completed", text: '删除',
statusText: "已完成", style: {
downloadUrl: "/static/files/passenger-elevator.pdf", backgroundColor: '#f56c6c'
}, }
{ }])
id: 2, const delItem = item => {
title: "货运电梯专用图纸", console.log(item)
generateTime: "2025-05-15 14:30", deleteRecord(item)
status: "failed", }
statusText: "未完成", //
downloadUrl: null, const loading = ref(false);
}, const loadingStatus = ref('loadmore')
{ const page = ref(1)
id: 3, const list = ref([])
title: "医用电梯专业图纸", const count = ref(0)
generateTime: "2025-05-15 14:30",
status: "completed", //
statusText: "已完成", const downloadRecord = (record) => {
downloadUrl: "/static/files/medical-elevator.pdf",
}, uni.showLoading({
{ title: "准备下载...",
id: 4, });
title: "观光电梯定制图纸", uni.downloadFile({
generateTime: "2025-05-15 14:30", url: record.result_url,
status: "completed", success: (res) => {
statusText: "已完成", if (res.statusCode === 200) {
downloadUrl: "/static/files/sightseeing-elevator.pdf", uni.saveFile({
}, tempFilePath: res.tempFilePath,
{ success: () => {
id: 5, uni.showToast({
title: "货运电梯专用图纸", title: '下载成功',
generateTime: "2025-05-15 14:30", icon: 'success'
status: "failed", })
statusText: "未完成", }
downloadUrl: null, })
}, }
]); },
fail: () => {
// uni.showToast({
const downloadRecord = (record) => { title: '下载失败',
if (record.status !== "completed" || !record.downloadUrl) { icon: 'none'
uni.showToast({ })
title: "文件未准备好", }
icon: "none", })
}); };
return;
} //
const deleteRecord = (record) => {
uni.showLoading({ uni.showModal({
title: "准备下载...", title: "确认删除",
}); content: "确定要删除这条生成记录吗?删除后无法恢复。",
success: (res) => {
// if (res.confirm) {
setTimeout(() => { //
uni.hideLoading(); const index = records.value.findIndex((item) => item.id === record.id);
if (index !== -1) {
// API records.value.splice(index, 1);
uni.showToast({ }
title: "下载成功",
icon: "success", uni.showToast({
}); title: "删除成功",
icon: "success",
// });
// uni.downloadFile({
// url: record.downloadUrl, // API
// success: (res) => { // try {
// if (res.statusCode === 200) { // await RPC.post('/api/generate-record/delete', { id: record.id })
// uni.saveFile({ // } catch (error) {
// tempFilePath: res.tempFilePath, // console.error(':', error)
// success: () => { // }
// uni.showToast({ }
// title: '', },
// icon: 'success' });
// }) };
// }
// }) //
// } const loadRecords = async () => {
// }, loadingStatus.value === 'loading'
// fail: () => { RPC.post('/planned_list',{page:page.value,page_size:20}).then(res => {
// uni.showToast({ list.value = [...list.value, ...res.list]
// title: '', count.value = res.total
// icon: 'none' if (list.value.length >= count.value) {
// }) loadingStatus.value = 'nomore'
// } } else {
// }) loadingStatus.value = 'loadmore'
}, 1500); }
}; }).catch(() => {
loadingStatus.value = 'loadmore'
// })
const deleteRecord = (record) => { };
uni.showModal({
title: "确认删除", //
content: "确定要删除这条生成记录吗?删除后无法恢复。", onPullDownRefresh(() => {
success: (res) => { list.value = []
if (res.confirm) { page.value = 1
// loadingStatus.value === 'loading'
const index = records.value.findIndex((item) => item.id === record.id); RPC.post('/planned_list',{page:page.value,page_size:20}).then(res => {
if (index !== -1) { list.value = [...list.value, ...res.list]
records.value.splice(index, 1); count.value = res.total
} if (list.value.length >= count.value) {
loadingStatus.value = 'nomore'
uni.showToast({ } else {
title: "删除成功", loadingStatus.value = 'loadmore'
icon: "success", }
}); }).catch(() => {
loadingStatus.value = 'loadmore'
// API }).finally(() => {
// try { uni.stopPullDownRefresh()
// await RPC.post('/api/generate-record/delete', { id: record.id }) })
// } catch (error) { })
// console.error(':', error)
// } onReachBottom(() => {
} loadmore()
}, })
});
}; const loadmore = () => {
if (list.value.length >= count.value || loadingStatus.value === 'loading') return
// console.log('上拉加载:')
const loadMore = async () => { loadingStatus.value = 'loading';
if (loading.value) return; page.value = ++page.value;
loadRecords()
loading.value = true; }
try {
// API
await new Promise((resolve) => setTimeout(resolve, 1000)); onShow(() => {
//
// list.value = []
hasMore.value = false; page.value = 1
loadRecords();
uni.showToast({ });
title: "没有更多数据了",
icon: "none",
});
} catch (error) {
console.error("加载更多失败:", error);
uni.showToast({
title: "加载失败,请重试",
icon: "none",
});
} finally {
loading.value = false;
}
};
//
const loadRecords = async () => {
try {
// API
// const result = await RPC.get('/api/generate-records')
// records.value = result.data
} catch (error) {
console.error("加载生成记录失败:", error);
uni.showToast({
title: "加载失败,请重试",
icon: "none",
});
}
};
//
const onRefresh = async () => {
hasMore.value = true;
await loadRecords();
};
onMounted(() => {
loadRecords();
});
onShow(() => {
//
loadRecords();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
font-size: 14px; font-size: 14px;
min-height: 100vh; min-height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
padding: 16px; padding: 16px;
} }
.record-list { .record-list {
.record-item { .record-item {
background: white; background: white;
border-radius: 12px; border-radius: 12px;
padding: 16px; padding: 16px;
margin-bottom: 12px; margin-bottom: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
.record-info { .record-info {
flex: 1; flex: 1;
.record-title { .record-title {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
font-weight: 500; font-weight: 500;
margin-bottom: 6px; margin-bottom: 6px;
} }
.record-time { .record-time {
font-size: 13px; font-size: 13px;
color: #999; color: #999;
} }
} }
.status-tag { .status-tag {
padding: 4px 8px; padding: 4px 8px;
border-radius: 4px; border-radius: 4px;
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
background: #fff7e6;
&.completed { color: #fa8c16;
background: #e8f5e8;
color: #52c41a; &.completed {
} background: #e8f5e8;
color: #52c41a;
&.failed { }
background: #fff1f0;
color: #ff4d4f; &.failed {
} background: #fff1f0;
color: #ff4d4f;
&.processing { }
background: #fff7e6;
color: #fa8c16; &.processing {
} background: #fff7e6;
} color: #fa8c16;
}
.record-actions { }
display: flex;
align-items: center; .record-actions {
flex-shrink: 0; display: flex;
} align-items: center;
} flex-shrink: 0;
} }
}
.empty-state { }
display: flex;
flex-direction: column; .empty-state {
align-items: center; display: flex;
justify-content: center; flex-direction: column;
padding: 80px 20px; align-items: center;
justify-content: center;
.empty-text { padding: 80px 20px;
color: #999;
font-size: 14px; .empty-text {
margin-top: 16px; color: #999;
} font-size: 14px;
} margin-top: 16px;
}
.load-more { }
padding: 20px;
text-align: center; .load-more {
} padding: 20px;
text-align: center;
}
</style> </style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

@ -124,7 +124,10 @@ $uv.http.interceptors.request.use(
} }
const method = config.url const method = config.url
config.url = 'https://lift-dev.ruixininfo.com/jsonrpc' config.url = 'https://lift-drawing.ruixininfo.com/jsonrpc'
// #ifdef H5
config.url = '/jsonrpc'
// #endif
// config.url = useUserStore().adressIp + '/jsonrpc' // config.url = useUserStore().adressIp + '/jsonrpc'
const params = config.data const params = config.data
config.data = { config.data = {

@ -26,11 +26,10 @@ export default defineConfig(({ mode }) => {
server: { server: {
port: Number.parseInt(env.VITE_APP_PORT, 10), port: Number.parseInt(env.VITE_APP_PORT, 10),
proxy: { proxy: {
[env.VITE_APP_PROXY_PREFIX]: { ['/jsonrpc']: {
changeOrigin: true, changeOrigin: true,
target: env.VITE_APP_BASE_URL, target: 'https://lift-drawing-h5.ruixininfo.com',
rewrite: (path) => // target: 'https://lift-drawing.ruixininfo.com',
path.replace(new RegExp("^" + env.VITE_APP_PROXY_PREFIX), ""),
}, },
}, },
}, },

Loading…
Cancel
Save