index.axml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <view
  2. class="ant-image-upload {{ className || '' }}"
  3. style="{{ style || '' }}">
  4. <slot fileList="{{ mixin.value }}">
  5. <block
  6. a:for="{{ mixin.value }}"
  7. a:for-index="index"
  8. a:for-item="item"
  9. a:key="{{ item.uid }}">
  10. <view class="ant-image-upload-show">
  11. <view
  12. data-uid="{{ item.uid }}"
  13. onTap="onRemove">
  14. <slot name="removeButton">
  15. <view class="ant-image-upload-close" />
  16. </slot>
  17. </view>
  18. <slot
  19. name="image"
  20. value="{{ item }}">
  21. <view
  22. a:if="{{ item.status === 'uploading' || item.status === 'error' }}"
  23. class="ant-image-upload-cover">
  24. <view
  25. a:if="{{ item.status === 'uploading' }}"
  26. class="ant-image-upload-cover-loading">
  27. <loading className="ant-image-upload-cover-loading-icon" />
  28. <view class="ant-image-upload-cover-loading-text">
  29. {{ uploadingText }}
  30. </view>
  31. </view>
  32. <view
  33. a:if="{{ item.status === 'error' }}"
  34. class="ant-image-upload-cover-error">
  35. <icon
  36. className="ant-image-upload-cover-error-icon"
  37. type="CloseCircleOutline" />
  38. <view class="ant-image-upload-cover-error-text">
  39. {{ uploadfailedText }}
  40. </view>
  41. </view>
  42. </view>
  43. <image
  44. class="ant-image-upload-image"
  45. mode="{{ imageMode }}"
  46. src="{{ item.url || item.path }}"
  47. data-uid="{{ item.uid }}"
  48. onTap="onPreview" />
  49. </slot>
  50. </view>
  51. </block>
  52. <view onTap="chooseImage">
  53. <slot name="uploadButton">
  54. <view
  55. a:if="{{ showUploadButton }}"
  56. class="ant-image-upload-add-image-wrapper">
  57. <icon
  58. type="AddOutline"
  59. className="ant-image-upload-add-image-icon" />
  60. </view>
  61. </slot>
  62. </view>
  63. </slot>
  64. </view>