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": "消费"
},
{

@ -2,11 +2,7 @@
<view class="container">
<!-- 顶部图片和标题 -->
<view class="header-section">
<image
class="header-image"
src="/static/imgs/indexImg.png"
mode="aspectFill"
></image>
<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">
@ -18,42 +14,27 @@
<!-- 选择图纸模板 -->
<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>
<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>
@ -61,25 +42,19 @@
<!-- 设置参数 -->
<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-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-form-item prop="password" label="载重kg">
<uv-input
v-model="formField.password"
color="#000"
@ -134,26 +109,25 @@
v-model="formField.password"
placeholder="请输入"
></uv-textarea>
</uv-form-item>
</uv-form-item> -->
</uv-form>
</view>
</view>
<!-- 底部按钮 -->
<view class="bottom-actions">
<uv-button
:loading="generating"
@click="viewHistory"
text="生成图纸"
color="#3F70FF"
></uv-button>
<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 {
ref,
onMounted
} from "vue";
import {
onShow,
onLoad,
@ -161,21 +135,59 @@ import {
onShareTimeline,
onReachBottom,
} from "@dcloudio/uni-app";
import { useAuthStore, useUserStore } from "@/store";
import {
useAuthStore,
useUserStore
} from "@/store";
import RPC from "@/utils/request";
import { usePermission } from "@/hooks/usePermission";
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(() => {
//
const selectedTemplate = ref("passenger");
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 = (template) => {
selectedTemplate.value = template;
const selectTemplate = (item) => {
currentTemplate.value = JSON.parse(JSON.stringify(item));
};
const form = ref(null);
@ -196,50 +208,8 @@ const rules = ref({
// }
});
//
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",
});
@ -286,7 +256,8 @@ onLoad(() => {
padding-bottom: 52px;
/* #ifdef H5 */
padding-bottom: 102px; /* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */
padding-bottom: 102px;
/* H5环境下需要更多空间 (50px按钮 + 50px tabBar + 2px间距) */
/* #endif */
}
@ -341,6 +312,8 @@ onLoad(() => {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
max-height: 200px;
overflow-y: auto;
.template-item {
border: 1px solid #e5e5e5;
@ -385,7 +358,8 @@ onLoad(() => {
width: 100%;
/* #ifdef H5 */
bottom: 50px; /* H5环境下给tabBar留出空间 */
bottom: 50px;
/* H5环境下给tabBar留出空间 */
/* #endif */
}
</style>

@ -11,76 +11,40 @@
</view>
<div class="main">
<view class="form">
<uv-form
labelAlign="right"
labelWidth="50"
labelPosition="top"
:model="userInfo"
:rules="rules"
ref="form"
>
<uv-form labelAlign="right" labelWidth="50" labelPosition="top" :model="userInfo" :rules="rules"
ref="form">
<uv-form-item prop="phone">
<div class="formLabel">
<img class="img" src="/static/imgs/phone.png" alt="" />
手机号
</div>
<uv-input
v-model="userInfo.phone"
color="#000"
border="bottom"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入用户名"
></uv-input>
<uv-input v-model="userInfo.phone" color="#000" border="bottom"
:placeholderStyle="{ color: '#666778' }" placeholder="请输入用户名"></uv-input>
</uv-form-item>
<uv-form-item prop="password">
<div class="formLabel">
<img class="img" src="/static/imgs/code.png" alt="" />
验证码
</div>
<uv-input
v-model="userInfo.password"
color="#000"
border="bottom"
:placeholderStyle="{ color: '#666778' }"
placeholder="请输入验证码"
>
<uv-input v-model="userInfo.password" color="#000" border="bottom"
:placeholderStyle="{ color: '#666778' }" placeholder="请输入验证码">
<template v-slot:suffix>
<uv-code
ref="codeRef"
@change="codeChange"
seconds="20"
changeText="X秒重新获取"
></uv-code>
<uv-code ref="codeRef" @change="codeChange" seconds="20" changeText="X秒重新获取"></uv-code>
<text style="color: #4d82fd" @click="getCode">{{ tips }}</text>
</template>
</uv-input>
</uv-form-item>
</uv-form>
</view>
<uv-button
@click="login"
customStyle="margin-top:30px"
text="登录"
color="#3F70FF"
></uv-button>
<uv-button @click="login" customStyle="margin-top:30px" text="登录" color="#3F70FF"></uv-button>
<div class="wechatBox" v-if="showWechatLogin">
<uv-divider text="第三方登录"></uv-divider>
<uv-icon
name="weixin-circle-fill"
color="#5fc157"
size="50"
@click="wechatLogin"
></uv-icon>
<uv-icon name="weixin-circle-fill" color="#5fc157" size="50" @click="wechatLogin"></uv-icon>
</div>
</div>
<!-- 微信登录绑定手机号弹窗 -->
<uv-popup
ref="popup"
mode="center"
:closeOnClickOverlay="false"
:round="10"
>
<uv-popup ref="popup" mode="center" :closeOnClickOverlay="false" :round="10">
<view class="bind-phone-modal">
<view class="modal-header">
<view class="modal-title">绑定手机号</view>
@ -88,37 +52,17 @@
</view>
<view class="modal-form">
<uv-form
:model="bindPhoneInfo"
:rules="bindPhoneRules"
ref="bindPhoneForm"
>
<uv-form :model="bindPhoneInfo" :rules="bindPhoneRules" ref="bindPhoneForm">
<uv-form-item prop="phone">
<uv-input
v-model="bindPhoneInfo.phone"
placeholder="请输入手机号"
type="number"
maxlength="11"
border="surround"
></uv-input>
<uv-input v-model="bindPhoneInfo.phone" placeholder="请输入手机号" type="number" maxlength="11"
border="surround"></uv-input>
</uv-form-item>
<uv-form-item prop="code">
<uv-input
v-model="bindPhoneInfo.code"
placeholder="请输入验证码"
border="surround"
>
<uv-input v-model="bindPhoneInfo.code" placeholder="请输入验证码" border="surround">
<template v-slot:suffix>
<uv-code
ref="bindCodeRef"
@change="bindCodeChange"
seconds="60"
changeText="X秒重新获取"
></uv-code>
<text
style="color: #4d82fd; font-size: 12px"
@click="getBindCode"
>
<uv-code ref="bindCodeRef" @change="bindCodeChange" seconds="60"
changeText="X秒重新获取"></uv-code>
<text style="color: #4d82fd; font-size: 12px" @click="getBindCode">
{{ bindCodeTips }}
</text>
</template>
@ -135,11 +79,7 @@
>
取消
</uv-button> -->
<uv-button
type="primary"
@click="confirmBindPhone"
:loading="bindingPhone"
>
<uv-button type="primary" @click="confirmBindPhone" :loading="bindingPhone">
确认绑定
</uv-button>
</view>
@ -149,15 +89,23 @@
</template>
<script setup>
import { ref, onMounted } from "vue";
import {
ref,
onMounted
} from "vue";
import {
HOME_PATH,
LOGIN_PATH,
isTabBarPath,
removeQueryString,
} from "@/router";
import { useAuthStore, useUserStore } from "@/store";
import { onLoad } from "@dcloudio/uni-app";
import {
useAuthStore,
useUserStore
} from "@/store";
import {
onLoad
} from "@dcloudio/uni-app";
import RPC from "@/utils/request";
@ -179,8 +127,7 @@ const bindPhoneInfo = ref({
code: "",
});
const bindPhoneRules = ref({
phone: [
{
phone: [{
required: true,
message: "请输入手机号",
trigger: ["blur", "change"],
@ -240,17 +187,16 @@ const userInfo = ref({
password: "",
});
const rules = ref({
phone: [
{
phone: [{
required: true,
message: "请输入手机号",
trigger: ["blur", "change"],
},
{
pattern: /^1[3-9]\d{9}$/,
message: "请输入正确的手机号",
trigger: ["blur", "change"],
},
// {
// pattern: /^1[3-9]\d{9}$/,
// message: "",
// trigger: ["blur", "change"],
// },
],
password: {
required: true,
@ -419,7 +365,8 @@ const wechatH5Login = () => {
handleWechatH5Callback(code);
} else {
//
const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`;
const authUrl =
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`;
uni.showLoading({
title: "正在跳转微信授权...",
@ -464,8 +411,7 @@ const handleWechatH5Callback = async (code) => {
const url = new URL(window.location);
url.searchParams.delete("code");
url.searchParams.delete("state");
window.history.replaceState(
{},
window.history.replaceState({},
document.title,
url.pathname + url.search
);
@ -580,13 +526,34 @@ const login = async () => {
// url: redirect,
// });
// })
authStore.setAccessToken("accessToken");
setTimeout(() => {
RPC.post('/login', {
username: userInfo.value.phone,
password: userInfo.value.password,
}, {
custom: {
loading: true,
loadingText: '正在登录...'
},
})
.then((res) => {
authStore.setAccessToken(res.token);
RPC.post('/user/info', {
token: res.token,
})
.then((res) => {
userStore.setUserInfo(res)
uni.$uv.route({
type: isTabBarPath(redirect) ? "switchTab" : "redirectTo",
url: redirect,
});
}, 800);
})
.finally(() => {
loading.value = false
})
})
.catch(() => {
loading.value = false
})
};
onMounted(() => {
@ -611,11 +578,9 @@ onMounted(() => {
height: 100vh;
display: flex;
flex-direction: column;
background: linear-gradient(
124.92deg,
background: linear-gradient(124.92deg,
rgba(77, 130, 253, 1) 7.66%,
rgba(85, 184, 254, 1) 89.55%
);
rgba(85, 184, 254, 1) 89.55%);
.header {
height: 15vh;
@ -636,16 +601,19 @@ onMounted(() => {
background-color: #fff;
border-radius: 20px 20px 0 0;
padding: 7vw;
.formLabel {
display: flex;
align-items: center;
margin-bottom: 4px;
.img {
width: 20px;
height: 20px;
margin-right: 6px;
}
}
.wechatBox {
position: fixed;
width: 100%;

@ -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>

@ -2,181 +2,107 @@
<view class="container">
<!-- 生成记录列表 -->
<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-item">
<!-- 记录信息 -->
<view class="record-info">
<view class="record-title">{{ record.title }}</view>
<view class="record-time">生成时间: {{ record.generateTime }}</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 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">
<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>
<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>
下载
</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>
</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>
下载
</u-button>
</uv-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>
</uv-swipe-action-item>
</uv-swipe-action>
</view>
<!-- 空状态 -->
<view v-if="records.length === 0" class="empty-state">
<u-icon name="file-text" size="60" color="#ccc"></u-icon>
<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>
<!-- 加载更多 -->
<view v-if="hasMore && records.length > 0" class="load-more">
<u-button
type="default"
size="small"
:loading="loading"
@click="loadMore"
>
{{ loading ? "加载中..." : "加载更多" }}
</u-button>
</view>
<uv-load-more :status="loadingStatus" @loadmore="loadmore" />
</view>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
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 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 loadingStatus = ref('loadmore')
const page = ref(1)
const list = ref([])
const count = ref(0)
//
const downloadRecord = (record) => {
if (record.status !== "completed" || !record.downloadUrl) {
uni.showToast({
title: "文件未准备好",
icon: "none",
});
return;
}
uni.showLoading({
title: "准备下载...",
});
//
setTimeout(() => {
uni.hideLoading();
// API
uni.downloadFile({
url: record.result_url,
success: (res) => {
if (res.statusCode === 200) {
uni.saveFile({
tempFilePath: res.tempFilePath,
success: () => {
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);
title: '下载成功',
icon: 'success'
})
}
})
}
},
fail: () => {
uni.showToast({
title: '下载失败',
icon: 'none'
})
}
})
};
//
@ -208,60 +134,59 @@ const deleteRecord = (record) => {
});
};
//
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",
});
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'
})
};
//
const onRefresh = async () => {
hasMore.value = true;
await loadRecords();
};
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()
}
onMounted(() => {
loadRecords();
});
onShow(() => {
//
list.value = []
page.value = 1
loadRecords();
});
</script>
@ -305,6 +230,8 @@ onShow(() => {
border-radius: 4px;
font-size: 12px;
font-weight: 500;
background: #fff7e6;
color: #fa8c16;
&.completed {
background: #e8f5e8;

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