邓洁 : 下拉框筛选数据和重置数据
This commit is contained in:
@@ -127,7 +127,7 @@
|
|||||||
"navigationBarTitleText": "转让信息",
|
"navigationBarTitleText": "转让信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"navigationBarTitleText": "找店信息",
|
"navigationBarTitleText": "找店信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
"navigationBarTitleText": "出租信息",
|
"navigationBarTitleText": "出租信息",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
"navigationBarTitleText": "项目招商",
|
"navigationBarTitleText": "项目招商",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarBackgroundColor": "#339967",
|
"navigationBarBackgroundColor": "#339967",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="3" :shopInfoList="shopInfoList" />
|
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="3" :shopInfoList="shopInfoList" />
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -34,25 +38,63 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
customQuery: {},
|
customQuery: {},
|
||||||
shopListLength: '',
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 3,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.shopInfoList.length !== 0) {
|
if (this.shopListLength !== 0) {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
console.log("触底加载");
|
console.log("触底加载");
|
||||||
|
}else if (this.shopListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getShopList(q) {
|
getShopList(q, type) {
|
||||||
let query = this.getQueryInfo(q)
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
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.shopListLength = res.data.data.length
|
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);
|
console.log(this.shopInfoList);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -75,7 +117,13 @@
|
|||||||
page {
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
.marginLR10 {
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="4" :shopInfoList="shopInfoList" />
|
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="4" :shopInfoList="shopInfoList" />
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -34,25 +38,63 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
customQuery: {},
|
customQuery: {},
|
||||||
shopListLength: '',
|
shopListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 4,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.shopInfoList.length !== 0) {
|
if (!this.refresh && this.shopListLength !== 0) {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
console.log("触底加载");
|
console.log("触底加载");
|
||||||
|
} else if (this.searchListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getShopList(q) {
|
getShopList(q, type) {
|
||||||
let query = this.getQueryInfo(q)
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
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.shopListLength = res.data.data.length
|
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);
|
console.log(this.shopInfoList);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -76,6 +118,14 @@
|
|||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
.marginLR10 {
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
|
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -33,25 +37,63 @@
|
|||||||
searchInfoList: [],
|
searchInfoList: [],
|
||||||
customQuery: {},
|
customQuery: {},
|
||||||
searchListLength: '',
|
searchListLength: '',
|
||||||
|
showNull: false,
|
||||||
|
refresh: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.refresh = true
|
||||||
|
// if (this.showNull = true) {
|
||||||
|
const q = this.$u.queryParams({
|
||||||
|
type: 2,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
pageNum: 1,
|
||||||
|
})
|
||||||
|
// if(this.showNull=true){
|
||||||
|
// this.pageNum=1
|
||||||
|
// }
|
||||||
|
this.getShopList(q, "refresh")
|
||||||
|
|
||||||
|
// }
|
||||||
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.searchListLength !== 0) {
|
if (!this.refresh && this.searchListLength !== 0) {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
console.log("触底加载");
|
console.log("触底加载");
|
||||||
|
} else if (this.searchListLength == 0) {
|
||||||
|
this.pageNum = 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getShopList(q) {
|
getShopList(q, type) {
|
||||||
let query = this.getQueryInfo(q)
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
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.searchListLength = res.data.data.length
|
this.searchListLength = res.data.data.length
|
||||||
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
if (query.includes('business') || query.includes('areatype') || query.includes('sortType') || query
|
||||||
|
.includes('region') || this.refresh) {
|
||||||
|
console.log('筛选');
|
||||||
|
// this.resetQuery(q)
|
||||||
|
this.searchInfoList = res.data.data
|
||||||
|
this.refresh = false
|
||||||
|
if (res.data.data.length == 0) {
|
||||||
|
this.showNull = true
|
||||||
|
} else {
|
||||||
|
this.showNull = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('查询');
|
||||||
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
||||||
|
}
|
||||||
console.log(this.searchInfoList);
|
console.log(this.searchInfoList);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -75,6 +117,14 @@
|
|||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
|
|
||||||
.marginLR10 {
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
<view class="marginLR10">
|
<view class="marginLR10">
|
||||||
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList" />
|
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList" />
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="showNull" class="showNull">
|
||||||
|
<text>没有符合条件的数据, 请下拉刷新重置数据~
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -33,26 +37,63 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
customQuery: {},
|
customQuery: {},
|
||||||
shopListLength: '',
|
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() {
|
onReachBottom() {
|
||||||
if (this.shopInfoList.length !== 0) {
|
if (!this.refresh&&this.shopListLength !== 0) {
|
||||||
this.pageNum++
|
this.pageNum++
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
console.log("触底加载");
|
console.log("触底加载");
|
||||||
|
}else if(this.shopListLength == 0){
|
||||||
|
this.pageNum=1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getShopList()
|
this.getShopList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getShopList(q) {
|
getShopList(q, type) {
|
||||||
let query = this.getQueryInfo(q)
|
let query = {}
|
||||||
|
if (type == "refresh") {
|
||||||
|
query = q
|
||||||
|
} else {
|
||||||
|
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.shopListLength = res.data.data.length
|
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);
|
console.log(this.shopInfoList);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -75,7 +116,13 @@
|
|||||||
page {
|
page {
|
||||||
background-color: #F8F8F8;
|
background-color: #F8F8F8;
|
||||||
}
|
}
|
||||||
|
.showNull {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100rpx;
|
||||||
|
color: darkgray;
|
||||||
|
}
|
||||||
.marginLR10 {
|
.marginLR10 {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user