92 lines
2.7 KiB
JavaScript
92 lines
2.7 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const common_assets = require("../../common/assets.js");
|
|
const _sfc_main = {
|
|
__name: "hukou",
|
|
setup(__props) {
|
|
const nameArray = [
|
|
"姓名",
|
|
"户主或与户主关系",
|
|
"曾用名",
|
|
"性别",
|
|
"出生地",
|
|
"民族",
|
|
"籍贯",
|
|
"出生日期",
|
|
"本市(县)其他住址",
|
|
"宗教信仰",
|
|
"公民身份证件编号",
|
|
"身高",
|
|
"血型",
|
|
"文化程度",
|
|
"婚姻状况",
|
|
"兵役状况",
|
|
"服务住所",
|
|
"职业",
|
|
"何时由何地迁来本市(县)",
|
|
"何时由何地迁来本址"
|
|
];
|
|
const tempImagePath = common_vendor.ref("");
|
|
function getMessage() {
|
|
common_vendor.index.chooseImage({
|
|
count: 1,
|
|
sourceType: ["camera"],
|
|
success: (chooseRes) => {
|
|
tempImagePath.value = chooseRes.tempFilePaths[0];
|
|
uploadImage(tempImagePath.value);
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/addoldman/hukou.vue:64", "拍照失败:", err);
|
|
}
|
|
});
|
|
}
|
|
function uploadImage(filePath) {
|
|
common_vendor.index.uploadFile({
|
|
url: `${common_vendor.index.getStorageSync("serverUrl")}/api/ocr/idCard`,
|
|
// 替换为你的POST接口地址
|
|
filePath,
|
|
name: "file",
|
|
// 后端接收时的字段名
|
|
header: {
|
|
"X-Access-Token": common_vendor.index.getStorageSync("token") || ""
|
|
},
|
|
formData: {
|
|
// 可以根据接口需要添加额外表单字段
|
|
// userId: '12345'
|
|
},
|
|
success: (uploadRes) => {
|
|
common_vendor.index.__f__("log", "at pages/addoldman/hukou.vue:83", "????", JSON.parse(JSON.parse(uploadRes.data).result).data);
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.showToast({
|
|
title: "上传出错",
|
|
icon: "error"
|
|
});
|
|
}
|
|
});
|
|
}
|
|
const goback = () => {
|
|
common_vendor.index.redirectTo({
|
|
url: `/pages/index/index`
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_assets._imports_0$4,
|
|
b: common_assets._imports_1$3,
|
|
c: common_vendor.o(getMessage),
|
|
d: common_vendor.f(nameArray, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item),
|
|
b: index
|
|
};
|
|
}),
|
|
e: common_vendor.o(goback)
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d86bf352"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/addoldman/hukou.js.map
|