|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
|
|
+ <view class="" style="height: 80rpx;">
|
|
|
|
|
+
|
|
|
|
|
+ </view>
|
|
|
<canvas :style="{ width: canvasW + 'px', height: canvasH + 'px',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
|
|
<canvas :style="{ width: canvasW + 'px', height: canvasH + 'px',}" canvas-id="myCanvas" id="myCanvas" class="hb"></canvas>
|
|
|
<!-- #ifndef MP -->
|
|
<!-- #ifndef MP -->
|
|
|
<div class="preserve">
|
|
<div class="preserve">
|
|
@@ -47,6 +50,7 @@
|
|
|
// #endif
|
|
// #endif
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ bl: 0.95,//画布比例
|
|
|
canvasW: '',
|
|
canvasW: '',
|
|
|
canvasH: '',
|
|
canvasH: '',
|
|
|
bgimg: '',
|
|
bgimg: '',
|
|
@@ -226,11 +230,11 @@
|
|
|
// 获取商品主图,二维码信息,APP端会返回图片的本地路径(H5端只能返回原路径)
|
|
// 获取商品主图,二维码信息,APP端会返回图片的本地路径(H5端只能返回原路径)
|
|
|
this.goodsImg = await this.getImageInfo(that.bgimg);
|
|
this.goodsImg = await this.getImageInfo(that.bgimg);
|
|
|
this.ewmImg = await this.getImageInfo(that.qrcode);
|
|
this.ewmImg = await this.getImageInfo(that.qrcode);
|
|
|
- this.canvasW = this.SystemInfo.windowWidth; // 画布宽度
|
|
|
|
|
|
|
+ this.canvasW = this.SystemInfo.windowWidth * that.bl; // 画布宽度
|
|
|
this.ratio = this.SystemInfo.windowWidth / 750;
|
|
this.ratio = this.SystemInfo.windowWidth / 750;
|
|
|
let x = 750*this.goodsImg.height/this.goodsImg.width
|
|
let x = 750*this.goodsImg.height/this.goodsImg.width
|
|
|
// this.canvasW =750 * this.ratio;
|
|
// this.canvasW =750 * this.ratio;
|
|
|
- this.canvasH = x * this.ratio;
|
|
|
|
|
|
|
+ this.canvasH = x * this.ratio * that.bl;
|
|
|
|
|
|
|
|
this.ewmW = 220 * this.ratio;
|
|
this.ewmW = 220 * this.ratio;
|
|
|
|
|
|
|
@@ -431,5 +435,7 @@
|
|
|
}
|
|
}
|
|
|
.hb {
|
|
.hb {
|
|
|
margin: auto;
|
|
margin: auto;
|
|
|
|
|
+ border-radius: 20rpx;
|
|
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|