解决微信小程序首页空白问题。
This commit is contained in:
@@ -1,134 +0,0 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const common_request = require("../../../common/request.js");
|
||||
const _sfc_main = {
|
||||
name: "DeviceBindPopup",
|
||||
data() {
|
||||
return {
|
||||
deviceBindForm: {
|
||||
deviceCode: "",
|
||||
salesPhone: "",
|
||||
dealershipName: ""
|
||||
},
|
||||
deviceBindSubmitting: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 打开设备绑定弹窗
|
||||
*/
|
||||
open() {
|
||||
this.deviceBindForm = {
|
||||
deviceCode: "",
|
||||
salesPhone: "",
|
||||
dealershipName: ""
|
||||
};
|
||||
if (this.$refs.deviceBindPopup) {
|
||||
this.$refs.deviceBindPopup.open();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 关闭设备绑定弹窗
|
||||
*/
|
||||
close() {
|
||||
if (this.$refs.deviceBindPopup) {
|
||||
this.$refs.deviceBindPopup.close();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 关闭设备绑定弹窗(内部方法)
|
||||
*/
|
||||
closeDeviceBindDialog() {
|
||||
this.close();
|
||||
},
|
||||
/**
|
||||
* 提交设备绑定
|
||||
*/
|
||||
async submitDeviceBind() {
|
||||
var _a, _b;
|
||||
if (this.deviceBindSubmitting)
|
||||
return;
|
||||
const { deviceCode, salesPhone, dealershipName } = this.deviceBindForm;
|
||||
if (!deviceCode || !deviceCode.trim()) {
|
||||
return common_vendor.index.showToast({
|
||||
title: "请输入设备编号",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.deviceBindSubmitting = true;
|
||||
try {
|
||||
const requestData = {
|
||||
deviceCode: deviceCode.trim(),
|
||||
salesPhone: salesPhone ? salesPhone.trim() : "",
|
||||
dealershipName: dealershipName ? dealershipName.trim() : "",
|
||||
bindStatus: true
|
||||
};
|
||||
const res = await common_request.post("/api/deviceManagement/add", requestData);
|
||||
if (res.statusCode === 200 && res.data && res.data.success) {
|
||||
this.close();
|
||||
common_vendor.index.showToast({
|
||||
title: res.data.message || "设备绑定成功",
|
||||
icon: "success"
|
||||
});
|
||||
this.$emit("success");
|
||||
} else {
|
||||
const errorMessage = ((_a = res.data) == null ? void 0 : _a.message) || "设备绑定失败,请稍后重试";
|
||||
common_vendor.index.showToast({
|
||||
title: errorMessage,
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/ucenter/components/DeviceBindPopup.vue:117", "设备绑定失败:", e);
|
||||
const errorMessage = ((_b = e == null ? void 0 : e.data) == null ? void 0 : _b.message) || (e == null ? void 0 : e.message) || "设备绑定失败,请稍后重试";
|
||||
common_vendor.index.showToast({
|
||||
title: errorMessage,
|
||||
icon: "none"
|
||||
});
|
||||
} finally {
|
||||
this.deviceBindSubmitting = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
(_easycom_uni_easyinput2 + _easycom_uni_popup2)();
|
||||
}
|
||||
const _easycom_uni_easyinput = () => "../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
||||
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_easyinput + _easycom_uni_popup)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.o(($event) => $data.deviceBindForm.deviceCode = $event),
|
||||
b: common_vendor.p({
|
||||
placeholder: "请输入设备编号",
|
||||
modelValue: $data.deviceBindForm.deviceCode
|
||||
}),
|
||||
c: common_vendor.o(($event) => $data.deviceBindForm.salesPhone = $event),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入销售电话",
|
||||
type: "number",
|
||||
modelValue: $data.deviceBindForm.salesPhone
|
||||
}),
|
||||
e: common_vendor.o(($event) => $data.deviceBindForm.dealershipName = $event),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入所属门店",
|
||||
modelValue: $data.deviceBindForm.dealershipName
|
||||
}),
|
||||
g: common_vendor.o((...args) => $options.closeDeviceBindDialog && $options.closeDeviceBindDialog(...args)),
|
||||
h: common_vendor.t($data.deviceBindSubmitting ? "提交中..." : "提交"),
|
||||
i: $data.deviceBindSubmitting,
|
||||
j: common_vendor.o((...args) => $options.submitDeviceBind && $options.submitDeviceBind(...args)),
|
||||
k: common_vendor.sr("deviceBindPopup", "e2e14e8e-0"),
|
||||
l: common_vendor.p({
|
||||
type: "dialog"
|
||||
})
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e2e14e8e"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/ucenter/components/DeviceBindPopup.js.map
|
||||
Reference in New Issue
Block a user