瀏覽代碼

抽奖页面 弹窗增加关闭按钮

DESKTOP-O04BTUJ\muzen 2 年之前
父節點
當前提交
461c770afd
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      src/pages/lottery/index.vue

+ 13 - 1
src/pages/lottery/index.vue

@@ -25,7 +25,7 @@
     </view>
 
     <!-- 弹窗 -->
-    <uni-popup ref="popup" type="center">
+    <uni-popup ref="popup" type="center" :is-mask-click="false">
       <view v-if="this.hasLotteryCount <= 0" class="popup" style="justify-content: space-around">
         <view>
           <view>很遗憾!</view>
@@ -40,6 +40,7 @@
         <button v-if="form.resultGoodType === 5" @click="getAgain">再抽一次</button>
         <button v-if="form.resultGoodType === 3" @click="getDetail">填写收货信息</button>
       </view>
+      <uni-icons class="close" type="close" size="45" color="#FFF" @click="close" />
     </uni-popup>
   </view>
 </template>
@@ -201,6 +202,11 @@ export default {
       uni.redirectTo({
         url: `/pages/lottery/detail?prizeId=${this.form.resultGoodId}&lotteryCode=` + encodeURIComponent(this.form.lotteryCode)
       })
+    },
+
+    // 关闭弹窗
+    close(){
+      this.$refs.popup.close()
     }
   }
 }
@@ -308,5 +314,11 @@ export default {
       font-size: 32rpx;
     }
   }
+  .close {
+    position: absolute;
+    left: 50%;
+    transform: translate(-50%);
+    margin-top: 20rpx;
+  }
 }
 </style>