diff --git a/src/components/pagination/main.js b/src/components/pagination/main.js index 572d8dc6..4f9bdf5c 100644 --- a/src/components/pagination/main.js +++ b/src/components/pagination/main.js @@ -121,6 +121,10 @@ import _ from "lodash"; this.onJumpPage(1) switch(key) { + case "0": + this.setState({count:5}) + this.props.onCountChange(5); + break; case "1": this.setState({count:10}) this.props.onCountChange(10); @@ -183,6 +187,7 @@ import _ from "lodash"; {this.onMenuClick(e,key)}} className="mymenu" > + 5 10 20 50 diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 5d1793ce..38023f56 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -920,7 +920,7 @@ export default class acclist extends React.Component{ { this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > 串码 链接 - 二维码 + 二维码 diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index fa347c8d..0f5adc33 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -720,7 +720,7 @@ export default class acclist extends React.Component{ { this.onStyleChange(e)} } value={this.state.model.style}> 串码 链接 - 二维码 + 二维码 diff --git a/src/pages/plan/key/detail/list.js b/src/pages/plan/key/detail/list.js index df97e6bf..264bd40e 100644 --- a/src/pages/plan/key/detail/list.js +++ b/src/pages/plan/key/detail/list.js @@ -13,7 +13,10 @@ import _ from "lodash"; import menu from "../../../../assets/enum.js" import common from "../../../../assets/comm.js" const PAGE_SIZE_OPTIONS = [10, 20, 30]; - +// + // + // + // export default class acclist extends React.Component{ constructor(props){ @@ -50,12 +53,7 @@ export default class acclist extends React.Component{ } } - clickFn(){ - - let link = window.location.href.replace(window.location.hash,"#/home/plan-create"); - console.log(link) - window.open(link, "_blank") - } + //分页 onPageChange(e){ this.setState({page:e}); @@ -64,60 +62,7 @@ export default class acclist extends React.Component{ },0); } - 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; - - } - - - - planSend(plan_id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let data = { - "operation": 1 - } - startOrStopPlan(plan_id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let data = { - page:this.state.page, - limit:this.state.limit - } - this.getPlanList(data); - },(err)=>{ - Notify.error(err) - }) - }) - this.setState({audit_visible:false}) - Notify.success("发送成功") - },(err)=>{ - Notify.error(err) - }) - }) - - - } + componentDidMount(e){ let data = { page:1, @@ -155,265 +100,17 @@ export default class acclist extends React.Component{ let data = { page:this.state.page, limit:this.state.limit, - status:this.state.status, - key_word:this.state.key_word + + key:this.state.key } - this.getPlanList(data); + this.getKeyCodeList(data); } - //切换siwtch - onSwitchChange(status,row){ - let self = this; - Sweetalert.confirm({ - type:'warning', - closeBtn:true, - title:'确认操作', - content:

是否改变{row.open==1?'关闭':'开启'}[{row.title}]的状态?

, - onConfirm:()=>{ this.changeState(status,row)}, - onCancel: this.onCancel, - className:'questModal', - parentComponent: this - }); - } - cancel(e){ - this.setState({audit_visible:false}) - } - //修改状态 - changeState(status,row){ - let self=this; - let data = { - "operation": status ? 1 : 2 - - } - - - if(row.status == 3) - { - - this.setState({plan_id:row.id}) - planIsSend(row.id).then((res)=>{ - handelResponse(res,(req,msg)=>{ - if(req.is_send == false) - { - 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) - }) - }) - } - else{ - - startOrStopPlan(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id}); - console.log(row.status) - - - this.state.distdata[id].open = status ? 2 : 1; - this.setState({distdata:this.state.distdata}) - let data = { - page:this.state.page, - limit:this.state.limit, - status:this.state.status, - key_word:this.state.key_word - - } - self.getPlanList(data); - Notify.success("更改状态成功") - },(err)=>{ - Notify.error(err) - }) - }) - - - } - - }) - }); - - } - else{ - startOrStopPlan(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - let id = _.findIndex(this.state.distdata,(o)=>{return o.id == row.id}); - this.state.distdata[id].open = status ? 2 : 1; - this.setState({distdata:this.state.distdata}) - let data = { - page:this.state.page, - limit:this.state.limit, - status:this.state.status, - key_word:this.state.key_word - - } - self.getPlanList(data); - Notify.success("更改状态成功") - },(err)=>{ - Notify.error(err) - }) - }) - } - - } - //输入值变化 - onInputChange(e){ - - } - //营销系统名称 - linkTo(row){ - // sessionStorage.setItem('showflag',true); - // let arr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, - // {path:'/home/key-list',name:row.title+'key列表'} - // ]}] - // sessionStorage.setItem("plan_item",JSON.stringify(row)) - // sessionStorage.setItem('breaknav',JSON.stringify(arr)); - // sessionStorage.setItem('linkshowname',"营销计划管理"); - // sessionStorage.setItem("key_plan_id",row.id) - // sessionStorage.setItem("key_plan_status",row.status) - // this.props.history.push('/home/key-list'); - } - menuItemClick(e,key,row){ - - if(row.status ==6 ||row.status == 0 ) - { - - Notify.error("该状态下的数据不允许编辑") - return - } - - - if(key == 1) - { - let data ={ - "type":"sms" - } - - planResend(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("发送成功") - - },(err)=>{ - Notify.error(err) - }) - }) - } - - if(key == 2) - { - let data ={ - "type":"email" - } - - planResend(row.id,data).then((res)=>{ - handelResponse(res,(req,msg)=>{ - Notify.success("发送成功") - },(err)=>{ - Notify.error(err) - }) - }) - } + + - if(key == 3) - { - let email = "" - let self = this; - openDialog({ - closeBtn:true, - dialogId: 1, // id is used to close the dialog - title: '请输入接收邮箱', - children: , - footer: , - onClose() { - console.log('outer dialog closed'); - }, - }); - - } - - if(key == 4) - { - let phone = "" - let self = this - openDialog({ - closeBtn:true, - dialogId: 2, // id is used to close the dialog - title: '请输入接收手机', - children: , - footer: , - onClose() { - }, - }); - } - } //清空 clearFn(){ this.refs.plan_list.allChecked(false) @@ -440,36 +137,6 @@ export default class acclist extends React.Component{ }); this.setState({grantTotal,receiveTotal,usageTotal,silentTotal,receive_total,usage_total,silent_total}); } - onFilter(e,prop){ - this.setState({page:1}) - this.setState({limit:10}) - - let data = { - page:1, - limit:10, - key_word:this.state.key_word - } - data[prop] = e - if(e==999) - { - delete data[prop]; - } - else{ - let params ={} - params[prop] = e - this.setState(params) - } - this.getPlanList(data) - console.log(data) - } - phoneChange=(e)=> - { - this.setState({"phone":e.target.value}) - } - emailChange=(e)=> - { - this.setState({"email":e.target.value}) - } // 监听组件内部状态的变化: componentDidUpdate(prevProps,prevState){ @@ -477,9 +144,6 @@ export default class acclist extends React.Component{ if(prevState.search!=this.state.search &&!this.state.search){ this.iptsureFn(); } - if(prevState.status!=this.state.status){ - this.iptsureFn(); - } } iptsureFn(e){ @@ -488,45 +152,15 @@ export default class acclist extends React.Component{ let data = { page:1, limit:10, - status:this.state.status, - key_word: this.state.search + key: this.state.search } - this.getPlanList(data) + this.getKeyCodeList(data) } - - onPhoneChange(e){ - this.setState({phone_radio:e.target.value}) - } - onEmailChange(e){ - this.setState({email_radio:e.target.value}) - } - - onEdit(e,row){ - sessionStorage.setItem('showflag',true); - let editarr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, - {path:'/home/key-list',name:'编辑:'+row.title} - ]}] - sessionStorage.setItem('breakchangenav',JSON.stringify(editarr)); - if(row.status == 2 || row.status == 6) - { - Notify.clear(); - 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"); - window.open(link, "_blank") - sessionStorage.setItem('showflag',true); - let arr=[{pagetitle:'编辑',items:[{path:'/home/key-list',name:'营销计划管理'}, - {path:'/home/key-list',name:'编辑:'+row.title} - ]}] - sessionStorage.setItem('breaknav',JSON.stringify(arr)); - sessionStorage.setItem('linkshowname',"营销计划管理"); - } + + onFilterClose(prop){ let data = {} data[prop] = null; @@ -536,15 +170,21 @@ export default class acclist extends React.Component{ let params = { page:1, limit:10, - status:this.state.status, - key_word: this.state.search + key: this.state.search } - this.getPlanList(params) + this.getKeyCodeList(params) } tabFn(e){ console.log(e) + switch(e){ + + + } + + + } render(){ const { current, pageSize } = this.state; @@ -581,13 +221,7 @@ export default class acclist extends React.Component{ type: "normal", width:'auto' }, - { - title: '操作', - prop: 'opearo', - name: 'opearo', - type: "slot", - width:'auto', - }, + ]; const date =
- - - - +
{/* */} - this.setState({search:e})} value={this.state.search} wordSearch={this.iptsureFn.bind(this)} icon="search" placeholder={"请输入营销计划名称、分销商名称查询"} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{ + this.setState({search:e})} value={this.state.search} wordSearch={this.iptsureFn.bind(this)} icon="search" placeholder={"请完整输入key"} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{ this.setState({search:''}) let data ={ page:1, limit:10, - } - this.getPlanList(data) + this.getKeyCodeList(data) }} alignment={'left'}/>
- {this.onFilter(e,prop)}} onClose={(e)=>{this.onFilterClose(e) }} > -
+
{this.state.selectiondata.length>0?(清空} @@ -642,6 +271,7 @@ export default class acclist extends React.Component{ isSwitch={false} page={this.state.page} ref="plan_list" + isMultiple={false} dataCount={this.state.dataCount} pageChange={(e)=>{ this.onPageChange(e) @@ -729,15 +359,11 @@ export default class acclist extends React.Component{ return { - - if(item == this.state.phone_list[this.state.phone_radio]) - { - this.setState({phone_radio:-1}) - } - - }} - - >{item} + if(item == this.state.phone_list[this.state.phone_radio]) + { + this.setState({phone_radio:-1}) + } + }}>{item} }) diff --git a/src/pages/plan/key/detail/list.less b/src/pages/plan/key/detail/list.less index e69de29b..0bae22bd 100644 --- a/src/pages/plan/key/detail/list.less +++ b/src/pages/plan/key/detail/list.less @@ -0,0 +1,4 @@ +.code-table { + border-top: 1px solid #e0e0e0; + padding-bottom: 24px; +} \ No newline at end of file diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 0235bbf3..3b4d2876 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -843,7 +843,7 @@ export default class acclist extends React.Component{ { this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > 串码 链接 - 二维码 + 二维码