Rorschach 6 years ago
parent
commit
d7d7b3e1ad

+ 9 - 1
component/hot/hot.js

@@ -127,7 +127,8 @@ export const hotInit = (that) => {
         temp.classId = item.userRead.id;
         temp.time = formatDate(item.userRead.gmtCreated, 3);
         temp.avatar = item.user.avatar;
-        temp.avatar = item.user.avatar;
+        temp.uid = item.user.uid;
+        // temp.avatar = item.user.avatar;
         temp.nickName = item.user.wechatName;
         // recommendWorks.push(temp);
         that.data.hotData.hotWorks.push(temp);
@@ -154,6 +155,13 @@ export const hotInit = (that) => {
         that.openClass('tap', id);
         break;
     }
+  },
+  that.goToUsers = (e) => {
+    console.log(e)
+    let uid = e.currentTarget.dataset.uid;
+        wx.navigateTo({
+            url: `../../pages/user/myworks/myworks?uid=${uid}`
+        });
   }
   // 下拉加载
   that.scrollUpdate = (e) => {

+ 1 - 1
component/hot/hot.wxml

@@ -48,7 +48,7 @@
         <view class="hotWares">
             <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
                 <view class="topData">
-                    <view class="worksLeft">
+                    <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
                         <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
                         <view class="worksInfo">
                             <view class="authorName">{{item.nickName}}</view>

+ 6 - 1
component/my/my.wxml

@@ -3,7 +3,7 @@
   <view class='mine-container'>
     <view class='follow-details'>
       <view class='follow-info'>
-        <view class='set-msg'>
+        <view class='set-msg' wx:if="{{myData.user.user.wechatName}}">
           <view class='avatar-box'>
             <image class='avatar-image' src='{{ myData.user.user.avatar }}'></image>
             <view class='occupation-title' wx:if="{{myData.user.user.profession}}">{{ myData.user.user.profession }}</view>
@@ -29,6 +29,11 @@
             <view class='edit-text'>修改</view>
           </view>
         </view>
+        <view class='set-msg-temp' hidden="{{myData.user.user.wechatName}}">
+            <view class="placerholder line1"></view>
+            <view class="placerholder line2"></view>
+            <view class="placerholder line3"></view>
+        </view>
       </view>
       <view class='mine-category'>
         <view class='play-count'>

+ 21 - 0
component/my/my.wxss

@@ -296,4 +296,25 @@ image {
   color: #444;
   background: #FFFFFF;
   border-radius: 14rpx;
+}
+
+.set-msg-temp {
+  position: absolute;
+  width: 100%;
+  height: 248rpx;
+}
+
+.placerholder {
+  height: 41rpx;
+  background: rgba(228,255,242,.8);
+  /* background: #E4FFF2; */
+  width: 410rpx;
+  margin-top: 35rpx;
+  margin-left: 220rpx;
+  border-radius: 10rpx;
+
+}
+
+.line1 {
+  width: 300rpx;
 }

+ 28 - 6
component/share/share.js

@@ -28,7 +28,8 @@ Component({
     path: '',
     QRCodeImagePath: '',
     QRCodeImageLocalPath: '',
-    groupPurchaseInfo: {}
+    groupPurchaseInfo: {},
+    animationData: {}
   },
 
   /**
@@ -134,7 +135,6 @@ Component({
             qrCodeId: this.data.shareId
           }
         })
-
       }
       if (this.data.shareType === 'group') {
         console.log(data)
@@ -161,14 +161,36 @@ Component({
           shareFlag: !this.data.shareFlag
         })
       }
+       // 动画测试
+       this.animation = wx.createAnimation({
+        duration: 700,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(0).step();
+      this.setData({
+        animationData:this.animation.export()
+      })
+      // 动画测试
     },
     //关闭弹框
     close: function (e) {
-      console.log(e)
+      this.animation = wx.createAnimation({
+        duration: 400,
+        timingFunction: 'ease',
+      })
+      this.animation.bottom(-300).step();
       this.setData({
-        shareFlag: !this.data.shareFlag,
-        imgUrls: ''
+        animationData:this.animation.export()
+      },()=>{
+        setTimeout(()=>{
+          this.setData({
+            shareFlag: !this.data.shareFlag,
+            imgUrls: ''
+          })
+        },200)
       })
+      
+      
     },
     nothing: function (e) {
       return
@@ -275,7 +297,7 @@ Component({
             ctx.arc(52, 58, 36, 0, 2 * Math.PI, false) 
             ctx.clip(); //剪切头像区域
             ctx.fill('red')
-            ctx.drawImage(this.data.avatar, 15, 22, 72, 72); //插入图片  
+            ctx.drawImage(this.data.avatar, 16, 22, 72, 72); //插入图片  
             ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
             ctx.setFontSize(20)
             ctx.setFillStyle('#fff')

+ 1 - 1
component/share/share.wxml

@@ -1,5 +1,5 @@
 <view class="share" bindtap="close" wx:if="{{shareFlag}}" catchtouchmove='true'>
-   <view class="btn" wx:if="{{!imgUrls}}" id="btnArea" bindtap="nothing">
+   <view class="btn" animation="{{animationData}}" wx:if="{{!imgUrls}}" id="btnArea" bindtap="nothing">
        <image class="bg" src="../../static/groupImg/share.png"></image>
        <view class="share-btn">
             <button class="share-friend" open-type="share" catchtap="shareFriend">

+ 1 - 1
component/share/share.wxss

@@ -11,7 +11,7 @@
 
 .btn {
     position: fixed;
-    bottom: 0;
+    bottom: -300rpx;
     width: 100%;
     height: 290rpx;
     background: #fff;

+ 1 - 1
pages/groupPage/my-group/my-group.wxml

@@ -21,7 +21,7 @@
                         <text wx:if="{{!(item.groupPurchaseOrder.headcount - item.groupPurchaseOrder.joinCount)}}">{{timeList[index]}}</text>
                     </view>
                     <view class="jion-btn {{item.groupPurchaseOrder.status =='SUCCESSED' ? 'success-bg' : ''}}"  bindtap="collageDetails" data-ind="{{index}}" data-num="{{item.groupPurchaseOrder.status==='SUCCESSED'}}" data-orderId="{{item.groupPurchaseOrder.id}}" data-groupId="{{item.groupPurchaseOrder.groupId}}" data-productId="{{item.groupPurchaseOrder.productId}}" data-uid="{{item.groupPurchaseOrder.organizer}}">
-                        {{item.groupPurchaseOrder.status =='SUCCESSED' ? '已成功' : '去参团'}}
+                        {{item.groupPurchaseOrder.status =='SUCCESSED' ? '已成功' : '进行中'}}
                     </view>
                 </view>
                 </view>

+ 5 - 5
pages/social/works/works.js

@@ -58,14 +58,14 @@ Page({
         // this.data.stackSize >= 2
         console.log(this.data.stackSize)
         if (this.innerAudioContext) {
-            this.innerAudioContext.stop();
+            this.innerAudioContext.pause();
         }
         let videoCtx = wx.createVideoContext('worksVideo', this);
         videoCtx.stop();
     },
     onUnload: function () {
         if (this.innerAudioContext) {
-            this.innerAudioContext.stop();
+            this.innerAudioContext.pause();
         }
         let videoCtx = wx.createVideoContext('worksVideo', this);
         videoCtx.stop();
@@ -164,8 +164,9 @@ Page({
         this.innerAudioContext.play();
         httpRequestApi.playWorks(this.uid, this.data.id);
     },
+    // 视频播放完毕销毁录音
     videoEnd: function () {
-        this.innerAudioContext.stop();
+        this.innerAudioContext.destroy();
     },
     videoPause: function () {
         this.innerAudioContext.pause();
@@ -256,7 +257,7 @@ Page({
         // let uid = wx.getStorageSync('uid');
         let followUid = e.currentTarget.dataset.id;
         let index = e.currentTarget.dataset.index;
-        httpRequestApi.likeCommend(this.uid, followUid).success(res => {
+        httpRequestApi.likeCommend(this.uid, followUid).success(res => {            
             console.log(res);
             const str = `replyList[${index}].likes`;
             this.setData({
@@ -267,7 +268,6 @@ Page({
     // 去用户主页
     goToUsers: function (e) {
         let uid = e.currentTarget.dataset.uid;
-        console.log(uid);
         wx.navigateTo({
             url: `../../user/myworks/myworks?uid=${uid}`
         });

+ 9 - 1
pages/user/myworks/myworks.js

@@ -12,7 +12,8 @@ Page({
     totalNo: 0,
     uid: '',
     worksList: [],
-    isFans: false
+    isFans: false,
+    isMyself: false,
   },
   toMyWorks: function(e){
     let id = e.currentTarget.dataset.id;
@@ -54,10 +55,12 @@ Page({
     let uid = this.data.uid;
     console.log('用户身份',uid);
     APIClient.getUserMsg(uid, pageNo, pageSize).success(res => {
+      res.data.data.user.birthday = formatDate(res.data.data.user.birthday,4)
       this.setData({
         wareCards: res.data.data,
         isFans: res.data.data.like 
       });
+      console.log(this.data.wareCards)
       // wx.hideToast();
     }).fail(err => {
       console.log(err);
@@ -76,6 +79,11 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    if(options.uid === wx.getStorageSync('uid')){
+      this.setData({
+        isMyself: true
+      })
+    }
     this.setData({
       uid: options.uid
     },() => {

+ 2 - 3
pages/user/myworks/myworks.wxml

@@ -21,13 +21,12 @@
             <view class='flowers-box' wx:elif='{{ wareCards.user.gender === 1 }}'>
               <image src='../../../static/image/boy.png'></image>
             </view>
-            <view wx:else class='gender-size'>未知</view>
           </view>
-          <view class='avatar-birthday'>{{ format.getBirthday(wareCards.user.birthday) }}</view>
+          <view class='avatar-birthday'>{{ wareCards.user.birthday }}</view>
           <view class='avatar-address'>{{ wareCards.user.schoolName }}</view>
         </view>
       </view>
-      <view class="follow">
+      <view class="follow" wx:if="{{!isMyself}}">
         <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
         <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
       </view>