first commit
This commit is contained in:
83
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
83
unpackage/dist/dev/mp-weixin/pages/hiddendanger/view.js
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
(_easycom_up_input2 + _easycom_up_textarea2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_textarea)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "view",
|
||||
setup(__props) {
|
||||
const detailData = common_vendor.reactive({
|
||||
hazardId: "",
|
||||
assignId: "",
|
||||
title: "",
|
||||
level: 0,
|
||||
levelName: "",
|
||||
source: "",
|
||||
description: "",
|
||||
address: "",
|
||||
createdAt: "",
|
||||
attachments: []
|
||||
});
|
||||
const fetchDetail = async (hazardId, assignId) => {
|
||||
try {
|
||||
const res = await request_api.getHiddenDangerDetail({ hazardId, assignId });
|
||||
if (res.code === 0 && res.data) {
|
||||
Object.assign(detailData, res.data);
|
||||
} else {
|
||||
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取隐患详情失败:", error);
|
||||
common_vendor.index.showToast({ title: "请求失败", icon: "none" });
|
||||
}
|
||||
};
|
||||
common_vendor.onLoad((options) => {
|
||||
if (options.hazardId && options.assignId) {
|
||||
fetchDetail(options.hazardId, options.assignId);
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0
|
||||
}, (detailData == null ? void 0 : detailData.attachments) && detailData.attachments.length > 0 ? {
|
||||
b: common_vendor.f(detailData.attachments, (img, idx, i0) => {
|
||||
return {
|
||||
a: idx,
|
||||
b: img.filePath
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
c: common_vendor.o(($event) => detailData.title = $event),
|
||||
d: common_vendor.p({
|
||||
disabled: "true",
|
||||
disabledColor: "#F6F6F6",
|
||||
border: "surround",
|
||||
modelValue: detailData.title
|
||||
}),
|
||||
e: common_vendor.n(detailData.level === 1 ? "bg-blue light" : "bg-gray"),
|
||||
f: common_vendor.n(detailData.level === 2 ? "bg-blue light" : "bg-gray"),
|
||||
g: common_vendor.n(detailData.level === 3 ? "bg-blue light" : "bg-gray"),
|
||||
h: detailData.address,
|
||||
i: common_vendor.o(($event) => detailData.address = $event.detail.value),
|
||||
j: common_vendor.o(($event) => detailData.description = $event),
|
||||
k: common_vendor.p({
|
||||
placeholder: "暂无描述",
|
||||
disabled: true,
|
||||
modelValue: detailData.description
|
||||
}),
|
||||
l: common_vendor.t(detailData.source || "暂无"),
|
||||
m: common_vendor.t(detailData.createdAt || "暂无")
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4d631e68"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
Reference in New Issue
Block a user