适配微信小程序

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);

View File

@@ -1 +1 @@
<uni-popup wx:if="{{l}}" class="r data-v-635fc302" u-s="{{['d']}}" u-r="deviceBindPopup" u-i="635fc302-0" bind:__l="__l" u-p="{{l}}"><view class="device-bind-dialog data-v-635fc302"><view class="device-bind-title data-v-635fc302">设备绑定</view><view class="device-bind-field data-v-635fc302"><text class="device-bind-label data-v-635fc302">设备编号</text><uni-easyinput wx:if="{{b}}" class="data-v-635fc302" u-i="635fc302-1,635fc302-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"/></view><view class="device-bind-field data-v-635fc302"><text class="device-bind-label data-v-635fc302">家长电话</text><uni-easyinput wx:if="{{d}}" class="data-v-635fc302" u-i="635fc302-2,635fc302-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/></view><view class="device-bind-field data-v-635fc302"><text class="device-bind-label data-v-635fc302">所属门店</text><uni-easyinput wx:if="{{f}}" class="data-v-635fc302" u-i="635fc302-3,635fc302-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"/></view><view class="device-bind-actions data-v-635fc302"><button class="dialog-btn cancel data-v-635fc302" bindtap="{{g}}">取消</button><button class="dialog-btn confirm data-v-635fc302" disabled="{{i}}" bindtap="{{j}}">{{h}}</button></view></view></uni-popup>
<uni-popup wx:if="{{l}}" class="r data-v-1b9b472c" u-s="{{['d']}}" u-r="deviceBindPopup" u-i="1b9b472c-0" bind:__l="__l" u-p="{{l}}"><view class="device-bind-dialog data-v-1b9b472c"><view class="device-bind-title data-v-1b9b472c">设备绑定</view><view class="device-bind-field data-v-1b9b472c"><text class="device-bind-label data-v-1b9b472c">设备编号</text><uni-easyinput wx:if="{{b}}" class="data-v-1b9b472c" u-i="1b9b472c-1,1b9b472c-0" bind:__l="__l" bindupdateModelValue="{{a}}" u-p="{{b}}"/></view><view class="device-bind-field data-v-1b9b472c"><text class="device-bind-label data-v-1b9b472c">电话</text><uni-easyinput wx:if="{{d}}" class="data-v-1b9b472c" u-i="1b9b472c-2,1b9b472c-0" bind:__l="__l" bindupdateModelValue="{{c}}" u-p="{{d}}"/></view><view class="device-bind-field data-v-1b9b472c"><text class="device-bind-label data-v-1b9b472c">所属门店</text><uni-easyinput wx:if="{{f}}" class="data-v-1b9b472c" u-i="1b9b472c-3,1b9b472c-0" bind:__l="__l" bindupdateModelValue="{{e}}" u-p="{{f}}"/></view><view class="device-bind-actions data-v-1b9b472c"><button class="dialog-btn cancel data-v-1b9b472c" bindtap="{{g}}">取消</button><button class="dialog-btn confirm data-v-1b9b472c" disabled="{{i}}" bindtap="{{j}}">{{h}}</button></view></view></uni-popup>

View File

@@ -1 +1 @@
.device-bind-dialog.data-v-635fc302{padding:40rpx 30rpx 30rpx;background-color:#fff;border-radius:16rpx;width:600rpx}.device-bind-title.data-v-635fc302{font-size:34rpx;font-weight:700;text-align:center;margin-bottom:30rpx}.device-bind-field.data-v-635fc302{margin-bottom:20rpx}.device-bind-label.data-v-635fc302{display:block;font-size:26rpx;color:#666;margin-bottom:10rpx}.device-bind-actions.data-v-635fc302{margin-top:20rpx;display:flex;flex-direction:row;justify-content:flex-end}.dialog-btn.data-v-635fc302{min-width:140rpx;height:70rpx;line-height:70rpx;font-size:28rpx;border-radius:8rpx;padding:0 24rpx}.dialog-btn.cancel.data-v-635fc302{background-color:#f5f5f5;color:#333;margin-right:20rpx}.dialog-btn.confirm.data-v-635fc302{background-color:#007aff;color:#fff}.dialog-btn.data-v-635fc302:after{border:none}
.device-bind-dialog.data-v-1b9b472c{padding:40rpx 30rpx 30rpx;background-color:#fff;border-radius:16rpx;width:600rpx}.device-bind-title.data-v-1b9b472c{font-size:34rpx;font-weight:700;text-align:center;margin-bottom:30rpx}.device-bind-field.data-v-1b9b472c{margin-bottom:20rpx}.device-bind-label.data-v-1b9b472c{display:block;font-size:26rpx;color:#666;margin-bottom:10rpx}.device-bind-actions.data-v-1b9b472c{margin-top:20rpx;display:flex;flex-direction:row;justify-content:flex-end}.dialog-btn.data-v-1b9b472c{min-width:140rpx;height:70rpx;line-height:70rpx;font-size:28rpx;border-radius:8rpx;padding:0 24rpx}.dialog-btn.cancel.data-v-1b9b472c{background-color:#f5f5f5;color:#333;margin-right:20rpx}.dialog-btn.confirm.data-v-1b9b472c{background-color:#007aff;color:#fff}.dialog-btn.data-v-1b9b472c:after{border:none}