瀏覽代碼

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

李志伟 3 年之前
父節點
當前提交
646f70ed85
共有 3 個文件被更改,包括 39 次插入23 次删除
  1. 34
    20
      src/components/MyWinning.vue
  2. 1
    1
      src/components/Popup.vue
  3. 4
    2
      src/pages/Honghe.vue

+ 34
- 20
src/components/MyWinning.vue 查看文件

@@ -7,30 +7,33 @@
7 7
         @click="cancelPopupts"
8 8
       ></div>
9 9
       <div>
10
-        <div v-if="Prize!=undefined">
11
-          <!-- 领取奖品-->
12
-          <div class="outer3 flex-col" style="overflow: auto;height:100vh;">
13
-            <div class="haibao-box" style="overflow: auto;height:100vh;">
14
-              <img class="haibao" src="../assets/prizeImg/MyPrize.jpg" alt />
10
+        <div v-show="!PrizeShow">
11
+          <div v-if="Prize.prizeId!=undefined">
12
+            <!-- 领取奖品-->
13
+            <div class="outer3 flex-col" style="overflow: auto;height:100vh;">
14
+              <div class="haibao-box" style="overflow: auto;height:100vh;">
15
+                <img class="haibao" src="../assets/prizeImg/MyPrize.jpg" alt />
15 16
 
16
-              <div class="haibao-jiangping">
17
-                <img v-if="Prize" :src="`${Prize.thumb2}`" alt />
18
-                <h1 v-else>暂无奖品</h1>
17
+                <div class="haibao-jiangping">
18
+                  <img v-if="Prize" :src="`${Prize.thumb2}`" alt />
19
+                  <h1 v-else>暂无奖品</h1>
20
+                </div>
19 21
               </div>
20 22
             </div>
21 23
           </div>
22
-        </div>
23
-        <div v-else style="overflow: auto;height:100vh;">
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
-                <!-- 没有奖品 -->
24
+          <div v-else style="overflow: auto;height:100vh;">
25
+            <div class="page flex-col">
26
+              <div class="group1 flex-col">
27
+                <div class="wrap3 flex-col">
28
+                  <img src="../assets/prizeImg/notPrize.jpg" class="subhaibao" />
29
+                  <!-- 没有奖品 -->
30
+                </div>
29 31
               </div>
30 32
             </div>
31 33
           </div>
32 34
         </div>
33
-        <div v-if="PrizeState==2" style="overflow: auto;height:100vh;">
35
+
36
+        <div v-show="PrizeShow" style="overflow: auto;height:100vh;">
34 37
           <div class="page flex-col">
35 38
             <div class="group1 flex-col">
36 39
               <div class="wrap3 flex-col">
@@ -69,11 +72,11 @@ export default {
69 72
       type: Object
70 73
     },
71 74
     PrizeState: {
72
-      type: Number
75
+      type: [Number || Boolean]
73 76
     },
74 77
     Prize: {
75
-      type: Object
76
-      // default: () => ({})
78
+      type: Object,
79
+      default: () => ({})
77 80
     },
78 81
     prizeList: {
79 82
       type: Array
@@ -87,7 +90,8 @@ export default {
87 90
       shaerBut: require('../assets/buttonImg/sayFriend.png'),
88 91
       pressImage: require('../assets/buttonImg/pressSave.png'),
89 92
       shaerButRed: require('../assets/buttonImg/sayFriend.png'),
90
-      pressLucky: require('../assets/buttonImg/happyAccept.png')
93
+      pressLucky: require('../assets/buttonImg/happyAccept.png'),
94
+      PrizeShow: null
91 95
     }
92 96
   },
93 97
 
@@ -110,7 +114,17 @@ export default {
110 114
       }
111 115
     }
112 116
   },
117
+  created() {
118
+    this.noShowMy()
119
+  },
113 120
   methods: {
121
+    noShowMy() {
122
+      let a = this.prizeList.reduce((sum, x) => x.exitsNum + sum, 0) <= 0
123
+      this.PrizeShow = a
124
+      console.log('🚀 ~ file: MyWinning.vue ~ line 119 ~ noShowMy ~ a', a)
125
+      // if (this.Prize.prizeId==''&& ) {
126
+      // }
127
+    },
114 128
     /** 取消按钮操作 */
115 129
     cancelPopupts() {
116 130
       // this.shaerShow = false

+ 1
- 1
src/components/Popup.vue 查看文件

@@ -97,7 +97,7 @@ export default {
97 97
       required: false
98 98
     },
99 99
     PrizeState: {
100
-      type: Number
100
+      type: [Number || Boolean]
101 101
     },
102 102
     prizeList: {
103 103
       type: Array

+ 4
- 2
src/pages/Honghe.vue 查看文件

@@ -228,10 +228,12 @@ export default {
228 228
   },
229 229
   methods: {
230 230
     noShowMy() {
231
-      if (this.noPrize) {
231
+      if (this.person.prizeId !== '' && this.noPrize) {
232 232
         console.log('有奖品')
233 233
       } else {
234
-        this.PrizeState = 2
234
+        this.PrizeState = true
235
+
236
+        console.log('没有奖品')
235 237
       }
236 238
     },
237 239
     //关闭