idea.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="content">
  3. <view style="padding-top:100rpx;font-size: 40rpx;font-weight: bold; margin-bottom: 20rpx;margin-left: 40rpx;">健康档案</view>
  4. <view class="inner">
  5. <view v-for="(item,index) in docs" :key="index" class="item" @click="showDetail(item)">
  6. <view class="user-info">
  7. <view class="name">{{item.userName}}</view>
  8. <text class="gray-tag" v-if="item.sex==1">男</text>
  9. <text class="gray-tag" v-if="item.sex==2">女</text>
  10. <view class="gray-tag">{{utils.getAge(item.birthday)}}岁</view>
  11. <view class="blue-tag">标签</view>
  12. </view>
  13. <!-- <view class="stage-box">
  14. <text class="stage">阶段1:</text>
  15. <text class="stage-text">药物治疗胰岛素降糖,洛氟沙星抗感染治疗中治疗中治疗中治疗中</text>
  16. </view>
  17. <view class="progress-box">
  18. <progress :percent="80" activeColor="#4BC9B1" border-radius="5" stroke-width="5" />
  19. </view> -->
  20. <view class="period">建档时间 {{item.createTime}}</view>
  21. <view class="period">备注 {{item.remark!=null?item.remark:''}}</view>
  22. </view>
  23. <view v-if="docs.length == 0" class="no-data-box" @click="getMyDocList()">
  24. <image src="https://zkzh-2025.oss-cn-beijing.aliyuncs.com/shop/images/no_data.png" mode="aspectFit"></image>
  25. <view class="empty-title">暂无数据</view>
  26. </view>
  27. </view>
  28. <view class="btn-box">
  29. <view class="sub-btn" @click="addDoc">创建健康档案</view>
  30. </view>
  31. <!-- <tabbar actindex="2"></tabbar> -->
  32. </view>
  33. </template>
  34. <script>
  35. import {getMyDocList,delDoc} from '@/api/doc.js'
  36. export default {
  37. data() {
  38. return {
  39. docs:[],
  40. }
  41. },
  42. onLoad() {
  43. this.getMyDocList()
  44. uni.$on('refreshDoc', () => {
  45. this.getMyDocList()
  46. })
  47. },
  48. methods: {
  49. showDetail(item){
  50. uni.navigateTo({
  51. url: './docDetail?docId='+item.docId
  52. })
  53. },
  54. editDoc(item){
  55. uni.navigateTo({
  56. url: './addDoc?type=edit&docId='+item.docId
  57. })
  58. },
  59. delDoc(item){
  60. uni.showModal({
  61. title:"提示",
  62. content:"确认删除吗?",
  63. showCancel:true,
  64. cancelText:'取消',
  65. confirmText:'确定',
  66. success:res=>{
  67. if(res.confirm){
  68. // 用户点击确定
  69. var data={docId:item.docId}
  70. delDoc(data).then(
  71. res => {
  72. if(res.code==200){
  73. uni.showToast({
  74. icon:'success',
  75. title: "操作成功",
  76. });
  77. this.getMyDocList()
  78. }else{
  79. uni.showToast({
  80. icon:'none',
  81. title: "请求失败",
  82. });
  83. }
  84. },
  85. rej => {}
  86. );
  87. }else{
  88. // 否则点击了取消
  89. }
  90. }
  91. })
  92. },
  93. getMyDocList(){
  94. uni.showLoading({
  95. title:"正在加载中"
  96. })
  97. getMyDocList().then(
  98. res => {
  99. uni.hideLoading()
  100. if(res.code==200){
  101. this.docs=res.data;
  102. }else{
  103. uni.showToast({
  104. icon:'none',
  105. title: "请求失败",
  106. });
  107. }
  108. },
  109. rej => {}
  110. );
  111. },
  112. addDoc() {
  113. uni.navigateTo({
  114. url: './addDoc?type=add'
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. page{
  122. height: 100%;
  123. }
  124. .content{
  125. height: 100%;
  126. display: flex;
  127. flex-direction: column;
  128. justify-content: space-between;
  129. .inner{
  130. flex: 1;
  131. padding: 20upx 20upx 160upx;
  132. .item{
  133. background: #FFFFFF;
  134. border-radius: 20upx;
  135. margin-bottom: 20upx;
  136. padding: 40upx 30upx;
  137. &:last-child{
  138. margin-bottom: 0;
  139. }
  140. .user-info{
  141. display: flex;
  142. align-items: center;
  143. .name{
  144. font-size: 36upx;
  145. font-family: PingFang SC;
  146. font-weight: bold;
  147. color: #111111;
  148. line-height: 1;
  149. margin-right: 20upx;
  150. }
  151. .gray-tag{
  152. height: 46upx;
  153. line-height: 46upx;
  154. padding: 0 16upx;
  155. font-size: 24upx;
  156. font-family: PingFang SC;
  157. font-weight: 500;
  158. color: #333333;
  159. background: #F7F7F7;
  160. border-radius: 8upx;
  161. margin-right: 10upx;
  162. }
  163. .blue-tag{
  164. height: 46upx;
  165. line-height: 46upx;
  166. padding: 0 16upx;
  167. font-size: 24upx;
  168. font-family: PingFang SC;
  169. font-weight: bold;
  170. color: #4BC9B1;
  171. background: #E2F6F2;
  172. border-radius: 8upx;
  173. }
  174. }
  175. .stage-box{
  176. white-space: nowrap;
  177. overflow: hidden;
  178. text-overflow: ellipsis;
  179. margin-top: 34upx;
  180. .stage{
  181. font-size: 26upx;
  182. font-family: PingFang SC;
  183. font-weight: 500;
  184. color: #111111;
  185. line-height: 1;
  186. }
  187. .stage-text{
  188. font-size: 26upx;
  189. font-family: PingFang SC;
  190. font-weight: 500;
  191. color: #666666;
  192. line-height: 1;
  193. }
  194. }
  195. .progress-box{
  196. margin-top: 18upx;
  197. }
  198. .period{
  199. font-size: 28upx;
  200. font-family: PingFang SC;
  201. font-weight: 500;
  202. color: #999999;
  203. line-height: 1;
  204. margin-top: 40upx;
  205. }
  206. }
  207. }
  208. .btn-box{
  209. z-index: 9999;
  210. width: 100%;
  211. padding: 30upx;
  212. position: fixed;
  213. bottom: 120rpx;
  214. left: 0;
  215. box-sizing: border-box;
  216. background: #FFFFFF;
  217. .sub-btn{
  218. width: 100%;
  219. height: 88upx;
  220. line-height: 88upx;
  221. text-align: center;
  222. font-size: 30upx;
  223. font-family: PingFang SC;
  224. font-weight: bold;
  225. color: #FFFFFF;
  226. background: #2BC7B9;
  227. border-radius: 44upx;
  228. }
  229. }
  230. }
  231. </style>