|
@@ -4,7 +4,8 @@
|
|
|
<view class="one">
|
|
|
<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
|
|
|
<view class="list-scroll-view">
|
|
|
- <view class="one_1" @tap="toNotice()"><text class="iconfont icon-a-qingchuquanbuyidu"></text>全部已读</view>
|
|
|
+ <view class="one_1" @tap="toNotice()"><text
|
|
|
+ class="iconfont icon-a-qingchuquanbuyidu"></text>全部已读</view>
|
|
|
<view class="list" v-for="(item,index) in list" :key="index">
|
|
|
<uni-badge class="badge" :text="item.num" absolute="leftTop" size="normal">
|
|
|
<view class="list_1">
|
|
@@ -30,9 +31,9 @@
|
|
|
user: {},
|
|
|
list: [],
|
|
|
// 状态
|
|
|
- statusList:[],
|
|
|
+ statusList: [],
|
|
|
// 来源
|
|
|
- sourceList:[],
|
|
|
+ sourceList: [],
|
|
|
total: 0,
|
|
|
page: 0,
|
|
|
skip: 0,
|
|
@@ -71,23 +72,23 @@
|
|
|
// 查询列表
|
|
|
async search() {
|
|
|
const that = this;
|
|
|
- let info = {
|
|
|
- skip: that.skip,
|
|
|
- limit: that.limit,
|
|
|
- customer:that.user._id
|
|
|
+ let info = {
|
|
|
+ skip: that.skip,
|
|
|
+ limit: that.limit,
|
|
|
+ customer: that.user._id
|
|
|
+ }
|
|
|
+ const res = await that.$api(`/notice`, `GET`, {
|
|
|
+ ...info,
|
|
|
+ })
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ let list = [...that.list, ...res.data];
|
|
|
+ for (let val of list) {
|
|
|
+ if (val.status) val.zhStatus = that.searchStatus(val.status)
|
|
|
+ if (val.source) val.zhSource = that.searchSource(val.source)
|
|
|
+ if (val.status != '1') val.num = 1
|
|
|
}
|
|
|
- const res = await that.$api(`/notice`, `GET`, {
|
|
|
- ...info,
|
|
|
- })
|
|
|
- if (res.errcode == '0') {
|
|
|
- let list = [...that.list, ...res.data];
|
|
|
- for (let val of list) {
|
|
|
- if (val.status) val.zhStatus = that.searchStatus(val.status)
|
|
|
- if (val.source) val.zhSource = that.searchSource(val.source)
|
|
|
- if(val.status!='1')val.num=1
|
|
|
- }
|
|
|
- that.$set(that, `list`, list)
|
|
|
- that.$set(that, `total`, res.total)
|
|
|
+ that.$set(that, `list`, list)
|
|
|
+ that.$set(that, `total`, res.total)
|
|
|
}
|
|
|
},
|
|
|
// 查询状态
|
|
@@ -105,12 +106,12 @@
|
|
|
else return '暂无'
|
|
|
},
|
|
|
// 全部已读
|
|
|
- async toNotice(){
|
|
|
+ async toNotice() {
|
|
|
const that = this;
|
|
|
- let list =that.list.filter((i) => i.status != '1');
|
|
|
+ let list = that.list.filter((i) => i.status != '1');
|
|
|
for (let val of list) {
|
|
|
const res = await that.$api(`/notice/${val._id}`, `POST`, {
|
|
|
- status:'1'
|
|
|
+ status: '1'
|
|
|
})
|
|
|
if (res.errcode == '0') {
|
|
|
that.clearPage();
|
|
@@ -165,34 +166,43 @@
|
|
|
<style lang="scss">
|
|
|
.main {
|
|
|
.one {
|
|
|
- .one_1{
|
|
|
+ .one_1 {
|
|
|
padding: 2vw;
|
|
|
text-align: center;
|
|
|
- .iconfont{
|
|
|
- color:#707070;
|
|
|
+
|
|
|
+ .iconfont {
|
|
|
+ color: #707070;
|
|
|
}
|
|
|
+
|
|
|
color:#707070;
|
|
|
}
|
|
|
+
|
|
|
.list {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
margin: 2vw 2vw 0 2vw;
|
|
|
padding: 2vw;
|
|
|
border-radius: 5px;
|
|
|
- border: 1px solid #f5f5f5;;
|
|
|
- .badge{
|
|
|
+ border: 1px solid #f5f5f5;
|
|
|
+ ;
|
|
|
+
|
|
|
+ .badge {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- .list_1{
|
|
|
+
|
|
|
+ .list_1 {
|
|
|
padding: 2vw 0 0 0;
|
|
|
font-size: 14px;
|
|
|
- text{
|
|
|
+
|
|
|
+ text {
|
|
|
color: var(--f85Color);
|
|
|
}
|
|
|
}
|
|
|
- .list_2{
|
|
|
+
|
|
|
+ .list_2 {
|
|
|
font-size: 12px;
|
|
|
- text{
|
|
|
+
|
|
|
+ text {
|
|
|
color: var(--f85Color);
|
|
|
}
|
|
|
}
|