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
8ea9ef00
Commit
8ea9ef00
authored
Jun 05, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改页面
parent
b9439f0f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
53 deletions
+88
-53
index.vue
components/auth/index.vue
+62
-34
index.vue
components/userbox/index.vue
+2
-2
address.vue
pages/address/address.vue
+4
-3
balance.vue
pages/balance/balance.vue
+3
-3
favorite.vue
pages/favorite/favorite.vue
+2
-2
index.vue
pages/foot/index/index.vue
+3
-3
index.vue
pages/share/index/index.vue
+4
-3
user-center.vue
pages/user-center/user-center.vue
+8
-3
No files found.
components/auth/index.vue
View file @
8ea9ef00
...
...
@@ -19,23 +19,15 @@ export default {
};
},
created
()
{
this
.
pageinfo
=
uni
.
getStorageSync
(
"basedata"
)
?
uni
.
getStorageSync
(
"basedata"
).
auth_page
:
{};
this
.
pageinfo
=
uni
.
getStorageSync
(
'basedata'
)
?
uni
.
getStorageSync
(
'basedata'
).
auth_page
:
{};
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;`
;
console
.
log
(
this
.
sureStyle
,
'this.sureStyle'
);
this
.
cancelStyle
=
`height:
${
y
.
height
}
rpx;width:
${
y
.
width
}
rpx;left:
${
y
.
left
}
rpx;top:
${
y
.
top
}
rpx;`
;
},
methods
:
{
getUserInfo
(
e
)
{
// if(e.mp.detail.userInfo){
// // TODO 实现用户登录
// uni.setStorageSync("userinfo", e.mp.detail.userInfo);
// this.$emit('changeuserinfo');
// }
var
that
=
this
;
var
that
=
this
;
uni
.
getProvider
({
service
:
'oauth'
,
success
:
function
(
res
)
{
...
...
@@ -43,33 +35,21 @@ export default {
uni
.
login
({
provider
:
'weixin'
,
success
:
res
=>
{
that
.
authorization
=
res
.
code
;
uni
.
getUserInfo
({
provider
:
'weixin'
,
success
:
info
=>
{
//这里请求接口
var
OpenId
=
'ow_7I5XC1-RGwwk8QANBmWKYKmOc'
console
.
log
(
res
,
'请求222'
);
console
.
log
(
info
,
'info'
);
that
.
request2
(
{
url
:
'/api/AppletLogin/Login'
,
data
:
{
Source
:
1
,
OpenId
:
OpenId
,
Name
:
'^O^ 做个好梦^O^'
,
Photo
:
'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLnsYM6ibJ4QzJqibNy4WudZy1HEhia3oIzXFhaGjUHZicDtNZeavGyxkP02ib2LVicpwDC4U7PZUZH6GuA/132'
,
Moblie
:
''
,
SuperiorId
:
0
}
},
res
=>
{
console
.
log
(
res
,
'登录了'
);
if
(
res
.
resultCode
==
1
){
uni
.
setStorageSync
(
"mall_UserInfo"
,
res
.
data
);
that
.
$emit
(
'changeuserinfo'
);
}
}
);
let
obj
=
{
Source
:
1
,
OpenId
:
''
,
Name
:
info
.
userInfo
.
nickName
,
Photo
:
info
.
userInfo
.
avatarUrl
,
Moblie
:
''
,
SuperiorId
:
0
,
code
:
res
.
code
};
that
.
getCode
(
obj
);
},
fail
:
()
=>
{
uni
.
showToast
({
title
:
'微信登录授权失败'
,
icon
:
'none'
});
...
...
@@ -90,7 +70,55 @@ export default {
});
},
close
()
{
this
.
showDialog
=
false
;
this
.
$emit
(
'gbAuth'
);
},
//调用获取code
getCode
(
obj
)
{
var
that
=
this
;
uni
.
getUserInfo
({
provider
:
'weixin'
,
success
:
info
=>
{
//这里请求接口
var
OpenId
=
''
;
that
.
request2
(
{
url
:
'/api/mall/GetWeChatOpenId'
,
data
:
{
Code
:
obj
.
code
}
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
obj
.
OpenId
=
res
.
data
;
that
.
getLogin
(
obj
);
}
}
);
}
});
},
//登录
getLogin
(
obj
)
{
var
that
=
this
;
that
.
request2
(
{
url
:
'/api/AppletLogin/Login'
,
data
:
{
Source
:
1
,
OpenId
:
obj
.
OpenId
,
Name
:
obj
.
nickName
,
Photo
:
obj
.
avatarUrl
,
Moblie
:
''
,
SuperiorId
:
0
}
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
uni
.
setStorageSync
(
'mall_UserInfo'
,
res
.
data
);
that
.
$emit
(
'changeuserinfo'
);
}
}
);
}
}
};
...
...
components/userbox/index.vue
View file @
8ea9ef00
...
...
@@ -22,7 +22,7 @@ export default {
};
},
created
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -33,7 +33,7 @@ export default {
},
methods
:
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
}
}
...
...
pages/address/address.vue
View file @
8ea9ef00
...
...
@@ -60,7 +60,7 @@
@
confirm=
"confirm"
></u-modal>
<u-toast
ref=
"uToast"
/>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
</view>
</
template
>
...
...
@@ -111,7 +111,7 @@ export default {
});
},
onLoad
()
{
this
.
u
=
wx
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
wx
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -142,7 +142,8 @@ export default {
);
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
init
();
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
this
.
showAuth
=
false
;
},
isdefault
(
item
)
{
...
...
pages/balance/balance.vue
View file @
8ea9ef00
...
...
@@ -46,7 +46,7 @@
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
<view
class=
"loading"
v-if=
"load"
>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
...
...
@@ -90,7 +90,7 @@
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -114,7 +114,7 @@
},
methods
:
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
},
balancedata
(){
...
...
pages/favorite/favorite.vue
View file @
8ea9ef00
...
...
@@ -103,7 +103,7 @@
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -166,7 +166,7 @@
);
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
},
clickHandler
(
url
)
{
...
...
pages/foot/index/index.vue
View file @
8ea9ef00
...
...
@@ -72,7 +72,7 @@
</scroll-view>
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
<view
class=
"loading"
v-show=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
...
...
@@ -192,7 +192,7 @@
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -270,7 +270,7 @@
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
},
change
(
index
)
{
...
...
pages/share/index/index.vue
View file @
8ea9ef00
...
...
@@ -89,7 +89,7 @@
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
</view>
</
template
>
...
...
@@ -110,6 +110,7 @@
sharemenus
:{},
orderdata
:{},
bg_img
:
''
,
showAuth
:
false
}
},
created
(){
...
...
@@ -142,7 +143,7 @@
});
},
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
"未登录"
,
...
...
@@ -153,7 +154,7 @@
},
methods
:
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
},
init
(){
...
...
pages/user-center/user-center.vue
View file @
8ea9ef00
...
...
@@ -92,9 +92,7 @@
<Text
style=
"margin-top: 10rpx;"
>
{{
meueData
.
user_center
.
copyright
.
description
}}
</Text>
</view>
</view>
<!-- v-if="showAuth" -->
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<tabbars></tabbars>
</view>
</
template
>
...
...
@@ -159,6 +157,9 @@ export default {
});
this
.
userinfo
();
},
onShow
()
{
this
.
userinfo
();
},
methods
:
{
goHome
()
{
uni
.
redirectTo
({
url
:
'/pages/index/main'
});
...
...
@@ -193,6 +194,10 @@ export default {
if
((
name
&&
name
.
nickname
==
''
)
||!
name
||
!
name
.
nickname
)
{
this
.
showAuth
=
true
;
}
},
//关闭登录窗口
gbAuth
(){
this
.
showAuth
=
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