diff --git a/ruoyi-geek-app/App.vue b/ruoyi-geek-app/App.vue index 7d46cf5..68b4159 100644 --- a/ruoyi-geek-app/App.vue +++ b/ruoyi-geek-app/App.vue @@ -38,13 +38,18 @@ try { const response = await listConvert(queryParams.value); const unitDataGrouped = groupByUnitType(response.rows); + // #ifdef APP || APP-PLUS uni.setStorageSync({ key: 'unitData', - data: unitDataGrouped, + data: JSON.stringify(unitDataGrouped), success: function() { console.log('缓存成功'); } }); + // #endif + // #ifdef H5 + localStorage.setItem('unitData', JSON.stringify(unitDataGrouped)) + // #endif } catch (error) { console.error('获取单位数据失败:', error); diff --git a/ruoyi-geek-app/manifest.json b/ruoyi-geek-app/manifest.json index b6206f2..f7c04d8 100644 --- a/ruoyi-geek-app/manifest.json +++ b/ruoyi-geek-app/manifest.json @@ -43,7 +43,39 @@ /* ios打包配置 */ "ios" : {}, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs" : {}, + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + } } }, /* 快应用特有相关 */ diff --git a/ruoyi-geek-app/pages.json b/ruoyi-geek-app/pages.json index 8248469..0c3b31c 100644 --- a/ruoyi-geek-app/pages.json +++ b/ruoyi-geek-app/pages.json @@ -229,6 +229,7 @@ ] }, { + "root": "pages_geek/pages", "pages": [ { @@ -241,7 +242,21 @@ "path": "upload/index" } ] - } + }, + { + + "root": "pages_caltools/pages", + "pages": [ + { + "path": "index" + }, + { + "path": "main" + } + ] + } + + ], "tabBar": { "color": "#000000", diff --git a/ruoyi-geek-app/pages/index.vue b/ruoyi-geek-app/pages/index.vue index 55bd27d..9714666 100644 --- a/ruoyi-geek-app/pages/index.vue +++ b/ruoyi-geek-app/pages/index.vue @@ -12,7 +12,7 @@ ref, onMounted } from 'vue'; - import NGCalTools from '@/pages_NGCalTools/pages/index' + import NGCalTools from '@/pages_caltools/pages/index' diff --git a/ruoyi-geek-app/pages_NGCalTools/components/NGCom.vue b/ruoyi-geek-app/pages_caltools/components/NGCom.vue similarity index 100% rename from ruoyi-geek-app/pages_NGCalTools/components/NGCom.vue rename to ruoyi-geek-app/pages_caltools/components/NGCom.vue diff --git a/ruoyi-geek-app/pages_NGCalTools/components/NGResult.vue b/ruoyi-geek-app/pages_caltools/components/NGResult.vue similarity index 100% rename from ruoyi-geek-app/pages_NGCalTools/components/NGResult.vue rename to ruoyi-geek-app/pages_caltools/components/NGResult.vue diff --git a/ruoyi-geek-app/pages_NGCalTools/components/meterPar.vue b/ruoyi-geek-app/pages_caltools/components/meterPar.vue similarity index 99% rename from ruoyi-geek-app/pages_NGCalTools/components/meterPar.vue rename to ruoyi-geek-app/pages_caltools/components/meterPar.vue index 6006f77..c89ed64 100644 --- a/ruoyi-geek-app/pages_NGCalTools/components/meterPar.vue +++ b/ruoyi-geek-app/pages_caltools/components/meterPar.vue @@ -425,9 +425,9 @@ watch( () => meterPar.value, (newVal) => { - console.log(11111, newVal) + // console.log(11111, newVal) if (!isObjectEqual(newVal, props.modelValue)) { - console.log('Emit to parent', newVal); + // console.log('Emit to parent', newVal); emits('update:modelValue', deepClone(newVal)); } }, { diff --git a/ruoyi-geek-app/pages_NGCalTools/components/meterResult.vue b/ruoyi-geek-app/pages_caltools/components/meterResult.vue similarity index 100% rename from ruoyi-geek-app/pages_NGCalTools/components/meterResult.vue rename to ruoyi-geek-app/pages_caltools/components/meterResult.vue diff --git a/ruoyi-geek-app/pages_caltools/pages/index.vue b/ruoyi-geek-app/pages_caltools/pages/index.vue new file mode 100644 index 0000000..666671d --- /dev/null +++ b/ruoyi-geek-app/pages_caltools/pages/index.vue @@ -0,0 +1,159 @@ + + + + + \ No newline at end of file diff --git a/ruoyi-geek-app/pages_NGCalTools/pages/index.vue b/ruoyi-geek-app/pages_caltools/pages/main.vue similarity index 95% rename from ruoyi-geek-app/pages_NGCalTools/pages/index.vue rename to ruoyi-geek-app/pages_caltools/pages/main.vue index c254f14..da10ce9 100644 --- a/ruoyi-geek-app/pages_NGCalTools/pages/index.vue +++ b/ruoyi-geek-app/pages_caltools/pages/main.vue @@ -32,7 +32,7 @@ watch } from 'vue'; import { - onLoad + onLoad,onShow } from '@dcloudio/uni-app'; import meterPar from '../components/meterPar'; import ngComponents from '../components/NGCom'; @@ -48,8 +48,7 @@ const current = ref(0) const btnText = ref(''); const elFormItemWidth = ref(160); - const elFormItemWidthmin = ref(140); - const activeTab = ref('meterpar'); + const elFormItemWidthmin = ref(140); const isShowMessage = ref(false); const message = ref(''); const parentMeterPar = ref({ @@ -188,12 +187,13 @@ const dMeterType = ref('0'); //在页面加载时获取参数 - onMounted(() => { - // if (options.dMeterType) { - dMeterType.value ='0';// options.dMeterType; - parentMeterPar.value.dMeterType = '0';//dMeterType.value; - // } + onLoad((options) => { + if (options.dMeterType) { + dMeterType.value = options.dMeterType; + parentMeterPar.value.dMeterType = dMeterType.value; + } }); + // 监听 dMeterType 的变化 watch(dMeterType, (newValue) => { @@ -241,7 +241,7 @@ if (parentMeterPar.value.dngComponents === '') { message.value = '组分为空,请输入天然气组分!'; showMessage(); - activeTab.value = 'ngComponents'; + current.value = 1; return; } // 清空 parentNGResult 的值 @@ -253,7 +253,7 @@ try { const res = await calcNGPar(parentMeterPar.value); parentNGResult.value = res.data; - activeTab.value = 'meterresult'; + current.value = 2; console.log('Response:', res); } catch (error) { console.error('Request error:', error); @@ -270,7 +270,7 @@ if (parentMeterPar.value.dngComponents === '') { message.value = '组分为空,请输入天然气组分!'; showMessage(); - activeTab.value = 'ngComponents'; + current.value = 1; return; } // 清空 parentMeterResult 的值 @@ -283,7 +283,7 @@ const res = await calcFlow(parentMeterPar.value); parentMeterResult.value = res.data[0]; console.log('Response:', parentMeterResult.value); - activeTab.value = 'meterresult'; + current.value = 2; } catch (error) { console.error('Request error:', error); uni.showToast({ diff --git a/ruoyi-geek-app/static/caltools/DpMeter.jpg b/ruoyi-geek-app/static/caltools/DpMeter.jpg new file mode 100644 index 0000000..3384588 Binary files /dev/null and b/ruoyi-geek-app/static/caltools/DpMeter.jpg differ diff --git a/ruoyi-geek-app/static/logo.png b/ruoyi-geek-app/static/logo.png index 2be05aa..6efb517 100644 Binary files a/ruoyi-geek-app/static/logo.png and b/ruoyi-geek-app/static/logo.png differ diff --git a/ruoyi-geek-app/uni_modules/a-yjly-inputunit/components/a-yjly-inputunit/a-yjly-inputunit.vue b/ruoyi-geek-app/uni_modules/a-yjly-inputunit/components/a-yjly-inputunit/a-yjly-inputunit.vue index 5aab4f3..34fb03d 100644 --- a/ruoyi-geek-app/uni_modules/a-yjly-inputunit/components/a-yjly-inputunit/a-yjly-inputunit.vue +++ b/ruoyi-geek-app/uni_modules/a-yjly-inputunit/components/a-yjly-inputunit/a-yjly-inputunit.vue @@ -192,16 +192,22 @@ // 后台的API可自行开发,这里提供了js数据格式 // const res = await listSysUnitConvert({ unitType: unitType, status: 'Y' }); // this.unitData = res.rows; - const tempData=uni.getStorageSync("unitData") - // console.log(JSON.stringify(tempData)); - var unitDatalist = ( tempData); + var tempData = []; + // #ifdef APP || APP-PLUS + tempData = uni.getStorageSync("unitData"); + // #endif + // #ifdef H5 + tempData = localStorage.getItem("unitData"); + // #endif + // console.log((tempData)); + var unitDatalist = JSON.parse(tempData); // console.log(unitDatalist); this.unitData = unitDatalist[unitType]; // console.log(this.unitData); this.baseUnit = this.unitData.find((u) => u.baseUnit === 'Y'); // console.log(this.baseUnit); } catch (e) { - console.error('单位数据加载失败:', e); + console.error('单位数据加载失败:', e); } },