Przeglądaj źródła

开发消息列表页面

bayi 2 lat temu
rodzic
commit
cb41e3984e

+ 14 - 0
pages/my/index.less

@@ -119,6 +119,7 @@
     border-radius: 20rpx;
 
     .sBox {
+      position: relative;
       display: flex;
       flex-direction: column;
       align-items: center;
@@ -133,6 +134,19 @@
         font-size: 24rpx;
         color: #333;
       }
+
+      .noticeTips {
+        position: absolute;
+        right: -2rpx;
+        top: -6rpx;
+        width: 34rpx;
+        padding: 4rpx 0rpx;
+        border-radius: 40rpx;
+        color: white;
+        font-size: 18rpx;
+        text-align: center;
+        background-color: #FF0000;
+      }
     }
 
     .contactBtn {

+ 1 - 0
pages/my/index.wxml

@@ -50,6 +50,7 @@
       <text class="title">我的收藏</text>
     </view>
     <view class="sBox" bindtap='jump' data-url="/pages/notice/index">
+      <view class="noticeTips">31</view>
       <image class="img" src="/static/message.png" mode="" />
       <text class="title">消息通知</text>
     </view>

+ 13 - 0
pages/my/index.wxss

@@ -100,6 +100,7 @@
   border-radius: 20rpx;
 }
 .container .sectionBoxs .sBox {
+  position: relative;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -113,6 +114,18 @@
   font-size: 24rpx;
   color: #333;
 }
+.container .sectionBoxs .sBox .noticeTips {
+  position: absolute;
+  right: -2rpx;
+  top: -6rpx;
+  width: 34rpx;
+  padding: 4rpx 0rpx;
+  border-radius: 40rpx;
+  color: white;
+  font-size: 18rpx;
+  text-align: center;
+  background-color: #FF0000;
+}
 .container .sectionBoxs .contactBtn {
   border: none;
   padding: 0rpx;

+ 2 - 1
pages/notice/index.json

@@ -1,3 +1,4 @@
 {
-  "usingComponents": {}
+  "usingComponents": {},
+  "navigationBarTitleText": "消息列表"
 }

+ 33 - 0
pages/notice/index.less

@@ -0,0 +1,33 @@
+.noticeBox {
+  .notice {
+    padding: 30rpx 20rpx;
+    box-sizing: border-box;
+
+    .date {
+      width: 285rpx;
+      padding: 6rpx 0rpx;
+      margin: 0rpx auto;
+      background-color: #D2DAE7;
+      border-radius: 30rpx;
+      text-align: center;
+    }
+
+    .content {
+      margin-top: 24rpx;
+      padding: 28rpx 22rpx;
+      border-radius: 20rpx;
+      background: #FFFFFF;
+      font-size: 32rpx;
+
+      .title {
+        font-weight: bold;
+        margin-bottom: 20rpx;
+      }
+
+      .row {
+        line-height: 48rpx;
+        margin-bottom: 10rpx;
+      }
+    }
+  }
+}

+ 32 - 2
pages/notice/index.wxml

@@ -1,2 +1,32 @@
-<!--pages/notice/index.wxml-->
-<text>pages/notice/index.wxml</text>
+<view class="noticeBox">
+  <view class="notice">
+    <view class="date">1月30日 12:00</view>
+    <view class="content">
+      <view class="title">线上小朋友朗读PK赛!</view>
+      <view class="row">
+        一年级:《 影子》《比尾巴》《青蛙写诗》
+      </view>
+      <view class="row">
+        二年级:《古诗二首-夜宿山寺》《古诗二首-敕勒
+      </view>
+      <view class="row">
+        三年级:《美丽的小兴安岭》《带刺的朋友》《望洞三年级:《美丽的小兴安岭》《带刺的朋友》《望洞
+      </view>
+    </view>
+  </view>
+  <view class="notice">
+    <view class="date">1月30日 12:00</view>
+    <view class="content">
+      <view class="title">线上小朋友朗读PK赛!</view>
+      <view class="row">
+        一年级:《 影子》《比尾巴》《青蛙写诗》
+      </view>
+      <view class="row">
+        二年级:《古诗二首-夜宿山寺》《古诗二首-敕勒
+      </view>
+      <view class="row">
+        三年级:《美丽的小兴安岭》《带刺的朋友》《望洞三年级:《美丽的小兴安岭》《带刺的朋友》《望洞
+      </view>
+    </view>
+  </view>
+</view>

+ 27 - 1
pages/notice/index.wxss

@@ -1 +1,27 @@
-/* pages/notice/index.wxss */
+.noticeBox .notice {
+  padding: 30rpx 20rpx;
+  box-sizing: border-box;
+}
+.noticeBox .notice .date {
+  width: 285rpx;
+  padding: 6rpx 0rpx;
+  margin: 0rpx auto;
+  background-color: #D2DAE7;
+  border-radius: 30rpx;
+  text-align: center;
+}
+.noticeBox .notice .content {
+  margin-top: 24rpx;
+  padding: 28rpx 22rpx;
+  border-radius: 20rpx;
+  background: #FFFFFF;
+  font-size: 32rpx;
+}
+.noticeBox .notice .content .title {
+  font-weight: bold;
+  margin-bottom: 20rpx;
+}
+.noticeBox .notice .content .row {
+  line-height: 48rpx;
+  margin-bottom: 10rpx;
+}

+ 3 - 5
pages/pkResult/index.js

@@ -28,6 +28,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    console.log(options);
     this.storeBindings = createStoreBindings(this, {
       store,
       fields: {
@@ -41,7 +42,6 @@ Page({
     this.innerAudioContext = wx.createInnerAudioContext()
   },
   compareScore() {
-    console.log(this.data);
     let pkData = this.data.pkData
     let score = pkData.score
     let myResult = {
@@ -152,7 +152,6 @@ Page({
           canvas.height = res[0].height * dpr;
           ctx.scale(dpr, dpr);
           ctx.font = '16px PingFang';
-          console.log(this.data.victory, this.data.defeated, this.data.equal);
           let bgImg = canvas.createImage();
           bgImg.src = this.data.equal ? 'https://reader-wx.ai160.com/images/reader/v3/equal.png' : 'https://reader-wx.ai160.com/images/reader/v3/victory.png'
           bgImg.onload = () => {
@@ -209,7 +208,7 @@ Page({
                     success(res) {
                       resolve({
                         title: '请欣赏我的课文朗读作品,点赞+评论。',
-                        path: `/pages/index/index?&uid=${wx.getStorageSync('uid')}`,
+                        path: `/pages/pkResult/index?&uid=${wx.getStorageSync('uid')}`,
                         imageUrl: res.tempFilePath
                       })
                     },
@@ -226,7 +225,7 @@ Page({
                     success(res) {
                       resolve({
                         title: '请欣赏我的课文朗读作品,点赞+评论。',
-                        path: `/pages/index/index?&uid=${wx.getStorageSync('uid')}`,
+                        path: `/pages/pkResult/index?&uid=${wx.getStorageSync('uid')}`,
                         imageUrl: res.tempFilePath
                       })
                     },
@@ -248,7 +247,6 @@ Page({
     if (from == 'button') {
       const promise = new Promise(resolve => {
         this.creatShare().then(res => {
-          console.log(res);
           resolve(res)
         })
       })