|
|
@ -35,10 +35,16 @@ |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
queryObj:{ |
|
|
name:"", |
|
|
name:"", |
|
|
|
|
|
pageNum:1, |
|
|
|
|
|
pageSize:1 |
|
|
|
|
|
}, |
|
|
|
|
|
total:0, |
|
|
|
|
|
isloading:false, |
|
|
//轮播图数据列表 |
|
|
//轮播图数据列表 |
|
|
swiperList: [], |
|
|
swiperList: [], |
|
|
//轮播图数据列表 |
|
|
//场景数据列表 |
|
|
sceneList: [] |
|
|
sceneList: [] |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
@ -62,26 +68,19 @@ |
|
|
uni.$showMsg('数据请求成功!') |
|
|
uni.$showMsg('数据请求成功!') |
|
|
}, |
|
|
}, |
|
|
async getSceneList() { |
|
|
async getSceneList() { |
|
|
|
|
|
this.isloading = true |
|
|
const { |
|
|
const { |
|
|
data: res |
|
|
data: res |
|
|
} = await uni.$http.post('/small/scene/manage/listAll',{name:this.name}) |
|
|
} = await uni.$http.post('/small/scene/manage/listApp',this.queryObj) |
|
|
if (!res.success) return uni.$showMsg() |
|
|
this.isloading = false |
|
|
this.sceneList = [] |
|
|
|
|
|
res.data.forEach(item=>{ |
|
|
res.rows.forEach(item=>{ |
|
|
item.uploadPath = uni.$http.baseUrl +item.uploadPath |
|
|
item.uploadPath = uni.$http.baseUrl +item.uploadPath |
|
|
this.sceneList.push(item) |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
this.sceneList =[...this.sceneList,...res.rows] |
|
|
|
|
|
this.total = res.total |
|
|
uni.$showMsg('数据请求成功!') |
|
|
uni.$showMsg('数据请求成功!') |
|
|
}, |
|
|
}, |
|
|
objToParams(obj){ |
|
|
|
|
|
let arr = []; |
|
|
|
|
|
for (let key in obj) { |
|
|
|
|
|
arr.push(`${key}=${obj[key]}`); |
|
|
|
|
|
} |
|
|
|
|
|
return arr.join('&') |
|
|
|
|
|
}, |
|
|
|
|
|
navClickHandler(item) { |
|
|
navClickHandler(item) { |
|
|
if(item !== ""){ |
|
|
if(item !== ""){ |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
@ -102,6 +101,12 @@ |
|
|
delta:1,//返回层数,2则上上页 |
|
|
delta:1,//返回层数,2则上上页 |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
onReachBottom(){ |
|
|
|
|
|
if(this.queryObj.pageNum * this.queryObj.pageSize >= this.total) return uni.$showMsg('已展示所有场景') |
|
|
|
|
|
if(this.isloading) return |
|
|
|
|
|
this.queryObj.pageNum++ |
|
|
|
|
|
this.getSceneList() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|