李志伟 3 years ago
parent
commit
113510c04e
2 changed files with 46 additions and 20 deletions
  1. 7
    5
      src/components/imgbox.vue
  2. 39
    15
      src/pages/Honghe.vue

+ 7
- 5
src/components/imgbox.vue View File

@@ -17,10 +17,6 @@ export default {
17 17
       type: Object,
18 18
       default: () => ({})
19 19
     },
20
-    mode: {
21
-      type: String,
22
-      default: '1'
23
-    }
24 20
   },
25 21
   data() {
26 22
     return {
@@ -29,7 +25,7 @@ export default {
29 25
       classList: ["card"],
30 26
       fristFontImg:undefined,
31 27
       nowFontImg: require('../assets/popupImg/backImag.jpg'),
32
-      nowBackImg: require('../assets/popupImg/popuBody.jpg'),
28
+      // nowBackImg: require('../assets/popupImg/popuBody.jpg'),
33 29
       openImg: require('../assets/popupImg/redBack.jpg'),
34 30
       isFrist:true,
35 31
     };
@@ -37,6 +33,12 @@ export default {
37 33
   computed: {
38 34
     poster() {
39 35
       return this.mode === 1 ? this.nowFontImg : '';
36
+    },    
37
+    mode() {
38
+      return this.prize.mode;
39
+    },
40
+    nowBackImg() {
41
+      return this.mode === 3 ? require('../assets/popupImg/popuBody.jpg') : '';
40 42
     }
41 43
   },
42 44
 };

+ 39
- 15
src/pages/Honghe.vue View File

@@ -13,12 +13,13 @@
13 13
       <div class="outer6 flex-col">
14 14
         <div v-for="month in list" :key="month.id" class="section-item">
15 15
           <div @click="handleMonthClick(month)">
16
+            <ImgBox :prize="month"></ImgBox>
16 17
             <!-- <img class="section-item-image" src="../assets/coverIndex.jpg" /> -->
17
-            <img
18
+            <!-- <img
18 19
               :class="`section-item-image ${rotateY?'backImag':''}` "
19 20
               src="../assets/popupImg/backImag.jpg"
20
-            />
21
-          </div> -->
21
+            /> -->
22
+          </div>
22 23
         </div>
23 24
       </div>
24 25
     </div>
@@ -39,7 +40,8 @@ const monthList = [
39 40
     popImg: '',
40 41
     shareImg: '',
41 42
     screenImg: '',
42
-    calendarImg: ''
43
+    calendarImg: '',
44
+    mode: 1
43 45
   },
44 46
   {
45 47
     id: 2,
@@ -47,7 +49,8 @@ const monthList = [
47 49
     popImg: '',
48 50
     shareImg: '',
49 51
     screenImg: '',
50
-    calendarImg: ''
52
+    calendarImg: '',
53
+    mode: 1
51 54
   },
52 55
   {
53 56
     id: 3,
@@ -55,7 +58,8 @@ const monthList = [
55 58
     popImg: '',
56 59
     shareImg: '',
57 60
     screenImg: '',
58
-    calendarImg: ''
61
+    calendarImg: '',
62
+    mode: 1
59 63
   },
60 64
   {
61 65
     id: 4,
@@ -63,7 +67,8 @@ const monthList = [
63 67
     popImg: '',
64 68
     shareImg: '',
65 69
     screenImg: '',
66
-    calendarImg: ''
70
+    calendarImg: '',
71
+    mode: 1
67 72
   },
68 73
   {
69 74
     id: 5,
@@ -71,7 +76,8 @@ const monthList = [
71 76
     popImg: '',
72 77
     shareImg: '',
73 78
     screenImg: '',
74
-    calendarImg: ''
79
+    calendarImg: '',
80
+    mode: 1
75 81
   },
76 82
   {
77 83
     id: 6,
@@ -79,7 +85,8 @@ const monthList = [
79 85
     popImg: '',
80 86
     shareImg: '',
81 87
     screenImg: '',
82
-    calendarImg: ''
88
+    calendarImg: '',
89
+    mode: 1
83 90
   },
84 91
   {
85 92
     id: 7,
@@ -87,7 +94,8 @@ const monthList = [
87 94
     popImg: '',
88 95
     shareImg: '',
89 96
     screenImg: '',
90
-    calendarImg: ''
97
+    calendarImg: '',
98
+    mode: 1
91 99
   },
92 100
   {
93 101
     id: 8,
@@ -95,7 +103,8 @@ const monthList = [
95 103
     popImg: '',
96 104
     shareImg: '',
97 105
     screenImg: '',
98
-    calendarImg: ''
106
+    calendarImg: '',
107
+    mode: 1
99 108
   },
100 109
   {
101 110
     id: 9,
@@ -103,7 +112,8 @@ const monthList = [
103 112
     popImg: '',
104 113
     shareImg: '',
105 114
     screenImg: '',
106
-    calendarImg: ''
115
+    calendarImg: '',
116
+    mode: 1
107 117
   },
108 118
   {
109 119
     id: 10,
@@ -111,7 +121,8 @@ const monthList = [
111 121
     popImg: '',
112 122
     shareImg: '',
113 123
     screenImg: '',
114
-    calendarImg: ''
124
+    calendarImg: '',
125
+    mode: 1
115 126
   },
116 127
   {
117 128
     id: 11,
@@ -119,7 +130,8 @@ const monthList = [
119 130
     popImg: '',
120 131
     shareImg: '',
121 132
     screenImg: '',
122
-    calendarImg: ''
133
+    calendarImg: '',
134
+    mode: 1
123 135
   },
124 136
   {
125 137
     id: 12,
@@ -127,7 +139,8 @@ const monthList = [
127 139
     popImg: '',
128 140
     shareImg: '',
129 141
     screenImg: '',
130
-    calendarImg: ''
142
+    calendarImg: '',
143
+    mode: 1
131 144
   }
132 145
 ]
133 146
 
@@ -136,6 +149,7 @@ export default {
136 149
   components: {
137 150
     Popup: () => import('@/components/Popup.vue'),
138 151
     MyWinning: () => import('@/components/MyWinning.vue'),
152
+    ImgBox: () => import('@/components/imgbox.vue')
139 153
   },
140 154
   data() {
141 155
     return {
@@ -164,8 +178,18 @@ export default {
164 178
     //关闭
165 179
     cancelFrom() {
166 180
       this.showPopup = false
181
+      this.list.map((item) => {
182
+        if (item.id == this.currentMonth.id) {
183
+          item.mode=3
184
+        }
185
+      })
167 186
     },
168 187
     handleMonthClick(month) {
188
+      this.list.map((item) => {
189
+        if (item.id == month.id) {
190
+          item.mode=2
191
+        }
192
+      })
169 193
       this.currentMonth = month
170 194
 
171 195
       // 如果点击可以抽奖