| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <up-float-button
- :isMenu="isMenu"
- :list="list"
- :top="top"
- :buttom="buttom"
- :right="right"
- :backgroundColor="backgroundColor"
- :color="color"
- :width="width"
- :height="height"
- :borderColor="borderColor"
- @click="btnClick"
- @item-click="itemClick"
- style="z-index: 997"
- >
- <view class="buttom">
- <view class="carts">
- <image :src="image" class="img"></image>
- <view class="cartNum" v-if="unclaimedNum || cartNum">{{
- unclaimedNum || cartNum
- }}</view>
- </view>
- </view>
- </up-float-button>
- </template>
- <script setup>
- import { computed } from "vue";
- import { useShopStore, useTabbarStore } from "@/store";
- const useShop = useShopStore();
- const useTabbar = useTabbarStore();
- const props = defineProps({
- isMenu: Boolean,
- list: {
- type: Array,
- default: () => [],
- },
- backgroundColor: {
- type: String,
- default: "#e1e5ed",
- },
- top: String,
- buttom: String,
- right: {
- type: String,
- default: "30px",
- },
- color: {
- type: String,
- default: "#fff",
- },
- width: {
- type: String,
- default: "100rpx",
- },
- height: {
- type: String,
- default: "100rpx",
- },
- borderColor: {
- type: String,
- default: "",
- },
- image: {
- type: String,
- default: "/static/shop/cart.png",
- },
- unclaimedNum: {
- type: Number,
- default: 0,
- },
- });
- const emit = defineEmits(["onConfirm", "itemClick"]);
- const cartNum = computed(() => useShop.getCartNum);
- const btnClick = () => {
- emit("onConfirm");
- };
- const itemClick = (e) => {
- emit("itemClick", e);
- };
- </script>
- <style lang="less" scoped>
- @import url("@/style.less");
- /deep/ .u-float-button__main {
- .flex();
- }
- .buttom {
- background-color: #1e1e1e;
- width: 84rpx;
- height: 84rpx;
- border-radius: 50%;
- .carts {
- width: 100%;
- height: 100%;
- .flex_center();
- position: relative;
- .img {
- width: 40rpx;
- height: 40rpx;
- }
- .cartNum {
- position: absolute;
- top: 5px;
- right: 5px;
- width: 32rpx;
- height: 32rpx;
- border-radius: 50%;
- border: 1px solid var(--light);
- .flex_center();
- color: var(--light);
- background-color: #f56c6c;
- .size(20rpx);
- }
- }
- }
- </style>
|