[双节样式]
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
/* 海报预览 */
|
||||
.poster{ width: 550rpx; height: 900rpx; background: white; box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, .05); border-radius: 20rpx; overflow: hidden; }
|
||||
.poster-item{ width: 550rpx; height: 900rpx; background-position: center; background-size: cover; position: relative; }
|
||||
.poster-qrocde{ position: absolute; background-color: white; padding: 10rpx;}
|
||||
.poster-qrocde{ position: absolute; background-color: white; padding: 10rpx; border-radius: 50%; }
|
||||
|
||||
/* 分享功能 */
|
||||
.tool{ display: flex; align-items: center; justify-content: space-around; width: 70vw; margin-top: 80rpx; }
|
||||
.tool-item{ text-align: center; }
|
||||
.tool-item[size="mini"]{ padding: 0; margin: 0; background-color: transparent; }
|
||||
.tool-icon{ background: #f7f8f9; width: 88rpx; height: 88rpx; border-radius: 50%; vertical-align: top; }
|
||||
.tool-icon{ background: #f7f8f9; width: 88rpx; height: 88rpx; border-radius: 50%; vertical-align: top;}
|
||||
.tool-text{ color: gray; font-size: 30rpx; line-height: 40rpx; margin-top: 10rpx; font-weight: normal;}
|
||||
|
||||
/* canvas */
|
||||
|
||||
Reference in New Issue
Block a user