首页、分类、服务列表增加下拉刷新
This commit is contained in:
parent
2e1ea54192
commit
73cf2229fd
|
@ -3,7 +3,8 @@
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "熊熊安装队"
|
"navigationBarTitleText": "熊熊安装队",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -21,13 +22,15 @@
|
||||||
{
|
{
|
||||||
"path": "pages/service/cate",
|
"path": "pages/service/cate",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分类"
|
"navigationBarTitleText": "分类",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/service/list",
|
"path": "pages/service/list",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务列表"
|
"navigationBarTitleText": "服务列表",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,31 +120,38 @@ export default {
|
||||||
WidgetModal,
|
WidgetModal,
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// 首页轮播
|
this.initPage();
|
||||||
this.$request({
|
|
||||||
api: "index.banner",
|
|
||||||
}).then((response) => {
|
|
||||||
response.data.forEach((item) => {
|
|
||||||
this.bannerList.push({
|
|
||||||
image: item.image,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// 系统公告
|
|
||||||
this.$models.system.notifyList().then((list) => {
|
|
||||||
this.notifyList = list;
|
|
||||||
});
|
|
||||||
// 导航
|
|
||||||
this.$models.system.navList().then((list) => {
|
|
||||||
this.installServiceList = list.install;
|
|
||||||
this.aftermarketServiceList = list.aftermarket;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {
|
||||||
|
this.initPage();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initPage() {
|
||||||
|
this.bannerList = [];
|
||||||
|
// 首页轮播
|
||||||
|
this.$request({
|
||||||
|
api: "index.banner",
|
||||||
|
}).then((response) => {
|
||||||
|
response.data.forEach((item) => {
|
||||||
|
this.bannerList.push({
|
||||||
|
image: item.image,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// 系统公告
|
||||||
|
this.$models.system.notifyList().then((list) => {
|
||||||
|
this.notifyList = list;
|
||||||
|
});
|
||||||
|
// 导航
|
||||||
|
this.$models.system.navList().then((list) => {
|
||||||
|
this.installServiceList = list.install;
|
||||||
|
this.aftermarketServiceList = list.aftermarket;
|
||||||
|
});
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 跳转
|
* 跳转
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -80,14 +80,7 @@ export default {
|
||||||
x: x - this.$utils.rpx2px(20),
|
x: x - this.$utils.rpx2px(20),
|
||||||
y: y - this.$utils.rpx2px(40),
|
y: y - this.$utils.rpx2px(40),
|
||||||
};
|
};
|
||||||
// 加载分类
|
this.initPage();
|
||||||
this.data.push({
|
|
||||||
id: 0,
|
|
||||||
name: "热门推荐",
|
|
||||||
cover: "",
|
|
||||||
child: await this.hotCate(),
|
|
||||||
});
|
|
||||||
this.loadCate();
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.newId = this.currentId = this.currentCateId;
|
this.newId = this.currentId = this.currentCateId;
|
||||||
|
@ -98,8 +91,22 @@ export default {
|
||||||
this.$store.commit("system/currentCateId", this.newId);
|
this.$store.commit("system/currentCateId", this.newId);
|
||||||
},
|
},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {
|
||||||
|
this.initPage();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async initPage() {
|
||||||
|
this.data = [];
|
||||||
|
// 加载分类
|
||||||
|
this.data.push({
|
||||||
|
id: 0,
|
||||||
|
name: "热门推荐",
|
||||||
|
cover: "",
|
||||||
|
child: await this.hotCate(),
|
||||||
|
});
|
||||||
|
this.loadCate();
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 推荐
|
* 推荐
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -65,13 +65,20 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.currentId = e.id;
|
this.currentId = e.id;
|
||||||
this.loadList(e.id);
|
this.initPage();
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {
|
||||||
|
this.initPage();
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initPage() {
|
||||||
|
this.data = [];
|
||||||
|
this.loadList(this.currentId);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 加载列表
|
* 加载列表
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue