From e204aaa91717aae2125132719a2f3553d78a9886 Mon Sep 17 00:00:00 2001 From: lagos <627844378@qq.com> Date: Wed, 4 Jun 2025 11:19:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=AE=9E=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E5=AE=9E=E7=8E=B0=E7=A7=92=E7=BA=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E8=AF=A2=202.=E8=A7=A3=E5=86=B3=E5=8D=95?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6=E9=A2=84=E8=A7=88=E6=97=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=8A=E4=B8=80=E7=BA=A7=E6=B2=A1=E6=9C=89=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E4=B8=AD=E9=97=B4=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/.env.development | 2 +- manifest.config.ts | 4 +- src/components/PageLayout/PageLayout.vue | 1 + src/manifest.json | 4 +- src/pages/login/login.vue | 4 +- src/pages/onlinePreview/detail.vue | 18 ++++++++- src/pages/production/index.vue | 9 ++++- src/pages/production/shishishuju/trqSssj.vue | 39 +++++++++++--------- 8 files changed, 53 insertions(+), 28 deletions(-) diff --git a/env/.env.development b/env/.env.development index 096ebec..e550644 100644 --- a/env/.env.development +++ b/env/.env.development @@ -5,4 +5,4 @@ VITE_DELETE_CONSOLE = false # 是否开启sourcemap VITE_SHOW_SOURCEMAP = true VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot' -#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot' \ No newline at end of file +#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot' \ No newline at end of file diff --git a/manifest.config.ts b/manifest.config.ts index 1ade4c0..a2fb3c4 100644 --- a/manifest.config.ts +++ b/manifest.config.ts @@ -17,8 +17,8 @@ export default defineManifestConfig({ name: VITE_APP_TITLE, appid: VITE_UNI_APPID, description: '', - versionName: '2.0.0', - versionCode: '20250529', + versionName: '1.1.22', + versionCode: '20250530', transformPx: false, locale: VITE_FALLBACK_LOCALE, // 'zh-Hans' /* 5+App特有相关 */ diff --git a/src/components/PageLayout/PageLayout.vue b/src/components/PageLayout/PageLayout.vue index d11684c..c2a5947 100644 --- a/src/components/PageLayout/PageLayout.vue +++ b/src/components/PageLayout/PageLayout.vue @@ -106,6 +106,7 @@ // 只有在页面中才默认返回,弹层中不返回 if (props.type === 'page') { const pages = getCurrentPages() + console.log(router) if (props.backRouteName || props.backRoutePath) { const prevPage = pages[pages.length - 2] if (prevPage) { diff --git a/src/manifest.json b/src/manifest.json index 68ea237..628535c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name": "数智产销", "appid": "__UNI__9F097F0", "description": "", - "versionName": "2.0.0", - "versionCode": "20250529", + "versionName": "1.1.22", + "versionCode": "20250530", "transformPx": false, "app-plus": { "usingComponents": true, diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index ba81322..78c6a09 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -105,9 +105,9 @@ let pw = Base64.encode(encodeURIComponent(password.value)) loading.value = true /*生产环境 begin */ - loginApi({ username: un, password: pw }) + // loginApi({ username: un, password: pw }) /*开发环境 begin */ - // loginApi({ username: userName.value, password: password.value, captcha: 'app' }) + loginApi({ username: userName.value, password: password.value, captcha: 'app' }) .then((res : any) => { if (res.success) { const { result } = res diff --git a/src/pages/onlinePreview/detail.vue b/src/pages/onlinePreview/detail.vue index 924a06a..9c780cc 100644 --- a/src/pages/onlinePreview/detail.vue +++ b/src/pages/onlinePreview/detail.vue @@ -43,6 +43,7 @@ } from '@dcloudio/uni-app'; const detail = ref({}) const detailArr = ref([]) + const ifBackAll = ref(false); //判断是否直接返回最上级 //判断是否h5 by 闵 var ifH5 = false; const onlinePreview = (url) => { //在线预览文件 by 闵 @@ -57,6 +58,7 @@ } onLoad((options) => { + console.log(2222) detail.value = options.data detailArr.value = options.data.split(","); //#ifdef H5 || MP-WEIXIN @@ -64,9 +66,23 @@ //#endif //判断是否只有一个文件 if (detailArr.value && detailArr.value.length == 1) { + let url = '/pages/onlinePreview/onlinePreview'; if (ifH5) url = '/pages/onlinePreview/onlinePreviewH5' - onlinePreview(url + `?data=${JSON.stringify(options.data)}`); + uni.navigateTo({ //跳转成功赋予状态 + url: url + `?data=${JSON.stringify(options.data)}`, + success: () => ifBackAll.value = true //只有一个文件,且加载了 + }) + } + }) + + onShow (()=>{ + //页面卸载,如果是从 + console.log(ifBackAll.value) + if(ifBackAll.value){ + //直接返回上一级 + uni.navigateBack({ + }) } }) diff --git a/src/pages/production/index.vue b/src/pages/production/index.vue index adcac4f..75cab1e 100644 --- a/src/pages/production/index.vue +++ b/src/pages/production/index.vue @@ -19,7 +19,7 @@ @clickItem="onClickItem" styleType="button" activeColor="#0055ff"> - + @@ -35,7 +35,7 @@ - + @@ -98,6 +98,11 @@ window.removeEventListener('resize', calculateScrollViewHeight); }); + onHide(()=>{ //切换首页后,将生产切换为日本数据以清楚定时 by闵 + console.log(555555) + current.value = 0; + }) + const calculateScrollViewHeight = () => { // 获取屏幕的总高度 const screenHeight = uni.getSystemInfoSync().windowHeight; diff --git a/src/pages/production/shishishuju/trqSssj.vue b/src/pages/production/shishishuju/trqSssj.vue index 44245a1..cda0622 100644 --- a/src/pages/production/shishishuju/trqSssj.vue +++ b/src/pages/production/shishishuju/trqSssj.vue @@ -8,7 +8,7 @@ - + @@ -114,18 +114,7 @@ }); uni.onSocketMessage(function(res) { console.log('收到服务器内容:' + res.data); - // 语音播放 start - const innerAudioContext = uni.createInnerAudioContext(); - innerAudioContext.autoplay = true; - innerAudioContext.src = 'https://wzs1.oss-cn-beijing.aliyuncs.com/music.mp3'; - innerAudioContext.onPlay(() => { - console.log('开始播放'); - }); - innerAudioContext.onError(res => { - console.log(res.errMsg); - console.log(res.errCode); - }); - //语音播放 end + }); // 这里仅是事件监听【如果socket关闭了会执行】 uni.onSocketClose(function(res) { @@ -141,15 +130,22 @@ console.log(2, e, data.value); stationID.value = e stationName.value = data.value.title + getScData(); //获取生产数据 + + } + + const getScData= ()=>{ uni.request({ url: jlByzc.value + '?zhanc=' + stationID.value + '&jldLx=0', method: 'GET', success: (res) => { + console.log(res) jlData.value = JSON.parse(res.data.result).JlData; } }) - } + + const websock = ref(null); const timer2 = ref(null); // 封装心跳函数 @@ -157,7 +153,10 @@ timer2.value = setInterval(() => { if (websock.value && websock.value.readyState === 1) { // 如果连接正常,发送心跳消息 - connectSocketInit() + // connectSocketInit() + } + if(stationID.value){ + getScData(); } }, 1000); }; @@ -176,9 +175,13 @@ websocketheart() }) - - - + + onUnmounted(()=>{ //页面销毁删除定时 + // 销毁定时器 + console.log(22222) + clearInterval(timer2.value); + }) + // 数字格式化 const formatNumber = (num) => { let temp = 0;