1.0.4 • Published 3 years ago

ssr-poster-uniapp-plugin v1.0.4

Weekly downloads
4
License
ISC
Repository
-
Last release
3 years ago

ssr-poster-uniapp-plugin

概述

服务端渲染海报方案,合成插件小程序版(uni-app)

版本说明

微信SDK版本 >= 2.7.0

使用方法

1、安装

npm install ssr-poster-uniapp-plugin

2、引用

<template>
    <create-poster ref="createPosterRef" :width="600" :height="600" />
</template>

<script>
    import CreatePoster from 'ssr-poster-uniapp-plugin/CreatePoster';

    export default {
        name: 'test',
        components: {
            CreatePoster
        },
        mounted() {
            const qrcode = 'https://imgcdn.huanjutang.com/assets/img/2020428155511847.jpg';
            const { image, imgProps, qrCodeProps } = {
                image: 'https://imgcdn.huanjutang.com/assets/posters/15919415174372185.png',
                imgProps: {
                    w: 750,
                    h: 1334,
                },
                qrCodeProps: {
                    x: 276,
                    y: 658,
                    size: 199
                }
            };

            this.$refs.createPosterRef.posterCompose(image, qrcode, {
                imgProps,
                qrCodeProps,
            }).then(tempFile => {
                // tempFile 图片临时地址
            }).catch(() => {
                // 生成失败
            });
        }
    }
</script>

方法说明

posterCompose 合成图片(重复调用会重新绘制页面)

1.0.4

3 years ago

1.0.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago