123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- const { getClassifyGoods } = require('../../API/appraise')
- Page({
-
- data: {
- classifyShow: [],
- page: 1,
- pageSize: 6,
- id: 3,
- title: "",
-
- isLoading: false
- },
-
- onLoad(options) {
-
- this.setData({
-
- id: options.classify_id,
-
- title: options.title
- }),
- wx.setNavigationBarTitle({
- title: this.data.title,
- })
- this.getGoods()
- },
- getGoods() {
-
- wx.showLoading({
- title: '数据获取中',
- })
- getClassifyGoods(this.data).then((res) => {
- console.log(this.data);
- const { data } = res.data;
- console.log(res);
- this.setData({
- classifyShow: [...this.data.classifyShow , ...data.data],
- isLoading: true
- })
- console.log(this.data.classifyShow);
- })
- this.setData({
- isLoading: false
- })
- },
-
- onReady() {
- },
-
- onShow() {
- },
-
- onHide() {
- },
-
- onUnload() {
- },
-
- onPullDownRefresh() {
- },
-
- onReachBottom() {
- if(this.data.isLoading) {
- this.setData({
- page: this.data.page + 1,
- })
- this.getGoods()
- }
- },
-
- onShareAppMessage() {
- }
- })
|