diff --git a/common/style/reset.css b/common/style/reset.css index bb27253..4558010 100644 --- a/common/style/reset.css +++ b/common/style/reset.css @@ -134,6 +134,6 @@ input[type="button"], input[type="submit"], input[type="search"], input[type="re .mgb10 { margin-bottom: 10rpx; } -.mgr10 { - margin-right: 10rpx; +.mgr20 { + margin-right: 20rpx; } \ No newline at end of file diff --git a/components/LinkScan.vue b/components/LinkScan.vue index ffa39a8..82911fa 100644 --- a/components/LinkScan.vue +++ b/components/LinkScan.vue @@ -13,7 +13,7 @@ @blur="handleBlur" @confirm="handleSend"> - + diff --git a/components/SearchBox.vue b/components/SearchBox.vue index aa56213..772a35f 100644 --- a/components/SearchBox.vue +++ b/components/SearchBox.vue @@ -1,18 +1,16 @@ @@ -51,93 +49,37 @@ } }, methods: { - handleChange ($event) { - this.cur = $event.target.value - this.$emit('input', this.cur) - this.$emit('handleChange', this.cur) - if (this.focusState) { - this.focusState = false - } + handleFocus () { + this.focusState = true }, - handleBlur () { + handleBlur (e) { + this.$emit('input', e.target.value) + this.$emit('handleChange', e.target.value) this.focusState = false }, - toSearch () { - this.$emit('toSearch', this.cur) - }, toDel () { - this.cur = '' this.$emit('input', '') }, - toScan () { - setTimeout(() => { - this.focusState = true - },0) - setTimeout(() => { - uni.hideKeyboard() - }, 300) - this.cur = '' - this.$emit('input', '') - }, - 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' - // }) - } - }); + handleSend (e) { + this.$emit('input', e.target.value) + this.$emit('handleChange', e.target.value) } - // #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 } }