lvkun 4 жил өмнө
parent
commit
246566377e

+ 13 - 0
src/api/promoted.js

@@ -34,4 +34,17 @@ export function bobyPass (parmas) {
         method: 'PUT',
         query: parmas
     })
+}
+
+/**
+ * @description 查询比赛排名
+ */
+
+
+export function getCompetitionRank (parmas) {
+    return request({
+        url: `/agent/miniprogram/competition/score/rank`,
+        method: 'GET',
+        query: parmas
+    })
 }

+ 13 - 7
src/components/student-info/student-info.vue

@@ -3,14 +3,14 @@
     <image class="ava" :src="require('@/static/image/ava.jpg')" />
     <view class="content-info" >
       <view class="top" >
-        <view class="name" >coke</view>
+        <view class="name" >{{itemData.babyName}}</view>
         <view class="apply-count" >
-          参赛号:2344523445445
+          参赛号:{{itemData.competitionNo}}
         </view>
       </view>
       <view class="bottom" >
-        <view class="score" >成绩:67分</view>
-        <view class="time" >/ 用时: 00:00:00</view>
+        <view class="score" >成绩:{{itemData.score}}分</view>
+        <view class="time" >/用时: {{itemData.time}}秒</view>
       </view>
     </view>
   </view>
@@ -18,7 +18,13 @@
 
 <script>
 export default {
-  name: 'student-info'
+  name: 'student-info',
+  props: {
+    itemData: {
+      type: Object,
+      require: true
+    }
+  }
 }
 </script>
 
