<template>
	<view class="bg-max bg-gray" style="background: #ffffff;height: 100vh">
		<van-sticky>
			<view class="justify-center bg-white sh pd-px-20 mg-b-20" >
				<van-icon class="top-left" name="arrow-left" @tap="goBack" />
				<view class="top-center">店铺名片</view>
			</view>
		</van-sticky>
		<view  id="aa"  style="position: relative;margin: 20rpx 30rpx">
			<van-image   src="../../static/haibao2.png"/>
			<!--<view  style="position: absolute;top: 120px;left: 450rpx">-->
				<!--<van-image src="../../static/img/dz/jyx-logo.jpg" alt=""/>-->
			<!--</view>-->
		</view>
		<!--<view style="margin: 20rpx 30rpx">-->
			<!--<img :src="state.temIMg" alt="" style="width: 100%">-->
		<!--</view>-->

	</view>
</template>

<script setup lang="ts">
    import {  reactive } from 'vue';
    const state = reactive({
        temIMg:''
    })
    import html2Canvas from "html2canvas"
    import { PageUtils } from '@/utils/utils';
    function goBack() {
        PageUtils.goBack()
    }
    // 再画卡片
    function drawBg() {
        const ctx = uni.createCanvasContext('cardbg')
        ctx.drawImage('../../static/haibao1.png', 0, 0, 320, 314)
        ctx.draw()
        // 等待1s画完卡片
        setTimeout(() => {
            const cardDom = document.getElementById("aa")
            if (!cardDom) return
            html2Canvas(cardDom, { useCORS: false }).then(canvas => {
                state.temIMg=canvas.toDataURL("image/png")
            })
        }, 500);
    }
</script>

<style lang="scss" scoped>
	.card{
		background: #ffffff;
		height: 400rpx;
		width: 100%;
	}
</style>