From 2b8797a1acb809ffb8b95736640777f53a79d844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Tue, 23 Apr 2024 11:48:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE=E6=A1=86?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 8196 bytes App.vue | 147 ++++++++++++--- components/customTabBar/index.vue | 80 ++++++-- components/loadMore/index.vue | 70 +++++++ components/progressBar.vue | 19 +- components/searchView/index.vue | 40 ++++ main.js | 27 ++- manifest.json | 13 +- pages.json | 22 ++- pages/index/index.vue | 72 ++++---- pages/index/materialYield.vue | 80 ++++---- pages/index/schedule.vue | 87 +++++---- pages/login/login.vue | 30 +-- pages/person/person.vue | 73 ++++++-- pages/production/productionDetail.vue | 47 +++-- pages/production/productionOrder.vue | 225 ++++++++++++++++------- static/.DS_Store | Bin 0 -> 8196 bytes static/css/app.css | 78 ++++++++ static/iconfont/.DS_Store | Bin 0 -> 6148 bytes static/iconfont/iconfont-weapp/.DS_Store | Bin 0 -> 6148 bytes static/iconfont/iconfont.css | 46 ++++- static/sweep.png | Bin 0 -> 6928 bytes uni.scss | 48 ++++- utils/api.js | 95 +++++----- utils/envConfig.js | 7 - utils/public.js | 8 +- 26 files changed, 962 insertions(+), 352 deletions(-) create mode 100644 .DS_Store create mode 100644 components/loadMore/index.vue create mode 100644 components/searchView/index.vue create mode 100644 static/.DS_Store create mode 100644 static/css/app.css create mode 100644 static/iconfont/.DS_Store create mode 100644 static/iconfont/iconfont-weapp/.DS_Store create mode 100644 static/sweep.png diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..bf7edd8ae35815eeacfbe199b7585b9d20082403 GIT binary patch literal 8196 zcmeHMO>Y}T7=9<8>$pjsG$|1ul7%lw4I!zN28jb(rw9dv5_Qw!C@E%bZ`^IxGiG<~ zv_z47h9AI<3qPP&uKWNva^=7u;KG3uJTtRycGt1Q2~l;%nt5kuo@Zv>$DVgQHW9IE zueC|EN<(WyuwTX*&AL5)Nx8cA%}M6Vr5J$;>Rdp)fT&cx44AW@~FoqkvIhQ~`N+x2TTS zXLL7xe{Te$fj+sN?jo=MtrBWPvuNq!wN8ENktc8aDfIIkdXAbTr~|wpP9AbhQI^Br z%5i2Cu8$d>j9|abVdu!lm@P1#0{|5uJP3yiCHSIjWc&Y|ZOngf4=St87! zSkj;DJW8qWQ%WtuYZv~XqHKfvE(Ku8=W!!Q_0l6;%Z)IGrxZ-{rWH@lnb%tCmqyNA zBFC+YN&V8C8Kr^?C46dTHBjn}#Wv2OZt_|AvC$3uDBjrkl}$`eP0!3)vsTf1Rxd5@2p+pW_d-SRTOJ_CpZmNe&Z?rvTan^Ay2C11 zg?efA{CxBFTKV>!t&6qt`R2x*_t(l>+uIix1#6}9-Us*Vr$L8{Z{RBuOAZ>E*Uv9X zsb9u_zu8ZGVm}Xk`mIzNdR3S!UYlRIURqqbvADdrvU2ma)s>~!-*~fLy3uf(r|nR# zc1HvvtOh-=Ub-H^=iR2@`=Qr|ueI2F8aw{i=vvAV?t85-E}IUXb%9yFY*2%K9C{u< zYKMMn@8l%%;##VHC}(SiA_(?H0 zUa-fjB92Ap&<#VEx4r7Knh!7J%GH!k*KPW|UHR}2EoGr%zoTmORFc{gMGK6GU1;xsQk?e+(TR+2?219PlAipApk8TFJfB^0T>%j*Zq&Whd zk3e-rP?RAc!%Zn=sxPMklX}^!Mc9wV|Nj4SI%igG6fg?>D+SopJ?CB((BVm#XUV&E z8Tm_OnIvwYt)ie%*Kt^N9fy7Khau`^Kqbdc>_A(zApPe*1eo(*ekW1doAY1E@Jbf{ E09LF0 diff --git a/components/customTabBar/index.vue b/components/customTabBar/index.vue index 0d3c209..0127595 100644 --- a/components/customTabBar/index.vue +++ b/components/customTabBar/index.vue @@ -4,7 +4,7 @@ - + @@ -38,9 +38,9 @@ export default { }, { id: 1, - path: '/pages/person/person', - // icon: '/static/logo.png', - // selectIcon: '/static/logo.png', + path: '', + icon: '/static/sweep.png', + selectIcon: '', text: '扫一扫', // 通过类名class控制样式大小 centerItem: true @@ -60,11 +60,34 @@ export default { this.currentItem = this.currentPage }, methods: { - changeItem (item) { - uni.switchTab({ - url: item.path - }) - } + changeItem (item) { + if(item.centerItem){ + this.scanQRCode(); + return + } + uni.switchTab({ + url: item.path + }) + }, + scanQRCode(){ + uni.scanCode({ + success: (res) => { + console.log('扫码结果:' + res.result); + uni.showModal({ + title: '扫码结果', + content: res.result, + showCancel: false + }); + }, + fail: (err) => { + console.error('扫码失败:' + err); + uni.showToast({ + title: '扫码失败', + icon: 'none' + }); + } + }); + } } }; @@ -74,18 +97,32 @@ view { margin: 0; box-sizing: border-box; } +.tabbar-container::before{ + content: ''; + position: absolute; + left: 10%; + top: 0; + z-index: 10; + height: 1px; + width: 80%; + background-image: linear-gradient(90deg, $uni-border-color-default, $uni-color-primary 50%, $uni-border-color-default); + background-size: 100% 1px; + background-repeat:no-repeat; + z-index: 1; +} .tabbar-container { position: fixed; bottom: 0rpx; left: 0rpx; width: 100%; height: 110rpx; - box-shadow: 0 0 5px #999; display: flex; align-items: center; padding: 5rpx 0; - color: #999999; - background: #131E3B; + color: $uni-text-color-grey; + background: $uni-border-color-default; + box-shadow: 0 2px 4px $uni-border-shadow-color-default; + /* 针对tabbar的统一处理 */ .tabbar-item { width: 33.33%; @@ -111,7 +148,7 @@ view { } // 被选中的导航栏字体 .item-active { - color: #fff; + color: $uni-text-color-inverse; } } @@ -119,15 +156,26 @@ view { .center-item { display: block; position: relative; + z-index: 20; .item-top { flex-shrink: 0; width: 100rpx; height: 100rpx; position: absolute; - top: -50rpx; + top: -60rpx; left: calc(50% - 50rpx); border-radius: 50%; - box-shadow: 0 0 5px #999; + box-shadow: 0 2px 4px $uni-border-shadow-color-default; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + border: 2px solid $uni-text-color-inverse; + .img{ + width: 100%; + height: 100%; + border-radius: 50%; + } } .item-bottom { position: absolute; @@ -136,7 +184,7 @@ view { .item-active { position: absolute; bottom: 5rpx; - color: #1fff; + color: $uni-text-color-inverse; } } } diff --git a/components/loadMore/index.vue b/components/loadMore/index.vue new file mode 100644 index 0000000..3a577ad --- /dev/null +++ b/components/loadMore/index.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/components/progressBar.vue b/components/progressBar.vue index 0b71300..de9117b 100644 --- a/components/progressBar.vue +++ b/components/progressBar.vue @@ -1,19 +1,14 @@ @@ -48,7 +43,7 @@ export default { } - \ No newline at end of file diff --git a/main.js b/main.js index e0f84df..b0d1d26 100644 --- a/main.js +++ b/main.js @@ -1,11 +1,22 @@ -import "./static/iconfont/iconfont.css" -import "./static/iconfont/iconfont-weapp/iconfont-weapp-icon.css" +import "./static/iconfont/iconfont.css" +import './static/css/app.css'; +import "./static/iconfont/iconfont-weapp/iconfont-weapp-icon.css" + +// 全局组件 +import searchView from './components/searchView/index' +import loadMore from './components/loadMore/index' +import progressBar from './components/progressBar' // #ifndef VUE3 import Vue from 'vue' -import App from './App' -import svg from './static/iconfont/svg.js' +import App from './App' +import svg from './static/iconfont/svg.js' + +Vue.component('search-view',searchView); +Vue.component('load-more',loadMore); +Vue.component('progress-bar',progressBar); + Vue.use(svg); @@ -25,7 +36,13 @@ import request from "./utils/api.js" import publicMethods from "./utils/public.js" export function createApp() { - const app = createSSRApp(App) + const app = createSSRApp(App) + + // 全局注册组件 + app.component('searchView', searchView); + app.component('loadMore', loadMore); + app.component('progressBar', progressBar); + app.config.globalProperties.$api = request; app.config.globalProperties.$wf = publicMethods; return { diff --git a/manifest.json b/manifest.json index a4b2d30..3dff693 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "mes-mobile01", + "name" : "mes-mobile", "appid" : "__UNI__41DB0F2", "description" : "", "versionName" : "1.0.0", @@ -52,9 +52,14 @@ /* 小程序特有相关 */ "appid" : "wx38dc81b0eef130a3", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "postcss" : true, + "es6" : true, + "minified" : true }, - "usingComponents" : true + "usingComponents" : true, + "libVersion":"latest" }, - "vueVersion" : "3" + "vueVersion" : "3", + "locale" : "zh-Hans" } diff --git a/pages.json b/pages.json index 41078b0..890e916 100644 --- a/pages.json +++ b/pages.json @@ -35,7 +35,6 @@ "path" : "pages/login/login", "style" : { - // "navigationBarTitleText" : "登录", "enablePullDownRefresh" : false, "navigationStyle": "custom" } @@ -45,7 +44,10 @@ "style" : { "navigationBarTitleText" : "生产工单管理", - "enablePullDownRefresh" : false + "enablePullDownRefresh" : true, + "pullToRefresh":{ + "color":"red" + } } }, { @@ -184,13 +186,21 @@ "enablePullDownRefresh" : false } }], - "globalStyle": { + "globalStyle": { "navigationBarTextStyle": "white", "navigationBarTitleText": "德木自动化系统", - "navigationBarBackgroundColor": "#060B26", + "navigationBarBackgroundColor": "#060B26", + "backgroundColor":"#060B26", + "backgroundTextStyle":"light", "app-plus": { - "background": "#efeff4" - } + "background": "#060B26" + }, + "mp-weixin":{ + "background":"#060B26", + "pullToRefresh":{ + "color":"#060B26" + } + } }, "condition" : { //模式配置,仅开发期间生效 "current": 0, //当前激活的模式(list 的索引项) diff --git a/pages/index/index.vue b/pages/index/index.vue index 6136833..baa8510 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -25,7 +25,7 @@ ▴2.89% - + 1,567 @@ -43,7 +43,7 @@ ▴2.89% - + 1,567 @@ -61,7 +61,7 @@ ▴2.89% - + 1,567 @@ -79,7 +79,7 @@ ▴2.89% - + 1,567 @@ -97,7 +97,7 @@ ▴2.89% - + 1,567 @@ -115,7 +115,7 @@ ▴2.89% - + 1,567 @@ -166,14 +166,6 @@ 生产工单 - - - 工单进度 - - - - 工单出材率 - 生产报表 @@ -187,11 +179,19 @@ 排程管理 + + + + 工单进度 + + + + 工单出材率 - + @@ -205,8 +205,8 @@ 设备状态 - - + + 设备报修 @@ -300,7 +300,7 @@ .name{flex:1;} .accounticon{ margin-right: 5px; - color: #fff; + color: $uni-text-color-inverse; font-size: 20px; } .notifyicon{font-size: 20px;padding-right: 20px;} @@ -312,33 +312,43 @@ .content_title{line-height: 25px;font-size: 16px;padding: 15px 0;} .device_data{display: flex;flex-wrap: wrap; .device_module{ - width: calc(50% - 12px); /* 计算每个块的宽度(根据需要调整)*/ + width: calc(50% - 6px); /* 计算每个块的宽度(根据需要调整)*/ + // background-color: #ccc; /* 设置背景色(根据需要调整)*/ + background: $uni-bg-color-primary; margin:6px; - background-color: #ccc; /* 设置背景色(根据需要调整)*/ - padding: 10px; - background: #1C2755; + padding: 10px 14px; border-radius: 8px; display: flex; .module_left{width: 60%; - .icon_background{width: 32px;height: 32px;background: #6576B7;border-radius: 8px; display: flex;align-items: center;justify-content: center;margin-bottom: 4px;} + .icon_background{width: 32px;height: 32px;background: $uni-bg-color-info;border-radius: 8px; display: flex;align-items: center;justify-content: center;margin-bottom: 4px;} } .module_right{width: 40%; - .top{float: right;font-size: 10px;padding: 2px 4px;background: rgba(103,194,58,0.3);border-radius: 4px;color: #67C23A;} + .top{ + display: flex;flex-direction: column; font-size: 10px;padding: 2px 4px;background: rgba(103,194,58,0.3);border-radius: 4px;color: $uni-text-color-success; + } + .num{ + margin-top: 6px; + } } + } + .device_module:nth-child(even){ + margin-right: 0; + } + .device_module:nth-child(odd){ + margin-left: 0; } } - .energy_data{padding: 12px; height: 64px; display: flex;align-items: center;background: #1C2755;border-radius: 8px; - .energy_icon{color: #009688;font-size: 24px;margin-right: 8px;} + .energy_data{padding: 12px; height: 64px; display: flex;align-items: center;background: $uni-bg-color-primary;border-radius: 8px; + .energy_icon{color: $uni-text-color-primary;font-size: 24px;margin-right: 8px;} .energy_image{flex: 1;text-align: center; image{width: 86px;height: 32px;} } - .energy_number{color: #FA3758;} + .energy_number{color: $uni-text-color-danger;} } .content_data{ - // view{display: inline-block;width: 25%;} - padding: 10px 0;display: flex;position: relative;align-items: center;text-align: center;height: 98px; + padding: 10px 0;display: flex;position: relative;align-items: center;justify-content:flex-start;height: 98px; .content_module{ - width: 25%;margin: 10px 1%;height: 98px;display: flex;align-items: center;justify-content: center;flex-direction: column;background-color: #009688;border-radius: 8px; + width: calc(25% - 7px);margin: 10px 4px;height: 98px;display: flex;align-items: center;justify-content: center;flex-direction: column;background-color: $uni-color-primary;border-radius: 8px; .contenticon{font-size: 24px;width: 32px;height: 32px;background-repeat: no-repeat;} .contentname{padding-top: 2px;font-size: 12px;} } diff --git a/pages/index/materialYield.vue b/pages/index/materialYield.vue index 1430158..6e2b30a 100644 --- a/pages/index/materialYield.vue +++ b/pages/index/materialYield.vue @@ -1,50 +1,49 @@