Showing
2 changed files
with
23 additions
and
6 deletions
@@ -3,16 +3,16 @@ | @@ -3,16 +3,16 @@ | ||
3 | <ul class="cardlist card-large clearfix"> | 3 | <ul class="cardlist card-large clearfix"> |
4 | <li class="card" v-for="(item, index) in data" :key="item.product_skn"> | 4 | <li class="card" v-for="(item, index) in data" :key="item.product_skn"> |
5 | <div class="card-pic"> | 5 | <div class="card-pic"> |
6 | - <a-link v-good-link-url="item"> | 6 | + <a-link :product="item"> |
7 | <img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name"> | 7 | <img v-img-src="{src: item.default_images, width: 330, height: 440}" :alt="item.product_name"> |
8 | </a-link> | 8 | </a-link> |
9 | </div> | 9 | </div> |
10 | <div class="card-bd"> | 10 | <div class="card-bd"> |
11 | <h2 class="card-label"> | 11 | <h2 class="card-label"> |
12 | - <a-link v-good-link-url="item" class="line-clamp-1">{{item.product_name}}</a-link> | 12 | + <a-link :product="item" class="line-clamp-1">{{item.product_name}}</a-link> |
13 | </h2> | 13 | </h2> |
14 | <h2 class="card-label-desc" v-if="item.product_name1"> | 14 | <h2 class="card-label-desc" v-if="item.product_name1"> |
15 | - <a-link v-good-link-url="item" class="line-clamp-1">{{item.product_name}}</a-link> | 15 | + <a-link :product="item" class="line-clamp-1">{{item.product_name}}</a-link> |
16 | </h2> | 16 | </h2> |
17 | <span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span> | 17 | <span class="good-price" :class="{'sale-price': item.market_price}">¥{{item.sales_price | toFixed}}</span> |
18 | <span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span> | 18 | <span class="good-price" :class="{'old-price': item.market_price}" v-if="item.market_price">¥{{item.market_price | toFixed}}</span> |
1 | <template> | 1 | <template> |
2 | - <v-touch tag="span" @tap="click"> | 2 | + <div @click="click"> |
3 | <slot></slot> | 3 | <slot></slot> |
4 | - </v-touch> | 4 | + </div> |
5 | </template> | 5 | </template> |
6 | 6 | ||
7 | <script> | 7 | <script> |
@@ -10,9 +10,26 @@ | @@ -10,9 +10,26 @@ | ||
10 | 10 | ||
11 | export default { | 11 | export default { |
12 | name: 'ALink', | 12 | name: 'ALink', |
13 | + props: ['product'], | ||
13 | methods: { | 14 | methods: { |
14 | click() { | 15 | click() { |
15 | - let goodUrl = this.$el.dataset['url']; | 16 | + let {product_id, goods_id, cn_alphabet, product_skn} = this.product; |
17 | + | ||
18 | + if (!goods_id) { | ||
19 | + goods_id = this.product.goods_list.length ? this.product.goods_list[0].goods_id : ''; | ||
20 | + } | ||
21 | + let goodUrl = `/product/pro_${product_id}_${goods_id}/${cn_alphabet}.html`; | ||
22 | + | ||
23 | + if (yoho.isYohoBuy) { | ||
24 | + let goParams = { | ||
25 | + action: 'go.productDetail', | ||
26 | + params: { | ||
27 | + product_skn: product_skn | ||
28 | + } | ||
29 | + }; | ||
30 | + | ||
31 | + goodUrl += `?openby:yohobuy=${JSON.stringify(goParams)}`; | ||
32 | + } | ||
16 | 33 | ||
17 | if (goodUrl) { | 34 | if (goodUrl) { |
18 | let url = goodUrl; | 35 | let url = goodUrl; |
-
mentioned in commit 11e9b352
-
Please register or login to post a comment