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

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

parent bb8d0410
......@@ -3,14 +3,25 @@ export function getList(data) {
return request({
url: `/rest/msg/updateLog`,
method: 'GET',
data
data,
noLoading:true,
})
}
export function markLog(data) {
// 全部已读
export function markLog() {
return request({
url: `/rest/msg/mark`,
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 @@
<view class="left-view">
<text>本月结余(元)</text>
<view class="eye-image" @click="changeEye">
<image :src="eyeFillImage" v-if="eyeFill"></image>
<image :src="eyeOffImage" v-else></image>
<image :src="eyeOffImage" v-if="eyeClose"></image>
<image :src="eyeFillImage" v-else></image>
</view>
</view>
<view class="right-view" hover-class="u-hover-class" @click="$u.throttle(handleSelectDate, 500)">
......@@ -48,20 +48,20 @@
<u-icon name="arrow-down-fill" color="#ffffff" size="22"></u-icon>
</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="left-view">
<view>本月收入</view>
<view class="money-view ">
<text v-if="eyeFill">¥{{ money.income }}</text>
<text v-else>{{asterisk}}</text>
<text v-if="eyeClose" >{{asterisk}}</text>
<text v-else>¥{{ money.income }}</text>
</view>
</view>
<view class="right-view">
<view>本月支付</view>
<view class="money-view ">
<text v-if="eyeFill">¥{{ money.expense }}</text>
<text v-else>{{asterisk}}</text>
<text v-if="eyeClose" >{{asterisk}}</text>
<text v-else>¥{{ money.expense }}</text>
</view>
</view>
<!-- ellipsis -->
......@@ -135,7 +135,6 @@ export default {
tabbar,
eyeFillImage: baseUrl + 'chakanedu-n@3x.png',
eyeOffImage: indexBaseUrl + 'bukechakan@3x.png',
eyeFill: true,
asterisk: '****',
showDatePicker: false,
visible: false,
......@@ -156,7 +155,7 @@ export default {
};
},
computed: {
...mapGetters(['userInfo']),
...mapGetters(['userInfo','eyeClose']),
baseUrl() {
return process.uniEnv.qn_base_url;
},
......@@ -285,7 +284,7 @@ export default {
},
methods: {
changeEye() {
this.eyeFill = !this.eyeFill;
this.$store.dispatch("Save_eye_fill",!this.eyeClose)
},
shareSuccessTip() {
if (this.shareSuccess) {
......
......@@ -10,7 +10,7 @@
<!-- <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-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>
<u-icon name="arrow-right" class="package-item-right-icon"></u-icon>
</view>
......@@ -33,7 +33,8 @@ export default {
},
props: {
messageNum: {
type: Number
type: Number,
default:0
}
},
data() {
......
......@@ -5,7 +5,7 @@
<!-- 购买会员入口 -->
<vip-center v-if="showPayEntrance"></vip-center>
<user-total :list="usedOptions" title="常用功能"></user-total>
<my-package></my-package>
<my-package :messageNum="messageNum"></my-package>
</view>
<mid-popup ref="midPopup"></mid-popup>
<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';
import { checkToken } from '@/utils/common.js';
import { tabbar } from '@/utils/settings.js';
import { mapGetters } from 'vuex';
import { notReadCount } from '@/api/mine/update-log.js';
export default {
components: {
MidPopup,
......@@ -33,7 +34,8 @@ export default {
data() {
return {
tabbar,
usedOptions
usedOptions,
messageNum:0,
};
},
computed: {
......@@ -85,6 +87,7 @@ export default {
onShow() {
if (checkToken()) {
this.getUserInfo();
this.getNotReadCount()
}
//拉取新用户信息,更新到storage
// this.getUserCount();
......@@ -155,6 +158,15 @@ export default {
return false;
}
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 {
this.freshing = false;
}
});
this.mark()
} catch (e) {
//TODO handle the exception
this.loadStatus='loadmore'
......@@ -114,6 +115,14 @@ export default {
if (this.loadStatus != 'loadmore') return;
this.loadStatus == 'loading';
this.getList();
},
async mark(){
try{
await markLog()
}catch(e){
console.log(e)
//TODO handle the exception
}
}
}
};
......
......@@ -6,6 +6,7 @@ const getters = {
loginChannel:state=>state.login.loginChannel,
authType:state=>state.login.authType,
autoLogin:state=>state.login.autoLogin,
eyeClose:state=>state.login.eyeClose,
quotedPriceTooltip:state=>state.common.quotedPriceTooltip,
cdKeySetting:state=>state.common.cdKeySetting,
billType:state=>state.bill.billType,
......
......@@ -11,6 +11,8 @@ import {
getChannel,
setAutoLogin,
getAutoLogin,
setEyeFill,
getEyeFill,
} from "@/utils/common.js"
import {
loginInfo
......@@ -37,6 +39,7 @@ const state = {
userInfo: getUserinfo(),
scene: null,
showPublic: false,
eyeClose:getEyeFill()||false,
// 场景值
sceneList: [
1011,
......@@ -91,6 +94,10 @@ const mutations = {
state.autoLogin = data
setAutoLogin(data)
},
SAVE_EYE_FILL: (state, data) => {
state.eyeClose = data
setEyeFill(data)
},
}
const actions = {
......@@ -297,6 +304,14 @@ const actions = {
})
})
},
// 退出系统
Save_eye_fill({
commit,
state,
dispatch
},flag) {
commit("SAVE_EYE_FILL",flag)
},
}
export default {
......
......@@ -108,6 +108,18 @@ export function getBillType() {
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) {
if (checkToken()) {
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