From e8758c23d52df87d74d73c01bdd274d97ef6c7a5 Mon Sep 17 00:00:00 2001 From: xiangxy Date: Wed, 17 Sep 2025 14:40:25 +0800 Subject: [PATCH] saoma --- components/SearchBox.vue | 43 ++++++++++++++++++++++++++++++++++++++ pages/ftdl/work-manage.vue | 8 ++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/components/SearchBox.vue b/components/SearchBox.vue index 29ac87e..1a6564e 100644 --- a/components/SearchBox.vue +++ b/components/SearchBox.vue @@ -12,6 +12,7 @@ + @@ -51,7 +52,49 @@ if (e.target.value.length) { this.$emit('handleChange', e.target.value) } + }, + async toPhone() { + // #ifdef APP-PLUS + let status = await this.checkPermission(); + if (status !== 1) { + return; + } + // #endif + uni.scanCode({ + success: (res) => { + this.$emit('input', res.result) + this.$emit('handleChange', res.result) + }, + fail: (err) => { + // uni.showToast({ + // title: '出错', + // icon: 'none' + // }) + } + }); } + // #ifdef APP-PLUS + , + async checkPermission(code) { + let status = permision.isIOS ? await permision.requestIOS('camera') : + await permision.requestAndroid('android.permission.CAMERA'); + + if (status === null || status === 1) { + status = 1; + } else { + uni.showModal({ + content: "需要相机权限", + confirmText: "设置", + success: function(res) { + if (res.confirm) { + permision.gotoAppSetting(); + } + } + }) + } + return status; + } + // #endif } } diff --git a/pages/ftdl/work-manage.vue b/pages/ftdl/work-manage.vue index b0bb12f..d08d56d 100644 --- a/pages/ftdl/work-manage.vue +++ b/pages/ftdl/work-manage.vue @@ -11,6 +11,7 @@ @@ -42,7 +43,7 @@ - + @@ -82,6 +83,11 @@ this.title = options.title }, methods: { + handleChange (e) { + if (e) { + this.searchList() + } + }, searchList () { this.dataList = [] this.pageNum = 1