From 242945e6e4708a2ae6ac896ba62241fffe456dac Mon Sep 17 00:00:00 2001
From: zhouwenxuan <1175765986@qq.com>
Date: Tue, 01 Aug 2023 15:23:02 +0800
Subject: [PATCH] 响应反馈
---
pages/tabBar/notice/notice.vue | 61 +++++++++++++++++++-----------
1 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/pages/tabBar/notice/notice.vue b/pages/tabBar/notice/notice.vue
index c11047e..9f64fa3 100644
--- a/pages/tabBar/notice/notice.vue
+++ b/pages/tabBar/notice/notice.vue
@@ -30,12 +30,12 @@
</view>
</view>
<view class="listHead">
- <view class="switchBtn">
+<!-- <view class="switchBtn">
<u-checkbox-group>
<u-checkbox v-model="isReadOnly" @change="chooseRead"></u-checkbox>
</u-checkbox-group>
<text>只显示未读</text>
- </view>
+ </view> -->
<view class="switchBtn">
<u-switch v-model="checked" size="20" @change="clickSwitch" style="margin-right: 6px"></u-switch>
<text>仅紧临</text>
@@ -46,11 +46,11 @@
<view class="noticeList">
<view class="listContent" v-if="noticeList.length > 0" >
<view v-for="(item, index) in noticeList" :key="index" class="itemContent" >
- <view class="content" v-if="item.isRead" >
+ <view class="content" v-if="item.isResponse" >
<text style="color:rgb(17, 204, 33);" @click="toDetail(item)">[已叫应]</text>
<text @click="toDetail(item)">[{{item.colorContent}}]</text>
<text @click="toDetail(item)">{{item.title}},{{item.content}}</text>
- <view v-if="item.isRead" style="float: right; width: 80px;margin-top: 3px;">
+ <!-- <view v-if="item.isResponse" style="float: right; width: 80px;margin-top: 3px;"> -->
<!-- <u-button @click="toDetail(item)"v-if="item.buttonContent == '已叫应'" size="mini" style="margin-bottom: 10px;background-color:rgb(17, 204, 33);color: white;">
{{item.buttonContent}}
</u-button>
@@ -60,14 +60,14 @@
<u-button @click="toDetail(item)" v-else type="error" size="mini" style="margin-bottom: 10px;">
{{item.buttonContent}}
</u-button> -->
- </view>
+ <!-- </view> -->
</view>
<view class="contentNoRead" v-else>
<u-badge :is-dot="true" type="error" style="position: absolute;"></u-badge>
<text style="color: red;margin-left:10px;" @click="toDetail(item)">[未叫应]</text>
<text @click="toDetail(item)">[{{item.colorContent}}]</text>
<text @click="toDetail(item)">{{item.title}},{{item.content}}</text>
- <view style="float: right; width: 80px;margin-top: 3px;">
+ <!-- <view style="float: right; width: 80px;margin-top: 3px;"> -->
<!-- <u-button @click="toDetail(item)" v-if="item.buttonContent == '已叫应'" size="mini" style="margin-bottom: 10px;background-color:rgb(17, 204, 33);color: white;">
{{item.buttonContent}}
</u-button>
@@ -77,16 +77,12 @@
<u-button @click="toDetail(item)" v-else type="error" size="mini" style="margin-bottom: 10px;">
{{item.buttonContent}}
</u-button> -->
- </view>
+ <!-- </view> -->
</view>
</view>
</view>
<view v-else>
- <u-empty
- mode="data"
- icon="http://cdn.uviewui.com/uview/empty/data.png"
- margin-top="50%">
- </u-empty>
+ <u-empty margin-top="40%" text="数据为空" mode="data"></u-empty>
</view>
</view>
</view>
@@ -97,7 +93,7 @@
</template>
<script>
- import { getNotice, update } from '../../../api/notice';
+ import { getNotice, update,confirm } from '../../../api/notice';
import dia from './dialog.vue';
import tabBar from '../tabBarIndex.vue'
export default {
@@ -166,7 +162,9 @@
},
methods: {
getNoticeList() {
- this.data.searchParams.readStatus = this.isReadOnly ? 0 : null;
+ this.noSpeak = 0;
+ // this.data.searchParams.readStatus = this.isReadOnly ? 0 : null;
+ this.data.searchParams.readStatus = null;
this.data.searchParams.emergType = this.checked ? 1 : null ;
this.data.searchParams.warningLevel = this.selectedSaleAnalysis =='all' ? null : this.selectedSaleAnalysis =='red' ? 1 : this.selectedSaleAnalysis =='orange' ? 2: this.selectedSaleAnalysis =='yellow'? 3 : 4;
getNotice(this.data).then(res => {
@@ -175,15 +173,16 @@
this.noticeListCopy = this.noticeList;
if (this.noticeList.length > 0) {
this.noticeList.forEach((item, index) => {
- if(item.readStatus == 0){
+ if(item.responseStatus == 1){
this.noSpeak++;
}
- this.noticeList[index].isRead = item.readStatus == 1 ? true : false;
+ this.noticeList[index].isResponse = item.responseStatus == 2 ? true : false;
this.noticeList[index].colorContent = item.warningLevel == 1 ? '红色预警': item.warningLevel == 2 ? '橙色预警': item.warningLevel == 3 ? '黄色预警':'蓝色预警';
this.noticeList[index].buttonContent = item.responseStatus == 1 ? '待叫应': item.responseStatus == 2 ? '已叫应' : '超时未叫应';
});
}
}
+ }).catch(err=>{
})
},
handleButtonClick(button) {
@@ -202,15 +201,15 @@
toDetail(item) {
console.log("item",item)
//改为修改叫应状态
- if (item.readStatus === 0) {
- this.updateReadStatus(item);
+ if (item.responseStatus === 1) {
+ this.updateResponseStatus(item);
}
uni.navigateTo({
url: `/pages/tabBar/notice/detail?data=` + encodeURIComponent(JSON.stringify(item))
})
},
- updateReadStatus(item) {
- update({id: item.id}).then(res => {});
+ updateResponseStatus(item) {
+ confirm({id: item.id}).then(res => {});
},
openDialog(item){
this.$refs.showDialog.id = item.id;
@@ -239,7 +238,7 @@
},
clickSwitch(e) {
this.getNoticeList();
- }
+ },
}
}
</script>
@@ -308,7 +307,7 @@
.listHead{
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: flex-end;
}
}
@@ -322,7 +321,8 @@
height: 30px;
border-radius: 5px;
&.active{
- border: 1px solid #fff;
+ border: 1px solid rgba(0,0,0,.4);
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
}
.buttonAll{
@@ -340,21 +340,36 @@
}
.all {
background-color: rgb(17,204,33);
+ &.active{
+ background-image: linear-gradient(#22992d,#12da23);
+ }
}
.active {
border: 1.5px solid #8d8d8d;
}
.red {
background-color: #ff5555;
+ &.active{
+ background:linear-gradient(#dc2f2f, #ff5b5b);
+ }
}
.orange {
background-color: rgb(251, 158, 13);
+ &.active{
+ background: linear-gradient(#e28e0c,#ffa90e);
+ }
}
.yellow {
background-color: rgb(255, 223, 37);
+ &.active{
+ background: linear-gradient(#e6c921,#ffef28);
+ }
}
.blue {
background-color: #409EFF;
+ &.active{
+ background: linear-gradient(#3a8ee6,#44a9ff);
+ }
}
.switchBtn{
display: flex;
--
Gitblit v1.9.2