|
@@ -3,13 +3,14 @@
|
|
<view class="forms">
|
|
<view class="forms">
|
|
<view class="flex align_center">
|
|
<view class="flex align_center">
|
|
<view class="labes">扫描唯一码:</view>
|
|
<view class="labes">扫描唯一码:</view>
|
|
- <view class="inputs"><image style="width: 100%;height: 35px;background: #eaeaea;" :src="tempImg"></image></view>
|
|
|
|
- <view class="btns" @click="openCamera"><image src="../../static/tab/tab_scan_normal.png"></image></view>
|
|
|
|
|
|
+ <view class="inputs">
|
|
|
|
+ <u-button size="medium" @click="openCamera"><image style="height: 0.9rem;width: 0.9rem;margin-right: 0.3rem;" src="../../static/tab/tab_scan_normal.png"></image> 点击扫描 </u-button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="flex align_center">
|
|
<view class="flex align_center">
|
|
<view class="labes">识别唯一码:</view>
|
|
<view class="labes">识别唯一码:</view>
|
|
- <view class="inputs"><u-input :focus="focusInput" v-model="uuidCode" maxlength="10" border clearable type="text" placeholder="请输入唯一码"></u-input></view>
|
|
|
|
- <view class="btns"><u-button :loading="loading" type="primary" size="mini" @click="addTags">添加</u-button></view>
|
|
|
|
|
|
+ <view class="inputs"><u-input :focus="focusInput" v-model="uuidCode" maxlength="15" border clearable type="text" placeholder="请输入唯一码"></u-input></view>
|
|
|
|
+ <view class="btns"><u-button :loading="loading" :custom-style="{padding:'0 20rpx'}" type="primary" size="medium" @click="addTags">添加</u-button></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="tags-box">
|
|
<view class="tags-box">
|
|
@@ -39,14 +40,6 @@
|
|
if(uuidTemp && uuidTemp.traceCodeList){
|
|
if(uuidTemp && uuidTemp.traceCodeList){
|
|
this.uuid = uuidTemp.traceCodeList
|
|
this.uuid = uuidTemp.traceCodeList
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 识别结束
|
|
|
|
- const ret = this.$store.state.vuex_tempData
|
|
|
|
- if(ret&&ret.retCode){
|
|
|
|
- this.tempImg = ret.filePath
|
|
|
|
- this.uuidCode = ret.retCode
|
|
|
|
- }
|
|
|
|
- this.focusInput = ret&&ret=="inputCode"
|
|
|
|
},
|
|
},
|
|
onHide() {
|
|
onHide() {
|
|
this.$store.state.vuex_tempData = null
|
|
this.$store.state.vuex_tempData = null
|
|
@@ -99,9 +92,17 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
openCamera(){
|
|
openCamera(){
|
|
- uni.navigateTo({
|
|
|
|
- url: "/pages/scan-frame/scan-frame?pageType=UUID"
|
|
|
|
- })
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ uni.scanCode({
|
|
|
|
+ scanType: ['barCode','datamatrix','pdf417'],
|
|
|
|
+ success: function (res) {
|
|
|
|
+ // console.log('条码类型:' + res.scanType);
|
|
|
|
+ // console.log('条码内容:' + res.result);
|
|
|
|
+ // _this.tempImg = ret.filePath
|
|
|
|
+ _this.uuidCode = res.result
|
|
|
|
+ _this.focusInput = true
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
saveForm(){
|
|
saveForm(){
|
|
if(this.uuid.length){
|
|
if(this.uuid.length){
|
|
@@ -150,6 +151,9 @@
|
|
}
|
|
}
|
|
.inputs{
|
|
.inputs{
|
|
flex-grow: 1;
|
|
flex-grow: 1;
|
|
|
|
+ button{
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.btns{
|
|
.btns{
|
|
width: 3rem;
|
|
width: 3rem;
|