Task:点击购物车图标加入购物车
This commit is contained in:
@@ -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: () => {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<view class="price">
|
||||
<text class="price-txt price-red">¥{{ item[priceKey] }}</text>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" @click.stop="$emit('add', item)">
|
||||
<image
|
||||
:src="webUrl + '/home/icon-cart.png'"
|
||||
class="img"
|
||||
|
||||
Reference in New Issue
Block a user