| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 | 
							- <template>
 
- 	<view class="content">
 
- 		<view class="container">
 
- 			<view class="star" v-if="tabIndex==1">
 
- 				<view class="item">
 
- 					<zhcx-star key="star" />
 
- 					<text>默认</text>
 
- 				</view>
 
- 				<view class="item">
 
- 					<zhcx-star star="4.2" key="star-level" />
 
- 					<text>自定义等级</text>
 
- 				</view>
 
- 				<view class="item">
 
- 					<zhcx-star key="star-color" star="5"  color="orange" />
 
- 					<text>自定义颜色</text>
 
- 				</view>		
 
- 				<view class="item">
 
- 					<zhcx-star key="star-icon" star="2.5" icon="zhcx-icon-aixin" />
 
- 					<text>自定义图标</text>
 
- 				</view>					
 
- 				<view class="item">
 
- 					<zhcx-star star="4.4" color="#3384ff" :disable="false" @check="changeStar"/>
 
- 					<text>可点击</text>
 
- 				</view>	
 
- 				<view class="item">
 
- 					<zhcx-star star="3" color="red" :disable="false" @check="changeStar"/>
 
- 					<text>红星打分可点击</text>
 
- 				</view>							
 
- 			</view>
 
- 			<view class="star" v-if="tabIndex==2">
 
- 				<zhcx-icon />
 
- 			</view>
 
- 			<view class="more" v-if="tabIndex==3">
 
- 				<text>还没写</text>
 
- 				<view class="accordion-content">
 
- 					<accordion>
 
- <!-- 						<view class="item" slot="item">
 
- 							<p>112</p>
 
- 						</view> -->
 
- 					</accordion>				
 
- 				</view>
 
- 			</view>		
 
- 		</view>
 
- 		<view class="tabBar">
 
- 			<view class="item" v-for="item in tabBar" @click="changeTab(item.id)" :key="item.id" :class="tabIndex===item.id?'active':''">
 
- 				<!-- <text>icon</text> -->
 
- 				<text class="name">{{item.name}}</text>
 
- 			</view>
 
- 		</view>
 
- 	</view>
 
- </template>
 
- <script>
 
- 	import zhcxStar from '@/components/Star'
 
- 	import zhcxIcon from '@/components/Icon'
 
- 	import accordion from '@/components/Accordion'
 
- 	
 
- 	export default{
 
- 		name:"zhcx-componts",
 
- 		data:()=>{
 
- 			return{
 
- 				navTitle:"组件",
 
- 				tabIndex:"1",
 
- 				tabBar:[
 
- 					{
 
- 						id:"1",
 
- 						icon:"",
 
- 						name:"评分",
 
- 						path:""
 
- 					},
 
- 					{
 
- 						id:"2",
 
- 						icon:"",
 
- 						name:"图标",
 
- 						path:""
 
- 					},
 
- 					{
 
- 						id:"3",
 
- 						icon:"",
 
- 						name:"更多",
 
- 						path:""
 
- 					}									
 
- 				]
 
- 			}
 
- 		},
 
- 		components:{
 
- 			zhcxStar,zhcxIcon,accordion
 
- 		},	
 
- 		methods:{
 
- 			changeTab(index){
 
- 				this.tabIndex=index;
 
- 				var title=this.tabBar[index-1].name;
 
- 				uni.setNavigationBarTitle({
 
- 				  title
 
- 				})			
 
- 			},
 
- 			changeStar(options){
 
- 				let {checked,star,index}=options;
 
- 				console.log({
 
- 					checked,star,index
 
- 				})
 
- 			}			
 
- 		}
 
- 	}
 
- </script>
 
- <style lang="scss" scoped>
 
- 	.content{
 
- 		.container{
 
- 			padding-bottom:100upx ;
 
- 			.star{
 
- 				.item{
 
- 					padding: 10upx 20upx;
 
- 					display: flex;
 
- 					justify-content: space-between;
 
- 					align-items: center;
 
- 				}
 
- 			}
 
- 		}
 
- 		.tabBar{
 
- 			width: 100%;
 
- 			height: 100upx;						
 
- 			position: fixed;
 
- 			background-color: #fff;
 
- 			left: 0;
 
- 			bottom: 0;
 
- 			border-top: 1px solid #dadada;
 
- 			display: flex;
 
- 			justify-content: space-around;
 
- 			align-items: center;
 
- 			.item{
 
- 				width: 25%;	
 
- 				height: 100upx;
 
- 				float: left;
 
- 				text-align: center;
 
- 				display: flex;
 
- 				justify-content: center;
 
- 				align-items: center;
 
- 				flex-direction: column;
 
- 				&.active{
 
- 					color: #3384ff;
 
- 				}
 
- 				.icon{
 
- 					
 
- 				}
 
- 				.name{
 
- 					
 
- 				}
 
- 			}
 
- 		}
 
- 	}
 
- 	.accordion-content{
 
- 		.item{
 
- 			width: 80%;
 
- 			height: 100vh;
 
- 			background-color: #fff;
 
- 		}
 
- 	}
 
- </style>
 
 
  |