dever 4 роки тому
батько
коміт
9c611ae024
1 змінених файлів з 10 додано та 10 видалено
  1. 10 10
      pages/dream/view/momentItem.vue

+ 10 - 10
pages/dream/view/momentItem.vue

@@ -9,15 +9,15 @@
 			<view class="paragraph">{{item.content}}</view>
 			<!-- 相册 -->
 			<view class="thumbnails" v-if="item.pic.length > 0 && item.pic[0]">
-				<view :class="item.pic.length === 1?'my-gallery':'thumbnail'" v-for="(v1, k1) in item.pic" :key="k1">
-					<image class="gallery_img" lazy-load mode="aspectFill" :src="v1" :data-src="v1" @tap="Dever.viewPic(item.pic, v1)"></image>
+				<view :class="item.pic.length === 1?'my-gallery':'thumbnail'" v-for="(v, k) in item.pic" :key="k">
+					<image class="gallery_img" lazy-load mode="aspectFill" :src="v" :data-src="v" @tap="Dever.viewPic(item.pic, v)"></image>
 				</view>
 			</view>
 			<!-- 资料条 -->
 			<view class="toolbar">
 				<view class="timestamp">{{item.cdate_string}}</view>
-				<view class="like" @tap="like(k)">
-					<image src="@/static/moment/islike.png" style="width: 30px;"></image>
+				<view class="like" @tap="updateUp(item)">
+					<image :src="item.is_up ? '../../static/moment/like.png' : '../../static/moment/islike.png'" style="width: 30px;"></image>
 				</view>
 				<view class="comment" @tap="updateComment(item.id)">
 					<image src="@/static/moment/comment.png" style="width: 30px;"></image>
@@ -27,11 +27,11 @@
 			<view class="post-footer">
 				<view class="footer_content">
 					<image class="liked" src="@/static/moment/liked.png"></image>
-					<!--<text class="nickname" v-for="(user,index_like) in post.like" :key="index_like">{{user.username}}</text>-->
+					<text class="nickname" v-for="(v, k) in item.up_list" :key="k">{{v.username}}</text>
 				</view>
-				<view v-if="item.child.length" class="footer_content" v-for="(v2, k2) in item.child" :key="k2" @tap="reply(k,k2)">
-					<text class="comment-nickname">{{v2.user.username}}: </text>
-					<text class="comment-content">{{v2.content}}</text>
+				<view v-if="item.child.length" class="footer_content" v-for="(v, k) in item.child" :key="k" @tap="reply()">
+					<text class="comment-nickname">{{v.user.username}}: </text>
+					<text class="comment-content">{{v.content}}</text>
 				</view>
 				<view class="text-grey flex solid-bottom padding justify-center more" style="padding: 8rpx;" @click="getMore" v-if="item.child_total > 1">{{more}}</view>
 			</view>
@@ -131,7 +131,7 @@
 					item.num_up++;
 					item.is_up = true;
 				}
-				self.Dever.post('app/community/?l=api.up', {id:item.id,noloading:1});
+				self.Dever.post('app/community/?l=api.up', {id:item.id,type:this.type,noloading:1});
 			},
 			updateOppose : function(item) {
 				var self = this;
@@ -145,7 +145,7 @@
 					item.num_oppose++;
 					item.is_oppose = true;
 				}
-				self.Dever.post('app/community/?l=api.oppose', {id:item.id,noloading:1});
+				self.Dever.post('app/community/?l=api.oppose', {id:item.id,type:this.type,noloading:1});
 			},
 			updateComment : function (type_id, to_id, to_uid) {
 				this.type = this.type;