Blame view

pages/policy/policy.vue 1.99 KB
1f3f2378   起风了   我的第一次
1
2
3
  <template>

  	<view>

  		<view v-if="list.length>0">

b9de76dc   李宇   1
4
  			<view class="content" @click="xwtz('/pages/policy/policydetail?id='+item.id)" v-for="(item,index) in list" :key="index">

1f3f2378   起风了   我的第一次
5
6
7
8
9
  				<view class="box_item">

  					<view class="box_left">

  						<span class="f1">{{item.title}}</span>

  						<span class="f2">{{item.readCount}}人阅读</span>

  					</view>

63d2069f   李宇   1
10
  					<view class="box_right" v-if="item.coverImage">

1f3f2378   起风了   我的第一次
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  						<view class="images">

  							<image :src="BASE_URL + item.coverImage" style="width: 100%;height: 100%;border-radius: 20rpx;" mode="aspectFill"></image>

  						</view>

  					</view>

  				</view>

  			</view>

  		</view>

  		<view v-else style="width: 100%;text-align: center;margin-top: 100rpx;font-size: 30rpx;">

  			暂无数据

  		</view>

  	</view>

  </template>

  

  <script>

  	import BASE_URL from "@/common/config.js"

  	export default {

  		data() {

  			return {

  				BASE_URL,

  				list: [],

  				from:{

  					publishStatus:'展示',

  				}

  			}

  		},

  		onLoad(params) {

  			this.getlist()

  		},

  		methods: {

  			getlist() {

  				this.API.getpolicyDocument(this.from).then(res => {

  					console.log(res);

  					this.list = res.rows

  					

  				})

  			},

  			xwtz(e) {

  				uni.navigateTo({

  					url: e

  				})

  			}

  		}

  	}

  </script>

  

  <style lang="scss">

  	.content {

  		padding: 20rpx;

  

  		.box_item {

  			background-color: #fff;

  			display: flex;

  			padding: 20rpx;

  			border-radius: 20rpx;

  			height: 200rpx;

  

  			.box_left {

  				display: flex;

  				flex-direction: column;

  				justify-content: space-between;

63d2069f   李宇   1
71
72
  				width: 100%;

  				// margin-right: 2%;

1f3f2378   起风了   我的第一次
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
  

  				.f1 {

  					font-size: 35rpx;

  					font-weight: 600;

  					display: block;

  					margin-bottom: 20rpx;

  				}

  

  				.f2 {

  					color: #ababab;

  				}

  			}

  

  			.box_right {

  				width: 40%;

  

  				.images {

  					// background-color: #ababab;

  					height: 160rpx;

  					width: 100%;

  					// background-image: url("http://antis14.sherkxuan.cn/assets/images/a1.png");

  					// background-size: 100% 100%;

  				}

  			}

  		}

  	}

  </style>