罗世杰:店铺转让、找店地址触底加载和下拉query
This commit is contained in:
@@ -220,7 +220,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
>text {
|
>text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<DropDown></DropDown>
|
<DropDown @getQueryInfo = "getShopList"></DropDown>
|
||||||
</view>
|
</view>
|
||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<SearchShopList :showStyle="1"/>
|
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -26,11 +26,44 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 5,
|
||||||
|
pageNum: 1,
|
||||||
|
searchInfoList: [],
|
||||||
|
customQuery: {},
|
||||||
|
searchListLength: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.searchListLength !== 0) {
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getShopList(q){
|
||||||
|
let query = this.getQueryInfo(q)
|
||||||
|
console.log("listquery",query);
|
||||||
|
this.$api.getShopList(query).then(res => {
|
||||||
|
this.searchListLength = res.data.data.length
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
console.log(this.searchInfoList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getQueryInfo(query){
|
||||||
|
console.log("getQueryInfo",query);
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
...query
|
||||||
|
})
|
||||||
|
this.customQuery = q
|
||||||
|
return q
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getShopList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -29,24 +29,26 @@
|
|||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
shopInfoList: [],
|
shopInfoList: [],
|
||||||
customQuery: {
|
customQuery: {},
|
||||||
|
shopListLength: '',
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
onReachBottom() {
|
||||||
|
if (this.shopInfoList.length !== 0) {
|
||||||
|
this.pageNum++
|
||||||
|
this.getShopList()
|
||||||
|
console.log("触底加载");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getShopList(q){
|
getShopList(q){
|
||||||
let query = this.getQueryInfo(q)
|
let query = this.getQueryInfo(q)
|
||||||
console.log("listquery",query);
|
console.log("listquery",query);
|
||||||
this.$api.getShopList(query).then(res => {
|
this.$api.getShopList(query).then(res => {
|
||||||
this.shopInfoList = res.data.data
|
this.shopListLength = res.data.data.length
|
||||||
|
this.shopInfoList = [...this.shopInfoList, ...res.data.data]
|
||||||
console.log(this.shopInfoList);
|
console.log(this.shopInfoList);
|
||||||
this.shopInfoList.forEach(item=>{
|
|
||||||
item.pics =this.$api.imgUrl + item.pics
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getQueryInfo(query){
|
getQueryInfo(query){
|
||||||
@@ -60,9 +62,6 @@
|
|||||||
this.customQuery = q
|
this.customQuery = q
|
||||||
return q
|
return q
|
||||||
},
|
},
|
||||||
rePost(query){
|
|
||||||
console.log("rePost",query);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
|
|||||||
Reference in New Issue
Block a user