|
|
@@ -3,26 +3,31 @@ |
|
|
|
<!-- <u-tabs :list="list" :show-bar="false" :is-scroll="false" :current="current" @change="change"></u-tabs> -->
|
|
|
|
<view class="listMain">
|
|
|
|
<view class="upgradeList">
|
|
|
|
<block v-if="updateAnnList.length!=0">
|
|
|
|
<block v-for="(item,index) in updateAnnList" :key="index">
|
|
|
|
<view class="upgradeItem" @click="goDetail(item.content,item.id,item.title)">
|
|
|
|
<view class="notRead">
|
|
|
|
<view v-if="item.readFlag==0" class="red"></view>
|
|
|
|
</view>
|
|
|
|
<view class="right">
|
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
|
<view class="time">{{item.createTime}}</view>
|
|
|
|
<scroll-view :scroll-top="scrollTop" refresher-enabled="true" :refresher-triggered="triggered"
|
|
|
|
@refresherpulling="onPulling" @refresherrefresh="onRefresh" @refresherrestore="onRestore"
|
|
|
|
:scroll-y="true" class="scroll-Y" @scrolltolower="lower">
|
|
|
|
<block v-if="updateAnnList.length!=0">
|
|
|
|
<block v-for="(item,index) in updateAnnList" :key="index">
|
|
|
|
<view class="upgradeItem" @click="goDetail(item.content,item.id,item.title)">
|
|
|
|
<view class="notRead">
|
|
|
|
<view v-if="item.readFlag==0" class="red"></view>
|
|
|
|
</view>
|
|
|
|
<view class="right">
|
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
|
<view class="time">{{item.createTime}}</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</block>
|
|
|
|
</block>
|
|
|
|
<block v-else>
|
|
|
|
<view style=" padding: 100rpx 0;">
|
|
|
|
<u-empty text="暂无数据" mode="list"></u-empty>
|
|
|
|
</view>
|
|
|
|
</block>
|
|
|
|
</block>
|
|
|
|
<block v-else>
|
|
|
|
<view style=" padding: 100rpx 0;">
|
|
|
|
<u-empty text="暂无数据" mode="list"></u-empty>
|
|
|
|
</view>
|
|
|
|
</block>
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <view class="systemList" v-if="current==0">
|
|
|
|
<block v-if="sysItemList.length!=0">
|
|
|
|
<block v-for="(item,index) in sysItemList" :key="index">
|
|
|
@@ -80,6 +85,11 @@ |
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
triggered: true,
|
|
|
|
scrollTop: 0,
|
|
|
|
old: {
|
|
|
|
scrollTop: 0
|
|
|
|
},
|
|
|
|
updateAnnList: [],
|
|
|
|
sysItemList: [],
|
|
|
|
list: [{
|
|
|
@@ -88,34 +98,97 @@ |
|
|
|
name: `升级公告`,
|
|
|
|
count: "",
|
|
|
|
}],
|
|
|
|
current: 0
|
|
|
|
current: 0,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.updateAnnList = []
|
|
|
|
this.pageNum = 1
|
|
|
|
this.updateInit()
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
this._freshing = false;
|
|
|
|
setTimeout(() => {
|
|
|
|
this.triggered = true;
|
|
|
|
}, 1000)
|
|
|
|
},
|
|
|
|
onPullDownRefresh() {
|
|
|
|
this.updateInit()
|
|
|
|
setTimeout(function() {
|
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
}, 1000);
|
|
|
|
},
|
|
|
|
// onReachBottom(){
|
|
|
|
// this.pageNum++
|
|
|
|
// this.updateInit()
|
|
|
|
// },
|
|
|
|
methods: {
|
|
|
|
onPulling(e) {
|
|
|
|
console.log("onpulling", e);
|
|
|
|
},
|
|
|
|
onRefresh() {
|
|
|
|
if (this._freshing) return;
|
|
|
|
|
|
|
|
this.updateInit()
|
|
|
|
this._freshing = true;
|
|
|
|
setTimeout(() => {
|
|
|
|
this.triggered = false;
|
|
|
|
this._freshing = false;
|
|
|
|
}, 3000)
|
|
|
|
},
|
|
|
|
onRestore() {
|
|
|
|
this.triggered = 'restore'; // 需要重置
|
|
|
|
console.log("onRestore");
|
|
|
|
},
|
|
|
|
// uppers(e) {
|
|
|
|
// this.pageNum = 1
|
|
|
|
// this.updateInit()
|
|
|
|
// },
|
|
|
|
lower(e) {
|
|
|
|
this.pageNum++
|
|
|
|
this.updateInit()
|
|
|
|
},
|
|
|
|
updateInit() {
|
|
|
|
uni.request({
|
|
|
|
url: config.service.updateList,
|
|
|
|
method: "GET",
|
|
|
|
data: {
|
|
|
|
id: uni.getStorageSync('weapp_session_userInfo_data').accountId
|
|
|
|
id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
|
|
|
|
num: this.pageNum,
|
|
|
|
size: this.pageSize
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
'content-type': 'application/json',
|
|
|
|
'Access-Token': uni.getStorageSync('weapp_session_login_data').token
|
|
|
|
},
|
|
|
|
success: (res) => {
|
|
|
|
this.updateAnnList = res.data.data.list
|
|
|
|
this.list[1].count = res.data.data.count
|
|
|
|
// this.updateAnnList = res.data.data.list.results
|
|
|
|
if (res.data.data != null) {
|
|
|
|
this.list[1].count = res.data.data.count
|
|
|
|
}
|
|
|
|
if (res.data.data == null) {
|
|
|
|
console.log(11)
|
|
|
|
uni.showToast({
|
|
|
|
title: '已经到底了!',
|
|
|
|
duration: 2000
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
if(this.pageNum!=1){
|
|
|
|
this.updateAnnList = [...this.updateAnnList, ...res.data.data.list.results];
|
|
|
|
}else{
|
|
|
|
this.updateAnnList = res.data.data.list.results
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
goDetail(text, id,title) {
|
|
|
|
goDetail(text, id, title) {
|
|
|
|
let link = encodeURIComponent(JSON.stringify(text))
|
|
|
|
uni.navigateTo({
|
|
|
|
url: "./messageDetail?content=" + link + "&id=" + id+"&tit="+title
|
|
|
|
url: "./messageDetail?content=" + link + "&id=" + id + "&tit=" + title
|
|
|
|
})
|
|
|
|
},
|
|
|
|
change(index) {
|
|
|
@@ -129,6 +202,12 @@ |
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.scroll-Y {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
position: fixed;
|
|
|
|
}
|
|
|
|
|
|
|
|
.message_list {
|
|
|
|
.u-tab-item {
|
|
|
|
border: 0.5rpx solid #dedede;
|
|
|
|