img_process_history.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="content">
  3. <view v-if="!img_process_history || Object.keys(img_process_history).length === 0" class="no_data"></view>
  4. <view v-else v-for="(value, key) in img_process_history" :key="key" class="img-history-item">
  5. <view @longpress="check_del_img_history(key)" @click="$util.navigateTo(`/pages/img_process/img_process?timestamp=${key}`)" class="flex justify-between">
  6. <view>
  7. <view class="flex justify-start margin-bottom-xs">
  8. <text class="title center">检测结果:</text>
  9. <text class="result center" v-for="(value, key) in value['disease']">{{value}}</text>
  10. </view>
  11. <view class="time align-center">{{value['time_string']}}</view>
  12. </view>
  13. <view @click.stop="openpopup(key)" class="center relationship">
  14. <text v-if="value['relationship']">{{family_list[value['relationship']]['name']}}</text>
  15. <text v-else style="text-decoration: underline; color: #666;">关联成员</text>
  16. </view>
  17. </view>
  18. </view>
  19. <uv-popup ref="popup" mode="right" bgColor="#f5f5f5" style="overflow-y: scroll;" >
  20. <scroll-view class="popup scroll-Y" scroll-y="true">
  21. <view v-if="!family_list" class="no-data center">暂无成员</view>
  22. <view v-else v-for="(value, key) in family_list" :key="key" class="family-item">
  23. <view @click="addrelationship(key)" class="flex justify-between">
  24. <view>
  25. <view class="flex justify-start margin-bottom-xs">
  26. <text class="name center">{{value['name']}}</text>
  27. <text v-if="value['relationship']" class="relationship center">{{value['relationship']}}</text>
  28. </view>
  29. <text class="gender">性别:{{ value['gender'] === 0 ? '男' : (value['gender'] === 1 ? '女' : '未知') }}</text>
  30. <text v-if="value['age']" class="age">年龄:{{value['age']}}岁</text>
  31. </view>
  32. <text class="cuIcon-right center"></text>
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </uv-popup>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. onShow() {
  42. let img_process_history = uni.getStorageSync('img_process_history');
  43. this.img_process_history = this.$util.reversedObject(img_process_history);
  44. this.family_list = uni.getStorageSync('family_list');
  45. },
  46. onPullDownRefresh() {
  47. let img_process_history = uni.getStorageSync('img_process_history');
  48. this.img_process_history = this.$util.reversedObject(img_process_history);
  49. this.family_list = uni.getStorageSync('family_list');
  50. },
  51. data() {
  52. return {
  53. img_process_history: null,
  54. family_list: null,
  55. selectitem: null,
  56. }
  57. },
  58. methods: {
  59. addrelationship(key){
  60. let img_process_history = uni.getStorageSync('img_process_history');
  61. img_process_history[this.selectitem]['relationship'] = key;
  62. uni.setStorageSync('img_process_history', img_process_history);
  63. this.img_process_history = this.$util.reversedObject(img_process_history);
  64. this.$refs.popup.close();
  65. },
  66. openpopup(selectitem){
  67. this.selectitem = selectitem;
  68. this.$refs.popup.open();
  69. },
  70. check_del_img_history(key){
  71. uni.showModal({
  72. title: '删除记录',
  73. content: ' 是否要删除此记录?',
  74. success: (res) => {
  75. if (res.confirm) this.del_img_history(key);
  76. }
  77. })
  78. },
  79. del_img_history(key){
  80. let img_process_history = uni.getStorageSync('img_process_history');
  81. delete img_process_history[key];
  82. this.img_process_history = this.$util.reversedObject(img_process_history);
  83. uni.setStorageSync('img_process_history', img_process_history);
  84. this.$forceUpdate();
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="less" scoped>
  90. .popup{
  91. padding: 10px;
  92. width: 75vw;
  93. .family-item{
  94. background-color: #fff;
  95. border-radius: 20px;
  96. height: 80px;
  97. margin-bottom: 10px;
  98. padding: 10px 18px;
  99. color: #666;
  100. letter-spacing: 1px;
  101. .name{
  102. letter-spacing: 2px;
  103. font-size: 20px;
  104. font-weight: 550;
  105. color: #555;
  106. }
  107. .gender{
  108. margin-right: 20px;
  109. }
  110. .relationship{
  111. color: #555;
  112. font-size: 16px;
  113. height: 24px;
  114. width: 60px;
  115. border-radius: 10px;
  116. letter-spacing: 0px;
  117. margin-left: 20px;
  118. background-color: #ebf6ff;
  119. }
  120. }
  121. }
  122. .no-data{
  123. height: 30vw;
  124. font-size: 24px;
  125. color: #777;
  126. padding: 10px;
  127. background-color: #fff;
  128. border-radius: 20px;
  129. }
  130. .content{
  131. padding: 10px 20px;
  132. border: none;
  133. background-color: #f6f6f6;
  134. height: 100vh;
  135. }
  136. .scroll-Y {
  137. /* #ifndef MP */
  138. height: calc(100vh - 155px);
  139. /* #endif */
  140. /* #ifdef MP */
  141. height: calc(100vh - 65px);
  142. /* #endif */
  143. }
  144. .relationship{
  145. z-index: 100;
  146. color: #666;
  147. font-size: 16px;
  148. margin: 5px 0;
  149. width: 85px;
  150. border-radius: 10px;
  151. letter-spacing: 0px;
  152. background-color: #ebf6ff;
  153. }
  154. .img-history-item{
  155. background-color: #fff;
  156. border-radius: 20px;
  157. height: 80px;
  158. margin-bottom: 20px;
  159. padding: 15px;
  160. color: #666;
  161. letter-spacing: 1px;
  162. .title{
  163. letter-spacing: 2px;
  164. font-size: 18px;
  165. font-weight: 550;
  166. color: #555;
  167. }
  168. .result{
  169. font-size: 17px;
  170. font-weight: 550;
  171. color: #f56c6c;
  172. margin-right: 10px;
  173. }
  174. .time{
  175. margin-top: 8px;
  176. }
  177. }
  178. </style>