share-box.vue
2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
<div class="brand-share">
<img class="brand-top-box" v-bind:src="shopInfo.shopBg | resize 750 478">
<div class="brand-title">{{ shopInfo.shopName }}</div>
<div class="brand-intro">{{ shopInfo.shopIntro }}</div>
<div class="tip">进入 BLK 选购潮品</div>
<div class="icon arrow"></div>
<a href="//m.yohoblk.com"><img v-bind:src="shopInfo.shopBg | resize 752 365"></a>
</div>
<share-bottom></share-bottom>
</template>
<style>
.brand-share {
.brand-top-box {
width: 100%;
}
.brand-title {
margin: 30px;
font-weight: 700;
font-size: 32px;
color: #000;
font-style: italic;
}
.brand-intro {
margin: 30px;
}
.tip {
width: 100%;
text-align: center;
font-size: 36px;
margin: 10px 0;
}
.arrow {
width: 100%;
text-align: center;
margin-bottom: 20px;
}
img {
width: 100%;
height: 365px;
}
}
</style>
<script>
const $ = require('jquery');
const shareBottom = require('component/tool/share-bottom.vue');
const tip = require('common/tip');
const share = require('common/share');
const $share = $('#share');
module.exports = {
data() {
return {
shopInfo: {}
};
},
watch: {
shopInfo() {
share({
title: this.shopInfo.shopName,
link: location.href,
desc: this.shopInfo.shareSubTitle,
imgUrl: this.shopInfo.shopBg
});
}
},
methods: {
/* 获取店铺简介相关数据 */
getShopInfo() {
$.get({
url: '/product/shop/info.json',
data: {
domain: $share.data('domain'),
shopId: $share.data('shopid')
}
}).done(result => {
this.shopInfo = result;
}).fail(() => {
tip('网络错误');
});
}
},
components: {
shareBottom
},
created() {
this.getShopInfo();
}
};
</script>