Sfoglia il codice sorgente

首页导航区修改

xiaohaizhao 1 anno fa
parent
commit
4c62938fa7
4 ha cambiato i file con 56 aggiunte e 67 eliminazioni
  1. 2 1
      pages/index/index/index.vue
  2. 9 64
      pages/index/index/modules/apps.vue
  3. 2 0
      utils/login.js
  4. 43 2
      utils/tool.js

+ 2 - 1
pages/index/index/index.vue

@@ -10,7 +10,7 @@
         </view>
 
         <slideshow ref="indexTop" />
-        <apps />
+        <apps ref="apps" />
 
         <view class="shop" v-if="shopDetail.storename">
             <view class="head">
@@ -119,6 +119,7 @@ export default {
     },
     methods: {
         init(callBack) {
+            this.$refs.apps.init();
             Promise.all([this.getLocaT(), this.$refs.indexTop.getBanners(['indexTop']), this.$refs.indexBottom.getBanners(['indexBottom'])]).then(res => {
                 callBack()
                 this.updatePage = false;

+ 9 - 64
pages/index/index/modules/apps.vue

@@ -1,12 +1,12 @@
 <template>
-    <view class="apps-box">
-        <view class="item" v-for="item in list" :key="item.label" hover-class="navigator-hover" @click="onClick(item)">
+    <view class="apps-box" v-if="list.length">
+        <view class="item" v-for="item in list" :key="item.remark" hover-class="navigator-hover" @click="switchPage(item)">
             <view class="label">
-                {{ item.label }}
+                {{ item.remark }}
                 <view class="backg" :style="{ background: item.color }" />
             </view>
             <view class="introduce u-line-2">
-                {{ item.introduce }}
+                {{ item.remarks }}
             </view>
         </view>
     </view>
@@ -17,40 +17,8 @@ export default {
     name: "apps",
     data() {
         return {
-            list: [{
-                label: "单品",
-                introduce: "电器 / 吊顶 / 墙面 / 木制品 \n渠道 / 工程",
-                itemId: "cloud"
-            }, {
-                label: "商品",
-                introduce: "总部直通车  千万大返利",
-                itemId: "index",
-                page: "活动",
-            }, {
-                label: "图库",
-                introduce: "电器 / 厨卫 / 阳台 / 背景墙 /顶墙",
-                itemId: "index",
-                page: "案例",
-                params: {
-                    active: '图库'
-                }
-            }, {
-                label: "实景/设计分享图",
-                introduce: "总部精选 / 实景图 / 设计图",
-                itemId: "index",
-                page: "案例",
-                params: {
-                    active: '实景案例'
-                }
-            }, {
-                label: "资料库",
-                introduce: "单品 / 通知 / 介绍 / 画册 / 物料\n视频 / 说明书等",
-                itemId: "cloud",
-            }, {
-                label: "商学院",
-                introduce: "产品 / 销售 / 管理 / 设计 / 考试等",
-                itemId: "cloud",
-            }, {
+            list: [],
+            list1: [{
                 label: "6C红人服务",
                 introduce: "装修报价 / 老房改造 / 精装房焕新\n品质服务",
                 path: "/packageA/advertising/unshareable?id=505"
@@ -58,15 +26,6 @@ export default {
                 label: "免费设计",
                 introduce: "0元领取全屋顶墙设计方案\n免费量尺寸 / 免费设计",
                 path: "/packageA/advertising/shareable?id=505"
-            }, {
-                label: "视频",
-                introduce: "品牌 / 产品 / 安装 / 服务等视频",
-                itemId: "index",
-            }, {
-                label: "云C+工作台",
-                introduce: "预约名单 / 人员管理 / 活动 \n门店 / 商城管理 / 排行榜等",
-                itemId: "cloud",
-                page: "工作台",
             }],
             colors: ['linear-gradient( 270deg, rgba(255,255,255,0) 0%, #E18FFA 100%)',
                 "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #FD8C90 100%)",
@@ -76,24 +35,10 @@ export default {
                 "linear-gradient( 270deg, rgba(255,255,255,0) 0%, #D4D418 100%)"],
         }
     },
-    created() {
-        this.list = this.dye(this.list, this.colors, 2)
-    },
     methods: {
-        onClick(item) {
-            if (item.itemId) {
-                this.$Http.changePage(item.itemId, item.page || item.label, item.params || '')
-            } else if (item.path) {
-                uni.navigateTo({
-                    url: item.path,
-                })
-            } else {
-                uni.showToast({
-                    title: "功能尚在开发中",
-                    icon: "none"
-                })
-            }
-        }
+        init() {
+            this.list = this.dye(this.getApps('首页功能导航'), this.colors, 2)
+        },
     },
 }
 </script>

+ 2 - 0
utils/login.js

@@ -69,8 +69,10 @@ function parsingAuth(list) {
                     pathDetail: m.path_index,
                     name: m.name,
                     remark: m.meta.title,
+                    remarks: m.remarks,
                     cover: m.cover,
                     option: m.meta.auth.map(v => v.option),
+                    forms: m.meta.forms,
                     optionname: m.meta.auth.map(v => v.optionname)
                 }
             })

+ 43 - 2
utils/tool.js

@@ -34,6 +34,7 @@ function mount() {
         return new Promise((resolve, reject) => {
             let that = this;
             handle()
+
             function handle() {
                 uni.getLocation({
                     isHighAccuracy,
@@ -241,12 +242,52 @@ function mount() {
                 }
             })
         } else {
+            if (app.name == 'index_design') {
+                app.name = 'design';
+            } else if (['index_6C', 'index_freeDesign'].includes(app.name)) {
+                app.name = 'longText';
+            };
+            if (app.name == 'index_design') app.name = 'design';
             switch (app.name) {
                 case 'design':
-                    Vue.prototype.$Http.changePage("index","案例",{active: '实景案例' })
+                    Vue.prototype.$Http.changePage("index", "案例", {
+                        active: '实景案例'
+                    })
+                    break;
+                case 'index_product':
+                    Vue.prototype.$Http.changePage("cloud", "单品")
+                    break;
+                case 'index_commodity':
+                    Vue.prototype.$Http.changePage("index", "活动")
+                    break;
+                case 'index_imgs':
+                    Vue.prototype.$Http.changePage("index", "案例", {
+                        active: '图库'
+                    })
+                    break;
+                case 'index_dataBank':
+                    Vue.prototype.$Http.changePage("cloud", "资料库")
+                    break;
+                case 'index_school':
+                    Vue.prototype.$Http.changePage("cloud", "商学院")
+                    break;
+                case 'index_video':
+                    Vue.prototype.$Http.changePage("index", "视频")
+                    break;
+                case 'index_cloud':
+                    Vue.prototype.$Http.changePage("cloud", "工作台")
+                    break;
+                case 'longText':
+                    if (app.forms.path) {
+                        uni.navigateTo({
+                            url: app.forms.path.formcols[0].title
+                        })
+                    } else {
+                        console.log("长图文", app)
+                    }
                     break;
-            
                 default:
+                    console.log("未配置路径", app.name)
                     break;
             }
         }