first commit
This commit is contained in:
108
金壶/appV1/pages/my/is_message.vue
Normal file
108
金壶/appV1/pages/my/is_message.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<!-- 消息 页面 -->
|
||||
<view class="content">
|
||||
<PublicTop page_title='消息'></PublicTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view>
|
||||
<view v-if='messageList.length<=0' align="center">
|
||||
<image src="../../static/no/u/carno.png" mode="" class="noCar_img"></image>
|
||||
<view class="x_textCenter margin-shu20 font_28 x_text_hui">暂无消息</view>
|
||||
</view>
|
||||
<view class="padding-30" v-for="(item,index) of this.messageList" :key="index">
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom">
|
||||
<image src="../../static/my/mycar.png" mode="" class="" style="height:74upx; width:76upx;"></image>
|
||||
<view class="font-weight margin-zy20">{{item.biz_type_text}}</view>
|
||||
<view class="flex-1 x_text_hui">{{item.biz_title}}</view>
|
||||
<view class="">{{item.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading-text">{{loadingText}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import message from '../../utils/models/message.js'
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
cache:250,
|
||||
messageList:[],
|
||||
page:1,
|
||||
isScroll:true,
|
||||
loadingText:"",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PublicTop
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
onPullDownRefresh() {
|
||||
setTimeout(()=>{
|
||||
this.reload();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom(){
|
||||
if(!this.isScroll){
|
||||
this.loadingText="到底了";
|
||||
return false;
|
||||
}else{
|
||||
this.loadingText="正在加载...";
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async getList() {
|
||||
let parames = {
|
||||
page:this.page
|
||||
}
|
||||
|
||||
let data = await message.getList(parames)
|
||||
if(data.data.current_page == data.data.last_page){
|
||||
this.isScroll = false
|
||||
}
|
||||
for (let i = 0; i < data.data.data.length; i++) {
|
||||
this.messageList.push(data.data.data[i])
|
||||
}
|
||||
this.page++
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if(this.page){
|
||||
this.isScroll = true
|
||||
this.serviceList = []
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.noCar_img{
|
||||
height:238upx;
|
||||
width:350upx;
|
||||
margin-top: 100upx;
|
||||
}
|
||||
.loading-text{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 60upx;
|
||||
color: #979797;
|
||||
font-size: 24upx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user