摘要: 代码块存档 //扫描框 <view class="scanCodeBox"> <input class="inputContent" type="number" @blur="loseFocus" :disabled="false" :value="textValue" placeholder="请 阅读全文
posted @ 2025-03-26 10:08 格林格林 阅读(84) 评论(0) 推荐(0)
摘要: 父组件 uni.$on('update', function (data) { console.log('监听到事件来自 update ,携带参数 msg 为:' + data.msg); getListdata(resData.value); }) 子组件 function click(){ un 阅读全文
posted @ 2025-03-12 09:30 格林格林 阅读(72) 评论(0) 推荐(0)
摘要: import { useStore } from 'vuex'; let store = useStore(); const item = computed(() => { return { name: store.state.printerName, deviceId: store.state.d 阅读全文
posted @ 2025-03-06 15:35 格林格林 阅读(23) 评论(0) 推荐(0)
摘要: let wait = ref() function wait(){ //打开等待弹窗 wait.value = plus.nativeUI.showWaiting("正在连接蓝牙..."); // 2秒后更新等待对话框上显示的文字内容 setTimeout(function(){ w.setTitl 阅读全文
posted @ 2025-03-06 11:13 格林格林 阅读(38) 评论(0) 推荐(0)
摘要: 前提:uniapp的app端,用uni自带的toast,icon会自占一行,很丑 如图: 利用 plus.nativeUI.toast 显示正常大小的icon plus.nativeUI.toast( e,//提示文字 { type: 'text', duration: 'short', iconW 阅读全文
posted @ 2025-02-28 10:29 格林格林 阅读(90) 评论(0) 推荐(0)
摘要: 前提: uni自带的拍照插件不支持app使用 需要实现PDA拍照,并识别拍照内容,显示到文本框 uniapp的app端用不了tesseract.js ,因为nodejs没有blob,放弃前端识别文本 plus.camera.getCamera( index ); 指定要获取摄像头的索引值,1表示主摄 阅读全文
posted @ 2025-02-27 17:07 格林格林 阅读(464) 评论(0) 推荐(0)
摘要: 格式化时间方法 function formatDate(time, format) { var t = new Date(time); var tf = function (i) { return (i < 10 ? '0' : '') + i }; return format.replace(/y 阅读全文
posted @ 2025-02-18 14:23 格林格林 阅读(21) 评论(0) 推荐(0)
摘要: 需求:按PDA的扫码键,把扫码内容填入input中 scanner.js 扫描工具类 let main; let filter; let receiver; let tag = false; /** * 开始广播监听扫码 */ const start = () => { /* #ifdef APP- 阅读全文
posted @ 2025-02-14 15:39 格林格林 阅读(397) 评论(0) 推荐(0)
摘要: //index.vue import {onPullDownRefresh} from "@dcloudio/uni-app" //下拉刷新页面 onPullDownRefresh(() => { setTimeout(function () { console.log('start pulldow 阅读全文
posted @ 2025-02-13 11:46 格林格林 阅读(444) 评论(0) 推荐(0)
摘要: arr是需要去重的数组 let arr = [{a:1,b:2},{a:1,b:2},{a:2,b:3}] result是去重后的数组 const strings = arr.map((item) => JSON.stringify(item)) const removeDupList = Arra 阅读全文
posted @ 2025-02-12 15:32 格林格林 阅读(9) 评论(0) 推荐(0)