uniapp动态气泡上升效果

1、效果图:

2、创建子组件canvas_love.vue

<template>
	<view class="action">
		<view class="icon_img">
			<view class="icon_smallimg"></view>
			<view class="texttag">限时5折起</view>
			<canvas canvas-id="mycanvas" class="canvas" />
		</view>
	</view>
</template>

<script>
	var lastFrameTime = 0;
	var count = 0;
	var ctx = null;
	var factor = {
		speed: 0.004, // 运动速度,值越小越慢
		t: 0 //  贝塞尔函数系数
	};
	var that;
	var timer = null; // 循环定时器
	export default {
		name: 'canvas_love',
		data() {
			return {
				style_img: '',
				img_path: [
					[{
						x: 30,
						y: 50
					}, {
						x: 40,
						y: 30
					}, {
						x: 60,
						y: 25
					}, {
						x: 40,
						y: 0
					}],
					[{
						x: 30,
						y: 50
					}, {
						x: 70,
						y: 20
					}, {
						x: 80,
						y: 10
					}, {
						x: 30,
						y: 0
					}],
					[{
						x: 30,
						y: 50
					}, {
						x: 60,
						y: 10
					}, {
						x: 70,
						y: 0
					}, {
						x: 20,
						y: 0
					}]
				]
			}
		},
		created() {
			that = t
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值