From dfe7bcab40ec7eaac34a682e376927fe544f1e93 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Mon, 11 Nov 2024 09:43:36 +0800
Subject: [PATCH] 11
---
pages/billing/addUser.vue | 1 +
pages/index/index.vue | 2 +-
pages/inventory/goodsList1.vue | 229 +++++++++++++++++++--------------
pages/inventory/inventory.vue | 157 ++++++++++++++++------
4 files changed, 248 insertions(+), 141 deletions(-)
diff --git a/pages/billing/addUser.vue b/pages/billing/addUser.vue
index 2ae9b78..86bfac3 100644
--- a/pages/billing/addUser.vue
+++ b/pages/billing/addUser.vue
@@ -363,6 +363,7 @@
that.tui.request("/app/customer/edit", "post", {
name: this.formData.consigneeName,
phone: this.formData.consigneeMobile,
+ shopId:uni.getStorageSync('shopId'),
orderByField: Number((this.formData.orderByField == '' || this.formData.orderByField == null) ? 0 : this.formData.orderByField),
address: this.formData.address,
province: this.formData.province,
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 833caec..0fa93e9 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -177,7 +177,7 @@
-
-
+
-
+
@@ -305,9 +316,9 @@
return {
canvasshow: false,
size: 30,
- customerCategoryList: [],
indexList: [],
zheng: '0',
+ khName:{},
canvasWidth:0,
canvasHeight:0,
fu: '0',
@@ -330,18 +341,16 @@
shopList1: [],
picture: '',
gateType: '',
- total: 0
+ total: 0,
+ customerCategoryList:[]
}
},
onLoad(option) {
if (option.khid != undefined) {
uni.redirectTo({
- url: "/package1/index/downStearmList?khid=" + option.khid
+ url: "/package1/index/oneGoodsShare?khid=" + option.khid
})
}
- // if(uni.getStorageSync('noReload') == true){
- // uni.removeStorageSync('noReload')
- // }
let that = this
this.type = uni.getStorageSync('type')
uni.getSystemInfo({
@@ -349,12 +358,13 @@
that.windowHeight = info.windowHeight
}
});
+ this.getCustomerCategoryList()
},
onShareAppMessage() {
return {
- title: '查看我的推荐',
+ title: uni.getStorageSync('shopName') +'给您推荐的商品',
imageUrl: this.picture,
- path: '/package1/index/downStearmList?khid=' + this.khid + '&userId=""'
+ path: '/package1/index/oneGoodsShare?khid=' + this.khid + '&userId='+this.khName.id
}
},
onReachBottom() {
@@ -369,7 +379,7 @@
},
onShow() {
- console.log('shopList', this.shopList)
+ console.log('shopList', this.khName)
if (uni.getStorageSync('noReload') == true) {
this.searchName = ''
uni.removeStorageSync('noReload')
@@ -381,9 +391,46 @@
this.getweiruku()
},
methods: {
+ //跳转到客户选择页
+ goPopleList(){
+ uni.navigateTo({
+ url: '/package1/index/peopleList?popleType=khName'
+ })
+ },
+ //获取客户分类
+ getCustomerCategoryList(){
+ this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", {
+ shopId:uni.getStorageSync('shopId')
+ }, false, true).then((res) => {
+ if (res.code == 200) {
+ if(res.result.length > 0){
+ this.customerCategoryList = res.result
+ for(let i=0;i {})
+ },
getUserData() {
let that = this;
+ if(this.goodsData.productPicture == null || this.goodsData.productPicture == ''){
+ this.tui.toast("暂无可展示的图片", 300)
+ return
+ }
+ uni.setStorageSync('noReload', true)
this.tui.request("/order/ow/getWechatQrcode", "post", {
+ // page: 'package1/index/oneGoodsShare',
page: 'package1/index/downStearmList',
scene: this.khid,
envVersion: __wxConfig.envVersion,
@@ -416,7 +463,7 @@
title: '生成中...'
})
this.canvasshow = true
-
+ const ctx = uni.createCanvasContext('myCanvas', this);
//背景图
let imgA = this.goodsData.productPicture;
@@ -431,51 +478,59 @@
// that.canvasWidth = (image.width/ Number((image.height/1500).toFixed(2))).toFixed(0)
// }else{
that.canvasWidth = image.width
- that.canvasHeight = image.height + 200
+ if((image.height + 200) / image.width > 2){
+ that.canvasHeight = image.width * 2
+ image.height = that.canvasHeight * 0.8
+ }else{
+ that.canvasHeight = image.height / 0.8
+ }
// }
-
- const ctx = uni.createCanvasContext('myCanvas', this);
+ console.log(that.canvasWidth);
+ console.log(that.canvasHeight);
ctx.setFillStyle('#fff');
ctx.fillRect(0, 0, that.canvasWidth, that.canvasHeight);
// // 绘制第一张图片
ctx.drawImage(image.path, 0, 0, image.width, image.height);
ctx.draw()
// 绘制第二张图片
- ctx.drawImage(that.base64, 25, that.canvasHeight - 175, 150, 150);
+ ctx.drawImage(that.base64, 25, (that.canvasHeight * 0.8) + (that.canvasHeight * 0.2 * 0.15), (that.canvasHeight * 0.2 * 0.75), (that.canvasHeight * 0.2 * 0.75));
ctx.draw(true);
ctx.font = "20px 宋体";
// 设置字体样式
- ctx.setFontSize(28)
+ let codeWidth = that.canvasHeight * 0.2 * 0.75
+ ctx.setFontSize((codeWidth / 6).toFixed(0))
// 设置文字颜色
ctx.fillStyle = '#FF5809';
// 绘制文字
- ctx.fillText(uni.getStorageSync('shopName'), 200 , that.canvasHeight - 125);
+ ctx.fillText(uni.getStorageSync('shopName'), (that.canvasHeight * 0.2 * 0.75) + 35 , (that.canvasHeight * 0.8) + (that.canvasHeight * 0.2 * 0.47));
// 设置字体样式
- ctx.setFontSize(24)
+ ctx.setFontSize((codeWidth / 7).toFixed(0))
// 设置文字颜色
ctx.fillStyle = '#000';
// 绘制文字
- ctx.fillText('长按识别查看商品', 200 ,that.canvasHeight - 75);
- ctx.draw(true)
- setTimeout(ress => {
- uni.canvasToTempFilePath({
- x: 0,
- y: 0,
- width: that.canvasWidth,
- height: that.canvasHeight,
- destWidth: that.canvasWidth,
- destHeight: that.canvasHeight,
- canvasId: 'myCanvas',
- success: (res3) => {
- that.canvasshow = false
- that.tempFilePath = res3.tempFilePath
- uni.previewImage({
- urls: [res3.tempFilePath]
- })
- uni.hideLoading()
- }
- });
- }, 500)
+ ctx.fillText('长按识别查看商品', (that.canvasHeight * 0.2 * 0.75) + 35 ,(that.canvasHeight * 0.8) + (that.canvasHeight * 0.2 * 0.47) + Number((codeWidth / 5).toFixed(0)));
+ ctx.draw(true,(()=>{
+ setTimeout(ress=>{
+ uni.canvasToTempFilePath({
+ x: 0,
+ y: 0,
+ width: that.canvasWidth,
+ height: that.canvasHeight,
+ destWidth: that.canvasWidth,
+ destHeight: that.canvasHeight,
+ canvasId: 'myCanvas',
+ success: (res3) => {
+ that.canvasshow = false
+ that.tempFilePath = res3.tempFilePath
+ uni.previewImage({
+ urls: [res3.tempFilePath]
+ })
+ uni.hideLoading()
+ }
+ });
+ },500)
+ })())
+
}
});
@@ -525,7 +580,7 @@
priceType: type
}, false, true).then((res) => {
if (res.code == 200) {
- this.khid = res.result.id
+ this.khid = res.result.id+'-'
} else {
this.tui.toast(res.message)
}
@@ -1134,4 +1189,24 @@
margin-bottom: 80rpx;
overflow: scroll;
}
+ .content-list {
+ width: 100%;
+ display: flex;
+ height: 80rpx;
+ border-bottom: 1px solid #eee;
+ }
+ .list-name {
+ width: 100rpx;
+ text-align: left;
+ line-height: 80rpx;
+ height: 80rpx;
+ font-size: 36rpx;
+ }
+
+ .list-val {
+ width: 345rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ display: flex;
+ }
\ No newline at end of file