瀏覽代碼

修改二级分类页面筛选项

DELL 3 年之前
父節點
當前提交
8d37338556
共有 1 個文件被更改,包括 10 次插入14 次删除
  1. 10 14
      src/packageGoods/goods/list.vue

+ 10 - 14
src/packageGoods/goods/list.vue

@@ -5,7 +5,7 @@
 		<view class="fixed-top">
 			<!-- 搜索 -->
 			<view class="fixed-top-search flex">
-				<u-input v-model="title" @confirm="getList()" confirmType="search" placeholder="请输入商品名称" border="none" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" />
+				<u-input v-model="title" @confirm="pageList()" confirmType="search" placeholder="请输入商品名称" border="none" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" />
 			</view>
 			<!-- 选择 -->
 			<view class="fixed-top-choice flex">
@@ -86,20 +86,16 @@
 				this.tagIds = opthios.tagIds
 				this.categoryId = Number(opthios.categoryId)
 			}
-			this.getList()
-		},
-		
-		onShow() {
-			// this.pageList()
+			this.pageList()
 		},
 		
 		methods: {
-			// pageList() {
-			// 	this.pageNum = 1
-			// 	this.total = 0
-			// 	this.list = []
-			// 	this.getList()
-			// },
+			pageList() {
+				this.pageNum = 1
+				this.total = 0
+				this.list = []
+				this.getList()
+			},
 			
 			// 商品列表
 			getList() {
@@ -150,7 +146,7 @@
 					this.priceShow = !this.priceShow
 					this.priceSort = this.priceShow ? 1 : 2
 				}
-				this.getList()
+				this.pageList()
 			},
 		},
 		
@@ -159,7 +155,7 @@
 			if (this.total > this.pageNum * 20) {
 				setTimeout(() => {
 					++this.pageNum
-					this.getList()
+					this.pageList()
 				}, 500)
 			} else {
 				uni.$u.toast('已经到底了')