()
| 187 | } |
| 188 | } |
| 189 | async getPosts() { |
| 190 | let options = { |
| 191 | method: 'GET', |
| 192 | url: `https://api.xinc818.com/mini/community/home/posts?pageNum=1&pageSize=10&queryType=3&position=2`, |
| 193 | headers: {} |
| 194 | |
| 195 | }; |
| 196 | let { data: result } = await this.request(options); |
| 197 | if (result.code == 0) { |
| 198 | this.posts = result.data.list |
| 199 | |
| 200 | } |
| 201 | } |
| 202 | async likePosts() { |
| 203 | //找到posts里面liked为false的 |
| 204 | let posts = this.posts.filter(item => item.liked == false) |