52 lines
1.7 KiB
JavaScript
52 lines
1.7 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const pages_oldmanindex_api = require("./api.js");
|
|
const _sfc_main = {
|
|
__name: "saoyisao",
|
|
setup(__props) {
|
|
const goBack = () => {
|
|
common_vendor.index.navigateBack();
|
|
};
|
|
function isAtLeastTenChars(str) {
|
|
return typeof str === "string" && str.length >= 10;
|
|
}
|
|
async function onScan() {
|
|
const res = await common_vendor.index.scanCode();
|
|
if (isAtLeastTenChars(res.result)) {
|
|
pages_oldmanindex_api.getOrgNuId(res.result).then((res0) => {
|
|
if (res0.result) {
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/oldmanindex/saoyisaothen?element=${JSON.stringify(res0.result)}`
|
|
});
|
|
} else {
|
|
common_vendor.index.showToast({
|
|
title: "扫描的二维码有误",
|
|
icon: "none",
|
|
// 不显示对勾图标
|
|
duration: 2e3
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
common_vendor.index.showToast({
|
|
title: "扫描的二维码有误",
|
|
icon: "none",
|
|
// 不显示对勾图标
|
|
duration: 2e3
|
|
});
|
|
}
|
|
}
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.o(goBack),
|
|
b: `${common_vendor.index.getStorageSync("moveHeight") + 35}px`,
|
|
c: `${common_vendor.index.getStorageSync("moveHeight") + 30}px`,
|
|
d: common_vendor.o(onScan)
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8fcb4df2"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/oldmanindex/saoyisao.js.map
|