DetailBox.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="detailBox-wrap" ref="detailBox">
  3. <div class="head">
  4. <span class="icon" @click="close">
  5. <img src="../images/small-close.png">
  6. </span>
  7. <span class="name">{{privateData.name+'详情'}}</span>
  8. <span @click="handleClear">清空</span>
  9. <i>{{tips}}</i>
  10. </div>
  11. <div class="main">
  12. <Detail :datas="privateData"
  13. ref="detail"
  14. :type="moduleType"
  15. :ppId="ppId"/>
  16. </div>
  17. <div class="foot" @click="complete">完成</div>
  18. <Toast :message="clearTxt"
  19. :show="showToast"
  20. @comfirn="comfirnDel"
  21. @cancel="cancelDel"/>
  22. </div>
  23. </template>
  24. <script type="text/javascript">
  25. import Detail from './Detail.vue';
  26. import Toast from '../common/Toast.vue';
  27. export default {
  28. name:'DetailBox', //点开详情的盒子
  29. data(){
  30. return{
  31. msg:"胸痛详情",
  32. privateData:{},
  33. compFlag:false,
  34. clearTxt:"是否清空当前已选内容?",
  35. showToast:false,
  36. tips:"(请完成病情预问诊可让医生提前了解病情)"
  37. }
  38. },
  39. created(){
  40. this.privateData = this.data;
  41. },
  42. mounted(){
  43. const box = this.$refs.detailBox;
  44. const height = document.documentElement.clientHeight;
  45. box.style.height = height - 45 + 'px';
  46. },
  47. methods:{
  48. close(){
  49. this.$emit("close");
  50. },
  51. complete(){
  52. this.$refs.detail.saveData();
  53. this.$emit("pComplete");
  54. },
  55. handleClear(){//清空
  56. this.showToast = true;
  57. },
  58. cancelDel(){
  59. this.showToast = false;
  60. },
  61. comfirnDel(){
  62. this.$refs.detail.clearData();
  63. this.showToast = false;
  64. // 让detail组件更新
  65. // this.privateData = JSON.parse(JSON.stringify(this.data));
  66. this.$emit('reload',this.data.id);
  67. }
  68. },
  69. props:['data','moduleType','ppId'],
  70. components:{
  71. Detail,
  72. Toast
  73. }
  74. }
  75. </script>
  76. <style lang="less" scoped>
  77. @import '../less/base.less';
  78. .detailBox-wrap{
  79. width: 100%;
  80. // overflow-y: auto;
  81. position: fixed;
  82. bottom: 0;
  83. left: 0;
  84. z-index: 666;
  85. background: #fff;
  86. border-radius: .08rem .08rem 0 0;
  87. font-size: .3rem;
  88. // animation: wave .4s ease-in;
  89. animation: wave .4s linear;
  90. .head{
  91. // height: .88rem;
  92. height: 1rem; //增加了提示
  93. line-height: .88rem;
  94. display: flex;
  95. justify-content: space-between;
  96. border-bottom: 1px solid #E6E7EF;
  97. padding: 0 .4rem 0 .32rem;
  98. font-size: .28rem;
  99. color: #7C828E;
  100. i{
  101. position: absolute;
  102. top:0.35rem;
  103. left:0;
  104. font-size: .22rem;
  105. width:100%;
  106. display: inline-block;
  107. text-align: center;
  108. }
  109. .icon{
  110. display: inline-block;
  111. height: 100%;
  112. padding: 0 .1rem;
  113. img{
  114. width:.34rem;
  115. vertical-align: middle;
  116. }
  117. }
  118. .name{
  119. font-size: .32rem;
  120. color: #1A1A1A;
  121. }
  122. }
  123. .main{
  124. height: 100%;
  125. width:100%;
  126. overflow-y: auto;
  127. }
  128. .foot{
  129. .footer;
  130. animation-delay:.6s;
  131. animation: foo .4s linear;
  132. /* width:100%;
  133. height: .88rem;
  134. line-height: .88rem;
  135. text-align: center;
  136. color:#fff;
  137. font-size: .32rem;
  138. background: linear-gradient(-270deg, #4F4FFF,#4F8BFF); */
  139. }
  140. }
  141. @keyframes wave {
  142. 0% {top:100% ;}
  143. 25% {top: 75%;}
  144. 50% {top: 50%;}
  145. 75% {top: 25%;}
  146. 100% {top: 45px;}
  147. }
  148. @keyframes foo {
  149. 0% {bottom:-1rem;}
  150. 100% {bottom:0;}
  151. }
  152. </style>