Commit 4cf9066d authored by 刘文虎's avatar 刘文虎

未读小红点/首页眼睛图标

parent bb8d0410
...@@ -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
...@@ -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="eyeFillImage" v-if="eyeFill"></image> <image :src="eyeOffImage" v-if="eyeClose"></image>
<image :src="eyeOffImage" v-else></image> <image :src="eyeFillImage" 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">{{ eyeFill ? money.money : asterisk }}</view> <view class="info-money-view">{{ eyeClose ? 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="eyeFill">¥{{ money.income }}</text> <text v-if="eyeClose" >{{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="eyeFill">¥{{ money.expense }}</text> <text v-if="eyeClose" >{{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) {
......
...@@ -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() {
......
...@@ -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
}
} }
} }
}; };
......
...@@ -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
}
} }
} }
}; };
......
...@@ -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,
......
...@@ -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 {
......
...@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment