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

146
package1/AI/AIPicture.vue

@ -1,8 +1,8 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="top" ref="top"> <view class="top" ref="top">
<view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;"> <view @tap="backPage" style="width: 80rpx;height: 80rpx;margin: 98rpx 0 0 30rpx;">
<uni-icons type="left" color="#fff" size="27"></uni-icons> <uni-icons type="left" color="#fff" size="27"></uni-icons>
</view> </view>
<view class="top1"> <view class="top1">
<text style="display: block;margin-top: 107rpx;color: #fff;">Ai入库</text> <text style="display: block;margin-top: 107rpx;color: #fff;">Ai入库</text>
@ -39,11 +39,12 @@
</view> </view>
<view class="content-list"> <view class="content-list">
<view class="content-list-img" v-for="(item,index) in purchaseOcrPictureList" :key="index"> <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> <uni-icons type="trash" color="#00BFFF" size="20"></uni-icons>
</view> </view>
<image show-menu-by-longpress :src="item.ocrPicture" @tap="showImage(item.ocrPicture)"></image> <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> </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/5444bab7df8d47e09c831c054b6e447b.jpg',
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg', 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/44e7ccc2fae74db593bd1a10f538e2de.jpg',
'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg' 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/2a55142e562b4ea480ce553c8b84d092.jpg'
], ],
purchaseOcrPictureList:[] purchaseOcrPictureList: []
} }
}, },
onShow() { onShow() {
if(this.uploadUrl && this.uploadNum == 1){ if (this.uploadUrl && this.uploadNum == 1) {
let data = { let data = {
ocrPicture:this.uploadUrl, ocrPicture: this.uploadUrl,
count:'' count: ''
} }
this.purchaseOcrPictureList.push(data) this.purchaseOcrPictureList.push(data)
this.uploadUrl = '' this.uploadUrl = ''
this.uploadNum = '' this.uploadNum = ''
} }
}, },
onLoad() { onLoad() {
}, },
methods: { methods: {
identify(){ identify() {
this.tui.request("/purchaseOcrPicture/batchSave", "POST", { this.tui.request("/purchaseOcrPicture/batchSave", "POST", {
orderId:"", orderId: "",
purchaseOcrPictureList:this.purchaseOcrPictureList purchaseOcrPictureList: this.purchaseOcrPictureList
}, false, false).then((res) => { }, false, false).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.tui.toast("识别中,请等待...") this.tui.toast("识别中,请等待...")
setTimeout(res => { setTimeout(res => {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}, 2000) }, 2000)
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
backPage(){ backPage() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
}, },
//点击图片放大 //点击图片放大
showImage(img) { showImage(img) {
@ -124,12 +125,23 @@
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
camera: 'back', camera: 'back',
success(res) { success(res) {
console.log(res.tempFiles[0].tempFilePath) uni.navigateTo({
uni.navigateTo({ url: '/package1/cropper/cropper?imgSrc='+res.tempFiles[0].tempFilePath
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; width: 780rpx;
height: 390rpx; height: 390rpx;
opacity: 1; opacity: 1;
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%); background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);
overflow: hidden; overflow: hidden;
} }
@ -313,13 +325,13 @@
overflow: hidden; overflow: hidden;
.bottom-img { .bottom-img {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
background-size: 100%; background-size: 100%;
margin: 10rpx; margin: 10rpx;
float: left; float: left;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
} }
@ -452,26 +464,26 @@
} }
.bottom-btn { .bottom-btn {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
padding-left: 100rpx; padding-left: 100rpx;
color: #777; color: #777;
line-height: 80rpx; line-height: 80rpx;
font-weight: bold; font-weight: bold;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 40rpx; bottom: 40rpx;
font-size: 34rpx; font-size: 34rpx;
} }
.run-line { .run-line {
width: 200px; width: 200px;
height: 200px; height: 200px;
-webkit-animation: rotate2 2s linear infinite; -webkit-animation: rotate2 2s linear infinite;
animation: rotate2 3s linear infinite; animation: rotate2 3s linear infinite;
-webkit-transform-origin: 50% 50%; -webkit-transform-origin: 50% 50%;
z-index: -2; z-index: -2;
margin: -50% 0 0 -50%; margin: -50% 0 0 -50%;
background: linear-gradient(90deg, #FFF0F5 0%, #BCD2EE 100%); 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("1")' class="box">拍照入库</view>
<view @tap='goList("2")' class="box">AI入库列表</view> <view @tap='goList("2")' class="box">AI入库列表</view>
<view @tap='goList("3")' 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> </view>
</template> </template>
@ -11,7 +16,8 @@
components: {}, components: {},
data() { data() {
return { return {
address:'',
res:[]
} }
}, },
onShow() { onShow() {
@ -21,6 +27,21 @@
}, },
methods: { 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){ goList(type){
if(type == 1){ if(type == 1){
uni.navigateTo({ uni.navigateTo({

24
package1/cropper/cropper.vue

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

Loading…
Cancel
Save