From 382dc777069308b397b8902091918f2a2a95eb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Mon, 13 Dec 2021 15:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/list/list.js | 6 +- src/pages/plan/key/list.js | 284 ++++++++++++++++++----------------- src/pages/plan/list/list.js | 4 + 3 files changed, 157 insertions(+), 137 deletions(-) diff --git a/src/pages/order/list/list.js b/src/pages/order/list/list.js index e48508b8..ca91d4a3 100644 --- a/src/pages/order/list/list.js +++ b/src/pages/order/list/list.js @@ -32,9 +32,9 @@ const Column = [ type: "normal", width:'100px' }, { - title: 'key-批次ID', - name: 'key_batch_id', - prop:'key_batch_id', + title: '兑换码-批次ID', + name: 'code_batch_id', + prop:'code_batch_id', type: "normal", width:'100px' }, diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index aa111775..e9793398 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -1,7 +1,7 @@ import ReactDOM from 'react-dom'; import React, { Component } from 'react'; import { Link } from "react-router-dom"; -import {Input,openDialog,closeDialog,Notify,Menu, MenuItem,Button,Tag,Sweetalert,CombinedDateRangePicker,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,DropdownContent} from 'zent'; +import {Input,RadioGroup,Radio,openDialog,closeDialog,Notify,Menu, MenuItem,Button,Tag,Sweetalert,CombinedDateRangePicker,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,DropdownContent} from 'zent'; import "./list.less" import { Switch } from 'zent'; import "../../../assets/comm.css" @@ -10,7 +10,7 @@ import Grid from "../../../components/gird/main.js" import TabPage from "../../../components/tabPage/main.js" import Filterbar from "../../../components/filterbar/main.js" import menu from "../../../assets/enum.js" -import {getKeyList,handelResponse,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey,keysIsSend} from "../../../assets/api.js" +import {getKeyList,planIsSend,getReseller,handelResponse,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey,keysIsSend} from "../../../assets/api.js" import _ from "lodash"; const Column = [ { @@ -130,7 +130,15 @@ export default class acclist extends React.Component{ phone:"", isSend:false, isEmail : false, - isSms :false + isSms :false, + audit_visible:false, + phone_list:[], + email_list:[], + phone:"", + email:"", + email_radio:-1, + phone_radio:-1, + } } @@ -339,6 +347,41 @@ onEditRow(status,row){ iptsureFn(){ this.getKeyList(); } + + cancel(e){ + this.setState({audit_visible:false}) + } + + send(e) + { + let phoneReg = new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"); + let emailReg = new RegExp( "^[A-Za-z0-9\u4e00-\u9fa5\.]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"); + + + + + let plan_id = this.state.plan_id; + let data ={ + phone: this.state.phone_radio > -1 ? this.state.phone_list[this.state.phone_radio] : this.state.phone , + email: this.state.email_radio > -1 ? this.state.email_list[this.state.email_radio] : this.state.email + } + + + if (!phoneReg.test(data.phone)) { + + Notify.error("手机号格式不正确") + return; + } + if(!emailReg.test(data.email)){ + + Notify.error("邮箱格式不正确") + return; + + } + + + } + componentWillMount(){ this.setState({tableHeight:window.innerHeight-390}); @@ -363,139 +406,37 @@ phoneChange=(e)=> } menuItemClick(e,key,row){ - let self =this if(key == 1) { - - if(this.state.isSms == false) - { - - Notify.error("还没发送过密码") - return; - } - let data ={ - "type":"sms" - } + let reseller_id = sessionStorage.getItem("reseller_id") - resKeyEmail(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - - Notify.success("发送成功") - },(err)=>{ + getReseller(reseller_id).then((res)=>{ + handelResponse(res,(req,msg)=>{ + this.setState({phone_list:req.contact_phone}) + this.setState({email_list:req.contact_email}) + this.setState({audit_visible:true}) + },(err)=>{ Notify.error(err) - }) + }) }) - } - - if(key == 2) - { - console.log("状态",this.state.isEmail) + // planIsSend(row.id).then((res)=>{ + // handelResponse(res,(req,msg)=>{ + // this.setState({cur_item:row}) + // getReseller(row.reseller_id).then((res)=>{ + // handelResponse(res,(req,msg)=>{ + // this.setState({phone_list:req.contact_phone}) + // this.setState({email_list:req.contact_email}) + // this.setState({audit_visible:true}) + + // },(err)=>{ + // Notify.error(err) + // }) + // }) + - if(this.state.isEmail == false) - { - - Notify.error("还没发送过key") - return; - } - let data ={ - "type":"email" - } - - resKeyEmail(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - - Notify.success("发送成功") - },(err)=>{ - Notify.error(err) - }) - }) - } - - - if(key == 3) - { - let email = "" - openDialog({ - closeBtn:true, - dialogId: 1, // id is used to close the dialog - title: '请输入接收邮箱', - children: , - footer: , - onClose() { - - }, - }); - - } - - if(key == 4) - { - let phone = "" - openDialog({ - closeBtn:true, - dialogId: 2, // id is used to close the dialog - title: '请输入接收手机', - children: , - footer: , - onClose() { - - }, - }); + // }) + // }); } if(key == 5) { @@ -661,11 +602,7 @@ onChangeCombinedDate(e){ this.menuItemClick(e,key,rowData)} style={{width:"400px"}}> - 再次发送key密码 - 再次发送key - 修改接收邮箱发送 - 修改接收手机发送 + 发送密码及压缩包 作废 @@ -684,6 +621,85 @@ onChangeCombinedDate(e){ /> + + + { + + this.state.audit_visible ? ( + +
+
+
+ + {this.cancel(e)}} /> +
发送
+
是否立即发送key以及解压密码?
+
+
+ 接收手机号 +
+
+ {this.onPhoneChange(e)}} + > + { + + this.state.phone_list.map((item, index) => { + + return {item} + + }) + + } + +
+
+
+
+ 接收邮箱 +
+
+ {this.onEmailChange(e)} } + > + { + this.state.email_list.map((item, index) => { + + return {item} + + }) + } + +
+
+ +
+
自定义
+
+ -1} > +
+
+ -1} > +
+
+ + +
+ + +
+
+
+ ):null + + } + + + ) } diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 679f76ee..acb87b00 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -283,6 +283,7 @@ export default class acclist extends React.Component{ sessionStorage.setItem('breaknav',JSON.stringify(arr)); sessionStorage.setItem('linkshowname',"营销计划管理"); sessionStorage.setItem("key_plan_id",row.id) + sessionStorage.setItem("reseller_id",row.reseller_id); sessionStorage.setItem("key_plan_status",row.status) this.props.history.push('/home/key-list'); } @@ -410,6 +411,7 @@ export default class acclist extends React.Component{ onEdit(e,row){ console.log("计划任务ID") + console.log(row) sessionStorage.setItem('showflag',true); let editarr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, {path:'/home/key-list',name:'编辑:'+row.title} @@ -421,6 +423,8 @@ export default class acclist extends React.Component{ Notify.error("不可编辑") return; } + + sessionStorage.setItem("plan_id",row.id) sessionStorage.setItem("plan_status",row.status) let link = window.location.href.replace(window.location.hash,"#/home/plan-edit");