overseas 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/package.json +80 -0
- package/packages/.DS_Store +0 -0
- package/packages/base/bottom-popup/index.js +10 -0
- package/packages/base/bottom-popup/src/bottom-popup.vue +151 -0
- package/packages/base/button/index.js +10 -0
- package/packages/base/button/src/button.vue +108 -0
- package/packages/base/dialog/index.js +10 -0
- package/packages/base/dialog/src/dialog.vue +173 -0
- package/packages/base/icon/index.js +10 -0
- package/packages/base/icon/src/icon.vue +15 -0
- package/packages/base/image/index.js +10 -0
- package/packages/base/image/src/image.vue +40 -0
- package/packages/base/material-list/index.js +10 -0
- package/packages/base/material-list/src/material-list.vue +48 -0
- package/packages/base/popup/index.js +10 -0
- package/packages/base/popup/src/popup.vue +44 -0
- package/packages/business/basic-image/index.js +10 -0
- package/packages/business/basic-image/src/basicImage.vue +51 -0
- package/packages/business/bottom-fixed-button/index.js +10 -0
- package/packages/business/bottom-fixed-button/src/bottomFixedButton.vue +66 -0
- package/packages/business/class-choose/index.js +10 -0
- package/packages/business/class-choose/src/courseCard.vue +142 -0
- package/packages/business/class-choose/src/img/icon_close_bottomcard.svg +14 -0
- package/packages/business/class-choose/src/img/icon_date.svg +21 -0
- package/packages/business/class-choose/src/img/icon_full.svg +27 -0
- package/packages/business/class-choose/src/img/icon_full_EL.svg +49 -0
- package/packages/business/class-choose/src/img/icon_selected.svg +18 -0
- package/packages/business/class-choose/src/img/icon_star_selected.svg +13 -0
- package/packages/business/class-choose/src/img/icon_star_unselect.svg +13 -0
- package/packages/business/class-choose/src/index.vue +316 -0
- package/packages/business/grade-panel/index.js +10 -0
- package/packages/business/grade-panel/src/gradePanel.vue +150 -0
- package/packages/business/material-panel/index.js +10 -0
- package/packages/business/material-panel/src/index.vue +136 -0
- package/packages/business/notified-panel/index.js +10 -0
- package/packages/business/notified-panel/src/areaCodeList.js +181 -0
- package/packages/business/notified-panel/src/index.vue +491 -0
- package/packages/business/page-render/index.js +10 -0
- package/packages/business/page-render/src/pageRender.vue +73 -0
- package/packages/business/registration-panel/index.js +10 -0
- package/packages/business/registration-panel/src/areaCodeList.js +181 -0
- package/packages/business/registration-panel/src/img/icon_off.png +0 -0
- package/packages/business/registration-panel/src/img/icon_on.png +0 -0
- package/packages/business/registration-panel/src/index.vue +329 -0
- package/packages/business/registration-panel/src/languageList.js +41 -0
- package/packages/business/selector-panel/index.js +10 -0
- package/packages/business/selector-panel/src/selectorPanel.vue +134 -0
- package/packages/business/student-info/index.js +10 -0
- package/packages/business/student-info/src/api/index.js +10 -0
- package/packages/business/student-info/src/config.js +11 -0
- package/packages/business/student-info/src/studentInfo.vue +145 -0
- package/packages/business/switch-student/index.js +10 -0
- package/packages/business/switch-student/src/api/index.js +28 -0
- package/packages/business/switch-student/src/switchStudent.vue +245 -0
- package/packages/business/tips-popup/index.js +10 -0
- package/packages/business/tips-popup/src/tipsPopup.vue +76 -0
- package/packages/business/user-login/index.js +10 -0
- package/packages/business/user-login/src/api/index.js +23 -0
- package/packages/business/user-login/src/img/logo.png +0 -0
- package/packages/business/user-login/src/index.vue +149 -0
- package/packages/theme-style/package.json +38 -0
- package/packages/theme-style/src/bottom-fixed-button.scss +31 -0
- package/packages/theme-style/src/bottom-popup.scss +87 -0
- package/packages/theme-style/src/button.scss +110 -0
- package/packages/theme-style/src/class-choose.scss +251 -0
- package/packages/theme-style/src/common/popup.scss +39 -0
- package/packages/theme-style/src/common/var.scss +6 -0
- package/packages/theme-style/src/common.scss +97 -0
- package/packages/theme-style/src/dialog.scss +130 -0
- package/packages/theme-style/src/grade-panel.scss +76 -0
- package/packages/theme-style/src/icon.scss +369 -0
- package/packages/theme-style/src/image.scss +8 -0
- package/packages/theme-style/src/img/body_bg.png +0 -0
- package/packages/theme-style/src/img/pdf.png +0 -0
- package/packages/theme-style/src/img/title_bg.png +0 -0
- package/packages/theme-style/src/index.scss +20 -0
- package/packages/theme-style/src/material-list.scss +118 -0
- package/packages/theme-style/src/material-panel.scss +2 -0
- package/packages/theme-style/src/notified-panel.scss +207 -0
- package/packages/theme-style/src/page-render.scss +3 -0
- package/packages/theme-style/src/registration-panel.scss +158 -0
- package/packages/theme-style/src/selector-panel.scss +86 -0
- package/packages/theme-style/src/student-info.scss +114 -0
- package/packages/theme-style/src/switch-student.scss +176 -0
- package/packages/theme-style/src/tips-popup.scss +60 -0
- package/packages/theme-style/src/user-login.scss +93 -0
- package/src/index.js +74 -0
- package/src/network/api.js +53 -0
- package/src/network/apiUrl.js +65 -0
- package/src/utils/dom.js +54 -0
- package/src/utils/filters.js +82 -0
- package/src/utils/merge.js +16 -0
- package/src/utils/phone.js +153 -0
- package/src/utils/popup/index.js +115 -0
- package/src/utils/popup/popup-manager.js +178 -0
- package/src/utils/storage.js +22 -0
- package/src/utils/utils.js +49 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 国际区号配置
|
|
3
|
+
*/
|
|
4
|
+
export const areaCodeList = [
|
|
5
|
+
{
|
|
6
|
+
// 美国
|
|
7
|
+
value: '1',
|
|
8
|
+
text: '+1',
|
|
9
|
+
code: 'us',
|
|
10
|
+
name: 'United States',
|
|
11
|
+
reg: /^\d{10}$/,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
// 英国
|
|
15
|
+
value: '44',
|
|
16
|
+
text: '+44',
|
|
17
|
+
code: 'uk',
|
|
18
|
+
name: 'United Kingdom',
|
|
19
|
+
reg: /(^[0-9]{10,11}$)/,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
// 新加坡
|
|
23
|
+
value: '65',
|
|
24
|
+
text: '+65',
|
|
25
|
+
code: 'sg',
|
|
26
|
+
name: 'Singapore',
|
|
27
|
+
reg: /^\d{8}$/,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
// 中国
|
|
31
|
+
value: '86',
|
|
32
|
+
text: '+86',
|
|
33
|
+
code: 'cn',
|
|
34
|
+
name: 'China',
|
|
35
|
+
reg: /^\d{11}$/,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
// 澳大利亚
|
|
39
|
+
value: '61',
|
|
40
|
+
text: '+61',
|
|
41
|
+
code: 'au',
|
|
42
|
+
name: 'Australia',
|
|
43
|
+
reg: /(^[0-9]{1,99}$)/,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
// 柬埔寨
|
|
47
|
+
value: '855',
|
|
48
|
+
text: '+855',
|
|
49
|
+
code: 'kh',
|
|
50
|
+
name: 'Cambodia',
|
|
51
|
+
reg: /^\d{10}$/,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// 加拿大
|
|
55
|
+
value: '1',
|
|
56
|
+
text: '+1',
|
|
57
|
+
code: 'ca',
|
|
58
|
+
name: 'Canada',
|
|
59
|
+
reg: /(^[0-9]{1,99}$)/,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
// 法国
|
|
63
|
+
value: '33',
|
|
64
|
+
text: '+33',
|
|
65
|
+
code: 'fr',
|
|
66
|
+
name: 'France',
|
|
67
|
+
reg: /^\d{10}$/,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
// 德国
|
|
71
|
+
value: '49',
|
|
72
|
+
text: '+49',
|
|
73
|
+
code: 'de',
|
|
74
|
+
name: 'Germany',
|
|
75
|
+
reg: /^\d{11}$/,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
// 香港
|
|
79
|
+
value: '852',
|
|
80
|
+
text: '+852',
|
|
81
|
+
code: 'hk',
|
|
82
|
+
name: 'Hong Kong, China',
|
|
83
|
+
reg: /^\d{8}$/,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
// 印度
|
|
87
|
+
value: '91',
|
|
88
|
+
text: '+91',
|
|
89
|
+
code: 'in',
|
|
90
|
+
name: 'India',
|
|
91
|
+
reg: /^\d{10}$/,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
// 印度尼西亚
|
|
95
|
+
value: '62',
|
|
96
|
+
text: '+62',
|
|
97
|
+
code: 'id',
|
|
98
|
+
name: 'Indonesia',
|
|
99
|
+
reg: /^\d{11}$/,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
// 爱尔兰
|
|
103
|
+
value: '353',
|
|
104
|
+
text: '+353',
|
|
105
|
+
code: 'ie',
|
|
106
|
+
name: 'Ireland',
|
|
107
|
+
reg: /^\d{9,10}$/,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
// 意大利
|
|
111
|
+
value: '39',
|
|
112
|
+
text: '+39',
|
|
113
|
+
code: 'it',
|
|
114
|
+
name: 'Italy',
|
|
115
|
+
reg: /^\d{10}$/,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
// 日本
|
|
119
|
+
value: '81',
|
|
120
|
+
text: '+81',
|
|
121
|
+
code: 'jp',
|
|
122
|
+
name: 'Japan',
|
|
123
|
+
reg: /^\d{11}$/,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
// 澳门
|
|
127
|
+
value: '853',
|
|
128
|
+
text: '+853',
|
|
129
|
+
code: 'mo',
|
|
130
|
+
name: 'Macau, China',
|
|
131
|
+
reg: /^\d{6,7}$/,
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
// 马来西亚
|
|
135
|
+
value: '60',
|
|
136
|
+
text: '+60',
|
|
137
|
+
code: 'ms',
|
|
138
|
+
name: 'Malaysia',
|
|
139
|
+
reg: /(^[0-9]{1,99}$)/,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
// 挪威
|
|
143
|
+
value: '47',
|
|
144
|
+
text: '+47',
|
|
145
|
+
code: 'no',
|
|
146
|
+
name: 'Norway',
|
|
147
|
+
reg: /^\d{8}$/,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
// 波兰
|
|
151
|
+
value: '48',
|
|
152
|
+
text: '+48',
|
|
153
|
+
code: 'pl',
|
|
154
|
+
name: 'Poland',
|
|
155
|
+
reg: /^\d{9}$/,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
// 韩国
|
|
159
|
+
value: '82',
|
|
160
|
+
text: '+82',
|
|
161
|
+
code: 'kr',
|
|
162
|
+
name: 'South Korea',
|
|
163
|
+
reg: /^\d{11}$/,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
// 西班牙
|
|
167
|
+
value: '34',
|
|
168
|
+
text: '+34',
|
|
169
|
+
code: 'es',
|
|
170
|
+
name: 'Spain',
|
|
171
|
+
reg: /^\d{10}$/,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
// 泰国
|
|
175
|
+
value: '66',
|
|
176
|
+
text: '+66',
|
|
177
|
+
code: 'th',
|
|
178
|
+
name: 'Thailand',
|
|
179
|
+
reg: /^\d{10}$/,
|
|
180
|
+
},
|
|
181
|
+
]
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="notified-panel" ref="notified-panel" class="notified-panel"
|
|
3
|
+
:style="[backgroundColorStyle, backgroundImgStyle]"
|
|
4
|
+
>
|
|
5
|
+
<div v-if="title || desc" class="notified-header">
|
|
6
|
+
<div v-if="title" class="notified-title">
|
|
7
|
+
{{ title }}
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="desc" class="notified-desc">
|
|
10
|
+
{{ desc }}
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="notified-form">
|
|
14
|
+
<van-form @submit="onSubmit">
|
|
15
|
+
<template v-for="(question, index) in questions">
|
|
16
|
+
<div v-if="question.entryType === 'phone'" :key="index" class="form-item">
|
|
17
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
18
|
+
{{ question.title }}
|
|
19
|
+
</div>
|
|
20
|
+
<div class="item-body phone-body">
|
|
21
|
+
<van-field style="width:120px;border-right: 0px;" readonly clickable :value="areacodeText" name="areaCode"
|
|
22
|
+
right-icon="arrow-down" @click="showAreaPicker = true"
|
|
23
|
+
/>
|
|
24
|
+
<van-popup v-model="showAreaPicker" round position="bottom">
|
|
25
|
+
<van-picker show-toolbar :columns="areaCodeList.map(e => `(${e.text}) ${e.name}`)"
|
|
26
|
+
@cancel="showAreaPicker = false" @confirm="onConfirmArea"
|
|
27
|
+
/>
|
|
28
|
+
</van-popup>
|
|
29
|
+
<van-field v-model="form.phone" name="phone"
|
|
30
|
+
:rules="[{ required: question.required, message: 'Required' }, { validator: validatorPhone, message: 'Invalid phone number' }]"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div v-if="question.entryType === 'mail'" :key="index" class="form-item">
|
|
35
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
36
|
+
{{ question.title }}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="item-body">
|
|
39
|
+
<van-field v-model="form.mail" name="mail"
|
|
40
|
+
:rules="[{ required: question.required, message: 'Required' }, { validator, message: 'Invalid email format' }]"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div v-if="question.entryType === 'name'" :key="index" class="form-item name-item">
|
|
45
|
+
<div class="form-name">
|
|
46
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
47
|
+
{{ question.firstName }}
|
|
48
|
+
</div>
|
|
49
|
+
<div class="item-body name-body">
|
|
50
|
+
<van-field v-model="form.firstName" name="firstName"
|
|
51
|
+
:rules="[{ required: question.required, message: 'Required' }]"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="form-name">
|
|
56
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
57
|
+
{{ question.lastName }}
|
|
58
|
+
</div>
|
|
59
|
+
<div class="item-body name-body">
|
|
60
|
+
<van-field v-model="form.lastName" name="lastName"
|
|
61
|
+
:rules="[{ required: question.required, message: 'Required' }]"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div v-if="question.entryType === 'grade'" :key="index" class="form-item">
|
|
67
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
68
|
+
{{ question.title }}
|
|
69
|
+
</div>
|
|
70
|
+
<div class="item-body grade-body">
|
|
71
|
+
<van-field readonly clickable :value="form.grade" name="grade"
|
|
72
|
+
right-icon="arrow-down"
|
|
73
|
+
:rules="[{ required: question.required, message: 'Required' }]" placeholder="grade"
|
|
74
|
+
@click="showGradePicker = true"
|
|
75
|
+
/>
|
|
76
|
+
<van-popup v-model="showGradePicker" round position="bottom">
|
|
77
|
+
<van-picker show-toolbar
|
|
78
|
+
:columns="questions.find(q => q.entryType === 'grade').gradeList.filter(i => i.checked).map(g => g.name)"
|
|
79
|
+
@cancel="showGradePicker = false" @confirm="onConfirmGrade"
|
|
80
|
+
/>
|
|
81
|
+
</van-popup>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<div v-if="question.entryType === 'wechat'" :key="index" class="form-item">
|
|
85
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
86
|
+
{{ question.title }}
|
|
87
|
+
</div>
|
|
88
|
+
<div class="item-body">
|
|
89
|
+
<van-field v-model="form.wechat" name="wechat" :rules="[{ required: question.required, message: 'Required' }]" />
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div v-if="question.entryType === 'line'" :key="index" class="form-item">
|
|
93
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
94
|
+
{{ question.title }}
|
|
95
|
+
</div>
|
|
96
|
+
<div class="item-body">
|
|
97
|
+
<van-field v-model="form.line" name="line" :rules="[{ required: question.required, message: 'Required' }]" />
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
<div v-if="question.entryType === 'whatsapp'" :key="index" class="form-item">
|
|
101
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
102
|
+
{{ question.title }}
|
|
103
|
+
</div>
|
|
104
|
+
<div class="item-body">
|
|
105
|
+
<van-field v-model="form.whatsapp" name="whatsapp" :rules="[{ required: question.required, message: 'Required' }]" />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div v-if="question.entryType === 'zipcode'" :key="index" class="form-item">
|
|
109
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
110
|
+
{{ question.title }}
|
|
111
|
+
</div>
|
|
112
|
+
<div class="item-body">
|
|
113
|
+
<van-field v-model="form.zipcode" name="zipcode" :rules="[{ required: question.required, message: 'Required' }]" />
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<div v-if="question.entryType === 'city'" :key="index" class="form-item">
|
|
117
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
118
|
+
{{ question.title }}
|
|
119
|
+
</div>
|
|
120
|
+
<div class="item-body customize-body">
|
|
121
|
+
<template v-if="question.questionType === '1'">
|
|
122
|
+
<van-field v-model="form.city" name="city"
|
|
123
|
+
:rules="[{ required: question.required, message: 'Required' }]"
|
|
124
|
+
/>
|
|
125
|
+
</template>
|
|
126
|
+
<template v-if="question.questionType === '2'">
|
|
127
|
+
<van-field v-model="form.city" readonly clickable name="city"
|
|
128
|
+
right-icon="arrow-down"
|
|
129
|
+
:rules="[{ required: question.required, message: 'Required' }]" placeholder="city"
|
|
130
|
+
@click="showCityPicker = true"
|
|
131
|
+
/>
|
|
132
|
+
<van-popup v-model="showCityPicker" round position="bottom">
|
|
133
|
+
<van-picker show-toolbar :columns="question.options.map(e => e.text)" @cancel="showCityPicker = false"
|
|
134
|
+
@confirm="onConfirmCity"
|
|
135
|
+
/>
|
|
136
|
+
</van-popup>
|
|
137
|
+
</template>
|
|
138
|
+
<template v-if="question.questionType === '3'">
|
|
139
|
+
<van-field name="city" :rules="[{ required: question.required, message: 'Required' }]">
|
|
140
|
+
<template #input>
|
|
141
|
+
<van-radio-group v-model="form.city">
|
|
142
|
+
<van-radio v-for="(option, ind) in question.options" :key="ind" :name="option.text"
|
|
143
|
+
checked-color="#FF9F0A"
|
|
144
|
+
>
|
|
145
|
+
<template #icon="props">
|
|
146
|
+
<div class="radio-icon" :class="[props.checked?'activeRadioIcon':'inactiveRadioIcon']" />
|
|
147
|
+
</template>
|
|
148
|
+
{{ option.text }}
|
|
149
|
+
<van-field v-if="option.isOther" v-model="option.value" />
|
|
150
|
+
</van-radio>
|
|
151
|
+
</van-radio-group>
|
|
152
|
+
</template>
|
|
153
|
+
</van-field>
|
|
154
|
+
</template>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
<div v-if="question.entryType === 'customize'" :key="index" class="form-item">
|
|
158
|
+
<div class="item-label" :class="{ 'label-required': question.required }">
|
|
159
|
+
{{ question.title }}
|
|
160
|
+
</div>
|
|
161
|
+
<div class="item-body customize-body">
|
|
162
|
+
<template v-if="question.questionType === '1'">
|
|
163
|
+
<van-field v-model="form[question.title]" :name="question.title"
|
|
164
|
+
:rules="[{ required: question.required, message: 'Required' }]"
|
|
165
|
+
/>
|
|
166
|
+
</template>
|
|
167
|
+
<template v-if="question.questionType === '2'">
|
|
168
|
+
<van-field v-model="form[question.title]" readonly clickable :name="question.title"
|
|
169
|
+
right-icon="arrow-down"
|
|
170
|
+
:rules="[{ required: question.required, message: 'Required' }]" @click="showCustomizePicker[index] = true"
|
|
171
|
+
/>
|
|
172
|
+
<van-popup v-model="showCustomizePicker[index]" round position="bottom">
|
|
173
|
+
<van-picker show-toolbar :columns="question.options.map(e => e.text)"
|
|
174
|
+
@cancel="showCustomizePicker[index] = false" @confirm="(value) => {
|
|
175
|
+
form[question.title] = value; showCustomizePicker[index] = false
|
|
176
|
+
}"
|
|
177
|
+
/>
|
|
178
|
+
</van-popup>
|
|
179
|
+
</template>
|
|
180
|
+
<template v-if="question.questionType === '3'">
|
|
181
|
+
<van-field class="customize34" :name="question.title" :rules="[{ required: question.required, message: 'Required' }]">
|
|
182
|
+
<template #input>
|
|
183
|
+
<van-radio-group v-model="form[question.title]">
|
|
184
|
+
<van-radio v-for="(option, ind) in question.options" :key="ind" :name="option.text"
|
|
185
|
+
checked-color="#FF9F0A"
|
|
186
|
+
>
|
|
187
|
+
<template #icon="props">
|
|
188
|
+
<div class="radio-icon" :class="[props.checked?'activeRadioIcon':'inactiveRadioIcon']" />
|
|
189
|
+
</template>
|
|
190
|
+
{{ option.text }}
|
|
191
|
+
<van-field v-if="option.isOther" v-model="option.value" />
|
|
192
|
+
</van-radio>
|
|
193
|
+
</van-radio-group>
|
|
194
|
+
</template>
|
|
195
|
+
</van-field>
|
|
196
|
+
</template>
|
|
197
|
+
<template v-if="question.questionType === '4'">
|
|
198
|
+
<van-field class="customize34" :name="question.title" :rules="[{ required: question.required, message: 'Required' }]">
|
|
199
|
+
<template #input>
|
|
200
|
+
<van-checkbox-group v-model="form[question.title]">
|
|
201
|
+
<van-checkbox v-for="(option, index) in question.options" :key="index" :name="option.text"
|
|
202
|
+
checked-color="#FF9F0A" shape="square"
|
|
203
|
+
>
|
|
204
|
+
{{ option.text }}
|
|
205
|
+
<van-field v-if="option.isOther" v-model="option.value" />
|
|
206
|
+
</van-checkbox>
|
|
207
|
+
</van-checkbox-group>
|
|
208
|
+
</template>
|
|
209
|
+
</van-field>
|
|
210
|
+
</template>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</template>
|
|
214
|
+
<div style="margin: 16px">
|
|
215
|
+
<van-button round block type="info" :color="buttonProps.backgroundColor" native-type="submit">
|
|
216
|
+
{{ buttonProps.text }}
|
|
217
|
+
</van-button>
|
|
218
|
+
</div>
|
|
219
|
+
</van-form>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
|
|
224
|
+
<script>
|
|
225
|
+
import Button from 'vant/es/button';
|
|
226
|
+
import Field from 'vant/es/field';
|
|
227
|
+
import Form from 'vant/es/form';
|
|
228
|
+
import Picker from 'vant/es/picker';
|
|
229
|
+
import Radio from "vant/es/radio"
|
|
230
|
+
import RadioGroup from "vant/es/radio-group"
|
|
231
|
+
import Checkbox from "vant/es/checkbox"
|
|
232
|
+
import CheckboxGroup from "vant/es/checkbox-group"
|
|
233
|
+
import Popup from "vant/es/popup"
|
|
234
|
+
import { areaCodeList } from './areaCodeList';
|
|
235
|
+
export default {
|
|
236
|
+
name: 'TsNotifiedPanel',
|
|
237
|
+
components: {
|
|
238
|
+
[Button.name]: Button,
|
|
239
|
+
[Form.name]: Form,
|
|
240
|
+
[Field.name]: Field,
|
|
241
|
+
[Picker.name]: Picker,
|
|
242
|
+
[Radio.name]: Radio,
|
|
243
|
+
[RadioGroup.name]: RadioGroup,
|
|
244
|
+
[Checkbox.name]: Checkbox,
|
|
245
|
+
[CheckboxGroup.name]: CheckboxGroup,
|
|
246
|
+
[Popup.name]: Popup
|
|
247
|
+
},
|
|
248
|
+
props: {
|
|
249
|
+
title: {
|
|
250
|
+
type: String,
|
|
251
|
+
default:
|
|
252
|
+
'AMC 8 讲座报名表AMC 8 讲座报名表AMC 8 讲座报名表AMC 8 讲座报名表',
|
|
253
|
+
},
|
|
254
|
+
desc: {
|
|
255
|
+
type: String,
|
|
256
|
+
default:
|
|
257
|
+
'填写下方信息即可报名周末AMC 8 备考讲座填写下方信息即可报名周末AMC 8 备考讲座填写下方信息即可报名周末AMC 8 备考讲座',
|
|
258
|
+
},
|
|
259
|
+
crmTagList: {
|
|
260
|
+
type: Array,
|
|
261
|
+
default: () => [],
|
|
262
|
+
},
|
|
263
|
+
questions: {
|
|
264
|
+
type: Array,
|
|
265
|
+
default: () => [
|
|
266
|
+
{
|
|
267
|
+
entryType: 'name',
|
|
268
|
+
questionType: '4',
|
|
269
|
+
title: '自定义',
|
|
270
|
+
gradeList: [],
|
|
271
|
+
firstName: 'First Name',
|
|
272
|
+
lastName: 'Last Name',
|
|
273
|
+
options: [{
|
|
274
|
+
text: "123123",
|
|
275
|
+
value: "",
|
|
276
|
+
isOther: false
|
|
277
|
+
}, {
|
|
278
|
+
text: "11111111111",
|
|
279
|
+
value: "",
|
|
280
|
+
isOther: false
|
|
281
|
+
}, {
|
|
282
|
+
text: "2222222222222222",
|
|
283
|
+
value: "",
|
|
284
|
+
isOther: false
|
|
285
|
+
}, {
|
|
286
|
+
text: "33333333333333333",
|
|
287
|
+
value: "",
|
|
288
|
+
isOther: true
|
|
289
|
+
}],
|
|
290
|
+
areaCode: 'us',
|
|
291
|
+
required: true,
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
buttonProps: {
|
|
296
|
+
type: Object,
|
|
297
|
+
default: () => {
|
|
298
|
+
return {
|
|
299
|
+
text: 'Submit',
|
|
300
|
+
backgroundColor: '#FF9F0A',
|
|
301
|
+
eventName: 'notified-submit',
|
|
302
|
+
dialogType: 'alert',
|
|
303
|
+
alert: {
|
|
304
|
+
title: 'Successfully Submitted',
|
|
305
|
+
message: '',
|
|
306
|
+
buttonText: 'ok',
|
|
307
|
+
buttonBgColor: '#FF9F0A',
|
|
308
|
+
},
|
|
309
|
+
};
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
backgroundImgUrl: {
|
|
313
|
+
type: String,
|
|
314
|
+
default: 'https://img2.baidu.com/it/u=3202947311,1179654885&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
|
|
315
|
+
},
|
|
316
|
+
backgroundColor: {
|
|
317
|
+
type: String,
|
|
318
|
+
default: '',
|
|
319
|
+
},
|
|
320
|
+
talWebhook: {
|
|
321
|
+
type: String,
|
|
322
|
+
default: '',
|
|
323
|
+
},
|
|
324
|
+
talSecret: {
|
|
325
|
+
type: String,
|
|
326
|
+
default: '',
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
data() {
|
|
330
|
+
return {
|
|
331
|
+
areaCodeList,
|
|
332
|
+
form: {
|
|
333
|
+
phone: '',
|
|
334
|
+
name: '',
|
|
335
|
+
areaCode: "",
|
|
336
|
+
firstName: "",
|
|
337
|
+
lastName: "",
|
|
338
|
+
mail: "",
|
|
339
|
+
grade: "",
|
|
340
|
+
wechat: "",
|
|
341
|
+
line: "",
|
|
342
|
+
whatsapp: "",
|
|
343
|
+
city: "",
|
|
344
|
+
zipcode: ""
|
|
345
|
+
},
|
|
346
|
+
gradeList: [],
|
|
347
|
+
showGradePicker: false,
|
|
348
|
+
showAreaPicker: false,
|
|
349
|
+
showCityPicker: false,
|
|
350
|
+
showCustomizePicker: {},
|
|
351
|
+
areacodeText: "+1",
|
|
352
|
+
phoneReg: /^\d{1,99}$/
|
|
353
|
+
};
|
|
354
|
+
},
|
|
355
|
+
computed: {
|
|
356
|
+
areaCodeNameList() {
|
|
357
|
+
return this.areaCodeList.map((area) => {
|
|
358
|
+
return {
|
|
359
|
+
value: area.value,
|
|
360
|
+
text: area.text,
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
},
|
|
364
|
+
backgroundImgStyle() {
|
|
365
|
+
if (this.backgroundImgUrl) {
|
|
366
|
+
return {
|
|
367
|
+
backgroundImage: `url(${this.backgroundImgUrl})`,
|
|
368
|
+
backgroundSize: 'cover',
|
|
369
|
+
backgroundRepeat: 'no-repeat',
|
|
370
|
+
}
|
|
371
|
+
} else {
|
|
372
|
+
return {}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
},
|
|
376
|
+
backgroundColorStyle() {
|
|
377
|
+
if (this.backgroundColor) {
|
|
378
|
+
return {
|
|
379
|
+
backgroundColor: this.backgroundColor
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
return {}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
watch: {
|
|
387
|
+
questions: {
|
|
388
|
+
handler(newValue) {
|
|
389
|
+
console.log("newValue", newValue)
|
|
390
|
+
this.questions.map((question, index) => {
|
|
391
|
+
if (question.entryType === "phone") {
|
|
392
|
+
const areaCodeObj = this.areaCodeList.find(e=>e.code === question.areaCode)
|
|
393
|
+
this.areacodeText = areaCodeObj.text
|
|
394
|
+
this.form.areaCode = areaCodeObj.value
|
|
395
|
+
this.phoneReg = areaCodeObj.reg
|
|
396
|
+
}
|
|
397
|
+
if (question.entryType === "grade") {
|
|
398
|
+
const gradeList = question.gradeList.filter(i => i.checked)
|
|
399
|
+
const grade = gradeList[0]
|
|
400
|
+
if (!this.form.grade) {
|
|
401
|
+
this.form.grade = grade.name
|
|
402
|
+
this.form.gradeValue = grade.value
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (question.entryType === "customize") {
|
|
406
|
+
this.$set(this.showCustomizePicker, index, false)
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
},
|
|
410
|
+
deep: true,
|
|
411
|
+
immediate: true
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
mounted() {
|
|
415
|
+
console.log("form", this.form)
|
|
416
|
+
},
|
|
417
|
+
destroyed() { },
|
|
418
|
+
methods: {
|
|
419
|
+
validator(val) {
|
|
420
|
+
return !val || /^([A-Za-z0-9_\-.])+@([A-Za-z0-9_\-.])+.([A-Za-z]{2,8})$/.test(val);
|
|
421
|
+
},
|
|
422
|
+
validatorPhone(val) {
|
|
423
|
+
return !val || this.phoneReg.test(val)
|
|
424
|
+
},
|
|
425
|
+
bottomBtnClick() {
|
|
426
|
+
this.$emit('btn-click', 'notified-submit', {
|
|
427
|
+
props: this.$props,
|
|
428
|
+
});
|
|
429
|
+
},
|
|
430
|
+
onSubmit() {
|
|
431
|
+
console.log("this.form", this.form)
|
|
432
|
+
console.log(this.questions)
|
|
433
|
+
this.questions.forEach(question => {
|
|
434
|
+
// 有自定义
|
|
435
|
+
let isOtherOptions = question.options.filter(option => option.isOther)
|
|
436
|
+
if (!isOtherOptions.length) return
|
|
437
|
+
if (question.questionType === '3') {
|
|
438
|
+
if (question.entryType === 'city') {
|
|
439
|
+
question.options.map(e => {
|
|
440
|
+
if (e.text === this.form.city && e.isOther) {
|
|
441
|
+
this.form.city = this.form.city + e.value
|
|
442
|
+
}
|
|
443
|
+
})
|
|
444
|
+
} else if (question.entryType === 'customize') {
|
|
445
|
+
question.options.map(e => {
|
|
446
|
+
if (e.text === this.form[question.title] && e.isOther) {
|
|
447
|
+
this.form[question.title] = this.form[question.title] + e.value
|
|
448
|
+
}
|
|
449
|
+
})
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if (question.questionType === '4') {
|
|
453
|
+
let isOtherOptions = question.options.filter(option => option.isOther)
|
|
454
|
+
if (!isOtherOptions.length) return
|
|
455
|
+
question.options.map(e => {
|
|
456
|
+
if (this.form[question.title].includes(e.text) && e.isOther) {
|
|
457
|
+
this.form[question.title].splice(this.form[question.title].indexOf(e.text), 1)
|
|
458
|
+
this.form[question.title].push(e.text + e.value)
|
|
459
|
+
}
|
|
460
|
+
})
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
this.form.crmTagList = this.crmTagList
|
|
464
|
+
this.form.name = `${this.form.firstName} ${this.form.lastName}`
|
|
465
|
+
this.form.talWebhook = this.talWebhook
|
|
466
|
+
this.form.talSecret = this.talSecret
|
|
467
|
+
this.$emit('btn-click', this.buttonProps.eventName, this.form);
|
|
468
|
+
},
|
|
469
|
+
onConfirmGrade(value, index) {
|
|
470
|
+
console.log("onConfirmGrade", value, index)
|
|
471
|
+
const gradeList = this.questions.find(q => q.entryType === 'grade').gradeList.filter(i => i.checked)
|
|
472
|
+
const grade = gradeList[index]
|
|
473
|
+
this.form.grade = grade.name
|
|
474
|
+
this.form.gradeValue = grade.value
|
|
475
|
+
this.showGradePicker = false;
|
|
476
|
+
},
|
|
477
|
+
onConfirmArea(value, index) {
|
|
478
|
+
console.log("onConfirmArea", value, index)
|
|
479
|
+
const areaObj = this.areaCodeList[index]
|
|
480
|
+
this.phoneReg = areaObj.reg
|
|
481
|
+
this.form.areaCode = areaObj.value
|
|
482
|
+
this.areacodeText = areaObj.text
|
|
483
|
+
this.showAreaPicker = false
|
|
484
|
+
},
|
|
485
|
+
onConfirmCity(value) {
|
|
486
|
+
this.form.city = value
|
|
487
|
+
this.showCityPicker = false
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
};
|
|
491
|
+
</script>
|