Baozhangchao пре 3 година
родитељ
комит
e98fc5c8d3
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
         @click="cancelPopupts"
7
         @click="cancelPopupts"
8
       ></div>
8
       ></div>
9
       <div>
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
               </div>
21
               </div>
20
             </div>
22
             </div>
21
           </div>
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
               </div>
31
               </div>
30
             </div>
32
             </div>
31
           </div>
33
           </div>
32
         </div>
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
           <div class="page flex-col">
37
           <div class="page flex-col">
35
             <div class="group1 flex-col">
38
             <div class="group1 flex-col">
36
               <div class="wrap3 flex-col">
39
               <div class="wrap3 flex-col">
69
       type: Object
72
       type: Object
70
     },
73
     },
71
     PrizeState: {
74
     PrizeState: {
72
-      type: Number
75
+      type: [Number || Boolean]
73
     },
76
     },
74
     Prize: {
77
     Prize: {
75
-      type: Object
76
-      // default: () => ({})
78
+      type: Object,
79
+      default: () => ({})
77
     },
80
     },
78
     prizeList: {
81
     prizeList: {
79
       type: Array
82
       type: Array
87
       shaerBut: require('../assets/buttonImg/sayFriend.png'),
90
       shaerBut: require('../assets/buttonImg/sayFriend.png'),
88
       pressImage: require('../assets/buttonImg/pressSave.png'),
91
       pressImage: require('../assets/buttonImg/pressSave.png'),
89
       shaerButRed: require('../assets/buttonImg/sayFriend.png'),
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
       }
114
       }
111
     }
115
     }
112
   },
116
   },
117
+  created() {
118
+    this.noShowMy()
119
+  },
113
   methods: {
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
     cancelPopupts() {
129
     cancelPopupts() {
116
       // this.shaerShow = false
130
       // this.shaerShow = false

+ 1
- 1
src/components/Popup.vue Прегледај датотеку

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

+ 4
- 2
src/pages/Honghe.vue Прегледај датотеку

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