dever 5 年之前
父节点
当前提交
db8a66a4df
共有 3 个文件被更改,包括 29 次插入42 次删除
  1. 26 39
      lib/community/y-DiaryItem/y-DiaryItem.vue
  2. 2 2
      pages/dream/view/community.vue
  3. 1 1
      pages/dream/view/communityPush.vue

+ 26 - 39
lib/community/y-DiaryItem/y-DiaryItem.vue

@@ -36,27 +36,27 @@
 				<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">
+				<view class="icon-display"  @click="updateComment(20, item.id)">
 					<text class="cuIcon-messagefill margin-lr-xs"></text> {{item.num_comment}}
 				</view>
 			</view>
 
-			<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="cu-list menu-avatar comment solids-top" v-if="fetch.info.length">
+				<view class="cu-item" v-for="(v, k) in fetch.info" :key="k">
+					<image :src="v.user.avatar" mode="widthFix" class="cu-avatar round"></image>
 					<view class="content">
-						<view class="text-grey">莫甘娜</view>
-						<view class="text-gray text-content text-df">
-							凯尔,你被自己的光芒变的盲目。
+						<view class="text-grey">{{v.user.username}}</view>
+						<view class="text-grays text-content text-df">
+							{{v.content}}
 						</view>
-						<view class="bg-grey padding-sm radius margin-top-sm  text-sm">
+						<view class="bg-greys 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 class="text-gray text-df">{{v.cdate_string}}</view>
 							<view>
 								<text class="cuIcon-appreciatefill text-red"></text>
 								<text class="cuIcon-messagefill text-gray margin-left-sm"></text>
@@ -64,29 +64,6 @@
 						</view>
 					</view>
 				</view>
-
-				<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">
@@ -111,6 +88,9 @@
 		components:{
 			communityPush
 		},
+		mounted() {
+			this.getData(1, 20, this.item.id);
+		},
 		data() {
 			return {
 				title : '回复话题',
@@ -118,13 +98,20 @@
 				showPop: false,
 				type : 20,
 				type_id : 0,
-				commentList: []
+				fetch: {
+					info : [],
+				},
 			};
 		},
 		methods: {
-			handleFollow : function() {
-				let that = this;
-				that.item.follow = !that.item.follow;
+			getRefresh : function(cate_id, type, type_id) {
+				this.getData(1, type, type_id);
+			},
+			getData : function(page, type, type_id) {
+				var self = this;
+				this.Dever.get(this, 'app/community/?l=api.info', {cate_id:self.cate_id, type:type, type_id:type_id}, function(t) {
+					self.hideModal();
+				});
 			},
 			updateUp : function() {
 				let that = this;
@@ -152,9 +139,9 @@
 					that.item.is_oppose = true;
 				}
 			},
-			updateComment : function () {
-				this.type = 20;
-				this.type_id = this.item.id;
+			updateComment : function (type, type_id) {
+				this.type = type;
+				this.type_id = type_id;
 				this.show = true;
 			},
 			hideModal : function () {

+ 2 - 2
pages/dream/view/community.vue

@@ -73,8 +73,8 @@ export default {
 		
 	},
 	methods:{
-		getRefresh : function() {
-			this.getData(this.cate_id, 1);
+		getRefresh : function(cate_id, type, type_id) {
+			this.getInfo(cate_id, 1);
 		},
 		getData : function() {
 			var self = this;

+ 1 - 1
pages/dream/view/communityPush.vue

@@ -101,7 +101,7 @@
 			},
 			
 			getRefresh : function() {
-				this.$emit('getRefresh');
+				this.$emit('getRefresh', this.cate_id, this.type, this.type_id);
 			}
 		}
 	}