Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
750e677f
Commit
750e677f
authored
Apr 16, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
616b7926
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
3 deletions
+46
-3
index.vue
components/auth/index.vue
+46
-3
No files found.
components/auth/index.vue
View file @
750e677f
...
...
@@ -2,8 +2,8 @@
<div
class=
"auth-page"
>
<u-popup
v-model=
"showDialog"
mode=
"center"
:mask-close-able=
"false"
custom-style=
"padding:0;background:none;"
>
<img
:src=
"pageinfo.pic_url"
mode=
"widthFix"
/>
<
!--
<button
:style=
"sureStyle"
class=
"hotsopt"
open-type=
"getUserInfo"
@
getuserinfo=
"showLogin==true?getUserInfo():''"
></button>
--
>
<button
:style=
"sureStyle"
class=
"hotsopt"
@
tap=
"showLogin==true?getUserProfile():''"
></button>
<
button
:style=
"sureStyle"
class=
"hotsopt"
open-type=
"getUserInfo"
v-if=
"canIUseGetUserProfile == false"
@
getuserinfo=
"showLogin==true?getoldUser():''"
></button
>
<button
:style=
"sureStyle"
class=
"hotsopt"
v-if=
"canIUseGetUserProfile == true"
@
tap=
"showLogin==true?getUserProfile():''"
></button>
<button
:style=
"cancelStyle"
class=
"hotsopt"
@
click=
"close"
></button>
</u-popup>
<coupon
v-if=
"showCoupons"
:coupon-message=
"couponMessage"
:cform=
"ComeFrom"
@
goLook=
"goLook"
@
closeBtn=
"closeBtn"
></coupon>
...
...
@@ -26,23 +26,52 @@
couponMessage
:
''
,
ComeFrom
:
''
,
showLogin
:
true
,
canIUseGetUserProfile
:
false
,
msg
:{}
};
},
created
()
{
this
.
pageinfo
=
uni
.
getStorageSync
(
'basedata'
)
?
uni
.
getStorageSync
(
'basedata'
).
auth_page
:
{};
if
(
wx
.
getUserProfile
)
{
console
.
log
(
'进入新的'
)
this
.
canIUseGetUserProfile
=
true
}
let
x
=
this
.
pageinfo
.
hotspot
;
let
y
=
this
.
pageinfo
.
hotspot_cancel
;
this
.
sureStyle
=
`height:
${
x
.
height
}
rpx;width:
${
x
.
width
}
rpx;left:
${
x
.
left
}
rpx;top:
${
x
.
top
}
rpx;`
;
this
.
cancelStyle
=
`height:
${
y
.
height
}
rpx;width:
${
y
.
width
}
rpx;left:
${
y
.
left
}
rpx;top:
${
y
.
top
}
rpx;`
;
},
methods
:
{
getUserProfile
(){
getoldUser
(){
//旧的 兼容电脑端
var
that
=
this
;
uni
.
login
({
provider
:
'weixin'
,
success
:
function
(
loginRes
)
{
console
.
log
(
loginRes
.
authResult
);
// 获取用户信息
uni
.
getUserInfo
({
provider
:
'weixin'
,
success
:
function
(
infoRes
)
{
console
.
log
(
infoRes
,
'infoRes'
)
that
.
getUserInfo
(
infoRes
)
}
});
}
});
},
getUserProfile
(){
//新的获取用户资料
var
that
=
this
;
wx
.
getUserProfile
({
desc
:
'用于完善资料'
,
// 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success
:
info
=>
{
console
.
log
(
info
.
userInfo
)
this
.
msg
=
{
Id
:
0
,
AliasName
:
info
.
userInfo
.
nickName
,
Photo
:
info
.
userInfo
.
avatarUrl
,
};
that
.
getUserInfo
(
info
)
},
fail
:
()
=>
{
uni
.
showToast
({
...
...
@@ -161,11 +190,25 @@
uni
.
removeStorageSync
(
"Up"
);
uni
.
removeStorageSync
(
"CounponPassword"
);
uni
.
removeStorageSync
(
"KeyWord"
);
let
uid
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserId
;
that
.
msg
.
Id
=
uid
that
.
updateuserinfo
(
that
.
msg
);
//更新用户头像
}
}
);
},
updateuserinfo
(
msg
)
{
this
.
request2
({
url
:
"/api/MemberUser/SetMemberPhoto"
,
data
:
msg
,
},
(
res
)
=>
{
//静默处理不做任何提示
},
(
error
)
=>
{}
);
},
goLook
()
{
this
.
showCoupons
=
false
;
},
...
...
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