productintro.vue
9.7 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<template>
<div class="containerbox">
<div class="companytopimg">
<img src="../../../assets/companytop.png" alt />
<div class="intro">
<div class="flextwo fanbanck" @click="back">
<div class="leftrow leftrowkimg">
<img src="../../../assets/leftrowk.png" alt />
</div>
<div class="sharemiddle topk">公司介绍及产品介绍</div>
<div class="sharebtn"></div>
</div>
<div class="introtextbox">
<div class="introtext flex">
<img src="../../../assets/xiaolian.png" alt class="xiaoimg" />
<div class="introtitlename" style="font-size:0.28rem">
亲爱的
<span style="font-size:0.28rem;font-weight:bold">{{ result.name }},</span>
<span style="font-size:0.28rem;font-weight:bold">{{result.agent_name}}</span> 邀您深度了解唐元集!
</div>
</div>
</div>
</div>
<div class="companytext">
<div class="comtexttop flexthree">
<div class="textleft flexone">
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.company_title}}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
</div>
</div>
<div class="companyintrotext" v-html="intended.company"></div>
</div>
</div>
<div class="productimg">
<div class="zizhibox">
<div class="comtexttop flexthree">
<div class="textleft flexone">
<div class="textleftheng"></div>
<div class="textyuan"></div>
</div>
<div class="textname">{{intended.product_intro_title}}</div>
<div class="textleft flexone">
<div class="textkyuan"></div>
<div class="textrightheng"></div>
</div>
</div>
<div class="taozucontent" v-html="intended.product_intro"></div>
</div>
</div>
<div class="nextpage" @click="next">下一页</div>
<!-- 弹层 -->
<div class="register" v-if="showshare">
<div class="fenwrap">
<img src="../../../assets/chahao.png" alt class="chahao" @click="hideshare" />
<div class="fenimg">
<img src="../../../assets/fenimg.png" alt />
<div class="fenname">结果已出,立即分享给朋友</div>
<div class="fenbtn" @click="sueshare">立即分享</div>
</div>
</div>
</div>
<!-- 分享弹层 -->
<div class="sharewrap" v-if="shareshow" @click="hidesharek">
<img src="../../../assets/share.png" alt />
</div>
</div>
</template>
<script>
import wx from "jweixin-1.6.0";
export default {
data() {
return {
subid: "",
company: "",
product: "",
result: "",
intended: '',
showshare: false,
shareshow: false,
baseurl: ''
};
},
beforeRouteEnter(to, from, next) {
var u = navigator.userAgent;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
// XXX: 修复iOS版微信HTML5 History兼容性问题
if (isiOS && to.path !== location.pathname) {
// 此处不可使用location.replace
location.assign(to.fullPath);
} else {
next();
}
},
created() {
this.baseurl = 'http://' + location.host;
let type = localStorage.getItem("type")
if (type == 1) {
this.showshare = true;
}
document.title = '唐元集公众号'
this.subid = this.$route.query.subid;
this.getcompanyintro();
this.getresult();
this.getappid();
this.getintence()
},
mounted() {
window.scrollTo(0, 0);
},
methods: {
hidesharek() {
this.shareshow = false
},
getintence() {
let that = this
console.log(99999)
var result = ""
var url = "/api/user/intended";
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
result = res.data
localStorage.setItem("intended", JSON.stringify(res.data.intended))
that.intended = JSON.parse(localStorage.getItem("intended"));
})
.catch(function (err) {
console.log(err);
});
},
// 获取appid
getappid() {
let that = this;
let urlk = window.location.href;
var url = "/api/user/wechat_jssdk";
let param = {
url: urlk
};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res, 'hahahahaiaioaioaio4');
wx.config({
debug: false,
appId: res.data.jssdk.appId, // 和获取Ticke的必须一样------必填,公众号的唯一标识
timestamp: res.data.jssdk.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.jssdk.nonceStr, // 必填,生成签名的随机串
signature: res.data.jssdk.signature, // 必填,签名,见附录1
//需要分享的列表项:发送给朋友,分享到朋友圈,分享到QQ,分享到QQ空间
jsApiList: [
"showOptionMenu",
"updateAppMessageShareData",
"updateTimelineShareData",
]
});
wx.ready(function () {
wx.showOptionMenu();
})
that.sharetofriend()
})
.catch(function (err) {
console.log(err);
});
},
// 分享给朋友
sharetofriend() {
var that = this;
localStorage.setItem("type", '')
// 处理验证失败的信息
wx.error(function (res) {
logUtil.printLog("验证失败返回的信息:", res);
});
// 处理验证成功的信息
wx.ready(function () {
// 分享到朋友圈
wx.updateTimelineShareData({
title: '分享', // 分享标题
link: that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
// imgUrl: that.details.details.img
// ? that.details.details.img
// : that.sharemsg.img,
// 分享图标
// desc: that.sharemsg.content,
success: function (res) {
// 用户确认分享后执行的回调函数
console.log("suss");
logUtil.printLog("分享到朋友圈成功返回的信息为:", res);
that.showMsg("分享成功!");
},
cancel: function (res) {
// 用户取消分享后执行的回调函数
console.log("err");
logUtil.printLog("取消分享到朋友圈返回的信息为:", res);
}
}),
// 分享给朋友
wx.updateAppMessageShareData({
title: '分享', // 分享标题
desc: '分享', // 分享描述
link:
that.baseurl +
"/redirect.html?shareRedirect=" +
encodeURIComponent(window.location.href), // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'http://tangyuanji.t.brotop.cn/uploads/20200804/fcabfaf5aa3c856ced04703b0a78a467.png',
// imgUrl: that.details.details.img
// ? that.details.details.img
// : that.sharemsg.img,
// 分享图标
type: "", // 分享类型,music、video或link,不填默认为link
dataUrl: "", // 如果type是music或video,则要提供数据链接,默认为空
success: function (res) {
// 用户确认分享后执行的回调函数
logUtil.printLog("分享给朋友成功返回的信息为:", res);
},
cancel: function (res) {
// 用户取消分享后执行的回调函数
logUtil.printLog("取消分享给朋友返回的信息为:", res);
}
});
});
},
hideshare() {
this.showshare = false
},
// 立即分享
sueshare() {
this.showshare = false;
this.shareshow = true
},
back() {
this.$router.go(-1)
},
getresult() {
let that = this;
var url = "/api/user/assistance_result";
let param = {
assistance_id: that.subid
};
that.$axios
.post(url, param)
.then(function (res) {
that.result = res.data.result;
console.log(that.result);
})
.catch(function (err) {
console.log(err);
});
},
// 下一页
next() {
console.log(44);
this.$router.push({
path: "/productvideo",
query: {
subid: this.subid
}
});
},
getcompanyintro() {
let that = this;
var url = "/api/common/company";
let param = {};
that.$axios
.post(url, param)
.then(function (res) {
console.log(res);
that.company = res.data.company;
that.product = res.data.product;
})
.catch(function (err) {
console.log(err);
});
},
}
};
</script>
<style scoped>
@import "../../../style/usercenter.css";
.taozucontent {
width: 100%;
padding: 0 0.32rem;
box-sizing: border-box;
/* height: 17.5rem; */
overflow-y: scroll;
}
.sharewrap {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
}
</style>