Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
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
zhengke
jz_Travel
Commits
443e3190
Commit
443e3190
authored
Mar 04, 2025
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增内部员工绑定
parent
544e4096
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
256 additions
and
0 deletions
+256
-0
index.vue
components/auth/index.vue
+2
-0
pages.json
pages.json
+7
-0
user-bind-erp.vue
pages/user-center/user-bind-erp.vue
+247
-0
No files found.
components/auth/index.vue
View file @
443e3190
...
...
@@ -208,6 +208,7 @@
if
(
uni
.
getStorageSync
(
'direct_user_id'
)){
Pid
=
uni
.
getStorageSync
(
'direct_user_id'
)
if
(
isNaN
(
Pid
))
Pid
=
0
uni
.
removeStorageSync
(
'direct_user_id'
)
}
const
parameters
=
{
OpenId
,
...
...
@@ -234,6 +235,7 @@
contactNumber
:
u
.
moblie
,
salesBaseInfo
:
u
.
salesBaseInfo
,
pid
:
u
.
pid
,
erpBaseInfo
:
u
.
erpBaseInfo
,
count
:
0
,
customerType
:
1
,
//直客,2-同行
directCustomerId
:
u
.
directCustomerId
//直客Id
...
...
pages.json
View file @
443e3190
...
...
@@ -108,6 +108,13 @@
{
"navigationBarTitleText"
:
"用户资料"
}
},
{
"path"
:
"user-bind-erp"
,
"style"
:
{
"navigationBarTitleText"
:
"员工账号绑定"
}
}
]
},
...
...
pages/user-center/user-bind-erp.vue
0 → 100644
View file @
443e3190
<
template
>
<view
class=
"user-bind-erp column items-center"
>
<view
class=
"row items-center"
style=
"margin-top: 5vh;"
v-if=
"!user.erpBaseInfo"
>
<image
class=
"logo"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766970838521511.jpeg"
mode=
"widthFix"
></image>
<u-icon
class=
"q-ml-md q-mr-md"
name=
"wangfan1"
custom-prefix=
"tffont"
color=
"#00000066"
size=
"36"
></u-icon>
<image
class=
"logo"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766970838511899.png"
mode=
"widthFix"
></image>
</view>
<view
class=
"login-form"
v-if=
"!user.erpBaseInfo"
>
<view
class=
"login-title"
>
绑定员工账号
</view>
<view
class=
"login-item"
>
<input
type=
"text"
v-model=
"model.account"
placeholder=
"请输入ERP员工账号"
:class=
"
{'focus':currentFocus=='account'}" @blur="changeCurrentFocus('')"
@focus="changeCurrentFocus('account')">
</view>
<view
class=
"login-item"
>
<input
type=
"password"
v-model=
"model.password"
placeholder=
"请输入ERP员工密码"
:class=
"
{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')"
@focus="changeCurrentFocus('pwd')">
</view>
<view
class=
"login-item"
>
<view
@
click=
"bindErpAccountHandle"
class=
"login-btn"
>
绑定
</view>
</view>
</view>
<view
class=
"login-form"
style=
"margin-top: 5vh;"
v-else=
"user.erpBaseInfo"
>
<view
class=
"login-title"
>
当前账号已绑定
</view>
<view
class=
"q-mt-sm card row items-center"
>
<image
class=
"avatar"
:src=
"user.erpBaseInfo.icon?user.erpBaseInfo.icon:defaultIcon"
></image>
<view
class=
"q-ml-md"
>
<view
style=
"line-height: 1; font-size: 28rpx; font-weight: bold;"
>
{{
user
.
erpBaseInfo
.
emName
}}
</view>
<view
class=
"q-mt-sm num row items-center"
>
<text
style=
"padding: 6rpx;"
class=
"text-center"
>
{{
user
.
erpBaseInfo
.
branchName
}}
</text>
<text
class=
"text-center"
style=
"padding:6rpx;color:#fff;background-color: #B99846;"
>
{{
user
.
erpBaseInfo
.
departName
}}
</text>
</view>
</view>
</view>
<view
class=
"q-mt-md"
>
<u-alert-tips
type=
"error"
description=
"已绑定的账号暂时不支持自行解绑"
></u-alert-tips>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
model
:{
account
:
''
,
password
:
''
},
user
:{},
mall
:{},
currentFocus
:
''
,
defaultIcon
:
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695262844000_280.png'
}
},
onLoad
()
{
// #ifdef MP-AG
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
// #endif
if
(
uni
.
getStorageSync
(
'b2b_user'
)
&&
uni
.
getStorageSync
(
'mall_UserInfo'
)){
this
.
user
=
uni
.
getStorageSync
(
'b2b_user'
)
this
.
mall
=
uni
.
getStorageSync
(
'mall_UserInfo'
)
}
else
{
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
}
},
methods
:
{
changeCurrentFocus
(
val
)
{
this
.
currentFocus
=
val
},
directUserLoginHandle
(){
let
Pid
=
0
if
(
uni
.
getStorageSync
(
'direct_user_id'
)){
Pid
=
uni
.
getStorageSync
(
'direct_user_id'
)
if
(
isNaN
(
Pid
))
Pid
=
0
uni
.
removeStorageSync
(
'direct_user_id'
)
}
const
{
OpenId
,
Unoinid
}
=
this
.
mall
const
parameters
=
{
OpenId
,
Unoinid
,
Pid
}
this
.
apipost
(
"HePingGuoLvLogin_post"
,
parameters
,
r
=>
{
const
u
=
r
.
data
const
user
=
{
accountId
:
u
.
directCustomerId
,
customerId
:
u
.
directCustomerId
,
customerInfoChildrenId
:
u
.
directCustomerId
,
realNameAuthentication
:
0
,
account
:
""
,
name
:
u
.
name
,
customerName
:
this
.
user
.
name
,
photo
:
u
.
photo
,
secretKey
:
""
,
token
:
u
.
token
,
groupId
:
0
,
isMember
:
0
,
createBy
:
u
.
pid
,
EmLoginMobile
:
u
.
moblie
,
contactNumber
:
u
.
moblie
,
salesBaseInfo
:
u
.
salesBaseInfo
,
pid
:
u
.
pid
,
erpBaseInfo
:
u
.
erpBaseInfo
,
count
:
0
,
customerType
:
1
,
//直客,2-同行
directCustomerId
:
u
.
directCustomerId
//直客Id
}
uni
.
setStorageSync
(
'b2b_user'
,
user
)
this
.
user
=
user
uni
.
setStorageSync
(
"lastLogin"
,
new
Date
().
getTime
())
uni
.
hideLoading
()
})
},
bindErpAccountHandle
(){
if
(
this
.
model
.
account
==
''
||
this
.
model
.
password
==
''
){
uni
.
showToast
({
icon
:
'none'
,
title
:
'请完善登录信息'
})
return
}
uni
.
showLoading
({
title
:
'正在验证用户信息'
})
const
mall
=
uni
.
getStorageSync
(
'mall_UserInfo'
)
const
parameters
=
{
EmAccount
:
this
.
model
.
account
,
EmPassword
:
this
.
model
.
password
,
Unoinid
:
this
.
mall
.
Unoinid
}
this
.
apipost
(
"HPSLBindEmp_post"
,
parameters
,
r
=>
{
if
(
r
.
resultCode
==
1
){
this
.
directUserLoginHandle
()
return
;
}
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'账号或密码错误'
})
},
e
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
e
})
})
}
}
}
</
script
>
<
style
>
@import
url('../../asset/css/flex.css')
;
.user-bind-erp
{
height
:
100vh
;
}
.user-bind-erp
.bind-title
{
font-size
:
36
rpx
;
font-weight
:
bold
;
color
:
#180000
;
}
.user-bind-erp
.logo
{
width
:
80
rpx
;
height
:
80
rpx
;
border-radius
:
50%
;
}
.user-bind-erp
.login-form
{
margin-top
:
50px
;
padding
:
20px
;
width
:
80vw
;
}
.user-bind-erp
.card
{
background-color
:
#FFF
;
box-shadow
:
0
0
20
rpx
#00000014
;
padding
:
30
rpx
;
border-radius
:
16
rpx
;
}
.user-bind-erp
.card
.num
{
border-radius
:
7
rpx
;
background-color
:
#100000
;
font-size
:
22
rpx
;
font-weight
:
400
;
color
:
#f1f2f4
;
overflow
:
hidden
;
padding
:
0
;
line-height
:
1
;
}
.user-bind-erp
.card
.avatar
{
width
:
80
rpx
;
height
:
80
rpx
;
border-radius
:
16
rpx
;
}
.user-bind-erp
.login-form
.login-title
{
font-size
:
20px
;
font-weight
:
700
;
font-family
:
logo-font
;
margin-bottom
:
30px
;
text-align
:
center
;
}
.user-bind-erp
.login-form
.login-item
{
margin-top
:
30px
;
}
.user-bind-erp
.login-form
.login-item
input
{
background-color
:
rgba
(
0
,
0
,
0
,
.05
);
padding
:
0
12px
;
height
:
46px
;
line-height
:
46px
;
border-radius
:
8px
;
color
:
#1d1d1d
;
font-family
:
nav-font
;
}
.user-bind-erp
.login-form
.login-item
input
.focus
{
background
:
#1d1d1d
;
color
:
#FFF
;
}
.user-bind-erp
.login-form
.login-btn
{
height
:
80
rpx
;
background-color
:
#111111
;
text-align
:
center
;
line-height
:
80
rpx
;
color
:
#fff
;
/* font-weight: 600; */
font-size
:
28
rpx
;
border-radius
:
16
rpx
;
font-family
:
logo-font
;
font-size
:
16px
;
}
.user-bind-erp
.login-form
.login-btn.disable
{
opacity
:
0.5
;
}
</
style
>
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