From bb3cd38685cbe4903114b2d1136dffce0c6a545d Mon Sep 17 00:00:00 2001 From: Apple <> Date: Tue, 21 Jun 2022 10:11:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=90=A5=E9=94=80=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=AB=8B=E5=87=8F=E9=87=91=E3=80=90=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=91=E7=AD=9B=E9=80=89=E7=AB=8B=E5=87=8F?= =?UTF-8?q?=E9=87=91=E5=92=8C=E5=95=86=E5=93=81=E7=8A=B6=E6=80=81=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=95=B0=E6=8D=AE=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/list/list.js | 39 +++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index 819005d0..a0e894c1 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -184,6 +184,7 @@ export default class orderlist extends React.Component { constructor(props) { super(props) this.state = { + orderType:'', tabList: [{ title: '订单列表' }], orderList: [], filterList: [ @@ -193,10 +194,13 @@ export default class orderlist extends React.Component { prop: 'status', menuList: [ { id: 999, name: '全部' }, - { id: 1, name: '充值中' }, - { id: 2, name: '已完成' }, - { id: 3, name: '充值失败' }, - { id: 4, name: '已取消' } + { id: 1, name: '商品-充值中' }, + { id: 2, name: '商品-已完成' }, + { id: 3, name: '商品-充值失败' }, + { id: 4, name: '商品-已取消' }, + { id: 111, name: '立减金-待领取' }, + { id: 222, name: '立减金-已领取' }, + { id: 5, name: '立减金-已过期' } ] } ], @@ -277,8 +281,11 @@ export default class orderlist extends React.Component { //导出订单 exportFn() { let _self = this - let { key_word, key, status, option } = _self.state + let { key_word, key, status, option,orderType } = _self.state let data = {} + if(orderType){//区分立减金和商品 + data.order_type=orderType; + } if (this.state.combinedValue && this.state.combinedValue[0]) { data.begin_time = this.state.combinedValue[0] data.end_time = this.state.combinedValue[1] @@ -501,13 +508,17 @@ export default class orderlist extends React.Component { let data = {} data[prop] = null this.setState(data) + this.setState({orderType:null}); } //获取订单列表 getOrderFn(time = {}) { let _self = this - let { page, limit, option, key_word, status } = _self.state + let { page, limit, option, key_word, status,orderType} = _self.state let data = { page, limit } + if(orderType){//区分立减金和商品 + data.order_type=orderType; + } if (this.state.combinedValue && this.state.combinedValue[0]) { data.begin_time = this.state.combinedValue[0] data.end_time = this.state.combinedValue[1] @@ -548,6 +559,7 @@ export default class orderlist extends React.Component { data.channel_activity_id = key_word } } + getOrderList(data) .then((res) => { @@ -600,13 +612,22 @@ export default class orderlist extends React.Component { //状态筛选 selectedId(e, prop) { let data = {} + let orderType=1; + data[prop] = e if (e == 999) { data[prop] = null - } else { - data[prop] = e + }if (e == 111) { + data[prop] = 1 + orderType=2; + } if (e == 222) { + data[prop] = 2 + orderType=2; + } + if(e==5){ + orderType=2; } - this.setState(data) + this.setState({orderType}); } // 监听组件内部状态的变化: componentDidUpdate(prevProps, prevState) {