Prechádzať zdrojové kódy

新增客户小程序

tanxue 20 hodín pred
rodič
commit
3597c02c41

+ 52 - 0
components/custom-tabbar/custom-tabbar-kehu.vue

@@ -0,0 +1,52 @@
+<template>
+	<view class="phone-client-tabbar">
+		<view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path,index)">
+			<!-- <icon  :style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }"></icon> -->
+			<image class="tabbar-item-icon" :src="currentTab === index ? item.activePath : item.iconPath" mode="aspectFit"></image>
+			<text class="tabbar-item-text">{{item.text}}</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getStaticUrl} from '@/utils/common.js';
+	import {
+		useTabBarHistory
+	} from '@/utils/emitEvents.js';
+	import cacheManager from "@/utils/cacheManager.js";
+	export default {
+		props: {
+			currentTab: {
+				type: Number,
+			}
+		},
+		data() {
+			return {
+				tabList: [{
+						text: '首页',
+						path: `/pages/kehu/shouYe/shouye`,
+						iconPath: '/static/images/tabbar/unselect/client-jz-icon.png',
+						activePath:'/static/images/tabbar/select/client-jz-icon.png',
+					},
+					{
+						text: '我的',
+						path: `/pages/kehu/my/my`,
+						iconPath: '/static/images/tabbar/unselect/client-my-icon.png',
+						activePath: '/static/images/tabbar/select/client-my-icon.png',
+					},
+				],
+			};
+		},
+		methods: {
+			switchTab(path, index) {
+				if (index == this.currentTab) {
+					// 同页面不刷新
+					return;
+				}
+				uni.redirectTo({url: path});
+			},
+		},
+	}
+</script>
+
+

+ 9 - 12
pages/kehu/shouye/shouye.vue

@@ -1,20 +1,17 @@
 <template>
 	<view>
-		
+		<view>客户首页</view>
+		<!-- 底部区域 -->
+		<customTabbarKehu :currentTab="0"></customTabbarKehu>
 	</view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
-	}
+<script setup>
+	import * as httpApi from "@/api/shouye.js"
+	import {onLoad, onShow} from "@dcloudio/uni-app"
+	import {reactive} from "vue"
+	import cacheManager from '@/utils/cacheManager.js'
+	import customTabbarKehu from "@/components/custom-tabbar/custom-tabbar-kehu.vue"
 </script>
 
 <style>