|
| 1 | +<template> |
| 2 | + <div calss="cow-container"> |
| 3 | + <div class="cow-top"> |
| 4 | + <div class="cow-choiceness"> |
| 5 | + <div class="text">精选</div> |
| 6 | + <div class="desc">双11你准备给你老婆买啥</div> |
| 7 | + <Icon type="ios-planet" class="star" color="#f5f5f56b" /> |
| 8 | + </div> |
| 9 | + <div class="cow-hot"> |
| 10 | + <div class="text">热门</div> |
| 11 | + <div class="desc">99年世界末日了解一下</div> |
| 12 | + <Icon type="ios-analytics" class="hot" color="#f5f5f56b" /> |
| 13 | + </div> |
| 14 | + </div> |
| 15 | + <div class="cow-list"> |
| 16 | + <div class="cow-item" v-for="(item,index) in cowList" :key="index"> |
| 17 | + <div class="item-head"> |
| 18 | + <img v-bind:src="item.header" /> |
| 19 | + <span class="author">{{item.author}}</span> |
| 20 | + <span class="focus">关注</span> |
| 21 | + </div> |
| 22 | + <div class="item-content" @click="link(item)"> |
| 23 | + <span class="title">【{{item.title}}】</span> |
| 24 | + {{splitContent(item)}} |
| 25 | + <!-- <span |
| 26 | + @click="item.show=!item.show" |
| 27 | + v-show="item.show" |
| 28 | + class="all-text" |
| 29 | + >全文</span>--> |
| 30 | + <span v-show="item.show" class="all-text">全文</span> |
| 31 | + </div> |
| 32 | + <div class="item-imgs"> |
| 33 | + <img |
| 34 | + :class="item.class" |
| 35 | + v-for="(imgItem,imgIndex) in item.imgs" |
| 36 | + v-bind:src="imgItem" |
| 37 | + :key="imgIndex" |
| 38 | + /> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + </div> |
| 43 | +</template> |
| 44 | +<script> |
| 45 | +export default { |
| 46 | + data() { |
| 47 | + return { |
| 48 | + cowList: [ |
| 49 | + { |
| 50 | + title: "暗恋一个女生,昨天请她出来看电影..", |
| 51 | + author: "路边观察社北京一分社", |
| 52 | + header: |
| 53 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/head3.jpg", |
| 54 | + content: |
| 55 | + " 暗恋一个女生很久了,昨天请她出来看电影,当我准时到影院时,才发现自己没带钱。值得庆幸的是,她像往常一样,并没有赴约,这终究是人生的大幸还是不幸,点了支烟,我茫然深思", |
| 56 | + imgs: [ |
| 57 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/x2.jpg" |
| 58 | + ] |
| 59 | + }, |
| 60 | + { |
| 61 | + title: "听说女人和男人在床上说得最多的一句是", |
| 62 | + author: "路边观察社北京二分社", |
| 63 | +
|
| 64 | + header: |
| 65 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/head1.jpg", |
| 66 | + content: |
| 67 | + " “你压着我头发了。”现在看电视剧终于明白为什么男二号总对男一号说:“你要敢动她根头发我和你没完!.....................", |
| 68 | + imgs: [ |
| 69 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/xx.jpg", |
| 70 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/x3.jpg" |
| 71 | + ] |
| 72 | + }, |
| 73 | + { |
| 74 | + title: "2019年7月26日早 灰暗的云彩笼罩了天空", |
| 75 | + author: "路边观察社北京三分社", |
| 76 | + header: |
| 77 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/head3.jpg", |
| 78 | + content: |
| 79 | + " 显得那样阴霾 我蹒跚着走到了那个地方 一切还是那么熟悉 强颜欢笑的和熟悉的熟人打着招呼 看得出 他们也在强颜欢笑 走到了那个非常熟悉的人的面前 深深的吸了一口气 还是那熟悉的问道 无语凝视着 我缓缓的递过去带着体温的八元钱 淡淡的说道 :“老样子” 他苦笑着摇摇头,说:“不够” “不够?”内心不禁起波澜,难道涨的这么快吗,安抚住心内的汹涌澎湃,我试探着问道:“那来一个?”他依然苦笑着摇头。“纳尼,以前四块钱一个的肉夹馍,肿么现在八元钱一个都不够了哇,告诉我,这是为什么,到底是为什么?”此刻我有些抓狂,肾上腺激素飙高,显然我有些失控了。“亲,我也没办法,猪肉都22一斤了。。。。。。”看着他那也是万般无奈的表情,我颓然的放下那拿着带着体温的钱的手,默默的低下来头,惆怅的转身而去,拉长的身影,显得那么的黑暗无助。。。。。。", |
| 80 | + imgs: [ |
| 81 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/xx.jpg", |
| 82 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/x1.jpg", |
| 83 | + "https://imgs-1256993465.cos.ap-chengdu.myqcloud.com/h5pic/x2.jpg" |
| 84 | + ] |
| 85 | + } |
| 86 | + ] |
| 87 | + }; |
| 88 | + }, |
| 89 | + methods: { |
| 90 | + link(item) { |
| 91 | + this.$message.error(item.title); |
| 92 | + }, |
| 93 | + imgClass() { |
| 94 | + return "a2"; |
| 95 | + }, |
| 96 | + splitContent(item) { |
| 97 | + if (item.imgs && item.imgs.length > 0) { |
| 98 | + item.class = "img" + item.imgs.length; |
| 99 | + } |
| 100 | + if (item.content.length < 80) { |
| 101 | + item.show = false; |
| 102 | + return item.content; |
| 103 | + } |
| 104 | + item.show = true; |
| 105 | + return item.content.substring(0, 80) + "..."; |
| 106 | + } |
| 107 | + } |
| 108 | +}; |
| 109 | +</script> |
| 110 | +<style scoped> |
| 111 | +.cow-container { |
| 112 | + height: 100%; |
| 113 | +} |
| 114 | +.cow-top { |
| 115 | + background: white; |
| 116 | + display: inline-block; |
| 117 | + width: 100%; |
| 118 | + padding: 0 4px; |
| 119 | +} |
| 120 | +.cow-top > div { |
| 121 | + float: left; |
| 122 | + width: 49%; |
| 123 | + text-align: left; |
| 124 | +} |
| 125 | +.cow-top > div:first-child { |
| 126 | + background: #57a3f3; |
| 127 | + padding: 10px; |
| 128 | + color: white; |
| 129 | + border-radius: 5px; |
| 130 | + margin-right: 2%; |
| 131 | +} |
| 132 | +.cow-top > div:last-child { |
| 133 | + background: #ff4081; |
| 134 | + padding: 10px; |
| 135 | + color: white; |
| 136 | + border-radius: 5px; |
| 137 | +} |
| 138 | +.cow-top > div .text { |
| 139 | + font-size: 20px; |
| 140 | +} |
| 141 | +.cow-top > div .desc { |
| 142 | + font-size: 12px; |
| 143 | +} |
| 144 | +.cow-choiceness .star { |
| 145 | + color: #f5f5f56b; |
| 146 | + position: relative; |
| 147 | + float: right; |
| 148 | + top: -5px; |
| 149 | + right: -5px; |
| 150 | + margin-top: -54px; |
| 151 | + font-size: 46px; |
| 152 | + border: 0px; |
| 153 | +} |
| 154 | +.cow-hot .hot { |
| 155 | + color: #f5f5f56b; |
| 156 | + position: relative; |
| 157 | + float: right; |
| 158 | + top: -5px; |
| 159 | + right: -5px; |
| 160 | + margin-top: -54px; |
| 161 | + font-size: 46px; |
| 162 | + border: 0px; |
| 163 | +} |
| 164 | +.item-head { |
| 165 | + border-bottom: 1px solid #eee; |
| 166 | + margin-bottom: 12px; |
| 167 | + text-align: left; |
| 168 | +} |
| 169 | +.item-head img { |
| 170 | + height: 25px; |
| 171 | + width: 25px; |
| 172 | + border-radius: 50%; |
| 173 | + margin-right: 10px; |
| 174 | +} |
| 175 | +.item-head span { |
| 176 | + position: relative; |
| 177 | + top: -5px; |
| 178 | + font-size: 15px; |
| 179 | +} |
| 180 | +.item-head .focus { |
| 181 | + position: relative; |
| 182 | + top: 0; |
| 183 | + font-size: 15px; |
| 184 | + float: right; |
| 185 | + padding: 0px 10px; |
| 186 | + border-radius: 15px; |
| 187 | + border: 1px solid #f9d9d9; |
| 188 | + color: #f44336; |
| 189 | +} |
| 190 | +.item-imgs{ |
| 191 | + max-height: 180px; |
| 192 | + /* width: 300px; */ |
| 193 | + /* height: 50px; */ |
| 194 | + line-height: 25px; |
| 195 | + overflow: hidden; |
| 196 | +} |
| 197 | +.item-imgs .img1 { |
| 198 | + width: 100%; |
| 199 | + /* max-height: 180px; */ |
| 200 | +} |
| 201 | +.item-imgs .img2 { |
| 202 | + width: 49%; |
| 203 | + height: 120px; |
| 204 | +} |
| 205 | +
|
| 206 | +.item-imgs .img3 { |
| 207 | + width: 32%; |
| 208 | + height: 75px; |
| 209 | +} |
| 210 | +.item-imgs .img3:first-child, |
| 211 | +.item-imgs .img2:first-child { |
| 212 | + margin-right: 2%; |
| 213 | +} |
| 214 | +.item-imgs .img3:last-child { |
| 215 | + margin-left: 2%; |
| 216 | +} |
| 217 | +.cow-item { |
| 218 | + background: white; |
| 219 | + padding: 10px; |
| 220 | + margin-bottom: 8px; |
| 221 | +} |
| 222 | +.cow-item:hover { |
| 223 | + cursor: pointer; |
| 224 | +} |
| 225 | +.item-imgs { |
| 226 | + margin-top: 9px; |
| 227 | +} |
| 228 | +.item-content { |
| 229 | + letter-spacing: 1.2px; |
| 230 | + text-align: left; |
| 231 | + color: #8b8787; |
| 232 | +} |
| 233 | +.item-content .title { |
| 234 | + font-size: 15px; |
| 235 | + color: #353535; |
| 236 | +} |
| 237 | +.item-content .all-text { |
| 238 | + color: blue; |
| 239 | +} |
| 240 | +.cow-list { |
| 241 | + border: 1px solid #eee; |
| 242 | +} |
| 243 | +</style> |
| 244 | + |
0 commit comments