浏览代码

完成买家页面

Zhengy 6 年之前
父节点
当前提交
fda13efa41
共有 5 个文件被更改,包括 490 次插入73 次删除
  1. 3 0
      src/api/config.js
  2. 245 41
      src/mock/index.js
  3. 39 1
      src/router/index.js
  4. 146 2
      src/view/buyer/Buyer.vue
  5. 57 29
      src/view/shop/Good.vue

+ 3 - 0
src/api/config.js

@@ -13,4 +13,7 @@ export default{
 	changeGoodBasicMess:api+"/changeGoodBasicMess",//商家修改商品基本信息
 	addGoodTags:api+"/addGoodTags",//商家添加个性化元素分类
 	addGood:api+"/addGood",//商家上架商品
+	paySuccess:api+"/paySuccess",//买家支付成功
+	submitEvaluation:api+"/submitEvaluation",//买家提交评价
+	getOrderList:api+"/getOrderList",//买家获取订单列表
 }

+ 245 - 41
src/mock/index.js

@@ -26,19 +26,19 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["黄金","白银","彩金","水晶","珍珠"]
+  					"list":[{"name":"黄金","price":688},{"name":"白银","price":499},{"name":"彩金","price":378},{"name":"水晶","price":256},{"name":"珍珠","price":196}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"图形",
-  					"list":["比翼双飞","心心相印","长命百岁","合家欢乐","福运到","守护天使"]
+  					"list":[{"name":"比翼双飞","price":100},{"name":"心心相印","price":100},{"name":"长命百岁","price":100},{"name":"合家欢乐","price":100},{"name":"福运到","price":100},{"name":"守护天使","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"刻字",
-  					"list":["嘿,是我","小幸运","我是你爸爸","女神"]
+  					"list":[{"name":"嘿,是我","price":100},{"name":"小幸运","price":100},{"name":"我是你爸爸","price":100},{"name":"女神","price":100}]
   				},
   			],
   			"commentsList":[
@@ -74,19 +74,19 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["黄金","白银","彩金","水晶","珍珠"]
+  					"list":[{"name":"黄金","price":688},{"name":"白银","price":499},{"name":"彩金","price":378},{"name":"水晶","price":256},{"name":"珍珠","price":196}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"图形",
-  					"list":["比翼双飞","心心相印","长命百岁","合家欢乐","福运到","守护天使"]
+  					"list":[{"name":"比翼双飞","price":100},{"name":"心心相印","price":100},{"name":"长命百岁","price":100},{"name":"合家欢乐","price":100},{"name":"福运到","price":100},{"name":"守护天使","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"刻字",
-  					"list":["嘿,是我","小幸运","我是你爸爸","女神"]
+  					"list":[{"name":"嘿,是我","price":100},{"name":"小幸运","price":100},{"name":"我是你爸爸","price":100},{"name":"女神","price":100}]
   				},
   			],
   			"commentsList":[
@@ -121,26 +121,22 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["黄金","白银","彩金","水晶","珍珠"]
+  					"list":[{"name":"黄金","price":688},{"name":"白银","price":499},{"name":"彩金","price":378},{"name":"水晶","price":256},{"name":"珍珠","price":196}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"图形",
-  					"list":["比翼双飞","心心相印","长命百岁","合家欢乐","福运到","守护天使"]
+  					"list":[{"name":"比翼双飞","price":100},{"name":"心心相印","price":100},{"name":"长命百岁","price":100},{"name":"合家欢乐","price":100},{"name":"福运到","price":100},{"name":"守护天使","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"刻字",
-  					"list":["嘿,是我","小幸运","我是你爸爸","女神"]
+  					"list":[{"name":"嘿,是我","price":100},{"name":"小幸运","price":100},{"name":"我是你爸爸","price":100},{"name":"女神","price":100}]
   				},
   			],
   			"commentsList":[
-  				{
-  					"text":"特别美妹妹很喜欢",
-  					"author":"和牙刷私奔叻丶"
-  				},
   				{
   					"text":"不咋地啊",
   					"author":"夜凋凝"
@@ -168,26 +164,22 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["黄金","白银","彩金","水晶","珍珠"]
+  					"list":[{"name":"黄金","price":688},{"name":"白银","price":499},{"name":"彩金","price":378},{"name":"水晶","price":256},{"name":"珍珠","price":196}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"图形",
-  					"list":["比翼双飞","心心相印","长命百岁","合家欢乐","福运到","守护天使"]
+  					"list":[{"name":"比翼双飞","price":100},{"name":"心心相印","price":100},{"name":"长命百岁","price":100},{"name":"合家欢乐","price":100},{"name":"福运到","price":100},{"name":"守护天使","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"刻字",
-  					"list":["嘿,是我","小幸运","我是你爸爸","女神"]
+  					"list":[{"name":"嘿,是我","price":100},{"name":"小幸运","price":100},{"name":"我是你爸爸","price":100},{"name":"女神","price":100}]
   				},
   			],
   			"commentsList":[
-  				{
-  					"text":"特别美妹妹很喜欢",
-  					"author":"和牙刷私奔叻丶"
-  				},
   				{
   					"text":"不咋地啊",
   					"author":"夜凋凝"
@@ -219,25 +211,25 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"膨化食品类",
-  					"list":["虾条","薯片","鱿鱼酥","蔬菜圈","爆米花"]
+  					"list":[{"name":"虾条","price":8},{"name":"薯片","price":8},{"name":"鱿鱼酥","price":12},{"name":"蔬菜圈","price":6},{"name":"爆米花","price":9}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"凉果蜜饯类",
-  					"list":["话梅","凉果","蜜饯","果脯","瓜果干","酸角糕"]
+  					"list":[{"name":"话梅","price":11},{"name":"凉果","price":8},{"name":"蜜饯","price":8},{"name":"果脯","price":10},{"name":"瓜果干","price":9},{"name":"酸角糕","price":8}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"肉干鱼干类",
-  					"list":["牛肉干","牛肉脯","猪肉粒","鱼片"]
+  					"list":[{"name":"牛肉干","price":19.9},{"name":"牛肉脯","price":18.5},{"name":"猪肉粒","price":16.2},{"name":"鱼片","price":12}]
   				},
   				{
   					"id":3,
   					"inputVisible":false,
   					"type":"干果类",
-  					"list":["花生","瓜子","开心果","核桃仁","杏仁","榛子"]
+  					"list":[{"name":"花生","price":8.8},{"name":"瓜子","price":8.8},{"name":"开心果","price":12},{"name":"核桃仁","price":18},{"name":"杏仁","price":11},{"name":"榛子","price":12}]
   				},
   			],
   			"commentsList":[
@@ -273,19 +265,19 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["羊毛","石棉","锦纶","涤纶","晴纶"]
+  					"list":[{"name":"羊毛","price":300},{"name":"石棉","price":280},{"name":"锦纶","price":190},{"name":"涤纶","price":130},{"name":"晴纶","price":120}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"颜色",
-  					"list":["红色","黑色","白色","紫色","粉色","绿色"]
+  					"list":[{"name":"红色","price":100},{"name":"黑色","price":100},{"name":"白色","price":100},{"name":"紫色","price":100},{"name":"粉色","price":100},{"name":"绿色","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"风格",
-  					"list":["少女","尊贵","气质","时尚"]
+  					"list":[{"name":"少女","price":300},{"name":"尊贵","price":3500},{"name":"气质","price":280},{"name":"时尚","price":400}]
   				},
   			],
   			"commentsList":[
@@ -316,26 +308,22 @@ var accountInfo=[//账号列表
   					"id":0,
   					"inputVisible":false,
   					"type":"材质",
-  					"list":["羊毛","石棉","锦纶","涤纶","晴纶"]
+  					"list":[{"name":"羊毛","price":300},{"name":"石棉","price":280},{"name":"锦纶","price":190},{"name":"涤纶","price":130},{"name":"晴纶","price":120}]
   				},
   				{
   					"id":1,
   					"inputVisible":false,
   					"type":"颜色",
-  					"list":["红色","黑色","白色","紫色","粉色","绿色"]
+  					"list":[{"name":"红色","price":100},{"name":"黑色","price":100},{"name":"白色","price":100},{"name":"紫色","price":100},{"name":"粉色","price":100},{"name":"绿色","price":100}]
   				},
   				{
   					"id":2,
   					"inputVisible":false,
   					"type":"风格",
-  					"list":["少女","尊贵","气质","时尚"]
+  					"list":[{"name":"少女","price":300},{"name":"尊贵","price":3500},{"name":"气质","price":280},{"name":"时尚","price":400}]
   				},
   			],
   			"commentsList":[
-  				{
-  					"text":"质量不错",
-  					"author":"和牙刷私奔叻丶"
-  				},
   				{
   					"text":"不咋地",
   					"author":"夜凋凝"
@@ -346,9 +334,135 @@ var accountInfo=[//账号列表
   },
   ],
   [//买家账号
-  	{"name":"buyer1","password":"123","mess":{"id":1,"userName":"和牙刷私奔叻丶","loginId":"buyer1","password":"123","address":"黑龙江省大庆市"}},
-  	{"name":"buyer2","password":"123","mess":{"id":2,"userName":"夜凋凝","loginId":"buyer2","password":"123","address":"黑龙江省鹤岗市"}},
-  	{"name":"buyer3","password":"123","mess":{"id":3,"userName":"盛夏。","loginId":"buyer3","password":"123","address":"四川省南充市"}},
+  	{"name":"buyer1","password":"123","mess":{"id":1,"userName":"和牙刷私奔叻丶","loginId":"buyer1","password":"123","address":"黑龙江省大庆市"},
+  	"boughtList":[
+  		{
+  			"id":1,
+  			"shopId":1,
+  			"goodId":"1",
+  			"madeTags":[
+  				{
+  					"type":"材质",
+  					"item":{
+  						"name":"白银",
+  						"price":499
+  					}
+  				},
+  				{
+  					"type":"图形",
+  					"item":{
+  						"name":"合家欢乐",
+  						"price":100
+  					}
+  				},
+  				{
+  					"type":"刻字",
+  					"item":{
+  						"name":"嘿,是我",
+  						"price":100
+  					}
+  				},
+  			],
+  			"evaluate":"特别美妹妹很喜欢"
+  		},
+  		{
+  			"id":2,
+  			"shopId":1,
+  			"goodId":"2",
+  			"madeTags":[
+  				{
+  					"type":"材质",
+  					"item":{
+  						"name":"水晶",
+  						"price":256
+  					}
+  				},
+  				{
+  					"type":"图形",
+  					"item":{
+  						"name":"福运到",
+  						"price":100
+  					}
+  				},
+  				{
+  					"type":"刻字",
+  					"item":{
+  						"name":"小幸运",
+  						"price":100
+  					}
+  				},
+  			],
+  			"evaluate":"特别美妹妹很喜欢"
+  		},
+  		{
+  			"id":3,
+  			"shopId":2,
+  			"goodId":"1",
+  			"madeTags":[
+  				{
+  					"type":"膨化食品类",
+  					"item":{
+  						"name":"虾条",
+  						"price":8
+  					}
+  				},
+  				{
+  					"type":"凉果蜜饯类",
+  					"item":{
+  						"name":"凉果",
+  						"price":8
+  					}
+  				},
+  				{
+  					"type":"肉干鱼干类",
+  					"item":{
+  						"name":"牛肉脯",
+  						"price":18.5
+  					}
+  				},
+  				{
+  					"type":"干果类",
+  					"item":{
+  						"name":"杏仁",
+  						"price":11
+  					}
+  				},
+  			],
+  			"evaluate":"太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦太好吃啦"
+  		},
+  		{
+  			"id":4,
+  			"shopId":3,
+  			"goodId":"1",
+  			"madeTags":[
+  				{
+  					"type":"材质",
+  					"item":{
+  						"name":"棉纶",
+  						"price":190
+  					}
+  				},
+  				{
+  					"type":"颜色",
+  					"item":{
+  						"name":"黑色",
+  						"price":100
+  					}
+  				},
+  				{
+  					"type":"风格",
+  					"item":{
+  						"name":"气质",
+  						"price":280
+  					}
+  				},
+  			],
+  			"evaluate":"质量不错"
+  		},
+  	]
+  },
+  	{"name":"buyer2","password":"123","mess":{"id":2,"userName":"夜凋凝","loginId":"buyer2","password":"123","address":"黑龙江省鹤岗市"},},
+  	{"name":"buyer3","password":"123","mess":{"id":3,"userName":"盛夏。","loginId":"buyer3","password":"123","address":"四川省南充市"},},
   ],
 ];
 var shopTagList=[{id: 1, text: '饰品', value: '饰品' }, {id: 2, text: '食品', value: '食品' }, {id: 3, text: '服装', value: '服装' }]
@@ -465,10 +579,20 @@ Mock.mock('http://www.Zhengy.com/api/adminHandle',function(options){
 //商家获取已上架商品列表
 Mock.mock('http://www.Zhengy.com/api/getGoodList',function(options){
 	var req = eval('('+options.body+')');
-	var index = accountInfo[1].findIndex((value,index,arr)=>{
-		return value.mess.id==req.id;
-	})
-	var res = accountInfo[1][index].goodList;
+	if(req.type=='1'){
+		var res=[];
+		for(var i=0,length1=accountInfo[1].length;i<length1;i++){
+			for(var j=0,length2=accountInfo[1][i].goodList.length;j<length2;j++){
+				accountInfo[1][i].goodList[j].shopId=accountInfo[1][i].mess.id;
+				res.push(accountInfo[1][i].goodList[j]);
+			}
+		}
+	}else{
+		var index = accountInfo[1].findIndex((value,index,arr)=>{
+			return value.mess.id==req.id;
+		})
+		var res = accountInfo[1][index].goodList;
+	}
 	return res;
 })
 //商家获取某商品详细信息
@@ -571,4 +695,84 @@ Mock.mock('http://www.Zhengy.com/api/addGood',function(options){
 	accountInfo[1][index].goodList.push(good);
 	code=200;
 	return {code:code,goodlist:accountInfo[1][index].goodList}
+})
+
+//买家页面
+//买家支付成功
+Mock.mock('http://www.Zhengy.com/api/paySuccess',function(options){
+	var req = eval('('+options.body+')');
+	var code=201;
+	var index1 = accountInfo[2].findIndex((value,index,arr)=>{
+		return value.mess.id==req.buyerId;
+	})
+	if(accountInfo[2][index1].boughtList.length==0){
+		var id=1;
+	}else{
+		id=accountInfo[2][index1].boughtList[accountInfo[2][index1].boughtList.length-1].id+1;
+	}
+	let bought={
+		"id":id,
+		"shopId":req.shopId,
+		"goodId":req.goodId,
+		"madeTags":req.madeTags
+	}
+	accountInfo[2][index1].boughtList.push(bought);
+	code=200;
+	return {code:code,id:id}
+})
+//买家提交评价
+Mock.mock('http://www.Zhengy.com/api/submitEvaluation',function(options){
+	var req = eval('('+options.body+')');
+	var code=201;
+	var index1 = accountInfo[2].findIndex((value,index,arr)=>{
+		return value.mess.id==req.buyerId;
+	})
+	let comment={
+		"text":req.comment,
+		"author":accountInfo[2][index1].mess.userName,
+	}
+	var index2 = accountInfo[1].findIndex((value,index,arr)=>{
+		return value.mess.id==req.shopId;
+	})
+	var index3 = accountInfo[1][index2].goodList.findIndex((value,index,arr)=>{
+		return value.id==req.goodId;
+	})
+	accountInfo[1][index2].goodList[index3].commentsList.push(comment);
+	var index4 = accountInfo[2][index1].boughtList.findIndex((value,index,arr)=>{
+		return value.id==req.id;
+	})
+	accountInfo[2][index1].boughtList[index4].evaluate=req.comment;
+	code=200;
+	return {code:code,buyer:accountInfo[2][index1].boughtList[index4],shop:accountInfo[1][index2].goodList[index3]}
+})
+//买家获取订单列表
+Mock.mock('http://www.Zhengy.com/api/getOrderList',function(options){
+	var req = eval('('+options.body+')');
+	var code=201;
+	var index = accountInfo[2].findIndex((value,index,arr)=>{
+		return value.mess.id==req.buyerId;
+	})
+	var res=[];
+	for(var i=0,length=accountInfo[2][index].boughtList.length;i<length;i++){
+		var list = accountInfo[2][index].boughtList[i];
+		var index2 = accountInfo[2].findIndex((value,index,arr)=>{
+			return value.mess.id==list.shopId;
+		})
+		var index3 = accountInfo[1][index2].goodList.findIndex((value,index,arr)=>{
+			return value.id==list.goodId;
+		})
+		var item={
+			id:accountInfo[2][index].boughtList[i].id,
+			evaluate:accountInfo[2][index].boughtList[i].evaluate,
+			shopId:accountInfo[2][index].boughtList[i].shopId,
+			goodId:accountInfo[2][index].boughtList[i].goodId,
+			coverImg:accountInfo[1][index2].goodList[index3].coverImg,
+			title:accountInfo[1][index2].goodList[index3].title,
+			produce:accountInfo[1][index2].goodList[index3].produce,
+			price:accountInfo[1][index2].goodList[index3].price,
+		}
+		res.push(item);
+	}
+	code=200;
+	return {code:code,list:res}
 })

+ 39 - 1
src/router/index.js

@@ -73,7 +73,45 @@ export default new Router({
     },
     {
     	path: '/buyer',
-    	component: Buyer
+    	component: Buyer,
+      children: [
+        {
+          path:'index',
+          component: function(resolve){
+            require(['../view/buyer/Index.vue'], resolve)
+          }
+        },
+        {
+          path:'goodList',
+          component: function(resolve){
+            require(['../view/buyer/GoodList.vue'], resolve)
+          }
+        },
+        {
+          path:'good',
+          component: function(resolve){
+            require(['../view/buyer/Good.vue'], resolve)
+          }
+        },
+        {
+          path:'toBuy',
+          component: function(resolve){
+            require(['../view/buyer/ToBuy.vue'], resolve)
+          }
+        },
+        {
+          path:'orderList',
+          component: function(resolve){
+            require(['../view/buyer/OrderList.vue'], resolve)
+          }
+        },
+        {
+          path:'order',
+          component: function(resolve){
+            require(['../view/buyer/Order.vue'], resolve)
+          }
+        },
+      ]
     },
   ]
 })

+ 146 - 2
src/view/buyer/Buyer.vue

@@ -1,5 +1,43 @@
 <template>
-
+	<div class="admin-wrap">
+		<el-container>
+		  <el-aside width="260px">
+		    <el-row >
+			    <el-col>
+			      <el-menu 
+			        default-active="1" 
+			        class="el-menu-vertical-demo" 
+			        :unique-opened="true">
+			        <el-menu-item index="1">
+			          <router-link to="/buyer/index"><img src="../../assets/images/admin/administrator.png" />用户信息</router-link>
+			        </el-menu-item>
+			        <el-submenu index="2">
+			          <template slot="title" ><i class="el-icon-tickets"></i>商品管理</template>
+			          <el-menu-item-group>
+			            <el-menu-item index="2-1">
+			              <router-link to="/buyer/goodList">商品列表</router-link>
+			            </el-menu-item>
+			            <el-menu-item index="2-2">
+			              <router-link to="/buyer/orderList">我的订单</router-link>
+			            </el-menu-item>
+			          </el-menu-item-group>
+			        </el-submenu>
+			      </el-menu>
+			    </el-col>
+			  </el-row>
+		  </el-aside>
+		  <el-main>
+		  	<div class="header-wrap">
+		  		<router-link to="/index">退出</router-link>
+		  		<div>
+		  			<img src="../../assets/images/admin/userImg.png" />
+		  			{{$store.state.userMess.userName}}
+		  		</div>
+		  	</div>
+				<router-view></router-view>
+		  </el-main>
+		</el-container>
+	</div>
 </template>
 
 <script>
@@ -7,5 +45,111 @@
 </script>
 
 <style scoped>
-	
+	.admin-wrap{
+		height: 100%;
+	}
+	.header-wrap{
+		width: 100%;
+		height: 50px;
+		background-color: #fff;
+		padding: 0 20px;
+		line-height: 50px;
+	}
+	.header-wrap a{
+		display: block;
+		float: right;
+		color: #3eb983;
+	}
+	.header-wrap div{
+		height: 100%;
+		float: right;
+		text-align: left;
+		vertical-align: middle;
+		padding-right: 30px;
+	}
+	.header-wrap img{
+		width: 20px;
+		vertical-align: middle;
+		margin-right: 5px;
+	}
+</style>
+
+<style>
+	.el-container{
+		height: 100%;
+	}
+	.el-aside{
+		background-color: #1f2935;
+		text-align: left;
+	}
+	.el-main{
+		padding: 0;
+	}
+	.el-menu{
+		height: 100%;
+	}
+</style>
+
+<style>
+	.iconfont{
+    margin-right:10px;
+  }
+  .el-menu-vertical-demo{
+    padding-left: 18px;
+  }
+  .el-menu{
+    background: #1f2935!important;
+    border-right: 0;
+  }
+  .el-menu img{
+  	width: 20px;
+  	margin: 0 5px 0 2px;
+  	vertical-align: middle;
+  }
+  .el-menu-item a{
+    display: block;
+    width: 100%;
+    height: 100%;
+    font-size: 14px;
+    /*padding-left: 6px;*/
+  }
+  .el-submenu a{
+    padding-left: 6px;
+  }
+  a.router-link-active a{
+    color:#3eb983!important; 
+  }
+  .el-menu-item-group .is-active a{
+    color:#3eb983!important; 
+  }
+  .el-menu-item-group li{
+    background:#1f2935;
+    line-height: 48px;
+    font-size:16px;
+  }
+  .el-menu-item-group li i{
+  	margin-right: 10px;
+  }
+  .el-menu-item-group__title {
+    padding-top: 0;
+    color: #a2aebf;
+  }
+  a{
+    color: #a2aebf;
+  }
+  .el-submenu .el-menu-item:hover, .el-submenu__title:hover{
+    background: #0f1722!important;
+  }
+  .el-menu-item, .el-submenu__title{
+    color:#a2aebf; 
+  }
+  .el-submenu__icon-arrow{
+    right: 40px;
+  }
+  .el-menu-vertical-demo{
+    padding-left: 0;
+  }
+  .el-menu--horizontal.el-menu--dark .el-submenu .el-menu-item:hover, .el-menu--horizontal.el-menu--dark .el-submenu .el-submenu-title:hover, .el-menu-item:hover{
+    background: #0f1722;
+  }
 </style>

+ 57 - 29
src/view/shop/Good.vue

@@ -30,23 +30,30 @@
 						<h6>{{item.type}}</h6>
 						<div>
 							<el-tag
-							  v-for="tag in item.list"
-							  :key="tag"
+							  v-for="(tag,index) in item.list"
+							  :key="index"
 							  closable
 							  :disable-transitions="false"
 							  @close="handleClose(tag,item.id)">
-							  {{tag}}
+							  {{tag.name}}
 							</el-tag>
 							<el-input
 							  class="input-new-tag"
 							  v-if="item.inputVisible"
-							  v-model="inputValue"
+							  v-model="inputValue1"
 							  :ref="item.type"
 							  size="small"
-							  @keyup.enter.native="handleInputConfirm(item.id)"
-							  @blur="handleInputConfirm(item.id)"
-							>
-							</el-input>
+							  placeholder="标签名称"
+							></el-input>
+							<el-input
+							  class="input-new-tag"
+							  v-if="item.inputVisible"
+							  v-model="inputValue2"
+							  :ref="item.type"
+							  size="small"
+							  placeholder="标签价格"
+							></el-input>
+							<el-button v-if="item.inputVisible" class="button-new-tag" @click="handleInputConfirm(item.id)">确定</el-button>
 							<el-button v-else class="button-new-tag" size="small" @click="showInput(item.id,item.type)">+ 添加新元素</el-button>
 						</div>
 					</div>
@@ -79,23 +86,32 @@
           </el-form-item>
           <el-form-item label="元素标签" v-show="dialogTitle=='添加元素分类'">
             <el-tag
-						  v-for="tag in showItem.list"
-						  :key="tag"
+						  v-for="(tag,index) in showItem.list"
+						  :key="index"
 						  closable
 						  :disable-transitions="false"
 						  @close="handleClose(tag,-1)">
-						  {{tag}}
+						  {{tag.name}}
 						</el-tag>
 						<el-input
 						  class="input-new-tag"
 						  v-if="showItem.inputVisible"
-						  v-model="inputValue"
+						  v-model="inputValue1"
 						  ref="saveTagInput"
 						  size="small"
-						  @keyup.enter.native="handleInputConfirm(-1)"
-						  @blur="handleInputConfirm(-1)"
+						  placeholder="标签名称"
 						>
 						</el-input>
+						<el-input
+						  class="input-new-tag"
+						  v-if="showItem.inputVisible"
+						  v-model="inputValue2"
+						  ref="saveTagInput"
+						  size="small"
+						  placeholder="标签价格"
+						>
+						</el-input>
+						<el-button v-if="showItem.inputVisible" class="button-new-tag" @click="handleInputConfirm(-1)">确定</el-button>
 						<el-button v-else class="button-new-tag" size="small" @click="showInput(-1,showItem.type)">+ 添加新元素</el-button>
           </el-form-item>
           <el-form-item>
@@ -118,7 +134,8 @@
 				fileList:[],
 				tagList:[],
 				inputVisible: false,
-        inputValue: '',
+        inputValue1: '',
+        inputValue2: '',
         dialogTableVisible:false,
 				dialogTitle:"",
         showItem:{
@@ -195,21 +212,26 @@
       showInput(id,type) {
       	if(id!=-1){
       		this.tagList[id].inputVisible = true;
-      		this.$nextTick(_ => {
-      			this.$refs[type][0].$refs.input.focus();
-	        });
+      		// this.$nextTick(_ => {
+      		// 	this.$refs[type][0].$refs.input.focus();
+	       //  });
       	}else{
       		this.showItem.inputVisible = true;
-      		this.$nextTick(_ => {
-	        	this.$refs.saveTagInput.$refs.input.focus();
-	        });
+      		// this.$nextTick(_ => {
+	       //  	this.$refs.saveTagInput.$refs.input.focus();
+	       //  });
       	}
         
       },
       handleInputConfirm(id) {
-        let inputValue = this.inputValue;
-        if (inputValue&&id!=-1) {
-          this.tagList[id].list.push(inputValue);
+        let inputValue1 = this.inputValue1;
+        let inputValue2 = this.inputValue2;
+        if (inputValue1&&inputValue2&&id!=-1) {
+        	var tag={
+        		name:inputValue1,
+        		price:inputValue2
+        	}
+          this.tagList[id].list.push(tag);
           let param = {
 						shopId:this.$store.state.userMess.id,
 						goodId:this.$route.params.id.slice(1),
@@ -222,15 +244,21 @@
 		        console.log("handleInputConfirm:"+err);
 		      });
 		      this.tagList[id].inputVisible = false;
-        }else if(inputValue&&id==-1){
-        	this.showItem.list.push(inputValue);
+        }else if(inputValue1&&inputValue2&&id==-1){
+        	var tag={
+        		name:inputValue1,
+        		price:inputValue2
+        	}
+        	this.showItem.list.push(tag);
         	this.showItem.inputVisible = false
-        }else if(inputValue==""&&id!=-1){
+        }else if(id!=-1&&(inputValue1==""||inputValue2=="")){
         	this.tagList[id].inputVisible = false;
-        }else if(inputValue==""&&id==-1){
+        }else if(id==-1&&(inputValue1==""||inputValue2=="")){
+
         	this.showItem.inputVisible = false;
         }
-        this.inputValue = '';
+        this.inputValue1 = '';
+        this.inputValue2 = '';
       },
       toCancel(){
       	this.dialogTableVisible=false;