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
9a4179f5
Commit
9a4179f5
authored
Sep 21, 2023
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增微信登录
parent
56046388
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
21 deletions
+52
-21
login.vue
pages/jiuzhai/login.vue
+37
-17
user-center.vue
pages/user-center/user-center.vue
+15
-4
No files found.
pages/jiuzhai/login.vue
View file @
9a4179f5
...
...
@@ -13,11 +13,11 @@
<input
type=
"password"
v-model=
"msg.password"
placeholder=
"请输入你的登录密码"
:class=
"
{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')" @focus="changeCurrentFocus('pwd')">
</view>
<view
class=
"login-item"
>
<view
@
click=
"login
ERPHandler
"
class=
"login-btn"
:class=
"
{'disable':msg.account==''||msg.password==''}">立即登录
</view>
<view
@
click=
"login
ByAccount
"
class=
"login-btn"
:class=
"
{'disable':msg.account==''||msg.password==''}">立即登录
</view>
</view>
<u-divider
contentPosition=
"center"
:margin-top=
"60"
:margin-bottom=
"60"
>
其他登录方式
</u-divider>
<view
style=
"text-align: center;"
>
<button
class=
"wechat-login"
>
<button
class=
"wechat-login"
@
click=
"loginByOpenId"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1695266425000_759.png"
mode=
"widthFix"
></image>
</button>
</view>
...
...
@@ -35,7 +35,8 @@
platform
:
3
,
OpenId
:
''
},
currentFocus
:
''
currentFocus
:
''
,
loginLoading
:
false
}
},
mounted
()
{
...
...
@@ -45,22 +46,37 @@
changeCurrentFocus
(
val
){
this
.
currentFocus
=
val
},
login
ERPHandler
(){
login
ByAccount
(){
if
(
this
.
msg
.
account
!=
''
&&
this
.
msg
.
password
!=
''
){
this
.
loginErpHandler
()
}
},
loginByOpenId
(){
if
(
this
.
msg
.
OpenId
!=
''
){
this
.
loginErpHandler
()
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
'获取微信信息失败,请使用账号密码登录'
})
}
},
loginErpHandler
(){
if
(
this
.
loginLoading
)
return
;
this
.
loginLoading
=
true
uni
.
showLoading
({
title
:
'登录中...'
})
this
.
apipost
(
"b2b_post_Login"
,
this
.
msg
,(
res
)
=>
{
//console.log(res)
if
(
res
.
resultCode
==
1
)
{
uni
.
setStorageSync
(
'b2b_user'
,
res
.
data
)
this
.
getLogin
()
}
},(
error
)
=>
{
this
.
loginLoading
=
false
uni
.
hideLoading
()
})
}
},
getUserProfileHandler
(){
wx
.
login
({
...
...
@@ -120,6 +136,7 @@
},
(
res
)
=>
{
uni
.
hideLoading
()
this
.
loginLoading
=
false
if
(
res
.
resultCode
==
1
)
{
uni
.
setStorageSync
(
"mall_UserInfo"
,
res
.
data
);
uni
.
removeStorageSync
(
"pid"
);
...
...
@@ -133,7 +150,10 @@
}
},
(
err
)
=>
{
uni
.
hideLoading
()});
(
err
)
=>
{
uni
.
hideLoading
()
this
.
loginLoading
=
false
});
},
}
}
...
...
pages/user-center/user-center.vue
View file @
9a4179f5
...
...
@@ -88,7 +88,7 @@
"
@
click=
"login(user_info)"
>
{{
b2b_user_info
?
b2b_user_info
.
n
ame
:
"立即登录"
customer_info
?
customer_info
.
customerN
ame
:
"立即登录"
}}
</Text
>
<!-- 判断是甲鹤小程序 -->
...
...
@@ -643,6 +643,7 @@ export default {
isAttestationEdu
:
0
,
//学员是否认证了 0否1是
appid
:
encodeURIComponent
(
JSON
.
stringify
({
appId
:
"2021002181604459"
})),
userId
:
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserId
,
customer_info
:{}
};
},
components
:
{
...
...
@@ -658,7 +659,7 @@ export default {
?
uni
.
getStorageSync
(
"basedata"
).
mall
.
setting
.
mallStyle
.
IsEducation
:
0
:
0
;
this
.
userinfo
();
//
this.userinfo();
this
.
setting
=
uni
.
getStorageSync
(
"basedata"
).
mall
.
setting
;
this
.
isCompany
=
uni
.
getStorageSync
(
"user_type"
)
?
uni
.
getStorageSync
(
"user_type"
)
==
"company"
...
...
@@ -671,6 +672,7 @@ export default {
?
basedata
.
user_info
.
isAttestationEdu
:
0
;
this
.
b2b_user_info
=
uni
.
getStorageSync
(
'b2b_user'
)
this
.
getCustomerInfo
()
},
onLoad
()
{
this
.
navHeight
=
this
.
$navHeight
-
2
;
...
...
@@ -685,7 +687,7 @@ export default {
}
},
mounted
()
{
this
.
getComponyStatus
();
//
this.getComponyStatus();
let
currentPages
=
getCurrentPages
();
let
c
=
this
.
$uiConfig
.
is_bang
?
80
:
52
;
this
.
bottommargin
=
c
+
10
+
"px"
;
...
...
@@ -719,7 +721,7 @@ export default {
onShow
()
{
this
.
userinfo
(
2
);
if
(
this
.
mall_UserInfo
)
{
this
.
getUserPoint
();
//
this.getUserPoint();
}
let
basedata
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
)
...
...
@@ -729,6 +731,15 @@ export default {
:
0
;
},
methods
:
{
getCustomerInfo
(){
if
(
this
.
b2b_user_info
&&
this
.
b2b_user_info
.
token
){
this
.
apipost
(
"b2b_get_GetCustomerManagerInfo"
,{},(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
customer_info
=
res
.
data
}
})
}
},
goHome
()
{
uni
.
redirectTo
({
url
:
"/pages/index/main"
,
...
...
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