Lufaneng 11 months ago
parent d827e4e6c0
commit 0abb3ae117

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

Loading…
Cancel
Save