Commit 19e3acd9 authored by Mac's avatar Mac

二维码的修改

parent 0a23c64b
......@@ -145,6 +145,7 @@ export default {
};
},
onLoad(option) {
console.log(option,'option')
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
let c = this.$uiConfig.is_bang ? 80 : 52;
......
......@@ -64,11 +64,16 @@ export default {
getWeiXinQRCode() {
let that = this;
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(
{
url: "/api/AppletUser/GetWeiXinQRCodeForApplet",
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,
},
},
......
......@@ -121,9 +121,12 @@
// src: that.UserInfo.Photo,
src: that.fenxqrcode,
success: function (image) {
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制头像
that.drawQrCode(ctx)
if(that.qrcode.QrCodeType==0){
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)
},
});
}else{
......@@ -138,8 +141,11 @@
uni.getImageInfo({//头像
src: that.fenxqrcode,
success: function (image) {
ctx.drawImage(image.path, that.qrcode.QrCodePaddingLeft, that.qrcode.QrCodePaddingTop, that.qrcode.QrCodeSize, that.qrcode.QrCodeSize);//绘制头像
if(that.qrcode.QrCodeType==0){
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)
},
});
......
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