message-again.wxml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. <view class="not-change">无变化</view>
  50. </view>
  51. <view wx:if="{{multiple}}" class="item" bind:tap="onSubmit">
  52. <view class="sub-btn">选好了</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="chat-card right" wx:if="{{result}}">
  58. <view class="chat-card__avatar ">
  59. <user-avatar></user-avatar>
  60. </view>
  61. <view class="chat-card__content">
  62. <t-cell title="{{result}}" bordered="{{false}}"></t-cell>
  63. </view>
  64. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  65. </view>
  66. <view class="chat-card left" wx:if="{{result}}">
  67. <view class="chat-card__avatar ">
  68. <image src="../../assets/robot.png" mode="aspectFill" />
  69. </view>
  70. <view class="chat-card__content">
  71. <t-cell t-class="cell-border-gradient" title="请问有没有出现新的症状?"></t-cell>
  72. <t-radio-group t-class="horizontal-box" value="{{value1}}" bind:change="onChangeValue" disabled="{{btnDisabled}}">
  73. <view wx:for="{{radioList}}" wx:key="index" class="radio-card {{value1 == index ? 'card-active' : ''}}">
  74. <t-icon wx:if="{{value1 == index}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
  75. <t-radio value="{{index}}" label="{{item.label}}" icon="none" borderless />
  76. </view>
  77. </t-radio-group>
  78. </view>
  79. </view>
  80. <view class="chat-card right" wx:if="{{symptomResult}}">
  81. <view class="chat-card__avatar ">
  82. <user-avatar></user-avatar>
  83. </view>
  84. <view class="chat-card__content">
  85. <t-cell title="{{symptomResult}}" bordered="{{false}}"></t-cell>
  86. </view>
  87. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  88. </view>
  89. <view class="chat-card left" wx:if="{{symptomResult==='有'}}">
  90. <view class="chat-card__avatar ">
  91. <image src="../../assets/robot.png" mode="aspectFill" />
  92. </view>
  93. <view class="chat-card__content">
  94. <t-cell t-class="cell-border-gradient" title="请描述新的症状?"></t-cell>
  95. </view>
  96. </view>
  97. <view class="chat-card right" wx:if="{{messages[0].content && symptomResult==='有'}}">
  98. <view class="chat-card__avatar ">
  99. <user-avatar></user-avatar>
  100. </view>
  101. <view class="chat-card__content">
  102. <t-cell title="{{messages[0].content}}" bordered="{{false}}"></t-cell>
  103. </view>
  104. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  105. </view>
  106. <view class="chat-card left" wx:if="{{messages.length>0 || symptomResult==='没有' }}">
  107. <view class="chat-card__avatar ">
  108. <image src="../../assets/robot.png" mode="aspectFill" />
  109. </view>
  110. <view class="chat-card__content">
  111. <t-cell t-class="cell-border-gradient" title="请问还有其他要补充的吗?"></t-cell>
  112. </view>
  113. </view>
  114. <view class="chat-card right" wx:if="{{symptomResult==='有'?messages[1].content:false || symptomResult==='没有'?messages[0].content:false}}">
  115. <view class="chat-card__avatar ">
  116. <user-avatar></user-avatar>
  117. </view>
  118. <view class="chat-card__content">
  119. <t-cell title="{{symptomResult==='有'?messages[1].content:messages[0].content}}" bordered="{{false}}"></t-cell>
  120. </view>
  121. <t-loading wx:if="{{active}}" t-class="loading" theme="spinner" size="40rpx" class="wrapper" />
  122. </view>
  123. <view class="input-panel" style="bottom:{{inputBoxBottom}}px;" wx:if="{{showrePlenish}}" >
  124. <input bind:input="handleInput" value="{{inputText}}" adjust-position="{{false}}" placeholder="请输入" bind:focus="onInputFocus" bind:blur="onInputBlur"
  125. confirm-type="send" />
  126. <view class="send-btn" bind:tap="send">发送</view>
  127. </view>
  128. <t-popup wx:if="{{subOptions.length}}" t-class="form-picker__inner" visible="{{true}}" bind:visible-change="onCancel" placement="bottom" close-on-overlay-click="{{false}}">
  129. <view class="form-picker__header">
  130. <view class="btn btn--cancel" aria-role="button" bind:tap="onCancel">取消</view>
  131. <view class="title">{{subTitle}}</view>
  132. <view wx:if="{{subMultiple}}" class="btn btn--confirm" aria-role="button" bind:tap="onConfirm">确定</view>
  133. </view>
  134. <view class="form-picker__content">
  135. <scroll-view class="options-wrapper" type="custom" scroll-y style="height: {{_.maxHeight(subOptions, itemHeight)}}px;" mark:type="sub" bind:tap="handleSub">
  136. <grid-builder list="{{_.options(subOptions)}}" cross-axis-count="3" cross-axis-gap="8" main-axis-gap="8" padding="{{[4,4,4,4]}}">
  137. <view slot:item slot:index class="card {{_.getClassName(item)}}" style="height: {{itemHeight}}px;" mark:item="{{item}}">
  138. <t-icon wx:if="{{item.checked}}" name="check" t-class="card__icon" ariaHidden="{{true}}" />
  139. <text overflow="ellipsis" max-lines="2">{{item.name}}{{_.subName(item)}}</text>
  140. </view>
  141. </grid-builder>
  142. </scroll-view>
  143. </view>
  144. </t-popup>