Browse Source

二级页面数据展示

LXT-NJ\Admin 2 years ago
parent
commit
62231131cb
2 changed files with 55 additions and 69 deletions
  1. 53 67
      pages/gengduo/index.vue
  2. 2 2
      pages/shop/index.vue

+ 53 - 67
pages/gengduo/index.vue

@@ -6,8 +6,8 @@
 			<tm-sheet black>
 				<tm-sliderNav :style="{ height: (sys.windowHeight-80) + 'px' }" class="zuo fl" @change="change"
 					:list="list" text color="red">
-					
-					</tm-sliderNav>
+
+				</tm-sliderNav>
 				<view class="fr you" :style="{ height: (sys.windowHeight-80) + 'px' }">
 					<view class="huadong">
 						<view class="py-10 text-size-g dianz mingri text-align-center mt-40">
@@ -36,63 +36,48 @@
 		data() {
 			return {
 				list: [],
-				quanbuList: [{
-					src: '/static/img/45.png',
-					text: 'NEO CITY 涂鸦',
-					type: '手提包'
-				}, {
-					src: '/static/img/46.png',
-					text: '满印迷你标识',
-					type: '围巾'
-				}, {
-					src: '/static/img/47.png',
-					text: '大号版型夹克',
-					type: '新品'
-				}, {
-					src: '/static/img/45.png',
-					text: 'NEO CITY 涂鸦',
-					type: '手提包'
-				}, {
-					src: '/static/img/46.png',
-					text: '满印迷你标识',
-					type: '围巾'
-				}, {
-					src: '/static/img/47.png',
-					text: '大号版型夹克',
-					type: '新品'
-				}, {
-					src: '/static/img/46.png',
-					text: '满印迷你标识',
-					type: '围巾'
-				}, {
-					src: '/static/img/47.png',
-					text: '大号版型夹克',
-					type: '新品'
-				}, {
-					src: '/static/img/45.png',
-					text: 'NEO CITY 涂鸦',
-					type: '手提包'
-				}, {
-					src: '/static/img/46.png',
-					text: '满印迷你标识',
-					type: '围巾'
-				}, {
-					src: '/static/img/47.png',
-					text: '大号版型夹克',
-					type: '新品'
-				}, {
-					src: '/static/img/46.png',
-					text: '满印迷你标识',
-					type: '围巾'
-				}, {
-					src: '/static/img/47.png',
-					text: '大号版型夹克',
-					type: '新品'
-				}]
+				quanbuList: [
+					// 	{
+					// 	src: '/static/img/45.png',
+					// 	text: 'NEO CITY 涂鸦',
+					// 	type: '手提包'
+					// }, {
+					// 	src: '/static/img/46.png',
+					// 	text: '满印迷你标识',
+					// 	type: '围巾'
+					// }, {
+					// 	src: '/static/img/47.png',
+					// 	text: '大号版型夹克',
+					// 	type: '新品'
+					// }, {
+					// 	src: '/static/img/45.png',
+					// 	text: 'NEO CITY 涂鸦',
+					// 	type: '手提包'
+					// }, {
+					// 	src: '/static/img/46.png',
+					// 	text: '满印迷你标识',
+					// 	type: '围巾'
+					// }, {
+					// 	src: '/static/img/47.png',
+					// 	text: '大号版型夹克',
+					// 	type: '新品'
+					// }, {
+					// 	src: '/static/img/46.png',
+					// 	text: '满印迷你标识',
+					// 	type: '围巾'
+					// }, {
+					// 	src: '/static/img/47.png',
+					// 	text: '大号版型夹克',
+					// 	type: '新品'
+					// }, {
+					// 	src: '/static/img/45.png',
+					// 	text: 'NEO CITY 涂鸦',
+					// 	type: '手提包'
+					// }
+				]
 			};
 		},
 		onLoad() {
-
 		},
 		created() {
 			this.sys = uni.getSystemInfoSync();
@@ -127,22 +112,23 @@
 			},
 			// 切换更换二级分类
 			change(e) {
-				let that=this;
+				let that = this;
 				myRequest({
-					url:'/api/ShopGoods/getMallChildrenClassification',
-					method:'post',
-					data:{id:that.list[e].id}
-				}).then(res=>{
-					console.log(res.data);
-					if(res.data.code==200){
+					url: '/api/ShopGoods/getMallChildrenClassification',
+					method: 'post',
+					data: {
+						'id': that.list[e].id
+					}
+				}).then(res => {
+					if (res.data.code == 200) {
+						that.quanbuList = [];
 						res.data.data.forEach(item => {
 							that.quanbuList.push({
-								// src: item.image,
-								// img: item.image,
-								// text: item.category_name
+								src: item.image,
+								text: item.category_name
 							})
 						})
-					}else{
+					} else {
 						that.$refs.toast.show({
 							model: 'error',
 							label: res.data.msg

+ 2 - 2
pages/shop/index.vue

@@ -316,11 +316,11 @@ export default {
 			// this.gouwuche.push(data)
 		},
 		zhonglei(e){
-			if(e.index==4){
+			// if(e.index==4){
 				uni.navigateTo({
 					url: "/pages/gengduo/index",
 				})
-			}
+			// }
 		}
 	},
 }