|
|
@@ -4,7 +4,10 @@
|
|
|
<view class="tabs">
|
|
|
<Tabs :tabs="tabs" :currentTab="tabIndex" @change="changeTabEvent" itemWidth="33%"></Tabs>
|
|
|
</view>
|
|
|
- <scroll-view scroll-y class="allot-list">
|
|
|
+ <view @click="allRead" class="set-all-read">
|
|
|
+ 全部置为已读
|
|
|
+ </view>
|
|
|
+ <view class="allot-list">
|
|
|
<block v-if="!$util.isEmpty(list.data)">
|
|
|
<view class="allot-item" v-for="(item, index) in list.data" :key="index" @click="goTo(item)" >
|
|
|
<view class="info">
|
|
|
@@ -17,7 +20,7 @@
|
|
|
<block v-else>
|
|
|
<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
|
|
|
</block>
|
|
|
- </scroll-view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -25,7 +28,7 @@
|
|
|
import Tabs from "@/components/plugin/tabs";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import { list } from "@/mixins";
|
|
|
-import { getNotifyList,readNotify } from "@/api/notice";
|
|
|
+import { getNotifyList,readNotify,allReadNotify } from "@/api/notice";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
components: { Tabs, AppWrapperEmpty },
|
|
|
@@ -68,12 +71,24 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ allRead(){
|
|
|
+ let that = this
|
|
|
+ this.$util.confirmModal({content:'确认全部设为已读?'},() => {
|
|
|
+ allReadNotify().then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.$msg(res.msg)
|
|
|
+ that.resetList()
|
|
|
+ that.getNoticeList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
init() {
|
|
|
- this.getNoticeList();
|
|
|
+ this.getNoticeList()
|
|
|
},
|
|
|
getNoticeList() {
|
|
|
return getNotifyList({read:this.tabs[this.tabIndex].key,page: this.list.page}).then(res => {
|
|
|
- this.completes(res);
|
|
|
+ this.completes(res)
|
|
|
})
|
|
|
},
|
|
|
changeTabEvent(info) {
|
|
|
@@ -87,8 +102,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
goTo(item) {
|
|
|
- item.read = 1
|
|
|
- readNotify({id:item.id})
|
|
|
+ if(item.read == 0){
|
|
|
+ item.read = 1
|
|
|
+ readNotify({id:item.id})
|
|
|
+ }
|
|
|
if (item.page && !this.$util.isEmpty(item.page)){
|
|
|
this.$util.pageTo({url: item.page})
|
|
|
}
|
|
|
@@ -102,10 +119,22 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
background-color: #f9fbfc;
|
|
|
+ .set-all-read{
|
|
|
+ width:190upx;
|
|
|
+ height:80upx;
|
|
|
+ line-height:80upx;
|
|
|
+ text-align:center;
|
|
|
+ bottom:10upx;
|
|
|
+ background-color: #3385FF;
|
|
|
+ border-radius: 60upx;
|
|
|
+ position: fixed;
|
|
|
+ color:white;
|
|
|
+ right:10upx;
|
|
|
+ }
|
|
|
.allot-list {
|
|
|
margin-top: 20upx;
|
|
|
flex: 1;
|
|
|
- padding-bottom: 30upx;
|
|
|
+ padding-bottom:100upx;
|
|
|
.allot-item {
|
|
|
margin-bottom: 1upx;
|
|
|
padding: 30upx;
|