no message
This commit is contained in:
80
unpackage/dist/dev/mp-alipay/pageOrder/recharge/recharge.js
vendored
Normal file
80
unpackage/dist/dev/mp-alipay/pageOrder/recharge/recharge.js
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const api_api = require("../../api/api.js");
|
||||
const utils_fun = require("../../utils/fun.js");
|
||||
const store_index = require("../../store/index.js");
|
||||
const _sfc_main = {
|
||||
__name: "recharge",
|
||||
setup(__props) {
|
||||
let transactionNo = common_vendor.ref("");
|
||||
common_vendor.ref("");
|
||||
common_vendor.onLoad(async (options) => {
|
||||
transactionNo.value = options.transactionNo;
|
||||
if (options.type) {
|
||||
let _res = await api_api.realtimeInfo({
|
||||
transactionNo: options.transactionNo
|
||||
});
|
||||
store_index.store.commit("setDataObj", _res);
|
||||
}
|
||||
});
|
||||
const end = (e) => {
|
||||
common_vendor.index.showModal({
|
||||
title: "提示",
|
||||
content: e == 1 ? "是否确认结束充电?" : "结束充电失败,请重试!",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
api_api.stopCharging({ transactionNo: transactionNo.value }).then((res2) => {
|
||||
common_vendor.index.showLoading({
|
||||
title: "停止充电中..."
|
||||
});
|
||||
store_index.store.commit("setSokStatus", 0);
|
||||
timeMap(transactionNo.value);
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log("用户点击取消");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const timeMap = (_res) => {
|
||||
setTimeout(async () => {
|
||||
if (store_index.store.state.sokStatus != 1) {
|
||||
let _data = await api_api.ordersInfo({
|
||||
transactionNo: _res
|
||||
});
|
||||
store_index.store.commit("setDataObj", _data);
|
||||
if (_data.status == 3 || _data.status == 4) {
|
||||
common_vendor.index.hideLoading();
|
||||
end(2);
|
||||
}
|
||||
if (_data.status == 5 || _data.status == 6) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.navigateBack();
|
||||
store_index.store.commit("setSokStatus", 0);
|
||||
}
|
||||
}
|
||||
}, 3e4);
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.orderNo),
|
||||
b: common_assets._imports_0$7,
|
||||
c: common_vendor.o(($event) => common_vendor.unref(utils_fun.copy)(common_vendor.unref(store_index.store).state.dataObj.orderNo)),
|
||||
d: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.currentAmount || 0),
|
||||
e: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.cumulativeTime || 0),
|
||||
f: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.chargingDegree || 0),
|
||||
g: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.cumulativeTime || 0),
|
||||
h: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.currentAmount || 0),
|
||||
i: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.outputVoltage || 0),
|
||||
j: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.outputCurrent || 0),
|
||||
k: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.power || 0),
|
||||
l: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.gunNo),
|
||||
m: common_vendor.t(common_vendor.unref(store_index.store).state.dataObj.deviceNo || ""),
|
||||
n: common_vendor.o(($event) => end(1))
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-32c0de50"]]);
|
||||
my.createPage(MiniProgramPage);
|
||||
Reference in New Issue
Block a user