hldy_xcx/unpackage/dist/dev/mp-weixin/pages/addsupplier/all.js

135 lines
4.4 KiB
JavaScript
Raw Normal View History

2025-12-24 17:18:42 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const request_index = require("../../request/index.js");
if (!Math) {
model();
}
const model = () => "../../compontent/public/model.js";
const _sfc_main = {
__name: "all",
setup(__props) {
const show = common_vendor.ref(false);
const content = common_vendor.ref("");
const showmarrylist = common_vendor.reactive(
[
{
value: "代理商",
label: "代理商"
},
{
value: "批发商",
label: "批发商"
},
{
value: "制造商",
label: "制造商"
}
]
);
const statusarray = ["loading", "success", "fail"];
common_vendor.reactive(["", "", "", "", "", "", "", ""]);
const headImge = common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref(["", "", "", ""]);
common_vendor.reactive(["", ""]);
const nameArray1 = ["供应商名称", "供应商性质", "供应商地址", "负责人", "联系电话", "开户行", "开户行账号"];
const textArray1 = common_vendor.reactive(["", "", "", "", "", "", ""]);
common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref("");
common_vendor.ref(0);
common_vendor.ref("");
function getMessage(url) {
if (!url) {
return;
}
common_vendor.index.previewImage({
current: url,
// 当前显示图片的链接
urls: [url],
// 可以预览的图片列表
indicator: "default",
// 显示面板指示点,'default'|'number'|'none'
loop: true,
// 是否可循环预览
longPressActions: {
itemList: ["保存图片"],
success: (data) => {
common_vendor.index.__f__("log", "at pages/addsupplier/all.vue:273", "长按操作成功", data);
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/addsupplier/all.vue:276", "长按操作失败", err);
}
}
});
}
function isAtLeastEightChars(str) {
return typeof str === "string" && str.length >= 12;
}
const openLook = (res) => {
if (isAtLeastEightChars(res)) {
content.value = res;
show.value = true;
}
};
const goBack = () => {
common_vendor.index.navigateBack();
};
common_vendor.ref("");
common_vendor.ref("");
const applyStatus = common_vendor.ref(false);
common_vendor.onLoad((options) => {
let data = JSON.parse(options.element);
data.name = showmarrylist[Number(data.suppliersNature) - 1].value;
const keys = [
"suppliersName",
"name",
"suppliersAddress",
"personInCharge",
"contactNumber",
"openingBank",
"openingBankNo"
];
keys.forEach((key, index) => {
textArray1[index] = data[key] || "";
});
headImge.value = `${request_index.media_base_url}${data.imgPath}`;
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(($event) => show.value = false),
b: common_vendor.p({
show: show.value,
content: content.value
}),
c: common_vendor.o(goBack),
d: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
e: `${common_vendor.index.getStorageSync("moveHeight") + 30}px`,
f: applyStatus.value ? `https://www.focusnu.com/media/directive/index/${statusarray[applyStatus.value - 1]}.png` : ``,
g: common_vendor.f(nameArray1, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.t(textArray1[index] ? textArray1[index] : "自动获取"),
c: index,
d: common_vendor.o(($event) => openLook(textArray1[index]), index)
};
}),
h: common_vendor.s(!applyStatus.value ? {
height: `100rpx`
} : {
height: `140rpx`
}),
i: headImge.value ? headImge.value : `https://www.focusnu.com/media/directive/index/IDcard.png`,
j: !headImge.value
}, !headImge.value ? {} : {}, {
k: common_vendor.o(($event) => getMessage(headImge.value))
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b8c90a4e"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/addsupplier/all.js.map