Files
GX.O3.WMS/APK/APP_O3/pages/tabbar/home/moerNews.vue
T

167 lines
4.0 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="page">
<view class="msg" v-for="(item,index) in listNewsBlank" :key='index' @click="Detail(item)" v-if="list.length == 0">
<view class="my-body">
<view class="item-card">
<view class="item-card-left">
<text class='left-title'>{{item.FName}}</text>
<text class="left-date">日期:{{item.C_YMD}}</text>
</view>
<view class="item-card-right" :style="{backgroundImage: 'url(' + item.FImageBase64 + ')'}"></view>
</view>
</view>
</view>
<view class="msg" v-for="(item,index) in list" :key='index' @click="Detail(item)" v-if="list.length > 0">
<view class="my-body">
<view class="item-card">
<view class="item-card-left">
<text class='left-title'>{{item.FName}}</text>
<text class="left-date">日期:{{item.C_YMD}}</text>
</view>
<view class="item-card-right" :style="{backgroundImage: 'url(' + item.FImageBase64 + ')'}"></view>
</view>
</view>
</view>
</view>
</template>
<script>
import errorUtil from '@/common/errorutil.js';
export default {
data() {
return {
orgid:'',
list:[],
pageIndex:1,
pageSize:6,
showTips:false,
listNewsBlank:[
{"FImageBase64":'../../../static/home/big_1.png',"FName":"电子公司引入WMS解决仓储诸多痛点","C_YMD":"2021-1-11 18:00:00"},
{"FImageBase64":'../../../static/home/big_2.png',"FName":"WMS仓库管理软件如何实现精细化管理","C_YMD":"2021-1-11 18:00:00"},
{"FImageBase64":'../../../static/home/big_3.png',"FName":"智能仓储管理系统的设计方案","C_YMD":"2021-1-11 18:00:00"},
],
}
},
computed: {},
onLoad() {
this.pageIndex = 1;
this.getNews(1, 6);
},
onShow() {
this.list = uni.getStorageSync('infoList')
},
onPullDownRefresh:function(){
this.showTips = false;
this.getNews(1, 6);
setTimeout(()=>{
//停止下拉样式
uni.stopPullDownRefresh();
//隐藏标题读取
uni.hideNavigationBarLoading();
},
500);
},
onReachBottom:function(){
if(!this.showTips) {
this.getInfo(this.pageIndex, this.pageSize);
}
else {
uni.showToast({
icon: 'none',
title: '已经到底了'
});
}
},
methods: {
getNews(pageIndex,pageSize){
let _self = this;
let requestParams = {
basicType:2,
pageSize:pageSize,
pageIndex:pageIndex,
UID:''
};
this.$request.get('/SysMessage/Notice',{params:requestParams})
.then(res => {
_self.listNews = res;
}).catch(err => {
uni.hideLoading();
this.dialogProps(err)
});
},
Detail:function(item){
uni.setStorageSync('newsDetail',item);
uni.navigateTo({
url:'./newsDetail'
})
}
}
}
</script>
<style lang="scss" scoped>
page{
background-color: #FFFFFF;
}
.msg{
display: flex;
flex-direction: column;
margin-left: 40rpx;
margin-right: 40rpx;
background: #FFFFFF;
height: 240rpx;
border-bottom: solid 2rpx rgba(243, 243, 243, 1);
}
.my-body{
display: flex;
flex-direction: row;
background: #FFFFFF;
align-items: center;
}
.item-card{
display: flex;
flex-direction: row;
height: 240rpx;
width: 100%;
align-items: center;
.item-card-left{
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
height: 140rpx;
width: calc(100% - 240rpx);
.left-title{
height: 55px;
line-height: 25px;
color: rgba(0, 0, 0, 1);
letter-spacing: 1px;
font-size: 18px;
font-weight: 400;
flex-grow: 0;
flex-shrink: 0;
}
.left-date{
height: 15px;
color: rgba(120, 120, 120, 1);
font-size: 12px;
font-weight: 400;
flex-grow: 0;
flex-shrink: 0;
}
}
.item-card-right{
height: 140rpx;width: 240rpx;flex-shrink: 0;
background-image: url('../../../static/home/banner2.png');
background-repeat: no-repeat;
background-size: cover;
}
}
</style>