浏览代码

添加我的和工作台页面

xiaohaizhao 1 年之前
父节点
当前提交
d4ef67877f

+ 23 - 0
pages/index/cloud/workbench.vue

@@ -0,0 +1,23 @@
+<template>
+    <view>
+        工作台
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            updatePage: true,
+        }
+    },
+    methods: {
+        init(callBack) {
+            callBack()
+            this.updatePage = false;
+        },
+    },
+}
+</script>
+
+<style lang="scss"></style>

+ 8 - 2
pages/index/index.vue

@@ -3,10 +3,13 @@
 		<index ref="首页" v-show="page == '首页'" />
 		<store ref="活动" v-show="page == '活动'" />
 		<my-case ref="案例" v-show="page == '案例'" />
+		<user-center ref="我的" v-show="page == '我的'" />
+
+		<workbench ref="工作台" v-show="page == '工作台'" />
 		<dataBank ref="资料库" v-show="page == '资料库'" />
 		<school ref="商学院" v-show="page == '商学院'" />
 		<product ref="单品" v-show="page == '单品'" />
-
+		
 		<bottom-suspension-frame ref="pages" @onChange="pageChange" />
 	</view>
 </template>
@@ -15,13 +18,16 @@
 import index from './index/index.vue'
 import store from './index/store.vue'
 import myCase from './index/myCase.vue'
+import userCenter from './index/userCenter.vue'
+
 import dataBank from './cloud/dataBank.vue'
 import school from './cloud/school.vue'
 import product from './cloud/product.vue'
+import workbench from './cloud/workbench.vue'
 
 import bottomSuspensionFrame from "./modules/bottomSuspensionFrame.vue";
 export default {
-	components: { bottomSuspensionFrame, index, store, myCase, dataBank, school, product },
+	components: { bottomSuspensionFrame, index, store, myCase, userCenter, dataBank, school, product, workbench },
 	data() {
 		return {
 			swiperItemID: 'index',

+ 2 - 0
pages/index/index/modules/apps.vue

@@ -65,6 +65,8 @@ export default {
             }, {
                 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%)",

+ 23 - 0
pages/index/index/userCenter.vue

@@ -0,0 +1,23 @@
+<template>
+    <view>
+        用户中心
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            updatePage: true,
+        }
+    },
+    methods: {
+        init(callBack) {
+            callBack()
+            this.updatePage = false;
+        },
+    },
+}
+</script>
+
+<style lang="scss"></style>

+ 35 - 12
pages/index/modules/bottomSuspensionFrame.vue

@@ -8,19 +8,22 @@
                     {{ item.name }}
                 </text>
             </view>
-            <image class="image" src="/static/c+selected.svg" mode="widthFix"
-                @click="onClick('cloud', cloudLastPage || '资料库')" />
+            <image v-if="!sightseer" class="image" src="/static/c+selected.svg" mode="widthFix"
+                @click="onClick('cloud', '工作台')" />
         </swiper-item>
+
         <swiper-item class="swiper-item" item-id="cloud">
-            <image class="image" src="/static/c+unselected.svg" mode="widthFix"
-                @click="onClick('index', indexLastPage || '首页')" />
-            <view class="item" v-for="item in cloud" :key="item.name"
-                @click="item.name == showPageName ? update() : onClick('cloud', item.name)">
-                <u-loading-icon v-if="item.loading" mode="circle" />
-                <text v-else :style="{ fontWeight: item.name == showPageName ? 'bold' : 'normal' }">
-                    {{ item.name }}
-                </text>
-            </view>
+            <image class="image" :src="showPageName == '工作台' ? '/static/c+unselected.svg' : '/static/c+selected.svg'"
+                mode="widthFix" @click="onClick('cloud', '工作台')" />
+            <block v-for="item in cloud" :key="item.name">
+                <block v-if="item.name == '工作台'" />
+                <view v-else class="item" @click="item.name == showPageName ? update() : onClick('cloud', item.name)">
+                    <u-loading-icon v-if="item.loading" mode="circle" />
+                    <text v-else :style="{ fontWeight: item.name == showPageName ? 'bold' : 'normal' }">
+                        {{ item.name }}
+                    </text>
+                </view>
+            </block>
         </swiper-item>
     </swiper>
 </template>
@@ -29,6 +32,7 @@
 export default {
     data() {
         return {
+            sightseer: true,
             current: "index",
             showPageName: "",
             indexLastPage: '',
@@ -41,8 +45,12 @@ export default {
                 name: "案例"
             }, {
                 name: "视频"
+            }, {
+                name: "我的"
             }],
             cloud: [{
+                name: "工作台"
+            }, {
                 name: "资料库"
             }, {
                 name: "商学院"
@@ -60,11 +68,27 @@ export default {
         }
     },
     mounted() {
+        this.init();
         // #ifdef !MP-WEIXIN
         this.onClick(this.$parent.$parent.swiperItemID, this.$parent.$parent.page)
         // #endif
     },
     methods: {
+        init() {
+            const systemInitIsComplete = this.$Http.systemInitIsComplete;
+            if (!systemInitIsComplete || typeof systemInitIsComplete == 'object') {
+                this.$Http.HomePageStartRendering = render(this)
+            } else {
+                render(this)
+            }
+            function render(that) {
+                let sightseer = uni.getStorageSync('userMsg').usertype == 99;
+                if (!that.sightseer) that.index.pop();
+                that.sightseer = sightseer
+                console.log("是否游客", that.sightseer)
+                console.log(that.index)
+            }
+        },
         onClick(current, name, update = false, params = null) {
             if (name == '首页') current = 'index';
             const item = this[current].find(v => v.name == name),
@@ -131,6 +155,5 @@ export default {
             padding: 4px;
         }
     }
-
 }
 </style>