"use strict"; const common_vendor = require("../../../common/vendor.js"); const utils_api = require("../../../utils/api.js"); const utils_tools = require("../../../utils/tools.js"); if (!Array) { const _easycom_ecuCodeScan2 = common_vendor.resolveComponent("ecuCodeScan"); const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item"); const _easycom_bikeCodeScan2 = common_vendor.resolveComponent("bikeCodeScan"); const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms"); const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card"); const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more"); const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list"); const _easycom_c_uni_goods_nav2 = common_vendor.resolveComponent("c-uni-goods-nav"); (_easycom_ecuCodeScan2 + _easycom_uni_forms_item2 + _easycom_bikeCodeScan2 + _easycom_uni_forms2 + _easycom_uni_card2 + _easycom_uni_load_more2 + _easycom_uni_list2 + _easycom_c_uni_goods_nav2)(); } const _easycom_ecuCodeScan = () => "../../../components/ecuCodeScan/ecuCodeScan.js"; const _easycom_uni_forms_item = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.js"; const _easycom_bikeCodeScan = () => "../../../components/bikeCodeScan/bikeCodeScan.js"; const _easycom_uni_forms = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms.js"; const _easycom_uni_card = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js"; const _easycom_uni_load_more = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.js"; const _easycom_uni_list = () => "../../../node-modules/@dcloudio/uni-ui/lib/uni-list/uni-list.js"; const _easycom_c_uni_goods_nav = () => "../../../components/c-uni-goods-nav/c-uni-goods-nav.js"; if (!Math) { (_easycom_ecuCodeScan + _easycom_uni_forms_item + _easycom_bikeCodeScan + _easycom_uni_forms + _easycom_uni_card + _easycom_uni_load_more + _easycom_uni_list + _easycom_c_uni_goods_nav)(); } const _sfc_main = { __name: "detectionecu", setup(__props) { const ebikeInfo = common_vendor.ref({ ecuCode: "", bikeCode: "", ecuId: "", ecuSn: "" }); const reqState = common_vendor.ref(false); const detectionInfo = common_vendor.ref({ online: { load: "", btuDisabled: true, detectionState: "", msg: "" }, findEbike: { load: "", btuDisabled: true, detectionState: "", msg: "" }, gps: { load: "", btuDisabled: true, detectionState: false, msg: "" }, soc: { load: "", btuDisabled: true, detectionState: false, msg: "" }, openBatteryLock: { load: "", btuDisabled: true, detectionState: "", msg: "" }, lock: { load: "", btuDisabled: true, detectionState: "", msg: "" }, unlock: { load: "", btuDisabled: true, detectionState: "", msg: "" }, openHelmet: { load: "", btuDisabled: true, detectionState: "", msg: "" }, voltage: { load: "", btuDisabled: true, detectionState: false, msg: "" }, cancelAntiTheft: { load: "", btuDisabled: true, detectionState: "", msg: "" }, powerOff: { load: "", btuDisabled: true, detectionState: "", msg: "" } }); const modelShow = common_vendor.ref(true); const urlList = common_vendor.ref([]); const contentText = common_vendor.ref({ contentdown: "", contentrefresh: "测试中", contentnomore: "" }); const showClick = () => { modelShow.value = !modelShow.value; }; const navButtonGroup = common_vendor.reactive([{ text: "自动测试", backgroundColor: "#0078D4", color: "#fff", disable: true }]); const bikeCodeScanChange = (data) => { utils_api.callEbikeInfo("getBikeINfoData?bikeCode=" + data).then((res) => { ebikeInfo.value.ecuCode = res.data.ecuCode; ebikeInfo.value.bikeId = res.data.bikeId; ebikeInfo.value.ecuId = res.data.ecuId; ebikeInfo.value.ecuSn = res.data.ecuSn; detectionInfo.value.online.btuDisabled = false; detectionInfo.value.findEbike.btuDisabled = false; detectionInfo.value.gps.btuDisabled = false; detectionInfo.value.soc.btuDisabled = false; detectionInfo.value.openBatteryLock.btuDisabled = false; detectionInfo.value.lock.btuDisabled = false; detectionInfo.value.unlock.btuDisabled = false; detectionInfo.value.openHelmet.btuDisabled = false; detectionInfo.value.voltage.btuDisabled = false; detectionInfo.value.cancelAntiTheft.btuDisabled = false; detectionInfo.value.powerOff.btuDisabled = false; navButtonGroup[0].disable = false; }); }; const ecuCodeScanChange = (data) => { ebikeInfo.value.ecuCode = data["imei"]; ebikeInfo.value.ecuSn = data["sn"]; }; const socClick = () => { utils_tools.showModelMessage("中控读取电池BMS返回的电量", "SOC说明", false, "我知道了"); }; const execDetection = (url) => { if (reqState.value) { common_vendor.index.showToast({ title: "指令执行中,请稍后", icon: "none" }); detectionInfo.value[url["url"]].btuDisable = false; return; } if (url["type"]) { detectionInfo.value[url["type"]].load = "loading"; detectionInfo.value[url["type"]].btuDisable = true; detectionInfo.value[url["type"]].detectionState = ""; } else { detectionInfo.value[url["url"]].load = "loading"; detectionInfo.value[url["url"]].btuDisable = true; detectionInfo.value[url["url"]].detectionState = ""; } reqState.value = true; var paramName = "ecuId"; var data = ebikeInfo.value.ecuId; var bikeId = ebikeInfo.value.bikeId; utils_api.callCoreApi(url["url"] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, "get").then((res) => { if (url["type"]) { utils_api.callCoreApi("gpsMsg?ecuSn=" + ebikeInfo.value.ecuSn, {}, "get").then((res2) => { detectionInfo.value[url["type"]].load = ""; reqState.value = false; detectionInfo.value[url["type"]].btuDisable = false; if (url["type"] == "gps") { detectionInfo.value[url["type"]].msg = "东经:" + res2.data.longitude + "°,北纬:" + res2.data.latitude + "°"; } else { detectionInfo.value[url["type"]].msg = res2.data[url["type"]]; } detectionInfo.value[url["type"]].detectionState = true; }); } else { detectionInfo.value[url["url"]].load = ""; reqState.value = false; detectionInfo.value[url["url"]].btuDisable = false; detectionInfo.value[url["url"]].msg = res.data.message; if (res.data.code == 200) { detectionInfo.value[url["url"]].detectionState = "success"; } else { detectionInfo.value[url["url"]].detectionState = "error"; } } }); }; const recursionExecDetection = () => { if (urlList.value[0]["type"]) { detectionInfo.value[urlList.value[0]["type"]].load = "loading"; detectionInfo.value[urlList.value[0]["type"]].btuDisable = true; detectionInfo.value[urlList.value[0]["type"]].detectionState = ""; } else { detectionInfo.value[urlList.value[0]["url"]].load = "loading"; detectionInfo.value[urlList.value[0]["url"]].btuDisable = true; detectionInfo.value[urlList.value[0]["url"]].detectionState = ""; } reqState.value = true; var paramName = "ecuId"; var data = ebikeInfo.value.ecuId; var bikeId = ebikeInfo.value.bikeId; utils_api.callCoreApi(urlList.value[0]["url"] + "?" + paramName + "=" + data + "&bikeId=" + bikeId, {}, "get").then((res) => { if (urlList.value[0]["type"]) { utils_api.callCoreApi("gpsMsg?ecuSn=" + ebikeInfo.value.ecuSn, {}, "get").then((res2) => { detectionInfo.value[urlList.value[0]["type"]].load = ""; reqState.value = false; detectionInfo.value[urlList.value[0]["type"]].btuDisable = false; if (urlList.value[0]["type"] == "gps") { detectionInfo.value[urlList.value[0]["type"]].msg = "东经:" + res2.data.longitude + "°,北纬:" + res2.data.latitude + "°"; } else { detectionInfo.value[urlList.value[0]["type"]].msg = res2.data[urlList.value[0]["type"]]; } detectionInfo.value[urlList.value[0]["type"]].detectionState = true; urlList.value.shift(); if (urlList.value.length > 0) { recursionExecDetection(); } }); } else { detectionInfo.value[urlList.value[0]["url"]].load = ""; reqState.value = false; detectionInfo.value[urlList.value[0]["url"]].btuDisable = false; detectionInfo.value[urlList.value[0]["url"]].msg = res.data.message; if (res.data.code == 200) { detectionInfo.value[urlList.value[0]["url"]].detectionState = "success"; } else { detectionInfo.value[urlList.value[0]["url"]].detectionState = "error"; } urlList.value.shift(); if (urlList.value.length > 0) { recursionExecDetection(); } } }); }; const autoDetection = () => { urlList.value = [ { url: "online" }, { url: "gps", type: "gps" }, { url: "gps", type: "soc" }, { url: "gps", type: "voltage" }, { url: "openBatteryLock" }, { url: "unlock" }, { url: "openHelmet" }, { url: "lock" }, { url: "findEbike" }, { url: "powerOff" }, { url: "cancelAntiTheft" } ]; recursionExecDetection(); }; return (_ctx, _cache) => { return common_vendor.e({ a: modelShow.value }, modelShow.value ? { b: common_vendor.o(showClick), c: common_vendor.o(ecuCodeScanChange), d: common_vendor.p({ codeValue: ebikeInfo.value.ecuCode }), e: common_vendor.p({ label: "中控编号", ["label-s"]: true, name: "bikeCode" }) } : { f: common_vendor.o(showClick), g: common_vendor.o(bikeCodeScanChange), h: common_vendor.p({ codeValue: ebikeInfo.value.bikeCode }), i: common_vendor.p({ label: "车辆编号", name: "bikeCode" }) }, { j: common_vendor.sr("ebikeInfoForm", "43797045-1,43797045-0"), k: common_vendor.p({ modelValue: ebikeInfo.value }), l: detectionInfo.value.online.load == "loading" }, detectionInfo.value.online.load == "loading" ? { m: common_vendor.p({ status: detectionInfo.value.online.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { n: detectionInfo.value.online.detectionState == "error" }, detectionInfo.value.online.detectionState == "error" ? {} : {}, { o: detectionInfo.value.online.detectionState == "error" }, detectionInfo.value.online.detectionState == "error" ? { p: common_vendor.t(detectionInfo.value.online.msg) } : {}, { q: detectionInfo.value.online.detectionState == "success" }, detectionInfo.value.online.detectionState == "success" ? {} : {}, { r: detectionInfo.value.online.detectionState == "success" }, detectionInfo.value.online.detectionState == "success" ? { s: common_vendor.t(detectionInfo.value.online.msg) } : {}, { t: detectionInfo.value.online.btuDisabled, v: common_vendor.o(($event) => execDetection({ url: "online" })), w: common_vendor.p({ border: true }), x: detectionInfo.value.gps.load == "loading" }, detectionInfo.value.gps.load == "loading" ? { y: common_vendor.p({ status: detectionInfo.value.gps.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { z: detectionInfo.value.gps.detectionState }, detectionInfo.value.gps.detectionState ? {} : {}, { A: detectionInfo.value.gps.detectionState }, detectionInfo.value.gps.detectionState ? { B: common_vendor.t(detectionInfo.value.gps.msg) } : {}, { C: detectionInfo.value.gps.btuDisabled, D: common_vendor.o(($event) => execDetection({ url: "gps", type: "gps" })), E: common_vendor.p({ border: true }), F: common_vendor.o(socClick), G: detectionInfo.value.soc.load == "loading" }, detectionInfo.value.soc.load == "loading" ? { H: common_vendor.p({ status: detectionInfo.value.soc.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { I: detectionInfo.value.soc.detectionState }, detectionInfo.value.soc.detectionState ? {} : {}, { J: detectionInfo.value.soc.detectionState }, detectionInfo.value.soc.detectionState ? { K: common_vendor.t(detectionInfo.value.soc.msg) } : {}, { L: detectionInfo.value.soc.btuDisabled, M: common_vendor.o(($event) => execDetection({ url: "gps", type: "soc" })), N: common_vendor.p({ border: true }), O: detectionInfo.value.voltage.load == "loading" }, detectionInfo.value.voltage.load == "loading" ? { P: common_vendor.p({ status: detectionInfo.value.voltage.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { Q: detectionInfo.value.voltage.detectionState }, detectionInfo.value.voltage.detectionState ? {} : {}, { R: detectionInfo.value.voltage.detectionState }, detectionInfo.value.voltage.detectionState ? { S: common_vendor.t(detectionInfo.value.voltage.msg) } : {}, { T: detectionInfo.value.voltage.btuDisabled, U: common_vendor.o(($event) => execDetection({ url: "gps", type: "voltage" })), V: common_vendor.p({ border: true }), W: detectionInfo.value.openBatteryLock.load == "loading" }, detectionInfo.value.openBatteryLock.load == "loading" ? { X: common_vendor.p({ ["icon-size"]: 15, status: detectionInfo.value.openBatteryLock.load, iconType: "circle", ["content-text"]: contentText.value }) } : {}, { Y: detectionInfo.value.openBatteryLock.detectionState == "error" }, detectionInfo.value.openBatteryLock.detectionState == "error" ? {} : {}, { Z: detectionInfo.value.openBatteryLock.detectionState == "error" }, detectionInfo.value.openBatteryLock.detectionState == "error" ? { aa: common_vendor.t(detectionInfo.value.openBatteryLock.msg) } : {}, { ab: detectionInfo.value.openBatteryLock.detectionState == "success" }, detectionInfo.value.openBatteryLock.detectionState == "success" ? {} : {}, { ac: detectionInfo.value.openBatteryLock.detectionState == "success" }, detectionInfo.value.openBatteryLock.detectionState == "success" ? { ad: common_vendor.t(detectionInfo.value.openBatteryLock.msg) } : {}, { ae: detectionInfo.value.openBatteryLock.btuDisabled, af: common_vendor.o(($event) => execDetection({ url: "openBatteryLock" })), ag: common_vendor.p({ border: true }), ah: detectionInfo.value.unlock.load == "loading" }, detectionInfo.value.unlock.load == "loading" ? { ai: common_vendor.p({ status: detectionInfo.value.unlock.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { aj: detectionInfo.value.unlock.detectionState == "error" }, detectionInfo.value.unlock.detectionState == "error" ? {} : {}, { ak: detectionInfo.value.unlock.detectionState == "error" }, detectionInfo.value.unlock.detectionState == "error" ? { al: common_vendor.t(detectionInfo.value.unlock.msg) } : {}, { am: detectionInfo.value.unlock.detectionState == "success" }, detectionInfo.value.unlock.detectionState == "success" ? {} : {}, { an: detectionInfo.value.unlock.detectionState == "success" }, detectionInfo.value.unlock.detectionState == "success" ? { ao: common_vendor.t(detectionInfo.value.unlock.msg) } : {}, { ap: detectionInfo.value.unlock.btuDisabled, aq: common_vendor.o(($event) => execDetection({ url: "unlock" })), ar: common_vendor.p({ border: true }), as: detectionInfo.value.openHelmet.load == "loading" }, detectionInfo.value.openHelmet.load == "loading" ? { at: common_vendor.p({ status: detectionInfo.value.openHelmet.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { av: detectionInfo.value.openHelmet.detectionState == "error" }, detectionInfo.value.openHelmet.detectionState == "error" ? {} : {}, { aw: detectionInfo.value.openHelmet.detectionState == "error" }, detectionInfo.value.openHelmet.detectionState == "error" ? { ax: common_vendor.t(detectionInfo.value.openHelmet.msg) } : {}, { ay: detectionInfo.value.openHelmet.detectionState == "success" }, detectionInfo.value.openHelmet.detectionState == "success" ? {} : {}, { az: detectionInfo.value.openHelmet.detectionState == "success" }, detectionInfo.value.openHelmet.detectionState == "success" ? { aA: common_vendor.t(detectionInfo.value.openHelmet.msg) } : {}, { aB: detectionInfo.value.openHelmet.btuDisabled, aC: common_vendor.o(($event) => execDetection({ url: "openHelmet" })), aD: common_vendor.p({ border: true }), aE: detectionInfo.value.lock.load == "loading" }, detectionInfo.value.lock.load == "loading" ? { aF: common_vendor.p({ status: detectionInfo.value.lock.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { aG: detectionInfo.value.lock.detectionState == "error" }, detectionInfo.value.lock.detectionState == "error" ? {} : {}, { aH: detectionInfo.value.lock.detectionState == "error" }, detectionInfo.value.lock.detectionState == "error" ? { aI: common_vendor.t(detectionInfo.value.lock.msg) } : {}, { aJ: detectionInfo.value.lock.detectionState == "success" }, detectionInfo.value.lock.detectionState == "success" ? {} : {}, { aK: detectionInfo.value.lock.detectionState == "success" }, detectionInfo.value.lock.detectionState == "success" ? { aL: common_vendor.t(detectionInfo.value.lock.msg) } : {}, { aM: detectionInfo.value.lock.btuDisabled, aN: common_vendor.o(($event) => execDetection({ url: "lock" })), aO: common_vendor.p({ border: true }), aP: detectionInfo.value.findEbike.load == "loading" }, detectionInfo.value.findEbike.load == "loading" ? { aQ: common_vendor.p({ status: detectionInfo.value.findEbike.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { aR: detectionInfo.value.findEbike.detectionState == "error" }, detectionInfo.value.findEbike.detectionState == "error" ? {} : {}, { aS: detectionInfo.value.findEbike.detectionState == "error" }, detectionInfo.value.findEbike.detectionState == "error" ? { aT: common_vendor.t(detectionInfo.value.findEbike.msg) } : {}, { aU: detectionInfo.value.findEbike.detectionState == "success" }, detectionInfo.value.findEbike.detectionState == "success" ? {} : {}, { aV: detectionInfo.value.findEbike.detectionState == "success" }, detectionInfo.value.findEbike.detectionState == "success" ? { aW: common_vendor.t(detectionInfo.value.findEbike.msg) } : {}, { aX: detectionInfo.value.findEbike.btuDisabled, aY: common_vendor.o(($event) => execDetection({ url: "findEbike" })), aZ: common_vendor.p({ border: true }), ba: detectionInfo.value.powerOff.load == "loading" }, detectionInfo.value.powerOff.load == "loading" ? { bb: common_vendor.p({ status: detectionInfo.value.powerOff.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { bc: detectionInfo.value.powerOff.detectionState == "error" }, detectionInfo.value.powerOff.detectionState == "error" ? {} : {}, { bd: detectionInfo.value.powerOff.detectionState == "error" }, detectionInfo.value.powerOff.detectionState == "error" ? { be: common_vendor.t(detectionInfo.value.powerOff.msg) } : {}, { bf: detectionInfo.value.powerOff.detectionState == "success" }, detectionInfo.value.powerOff.detectionState == "success" ? {} : {}, { bg: detectionInfo.value.powerOff.detectionState == "success" }, detectionInfo.value.powerOff.detectionState == "success" ? { bh: common_vendor.t(detectionInfo.value.powerOff.msg) } : {}, { bi: detectionInfo.value.powerOff.btuDisabled, bj: common_vendor.o(($event) => execDetection({ url: "powerOff" })), bk: common_vendor.p({ border: true }), bl: detectionInfo.value.cancelAntiTheft.load == "loading" }, detectionInfo.value.cancelAntiTheft.load == "loading" ? { bm: common_vendor.p({ status: detectionInfo.value.cancelAntiTheft.load, iconType: "circle", ["icon-size"]: 15, ["content-text"]: contentText.value }) } : {}, { bn: detectionInfo.value.cancelAntiTheft.detectionState == "error" }, detectionInfo.value.cancelAntiTheft.detectionState == "error" ? {} : {}, { bo: detectionInfo.value.cancelAntiTheft.detectionState == "error" }, detectionInfo.value.cancelAntiTheft.detectionState == "error" ? { bp: common_vendor.t(detectionInfo.value.cancelAntiTheft.msg) } : {}, { bq: detectionInfo.value.cancelAntiTheft.detectionState == "success" }, detectionInfo.value.cancelAntiTheft.detectionState == "success" ? {} : {}, { br: detectionInfo.value.cancelAntiTheft.detectionState == "success" }, detectionInfo.value.cancelAntiTheft.detectionState == "success" ? { bs: common_vendor.t(detectionInfo.value.cancelAntiTheft.msg) } : {}, { bt: detectionInfo.value.cancelAntiTheft.btuDisabled, bv: common_vendor.o(($event) => execDetection({ url: "cancelAntiTheft" })), bw: common_vendor.p({ border: true }), bx: common_vendor.o(autoDetection), by: common_vendor.p({ fill: true, options: [], buttonGroup: navButtonGroup }) }); }; } }; wx.createPage(_sfc_main); //# sourceMappingURL=../../../../.sourcemap/mp-weixin/pages/warehouse/detectionecu/detectionecu.js.map