Authored by 杨延青

Merge branch 'feature/0330' into 'release/6.8.8'

Feature/0330



See merge request !25
1 <template> 1 <template>
2 - <img v-lazy="currentSrc" :alt="alt" v-if="currentLazy">  
3 - <img :src="currentSrc" :alt="alt" v-else lazy="" data-src=""> 2 + <img v-lazy="currentSrc" :alt="alt" v-if="currentLazy" @error="onError">
  3 + <img :src="currentSrc" :alt="alt" v-else lazy="" data-src="" @error="onError">
4 </template> 4 </template>
5 5
6 <script> 6 <script>
@@ -61,6 +61,11 @@ export default { @@ -61,6 +61,11 @@ export default {
61 .replace('{width}', this.width) 61 .replace('{width}', this.width)
62 .replace('{height}', this.height); 62 .replace('{height}', this.height);
63 } 63 }
  64 + },
  65 + methods: {
  66 + onError() {
  67 + this.$emit('error');
  68 + }
64 } 69 }
65 }; 70 };
66 </script> 71 </script>
1 <template> 1 <template>
2 - <ImageFormat :lazy="lazy" class="img-avatar" :src="imageSrc" :width="width" :height="height"></ImageFormat> 2 + <ImageFormat :lazy="lazy" class="img-avatar" :src="imageSrc" :width="width" :height="height" @error="errorHandle"></ImageFormat>
3 </template> 3 </template>
4 4
5 <script> 5 <script>
@@ -23,9 +23,20 @@ export default { @@ -23,9 +23,20 @@ export default {
23 default: false 23 default: false
24 } 24 }
25 }, 25 },
  26 + data() {
  27 + return {
  28 + imgSrc: this.src,
  29 + defaultSrc: '//img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png?imageView/2/w/{width}/h/{height}'
  30 + };
  31 + },
26 computed: { 32 computed: {
27 imageSrc() { 33 imageSrc() {
28 - return this.src || '//img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png?imageView/2/w/{width}/h/{height}'; 34 + return this.imgSrc || this.defaultSrc;
  35 + }
  36 + },
  37 + methods: {
  38 + errorHandle() {
  39 + this.imgSrc = this.defaultSrc;
29 } 40 }
30 } 41 }
31 }; 42 };
@@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
16 </p> 16 </p>
17 </div> 17 </div>
18 <div class="option-btn" :class="{'follow': item.isAttention}"> 18 <div class="option-btn" :class="{'follow': item.isAttention}">
19 - <WidgetFollow class="click-wrap" :author-uid="item.authorUid" :author-type="item.authorType" :follow="item.isAttention" @on-follow="follow => onFollow(follow, index)"></WidgetFollow>  
20 - {{item.isAttention ? '取消关注' : followName}} 19 + <WidgetFollow class="click-wrap" :author-uid="item.userId" :author-type="item.userType" :follow="item.isAttention" @on-follow="follow => onFollow(follow, index)"></WidgetFollow>
  20 + {{item.isAttention ? '已关注' : followName}}
21 </div> 21 </div>
22 </div> 22 </div>
23 </div> 23 </div>
@@ -136,8 +136,13 @@ export default { @@ -136,8 +136,13 @@ export default {
136 } 136 }
137 137
138 .name { 138 .name {
  139 + max-width: 370px;
139 font-size: 28px; 140 font-size: 28px;
140 line-height: 1.4; 141 line-height: 1.4;
  142 + display: block;
  143 + overflow: hidden;
  144 + text-overflow: ellipsis;
  145 + white-space: nowrap;
141 } 146 }
142 147
143 .extra { 148 .extra {