|
@@ -1,26 +1,27 @@
|
|
|
<template name="comment">
|
|
|
<view>
|
|
|
<view class="msgs-tabs">
|
|
|
- <view class="tit">{{name}}</view>
|
|
|
- <view class="num">全部评论(100)</view>
|
|
|
+ <view class="tit">{{item.name}}</view>
|
|
|
+ <view class="num" style="display: none;">全部({{fetch.total}})</view>
|
|
|
</view>
|
|
|
- <view class="living">
|
|
|
+ <view class="living grace-body">
|
|
|
<view class="rich-wrapper">
|
|
|
- <rich-text :nodes="content"></rich-text>
|
|
|
+ <dever-content :item="item.content_array" :pics="item.content_pic"></dever-content>
|
|
|
</view>
|
|
|
<view class="message" @touchstart="stop">
|
|
|
<y-Barrage ref="barrage" @end="reload" :minTime="minTime" :maxTime="maxTime"></y-Barrage>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="send clearfix">
|
|
|
- <input type="text" bindinput="comment" value="" />
|
|
|
- <view class="button primary" bindtap="pushComment">发布</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <y-Fab :bottom="20" :right="140" @click="showModal" bgColor="#0fa5e5" text="发布"></y-Fab>
|
|
|
+ <view v-if="show">
|
|
|
+ <communityPush :title="title" :is_upload="false" @hideModal="hideModal" @getRefresh="getRefresh" :type="type" :type_id="type_id" :api="api"></communityPush>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script>
|
|
|
+import communityPush from "@/pages/dream/view/communityPush";
|
|
|
+import deverContent from '@/lib/dever/components/content.vue';
|
|
|
export default {
|
|
|
name: "comment",
|
|
|
props: {
|
|
@@ -32,44 +33,56 @@ export default {
|
|
|
type : String,
|
|
|
value : null
|
|
|
},
|
|
|
- name : {
|
|
|
- type : String,
|
|
|
+ item : {
|
|
|
+ type : Object,
|
|
|
value : null
|
|
|
- },
|
|
|
- content : {
|
|
|
- type : String,
|
|
|
- value : null
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ api : 'app/community/?l=api.addComment',
|
|
|
+ title : '发表新评论',
|
|
|
minTime : 5,
|
|
|
- maxTime : 10,
|
|
|
- comments: [
|
|
|
- {
|
|
|
- id : 1,
|
|
|
- avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
|
|
|
- username : 'rabin',
|
|
|
- content : 'dfdfdfdf',
|
|
|
- },
|
|
|
- {
|
|
|
- id : 2,
|
|
|
- avatar : 'https://pic.rmb.bdstatic.com/b9279adf974b78d27201a0b34970c2a9.jpeg',
|
|
|
- username : 'test',
|
|
|
- content : '哈哈哈哈或',
|
|
|
- }
|
|
|
- ],
|
|
|
- loading: false
|
|
|
+ maxTime : 10,
|
|
|
+ show : false,
|
|
|
+ fetch : {
|
|
|
+ info : [],
|
|
|
+ },
|
|
|
+ page : 1,
|
|
|
+ load : true,
|
|
|
+ info : [],
|
|
|
+ seconds : 0,
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted() {
|
|
|
+ this.page = 1;
|
|
|
this.getData();
|
|
|
},
|
|
|
methods:{
|
|
|
getData : function() {
|
|
|
var self = this;
|
|
|
- this.Dever.get(this, 'app/community/?l=api.comment', {id:this.id,noloading:1}, function(t) {
|
|
|
- self.$refs.barrage.start(t.info);
|
|
|
+ if (!self.load) {
|
|
|
+ self.$refs.barrage.start(self.info);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.Dever.get(this, 'app/community/?l=api.comment', {id:this.id,noloading:1,page:this.page,type:this.type,type_id:this.type_id,noconcat:1}, function(t) {
|
|
|
+ if (t && t.info && t.info.length > 0) {
|
|
|
+ self.info = self.info.concat(t.info);
|
|
|
+ if (self.page == 1) {
|
|
|
+ self.$refs.barrage.start(t.info);
|
|
|
+ } else {
|
|
|
+ for (var i in t.info) {
|
|
|
+ self.$refs.barrage.add(t.info[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.page++;
|
|
|
+ } else {
|
|
|
+ self.load = false;
|
|
|
+ self.reload();
|
|
|
+ }
|
|
|
+ }, function(e) {
|
|
|
+ self.load = false;
|
|
|
+ self.reload();
|
|
|
});
|
|
|
},
|
|
|
reload : function() {
|
|
@@ -77,8 +90,24 @@ export default {
|
|
|
},
|
|
|
stop : function() {
|
|
|
//this.$refs.barrage.stop();
|
|
|
+ },
|
|
|
+ showModal : function() {
|
|
|
+ this.show = true;
|
|
|
+ },
|
|
|
+ hideModal : function() {
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ getRefresh : function(cate_id, type, type_id, content) {
|
|
|
+ var item = {};
|
|
|
+ item.content = content;
|
|
|
+ this.info.push(item);
|
|
|
+ this.$refs.barrage.add(item);
|
|
|
+ this.hideModal();
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ communityPush,deverContent
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -138,30 +167,6 @@ export default {
|
|
|
.living-tabs>view.cur{
|
|
|
border-bottom: 6rpx solid #000;
|
|
|
}
|
|
|
-.living .send{
|
|
|
- border-bottom: solid 2rpx #f0f0f0;
|
|
|
- padding:0 30rpx 40rpx;
|
|
|
-}
|
|
|
-.living .send input{
|
|
|
- float:left;
|
|
|
- box-sizing: border-box;
|
|
|
- width:540rpx;
|
|
|
- height:60rpx;
|
|
|
- border:solid 2rpx #999999;
|
|
|
- border-radius: 10rpx;
|
|
|
- padding:0 10rpx;
|
|
|
- line-height: 60rpx;
|
|
|
- font-size: 30rpx;
|
|
|
-}
|
|
|
-.living .send .button{
|
|
|
- float:right;
|
|
|
- box-sizing: border-box;
|
|
|
- padding:0;
|
|
|
- width:130rpx;
|
|
|
- min-width: 0;
|
|
|
- height:60rpx;
|
|
|
- line-height: 60rpx;
|
|
|
-}
|
|
|
.living .message{
|
|
|
height:320rpx;
|
|
|
padding:15rpx 0 110rpx;
|
|
@@ -227,54 +232,6 @@ export default {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
}
|
|
|
-
|
|
|
-.console{
|
|
|
- position: fixed;
|
|
|
- bottom:0;
|
|
|
- left:0;
|
|
|
- width:750rpx;
|
|
|
- height:98rpx;
|
|
|
- padding-top:20rpx;
|
|
|
- z-index: 5;
|
|
|
-}
|
|
|
-.console .comment{
|
|
|
- position: absolute;
|
|
|
- top:10rpx;
|
|
|
- left:85rpx;
|
|
|
- background:url(http://www.huoxingkandiqiu.com/files/img/ico-comment.png) no-repeat;
|
|
|
- background-size: 98rpx 98rpx;
|
|
|
- width:98rpx;
|
|
|
- height:98rpx;
|
|
|
-}
|
|
|
-.console .thumbup{
|
|
|
- position: absolute;
|
|
|
- top:10rpx;
|
|
|
- right:85rpx;
|
|
|
-}
|
|
|
-.console .num{
|
|
|
- background: #fff;
|
|
|
- position: absolute;
|
|
|
- top:40rpx;
|
|
|
- right:0;
|
|
|
- width:100rpx;
|
|
|
- height: 40rpx;
|
|
|
- line-height: 40rpx;
|
|
|
- color: #000;
|
|
|
- font-size: 24rpx;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
-.console .unlike{
|
|
|
- background:url(http://www.huoxingkandiqiu.com/files/img/ico-unlike.png) no-repeat;
|
|
|
- background-size: 98rpx 98rpx;
|
|
|
- width:98rpx;
|
|
|
- height:98rpx;
|
|
|
-}
|
|
|
-.console .like{
|
|
|
- background:url(http://www.huoxingkandiqiu.com/files/img/ico-like.png) no-repeat;
|
|
|
- background-size: 98rpx 98rpx;
|
|
|
- width:98rpx;
|
|
|
- height:98rpx;
|
|
|
-}
|
|
|
.mask .layer{
|
|
|
padding:40rpx 30rpx;
|
|
|
}
|
|
@@ -295,46 +252,4 @@ export default {
|
|
|
bottom:20rpx;
|
|
|
left:225rpx;
|
|
|
}
|
|
|
-
|
|
|
-.console .edit{
|
|
|
- background:url(http://www.huoxingkandiqiu.com/files/img/edit.png) no-repeat;
|
|
|
- background-size: 80rpx 80rpx;
|
|
|
- width:80rpx;
|
|
|
- height:80rpx;
|
|
|
- position: absolute;
|
|
|
- left: 135rpx;
|
|
|
- bottom: 30rpx;
|
|
|
-}
|
|
|
-.console .edit.left30{
|
|
|
- left: 30rpx;
|
|
|
-}
|
|
|
-.button {
|
|
|
- height: 80rpx;
|
|
|
- border: 1rpx solid #cc1619;
|
|
|
- color: #cc1619;
|
|
|
- font-size: 30rpx;
|
|
|
- min-width: 300rpx;
|
|
|
- border-radius: 40rpx;
|
|
|
- text-align: center;
|
|
|
- line-height: 80rpx;
|
|
|
- display: block;
|
|
|
- position: relative;
|
|
|
-}
|
|
|
-.button>button{
|
|
|
- position: absolute;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- opacity: 0;
|
|
|
-}
|
|
|
-
|
|
|
-.button.big {
|
|
|
- width: 420rpx;
|
|
|
-}
|
|
|
-
|
|
|
-.button.primary {
|
|
|
- background-color: #000;
|
|
|
- color: #fff;
|
|
|
-}
|
|
|
</style>
|