index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <van-button
  4. square
  5. :id="id"
  6. size="large"
  7. :lang="lang"
  8. :loading="loading"
  9. :disabled="disabled"
  10. :open-type="openType"
  11. :business-id="businessId"
  12. custom-class="van-goods-action-icon"
  13. :session-from="sessionFrom"
  14. :app-parameter="appParameter"
  15. :send-message-img="sendMessageImg"
  16. :send-message-path="sendMessagePath"
  17. :show-message-card="showMessageCard"
  18. :send-message-title="sendMessageTitle"
  19. @click="onClick($event, { tagId: id })"
  20. @error="bindError($event, { tagId: id })"
  21. @contact="bindContact($event, { tagId: id })"
  22. @opensetting="bindOpenSetting($event, { tagId: id })"
  23. @getuserinfo="bindGetUserInfo($event, { tagId: id })"
  24. @getphonenumber="bindGetPhoneNumber($event, { tagId: id })"
  25. @launchapp="bindLaunchApp($event, { tagId: id })"
  26. >
  27. <view class="van-goods-action-icon__content">
  28. <van-icon v-if="icon" size="20px" :name="icon" :dot="dot" :info="info" class="van-goods-action-icon__icon" custom-class="icon-class" />
  29. <slot name="icon" />
  30. <text class="text-class">{{ text }}</text>
  31. </view>
  32. </van-button>
  33. </view>
  34. </template>
  35. <script>
  36. import { VantComponent } from '../common/component';
  37. import { link } from '../mixins/link';
  38. import { button } from '../mixins/button';
  39. import { openType } from '../mixins/open-type';
  40. export default {
  41. data() {
  42. return {
  43. id: '',
  44. lang: '',
  45. openType: '',
  46. businessId: '',
  47. sessionFrom: '',
  48. appParameter: '',
  49. sendMessageImg: '',
  50. sendMessagePath: '',
  51. showMessageCard: '',
  52. sendMessageTitle: ''
  53. };
  54. },
  55. classes: ['icon-class', 'text-class'],
  56. mixins: [link, button, openType],
  57. props: {
  58. text: String,
  59. dot: Boolean,
  60. info: String,
  61. icon: String,
  62. disabled: Boolean,
  63. loading: Boolean
  64. },
  65. methods: {
  66. onClick(event, _dataset) {
  67. /* ---处理dataset begin--- */
  68. this.handleDataset(event, _dataset);
  69. /* ---处理dataset end--- */
  70. this.$emit('click', event.detail);
  71. this.jumpLink();
  72. },
  73. bindError(e, _dataset) {
  74. /* ---处理dataset begin--- */
  75. this.handleDataset(e, _dataset);
  76. /* ---处理dataset end--- */
  77. console.log('占位:函数 bindError 未声明');
  78. },
  79. bindContact(e, _dataset) {
  80. /* ---处理dataset begin--- */
  81. this.handleDataset(e, _dataset);
  82. /* ---处理dataset end--- */
  83. console.log('占位:函数 bindContact 未声明');
  84. },
  85. bindOpenSetting(e, _dataset) {
  86. /* ---处理dataset begin--- */
  87. this.handleDataset(e, _dataset);
  88. /* ---处理dataset end--- */
  89. console.log('占位:函数 bindOpenSetting 未声明');
  90. },
  91. bindGetUserInfo(e, _dataset) {
  92. /* ---处理dataset begin--- */
  93. this.handleDataset(e, _dataset);
  94. /* ---处理dataset end--- */
  95. console.log('占位:函数 bindGetUserInfo 未声明');
  96. },
  97. bindGetPhoneNumber(e, _dataset) {
  98. /* ---处理dataset begin--- */
  99. this.handleDataset(e, _dataset);
  100. /* ---处理dataset end--- */
  101. console.log('占位:函数 bindGetPhoneNumber 未声明');
  102. },
  103. bindLaunchApp(e, _dataset) {
  104. /* ---处理dataset begin--- */
  105. this.handleDataset(e, _dataset);
  106. /* ---处理dataset end--- */
  107. console.log('占位:函数 bindLaunchApp 未声明');
  108. }
  109. }
  110. };
  111. </script>
  112. <style>
  113. @import './index.css';
  114. </style>