Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
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
刘文虎
account-book
Commits
4cf9066d
Commit
4cf9066d
authored
Aug 17, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未读小红点/首页眼睛图标
parent
bb8d0410
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
17 deletions
+77
-17
update-log.js
api/mine/update-log.js
+14
-3
index.vue
pages/index/index.vue
+9
-10
my-package.vue
pages/index/mine/components/my-package.vue
+3
-2
mine.vue
pages/index/mine/mine.vue
+14
-2
update-log.vue
pages/mine/update-log/update-log.vue
+9
-0
getters.js
store/getters.js
+1
-0
login.js
store/modules/login.js
+15
-0
common.js
utils/common.js
+12
-0
No files found.
api/mine/update-log.js
View file @
4cf9066d
...
@@ -3,14 +3,25 @@ export function getList(data) {
...
@@ -3,14 +3,25 @@ export function getList(data) {
return
request
({
return
request
({
url
:
`/rest/msg/updateLog`
,
url
:
`/rest/msg/updateLog`
,
method
:
'GET'
,
method
:
'GET'
,
data
data
,
noLoading
:
true
,
})
})
}
}
export
function
markLog
(
data
)
{
// 全部已读
export
function
markLog
()
{
return
request
({
return
request
({
url
:
`/rest/msg/mark`
,
url
:
`/rest/msg/mark`
,
method
:
'POST'
,
method
:
'POST'
,
data
noLoading
:
true
,
})
}
// 查询未读数量
export
function
notReadCount
()
{
return
request
({
url
:
`/rest/msg/notReadCount`
,
method
:
'GET'
,
noLoading
:
true
,
})
})
}
}
\ No newline at end of file
pages/index/index.vue
View file @
4cf9066d
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<text>
本月结余(元)
</text>
<text>
本月结余(元)
</text>
<view
class=
"eye-image"
@
click=
"changeEye"
>
<view
class=
"eye-image"
@
click=
"changeEye"
>
<image
:src=
"eye
FillImage"
v-if=
"eyeFill
"
></image>
<image
:src=
"eye
OffImage"
v-if=
"eyeClose
"
></image>
<image
:src=
"eye
Off
Image"
v-else
></image>
<image
:src=
"eye
Fill
Image"
v-else
></image>
</view>
</view>
</view>
</view>
<view
class=
"right-view"
hover-class=
"u-hover-class"
@
click=
"$u.throttle(handleSelectDate, 500)"
>
<view
class=
"right-view"
hover-class=
"u-hover-class"
@
click=
"$u.throttle(handleSelectDate, 500)"
>
...
@@ -48,20 +48,20 @@
...
@@ -48,20 +48,20 @@
<u-icon
name=
"arrow-down-fill"
color=
"#ffffff"
size=
"22"
></u-icon>
<u-icon
name=
"arrow-down-fill"
color=
"#ffffff"
size=
"22"
></u-icon>
</view>
</view>
</view>
</view>
<view
class=
"info-money-view"
>
{{
eye
Fill
?
money
.
money
:
asterisk
}}
</view>
<view
class=
"info-money-view"
>
{{
eye
Close
?
asterisk
:
money
.
money
}}
</view>
<view
class=
"info-bottom-view"
>
<view
class=
"info-bottom-view"
>
<view
class=
"left-view"
>
<view
class=
"left-view"
>
<view>
本月收入
</view>
<view>
本月收入
</view>
<view
class=
"money-view "
>
<view
class=
"money-view "
>
<text
v-if=
"eye
Fill"
>
¥
{{
money
.
income
}}
</text>
<text
v-if=
"eye
Close"
>
{{
asterisk
}}
</text>
<text
v-else
>
{{
asterisk
}}
</text>
<text
v-else
>
¥
{{
money
.
income
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"right-view"
>
<view
class=
"right-view"
>
<view>
本月支付
</view>
<view>
本月支付
</view>
<view
class=
"money-view "
>
<view
class=
"money-view "
>
<text
v-if=
"eye
Fill"
>
¥
{{
money
.
expense
}}
</text>
<text
v-if=
"eye
Close"
>
{{
asterisk
}}
</text>
<text
v-else
>
{{
asterisk
}}
</text>
<text
v-else
>
¥
{{
money
.
expense
}}
</text>
</view>
</view>
</view>
</view>
<!-- ellipsis -->
<!-- ellipsis -->
...
@@ -135,7 +135,6 @@ export default {
...
@@ -135,7 +135,6 @@ export default {
tabbar
,
tabbar
,
eyeFillImage
:
baseUrl
+
'chakanedu-n@3x.png'
,
eyeFillImage
:
baseUrl
+
'chakanedu-n@3x.png'
,
eyeOffImage
:
indexBaseUrl
+
'bukechakan@3x.png'
,
eyeOffImage
:
indexBaseUrl
+
'bukechakan@3x.png'
,
eyeFill
:
true
,
asterisk
:
'****'
,
asterisk
:
'****'
,
showDatePicker
:
false
,
showDatePicker
:
false
,
visible
:
false
,
visible
:
false
,
...
@@ -156,7 +155,7 @@ export default {
...
@@ -156,7 +155,7 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'userInfo'
]),
...
mapGetters
([
'userInfo'
,
'eyeClose'
]),
baseUrl
()
{
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
return
process
.
uniEnv
.
qn_base_url
;
},
},
...
@@ -285,7 +284,7 @@ export default {
...
@@ -285,7 +284,7 @@ export default {
},
},
methods
:
{
methods
:
{
changeEye
()
{
changeEye
()
{
this
.
eyeFill
=
!
this
.
eyeFill
;
this
.
$store
.
dispatch
(
"Save_eye_fill"
,
!
this
.
eyeClose
)
},
},
shareSuccessTip
()
{
shareSuccessTip
()
{
if
(
this
.
shareSuccess
)
{
if
(
this
.
shareSuccess
)
{
...
...
pages/index/mine/components/my-package.vue
View file @
4cf9066d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<!--
<view
class=
"package-item-icon"
><u-icon
:name=
"item.icon"
></u-icon></view>
-->
<!--
<view
class=
"package-item-icon"
><u-icon
:name=
"item.icon"
></u-icon></view>
-->
<view
class=
"package-item-title"
>
{{
item
.
title
}}
</view>
<view
class=
"package-item-title"
>
{{
item
.
title
}}
</view>
<view
class=
"package-item-right"
>
<view
class=
"package-item-right"
>
<
!--
<text
class=
"dot"
v-if=
"item.title==='更新日志'"
></text>
--
>
<
text
class=
"dot"
v-if=
"item.title==='更新日志'&&messageNum>0"
></text
>
<text
class=
"package-item-right-text"
v-if=
"item.title==='更新日志'"
>
{{
version
}}
</text>
<text
class=
"package-item-right-text"
v-if=
"item.title==='更新日志'"
>
{{
version
}}
</text>
<u-icon
name=
"arrow-right"
class=
"package-item-right-icon"
></u-icon>
<u-icon
name=
"arrow-right"
class=
"package-item-right-icon"
></u-icon>
</view>
</view>
...
@@ -33,7 +33,8 @@ export default {
...
@@ -33,7 +33,8 @@ export default {
},
},
props
:
{
props
:
{
messageNum
:
{
messageNum
:
{
type
:
Number
type
:
Number
,
default
:
0
}
}
},
},
data
()
{
data
()
{
...
...
pages/index/mine/mine.vue
View file @
4cf9066d
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<!-- 购买会员入口 -->
<!-- 购买会员入口 -->
<vip-center
v-if=
"showPayEntrance"
></vip-center>
<vip-center
v-if=
"showPayEntrance"
></vip-center>
<user-total
:list=
"usedOptions"
title=
"常用功能"
></user-total>
<user-total
:list=
"usedOptions"
title=
"常用功能"
></user-total>
<my-package></my-package>
<my-package
:messageNum=
"messageNum"
></my-package>
</view>
</view>
<mid-popup
ref=
"midPopup"
></mid-popup>
<mid-popup
ref=
"midPopup"
></mid-popup>
<u-tabbar
:list=
"tabbar"
:mid-button=
"true"
:mid-button-size=
"80"
:before-switch=
"beforeSwitch"
></u-tabbar>
<u-tabbar
:list=
"tabbar"
:mid-button=
"true"
:mid-button-size=
"80"
:before-switch=
"beforeSwitch"
></u-tabbar>
...
@@ -22,6 +22,7 @@ import { usedOptions } from '@/utils/options/mine/index.js';
...
@@ -22,6 +22,7 @@ import { usedOptions } from '@/utils/options/mine/index.js';
import
{
checkToken
}
from
'@/utils/common.js'
;
import
{
checkToken
}
from
'@/utils/common.js'
;
import
{
tabbar
}
from
'@/utils/settings.js'
;
import
{
tabbar
}
from
'@/utils/settings.js'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
mapGetters
}
from
'vuex'
;
import
{
notReadCount
}
from
'@/api/mine/update-log.js'
;
export
default
{
export
default
{
components
:
{
components
:
{
MidPopup
,
MidPopup
,
...
@@ -33,7 +34,8 @@ export default {
...
@@ -33,7 +34,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
tabbar
,
tabbar
,
usedOptions
usedOptions
,
messageNum
:
0
,
};
};
},
},
computed
:
{
computed
:
{
...
@@ -85,6 +87,7 @@ export default {
...
@@ -85,6 +87,7 @@ export default {
onShow
()
{
onShow
()
{
if
(
checkToken
())
{
if
(
checkToken
())
{
this
.
getUserInfo
();
this
.
getUserInfo
();
this
.
getNotReadCount
()
}
}
//拉取新用户信息,更新到storage
//拉取新用户信息,更新到storage
// this.getUserCount();
// this.getUserCount();
...
@@ -155,6 +158,15 @@ export default {
...
@@ -155,6 +158,15 @@ export default {
return
false
;
return
false
;
}
}
return
true
;
return
true
;
},
async
getNotReadCount
(){
try
{
let
{
data
}
=
await
notReadCount
()
this
.
messageNum
=
data
||
0
}
catch
(
e
){
console
.
log
(
e
)
//TODO handle the exception
}
}
}
}
}
};
};
...
...
pages/mine/update-log/update-log.vue
View file @
4cf9066d
...
@@ -87,6 +87,7 @@ export default {
...
@@ -87,6 +87,7 @@ export default {
this
.
freshing
=
false
;
this
.
freshing
=
false
;
}
}
});
});
this
.
mark
()
}
catch
(
e
)
{
}
catch
(
e
)
{
//TODO handle the exception
//TODO handle the exception
this
.
loadStatus
=
'loadmore'
this
.
loadStatus
=
'loadmore'
...
@@ -114,6 +115,14 @@ export default {
...
@@ -114,6 +115,14 @@ export default {
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
if
(
this
.
loadStatus
!=
'loadmore'
)
return
;
this
.
loadStatus
==
'loading'
;
this
.
loadStatus
==
'loading'
;
this
.
getList
();
this
.
getList
();
},
async
mark
(){
try
{
await
markLog
()
}
catch
(
e
){
console
.
log
(
e
)
//TODO handle the exception
}
}
}
}
}
};
};
...
...
store/getters.js
View file @
4cf9066d
...
@@ -6,6 +6,7 @@ const getters = {
...
@@ -6,6 +6,7 @@ const getters = {
loginChannel
:
state
=>
state
.
login
.
loginChannel
,
loginChannel
:
state
=>
state
.
login
.
loginChannel
,
authType
:
state
=>
state
.
login
.
authType
,
authType
:
state
=>
state
.
login
.
authType
,
autoLogin
:
state
=>
state
.
login
.
autoLogin
,
autoLogin
:
state
=>
state
.
login
.
autoLogin
,
eyeClose
:
state
=>
state
.
login
.
eyeClose
,
quotedPriceTooltip
:
state
=>
state
.
common
.
quotedPriceTooltip
,
quotedPriceTooltip
:
state
=>
state
.
common
.
quotedPriceTooltip
,
cdKeySetting
:
state
=>
state
.
common
.
cdKeySetting
,
cdKeySetting
:
state
=>
state
.
common
.
cdKeySetting
,
billType
:
state
=>
state
.
bill
.
billType
,
billType
:
state
=>
state
.
bill
.
billType
,
...
...
store/modules/login.js
View file @
4cf9066d
...
@@ -11,6 +11,8 @@ import {
...
@@ -11,6 +11,8 @@ import {
getChannel
,
getChannel
,
setAutoLogin
,
setAutoLogin
,
getAutoLogin
,
getAutoLogin
,
setEyeFill
,
getEyeFill
,
}
from
"@/utils/common.js"
}
from
"@/utils/common.js"
import
{
import
{
loginInfo
loginInfo
...
@@ -37,6 +39,7 @@ const state = {
...
@@ -37,6 +39,7 @@ const state = {
userInfo
:
getUserinfo
(),
userInfo
:
getUserinfo
(),
scene
:
null
,
scene
:
null
,
showPublic
:
false
,
showPublic
:
false
,
eyeClose
:
getEyeFill
()
||
false
,
// 场景值
// 场景值
sceneList
:
[
sceneList
:
[
1011
,
1011
,
...
@@ -91,6 +94,10 @@ const mutations = {
...
@@ -91,6 +94,10 @@ const mutations = {
state
.
autoLogin
=
data
state
.
autoLogin
=
data
setAutoLogin
(
data
)
setAutoLogin
(
data
)
},
},
SAVE_EYE_FILL
:
(
state
,
data
)
=>
{
state
.
eyeClose
=
data
setEyeFill
(
data
)
},
}
}
const
actions
=
{
const
actions
=
{
...
@@ -297,6 +304,14 @@ const actions = {
...
@@ -297,6 +304,14 @@ const actions = {
})
})
})
})
},
},
// 退出系统
Save_eye_fill
({
commit
,
state
,
dispatch
},
flag
)
{
commit
(
"SAVE_EYE_FILL"
,
flag
)
},
}
}
export
default
{
export
default
{
...
...
utils/common.js
View file @
4cf9066d
...
@@ -108,6 +108,18 @@ export function getBillType() {
...
@@ -108,6 +108,18 @@ export function getBillType() {
return
uni
.
getStorageSync
(
"BILLTYPE"
)
||
''
return
uni
.
getStorageSync
(
"BILLTYPE"
)
||
''
}
}
export
function
setEyeFill
(
data
)
{
uni
.
setStorageSync
(
"EYEFILL"
,
data
);
}
export
function
getEyeFill
()
{
return
uni
.
getStorageSync
(
"EYEFILL"
)
||
""
}
export
function
removeEyeFill
()
{
uni
.
removeStorageSync
(
"EYEFILL"
);
}
export
function
checkLoginAndVip
(
callback
)
{
export
function
checkLoginAndVip
(
callback
)
{
if
(
checkToken
())
{
if
(
checkToken
())
{
if
(
checkVip
())
{
if
(
checkVip
())
{
...
...
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