From 456dab7df1c829c28c77844e2b6df38f78a967c9 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 24 Sep 2024 09:02:33 +0800 Subject: [PATCH] 11 --- pages/billing/addUser.vue | 58 +- pages/billing/changeGoods1.vue | 8 +- pages/index/checkShop.vue | 2 +- .../index/customAndSupplierProductDetail.vue | 1469 ----------- pages/index/dataStatistics.vue | 276 +- pages/index/home.vue | 2 +- pages/index/index.vue | 191 +- pages/index/shareStyle.vue | 128 +- pages/inventory/goodsList1.vue | 2232 +++++++++++++---- pages/inventory/inventory.vue | 7 +- pages/inventory/inventoryDetail.vue | 149 +- pages/login/login.vue | 16 +- 12 files changed, 2423 insertions(+), 2115 deletions(-) delete mode 100644 pages/index/customAndSupplierProductDetail.vue diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue index 7c65e24..003c4cb 100644 --- a/pages/billing/addUser.vue +++ b/pages/billing/addUser.vue @@ -9,7 +9,11 @@ - + + @@ -56,7 +60,8 @@ showPrice:false, keyboardNum:'', userInfo: '', - show: false, + show: false, + categoryList:[], goodsNum:'', delShow: false, addressObj: {}, @@ -70,7 +75,9 @@ province: '', city: '', area: '', - noEarn:"" + noEarn:"", + fenlei:'', + fenleiName:'' }, // 单选数据源 sexs: [{ @@ -122,7 +129,13 @@ onLoad(option) { this.popleType = option.popleType this.type = option.type - let data = JSON.parse(option.data) + this.getCategoryList() + let data = '' + console.log(option.data) + if(option.data != undefined){ + data = option.data + } + data = JSON.parse(data) if (option.type = "edit") { this.formData.address1 = data.province + data.city + data.area this.formData.address = data.address @@ -130,8 +143,9 @@ this.formData.city = data.city this.formData.province = data.province this.formData.id = data.id - this.formData.consigneeMobile = data.consigneeMobile || data.phone || "" - console.log(this.formData.consigneeMobile) + this.formData.fenlei = data.categoryId + this.formData.fenleiName = data.categoryName + this.formData.consigneeMobile = data.consigneeMobile || data.phone || "" this.formData.consigneeName = data.consigneeName || data.name || "" } @@ -147,6 +161,34 @@ }) }, methods: { + //获取客户分类 + getCategoryList(){ + this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", { + shopId:uni.getStorageSync('shopId') + }, false, true).then((res) => { + if (res.code == 200) { + for(let i=0;i{ + this.categoryList = res.result + },200) + + } else { + this.tui.toast(res.message) + } + }).catch((res) => {}) + }, + //切换分类 + categoryChange(e) { + for (let i = 0; i < this.categoryList.length; i++) { + if (this.categoryList[i].value == e) { + this.formData.fenlei = e; + this.formData.fenleiName = this.categoryList[i].text + } + } + }, //获取手机通讯录 getUserPhone() { let that = this; @@ -321,6 +363,8 @@ city: this.formData.city, area: this.formData.area, id: this.formData.id, + categoryId:this.formData.fenlei, + categoryName:this.formData.fenleiName, userName: this.formData.consigneeMobile }, false, true).then((res) => { if (res.code == 200) { @@ -349,6 +393,8 @@ province: this.formData.province, city: this.formData.city, area: this.formData.area, + categoryId:this.formData.fenlei, + categoryName:this.formData.fenleiName, userName: this.formData.consigneeMobile, amountOwed:this.formData.noEarn }, false, true).then((res) => { diff --git a/pages/billing/changeGoods1.vue b/pages/billing/changeGoods1.vue index 4526417..55f2bd6 100644 --- a/pages/billing/changeGoods1.vue +++ b/pages/billing/changeGoods1.vue @@ -11,7 +11,7 @@ :class="item.parentId ? 'red' :''">{{item.categoryName}} - + @@ -966,9 +966,11 @@ }) await this.$nextTick(() => { let data = { + attrId:this.goodsDetail.attrId, id: this.goodsDetail.id, price: this.zPrice, num: this.zNum, + customerCategoryRule:JSON.parse(this.goodsDetail.customerCategoryRule), categoryId: this.goodsDetail.categoryId, productName: this.goodsDetail.productName, productSn: this.goodsDetail.productSn, @@ -978,6 +980,7 @@ saleDetailQueryDTO: this.temporaryList, saleDetailQueryDTO1: [], purchasePrice: this.goodsDetail.purchasePrice, + unitPrice: this.goodsDetail.wholesalePrice, wholesalePrice: this.goodsDetail.wholesalePrice, lsprice: this.goodsDetail.price } @@ -1083,6 +1086,7 @@ } this.$nextTick(() => { let data = { + attrId:this.goodsDetail.attrId, id: this.goodsDetail.id, price: this.zPrice, num: this.zNum, @@ -1090,10 +1094,12 @@ productName: this.goodsDetail.productName, productSn: this.goodsDetail.productSn, returnPrice: this.goodsDetail.wholesalePrice, + customerCategoryRule:JSON.parse(this.goodsDetail.customerCategoryRule), productPicture: this.goodsDetail.productPicture, supplierName: this.goodsDetail.supplierName, saleDetailQueryDTO: newList, saleDetailQueryDTO1: [], + unitPrice:this.goodsDetail.wholesalePrice, purchasePrice: this.goodsDetail.purchasePrice, wholesalePrice: this.goodsDetail.wholesalePrice, lsprice: this.goodsDetail.price diff --git a/pages/index/checkShop.vue b/pages/index/checkShop.vue index 1060302..4448d4b 100644 --- a/pages/index/checkShop.vue +++ b/pages/index/checkShop.vue @@ -128,7 +128,7 @@ that.tui.toast('登录成功', 2000, true) setTimeout(() => { uni.reLaunch({ - url: '/package1/other/logistics' + url: '/package1/other/newLogisticsIndex' }) }, 200) }, diff --git a/pages/index/customAndSupplierProductDetail.vue b/pages/index/customAndSupplierProductDetail.vue deleted file mode 100644 index 962c1ba..0000000 --- a/pages/index/customAndSupplierProductDetail.vue +++ /dev/null @@ -1,1469 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/index/dataStatistics.vue b/pages/index/dataStatistics.vue index 9592cc1..c8d6b14 100644 --- a/pages/index/dataStatistics.vue +++ b/pages/index/dataStatistics.vue @@ -50,18 +50,221 @@ --> - + - + - {{item.name}} + 销售金额 - {{item.name == '销售金额'?shopInfo.totalAmount:item.name == '销售总件数'?shopInfo.totalJCount:item.name == '退货总件数'?shopInfo.returnTotalCount:item.name == '实收金额'?shopInfo.totalAlreadyEarn:item.name == '利润' && type == 0?shopInfo.totalProfit:item.name == '进货金额' && type == 0?shopInfo.purchasingCost:item.name == '退货金额'?shopInfo.returnTotalAmount:item.name == '下单客户'?shopInfo.totalCCount:""}} + {{shopInfo.totalAmount}} + + + + + + 销售总件数 + + + {{shopInfo.totalJCount}} + + + + + + + + + + 销售利润 + + + {{shopInfo.totalProfit==null?0:shopInfo.totalProfit}} + + + + + + + + + 实际利润 + + + {{((shopInfo.totalProfit == null?0:shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}} + + + + + + + + + + 进货金额 + + + {{shopInfo.purchasingCost}} + + + + + + + + + 进货总件数 + + + {{shopInfo.purchasingCount}} + + + + + + + + + + 退货金额 + + + {{shopInfo.returnTotalAmount}} + + + + + + + + + 退货总件数 + + + {{shopInfo.returnTotalCount}} + + + + + + + + + + 实收金额 + + + {{shopInfo.totalAlreadyEarn}} + + + + + + + + + 下单客户 + + + {{shopInfo.totalCCount}} + + + + + + + + + 热销商品 + + + + + + + + + + + 利润明细 + + + + {{shopInfo.totalAmount}} + 销售金额 + + + {{shopInfo.totalAmount - shopInfo.totalProfit}} + 销售成本 + + + {{shopInfo.returnTotalAmount}} + 退货金额 + + + {{shopInfo.saleReturnCost}} + 退货成本 + + + + + 点击↓↓↓可查看计算公式 + + + {{shopInfo.totalProfit}} + 销售利润 + + + + {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}} + 实际利润 + + + {{shopInfo.totalProfit == 0?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}% + 销售利润率 + + + {{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}% + 实际利润率 + + + + + + + 确定 + + + + + + {{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式 + + + + 公式:销售利润/销售金额*100 + {{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}% + + + 公式:实际利润/(销售金额-退货金额) + {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}% + + + 公式:销售利润-(退货金额-退货成本) + {{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}} + + + 公式:销售金额-销售成本 + {{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}} + + + @@ -70,8 +273,15 @@ export default { data() { return { + showDan:'', + showFormula: false, range:[], - shopInfo:{}, + shopInfo:{ + totalProfit:0, + returnTotalAmount:0, + saleReturnCost:0 + }, + showDayPrice: false, type:uni.getStorageSync('type'), dataList:[{ name:'销售金额', @@ -86,13 +296,21 @@ value:'shishou', icon:'auth' },{ - name:'利润', - value:'lirun', + name:'销售利润', + value:'xiaoshoulirun', + icon:'wallet' + },{ + name:'实际利润', + value:'shijilirun', icon:'wallet' },{ name:'进货金额', value:'jinhuo', icon:'home' + },{ + name:'进货总件数', + value:'jinhuo', + icon:'home' },{ name:'退货金额', value:'tuihuo', @@ -103,8 +321,12 @@ icon:'refreshempty' },{ name:'下单客户', - value:'xiadankehu', + value:'xiadan', icon:'staff' + },{ + name:'热销商品', + value:'rexiao', + icon:'fire' }] }; }, @@ -116,19 +338,37 @@ }, methods: { goDetail(item){ - if(item.value == 'lirun'){ + if(item == 'xiaoshoulirun'){ uni.navigateTo({ - url:'/package1/index/lirun?value='+ item.value + '&range=' + JSON.stringify(this.range) + url:'/package1/index/lirun?value='+ item + '&range=' + JSON.stringify(this.range) + }) + }else if(item == 'shijilirun'){ + this.showDayPrice = true + }else if(item == 'rexiao'){ + uni.navigateTo({ + url:'/package1/index/fireGoods' }) }else{ uni.navigateTo({ - url:'/package1/index/statisticsDetail?value='+ item.value + '&range=' + JSON.stringify(this.range) + url:'/package1/index/statisticsDetail?value='+ item + '&range=' + JSON.stringify(this.range) }) } }, + changeFormula(type){ + console.log(type) + this.showFormula = true + this.showDan = type + setTimeout(res=>{ + this.showFormula = false + },2000) + }, getSaleInfo() { - this.shopInfo = {} + this.shopInfo = { + totalProfit:0, + returnTotalAmount:0, + saleReturnCost:0 + } this.tui.request("/app/sale/getShopAll", "POST", { pageVo: { pageSize: 5, @@ -273,4 +513,16 @@ font-size: 34rpx; border-bottom: 1px solid #eee; } + .tan-lirun{ + margin-top: 20rpx; + width: 45%; + height: 60px; + display: flex; + flex-direction: column; + text-align: center; + float: left; + background-image: linear-gradient(#84C1FF, #C4E1FF) !important; + color: #fff; + border-radius: 10px; + } \ No newline at end of file diff --git a/pages/index/home.vue b/pages/index/home.vue index bf55cf6..1e6ddb2 100644 --- a/pages/index/home.vue +++ b/pages/index/home.vue @@ -16,7 +16,7 @@ if (uni.getStorageSync('hiver_token')) { if (uni.getStorageSync('wayValue') == 1) { uni.reLaunch({ - url: '/package1/other/logistics' + url: '/package1/other/newLogisticsIndex' }) } else if (uni.getStorageSync('wayValue') == 0) { uni.reLaunch({ diff --git a/pages/index/index.vue b/pages/index/index.vue index 6133bf1..5ecf9b0 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -7,12 +7,10 @@ - + - 待退货 - {{waitCount.waitReturnCount > 99 ? '99+' :waitCount.waitReturnCount}} + 热销商品 - - + + 今日利润 + @@ -149,6 +149,8 @@ + - - 宣传图 X @@ -207,6 +209,86 @@ + + + {{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式 + + + + 公式:销售利润/销售金额*100 + {{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}% + + + 公式:实际利润/(销售金额-退货金额) + {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}% + + + 公式:销售利润-(退货金额-退货成本) + {{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}} + + + 公式:销售金额-销售成本 + {{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}} + + + + + + + + 利润明细 + + + + {{shopInfo.totalAmount}} + 销售金额 + + + {{shopInfo.totalAmount - shopInfo.totalProfit}} + 销售成本 + + + {{shopInfo.returnTotalAmount}} + 退货金额 + + + {{shopInfo.saleReturnCost}} + 退货成本 + + + + + 点击↓↓↓可查看计算公式 + + + {{shopInfo.totalProfit}} + 销售利润 + + + + {{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}} + 实际利润 + + + {{shopInfo.totalProfit == 0 ?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}% + 销售利润率 + + + + {{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}% + 实际利润率 + + + + + + + 确定 + + + @@ -224,11 +306,14 @@ src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg', inventoryList: [], settingShow: false, - chartData: {}, + showFormula: false, + chartData: {}, + showDan:'', returnList:new Map(), shopName: '', waimaiRight:'-70rpx', showDayPrice: false, + shijiPrice:false, opts: { padding: [15, 10, 0, 15], dataLabel: true, @@ -264,7 +349,19 @@ } }, }, - shopInfo: {}, + shopInfo: { + totalAmount: 0, + totalAlreadyEarn: 0, + totalPayAmount: 0, + totalCCount: 0, + totalCount: 0, + totalJCount: 0, + totalProfit: 0, + saleReturnCost:0, + returnTotalAmount: 0, + returnTotalCount: 0, + totalAlreadyEarnDetail: 0 + }, waitCount: {}, enDayShow:false, endDay:'', @@ -282,6 +379,7 @@ }, onShow() { this.getSaleInfo() + this.getEndTime() }, onLoad() { let that = this; @@ -303,7 +401,7 @@ that.type = res.data } }); - this.getEndTime() + var today = new Date(); var day = today.getDate(); //宣传页 @@ -321,26 +419,18 @@ methods: { //获取店铺到期时间 getEndTime(){ - var today = new Date(); - var day = today.getDate(); - if(uni.getStorageSync('endTime')){ - this.endTime = uni.getStorageSync('endTime') - this.endDay = this.daysUntil(this.endTime) + this.textArr = [] + this.tui.request("/app/shop/getShopInfoById", "post", { + id: uni.getStorageSync('shopId') + }, false, true).then((res) => { + uni.setStorageSync('endTime',res.result.endTime) + this.endTime = res.result.endTime + this.endDay = this.daysUntil(res.result.endTime) if(this.endDay < 7){ this.enDayShow = true } - }else{ - this.tui.request("/app/shop/getShopInfoById", "post", { - id: uni.getStorageSync('shopId') - }, false, true).then((res) => { - uni.setStorageSync('endTime',res.result.endTime) - this.endTime = res.result.endTime - this.endDay = this.daysUntil(res.result.endTime) - if(this.endDay < 7){ - this.enDayShow = true - } - }) - } + }) + setTimeout(res1=>{ if(this.endTime != undefined){ let text = '您的店铺有效期至'+this.endTime+',还有'+this.endDay+'天到期,请及时联系管理员续费或开通' @@ -357,6 +447,14 @@ const daysDifference = Math.ceil(differenceInMs / (1000 * 60 * 60 * 24)); return daysDifference; }, + changeFormula(type){ + console.log(type) + this.showFormula = true + this.showDan = type + setTimeout(res=>{ + this.showFormula = false + },2000) + }, popClose() { this.$refs.publicizepopup.close() }, @@ -487,7 +585,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].discountAmount:item.saleDetailDTOList[i].wholesalePrice + obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice // obj.discountAmount = item.saleDetailDTOList[i].discountAmount obj.returnPrice = item.saleDetailDTOList[i].returnPrice obj.saleId = item.id @@ -527,7 +625,19 @@ }) }, getSaleInfo() { - this.shopInfo = {} + this.shopInfo = { + totalAmount: 0, + totalAlreadyEarn: 0, + totalPayAmount: 0, + totalCCount: 0, + totalCount: 0, + totalJCount: 0, + totalProfit: 0, + saleReturnCost:0, + returnTotalAmount: 0, + returnTotalCount: 0, + totalAlreadyEarnDetail: 0 + } this.inventoryList = [] this.tui.request("/app/sale/getShopAll", "POST", { pageVo: { @@ -544,6 +654,7 @@ totalCount: res.result.totalCount, totalJCount: res.result.totalJCount, totalProfit: res.result.totalProfit, + saleReturnCost:res.result.saleReturnCost, returnTotalAmount: res.result.returnTotalAmount, returnTotalCount: res.result.returnTotalCount, totalAlreadyEarnDetail: res.result.totalAlreadyEarnDetail @@ -814,14 +925,14 @@ } .publicize-content { - width: 460rpx; - height: 600rpx; + width: 600rpx; + height: 700rpx; } .publicize-content img { - width: 460rpx; - height: 460rpx; + width: 600rpx; + height: 600rpx; border-radius: 50px; } @@ -883,4 +994,16 @@ line-height: 60rpx; font-size: 30rpx; } + .tan-lirun{ + margin-top: 20rpx; + width: 45%; + height: 60px; + display: flex; + flex-direction: column; + text-align: center; + float: left; + background-image: linear-gradient(#84C1FF, #C4E1FF) !important; + color: #fff; + border-radius: 10px; + } \ No newline at end of file diff --git a/pages/index/shareStyle.vue b/pages/index/shareStyle.vue index 5f08960..18b3158 100644 --- a/pages/index/shareStyle.vue +++ b/pages/index/shareStyle.vue @@ -10,7 +10,7 @@ :class="item.parentId ? 'red' :''">{{item.categoryName}} - + @@ -155,6 +155,10 @@ + + + + @@ -163,6 +167,7 @@ components: {}, data() { return { + canvasshow:false, indexList: [], pageNum: 1, //分页的页码 shopList: [], @@ -182,7 +187,9 @@ gwcList: [], checkPayData:'', data:{}, - height:0 + height:0, + base64:'', + tempFilePath:'' } }, created() { @@ -232,6 +239,112 @@ this.shopName = options.shopName ? options.shopName : uni.getStorageSync('shopName') }, methods: { + getUserData(khid){ + let that = this; + this.tui.request("/order/ow/getWechatQrcode", "post", { + page: 'package1/index/downStearmList', + scene:khid, + envVersion: __wxConfig.envVersion, + }, false, true).then((res1) => { + console.log('getWechatQrcode',res1) + if (res1.code == 200) { + let imgA = res1.result; + uni.downloadFile({ + url: imgA, + success: (res2) => { + console.log('downloadFile',res2) + this.base64 = res2.tempFilePath + if(this.data.shareType == "1"){ + uni.showLoading({ + title:'请求中...' + }) + setTimeout(res3=>{ + uni.hideLoading() + uni.showModal({ + title:'提示', + content:'确定要分享全部吗?', + success(res3) { + if(res3.confirm){ + console.log('点了确定') + that.getData() + } + } + }) + },500) + + + }else{ + this.$refs.share.open() + } + } + }); + } else { + this.tui.toast(res.message) + } + }).catch((res) => { + console.log('报错',res) + }) + }, + getData() { + let that = this + uni.showLoading({ + title:'生成中...' + }) + this.canvasshow = true + const ctx = uni.createCanvasContext('myCanvas', this); + //背景图 + let imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg'; + uni.downloadFile({ + url: imgA, + success: (res2) => { + console.log('下载北京图',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 = this.shopName; + 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) => { + + console.log('图片预览',res3.tempFilePath) + this.canvasshow = false + this.tempFilePath = res3.tempFilePath + uni.previewImage({ + urls: [res3.tempFilePath] + }) + uni.hideLoading() + } + }); + },500) + } + } + }); + + }, //初始化获取分类列表 getGategoryList() { this.tui.request("/app/productCategory/list", "get", { @@ -457,19 +570,20 @@ } }) }, - checkPay(type){ + checkPay(type){ + let that = this; this.data.priceType = type this.tui.request("/app/productShare/save", "POST", this.data, false, true).then((res) => { if (res.code == 200) { - this.khid = res.result.id + this.khid = res.result.id + this.getUserData(this.khid) } else { this.tui.toast(res.message) } - }).catch((res) => {}) - this.checkPayData = type + }).catch((res) => {}) + this.checkPayData = type this.$refs.payDialog.close() - this.$refs.share.open() }, //关闭购物车弹窗 closeCar() { diff --git a/pages/inventory/goodsList1.vue b/pages/inventory/goodsList1.vue index de29043..6a5b73f 100644 --- a/pages/inventory/goodsList1.vue +++ b/pages/inventory/goodsList1.vue @@ -2,7 +2,7 @@