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){