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