From 00ad605bc2f711e5599394b787403275034c6e72 Mon Sep 17 00:00:00 2001 From: liaodeyun Date: Tue, 25 Nov 2025 10:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E5=96=84=E9=A6=96?= =?UTF-8?q?=E9=A1=B5,=E6=B6=88=E9=99=A4bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 64 +- .../geek-confirm-dialog.vue | 208 +++--- .../geek-uploadbox/geek-uploadbox.vue | 474 +++++++------- pages.json | 590 +++++++++--------- pages/index.vue | 211 +++++-- pages/work.vue | 211 ++----- pages_caltools/pages/index.vue | 120 ++-- pages_mine/pages/register/index.vue | 273 ++++++++ pages_template/pages/order/OrderItem.vue | 334 +++++----- .../a-yjly-inputunit/a-yjly-inputunit.vue | 4 +- 10 files changed, 1399 insertions(+), 1090 deletions(-) create mode 100644 pages_mine/pages/register/index.vue diff --git a/App.vue b/App.vue index 5543904..405c0e3 100644 --- a/App.vue +++ b/App.vue @@ -5,6 +5,7 @@ import { listConvert } from '@/api/system/unitConverter/sysUnitConverter.js'; + const queryParams = ref({ pageNum: 1, pageSize: 1000, @@ -16,8 +17,14 @@ status: null, unitOrder: null }); + // 保留原有单位换算方法 const groupByUnitType = (data) => { + if (!data || !Array.isArray(data)) { + console.warn('groupByUnitType: 数据为空或不是数组'); + return {}; + } + return data.reduce((acc, unit) => { const type = unit.unitType; if (!acc[type]) acc[type] = []; @@ -34,44 +41,65 @@ return acc; }, {}); }; + const getList = async () => { try { + console.log('开始请求单位数据...'); const response = await listConvert(queryParams.value); + console.log('API响应:', response); + + if (!response || !response.rows) { + console.error('API响应格式错误'); + return; + } + + if (response.rows.length === 0) { + console.warn('单位数据为空数组'); + return; + } + const unitDataGrouped = groupByUnitType(response.rows); - console.log('开始缓存' + unitDataGrouped); + console.log('分组后的单位数据:', unitDataGrouped); + // #ifdef APP || APP-PLUS - uni.setStorageSync({ - key: 'unitData', - data: unitDataGrouped, - success: function() { - console.log('缓存成功'); - } - }); + try { + // 使用正确的同步写法 + uni.setStorageSync('unitData', unitDataGrouped); + console.log('APP端缓存成功'); + + // 立即验证 + const verifyData = uni.getStorageSync('unitData'); + console.log('APP缓存验证:', verifyData ? '成功' : '失败', verifyData); + } catch (storageError) { + console.error('APP缓存设置失败:', storageError); + } // #endif + // #ifdef H5 - localStorage.setItem('unitData', JSON.stringify(unitDataGrouped)) + try { + localStorage.setItem('unitData', JSON.stringify(unitDataGrouped)); + console.log('H5端缓存成功'); + } catch (storageError) { + console.error('H5缓存设置失败:', storageError); + } // #endif } catch (error) { - console.error('获取单位数据失败:', error); + console.error('获取单位数据失败:', error); } }; - export default { onLaunch: function() { + console.log('App Launch - 开始初始化'); getList(); - console.log('App Launch') }, onShow: function() { - console.log('App Show') + console.log('App Show'); }, onHide: function() { - console.log('App Hide') - }, - - - + console.log('App Hide'); + } } diff --git a/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue b/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue index aafb105..a5c6830 100644 --- a/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue +++ b/components/geek-xd/components/geek-confirm-dialog/geek-confirm-dialog.vue @@ -1,123 +1,123 @@ \ No newline at end of file diff --git a/components/geek-xd/components/geek-uploadbox/geek-uploadbox.vue b/components/geek-xd/components/geek-uploadbox/geek-uploadbox.vue index 6d4a58b..05e192b 100644 --- a/components/geek-xd/components/geek-uploadbox/geek-uploadbox.vue +++ b/components/geek-xd/components/geek-uploadbox/geek-uploadbox.vue @@ -1,270 +1,274 @@ \ No newline at end of file diff --git a/pages.json b/pages.json index eb0151b..81cce9b 100644 --- a/pages.json +++ b/pages.json @@ -1,298 +1,296 @@ { - "easycom": { - "custom": { - "u-city-select": "@/components/u-city-select/u-city-select.vue", - "geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue", - "gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue", - "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", - "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue", - "qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue" - } - }, - "pages": [ - { - "path": "pages/index", - "style": { - "navigationBarTitleText": "天然气工具集", - "navigationStyle": "custom" - } - }, - { - "path": "pages/login", - "style": { - "navigationBarTitleText": "登录" - } - }, - { - "path": "pages/work", - "style": { - "navigationBarTitleText": "工作台" - } - }, - { - "path": "pages/template", - "style": { - "navigationBarTitleText": "模板" - } - }, - { - "path": "pages/mine", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/common/webview/index", - "style": { - "navigationBarTitleText": "浏览网页" - } - }, - { - "path": "pages/common/textview/index", - "style": { - "navigationBarTitleText": "浏览文本" - } - } - ], - "subPackages": [ - { - "root": "pages_mine/pages", - "pages": [ - { - "path": "avatar/index", - "style": { - "navigationBarTitleText": "修改头像" - } - }, - { - "path": "info/index", - "style": { - "navigationBarTitleText": "个人信息" - } - }, - { - "path": "info/edit", - "style": { - "navigationBarTitleText": "编辑资料" - } - }, - { - "path": "pwd/index", - "style": { - "navigationBarTitleText": "修改密码" - } - }, - { - "path": "setting/index", - "style": { - "navigationBarTitleText": "应用设置" - } - }, - { - "path": "help/index", - "style": { - "navigationBarTitleText": "常见问题" - } - }, - { - "path": "about/index", - "style": { - "navigationBarTitleText": "关于我们" - } - } - ] - }, - { - "root": "pages_template/pages", - "pages": [ - { - "path": "wxCenter/index", - "style": { - "navigationBarTitleText": "wxCenter 仿微信个人中心", - "navigationStyle": "custom" - } - }, - { - "path": "keyboardPay/index", - "style": { - "navigationBarTitleText": "keyboardPay 自定义键盘支付" - } - }, - { - "path": "mallMenu/index2", - "style": { - "navigationBarTitleText": "mallMenu-商城分类" - } - }, - { - "path": "mallMenu/index1", - "style": { - "navigationBarTitleText": "mallMenu-商城分类" - } - }, - { - "path": "coupon/index", - "style": { - "navigationBarTitleText": "coupon-优惠券" - } - }, - { - "path": "login/index1", - "style": { - "navigationBarTitleText": "美团登录" - } - }, - { - "path": "login/index2", - "style": { - "navigationBarTitleText": "水滴登录" - } - }, - { - "path": "citySelect/index", - "style": { - "navigationBarTitleText": "城市选择" - } - }, - { - "path": "submitBar/index", - "style": { - "navigationBarTitleText": "提交订单栏" - } - }, - { - "path": "comment/index", - "style": { - "navigationBarTitleText": "评论" - } - }, - { - "path": "comment/reply", - "style": { - "navigationBarTitleText": "评论详情" - } - }, - { - "path": "order/index", - "style": { - "navigationBarTitleText": "订单" - } - }, - { - "path": "login/code", - "style": { - "navigationBarTitleText": "登录获取验证码" - } - }, - { - "path": "address/index", - "style": { - "navigationBarTitleText": "用户地址" - } - }, - { - "path": "address/addSite", - "style": { - "navigationBarTitleText": "添加用户地址" - } - } - ] - }, - { - "root": "pages_qiun/pages", - "pages": [ - { - "path": "sport/index", - "style": { - "pageOrientation": "auto" - } - }, - { - "path": "school/index", - "style": { - "pageOrientation": "auto" - } - }, - { - "path": "finance/index", - "style": { - "pageOrientation": "auto" - } - }, - { - "path": "main/index", - "style": { - "pageOrientation": "auto" - } - } - ] - }, - { - - "root": "pages_geek/pages", - "pages": [ - { - "path": "index/index" - }, - { - "path": "code/index" - }, - { - "path": "upload/index" - } - ] - }, - { - - "root": "pages_caltools/pages", - "pages": [ - { - "path": "index" - }, - { - "path": "main" - } - ] + "easycom": { + "custom": { + "u-city-select": "@/components/u-city-select/u-city-select.vue", + "geek-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue", + "gx-(.*)": "@/components/geek-xd/components/geek-$1/geek-$1.vue", + "^u--(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^up-(.*)": "uview-plus/components/u-$1/u-$1.vue", + "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue", + "qiun-(.*)": "@/components/qiun-data-charts/components/qiun-$1/qiun-$1.vue" + } + }, + "pages": [{ + "path": "pages/index", + "style": { + "navigationBarTitleText": "天然气工具集", + "navigationStyle": "custom" + } + }, + { + "path": "pages/login", + "style": { + "navigationBarTitleText": "登录" + } + }, + { + "path": "pages/work", + "style": { + "navigationBarTitleText": "工作台" + } + }, + { + "path": "pages/template", + "style": { + "navigationBarTitleText": "模板" + } + }, + { + "path": "pages/mine", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/common/webview/index", + "style": { + "navigationBarTitleText": "浏览网页" + } + }, + { + "path": "pages/common/textview/index", + "style": { + "navigationBarTitleText": "浏览文本" + } + } + ], + "subPackages": [{ + "root": "pages_mine/pages", + "pages": [{ + "path": "register/index", + "style": { + "navigationBarTitleText": "注册" + } + }, + { + "path": "avatar/index", + "style": { + "navigationBarTitleText": "修改头像" + } + }, + { + "path": "info/index", + "style": { + "navigationBarTitleText": "个人信息" + } + }, + { + "path": "info/edit", + "style": { + "navigationBarTitleText": "编辑资料" + } + }, + { + "path": "pwd/index", + "style": { + "navigationBarTitleText": "修改密码" + } + }, + { + "path": "setting/index", + "style": { + "navigationBarTitleText": "应用设置" + } + }, + { + "path": "help/index", + "style": { + "navigationBarTitleText": "常见问题" + } + }, + { + "path": "about/index", + "style": { + "navigationBarTitleText": "关于我们" + } + } + ] + }, + { + "root": "pages_template/pages", + "pages": [{ + "path": "wxCenter/index", + "style": { + "navigationBarTitleText": "wxCenter 仿微信个人中心", + "navigationStyle": "custom" + } + }, + { + "path": "keyboardPay/index", + "style": { + "navigationBarTitleText": "keyboardPay 自定义键盘支付" + } + }, + { + "path": "mallMenu/index2", + "style": { + "navigationBarTitleText": "mallMenu-商城分类" + } + }, + { + "path": "mallMenu/index1", + "style": { + "navigationBarTitleText": "mallMenu-商城分类" + } + }, + { + "path": "coupon/index", + "style": { + "navigationBarTitleText": "coupon-优惠券" + } + }, + { + "path": "login/index1", + "style": { + "navigationBarTitleText": "美团登录" + } + }, + { + "path": "login/index2", + "style": { + "navigationBarTitleText": "水滴登录" + } + }, + { + "path": "citySelect/index", + "style": { + "navigationBarTitleText": "城市选择" + } + }, + { + "path": "submitBar/index", + "style": { + "navigationBarTitleText": "提交订单栏" + } + }, + { + "path": "comment/index", + "style": { + "navigationBarTitleText": "评论" + } + }, + { + "path": "comment/reply", + "style": { + "navigationBarTitleText": "评论详情" + } + }, + { + "path": "order/index", + "style": { + "navigationBarTitleText": "订单" + } + }, + { + "path": "login/code", + "style": { + "navigationBarTitleText": "登录获取验证码" + } + }, + { + "path": "address/index", + "style": { + "navigationBarTitleText": "用户地址" + } + }, + { + "path": "address/addSite", + "style": { + "navigationBarTitleText": "添加用户地址" + } + } + ] + }, + { + "root": "pages_qiun/pages", + "pages": [{ + "path": "sport/index", + "style": { + "pageOrientation": "auto" + } + }, + { + "path": "school/index", + "style": { + "pageOrientation": "auto" + } + }, + { + "path": "finance/index", + "style": { + "pageOrientation": "auto" + } + }, + { + "path": "main/index", + "style": { + "pageOrientation": "auto" + } + } + ] + }, + { + + "root": "pages_geek/pages", + "pages": [{ + "path": "index/index" + }, + { + "path": "code/index" + }, + { + "path": "upload/index" + } + ] + }, + { + + "root": "pages_caltools/pages", + "pages": [{ + "path": "index" + }, + { + "path": "main" + } + ] + } + + + ], + "tabBar": { + "color": "#000000", + "selectedColor": "#000000", + "borderStyle": "white", + "backgroundColor": "#ffffff", + "list": [{ + "pagePath": "pages/index", + "iconPath": "static/images/tabbar/home.png", + "selectedIconPath": "static/images/tabbar/home_.png", + "text": "首页" + }, + { + "pagePath": "pages/work", + "iconPath": "static/images/tabbar/work.png", + "selectedIconPath": "static/images/tabbar/work_.png", + "text": "计算" + }, + { + "pagePath": "pages/template", + "iconPath": "static/images/tabbar/work.png", + "selectedIconPath": "static/images/tabbar/work_.png", + "text": "资料" + }, + { + "pagePath": "pages/mine", + "iconPath": "static/images/tabbar/mine.png", + "selectedIconPath": "static/images/tabbar/mine_.png", + "text": "我的" + } + ] + }, + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "RuoYi", + "navigationBarBackgroundColor": "#FFFFFF" } - - - ], - "tabBar": { - "color": "#000000", - "selectedColor": "#000000", - "borderStyle": "white", - "backgroundColor": "#ffffff", - "list": [ - { - "pagePath": "pages/index", - "iconPath": "static/images/tabbar/home.png", - "selectedIconPath": "static/images/tabbar/home_.png", - "text": "首页" - }, - { - "pagePath": "pages/work", - "iconPath": "static/images/tabbar/work.png", - "selectedIconPath": "static/images/tabbar/work_.png", - "text": "工作台" - }, - { - "pagePath": "pages/template", - "iconPath": "static/images/tabbar/work.png", - "selectedIconPath": "static/images/tabbar/work_.png", - "text": "模板" - }, - { - "pagePath": "pages/mine", - "iconPath": "static/images/tabbar/mine.png", - "selectedIconPath": "static/images/tabbar/mine_.png", - "text": "我的" - } - ] - }, - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "RuoYi", - "navigationBarBackgroundColor": "#FFFFFF" - } -} +} \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index 9714666..4ae851e 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,50 +1,179 @@ + - \ No newline at end of file +.text { + text-align: center; + font-size: 26rpx; + margin-top: 10rpx; +} + +.grid-item-box { + flex: 1; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + align-items: center; + justify-content: center; + padding: 15px 0; +} + +.uni-margin-wrap { + width: 690rpx; + width: 100%; + ; +} + +.swiper { + height: 300rpx; +} + +.swiper-box { + height: 150px; +} + +.swiper-item { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + justify-content: center; + align-items: center; + color: #fff; + height: 300rpx; + line-height: 300rpx; +} + +@media screen and (min-width: 500px) { + .uni-swiper-dot-box { + width: 400px; + /* #ifndef APP-NVUE */ + margin: 0 auto; + /* #endif */ + margin-top: 8px; + } + + .image { + width: 100%; + } +} + diff --git a/pages/work.vue b/pages/work.vue index 4ae851e..9714666 100644 --- a/pages/work.vue +++ b/pages/work.vue @@ -1,179 +1,50 @@ - + + .charts-box { + width: 100%; + height: 300px; + } + \ No newline at end of file diff --git a/pages_caltools/pages/index.vue b/pages_caltools/pages/index.vue index 666671d..0c29601 100644 --- a/pages_caltools/pages/index.vue +++ b/pages_caltools/pages/index.vue @@ -1,23 +1,25 @@