zz-shopify-components 0.7.0 → 0.9.0
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.
|
@@ -227,47 +227,47 @@
|
|
|
227
227
|
var EduErrorCodeConf = {
|
|
228
228
|
201: {
|
|
229
229
|
zh: "该教育邮箱已完成注册,无需重复认证",
|
|
230
|
-
en: "This educational email has been registered, no need to re-authenticate"
|
|
230
|
+
en: "This educational email has been registered, no need to re-authenticate."
|
|
231
231
|
},
|
|
232
232
|
400: {
|
|
233
233
|
zh: "邮箱格式不符合教育邮箱规范,请检查后重试",
|
|
234
|
-
en: "Email format does not meet educational email standards, please check and try again"
|
|
234
|
+
en: "Email format does not meet educational email standards, please check and try again."
|
|
235
235
|
},
|
|
236
236
|
401: {
|
|
237
237
|
zh: "认证方式与历史记录不一致,请使用相同认证方式",
|
|
238
|
-
en: "Authentication method inconsistent with historical records, please use the same authentication method"
|
|
238
|
+
en: "Authentication method inconsistent with historical records, please use the same authentication method."
|
|
239
239
|
},
|
|
240
240
|
402: {
|
|
241
241
|
zh: "已有相同信息和资料的审核表单已在处理中,无需提交",
|
|
242
|
-
en: "A review form with the same information and materials is already being processed, no need to submit"
|
|
242
|
+
en: "A review form with the same information and materials is already being processed, no need to submit."
|
|
243
243
|
},
|
|
244
244
|
403: {
|
|
245
245
|
zh: "申请拒绝次数已达上限(5次),无法继续提交",
|
|
246
|
-
en: "Application rejection limit reached (5 times), cannot continue to submit"
|
|
246
|
+
en: "Application rejection limit reached (5 times), cannot continue to submit."
|
|
247
247
|
},
|
|
248
248
|
404: {
|
|
249
249
|
zh: "审核资料未上传或上传格式不合要求",
|
|
250
|
-
en: "Application review materials not uploaded or upload format does not meet requirements"
|
|
250
|
+
en: "Application review materials not uploaded or upload format does not meet requirements."
|
|
251
251
|
},
|
|
252
252
|
405: {
|
|
253
253
|
zh: "验证码格式错误,请输入正确的 位数字验证码",
|
|
254
|
-
en: "Verification code format is incorrect, please enter the correct six-digit verification code"
|
|
254
|
+
en: "Verification code format is incorrect, please enter the correct six-digit verification code."
|
|
255
255
|
},
|
|
256
256
|
406: {
|
|
257
257
|
zh: "验证码已过期,请重新获取",
|
|
258
|
-
en: "Verification code has expired, please obtain a new one"
|
|
258
|
+
en: "Verification code has expired, please obtain a new one."
|
|
259
259
|
},
|
|
260
260
|
407: {
|
|
261
261
|
zh: "验证码错误,请重新输入",
|
|
262
|
-
en: "Incorrect verification code, please try again"
|
|
262
|
+
en: "Incorrect verification code, please try again."
|
|
263
263
|
},
|
|
264
264
|
429: {
|
|
265
265
|
zh: "验证码发送过于频繁,请 1 分钟后再试",
|
|
266
|
-
en: "Verification code sent too frequently, please try again in 1 minute"
|
|
266
|
+
en: "Verification code sent too frequently, please try again in 1 minute."
|
|
267
267
|
},
|
|
268
268
|
500: {
|
|
269
269
|
zh: "系统繁忙,请稍后再试",
|
|
270
|
-
en: "System is busy, please try again later"
|
|
270
|
+
en: "System is busy, please try again later."
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
document.addEventListener('DOMContentLoaded', function () {
|
|
@@ -320,24 +320,23 @@
|
|
|
320
320
|
isValid = false;
|
|
321
321
|
} else {
|
|
322
322
|
fileInput.classList.remove('error');
|
|
323
|
+
if(!identityDocumentUrl) {
|
|
324
|
+
// 文件还在上传中,请等待文件上传成功
|
|
325
|
+
zzShowToast('File is still uploading, please wait for the file to be uploaded successfully')
|
|
326
|
+
return
|
|
327
|
+
}
|
|
323
328
|
}
|
|
329
|
+
|
|
324
330
|
}
|
|
325
331
|
|
|
326
332
|
|
|
327
333
|
// 验证邮箱格式
|
|
328
334
|
const email = form.querySelector('[name="email"]');
|
|
329
|
-
|
|
330
|
-
if (verifyType === 'email') {
|
|
331
|
-
emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]*(\.edu|\.ac|zerozero)(\.[a-zA-Z]{2,})?$/;
|
|
332
|
-
}
|
|
335
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
333
336
|
if (email.value && !emailRegex.test(email.value)) {
|
|
334
337
|
email.classList.add('error');
|
|
335
338
|
isValid = false;
|
|
336
|
-
|
|
337
|
-
zzEduInfoDialog.showModal({
|
|
338
|
-
message: verifyType === 'email' ? 'Email format does not meet educational email standards, please check and try again' : 'Please enter a valid email address',
|
|
339
|
-
showInput: false
|
|
340
|
-
})
|
|
339
|
+
zzShowToast('Please enter a valid email address')
|
|
341
340
|
return
|
|
342
341
|
}
|
|
343
342
|
|
|
@@ -456,7 +455,8 @@
|
|
|
456
455
|
// 显示文件预览
|
|
457
456
|
showFilePreview(file);
|
|
458
457
|
const fileName = await getFileMD5Name(file);
|
|
459
|
-
|
|
458
|
+
const fileUploadLoading = block.querySelector('.zz-edu-form-file-upload-loading')
|
|
459
|
+
fileUploadLoading.classList.remove('tw-hidden')
|
|
460
460
|
|
|
461
461
|
httpRequest
|
|
462
462
|
.get(
|
|
@@ -477,26 +477,31 @@
|
|
|
477
477
|
stsToken: data.SecurityToken,
|
|
478
478
|
});
|
|
479
479
|
const result = await client.put(fileName || file.name, file);
|
|
480
|
-
console.log('result---------', result)
|
|
480
|
+
console.log('upload result---------', result)
|
|
481
481
|
if(result.url) {
|
|
482
482
|
identityDocumentUrl = result.url
|
|
483
|
+
fileUploadLoading.classList.add('tw-hidden')
|
|
483
484
|
} else {
|
|
484
485
|
removeEduVerifyFile()
|
|
486
|
+
fileUploadLoading.classList.add('tw-hidden')
|
|
485
487
|
zzShowToast('File upload failed, please try again.')
|
|
486
488
|
}
|
|
487
489
|
|
|
488
490
|
} catch (error) {
|
|
489
491
|
removeEduVerifyFile()
|
|
492
|
+
fileUploadLoading.classList.add('tw-hidden')
|
|
490
493
|
zzShowToast('File upload failed, please try again.')
|
|
491
494
|
}
|
|
492
495
|
|
|
493
496
|
} else {
|
|
494
497
|
removeEduVerifyFile()
|
|
498
|
+
fileUploadLoading.classList.add('tw-hidden')
|
|
495
499
|
zzShowToast('File upload failed, please try again.')
|
|
496
500
|
}
|
|
497
501
|
|
|
498
502
|
}).catch((err) => {
|
|
499
503
|
zzShowToast(EduErrorCodeConf[500].en)
|
|
504
|
+
fileUploadLoading.classList.add('tw-hidden')
|
|
500
505
|
removeEduVerifyFile()
|
|
501
506
|
});
|
|
502
507
|
}
|
|
@@ -534,6 +539,7 @@
|
|
|
534
539
|
<span class="zz-edu-form-file-name">${fileName}</span>
|
|
535
540
|
<span class="zz-edu-form-file-size">${fileSize} MB</span>
|
|
536
541
|
</div>
|
|
542
|
+
<span class='zz-edu-form-file-upload-loading tw-hidden tw-daisy-loading tw-daisy-loading-spinner ' ></span>
|
|
537
543
|
<div class="zz-edu-form-file-remove-btn" onclick="removeEduVerifyFile{{ block.id }}()">
|
|
538
544
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
539
545
|
<circle cx="12" cy="12" r="12" fill="#DD3B46"/>
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
|
|
203
203
|
</span>
|
|
204
204
|
<span class='max-lg:tw-hidden'>
|
|
205
|
-
{% render 'zz-prev-next-
|
|
205
|
+
{% render 'zz-prev-next-blur-icon', type: 'prev', color_type: 'light' %}
|
|
206
206
|
</span>
|
|
207
207
|
</div>
|
|
208
208
|
<div class='swiper-button-next {% if block_size <= 1 %} tw-hidden {% endif %}'>
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
|
|
225
225
|
</span>
|
|
226
226
|
<span class='max-lg:tw-hidden'>
|
|
227
|
-
{% render 'zz-prev-next-
|
|
227
|
+
{% render 'zz-prev-next-blur-icon', type: 'next', color_type: 'light' %}
|
|
228
228
|
</span>
|
|
229
229
|
</div>
|
|
230
230
|
|