Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fe-app-h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万亚飞
fe-app-h5
Commits
14763990
Commit
14763990
authored
May 27, 2019
by
万亚飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
f2e070c2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
18 deletions
+44
-18
TrainItem.js
src/Components/page/user/TrainItem.js
+5
-2
JobList.js
src/pages/user/JobList.js
+16
-9
TrainList.js
src/pages/user/TrainList.js
+15
-4
addMaterial.js
src/pages/user/addMaterial.js
+1
-1
native.js
src/static/js/native.js
+1
-1
tools.js
src/utils/tools.js
+6
-1
No files found.
src/Components/page/user/TrainItem.js
View file @
14763990
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
linkTo
}
from
'@/utils/tools'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
...
@@ -41,9 +42,11 @@ class TrainItem extends Component {
...
@@ -41,9 +42,11 @@ class TrainItem extends Component {
console
.
log
(
this
.
props
.
history
);
console
.
log
(
this
.
props
.
history
);
if
(
data
.
auditStatus
==
1
)
return
;
if
(
data
.
auditStatus
==
1
)
return
;
if
(
iType
===
3
)
{
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
{
}
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
})}
className
=
{
classNames
(
'o-btn'
,
{
disabled
:
data
.
auditStatus
==
1
})}
...
...
src/pages/user/JobList.js
View file @
14763990
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
Modal
,
Toast
}
from
'antd-mobile'
;
import
{
Modal
,
Toast
}
from
'antd-mobile'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
Layout
from
'../../Components/static/Layout/Layout
'
;
import
{
linkTo
}
from
'@/utils/tools
'
;
import
TrainItem
from
'../../Components/page/user/TrainItem'
;
import
TrainItem
from
'../../Components/page/user/TrainItem'
;
import
TabBar
from
'../../Components/page/user/TabBar'
;
import
TabBar
from
'../../Components/page/user/TabBar'
;
import
{
MATERIAL_ARR
}
from
'../../static/js/constant'
;
import
{
MATERIAL_ARR
}
from
'../../static/js/constant'
;
...
@@ -17,18 +16,28 @@ function AddView(props) {
...
@@ -17,18 +16,28 @@ function AddView(props) {
console
.
log
(
props
);
console
.
log
(
props
);
return
(
return
(
<
div
className
=
"bottom-operate"
>
<
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
]}
添加
{
MATERIAL_ARR
[
props
.
tabIndex
]}
<
/
Link
>
<
/
a
>
<
/div
>
<
/div
>
);
);
}
}
function
NoDataView
(
props
)
{
function
NoDataView
(
props
)
{
return
(
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"
/>
<
i
className
=
"y-icon-add"
/>
<
span
>
添加
{
MATERIAL_ARR
[
props
.
tabIndex
]}
<
/span
>
<
span
>
添加
{
MATERIAL_ARR
[
props
.
tabIndex
]}
<
/span
>
<
/
Link
>
<
/
a
>
);
);
}
}
function
ListItemView
(
props
)
{
function
ListItemView
(
props
)
{
...
@@ -93,10 +102,8 @@ class JobList extends Component {
...
@@ -93,10 +102,8 @@ class JobList extends Component {
tabIndex
:
index
tabIndex
:
index
});
});
const
{
history
}
=
this
.
props
;
const
{
history
}
=
this
.
props
;
console
.
log
(
this
.
props
);
history
.
replace
(
`
${
history
.
location
.
pathname
}
?index=
${
index
}
`
);
console
.
log
(
history
.
replace
(
`
${
history
.
location
.
pathname
}
?index=
${
index
}
`
));
// location.replace(`?index=${index}`);
// location.replace(`?index=${index}`);
console
.
log
(
location
);
}
}
toAddMaterial
=
()
=>
{};
toAddMaterial
=
()
=>
{};
delTrain
=
operate
=>
{
delTrain
=
operate
=>
{
...
...
src/pages/user/TrainList.js
View file @
14763990
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import
{
Link
}
from
'react-router-dom'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
Modal
,
Toast
}
from
'antd-mobile'
;
import
{
Modal
,
Toast
}
from
'antd-mobile'
;
import
{
linkTo
}
from
'@/utils/tools'
;
import
Layout
from
'../../Components/static/Layout/Layout'
;
import
Layout
from
'../../Components/static/Layout/Layout'
;
import
TrainItem
from
'../../Components/page/user/TrainItem'
;
import
TrainItem
from
'../../Components/page/user/TrainItem'
;
...
@@ -75,9 +76,14 @@ class TrainList extends Component {
...
@@ -75,9 +76,14 @@ class TrainList extends Component {
<
/ul
>
<
/ul
>
<
div
className
=
"bottom-operate"
>
<
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
>
<
/div
>
<
Modal
<
Modal
...
@@ -103,10 +109,15 @@ class TrainList extends Component {
...
@@ -103,10 +109,15 @@ class TrainList extends Component {
/
>
/
>
<
/div
>
<
/div
>
)
:
(
)
:
(
<
Link
to
=
"/user/train/add"
className
=
"add-train"
>
<
a
onClick
=
{()
=>
{
linkTo
(
'/user/train/add'
);
}}
className
=
"add-train"
>
<
i
className
=
"y-icon-add"
/>
<
i
className
=
"y-icon-add"
/>
<
span
>
添加受训背景
<
/span
>
<
span
>
添加受训背景
<
/span
>
<
/
Link
>
<
/
a
>
)}
)}
<
/div
>
<
/div
>
<
/Layout
>
<
/Layout
>
...
...
src/pages/user/addMaterial.js
View file @
14763990
...
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
...
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import
{
Toast
,
Modal
}
from
'antd-mobile'
;
import
{
Toast
,
Modal
}
from
'antd-mobile'
;
import
Layout
from
'../../Components/static/Layout/Layout'
;
import
Layout
from
'../../Components/static/Layout/Layout'
;
import
{
MATERIAL_ARR
}
from
'../../static/js/constant'
;
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
UpLoad
from
'../../Components/common/Upload/Upload'
;
import
{
getParameterByName
}
from
'../../utils/common'
;
import
{
getParameterByName
}
from
'../../utils/common'
;
...
...
src/static/js/native.js
View file @
14763990
...
@@ -281,7 +281,7 @@ export default function() {
...
@@ -281,7 +281,7 @@ export default function() {
};
};
params
.
cmd
.
action_name
=
'action_needLoad'
;
params
.
cmd
.
action_name
=
'action_needLoad'
;
params
.
url
=
'ydl_app'
;
params
.
url
=
'ydl_app'
;
console
.
log
(
'notRefresh'
);
console
.
log
(
'notRefresh
,2.2.50
'
);
sendDataToExp
(
params
);
sendDataToExp
(
params
);
};
};
// 跳转到m站
// 跳转到m站
...
...
src/utils/tools.js
View file @
14763990
import
app
from
'../static/js/native'
;
export
const
ENV
=
process
.
env
.
NODE_ENV
;
export
const
ENV
=
process
.
env
.
NODE_ENV
;
export
const
isBrowser
=
process
.
browser
;
export
const
isBrowser
=
process
.
browser
;
export
const
UA
=
isBrowser
?
navigator
.
userAgent
:
''
;
export
const
UA
=
isBrowser
?
navigator
.
userAgent
:
''
;
...
@@ -5,7 +6,6 @@ export const isIOS = UA && /iphone|ipad|ipod|ios/.test(UA.toLowerCase());
...
@@ -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
isAndroid
=
UA
.
indexOf
(
'Android'
)
>
-
1
||
UA
.
indexOf
(
'Adr'
)
>
-
1
;
//android终端
export
const
isWX
=
/MicroMessenger/
.
test
(
UA
);
export
const
isWX
=
/MicroMessenger/
.
test
(
UA
);
export
const
TERMINAL
=
isIOS
?
'IOS'
:
'Android'
;
export
const
TERMINAL
=
isIOS
?
'IOS'
:
'Android'
;
console
.
log
(
UA
);
export
function
getUrlParam
(
name
,
_location
)
{
export
function
getUrlParam
(
name
,
_location
)
{
let
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
// 构造一个含有目标参数的正则表达式对象
let
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
// 构造一个含有目标参数的正则表达式对象
let
r
;
let
r
;
...
@@ -52,3 +52,8 @@ export function getImgNaturalDimensions(imgSrc, callback) {
...
@@ -52,3 +52,8 @@ export function getImgNaturalDimensions(imgSrc, callback) {
// }
// }
return
[
nWidth
,
nHeight
];
return
[
nWidth
,
nHeight
];
}
}
export
function
linkTo
(
url
)
{
location
.
href
=
url
;
// alert(`${location.origin}${url}`);
// app().goPage('壹点零', `${location.origin}${url}`);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment