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
7c0688ca
Commit
7c0688ca
authored
Feb 17, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定
parent
c4979ed0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
13 deletions
+88
-13
bind_Customer.vue
pages/jiuzhai/bind_Customer.vue
+88
-13
No files found.
pages/jiuzhai/bind_Customer.vue
View file @
7c0688ca
...
@@ -7,18 +7,20 @@
...
@@ -7,18 +7,20 @@
</view>
</view>
<view
class=
"login-form"
>
<view
class=
"login-form"
>
<view
class=
"login-title"
>
同行登录
</view>
<view
class=
"login-title"
>
同行登录
</view>
<view
class=
"login-item"
>
<template
v-if=
"!ShareLoginstatus"
>
<input
type=
"text"
v-model=
"msg.account"
placeholder=
"请输入您的同业账号"
:class=
"
{'focus':currentFocus=='account'}" @blur="changeCurrentFocus('')"
<view
class=
"login-item"
>
@focus="changeCurrentFocus('account')">
<input
type=
"text"
v-model=
"msg.account"
placeholder=
"请输入您的同业账号"
:class=
"
{'focus':currentFocus=='account'}" @blur="changeCurrentFocus('')"
</view>
@focus="changeCurrentFocus('account')">
<view
class=
"login-item"
>
</view>
<input
type=
"password"
v-model=
"msg.password"
placeholder=
"请输入您的登录密码"
:class=
"
{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')"
<view
class=
"login-item"
>
@focus="changeCurrentFocus('pwd')">
<input
type=
"password"
v-model=
"msg.password"
placeholder=
"请输入您的登录密码"
:class=
"
{'focus':currentFocus=='pwd'}" @blur="changeCurrentFocus('')"
</view>
@focus="changeCurrentFocus('pwd')">
<view
class=
"login-item"
>
</view>
<view
@
click=
"loginByAccount"
class=
"login-btn"
:class=
"
{'disable':msg.account==''||msg.password==''}">登录
</view>
<view
class=
"login-item"
>
</view>
<view
@
click=
"loginByAccount"
class=
"login-btn"
:class=
"
{'disable':msg.account==''||msg.password==''}">登录
</view>
</view>
</
template
>
</view>
</view>
</view>
</view>
</template>
</template>
...
@@ -33,13 +35,75 @@
...
@@ -33,13 +35,75 @@
OpenId
:
''
OpenId
:
''
},
},
currentFocus
:
''
,
currentFocus
:
''
,
loginLoading
:
false
loginLoading
:
false
,
param
:{
OpenId
:
''
,
//oDGzz5J3qpVo0j_fU8mKxk-G5bcI
id
:
''
,
createBy
:
0
,
},
ShareLoginstatus
:
false
,
}
}
},
},
onLoad
(
option
)
{
if
(
option
&&
option
.
scene
)
{
let
t
=
decodeURIComponent
(
option
.
scene
).
split
(
'&'
)
t
.
forEach
(
x
=>
{
let
item
=
x
.
split
(
'='
)
if
(
item
.
length
===
2
)
{
if
(
item
[
0
]
===
'id'
)
{
this
.
param
.
id
=
item
[
1
]
}
else
if
(
item
[
0
]
===
'createBy'
)
{
this
.
param
.
createBy
=
item
[
1
]
}
}
})
console
.
log
(
this
.
param
,
'------0000'
)
}
},
mounted
()
{
mounted
()
{
// let scene = "id=10507&createBy=5"
// console.log(encodeURIComponent(scene),'------')
this
.
getUserProfileHandler
()
this
.
getUserProfileHandler
()
},
},
methods
:
{
methods
:
{
ShareLogin
()
{
this
.
apipost
(
"b2b_post_LvXiaoYouBindCustomerByCode"
,
this
.
param
,(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
//移除缓存=>跳转到首页重新登录
uni
.
removeStorageSync
(
'b2b_user'
)
uni
.
removeStorageSync
(
'mall_UserInfo'
)
let
tempData
=
res
.
data
;
if
(
tempData
&&
tempData
.
Id
&&
tempData
.
Id
>
0
)
{
if
(
tempData
.
CounponList
){
uni
.
setStorageSync
(
'coupons'
,
tempData
.
CounponList
)
}
else
{
uni
.
setStorageSync
(
'coupons'
,[{
Name
:
tempData
.
CouponsName
,
Num
:
1
}])
}
let
newUrl
=
'/pages/index/index'
;
uni
.
redirectTo
({
url
:
newUrl
})
}
else
{
uni
.
redirectTo
({
url
:
'/pages/index/index'
})
}
}
},(
error
)
=>
{
if
(
error
.
message
==
'当前微信已绑定其他同业!'
){
if
(
uni
.
getStorageSync
(
"mall_UserInfo"
)
||
uni
.
getStorageSync
(
'b2b_user'
)){
let
newUrl
=
'/pages/index/index'
;
uni
.
redirectTo
({
url
:
newUrl
})
}
else
{
this
.
ShareLoginstatus
=
false
}
}
})
},
changeCurrentFocus
(
val
)
{
changeCurrentFocus
(
val
)
{
this
.
currentFocus
=
val
this
.
currentFocus
=
val
},
},
...
@@ -108,6 +172,12 @@
...
@@ -108,6 +172,12 @@
})
})
},
},
getUserProfileHandler
()
{
getUserProfileHandler
()
{
if
(
this
.
param
.
id
&&
this
.
param
.
createBy
){
uni
.
showLoading
({
title
:
'绑定中...'
})
this
.
ShareLoginstatus
=
true
}
wx
.
login
({
wx
.
login
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
this
.
getCode
(
res
)
this
.
getCode
(
res
)
...
@@ -126,6 +196,11 @@
...
@@ -126,6 +196,11 @@
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
if
(
res
.
resultCode
==
1
)
{
this
.
msg
.
OpenId
=
res
.
data
;
this
.
msg
.
OpenId
=
res
.
data
;
if
(
this
.
param
.
id
&&
this
.
param
.
createBy
){
this
.
param
.
OpenId
=
this
.
msg
.
OpenId
this
.
ShareLogin
()
}
}
}
}
}
);
);
...
...
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