Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
高东东-金蝶建发
/
jf-yzj-employeeself-develop
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bcc905cb
authored
Nov 21, 2023
by
zhongqm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update:我要请假已经接入
parent
7ccd63cf
Pipeline
#23922
failed with stage
in 0 seconds
Changes
10
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
185 additions
and
137 deletions
index.html
jsconfig.json
package.json
src/shared/api.js
src/shared/api/index.js
src/shared/api/user.js
src/shared/app.vue
src/shared/components/homepage/home.vue
src/shared/polyfill/cordova.js
src/shared/store/modules/prove.js
index.html
View file @
bcc905cb
...
...
@@ -6,6 +6,7 @@
<meta
name=
"format-detection"
content=
"telephone=no"
/>
<meta
name=
"viewport"
content=
"initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
>
<script
src=
"miniapp://common/js/qing/qing.js"
></script>
<!-- <script src="https://staging.jffctest.com/public/js/qing/latest/qing.js"></script>-->
</head>
<body>
<div
id=
"app"
></div>
...
...
jsconfig.json
0 → 100644
View file @
bcc905cb
{
"compilerOptions"
:
{
"baseUrl"
:
"./"
,
"paths"
:
{
"@/*"
:
[
"./src/shared/*"
],
"~com/*"
:
[
"./src/shared/components/*"
],
"~lib/*"
:
[
"./src/libraries/*"
],
"~config/*"
:
[
"./src/shared/config/*"
]
,
"~proj/*"
:
[
"./src/projectDynamic/*"
]
}
}
}
package.json
View file @
bcc905cb
...
...
@@ -7,7 +7,7 @@
"scripts"
:
{
"dev"
:
"node build/dev-server.js"
,
"start"
:
"npm run dev"
,
"build"
:
"npm run build:
v
test"
,
"build"
:
"npm run build:test"
,
"build:test"
:
"cross-env PACK_ENV=prod PACK_VENV=vtest node build/build.js"
,
"build:prod"
:
"cross-env PACK_ENV=prod PACK_VENV=vprod node build/build.js"
},
...
...
src/shared/api.js
View file @
bcc905cb
// const testToken = 'T3353641990669312'
const
basePreUrl
=
'hr.hrself.'
;
const
basePreUrl
=
'hr.hrself.'
// export const SetToken = function (val) {
// let env = process.env.NODE_ENV;
...
...
@@ -14,24 +14,25 @@ const basePreUrl = 'hr.hrself.';
// })
// }
// }
//我要请假小程序appid
export
const
LeaveAppId
=
process
.
env
.
PACK_VENV
===
'vprod'
?
'500000125'
:
'500000125'
export
default
{
LoginUrl
:
basePreUrl
+
"loginSelf"
,
AnnRollUrl
:
basePreUrl
+
"annRollListSelf"
,
PayRollUrl
:
basePreUrl
+
"payRollListSelf"
,
PayRolDetailUrl
:
basePreUrl
+
"payRollInfoSelf"
,
InsurelUrl
:
basePreUrl
+
"insRecordInfoSelf"
,
FundUrl
:
basePreUrl
+
"fundRecordInfoSelf"
,
AwardUrl
:
basePreUrl
+
"awardListSelf"
,
RewUrl
:
basePreUrl
+
"rewProvideListSelf"
,
UserInfoUrl
:
basePreUrl
+
"userInfoSelf"
,
UserModifyUrl
:
basePreUrl
+
"modifyUserInfoSelf"
,
AddCodeUrl
:
basePreUrl
+
"getCodeSelf"
,
HomeListUrl
:
basePreUrl
+
"homeListSelf"
,
HomeInfoUrl
:
basePreUrl
+
"homeInfoSelf"
,
HomeModifyUrl
:
basePreUrl
+
"modifyHomeInfoSelf"
,
DiamondUrl
:
basePreUrl
+
"diamondLifeV"
,
UpdatePassword
:
basePreUrl
+
"updatePassword"
,
SendCodeByUserName
:
basePreUrl
+
"sendCodeByUserName"
,
UpdatePasswordByCode
:
basePreUrl
+
"updatePasswordByCode"
LoginUrl
:
basePreUrl
+
'loginSelf'
,
AnnRollUrl
:
basePreUrl
+
'annRollListSelf'
,
PayRollUrl
:
basePreUrl
+
'payRollListSelf'
,
PayRolDetailUrl
:
basePreUrl
+
'payRollInfoSelf'
,
InsurelUrl
:
basePreUrl
+
'insRecordInfoSelf'
,
FundUrl
:
basePreUrl
+
'fundRecordInfoSelf'
,
AwardUrl
:
basePreUrl
+
'awardListSelf'
,
RewUrl
:
basePreUrl
+
'rewProvideListSelf'
,
UserInfoUrl
:
basePreUrl
+
'userInfoSelf'
,
UserModifyUrl
:
basePreUrl
+
'modifyUserInfoSelf'
,
AddCodeUrl
:
basePreUrl
+
'getCodeSelf'
,
HomeListUrl
:
basePreUrl
+
'homeListSelf'
,
HomeInfoUrl
:
basePreUrl
+
'homeInfoSelf'
,
HomeModifyUrl
:
basePreUrl
+
'modifyHomeInfoSelf'
,
DiamondUrl
:
basePreUrl
+
'diamondLifeV'
,
UpdatePassword
:
basePreUrl
+
'updatePassword'
,
SendCodeByUserName
:
basePreUrl
+
'sendCodeByUserName'
,
UpdatePasswordByCode
:
basePreUrl
+
'updatePasswordByCode'
}
src/shared/api/index.js
View file @
bcc905cb
...
...
@@ -17,7 +17,7 @@ const masConfig = process.env.PACK_VENV === 'vprod'
const
mas
=
MAS
.
getInstance
().
config
(
masConfig
)
Vue
.
prototype
.
$mas
=
mas
const
debugToken
=
'
T5005556394836992
'
const
debugToken
=
'
yzj_68ab62e08529511f15d5797337c1298f
'
const
debugUsername
=
'hqhuang@cndrealty.com'
// 调试模式下,为非V+包环境
const
debug
=
process
.
env
.
NODE_ENV
===
'development'
...
...
src/shared/api/user.js
View file @
bcc905cb
src/shared/app.vue
View file @
bcc905cb
...
...
@@ -71,7 +71,7 @@ export default {
// await Api.setToken(this)
// 修改导航条颜色
this
.
$nativeApi
.
system
.
statusBarColor
([
255
,
255
,
255
,
1
])
//
this.$nativeApi.system.statusBarColor([255, 255, 255, 1])
// 监听路由变化
this
.
$router
.
beforeEach
((
to
,
from
,
next
)
=>
{
...
...
src/shared/components/homepage/home.vue
View file @
bcc905cb
<
template
>
<div
class=
"view-content has-header bg"
>
<div
class=
"user_info"
>
<div
class=
'view-content has-header bg'
>
<div
class=
'user_info'
>
<div>
<h2>
{{
userName
}}
</h2>
<p>
您已入职
{{
dayCount
}}
天
</p>
<h2>
{{
userName
}}
</h2>
<p>
您已入职
{{
dayCount
}}
天
</p>
<!--
<p>
新的一天,新开始的开始!
</p>
-->
</div>
<div
class=
"photoWrapper"
>
<img
:src=
"photoUrl"
class=
"round_icon"
/>
<div
class=
'photoWrapper'
>
<img
:src=
'photoUrl'
class=
'round_icon'
/>
</div>
</div>
<!-- 钻石人生-入口 (暂时隐藏)-->
<div
class=
"banner"
@
click=
"onBannerClick"
>
<img
class=
"bannerImg"
src=
"../../assets/images/life_banner@2x.png"
alt=
"life"
>
<div
class=
'banner'
@
click=
'onBannerClick'
>
<img
class=
'bannerImg'
src=
'../../assets/images/life_banner@2x.png'
alt=
'life'
>
</div>
<group
gutter=
"0"
>
<cell
:is-link=
"true"
@
click
.
native=
"clickMyInfo"
class=
"border-top"
>
<p
class=
"cell-title"
slot=
"title"
>
个人信息修改
</p>
<font-icon
slot=
"icon"
class=
"margin-r-8"
type=
"ic_me"
/>
<group
gutter=
'0'
>
<cell
:is-link=
'true'
@
click
.
native=
'clickMyInfo'
class=
'border-top'
>
<p
class=
'cell-title'
slot=
'title'
>
个人信息修改
</p>
<font-icon
slot=
'icon'
class=
'margin-r-8'
type=
'ic_me'
/>
<!--
<span
slot=
"value"
style=
"color:#D23930"
>
完整度
{{
percent
}}
</span>
-->
</cell>
<cell
:is-link=
"true"
@
click
.
native=
"clickLeave"
class=
"border-top"
>
<p
class=
"cell-title"
slot=
"title"
>
请假
</p>
<font-icon
slot=
"icon"
class=
"margin-r-8"
type=
"ic_qingjia"
/>
<cell
:is-link=
'true'
@
click
.
native=
'clickLeave'
class=
'border-top'
>
<p
class=
'cell-title'
slot=
'title'
>
请假
</p>
<font-icon
slot=
'icon'
class=
'margin-r-8'
type=
'ic_qingjia'
/>
</cell>
<cell
:is-link=
"true"
@
click
.
native=
"clickSalary"
class=
"border-top"
>
<p
class=
"cell-title"
slot=
"title"
>
薪资查询
</p>
<font-icon
slot=
"icon"
class=
"margin-r-8"
type=
"ic_xinzi"
/>
<cell
:is-link=
'true'
@
click
.
native=
'clickSalary'
class=
'border-top'
>
<p
class=
'cell-title'
slot=
'title'
>
薪资查询
</p>
<font-icon
slot=
'icon'
class=
'margin-r-8'
type=
'ic_xinzi'
/>
</cell>
<cell
:is-link=
"true"
@
click
.
native=
"clickProve"
class=
"border-top border-bottom"
>
<p
class=
"cell-title"
slot=
"title"
>
开具证明
</p>
<font-icon
slot=
"icon"
class=
"margin-r-8"
type=
"ic_zhengming"
/>
<cell
:is-link=
'true'
@
click
.
native=
'clickProve'
class=
'border-top border-bottom'
>
<p
class=
'cell-title'
slot=
'title'
>
开具证明
</p>
<font-icon
slot=
'icon'
class=
'margin-r-8'
type=
'ic_zhengming'
/>
</cell>
</group>
<img
:src=
"require('../../assets/images/bg_bottom@2x.png')"
class=
"bottom-img"
/>
<login-dialog
ref=
"dialogOA"
v-on:loginSuccess=
"doLogin"
/>
<half-year-dialog
ref=
"halfYearDialog"
@
onButtonClick=
"gotoChange"
/>
<img
:src=
"require('../../assets/images/bg_bottom@2x.png')"
class=
'bottom-img'
/>
<login-dialog
ref=
'dialogOA'
v-on:loginSuccess=
'doLogin'
/>
<half-year-dialog
ref=
'halfYearDialog'
@
onButtonClick=
'gotoChange'
/>
</div>
</
template
>
...
...
@@ -45,6 +45,7 @@ import FontIcon from '@/components/commom/FontIcon'
import
{
mapState
,
mapActions
,
mapMutations
}
from
'vuex'
import
LoginDialog
from
'./login'
import
HalfYearDialog
from
'@/components/commom/halfYearDialog'
import
{
LeaveAppId
}
from
'@/api'
export
default
{
components
:
{
...
...
@@ -55,7 +56,7 @@ export default {
LoginDialog
,
HalfYearDialog
},
activated
()
{
activated
()
{
this
.
init
()
/* 用自定义事件重新document事件
document.addEventListener('backbutton', this.onBackKeyDown)
...
...
@@ -65,7 +66,7 @@ export default {
}
customEvt
.
addEventListener
(
'backbutton'
,
this
.
_onBackKeyDown
)
},
deactivated
()
{
deactivated
()
{
/* 用自定义事件重新document事件
document.removeEventListener('backbutton', this.onBackKeyDown)
*/
...
...
@@ -79,7 +80,7 @@ export default {
}
},
watch
:
{
username
()
{
username
()
{
// V+延时触发
if
(
this
.
username
)
{
this
.
init
()
...
...
@@ -93,16 +94,16 @@ export default {
'username'
,
'userid'
]),
userName
()
{
userName
()
{
return
this
.
userInfo
.
name
},
dayCount
()
{
dayCount
()
{
return
this
.
userInfo
.
enterDay
},
percent
()
{
percent
()
{
return
this
.
userInfo
.
infoPercent
},
photoUrl
()
{
photoUrl
()
{
return
this
.
userInfo
.
personPhoto
?
(
`data:image/jpeg;base64,
${
this
.
userInfo
.
personPhoto
}
`
)
:
require
(
'../../assets/images/avatar.png'
)
}
},
...
...
@@ -118,7 +119,7 @@ export default {
'updateIncumbencyProveInfo'
,
'updateIncomeProveInfo'
]),
init
()
{
init
()
{
// 移动端触发
if
(
this
.
username
)
{
// 未登录,弹出登录对话框
...
...
@@ -129,22 +130,26 @@ export default {
this
.
$mas
.
userName
=
this
.
username
}
},
clickMyInfo
()
{
clickMyInfo
()
{
this
.
$router
.
push
({
name
:
'myInfo'
})
},
clickSalary
()
{
clickSalary
()
{
this
.
$router
.
push
({
name
:
'salaryList'
})
},
clickLeave
()
{
this
.
$nativeApi
.
navigator
.
showWidget
([
'com.cnd.hr.leave'
])
clickLeave
()
{
// this.$nativeApi.navigator.showWidget(['com.cnd.hr.leave'])
qing
.
call
(
'gotoLightApp'
,
{
urlParam
:
'cloudhub://miniapp?appid='
+
LeaveAppId
+
'&path=index.html'
})
},
clickProve
()
{
clickProve
()
{
// 清空缓存的证明数据
this
.
updateIncumbencyProveInfo
({})
this
.
updateIncomeProveInfo
({})
this
.
$router
.
push
({
name
:
'prove'
})
},
onBackKeyDown
(
e
)
{
onBackKeyDown
(
e
)
{
// 安卓点击返回键退出
if
(
this
.
$router
.
currentRoute
.
name
===
'homepage'
)
{
this
.
$nativeApi
.
navigator
.
exit
()
...
...
@@ -167,7 +172,7 @@ export default {
this
.
showHalfYearDialog
()
}
},
isNeedShowHalfYearDialog
()
{
isNeedShowHalfYearDialog
()
{
let
show
=
false
let
isNeedCleanDate
=
false
// 上次确认状态
...
...
@@ -184,8 +189,8 @@ export default {
let
lastMonth
=
last
.
getMonth
()
+
1
let
lastDay
=
last
.
getDate
()
// 如果时间到了指定的日期,则需要再次弹出确认弹窗
if
(
month
===
this
.
alertMonth
&&
day
===
this
.
alertDay
)
{
if
(
lastYear
===
year
&&
lastMonth
===
month
)
{
if
(
month
===
this
.
alertMonth
&&
day
===
this
.
alertDay
)
{
if
(
lastYear
===
year
&&
lastMonth
===
month
)
{
isNeedCleanDate
=
false
// console.log('同年同月,不清除')
}
else
{
...
...
@@ -210,15 +215,15 @@ export default {
}
return
show
},
showHalfYearDialog
()
{
showHalfYearDialog
()
{
// 显示半年提示框(显示员工信息确认提示框)
// window.localStorage.setItem('lastShowDate_' + this.$store.state.shareStore.userid, new Date().getTime())
this
.
$refs
.
halfYearDialog
.
showDialog
()
},
gotoChange
()
{
gotoChange
()
{
this
.
clickMyInfo
()
},
isNeedShowDiamondLife
()
{
isNeedShowDiamondLife
()
{
// 新的一年里,第一次登录,自动打开钻石人生页面
let
show
=
false
let
lastDate
=
window
.
localStorage
.
getItem
(
'newYear_'
+
this
.
$store
.
state
.
shareStore
.
userid
)
...
...
@@ -235,63 +240,69 @@ export default {
}
return
show
},
showDiamondLife
()
{
showDiamondLife
()
{
// 显示钻石人生
window
.
localStorage
.
setItem
(
'newYear_'
+
this
.
$store
.
state
.
shareStore
.
userid
,
new
Date
().
getTime
())
this
.
onBannerClick
()
},
onBannerClick
()
{
onBannerClick
()
{
return
// 钻石人生
this
.
$router
.
push
({
name
:
'diamondLife'
})
}
},
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
to
,
from
,
next
)
{
next
(
vm
=>
{
if
(
from
.
name
===
'forgotPsw'
||
from
.
name
===
'resetPsw'
)
{
// 再次显示登录对话框
vm
.
showLogin
()
}
})
;
})
}
}
</
script
>
<!-- 全局样式 -->
<
style
lang=
"less"
>
<
style
lang=
'less'
>
.vux-header
{
background-color
:
#fff
!important
;
background-color
:
#fff
!important
;
.vux-header-left
{
color
:
#333333
!important
;
color
:
#333333
!important
;
.
left-arrow
:
before
{
border-color
:
#333333
!important
;
border-color
:
#333333
!important
;
}
}
}
.bg
{
background-color
:
#ffffff
!important
;
background-color
:
#ffffff
!important
;
}
.weui-cells
:before
,
.weui-cell
:before
{
border-top
:
none
!important
;
border-top
:
none
!important
;
}
.weui-cells
:after
{
border-bottom
:
none
!important
;
border-bottom
:
none
!important
;
}
.margin-r-8
{
margin-right
:
8px
;
}
.border-top
{
border-top
:
1px
solid
#D9D9D9
;
}
.border-bottom
{
border-bottom
:
1px
solid
#D9D9D9
;
}
</
style
>
<
style
lang=
"less"
scoped
>
<
style
lang=
'less'
scoped
>
.user_info
{
display
:
flex
;
justify-content
:
space-between
;
...
...
@@ -302,11 +313,13 @@ export default {
font-size
:
24px
;
font-weight
:
bold
;
}
p
{
color
:
#666666
;
font-size
:
14px
;
font-weight
:
400
;
}
.photoWrapper
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -316,21 +329,25 @@ export default {
height
:
72px
;
border-radius
:
50%
;
overflow
:
hidden
;
.round_icon
{
width
:
100%
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
}
}
}
.cell-title
{
font-size
:
20px
;
}
.weui-cell
{
padding
:
15px
;
}
.banner
{
position
:
relative
;
width
:
100%
;
...
...
@@ -344,6 +361,7 @@ export default {
padding
:
12px
15px
;
}
}
.bottom-img
{
position
:
absolute
;
width
:
100%
;
...
...
src/shared/polyfill/cordova.js
View file @
bcc905cb
;(
function
(
global
)
{
;(
function
(
global
)
{
var
qing
=
global
.
qing
var
appMap
=
{
'com.jffc.gc-bak'
:
'500000106'
,
'com.jffc.gc'
:
'500000113'
,
'com.jffc.supplier'
:
'500000112'
'com.jffc.supplier'
:
'500000112'
,
'com.cnd.hr.leave'
:
'500000125'
}
function
isObject
(
value
)
{
function
isObject
(
value
)
{
return
value
!==
null
&&
typeof
value
===
'object'
}
var
qingPromise
=
function
(
fnName
,
params
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
qingPromise
=
function
(
fnName
,
params
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
originSuccess
=
params
.
success
var
originError
=
params
.
error
var
opt
=
Object
.
assign
(
params
,
{
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
originSuccess
)
{
originSuccess
(
res
)
}
resolve
(
res
)
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
if
(
originError
)
{
originError
(
e
)
}
...
...
@@ -31,6 +32,7 @@
qing
.
call
(
fnName
,
opt
)
})
}
// 根据“工号”查询【工号、eid、orgId】等信息
function
getPersonInfosByJobNo
(
jobNos
)
{
var
opt
=
{
...
...
@@ -45,8 +47,8 @@
jobNos
:
jobNos
.
join
(
','
)
}
}
return
new
Promise
(
function
(
resolve
,
reject
)
{
opt
.
success
=
function
(
result
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
opt
.
success
=
function
(
result
)
{
var
success
=
(
result
||
{}).
success
||
false
var
data
=
(
result
||
{}).
data
||
[]
if
(
String
(
success
).
toLowerCase
()
!==
'true'
||
data
.
length
===
0
)
{
...
...
@@ -55,7 +57,7 @@
}
resolve
(
result
.
data
)
}
opt
.
error
=
function
(
e
)
{
opt
.
error
=
function
(
e
)
{
reject
(
e
)
}
qing
.
call
(
'request'
,
opt
)
...
...
@@ -76,8 +78,8 @@
oIds
:
oIds
.
join
(
','
)
}
}
return
new
Promise
(
function
(
resolve
,
reject
)
{
opt
.
success
=
function
(
result
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
opt
.
success
=
function
(
result
)
{
var
success
=
(
result
||
{}).
success
var
data
=
(
result
||
{}).
data
||
[]
if
(
String
(
success
).
toLowerCase
()
!==
'true'
||
data
.
length
===
0
)
{
...
...
@@ -86,7 +88,7 @@
}
resolve
(
result
.
data
)
}
opt
.
error
=
function
(
e
)
{
opt
.
error
=
function
(
e
)
{
reject
(
e
)
}
qing
.
call
(
'request'
,
opt
)
...
...
@@ -95,11 +97,11 @@
// 通过qingjs选人
function
selectPersonByQing
(
selected
,
isMulti
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
qing
.
call
(
'selectPersons'
,
{
isMulti
:
isMulti
,
selected
:
selected
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
var
success
=
(
result
||
{}).
success
||
false
var
persons
=
((
result
||
{}).
data
||
{}).
persons
||
[]
if
(
...
...
@@ -119,7 +121,7 @@
function
formatData2Mx
(
persons
)
{
// openId和人员的映射关系
var
personMap
=
{}
var
openIds
=
persons
.
map
(
function
(
p
)
{
var
openIds
=
persons
.
map
(
function
(
p
)
{
// 将云之家的人员字段与美信的人员字段映射起来
p
.
telephonenumber
=
p
.
phone
p
.
cn
=
p
.
name
...
...
@@ -130,8 +132,8 @@
personMap
[
openId
]
=
p
return
openId
})
return
getPersonInfosByoIds
(
openIds
).
then
(
function
(
ids
)
{
var
persons
=
ids
.
map
(
function
(
personIds
)
{
return
getPersonInfosByoIds
(
openIds
).
then
(
function
(
ids
)
{
var
persons
=
ids
.
map
(
function
(
personIds
)
{
var
openId
=
personIds
.
oId
var
jobNo
=
personIds
.
jobNo
// 从缓存里面查询对应人员
...
...
@@ -154,23 +156,23 @@
}
// 根据openId选人
selectedPromise
.
then
(
function
(
persons
)
{
var
oIds
=
persons
.
map
(
function
(
p
)
{
.
then
(
function
(
persons
)
{
var
oIds
=
persons
.
map
(
function
(
p
)
{
return
p
.
oId
})
return
selectPersonByQing
(
oIds
,
isMulti
)
})
.
then
(
function
(
persons
)
{
.
then
(
function
(
persons
)
{
// 格式化选人信息
return
formatData2Mx
(
persons
)
})
.
then
(
function
(
persons
)
{
.
then
(
function
(
persons
)
{
successFn
({
result
:
true
,
array
:
persons
})
})
.
catch
(
function
()
{
.
catch
(
function
()
{
failFn
({
result
:
false
,
array
:
[]
...
...
@@ -192,7 +194,7 @@
qing
.
call
(
'request'
,
opt
)
}
function
openAppWithData
(
appName
,
data
,
url
)
{
function
openAppWithData
(
appName
,
data
,
url
)
{
var
val
=
''
if
(
isObject
(
data
))
{
data
=
JSON
.
stringify
(
data
)
...
...
@@ -204,12 +206,12 @@
val
=
data
.
replace
(
/'/gm
,
'∆∆'
).
replace
(
/"/gm
,
'åå'
)
}
val
=
encodeURIComponent
(
val
)
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
qing
.
call
(
'storage.setItem'
,
{
shared
:
true
,
key
:
appName
,
value
:
val
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
String
(
res
.
success
).
toLowerCase
()
===
'true'
)
{
qing
.
call
(
'gotoLightApp'
,
{
urlParam
:
url
...
...
@@ -219,7 +221,7 @@
reject
(
res
.
error
)
}
},
error
:
function
(
e
)
{
error
:
function
(
e
)
{
reject
(
e
)
}
})
...
...
@@ -228,7 +230,7 @@
var
handlers
=
{
MIDEACOMMON
:
{
launchExternalAPPByThird
:
function
(
params
,
successFn
,
failFn
)
{
launchExternalAPPByThird
:
function
(
params
,
successFn
,
failFn
)
{
params
=
params
||
[]
if
(
!
params
.
length
)
{
failFn
(
'未检测到要打开应用的包名!'
)
...
...
@@ -244,7 +246,7 @@
scheme
=
scheme
.
replace
(
'://://'
,
'://'
)
qing
.
call
(
'gotoApp'
,
{
data
:
`
${
scheme
}
p?`
,
success
:
function
(
result
)
{
success
:
function
(
result
)
{
const
success
=
(
result
||
{}).
success
||
false
if
(
`
${
success
}
`
.
toLowerCase
()
===
'true'
)
{
successFn
(
true
)
...
...
@@ -252,12 +254,12 @@
failFn
(
'打开应用失败!'
)
}
},
error
:
function
()
{
error
:
function
()
{
failFn
(
'打开应用失败!'
)
}
})
},
setBounces
:
function
(
p
,
successFn
,
failFn
)
{
setBounces
:
function
(
p
,
successFn
,
failFn
)
{
p
=
p
||
[
0
]
var
enable
=
p
[
0
]
...
...
@@ -271,11 +273,11 @@
})
successFn
(
'success'
)
},
exit
:
function
(
p
,
successFn
,
failFn
)
{
exit
:
function
(
p
,
successFn
,
failFn
)
{
qing
.
call
(
'closeWebView'
)
successFn
(
'success'
)
},
openSysBrowser
:
function
(
urls
,
successFn
,
failFn
)
{
openSysBrowser
:
function
(
urls
,
successFn
,
failFn
)
{
var
u
=
urls
||
[]
if
(
!
u
.
length
)
{
failFn
(
'未检测到要打开的url!'
)
...
...
@@ -289,7 +291,7 @@
success
:
successFn
})
},
language
:
function
(
param
,
successFn
,
failFn
)
{
language
:
function
(
param
,
successFn
,
failFn
)
{
var
lang
=
'zh-CN'
var
result
=
navigator
.
userAgent
.
match
(
/
(
;|^
)\s
*lang
\s
*:
([^
;
]
*
)
/
)
if
(
result
&&
result
.
length
===
3
)
{
...
...
@@ -301,7 +303,7 @@
language
:
lang
.
toLowerCase
()
})
},
vcard
:
function
(
uids
,
successFn
,
failFn
)
{
vcard
:
function
(
uids
,
successFn
,
failFn
)
{
var
jobNos
=
uids
||
[]
if
(
!
jobNos
.
length
)
{
failFn
(
'未检测到要打开人员的openId!'
)
...
...
@@ -309,18 +311,18 @@
}
// 通过工号获取openId,然后用openId打开人员详情页面。
getPersonInfosByJobNo
(
jobNos
)
.
then
(
function
(
personInfos
)
{
.
then
(
function
(
personInfos
)
{
// 打开人员卡片只有一条信息
qing
.
call
(
'personInfo'
,
{
openId
:
personInfos
[
0
].
oId
})
successFn
(
true
)
})
.
catch
(
function
(
e
)
{
.
catch
(
function
(
e
)
{
failFn
(
e
)
})
},
openUrl
:
function
(
params
,
successFn
,
failFn
)
{
openUrl
:
function
(
params
,
successFn
,
failFn
)
{
// params的第一个参数是要打开的url
var
url
=
(
params
||
[])[
0
]
// 第二个参数是打开url的参数
...
...
@@ -334,7 +336,7 @@
var
fnName
=
_p
.
H5CallBackFunction
.
replace
(
'()'
,
''
)
var
fn
=
window
[
fnName
]
if
(
fn
&&
(
typeof
fn
===
'function'
))
{
qing
.
on
(
'appear'
,
function
()
{
qing
.
on
(
'appear'
,
function
()
{
fn
()
})
}
...
...
@@ -343,7 +345,7 @@
urlParam
:
url
})
},
showWidget
:
function
(
params
,
successFn
,
failFn
)
{
showWidget
:
function
(
params
,
successFn
,
failFn
)
{
if
(
!
Array
.
isArray
(
params
)
||
!
params
[
0
])
{
failFn
(
'未检测到要打开的应用地址!'
)
return
...
...
@@ -355,27 +357,29 @@
return
}
var
data
=
params
[
1
]
||
''
console
.
log
(
'showWidget>>'
,
{
appName
,
appId
,
data
})
openAppWithData
(
encodeURIComponent
(
appName
),
data
,
'cloudhub://miniapp?appid='
+
appId
+
'&path=index.html'
).
then
(
successFn
,
failFn
)
},
getExtra
:
function
(
params
,
successFn
,
failFn
)
{
getExtra
:
function
(
params
,
successFn
,
failFn
)
{
if
(
Array
.
isArray
(
params
))
{
var
appName
=
params
[
0
]
if
(
appName
)
{
qing
.
call
(
'storage.getItem'
,
{
key
:
encodeURIComponent
(
appName
),
shared
:
true
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
String
(
res
.
success
).
toLowerCase
()
===
'true'
)
{
try
{
var
data
=
(
res
.
data
||
{}).
value
||
''
data
=
decodeURIComponent
(
data
)
if
(
data
)
{
// IOS有个奇葩的设计,把双引号转单引号输出了,所以需要将单引号,双引号在保存前特殊处理,然后再还原。
data
=
data
.
replace
(
/∆∆/gm
,
"'"
).
replace
(
/åå/gm
,
'"'
)
data
=
data
.
replace
(
/∆∆/gm
,
'\''
).
replace
(
/åå/gm
,
'"'
)
// 将json数据反编译回object
if
(
data
.
indexOf
(
'__json__='
)
===
0
)
{
data
=
data
.
replace
(
/^__json__=/
,
''
)
...
...
@@ -410,14 +414,14 @@
}
},
MIDEAUSER
:
{
orgChoose
:
function
(
p
,
successFn
,
failFn
)
{
orgChoose
:
function
(
p
,
successFn
,
failFn
)
{
selectPersons
([],
false
,
successFn
,
failFn
)
},
orgMuChoose
:
function
(
selected
,
successFn
,
failFn
)
{
orgMuChoose
:
function
(
selected
,
successFn
,
failFn
)
{
selectPersons
(
selected
,
true
,
successFn
,
failFn
)
},
getUser
:
function
(
param
,
successFn
,
failFn
)
{
getCurrentUserInfo
(
function
(
result
)
{
getUser
:
function
(
param
,
successFn
,
failFn
)
{
getCurrentUserInfo
(
function
(
result
)
{
var
success
=
(
result
||
{}).
success
var
error
=
(
result
||
{}).
error
var
data
=
(
result
||
{}).
data
||
{}
...
...
@@ -439,12 +443,12 @@
})
})
},
getUserPassword
:
function
(
param
,
successFn
,
failFn
)
{
getUserPassword
:
function
(
param
,
successFn
,
failFn
)
{
successFn
({})
}
},
MIDEAPDF
:
{
showTxt
:
function
(
param
,
successFn
,
failFn
)
{
showTxt
:
function
(
param
,
successFn
,
failFn
)
{
var
p
=
param
||
{}
if
(
!
p
.
url
)
{
failFn
(
'未检测到要打开文件的url!'
)
...
...
@@ -471,7 +475,7 @@
}
qing
.
call
(
'showFile'
,
qingParam
)
},
showPdf
:
function
(
urls
,
successFn
,
failFn
)
{
showPdf
:
function
(
urls
,
successFn
,
failFn
)
{
var
u
=
urls
||
[]
if
(
!
u
.
length
)
{
failFn
(
'未检测到要打开文件的url!'
)
...
...
@@ -484,11 +488,12 @@
error
:
failFn
})
},
showRAR
:
function
()
{}
showRAR
:
function
()
{
}
}
}
global
.
cordova
=
{
exec
:
function
(
successFn
,
failFn
,
module
,
method
,
params
)
{
exec
:
function
(
successFn
,
failFn
,
module
,
method
,
params
)
{
params
=
params
||
[]
console
.
warn
(
'cordova-module:'
+
module
+
', method:'
+
method
)
var
modules
=
handlers
[
module
.
toUpperCase
()]
...
...
@@ -517,13 +522,13 @@
// }
global
.
navigator
.
camera
=
{
getPicture
:
function
(
successFn
,
failFn
,
params
)
{
getPicture
:
function
(
successFn
,
failFn
,
params
)
{
var
sourceType
=
params
.
sourceType
||
1
var
opt
=
{
type
:
sourceType
===
1
?
'camera'
:
'photo'
}
qingPromise
(
'selectPic'
,
opt
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
var
success
=
(
result
||
{}).
success
||
false
var
data
=
(
result
||
{}).
data
||
{}
var
error
=
(
result
||
{}).
error
||
'获取图片信息失败!'
...
...
@@ -533,7 +538,7 @@
failFn
(
error
)
}
})
.
catch
(
function
(
e
)
{
.
catch
(
function
(
e
)
{
failFn
(
e
)
})
}
...
...
src/shared/store/modules/prove.js
View file @
bcc905cb
...
...
@@ -254,9 +254,11 @@ export default {
}
})
.
catch
(
err
=>
{
console
.
log
(
'报错了1>>'
,
err
)
commit
(
'networkError'
,
err
,
{
root
:
true
})
})
}
catch
(
error
)
{
console
.
log
(
'报错了2>>'
,
err
)
commit
(
'networkError'
,
error
,
{
root
:
true
})
}
},
...
...
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