Ver código fonte

Merge branch 'master' of http://git.ycjcjy.com/honghe/h5-draw-lots into master

张延森 3 anos atrás
pai
commit
22fc8e12ce
3 arquivos alterados com 62 adições e 45 exclusões
  1. 0
    0
      src/assets/prizeImg/activityOver.jpg
  2. 16
    32
      src/components/imgbox.vue
  3. 46
    13
      src/pages/Honghe.vue

src/assets/prizeImg/ALL_noPrize.jpg → src/assets/prizeImg/activityOver.jpg Ver arquivo


+ 16
- 32
src/components/imgbox.vue Ver arquivo

1
 <template>
1
 <template>
2
-  <div :class="{ bigBox: state === 1 }">
3
-    <popup :show="showPopup" @cancel="cancelFrom" />
4
-    <div class="card" :class="{ flipped: state === 1 }" @click="showPopup=true">
2
+  <div class="bigBox">
3
+    <div class="card" :class="{ flipped: mode === 2 }">
5
       <div class="front">
4
       <div class="front">
6
-        <img v-if="isFrist" :src="fristFontImg" class="nowimage" />
7
-        <img v-else :src="nowFontImg" class="nowimage" />
5
+        <img :src="poster" class="nowimage" />
8
       </div>
6
       </div>
9
       <div class="back">
7
       <div class="back">
10
-        <img v-if="state===1" :src="nowBackImg" class="nowimage" />
11
-        <img v-else :src="openImg" class="nowimage" />
8
+        <img :src="nowBackImg" class="nowimage" />
12
       </div>
9
       </div>
13
     </div>
10
     </div>
14
   </div>
11
   </div>
16
 <script>
13
 <script>
17
 export default {
14
 export default {
18
   props: {
15
   props: {
19
-    value: {
20
-      type: String,
21
-      require: true,
16
+    prize: {
17
+      type: Object,
18
+      default: () => ({})
22
     },
19
     },
23
   },
20
   },
24
-  components: {
25
-    Popup: () => import("@/components/Popup.vue"),
26
-  },
27
   data() {
21
   data() {
28
     return {
22
     return {
29
       showPopup: false,
23
       showPopup: false,
31
       classList: ["card"],
25
       classList: ["card"],
32
       fristFontImg:undefined,
26
       fristFontImg:undefined,
33
       nowFontImg: require('../assets/popupImg/backImag.jpg'),
27
       nowFontImg: require('../assets/popupImg/backImag.jpg'),
34
-      nowBackImg: require('../assets/popupImg/popuBody.jpg'),
28
+      // nowBackImg: require('../assets/popupImg/popuBody.jpg'),
35
       openImg: require('../assets/popupImg/redBack.jpg'),
29
       openImg: require('../assets/popupImg/redBack.jpg'),
36
       isFrist:true,
30
       isFrist:true,
37
     };
31
     };
38
   },
32
   },
39
-  watch: {
40
-    value: {
41
-      handler(val) {
42
-        if (val) {
43
-          this.fristFontImg = val;
44
-        }
45
-      },
46
-      immediate: true,
47
-    },
48
-  },
49
-  methods: {
50
-    transform() {
51
-      this.showPopup=true
52
-      this.state = Math.abs(this.state - 1);
33
+  computed: {
34
+    poster() {
35
+      return this.mode === 1 ? this.nowFontImg : '';
36
+    },    
37
+    mode() {
38
+      return this.prize.mode;
53
     },
39
     },
54
-    cancelFrom() {
55
-      this.state = Math.abs(this.state - 1);
56
-      this.showPopup=false
57
-      this.isFrist=false
40
+    nowBackImg() {
41
+      return this.mode === 3 ? require('../assets/popupImg/popuBody.jpg') : '';
58
     }
42
     }
59
   },
43
   },
60
 };
44
 };

+ 46
- 13
src/pages/Honghe.vue Ver arquivo

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