From 0be89c1ed6521f5abe897611f120bc5d0023c9ab Mon Sep 17 00:00:00 2001 From: zhangds Date: Thu, 22 Sep 2022 18:31:55 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=89=20=E5=A2=9E=E5=8A=A0key=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 68 ++++++++++++++++++------------- src/pages/plan/list/list.js | 41 ++++++++++++------- 2 files changed, 65 insertions(+), 44 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 5ad60510..4566adda 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -993,38 +993,48 @@ export default class acclist extends React.Component { }; rowItemClick(row, rowIndex) { - let codeInfo = { - //数据模型不可少 - code_name: row.title, - issued: row.quantity, //发放总量 - describe: row.describe, - date_time: [row.begin_time, row.end_time], - range: row.range, - restrict: row.restrict, - }; + // 兑换码 + if (this.state.keyType === 1) { + let codeInfo = { + //数据模型不可少 + code_name: row.title, + issued: row.quantity, //发放总量 + describe: row.describe, + date_time: [row.begin_time, row.end_time], + range: row.range, + restrict: row.restrict, + }; - let arr = _.map(row.product, (res) => { - let obj = {}; - obj.key = res.only; - obj.text = res.product_name; - return obj; - }); - this.setState({ - draw_title: "编辑兑换码", - rankoptions: arr, - rank: arr, - codeInfo: codeInfo, - rowIndex: rowIndex, - }); + let arr = _.map(row.product, (res) => { + let obj = {}; + obj.key = res.only; + obj.text = res.product_name; + return obj; + }); + this.setState({ + draw_title: "编辑兑换码", + rankoptions: arr, + rank: arr, + codeInfo: codeInfo, + rowIndex: rowIndex, + }); - let temp = _.map(row.product, (o) => { - o.checked = true; - return o; - }); + let temp = _.map(row.product, (o) => { + o.checked = true; + return o; + }); - sessionStorage.setItem("productData", JSON.stringify(row.product)); - sessionStorage.setItem("knockGoldData", JSON.stringify(row.product)); - this.setState({ drawerVisible: true, tempdata: temp }); + sessionStorage.setItem("productData", JSON.stringify(row.product)); + sessionStorage.setItem("knockGoldData", JSON.stringify(row.product)); + this.setState({ drawerVisible: true, tempdata: temp }); + } else { + this.setState({ + draw_title: "编辑优惠券", + rowIndex: rowIndex, + rowCouponData: row, + drawerVisible: true, + }); + } } onUpload = (file, report) => { diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index b68e8357..c373fba4 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -601,7 +601,8 @@ export default class acclist extends React.Component { // 预览 currPreview(rowData) { if ( - rowData.status === 0 ||rowData.status === 1|| + rowData.status === 0 || + rowData.status === 1 || rowData.status === 2 || rowData.status === 8 || rowData.status === 6 || @@ -909,7 +910,7 @@ export default class acclist extends React.Component { if (com == "opearo") { return ( - {rowData.status == 6||rowData.status == 1 ? ( + {rowData.status == 6 || rowData.status == 1 ? ( 编辑 @@ -924,7 +925,8 @@ export default class acclist extends React.Component { )} - {rowData.status == 0 ||rowData.status == 1|| + {rowData.status == 0 || + rowData.status == 1 || rowData.status == 2 || rowData.status == 7 ? ( - - { - rowData.status==1?( -
- 更多 -
- ):(
- 更多 -
) - } + {rowData.status == 1 ? ( +
+ 更多 +
+ ) : ( +
+ 更多 +
+ )}
{rowData.status == 6 ? ( @@ -991,11 +995,18 @@ export default class acclist extends React.Component { this.menuItemClick(e, key, rowData) } > - 发送密码及压缩包 + + 发送密码及压缩包 + 日志 - + 作废