@@ -44,8 +50,8 @@ export default {
         margin-right: 8rpx;
       }
       .apply-count {
-        width: 262rpx;
-        height: 36rpx;
+        padding: 0 12rpx;
+        box-sizing: border-box;
         display: flex;
         justify-content: center;
         align-items: center;

+ 6 - 0
src/pages.json

@@ -108,6 +108,12 @@
 			"style": {
 				"navigationBarTitleText": "选手名单"
 			}
+		},
+		{
+			"path": "pages/promoted/rank",
+			"style": {
+				"navigationBarTitleText": "成绩排名"
+			}
 		}
 	],
 	"globalStyle": {

+ 20 - 5
src/pages/competition/schoolDetail.vue

@@ -16,7 +16,7 @@
               :key="item.id"
               @click="changeTabs(item.id)"
             >
-              <text> {{ item.id | filterClassLabel }} </text>
+              <text> {{ item.id | filterClassLabel }}{{schoolPelploCount(item.id)}}</text>
               <view  v-if="active === item.id" class="line" />
             </view>
           </view>
@@ -70,15 +70,17 @@ export default {
   name: 'school-detail',
   filters: {
     filterClassLabel (id) {
+
       switch (id) {
         case -1:
-          return '托班'
+        
+          return `托班`
         case 0:
-          return '小班'
+          return `小班`
         case 1:
-          return '中班'
+          return `中班`
         case 2:
-          return '大班'
+          return `大班`
       }
     }
   },
@@ -130,6 +132,19 @@ export default {
     }
   },
   methods: {
+    // 返回对应的人数
+    schoolPelploCount (id) {
+       switch (id) {
+        case -1:
+          return `(${ this.schoolDetail.babyListOfLevel_1.length})`
+        case 0:
+          return `(${ this.schoolDetail.babyListOfLevel0.length})`
+        case 1:
+          return `(${ this.schoolDetail.babyListOfLevel1.length})`
+        case 2:
+          return `(${ this.schoolDetail.babyListOfLevel2.length})`
+      }
+    },
     async getCloudBaby () {
       const $par = {
         schoolId: this.schoolId,

+ 10 - 7
src/pages/index/index.vue

@@ -89,13 +89,16 @@ export default {
                 Tip.success('登录成功')
                 setLocalStorage('token', data.token)
                 this.$store.commit('set_userInfo', data)
-                const routes = getCurrentPages()
-                console.log(routes, 'routes');
-                const route =  routes[routes.length - 2]
-                console.log();
-                const param = route.__displayReporter.showOptions.query
-                uni.redirectTo({
-                    url: '/' + route.route + '?' + param
+                // const routes = getCurrentPages()
+                // console.log(routes, 'routes');
+                // const route =  routes[routes.length - 2]
+         
+                // const param = route.__displayReporter.showOptions.query
+                // uni.redirectTo({
+                //     url: '/' + route.route + '?' + param
+                // })
+                uni.reLaunch({
+                    url: '/pages/user/index'
                 })
           } else {
             this.code = ''

+ 23 - 13
src/pages/promoted/components/ClassTab.vue

@@ -2,35 +2,44 @@
   <view class="class-tab" >
     <view class="school-category" >
             <view 
-              :class="['category-item', active === item ? 'category-item-active' : '']" 
-              v-for="item in 3" 
-              :key="item"
+              :class="['category-item', active === item.id ? 'category-item-active' : '']" 
+              v-for="item in classCategory" 
+              :key="item.id"
               @click="changeTabs(item)"
             >
-              <text> {{ item === 0 ? '小班' : item === 1 ? '中班' : '大班' }} </text>
-              <view  v-if="active === item" class="line" />
+              <text> {{ item.label }} <block v-if="item.hasOwnProperty('count')" >{{`(${item.count})`}}</block></text>
+              <view  v-if="active === item.id" class="line" />
             </view>
     </view>
   </view>
 </template>
 
 <script>
+
 export default {
   name: 'class-tab',
+  props: {
+    classCategory: {
+      type: Array,
+      require: true
+    }
+  },
   data () {
     return {
-      active: 0
+      active: -1,
     }
   },
   methods: {
-    changeTabs (index) {
-      this.active = index
+    changeTabs (item) {
+      this.active = item.id
+      this.$emit('changeClass', item.id)
     }
   }
 }
 </script>
 
 <style lang="less" scoped>
+
 .school-category {
       display: flex;
       justify-content: center;
@@ -40,6 +49,7 @@ export default {
       border-bottom: 2rpx solid #F6F6F6;
       position: sticky;
       top: 0rpx;
+      z-index: 3;
       background-color: #fff;
       box-sizing: border-box;
       .category-item {
@@ -52,13 +62,13 @@ export default {
         align-items: center;
         justify-content: center;
         position: relative;
-        text {
-
-        }
       }
       .category-item:nth-child(2) {
-        margin-left: 60rpx;
-        margin-right: 60rpx;
+        margin-left: 40rpx;
+        margin-right: 40rpx;
+      }
+      .category-item:nth-child(3) {
+        margin-right: 40rpx;
       }
       .category-item-active {
         font-size: 32rpx;

+ 2 - 6
src/pages/promoted/components/SearchCom.vue

@@ -27,16 +27,12 @@ export default {
   },
   methods: {
     focus () {
-      if (this.keyword.length > 0) {
-          this.$emit('focus', false)
-      } else {
-        this.$emit('focus', true)
-      }
-      
+      this.$emit('focus', true)
     },
     onChange (e) {
       console.log(e.detail);
       this.keyword = e.detail
+      this.$emit('search', e.detail)
     }
   }
 }

+ 8 - 2
src/pages/promoted/components/SearchFooter.vue

@@ -1,7 +1,7 @@
 <template>
     <view class="search-footer" >
       <view class="search-container" >
-        <view class="student-count" >已选择: 23</view>
+        <view class="student-count" >已选择: {{babyIds.length}}</view>
         <view class="submit-btn" @click="$emit('open-submit-dialog')">
           提交晋级名单
         </view>
@@ -11,7 +11,13 @@
 
 <script>
 export default {
-  name: 'search-footer'
+  name: 'search-footer',
+  props: {
+    babyIds: {
+      type: Array,
+      require: true
+    }
+  }
 }
 </script>
 

+ 9 - 3
src/pages/promoted/components/StudentItem.vue

@@ -8,7 +8,7 @@
       </view>
     </view>
     <view class="right" >
-      <student-info />
+      <student-info :itemData='itemData'/>
     </view>
     
   </view>
@@ -18,7 +18,11 @@
 export default {
   name: 'student-item',
   props: {
-    rank: Number
+    rank: Number,
+    itemData: {
+      type: Object,
+      require: true
+    }
   },
   computed: {
     rankReat () {
@@ -36,10 +40,12 @@ export default {
 .student-item {
   // width: 104rpx;
   display: flex;
-  justify-content: center;
+  // justify-content: center;
   align-items: center;
   height: 164rpx;
   box-sizing: border-box;
+  padding-left: 56rpx;
+  
   .left {
     .rank-img {
       width: 60rpx;

+ 4 - 5
src/pages/promoted/components/StudentSelect.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="student-select" >
-    <student-info />
+    <student-info :itemData='itemData' />
     <view class="check-box" >
      
       <view
@@ -29,7 +29,7 @@ export default {
   },
   props: {
     itemData: {
-      type: String,
+      type: Object,
       require: true
     },
     babyIds: {
@@ -39,12 +39,12 @@ export default {
   },
   computed: {
     isSelect () {
-      return  this.babyIds.includes(this.itemData)
+      return  this.babyIds.includes(this.itemData.id)
     }
   },
   methods: {
     pushStudentIds () {
-      this.$emit('push-baby-ids', this.itemData)
+      this.$emit('push-baby-ids', this.itemData.id)
     }
   }
 }
@@ -59,7 +59,6 @@ export default {
   justify-content: space-between;
   align-items: center;
   box-sizing: border-box;
- 
   .check-box {
 
     .un-select {

+ 25 - 9
src/pages/promoted/components/SubmitDialog.vue

@@ -6,14 +6,13 @@
         <scroll-view 
           class="scroll-view"
           scroll-y
-
         >
            <view class="records" >
-              <view class="records-item" v-for="item in 22" :key="item">
-                <image class="ava" :src="require('@/static/image/ava.jpg')" />
-                <view class="name" >外卖小帅哥呀</view>
+              <view class="records-item" v-for="item in babyInfoList" :key="item.id">
+                <image class="ava" :src="item.headImg" />
+                <view class="name" >{{item.babyName}}</view>
                 <view class="school" >
-                  中德智慧幼儿园-小班
+                  {{item.schoolName}}-{{ item.classLevel | teferClass}}
                 </view>
               </view>
             </view>
@@ -24,7 +23,6 @@
           </view>
         </view>
       </view>
-      
     </view>
   </van-overlay>
 </template>
@@ -36,6 +34,24 @@ export default {
     submitDialogShow: {
       type: Boolean,
       default: false
+    },
+    babyInfoList: {
+      type: Array,
+      require: true
+    }
+  },
+  filters: {
+    teferClass ( level ) {
+      switch (level) {
+        case -1:
+          return '托班'
+        case 0:
+          return '小班'
+        case 1:
+          return '中班'
+        case 2:
+          return '大班'
+      }
     }
   },
   methods: {
@@ -136,9 +152,9 @@ export default {
               font-family: PingFangSC-Medium, PingFang SC;
               font-weight: 500;
               color: rgba(22, 119, 255, 0.8);
-              // display: flex;
-              // justify-content: center;
-              // align-items: center;
+              display: flex;
+              justify-content: center;
+              align-items: center;
               overflow: hidden;
               text-overflow: ellipsis;
               white-space: nowrap

+ 49 - 0
src/pages/promoted/config.js

@@ -0,0 +1,49 @@
+
+/**
+ * 
+ * @description 晋级名单的分类
+ * 
+ */
+export const classCategory = [
+  {
+    id: -1,
+    label: '托班'
+  },
+  {
+    id: 0,
+    label: '小班'
+  },
+  {
+    id: 1,
+    label: '中班'
+  },
+  {
+    id: 2,
+    label: '大班'
+  },
+]
+
+
+/**
+ * 
+ * @description 排行榜名单需要使用的图片
+ * 
+ */
+
+export const imgUrl =  [
+  {
+      count: 'http://res.training.luojigou.vip/Fmijl8dAfngLORY1_wQHupkK6O1H',
+      top: 'http://res.training.luojigou.vip/FosT3op3qAbtb_AHStAch2Ioi7pD',
+      bottom: 'http://res.training.luojigou.vip/FntpZcGDIsZsYYkgosM6s9sBQTDn'
+  },
+  {
+      count: 'http://res.training.luojigou.vip/FvmR-7IPqXwNtI4REBYNmlSecA8D',
+      top: 'http://res.training.luojigou.vip/Fldl2pRZblLQVdztOhlODPEhhlQF',
+      bottom: 'http://res.training.luojigou.vip/FnPemTe4MKzHzofwZx3cB77dLM3z'
+  },
+  {
+      count: 'http://res.training.luojigou.vip/FnXFslAE0LXmxtlTYWdeGzPU9Qxb',
+      top: 'http://res.training.luojigou.vip/FvKskKpeDP68TBe0cg15LY7Zom13',
+      bottom: 'http://res.training.luojigou.vip/FieXA8zqeIevUgQlhy5VNXBB6OG4'
+  }
+]

+ 53 - 11
src/pages/promoted/index.vue

@@ -5,13 +5,23 @@
       </view>
       
       <view class="class-tab" >
-         <class-tab />
+         <class-tab 
+           @changeClass='changeClass'
+           :classCategory='classCategory'
+         />
+      </view>
+      <block v-if="curClassList.length > 0">
+        <student-item
+          :rank='index + 1'
+          v-for="(item, index) in curClassList" 
+          :key="item.id"
+          :itemData='item'
+        />
+      </block>
+      
+      <view class="empty-page-box" v-if="curClassList.length === 0 && requestState">
+        <empty-page description='暂无晋级名单' :image="require('static/common/empty2.png')" />
       </view>
-      <student-item
-        :rank='item + 1'
-        v-for="item in 17" 
-        :key="item"
-      />
     </view>
 </template>
 
@@ -20,6 +30,7 @@ import AddBtn from './components/AddBtn'
 import ClassTab from './components/ClassTab'
 import StudentItem from './components/StudentItem'
 import { getBabyScore } from '@/api/promoted'
+import { classCategory as _classCategory } from './config'
 export default {
   name: 'promoted',
   components: {
@@ -27,25 +38,49 @@ export default {
     ClassTab,
     StudentItem
   },
+  computed: {
+    curClassList () {
+      return this.babyList.filter( baby => baby.classLevel === this.classType )
+    }
+  },
   onLoad (options) {
-    const { id } = options
-    this.id = id
+    const { stageId } = options
+    console.log(stageId, 'id');
+    this.stageId = stageId
     this.getBabyScore()
   },
+  data () {
+    return {
+      babyList: [],
+      classType: -1,
+      requestState: false,
+      classCategory: '',
+    }
+  },
   methods: {
+    changeClass (classType) {
+      this.classType = classType
+    },
     // 获取宝贝成绩
     async getBabyScore () {
       const $par =  {
         name: '',
-            
+        stageId: this.stageId,
+        pageSize: 10000
       }
-      const { data, status } = await getBabyScore()
+      const { data, status } = await getBabyScore($par)
+      this.requestState = true
       console.log( data, status);
+      this.babyList = data.entityList.filter( item => item.isPass === 1 )
+      this.classCategory = _classCategory.map( classTab => {
+        classTab.count = this.babyList.filter( baby => baby.classLevel === classTab.id ).length
+        return classTab
+      })
     },
     // 跳转到搜索页面
     goPromotedSearch () {
       uni.navigateTo({
-        url: '/pages/promoted/search'
+        url: `/pages/promoted/search?stageId=${this.stageId}`
       })
     }
   }
@@ -60,4 +95,11 @@ export default {
   position: sticky;
   top: 0rpx;
 }
+
+.empty-page-box {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
 </style>

+ 468 - 0
src/pages/promoted/rank.vue

@@ -0,0 +1,468 @@
+<template>
+  <view class="rank" >
+      <view class="class-tab-box" >
+        <class-tab 
+          :classCategory='classCategory'
+          @changeClass='changeClass'
+        />
+      </view>
+      <view>
+        <!-- 前三名 -->
+        <view class='top-three'>
+                <image class='top-bg' mode='aspectFit' :src="require('@/static/competition/top-bg.png')" />
+                <view 
+                  :class="[index === 0 ? 'first' : index === 1 ? 'second' : 'thirdly']" 
+                  v-for="(item, index) in 3" :key="item"
+                >
+                    <View v-if="item === 0">
+                      <Image class='first-bg' src='http://res.training.luojigou.vip/Fth2HDhbpMpVZFanOLYDRjlmyAF_' />
+                      <Image class='Ava' :src='topThree[index].imageUrl' />
+                    </View>
+                    <Image v-else class='Ava' :src='topThree[index].imageUrl' />
+                    <View class='Count unify-Count'>
+                        <Image class='Count-img unify-Count-img' :src='imgUrl[index].count' />
+                        <Text class='num'>12121</Text>
+                    </View> 
+                    <Image class='Top' :src='imgUrl[index].top' />
+                    <Image class='Bottom' :src='imgUrl[index].bottom' />
+                    <Text class='city-name unify-city-name'>北京啦啦啦幼儿园</Text>
+                    <view class="serial-number serial-number-bottom van-ellipsis" >
+                      编号:1233455667788
+                    </view>
+                </view>
+                <view class='green-shade' />
+        </view>
+        <!-- 全国前十 -->
+        <view class="nation" >
+            <view class="nation-label" >
+              全国前10强
+            </view>
+            <image class="nation-bg" :src="require('@/static/common/nation-bg.png')" />
+            <view class="nation-content" >
+              
+              <view class="nation-title">
+                <view>排名</view>
+                <view>参赛编号</view>
+                <view>姓名</view>
+                <view>园所/专柜名称</view>
+              </view>
+              <view class="rank-list" >
+                <view class="rank-item" v-for="(item, index) in 10" :key="item">
+                    <view class="rank-count" >
+                      <block v-if="index <= 2" >
+                        <image v-if="index === 0" class="rank-img" :src="require('@/static/competition/rank1.png')" />
+                        <image v-if="index === 1" class="rank-img" :src="require('@/static/competition/rank2.png')" />
+                        <image v-if="index === 2" class="rank-img" :src="require('@/static/competition/rank3.png')" />
+                      </block>
+                      <view v-else class="rank-img" >{{index + 1 }}</view>
+                    </view>
+                    <view class="apply-code" > {{item.competitionNo || 12048552565551 }}</view>
+                    <view class="nickname" >  {{  item.babyName || '收到快递呀' }}</view>
+                    <view class="school-name" >{{item.name || '中德智慧幼儿园'}} </view>
+                </view>
+              </view>
+            </view>
+        </view>
+      </view>
+  </view>
+</template>
+
+<script>
+import ClassTab from './components/ClassTab'
+import { classCategory, imgUrl } from './config'
+import { getCompetitionRank } from '@/api/promoted'
+import { getCompetitionId  } from '@/api/competition'
+export default {
+  name: 'rank',
+  components: {
+    ClassTab
+  },
+  async onLoad () {
+    await this.getCompetitionId()
+    this.getCompetitionRank()
+  },
+  data () {
+    return {
+      classCategory: Object.freeze(classCategory),
+      imgUrl: Object.freeze(imgUrl),
+      competitionId: '',  //  赛事id
+      classLevel: -1, // 班级等级
+      rankList: []
+    }
+  },
+  methods: {
+    async getCompetitionRank () {
+      const $par = {
+        classLevel: this.classLevel,
+        stageId: this.competitionId
+      }
+      const { data, status } = await getCompetitionRank($par)
+      console.log(data);
+      this.rankList = data
+    },
+    changeClass (classLevel) {
+      this.classLevel = classLevel
+    },
+    // 获取赛事id
+    async getCompetitionId () {
+      const { data, status } = await getCompetitionId()
+      this.competitionId = data
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .class-tab-box {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 10;
+  }
+
+
+.rank {
+    width: 750rpx;
+    height: 1718rpx;
+    background: #1B42FD;
+    overflow: hidden;
+}
+
+ .top-three {
+    margin: 0 auto;
+    margin-top: 164rpx;
+    position: relative;
+    z-index: 4;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    .top-bg {
+        width: 688rpx;
+        height: 346rpx;
+        margin: 0 auto;
+    }
+    
+
+    .unify-Count {
+        position: absolute;
+        top: 0;
+        left: 50%;
+        transform: translate(-50%, -50%);
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        .unify-Count-img {
+            position: absolute;
+            top: 0rpx;
+            left: 0rpx;
+        }
+        .num {
+            position: relative;
+            z-index: 1;
+            font-size: 24rpx;
+            font-weight: 500;
+            color: #FFFFFF;
+        }
+    }
+  
+    .unify-city-name {
+        font-size: 26rpx;
+        font-weight: 500;
+        color: #FB6D7E;
+        font-family: PingFangSC-Medium, PingFang SC;
+    }
+
+    .second {
+        width: 226rpx;
+        height: 306rpx;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        position: absolute;
+        top: 42rpx;
+        left: 36rpx;
+        .Ava {
+            width: 96rpx;
+            height: 96rpx;
+            border-radius: 50%;
+            position: absolute;
+            top: 46rpx;
+            left: 64rpx;
+            border: 4rpx solid rgb(181, 212, 249);
+            box-sizing: border-box;
+        }
+        .Count {
+            width: 172rpx;
+            height: 42rpx;
+            .Count-img {
+                width: 100%;
+                height: 100%;
+            }
+
+        }
+        .Top {
+            width: 61rpx;
+            height: 42rpx;
+            position: absolute;
+            top: 19rpx;
+            left: 82rpx;
+        }
+        .Bottom {
+            width: 168rpx;
+            height: 60rpx;
+            position: absolute;
+            top: 119rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+
+        .city-name {
+           width: 208rpx;
+            position: absolute;
+            bottom: 72rpx;
+            left: 50%;
+            transform: translate(-50%, -50%);
+        }
+        .serial-number-bottom {
+          bottom: 60rpx;
+        }
+    }
+
+    .first {
+        width: 244rpx;
+        height: 346rpx;
+        position: absolute;
+        left: 252rpx;
+        .first-bg {
+            position: absolute;
+            top: 67rpx;
+            left: 54%;
+            width: 185rpx;
+            height: 120rpx;
+            transform: translateX(-50%);
+        }
+        .Ava {
+            width: 108rpx;
+            height: 108rpx;
+            border-radius: 50%;
+            box-sizing: border-box;
+            position: absolute;
+            top: 72rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .Count {
+            width: 172rpx;
+            height: 42rpx;
+            .Count-img {
+                width: 100%;
+                height: 100%;
+            }
+            .num {
+
+            }
+        }
+        .Top {
+            width: 76.2rpx;
+            height: 52.8rpx;
+            position: absolute;
+            top: 30rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .Bottom {
+            width: 168rpx;
+            height: 60rpx;
+            position: absolute;
+            top: 146rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .city-name {
+            width: 208rpx;
+            position: absolute;
+            left: 50%;
+            bottom: 96rpx;
+            transform: translateX(-50%);
+        }
+        .serial-number-bottom {
+          bottom: 66rpx;
+        }
+    }
+
+    .thirdly {
+        width: 226rpx;
+        height: 306rpx;
+        position: absolute;
+        right: 32rpx;
+        top: 41rpx;
+        .Ava {
+            width: 96rpx;
+            height: 96rpx;
+            border-radius: 50%;
+            border: 4rpx solid rgb(239, 210, 174);
+            position: absolute;
+            top: 48rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .Count {
+            width: 172rpx;
+            height: 42rpx;
+            .Count-img {
+                width: 100%;
+                height: 100%;
+            }
+        }
+        .Top {
+            width: 61rpx;
+            height: 42rpx;
+            position: absolute;
+            top: 22rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .Bottom {
+            width: 168rpx;
+            height: 60rpx;
+            position: absolute;
+            top: 124rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .city-name {
+            width: 208rpx;
+            position: absolute;
+            bottom: 88rpx;
+            left: 50%;
+            transform: translateX(-50%);
+        }
+        .serial-number-bottom {
+          bottom: 60rpx;
+        }
+    }
+    .serial-number {
+      width: 196rpx;
+      font-size: 20rpx;
+      font-family: PingFangSC-Regular, PingFang SC;
+      font-weight: 400;
+      color: #666666;
+      position: absolute;
+      left: 50%;
+      transform: translateX(-50%);
+    }
+}
+
+.green-shade {
+    width: 88%;
+    height: 36rpx;
+    background: rgba(233, 237, 255, .5);
+    position: absolute;
+    left: 50%;
+    bottom: 8rpx;
+    transform: translateX(-50%);
+    z-index: 0;
+}
+
+.nation {
+  margin-top: 80rpx;
+  position: relative;
+  .nation-label {
+    font-size: 40rpx;
+    font-family: Helvetica;
+    color: #FFFFFF;
+    text-align: center;
+  }
+  .nation-bg {
+    width:  156rpx;
+    height: 154rpx;
+    position: absolute;
+    top: -36rpx;
+    right: 48rpx;
+    z-index: 0;
+  }
+  .nation-content {
+    width: 690rpx;
+    height: 1018rpx;
+    background: #FFFFFF;
+    border-radius: 18rpx;
+    margin: 0 auto;
+    margin-top: 40rpx;
+    position: relative;
+    padding: 38rpx 32rpx;
+    box-sizing: border-box;
+
+    .nation-title {
+      font-size: 24rpx;
+      font-family: PingFangSC-Regular, PingFang SC;
+      font-weight: 400;
+      color: #999999;
+      display: flex;
+    }
+    .nation-title view:nth-child(2) {
+      margin-left: 50rpx;
+      margin-right: 126rpx;
+    }
+    .nation-title view:nth-child(3) {
+      margin-right: 88rpx;
+    }
+
+    .rank-list {
+      margin-top: 16rpx;
+      position: relative;
+      z-index: 10;
+      .rank-item {
+        display: flex;
+        align-items: center;
+        height: 60rpx;
+        margin-top: 32rpx;
+        margin-bottom: 32rpx;
+        .rank-count {
+          margin-right: 38rpx;
+          .rank-img {
+            width: 60rpx;
+            height: 60rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+          }
+        }
+        .apply-code {
+          width: 178rpx;
+          margin-right: 44rpx;
+          font-size: 24rpx;
+          font-family: PingFangSC-Regular, PingFang SC;
+          font-weight: 400;
+          color: #666666;
+          overflow: hidden;
+          text-overflow:ellipsis;
+          white-space: nowrap;
+        }
+        .nickname {
+          font-size: 24rpx;
+          font-family: PingFangSC-Medium, PingFang SC;
+          font-weight: 500;
+          color: #333333;
+          margin-right: 28rpx;
+          width: 102rpx;
+          overflow: hidden;
+          text-overflow:ellipsis;
+          white-space: nowrap;
+        }
+        .school-name {
+          width: 168rpx;
+          overflow: hidden;
+          text-overflow:ellipsis;
+          white-space: nowrap;
+          font-size: 24rpx;
+          font-family: PingFangSC-Medium, PingFang SC;
+          font-weight: 500;
+          color: #333333;
+        }
+      }
+    }
+  }
+}
+
+
+</style>

+ 103 - 20
src/pages/promoted/search.vue

@@ -3,25 +3,35 @@
     <view class="search-com " :style="{'z-index': overlay? 2 : 1}" >
       <search-com
         @focus='(records) => overlay = records'
+        @search='search'
       />
     </view>
-    <view class="class-tab">
-      <class-tab  />
+    <view class="class-tab" v-if="!overlay && name.length === 0">
+      <class-tab
+        :classCategory='classCategory'
+        @changeClass='changeClass'
+      />
     </view>
     <!-- 选择选手 -->
     <view class="student-list" >
-      <student-select 
-        v-for="item in 10" 
-        :key="item"
-        :itemData='item'
-        @pushBabyIds='pushBabyIds'
-        :babyIds='babyIds'
-      />
+      <block v-if="curClassList.length > 0">
+        <student-select
+          v-for="item in curClassList"
+          :key="item.id"
+          :itemData='item'
+          @pushBabyIds='pushBabyIds'
+          :babyIds='babyIds'
+        />
+      </block>
+      <view v-if="curClassList.length === 0 && name.length === 0 && !overlay && requestState" class="empty-page-box">
+        <empty-page description='暂无参赛选手' :image="require('static/common/empty2.png')" />
+      </view>
     </view>
 
     <!-- 底部 -->
-    <search-footer 
-      @openSubmitDialog="submitDialogShow = true"
+    <search-footer
+      :babyIds='babyIds'
+      @openSubmitDialog="openSubmitDialog"
     />
 
     <!-- 搜索时遮罩 -->
@@ -30,6 +40,7 @@
     <!-- 提交弹窗 -->
     <submit-dialog
       :submitDialogShow='submitDialogShow'
+      :babyInfoList='selectBabyList'
       @submit='submit'
       @closeSubmitDoalog='submitDialogShow = false'
     />
@@ -42,6 +53,8 @@ import ClassTab from './components/ClassTab'
 import StudentSelect from './components/StudentSelect'
 import SearchFooter from './components/SearchFooter'
 import SubmitDialog from './components/SubmitDialog'
+import { getBabyScore, bobyPass } from '@/api/promoted'
+import { classCategory as _classCategory } from './config'
 import Tip from '@/utils/tip'
 export default {
   name: 'search',
@@ -52,31 +65,87 @@ export default {
     SearchFooter,
     SubmitDialog
   },
-  onLoad () {
-    // this.getBabyScore()
+  computed: {
+    curClassList () {
+      if ( this.name.length !== 0) {
+        return this.babyList.filter( baby =>  baby.babyName.includes(this.name) && baby.isPass !== 1 ) 
+      } else if ( this.name.length === 0  && this.overlay) {
+        return []
+      } else {
+        return this.babyList.filter( baby => baby.classLevel === this.classType && baby.isPass !== 1  )
+      }
+    },
+    selectBabyList () {
+
+      return this.babyList.filter( baby => this.babyIds.includes(baby.id) && baby.isPass !== 1  )
+    }
+  },
+  onLoad (options) {
+    const { stageId } = options
+    this.stageId = stageId
+    this.getBabyScore()
   },
   data () {
     return {
       overlay: false, // 搜索遮罩
       submitDialogShow: false, // 提交
-
-      babyIds: [] // 需要提交的ids集合
+      stageId: '',
+      babyIds: [] ,// 需要提交的ids集合
+      babyList: [], // 宝贝列表
+      classType: -1 , //  当前tabs的类型
+      name: '',  // 搜索是园长或者园所名
+      requestState: false, // 主请求是否结束
+      classCategory: []
     }
   },
   methods: {
-    // 提交内容
-    submit () {
-      Tip.toast('提交成功', '' , 'none')
+    // 搜索学生
+    search (keyword) {
+      this.name = keyword
+    },
+    // 打开提交窗口
+    openSubmitDialog () {
+      if (this.babyIds.length > 0) {
+        this.submitDialogShow = true
+      } else {
+        Tip.toast('至少选择一名选手', '', 'none')
+      }
+    },
+    changeClass (classType) {
+      this.classType = classType
+    },
+    // 提交内容 宝贝批量晋级
+    async submit () {
+      const $par = {
+        babyIds: this.babyIds,
+        stageId: this.stageId
+      }
+      Tip.loading('提交中')
+      const { data, status } = await bobyPass($par)
+      Tip.loaded()
+      console.log(data)
+      if (status === 200) {
+        Tip.toast('提交成功', '' , 'none')
+        this.getBabyScore()
+        this.babyIds = []
+      }
       this.submitDialogShow = false
     },
     // 获取宝贝成绩
     async getBabyScore () {
       const $par =  {
         name: '',
-            
+        stageId: this.stageId,
+        pageSize: 10000
       }
-      const { data, status } = await getBabyScore()
+      const { data, status } = await getBabyScore($par)
+      this.requestState = true
       console.log( data, status);
+      this.babyList = data.entityList.filter( item => item.isPass === 0 )
+      this.classCategory = _classCategory.map( _classTab => {
+        _classTab.count = this.babyList.filter( baby => baby.classLevel === _classTab.id ).length
+        return _classTab
+      })
     },
     // 添加宝贝id
     pushBabyIds (id) {
@@ -100,6 +169,11 @@ export default {
   }
 }
 
+.student-list {
+  height: 100vh;
+  padding-bottom: 200rpx;
+}
+
 .search-com  {
   width: 100vw;
   height: 100rpx;
@@ -118,4 +192,13 @@ export default {
   bottom: 0;
   background-color: rgba(0, 0, 0, .6);
 }
+
+
+.empty-page-box {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: -1;
+}
 </style>

+ 7 - 2
src/pages/user/index.vue

@@ -193,8 +193,13 @@ export default {
 			})
 		},
 		// 点击邀请码与地区园所
-		hanlderInviteCodeWithSchool (item) {
-			const { id } =item
+		async hanlderInviteCodeWithSchool (item) {
+			const { id } = item
+
+			const {data, status } =  await getUserInfo()
+
+			if (status !== 200) return
+			
 			switch (id) {
 				case 1:
 					uni.navigateTo({

BIN
src/static/common/empty2.png


BIN
src/static/common/nation-bg.png


BIN
src/static/competition/rank1.png


BIN
src/static/competition/rank2.png


BIN
src/static/competition/rank3.png


BIN
src/static/competition/top-bg.png


+ 3 - 2
src/utils/config.js

@@ -2,11 +2,12 @@ let BASEURL = ""
 
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-    BASEURL = 'http://agentminiprogram.test.luojigou.vip:8899/'
+    BASEURL = 'http://agentminiprogram.test.luojigou.vip:8899'
     // BASEURL = 'https://api.zaojiao.net'
 }else{
     // 生产环境
     BASEURL = 'https://api.zaojiao.net'
 }
 
-export default BASEURL
+export default BASEURL
+

+ 1 - 1
src/utils/request.js

@@ -28,7 +28,7 @@ const request = async(params = {}) => {
       clearTimeout(timer)
       timer = setTimeout(() => {
         Tip.toast('登录失效,请重新登录', '', 'none')
-        uni.navigateTo({
+        uni.redirectTo ({
           url: '/pages/index/index'
         })
       }, 1000);