Authored by 陈峰

点击改为click

... ... @@ -3,16 +3,16 @@
<ul class="cardlist card-large clearfix">
<li class="card" v-for="(item, index) in data" :key="item.product_skn">
<div class="card-pic">
<a-link v-good-link-url="item">
<a-link :product="item">
<img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name">
</a-link>
</div>
<div class="card-bd">
<h2 class="card-label">
<a-link v-good-link-url="item" class="line-clamp-1">{{item.product_name}}</a-link>
<a-link :product="item" class="line-clamp-1">{{item.product_name}}</a-link>
</h2>
<h2 class="card-label-desc" v-if="item.product_name1">
<a-link v-good-link-url="item" class="line-clamp-1">{{item.product_name}}</a-link>
<a-link :product="item" class="line-clamp-1">{{item.product_name}}</a-link>
</h2>
<span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span>
<span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span>
... ...
<template>
<v-touch tag="span" @tap="click">
<div @click="click">
<slot></slot>
</v-touch>
</div>
</template>
<script>
... ... @@ -10,9 +10,26 @@
export default {
name: 'ALink',
props: ['product'],
methods: {
click() {
let goodUrl = this.$el.dataset['url'];
let {product_id, goods_id, cn_alphabet, product_skn} = this.product;
if (!goods_id) {
goods_id = this.product.goods_list.length ? this.product.goods_list[0].goods_id : '';
}
let goodUrl = `/product/pro_${product_id}_${goods_id}/${cn_alphabet}.html`;
if (yoho.isYohoBuy) {
let goParams = {
action: 'go.productDetail',
params: {
product_skn: product_skn
}
};
goodUrl += `?openby:yohobuy=${JSON.stringify(goParams)}`;
}
if (goodUrl) {
let url = goodUrl;
... ...