Pārlūkot izejas kodu

添加判断,非wifi/4g不可领取

DESKTOP-SVI9JE1\muzen 2 gadi atpakaļ
vecāks
revīzija
dbf5e6fbf2
1 mainītis faili ar 17 papildinājumiem un 11 dzēšanām
  1. 17 11
      src/pages/activity/index.vue

+ 17 - 11
src/pages/activity/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class='app-container'>
-    <image :src="pic" mode="aspectFill"  />
+    <image :src="pic" mode="aspectFill" />
     <button class="submit" type="submit" circle @click="getSubmit">立即兑换</button>
 
     <!-- 弹窗 -->
@@ -28,7 +28,8 @@ export default {
       form: {
         activityId: '',
         clientType: getApp().globalData.userInfo.deviceClientType,
-        deviceMac: getApp().globalData.userInfo.deviceMac
+        deviceMac: getApp().globalData.userInfo.deviceMac,
+        type: getApp().globalData.deviceInfo.deviceMode
       },
       // 弹窗内容
       content: '',
@@ -60,15 +61,20 @@ export default {
     // 立即领取
     getSubmit() {
       this.$refs.popup.open()
-      submit(this.form).then(res => {
-        if (res.data.code === 0) {
-          this.content = res.data.data
-          this.isShow = true
-        } else {
-          this.content = res.data.message
-          this.isShow = false
-        }
-      })
+      if (getApp().globalData.deviceInfo.deviceMode == 2 && getApp().globalData.deviceInfo.deviceMode == 4) {
+        submit(this.form).then(res => {
+          if (res.data.code === 0) {
+            this.content = res.data.data
+            this.isShow = true
+          } else {
+            this.content = res.data.message
+            this.isShow = false
+          }
+        })
+      } else {
+        this.const = '请在WIFI/4G模式下连接设备'
+        this.isShow = false
+      }
     },
 
     // 关闭弹窗