Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
fde2768a
Commit
fde2768a
authored
May 28, 2021
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆页面js,html
parent
2627491e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletions
+55
-1
src/api/login.js
+6
-1
src/pages/login/index.vue
+49
-0
No files found.
src/api/login.js
View file @
fde2768a
...
...
@@ -19,6 +19,10 @@ console.log(process.env,'-----------------config------')
// sso登录
getSsoBcakUrl
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/common/getSsoCallbackUrl`
,
options
)
}
},
//获取用户协议
getShopUserProtocol
()
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/getShopUserProtocol`
)
},
}
\ No newline at end of file
src/pages/login/index.vue
View file @
fde2768a
...
...
@@ -24,6 +24,23 @@
</div>
<div
class=
"layer"
@
click=
"isShowPhone = false"
></div>
</div>
<div
class=
"readAgreement"
>
<van-checkbox
:value=
"checked"
@
click=
"checked = !checked"
>
我已阅读并同意
</van-checkbox>
<span
v-if=
"content"
@
click=
"contentShow = true"
>
《用户协议》
</span>
</div>
<van-popup
:show=
"contentShow"
custom-style=
"width:80vw;height:80vh;background:#fff;"
:close-on-click-overlay=
"true"
@
close=
"closeDia"
>
<div
class=
"posterWrap"
>
<div
v-html=
"content"
></div>
</div>
<div
class=
"posterWrap_btn"
>
<div
@
click=
"conF"
>
我已阅读并同意
</div>
</div>
</van-popup>
</div>
</
template
>
...
...
@@ -36,6 +53,9 @@ import indexApi from "@/api/index.js";
export
default
{
data
()
{
return
{
checked
:
false
,
contentShow
:
false
,
content
:
''
,
code
:
""
,
session_key
:
""
,
shopName
:
""
,
...
...
@@ -93,6 +113,12 @@ export default {
});
},
onLoad
(
options
)
{
login
.
getShopUserProtocol
().
then
(
res
=>
{
console
.
log
(
res
,
777888999
)
if
(
res
.
data
.
code
==
'200'
)
{
this
.
content
=
res
.
data
.
data
;
}
});
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
//mpvue 的混合周期 使用小程序生命周期数据未初始化
options
.
scene
&&
(
this
.
scene
=
options
.
scene
);
if
(
options
.
back
)
{
...
...
@@ -107,6 +133,13 @@ export default {
this
.
getshop
();
},
methods
:
{
conF
()
{
this
.
contentShow
=
false
;
this
.
checked
=
true
;
},
closeDia
()
{
this
.
contentShow
=
false
;
},
getshop
()
{
this
.
shopName
=
wx
.
getStorageSync
(
"shopName"
);
this
.
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
...
...
@@ -170,6 +203,17 @@ export default {
}
},
getUserProfile
()
{
if
(
this
.
content
&&!
this
.
checked
)
{
wx
.
showToast
({
title
:
'您还未同意协议'
,
icon
:
"none"
});
return
}
wx
.
showLoading
({
title
:
'登录中...'
,
mask
:
true
})
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
// 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
wx
.
getUserProfile
({
...
...
@@ -213,6 +257,9 @@ export default {
wx
.
showToast
({
title
:
err
,
icon
:
"none"
});
});
},
fail
:
(
e
)
=>
{
wx
.
hideLoading
()
}
});
},
checkLogin
(
e
)
{
...
...
@@ -249,6 +296,7 @@ export default {
}
else
{
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
this
.
addRecord
(
true
);
}
}
...
...
@@ -261,6 +309,7 @@ export default {
wx
.
hideLoading
();
//不是会员需要绑定手机号
this
.
isShowPhone
=
true
;
wx
.
hideLoading
()
this
.
addRecord
(
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