index.wxml 3.61 KB
Newer Older
李嘉林 committed
1 2 3 4 5 6 7
<wxs src="../wxs/utils.wxs" module="utils" />

<van-popup
  show="{{ show }}"
  z-index="{{ zIndex }}"
  overlay="{{ overlay }}"
  transition="{{ transition }}"
程默 committed
8
  custom-class="van-dialog van-dialog--{{ theme }} {{ className }}"
李嘉林 committed
9 10 11 12 13 14 15
  custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
  overlay-style="{{ overlayStyle }}"
  close-on-click-overlay="{{ closeOnClickOverlay }}"
  bind:close="onClickOverlay"
>
  <view
    wx:if="{{ title || useTitleSlot  }}"
程默 committed
16
    class="{{ utils.bem('dialog__header', { isolated: !(message || useSlot) }) }}"
李嘉林 committed
17 18
  >
    <slot wx:if="{{ useTitleSlot }}" name="title" />
程默 committed
19
    <block wx:elif="{{ title }}">{{ title }}</block>
李嘉林 committed
20 21 22 23 24
  </view>

  <slot wx:if="{{ useSlot }}" />
  <view
    wx:elif="{{ message }}"
程默 committed
25
    class="{{ utils.bem('dialog__message', [theme, messageAlign, { hasTitle: title }]) }}"
李嘉林 committed
26 27 28 29
  >
    <text class="van-dialog__message-text">{{ message }}</text>
  </view>

程默 committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  <van-goods-action wx:if="{{ theme === 'round-button' }}" custom-class="van-dialog__footer--round-button">
    <van-goods-action-button
      wx:if="{{ showCancelButton }}"
      size="large"
      loading="{{ loading.cancel }}"
      class="van-dialog__button van-hairline--right"
      custom-class="van-dialog__cancel"
      custom-style="color: {{ cancelButtonColor }}"
      bind:click="onCancel"
    >
      {{ cancelButtonText }}
    </van-goods-action-button>
    <van-goods-action-button
      wx:if="{{ showConfirmButton }}"
      size="large"
      class="van-dialog__button"
      loading="{{ loading.confirm }}"
      custom-class="van-dialog__confirm"
      custom-style="color: {{ confirmButtonColor }}"

      open-type="{{ confirmButtonOpenType }}"
      lang="{{ lang }}"
      business-id="{{ businessId }}"
      session-from="{{ sessionFrom }}"
      send-message-title="{{ sendMessageTitle }}"
      send-message-path="{{ sendMessagePath }}"
      send-message-img="{{ sendMessageImg }}"
      show-message-card="{{ showMessageCard }}"
      app-parameter="{{ appParameter }}"

      bind:click="onConfirm"
      bindgetuserinfo="bindGetUserInfo"
      bindcontact="bindContact"
      bindgetphonenumber="bindGetPhoneNumber"
      binderror="bindError"
      bindlaunchapp="bindLaunchApp"
      bindopensetting="bindOpenSetting"
    >
      {{ confirmButtonText }}
    </van-goods-action-button>
  </van-goods-action>

  <view wx:else class="van-hairline--top van-dialog__footer">
李嘉林 committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    <van-button
      wx:if="{{ showCancelButton }}"
      size="large"
      loading="{{ loading.cancel }}"
      class="van-dialog__button van-hairline--right"
      custom-class="van-dialog__cancel"
      custom-style="color: {{ cancelButtonColor }}"
      bind:click="onCancel"
    >
      {{ cancelButtonText }}
    </van-button>
    <van-button
      wx:if="{{ showConfirmButton }}"
      size="large"
      class="van-dialog__button"
      loading="{{ loading.confirm }}"
      custom-class="van-dialog__confirm"
      custom-style="color: {{ confirmButtonColor }}"

      open-type="{{ confirmButtonOpenType }}"
      lang="{{ lang }}"
      business-id="{{ businessId }}"
      session-from="{{ sessionFrom }}"
      send-message-title="{{ sendMessageTitle }}"
      send-message-path="{{ sendMessagePath }}"
      send-message-img="{{ sendMessageImg }}"
      show-message-card="{{ showMessageCard }}"
      app-parameter="{{ appParameter }}"

      bind:click="onConfirm"
      bindgetuserinfo="bindGetUserInfo"
      bindcontact="bindContact"
      bindgetphonenumber="bindGetPhoneNumber"
      binderror="bindError"
      bindlaunchapp="bindLaunchApp"
      bindopensetting="bindOpenSetting"
    >
      {{ confirmButtonText }}
    </van-button>
  </view>
</van-popup>