Task:点击购物车图标加入购物车

This commit is contained in:
modendeveloper
2025-01-14 23:42:33 +08:00
parent f8b6d72a59
commit 46b858b700
10 changed files with 485 additions and 24 deletions
+17 -1
View File
@@ -1,6 +1,6 @@
<template>
<view>
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''">
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''" :style="{paddingBottom: paddingBottom}">
<view class="textpic acea-row row-between-wrapper">
<view class="pictrue" @click="previewImg(attrObj.productSelect.image)">
<image :src="attrObj.productSelect.image" class="image" />
@@ -59,6 +59,14 @@
>+</view>
</view>
</view>
<view class="v12-px-2 v12-mt-3" v-if="showOk">
<u-button
shape="circle"
color="#C52733"
@click="$emit('ok')"
:disabled="(attr.productSelect.stock === 0 && attr.cartAttr)"
>加入购物车</u-button>
</view>
</view>
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
</view>
@@ -67,6 +75,14 @@
export default {
name: "ProductWindow",
props: {
paddingBottom: {
type: String,
default: '140rpx'
},
showOk: {
type: Boolean,
default: false
},
attr: {
type: Object,
default: () => {