#
whycq
2024-07-17 bbfe4dd2532bbd41c7f9d26285c7f0aae84ccb54
pages/home/home.vue
@@ -2,7 +2,7 @@
   <view>
      <scroll-view scroll-y class="page">
         <view class="nav-list">
            <navigator hover-class='none' :url="'/pages' + item.url" class="nav-li" navigateTo
            <navigator hover-class='none' :url="'/pages' + item.url + '?id=' + item.id" class="nav-li" navigateTo
               :class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]"
               v-for="(item,index) in elements" :key="index">
               <view class="nav-title">{{item.title}}</view>
@@ -244,7 +244,7 @@
      onShow() {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
         this.project = uni.getStorageSync('project')
         // this.project = uni.getStorageSync('project')
         this.getAuth()
         this.backGroundRepeat()
      },
@@ -264,7 +264,7 @@
            let that = this
            uni.request({
               url: that.baseUrl + '/menu/pda/auth',
               data: {},
               data: {level:1,id: '0'},
               header: { 'token': uni.getStorageSync('token') },
               method: 'POST',
               success(res) {
@@ -276,23 +276,15 @@
                  res = res.data
                  that.elements = []
                  if (res.code === 200) {
                     if (res.data == undefined || res.data == null || res.data == "") {
                        that.elements = that.elements2
                        return
                     }
                     for (var i = 0; i < res.data.length; i++) {
                        if (res.data.length < 0) {
                           break;
                        }
                        that.getIcon(res.data[i].title)
                        that.elements.unshift({
                           title: res.data[i].name,
                           name: res.data[i].title,
                           color: that.colorList[i],
                           cuIcon: that.icon,
                           url: `/${that.project}${res.data[i].action}`
                        })
                     }
                     that.getIcon(res.data[i].title)
                     that.elements.unshift({
                        title: res.data[i].name,
                        name: res.data[i].title,
                        color: that.colorList[i],
                        cuIcon: that.icon,
                        id: res.data[i].id,
                        url: `${res.data[i].code}`
                     })
                     that.elements.push({
                        title: '退出登录',
                        name: 'logOut',
@@ -342,6 +334,15 @@
</script>
<style>
   .nav-list {
      padding: 0px 40upx 0px;
   }
   .nav-li {
      padding: 30upx;
      border-radius: 12upx;
      width: 90%;
      margin: 0 2.5% 40upx;
   }
   .page {
      height: 100vh;
   }