(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["package1/AI/AIPicture"],{1082:function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=n(i("7eb4")),u=n(i("ee10")),s={components:{},data:function(){return{imgList:["https://jewel-shop.oss-cn-beijing.aliyuncs.com/f51c446ef147437c9a8200ed2b43ec7f.jpg","https://jewel-shop.oss-cn-beijing.aliyuncs.com/5444bab7df8d47e09c831c054b6e447b.jpg","https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg","https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg"],isShow:!1,focus:!1,purchaseOcrPictureList:[],parentPicturePath:"",parentId:"",newSubmit:[],productSn:"",productName:"",price:"",productCount:"",color:"",size:"",keyBoardHeight:0,name:"",nameText:"",isTake:!1}},onShow:function(){t.authorize({scope:"scope.writePhotosAlbum",success:function(){},fail:function(){this.tui.toast("您未授权,AI入库功能可能会出现错误")}})},onLoad:function(){},methods:{addSonImg:function(t){this.parentId=t,this.toggle()},splitData:function(t){return t.split("/")[3].split(".")[0]},clickAiBtn:function(){if(this.newSubmit=[],0!=this.purchaseOcrPictureList.length){for(var t=0;t0)for(var i=0;i20&&(t.showModal({title:"提示",showCancel:!1,content:"规格数不能超过20,例:“黑色M码”这种为一个规格,“黑色S码”或“白色L码”则为另外的规格,请以此种颜色+尺码组合为一种的方式来计数",success:function(t){}}),this.purchaseOcrPictureList[n].count=""):"zi"==e&&c.count>20&&(t.showModal({title:"提示",showCancel:!1,content:"规格数不能超过20,例:“黑色M码”这种为一个规格,“黑色S码”或“白色L码”则为另外的规格,请以此种颜色+尺码组合为一种的方式来计数",success:function(t){}}),this.purchaseOcrPictureList[n].children[u].count="")},shurukuang:function(){"productSn"==this.name?this.productSn=this.nameText:"productName"==this.name?this.productName=this.nameText:"price"==this.name?this.price=this.nameText:"productCount"==this.name?this.productCount=this.nameText:"color"==this.name?this.color=this.nameText:"size"==this.name&&(this.size=this.nameText),this.name="",this.nameText="",this.$refs.tanDialog.close()},loadImg:function(){t.hideLoading()},identify:function(){var e=this,i=0;""==this.productSn&&(i+=1),""==this.productName&&(i+=1),""==this.price&&(i+=1),""==this.productCount&&(i+=1),""==this.color&&(i+=1),""==this.size&&(i+=1),6!=i?this.tui.request("/purchaseOcrPicture/batchSave","POST",{orderId:"",purchaseOcrPictureList:this.newSubmit,purchaseOcrExample:{productSn:this.productSn,productName:this.productName,price:this.price,productCount:""==this.productCount?"均码":this.productCount,color:""==this.color?"均色":this.color,size:this.size}},!1,!1).then((function(i){200==i.code?t.navigateBack({delta:1}):e.tui.toast(i.message)})).catch((function(t){})):this.tui.toast("未输入规格信息")},backPage:function(){t.navigateBack({delta:1})},showImage:function(e){t.previewImage({urls:[e],current:e})},toggle:function(){var e=this;t.getSystemInfo({success:function(t){e.$refs.popup.open("bottom")}})},showBtn:function(){this.isShow=!0,t.hideLoading()},upLoadImg:function(e){var i=this;return(0,u.default)(c.default.mark((function n(){var u;return c.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return t.showLoading({title:"加载中...",mask:!0}),u=i,"ios"==e?t.chooseMedia({count:1,mediaType:["image"],sourceType:["camera","album"],camera:"back",success:function(t){u.upLoadFile(t.tempFiles[0].tempFilePath)},fail:function(){t.hideLoading()}}):"pai"==e?t.authorize({scope:"scope.writePhotosAlbum",success:function(){u.isTake=!0,t.hideLoading()},fail:function(){u.tui.toast("您未授权,AI入库功能可能会出现错误")}}):"xuan"==e&&t.chooseMedia({count:1,mediaType:["image"],sourceType:["album"],success:function(t){u.upLoadFile(t.tempFiles[0].tempFilePath)},fail:function(){t.hideLoading()}}),n.next=5,i.$refs.popup.close();case 5:case"end":return n.stop()}}),n)})))()},takePhoto:function(){var e=this;return(0,u.default)(c.default.mark((function i(){var n,u;return c.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=e,u=t.createCameraContext(),i.next=4,u.takePhoto({quality:"high",success:function(e){var i=n;t.saveImageToPhotosAlbum({filePath:e.tempImagePath,success:function(){i.cameraUpload()}})},fail:function(t){n.isTake=!1}});case 4:case"end":return i.stop()}}),i)})))()},obtainPrice:function(t,e,i){this.linshiPrice=t.target.value,"price"==e?this.price="":"productCount"==e&&(this.productCount="")},changessPrice:function(t,e){"price"==e?this.linshiPrice==t.target.value?this.price=t.target.value:""==t.target.value?this.price=this.linshiPrice:this.price=t.target.value:this.linshiPrice==t.target.value?this.productCount=t.target.value:""==t.target.value?this.productCount=this.linshiPrice:this.productCount=t.target.value},cameraUpload:function(){var e=this;t.chooseMedia({count:1,mediaType:["image"],sourceType:["album"],success:function(t){e.isTake=!1,e.upLoadFile(t.tempFiles[0].tempFilePath)},fail:function(){e.isTake=!1,t.hideLoading()},complete:function(t){}})},upLoadFile:function(e){var i=this;return(0,u.default)(c.default.mark((function n(){var u,s;return c.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return u=i,t.showLoading({title:"加载中...",mask:!0}),s=t.getStorageSync("hiver_token"),n.next=5,t.uploadFile({url:u.tui.interfaceUrl()+"/upload/file",filePath:e,name:"file",header:{"content-type":"multipart/form-data",accessToken:s},formData:{},success:function(t){var e=JSON.parse(t.data);if(""!=u.parentId){for(var i=0;i