CollegeSeasonPopup.vue
3.76 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
<template>
<div>
<div id="college_box">
<p class="title">填写信息</p>
<div class="item">
<input type="text" placeholder="请输入您的邀请码" v-model="inviteCode">
</div>
<div class="tip">
<img src="../assets/tip3.png" alt="">
<p>没有邀请码的用户可忽略</p>
</div>
<button class="submit" @click="submit">确定</button>
</div>
</div>
</template>
<script>
export default {
data () {
return {
inviteCode: '',//邀请码
}
},
mounted () {
let inviteCode = localStorage.getItem('inviteCode')
if (inviteCode) {
this.inviteCode = inviteCode
}
},
methods: {
submit () {
let openId = sessionStorage.getItem('openId');
// openId = 'oQTiTjucAcGORK3vI0XbDNOfld5U';
let postData = {
inviteCode: this.inviteCode,
openId: openId,
}
this.$toast.loading({
message: '加载中',
duration: 0,
forbidClick: true
})
this.http.initSubscribeUser(postData).then((res) => {
this.$toast.clear()
if(!this.inviteCode){
location.href = `https://payment.myjxt.com/?openId=${this.openId}`;//有openid后跳这个 399
return;
}
if (res.success) {
this.$toast.success(res.message)
this.$emit('hidePopup');
if (res.data) {
console.log('res.data:', res.data);
localStorage.setItem('inviteCode', this.inviteCode);
// location.href = res.data;//邀请码为空或者正确都会有链接返回
// 如果有邀请码
location.href = 'https://payment.myjxt.com/#/active?type=3'//顺治1 199
}
} else {
this.$toast.fail('邀请码不存在')
}
})
// return;
// // 如果有邀请码
// if (this.inviteCode) {
// location.href = 'https://wap.zj.10086.cn/szhy/business/student/h5OneToOne/schoolIndex.html?schoolId=A452C4C25259C362E05330844E0A6645'
// } else {
// // 没有邀请码跳支付
// location.href = `https://payment.myjxt.com/?openId=${this.openId}`;//有openid后跳这个
// // location.href = 'https://proxy.shunzhi.net/wx/index/getCode'
// }
}
}
}
</script>
<style lang="scss" scoped>
#college_box {
width: 100%;
background: #ffffff;
border-top-left-radius: 24px;
border-top-right-radius: 24px;
position: relative;
box-sizing: border-box;
padding: 0 40px;
padding-bottom: 100px;
.title {
text-align: center;
font-size: 30px;
letter-spacing: 2px;
font-weight: bold;
padding: 40px;
}
.item {
width: 670px;
height: 72px;
border-radius: 36px;
background: #f7f7f7;
box-sizing: border-box;
font-size: 28px;
padding: 0 32px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 28px;
p {
color: #333333;
&.nodata {
color: #999999;
}
}
img {
width: 40px;
}
input {
width: 100%;
background: transparent;
border: 0;
color: #333333;
padding: 0;
&::-webkit-input-placeholder {
color: #999999;
}
}
}
.tip {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 40px;
img {
width: 32px;
}
p {
font-size: 24px;
color: #999999;
margin-left: 8px;
}
}
.submit {
width: 294px;
height: 72px;
border: 0;
background: linear-gradient(135deg, #99c2ff 0%, #1f59ff 100%);
box-shadow: 0px 4px 8px 0px rgba(189, 189, 189, 0.5),
0px 8px 12px 0px rgba(87, 137, 255, 0.5);
border-radius: 34px;
font-size: 34px;
color: #ffffff;
margin: 0 auto;
display: block;
}
}
</style>