index.wxml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <van-popup
  3. show="{{ show }}"
  4. position="bottom"
  5. round="{{ round }}"
  6. z-index="{{ zIndex }}"
  7. overlay="{{ overlay }}"
  8. custom-class="van-action-sheet"
  9. safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
  10. close-on-click-overlay="{{ closeOnClickOverlay }}"
  11. bind:close="onClickOverlay"
  12. >
  13. <view wx:if="{{ title }}" class="van-action-sheet__header">
  14. {{ title }}
  15. <van-icon
  16. name="cross"
  17. custom-class="van-action-sheet__close"
  18. bind:click="onClose"
  19. />
  20. </view>
  21. <view wx:if="{{ description }}" class="van-action-sheet__description van-hairline--bottom">
  22. {{ description }}
  23. </view>
  24. <view wx:if="{{ actions && actions.length }}">
  25. <!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
  26. <button
  27. wx:for="{{ actions }}"
  28. wx:key="index"
  29. open-type="{{ item.disabled || item.loading || (canIUseGetUserProfile && item.openType === 'getUserInfo') ? '' : item.openType }}"
  30. style="{{ item.color ? 'color: ' + item.color : '' }}"
  31. class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} {{ item.className || '' }}"
  32. hover-class="van-action-sheet__item--hover"
  33. data-index="{{ index }}"
  34. bindtap="{{ item.disabled || item.loading ? '' : 'onSelect' }}"
  35. bindgetuserinfo="onGetUserInfo"
  36. bindcontact="onContact"
  37. bindgetphonenumber="onGetPhoneNumber"
  38. binderror="onError"
  39. bindlaunchapp="onLaunchApp"
  40. bindopensetting="onOpenSetting"
  41. lang="{{ lang }}"
  42. session-from="{{ sessionFrom }}"
  43. send-message-title="{{ sendMessageTitle }}"
  44. send-message-path="{{ sendMessagePath }}"
  45. send-message-img="{{ sendMessageImg }}"
  46. show-message-card="{{ showMessageCard }}"
  47. app-parameter="{{ appParameter }}"
  48. >
  49. <block wx:if="{{ !item.loading }}">
  50. {{ item.name }}
  51. <view wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</view>
  52. </block>
  53. <van-loading wx:else custom-class="van-action-sheet__loading" size="22px" />
  54. </button>
  55. </view>
  56. <slot />
  57. <block wx:if="{{ cancelText }}">
  58. <view class="van-action-sheet__gap" />
  59. <view
  60. class="van-action-sheet__cancel"
  61. hover-class="van-action-sheet__cancel--hover"
  62. hover-stay-time="70"
  63. bind:tap="onCancel"
  64. >
  65. {{ cancelText }}
  66. </view>
  67. </block>
  68. </van-popup>