百科新增loading
This commit is contained in:
		| @@ -21,7 +21,6 @@ Component({ | |||||||
|   }, |   }, | ||||||
|   lifetimes: { |   lifetimes: { | ||||||
|     attached() { |     attached() { | ||||||
|       console.log('----------=========') |  | ||||||
|       this.getData(); |       this.getData(); | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
| @@ -29,7 +28,7 @@ Component({ | |||||||
|    * 组件的方法列表 |    * 组件的方法列表 | ||||||
|    */ |    */ | ||||||
|   methods: { |   methods: { | ||||||
|     async getData() { |     async init() { | ||||||
|       const page = this.data.page; |       const page = this.data.page; | ||||||
|       const id = this.id; |       const id = this.id; | ||||||
|       const { code, data, message, total } = await getEncyclopediaList(id, page); |       const { code, data, message, total } = await getEncyclopediaList(id, page); | ||||||
| @@ -39,6 +38,11 @@ Component({ | |||||||
|       } |       } | ||||||
|       this.setData({ list: data, totalPage: Math.ceil(total / 20) }); |       this.setData({ list: data, totalPage: Math.ceil(total / 20) }); | ||||||
|     }, |     }, | ||||||
|  |     async getData() { | ||||||
|  |       loadingFunc(async() => { | ||||||
|  |         await this.init(); | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|     jumpToDetail(e) { |     jumpToDetail(e) { | ||||||
|       console.log('e', e) |       console.log('e', e) | ||||||
|       wx.navigateTo({ |       wx.navigateTo({ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user