This commit is contained in:
北海一刀 2021-11-17 13:38:02 +08:00
commit 1727cb1e3e
5 changed files with 244 additions and 25 deletions

View File

@ -36,7 +36,7 @@ import planlist from '../plan/list/list';
import planadd from "../plan/add/add"
import keylist from "../plan/key/list"
import keyorderlist from "../plan/keyorder/keyorder"
import accountlist from '../system/account/list/list';
import accountadd from '../system/account/add/add';
@ -117,23 +117,12 @@ export default class App extends Component {
items:[{path:'/home/order-list',name:'订单列表'}]
}],
path:'/home/order-list'
},{
name:'概览',
childmenu:[],
path:'/home/overview'
},{
name:'推广',
childmenu:[],
path:'/home/extension',
}],
lastTime:new Date().getTime(),
currentTime: new Date().getTime(),
timeOut:15 * 60 * 1000, //设置超时时间: 1分
};
componentDidMount(e){
if (this.state.noShowSubMenu.indexOf(this.props.location.pathname) > -1 ) {
console.log(789789798)
@ -233,7 +222,8 @@ export default class App extends Component {
<Route path="/home/plan-list" exact={true} component={planlist} />
<Route path="/home/plan-create" exact={true} component={planadd} />
<Route path="/home/key-list" exact={true} component={keylist} />
<Route path="/home/addkeyorder" exact={true} component={keyorderlist} />
<Route exact={true} path="/system" render={
()=> (

View File

@ -135,16 +135,16 @@ export default class acclist extends React.Component{
sessionStorage.setItem('breaknav',JSON.stringify(activerou));
}
aboutFn(e,row){
this.props.history.push('/home/exchange-addcommodity');
sessionStorage.setItem('pathname2','/home/exchange-addcommodity')
this.props.history.push('/home/addkeyorder');
sessionStorage.setItem('pathname2','/home/addkeyorder')
let activerou=[{pagetitle:'编辑',items:[
{
"path": "/home/exchangecode-list",
"path": "/home/keyorder",
"name": "兑换码管理"
},
{
"path": "/home/exchangecode-add",
"name": row.name+"兑换码的商品范围列表"
"path": "/home/addkeyorder",
"name": row.name+"列表管理"
}
]}]
sessionStorage.setItem('breaknav',JSON.stringify(activerou));

View File

@ -0,0 +1,223 @@
import ReactDOM from 'react-dom';
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { Button,Tag,Alert,Icon,Notify,Sweetalert,CombinedDateRangePicker} from 'zent';
import "../../../assets/comm.css"
import Ipt from "../../../components/input/main"
import Grid from "../../../components/gird/main.js"
import TabPage from "../../../components/tabPage/main.js"
import Filterbar from "../../../components/filterbar/main.js"
const Column = [
{
title: 'Key码',
name: 'id',
prop:'id',
className: 'name',
type: "normal",
width:'auto'
}, {
title: '归属营销计划',
prop:'name',
name: 'name',
width:'400px',
type: "normal",
}, {
title: '状态',
name: 'fail',
prop:'fail',
type: "normal",
width:'auto'
},
{
title: '剩余条数',
name: 'plan',
type: "normal",
prop:'plan',
width:'auto'
},
{
title: '更新时间',
name: 'belongid',
type: "normal",
prop:'time',
width:'auto',
},
{
title: '操作',
prop: 'opearo',
name: 'opearo',
type: "slot",
width:'200px',
},
];
export default class commoditylist extends React.Component{
constructor(props){
super(props)
this.state={
tabList:[{title:"全部"},{title:"待使用"},{title:"已使用"},{title:"暂停中"},{title:"已结束"},{title:"已作废"}],
distdata:[{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'进行中'},{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'进行中'},{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'进行中'},{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'进行中'},{id:12313123213123,name:'爱奇艺月卡兑换券',time:'2021-11-08 14:21:06',plan:'营销计划2',belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:'已作废'}],
selectiondata:[],
filterList:[{id:0,label:"商品类型",menuList:[{id:0,name:"卡密"},{id:1,name:"直充"}]},
],
menuList:[{id:0,name:"商品类型",check:false}],
combinedValue:[],
activepage:''
}
}
clickFn(){
this.props.history.push('/exchange-goodsadd');
sessionStorage.setItem('pathname2','/exchangecode-goodsadd')
let activerou=[{pagetitle:'新建',items:[
{
"path": "/exchangecode-list",
"name": "兑换码管理"
},
{
"path": "/exchangecode-goodsadd",
"name": "新建商品"
}
]}]
sessionStorage.setItem('breaknav',JSON.stringify(activerou));
}
aboutFn(e,row){
this.props.history.push('/exchange-commodity');
}
selection(selection){
this.setState({selectiondata:selection});
}
batchdelFn(){
if(this.state.selectiondata<1){
Notify.clear();
Notify.warn('请先勾选需删除的选项')
}else{
Sweetalert.confirm({
type:'warning',
closeBtn:true,
title:'确认操作',
content: <p>是否删除所选择的商品</p>,
onConfirm(){
alert('开始调用作废接口');
},
onCancel(){
console.log('点击了取消按钮');
},
className:'questModal',
parentComponent: this
});
}
}
//删除
deleteFn(e,row){
Sweetalert.confirm({
type:'warning',
closeBtn:true,
title:'确认操作',
content: <p>是否删除该商品</p>,
onConfirm(){
alert('开始调用作废接口');
},
onCancel(){
console.log('点击了取消按钮');
},
className:'questModal',
parentComponent: this
});
}
editinfo(e,rowData){
this.props.history.push('/home/exchangecode-add');
sessionStorage.setItem('pathname2','/home/exchangecode-add')
let activerou=[{pagetitle:'编辑',items:[
{
"path": "/home/exchangecode-list",
"name": "兑换码管理"
},
{
"path": "/home/exchangecode-add",
"name": "编辑兑换码"
}
]}]
sessionStorage.setItem('breaknav',JSON.stringify(activerou));
}
//选择时间
onChangeCombinedDate(e){
this.setState({combinedValue:e});
}
tabFn(index){
this.setState({activepage:index});
if(index==0){
}
if(index==1){
}
}
render(){
const { current, pageSize } = this.state;
const date = <CombinedDateRangePicker
className="zent-datepicker-demo"
value={this.state.combinedValue}
format="YYYY-MM-DD"
onChange={(e)=>{this.onChangeCombinedDate(e)}}
/>
return(
<div id="exchangecodeaboutlist">
<TabPage tabs={this.state.tabList} slot={date} tabChange={this.tabFn.bind(this)}>
<p className="codetable dflexj">
<span>
<Button type="primary" onClick={this.clickFn.bind(this)}>批量作废</Button>
<Button type="danger" onClick={this.batchdelFn.bind(this)}>批量标记已使用</Button>
<Button type="primary" onClick={this.clickFn.bind(this)}>导出excel</Button>
<Button type="primary" onClick={this.clickFn.bind(this)}>导出关联订单</Button>
</span>
{/* <Button type="info">批量操作</Button> */}
<Ipt icon="search" placeholder={"请输入商品名称进行匹配查询"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>
</p>
<div>
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar>
</div>
{this.state.selectiondata.length>0?(<Alert
type="info"
extraContent={<Button type="primary">清空</Button>}
>
已选择<font color="#296bef" style={{fontWeight:'bold'}}>{this.state.selectiondata.length}</font>30.0036.4
</Alert>):null
}
<div className="code-table">
<Grid
isMultiple={true}
spliteColor={'#fff'}
tableData={this.state.distdata}
Column={Column}
countbarVisible={false}
isSwitch={false}
pageChange={(e)=>{
this.pageChange(e)
}}
checkChange ={this.selection.bind(this)}
ComponentHandler={(com,rowData)=>{
if(com == "status")
{
return <Tag theme="blue" outline>
{rowData.status}
</Tag>;
}
if(com == "opearo")
{
return <div>
<span className="grid-link" onClick={(e)=>this.editinfo(e,rowData)}>详情</span>
<span className="grid-link" onClick={(e)=>this.deleteFn(e,rowData)}>更多</span>
</div>
}
}}
/>
</div>
</TabPage>
</div>
)
}
}

View File

View File

@ -20,10 +20,7 @@ export default class acclist extends React.Component{
super(props)
this.state={
tabList:[{title:"营销计划列表"}],
distdata:[
],
distdata:[{title:'士大夫大师傅'}],
filterList:[{id:0,label:"状态",menuList:[{id:0,name:"创建中"},{id:1,name:"审核中"},{id:2,name:"生效中"},{id:3,name:"暂停中"},{id:4,name:"已失效"},{id:5,name:"待生效"}]},
],
menuList:[{id:0,name:"状态",check:false}]
@ -85,7 +82,11 @@ export default class acclist extends React.Component{
//输入值变化
onInputChange(e){
}
}
//营销系统名称
tokeyBtn(){
this.props.history.push('/home/key-list');
}
render(){
@ -95,7 +96,7 @@ export default class acclist extends React.Component{
title: '营销计划名称',
name: 'title',
prop:'title',
type: "normal",
type: "slot",
width:'100px',
},{
title: '启用',
@ -201,6 +202,11 @@ export default class acclist extends React.Component{
console.log(selection)
}}
ComponentHandler={(com,rowData)=>{
if(com == "title")
{
return <span className="grid-link" onClick={this.tokeyBtn.bind(this)}>{rowData.title}</span>
}
if(com == "switch")
{
return <Switch size="small" checked={rowData.status} onChange={(e)=>{this.onSwitchChange(e,rowData)}}></Switch>;