Browse Source

tv2.0 student组件重构

Changpeng Duan 4 years ago
parent
commit
3e62a5b7b0
2 changed files with 54 additions and 17 deletions
  1. 9 9
      v2tv/src/Mock/index.js
  2. 45 8
      v2tv/src/components/student.vue

+ 9 - 9
v2tv/src/Mock/index.js

@@ -10,7 +10,7 @@ let worldDetail = function () {
         item.push({
             "id": "@guid",
             // "name": "@region",
-            Name: "赵水水水",
+            Name: "赵沂明",
             "Confirmed": "@integer(36844, 368449)",
             "Deaths": "@integer(1099, 10993)",
             "Recovered": "@integer(1986, 19865)",
@@ -144,7 +144,7 @@ let testStudent = function (num, team, mustbeTeamOne) {
             PowerPercent: "@integer(1, 100)",
             // PowerPercent: "100",
             // Name: "@cname",
-            Name: "赵水水水",
+            Name: "赵沂明",
             PkSucessnum: '1',//胜场数
             PkTotalnum: '1',//总场数
             PlanId: 60,
@@ -255,7 +255,7 @@ let UserRankingQuery = function (num) {
     for (var i = 0; i < num; i++) {
         item1.push({
             // "UserName": "@cname",
-            UserName: "赵水水水",
+            UserName: "赵沂明",
             "Values": "@integer(1, 9999)",
             "Head": require('../static/img/testhead.png')
         })
@@ -263,7 +263,7 @@ let UserRankingQuery = function (num) {
     for (var i = 0; i < num; i++) {
         item2.push({
             // "UserName": "@cname",
-            UserName: "赵水水水",
+            UserName: "赵沂明",
             "Values": "@float(1,9999,0,1)",
             "Head": require('../static/img/testhead.png')
         })
@@ -299,7 +299,7 @@ let testHerosRankingQuery = function (num) {
             "Result": [
                 {
                     // "UserName": "@cname",
-                    UserName: "赵水水水",
+                    UserName: "赵沂明",
                     "Sex": 1,
                     "Head": require('../static/img/testhead.png'),
                     "Values": "4744",
@@ -308,7 +308,7 @@ let testHerosRankingQuery = function (num) {
                 },
                 {
                     // "UserName": "@cname",
-                    UserName: "赵水水水",
+                    UserName: "赵沂明",
                     "Sex": 1,
                     "Head": require('../static/img/testhead.png'),
                     "Values": "4034",
@@ -317,7 +317,7 @@ let testHerosRankingQuery = function (num) {
                 },
                 {
                     // "UserName": "@cname",
-                    UserName: "赵水水水",
+                    UserName: "赵沂明",
                     "Sex": 1,
                     "Head": require('../static/img/testhead.png'),
                     "Values": "2290",
@@ -332,7 +332,7 @@ let testHerosRankingQuery = function (num) {
             "Result": [
                 {
                     // "UserName": "@cname",
-                    UserName: "赵水水水",
+                    UserName: "赵沂明",
                     "Sex": 1,
                     "Head": require('../static/img/testhead.png'),
                     "Values": "1022",
@@ -341,7 +341,7 @@ let testHerosRankingQuery = function (num) {
                 },
                 {
                     // "UserName": "@cname",
-                    UserName: "赵水水水",
+                    UserName: "赵沂明",
                     "Sex": 1,
                     "Head": require('../static/img/testhead.png'),
                     "Values": "1020",

+ 45 - 8
v2tv/src/components/student.vue

@@ -14,7 +14,13 @@
           </div>
           <div class="md">
             <div class="head">
-
+              <img :src="s.Head" alt="" v-if="s.Head" :class="[{'boy':s.Sex == 1},{'girl':s.Sex == 2}]">
+              <img src="../static/img/people/flyhead.png" alt="" v-if="!s.Head">
+              <div class="names">
+              <span>
+                  {{ s.Name }}
+              </span>
+              </div>
             </div>
           </div>
           <div class="rt">
@@ -110,7 +116,7 @@ export default {
   margin: 0 auto;
 }
 
-em, i, ul, li {
+em, i, ul, li, s {
   margin: 0;
   padding: 0;
   list-style: none;
@@ -222,19 +228,50 @@ ul {
   color: #fff;
 }
 
-.max {
-  width: 12rem;
-  height: 5rem;
-  margin-top: 2rem;
-}
-
 .userinfo {
   @include cube;
+
+  .lt {
+    width: 35%;
+    float: left;
+
+    span {
+      float: right;
+
+      em {
+        color: white;
+        font-size: 1.5rem;
+      }
+
+      s {
+        font-size: 0.4rem;
+        float: right;
+        text-align: right;
+        margin-top: 0.25rem;
+      }
+    }
+  }
+
+  .md {
+    width: 30%;
+    float: left;
+  }
+
+  .rt {
+    width: 35%;
+    float: right;
+  }
 }
 
 .userSport {
   @include cube;
 }
 
+.max {
+  width: 12rem;
+  height: 5rem;
+  margin-top: 2rem;
+}
+
 
 </style>