Merge pull request '邓洁:轮播图' (#101) from dj into master
Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/101
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="root">
|
||||
<InputAndSwiper @getQueryInfo="getInput"></InputAndSwiper>
|
||||
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList"></InputAndSwiper>
|
||||
|
||||
<view>
|
||||
<view class="dropdown-bug">
|
||||
@@ -32,6 +32,7 @@
|
||||
pageSize: 3,
|
||||
pageNum: 1,
|
||||
searchInfoList: [],
|
||||
swiperList: [],
|
||||
customQuery: {},
|
||||
searchListLength: '',
|
||||
showNull: false,
|
||||
@@ -62,17 +63,30 @@
|
||||
this.pageNum = 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getShopList()
|
||||
this.getBanner()
|
||||
},
|
||||
methods: {
|
||||
getInput(val){
|
||||
console.log('搜索值',val);
|
||||
if(this.pageNum!==1){
|
||||
this.pageNum=1
|
||||
getBanner() {
|
||||
this.$api.getBanner().then(res => {
|
||||
res.data.data.forEach(item => {
|
||||
item.img = this.$api.imgUrl + item.img
|
||||
})
|
||||
this.swiperList = res.data.data
|
||||
// .map(item => this.$api.imgUrl + item.img)
|
||||
})
|
||||
},
|
||||
getInput(val) {
|
||||
console.log('搜索值', val);
|
||||
if (this.pageNum !== 1) {
|
||||
this.pageNum = 1
|
||||
}
|
||||
const q = this.$u.queryParams({
|
||||
type: 2,
|
||||
pageSize: this.pageSize,
|
||||
pageNum: this.pageNum,
|
||||
kw:val
|
||||
kw: val
|
||||
})
|
||||
this.$api.getShopList(q).then(res => {
|
||||
this.searchListLength = res.data.data.length
|
||||
@@ -118,10 +132,8 @@
|
||||
})
|
||||
return q
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getShopList()
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="root">
|
||||
<InputAndSwiper @getQueryInfo="getInput"></InputAndSwiper>
|
||||
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList"> </InputAndSwiper>
|
||||
|
||||
<view>
|
||||
<view class="dropdown-bug">
|
||||
@@ -33,6 +33,7 @@
|
||||
pageNum: 1,
|
||||
shopInfoList: [],
|
||||
customQuery: {},
|
||||
swiperList: [],
|
||||
shopListLength: '',
|
||||
showNull: false,
|
||||
refresh: false
|
||||
@@ -57,22 +58,36 @@
|
||||
if (!this.refresh && this.shopListLength !== 0) {
|
||||
this.pageNum++
|
||||
this.getShopList()
|
||||
|
||||
console.log("触底加载");
|
||||
} else if (this.shopListLength == 0) {
|
||||
this.pageNum = 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getShopList()
|
||||
this.getBanner()
|
||||
},
|
||||
methods: {
|
||||
getInput(val){
|
||||
console.log('搜索值',val);
|
||||
if(this.pageNum!==1){
|
||||
this.pageNum=1
|
||||
getBanner() {
|
||||
this.$api.getBanner().then(res => {
|
||||
res.data.data.forEach(item => {
|
||||
item.img = this.$api.imgUrl + item.img
|
||||
})
|
||||
this.swiperList = res.data.data
|
||||
// .map(item => this.$api.imgUrl + item.img)
|
||||
})
|
||||
},
|
||||
getInput(val) {
|
||||
console.log('搜索值', val);
|
||||
if (this.pageNum !== 1) {
|
||||
this.pageNum = 1
|
||||
}
|
||||
const q = this.$u.queryParams({
|
||||
type: 1,
|
||||
pageSize: this.pageSize,
|
||||
pageNum: this.pageNum,
|
||||
kw:val
|
||||
kw: val
|
||||
})
|
||||
this.$api.getShopList(q).then(res => {
|
||||
this.shopListLength = res.data.data.length
|
||||
@@ -117,9 +132,6 @@
|
||||
})
|
||||
return q
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getShopList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user