孙旺 2 years ago
parent
commit
6cdd984800

+ 8 - 4
index.html

@@ -3,13 +3,17 @@
   <head>
     <meta charset="UTF-8" />
     <script>
-      var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
-        CSS.supports('top: constant(a)'))
+      var coverSupport =
+        'CSS' in window &&
+        typeof CSS.supports === 'function' &&
+        (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
       document.write(
         '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
-        (coverSupport ? ', viewport-fit=cover' : '') + '" />')
+          (coverSupport ? ', viewport-fit=cover' : '') +
+          '" />'
+      )
     </script>
-    <title></title>
+    <title>喵星人平台管理系统小程序</title>
     <!--preload-links-->
     <!--app-context-->
   </head>

+ 3 - 3
src/manifest.json

@@ -1,6 +1,6 @@
 {
-    "name" : "",
-    "appid" : "",
+    "name" : "喵星人平台管理系统小程序",
+    "appid" : "wxde6edfb4b2c1e7db",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "",
+        "appid" : "wxde6edfb4b2c1e7db",
         "setting" : {
             "urlCheck" : false
         },

+ 3 - 0
src/pages/globalPages/components/account.vue

@@ -33,6 +33,9 @@ onMounted(() => {
   console.log('商户运营', mqtt_cmd_templet_task)
 
 })
+
+const a = ref(b)
+
 </script>
 
 <style lang="scss" scoped>

+ 1 - 0
src/pages/globalPages/components/commodity.vue

@@ -9,6 +9,7 @@
                 title="数据中心"></u-navbar>
     </view>
   </view>
+
 </template>
 
 <script setup>

+ 47 - 5
src/pages/globalPages/components/home.vue

@@ -11,18 +11,28 @@
         {{item.label}}
       </view>
     </view>
+    <view style="width:300rpx;height:50rpx;background:skyblue;text-align:center;margin-top:100rpx;margin-bottom:50rpx;"
+          @click="change">点击我切换组件</view>
+
+    <test v-if="bflag">
+      你好啊,我是来自火星
+    </test>
+    <test1 v-else>
+      你好啊,我来自木星
+    </test1>
   </view>
 </template>
 
 <script setup>
 import {
   onMounted,
-  getCurrentInstance
+  watch,
+  watchEffect,
+  getCurrentInstance,
+  ref
 } from "vue";
-import {
-  onShow,
-  onLoad
-} from '@dcloudio/uni-app'
+import test from './test'
+import test1 from './test1'
 const { proxy } = getCurrentInstance();
 const { mqtt_cmd_templet_task } = proxy.$useDict("mqtt_cmd_templet_task");
 
@@ -30,6 +40,38 @@ onMounted(() => {
   console.log('平台运维', mqtt_cmd_templet_task)
 
 })
+
+const bflag = ref(true)
+
+function change () {
+  bflag.value = !bflag.value
+}
+
+const a = ref(0)
+
+const b = ref(0)
+
+const c = ref(0)
+
+const time = ref(0)
+
+setInterval(() => {
+  time.value++
+  if (time.value == 1) {
+    a.value = 10
+  }
+  if (time.value == 2) {
+    b.value = 10
+  }
+  if (time.value == 3) {
+    c.value = 10
+  }
+}, 3000);
+
+watchEffect(() => {
+  let d = a.value + b.value + c.value
+  console.log(d)
+})
 </script>
 
 <style lang="scss" scoped>

+ 202 - 0
src/pages/globalPages/components/test.vue

@@ -0,0 +1,202 @@
+<template>
+  <view class="container">
+    <view class="nav-bar">
+      <u-navbar leftIconColor="#fff"
+                titleStyle="color:#fff;fontSize:36rpx;"
+                :autoBack="true"
+                bgColor="#2C6FF3"
+                :placeholder="true"
+                title="质检出场"></u-navbar>
+      <view>测试插槽组件</view>
+      <slot />
+    </view>
+  </view>
+</template>
+
+<script setup>
+function onshow () {
+  console.log('测试插槽组件')
+}
+</script>
+
+<style lang="scss">
+.container {
+  .nav-style {
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #fff;
+  }
+
+  .search {
+    padding: 24rpx 24rpx;
+    background-color: #fff;
+  }
+
+  .total {
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: space-around;
+    align-items: center;
+    text-align: center;
+    color: #fff;
+    background-color: #2c6ff3;
+    padding: 40rpx 24rpx;
+
+    .total-item {
+      .num {
+        font-weight: bold;
+        font-size: 52rpx;
+      }
+
+      .name {
+        font-size: 26rpx;
+      }
+    }
+  }
+
+  .content {
+    padding: 24rpx;
+    padding-bottom: calc(124rpx + env(safe-area-inset-bottom) / 2);
+
+    .xy-card {
+      margin-bottom: 24rpx;
+    }
+
+    .eq-line-title {
+      font-size: 32rpx;
+      padding-bottom: 24rpx;
+      position: relative;
+
+      .arrow-right {
+        position: absolute;
+        right: 0;
+        top: 0;
+      }
+    }
+
+    .eq-item {
+      position: relative;
+
+      & + .eq-item {
+        padding-top: 12rpx;
+      }
+
+      .eq-content {
+        .eq-wrap {
+          border-radius: 8rpx;
+          background-color: rgb(245, 248, 251);
+          box-sizing: border-box;
+          padding: 24rpx 12rpx;
+          font-size: 26rpx;
+
+          .eq-name {
+            font-size: 32rpx;
+            font-weight: bold;
+            margin-bottom: 24rpx;
+            position: relative;
+
+            > .eq-title {
+              width: 420rpx;
+              > text {
+                font-size: 30rpx;
+                color: #666;
+                font-weight: normal;
+              }
+            }
+
+            .eq-status-box {
+              float: right;
+              position: absolute;
+              right: 0;
+              top: 0;
+            }
+
+            .eq-status {
+              font-size: 28rpx;
+              color: #666;
+              font-weight: normal;
+              margin-left: 12rpx;
+
+              > text {
+                display: inline-block;
+                background-color: #666;
+                width: 16rpx;
+                height: 16rpx;
+                border-radius: 16rpx;
+                margin-right: 12rpx;
+              }
+
+              &.online {
+                color: #f56c6c;
+
+                > text {
+                  background-color: green;
+                }
+              }
+            }
+          }
+        }
+
+        .eqeq-type {
+          display: flex;
+          flex-direction: row;
+          align-items: center;
+          font-size: 28rpx;
+
+          > view:nth-child(1) {
+            color: #000;
+            width: 200rpx;
+          }
+
+          > view:nth-child(2) {
+            color: #666;
+            padding-left: 6rpx;
+          }
+        }
+
+        .eqeq-type + .eqeq-type {
+          margin-top: 16rpx;
+        }
+
+        .status {
+          width: 130rpx;
+          height: 120rpx;
+          box-sizing: border-box;
+          border-radius: 120rpx;
+          // border: 6rpx solid #2C6FF3;
+          text-align: center;
+          display: flex;
+          flex-flow: column;
+          justify-content: space-around;
+          align-items: center;
+          position: absolute;
+          right: 12rpx;
+          bottom: 24rpx;
+
+          .s-name {
+            font-size: 28rpx;
+            padding-top: 20rpx;
+            font-weight: bold;
+          }
+
+          .s-num {
+            font-size: 32rpx;
+            padding-bottom: 20rpx;
+          }
+        }
+      }
+    }
+
+    .more {
+      text-align: center;
+      font-size: 28rpx;
+      color: #2c6ff3;
+      line-height: 80rpx;
+    }
+  }
+
+  .empty {
+    margin: 40% auto 0;
+  }
+}
+</style>

+ 202 - 0
src/pages/globalPages/components/test1.vue

@@ -0,0 +1,202 @@
+<template>
+  <view class="container">
+    <view class="nav-bar">
+      <u-navbar leftIconColor="#fff"
+                titleStyle="color:#fff;fontSize:36rpx;"
+                :autoBack="true"
+                bgColor="#2C6FF3"
+                :placeholder="true"
+                title="质检出场"></u-navbar>
+      <view>测试组件22222222222222</view>
+      <slot />
+    </view>
+  </view>
+</template>
+
+<script setup>
+function onshow () {
+  console.log('测试插槽组件')
+}
+</script>
+
+<style lang="scss">
+.container {
+  .nav-style {
+    font-size: 32rpx;
+    font-weight: bold;
+    color: #fff;
+  }
+
+  .search {
+    padding: 24rpx 24rpx;
+    background-color: #fff;
+  }
+
+  .total {
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: space-around;
+    align-items: center;
+    text-align: center;
+    color: #fff;
+    background-color: #2c6ff3;
+    padding: 40rpx 24rpx;
+
+    .total-item {
+      .num {
+        font-weight: bold;
+        font-size: 52rpx;
+      }
+
+      .name {
+        font-size: 26rpx;
+      }
+    }
+  }
+
+  .content {
+    padding: 24rpx;
+    padding-bottom: calc(124rpx + env(safe-area-inset-bottom) / 2);
+
+    .xy-card {
+      margin-bottom: 24rpx;
+    }
+
+    .eq-line-title {
+      font-size: 32rpx;
+      padding-bottom: 24rpx;
+      position: relative;
+
+      .arrow-right {
+        position: absolute;
+        right: 0;
+        top: 0;
+      }
+    }
+
+    .eq-item {
+      position: relative;
+
+      & + .eq-item {
+        padding-top: 12rpx;
+      }
+
+      .eq-content {
+        .eq-wrap {
+          border-radius: 8rpx;
+          background-color: rgb(245, 248, 251);
+          box-sizing: border-box;
+          padding: 24rpx 12rpx;
+          font-size: 26rpx;
+
+          .eq-name {
+            font-size: 32rpx;
+            font-weight: bold;
+            margin-bottom: 24rpx;
+            position: relative;
+
+            > .eq-title {
+              width: 420rpx;
+              > text {
+                font-size: 30rpx;
+                color: #666;
+                font-weight: normal;
+              }
+            }
+
+            .eq-status-box {
+              float: right;
+              position: absolute;
+              right: 0;
+              top: 0;
+            }
+
+            .eq-status {
+              font-size: 28rpx;
+              color: #666;
+              font-weight: normal;
+              margin-left: 12rpx;
+
+              > text {
+                display: inline-block;
+                background-color: #666;
+                width: 16rpx;
+                height: 16rpx;
+                border-radius: 16rpx;
+                margin-right: 12rpx;
+              }
+
+              &.online {
+                color: #f56c6c;
+
+                > text {
+                  background-color: green;
+                }
+              }
+            }
+          }
+        }
+
+        .eqeq-type {
+          display: flex;
+          flex-direction: row;
+          align-items: center;
+          font-size: 28rpx;
+
+          > view:nth-child(1) {
+            color: #000;
+            width: 200rpx;
+          }
+
+          > view:nth-child(2) {
+            color: #666;
+            padding-left: 6rpx;
+          }
+        }
+
+        .eqeq-type + .eqeq-type {
+          margin-top: 16rpx;
+        }
+
+        .status {
+          width: 130rpx;
+          height: 120rpx;
+          box-sizing: border-box;
+          border-radius: 120rpx;
+          // border: 6rpx solid #2C6FF3;
+          text-align: center;
+          display: flex;
+          flex-flow: column;
+          justify-content: space-around;
+          align-items: center;
+          position: absolute;
+          right: 12rpx;
+          bottom: 24rpx;
+
+          .s-name {
+            font-size: 28rpx;
+            padding-top: 20rpx;
+            font-weight: bold;
+          }
+
+          .s-num {
+            font-size: 32rpx;
+            padding-bottom: 20rpx;
+          }
+        }
+      }
+    }
+
+    .more {
+      text-align: center;
+      font-size: 28rpx;
+      color: #2c6ff3;
+      line-height: 80rpx;
+    }
+  }
+
+  .empty {
+    margin: 40% auto 0;
+  }
+}
+</style>

+ 1 - 0
src/pages/globalPages/home.vue

@@ -2,6 +2,7 @@
   <view class="container">
     <view class="pages">
       <Home ref="homeRef"
+            @play='play'
             v-if="current==0" />
       <Equipment ref="equipmentRef"
                  v-if="current==1" />