|
@@ -1,10 +1,8 @@
|
|
|
<template>
|
|
|
<view style="padding: 20rpx;">
|
|
|
- <view v-if="!listData.length">
|
|
|
- <u-empty text="消息列表为空" mode="message"></u-empty>
|
|
|
- </view>
|
|
|
+ <view v-if="!listData.length"><u-empty text="消息列表为空" mode="message"></u-empty></view>
|
|
|
<view v-else v-for="(item, index) in listData" :key="index" style="padding-bottom: 20rpx;">
|
|
|
- <navigator hover-class="none" :url="`/pages2/msg/detail?id=${item.id}`" class="item" :style="item.receiptStatus === 1 ? 'opacity: 0.7' : ''">
|
|
|
+ <navigator hover-class="none" :url="`/pages2/msg/detail?id=${item.id}`" class="item" :style="item.receiptStatus === 1 ? 'opacity: 0.7' : ''">
|
|
|
<view style="display: flex;justify-content: space-between;align-items: center;height: 60rpx;">
|
|
|
<view style="color: #333333;font-size: 30rpx;font-weight: bold;display: flex;align-items: center;">
|
|
|
<image :src="item.systemStatus === 1 ? img1 : img2" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
|
|
@@ -23,6 +21,7 @@
|
|
|
</view>
|
|
|
</navigator>
|
|
|
</view>
|
|
|
+ <u-divider v-if="totals !== 0 && listData.length === totals" bg-color="#eaeef1">到底了</u-divider>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -47,15 +46,22 @@ export default {
|
|
|
current: 0,
|
|
|
img1: '/static/icon/msg_icon1.png',
|
|
|
img2: '/static/icon/msg_icon2.png',
|
|
|
- listData: []
|
|
|
+ listData: [],
|
|
|
+ totals: 0,
|
|
|
+ formData: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 8
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
+ this.formData.pageNum = 1
|
|
|
this.$api
|
|
|
- .getappinformUserlist()
|
|
|
+ .getappinformUserlist(this.formData)
|
|
|
.then(res => {
|
|
|
if (res.data.code === 200) {
|
|
|
this.listData = res.data.rows;
|
|
|
+ this.totals = res.data.total;
|
|
|
}
|
|
|
})
|
|
|
.finally(() => {
|
|
@@ -63,10 +69,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- this.$store.getters.dictObj
|
|
|
+ this.$store.getters.dictObj;
|
|
|
+ this.getInfo();
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.getInfo();
|
|
|
+ // this.getInfo();
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
var self = this;
|
|
@@ -76,15 +83,35 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ getChangeData(v){
|
|
|
+ this.listData.map(item => {
|
|
|
+ if(item.id === v && item.receiptStatus !== 1){
|
|
|
+ item.receiptStatus = 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getInfo() {
|
|
|
- this.$api.getappinformUserlist().then(res => {
|
|
|
+ this.$api.getappinformUserlist(this.formData).then(res => {
|
|
|
if (res.data.code === 200) {
|
|
|
this.listData = res.data.rows;
|
|
|
+ this.totals = res.data.total;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ againGetApi() {
|
|
|
+ this.$api.getappinformUserlist(this.formData).then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.listData = this.listData.concat(res.data.rows);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.listData.length < this.totals) {
|
|
|
+ this.formData.pageNum++;
|
|
|
+ this.againGetApi();
|
|
|
}
|
|
|
},
|
|
|
- onReachBottom() {},
|
|
|
computed: { ...mapGetters(['userInfo']) }
|
|
|
};
|
|
|
</script>
|