huangxiaoqiang
22 小时以前 960b33fa24c47a330e51a2c24859d681ae62caeb
Code Management/PDA-FG/pages/index/index.vue
@@ -64,47 +64,6 @@
      },
      methods: {
         asyncChange(e) {
            if (this.isChanging) return;
            this.isChanging = true;
            // 先显示loading状态
            this.$refs.uToast.show({
               title: '正在切换模式...',
               type: 'loading',
               duration: 1000
            });
            this.$u.post('/api/PDA/AutoStatus?auto='+( e ? 'true' : 'false'), {}).then(result => {
               console.log(result);
               if (result) {
                  this.value = e; // 只有在请求成功后才更新实际值
                  this.switchValue = e; // 同步switch的状态
                  this.$refs.uToast.show({
                     title: '模式切换成功',
                     type: 'success',
                     duration: 1000
                  });
               } else {
                  this.switchValue = !e; // 请求失败则恢复switch状态
                  this.$refs.uToast.show({
                     title: '模式切换失败',
                     type: 'error',
                     duration: 1000
                  });
               }
            }).catch(error => {
               this.switchValue = !e; // 请求失败则恢复switch状态
               this.$refs.uToast.show({
                  title: '请求出错',
                  type: 'error',
                  duration: 1000
               });
            }).finally(() => {
               this.isChanging = false;
            });
         },
         AndroidCheckUpdate: function() {
            var _this = this;
            uni.request({