Merge branch 'master' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend
This commit is contained in:
commit
1b26c39b4d
|
@ -40,40 +40,7 @@ export default class adduserinfo extends React.Component{
|
|||
|
||||
componentDidMount(e){
|
||||
//获取商品信息
|
||||
|
||||
let product_id = sessionStorage.getItem("dataInfo");
|
||||
let code_batch_id = sessionStorage.getItem("code_id")
|
||||
|
||||
getCodeProduct(code_batch_id,product_id).then(res=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
let temp ={ //数据模型不可少
|
||||
id:req.product_id,
|
||||
type:req.product_type,
|
||||
contract_price:req.contract_price,
|
||||
official_price:req.official_price,
|
||||
cost_price:req.cost_price,
|
||||
stock:req.quantity,
|
||||
name:req.product_name,
|
||||
show_url:[{src:req.show_url[0]}],
|
||||
describe_url: [{src:req.describe_url[0]}] ,
|
||||
}
|
||||
|
||||
let sel_item = this.state.productOption.find((o)=>{
|
||||
return o.key == temp.id
|
||||
})
|
||||
|
||||
this.setState({cur_product:sel_item})
|
||||
this.setState({model:temp})
|
||||
|
||||
},(err)=>{
|
||||
|
||||
})
|
||||
}).catch(err=>{
|
||||
});
|
||||
|
||||
|
||||
this.getProductInfo()
|
||||
|
||||
}
|
||||
//获取直连天下商品映射信息
|
||||
getProductInfo(){
|
||||
|
@ -105,6 +72,39 @@ export default class adduserinfo extends React.Component{
|
|||
console.log(arr)
|
||||
this.setState({"productOption":arr})
|
||||
|
||||
|
||||
let product_id = sessionStorage.getItem("dataInfo");
|
||||
let code_batch_id = sessionStorage.getItem("code_id")
|
||||
|
||||
getCodeProduct(code_batch_id,product_id).then(res=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
let temp ={ //数据模型不可少
|
||||
id:req.product_id,
|
||||
type:req.product_type,
|
||||
contract_price:req.contract_price,
|
||||
official_price:req.official_price,
|
||||
cost_price:req.cost_price,
|
||||
stock:req.quantity,
|
||||
name:req.product_name,
|
||||
show_url:[{src:req.show_url[0]}],
|
||||
describe_url: [{src:req.describe_url[0]}] ,
|
||||
}
|
||||
|
||||
let sel_item = this.state.productOption.find((o)=>{
|
||||
return o.key == temp.id
|
||||
})
|
||||
|
||||
this.setState({cur_product:sel_item})
|
||||
this.setState({model:temp})
|
||||
|
||||
},(err)=>{
|
||||
|
||||
})
|
||||
}).catch(err=>{
|
||||
});
|
||||
|
||||
|
||||
|
||||
},(err)=>{
|
||||
})
|
||||
})
|
||||
|
@ -359,7 +359,7 @@ export default class adduserinfo extends React.Component{
|
|||
maxAmount={1}
|
||||
onChange={(e)=>{this.onUploadChange(e)}}
|
||||
onUpload={this.onUpload}
|
||||
defaultFileList={this.state.model.show_url}
|
||||
defaultFileList={this.state.model.show_url}
|
||||
value={this.state.model.show_url}
|
||||
/>
|
||||
</FormItem>
|
||||
|
@ -372,7 +372,7 @@ export default class adduserinfo extends React.Component{
|
|||
onChange={(e)=>{this.onUploadChange1(e)}}
|
||||
onUpload={this.onUpload}
|
||||
defaultFileList={this.state.model.describe_url}
|
||||
value={this.state.model.describe_url}
|
||||
value={this.state.model.describe_url}
|
||||
|
||||
/>
|
||||
</FormItem>
|
||||
|
|
|
@ -274,9 +274,9 @@ export default class exchangedit extends React.Component{
|
|||
let visible = await this.refs.product.submit()
|
||||
if(visible)
|
||||
{
|
||||
Notify.success("保存成功")
|
||||
setTimeout(()=>{
|
||||
this.setState({drawerVisible2:false})
|
||||
setTimeout(()=>{
|
||||
|
||||
let data = JSON.parse(sessionStorage.getItem("productData"));
|
||||
this.setState({tempdata:data })
|
||||
let arr = [];
|
||||
|
|
|
@ -171,9 +171,8 @@ export default class acclist extends React.Component{
|
|||
let visible = await this.refs.product.submit()
|
||||
if(visible)
|
||||
{
|
||||
Notify.success("保存成功")
|
||||
this.setState({drawerVisible2:false})
|
||||
setTimeout(()=>{
|
||||
this.setState({drawerVisible2:false})
|
||||
console.log(sessionStorage.getItem("productData"));
|
||||
let data = JSON.parse(sessionStorage.getItem("productData"));
|
||||
this.setState({tempdata:data })
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import ReactDOM from 'react-dom';
|
||||
import React, { Component } from 'react';
|
||||
import { Link } from "react-router-dom";
|
||||
import {Input,openDialog,Notify,Menu, MenuItem,Button,Tag,Sweetalert,CombinedDateRangePicker,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,DropdownContent} from 'zent';
|
||||
import {Input,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,planSend,putKeyEmail,cancelKey} from "../../../assets/api.js"
|
||||
import {getKeyList,handelResponse,startOrStopKeybatch,resKeyEmail,planResend,putKeyEmail,cancelKey} from "../../../assets/api.js"
|
||||
import _ from "lodash";
|
||||
const Column = [
|
||||
{
|
||||
|
@ -116,6 +116,8 @@ export default class acclist extends React.Component{
|
|||
distdata3:[],
|
||||
distdata11:[],
|
||||
tableHeight:600,
|
||||
email:"",
|
||||
phone:"",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,17 +286,29 @@ componentWillMount(){
|
|||
this.setState({tableHeight:window.innerHeight-390});
|
||||
}
|
||||
|
||||
phoneChange=(e)=>
|
||||
{
|
||||
|
||||
this.setState({"phone":e.target.value})
|
||||
|
||||
}
|
||||
emailChange=(e)=>
|
||||
{
|
||||
|
||||
this.setState({"email":e.target.value})
|
||||
|
||||
}
|
||||
|
||||
menuItemClick(e,key,row){
|
||||
console.log(key)
|
||||
let self =this
|
||||
if(key == 1)
|
||||
{
|
||||
let data ={
|
||||
"type":"sms"
|
||||
}
|
||||
|
||||
planSend(row.id,data).then((res)=>{
|
||||
planResend(row.id,data).then((res)=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
|
||||
Notify.success("更改状态成功")
|
||||
|
@ -310,7 +324,7 @@ componentWillMount(){
|
|||
"type":"email"
|
||||
}
|
||||
|
||||
planSend(row.id,data).then((res)=>{
|
||||
planResend(row.id,data).then((res)=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
|
||||
Notify.success("更改状态成功")
|
||||
|
@ -328,14 +342,11 @@ componentWillMount(){
|
|||
closeBtn:true,
|
||||
dialogId: 1, // id is used to close the dialog
|
||||
title: '请输入接收邮箱',
|
||||
children: <Input placeholder="请输入接收邮箱" onChange={(e)=>{
|
||||
email = e.target.value
|
||||
|
||||
}}></Input>,
|
||||
children: <Input placeholder="请输入接收邮箱" onChange={self.emailChange}></Input>,
|
||||
footer: <Button onClick={() => {
|
||||
|
||||
console.log(email)
|
||||
if(email=="")
|
||||
|
||||
if(self.state.email=="")
|
||||
{
|
||||
Notify.error("接收邮箱不能为空")
|
||||
return
|
||||
|
@ -345,14 +356,14 @@ componentWillMount(){
|
|||
let plan_id = row.id
|
||||
let data ={
|
||||
type:"email",
|
||||
to: email
|
||||
to: self.state.email
|
||||
}
|
||||
|
||||
|
||||
putKeyEmail(plan_id,data).then((res)=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
Notify.success("发送成功")
|
||||
this.closeDialog(1)
|
||||
closeDialog(1)
|
||||
},(err)=>{
|
||||
Notify.error(err)
|
||||
})
|
||||
|
@ -376,12 +387,10 @@ componentWillMount(){
|
|||
closeBtn:true,
|
||||
dialogId: 2, // id is used to close the dialog
|
||||
title: '请输入接收手机',
|
||||
children: <Input placeholder="请输入接收手机号" onChange={(e)=>{
|
||||
phone = e.target.phone
|
||||
}}></Input>,
|
||||
children: <Input placeholder="请输入接收手机号" onChange={self.phoneChange}></Input>,
|
||||
footer: <Button onClick={
|
||||
()=>{
|
||||
if(phone=="")
|
||||
if(self.state.phone=="")
|
||||
{
|
||||
Notify.error("接收手机号不能为空")
|
||||
return
|
||||
|
@ -389,20 +398,19 @@ componentWillMount(){
|
|||
let plan_id = row.id
|
||||
let data ={
|
||||
type:"sms",
|
||||
to: phone
|
||||
to: self.state.phone
|
||||
}
|
||||
console.log(phone)
|
||||
|
||||
putKeyEmail(plan_id,data).then((res)=>{
|
||||
handelResponse(res,(req,msg)=>{
|
||||
Notify.success("发送成功")
|
||||
this.closeDialog(1)
|
||||
closeDialog(2)
|
||||
},(err)=>{
|
||||
Notify.error(err)
|
||||
})
|
||||
})
|
||||
|
||||
this.closeDialog(1)
|
||||
|
||||
|
||||
}
|
||||
}>发送</Button>,
|
||||
|
|
|
@ -135,7 +135,7 @@ export default class adduserinfo extends React.Component{
|
|||
|
||||
|
||||
onUploadChange(files){
|
||||
if(files[0].file)
|
||||
if(files&&files[0].file)
|
||||
{
|
||||
let formdata= new FormData();
|
||||
formdata.append("file",files[0].file)
|
||||
|
|
Loading…
Reference in New Issue