From 3a6ecaa09f3022a32552b754c813b49effabf449 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 24 Sep 2024 09:02:19 +0800 Subject: [PATCH] 11 --- package1/AI/AIHangOrderList.vue | 54 +- package1/AI/addAiList.vue | 113 +- package1/AI/voiceInventory.vue | 1912 +++++++++++--------- package1/index/order.vue | 2 +- package1/index/orderDetail.vue | 785 +++++--- package1/index/peopleList.vue | 42 +- package1/inventory/addGoods.vue | 2163 ++++++++++++----------- package1/inventory/inventoryConfirm.vue | 39 +- 8 files changed, 3030 insertions(+), 2080 deletions(-) diff --git a/package1/AI/AIHangOrderList.vue b/package1/AI/AIHangOrderList.vue index 4926467..fddf8ea 100644 --- a/package1/AI/AIHangOrderList.vue +++ b/package1/AI/AIHangOrderList.vue @@ -918,8 +918,9 @@ } this.returnList.forEach(function(value, key) { item.saleDetailDTOList.push(value) - }) - if (item.saleDetailDTOList) { + }) + + if (item.saleDetailDTOList.length>0) { for (let i = 0; i < item.saleDetailDTOList.length; i++) { let obj = {} @@ -940,7 +941,8 @@ num++ } - } + } + obj.attrId = item.saleDetailDTOList[i].attrId obj.saleDetailQueryDTO = newSaleDetailDTOList obj.num = 0 obj.id = item.saleDetailDTOList[i].productId @@ -954,7 +956,7 @@ obj.productName = item.saleDetailDTOList[i].productName obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime() obj.productSn = item.saleDetailDTOList[i].productSn - obj.wholesalePrice = item.saleDetailDTOList[i].discountAmount || item.saleDetailDTOList[i].wholesalePrice + obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice obj.returnPrice = item.saleDetailDTOList[i].returnPrice obj.saleId = item.id obj.remark = item.remark @@ -962,7 +964,7 @@ obj.createByName = item.createByName dataList.push(obj) } - } else { + } else { let obj = {} obj.num = 0 obj.price = 0 @@ -971,26 +973,28 @@ obj.xsyId = item.createBy obj.createByName = item.createByName dataList.push(obj) - } - this.$nextTick(()=>{ - this.tui.request("/app/customer/list", "post", { - notBuyDays: "", - pageNum: 1, - pageSize: 10, - searchStr: item.userName, - sort: "", - }, false, false).then((res) => { - if (res.code == 200) { - this.returnList = new Map() - uni.setStorageSync('khName', JSON.stringify(res.result.records[0])) - uni.setStorageSync('carList1', JSON.stringify(dataList)) - uni.setStorageSync('hangOrder', true) - uni.switchTab({ - url: '/pages/inventory/goodsList1' - }) - } - }) - }) + } + setTimeout(res11=>{ + this.tui.request("/app/customer/list", "post", { + notBuyDays: "", + pageNum: 1, + pageSize: 10, + searchStr: item.userName, + sort: "", + }, false, false).then((res) => { + if (res.code == 200) { + this.returnList = new Map() + console.log('dataList',dataList) + uni.setStorageSync('khName', JSON.stringify(res.result.records[0])) + uni.setStorageSync('carList1', JSON.stringify(dataList)) + uni.setStorageSync('hangOrder', true) + uni.switchTab({ + url: '/pages/inventory/goodsList1' + }) + } + }) + },500) + }, //点击切换折叠状态 clickCollapse(item,index) { diff --git a/package1/AI/addAiList.vue b/package1/AI/addAiList.vue index ba50ef3..b3413b8 100644 --- a/package1/AI/addAiList.vue +++ b/package1/AI/addAiList.vue @@ -2,7 +2,7 @@ @@ -200,7 +201,10 @@ voiceData: {}, recordState: false, productPicture: [], - messages:['消息1', '消息2', '消息3'] + canvas: null, + tempFilePath: '', + messages: ['消息1', '消息2', '消息3'], + base64:'' } }, onShow() { @@ -215,8 +219,113 @@ }) }, onLoad(option) { + this.getUserData() }, methods: { + getUserData(){ + console.log(__wxConfig.envVersion) + uni.request({ + url: 'https://api.weixin.qq.com/cgi-bin/token', + data: { + grant_type: 'client_credential', + appid: 'wx6d7d4fb58d1502db', + secret: '3a2c8cd00926764bbd12fd7361e01f1d' + }, + method: 'GET', + dataType: 'json', + success: (res) => { + console.log('access_token',res.data.access_token) + uni.request({ + url: 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' + res.data + .access_token, + data: { + page: 'package1/index/downStearmList', + scene:'khid=1833763951914127361', + env_version: "develop", + }, + responseType: 'arraybuffer', + method: 'POST', + dataType: 'json', + success: (res1) => { + let base64 = wx.arrayBufferToBase64(res1.data) + console.log('base64',base64) + const time = new Date().getTime(); + const imgPath = wx.env.USER_DATA_PATH + "/poster" + time + "share" + ".png"; + const file = wx.getFileSystemManager(); + file.writeFileSync(imgPath, base64, "base64"); + this.base64 = imgPath + }, + fail: (res) => { + this.tui.toast("网络不给力,请稍后再试~") + } + }) + }, + fail: (res) => { + this.tui.toast("网络不给力,请稍后再试~") + } + }) + }, + getData() { + let that = this + uni.showLoading({ + title:'生成中...' + }) + const ctx = uni.createCanvasContext('myCanvas', this); + //背景图 + let imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg'; + uni.downloadFile({ + url: imgA, + success: (res2) => { + + if (res2.statusCode === 200) { + // // 绘制第一张图片 + ctx.drawImage(res2.tempFilePath, 0, 0, 1700, 2200); + ctx.draw() + // 绘制第二张图片 + ctx.drawImage(that.base64, 650, 850, 400, 400); + ctx.draw(true); + // 设置字体样式 + ctx.font = 'bold 200px SimSun'; + // 设置文字颜色 + ctx.fillStyle = '#088FEB'; + + var text = '天逸的店'; + var textWidth = ctx.measureText(text).width; + console.log(textWidth) + // 计算居中位置 + var x = (1700 - textWidth) / 2; + + // 绘制文字 + ctx.fillText(text, x, 700); + ctx.draw(true) + setTimeout(ress=>{ + uni.canvasToTempFilePath({ + x: 0, + y: 0, + width: 1700, + height: 2200, + destWidth: 1701, + destHeight: 2200, + canvasId: 'myCanvas', + success: (res3) => { + uni.previewImage({ + urls: [res3.tempFilePath] + }) + uni.hideLoading() + // uni.saveImageToPhotosAlbum({ + // filePath: res3.tempFilePath, + // success: function () { + // console.log('save success'); + // } + // }); + } + }); + },500) + } + } + }); + + }, //按住语音识别,开始 kaishi() { if (this.isVoice == false) { diff --git a/package1/AI/voiceInventory.vue b/package1/AI/voiceInventory.vue index c9ef911..9ad7a48 100644 --- a/package1/AI/voiceInventory.vue +++ b/package1/AI/voiceInventory.vue @@ -2,7 +2,8 @@