From a9b0fc10aa3162397be03fefc7a26ff01ab28f7f Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 2 Apr 2024 20:33:44 +0800 Subject: [PATCH] 11 --- package1/.DS_Store | Bin 10244 -> 10244 bytes package1/AI/AIInventoryList.vue | 7 ++ package1/AI/AIPicture.vue | 146 +++++++++++++++++--------------- package1/AI/addAiList.vue | 23 ++++- package1/cropper/cropper.vue | 24 +++++- 5 files changed, 131 insertions(+), 69 deletions(-) diff --git a/package1/.DS_Store b/package1/.DS_Store index 77795ed48301b2a61f826e2d4215f8a76a066493..a878e0c970d754b9b6083b31fd29fdf2c1058043 100644 GIT binary patch delta 45 zcmZn(XbIR*D?Hg*pp@Ov+{{2n!C>+aVVTLd1ym+)5)t0)EwYfsTTqq2c78!ZM7Vlk>#o8M`KL5E0w#BeI)&Gn>M1 Kmd#9}%*+7#Wf4#S diff --git a/package1/AI/AIInventoryList.vue b/package1/AI/AIInventoryList.vue index caa1940..c16c17e 100644 --- a/package1/AI/AIInventoryList.vue +++ b/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: '', diff --git a/package1/AI/AIPicture.vue b/package1/AI/AIPicture.vue index 8756109..8e3f192 100644 --- a/package1/AI/AIPicture.vue +++ b/package1/AI/AIPicture.vue @@ -1,8 +1,8 @@ @@ -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({ diff --git a/package1/cropper/cropper.vue b/package1/cropper/cropper.vue index 2634012..761f3db 100644 --- a/package1/cropper/cropper.vue +++ b/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' + }) } }); });