Merge branch 'clickCopyv1.4' into lazyRouter

This commit is contained in:
wangsongsole 2022-08-19 15:20:38 +08:00
commit 52b0549ac5
10 changed files with 976 additions and 978 deletions

View File

@ -1,6 +1,7 @@
import { Notify } from "zent"; import { Notify } from "zent";
// export const baseurl = 'https://marketapi.1688sup.com' //镜像环境
const Version = "v1.3.0"; // export const baseurl = 'http://pre.marketapi.1688sup.com'
// const Version = "v1.3.0";
// window.baseurl = 'http://pre.marketapi.1688sup.com' // window.baseurl = 'http://pre.marketapi.1688sup.com'
let baseurl = ""; let baseurl = "";
if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") {
@ -18,7 +19,7 @@ const upload = (method, url, params, responseType) => {
method: method, method: method,
headers: new Headers({ headers: new Headers({
authorization: sessionStorage.getItem("authorization"), authorization: sessionStorage.getItem("authorization"),
Version: Version, // Version: Version,
}), }),
body: params, body: params,
}; };
@ -60,7 +61,7 @@ const derive = (method, url, params, responseType) => {
responseType: "blob", responseType: "blob",
headers: new Headers({ headers: new Headers({
authorization: sessionStorage.getItem("authorization"), authorization: sessionStorage.getItem("authorization"),
Version: Version, // Version: Version,
}), }),
}; };
if (method == "get") { if (method == "get") {
@ -116,7 +117,7 @@ const getData = (method, url, params, responseType) => {
obj = { obj = {
headers: new Headers({ headers: new Headers({
authorization: sessionStorage.getItem("authorization"), authorization: sessionStorage.getItem("authorization"),
Version: Version, // Version: Version,
}), }),
}; };
if (params) { if (params) {
@ -176,7 +177,7 @@ const req = (method, url, params, responseType) => {
obj = { obj = {
headers: new Headers({ headers: new Headers({
authorization: sessionStorage.getItem("authorization"), authorization: sessionStorage.getItem("authorization"),
Version: Version, // Version: Version,
}), }),
}; };
if (params) { if (params) {
@ -198,7 +199,7 @@ const req = (method, url, params, responseType) => {
body: JSON.stringify(params), body: JSON.stringify(params),
headers: new Headers({ headers: new Headers({
"Content-Type": "application/json", "Content-Type": "application/json",
Version: Version, // Version: Version,
}), }),
}; };
} }
@ -210,7 +211,7 @@ const req = (method, url, params, responseType) => {
headers: new Headers({ headers: new Headers({
"Content-Type": "application/json", "Content-Type": "application/json",
authorization: sessionStorage.getItem("authorization"), authorization: sessionStorage.getItem("authorization"),
Version: Version, // Version: Version,
}), }),
}; };
} }

View File

@ -178,7 +178,7 @@ export default class menu extends React.Component {
}) })
let tableData = _.map(this.state.tableData, (item) => { let tableData = _.map(this.state.tableData, (item) => {
return (item.checked = e.target.checked) return (item.checked = e.target.checked&&!item.disabled)
}) })
this.setState({ this.setState({
tableData: this.state.tableData tableData: this.state.tableData

View File

@ -287,11 +287,17 @@ export default class addKnockGold extends Component {
let step1 = JSON.parse(sessionStorage.getItem('knockGold_effectDate')) let step1 = JSON.parse(sessionStorage.getItem('knockGold_effectDate'))
let isdisabled = false let isdisabled = false
let str = moment(date).format('YYYY-MM-DD HH:mm:ss') let str = moment(date).format('YYYY-MM-DD HH:mm:ss')
const isDay = moment(step1.begin_time).format('HH:mm:ss')
if (type == 'start') { if (type == 'start') {
if (isDay < '23:59:59') {
isdisabled = isdisabled =
moment(str).isBefore(step1.begin_time) ||
moment(str).subtract(1, 'days').isAfter(step1.end_time)
} else {
moment(str).isBefore(step1.begin_time) || moment(str).isBefore(step1.begin_time) ||
moment(str).isAfter(step1.end_time) moment(str).isAfter(step1.end_time)
} }
}
if (type == 'end') { if (type == 'end') {
isdisabled = isdisabled =
@ -305,11 +311,20 @@ export default class addKnockGold extends Component {
onDisabledRange2 = (date, type) => { onDisabledRange2 = (date, type) => {
let isdisabled = false let isdisabled = false
let str = moment(date).format('YYYY-MM-DD HH:mm:ss') let str = moment(date).format('YYYY-MM-DD HH:mm:ss')
const isDay = moment(this.state.model.entry_time[1]).format('HH:mm:ss')
if (type == 'start') { if (type == 'start') {
if (isDay < '23:59:59') {
isdisabled =
moment(str).isBefore(this.state.model.entry_time[0]) ||
moment(str)
.subtract(1, 'days')
.isAfter(this.state.model.entry_time[1])
} else {
isdisabled = isdisabled =
moment(str).isBefore(this.state.model.entry_time[0]) || moment(str).isBefore(this.state.model.entry_time[0]) ||
moment(str).isAfter(this.state.model.entry_time[1]) moment(str).isAfter(this.state.model.entry_time[1])
} }
}
if (type == 'end') { if (type == 'end') {
isdisabled = isdisabled =
@ -460,6 +475,8 @@ export default class addKnockGold extends Component {
/* 是支付宝立减金 才进行模板赋值操作 */ /* 是支付宝立减金 才进行模板赋值操作 */
if (transformData.channel == 1) { if (transformData.channel == 1) {
transformData.temp_no = this.state.model.temp_no transformData.temp_no = this.state.model.temp_no
} else {
transformData.temp_no = ''
} }
transformData.batch_goods_name = this.state.model.batch_goods_name transformData.batch_goods_name = this.state.model.batch_goods_name
transformData.channel_activity_id = this.state.model.channel_activity_id // transformData.channel_activity_id = this.state.model.channel_activity_id //

View File

@ -30,7 +30,6 @@ import {
uploadImg, uploadImg,
getReseller, getReseller,
getAccessVerification, getAccessVerification,
keyApproval,
getProductInfoSelect getProductInfoSelect
} from '../../../assets/api.js' } from '../../../assets/api.js'
import Productform from '../product/add' import Productform from '../product/add'
@ -152,12 +151,13 @@ export default class acclist extends React.Component {
this.setState({ pagetitle: '复制key' }) this.setState({ pagetitle: '复制key' })
getReseller(req.reseller_id).then((res) => { getReseller(req.reseller_id).then((res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
this.setState({ reseller: req })
this.setState({ this.setState({
direct_reseller_id: req.direct_reseller_id email_list: req.contact_email,
phone_list: req.contact_phone,
direct_reseller_id: req.direct_reseller_id,
reseller: req
}) })
this.setState({ phone_list: req.contact_phone }) this.getProductFunction(req.direct_reseller_id)
this.setState({ email_list: req.contact_email })
}) })
}) })
@ -259,13 +259,13 @@ export default class acclist extends React.Component {
getReseller(id).then((res) => { getReseller(id).then((res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
this.setState({ reseller: req })
this.setState({ phone_list: req.contact_phone })
this.setState({ email_list: req.contact_email })
this.setState({ this.setState({
direct_reseller_id: req.direct_reseller_id reseller: req,
direct_reseller_id: req.direct_reseller_id,
email_list: req.contact_email,
phone_list: req.contact_phone
}) })
this.getProductFunction(req.direct_reseller_id)
}) })
}) })
@ -287,6 +287,15 @@ export default class acclist extends React.Component {
this.setState({ paytype: e.target.value }) this.setState({ paytype: e.target.value })
} }
/* 获取商品列表 */
getProductFunction(id) {
getProductInfoSelect({ reseller_id: id }).then((res) => {
if (res.code === 200) {
sessionStorage.setItem('productsList', JSON.stringify(res.data.data))
}
})
}
async submit() { async submit() {
let valide = false let valide = false
if (this.refs.form1.validator()) { if (this.refs.form1.validator()) {
@ -421,16 +430,10 @@ export default class acclist extends React.Component {
} else { } else {
this.setState({ product_title: '新增立减金', newGoldLoading: true }) this.setState({ product_title: '新增立减金', newGoldLoading: true })
} }
let param = {
reseller_id: direct_reseller_ids
}
try { try {
getProductInfoSelect(param).then((res) => {
if (res.code === 200) {
sessionStorage.setItem('productsList', JSON.stringify(res.data.data))
this.setState({ productData: null }) this.setState({ productData: null })
this.setState({ drawerVisible2: true }) this.setState({ drawerVisible2: true })
}
if (type === 'addProduct') { if (type === 'addProduct') {
this.setState({ this.setState({
newGoodsBtnLoading: false newGoodsBtnLoading: false
@ -440,7 +443,6 @@ export default class acclist extends React.Component {
newGoldLoading: false newGoldLoading: false
}) })
} }
})
} catch (err) { } catch (err) {
if (type === 'addProduct') { if (type === 'addProduct') {
this.setState({ this.setState({

View File

@ -131,6 +131,17 @@ export default class acclist extends React.Component {
this.setState({ this.setState({
direct_reseller_id: req.direct_reseller_id direct_reseller_id: req.direct_reseller_id
}) })
/* 请求商品数据 */
getProductInfoSelect({
reseller_id: req.direct_reseller_id
}).then((res) => {
if (res.code === 200) {
sessionStorage.setItem(
'productsList',
JSON.stringify(res.data.data)
)
}
})
}) })
}) })
@ -332,19 +343,10 @@ export default class acclist extends React.Component {
} else { } else {
this.setState({ product_title: '新增立减金', newGoldLoading: true }) this.setState({ product_title: '新增立减金', newGoldLoading: true })
} }
let param = {
reseller_id: direct_reseller_ids
}
try { try {
getProductInfoSelect(param).then((res) => {
console.log('res ==>1', res)
console.log('this.state.tempdata ==>', this.state.tempdata)
if (res.code === 200) {
sessionStorage.setItem('productsList', JSON.stringify(res.data.data))
console.log('res ==>2', res.data.data)
this.setState({ productData: null }) this.setState({ productData: null })
this.setState({ drawerVisible2: true }) this.setState({ drawerVisible2: true })
}
if (type === 'addProduct') { if (type === 'addProduct') {
this.setState({ this.setState({
newGoodsBtnLoading: false newGoodsBtnLoading: false
@ -354,7 +356,6 @@ export default class acclist extends React.Component {
newGoldLoading: false newGoldLoading: false
}) })
} }
})
} catch (err) { } catch (err) {
if (type === 'addProduct') { if (type === 'addProduct') {
this.setState({ this.setState({
@ -815,10 +816,17 @@ export default class acclist extends React.Component {
let str = moment(date).format('YYYY-MM-DD HH:mm:ss') let str = moment(date).format('YYYY-MM-DD HH:mm:ss')
let beign_time = this.state.begintime let beign_time = this.state.begintime
let end_time = this.state.endtime let end_time = this.state.endtime
const isDay = moment(beign_time).format('HH:mm:ss')
if (type == 'start') { if (type == 'start') {
if (isDay < '23:59:59') {
isdisabled =
moment(str).isBefore(beign_time) ||
moment(str).subtract(1, 'days').isAfter(end_time)
} else {
isdisabled = isdisabled =
moment(str).isBefore(beign_time) || moment(str).isAfter(end_time) moment(str).isBefore(beign_time) || moment(str).isAfter(end_time)
} }
}
if (type == 'end') { if (type == 'end') {
isdisabled = isdisabled =
@ -833,7 +841,6 @@ export default class acclist extends React.Component {
} }
keyProductClick(row, index) { keyProductClick(row, index) {
console.log('keyProductClick 13==>', row)
if (this.state.direct_reseller_id > 0) { if (this.state.direct_reseller_id > 0) {
/* 区分立减金 */ /* 区分立减金 */
if (row.type === 2) { if (row.type === 2) {

View File

@ -271,6 +271,10 @@ export default class acclist extends React.Component {
] ]
} }
] ]
sessionStorage.setItem(
'knockGold_effectDate',
JSON.stringify(keyBatch.plan)
)
sessionStorage.setItem('pathname2', '/home/exchangecode-copyCode') sessionStorage.setItem('pathname2', '/home/exchangecode-copyCode')
sessionStorage.setItem('breaknav', JSON.stringify(breakchangenav)) sessionStorage.setItem('breaknav', JSON.stringify(breakchangenav))
this.props.history.push('/home/exchangecode-copyCode') this.props.history.push('/home/exchangecode-copyCode')

View File

@ -162,7 +162,7 @@ const getAccountList = () => {
console.log(145, window.baseurl); console.log(145, window.baseurl);
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
xhr.open("GET", window.baseurl + "/auth/login/verify"); xhr.open("GET", window.baseurl + "/auth/login/verify");
xhr.setRequestHeader("Version", "v1.3.0"); // xhr.setRequestHeader("Version", "v1.3.0");
xhr.responseType = "arraybuffer"; xhr.responseType = "arraybuffer";
xhr.onreadystatechange = function (response) { xhr.onreadystatechange = function (response) {
response.header = { response.header = {

File diff suppressed because it is too large Load Diff

View File

@ -7,17 +7,11 @@ import _ from "lodash";
import { import {
Button, Button,
Icon, Icon,
BlockLoading,
Notify, Notify,
Alert, Alert,
Switch,
Dropdown, Dropdown,
DropdownPosition, DropdownPosition,
DropdownClickTrigger, DropdownClickTrigger,
Input,
RadioGroup,
CombinedDateRangePicker,
Radio,
MenuItem, MenuItem,
DropdownContent, DropdownContent,
Menu, Menu,
@ -389,10 +383,10 @@ const UseKeyList = () => {
let grantTotal = 0; let grantTotal = 0;
let surplusTotal = 0; let surplusTotal = 0;
let usageTotal = 0; let usageTotal = 0;
let usage_total = 0;
let silent_total = 0;
let invalidTotal = 0; let invalidTotal = 0;
let outdateTotal = 0; let outdateTotal = 0;
// let usage_total = 0;
// let silent_total = 0;
data.forEach((item) => { data.forEach((item) => {
grantTotal += Number(item.total); grantTotal += Number(item.total);
surplusTotal += Number(item.residue); surplusTotal += Number(item.residue);
@ -400,8 +394,8 @@ const UseKeyList = () => {
outdateTotal += Number(item.overdue); outdateTotal += Number(item.overdue);
invalidTotal += Number(item.invalid); invalidTotal += Number(item.invalid);
usage_total += Number(item.usage_total); // usage_total += Number(item.usage_total);
silent_total += Number(item.silent_total); // silent_total += Number(item.silent_total);
}); });
setState({ setState({
grantTotal, grantTotal,

View File

@ -601,7 +601,7 @@ export default class acclist extends React.Component {
// 预览 // 预览
currPreview(rowData) { currPreview(rowData) {
if ( if (
rowData.status === 0 || rowData.status === 0 ||rowData.status === 1||
rowData.status === 2 || rowData.status === 2 ||
rowData.status === 8 || rowData.status === 8 ||
rowData.status === 6 || rowData.status === 6 ||
@ -909,7 +909,7 @@ export default class acclist extends React.Component {
if (com == "opearo") { if (com == "opearo") {
return ( return (
<span> <span>
{rowData.status == 6 ? ( {rowData.status == 6||rowData.status == 1 ? (
<a className="grid-link" style={{ color: "#d8dbdd" }}> <a className="grid-link" style={{ color: "#d8dbdd" }}>
编辑 编辑
</a> </a>
@ -924,7 +924,7 @@ export default class acclist extends React.Component {
</a> </a>
)} )}
{rowData.status == 0 || {rowData.status == 0 ||rowData.status == 1||
rowData.status == 2 || rowData.status == 2 ||
rowData.status == 7 ? ( rowData.status == 7 ? (
<span <span
@ -956,9 +956,16 @@ export default class acclist extends React.Component {
<Dropdown position={DropdownPosition.RightTop}> <Dropdown position={DropdownPosition.RightTop}>
<DropdownClickTrigger> <DropdownClickTrigger>
<div className="linkmore">
{
rowData.status==1?(
<div className="linkmore" style={{ color: "#d8dbdd" }}>
更多 <Icon type={"down"} /> 更多 <Icon type={"down"} />
</div> </div>
):( <div className="linkmore">
更多 <Icon type={"down"} />
</div>)
}
</DropdownClickTrigger> </DropdownClickTrigger>
{rowData.status == 6 ? ( {rowData.status == 6 ? (
@ -984,11 +991,11 @@ export default class acclist extends React.Component {
this.menuItemClick(e, key, rowData) this.menuItemClick(e, key, rowData)
} }
> >
<MenuItem key="1">发送密码及压缩包</MenuItem> <MenuItem key="1" disabled={rowData.status==1}>发送密码及压缩包</MenuItem>
<MenuItem key="2" disabled> <MenuItem key="2" disabled>
日志 日志
</MenuItem> </MenuItem>
<MenuItem key="3" disabled={this.state.isCancel}> <MenuItem key="3" disabled={this.state.isCancel||rowData.status==1}>
作废 作废
</MenuItem> </MenuItem>
</Menu> </Menu>