分类页面加入购物车数量变化
parent
bdbc2b4a19
commit
f3fa995d7d
|
@ -9,8 +9,8 @@
|
|||
:style="{ transform: 'translate3d(' + item.slide_x + 'px, 0, 0)' }">
|
||||
<view class="now-message-info" :style="{ width: windowWidth + 'px' }" @click="clickItemMethod(item)">
|
||||
<!-- <view class="mo-item flexs" @tap.stop="chooseEv(index)" :class="item.ifcheck ? 'active-item' : ''"></view> -->
|
||||
<label class="radio"><radio :checked="item.ifcheck" color="#ff3673" style="transform: scale(.8);"/></label>
|
||||
<view class="shopp-img imgH mar-y20 mar-z10" @tap.stop="chooseEv(index)">
|
||||
<label class="radio"><radio :checked="item.ifcheck" @tap.stop="chooseEv(index)" color="#ff3673" style="transform: scale(.8);"/></label>
|
||||
<view class="shopp-img imgH mar-y20 mar-z10" @tap="goDetail(item.spuId)">
|
||||
<image class="shopp-img imgH width100" :src="item.image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="imgH disjb fc fon24 width100">
|
||||
|
@ -268,6 +268,13 @@
|
|||
})
|
||||
}
|
||||
},
|
||||
// 查看商品详情
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url:'/pagesB/shop-detail/shop-detail?id='+id
|
||||
})
|
||||
},
|
||||
|
||||
// 输入框获取焦点事件
|
||||
focusEv(num) {
|
||||
// 储存当前商品的原始数值
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
import swiperTabJl from '@/components/swiper-tab/swiper-tab-jl.vue';
|
||||
// 底部组件
|
||||
import footTab from '@/components/foot-tabs/foot-tab.vue';
|
||||
import {getCartNum} from '@/jsFile/public-api.js';
|
||||
import { mapState } from 'vuex'//引入mapState
|
||||
export default {
|
||||
components:{
|
||||
|
@ -181,6 +182,7 @@
|
|||
this.$requst.post('/api/order/shopping-cart-add',{sku_id:id,num:1}).then(res=>{
|
||||
if(res.code==0) {
|
||||
this.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
|
||||
getCartNum();
|
||||
} else {
|
||||
this.$toolAll.tools.showToast(res.msg)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view>
|
||||
<view >
|
||||
<status-container titlet="搜索">
|
||||
<view slot="content" style="margin: -20rpx 0rpx 0 0rpx;">
|
||||
<view class="pad-x30 pad-s20" style="position: sticky;background-color: #f4f4f4;" :style="{top: padt+'px'}">
|
||||
|
|
Loading…
Reference in New Issue