更新记录
1.0.3(2024-12-12)
下载此版本
添加说明
1.0.2(2024-11-11)
下载此版本
优化速度
1.0.1(2024-11-07)
下载此版本
优化调整
查看更多
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.1.0 |
× |
√ |
√ |
√ |
√ |
√ |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
鸿蒙元服务 |
√ |
√ |
√ |
√ |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
× |
√ |
√ |
√ |
yaohai-cart-ball
<template>
<view class="content">
<yaohai-cart-ball ref="ballRefs"></yaohai-cart-ball>
<view class="list">
<view class="item">
<image @click="addcart" class="goods" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni.png"></image>
</view>
</view>
<view class="cart">
<view class="bag"></view>
购物车
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
const ballRefs = ref(null)
function addcart() {
const query = uni.createSelectorQuery()
query.select('.goods').boundingClientRect((rect) => {
console.log(rect)
ballRefs.value.movebell('', rect.left, rect.top, 0, 786)
}).exec();
// ballRefs.value.movebell('', 285, 15, 10, 786)
}
</script>
<style>
.list {
padding: 30rpx;
display: flex;
justify-content: flex-end;
}
.goods {
height: 150rpx;
width: 150rpx;
}
.cart {
position: fixed;
left: 20rpx;
right: 20rpx;
bottom: 20rpx;
background-color: #8f8f94;
color: #ffffff;
padding: 20rpx;
border-radius: 8rpx;
text-align: center;
}
.bag {
position: absolute;
width: 80rpx;
height: 80rpx;
top: -20rpx;
left: 20rpx;
background-color: black;
}
</style>