Commit 14763990 by 万亚飞

fix

parent f2e070c2
import React, { Component } from 'react';
import classNames from 'classnames';
import moment from 'moment';
import { linkTo } from '@/utils/tools';
import { withRouter } from 'react-router-dom';
import PropTypes from 'prop-types';
......@@ -41,9 +42,11 @@ class TrainItem extends Component {
console.log(this.props.history);
if (data.auditStatus == 1) return;
if (iType === 3) {
this.props.history.push(`/user/train/${data.id}?modifyId=${data.modifyId}`);
linkTo(`/user/train/${data.id}?modifyId=${data.modifyId}`);
// this.props.history.push();
} else {
this.props.history.push(`/user/job/${data.id}?index=${iType}&modifyId=${data.modifyId}`);
linkTo(`/user/job/${data.id}?index=${iType}&modifyId=${data.modifyId}`);
// this.props.history.push();
}
}}
className={classNames('o-btn', { disabled: data.auditStatus == 1 })}
......
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Modal, Toast } from 'antd-mobile';
import classNames from 'classnames';
import Layout from '../../Components/static/Layout/Layout';
import { linkTo } from '@/utils/tools';
import TrainItem from '../../Components/page/user/TrainItem';
import TabBar from '../../Components/page/user/TabBar';
import { MATERIAL_ARR } from '../../static/js/constant';
......@@ -17,18 +16,28 @@ function AddView(props) {
console.log(props);
return (
<div className="bottom-operate">
<Link className="am-button am-button-primary" to={`/user/job/add?index=${props.tabIndex}`}>
<a
className="am-button am-button-primary"
onClick={() => {
linkTo(`/user/job/add?index=${props.tabIndex}`);
}}
>
添加{MATERIAL_ARR[props.tabIndex]}
</Link>
</a>
</div>
);
}
function NoDataView(props) {
return (
<Link className="add-train" to={`/user/job/add?index=${props.tabIndex}`}>
<a
className="add-train"
onClick={() => {
linkTo(`/user/job/add?index=${props.tabIndex}`);
}}
>
<i className="y-icon-add" />
<span>添加{MATERIAL_ARR[props.tabIndex]}</span>
</Link>
</a>
);
}
function ListItemView(props) {
......@@ -93,10 +102,8 @@ class JobList extends Component {
tabIndex: index
});
const { history } = this.props;
console.log(this.props);
console.log(history.replace(`${history.location.pathname}?index=${index}`));
history.replace(`${history.location.pathname}?index=${index}`);
// location.replace(`?index=${index}`);
console.log(location);
}
toAddMaterial = () => {};
delTrain = operate => {
......
......@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Modal, Toast } from 'antd-mobile';
import { linkTo } from '@/utils/tools';
import Layout from '../../Components/static/Layout/Layout';
import TrainItem from '../../Components/page/user/TrainItem';
......@@ -75,9 +76,14 @@ class TrainList extends Component {
</ul>
<div className="bottom-operate">
<Link to="/user/train/add" className="am-button am-button-primary">
<a
onClick={() => {
linkTo('/user/train/add');
}}
className="am-button am-button-primary"
>
添加受训背景
</Link>
</a>
</div>
<Modal
......@@ -103,10 +109,15 @@ class TrainList extends Component {
/>
</div>
) : (
<Link to="/user/train/add" className="add-train">
<a
onClick={() => {
linkTo('/user/train/add');
}}
className="add-train"
>
<i className="y-icon-add" />
<span>添加受训背景</span>
</Link>
</a>
)}
</div>
</Layout>
......
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Toast, Modal } from 'antd-mobile';
import Layout from '../../Components/static/Layout/Layout';
import { MATERIAL_ARR } from '../../static/js/constant';
import { getParam, getImgNaturalDimensions } from '../../utils/tools';
import { getParam, getImgNaturalDimensions, linkTo } from '../../utils/tools';
import UpLoad from '../../Components/common/Upload/Upload';
import { getParameterByName } from '../../utils/common';
......
......@@ -281,7 +281,7 @@ export default function() {
};
params.cmd.action_name = 'action_needLoad';
params.url = 'ydl_app';
console.log('notRefresh');
console.log('notRefresh,2.2.50');
sendDataToExp(params);
};
// 跳转到m站
......
import app from '../static/js/native';
export const ENV = process.env.NODE_ENV;
export const isBrowser = process.browser;
export const UA = isBrowser ? navigator.userAgent : '';
......@@ -5,7 +6,6 @@ export const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA.toLowerCase());
export const isAndroid = UA.indexOf('Android') > -1 || UA.indexOf('Adr') > -1; //android终端
export const isWX = /MicroMessenger/.test(UA);
export const TERMINAL = isIOS ? 'IOS' : 'Android';
console.log(UA);
export function getUrlParam(name, _location) {
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); // 构造一个含有目标参数的正则表达式对象
let r;
......@@ -52,3 +52,8 @@ export function getImgNaturalDimensions(imgSrc, callback) {
// }
return [nWidth, nHeight];
}
export function linkTo(url) {
location.href = url;
// alert(`${location.origin}${url}`);
// app().goPage('壹点零', `${location.origin}${url}`);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment