Commit d2f50880 authored by zhengke's avatar zhengke

修改显示

parent e847eef4
...@@ -21,7 +21,12 @@ export default { ...@@ -21,7 +21,12 @@ export default {
UserInfo: "", UserInfo: "",
tempPic: "", tempPic: "",
bgPic: "", bgPic: "",
qrCodeConfig:{}, //二维码配置
qrCodeSize:126, //二维码宽高
qrCodeLeft:595, //二维码左边距
qrCodeTop:1200 ,//二维码上边距
halfCode:63 //二维码一半高度
}; };
}, },
created() { created() {
...@@ -31,6 +36,20 @@ export default { ...@@ -31,6 +36,20 @@ export default {
this.UserInfo = uni.getStorageSync("mall_UserInfo") this.UserInfo = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo") ? uni.getStorageSync("mall_UserInfo")
: {}; : {};
this.qrCodeConfig = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').liveConfig : {};
if(this.qrCodeConfig){
if(this.qrCodeConfig.LiveQrCodePaddingLeft){
this.qrCodeLeft=this.qrCodeConfig.LiveQrCodePaddingLeft;
}
if(this.qrCodeConfig.LiveQrCodePaddingTop){
this.qrCodeTop=this.qrCodeConfig.LiveQrCodePaddingTop;
}
if(this.qrCodeConfig.LiveQrCodeSize){
this.qrCodeSize=this.qrCodeConfig.LiveQrCodeSize;
this.halfCode=parseInt(this.qrCodeConfig.LiveQrCodeSize/2);
}
}
}, },
onLoad(option) { onLoad(option) {
this.bgPic = this.bgPic =
...@@ -93,7 +112,7 @@ export default { ...@@ -93,7 +112,7 @@ export default {
title: "正在生成", title: "正在生成",
}); });
let ctx = uni.createCanvasContext("firstCanvas", this); let ctx = uni.createCanvasContext("firstCanvas", this);
let that = this; let that = this;
uni.getImageInfo({ uni.getImageInfo({
src: that.bgPic, src: that.bgPic,
success: function (image) { success: function (image) {
...@@ -105,11 +124,13 @@ export default { ...@@ -105,11 +124,13 @@ export default {
success: function (image) { success: function (image) {
ctx.save(); ctx.save();
ctx.beginPath(); ctx.beginPath();
ctx.arc(595 + 63, 1200 + 63, 63, 0, Math.PI * 2); // ctx.arc(595 + 63, 1200 + 63, 63, 0, Math.PI * 2);
ctx.arc(that.qrCodeLeft + that.halfCode, that.qrCodeTop + that.halfCode, that.halfCode, 0, Math.PI * 2);
ctx.setFillStyle("#ffffff"); ctx.setFillStyle("#ffffff");
ctx.fill(); ctx.fill();
ctx.clip(); ctx.clip();
ctx.drawImage(image.path, 595, 1200, 126, 126); //绘制头像 // ctx.drawImage(image.path, 595, 1200, 126, 126); //绘制头像
ctx.drawImage(image.path, that.qrCodeLeft, that.qrCodeTop, that.qrCodeSize, that.qrCodeSize); //绘制头像
that.drawQrCode(ctx); that.drawQrCode(ctx);
}, },
}); });
...@@ -207,6 +228,7 @@ export default { ...@@ -207,6 +228,7 @@ export default {
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();
that.tempPic = res.tempFilePath; that.tempPic = res.tempFilePath;
console.log(res,'res');
}, },
fail(e) { fail(e) {
console.log(e); console.log(e);
......
...@@ -86,7 +86,10 @@ ...@@ -86,7 +86,10 @@
</view> </view>
<Text style='font-size: 12px;margin-top: 5px;'>{{sharedata.CustomModel.ReferrerName}}{{sharedata.UserInfo.SuperiorName!=''&&sharedata.UserInfo.SuperiorName!=null?sharedata.UserInfo.SuperiorName:'总部'}}</Text> <Text style='font-size: 12px;margin-top: 5px;'>{{sharedata.CustomModel.ReferrerName}}{{sharedata.UserInfo.SuperiorName!=''&&sharedata.UserInfo.SuperiorName!=null?sharedata.UserInfo.SuperiorName:'总部'}}</Text>
<Text style='font-size: 12px;margin-top: 5px;' >等级:{{sharedata.UserInfo.GradeName}}</Text> <view style="display:flex;align-items: center;margin-top: 5px;">
<Text style='font-size: 12px;'>等级:</Text>
<image :src="sharedata.UserInfo.GradeIcon" style="width:67px;height:22px;"></image>
</view>
<Text style='font-size: 12px;margin-top: 5px;height:19px;' >{{sharedata.UserInfo.IsEnableFXGrade==1 && sharedata.UserInfo.IsVip==1?'会员日期:'+ sharedata.UserInfo.VipExpiryDate:''}}</Text> <Text style='font-size: 12px;margin-top: 5px;height:19px;' >{{sharedata.UserInfo.IsEnableFXGrade==1 && sharedata.UserInfo.IsVip==1?'会员日期:'+ sharedata.UserInfo.VipExpiryDate:''}}</Text>
</view> </view>
......
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