|
@@ -11,7 +11,7 @@
|
|
|
v-model="value"
|
|
|
placeholder="请选择排序"
|
|
|
:localdata="range"
|
|
|
- @change="getList(value)"
|
|
|
+ @change="getList(value,'加载',1)"
|
|
|
></uni-data-select>
|
|
|
</view>
|
|
|
<view class="rnwdList">
|
|
@@ -20,16 +20,16 @@
|
|
|
<span class="listTitle">{{ item.titleName }}</span>
|
|
|
|
|
|
<view class="onePic" v-if="item.top != 1 ? item.urls.length == 1 : false ">
|
|
|
- <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
+ <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
</image>
|
|
|
</view>
|
|
|
<view class="twoPic" v-if="item.top != 1 ? item.urls.length == 2 : false">
|
|
|
- <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
+ <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
</image>
|
|
|
</view>
|
|
|
|
|
|
<view class="threePic" v-if="item.top != 1 ? item.urls.length == 3 : false">
|
|
|
- <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
+ <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
|
|
|
</image>
|
|
|
</view>
|
|
|
|
|
@@ -91,6 +91,15 @@ export default {
|
|
|
created(){
|
|
|
|
|
|
},
|
|
|
+ // 下拉刷新
|
|
|
+ onPullDownRefresh() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.listParams.pageNum = 1;
|
|
|
+ this.qbwd = [];
|
|
|
+ let result = this.getList(this.listParams.flag,'刷新')
|
|
|
+ },500)
|
|
|
+ },
|
|
|
+ // 上拉加载
|
|
|
onReachBottom(){
|
|
|
let pageNum = this.listParams.pageNum
|
|
|
let pageSize = this.listParams.pageSize
|
|
@@ -102,7 +111,7 @@ export default {
|
|
|
return
|
|
|
} else {
|
|
|
this.listParams.pageNum += 1;
|
|
|
- this.getList()
|
|
|
+ let result = this.getList(this.listParams.flag,'刷新')
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
@@ -117,7 +126,7 @@ export default {
|
|
|
if(this.favoriteList.includes(e.id)) return
|
|
|
likeServer({
|
|
|
id:e.id,
|
|
|
- type:12
|
|
|
+ type:10
|
|
|
}).then(e => {
|
|
|
})
|
|
|
this.favoriteList.push(e.id)
|
|
@@ -143,14 +152,29 @@ export default {
|
|
|
},
|
|
|
search(){
|
|
|
this.listParams.titleName = this.searchValue
|
|
|
- this.getList()
|
|
|
+ this.listParams.pageNum=1
|
|
|
+ listWxs(this.listParams).then(res => {
|
|
|
+ this.qbwd = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ uni.showToast({
|
|
|
+ title:`加载成功`
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
- getList(val = null){
|
|
|
+ getList(val = null,toastVal = '加载',clear){
|
|
|
+ if(clear==1){this.listParams.pageNum=1}
|
|
|
this.listParams.flag = val || ''
|
|
|
- this.qbwd = this.topList
|
|
|
listWxs(this.listParams).then(res => {
|
|
|
- this.qbwd = [...this.qbwd,...res.rows]
|
|
|
+ if(this.listParams.pageNum==1){
|
|
|
+ this.qbwd = [...this.topList,...res.rows]
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.qbwd = [...this.qbwd,...res.rows]
|
|
|
+ }
|
|
|
this.total = res.total
|
|
|
+ uni.showToast({
|
|
|
+ title:`${toastVal}成功`
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
goDetails(e) {
|
|
@@ -183,7 +207,6 @@ export default {
|
|
|
isTop:1
|
|
|
}).then(e => {
|
|
|
this.topList = e.data
|
|
|
- this.qbwd = this.topList
|
|
|
this.getList()
|
|
|
})
|
|
|
},
|
|
@@ -204,10 +227,6 @@ export default {
|
|
|
*/
|
|
|
onUnload() {},
|
|
|
/**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {},
|
|
|
- /**
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
onShareAppMessage() {},
|