Fix:4797 【商城小程序】购物车图标点击效果优化(①单规格商品:库存充足的情况下可以直接加入购物车,②多规格商品:弹出规格选择弹窗。参考首页尖货推荐处的商品加购图标点击效果)
This commit is contained in:
+17
-2
@@ -46,13 +46,21 @@
|
|||||||
<text>¥</text>
|
<text>¥</text>
|
||||||
<text class=" v12-font-36">{{ item.productPrice }}</text>
|
<text class=" v12-font-36">{{ item.productPrice }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click.stop="addToCart(item, 'productId')">
|
||||||
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
|
<u-icon :name="webUrl + '/home/icon-cart.png'" size="24"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</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="v12-mt-2 v12-align-center">
|
||||||
<view class="primary-title" v-if="details.contentTitle">
|
<view class="primary-title" v-if="details.contentTitle">
|
||||||
{{ details.contentTitle }}
|
{{ details.contentTitle }}
|
||||||
@@ -70,7 +78,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { queryNewZone } from '@/api/activity'
|
import { queryNewZone } from '@/api/activity'
|
||||||
|
import ProductWindow from '@/components/ProductWindow'
|
||||||
|
import goCartMixin from '@/mixins/goCartMixins'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default{
|
export default{
|
||||||
|
components: {
|
||||||
|
ProductWindow
|
||||||
|
},
|
||||||
|
mixins: [goCartMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
webUrl: this.$VUE_APP_RESOURCES_URL,
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
||||||
@@ -89,10 +104,10 @@ export default{
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['isLogin', 'location', 'userInfo']),
|
||||||
bannerImage() {
|
bannerImage() {
|
||||||
return this.details.newProducts && this.details.newProducts[this.current] && this.details.newProducts[this.current].bannerImage
|
return this.details.newProducts && this.details.newProducts[this.current] && this.details.newProducts[this.current].bannerImage
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick(index, tab) {
|
handleClick(index, tab) {
|
||||||
|
|||||||
Reference in New Issue
Block a user