lilei hai 1 ano
pai
achega
0efe30c2dd
Modificáronse 2 ficheiros con 21 adicións e 16 borrados
  1. 2 1
      pagesA/qualityPolicy/creatCustomInfo.vue
  2. 19 15
      pagesA/qualityPolicy/creatOrder.vue

+ 2 - 1
pagesA/qualityPolicy/creatCustomInfo.vue

@@ -62,7 +62,7 @@
 	import {
 		isvalidPhone
 	} from '@/libs/validate.js'
-	import{ traceWarrantySave } from '@/api/trace.js'
+	import{ traceWarrantySave, getTraceCodeQueryList } from '@/api/trace.js'
 	
 	export default {
 		components: {
@@ -238,6 +238,7 @@
 				this.$store.state.vuex_uuidTempData.customerInfo = this.form
 				const formData = this.$store.state.vuex_uuidTempData
 				console.log(formData)
+				
 				// 验证验证码是否正确
 				const phoneCodeIsOk = await verifyPhoneCode({mobile: this.form.customMobile, code: this.form.vericode })
 				if(phoneCodeIsOk.status == 200){

+ 19 - 15
pagesA/qualityPolicy/creatOrder.vue

@@ -3,13 +3,14 @@
 		<view class="forms">
 			<view class="flex align_center">
 				<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 class="flex align_center">
 				<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 class="tags-box">
@@ -39,14 +40,6 @@
 			if(uuidTemp && 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() {
 			this.$store.state.vuex_tempData = null
@@ -99,9 +92,17 @@
 				}
 			},
 			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(){
 				if(this.uuid.length){
@@ -150,6 +151,9 @@
 	}
 	.inputs{
 		flex-grow: 1;
+		button{
+			width: 100%;
+		}
 	}
 	.btns{
 		width: 3rem;