[双节样式]

This commit is contained in:
2023-09-28 13:37:23 +08:00
parent 3748f042cb
commit cd49194d3a
4 changed files with 9 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onLoad() {
let miniShareFun = wx.$api.user.poster({ url: 'pages/mall/index' })
let miniShareFun = wx.$api.user.poster({ url: 'pages/index/index' })
// wx.$api.user.poster({ url: 'pages/mall/index' }).then(res => {
// console.log(res.data)
// this.setData({
@@ -35,11 +35,10 @@ Page({
})
Promise.all([miniShareFun]).then(res => {
console.log(res)
let miniShareData = res[0].data
this.setData({
posters : miniShareData.posters,
qrcode : miniShareData.code,
qrcode : miniShareData.qrcode,
invite : miniShareData.invite,
current : 0
})
@@ -133,8 +132,12 @@ Page({
// 绘制图片二维码
code.src = qrcodeSrc
code.onload = () => {
ctx.arc( posterX + qrcodeSize/2, posterY + qrcodeSize/2, qrcodeSize/2 + 5, 0, 2 * Math.PI );
ctx.fillStyle = "#ffffff";
ctx.fill();
ctx.drawImage(code, posterX, posterY, qrcodeSize, qrcodeSize)
// 保存海报
wx.canvasToTempFilePath({
canvas : canvas,