41 lines
2.0 KiB
JavaScript
Raw Normal View History

2026-01-30 09:54:46 +08:00
"use strict";
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const common_libraries_day = require("../../common/libraries/day.js");
const common_libraries_naviHelper = require("../../common/libraries/naviHelper.js");
const gen_Apis = require("../../gen/Apis.js");
const INDEX_pass_model = require("./model.js");
2026-06-29 13:34:45 +08:00
const getFitmentShow = (data) => {
2026-01-30 09:54:46 +08:00
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Visitor.VisitorApplies.Show, data).then((res) => {
var _a, _b, _c, _d, _e, _f;
INDEX_pass_model.useModel.showData.value = res == null ? void 0 : res.data;
if ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.renovation_workers) == null ? void 0 : _b.length) {
INDEX_pass_model.useModel.userInfo.value = (_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.renovation_workers) == null ? void 0 : _d[0];
}
if ((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.code_expired_at) {
INDEX_pass_model.useModel.isExpired.value = common_libraries_day.isDatePassed((_f = res == null ? void 0 : res.data) == null ? void 0 : _f.code_expired_at);
}
console.log(res);
});
};
const method = {
2026-06-29 13:34:45 +08:00
init(e) {
INDEX_pass_model.useModel.formData.value = e;
console.log(e, INDEX_pass_model.useModel.formData.value, "sncd");
getFitmentShow(e);
},
2026-01-30 09:54:46 +08:00
handleSubmit(val) {
2026-06-29 13:34:45 +08:00
var _a, _b, _c, _d, _e;
2026-01-30 09:54:46 +08:00
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Visitor.VisitorApplies.Scan, {
code: (_c = (_b = (_a = INDEX_pass_model.useModel) == null ? void 0 : _a.showData) == null ? void 0 : _b.value) == null ? void 0 : _c.visitor_code,
2026-06-29 13:34:45 +08:00
scan_type: val,
...(_e = (_d = INDEX_pass_model.useModel) == null ? void 0 : _d.formData) == null ? void 0 : _e.value
2026-01-30 09:54:46 +08:00
}).then((res) => {
common_libraries_naviHelper.showToast("操作成功!", () => {
2026-06-29 13:34:45 +08:00
getFitmentShow(INDEX_pass_model.useModel.formData.value);
2026-01-30 09:54:46 +08:00
});
console.log(res);
});
}
};
exports.method = method;