Baozhangchao 3 лет назад
Родитель
Сommit
d654cf5fed
4 измененных файлов: 52 добавлений и 16 удалений
  1. 2
    0
      src/store/index.js
  2. 22
    9
      src/views/Course.vue
  3. 12
    4
      src/views/StrongPhoto.vue
  4. 16
    3
      src/views/userPages/SetUser.vue

+ 2
- 0
src/store/index.js Просмотреть файл

@@ -14,6 +14,8 @@ const store = new Vuex.Store({
14 14
       code: '123',
15 15
       name: '用户',
16 16
       phone: '',
17
+      age: null,
18
+
17 19
       personId: '',
18 20
       classId: '',
19 21
       sex: '',

+ 22
- 9
src/views/Course.vue Просмотреть файл

@@ -1,7 +1,12 @@
1 1
 <template>
2 2
   <div class="Course-box">
3
-    <div class="banner-box-top mglr-10" >
4
-      <van-swipe class="banner-swipe" :autoplay="3000" @change="i => currentItem = i" :show-indicators="false">
3
+    <div class="banner-box-top mglr-10">
4
+      <van-swipe
5
+        class="banner-swipe"
6
+        :autoplay="3000"
7
+        @change="i => currentItem = i"
8
+        :show-indicators="false"
9
+      >
5 10
         <van-swipe-item v-for="(image, index) in HomeBannerImages" :key="index">
6 11
           <ration-div :ratio="0.6">
7 12
             <van-image width="100%" height="100%" :src="image.thumb" />
@@ -9,12 +14,22 @@
9 14
         </van-swipe-item>
10 15
       </van-swipe>
11 16
       <div class="custom-indicator">
12
-        <span v-for="(_, index) in HomeBannerImages" :key="index" :class="{'active': currentItem === index }"></span>
17
+        <span
18
+          v-for="(_, index) in HomeBannerImages"
19
+          :key="index"
20
+          :class="{'active': currentItem === index }"
21
+        ></span>
13 22
       </div>
14 23
     </div>
15
-    
24
+
16 25
     <!-- list -->
17
-    <van-list class="mglr-10 course-list" v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
26
+    <van-list
27
+      class="mglr-10 course-list"
28
+      v-model="loading"
29
+      :finished="finished"
30
+      finished-text="没有更多了"
31
+      @load="onLoad"
32
+    >
18 33
       <course-card
19 34
         v-for="item in courseList"
20 35
         :key="item.courseId"
@@ -106,7 +121,6 @@ export default {
106 121
 </script>
107 122
 
108 123
 <style lang="less" scoped>
109
-
110 124
 .mglr-10 {
111 125
   margin-left: 10px;
112 126
   margin-right: 10px;
@@ -145,13 +159,12 @@ export default {
145 159
       background: rgba(0, 0, 0, 0.2);
146 160
 
147 161
       & + span {
148
-        margin-left: .2em;
162
+        margin-left: 0.2em;
149 163
       }
150 164
     }
151 165
     .active {
152
-      background: rgba(0, 0, 0, .65);
166
+      background: rgba(0, 0, 0, 0.65);
153 167
     }
154 168
   }
155
-
156 169
 }
157 170
 </style>

+ 12
- 4
src/views/StrongPhoto.vue Просмотреть файл

@@ -31,7 +31,14 @@
31 31
           <div></div>
32 32
           <span>{{item.createDate}}</span>
33 33
         </div>
34
-        <van-image v-for="(image, index) in item.res" :key="index" width="31vw" :src="image.url" style="padding:0 3px 0 2px" @click="showBig(image.url)" />
34
+        <van-image
35
+          v-for="(image, index) in item.res"
36
+          :key="index"
37
+          width="31vw"
38
+          :src="image.url"
39
+          style="padding:0 3px 0 2px"
40
+          @click="showBig(image.url)"
41
+        />
35 42
         <van-image-preview v-model="imageShow" :images="bigImg" />
36 43
       </div>
37 44
     </div>
@@ -64,7 +71,7 @@ export default {
64 71
     buttList: {
65 72
       handler(val) {
66 73
         if (val.length !== 0) {
67
-          this.SeePhotos(0,val[0].packId)
74
+          this.SeePhotos(0, val[0].packId)
68 75
         }
69 76
       },
70 77
       immediate: true
@@ -87,6 +94,7 @@ export default {
87 94
       this.imageShow = true
88 95
     },
89 96
     parseTime,
97
+    //日期按天分类
90 98
     dataResort(arr) {
91 99
       var newArr = []
92 100
       this.imageList.forEach(function (oldData, i) {
@@ -122,8 +130,8 @@ export default {
122 130
     animations() {
123 131
       this.classStyle = !this.classStyle
124 132
       if (this.classStyle === false) {
125
-        var item =this.buttList[this.activeNum]
126
-        this.buttList.splice(this.activeNum,1)
133
+        var item = this.buttList[this.activeNum]
134
+        this.buttList.splice(this.activeNum, 1)
127 135
         this.buttList.unshift(item)
128 136
       }
129 137
     },

+ 16
- 3
src/views/userPages/SetUser.vue Просмотреть файл

@@ -26,6 +26,14 @@
26 26
           value-key="label"
27 27
           :columns="sexArry"
28 28
         />
29
+        <van-field
30
+          v-model="personInfo.age"
31
+          type="number"
32
+          maxlength="2"
33
+          label="年龄"
34
+          placeholder="年龄"
35
+          :rules="[{ required: true, message: '请填写年龄' }]"
36
+        />
29 37
 
30 38
         <field-picker
31 39
           v-model="personInfo.termId"
@@ -70,10 +78,14 @@ export default {
70 78
         phone: null,
71 79
         termId: null,
72 80
         classId: null,
81
+        age: null
73 82
       },
74
-      sexArry: [{id: 1, label: '男'}, {id: 2, label: '女'}],
83
+      sexArry: [
84
+        { id: 1, label: '男' },
85
+        { id: 2, label: '女' }
86
+      ],
75 87
       SemesterArry: [],
76
-      ClasssArry: [],
88
+      ClasssArry: []
77 89
     }
78 90
   },
79 91
   computed: {
@@ -90,6 +102,7 @@ export default {
90 102
           this.personInfo.classId = nw.classId
91 103
           this.personInfo.termId = nw.termId
92 104
           this.personInfo.sex = nw.sex
105
+          // this.personInfo.age = nw.age
93 106
         }
94 107
       },
95 108
       immediate: true
@@ -131,7 +144,7 @@ export default {
131 144
       this.$toast.success('修改成功!')
132 145
       SetUser(this.$store.state.user.personId, {
133 146
         ...this.personInfo,
134
-        personId: this.$store.state.user.personId,
147
+        personId: this.$store.state.user.personId
135 148
       }).then((e) => {
136 149
         this.$store.commit('SET_USER_INFO', this.personInfo)
137 150
         this.$router.go(-1)