bayi пре 2 година
родитељ
комит
955f7cbfbd

+ 3 - 2
app.json

@@ -1,7 +1,10 @@
 {
   "pages": [
+    "pages/medalStore/index",
+    "pages/my/index",
     "pages/index/index",
     "pages/pkResult/index",
+    "pages/score/index",
     "pages/pkPage/index",
     "pages/rankIntro/index",
     "pages/ranking/index",
@@ -10,9 +13,7 @@
     "pages/collection/index",
     "pages/personal/index",
     "pages/childClassify/index",
-    "pages/score/index",
     "pages/reading/index",
-    "pages/my/index",
     "pages/editUser/index",
     "pages/notice/index",
     "pages/follow/index"

+ 2 - 2
app.wxss

@@ -25,8 +25,8 @@ text {
   width: 375px;
   height: 300px;
   position: absolute;
-  left: -999rpx;
-  top: -9999rpx;
+  /*  left: -999rpx;
+  top: -9999rpx; */
 }
 
 .textOver {

+ 10 - 0
components/activityList/index.wxml

@@ -91,4 +91,14 @@
       <view class="btn">立即参与</view>
     </view>
   </view>
+  <view class="activityBox">
+    <image src="" class="cover" />
+    <view class="footer">
+      <view class="info">
+        <view class="title">新学期 朗读赛</view>
+        <view class="time">2023.03.8-2023.03.14</view>
+      </view>
+      <view class="btn">立即参与</view>
+    </view>
+  </view>
 </view>

+ 1 - 1
pages/index/index.js

@@ -20,7 +20,7 @@ Page({
   data: {
     navBarHeight: app.globalData.navBarHeight,
     background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
-    currentType: '3',
+    currentType: '1',
     // 控制一级分类是否固定
     isFixed: false,
     categoryList: []

+ 66 - 0
pages/medalStore/index.js

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

+ 6 - 0
pages/medalStore/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "勋章墙",
+  "navigationBarBackgroundColor": "#30C866",
+  "navigationBarTextStyle": "white"
+}

+ 29 - 0
pages/medalStore/index.less

@@ -0,0 +1,29 @@
+.medalStore {
+  .header {
+    width: 100%;
+    padding: 60rpx 46rpx;
+    box-sizing: border-box;
+    background-color: #30C866;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    color: white;
+
+    .left {
+
+      .title {
+        font-size: 42rpx;
+        font-weight: bold;
+      }
+
+      .tips {
+        margin-top: 16rpx;
+        font-size: 24rpx;
+      }
+    }
+
+    .right {
+      font-size: 54rpx;
+    }
+  }
+}

+ 12 - 0
pages/medalStore/index.wxml

@@ -0,0 +1,12 @@
+<view class="medalStore">
+  <view class="header">
+    <view class="left">
+      <view class="title">我的勋章</view>
+      <view class="tips">累计已获得勋章5个</view>
+      <view class="tips">朗读配音可获得以下勋章哦,其他勋章敬请期待~</view>
+    </view>
+    <view class="right">
+      5
+    </view>
+  </view>
+</view>

+ 21 - 0
pages/medalStore/index.wxss

@@ -0,0 +1,21 @@
+.medalStore .header {
+  width: 100%;
+  padding: 60rpx 46rpx;
+  box-sizing: border-box;
+  background-color: #30C866;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  color: white;
+}
+.medalStore .header .left .title {
+  font-size: 42rpx;
+  font-weight: bold;
+}
+.medalStore .header .left .tips {
+  margin-top: 16rpx;
+  font-size: 24rpx;
+}
+.medalStore .header .right {
+  font-size: 54rpx;
+}

+ 41 - 0
pages/my/index.less

@@ -143,6 +143,47 @@
     }
   }
 
+  .medalBox {
+    margin-top: 20rpx;
+    padding: 20rpx 30rpx;
+    background-color: white;
+    border-radius: 20rpx;
+
+    .header {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+
+      .title {
+        font-size: 30rpx;
+        font-weight: bold;
+        color: #000;
+      }
+
+      .jump {
+        font-size: 26rpx;
+        color: #666666;
+
+        .jumpIcon {
+          width: 12rpx;
+          height: 22rpx;
+        }
+      }
+    }
+
+    .body {
+      margin-top: 20rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+
+      .medal {
+        width: 112rpx;
+        height: 94rpx;
+      }
+    }
+  }
+
   .payBox {
     margin-top: 20rpx;
     padding: 13rpx 30rpx;

+ 12 - 0
pages/my/index.wxml

@@ -60,6 +60,18 @@
       </view>
     </button>
   </view>
+  <!-- 勋章 -->
+  <view class="medalBox">
+    <view class="header">
+      <view class="title">我的勋章</view>
+      <view class="jump" bindtap='jump' data-url="/pages/medalStore/index">查看全部
+        <image src="/static/black.png" class='jumpIcon' />
+      </view>
+    </view>
+    <view class="body">
+      <image src="/static/concern.png" class="medal" wx:for="{{5}}" wx:key="index" />
+    </view>
+  </view>
   <!-- 支付 -->
   <!-- <view class="payBox" wx:if="{{!isIos}}"> -->
   <view class="payBox">

+ 34 - 0
pages/my/index.wxss

@@ -119,6 +119,40 @@
   line-height: normal;
   margin: 0;
 }
+.container .medalBox {
+  margin-top: 20rpx;
+  padding: 20rpx 30rpx;
+  background-color: white;
+  border-radius: 20rpx;
+}
+.container .medalBox .header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.container .medalBox .header .title {
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #000;
+}
+.container .medalBox .header .jump {
+  font-size: 26rpx;
+  color: #666666;
+}
+.container .medalBox .header .jump .jumpIcon {
+  width: 12rpx;
+  height: 22rpx;
+}
+.container .medalBox .body {
+  margin-top: 20rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.container .medalBox .body .medal {
+  width: 112rpx;
+  height: 94rpx;
+}
 .container .payBox {
   margin-top: 20rpx;
   padding: 13rpx 30rpx;

+ 10 - 6
pages/pkPage/index.js

@@ -10,7 +10,8 @@ import {
 Page({
   behaviors: [behavior, share, reachBottom],
   data: {
-    videoInfo: {}
+    videoInfo: {},
+    videoId: ''
   },
   /**
    * 生命周期函数--监听页面加载
@@ -18,10 +19,11 @@ Page({
   onLoad(options) {
     console.log(options);
     let videoId = options.videoId
+    this.setData({
+      videoId
+    })
     this.getreadInfo(videoId)
-    /* this.resetData({
-      userReadId: videoId
-    }) */
+    this.resetData()
   },
   async getreadInfo(videoId) {
     let videoInfo = await getreadInfo(videoId)
@@ -33,8 +35,10 @@ Page({
       videoInfo
     })
   },
-  loadMore(data) {
-    this.getData(getPkRecord, data)
+  loadMore() {
+    this.getData(getPkRecord, {
+      userReadId: this.data.videoId
+    })
   },
   onHide() {
     this.setData({

+ 2 - 1
pages/pkPage/index.wxml

@@ -5,7 +5,8 @@
   <!-- 挑战记录列表 -->
   <view class="pkRecord">
     <view class="title">挑战记录</view>
-    <scroll-view scroll-y="true" class="scrollBox" enhanced="true" show-scrollbar="{{false}}">
+    <scroll-view scroll-y="true" class="scrollBox" enhanced="true" show-scrollbar="{{false}}"
+      bindscrolltolower='loadMore'>
       <view class="record" wx:for="{{20}}" wx:key="index">
         <view class="record-left">
           <view class="rl-avatar">

+ 19 - 0
pages/pkResult/index.js

@@ -39,6 +39,8 @@ Page({
     this.storeBindings.updateStoreBindings()
     this.compareScore()
     this.innerAudioContext = wx.createInnerAudioContext()
+
+    this.share()
   },
   compareScore() {
     /*   let pkData = {
@@ -141,6 +143,23 @@ Page({
   onUnload() {
     this.innerAudioContext.destroy()
   },
+  share() {
+    let context = wx.createSelectorQuery();
+    context
+      .select('#share')
+      .fields({
+        node: true,
+        size: true
+      }).exec((res) => {
+        const canvas = res[0].node;
+        const ctx = canvas.getContext('2d');
+        const dpr = wx.getSystemInfoSync().pixelRatio;
+        canvas.width = res[0].width * dpr;
+        canvas.height = res[0].height * dpr;
+        ctx.scale(dpr, dpr);
+        
+      })
+  },
   onShareAppMessage() {
 
   }

+ 3 - 0
pages/pkResult/index.less

@@ -146,4 +146,7 @@
       box-shadow: 0 6px 14px 0 rgba(50, 197, 255, 0.65);
     }
   }
+}
+.share{
+  
 }

+ 2 - 1
pages/pkResult/index.wxml

@@ -33,4 +33,5 @@
       分享
     </button>
   </view>
-</view>
+</view>
+<canvas id='share' class="share" type="2d"> </canvas>