Browse Source

活动兑换仅支持wifi/4G设备

DESKTOP-SVI9JE1\muzen 2 years ago
parent
commit
b1346f889a
1 changed files with 19 additions and 34 deletions
  1. 19 34
      src/pages/activity/index.vue

+ 19 - 34
src/pages/activity/index.vue

@@ -5,15 +5,13 @@
 
     <!-- 弹窗 -->
     <uni-popup ref="popup" type="center" :is-mask-click="false">
-      <view v-if="isShow" class="popup">
-        <h3>兑换成功</h3>
+      <view class="popup">
+        <h3>{{ isShow ? '兑换成功' : '抱歉' }}</h3>
         <view class="center">{{ content }}</view>
-        <button type="submit" circle @click="getClose">确定</button>
-        <span>该套餐内容仅可在WIFI/移动数据模式下收听</span>
-      </view>
-      <view v-else class="popup-catch">
-        <view class="center">{{ content }}</view>
-        <button type="submit" circle @click="getClose">确定</button>
+        <view class="submit-btn">
+          <button type="submit" circle @click="getClose">确定</button>
+          <span>{{ isShow ? '该套餐内容仅可在WIFI/移动数据模式下收听' : '' }}</span>
+        </view>
       </view>
     </uni-popup>
   </view>
@@ -61,7 +59,7 @@ export default {
     // 立即领取
     getSubmit() {
       this.$refs.popup.open()
-      if (getApp().globalData.deviceInfo.deviceMode == 2 && getApp().globalData.deviceInfo.deviceMode == 4) {
+      if (this.form.type == 2 || this.form.type == 4) {
         submit(this.form).then(res => {
           if (res.data.code === 0) {
             this.content = res.data.data
@@ -72,7 +70,7 @@ export default {
           }
         })
       } else {
-        this.const = '请在WIFI/4G模式下连接设备'
+        this.content = '请在WIFI/4G模式下连接设备'
         this.isShow = false
       }
     },
@@ -106,20 +104,6 @@ uni-image {
 }
 
 .popup {
-  justify-content: space-between;
-
-  button {
-    position: absolute;
-    bottom: 116rpx;
-  }
-}
-
-.popup-catch {
-  justify-content: center;
-}
-
-.popup,
-.popup-catch {
   width: 576rpx;
   height: 600rpx;
   background: #fff;
@@ -130,23 +114,24 @@ uni-image {
   padding: 48rpx 0;
   display: flex;
   flex-direction: column;
+  justify-content: space-between;
   align-items: center;
 
   .center {
     font-size: 32rpx;
   }
 
-  button {
-    width: 320rpx;
-    height: 80rpx;
-    line-height: 80rpx;
-    font-size: 32rpx;
-    position: absolute;
-    bottom: 88rpx;
-  }
+  .submit-btn {
+    button {
+      width: 320rpx;
+      height: 80rpx;
+      line-height: 80rpx;
+      font-size: 32rpx;
+    }
 
-  span {
-    font-size: 24rpx;
+    span {
+      font-size: 24rpx;
+    }
   }
 }
 </style>