Browse Source

Merge branch 'develop/3.1.0' into test

DESKTOP-SVI9JE1\muzen 2 năm trước cách đây
mục cha
commit
902a52a965
2 tập tin đã thay đổi với 24 bổ sung12 xóa
  1. 7 1
      src/App.vue
  2. 17 11
      src/pages/activity/index.vue

+ 7 - 1
src/App.vue

@@ -4,12 +4,15 @@ export default {
     // 用户信息
     userInfo: {},
     // 状态栏
-    statusBarHeight: 20
+    statusBarHeight: 20,
+    // 设备信息
+    deviceInfo: {}
   },
   onLaunch() {
     // 获取App方法
     getUserInfo.postMessage('获取用户信息')
     getDeviceInfo.postMessage('获取设备信息')
+    getMWDeviceInfo.postMessage('获取音响信息')
     // 暴露setUserInfo方法给APP
     window['setUserInfo'] = res => {
       this.globalData.userInfo = JSON.parse(res)
@@ -17,6 +20,9 @@ export default {
     window['setDeviceInfo'] = res => {
       this.globalData.statusBarHeight = JSON.parse(res).statusHeight
     }
+    window['setMWDeviceInfo'] = res => {
+      this.globalData.deviceInfo = JSON.parse(res)
+    }
   }
 }
 </script>

+ 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
+      }
     },
 
     // 关闭弹窗