wangfukang 3 years ago
parent
commit
a9b0fc10aa
  1. BIN
      package1/.DS_Store
  2. 7
      package1/AI/AIInventoryList.vue
  3. 34
      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

@ -59,6 +59,9 @@
purchaseDetails:[] purchaseDetails:[]
} }
}, },
onPullDownRefresh(){
this.getList()
},
onShow() { onShow() {
this.carList1 = [] this.carList1 = []
this.getList() this.getList()
@ -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: '',

34
package1/AI/AIPicture.vue

@ -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>
@ -67,14 +68,14 @@
'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 = ''
@ -85,10 +86,10 @@
}, },
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) {
@ -104,7 +105,7 @@
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
backPage(){ backPage() {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
@ -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);
}
}
})
} }
} }
} }

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