Baozhangchao 3 anni fa
parent
commit
99c43ce280
4 ha cambiato i file con 30 aggiunte e 12 eliminazioni
  1. 17
    3
      src/components/MyWinning.vue
  2. 2
    4
      src/components/Popup.vue
  3. 10
    4
      src/pages/Honghe.vue
  4. 1
    1
      vue.config.js

+ 17
- 3
src/components/MyWinning.vue Vedi File

@@ -7,7 +7,7 @@
7 7
         @click="cancelPopupts"
8 8
       ></div>
9 9
       <div>
10
-        <div v-if="PrizeState===0">
10
+        <div v-if="Prize!=undefined">
11 11
           <!-- 领取屏保 -->
12 12
           <div class="outer3 flex-col">
13 13
             <div class="haibao">
@@ -21,11 +21,21 @@
21 21
           </div>
22 22
         </div>
23 23
         <div v-else style="overflow: auto;height:100vh;">
24
-          <!-- 挂历 -->
24
+          <div class="page flex-col">
25
+            <div class="group1 flex-col">
26
+              <div class="wrap3 flex-col">
27
+                <img src="../assets/prizeImg/notPrize.jpg" class="subhaibao" />
28
+                <!-- 没有奖品 -->
29
+              </div>
30
+            </div>
31
+          </div>
32
+        </div>
33
+        <div v-if="PrizeState===2" style="overflow: auto;height:100vh;">
25 34
           <div class="page flex-col">
26 35
             <div class="group1 flex-col">
27 36
               <div class="wrap3 flex-col">
28 37
                 <img src="../assets/prizeImg/activityOver.jpg" class="subhaibao" />
38
+                <!-- 活动结束 -->
29 39
               </div>
30 40
             </div>
31 41
           </div>
@@ -63,6 +73,7 @@ export default {
63 73
     },
64 74
     Prize: {
65 75
       type: Object
76
+      // default: () => ({})
66 77
     }
67 78
   },
68 79
 
@@ -79,7 +90,10 @@ export default {
79 90
 
80 91
   watch: {
81 92
     stater(val, res) {
82
-      console.log('🚀 ~ file: CalendarPoster.vue ~ line 98 ~ stater ~ res', res)
93
+      console.log(
94
+        '🚀 ~ file: CalendarPoster.vue ~ line 98 ~ stater ~ res',
95
+        this.Prize
96
+      )
83 97
     },
84 98
     created() {
85 99
       // this.showSelf = this.show

+ 2
- 4
src/components/Popup.vue Vedi File

@@ -41,7 +41,7 @@
41 41
           </div>
42 42
           <!-- 右侧 -->
43 43
           <div class="section-box">
44
-            <div class="section-box-share" @click="()=>{this.MyWinningShow=true}" v-if="isPrize">
44
+            <div class="section-box-share" @click="()=>{this.MyWinningShow=true}">
45 45
               <img src="../assets/buttonImg/myPrize.png" alt />
46 46
             </div>
47 47
             <div
@@ -117,9 +117,7 @@ export default {
117 117
   },
118 118
   watch: {
119 119
     show(val) {
120
-      console.log(this.isPrize, 'aaaaaaaaaaaa')
121
-
122
-      console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', val)
120
+      console.log('🚀 ~ file: Popup.vue ~ line 78 ~ show ~ val', this.isPrize)
123 121
       this.showSelf = val
124 122
       if (this.show === false) {
125 123
         this.myShareShow = false

+ 10
- 4
src/pages/Honghe.vue Vedi File

@@ -175,7 +175,7 @@ export default {
175 175
       prizeList: [],
176 176
       bingoId: rand(0, 12) + 1, // 可以抽奖的月份
177 177
       NOMyWinningShow: true,
178
-      PrizeState: 0
178
+      PrizeState: null
179 179
     }
180 180
   },
181 181
   computed: {
@@ -197,7 +197,7 @@ export default {
197 197
       return undefined
198 198
     },
199 199
     noPrize() {
200
-      if (this.prizeList.length && this.person.prizeId) {
200
+      if (this.prizeList.length) {
201 201
         return this.prizeList.reduce((sum, x) => x.exitsNum + sum, 0) <= 0
202 202
       }
203 203
 
@@ -258,7 +258,10 @@ export default {
258 258
 
259 259
       // 如果点击可以抽奖
260 260
       if (month.id === this.bingoId && !this.noPrize) {
261
-        //------------奖品没了-------------------------------------------
261
+        if (this.person.prizeId) {
262
+          this.PrizeState = 0
263
+        }
264
+
262 265
         if (!this.person.personId) {
263 266
           // 报错, 提示刷新页面
264 267
         } else {
@@ -271,6 +274,7 @@ export default {
271 274
         }
272 275
       } else {
273 276
         this.showPopup = true
277
+        this.PrizeState = 2
274 278
       }
275 279
     },
276 280
     // 抽奖
@@ -280,13 +284,15 @@ export default {
280 284
           // 更新人员信息
281 285
           this.person = res
282 286
           this.showMyWinning = true
287
+          // this.PrizeState = 0
288
+
283 289
           console.log('showMyWinning-----------')
284 290
 
285 291
           // 其他动作
286 292
         })
287 293
         .catch((err) => {
288 294
           if (err && err.code === 9999) {
289
-            this.PrizeState = 1
295
+            this.PrizeState = 2
290 296
 
291 297
             // 奖品没了
292 298
           } else {

+ 1
- 1
vue.config.js Vedi File

@@ -11,7 +11,7 @@ module.exports = {
11 11
   devServer: {
12 12
     proxy: {
13 13
       '/api': {
14
-        target: "http://192.168.89.147:8080/",
14
+        target: "http://192.168.89.147:9000/",
15 15
         // ws: true,
16 16
         changeOrigin: true,
17 17
         // pathRewrite: {