Browse Source

开发联调活动

bayi 2 years atrás
parent
commit
75b9b2da1d

+ 2 - 2
app.json

@@ -1,10 +1,10 @@
 {
   "pages": [
-    "pages/match/index",
     "pages/index/index",
+    "pages/pkResult/index",
+    "pages/match/index",
     "pages/medalStore/index",
     "pages/my/index",
-    "pages/pkResult/index",
     "pages/score/index",
     "pages/pkPage/index",
     "pages/rankIntro/index",

+ 10 - 13
components/activityList/index.js

@@ -9,15 +9,7 @@ Component({
   data: {
     //,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛
     type: '4',
-    activityList: [{
-      id: 1,
-      name: '新学期限时充值活动',
-      closing: '2023-1-29 16:38:00',
-    }, {
-      id: 2,
-      name: '入学限时充值活动',
-      closing: '2023-1-30 16:38:00',
-    }],
+    activityList: [],
     dsqList: []
   },
   lifetimes: {
@@ -35,12 +27,17 @@ Component({
    */
   methods: {
     async getActivities() {
-      let res = await getActivities()
-      this.data.activityList.forEach((item, index) => {
-        this.activityTimeOut(item.closing, index)
+      let activityList = await getActivities()
+      console.log(activityList);
+      this.setData({
+        activityList
       })
+      // 下面这个处理限时活动的,第一版先不上
+      /*  res.forEach((item, index) => {
+         this.activityTimeOut(item.closing, index)
+       }) */
     },
-    activityTimeOut(oTime,index) {
+    activityTimeOut(oTime, index) {
       let inputTime = new Date(oTime)
       let dsq = setInterval(() => {
         var nowTime = new Date();

+ 1 - 0
components/activityList/index.less

@@ -45,6 +45,7 @@
           display: flex;
           flex-direction: column;
           align-items: center;
+          text-align: center;
         }
 
         .nickName {

+ 86 - 77
components/activityList/index.wxml

@@ -1,5 +1,6 @@
+<wxs src="../../utils/filter.wxs" module="filters" />
 <view class="activityList">
-  <view class="activityBox" wx:for="{{activityList}}" wx:key="id">
+  <!--  <view class="activityBox" wx:for="{{activityList}}" wx:key="id">
     <image src="" class="cover" />
     <view class="footer">
       <view class="info">
@@ -14,97 +15,105 @@
       </view>
       <view class="btn {{item.second=='00'?'closingBtn':''}}">立即参与</view>
     </view>
-  </view>
-  <view class="ranking-class-1">
-    <view class="header">
-      <view class="title">邀新榜TOP100</view>
-      <view class="toAll">查看全部
-        <image src="/static/black.png" class="backIcon" />
+  </view> -->
+  <block wx:for="{{activityList}}" wx:key="id">
+    <view class="activityBox" wx:if="{{item.bannerType==1}}">
+      <image src="{{item.icon}}" class="cover" />
+      <view class="footer">
+        <view class="info">
+          <view class="title">{{item.title}}</view>
+          <view class="time">{{filters.formatDate(item.startTime,2)}}—{{filters.formatDate(item.endTime,2)}}</view>
+        </view>
+        <view class="btn">立即参与</view>
       </view>
     </view>
-    <view class="body">
-      <view class="top">
-        <view class="userBox">
-          <view class="secondUser">
-            <image src="/static/task1.png" class="avatar" />
-          </view>
-          <view class="nickName textOver">正直的憨憨正直的憨憨</view>
+    <view class="ranking-class-1" wx:if="{{item.bannerType==2}}">
+      <view class="header">
+        <view class="title">{{item.title}}</view>
+        <view class="toAll">查看全部
+          <image src="/static/black.png" class="backIcon" />
         </view>
-        <view class="userBox">
-          <view class="firstUser">
-            <image src="/static/task1.png" class="avatar" />
+      </view>
+      <view class="body">
+        <view class="top">
+          <view class="userBox">
+            <view class="secondUser">
+              <image src="{{item.userList[1].avatar}}" class="avatar" />
+            </view>
+            <view class="nickName textOver">{{item.userList[1].nickName||item.userList[1].eid}}</view>
           </view>
-          <view class="nickName textOver">正直的憨憨正直的憨憨</view>
-        </view>
-        <view class="userBox">
-          <view class="thirdUser">
-            <image src="/static/task1.png" class="avatar" />
+          <view class="userBox">
+            <view class="firstUser">
+              <image src="{{item.userList[0].avatar}}" class="avatar" />
+            </view>
+            <view class="nickName textOver">{{item.userList[0].nickName||item.userList[0].eid}}</view>
+          </view>
+          <view class="userBox">
+            <view class="thirdUser">
+              <image src="{{item.userList[2].avatar}}" class="avatar" />
+            </view>
+            <view class="nickName textOver">{{item.userList[2].nickName||item.userList[2].eid}}</view>
           </view>
-          <view class="nickName textOver">正直的憨憨正直的憨憨</view>
         </view>
-      </view>
-      <view class="btm">
-        <view class="userBox" wx:for="{{5}}" wx:key="index">
-          <image src="/static/task1.png" class="avatar" />
-          <view class="nickName textOver">正直的憨憨正直的憨憨</view>
+        <view class="btm">
+          <view class="userBox" wx:for="{{5}}" wx:key="index" wx:for-item="items">
+            <image src="{{item.userList[index+3].avatar}}" class="avatar" />
+            <view class="nickName textOver">{{item.userList[index+3].nickName||item.userList[index+3].eid||'请你来挑战'}}
+            </view>
+          </view>
         </view>
       </view>
     </view>
-  </view>
-  <view class="ranking-class-2 {{type=='2'?'yxb':type=='3'?'rbb':'pkb'}}">
-    <view class="header">
-      <view class="left">
-        <image src="{{type=='2'?'/static/yxb.png':type=='3'?'/static/rbb.png':'/static/pkb.png'}}" class="icon" />
-        <view class="title">{{type=='2'?'邀新榜':type=='3'?'热播榜':'PK榜'}}</view><text>TOP100</text>
-      </view>
-      <view class="toAll">查看全部
-        <image src="/static/rBtn.png" class="backIcon" />
-      </view>
-    </view>
-    <view class="body">
-      <view class="row">
-        <view class="left">
-          <image src="/static/1-1.png" class="stand" />
-          <image src="/static/play-big.png" class="avatar" />
-          <view class="nickName textOver">樱桃小丸子</view>
-        </view>
-        <view class="right">
-          <image src="{{type=='2'?'/static/yx.png':type=='3'?'/static/play.png':'/static/win.png'}}" class="playIcon" />
-          <view class="num">186</view>
-        </view>
-      </view>
-      <view class="row">
+    <view class="ranking-class-2 {{item.type=='1'?'yxb':item.type=='3'?'rbb':'pkb'}}" wx:if="{{item.bannerType==3}}">
+      <view class="header">
         <view class="left">
-          <image src="/static/2-1.png" class="stand" />
-          <image src="/static/play-big.png" class="avatar" />
-          <view class="nickName textOver">樱桃小丸子</view>
+          <image src="{{item.type=='1'?'/static/yxb.png':item.type=='3'?'/static/rbb.png':'/static/pkb.png'}}"
+            class="icon" />
+          <view class="title">{{item.title}}</view>
+          <!-- <view class="title">{{type=='2'?'邀新榜':type=='3'?'热播榜':'PK榜'}}</view><text>TOP100</text> -->
         </view>
-        <view class="right">
-          <image src="{{type=='2'?'/static/yx.png':type=='3'?'/static/play.png':'/static/win.png'}}" class="playIcon" />
-          <view class="num">186</view>
+        <view class="toAll">查看全部
+          <image src="/static/rBtn.png" class="backIcon" />
         </view>
       </view>
-      <view class="row">
-        <view class="left">
-          <image src="/static/3-1.png" class="stand" />
-          <image src="/static/play-big.png" class="avatar" />
-          <view class="nickName textOver">樱桃小丸子</view>
+      <view class="body">
+        <view class="row" wx:for="{{3}}" wx:key="index" wx:for-item='items'>
+          <view class="left">
+            <image src="/static/{{index+1}}-1.png" class="stand" />
+            <image src="{{item.userList[index].avatar}}" class="avatar" />
+            <view class="nickName textOver">{{item.userList[index].nickName||item.userList[index].eid}}</view>
+          </view>
+          <view class="right">
+            <image src="{{item.type=='1'?'/static/yx.png':item.type=='3'?'/static/play.png':'/static/win.png'}}"
+              class="playIcon" />
+            <view class="num">{{item.userList[index].count}}</view>
+          </view>
         </view>
-        <view class="right">
-          <image src="{{type=='2'?'/static/yx.png':type=='3'?'/static/play.png':'/static/win.png'}}" class="playIcon" />
-          <view class="num">186</view>
+        <!--  <view class="row">
+          <view class="left">
+            <image src="/static/2-1.png" class="stand" />
+            <image src="/static/play-big.png" class="avatar" />
+            <view class="nickName textOver">樱桃小丸子</view>
+          </view>
+          <view class="right">
+            <image src="{{type=='2'?'/static/yx.png':type=='3'?'/static/play.png':'/static/win.png'}}"
+              class="playIcon" />
+            <view class="num">186</view>
+          </view>
         </view>
+        <view class="row">
+          <view class="left">
+            <image src="/static/3-1.png" class="stand" />
+            <image src="/static/play-big.png" class="avatar" />
+            <view class="nickName textOver">樱桃小丸子</view>
+          </view>
+          <view class="right">
+            <image src="{{type=='2'?'/static/yx.png':type=='3'?'/static/play.png':'/static/win.png'}}"
+              class="playIcon" />
+            <view class="num">186</view>
+          </view>
+        </view> -->
       </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>
+  </block>
 </view>

+ 1 - 0
components/activityList/index.wxss

@@ -39,6 +39,7 @@
   display: flex;
   flex-direction: column;
   align-items: center;
+  text-align: center;
 }
 .activityList .ranking-class-1 .body .top .nickName {
   width: 140rpx;

+ 0 - 1
components/worksList/index.js

@@ -6,7 +6,6 @@ Component({
       type: Array,
       value: [],
       observer(newVal) {
-        console.log(newVal);
         this.setData({
           worksListCopy: newVal
         })

+ 17 - 14
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: '1',
+    currentType: '3',
     // 控制一级分类是否固定
     isFixed: false,
     desktopTips: false,
@@ -36,10 +36,22 @@ Page({
         selected: 1
       })
     }
-    getApp().callBack = (res) => {
-      this.getLocUserInfo()
-      this.resetData()
+    let uid = wx.getStorageSync('uid')
+    if (uid) {
+      getApp().callBack = (res) => {
+        this.getLocUserInfo()
+        this.resetData()
+      }
+    } else {
+      getApp().callBack = (res) => {
+        this.getLocUserInfo()
+        this.resetData()
+      }
     }
+    /*    getApp().callBack = (res) => {
+         this.getLocUserInfo()
+         this.resetData()
+       } */
     // 1023	安卓系统桌面图标,1104微信聊天主界面下拉,「我的小程序」栏(基础库2.2.4-2.29.0版本废弃,2.29.1版本起生效)
     let {
       isIOS,
@@ -57,16 +69,7 @@ Page({
         })
       }, 8000)
     }
-    let uid = wx.getStorageSync('uid')
-    /*  if (uid) {
-       this.getLocUserInfo()
-       this.resetData()
-     } else {
-       getApp().callBack = (res) => {
-         this.getLocUserInfo()
-         this.resetData()
-       }
-     } */
+
   },
   onUnload() {
     this.storeBindings.destroyStoreBindings()

+ 1 - 1
pages/index/index.less

@@ -40,7 +40,7 @@
 
         .icon {
           width: 60rpx;
-          height: 58rpx;
+          height: 60rpx;
         }
 
         .name {

+ 1 - 1
pages/index/index.wxss

@@ -36,7 +36,7 @@
 }
 .recommend .scrollBox .firstClassify .firstBox .icon {
   width: 60rpx;
-  height: 58rpx;
+  height: 60rpx;
 }
 .recommend .scrollBox .firstClassify .firstBox .name {
   margin-top: 6rpx;

+ 2 - 2
pages/my/index.less

@@ -135,7 +135,7 @@
         color: #333;
       }
 
-      .noticeTips {
+      /* .noticeTips {
         position: absolute;
         right: -2rpx;
         top: -6rpx;
@@ -146,7 +146,7 @@
         font-size: 18rpx;
         text-align: center;
         background-color: #FF0000;
-      }
+      } */
     }
 
     .contactBtn {

+ 3 - 3
pages/my/index.wxml

@@ -50,7 +50,7 @@
       <text class="title">我的收藏</text>
     </view>
     <view class="sBox" bindtap='jump' data-url="/pages/notice/index">
-      <view class="noticeTips">31</view>
+      <!-- <view class="noticeTips">31</view> -->
       <image class="img" src="/static/message.png" mode="" />
       <text class="title">消息通知</text>
     </view>
@@ -62,7 +62,7 @@
     </button>
   </view>
   <!-- 勋章 -->
-  <view class="medalBox">
+  <!--   <view class="medalBox">
     <view class="header">
       <view class="title">我的勋章</view>
       <view class="jump" bindtap='jump' data-url="/pages/medalStore/index">查看全部
@@ -72,7 +72,7 @@
     <view class="body">
       <image src="/static/concern.png" class="medal" wx:for="{{5}}" wx:key="index" />
     </view>
-  </view>
+  </view> -->
   <!-- 支付 -->
   <!-- <view class="payBox" wx:if="{{!isIos}}"> -->
   <view class="payBox">

+ 12 - 12
pages/my/index.wxss

@@ -104,6 +104,18 @@
   display: flex;
   flex-direction: column;
   align-items: center;
+  /* .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 .sBox .img {
   width: 69rpx;
@@ -114,18 +126,6 @@
   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;

+ 1 - 1
utils/filter.wxs

@@ -23,7 +23,7 @@ function formatDate(time, flag) {
     if (flag == 1) {
         return month + '月' + day + '日' + ' ' + hour + ':' + minute;
     } else if (flag == 2) {
-        return year + '-' + month + '-' + day
+        return year + '.' + month + '.' + day
     } else if (flag == 3) {
         return month + '-' + day + ' ' + hour + ':' + minute;
     } else if (flag == 4) {