hldy_app/unpackage/dist/dev/mp-weixin/component/Initialization/saoma.js

47 lines
1.4 KiB
JavaScript

"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);
}
}
);
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" });
}
});
}
return (_ctx, _cache) => {
return {
a: common_vendor.o(onScan),
b: __props.isShow,
c: common_vendor.s(transition.value ? {
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