瀏覽代碼

1.开发快捷评论 2.区分活动与排行榜处理

bayi 2 年之前
父節點
當前提交
85c62da792

+ 10 - 2
components/activityList/index.js

@@ -2,7 +2,12 @@ import {
   getActivities
 } from '~/api/global'
 Component({
-  properties: {},
+  properties: {
+    classify: {
+      type: Number,
+      value: 1
+    }
+  },
   /**
    * 组件的初始数据
    */
@@ -27,7 +32,10 @@ Component({
    */
   methods: {
     async getActivities() {
-      let activityList = await getActivities()
+      let activityList = await getActivities({
+        classify: this.properties.classify
+      })
+      console.log(activityList);
       this.setData({
         activityList
       })

+ 2 - 2
components/activityList/index.wxml

@@ -75,7 +75,7 @@
         </view>
       </view>
     </view>
-    <!--     <view class="activityBox" wx:if="{{item.bannerType==4}}">
+    <view class="activityBox" wx:if="{{item.bannerType==4}}">
       <image src="{{item.icon}}" class="cover-small " />
       <view class="footer">
         <view class="info">
@@ -96,7 +96,7 @@
           '已结束':item.voucherType?'立即使用':'立即领取'}}
         </view>
       </view>
-    </view> -->
+    </view>
   </block>
 </view>
 <!-- <Voucher id="voucher" /> -->

+ 12 - 0
components/comment/index.js

@@ -86,6 +86,18 @@ Component({
         detailDesc: e.detail.value
       })
     },
+    async quickRemark({
+      currentTarget
+    }) {
+      let data = {
+        columnId: this.data.columnId,
+        detailDesc: currentTarget.dataset.remark
+      }
+      await postReply(data)
+      // 评论数+1
+      this.triggerEvent('addCommentNum', this.data.columnId)
+      this.getComment()
+    },
     // 评论作品
     async sendReply() {
       if (!this.data.detailDesc.trim()) {

+ 51 - 0
components/comment/index.less

@@ -134,6 +134,57 @@
       }
     }
 
+    .quick {
+      width: 100%;
+      background-color: #EEEDED;
+
+      .close {
+        text-align: right;
+        font-size: 60rpx;
+        padding: 0rpx 20rpx;
+      }
+
+      .quickTop {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0rpx 20rpx;
+        font-size: 28rpx;
+
+        .left {
+          color: #00000060;
+        }
+
+        .right {
+          padding: 4rpx 20rpx;
+          background-color: #FFC86D;
+          color: #484848;
+          border-radius: 50rpx;
+
+        }
+      }
+
+      .contents {
+        display: flex;
+        align-items: center;
+        padding: 30rpx 0rpx 30rpx 20rpx;
+        width: 100%;
+        box-sizing: border-box;
+        white-space: nowrap;
+        border-bottom: 2rpx solid #9797976e;
+
+        .remark {
+          display: inline-block;
+          font-size: 26rpx;
+          padding: 8rpx 22rpx;
+          margin-right: 20rpx;
+          border-radius: 50rpx;
+          color: white;
+          background-color: #FF9B55;
+        }
+      }
+    }
+
     .footer {
       display: flex;
       align-items: center;

+ 23 - 0
components/comment/index.wxml

@@ -1,5 +1,6 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="commentBox" wx:if="{{show}}">
+<!-- <view class="commentBox"> -->
   <view class="commentBg" catchtap="close" catchtouchmove="true"></view>
   <view class="comment {{tabBarPadding?'seat2':''}}" animation="{{animationData}}">
     <view class="header">
@@ -39,6 +40,28 @@
         </view>
       </view>
     </view>
+    <!-- 快捷回复 -->
+    <view class="quick">
+      <view class="close" catchtap="close">×</view>
+      <view class="quickTop">
+        <view class="left">留下你的赞美,鼓励一下。</view>
+        <view class="right">试试下面的快捷回复吧~</view>
+      </view>
+      <scroll-view class="contents" scroll-x="true" enhanced show-scrollbar="{{false}}">
+        <view class="remark" bindtap="quickRemark" data-remark='你读的也太棒啦!' style="background-color: #FC614E">
+          你读的也太棒啦!
+        </view>
+        <view class="remark" bindtap="quickRemark" data-remark='很优秀,向你学习'>
+          很优秀,向你学习
+        </view>
+        <view class="remark" bindtap="quickRemark" data-remark='挺好的,期待更好' style="background-color: #26B944">
+          挺好的,期待更好
+        </view>
+        <view class="remark" bindtap="quickRemark" data-remark='还可以,继续努力' style="background-color: #7DB2FF">
+          还可以,继续努力
+        </view>
+      </scroll-view>
+    </view>
     <view class="footer">
       <input class="input" bindinput="bindKeyInput" value="{{detailDesc}}" placeholder="留下你的赞美,鼓励一下"
         focus="{{ifGetFocus}}" />

+ 43 - 0
components/comment/index.wxss

@@ -114,6 +114,49 @@
 .commentBox .comment .body .body-box .content:last-child {
   border: none;
 }
+.commentBox .comment .quick {
+  width: 100%;
+  background-color: #EEEDED;
+}
+.commentBox .comment .quick .close {
+  text-align: right;
+  font-size: 60rpx;
+  padding: 0rpx 20rpx;
+}
+.commentBox .comment .quick .quickTop {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 0rpx 20rpx;
+  font-size: 28rpx;
+}
+.commentBox .comment .quick .quickTop .left {
+  color: #00000060;
+}
+.commentBox .comment .quick .quickTop .right {
+  padding: 4rpx 20rpx;
+  background-color: #FFC86D;
+  color: #484848;
+  border-radius: 50rpx;
+}
+.commentBox .comment .quick .contents {
+  display: flex;
+  align-items: center;
+  padding: 30rpx 0rpx 30rpx 20rpx;
+  width: 100%;
+  box-sizing: border-box;
+  white-space: nowrap;
+  border-bottom: 2rpx solid #9797976e;
+}
+.commentBox .comment .quick .contents .remark {
+  display: inline-block;
+  font-size: 26rpx;
+  padding: 8rpx 22rpx;
+  margin-right: 20rpx;
+  border-radius: 50rpx;
+  color: white;
+  background-color: #FF9B55;
+}
 .commentBox .comment .footer {
   display: flex;
   align-items: center;

+ 0 - 7
components/videoPreview/index.js

@@ -307,12 +307,5 @@ Component({
         playStopTime: 1000
       })
     },
-    bindended(e) {
-      this.videoContext = wx.createVideoContext('myVideo')
-      console.log(e, '播放结束', this.videoContext);
-      setTimeout(() => {
-        this.videoContext.seek(2)
-      }, 100)
-    }
   }
 })

+ 1 - 1
components/videoPreview/index.wxml

@@ -59,7 +59,7 @@
     <!-- 播放时渲染的video -->
     <video class="video" id="myVideo" wx:if="{{videoInfoCopy.userRead.id==currentId}}"
       src="{{workType=='videoPath'? videoInfoCopy.userRead.videoPath:videoInfoCopy.example.videoPath}}" autoplay="true"
-      object-fit="contain" bindended='bindended'>
+      object-fit="contain">
     </video>
   </view>
   <!-- 音频 -->

+ 2 - 2
pages/score/index.js

@@ -164,7 +164,7 @@ Page({
               }
             }
           }
-          let peiyin = canvas.createImage();
+         /*  let peiyin = canvas.createImage();
           peiyin.src = '/static/peiyin.jpg';
           peiyin.onload = () => {
             ctx.drawImage(peiyin, 0, 211, 375, 89);
@@ -212,7 +212,7 @@ Page({
                 }
               }
             }
-          }
+          } */
         })
     })
   },

+ 1 - 1
pages/works/index.wxml

@@ -13,7 +13,7 @@
   <worksList wx:if="{{currentType!='7'}}" id="worksList"
     videoType="{{currentType=='4'||currentType=='6'?'follow':'my'}}" worksList="{{list}}" tabBarPadding='true'
     autoPlay='{{false}}' />
-  <activityList wx:if="{{currentType=='7'}}" />
+  <activityList classify='2' wx:if="{{currentType=='7'}}" />
   <emptyBg wx:if="{{nullList}}"
     message="{{currentType=='4'?'您还没有关注的用户哦':currentType=='5'?'您还没有作品哦,赶快去发表吧':'您还没有收藏作品哦'}}"></emptyBg>
 </view>

二進制
static/dengpao.png