Lou
2024-03-19 d34c7c19ab062b8e99b7af7e1d44e009c1b9b739
common/common.js
@@ -29,6 +29,15 @@
   }
}
/**
 *
 *  显示完整路径
 */
export const setFullUrl = (str) => {
   return `${minioBaseUrl}${str}`
}
export const showTips = (text, icon) => {
   uni.showToast({
@@ -60,11 +69,16 @@
// 文件路径转字符串
export const formattingUrls = (urls) => {
   let arr = [];
   for (let i of urls) {
      arr.push(i.name);
   if (!urls.length) {
      return ""
   } else {
      let arr = [];
      for (let i of urls) {
         arr.push(i.name);
      }
      return arr.join(",")
   }
   return arr.join(",")
}
//转换标签颜色
@@ -79,4 +93,55 @@
         return obj[i]
      }
   }
}
export const getTabbarList = (roleType) => {
   if (roleType == 2) {
      return [{
            name: '首页',
            iconPathSelected: '/static/img/tabbar-01-selected.png',
            iconPath: '/static/img/tabbar-01.png',
            url: '/pages/home/index'
         },
         {
            name: '驾驶舱',
            iconPathSelected: '/static/img/tabbar-02-selected.png',
            iconPath: '/static/img/tabbar-02.png',
            url: '/pages/statistics/index'
         },
         {
            name: '个人中心',
            iconPathSelected: '/static/img/tabbar-03-selected.png',
            iconPath: '/static/img/tabbar-03.png',
            url: '/pages/user/center'
         }
      ]
   } else {
      return [{
            name: '首页',
            iconPathSelected: '/static/img/tabbar-01-selected.png',
            iconPath: '/static/img/tabbar-01.png',
            url: '/pages/home/index'
         },
         {
            name: '圈子',
            iconPathSelected: '/static/img/tabbar-02-selected.png',
            iconPath: '/static/img/tabbar-02.png',
            url: '/pages/circle/index'
         },
         {
            name: '个人中心',
            iconPathSelected: '/static/img/tabbar-03-selected.png',
            iconPath: '/static/img/tabbar-03.png',
            url: '/pages/user/center'
         }
      ]
   }
}