From 6d2b54dda60663482cff5898bc887aa921a88706 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 24 Sep 2021 13:57:01 +0800 Subject: [PATCH] no message --- api/moment.js | 4 +++- pages/agent/fragment/index.wxml | 1 + pages/mall/fragment/index.wxml | 2 +- pages/moment/moment-item/index.js | 31 +++++++++++++++++++++++++++++-- pages/moment/theall/index.js | 4 ++-- pages/moment/theall/index.wxml | 4 ++-- 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/api/moment.js b/api/moment.js index ce374cb..e5db672 100644 --- a/api/moment.js +++ b/api/moment.js @@ -40,6 +40,7 @@ const getCategoryList = (params) => mGet(`/information-center/paper-index-catego const getCategoryType = (params) => mGet(`/ztb-market-information-service/get/scrap-paper-main-category`, params, mconfig) const getMomentList = (params) => mGet(`/ztb-market-information-service/get/price-compare-info/by-scrap-paper-main-category`, params, mconfig) const getInformationList = (params) => mGet(`/ztb-market-information-service/get/market-info/by-query-type`, params, mconfig) +const getMillPaperList = (params) => mGet(`/ztb-market-information-service/get/paper-category-info/by-paper-mill-id`, params, mconfig) export { mconfig, @@ -59,5 +60,6 @@ export { getCategoryList, getCategoryType, getMomentList, - getInformationList + getInformationList, + getMillPaperList } \ No newline at end of file diff --git a/pages/agent/fragment/index.wxml b/pages/agent/fragment/index.wxml index b702c95..5127831 100644 --- a/pages/agent/fragment/index.wxml +++ b/pages/agent/fragment/index.wxml @@ -17,6 +17,7 @@ + diff --git a/pages/mall/fragment/index.wxml b/pages/mall/fragment/index.wxml index 1c9e7b1..a9b2e3b 100644 --- a/pages/mall/fragment/index.wxml +++ b/pages/mall/fragment/index.wxml @@ -75,7 +75,7 @@ - + diff --git a/pages/moment/moment-item/index.js b/pages/moment/moment-item/index.js index a9c4be0..3265640 100644 --- a/pages/moment/moment-item/index.js +++ b/pages/moment/moment-item/index.js @@ -1,5 +1,8 @@ // pages/stock/index.js const util = require('../../../utils/util') +import { userPushFollowMill } from "../../../api/ztb" +import { getMillPaperList } from "../../../api/moment" +var requesting = false Component({ options: { @@ -12,21 +15,45 @@ Component({ }, data: { unflod: false, + loading: false, itemList: [2] }, methods: { onFlodTap: function(){ this.setData({ unflod: !this.data.unflod }) if(!this.data.itemList.length){ - + this.fetchItemList() } }, onAttentionChange: function(){ - + if (this.data.loading) { + return + } + this.setData({ loading: true }) + userPushFollowMill({ paperMillId: 1, follow: true }).then(result => { + this.setData({ loading: false }) + }).catch(err => { + this.setData({ loading: false }) + }) }, lookItem: function(e){ util.navigateTo('/pages/article/detail/index?id=' + this.data.item.id) }, + fetchItemList: function(){ + if (requesting) { + return + } + requesting = true + getMillPaperList({ paperMillId: 1, date: '' }).then(result => { + if (result.data.records.length) { + this.setData({ orderList: result.data.records }) + } else { + requesting = false + } + }).catch(err => { + requesting = false + }) + }, agentOrder: function(e){ } diff --git a/pages/moment/theall/index.js b/pages/moment/theall/index.js index 9b37f01..7e08919 100644 --- a/pages/moment/theall/index.js +++ b/pages/moment/theall/index.js @@ -64,14 +64,14 @@ Component({ if (this.data.requesting) { return } - this.setData({ orderList: [], ['form.pageNum']: 1, finished: false }) + this.setData({ orderList: [], ['form.pageNum']: 1, finished: false, requesting: true }) this.fetchOrderList() }, fetchList: function(){ if (this.data.requesting) { return } - this.data.requesting = true + this.setData({ requesting: true }) getInformationList(this.data.form).then(result => { if (result.data.records.length) { var respList = result.data.records diff --git a/pages/moment/theall/index.wxml b/pages/moment/theall/index.wxml index 0e36da7..24ae2e9 100644 --- a/pages/moment/theall/index.wxml +++ b/pages/moment/theall/index.wxml @@ -1,9 +1,9 @@ - + - +