Ver Fonte

引入菜单逻辑

孙旺 há 2 anos atrás
pai
commit
e9a9e68c0d

+ 16 - 0
.hbuilderx/launch.json

@@ -0,0 +1,16 @@
+{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
+  // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
+    "version": "0.0",
+    "configurations": [{
+     	"default" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "local"
+     	},
+     	"type" : "uniCloud"
+     }
+    ]
+}

+ 8 - 3
src/App.vue

@@ -23,13 +23,14 @@ function initApp () {
 
 async function checkLogin () {
   console.log('检测是否登录开始!')
-  if (getToken() && uni.getStorageSync('sysId')) {
+  if (getToken()) {
     console.log('已登录!')
     await usePermissionStore().GetPermis()
     //判断用户是否有任一菜单权限
-    if (usePermissionStore().permissions_menu && usePermissionStore().permissions_menu != '[]') {
+    if (usePermissionStore().permissions_menu && usePermissionStore().permissions_menu.length > 0) {
       // 开发模式下取消免登录,直接跳转调试页面,生产免登录跳转主页
-      if (process.env.NODE_ENV == 'production') {
+      // if (process.env.NODE_ENV == 'production') {
+      if (process.env.NODE_ENV == 'development') {
         proxy.$tab.reLaunch('/pages/globalPages/home')
       }
     } else {
@@ -70,5 +71,9 @@ function isUpdate () {
 
 <style lang="scss">
 /*每个页面公共css */
+@import '@/static/scss/index.scss';
 @import "uview-plus/index.scss";
+page{
+	background-color: #dcdcdc;
+}
 </style>

+ 106 - 244
src/pages/globalPages/components/account.vue

@@ -1,252 +1,114 @@
 <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>
-      <view v-for="(item,index) in mqtt_cmd_templet_task"
-            :key="item.value">
-        {{item.label}}
-      </view>
-    </view>
-  </view>
+	<view class="container">
+		<view class="banner">
+			<u-swiper :list="list1"></u-swiper>
+		</view>
+		<view class="content" v-if="list&&list.length>0">
+			<block v-for="item in list" :key="item.id">
+				<view class="menu-list">
+					<view class="menu-list-title">
+						{{item.meta.title}}
+					</view>
+					<view class="menu-list-content flex flex-wrap justify-start">
+						<block v-for="item1 in item.children" :key="item1.id">
+							<view class="menu-item flex flex-direction align-center">
+								<view class="menu-img"><u-icon :name="item1.meta.icon"></u-icon></view>
+								<view class="menu-name">
+									{{item1.meta.title}}
+								</view>
+							</view>
+						</block>
+					</view>
+				</view>
+			</block>
+		</view>
+		<view class="empty" v-else>
+			<u-empty></u-empty>
+		</view>
+	</view>
 </template>
 
 <script setup>
-import {
-  onMounted,
-  getCurrentInstance
-} from "vue";
-import {
-  onShow,
-  onLoad
-} from '@dcloudio/uni-app'
-const { proxy } = getCurrentInstance();
-const { mqtt_cmd_templet_task } = proxy.$useDict("mqtt_cmd_templet_task");
-
-onMounted(() => {
-  console.log('商户运营', mqtt_cmd_templet_task)
-
-})
-
+	import {
+		onMounted,
+		watch,
+		watchEffect,
+		getCurrentInstance,
+		ref,
+		computed
+	} from "vue";
+	import usePermissionStore from '@/stores/permission.js'
+	const {
+		proxy
+	} = getCurrentInstance();
+	const {
+		mqtt_cmd_templet_task
+	} = proxy.$useDict("mqtt_cmd_templet_task");
+
+	onMounted(() => {
+		console.log('商户运营', mqtt_cmd_templet_task)
+	})
+
+	const list1 = ref([
+		'https://cdn.uviewui.com/uview/swiper/swiper1.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper2.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper3.png',
+	])
+
+	const menu = ref(usePermissionStore().permissions_menu)
+
+	const list = computed(() => {
+		let tempList = []
+		if (menu.value.find(i => i.meta.title == '商户运营')) {
+			tempList = menu.value.find(i => i.meta.title == '商户运营').children
+		}
+		return tempList
+	})
 </script>
 
 <style lang="scss" scoped>
-.container {
-  padding-bottom: 100rpx;
-
-  // 个人信息
-  .user {
-    background: #2c6ff3
-      url("https://cdn.ossfile.mxrvending.com/assets/xy_merc_mini/images/globalPages/user-bg.png")
-      no-repeat left top;
-    background-size: 100%;
-    padding-bottom: 145rpx;
-    position: relative;
-    width: 100%;
-
-    .user-content {
-      margin-top: 34rpx;
-      width: 100%;
-
-      .head-img {
-        width: 100rpx;
-        height: 100rpx;
-        border-radius: 100rpx;
-        margin-left: 26rpx;
-      }
-
-      .user-name {
-        font-size: 28rpx;
-        color: #fff;
-        margin-left: 33rpx;
-      }
-
-      .share {
-        width: 30rpx;
-        height: 30rpx;
-        position: relative;
-        margin-left: 20rpx;
-
-        .share-image {
-          width: 30rpx;
-          height: 30rpx;
-          position: absolute;
-          left: 0;
-          top: 0;
-
-          > image {
-            width: 30rpx;
-            height: 30rpx;
-          }
-        }
-
-        button {
-          width: 40rpx;
-          height: 40rpx;
-          position: absolute;
-          left: 0;
-          top: 0;
-          opacity: 0;
-        }
-      }
-
-      .login-out {
-        width: 140rpx;
-        line-height: 52rpx;
-        height: 52rpx;
-        text-align: center;
-        font-size: 24rpx;
-        color: #2c6ff3;
-        background-color: #fff;
-        position: absolute;
-        right: 0;
-        top: 185rpx;
-        z-index: 99;
-        border-top-left-radius: 52rpx;
-        border-bottom-left-radius: 52rpx;
-      }
-    }
-  }
-
-  // 常用菜单
-  .menu {
-    width: 724rpx;
-    margin-left: 14rpx;
-    background: #ffffff;
-    box-shadow: 0px 0px 10rpx 0px rgba(174, 201, 255, 0.2);
-    border-radius: 14rpx;
-    margin-top: 24rpx;
-    position: relative;
-    padding: 20rpx 36rpx 42rpx;
-
-    &.menu-userinfo {
-      padding: 36rpx;
-      margin-top: -102rpx;
-    }
-
-    .menu-title {
-      font-size: 30rpx;
-      font-weight: 800;
-      color: #000000;
-      position: absolute;
-      left: 28rpx;
-      top: 28rpx;
-    }
-
-    .u-content {
-      display: flex;
-      flex-flow: row nowrap;
-      justify-content: space-around;
-      text-align: center;
-
-      .u-item {
-        line-height: 50rpx;
-
-        .u-name {
-          font-weight: bold;
-          font-size: 30rpx;
-        }
-
-        .u-val {
-          font-size: 28rpx;
-          color: #666;
-          position: relative;
-          padding-left: 30rpx;
-          display: inline-block;
-
-          > image {
-            width: 21rpx;
-            height: 21rpx;
-            position: absolute;
-            left: 0;
-            top: 50%;
-            transform: translateY(-50%);
-          }
-        }
-      }
-    }
-
-    .cu-btn {
-      padding: 0 12rpx;
-      font-size: 22rpx;
-      height: 40rpx;
-      line-height: 40rpx;
-      background-color: #2c6ff3;
-      color: #fff;
-    }
-
-    .edit {
-      position: absolute;
-      right: 28rpx;
-      top: 28rpx;
-    }
-
-    .s-content {
-      .s-item {
-        line-height: 50rpx;
-
-        > text {
-          color: red;
-        }
-      }
-    }
-
-    .menu-item {
-      display: flex;
-      flex-direction: column;
-      align-items: center;
-      width: 25%;
-
-      > .image {
-        width: 74rpx;
-        height: 74rpx;
-      }
-
-      > view {
-        color: #333333;
-        font-size: 26rpx;
-        line-height: 26rpx;
-        margin-top: 16rpx;
-      }
-    }
-  }
-
-  .qrcode-content {
-    padding: 24rpx;
-
-    .qrcode-img {
-      width: 400rpx;
-      height: 400rpx;
-    }
-
-    .save-qrcode {
-      margin-top: 24rpx;
-    }
-  }
-
-  .chang-password {
-    text-align: center;
-    line-height: 60rpx;
-    color: #2c6ff3;
-    text-decoration: underline;
-  }
-
-  .pwd-popup-content {
-    padding: 24rpx;
-
-    > view:nth-child(1) {
-      width: 160rpx;
-    }
-
-    > view:nth-child(2) {
-      width: 100%;
-    }
-  }
-}
+	.container {
+		.content {
+			.menu-list {
+				margin-bottom: 24rpx;
+				width: 726rpx;
+				margin-left: 12rpx;
+				background-color: #fff;
+				border-radius: 8rpx;
+
+				.menu-list-title {
+					font-size: 30rpx;
+					font-weight: bold;
+					line-height: 80rpx;
+					padding: 0 24rpx;
+				}
+
+				.menu-list-content {
+					width: 100%;
+					padding: 12rpx 0;
+
+					.menu-item {
+						width: 25%;
+						text-align: center;
+						margin-bottom: 24rpx;
+
+						.menu-img {
+							width: 80rpx;
+							height: 80rpx;
+							margin-bottom: 18rpx;
+						}
+						
+						.menu-name{
+							font-size: 26rpx;
+							color: #333;
+						}
+					}
+				}
+			}
+		}
+
+		.empty {
+			margin-top: 50%;
+		}
+	}
 </style>

+ 99 - 67
src/pages/globalPages/components/commodity.vue

@@ -1,82 +1,114 @@
 <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>
-
+	<view class="container">
+		<view class="banner">
+			<u-swiper :list="list1"></u-swiper>
+		</view>
+		<view class="content" v-if="list&&list.length>0">
+			<block v-for="item in list" :key="item.id">
+				<view class="menu-list">
+					<view class="menu-list-title">
+						{{item.meta.title}}
+					</view>
+					<view class="menu-list-content flex flex-wrap justify-start">
+						<block v-for="item1 in item.children" :key="item1.id">
+							<view class="menu-item flex flex-direction align-center">
+								<view class="menu-img"><u-icon :name="item1.meta.icon"></u-icon></view>
+								<view class="menu-name">
+									{{item1.meta.title}}
+								</view>
+							</view>
+						</block>
+					</view>
+				</view>
+			</block>
+		</view>
+		<view class="empty" v-else>
+			<u-empty></u-empty>
+		</view>
+	</view>
 </template>
 
 <script setup>
-function onshow () {
-  console.log('数据中心')
-}
-</script>
+	import {
+		onMounted,
+		watch,
+		watchEffect,
+		getCurrentInstance,
+		ref,
+		computed
+	} from "vue";
+	import usePermissionStore from '@/stores/permission.js'
+	const {
+		proxy
+	} = getCurrentInstance();
+	const {
+		mqtt_cmd_templet_task
+	} = proxy.$useDict("mqtt_cmd_templet_task");
 
-<style lang="scss" scoped>
-.btn-wrap {
-  padding: 24rpx;
-  background-color: #fff;
-}
+	onMounted(() => {
+		console.log('数据中心', mqtt_cmd_templet_task)
+	})
 
-.search {
-  padding: 0 24rpx 24rpx;
-  background-color: #fff;
+	const list1 = ref([
+		'https://cdn.uviewui.com/uview/swiper/swiper1.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper2.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper3.png',
+	])
 
-  .search-input {
-    position: relative;
+	const menu = ref(usePermissionStore().permissions_menu)
 
-    .scan-icon {
-      position: absolute;
-      top: 50%;
-      transform: translateY(-50%);
-      z-index: 2;
+	const list = computed(() => {
+		let tempList = []
+		if (menu.value.find(i => i.meta.title == '数据中心')) {
+			tempList = menu.value.find(i => i.meta.title == '数据中心').children
+		}
+		return tempList
+	})
+</script>
 
-      &.scan-left-show {
-        right: 36rpx;
-      }
+<style lang="scss" scoped>
+	.container {
+		.content {
+			.menu-list {
+				margin-bottom: 24rpx;
+				width: 726rpx;
+				margin-left: 12rpx;
+				background-color: #fff;
+				border-radius: 8rpx;
 
-      &.scan-left-hidden {
-        right: 100rpx;
-      }
-    }
-  }
+				.menu-list-title {
+					font-size: 30rpx;
+					font-weight: bold;
+					line-height: 80rpx;
+					padding: 0 24rpx;
+				}
 
-  .search-history {
-    .history-item {
-      margin-right: 24rpx;
-      padding: 0 12rpx;
-      background-color: #f2f2f2;
-      color: #333;
-      font-size: 24rpx;
-      line-height: 40rpx;
-      border-radius: 40rpx;
-      margin-top: 24rpx;
-    }
-  }
-}
+				.menu-list-content {
+					width: 100%;
+					padding: 12rpx 0;
 
-.classify-wrap {
-  // padding-bottom: 200rpx;
-}
+					.menu-item {
+						width: 25%;
+						text-align: center;
+						margin-bottom: 24rpx;
 
-.btn {
-  width: 100%;
-  position: fixed;
-  bottom: 120rpx;
-  left: 0;
-  display: flex;
-  flex-flow: row nowrap;
-  justify-content: space-between;
-  padding: 0 24rpx;
+						.menu-img {
+							width: 80rpx;
+							height: 80rpx;
+							margin-bottom: 18rpx;
+						}
+						
+						.menu-name{
+							font-size: 26rpx;
+							color: #333;
+						}
+					}
+				}
+			}
+		}
 
-  &.safa-btn {
-    bottom: 180rpx;
-  }
-}
+		.empty {
+			margin-top: 50%;
+		}
+	}
 </style>

+ 108 - 194
src/pages/globalPages/components/equipment.vue

@@ -1,200 +1,114 @@
 <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>
+	<view class="container">
+		<view class="banner">
+			<u-swiper :list="list1"></u-swiper>
+		</view>
+		<view class="content" v-if="list&&list.length>0">
+			<block v-for="item in list" :key="item.id">
+				<view class="menu-list">
+					<view class="menu-list-title">
+						{{item.meta.title}}
+					</view>
+					<view class="menu-list-content flex flex-wrap justify-start">
+						<block v-for="item1 in item.children" :key="item1.id">
+							<view class="menu-item flex flex-direction align-center">
+								<view class="menu-img"><u-icon :name="item1.meta.icon"></u-icon></view>
+								<view class="menu-name">
+									{{item1.meta.title}}
+								</view>
+							</view>
+						</block>
+					</view>
+				</view>
+			</block>
+		</view>
+		<view class="empty" v-else>
+			<u-empty></u-empty>
+		</view>
+	</view>
 </template>
 
 <script setup>
-function onshow () {
-  console.log('质检出场')
-}
+	import {
+		onMounted,
+		watch,
+		watchEffect,
+		getCurrentInstance,
+		ref,
+		computed
+	} from "vue";
+	import usePermissionStore from '@/stores/permission.js'
+	const {
+		proxy
+	} = getCurrentInstance();
+	const {
+		mqtt_cmd_templet_task
+	} = proxy.$useDict("mqtt_cmd_templet_task");
+
+	onMounted(() => {
+		console.log('质检&出厂', mqtt_cmd_templet_task)
+	})
+
+	const list1 = ref([
+		'https://cdn.uviewui.com/uview/swiper/swiper1.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper2.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper3.png',
+	])
+
+	const menu = ref(usePermissionStore().permissions_menu)
+
+	const list = computed(() => {
+		let tempList = []
+		if (menu.value.find(i => i.meta.title == '质检&出厂')) {
+			tempList = menu.value.find(i => i.meta.title == '质检&出厂').children
+		}
+		return tempList
+	})
 </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>
+<style lang="scss" scoped>
+	.container {
+		.content {
+			.menu-list {
+				margin-bottom: 24rpx;
+				width: 726rpx;
+				margin-left: 12rpx;
+				background-color: #fff;
+				border-radius: 8rpx;
+
+				.menu-list-title {
+					font-size: 30rpx;
+					font-weight: bold;
+					line-height: 80rpx;
+					padding: 0 24rpx;
+				}
+
+				.menu-list-content {
+					width: 100%;
+					padding: 12rpx 0;
+
+					.menu-item {
+						width: 25%;
+						text-align: center;
+						margin-bottom: 24rpx;
+
+						.menu-img {
+							width: 80rpx;
+							height: 80rpx;
+							margin-bottom: 18rpx;
+						}
+						
+						.menu-name{
+							font-size: 26rpx;
+							color: #333;
+						}
+					}
+				}
+			}
+		}
+
+		.empty {
+			margin-top: 50%;
+		}
+	}
+</style>

+ 103 - 63
src/pages/globalPages/components/home.vue

@@ -1,78 +1,118 @@
 <template>
-  <view class="container">
-    <view class="nav-bar">
-      <u-navbar title="平台运维"
-                :autoBack="true">
-      </u-navbar>
-    </view>
-    <view>
-      <view v-for="(item,index) in mqtt_cmd_templet_task"
-            :key="item.value">
-        {{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>
+	<view class="container">
+		<view class="banner">
+			<u-swiper :list="list1"></u-swiper>
+		</view>
+		<view class="content" v-if="list&&list.length>0">
+			<block v-for="item in list" :key="item.id">
+				<view class="menu-list">
+					<view class="menu-list-title">
+						{{item.meta.title}}
+					</view>
+					<view class="menu-list-content flex flex-wrap justify-start">
+						<block v-for="item1 in item.children" :key="item1.id">
+							<view class="menu-item flex flex-direction align-center">
+								<view class="menu-img">
+									<u-image width="75rpx" height="75rpx" src="https://cdn.ossfile.mxrvending.com/assets/xy_merc_mini/images/home/risk.png" mode="widthFix"
+										:lazy-load="true">
+									</u-image>
+								</view>
+								<view class="menu-name">
+									{{item1.meta.title}}
+								</view>
+							</view>
+						</block>
+					</view>
+				</view>
+			</block>
+		</view>
+		<view class="empty" v-else>
+			<u-empty></u-empty>
+		</view>
+	</view>
 </template>
 
 <script setup>
-import {
-  onMounted,
-  watch,
-  watchEffect,
-  getCurrentInstance,
-  ref
-} from "vue";
-import test from './test'
-import test1 from './test1'
-const { proxy } = getCurrentInstance();
-const { mqtt_cmd_templet_task } = proxy.$useDict("mqtt_cmd_templet_task");
-
-onMounted(() => {
-  console.log('平台运维', mqtt_cmd_templet_task)
+	import {
+		onMounted,
+		watch,
+		watchEffect,
+		getCurrentInstance,
+		ref,
+		computed
+	} from "vue";
+	import usePermissionStore from '@/stores/permission.js'
+	const {
+		proxy
+	} = getCurrentInstance();
+	const {
+		mqtt_cmd_templet_task
+	} = proxy.$useDict("mqtt_cmd_templet_task");
 
-})
+	onMounted(() => {
+		console.log('平台运维', mqtt_cmd_templet_task)
+	})
 
-const bflag = ref(true)
+	const list1 = ref([
+		'https://cdn.uviewui.com/uview/swiper/swiper1.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper2.png',
+		'https://cdn.uviewui.com/uview/swiper/swiper3.png',
+	])
 
-function change () {
-  bflag.value = !bflag.value
-}
+	const menu = ref(usePermissionStore().permissions_menu)
 
-const a = ref(0)
+	const list = computed(() => {
+		let tempList = []
+		if (menu.value.find(i => i.meta.title == '平台运维')) {
+			tempList = menu.value.find(i => i.meta.title == '平台运维').children
+		}
+		return tempList
+	})
+</script>
 
-const b = ref(0)
+<style lang="scss" scoped>
+	.container {
+		.content {
+			.menu-list {
+				margin-bottom: 24rpx;
+				width: 726rpx;
+				margin-left: 12rpx;
+				background-color: #fff;
+				border-radius: 8rpx;
 
-const c = ref(0)
+				.menu-list-title {
+					font-size: 30rpx;
+					font-weight: bold;
+					line-height: 80rpx;
+					padding: 0 24rpx;
+				}
 
-const time = ref(0)
+				.menu-list-content {
+					width: 100%;
+					padding: 12rpx 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);
+					.menu-item {
+						width: 25%;
+						text-align: center;
+						margin-bottom: 24rpx;
 
-watchEffect(() => {
-  let d = a.value + b.value + c.value
-  console.log(d)
-})
-</script>
+						.menu-img {
+							width: 80rpx;
+							height: 80rpx;
+							margin-bottom: 18rpx;
+						}
+						
+						.menu-name{
+							font-size: 26rpx;
+							color: #333;
+						}
+					}
+				}
+			}
+		}
 
-<style lang="scss" scoped>
+		.empty {
+			margin-top: 50%;
+		}
+	}
 </style>

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

@@ -1,202 +0,0 @@
-<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>

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

@@ -1,202 +0,0 @@
-<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>

+ 15 - 36
src/pages/globalPages/home.vue

@@ -16,7 +16,6 @@
               :value="current"
               @change="tabChange"
               :fixed="true"
-              :placeholder="false"
               :safeAreaInsetBottom="true">
       <u-tabbar-item v-for="item in list"
                      :key="item.id"
@@ -59,38 +58,28 @@ import usePermissionStore from '@/stores/permission.js'
 const current = ref(0)
 const client = ref(null)
 const tabName = ref(null)
-
-// const list = ref([{
-//   iconPath: "home",
-//   selectedIconPath: "home-fill",
-//   text: '平台运维',
-// },
-// {
-//   iconPath: "photo",
-//   selectedIconPath: "photo-fill",
-//   text: '质检出场',
-// },
-// {
-//   iconPath: "play-right",
-//   selectedIconPath: "play-right-fill",
-//   text: '数据中心',
-// },
-// {
-//   iconPath: "account",
-//   selectedIconPath: "account-fill",
-//   text: '商户运营',
-// },
-// ])
-
 const tabIcon = ref({
   '平台运维': ['../../static/images/tabbar/home.png', '../../static/images/tabbar/home_.png'],
   '质检&出厂': ['../../static/images/tabbar/equipment.png', '../../static/images/tabbar/equipment_.png'],
   '数据中心': ['../../static/images/tabbar/commodity.png', '../../static/images/tabbar/commodity_.png'],
   '商户运营': ['../../static/images/tabbar/mine.png', '../../static/images/tabbar/mine_.png'],
+  // '商管端': ['../../static/images/tabbar/equipment.png', '../../static/images/tabbar/equipment_.png'],
+})
+
+// 菜单逻辑
+const menu = ref(usePermissionStore().permissions_menu)
+const list = computed(() => {
+  let list = []
+  menu.value.forEach(i => {
+    list.push({
+      name: i.meta.title,
+      id: i.id
+    })
+  })
+  return list
 })
 
 onShow(() => {
-  console.log('onShow')
   // 版本自动更新代码
   const updateManager = wx.getUpdateManager()
   updateManager.onUpdateReady(function () {
@@ -119,17 +108,7 @@ onLoad((o) => {
   console.log('onLoad', o)
 })
 
-const menu = ref(usePermissionStore().permissions_menu)
-const list = computed(() => {
-  let list = []
-  menu.value.forEach(i => {
-    list.push({
-      name: i.meta.title,
-      id: i.id
-    })
-  })
-  return list
-})
+
 
 function tabChange (e) {
   current.value = e

+ 1 - 1
src/pages/login.vue

@@ -117,7 +117,7 @@ async function pwdLogin (params) {
   await permissionStore.GetPermis()
   //判断用户是否有任一菜单权限
 
-  console.log('permissionStore.permissions_menu', permissionStore.permissions_menu)
+  console.log('permissionStore.permissions_menu=================', permissionStore.permissions_menu)
   if (permissionStore.permissions_menu && permissionStore.permissions_menu !=
     '[]') {
     proxy.$tab.reLaunch('/pages/globalPages/home')

Diff do ficheiro suprimidas por serem muito extensas
+ 5 - 5185
src/stores/permission.js


+ 5 - 2
src/stores/user.js

@@ -32,8 +32,11 @@ const useUserStore = defineStore('user', {
           },
         })
           .then((res) => {
-            setToken(res.satoken)
-            this.token = res.satoken
+            // let token=res.satoken;
+            let token =
+              's9Pk26QO13sqVB27hN1YFU7GBwQ2m8W0qYZkb21nXlwfPJZhx4ku4lOFgIfot0Pg'
+            setToken(token)
+            this.token = token
             this.name = res.mercName
             storage.set(constant.name, res.mercName)
             resolve(res)

+ 0 - 3
src/utils/request.js

@@ -8,7 +8,6 @@ let timeout = 10000
 const baseUrl = config.baseUrl
 
 const request = (config) => {
-  console.log(config)
   // 是否需要设置 token
   const isToken = (config.headers || {}).isToken === false
   config.header = config.header || {}
@@ -35,7 +34,6 @@ const request = (config) => {
         dataType: 'json',
       })
       .then((response) => {
-        console.log(config.url + '==============', response)
         const { data } = response
         saveLogs(config.url, config.data, data.data)
         const code = data.code || 404
@@ -67,7 +65,6 @@ const request = (config) => {
         resolve(data.data)
       })
       .catch((error) => {
-        console.log('err', error)
         saveLogs(config.url, config.data, error)
         uni.hideLoading()
         let { message } = error

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff