uniapp 轮播 需要请求接口 vuex 获取用户信息生成海报

信息技术:海报分享与二维码动态保存
本文介绍了如何在弹出框中展示动态海报,通过Swiper实现海报切换,并利用微信API生成并保存带有二维码的海报。开发者展示了如何获取用户购物ID,调用API获取海报列表,以及在海报上绘制二维码的技术细节。
<template>
	<u-popup :value="show" mode="center" class="popup" @close="onClose" @open="onOpen">
		<view class="close" @click="onClose">x</view>
		<swiper class="swiper" :current="current" next-margin="120rpx" @change="swiperChange" previous-margin="120rpx">
			<swiper-item class="item" v-for="(item,index) in poster">
				<view :class="index==current?'wrapper':'wrapper-activity'">
					<image :src="item.posterPath" mode="aspectFit" class="img"></image>
					<image :src="qrCode" :style="{	position: 'absolute',
						top: item.y/3+'px',
						left:  item.x/3 +'px',
						width:  Width(item.w) +'rpx',
						height: Width(item.h)+'rpx'}"></image>
					<button class="btn" @click="onSavePoster(item)">保存海报</button>
					<canvas type="2d" id="myCanvas"
						style="width: 750px; height: 1060px;position: fixed; top: -999999px; left: -999999px;"></canvas>
				</view>
			</swiper-item>
		</swiper>
	</u-popup>
</template>

<script>
	import { createWxQRCode, queryExtensionPoster } from "@/api"
	import { mapGetters } from 'vuex'
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			idata: {
				type: Object,
				default () {
					return {
						list: [],

					}
				}
			},
		},
		data() {
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

呱嗨喵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值