| | |
| | | import CardTitle from "@/components/card-title/index.vue"; |
| | | import MonofilCard from "../components/MonofilCard.vue"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import { onLoad, onUnload, onShow, onHide } from "@dcloudio/uni-app"; |
| | | import { onLoad, onUnload } from "@dcloudio/uni-app"; |
| | | import Scan from "@/components/scan/index.vue"; |
| | | import ManageApi from "@/api/product/manage"; |
| | | import TwistApi from "@/api/product/twist"; |
| | |
| | | const getScanCode = async (code: any) => { |
| | | console.log("自定义扫描的结果回调函数:", code); |
| | | // let parseData = code.trim(); |
| | | let codeArr = code.code.split(","); |
| | | console.log("sb:", codeArr); |
| | | console.log("code:===========", JSON.parse(code.code)); |
| | | console.log("id:=============", JSON.parse(code.code).id); |
| | | const { data } = await TwistApi.getScarn({ |
| | | outPutId: codeArr[1].id, |
| | | outPutId: JSON.parse(code.code).id, |
| | | }); |
| | | const exists = cardList.value.some((item) => item.monofilamentNumber === data.monofilamentNumber); |
| | | if (!exists) { |
| | |
| | | // 开启广播监听事件 |
| | | uni.$off("scan", getScanCode); |
| | | }); |
| | | |
| | | onShow(() => {}); |
| | | |
| | | onHide(() => {}); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |