UsualSymptom.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="usual-symptom">
  3. <p class="title-bar">
  4. <!--<a href="javascript:void(0)">--><img @click="back" src="../images/back.png" alt="返回"/><!--</a>-->
  5. <span>您哪里不舒服?</span>
  6. </p>
  7. <ul class="radio-item clearfix">
  8. <li
  9. v-for="(item,idx) in symptoms"
  10. :class="[{'liSelect':item.select,'big':item.explains}]"
  11. :key="idx"
  12. @click="selectResult(item,idx)"
  13. >
  14. {{item.description||item.name}}
  15. <img src="../images/icon_que.png" alt="解释说明" @click.stop="showExplain(item)" v-if="item.explains"/>
  16. </li>
  17. </ul>
  18. <div class="searchWrap" @click="search(true)">
  19. <img class="searchImg" src="../images/search.png" alt="">
  20. <span class="placeholder">找不到?也可点击搜索症状</span>
  21. </div>
  22. <Search
  23. v-if="this.$store.state.searchShow"
  24. @search="search"
  25. @showDetil="showDetil"
  26. ></Search>
  27. <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
  28. <!-- <ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox> -->
  29. </div>
  30. </template>
  31. <script>
  32. import Radio from './Radio';
  33. import Search from '../components/Search.vue';
  34. // import ConfirmBox from '../common/ConfirmBox'
  35. import Tiptoast from '../common/Tiptoast.vue';
  36. export default {
  37. name:'UsualSymptom',
  38. props:[],
  39. data(){
  40. const data = this.$store.state.usualSymptom;
  41. return {
  42. symptoms:this.formatData(data),
  43. portaled:false, //是否将radio渲染到最外层
  44. showConfirm:false,
  45. len:10, //显示常用症状个数
  46. showExp:false,
  47. message:{
  48. title:'',
  49. text:''
  50. },
  51. }
  52. },
  53. methods:{
  54. back(){
  55. this.$router.go(-1);
  56. },
  57. showExplain(it){
  58. if(it.explains){
  59. this.message.title = it.description || it.name;
  60. this.message.text = it.explains;
  61. }else{
  62. this.message.title = "";
  63. this.message.text = "暂无资料";
  64. }
  65. this.showExp = true
  66. },
  67. closeTip(){
  68. this.showExp = false;
  69. this.message.title = '';
  70. this.message.text = '';
  71. },
  72. formatData(data){
  73. data.length=data.length>10?10:data.length;
  74. return data.map((i)=>{
  75. return Object.assign({},i,{
  76. name:i.name,
  77. value:i.questionId,
  78. special:'',
  79. connectId:[]
  80. })
  81. });
  82. },
  83. selectResult(item,idx){
  84. this.$emit('selectUsual',item,idx);
  85. this.$store.commit('setSearchShow', false);
  86. this.$store.commit('setText', { type: 1, text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name),flag:true,arrFlag:true, pId: item.questionId,idx:1 });
  87. let obj = {
  88. "labelName": item.tagName||item.name,//标签名称
  89. "operationNum": 1,//次数
  90. "operationType": 1,//1常见2搜索
  91. }
  92. this.$store.commit('addBuriedSome', obj);
  93. },
  94. confirmDialog(){
  95. },
  96. cancelDialog(){
  97. },
  98. search(flag){
  99. this.$store.commit('setSearchShow', flag);
  100. },
  101. showDetil(item,flg) {//搜索点开的详情
  102. this.$emit('selectUsual',item,flg);
  103. this.$store.commit('setSearchShow', false);
  104. },
  105. },
  106. components:{
  107. Radio,
  108. // ConfirmBox,
  109. Search,
  110. Tiptoast
  111. }
  112. }
  113. </script>
  114. <style lang="less" scoped>
  115. @import "../less/base.less";
  116. .usual-symptom{
  117. position: fixed;
  118. bottom: 0;
  119. background: #fff;
  120. padding: .4rem .1rem;
  121. box-shadow: 0px 0px 10px -3px rgba(104, 124, 189, 0.08);
  122. }
  123. .title-bar{
  124. font-size: .28rem;
  125. margin:0 0 .5rem .2rem;
  126. img{
  127. width: .16rem;
  128. margin-right:.4rem;
  129. }
  130. }
  131. .radio-item{
  132. li {
  133. padding: 0.14rem 0.2rem;
  134. border:1px #DFE0E4 solid;
  135. border-radius: 0.36rem;
  136. font-size: 0.26rem;
  137. margin: 0.15rem 0.12rem 0.15rem 0.15rem;
  138. float: left;
  139. color: #666;
  140. position: relative;
  141. &.big{
  142. margin: 0.15rem .65rem .15rem .15rem;
  143. }
  144. img{
  145. width: .35rem;
  146. position: absolute;
  147. right: -0.55rem;
  148. }
  149. }
  150. .liSelect {
  151. color: #fff;
  152. background-color: #colors[btn];
  153. border-color: #colors[btn];
  154. }
  155. }
  156. .searchWrap {
  157. margin:1.2rem .2rem 0 .2rem;
  158. height: .68rem;
  159. line-height: .25rem;
  160. box-sizing: border-box;
  161. position: relative;
  162. background: #F5F5F5;
  163. border-radius: .32rem;
  164. padding-left:.7rem;
  165. color: #AAAAAA;
  166. .placeholder{
  167. font-size: .24rem;
  168. }
  169. .searchImg {
  170. width: 0.44rem;
  171. height: 0.44rem;
  172. position: absolute;
  173. left: .2rem;
  174. top: .1rem;
  175. }
  176. }
  177. </style>