瀏覽代碼

创建朗读页面

bayi 2 年之前
父節點
當前提交
66ffc366a8

+ 1 - 0
app.json

@@ -1,6 +1,7 @@
 {
     "pages": [
         "pages/index/index",
+        "pages/reading/index",
         "pages/pkPage/index",
         "pages/userWorks/index",
         "pages/my/index",

+ 3 - 1
components/videoPreview/index.js

@@ -175,8 +175,10 @@ Component({
             this.triggerEvent('setListFans', this.properties.videoInfo.user.uid)
         },
         toPkPage() {
+            let readId = this.data.videoInfoCopy.userRead.id
+            let url = this.properties.videoType == 'public' ? `/pages/pkPage/index?videoId=${readId}` : `/pages/reading/index?videoId=${readId}`
             wx.navigateTo({
-                url: `/pages/pkPage/index?videoId=${this.data.videoInfoCopy.userRead.id}`,
+                url
             })
         }
     }

+ 1 - 1
components/videoPreview/index.wxml

@@ -76,7 +76,7 @@
             <view class="icon-name">{{filters.numFilter(videoInfoCopy.userRead.likeAmount)}}</view>
         </view>
     </view>
-    <view class="toReading" bindtap="toPkPage">
+    <view class="toReading" bindtap="toPkPage" wx:if="{{videoType!='my'}}">
         <image src="/static/reading.png" class="reading" mode="" />
         <view class="reading-text">挑战PK</view>
     </view>

+ 66 - 0
pages/reading/index.js

@@ -0,0 +1,66 @@
+// pages/reading/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/reading/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/reading/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/reading/index.wxml-->
+<text>pages/reading/index.wxml</text>

+ 1 - 0
pages/reading/index.wxss

@@ -0,0 +1 @@
+/* pages/reading/index.wxss */