|
|
@ -2,34 +2,77 @@ |
|
|
|
<view class="content flex_col flex_start"> |
|
|
|
|
|
|
|
<!-- item --> |
|
|
|
<view class="item flex_col flex_start_y bg-white padding " v-for="i in 3" @click="jumpPage('messageDetail')"> |
|
|
|
<view class="item flex_col flex_start_y bg-white padding " v-for="(i,k) in pageList" @click="jumpDetail(i)"> |
|
|
|
<view class="title flex_row flex_start"> |
|
|
|
<view class="text-m text-left">消息中心</view> |
|
|
|
<view class="bandage"></view> |
|
|
|
<view class="text-m text-left">{{i.msg_title}}</view> |
|
|
|
<view class="bandage" v-if="!i.is_read"></view> |
|
|
|
</view> |
|
|
|
<view class="time">2020.06.22</view> |
|
|
|
<view class="time">{{i.updated_at}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {msgList} from "../../nxTemp/apis/userAPI.js" |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
address:"", |
|
|
|
login:true |
|
|
|
login:true, |
|
|
|
postData:{ |
|
|
|
page:1, |
|
|
|
page_size:10 |
|
|
|
}, |
|
|
|
listLoadFinished:false, |
|
|
|
listTotal:0, |
|
|
|
pageList:[], |
|
|
|
no_data_txt:"还没有任何赛事~" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(parms) { |
|
|
|
|
|
|
|
this.updateList() |
|
|
|
}, |
|
|
|
onUnload() { |
|
|
|
|
|
|
|
this.resetPostData() |
|
|
|
}, |
|
|
|
onReachBottom(){ |
|
|
|
console.log("onReachBottom"); |
|
|
|
this.updatePage() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
updateList(){ |
|
|
|
if(this.listLoadFinished)return this.$tools.showNone("已加载完毕") |
|
|
|
msgList(this.postData).then(res => { |
|
|
|
this.$tools.showNone("已更新"); |
|
|
|
this.pageList.push(...res.list) |
|
|
|
checkListLoadFinished(res,this); |
|
|
|
}).catch(e=>{ |
|
|
|
this.$tools.showNone(e.errMsg) |
|
|
|
}) |
|
|
|
function checkListLoadFinished(res,that){ |
|
|
|
if(that.pageList.length == res.total)that.listLoadFinished = true |
|
|
|
else that.postData.page++ |
|
|
|
} |
|
|
|
}, |
|
|
|
//重置请求参数 |
|
|
|
resetPostData(){ |
|
|
|
this.postData = { |
|
|
|
page:1, |
|
|
|
page_size:10 |
|
|
|
} |
|
|
|
}, |
|
|
|
jumpPage(name){ |
|
|
|
this.$Router.push({name:name}) |
|
|
|
}, |
|
|
|
jumpDetail(i){ |
|
|
|
let {id,msg_optid} = i |
|
|
|
this.$Router.push({ |
|
|
|
name:"messageDetail", |
|
|
|
params:{ |
|
|
|
id,msg_optid |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|