index.wxml 2.5 KB

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