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
<template>
<div class="ybPaySuccess">
<div class='h2'>
<img :src="icon_yes" alt=""> 恭喜您,成功领取唱唱启蒙精品课程!
</div>
<p class='tip'>*教具礼包将于开课前寄出</p>
<div class='top'>
<img class='qr' :src="img1" alt="">
<p>请扫码关注公众号,查看课程!</p>
</div>
<img class='logo' :src="logo" alt="">
</div>
</template>
<script>
import icon_yes from '../../assets/yb/icon_yes@2x.png'
// import img1 from '../../assets/shop/qr2.png'
import img1 from '../../assets/yb/img_code@2x.png'
import logo from '../../assets/yb/logo@2x.png'
import { getCourseInfoApi,getwechatParam,getGoodsDetailApi } from "../../service/api";
export default {
name: "ybPaySuccess",
components: {},
data() {
return {
img1:img1,
icon_yes:icon_yes,
logo:logo,
groupDetail:{},
};
},
mounted() {
this.initPage();
},
methods: {
initPage() {
if (window.location.href.indexOf("invite_code") > -1) {
this.invite_code = this.$route.query.invite_code;
}
this.user_id = JSON.parse(localStorage.getItem("userDesc")).user_id;
this.onShare()
let invite = this.invite_code;
getGoodsDetailApi(50).then(res =>{
this.groupDetail = res
this.$sa.track("ViewTeacherPage", {
goodsID: this.groupDetail.id.toString(),
courseCate:
this.groupDetail.course_type === 1 ? "体验课" : "正式课",
lessonNumber: this.groupDetail.watch_num,
goodsName: this.groupDetail.name,
coursePrice: Number(this.groupDetail.original_price / 100),
discountPrice: Number(this.groupDetail.current_price / 100),
courseID: this.groupDetail.course_id,
courseName: "",
salesType: invite ? invite.split("-")[1] : "null",
salesID: invite ? Number(invite.split("-")[2]) : 0
});
})
},
goEdit(){
this.$router.push({name:'addressEdit'})
},
handleInviteCode() {
if (!this.invite_code) {
this.this_code = "CC-AIA-" + this.user_id;
} else {
let invite_code = this.invite_code.split("-");
let code = `${invite_code[0]}-${invite_code[1]}`;
this.this_code = `${code}-${this.user_id}`;
}
},
onShare: function(type) {
this.handleInviteCode();
let URL = `${process.env.API_URL}#/ybNav?parentId=${this.$route.query.parentId}&agentId=${this.$route.query.agentId}`;
this.enableShare({
product_title: '【免费领】价值498元亲子早教英语启蒙训练课',
desc: '友邦助您启蒙宝贝快乐家庭',
shareIcon: 'https://cdn.singsingenglish.com/new-sing/6c51175a99f73ee3a410ea9fbf66123f9f49f0f6.png',
shareUrl: URL
});
},
enableShare: function(option) {
let that = this;
getwechatParam({
api_list: "onMenuShareAppMessage,onMenuShareTimeline",
url: window.location.href.split("#")[0]
}).then(wechatRes => {
wx.config({
debug: false,
appId: wechatRes.appId,
timestamp: parseInt(wechatRes.timestamp),
nonceStr: wechatRes.nonceStr,
signature: wechatRes.signature,
jsApiList: wechatRes.jsApiList
});
wx.ready(function() {
wx.onMenuShareTimeline({
title: '【庆百年 友惊喜】暑期亲子礼︱价值498元唱唱启蒙英语线上课程免费领', // 分享标题
desc: '【庆百年 友惊喜】暑期亲子礼︱价值498元唱唱启蒙英语线上课程免费领', // 分享描述
link: option.shareUrl, // 分享链接
imgUrl:
option.shareIcon ||
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {
console.log("分享成功");
},
cancel: function() {
// alert("失败")
console.log("分享失败");
}
});
wx.onMenuShareAppMessage({
title: '【庆百年 友惊喜】暑期亲子礼', // 分享标题
desc: '价值498元唱唱启蒙英语线上课程免费领', // 分享描述
link: option.shareUrl, // 分享链接
imgUrl:
option.shareIcon ||
"https://cdn.singsingenglish.com/singsing/recommend/logo-refer.png", // 分享图标
success: function() {},
cancel: function() {}
});
});
});
},
}
};
</script>
<style scoped lang="less">
@import "../../util/public";
.ybPaySuccess {
background: #ffffff;
text-align:center;
border-top: 1px solid transparent;
.top{
margin:15 * @toVw auto;
width: 326* @toVw;
background: #FFEAAD;
height: 350 * @toVw;
border-radius:24 * @toVw;
position: relative;
img{max-width:100%;}
.qr{
position: absolute;
left: 59 * @toVw;
width: 207 * @toVw;
top: 31*@toVw;
border-radius:10 * @toVw;
}
p{
position: absolute;
top:270*@toVw;
width: 100%;
text-align: center;
color:#6F5C25;
font-weight:bold;
font-size: 17 * @toVw;
}
}
.h2{
font-size:17 * @toVw;
font-weight:bold;
text-align:center;
margin-top: 30 * @toVw;
img{
width: 24 * @toVw;
position:relative;
top: 2 * @toVw;
}
}
.tip{
font-size:13 * @toVw;
color:#666666;
margin: 13 * @toVw auto 33 * @toVw;
}
.logo{
position:fixed;
left: 130 * @toVw;
bottom: 20 * @toVw;
width: 125 * @toVw;
}
}
@media screen and (orientation: landscape) {
}
</style>