Browse Source

修改新增设备逻辑

wangming 4 tuần trước cách đây
mục cha
commit
96ba249809
3 tập tin đã thay đổi với 27 bổ sung79 xóa
  1. 1 1
      src/components/js_sdk/index.js
  2. 25 77
      src/pagesA/adNewDevice/adNewDevice.vue
  3. 1 1
      src/vue.config.js

+ 1 - 1
src/components/js_sdk/index.js

@@ -8,7 +8,7 @@ http.setConfig(config => {
         //     config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
         // }
         config.baseUrl = "https://radar-power.cn/portal-service-server/";
-        // config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
+        config.baseUrl = "https://api.radar-power.asia:4443/portal-service-server/";
     }
     if (__wxConfig.envVersion == 'trial') {
         // let selectedService = uni.getStorageSync("sercviceChoice")

+ 25 - 77
src/pagesA/adNewDevice/adNewDevice.vue

@@ -68,7 +68,6 @@
     </view>
 </template>
 <script>
-const airkiss = requirePlugin("airkiss");
 export default {
     name: "my",
     data() {
@@ -183,83 +182,34 @@ export default {
                 clientId: this.clientId,
                 userId: uni.getStorageSync("userId"),
                 devName: this.devName,
-                height: 0,
-                wifiName: this.wifiName,
-                wifiPassword: this.wifiPassword,
-                northAngle: 0,
                 mountPlain:
                     this.mountPlain == "" ? "mountPlain" : this.mountPlain,
                 installPosition: this.installPosition,
-                xxStart: 0,
-                xxEnd: 0,
-                yyStart: 0,
-                yyEnd: 0,
-                zzStart: 0,
-                zzEnd: 0,
-                // statusLight: this.statusLight,
             };
-
-            if (this.editFlag) {
-                this.$http
-                    .post("wap/device/updateDevice", deviceBandingParams, {
-                        header: {
-                            "Content-Type": "application/json;charset=UTF-8",
-                        },
-                    })
-                    .then((res) => {
-                        if (res.data.code == 200) {
-                            uni.showToast({
-                                title: "绑定成功",
-                                icon: "success",
-                                duration: 1500,
-                            });
-                            uni.setStorageSync("devId", res.data.data.devId);
-                            uni.reLaunch({
-                                url:
-                                    "/pagesA/roomSetting/roomSetting?devId=" +
-                                    res.data.data.devId +
-                                    "&clientId=" +
-                                    res.data.data.clientId,
-                            });
-                        } else {
-                            uni.showToast({
-                                title: res.data.message,
-                                icon: "none",
-                                duration: 1500,
-                            });
-                        }
-                    });
-            } else {
-                this.$http
-                    .post("wap/device/deviceBinding", deviceBandingParams, {
-                        header: {
-                            "Content-Type": "application/json;charset=UTF-8",
-                        },
-                    })
-                    .then((res) => {
-                        if (res.data.code == 200) {
-                            uni.showToast({
-                                title: "绑定成功",
-                                icon: "success",
-                                duration: 1500,
-                            });
-                            uni.setStorageSync("devId", res.data.data.devId);
-                            uni.reLaunch({
-                                url:
-                                    "/pagesA/roomSetting/roomSetting?devId=" +
-                                    res.data.data.devId +
-                                    "&clientId=" +
-                                    res.data.data.clientId,
-                            });
-                        } else {
-                            uni.showToast({
-                                title: res.data.message,
-                                icon: "none",
-                                duration: 1500,
-                            });
-                        }
-                    });
-            }
+            this.$http
+                .post("wap/device/deviceBinding", deviceBandingParams, {
+                    header: {
+                        "Content-Type": "application/json;charset=UTF-8",
+                    },
+                })
+                .then((res) => {
+                    if (res.data.code == 200) {
+                        uni.showToast({
+                            title: "绑定成功",
+                            icon: "success",
+                            duration: 1500,
+                        });
+                        uni.reLaunch({
+                            url: "/pages/home/home",
+                        });
+                    } else {
+                        uni.showToast({
+                            title: res.data.message,
+                            icon: "none",
+                            duration: 1500,
+                        });
+                    }
+                });
         },
         setDevInfo(devInfo) {
             this.clientId = devInfo.clientId;
@@ -313,9 +263,7 @@ export default {
         }
     },
 
-    onUnload(options) {
-        airkiss.stopAirkiss();
-    },
+    onUnload(options) {},
     onShow() {},
 };
 </script>

+ 1 - 1
src/vue.config.js

@@ -2,7 +2,7 @@ const path = require('path')
 const CopyWebpackPlugin = require('copy-webpack-plugin')
 
 module.exports = {
-    productionSourceMap: false,
+    productionSourceMap: true,
     configureWebpack: {
         devtool: 'source-map',
         plugins: [