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
7b5f1cf6
Commit
7b5f1cf6
authored
Jun 05, 2020
by
zhangjianguo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/mallapp
parents
ad059e61
8ea9ef00
Show 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 @
7b5f1cf6
...
@@ -19,23 +19,15 @@ export default {
...
@@ -19,23 +19,15 @@ export default {
};
};
},
},
created
()
{
created
()
{
this
.
pageinfo
=
uni
.
getStorageSync
(
"basedata"
)
this
.
pageinfo
=
uni
.
getStorageSync
(
'basedata'
)
?
uni
.
getStorageSync
(
'basedata'
).
auth_page
:
{};
?
uni
.
getStorageSync
(
"basedata"
).
auth_page
:
{};
let
x
=
this
.
pageinfo
.
hotspot
;
let
x
=
this
.
pageinfo
.
hotspot
;
let
y
=
this
.
pageinfo
.
hotspot_cancel
;
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
.
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;`
;
this
.
cancelStyle
=
`height:
${
y
.
height
}
rpx;width:
${
y
.
width
}
rpx;left:
${
y
.
left
}
rpx;top:
${
y
.
top
}
rpx;`
;
},
},
methods
:
{
methods
:
{
getUserInfo
(
e
)
{
getUserInfo
(
e
)
{
// if(e.mp.detail.userInfo){
var
that
=
this
;
// // TODO 实现用户登录
// uni.setStorageSync("userinfo", e.mp.detail.userInfo);
// this.$emit('changeuserinfo');
// }
var
that
=
this
;
uni
.
getProvider
({
uni
.
getProvider
({
service
:
'oauth'
,
service
:
'oauth'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
@@ -43,33 +35,21 @@ export default {
...
@@ -43,33 +35,21 @@ export default {
uni
.
login
({
uni
.
login
({
provider
:
'weixin'
,
provider
:
'weixin'
,
success
:
res
=>
{
success
:
res
=>
{
that
.
authorization
=
res
.
code
;
uni
.
getUserInfo
({
uni
.
getUserInfo
({
provider
:
'weixin'
,
provider
:
'weixin'
,
success
:
info
=>
{
success
:
info
=>
{
//这里请求接口
//这里请求接口
var
OpenId
=
'ow_7I5XC1-RGwwk8QANBmWKYKmOc'
let
obj
=
{
console
.
log
(
res
,
'请求222'
);
Source
:
1
,
console
.
log
(
info
,
'info'
);
OpenId
:
''
,
that
.
request2
(
Name
:
info
.
userInfo
.
nickName
,
{
Photo
:
info
.
userInfo
.
avatarUrl
,
url
:
'/api/AppletLogin/Login'
,
Moblie
:
''
,
data
:
{
SuperiorId
:
0
,
Source
:
1
,
code
:
res
.
code
OpenId
:
OpenId
,
};
Name
:
'^O^ 做个好梦^O^'
,
that
.
getCode
(
obj
);
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'
);
}
}
);
},
},
fail
:
()
=>
{
fail
:
()
=>
{
uni
.
showToast
({
title
:
'微信登录授权失败'
,
icon
:
'none'
});
uni
.
showToast
({
title
:
'微信登录授权失败'
,
icon
:
'none'
});
...
@@ -90,7 +70,55 @@ export default {
...
@@ -90,7 +70,55 @@ export default {
});
});
},
},
close
()
{
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 @
7b5f1cf6
...
@@ -22,7 +22,7 @@ export default {
...
@@ -22,7 +22,7 @@ export default {
};
};
},
},
created
()
{
created
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -33,7 +33,7 @@ export default {
...
@@ -33,7 +33,7 @@ export default {
},
},
methods
:
{
methods
:
{
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
this
.
showAuth
=
false
}
}
}
}
...
...
pages/address/address.vue
View file @
7b5f1cf6
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
@
confirm=
"confirm"
@
confirm=
"confirm"
></u-modal>
></u-modal>
<u-toast
ref=
"uToast"
/>
<u-toast
ref=
"uToast"
/>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
</view>
</view>
</
template
>
</
template
>
...
@@ -111,7 +111,7 @@ export default {
...
@@ -111,7 +111,7 @@ export default {
});
});
},
},
onLoad
()
{
onLoad
()
{
this
.
u
=
wx
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
wx
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -142,7 +142,8 @@ export default {
...
@@ -142,7 +142,8 @@ export default {
);
);
},
},
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"userinfo"
);
this
.
init
();
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
this
.
showAuth
=
false
;
this
.
showAuth
=
false
;
},
},
isdefault
(
item
)
{
isdefault
(
item
)
{
...
...
pages/balance/balance.vue
View file @
7b5f1cf6
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
</view>
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
<view
class=
"loading"
v-if=
"load"
>
<view
class=
"loading"
v-if=
"load"
>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
});
});
},
},
onLoad
(){
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
},
},
methods
:
{
methods
:
{
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
this
.
showAuth
=
false
},
},
balancedata
(){
balancedata
(){
...
...
pages/favorite/favorite.vue
View file @
7b5f1cf6
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
});
});
},
},
onLoad
(){
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
},
},
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
this
.
showAuth
=
false
},
},
clickHandler
(
cx
)
{
clickHandler
(
cx
)
{
...
...
pages/foot/index/index.vue
View file @
7b5f1cf6
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
</scroll-view>
</scroll-view>
</view>
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
<view
class=
"loading"
v-show=
"loading"
>
<view
class=
"loading"
v-show=
"loading"
>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<u-loading
mode=
"flower"
size=
"48"
></u-loading>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
<Text
style=
'color: #fff;margin-top: 10rpx;'
>
加载中...
</Text>
...
@@ -202,7 +202,7 @@
...
@@ -202,7 +202,7 @@
});
});
},
},
onLoad
(){
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -249,7 +249,7 @@
...
@@ -249,7 +249,7 @@
}
}
},
},
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
this
.
showAuth
=
false
},
},
change
(
index
)
{
change
(
index
)
{
...
...
pages/share/index/index.vue
View file @
7b5f1cf6
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
</view>
</view>
<
!--
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
--
>
<
auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth
>
</view>
</view>
</
template
>
</
template
>
...
@@ -110,6 +110,7 @@
...
@@ -110,6 +110,7 @@
sharemenus
:{},
sharemenus
:{},
orderdata
:{},
orderdata
:{},
bg_img
:
''
,
bg_img
:
''
,
showAuth
:
false
}
}
},
},
created
(){
created
(){
...
@@ -142,7 +143,7 @@
...
@@ -142,7 +143,7 @@
});
});
},
},
onLoad
(){
onLoad
(){
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
"未登录"
,
nickName
:
"未登录"
,
...
@@ -153,7 +154,7 @@
...
@@ -153,7 +154,7 @@
},
},
methods
:
{
methods
:
{
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
"
useri
nfo"
);
this
.
u
=
uni
.
getStorageSync
(
"
mall_UserI
nfo"
);
this
.
showAuth
=
false
this
.
showAuth
=
false
},
},
init
(){
init
(){
...
...
pages/user-center/user-center.vue
View file @
7b5f1cf6
...
@@ -92,9 +92,7 @@
...
@@ -92,9 +92,7 @@
<Text
style=
"margin-top: 10rpx;"
>
{{
meueData
.
user_center
.
copyright
.
description
}}
</Text>
<Text
style=
"margin-top: 10rpx;"
>
{{
meueData
.
user_center
.
copyright
.
description
}}
</Text>
</view>
</view>
</view>
</view>
<!-- v-if="showAuth" -->
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
></auth>
<tabbars></tabbars>
<tabbars></tabbars>
</view>
</view>
</
template
>
</
template
>
...
@@ -159,6 +157,9 @@ export default {
...
@@ -159,6 +157,9 @@ export default {
});
});
this
.
userinfo
();
this
.
userinfo
();
},
},
onShow
()
{
this
.
userinfo
();
},
methods
:
{
methods
:
{
goHome
()
{
goHome
()
{
uni
.
redirectTo
({
url
:
'/pages/index/main'
});
uni
.
redirectTo
({
url
:
'/pages/index/main'
});
...
@@ -193,6 +194,10 @@ export default {
...
@@ -193,6 +194,10 @@ export default {
if
((
name
&&
name
.
nickname
==
''
)
||!
name
||
!
name
.
nickname
)
{
if
((
name
&&
name
.
nickname
==
''
)
||!
name
||
!
name
.
nickname
)
{
this
.
showAuth
=
true
;
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