修改前端样式效果

This commit is contained in:
xiaofeng 2019-07-16 23:50:02 +08:00
parent 631a571a03
commit 76839f3684
2 changed files with 111 additions and 89 deletions

View File

@ -292,6 +292,20 @@
} }
}); });
}, },
initHasUserSpuFavorite(spuId){
if (!checkLogin()) {
this.hasCollectionType = 0;
return;
}
//
hasUserSpuFavorite(spuId).then(data => {
let hasCollection = data;
// alert("==" + hasCollection);
if (hasCollection) {
this.hasCollectionType = 1;
}
});
},
onClickCart() { onClickCart() {
this.$router.push('/cart'); this.$router.push('/cart');
@ -430,6 +444,7 @@
// attrValueMap // attrValueMap
this.attrValueMap.set(attr.attrValueId, attr.attrValueName); this.attrValueMap.set(attr.attrValueId, attr.attrValueName);
} }
} }
// debugger; // debugger;
this.vanSku = vanSku; this.vanSku = vanSku;
@ -439,6 +454,9 @@
this.initialSku.quantity = 1; this.initialSku.quantity = 1;
// sku // sku
this.doCalcSkuPrice(this.initialSku.id); this.doCalcSkuPrice(this.initialSku.id);
this.initHasUserSpuFavorite(id);
}); });
// //
if (checkLogin()) { if (checkLogin()) {
@ -453,7 +471,7 @@
<style lang="less"> <style lang="less">
.goods { .goods {
.active { .active {
color: #e50f3d; color: #f44;
} }
padding-bottom: 50px; padding-bottom: 50px;

View File

@ -7,27 +7,27 @@
@load="onLoad" @load="onLoad"
> >
<div v-for="(item,index) in list" :key="index"> <div v-for="(item,index) in list" :key="index">
<!-- <van-swipe-cell :right-width="65" :on-close="onClose(item)">--> <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 <van-card
:price="formatPrice(item.price)" :price="formatPrice(item.price)"
:desc="item.sellPoint" :desc="item.sellPoint"
:title="item.spuName" :title="item.spuName"
:thumb="item.spuImage" :thumb="item.spuImage"
/> @click="skipProductSpuInfo(item.spuId)"
>
</van-card>
<template slot="right">
<van-button square type="danger" text="删除"/>
</template>
</van-swipe-cell>
</div> </div>
</van-list> </van-list>
</div> </div>
</template> </template>
<script> <script>
// import { Card } from 'vant';
import {GetFavoritePage, DelFavorite} from "../../../api/user.js"; import {GetFavoritePage, DelFavorite} from "../../../api/user.js";
// Vue.use(Card);
export default { export default {
data() { data() {
return { return {
@ -42,6 +42,10 @@ export default {
formatPrice(data) { formatPrice(data) {
return (data / 100).toFixed(2); return (data / 100).toFixed(2);
}, },
skipProductSpuInfo(data) {
// return getProductSpuInfo(data);
this.$router.push('/product/'+data);
},
onClose(item) { onClose(item) {
return function (clickPosition, instance) { return function (clickPosition, instance) {
switch (clickPosition) { switch (clickPosition) {