소스 검색

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

张延森 3 년 전
부모
커밋
22fc8e12ce
3개의 변경된 파일62개의 추가작업 그리고 45개의 파일을 삭제
  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 파일 보기


+ 16
- 32
src/components/imgbox.vue 파일 보기

@@ -1,14 +1,11 @@
1 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 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 6
       </div>
9 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 9
       </div>
13 10
     </div>
14 11
   </div>
@@ -16,14 +13,11 @@
16 13
 <script>
17 14
 export default {
18 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 21
   data() {
28 22
     return {
29 23
       showPopup: false,
@@ -31,30 +25,20 @@ export default {
31 25
       classList: ["card"],
32 26
       fristFontImg:undefined,
33 27
       nowFontImg: require('../assets/popupImg/backImag.jpg'),
34
-      nowBackImg: require('../assets/popupImg/popuBody.jpg'),
28
+      // nowBackImg: require('../assets/popupImg/popuBody.jpg'),
35 29
       openImg: require('../assets/popupImg/redBack.jpg'),
36 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 파일 보기

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