index.vue 2.05 KB
Newer Older
程智春 committed
1 2 3 4 5 6 7 8 9
<template>
  <!-- 评论模块 -->
  <div class="livedIsMsg">
    <div class="list">
      <scroll-view :style="{'max-height': '24vh','width':'52vw'}" :scroll-y="true" :scroll-top="scrollTop" :scroll-with-animation="true"  @scrolltolower="scrolltolower">
        <div class="item flex" v-for="(item,index) in commentsList" :key="index">
          <div class="user">
            <p class="live"></p>
            <div class="name">
程智春 committed
10
              <span>{{item.customerName}}</span><span class="test">{{item.guestbookContent}}</span>
程智春 committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
            </div>
          </div>
        </div>
      </scroll-view>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  name: "",
  props:{
    id:{
      type:Number,
      default:0
    },
    commentsList:{
      type:Array,
      default:null
程智春 committed
30 31 32 33 34 35
    },
    updateVal:{
      type:{
        type:Number,
        default:0
      }
程智春 committed
36 37 38 39
    }
  },
  data() {
    return {
程智春 committed
40
      list: [],
程智春 committed
41 42 43
      scrollTop:0,
    };
  },
程智春 committed
44 45 46 47 48
  watch:{
    updateVal(){
      this.scrollTop=this.commentsList.length*1000;
    }
  },
程智春 committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

  onLoad(){

  },
  methods: {
    scrolltolower(){
      
    },
  }
};
</script>

<style lang="scss" scoped>
/* 一行否则出现省略号 */
.line-clamp1 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.livedIsMsg {
  padding: 8px;
  margin-bottom: 10px;
  position: fixed;
  left: 12px;
  bottom: 20vh;
  .list {
    width: 50vw;
    overflow: hidden;
    bottom: 0;
    padding-left: 10px;
程智春 committed
81
    border-radius: 9px;
程智春 committed
82 83
    .item {
      width: 50vw;
程智春 committed
84 85
      border-radius: 9px;
      margin-bottom: 4px;
程智春 committed
86
      .user {
程智春 committed
87 88 89 90 91 92 93
        max-width: 50vw;
        padding: 4px 8px;
        display: inline-block;
        line-height: 18px;
        border-radius: 9px;
        background-color: rgba(0,0,0,0.3);
        box-sizing: border-box;
程智春 committed
94 95 96 97 98 99 100 101 102 103 104 105 106 107
        .name {
          color: #f9a93c;
          font-size: 12px;
        }
      }
      .test {
        font-size: 12px;
        color: #f1f1f1;
        word-break: break-all;
      }
    }
  }
}
</style>