diff --git a/components/DropDown/DropDownItem.vue b/components/DropDown/DropDownItem.vue index 5b95120..3ecd3c0 100644 --- a/components/DropDown/DropDownItem.vue +++ b/components/DropDown/DropDownItem.vue @@ -49,7 +49,7 @@ } } else if (this.type === '面积') { this.queryInfo = { - areaType: this.activeIndex + 1 + areatype: this.activeIndex + 1 } } else if (this.type === '筛选') { this.queryInfo = { diff --git a/pages.json b/pages.json index 894046c..363d95c 100644 --- a/pages.json +++ b/pages.json @@ -36,7 +36,7 @@ "navigationBarTitleText": "店铺转让", "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#339967", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { @@ -45,7 +45,7 @@ "navigationBarTitleText": "找店地址", "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#339967", - "enablePullDownRefresh": false + "enablePullDownRefresh": true } }, { diff --git a/pages/shopTransfer/shopTransfer.vue b/pages/shopTransfer/shopTransfer.vue index 2ba1528..e27960c 100644 --- a/pages/shopTransfer/shopTransfer.vue +++ b/pages/shopTransfer/shopTransfer.vue @@ -1,19 +1,22 @@ @@ -26,42 +29,88 @@ }, data() { return { - pageSize: 5, + pageSize: 3, pageNum: 1, shopInfoList: [], customQuery: {}, shopListLength: '', - + showNull: false, + refresh: false } }, + onPullDownRefresh() { + this.refresh=true + // if (this.showNull = true) { + const q = this.$u.queryParams({ + type: 1, + pageSize: this.pageSize, + pageNum: 1, + }) + // if(this.showNull=true){ + // this.pageNum=1 + // } + this.getShopList(q, "refresh") + + // } + }, onReachBottom() { - if (this.shopInfoList.length !== 0) { + if (!this.refresh&&this.shopListLength !== 0) { this.pageNum++ this.getShopList() console.log("触底加载"); + }else if(this.shopListLength == 0){ + this.pageNum=1 } }, methods: { - getShopList(q){ - let query = this.getQueryInfo(q) - console.log("listquery",query); + getShopList(q, type) { + let query = {} + if (type == "refresh") { + query = q + } else { + query = this.getQueryInfo(q) + } + console.log("listquery", query); this.$api.getShopList(query).then(res => { this.shopListLength = res.data.data.length - this.shopInfoList = [...this.shopInfoList, ...res.data.data] + if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query + .includes('region')||this.refresh) { + console.log('筛选'); + // this.resetQuery(q) + this.shopInfoList = res.data.data + this.refresh=false + if (res.data.data.length == 0) { + this.showNull = true + } else { + this.showNull = false + } + } else { + console.log('查询'); + this.shopInfoList = [...this.shopInfoList, ...res.data.data] + } + console.log(this.shopInfoList); }) }, - getQueryInfo(query){ - console.log("getQueryInfo",query); + getQueryInfo(query) { + console.log('this.',this.refresh); const q = this.$u.queryParams({ type: 1, pageSize: this.pageSize, pageNum: this.pageNum, ...query }) - this.customQuery = q return q }, + // resetQuery(query){ + // console.log('ddd',query); + // const q = this.$u.queryParams({ + // type: 1, + // pageSize: 5, + // pageNum: 1, + // ...query + // }) + // } }, created() { this.getShopList() @@ -73,9 +122,19 @@ page { background-color: $uni-bg-color-grey; } - .root{ + + .showNull { + display: flex; + align-items: center; + justify-content: center; + height: 100rpx; + color: darkgray; + } + + .root { position: relative; } + .dropdown-bug { position: absolute; background-color: $uni-bg-color-grey; @@ -84,8 +143,8 @@ transform: translateY(-20rpx); z-index: 2; } - .marginLR10{ + + .marginLR10 { margin: 0 10px; } - - + \ No newline at end of file