Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
mp
user
Commits
45e25d9d
Commit
45e25d9d
authored
2 years ago
by
weijiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://140.143.224.240:8100/hooloo/mp/user
parents
ce63e9bd
b7f497cd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
8 deletions
+48
-8
pages/mine/mine.vue
+35
-4
request/mine/index.js
+10
-0
request/user/index.js
+3
-4
No files found.
pages/mine/mine.vue
View file @
45e25d9d
...
...
@@ -39,7 +39,8 @@
<h3>
我的消息
</h3>
<view
class=
"dec"
>
点击查看我的消息
</view>
</view>
<view
@
click=
"goToPage('msg')"
class=
"right"
>
<view
@
click=
"goToPage('msg')"
class=
"right msg"
>
<div
class=
"unread_number"
v-if=
"UnreadNumber"
>
{{
UnreadNumber
}}
</div>
<image
class=
"right_img"
src=
"../../static/imgs/myMail.png"
></image>
</view>
</view>
...
...
@@ -59,6 +60,7 @@
<
script
>
import
User
from
'@/request/user'
import
Mine
from
'@/request/mine'
export
default
{
onLoad
()
{
...
...
@@ -68,9 +70,15 @@ export default {
})
}
},
onShow
()
{
if
(
this
.
userms
){
this
.
getMessageCount
()
}
},
data
()
{
return
{
loginInfo
:
""
loginInfo
:
""
,
UnreadNumber
:
""
}
},
computed
:
{
...
...
@@ -86,19 +94,24 @@ export default {
getPhoneNumber
(
e
)
{
if
(
e
.
detail
.
errMsg
==
'getPhoneNumber:ok'
)
{
e
.
loginInfo
=
this
.
loginInfo
User
.
getPhoneNumber
(
e
);
User
.
getPhoneNumber
(
e
,
this
.
getMessageCount
);
}
else
if
(
e
.
detail
.
errMsg
==
"getPhoneNumber:fail user deny"
)
{
uni
.
showToast
({
title
:
'已拒绝手机号授权'
,
icon
:
'error'
})
}
},
goToPage
(
page
)
{
if
(
!
this
.
userms
)
{
this
.
loginBy
PhoneNumber
(
page
)
this
.
get
PhoneNumber
(
page
)
return
}
page
==
'order'
&&
uni
.
switchTab
({
url
:
'/pages/order/order'
})
page
==
'coupon'
&&
uni
.
showToast
({
title
:
'功能未开放!'
,
icon
:
'none'
});
page
==
'msg'
&&
uni
.
navigateTo
({
url
:
'/mineSubPackage/pages/msg/index'
})
},
async
getMessageCount
()
{
const
{
data
}
=
await
Mine
.
getMessageCount
()
const
num
=
data
&&
Number
(
data
.
data
)
!=
0
?
data
.
data
:
''
this
.
UnreadNumber
=
num
}
}
}
...
...
@@ -237,6 +250,24 @@ export default {
&.two
{
margin-top
:
15
rpx
;
.msg{
position
:
relative
;
.unread_number{
background-color
:
#ff73bf
;
width
:
25
rpx
;
height
:
25
rpx
;
font-size
:
15
rpx
;
color
:
white
;
line-height
:
25
rpx
;
text-align
:
center
;
border-radius
:
25
rpx
;
font-weight
:
bolder
;
position
:
absolute
;
right
:
-10
rpx
;
top
:
-10
rpx
;
}
}
}
.left
{
...
...
This diff is collapsed.
Click to expand it.
request/mine/index.js
View file @
45e25d9d
...
...
@@ -20,4 +20,14 @@ export default {
uni
.
showToast
({
title
:
'服务器错误'
,
icon
:
'none'
});
});
},
getMessageCount
()
{
return
uni
.
$u
.
http
.
get
(
'/app/getMessageCount'
,
{})
.
then
((
res
)
=>
{
return
res
;
})
.
catch
((
err
)
=>
{
uni
.
showToast
({
title
:
'服务器错误'
,
icon
:
'none'
});
});
}
};
This diff is collapsed.
Click to expand it.
request/user/index.js
View file @
45e25d9d
...
...
@@ -123,17 +123,16 @@ export default {
const
data
=
res
.
detail
.
encryptedData
wx
.
checkSession
({
success
:
(
res
)
=>
{
console
.
log
(
'seeon未过期'
)
console
.
log
(
'see
i
on未过期'
)
this
.
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
},
fail
:
(
res
)
=>
{
console
.
log
(
'seeon已过期'
)
console
.
log
(
'see
i
on已过期'
)
this
.
wxLoginAndGetOpenid
(
true
).
then
(
loginInfo
=>
{
this
.
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
})
}
})
// this.uniLogin(res.detail, callback);
},
onLogin
(
loginInfo
,
iv
,
data
,
callback
)
{
this
.
loginDecrypt
({
loginInfo
:
JSON
.
parse
(
loginInfo
),
iv
,
data
}).
then
(
res
=>
{
...
...
@@ -146,7 +145,7 @@ export default {
Store
.
commit
(
'setUserInfo'
,
data
);
Store
.
commit
(
'setAuthorization'
,
token
);
if
(
callback
)
callback
();
return
callback
();
}
}).
catch
((
err
)
=>
{
uni
.
showToast
({
...
...
This diff is collapsed.
Click to expand it.
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