bayi vor 2 Jahren
Ursprung
Commit
e7ab976131

+ 8 - 1
components/comment/index.js

@@ -145,6 +145,13 @@ Component({
         [str]: res,
         [strImg]: true
       })
-    }
+    },
+    jumpUserInfo({
+      currentTarget
+    }) {
+      wx.navigateTo({
+        url: `/pages/personal/index?uid=${currentTarget.dataset.uid}&type=user`,
+      })
+    },
   }
 })

+ 1 - 1
components/comment/index.wxml

@@ -9,7 +9,7 @@
     <view class="body" bindtap="cancelId">
       <view class="body-box">
         <view class="content" wx:for="{{list}}" wx:key="id">
-          <image src="{{item.user.avatar}}" class="c-avatar" />
+          <image src="{{item.user.avatar}}" class="c-avatar" data-uid='{{item.user.uid}}' bindtap="jumpUserInfo" />
           <view class="c-right">
             <view class="nickName">
               {{item.user.nickName||item.user.eid}}

+ 19 - 3
components/videoPreview/index.js

@@ -39,14 +39,18 @@ Component({
           newVal.userRead.title = newVal.userRead.title.split('\n')
         }
         this.setData({
-          videoInfoCopy: newVal
+          videoInfoCopy: newVal,
+          isOfficial: newVal.userRead.type != 'APP_EXAMPLE'
         })
       }
     },
     videoType: {
       type: String,
-      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,excellent是优秀作品展播
+      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,
       value: 'public',
+      observer(val) {
+        console.log(val);
+      }
     },
     currentId: {
       type: Number
@@ -63,6 +67,7 @@ Component({
   data: {
     selfUid: wx.getStorageSync('uid'),
     videoInfoCopy: {},
+    isOfficial: false
   },
   lifetimes: {
     attached() {
@@ -247,7 +252,18 @@ Component({
         })
       }
       let readId = videoInfo.userRead.id
-      let url = this.properties.videoType == 'excellent' ? `/pages/pkPage/index?videoId=${readId}` : `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}&readingType=${this.properties.videoType}`
+      let videoType = this.properties.videoType
+      let url = ''
+      if (!this.data.isOfficial || this.data.selfUid == videoInfo.user.uid) {
+        url = `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}`
+      } else if (videoType == 'public' || videoType == 'follow') {
+        url = `/pages/pkPage/index?videoId=${readId}`
+      } else if (videoType == 'pk') {
+        url = `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}&readingType=${videoType}`
+      } else {
+        url = `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}`
+      }
+      console.log(url);
       wx.navigateTo({
         url
       })

+ 8 - 13
components/videoPreview/index.wxml

@@ -8,6 +8,7 @@
         <view class="time">{{videoInfoCopy.userRead.day}}</view>
       </view>
     </view>
+    <!-- 用户本人作品的右侧 -->
     <view class="wH-right" wx:if="{{videoType=='my'&&videoInfoCopy.userRead.status!='CHECK'}}">
       <view class="wH-right-btn" bindtap="download">
         <image class="img" src="/static/down.png" mode="" />
@@ -25,14 +26,13 @@
         </view>
       </view>
     </view>
-    <view class="wH-right"
-      wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid||videoType=='excellent'&&selfUid!=videoInfoCopy.user.uid}}">
+    <view class="wH-right" wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid}}">
       <view class="follow {{videoInfoCopy.isFans?'isFans':''}}" bindtap="setFans">
         <image src="{{videoInfoCopy.isFans?'/static/follow_2.png':'/static/follow_1.png'}}" class="character" mode="" />
         <text class="text">{{videoInfoCopy.isFans?'已关注':'关注'}}</text>
       </view>
     </view>
-    <view class="wH-right" wx:elif="{{videoType=='pk'}}">
+    <view class="wH-right" wx:elif="{{videoType=='pk'&&isOfficial||videoType=='follow'&&isOfficial}}">
       <view class="pkNum">
         {{videoInfoCopy.userRead.score>=0?videoInfoCopy.userRead.score+'分':''}}
       </view>
