diff --git a/package1/AI/AIPicture.vue b/package1/AI/AIPicture.vue index b6f1829..8fc647a 100644 --- a/package1/AI/AIPicture.vue +++ b/package1/AI/AIPicture.vue @@ -22,8 +22,9 @@ 1.每张图片建议您裁剪到20个规格或以下 2.确保最后一款商品规格截取完整 3.每张图片输入对应的规格数量 - 4.如果拍照后找不到所拍照片,打开微信的设置-通用-照片、视频里面的照片,点击开启后重启微信即可 - 5.点击可查看使用教程 + 4.图片越清晰角度越正识别准确率越高,建议使用原相机拍照并在相册内截图后上传 + 5.如果拍照后找不到所拍照片,打开微信的设置-通用-照片、视频里面的照片,点击开启后重启微信即可 + 6.点击可查看使用教程 @@ -46,7 +47,7 @@ - + @@ -55,7 +56,7 @@ - @@ -75,7 +76,8 @@ - + + 提示:建议使用原相机拍照并在相册内截图后上传 拍照 从相册选择 取消 @@ -142,24 +144,18 @@ - + 请输入{{name=='productSn'?'货号':name=='productName'?'商品名称':name=='price'?'价格':name=='productCount'?'数量':name=='color'?'颜色':name=='size'?'尺码':''}} - - 温馨提示: - - - 需要您在上方图片中选择一款商品,拿出其中一种规格的的货号、名称、价格、数量、颜色、尺码输入到下方的输入框中,要保证规格值属于同一种商品,这样就能准确的识别市面上大部分的小票(包括手写单) - - + {{name=='productSn'?'货号':name=='productName'?'商品名称':name=='price'?'价格':name=='productCount'?'数量':name=='color'?'颜色':name=='size'?'尺码':''}} - + @@ -184,7 +180,7 @@ 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg', 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg' ], - focus:true, + focus:false, purchaseOcrPictureList: [], parentPicturePath: '', parentId: '', @@ -222,7 +218,7 @@ return str.split('/')[3].split('.')[0] }, clickAiBtn(){ - console.log() + console.log(this.purchaseOcrPictureList) this.newSubmit = [] if (this.purchaseOcrPictureList.length == 0) { this.tui.toast("请选择要上传的图片") @@ -236,7 +232,8 @@ let data = { ocrPicture: this.purchaseOcrPictureList[i].ocrPicture, count: this.purchaseOcrPictureList[i].count, - parentPicturePath: '' + parentPicturePath: '', + ocrPictureOrder:i == 0 ? "" : i + 1 } this.newSubmit.push(data) if (this.purchaseOcrPictureList[i].children.length > 0) { @@ -249,7 +246,8 @@ let data = { ocrPicture: this.purchaseOcrPictureList[i].children[m].ocrPicture, count: this.purchaseOcrPictureList[i].children[m].count, - parentPicturePath: this.purchaseOcrPictureList[i].ocrPicture + parentPicturePath: this.purchaseOcrPictureList[i].ocrPicture, + ocrPictureOrder:i == 0 ? "" : (i + 1) + '-' + (m+1) } this.newSubmit.push(data) } @@ -262,9 +260,27 @@ }, clickInput(name){ this.name = name - this.$refs.tanDialog.open(); + if(this.name == 'productSn'){ + this.nameText = this.productSn + }else if(this.name == 'productName'){ + this.nameText = this.productName + }else if(this.name == 'price'){ + this.nameText = this.price + }else if(this.name == 'productCount'){ + this.nameText = this.productCount + }else if(this.name == 'color'){ + this.nameText = this.color + }else if(this.name == 'size'){ + this.nameText = this.size + } + this.$refs.tanDialog.open('bottom'); - this.$refs.inputText.focus(); + this.focus = false + this.$nextTick(() => { + this.focus = true + }) + // this.focus = true + // this.$refs.inputText.focus(); }, shurukuang(){ if(this.name == 'productSn'){ @@ -283,6 +299,9 @@ this.name = "" this.nameText = "" this.$refs.tanDialog.close() + }, + loadImg(){ + uni.hideLoading(); }, identify() { let num = 0 @@ -360,7 +379,8 @@ }, upLoadImg(type) { uni.showLoading({ - title: '加载中...' + title: '加载中...', + mask:true }) let that = this; if(type == 'ios'){ @@ -371,6 +391,8 @@ camera: 'back', success(res) { that.upLoadFile(res.tempFiles[0].tempFilePath) + },fail(){ + uni.hideLoading(); } }) }else if(type == 'pai'){ @@ -392,6 +414,8 @@ } }) },1000) + },fail(){ + uni.hideLoading(); } }) }else if(type == 'xuan'){ @@ -401,16 +425,19 @@ sourceType: ['album'], success(res1) { that.upLoadFile(res1.tempFiles[0].tempFilePath) + },fail(){ + uni.hideLoading(); } }) } this.$refs.popup.close() - uni.hideLoading(); + // uni.hideLoading(); }, async upLoadFile(path){ let that = this; uni.showLoading({ - title: '加载中...' + title: '加载中...', + mask:true }) let hiver_token = uni.getStorageSync("hiver_token") await uni.uploadFile({ @@ -452,6 +479,7 @@ }, fail: (err) => { + uni.hideLoading(); uni.showToast({ title: JSON.stringify(err), icon: 'none' @@ -460,8 +488,8 @@ }); await setTimeout(res=>{ that.parentId = '' - uni.hideLoading(); - },500) + // uni.hideLoading(); + },1000) }, delImage(index) { let that = this; diff --git a/package1/AI/AiChat.vue b/package1/AI/AiChat.vue index de26b32..14e53a7 100644 --- a/package1/AI/AiChat.vue +++ b/package1/AI/AiChat.vue @@ -141,9 +141,11 @@ const chineseNumToArabic = { '零': 0, '一': 1, '二': 2, '两': 2, '三': 3, '四': 4, '五': 5, '六': 6, '七': 7, '八': 8, - '九': 9,'杠':'-','刚':'-','军色':'均色','叉':'X','金色':'均色','井':'#' + '九': 9,'杠':'-','刚':'-','军色':'均色','叉':'X','金色':'均色','井':'#', + '时间':'10件','事件':'10件','世间':'10件','实践':'10件','实件':'10件', + '景':'#','警':'#','颈':'#', }; - const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井)/g; + const regex = /(零|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|金色|井|时间|事件|世间|实践|实件|景|警|颈)/g; return str.replace(regex, match => chineseNumToArabic[match]); }, inputSaveText(){