适配微信小程序

This commit is contained in:
zhonghua.li
2026-04-17 09:41:37 +08:00
parent 18455a311d
commit 36b8784bc1
59 changed files with 650 additions and 586 deletions

View File

@@ -1 +1 @@
"use strict";const e=require("../../../common/vendor.js"),i=require("../../../common/request.js"),o={name:"DeviceBindPopup",data:()=>({deviceBindForm:{deviceCode:"",salesPhone:"",dealershipName:""},deviceBindSubmitting:!1}),methods:{open(){this.deviceBindForm={deviceCode:"",salesPhone:"",dealershipName:""},this.$refs.deviceBindPopup&&this.$refs.deviceBindPopup.open()},close(){this.$refs.deviceBindPopup&&this.$refs.deviceBindPopup.close()},closeDeviceBindDialog(){this.close()},async submitDeviceBind(){var o,n;if(this.deviceBindSubmitting)return;const{deviceCode:s,salesPhone:d,dealershipName:t}=this.deviceBindForm;if(!s||!s.trim())return e.index.showToast({title:"请输入设备编号",icon:"none"});this.deviceBindSubmitting=!0;try{const n={deviceCode:s.trim(),salesPhone:d?d.trim():"",dealershipName:t?t.trim():"",bindStatus:!0},c=await i.post("/api/deviceManagement/add",n);if(200===c.statusCode&&c.data&&c.data.success)this.close(),e.index.showToast({title:c.data.message||"设备绑定成功",icon:"success"}),this.$emit("success");else{const i=(null==(o=c.data)?void 0:o.message)||"设备绑定失败,请稍后重试";e.index.showToast({title:i,icon:"none"})}}catch(c){console.error("设备绑定失败:",c);const i=(null==(n=null==c?void 0:c.data)?void 0:n.message)||(null==c?void 0:c.message)||"设备绑定失败,请稍后重试";e.index.showToast({title:i,icon:"none"})}finally{this.deviceBindSubmitting=!1}}}};if(!Array){(e.resolveComponent("uni-easyinput")+e.resolveComponent("uni-popup"))()}Math||((()=>"../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"))();const n=e._export_sfc(o,[["render",function(i,o,n,s,d,t){return{a:e.o((e=>d.deviceBindForm.deviceCode=e),"1b"),b:e.p({placeholder:"请输入设备编号",modelValue:d.deviceBindForm.deviceCode}),c:e.o((e=>d.deviceBindForm.salesPhone=e),"73"),d:e.p({placeholder:"请输入销售电话",type:"number",modelValue:d.deviceBindForm.salesPhone}),e:e.o((e=>d.deviceBindForm.dealershipName=e),"e7"),f:e.p({placeholder:"请输入所属门店",modelValue:d.deviceBindForm.dealershipName}),g:e.o(((...e)=>t.closeDeviceBindDialog&&t.closeDeviceBindDialog(...e)),"f1"),h:e.t(d.deviceBindSubmitting?"提交中...":"提交"),i:d.deviceBindSubmitting,j:e.o(((...e)=>t.submitDeviceBind&&t.submitDeviceBind(...e)),"03"),k:e.sr("deviceBindPopup","635fc302-0"),l:e.p({type:"dialog"})}}],["__scopeId","data-v-635fc302"]]);wx.createComponent(n);
"use strict";const e=require("../../../common/vendor.js"),i=require("../../../common/request.js"),o={name:"DeviceBindPopup",data:()=>({deviceBindForm:{deviceCode:"",salesPhone:"",dealershipName:""},deviceBindSubmitting:!1}),methods:{open(){this.deviceBindForm={deviceCode:"",salesPhone:"",dealershipName:""},this.$refs.deviceBindPopup&&this.$refs.deviceBindPopup.open()},close(){this.$refs.deviceBindPopup&&this.$refs.deviceBindPopup.close()},closeDeviceBindDialog(){this.close()},async submitDeviceBind(){var o,n;if(this.deviceBindSubmitting)return;const{deviceCode:s,salesPhone:d,dealershipName:t}=this.deviceBindForm;if(!s||!s.trim())return e.index.showToast({title:"请输入设备编号",icon:"none"});this.deviceBindSubmitting=!0;try{const n={deviceCode:s.trim(),salesPhone:d?d.trim():"",dealershipName:t?t.trim():"",bindStatus:!0},c=await i.post("/api/deviceManagement/add",n);if(200===c.statusCode&&c.data&&c.data.success)this.close(),e.index.showToast({title:c.data.message||"设备绑定成功",icon:"success"}),this.$emit("success");else{const i=(null==(o=c.data)?void 0:o.message)||"设备绑定失败,请稍后重试";e.index.showToast({title:i,icon:"none"})}}catch(c){console.error("设备绑定失败:",c);const i=(null==(n=null==c?void 0:c.data)?void 0:n.message)||(null==c?void 0:c.message)||"设备绑定失败,请稍后重试";e.index.showToast({title:i,icon:"none"})}finally{this.deviceBindSubmitting=!1}}}};if(!Array){(e.resolveComponent("uni-easyinput")+e.resolveComponent("uni-popup"))()}Math||((()=>"../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"))();const n=e._export_sfc(o,[["render",function(i,o,n,s,d,t){return{a:e.o((e=>d.deviceBindForm.deviceCode=e),"1b"),b:e.p({placeholder:"请输入设备编号",modelValue:d.deviceBindForm.deviceCode}),c:e.o((e=>d.deviceBindForm.salesPhone=e),"b0"),d:e.p({placeholder:"请输入电话",type:"number",modelValue:d.deviceBindForm.salesPhone}),e:e.o((e=>d.deviceBindForm.dealershipName=e),"9f"),f:e.p({placeholder:"请输入所属门店",modelValue:d.deviceBindForm.dealershipName}),g:e.o(((...e)=>t.closeDeviceBindDialog&&t.closeDeviceBindDialog(...e)),"f8"),h:e.t(d.deviceBindSubmitting?"提交中...":"提交"),i:d.deviceBindSubmitting,j:e.o(((...e)=>t.submitDeviceBind&&t.submitDeviceBind(...e)),"02"),k:e.sr("deviceBindPopup","1b9b472c-0"),l:e.p({type:"dialog"})}}],["__scopeId","data-v-1b9b472c"]]);wx.createComponent(n);