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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
<div class="full-page">
<div class="container contentPage">
<div class="head">
<div class="list-item">
<div class="list-item-cell picture">
<span class="avatar" :style="{backgroundImage:'url(' + data.producerPicUrl + ')'}"></span>
</div>
<div class="list-item-cell info">
<div class="title">{{data.producerName}}</div>
<p>{{data.producerOrgName}}</p>
</div>
<div class="list-item-cell tool" @click="shareVisible=true">
<i class="glyphicon glyphicon-share"></i>
</div>
</div>
</div>
<div class="content" v-html="data.content"></div>
</div>
<div class="share-block" v-show="shareVisible">
<img src="../../assets/images/share-img.png" @click="shareVisible=false"/>
</div>
</div>
</template>
<script>
// import { getUserCard, getunUsedCountById } from '@/api/apply/apply'
import { getContentInfo } from '@/api/apply/apply'
import defaultOrgImg from '../../assets/images/org-default-picture.png'
import { wxpermission, initWXShare } from '@/wxpermission'
import { removeUrlParam } from '@/util/index'
export default {
name: 'Home',
data () {
return {
imprId: this.$route.query.imprId,
data: {
producerPicUrl: '',
producerName: '',
producerOrgName: '',
content: ''
},
shareVisible: false
}
},
created () {
this.getContentInfoFn(this.imprId)
},
mounted: function () {
},
computed: {
},
components: {
},
methods: {
getContentInfoFn (imprId) {
this.$Indicator.open()
getContentInfo(imprId).then(res => {
this.$Indicator.close()
if (res.code === 0) {
this.data = {
producerPicUrl: res.data.producerPicUrl !== '' ? res.data.producerPicUrl : defaultOrgImg,
producerName: res.data.producerName,
producerOrgName: res.data.producerOrgName,
content: res.data.content,
mainTitle: res.data.mainTitle,
subheading: res.data.subheading,
cover: res.data.cover
}
console.log('getContentInfo')
let that = this
wxpermission(1, () => {
let newShareLink = removeUrlParam('code')
newShareLink = newShareLink.split('#')[0] + '#/content?imprId=' + this.imprId
const shareData = {
title: that.data.mainTitle,
imgUrl: that.data.cover,
desc: that.data.subheading !== '' ? that.data.subheading : '凯歌健康券',
link: newShareLink
}
initWXShare(shareData)
})
}
}).catch((error) => {
this.$toast({
message: error.message,
position: 'center',
duration: 3000
})
})
}
}
}
</script>
<style scoped>
.full-page {
background-color: #ffffff;
}
.contentPage .head {
padding: 1em 0;
}
.contentPage .head > .list-item {
display: table;
width: 100%;
}
.contentPage .head > .list-item > .list-item-cell {
display: table-cell;
vertical-align: middle;
}
.contentPage .head > .list-item > .list-item-cell.picture {
width: 4.5em;
}
.contentPage .head > .list-item > .list-item-cell.picture > .avatar{
display: inline-block;
width: 4em;
height: 4em;
border-radius: 50%;
background-repeat: no-repeat;
background-size: 100% auto;
}
.contentPage .head > .list-item > .list-item-cell.info {
border-bottom:1px solid #ccc;
}
.contentPage .head > .list-item > .list-item-cell.info > .title {
font-size: 1.1em;
}
.contentPage .head > .list-item > .list-item-cell.tool {
width: 2em;
font-size: 1.6em;
color: #43d1be;
text-align: right;
border-bottom:1px solid #ccc;
}
.share-block {
position: fixed;
z-index: 9999;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.share-block img {
width: 100%;
}
</style>