zz-shopify-components 0.3.1-beta.13 → 0.3.1-beta.14

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.
@@ -169,10 +169,10 @@
169
169
  <div class="zz-edu-form-row upload-file-row zz-edu-form-hidden">
170
170
  <div class="zz-edu-form-column">
171
171
  <div class="zz-edu-form-group">
172
- <label for="fileUpload" class="zz-edu-form-label">Upload Document</label>
172
+ <label for="fileUpload-{{ block.id }}" class="zz-edu-form-label">Upload Document</label>
173
173
  <div class="zz-edu-form-file-upload-container">
174
- <input type="file" id="fileUpload" name="fileUpload" class="zz-edu-form-file-input" accept=".pdf,.jpg,.jpeg,.png">
175
- <label for="fileUpload" class="zz-edu-form-file-upload-label">
174
+ <input type="file" id="fileUpload-{{ block.id }}" name="fileUpload" class="zz-edu-form-file-input" accept=".pdf,.jpg,.jpeg,.png">
175
+ <label for="fileUpload-{{ block.id }}" class="zz-edu-form-file-upload-label">
176
176
  <div class="zz-edu-form-file-upload-content">
177
177
  <svg class="zz-edu-form-file-upload-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
178
178
  <path d="M12 16L12 8M12 8L15 11M12 8L9 11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
@@ -182,7 +182,7 @@
182
182
  <span class="zz-edu-form-file-upload-hint">PDF, JPG, PNG (Max 10MB)</span>
183
183
  </div>
184
184
  </label>
185
- <div class="zz-edu-form-file-preview" id="filePreview"></div>
185
+ <div class="zz-edu-form-file-preview" id="filePreview-{{ block.id }}"></div>
186
186
  </div>
187
187
  </div>
188
188
  </div>
@@ -313,7 +313,7 @@
313
313
 
314
314
  // 验证文件上传
315
315
  if (verifyType === 'manual') {
316
- const fileInput = form.querySelector('#fileUpload');
316
+ const fileInput = form.querySelector('#fileUpload-{{ block.id }}');
317
317
  if (!fileInput.files || fileInput.files.length === 0) {
318
318
  fileInput.classList.add('error');
319
319
  isValid = false;
@@ -419,8 +419,8 @@
419
419
 
420
420
 
421
421
  // 文件上传处理
422
- const fileInput = form.querySelector('#fileUpload');
423
- const filePreview = form.querySelector('#filePreview');
422
+ const fileInput = form.querySelector('#fileUpload-{{ block.id }}');
423
+ const filePreview = form.querySelector('#filePreview-{{ block.id }}');
424
424
  const fileUploadLabel = form.querySelector('.zz-edu-form-file-upload-label');
425
425
 
426
426
  fileInput.addEventListener('change', function(e) {
@@ -461,7 +461,6 @@
461
461
  accessKeySecret: data.AccessKeySecret,
462
462
  stsToken: data.SecurityToken,
463
463
  });
464
-
465
464
  const result = await client.put(file.name, file);
466
465
  if(result.url) {
467
466
  identityDocumentUrl = result.url
@@ -519,7 +518,7 @@
519
518
  <span class="zz-edu-form-file-name">${fileName}</span>
520
519
  <span class="zz-edu-form-file-size">${fileSize} MB</span>
521
520
  </div>
522
- <div class="zz-edu-form-file-remove-btn" onclick="removeEduVerifyFile()">
521
+ <div class="zz-edu-form-file-remove-btn" onclick="removeEduVerifyFile{{ block.id }}()">
523
522
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
524
523
  <circle cx="12" cy="12" r="12" fill="#DD3B46"/>
525
524
  <path d="M8.07812 15.9609L15.9977 8.04134" stroke="white" stroke-width="1.6" stroke-linecap="round"/>
@@ -533,7 +532,7 @@
533
532
  }
534
533
 
535
534
  // 移除文件
536
- window.removeEduVerifyFile = function() {
535
+ window['removeEduVerifyFile{{ block.id }}'] = function() {
537
536
  fileInput.value = '';
538
537
  filePreview.innerHTML = '';
539
538
  fileUploadLabel.style.display = 'flex';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.3.1-beta.13",
3
+ "version": "0.3.1-beta.14",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",