Fix:4797 【商城小程序】购物车图标点击效果优化(①单规格商品:库存充足的情况下可以直接加入购物车,②多规格商品:弹出规格选择弹窗。参考首页尖货推荐处的商品加购图标点击效果)

This commit is contained in:
LinCyJang
2026-01-14 21:49:01 +08:00
parent ea79af5bd9
commit 12c32fbf51
+18 -3
View File
@@ -46,13 +46,21 @@
<text></text>
<text class=" v12-font-36">{{ item.productPrice }}</text>
</view>
<view>
<view @click.stop="addToCart(item, 'productId')">
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
</view>
</view>
</view>
</view>
</view>
<ProductWindow
ref="attrWindow"
:attr="attr"
:cartNum="cart_num"
:showOk="true"
@changeFun="changeFun"
@ok="handleOk(() => this.getCartCount())"
/>
<!-- <view class="v12-mt-2 v12-align-center">
<view class="primary-title" v-if="details.contentTitle">
{{ details.contentTitle }}
@@ -70,7 +78,14 @@
</template>
<script>
import { queryNewZone } from '@/api/activity'
import ProductWindow from '@/components/ProductWindow'
import goCartMixin from '@/mixins/goCartMixins'
import { mapGetters } from 'vuex'
export default{
components: {
ProductWindow
},
mixins: [goCartMixin],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -89,10 +104,10 @@ export default{
})
},
computed: {
...mapGetters(['isLogin', 'location', 'userInfo']),
bannerImage() {
return this.details.newProducts && this.details.newProducts[this.current] && this.details.newProducts[this.current].bannerImage
}
},
methods: {
handleClick(index, tab) {
@@ -242,4 +257,4 @@ export default{
border-radius: 20rpx !important;
position: relative !important;
}
</style>
</style>