@@ -106,14 +106,9 @@
       <view class="icon-name">{{filters.numFilter(videoInfoCopy.userRead.likeAmount)}}</view>
     </view>
   </view>
-  <block wx:if="{{videoType!='my'}}">
-    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfoCopy.userRead.type=='READ'}}">
-      <image src="/static/reading.png" class="reading" mode="" />
-      <view class="reading-text">挑战PK</view>
-    </view>
-    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfoCopy.userRead.type=='APP_EXAMPLE'}}">
-      <image src="/static/reading.png" class="reading" mode="" />
-      <view class="reading-text">去朗读</view>
-    </view>
-  </block>
+  <view class="toReading" bindtap="toPkPage" wx:if="{{videoType!='my'}}">
+    <image src="/static/reading.png" class="reading" mode="" />
+    <view class="reading-text" wx:if="{{videoInfoCopy.userRead.type=='READ'}}">挑战PK</view>
+    <view class="reading-text" wx:if="{{!isOfficial}}">去朗读</view>
+  </view>
 </view>

+ 4 - 1
components/worksList/index.js

@@ -52,8 +52,11 @@ Component({
     },
     videoType: {
       type: String,
-      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,collection为收藏时的样式,excellent优秀作品展播
+      // value 为public时是默认公共样式,为my时为“我的”样式,展示下载删除是否公开,pk为pk的样式文案,collection为收藏时的样式,
       value: 'public',
+      observer(val) {
+        console.log(val);
+      }
     },
     // 是否在tabbar页面使用
     tabBarPadding: {

+ 1 - 1
pages/index/index.wxml

@@ -31,7 +31,7 @@
   <view class="{{isFixed?'brace':''}}" />
   <!-- 优秀作品展播及官方推荐列表组件 -->
   <worksList id="worksList" wx:if="{{currentType!='3'}}" worksList="{{list}}"
-    videoType="{{currentType=='2'?'excellent':'public'}}" tabBarPadding='true' />
+    videoType="public" tabBarPadding='true' />
   <activityList wx:if="{{currentType=='3'}}" />
 </view>
 <canvas id='share' type="2d"> </canvas>

+ 57 - 52
pages/rankIntro/index.js

@@ -1,68 +1,73 @@
 Page({
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        explain: ""
-    },
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad(options) {
-        wx.setNavigationBarTitle({
-            title: options.title
-        })
-        this.setData({
-            explain: options.img
-        })
-    },
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    explain: ""
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    wx.setNavigationBarTitle({
+      title: options.title
+    })
+    this.setData({
+      explain: options.img
+    })
+  },
 
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady() {
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
 
-    },
+  },
 
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow() {
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
 
-    },
+  },
 
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide() {
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
 
-    },
+  },
 
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload() {
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
 
-    },
+  },
 
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
 
-    },
+  },
 
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
 
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage() {
+  },
 
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+    const user = wx.getStorageSync('user');
+    return {
+      title: '自从用了它,家里朗朗书声,美妙极了!你家孩子也快来试试!',
+      path: `/pages/index/index?uid=${user.uid}`,
+      imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg'
     }
+  }
 })

+ 1 - 1
pages/works/index.wxml

@@ -8,7 +8,7 @@
     <view class="type {{currentType=='5'?'currentType':''}}" data-type='5'>我的作品</view>
   </view>
   <!-- 优秀作品展播及官方推荐列表组件 -->
-  <worksList id="worksList" videoType="{{currentType=='4'?'pk':'my'}}" worksList="{{list}}" tabBarPadding='true'
+  <worksList id="worksList" videoType="{{currentType=='4'?'follow':'my'}}" worksList="{{list}}" tabBarPadding='true'
     autoPlay='{{false}}' />
   <emptyBg wx:if="{{nullList}}" message="{{currentType=='4'?'您还没有关注的用户哦':'您还没有作品哦,赶快去发表吧'}}"></emptyBg>
 </view>