healthFoodDetail.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>饮食详情</title>
  7. <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  9. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  10. <link rel="stylesheet" href="../../../plugins/toastr/toastr.min.css" />
  11. <link rel="stylesheet" href="../../../plugins/element-ui/element-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/date.css" />
  13. <link rel="stylesheet" href="../css/common.css" />
  14. <style>
  15. #app {
  16. padding: 8px 16px;
  17. font-size: 14px;
  18. }
  19. .food-info {
  20. font-size: 16px;
  21. padding-bottom: 12px;
  22. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  23. }
  24. .food-info img{
  25. max-width: 280px;
  26. }
  27. .tip {
  28. color: #11b7f5;
  29. padding: 12px 0;
  30. }
  31. .flex {
  32. display: flex;
  33. align-items: center;
  34. }
  35. .food-item {
  36. margin-bottom: 20px;
  37. }
  38. .food-item img{
  39. width: 100px;
  40. }
  41. .pl8 {
  42. padding-left: 8px;
  43. }
  44. .food-component {
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  49. padding: 8px 0;
  50. margin-left: 20px;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <div id="app" v-cloak>
  56. <div class="food-info">
  57. <div class="lheight2">{{dietDetail.time}}</div>
  58. <div class="lheight2" style="margin-bottom: 8px">{{dietDetail.content}}</div>
  59. <img :src="dietDetail.images" alt="" />
  60. </div>
  61. <div class="tip">以下食物热量和营养价值仅供参考</div>
  62. <div class="food-list">
  63. <div class="food-item" v-for="(item,i) in foodList" :key="i">
  64. <div class="flex">
  65. <img :src="item.photo" alt="" />
  66. <div class="pl8">
  67. <div>
  68. {{item.name}}
  69. <span class="pl8">{{item.weight}}</span>
  70. </div>
  71. <div>{{item.hot}} 千卡热量</div>
  72. </div>
  73. </div>
  74. <div class="food-component" v-for="(val,key) in item.component">
  75. <div>{{key}}</div>
  76. <div>{{val}} 克</div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <script type="text/javascript" src="../../../js/vue.js"></script>
  82. <script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
  83. <script type="text/javascript" src="../../../js/es6-promise.js" charset="utf-8"></script>
  84. <script type="text/javascript" src="../../../plugins/toastr/toastr.min.js"></script>
  85. <script type="text/javascript" src="../../../plugins/element-ui/element-ui.js"></script>
  86. <script type="text/javascript" src="../../../api/http-request.js"></script>
  87. <script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
  88. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  89. <script type="text/javascript" src="../../../api/recover_api.js"></script>
  90. <script type="text/javascript" src="../../../js/underscore-1.9.1.js"></script>
  91. <script type="text/javascript" src="../../../js/util.js" charset="utf-8"></script>
  92. <script>
  93. new Vue({
  94. el: '#app',
  95. data() {
  96. return {
  97. id: '',
  98. dietDetail:{},
  99. foodList: []
  100. }
  101. },
  102. methods: {
  103. getFoodDetail() {
  104. const vm = this
  105. httpRequest.get('doctor/health_record/dietDetail', { data: { id: this.id } }).then(function (res) {
  106. vm.dietDetail = res.data.dietDetail
  107. vm.dietDetail.time = vm.dietDetail.recordDate.substring(0,10)
  108. vm.foodList = (res.data.foodCompList??[]).map(function(item){
  109. return {
  110. ...item,
  111. component: JSON.parse(item.component)
  112. }
  113. })
  114. })
  115. }
  116. },
  117. mounted() {
  118. this.id = GetRequest().id
  119. this.getFoodDetail()
  120. }
  121. })
  122. </script>
  123. </body>
  124. </html>