<template>
	<!-- 商品 模型 -->
	<view class="shopCategory">
		<view class="toptabbar flex">
			<view class="toptabbaritem flex1" :class="{active:navactive==0}" @tap="tagglenav(0)">
				<view class="navnames">添加{{keyname}}</view>
			</view>
			<view class="toptabbaritem flex1" :class="{active:navactive==1}" @tap="tagglenav(1)">
				<view class="navnames">{{keyname}}管理</view>
			</view>
		</view>
		
		<!-- 添加分类的盒子 -->
		<view class="addcategory" v-if="navactive==0">
			<view class="cell_input flex ali-c">
				<view class="lablename">{{keyname}}名称:</view>
				<view class="inputboxs flex1">
					<input type="text" class="input" value="" placeholder="请输入分类名称" />
				</view>
			</view>
			
			<view class="submitbtns">添加{{keyname}}</view>
		</view>
		
		<!-- 分类列表 -->
		<view class="categorylist" v-if="navactive==1">
			<view class="listnames">{{keyname}}列表</view>
			<view class="categorylist_body">
				<view class="categorylist_item flex ali-c jus-b">
					<view class="tagname">测试名称</view>
					<view class="sysbtns flex ali-c">
						<view class="btns">删除</view>
						<view class="changetag">编辑</view>
					</view>
				</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				navactive:1,//tab的选中  0是添加  1是分类管理
				keyname:"",//分类
				pagetype:1,//1分类 2属性
			};
		},
		onLoad(opdata) {
			let keyname = opdata.type==1?"分类":"属性";
			this.keyname = keyname;//关键名称
			uni.setNavigationBarTitle({
				title:keyname+"管理",
			})
		},
		methods:{
			//tab切换
			tagglenav(numbers){
				this.navactive = numbers;
			}
		},
		watch:{
			navactive(){
				if(this.navactive==0){
					//添加分类
				}else{
					//分类管理
				}
			}
		}
	}
</script>

<style lang="scss">
	@import  "../shopCategory/shopCategory.scss";
</style>
