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
bc1342f7
Commit
bc1342f7
authored
May 28, 2019
by
万亚飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a7e1d712
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
48 additions
and
71 deletions
+48
-71
App.jsx
src/App.jsx
+1
-1
Upload.js
src/Components/common/Upload/Upload.js
+22
-11
file.js
src/Components/common/UploadFile/file.js
+0
-1
TrainItem.js
src/Components/page/user/TrainItem.js
+0
-1
Layout.js
src/Components/static/Layout/Layout.js
+1
-1
fetch.js
src/api/fetch.js
+1
-2
DepositPay.js
src/pages/deposit/DepositPay.js
+1
-1
DepositUser.js
src/pages/deposit/DepositUser.js
+0
-1
JobList.js
src/pages/user/JobList.js
+0
-2
Train.js
src/pages/user/Train.js
+1
-2
TrainList.js
src/pages/user/TrainList.js
+1
-1
addMaterial.js
src/pages/user/addMaterial.js
+1
-4
native.js
src/static/js/native.js
+4
-36
global.less
src/static/styles/global.less
+6
-3
photoswipe.css
src/static/styles/photoswipe.css
+0
-0
tools.js
src/utils/tools.js
+8
-3
vconsole.js
src/utils/vconsole.js
+1
-1
No files found.
src/App.jsx
View file @
bc1342f7
...
...
@@ -23,7 +23,7 @@ class App extends React.Component {
vc
();
let
newObj
=
this
.
analysisQuery
();
if
(
newObj
&&
newObj
.
uid
)
{
storage
.
setSS
(
'
urlQuery
'
,
this
.
analysisQuery
());
storage
.
setSS
(
'
appInfo
'
,
this
.
analysisQuery
());
}
}
componentDidMount
()
{}
...
...
src/Components/common/Upload/Upload.js
View file @
bc1342f7
import
React
,
{
Component
}
from
'react'
;
import
{
ImagePicker
}
from
'antd-mobile'
;
import
app
from
'../../../static/js/native'
;
import
{
ImagePicker
,
Modal
}
from
'antd-mobile'
;
import
{
isIOS
}
from
'@/utils/tools'
;
import
storage
from
'@/utils/storage.plugin'
;
import
{
PhotoSwipeGallery
}
from
'react-photoswipe'
;
import
*
as
qiniu
from
'qiniu-js'
;
import
API
from
'./api'
;
import
'
react-photoswipe/lib
/photoswipe.css'
;
import
'
@/static/styles
/photoswipe.css'
;
class
UpLoad
extends
Component
{
state
=
{
isOpen
:
false
,
maxSelectImageNumber
:
1
,
//上传文件数
// certificateFiles: [],
ViewImagesIndex
:
0
ViewImagesIndex
:
0
,
appInfo
:
null
// viewImages: [] //查看大图list
};
componentDidMount
()
{
// appBridge({
// name: 'action_needLoad',
// option: {
// needLoad: false
// }
// });
this
.
setState
({
appInfo
:
storage
.
getSS
(
'appInfo'
)
});
}
// 获取随机字符串
random_string
(
len
=
32
)
{
...
...
@@ -125,7 +124,19 @@ class UpLoad extends Component {
return
(
<
div
className
=
"photo-wrap"
>
<
ImagePicker
accept
=
"image/png, image/jpeg, image/jpg"
files
=
{
certificateFiles
}
onChange
=
{
this
.
certificateChange
}
onImageClick
=
{
this
.
onImageClickFun
}
selectable
=
{
certificateFiles
.
length
<
maxSelectImageNumber
}
/
>
<
ImagePicker
onAddImageClick
=
{
e
=>
{
if
(
this
.
state
.
appInfo
.
v
<=
'2.2.50'
&&
isIOS
)
{
e
.
preventDefault
();
Modal
.
alert
(
'您的APP版本太低,升级后可使用上传图片功能'
);
}
}}
accept
=
"image/png, image/jpeg, image/jpg"
files
=
{
certificateFiles
}
onChange
=
{
this
.
certificateChange
}
onImageClick
=
{
this
.
onImageClickFun
}
selectable
=
{
certificateFiles
.
length
<
maxSelectImageNumber
}
/
>
<
PhotoSwipeGallery
items
=
{
viewImages
}
isOpen
=
{
isOpen
}
thumbnailContent
=
{
this
.
getThumbnailContent
}
options
=
{{
closeOnScroll
:
false
}}
onClose
=
{
this
.
closePhoto
}
/
>
<
/div
>
);
...
...
src/Components/common/UploadFile/file.js
View file @
bc1342f7
...
...
@@ -74,7 +74,6 @@ class Page extends Component {
}
qiniuNext
(
res
)
{
// console.log("qiniuNext >>>>>>>")
// console.log(res)
}
qiniuError
(
err
)
{
this
.
props
.
refresh
({
...
...
src/Components/page/user/TrainItem.js
View file @
bc1342f7
...
...
@@ -39,7 +39,6 @@ class TrainItem extends Component {
<
/span
>
<
span
onClick
=
{()
=>
{
console
.
log
(
this
.
props
.
history
);
if
(
data
.
auditStatus
==
1
)
return
;
if
(
iType
===
3
)
{
linkTo
(
`/new/user/train/
${
data
.
id
}
?modifyId=
${
data
.
modifyId
}
`
);
...
...
src/Components/static/Layout/Layout.js
View file @
bc1342f7
...
...
@@ -20,7 +20,7 @@ export default class Layout extends Component {
vc
();
let
newObj
=
this
.
analysisQuery
();
if
(
newObj
&&
newObj
.
uid
)
{
storage
.
setSS
(
'
urlQuery
'
,
this
.
analysisQuery
());
storage
.
setSS
(
'
appInfo
'
,
this
.
analysisQuery
());
}
// ENV === 'development' && storage.setLS('uid', 13090225);
}
...
...
src/api/fetch.js
View file @
bc1342f7
...
...
@@ -6,14 +6,13 @@ import { Toast } from 'antd-mobile';
import
{
getParameterByName
}
from
'../utils/common'
;
export
default
function
ajax
(
apiKey
,
options
)
{
const
userInfo
=
storage
.
getSS
(
'
urlQuery
'
);
const
userInfo
=
storage
.
getSS
(
'
appInfo
'
);
const
uinfo
=
userInfo
?
{
uid
:
userInfo
.
uid
,
accessToken
:
userInfo
.
accessToken
}
:
''
;
// console.log(uid);
const
option
=
Object
.
assign
(
{},
{
...
...
src/pages/deposit/DepositPay.js
View file @
bc1342f7
...
...
@@ -102,7 +102,7 @@ export default class DepositPay extends Component {
}
componentDidMount
()
{
const
userInfo
=
storage
.
getSS
(
'
urlQuery
'
);
const
userInfo
=
storage
.
getSS
(
'
appInfo
'
);
this
.
setState
({
userInfo
});
...
...
src/pages/deposit/DepositUser.js
View file @
bc1342f7
...
...
@@ -39,7 +39,6 @@ export default class DepositPay extends Component {
fetchData
=
()
=>
{
fetch
(
'myDeposit'
,
{
success
:
result
=>
{
console
.
log
(
result
);
let
{
cateDepositAmount
,
cateMeetRequired
,
qualityDepositAmount
,
qualityDepositDeficiency
}
=
result
.
data
;
this
.
setState
({
depositMoney
:
cateDepositAmount
,
//类目保证金
...
...
src/pages/user/JobList.js
View file @
bc1342f7
...
...
@@ -13,7 +13,6 @@ import { getParameterByName } from '../../utils/common';
import
'@/static/styles/user/train-list.less'
;
function
AddView
(
props
)
{
console
.
log
(
props
);
return
(
<
div
className
=
"bottom-operate"
>
<
a
...
...
@@ -147,7 +146,6 @@ class JobList extends Component {
};
render
()
{
const
{
authList
,
backList
,
honorList
,
delDialogObj
,
tabIndex
}
=
this
.
state
;
console
.
log
(
tabIndex
);
// title="执业背景"
return
(
<
div
>
...
...
src/pages/user/Train.js
View file @
bc1342f7
...
...
@@ -29,7 +29,6 @@ class Train extends Component {
};
//初始化图片
initImgs
(
imgs
)
{
console
.
log
(
'initImgs'
,
imgs
);
let
viewArr
=
[],
creArr
=
[];
const
_this
=
this
;
...
...
@@ -161,7 +160,7 @@ class Train extends Component {
fetch
(
subType
,
{
data
:
param
,
success
:
res
=>
{
Toast
.
info
(
`
${
str
}
成功
,请刷新列表页查看
`
);
Toast
.
info
(
`
${
str
}
成功`
);
fetch
(
'fetchTrainList'
,
{
loading
:
false
});
...
...
src/pages/user/TrainList.js
View file @
bc1342f7
...
...
@@ -23,7 +23,7 @@ class TrainList extends Component {
document
.
title
=
'受训背景'
;
app
().
downRefresh
(
true
);
app
().
notRefresh
(
true
);
const
userInfo
=
storage
.
getSS
(
'
urlQuery
'
);
const
userInfo
=
storage
.
getSS
(
'
appInfo
'
);
this
.
setState
({
userInfo
});
...
...
src/pages/user/addMaterial.js
View file @
bc1342f7
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
,
linkTo
}
from
'../../utils/tools'
;
import
UpLoad
from
'../../Components/common/Upload/Upload'
;
...
...
@@ -64,7 +63,6 @@ class AddMaterial extends Component {
}
initImgs
=
imgs
=>
{
console
.
log
(
'initImgs'
,
imgs
);
let
viewArr
=
[],
creArr
=
[];
const
_this
=
this
;
...
...
@@ -109,7 +107,6 @@ class AddMaterial extends Component {
}
else
{
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
}
console
.
log
(
res
);
};
delFile
=
()
=>
{
this
.
setState
({
...
...
@@ -160,7 +157,7 @@ class AddMaterial extends Component {
fetch
(
`
${
subType
}${
this
.
state
.
materialType
}
`
,
{
data
:
param
,
success
:
res
=>
{
Toast
.
info
(
`
${
str
}
成功
,请刷新列表页查看
`
);
Toast
.
info
(
`
${
str
}
成功`
);
fetch
(
'fetchJobList'
,
{
loading
:
false
});
...
...
src/static/js/native.js
View file @
bc1342f7
...
...
@@ -179,16 +179,11 @@ export default function() {
var
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
)
{
// console.log('微信')
return
'wx'
;
}
else
{
// console.log('非微信')
if
(
isiOS
)
{
console
.
log
(
'iOS'
);
return
'iOS'
;
}
else
if
(
isAndroid
)
{
console
.
log
(
'isAndroid'
);
return
'Android'
;
}
else
{
console
.
log
(
'非微信web'
,
ua
);
...
...
@@ -204,7 +199,6 @@ export default function() {
* connectWebViewJavascriptBridge
* ***/
function
connectWebViewJavascriptBridge
(
callback
)
{
console
.
log
(
'connectWebViewJavascriptBridge'
);
if
(
window
.
WebViewJavascriptBridge
)
{
callback
(
WebViewJavascriptBridge
);
}
else
{
...
...
@@ -217,18 +211,11 @@ export default function() {
);
}
}
window
.
sendDataToOC
=
function
(
params
)
{};
console
.
log
(
'system'
,
browser
);
if
(
browser
==
'iOS'
)
{
console
.
log
(
'isIos'
);
connectWebViewJavascriptBridge
(
function
(
bridge
)
{
bridge
.
init
(
function
(
message
,
responseCallback
)
{});
bridge
.
registerHandler
(
'javascriptHandler'
,
function
(
data
,
responseCallback
)
{});
console
.
log
(
'isIos2222'
);
window
.
sendDataToOC
=
function
(
params
)
{
bridge
.
callHandler
(
'javascriptHandler'
,
params
,
function
(
response
)
{
if
(
typeof
response
.
uid
==
'undefined'
)
{
...
...
@@ -253,7 +240,6 @@ export default function() {
function
sendDataToExp
(
params
)
{
try
{
if
(
browser
==
'iOS'
)
{
console
.
log
(
'postMessage'
,
params
);
window
.
webkit
.
messageHandlers
.
MModel
.
postMessage
(
params
);
}
else
{
var
a
=
''
;
...
...
@@ -281,37 +267,20 @@ export default function() {
};
params
.
cmd
.
action_name
=
'action_needLoad'
;
params
.
url
=
'ydl_app'
;
console
.
log
(
'notRefresh,2.2.50'
);
sendDataToExp
(
params
);
};
// 跳转到m站
native
.
openApp
=
function
()
{
console
.
log
(
'openApp'
);
setTimeout
(
function
()
{
var
parmas
=
{};
parmas
.
url
=
'ydl-user://confide/home'
;
sendDataToOC
(
parmas
);
},
300
);
};
native
.
goPage
=
function
(
url
)
{
setTimeout
(
function
()
{
var
par
ma
s
=
{
var
par
am
s
=
{
url
:
'http'
,
cmd
:
{
params
:
{
url
:
url
}
,
action_name
:
''
action_name
:
''
,
params
:
{
url
:
url
}
}
};
sendDataToExp
(
par
ma
s
);
sendDataToExp
(
par
am
s
);
},
300
);
};
native
.
toPage
=
function
(
url
)
{
sendDataToExp
(
url
);
};
native
.
setParams
=
function
(
action_name
,
params
,
_url
)
{
setParams
(
action_name
,
params
,
_url
);
};
native
.
gotoOCChat
=
function
(
args
)
{
const
params
=
{
cmd
:
{
...
...
@@ -331,7 +300,6 @@ export default function() {
url
:
_url
}
};
console
.
log
(
data
);
sendDataToExp
(
data
);
};
return
native
;
...
...
src/static/styles/global.less
View file @
bc1342f7
...
...
@@ -637,7 +637,7 @@ textarea::placeholder {
background: black;
}
/*常用按钮*/
btn.active,
.
btn.active,
.btn:active {
background-image: none;
outline: 0;
...
...
@@ -912,6 +912,9 @@ textarea::placeholder {
.am-toast-notice-content .am-toast-text {
min-width: 100px;
}
.am-modal-title {
line-height: 1.4;
}
.am-modal {
margin-bottom: 60px;
}
...
...
@@ -927,12 +930,12 @@ textarea::placeholder {
.am-button {
height: 45px;
line-height: 45px;
}
.am-button[disabled] {
&[disabled] {
background-color: #ddd;
&::before {
border: 1px solid #ddd !important;
}
}
}
.deposit-user .my-list .am-list-item .am-list-line .am-list-content,
...
...
src/static/styles/photoswipe.css
0 → 100644
View file @
bc1342f7
This diff is collapsed.
Click to expand it.
src/utils/tools.js
View file @
bc1342f7
...
...
@@ -54,9 +54,14 @@ export function getImgNaturalDimensions(imgSrc, callback) {
}
export
function
linkTo
(
url
)
{
location
.
href
=
url
;
// alert(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// history.pushState(null, 'hello', `${location.origin}${url}`);
// window.webkit.messageHandlers.MModel.postMessage({
// url: 'http',
// cmd: {
// action_name: '',
// params: { url: 'https://testh2.yidianling.com/new/user/train?uid=13089811&ts=1559025371&sign=39549b2a339e5a56bbb8a1d2bb594d67&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIwv=2.3.00&uid=13089811&ts=1559025371&sign=fe3e41e54912f6e5d366b346eaccfd2d&accessToken=d86ec45b5fcf9cd1a10dfaa17b527d67MTkwNTIw' }
// }
// });
// app().goPage(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// app().gotoOCChat('壹点零', `${location.origin}${url}`);
}
src/utils/vconsole.js
View file @
bc1342f7
...
...
@@ -65,7 +65,7 @@ export default function() {
lastZ
=
z
;
// 赋值,为下一次计算做准备
}
}
if
(
root
.
DeviceMotionEvent
&&
!
navigator
.
userAgent
.
match
(
/OS 8/
))
{
if
(
root
.
DeviceMotionEvent
&&
!
navigator
.
userAgent
.
match
(
/OS 8/
)
&&
location
.
hostname
.
match
(
'test'
)
)
{
styleDom
=
document
.
createElement
(
'style'
);
// styleDom.innerText = '#__vconsole{display:none}';
document
.
head
.
appendChild
(
styleDom
);
...
...
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