wangfukang 3 years ago
parent
commit
a9b0fc10aa
  1. BIN
      package1/.DS_Store
  2. 7
      package1/AI/AIInventoryList.vue
  3. 146
      package1/AI/AIPicture.vue
  4. 23
      package1/AI/addAiList.vue
  5. 24
      package1/cropper/cropper.vue

BIN
package1/.DS_Store

Binary file not shown.

7
package1/AI/AIInventoryList.vue

@ -58,6 +58,9 @@
carList1:[],
purchaseDetails:[]
}
},
onPullDownRefresh(){
this.getList()
},
onShow() {
this.carList1 = []
@ -74,6 +77,9 @@
isAiList: 1
}, false, false).then((res) => {
this.aiList = res.result.records
setTimeout(function () {
uni.stopPullDownRefresh();
}, 500);
}).catch((res) => {})
// this.tui.request("/app/sale/buyAi", "POST", {
@ -108,6 +114,7 @@
num: this.purchaseDetails[i].productCount,
wholesalePrice: 0,
isNew:true,
productId:this.purchaseDetails[i].productId,
productName: this.purchaseDetails[i].productName,
productSn: this.purchaseDetails[i].productSn,
productPicture: '',

146
package1/AI/AIPicture.vue

@ -1,8 +1,8 @@
<template>
<view class="page1">
<view class="top" ref="top">
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;">
<uni-icons type="left" color="#fff" size="27"></uni-icons>
<view class="top" ref="top">
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;">
<uni-icons type="left" color="#fff" size="27"></uni-icons>
</view>
<view class="top1">
<text style="display: block;margin-top: 107rpx;color: #fff;">Ai入库</text>
@ -39,11 +39,12 @@
</view>
<view class="content-list">
<view class="content-list-img" v-for="(item,index) in purchaseOcrPictureList" :key="index">
<view class="del-icon">
<view class="del-icon" @tap="delImage(index)">
<uni-icons type="trash" color="#00BFFF" size="20"></uni-icons>
</view>
<image show-menu-by-longpress :src="item.ocrPicture" @tap="showImage(item.ocrPicture)"></image>
<uni-easyinput type='number' prefixIcon="compose" v-model='item.count' placeholder="请输入规格数量"></uni-easyinput>
<uni-easyinput type='number' prefixIcon="compose" v-model='item.count'
placeholder="请输入规格数量"></uni-easyinput>
</view>
</view>
</view>
@ -66,48 +67,48 @@
'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'
],
purchaseOcrPictureList:[]
],
purchaseOcrPictureList: []
}
},
onShow() {
if(this.uploadUrl && this.uploadNum == 1){
let data = {
ocrPicture:this.uploadUrl,
count:''
}
this.purchaseOcrPictureList.push(data)
this.uploadUrl = ''
this.uploadNum = ''
onShow() {
if (this.uploadUrl && this.uploadNum == 1) {
let data = {
ocrPicture: this.uploadUrl,
count: ''
}
this.purchaseOcrPictureList.push(data)
this.uploadUrl = ''
this.uploadNum = ''
}
},
onLoad() {
},
methods: {
identify(){
this.tui.request("/purchaseOcrPicture/batchSave", "POST", {
orderId:"",
purchaseOcrPictureList:this.purchaseOcrPictureList
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("识别中,请等待...")
setTimeout(res => {
uni.navigateBack({
delta: 1
})
}, 2000)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
backPage(){
uni.navigateBack({
delta: 1
})
methods: {
identify() {
this.tui.request("/purchaseOcrPicture/batchSave", "POST", {
orderId: "",
purchaseOcrPictureList: this.purchaseOcrPictureList
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("识别中,请等待...")
setTimeout(res => {
uni.navigateBack({
delta: 1
})
}, 2000)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
backPage() {
uni.navigateBack({
delta: 1
})
},
//点击图片放大
showImage(img) {
@ -124,12 +125,23 @@
sourceType: ['album', 'camera'],
camera: 'back',
success(res) {
console.log(res.tempFiles[0].tempFilePath)
uni.navigateTo({
url: '/package1/cropper/cropper?imgSrc='+res.tempFiles[0].tempFilePath
uni.navigateTo({
url: '/package1/cropper/cropper?imgSrc='+res.tempFiles[0].tempFilePath
})
}
})
},
delImage(index) {
let that = this;
uni.showModal({
title: "提示",
content: "确定删除吗?",
success: function(res) {
if (res.confirm) {
that.purchaseOcrPictureList.splice(index, 1);
}
}
})
}
}
}
@ -145,7 +157,7 @@
width: 780rpx;
height: 390rpx;
opacity: 1;
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);
overflow: hidden;
}
@ -313,13 +325,13 @@
overflow: hidden;
.bottom-img {
width: 60rpx;
height: 60rpx;
background-size: 100%;
margin: 10rpx;
float: left;
position: absolute;
top: 0;
width: 60rpx;
height: 60rpx;
background-size: 100%;
margin: 10rpx;
float: left;
position: absolute;
top: 0;
bottom: 0;
}
}
@ -452,26 +464,26 @@
}
.bottom-btn {
width: 100%;
height: 80rpx;
padding-left: 100rpx;
color: #777;
line-height: 80rpx;
font-weight: bold;
position: absolute;
top: 0;
bottom: 40rpx;
width: 100%;
height: 80rpx;
padding-left: 100rpx;
color: #777;
line-height: 80rpx;
font-weight: bold;
position: absolute;
top: 0;
bottom: 40rpx;
font-size: 34rpx;
}
.run-line {
width: 200px;
height: 200px;
-webkit-animation: rotate2 2s linear infinite;
animation: rotate2 3s linear infinite;
-webkit-transform-origin: 50% 50%;
z-index: -2;
margin: -50% 0 0 -50%;
width: 200px;
height: 200px;
-webkit-animation: rotate2 2s linear infinite;
animation: rotate2 3s linear infinite;
-webkit-transform-origin: 50% 50%;
z-index: -2;
margin: -50% 0 0 -50%;
background: linear-gradient(90deg, #FFF0F5 0%, #BCD2EE 100%);
}

23
package1/AI/addAiList.vue

@ -3,6 +3,11 @@
<view @tap='goList("1")' class="box">拍照入库</view>
<view @tap='goList("2")' class="box">AI入库列表</view>
<view @tap='goList("3")' class="box">AI开单</view>
<view style="margin-bottom: 50px;">
<uni-easyinput type="textarea" v-model="address" />
<button @tap="submit">提交</button>
</view>
<view style="width:100%;height:500px;overflow: scroll;">{{res}}</view>
</view>
</template>
@ -11,7 +16,8 @@
components: {},
data() {
return {
address:'',
res:[]
}
},
onShow() {
@ -21,6 +27,21 @@
},
methods: {
submit(){
console.log(this.address)
this.tui.request("/app/sale/buyAi","post", {
aiMsg: this.address
}, false, true).then((res) => {
if (res.code == 200) {
this.res = JSON.stringify(res.result)
} else {
this.res = JSON.stringify(res.result)
this.tui.toast(res.message)
}
}).catch((res) => {
this.res = JSON.stringify(res.result)
})
},
goList(type){
if(type == 1){
uni.navigateTo({

24
package1/cropper/cropper.vue

@ -28,8 +28,23 @@
}
},
onLoad(options) {
let that = this;
this.cropper = this.selectComponent("#image-cropper");
this.src= options.imgSrc
// uni.getImageInfo({
// src: options.imgSrc,
// success(res) {
// that.height = res.height
// that.width = res.width
// that.max_width = res.width
// that.max_height = res.height
// },
// fail(err) {
// console.error('获取图片信息失败:', err);
// }
// });
// console.log('宽',this.width)
// console.log('高',this.height)
if(!options.imgSrc){
this.cropper.upload(); //上传图片
}
@ -140,15 +155,17 @@
},
submit() {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
this.cropper.getImg((obj) => {
console.log(obj.url)
console.log(that.tui.getToken())
uni.uploadFile({
url: 'https://dev.xenjoyou.com/hiver/upload/file',
filePath: obj.url,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': that.tui.getToken()
'accessToken': hiver_token
},
formData: {},
success: (uploadFileRes) => {
@ -168,6 +185,11 @@
wx.navigateBack({
delta: 1
})
},fail: (err) =>{
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
})
}
});
});

Loading…
Cancel
Save