| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- <template>
- <div class="topicCell" :class="{topicCellMobile: mobile}" @click="clickArt(art, index)" :style="{marginLeft:
- left+'px'}">
- <div class="leftArea" :class="{noePic: !art.cover_url}">
- <div class="topicTitle">
- {{art.title}}
- </div>
- <div class="bottomArea">
- <div class="left" >
- <div class="userInfo">
- <img :src="info.icon_url || info.iconUrl">
- <div>{{info.nickname}}</div>
- </div>
- <div class="publishTime">
- <div>{{formatPublichTime(art.updated_at)}}</div>
- </div>
- </div>
- <div class="right">
- <div class="zan">
- <div class="icon"/>
- <div class="num">{{art.like_count}}</div>
- </div>
- <div class="comment">
- <div class="icon" />
- <div class="num">{{art.reply_count}}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="rightArea" v-if="art.cover_url">
- <img :src="art.cover_url">
- </div>
- </div>
- </template>
- <script>
- export default {
- props: [ "art", "formatPublichTime", "mobile", "info", 'left' ],
- components: {},
- data() {
- return {
- }
- },
- computed: {},
- created() {
- },
- mounted() {
- },
- methods: {
- /**
- * 点击文章
- */
- clickArt(art, index) {
- location.href = `/p/${art.hash_id}`;
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../../assets/css/scssCommon.scss";
- .topicCell {
- margin: 0 auto;
- width:738px;
- height:174px;
- background:rgba(255,255,255,1);
- box-shadow:0px 0px 0px 0px rgba(0,0,0,0.1);
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-sizing: border-box;
- padding: 30px 20px;
- .leftArea {
- width: 528px;
- height: 114px;
- display: flex;
- justify-content: space-between;
- align-items: left;
- flex-direction: column;
- &.noePic {
- width: 100%;
- padding-right: 0;
- }
- .topicTitle {
- height: 50px;
- font-size: 18px;
- font-weight:600;
- color:rgba(51,51,51,1);
- line-height: 25px;
- width: 100%;
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- word-break: break-all;
- }
- .bottomArea {
- width: 100%;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .left {
- display: flex;
- align-items: center;
- .userInfo {
- display: flex;
- align-items: center;
- img {
- width: 24px;
- height: 24px;
- border-radius: 50%;
- }
- div {
- margin-left: 4px;
- height:17px;
- font-size:12px;
- font-weight:500;
- color:rgba(34,34,34,1);
- line-height:17px;
- }
- }
- .publishTime {
- margin-left: 10px;
- padding-left: 10px;
- height:17px;
- font-size:12px;
- font-weight:400;
- color:rgba(218,218,218,1);
- line-height:17px;
- border-left: 1px solid #ededed;
- /*transform-origin:left center;*/
- /*transform: scale(0.83);*/
- word-break: keep-all;
- white-space: nowrap;
- }
- }
- .right {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .zan, .comment {
- margin-left: 23px;
- display: flex;
- align-items: center;
- .icon {
- width: 16px;
- height: 16px;
- background: url("~@/assets/quan/icon/zan.png") no-repeat;
- background-size: cover;
- }
- .num {
- margin-left: 1px;
- height:18px;
- font-size:13px;
- font-weight:500;
- color:rgba(153,153,153,1);
- line-height:18px;
- word-break: keep-all;
- white-space: nowrap;
- }
- }
- .comment {
- margin-left: 12px;
- .icon {
- background: url("~@/assets/quan/icon/common.png") no-repeat;
- background-size: cover;
- }
- }
- }
- }
- }
- .rightArea {
- flex-shrink: 0;
- font-size: 0;
- width:154px;
- height:114px;
- img {
- width:154px;
- height:114px;
- border-radius:2px;
- }
- }
- }
- .topicCellMobile {
- margin: 0 auto;
- width: pxtovw(355);
- height: pxtovw(118);
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-sizing: border-box;
- padding: pxtovw(10) 0 pxtovw(19) 0;
- .leftArea {
- width: pxtovw(226);
- height: pxtovw(89);
- display: flex;
- justify-content: space-between;
- align-items: left;
- flex-direction: column;
- &.noePic {
- width: 100%;
- padding-right: 0;
- }
- .topicTitle {
- height: pxtovw(42);
- font-size:pxtovw(14);
- font-weight:600;
- color:rgba(51,51,51,1);
- line-height:pxtovw(21);
- width: 100%;
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- word-break: break-all;
- }
- .bottomArea {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .left {
- display: flex;
- align-items: center;
- .userInfo {
- display: flex;
- align-items: center;
- img {
- width: pxtovw(17);
- height: pxtovw(17);
- border-radius: 50%;
- }
- div {
- margin-left: pxtovw(5);
- height:pxtovw(14);
- font-size:pxtovw(10);
- font-weight:500;
- color:rgba(102,102,102,1);
- line-height:pxtovw(14);
- transform-origin:left center;
- transform: scale(0.83);
- word-break: keep-all;
- white-space: nowrap;
- }
- }
- .publishTime {
- margin-left: pxtovw(4);
- padding-left: pxtovw(10);
- height:pxtovw(14);
- font-size:pxtovw(10);
- font-weight:400;
- color:rgba(218,218,218,1);
- line-height:pxtovw(14);
- border-left: 1px solid #ededed;
- transform-origin:left center;
- transform: scale(0.83);
- word-break: keep-all;
- white-space: nowrap;
- max-width: pxtovw(80);
- }
- }
- .right {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .zan, .comment {
- display: flex;
- align-items: center;
- .icon {
- width: pxtovw(13);
- height: pxtovw(13);
- background: url("~@/assets/quan/icon/zan.png") no-repeat;
- background-size: cover;
- }
- .num {
- margin-left: pxtovw(2);
- font-size:10px;
- font-weight:500;
- color:rgba(153,153,153,1);
- line-height:14px;
- transform-origin:left center;
- transform: scale(0.83);
- word-break: keep-all;
- white-space: nowrap;
- }
- }
- .comment {
- margin-left: pxtovw(8);
- .icon {
- background: url("~@/assets/quan/icon/common.png") no-repeat;
- background-size: cover;
- }
- }
- }
- }
- }
- .rightArea {
- flex-shrink: 0;
- font-size: 0;
- width: pxtovw(120);
- height: pxtovw(89);
- img {
- width: pxtovw(120);
- height: pxtovw(89);
- }
- }
- }
- </style>
|