From b255755b189f4715aafa120431fa336dfaf117fd Mon Sep 17 00:00:00 2001 From: zhangds Date: Mon, 24 Oct 2022 16:36:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=95=86=E5=93=81=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/plan-copy.js | 59 ++------------------------------- 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/src/pages/plan/add/plan-copy.js b/src/pages/plan/add/plan-copy.js index be1125b2..98c089c4 100644 --- a/src/pages/plan/add/plan-copy.js +++ b/src/pages/plan/add/plan-copy.js @@ -1,7 +1,5 @@ /* 新增营销计划 */ -import ReactDOM from "react-dom"; -import React, { Component } from "react"; -import { HashRouter as Router, Route, Link } from "react-router-dom"; +import React from "react"; import { Button, Card, @@ -9,9 +7,7 @@ import { Notify, Radio, RadioGroup, - smoothScroll, Sweetalert, - Input, } from "zent"; import "./add.less"; import Step1 from "./step1.js"; @@ -24,10 +20,8 @@ import { getReseller, planSend, approvals, - getDraftInfo, get_copy_data, -} from "../../../assets/api.js"; -import { divNum } from "@/tools/number"; +} from "@/assets/api.js"; export default class add extends React.Component { constructor(props) { @@ -160,54 +154,7 @@ export default class add extends React.Component { keyType: type, }); sessionStorage.setItem("keyType", type); - if (type === 2) { - // 优惠券的转译-弹窗已做了优化 - return req.keys; - } else { - // 兑换码的转译 - req.keys.map((item) => { - item.code_batch.map((item1) => { - item1.products = []; - }); - }); - req.keys.map((item) => { - item.code_batch.map((item1) => { - item1.product.legal.map((item2) => { - item2.only = item2.product_id; - item2.type = 1; - item2.upstream = "直连天下"; - item1.products.push(item2); - }); - item1.product.reduce.map((item3) => { - let obj = {}; - obj.product_name = item3.batch_goods_name; //名字 - obj.channel_activity_id = item3.channel_activity_id; //批次号 - obj.only = item3.channel_activity_id; - obj.type = 2; //类型 - obj.upstream = String(item3.channel) === "1" ? "支付宝" : "微信"; //上游 - obj.effectDate = - item3.time_limit.effect_time.start_time + - " 至 " + - item3.time_limit.effect_time.end_time; //有效时间 - obj.contract_price = item3.price; //单价 - obj.official_price = item3.reduce_amount; //官方价 - obj.quantity = parseInt( - divNum(item3.all_budget, item3.reduce_amount) - ); //总库存 - obj.origin = item3; - item1.products.push(obj); - }); - }); - }); - req.keys.map((item) => { - item.code_batch.map((item1) => { - item1.product = item1.products; - delete item1.products; - }); - }); - - return req.keys; - } + return req.keys; } // 获取落地页