|
@@ -1,213 +1,178 @@
|
|
|
<template>
|
|
|
- <view :class="['card-item',radius ? 'radius' : '']">
|
|
|
- <view class="item-head">
|
|
|
- <view class="left-info">
|
|
|
- <view class="img-wrap flex-center" @tap="toOthers(item.id)">
|
|
|
- <image :src="item.user.avatar" mode="widthFix" class="avatar"></image>
|
|
|
+ <view class="cu-card dynamic no-card">
|
|
|
+ <view class="cu-item shadow">
|
|
|
+ <view class="cu-list menu-avatar">
|
|
|
+ <view class="cu-item">
|
|
|
+ <image :src="item.user.avatar" mode="widthFix" class="cu-avatar round lg"></image>
|
|
|
+ <view class="content flex-sub">
|
|
|
+ <view>{{ item.user.username }}</view>
|
|
|
+ <view class="text-gray text-sm flex justify-between">
|
|
|
+ {{ item.cdate_string }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="head-name">{{ item.user.username }}</view>
|
|
|
</view>
|
|
|
- <text class="color-nine">{{item.cdate_string}}</text>
|
|
|
- </view>
|
|
|
- <view class="content" @tap="toDetails(item.id)">
|
|
|
- <view class="text-content">{{ item.content }}</view>
|
|
|
- <view class="img-wrap padding-bottom-lg" v-if="item.pic.length == 1">
|
|
|
- <view class="img-box">
|
|
|
- <image v-for="(child, idx) in item.pic" :key="idx" :src="child" mode="widthFix" class="img" @tap.stop @tap="Dever.viewPic([child], child)"></image>
|
|
|
+ <view class="text-content">
|
|
|
+ {{ item.content }}
|
|
|
+ </view>
|
|
|
+ <view v-if="item.pic.length > 0">
|
|
|
+ <view class="grid flex-sub padding-lr col-1" v-if="item.pic.length == 1">
|
|
|
+ <view @tap.stop @tap="Dever.viewPic(item.pic, child)" class="bg-img only-img" :style="{backgroundImage: 'url('+child+')'}"
|
|
|
+ v-for="(child, idx) in item.pic" :key="idx">
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="grid flex-sub padding-lr col-3 grid-square" v-if="item.pic.length > 1">
|
|
|
+ <view @tap.stop @tap="Dever.viewPic(item.pic, child)" class="bg-img" :style="{backgroundImage: 'url('+child+')'}"
|
|
|
+ v-for="(child, idx) in item.pic" :key="idx">
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="img-list padding-bottom-lg" v-if="item.pic.length > 1">
|
|
|
- <view class="img-box" v-for="(child, idx) in item.pic" :key="idx">
|
|
|
- <image :src="child" mode="widthFix" class="img" @tap.stop @tap="Dever.viewPic(item.pic, child)"></image>
|
|
|
+ <view class="text-gray text-sm text-right padding">
|
|
|
+ <view class="icon-display" @click="updateOppose">
|
|
|
+ <text class="cuIcon-flashbuyfill margin-lr-xs" :class="item.is_oppose ? 'text-red' : ''"></text> {{item.num_oppose}}
|
|
|
+ </view>
|
|
|
+ <view class="icon-display" @click="updateUp">
|
|
|
+ <text class="cuIcon-appreciatefill margin-lr-xs" :class="item.is_up ? 'text-red' : ''"></text> {{item.num_up}}
|
|
|
+ </view>
|
|
|
+ <view class="icon-display" @click="updateComment">
|
|
|
+ <text class="cuIcon-messagefill margin-lr-xs"></text> {{item.num_comment}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="bottom-btn padding-bottom-sm">
|
|
|
- <view class="btn-item flex-center">
|
|
|
- <image class="img" src="@/static/img/diary/img_say.png" mode="widthFix"></image>
|
|
|
- <text>{{ item.num_comment }}</text>
|
|
|
+
|
|
|
+ <view class="cu-list menu-avatar comment solids-top">
|
|
|
+ <view class="cu-item">
|
|
|
+ <image src="https://ossweb-img.qq.com/images/lol/img/champion/Morgana.png" mode="widthFix" class="cu-avatar round"></image>
|
|
|
+ <view class="content">
|
|
|
+ <view class="text-grey">莫甘娜</view>
|
|
|
+ <view class="text-gray text-content text-df">
|
|
|
+ 凯尔,你被自己的光芒变的盲目。
|
|
|
+ </view>
|
|
|
+ <view class="bg-grey padding-sm radius margin-top-sm text-sm">
|
|
|
+ <view class="flex">
|
|
|
+ <view>凯尔:</view>
|
|
|
+ <view class="flex-sub">妹妹,你在帮他们给黑暗找借口吗?</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="margin-top-sm flex justify-between">
|
|
|
+ <view class="text-gray text-df">2018年12月4日</view>
|
|
|
+ <view>
|
|
|
+ <text class="cuIcon-appreciatefill text-red"></text>
|
|
|
+ <text class="cuIcon-messagefill text-gray margin-left-sm"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="btn-item flex-center" @tap.stop @tap="handleLike(item.id, item.is_up, item.num_up)">
|
|
|
- <image class="img" v-if="!item.is_up" src="@/static/img/diary/img_zan.png" mode="widthFix"></image>
|
|
|
- <image class="img" v-else src="@/static/img/diary/img_zan_1.png" mode="widthFix"></image>
|
|
|
- <text>{{ item.num_up }}</text>
|
|
|
+
|
|
|
+ <view class="cu-item">
|
|
|
+ <view class="cu-avatar round" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg);"></view>
|
|
|
+ <view class="content">
|
|
|
+ <view class="text-grey">凯尔</view>
|
|
|
+ <view class="text-gray text-content text-df">
|
|
|
+ 妹妹,如果不是为了飞翔,我们要这翅膀有什么用?
|
|
|
+ </view>
|
|
|
+ <view class="bg-grey padding-sm radius margin-top-sm text-sm">
|
|
|
+ <view class="flex">
|
|
|
+ <view>莫甘娜:</view>
|
|
|
+ <view class="flex-sub">如果不能立足于大地,要这双脚又有何用?</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="margin-top-sm flex justify-between">
|
|
|
+ <view class="text-gray text-df">2018年12月4日</view>
|
|
|
+ <view>
|
|
|
+ <text class="cuIcon-appreciate text-gray"></text>
|
|
|
+ <text class="cuIcon-messagefill text-gray margin-left-sm"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="show">
|
|
|
+ <communityPush :title="title" :is_upload="false" @hideModal="hideModal" @getRefresh="getRefresh" :cate_id="cate_id" :type="type" :type_id="type_id"></communityPush>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import communityPush from "@/pages/dream/view/communityPush";
|
|
|
export default {
|
|
|
props: {
|
|
|
- obj: {
|
|
|
+ item: {
|
|
|
type: Object
|
|
|
},
|
|
|
radius:{
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ cate_id : null,
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ communityPush
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- item: this.obj,
|
|
|
+ title : '回复话题',
|
|
|
+ show : false,
|
|
|
showPop: false,
|
|
|
+ type : 20,
|
|
|
+ type_id : 0,
|
|
|
commentList: []
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- obj(val) {
|
|
|
- this.list = val;
|
|
|
- }
|
|
|
- },
|
|
|
methods: {
|
|
|
- handleFollow(id) {
|
|
|
+ handleFollow : function() {
|
|
|
let that = this;
|
|
|
that.item.follow = !that.item.follow;
|
|
|
},
|
|
|
- toDetails(id) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '../../pages/diary/details?id=' + id
|
|
|
- });
|
|
|
- },
|
|
|
- handleLike(id, is_up, num_up) {
|
|
|
+ updateUp : function() {
|
|
|
let that = this;
|
|
|
+ if (that.item.is_oppose) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (that.item.is_up) {
|
|
|
- that.item.num_up;
|
|
|
+ that.item.num_up--;
|
|
|
+ that.item.is_up = false;
|
|
|
} else {
|
|
|
that.item.num_up++;
|
|
|
+ that.item.is_up = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ updateOppose : function() {
|
|
|
+ let that = this;
|
|
|
+ if (that.item.is_up) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (that.item.is_oppose) {
|
|
|
+ that.item.num_oppose--;
|
|
|
+ that.item.is_oppose = false;
|
|
|
+ } else {
|
|
|
+ that.item.num_oppose++;
|
|
|
+ that.item.is_oppose = true;
|
|
|
}
|
|
|
- that.item.is_up = !that.item.is_up;
|
|
|
},
|
|
|
- toOthers() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '../../pages/mine/other'
|
|
|
- });
|
|
|
+ updateComment : function () {
|
|
|
+ this.type = 20;
|
|
|
+ this.type_id = this.item.id;
|
|
|
+ this.show = true;
|
|
|
},
|
|
|
+ hideModal : function () {
|
|
|
+ this.show = false;
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- .flex-center {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- }
|
|
|
- .bottom-btn {
|
|
|
- display: flex;
|
|
|
+.cu-card {
|
|
|
|
|
|
- .btn-item {
|
|
|
- flex: 1;
|
|
|
- color: var(--mainColor);
|
|
|
-
|
|
|
- .img {
|
|
|
- width: 50rpx;
|
|
|
- height: 50rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .padding-bottom-sm {
|
|
|
- padding-bottom: 9px;
|
|
|
- text-align: center;
|
|
|
- padding-top: 12px;
|
|
|
- }
|
|
|
- .radius{
|
|
|
- border-radius: 16rpx;
|
|
|
- }
|
|
|
- .card-item {
|
|
|
- padding: 20rpx 40rpx 0rpx;
|
|
|
- background-color: #ffffff;
|
|
|
- box-shadow: 0 20rpx 40rpx 0 rgba(0, 0, 0, 0.1);
|
|
|
-
|
|
|
- .item-head {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- width: 100%;
|
|
|
- justify-content: space-between;
|
|
|
-
|
|
|
- .left-info {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- .img-wrap {
|
|
|
- width: 80rpx;
|
|
|
- height: 80rpx;
|
|
|
- overflow: hidden;
|
|
|
- border-radius: 50%;
|
|
|
-
|
|
|
- .avatar {
|
|
|
- width: 100%;
|
|
|
- height: 80rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .head-name {
|
|
|
- padding-left: 40rpx;
|
|
|
- color: #666666;
|
|
|
- font-size: 32rpx;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .follow-btn {
|
|
|
- width: 140rpx;
|
|
|
- height: 60rpx;
|
|
|
- border: 1rpx solid var(--mainColor);
|
|
|
- color: var(--mainColor);
|
|
|
- border-radius: 40rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .followed {
|
|
|
- color: #fff;
|
|
|
- background: var(--activeColor);
|
|
|
- border: 1rpx solid var(--activeColor);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .content {
|
|
|
- .text-content {
|
|
|
- padding: 40rpx 0;
|
|
|
- justify-content: space-between;
|
|
|
- color: var(--mainColor);
|
|
|
- font-size: 30rpx;
|
|
|
- text-align: justify;
|
|
|
- }
|
|
|
-
|
|
|
- .img-list {
|
|
|
- display: flex;
|
|
|
- flex-flow: row wrap;
|
|
|
-
|
|
|
- .img-box {
|
|
|
- flex: 0 0 30%;
|
|
|
- margin: 0 1% 1%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- overflow: hidden;
|
|
|
- height: 200rpx;
|
|
|
- border-radius: 4px;
|
|
|
- background-color: #ececec;
|
|
|
-
|
|
|
- .img {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .img-wrap {
|
|
|
- .img-box {
|
|
|
- width: 100%;
|
|
|
- max-height: 400rpx;
|
|
|
- overflow: hidden;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .cont {
|
|
|
- --color: var(--activeColor);
|
|
|
- --count: 1;
|
|
|
- }
|
|
|
+}
|
|
|
+.cu-list.menu-avatar>.cu-item:after, .cu-list.menu>.cu-item:after {
|
|
|
+ border: 0px;
|
|
|
+}
|
|
|
+.icon-display {
|
|
|
+ display: inline;
|
|
|
+ margin-left: 20rpx;
|
|
|
+}
|
|
|
</style>
|