|
|
|
@ -686,7 +686,6 @@ |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
const ctx = uni.createCanvasContext('myCanvas') |
|
|
|
|
import { |
|
|
|
|
checkLogin |
|
|
|
|
} from '@/core/app' |
|
|
|
@ -737,7 +736,8 @@ |
|
|
|
|
this.goodsRecommend = []; |
|
|
|
|
this.getSuggest() |
|
|
|
|
this.is_show_open_shop_buttun = uni.getStorageSync("Store").storeInfo.is_show_open_shop_buttun |
|
|
|
|
this.setting = uni.getStorageSync('Setting').customer |
|
|
|
|
this.setting = uni.getStorageSync('Setting').customer; |
|
|
|
|
this.ctx = uni.createCanvasContext('myCanvas') |
|
|
|
|
}, |
|
|
|
|
onShow(options) { |
|
|
|
|
if (uni.getStorageSync("userInfo").user_id) { |
|
|
|
@ -800,7 +800,7 @@ |
|
|
|
|
}, |
|
|
|
|
createImge(index, w, h) { |
|
|
|
|
const that = this; |
|
|
|
|
ctx.fillRect(0, 0, w / that.devicePixelRatio, h / that.devicePixelRatio); |
|
|
|
|
this.ctx.fillRect(0, 0, w / that.devicePixelRatio, h / that.devicePixelRatio); |
|
|
|
|
uni.downloadFile({ |
|
|
|
|
url: index == 1 ? 'https://www.royaum.com.cn/static/1@2x.png' : |
|
|
|
|
'https://www.royaum.com.cn/static/2@2x.png', |
|
|
|
@ -810,37 +810,37 @@ |
|
|
|
|
'https://www.royaum.com.cn/static/2@2x.png') |
|
|
|
|
console.log(res.tempFilePath) |
|
|
|
|
console.log("that.qrcode", that.qrcode) |
|
|
|
|
ctx.beginPath(); // 开始绘制 |
|
|
|
|
ctx.drawImage(res.tempFilePath, 0, 0, w / that.devicePixelRatio, h / that |
|
|
|
|
this.ctx.beginPath(); // 开始绘制 |
|
|
|
|
this.ctx.drawImage(res.tempFilePath, 0, 0, w / that.devicePixelRatio, h / that |
|
|
|
|
.devicePixelRatio); |
|
|
|
|
uni.downloadFile({ |
|
|
|
|
url: that.qrcode, |
|
|
|
|
success: (res2) => { |
|
|
|
|
ctx.save(); // 保存 |
|
|
|
|
this.ctx.save(); // 保存 |
|
|
|
|
if (index == 1) { |
|
|
|
|
ctx.arc(162 / that.devicePixelRatio / 2 + 468 / that |
|
|
|
|
this.ctx.arc(162 / that.devicePixelRatio / 2 + 468 / that |
|
|
|
|
.devicePixelRatio, |
|
|
|
|
162 / that.devicePixelRatio / 2 + 480 / that |
|
|
|
|
.devicePixelRatio, |
|
|
|
|
162 / that.devicePixelRatio / 2, 0, Math.PI * 2, false); |
|
|
|
|
ctx.clip(); |
|
|
|
|
ctx.drawImage(res2.tempFilePath, 468 / that.devicePixelRatio, 480 / |
|
|
|
|
this.ctx.clip(); |
|
|
|
|
this.ctx.drawImage(res2.tempFilePath, 468 / that.devicePixelRatio, 480 / |
|
|
|
|
that.devicePixelRatio, 162 / that.devicePixelRatio, 162 / |
|
|
|
|
that |
|
|
|
|
.devicePixelRatio); |
|
|
|
|
} else { |
|
|
|
|
ctx.arc(162 / that.devicePixelRatio / 2 + 275 / that |
|
|
|
|
this.ctx.arc(162 / that.devicePixelRatio / 2 + 275 / that |
|
|
|
|
.devicePixelRatio, |
|
|
|
|
162 / that.devicePixelRatio / 2 + 635 / that |
|
|
|
|
.devicePixelRatio, |
|
|
|
|
162 / that.devicePixelRatio / 2, 0, Math.PI * 2, false); |
|
|
|
|
ctx.clip(); |
|
|
|
|
ctx.drawImage(res2.tempFilePath, 275 / that.devicePixelRatio, 635 / |
|
|
|
|
this.ctx.clip(); |
|
|
|
|
this.ctx.drawImage(res2.tempFilePath, 275 / that.devicePixelRatio, 635 / |
|
|
|
|
that.devicePixelRatio, 162 / that.devicePixelRatio, 162 / |
|
|
|
|
that |
|
|
|
|
.devicePixelRatio); |
|
|
|
|
} |
|
|
|
|
ctx.draw() |
|
|
|
|
this.ctx.draw() |
|
|
|
|
uni.canvasToTempFilePath({ |
|
|
|
|
width: w / that.devicePixelRatio, |
|
|
|
|
height: h / that.devicePixelRatio, |
|
|
|
@ -855,7 +855,7 @@ |
|
|
|
|
that.qrcode2 = res.tempFilePath |
|
|
|
|
console.log(that.qrcode2) |
|
|
|
|
} |
|
|
|
|
ctx.clearRect(0, 0, w, h); |
|
|
|
|
this.ctx.clearRect(0, 0, w, h); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|