index.axml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <view class='uploader-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='../wxs/utils.sjs' name='utils'>
  3. </import-sjs>
  4. <view class='van-uploader'>
  5. <view class='van-uploader__wrapper'>
  6. <view a:if='{{ previewImage }}' a:for='{{ lists }}' a:key='{{index}}' class='van-uploader__preview' data-index='{{ index }}' ref-numbers='{{ lists }}' onTap='antmoveAction' data-antmove-tap='onClickPreview'>
  7. <image a:if='{{ item.isImage }}' mode='{{ imageFit }}' src='{{ item.thumb || item.url }}' alt="{{ item.name || ('图片' + index) }}" class='van-uploader__preview-image' style='width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};' data-index='{{ index }}' onTap='antmoveAction' data-antmove-tap='onPreviewImage'>
  8. </image>
  9. <video a:elif='{{ item.isVideo }}' src='{{ item.url }}' poster='{{ item.thumb }}' autoplay='{{ item.autoplay }}' class='van-uploader__preview-image' style='width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};' data-index='{{ index }}' onTap='antmoveAction' data-antmove-tap='onPreviewVideo'>
  10. </video>
  11. <view a:else class='van-uploader__file' style='width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};'>
  12. <van-icon name='description' class='van-uploader__file-icon' ref='saveChildRef1'>
  13. </van-icon>
  14. <view class='van-uploader__file-name van-ellipsis'>
  15. {{ item.name || item.url }}
  16. </view>
  17. </view>
  18. <view a:if="{{ item.status === 'uploading' || item.status === 'failed' }}" class='van-uploader__mask'>
  19. <van-icon a:if="{{ item.status === 'failed' }}" name='close' class='van-uploader__mask-icon' ref='saveChildRef2'>
  20. </van-icon>
  21. <van-loading a:else custom-class='van-uploader__loading' ref='saveChildRef3'>
  22. </van-loading>
  23. <text a:if='{{ item.message }}' class='van-uploader__mask-message'>
  24. {{ item.message }} </text>
  25. </view> <view a:if='{{ deletable && item.deletable }}' data-index='{{ index }}' class='van-uploader__preview-delete' catchTap='antmoveAction' data-antmove-tap='deleteItem'>
  26. <van-icon name='cross' class='van-uploader__preview-delete-icon' ref='saveChildRef4'>
  27. </van-icon>
  28. </view>
  29. </view> <block a:if='{{ isInCount }}'>
  30. <view class='van-uploader__slot' onTap='antmoveAction' data-antmove-tap='startUpload'>
  31. <slot>
  32. </slot>
  33. </view>
  34. <view a:if='{{ showUpload }}' class="van-uploader__upload {{ disabled ? 'van-uploader__upload--disabled': ''}}" style='width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};' onTap='antmoveAction' data-antmove-tap='startUpload'>
  35. <van-icon name='{{ uploadIcon }}' class='van-uploader__upload-icon' ref='saveChildRef5'>
  36. </van-icon>
  37. <text a:if='{{ uploadText }}' class='van-uploader__upload-text'>
  38. {{ uploadText }} </text>
  39. </view>
  40. </block>
  41. </view>
  42. </view>
  43. </view>