<view v-for="(item, key) in DataSource" :key="key">
<view :class="'content-view '+ (isCompanyAll?'hide1':'show1')">
<text class="content">{{item.content}}</text>
</view>
<view v-if="isCompanyMore" @tap="change" class="state" :data-index="index">{{item.isF?'查看完整信息':'收起信息'}}
<image class="horn"
:src="(item.isF? '/static/images/details_down.png' : '/static/images/details_up.png')"></image>
</view>
</view>
export default {
data() {
return {
isf: '',
isCompanyAll: true,
DataSource: '',
}
},
onShow: function() {
var self = this;
var query = uni.createSelectorQuery().in(self);
setTimeout(function() {
query.select('.user-content').boundingClientRect(res => {
if (res && res.height < 250) {
self.setData({
isCompanyMore: false
});
}
}).exec();
}, 2000);
},
methods: {
change: function(e) {
var that = this;
that.isCompanyAll = !that.isCompanyAll;
var DataSource = that.DataSource;
var row = DataSource[0];
row.isF = !row.isF;
that.setData({
DataSource: DataSource,
})
},
}
}
.content-view{
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp:3;
overflow: hidden;text-overflow:ellipsis;}
.content{font-size: 26rpx;line-height: 34rpx;color: #666;}
.state{width: 100%;text-align: center;color: #999;padding-top: 15rpx;
font-size: 26rpx;line-height: 60rpx;}
.hide1{display: -webkit-box;}
.show1{display: block}
.horn{width: 30rpx;height: 30rpx;display: inline-block;vertical-align: middle;margin-top: -4rpx;margin-left: 5rpx;}