|
@@ -0,0 +1,152 @@
|
|
|
|
+<template>
|
|
|
|
+ <view>
|
|
|
|
+ <u-navbar title="用电知识" title-color="#101010" ></u-navbar>
|
|
|
|
+
|
|
|
|
+ <view class="main" >
|
|
|
|
+ <view class="item" v-for="(item,i) in list"
|
|
|
|
+
|
|
|
|
+ @click="gotoUrlBtn(item)"
|
|
|
|
+
|
|
|
|
+ :key="i">
|
|
|
|
+ <view class="item-message">
|
|
|
|
+ <view>{{item.title}}</view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <view class="item-time" style="display: flex;">
|
|
|
|
+ <!-- {{item.tenantName}} -->
|
|
|
|
+
|
|
|
|
+ <view>{{item.createTime}}</view>
|
|
|
|
+ <view style="margin-left: 40rpx;">阅读量:{{item.readNum}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ </view>
|
|
|
|
+ <u-divider :isnone="list.length==0" nonetext="没有找到相关内容"
|
|
|
|
+ border-color="#CFD2D5">已经到底了</u-divider>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import * as API from '@/apis/pagejs/message.js'
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ type:10,
|
|
|
|
+ formData:{
|
|
|
|
+ type:10,
|
|
|
|
+ pageIndex:1,
|
|
|
|
+ pageSize:20,
|
|
|
|
+ },
|
|
|
|
+ typeName:"",
|
|
|
|
+ list:[],
|
|
|
|
+ recordsTotal:0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed:{
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onLoad(op) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ onReachBottom() {
|
|
|
|
+
|
|
|
|
+ if (this.list.length < this.recordsTotal) {
|
|
|
|
+ this.myLoadmore();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ gotoUrlBtn(item){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:"/pages/message/knowledge?id="+item.id
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getList(){
|
|
|
|
+ this.getMessageList()
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ myLoadmore() {
|
|
|
|
+ this.formData.pageIndex += 1;
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ getMessageList(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ mask:true,title:'加载中...'
|
|
|
|
+ })
|
|
|
|
+ API.newsList(this.formData).then((res) => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ if(this.formData.pageIndex==1){
|
|
|
|
+ this.list = [
|
|
|
|
+
|
|
|
|
+ ...res.data.data
|
|
|
|
+ ];
|
|
|
|
+ }else{
|
|
|
|
+ this.list = [
|
|
|
|
+ ...this.list,
|
|
|
|
+ ...res.data.data
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ this.recordsTotal = res.data.recordsTotal;
|
|
|
|
+
|
|
|
|
+ //this.list=response.data.data;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: error
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .main{
|
|
|
|
+
|
|
|
|
+ margin-top: 24rpx;
|
|
|
|
+ .item-main{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .item{
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ margin: 32rpx;
|
|
|
|
+ padding: 32rpx;
|
|
|
|
+ border-bottom: 1px solid rgba(244,244,244,1);
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+
|
|
|
|
+ box-shadow: 0px 2px 6px 0px rgba(0,61,146,0.05);
|
|
|
|
+ .item-message{
|
|
|
|
+ line-height: 44rpx;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ display: flex;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ color: rgba(51,51,51,1);
|
|
|
|
+ .billAmount{
|
|
|
|
+ color: #F44336;
|
|
|
|
+ }
|
|
|
|
+ .gotoBtn{
|
|
|
|
+ color:#1677FF
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .item-time2{
|
|
|
|
+ color: rgb(153,153,153);
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ margin-top: 16rpx;
|
|
|
|
+ }
|
|
|
|
+ .item-time{
|
|
|
|
+ color: rgb(153,153,153);
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
+ margin-top: 16rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</style>
|