添加商品描述和价格冗余字段

This commit is contained in:
xiaofeng
2019-07-16 01:08:26 +08:00
parent c1e34b908c
commit 2dc243a18f
9 changed files with 91 additions and 14 deletions

View File

@@ -98,7 +98,7 @@
</div>
<van-goods-action>
<van-goods-action-mini-btn icon="like-o" @click="onFavoriteClicked">
<van-goods-action-mini-btn icon="like-o" :class="{active:hasCollectionType === 1 }" @click="onFavoriteClicked">
收藏
</van-goods-action-mini-btn>
<van-goods-action-mini-btn icon="cart" :info="cartCount > 0 ? cartCount : undefined" @click="onClickCart">
@@ -208,6 +208,7 @@
calSkuPriceResult: {
},
hasCollectionType:0
};
},
@@ -327,11 +328,14 @@
// alert("hasCollectionType==" + hasCollectionType);
collectionSpu(id,hasCollectionType).then(data =>{
let v = data;
if (hasCollectionType == 1 && v){
alert("商品已收藏");
}else if (hasCollectionType == 2 && v){
alert("商品已取消");
}
this.hasCollectionType = hasCollectionType;
// if (hasCollectionType == 1 && v){
// // alert("商品已收藏");
// this.hasCollectionType = hasCollectionType;
// }else if (hasCollectionType == 2 && v){
// // alert("商品已取消");
// this.hasCollectionType = hasCollectionType;
// }
})
});
@@ -448,6 +452,9 @@
<style lang="less">
.goods {
.active {
color: #e50f3d;
}
padding-bottom: 50px;
&-swipe {

View File

@@ -7,19 +7,27 @@
@load="onLoad"
>
<div v-for="(item,index) in list" :key="index">
<van-swipe-cell :right-width="65" :on-close="onClose(item)">
<product-card :product='item' />
<span>{{item.spuName}}</span>
<span slot="right" >删除</span>
</van-swipe-cell>
<!-- <van-swipe-cell :right-width="65" :on-close="onClose(item)">-->
<!-- <product-card :product='item' />-->
<!-- <span>{{item.spuName}}</span>-->
<!-- <span slot="right" >删除</span>-->
<!-- </van-swipe-cell>-->
<van-card
:price="formatPrice(item.price)"
:desc="item.sellPoint"
:title="item.spuName"
:thumb="item.spuImage"
/>
</div>
</van-list>
</div>
</template>
<script>
// import { Card } from 'vant';
import { GetFavoritePage ,DelFavorite} from "../../../api/user.js";
// Vue.use(Card);
export default {
data(){
return{
@@ -31,6 +39,9 @@ export default {
}
},
methods:{
formatPrice(data) {
return (data / 100).toFixed(2);
},
onClose(item){
return function(clickPosition, instance) {
switch (clickPosition) {