message-again.wxml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!--module/chats/components/message-again/message-again.wxml-->
  2. <wxs module="_">
  3. module.exports.getClassName = function (option) {
  4. if (!option) return '';
  5. if (option.disabled) return 'card--disabled';
  6. if (option.checked) return 'card--active';
  7. }
  8. module.exports.maxHeight = function (options, height, maxHeight) {
  9. var rows = Math.ceil(options.filter(function (option) { return !option.hide }).length / 3);
  10. return Math.min(rows * (height + 8), maxHeight || 350);
  11. }
  12. module.exports.subName = function (option) {
  13. if (!option.options) return '';
  14. var options = option.options
  15. .filter(function (option) { return option.checked; })
  16. .map(function (option) { return option.name; })
  17. if (options.length) return ':' + options.join(' ');
  18. return ''
  19. }
  20. module.exports.options = function (options) {
  21. return options.filter(function (option) { return !option.hide })
  22. }
  23. </wxs>
  24. <!--module/chats/components/message-select/message-select.wxml-->
  25. <view class="chat-card left">
  26. <view class="chat-card__avatar ">
  27. <image src="../../assets/robot.png" mode="aspectFill" />
  28. </view>
  29. <view class="chat-card__content">
  30. <t-cell t-class="cell-border-gradient" title="您好,您于{{followObj.medicalTime}}在我院{{followObj.medicalDepartment}}因为{{followObj.diagnosis}}就诊。接下来,我们将对您进行一个随访,请依据您目前的实际情况回答。"></t-cell>
  31. </view>
  32. </view>
  33. <view class="chat-card left">
  34. <view class="chat-card__avatar ">
  35. <image src="../../assets/robot.png" mode="aspectFill" />
  36. </view>
  37. <view class="chat-card__content">
  38. <t-cell t-class="cell-border-gradient" title="请问您的情况是否有变化?" description="请点击症状进行选择"></t-cell>
  39. <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(options, itemHeight)}}px;" mark:type="options" bind:tap="handleTop">
  40. <grid-builder list="{{_.options(options)}}" cross-axis-count="3" cross-axis-gap="8" main-axis-gap="8" padding="{{[4,4,4,4]}}">
  41. <view slot:item slot:index class="card {{_.getClassName(item)}}" style="height: {{itemHeight}}px;" mark:item="{{item}}">
  42. <t-icon wx:if="{{item.checked}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
  43. <text overflow="ellipsis" max-lines="2">{{item.name}}{{_.subName(item)}}</text>
  44. </view>
  45. </grid-builder>
  46. </scroll-view>
  47. <view wx:if="{{multiple || !required}}" class="chat-card__handle {{active ? '' : 'disabled'}}">
  48. <view wx:if="{{!required}}" class="item {{hasSelected ? 'disabled': ''}}" bind:tap="onSkip">
  49. <image src="../../assets/button-1.bg.png" mode="aspectFit" />
  50. <view style="color: #d4d4d4;">无变化</view>
  51. </view>
  52. <view wx:if="{{multiple}}" class="item" bind:tap="onSubmit">
  53. <image src="../../assets/button-1.bg.png" mode="aspectFit" />
  54. <view>选好了</view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="chat-card right" wx:if="{{result}}">
  60. <view class="chat-card__avatar ">
  61. <user-avatar></user-avatar>
  62. </view>
  63. <view class="chat-card__content">
  64. <t-cell title="{{result}}" bordered="{{false}}"></t-cell>
  65. </view>
  66. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  67. </view>
  68. <view class="chat-card left" wx:if="{{result}}">
  69. <view class="chat-card__avatar ">
  70. <image src="../../assets/robot.png" mode="aspectFill" />
  71. </view>
  72. <view class="chat-card__content">
  73. <t-cell t-class="cell-border-gradient" title="请问有没有出现新的症状?"></t-cell>
  74. <t-radio-group t-class="horizontal-box" value="{{value1}}" bind:change="onChangeValue" disabled="{{btnDisabled}}">
  75. <view wx:for="{{radioList}}" wx:key="index" class="radio-card {{value1 == index ? 'card-active' : ''}}">
  76. <t-icon wx:if="{{value1 == index}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
  77. <t-radio value="{{index}}" label="{{item.label}}" icon="none" borderless />
  78. </view>
  79. </t-radio-group>
  80. </view>
  81. </view>
  82. <view class="chat-card right" wx:if="{{symptomResult}}">
  83. <view class="chat-card__avatar ">
  84. <user-avatar></user-avatar>
  85. </view>
  86. <view class="chat-card__content">
  87. <t-cell title="{{symptomResult}}" bordered="{{false}}"></t-cell>
  88. </view>
  89. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  90. </view>
  91. <view class="chat-card left" wx:if="{{symptomResult==='有'}}">
  92. <view class="chat-card__avatar ">
  93. <image src="../../assets/robot.png" mode="aspectFill" />
  94. </view>
  95. <view class="chat-card__content">
  96. <t-cell t-class="cell-border-gradient" title="请描述新的症状?"></t-cell>
  97. </view>
  98. </view>
  99. <view class="chat-card right" wx:if="{{messages[0].content && symptomResult==='有'}}">
  100. <view class="chat-card__avatar ">
  101. <user-avatar></user-avatar>
  102. </view>
  103. <view class="chat-card__content">
  104. <t-cell title="{{messages[0].content}}" bordered="{{false}}"></t-cell>
  105. </view>
  106. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  107. </view>
  108. <view class="chat-card left" wx:if="{{messages.length>0 || symptomResult==='没有' }}">
  109. <view class="chat-card__avatar ">
  110. <image src="../../assets/robot.png" mode="aspectFill" />
  111. </view>
  112. <view class="chat-card__content">
  113. <t-cell t-class="cell-border-gradient" title="请问还有其他要补充的吗?"></t-cell>
  114. </view>
  115. </view>
  116. <view class="chat-card right" wx:if="{{symptomResult==='有'?messages[1].content:false || symptomResult==='没有'?messages[0].content:false}}">
  117. <view class="chat-card__avatar ">
  118. <user-avatar></user-avatar>
  119. </view>
  120. <view class="chat-card__content">
  121. <t-cell title="{{symptomResult==='有'?messages[1].content:messages[0].content}}" bordered="{{false}}"></t-cell>
  122. </view>
  123. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  124. </view>
  125. <view class="input-panel" style="bottom:{{inputBoxBottom}}px;" wx:if="{{showrePlenish}}" >
  126. <input bind:input="handleInput" value="{{inputText}}" adjust-position="{{false}}" placeholder="请输入" bind:focus="onInputFocus" bind:blur="onInputBlur"
  127. confirm-type="send" />
  128. <view class="send-btn" bind:tap="send">发送</view>
  129. </view>
  130. <t-popup wx:if="{{subOptions.length}}" t-class="form-picker__inner" visible="{{true}}" bind:visible-change="onCancel" placement="bottom" close-on-overlay-click="{{false}}">
  131. <view class="form-picker__header">
  132. <view class="btn btn--cancel" aria-role="button" bind:tap="onCancel">取消</view>
  133. <view class="title">{{subTitle}}</view>
  134. <view wx:if="{{subMultiple}}" class="btn btn--confirm" aria-role="button" bind:tap="onConfirm">确定</view>
  135. </view>
  136. <view class="form-picker__content">
  137. <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(subOptions, itemHeight)}}px;" mark:type="sub" bind:tap="handleSub">
  138. <grid-builder list="{{_.options(subOptions)}}" cross-axis-count="3" cross-axis-gap="8" main-axis-gap="8" padding="{{[4,4,4,4]}}">
  139. <view slot:item slot:index class="card {{_.getClassName(item)}}" style="height: {{itemHeight}}px;" mark:item="{{item}}">
  140. <t-icon wx:if="{{item.checked}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
  141. <text overflow="ellipsis" max-lines="2">{{item.name}}{{_.subName(item)}}</text>
  142. </view>
  143. </grid-builder>
  144. </scroll-view>
  145. </view>
  146. </t-popup>