|
|
@ -4,14 +4,10 @@ |
|
|
|
<view> |
|
|
|
<view class="pop_tab"> |
|
|
|
<view class="tab_info"> |
|
|
|
<view class="conbox" > |
|
|
|
<textarea |
|
|
|
v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;" |
|
|
|
:placeholder="placeholderValue" |
|
|
|
:focus="boxfocus" |
|
|
|
@blur="handleBlur" |
|
|
|
@focus="handleFocus" |
|
|
|
@input="handelScanMsg" :cursor="cursorIndex" ></textarea> |
|
|
|
<view class="conbox"> |
|
|
|
<textarea v-model="scanMsg" trim="all" maxlength="1000" style="margin-left: 5px;width: 90%;" |
|
|
|
:placeholder="placeholderValue" :focus="boxfocus" @blur="handleBlur" @focus="handleFocus" |
|
|
|
@input="handelScanMsg" ></textarea> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="uni-flex uni-row space-between u-col-center"> |
|
|
@ -37,8 +33,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line> |
|
|
|
<scroll-view scroll-y="true" class="scroll-view" v-if="expand" |
|
|
|
style="height: 70px;"> |
|
|
|
<scroll-view scroll-y="true" class="scroll-view" v-if="expand" style="height: 70px;"> |
|
|
|
<view class="uni-flex u-col" v-for="(item,index) in scanList"> |
|
|
|
<view style="width: 100%;max-height: 100px;"> |
|
|
|
<view class="uni-flex u-row space-between u-col-center" @click="showItem(item)"> |
|
|
@ -59,7 +54,7 @@ |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<script > |
|
|
|
<script> |
|
|
|
import { |
|
|
|
getLabelInfo |
|
|
|
} from '../../common/label.js'; |
|
|
@ -139,7 +134,7 @@ |
|
|
|
}, |
|
|
|
clearScanValue() { |
|
|
|
this.scanMsg = '' |
|
|
|
this.cursorIndex =0 |
|
|
|
// this.cursorIndex = 0 |
|
|
|
this.getfocus(); |
|
|
|
}, |
|
|
|
clickScanMsg() { |
|
|
@ -153,8 +148,10 @@ |
|
|
|
// mask: true |
|
|
|
// }) |
|
|
|
let that = this; |
|
|
|
let index = that.scanMsg.indexOf('\n'); |
|
|
|
if (index >= 0) { |
|
|
|
// if(index==-1){ |
|
|
|
// that.scanMsg =that.scanMsg + "\n"; |
|
|
|
// } |
|
|
|
if (that.scanMsg.includes('\n')) { |
|
|
|
// that.scanMsg = 'HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q50'; |
|
|
|
setTimeout(() => { |
|
|
|
that.losefocus(); |
|
|
@ -176,7 +173,7 @@ |
|
|
|
getLabelInfo(content, this.headerType, callback => { |
|
|
|
// uni.hideLoading(); |
|
|
|
let scanResult = callback; |
|
|
|
scanResult.scanMessage=content |
|
|
|
scanResult.scanMessage = content |
|
|
|
if (scanResult.success) { |
|
|
|
that.clear(); |
|
|
|
// that.getfocus();//不能自动获取焦点 |
|
|
@ -191,14 +188,13 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, 500); |
|
|
|
}, 200); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleFocus(){ |
|
|
|
}, |
|
|
|
handleFocus() {}, |
|
|
|
|
|
|
|
handleBlur(){ |
|
|
|
handleBlur() { |
|
|
|
// setTimeout(res=>{ |
|
|
|
// uni.hideKeyboard(); |
|
|
|
// },200) |
|
|
@ -216,14 +212,13 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
clear() { |
|
|
|
if(this.clearResult) |
|
|
|
{ |
|
|
|
this.cursorIndex = 0; |
|
|
|
this.scanMsg = '' |
|
|
|
if (this.clearResult) { |
|
|
|
this.scanMsg = "" |
|
|
|
// this.cursorIndex = 0; |
|
|
|
} |
|
|
|
}, |
|
|
|
iconClick(type) { |
|
|
|
this.$emit("clearResult", this.scanMsgk); |
|
|
|
this.$emit("clearResult", this.scanMsg); |
|
|
|
}, |
|
|
|
expands() { |
|
|
|
this.expand = !this.expand; |
|
|
|