2025-07-07 17:35:35 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
|
__name: "saoma",
|
|
|
|
props: { isShow: { type: Boolean, required: true } },
|
|
|
|
emits: ["nav"],
|
|
|
|
setup(__props, { emit: __emit }) {
|
|
|
|
const props = __props;
|
|
|
|
const transition = common_vendor.ref(true);
|
|
|
|
common_vendor.watch(
|
|
|
|
() => props.isShow,
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
if (!oldVal && newVal) {
|
|
|
|
transition.value = false;
|
|
|
|
setTimeout(() => transition.value = true, 50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2025-08-21 16:51:53 +08:00
|
|
|
function onScan() {
|
|
|
|
common_vendor.index.scanCode({
|
|
|
|
// 仅使用相机扫码,设置为 false 则可以从相册选择图片扫码(部分平台可能不支持)
|
|
|
|
onlyFromCamera: true,
|
|
|
|
scanType: ["qrCode", "barCode"],
|
|
|
|
success(res) {
|
|
|
|
},
|
|
|
|
fail(err) {
|
|
|
|
common_vendor.index.showToast({ title: "扫码失败:" + err.errMsg, icon: "none" });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2025-07-07 17:35:35 +08:00
|
|
|
return (_ctx, _cache) => {
|
|
|
|
return {
|
2025-08-21 16:51:53 +08:00
|
|
|
a: common_vendor.o(onScan),
|
|
|
|
b: __props.isShow,
|
|
|
|
c: common_vendor.s(transition.value ? {
|
2025-07-07 17:35:35 +08:00
|
|
|
opacity: `1`
|
|
|
|
} : {
|
|
|
|
opacity: `0`
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ab7f57c7"]]);
|
|
|
|
wx.createComponent(Component);
|
|
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/component/Initialization/saoma.js.map
|