Commit 19e3acd9 authored by Mac's avatar Mac

二维码的修改

parent 0a23c64b
...@@ -145,6 +145,7 @@ export default { ...@@ -145,6 +145,7 @@ export default {
}; };
}, },
onLoad(option) { onLoad(option) {
console.log(option,'option')
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
let c = this.$uiConfig.is_bang ? 80 : 52; let c = this.$uiConfig.is_bang ? 80 : 52;
......
...@@ -64,11 +64,16 @@ export default { ...@@ -64,11 +64,16 @@ export default {
getWeiXinQRCode() { getWeiXinQRCode() {
let that = this; let that = this;
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
console.log(that.UserInfo,'that.UserInfo')
let SmallShopId = that.UserInfo.SmallShopId?that.UserInfo.SmallShopId:0;
if(SmallShopId==0){
SmallShopId = that.UserInfo.UserSmallShopId?that.UserInfo.UserSmallShopId:0;
}
that.request2( that.request2(
{ {
url: "/api/AppletUser/GetWeiXinQRCodeForApplet", url: "/api/AppletUser/GetWeiXinQRCodeForApplet",
data: { data: {
Path: "pages/live/index?user_id=" + that.UserInfo.UserId, Path: "pages/live/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
With: that.qrcode.QrCodeSize, With: that.qrcode.QrCodeSize,
}, },
}, },
......
...@@ -121,9 +121,12 @@ ...@@ -121,9 +121,12 @@
// src: that.UserInfo.Photo, // src: that.UserInfo.Photo,
src: that.fenxqrcode, src: that.fenxqrcode,
success: function (image) { success: function (image) {
if(that.qrcode.QrCodeType==0){
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制头像 ctx.arc(that.qrcode.QrCodeSize/2+that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodeSize/2+that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize/2, 0, Math.PI * 2, false);
that.drawQrCode(ctx) ctx.clip();//画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
}
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制二维码
that.drawQrCode(ctx)
}, },
}); });
}else{ }else{
...@@ -138,8 +141,11 @@ ...@@ -138,8 +141,11 @@
uni.getImageInfo({//头像 uni.getImageInfo({//头像
src: that.fenxqrcode, src: that.fenxqrcode,
success: function (image) { success: function (image) {
if(that.qrcode.QrCodeType==0){
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制头像 ctx.arc(that.qrcode.QrCodeSize/2+that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodeSize/2+that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize/2, 0, Math.PI * 2, false);
ctx.clip();//画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
}
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制二维码
that.drawQrCode(ctx) that.drawQrCode(ctx)
}, },
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment