idea.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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="../../static/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="3"></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. onShow() {
  49. uni.hideTabBar();
  50. },
  51. methods: {
  52. showDetail(item){
  53. uni.navigateTo({
  54. url: './docDetail?docId='+item.docId
  55. })
  56. },
  57. editDoc(item){
  58. uni.navigateTo({
  59. url: './addDoc?type=edit&docId='+item.docId
  60. })
  61. },
  62. delDoc(item){
  63. uni.showModal({
  64. title:"提示",
  65. content:"确认删除吗?",
  66. showCancel:true,
  67. cancelText:'取消',
  68. confirmText:'确定',
  69. success:res=>{
  70. if(res.confirm){
  71. // 用户点击确定
  72. var data={docId:item.docId}
  73. delDoc(data).then(
  74. res => {
  75. if(res.code==200){
  76. uni.showToast({
  77. icon:'success',
  78. title: "操作成功",
  79. });
  80. this.getMyDocList()
  81. }else{
  82. uni.showToast({
  83. icon:'none',
  84. title: "请求失败",
  85. });
  86. }
  87. },
  88. rej => {}
  89. );
  90. }else{
  91. // 否则点击了取消
  92. }
  93. }
  94. })
  95. },
  96. getMyDocList(){
  97. uni.showLoading({
  98. title:"正在加载中"
  99. })
  100. getMyDocList().then(
  101. res => {
  102. uni.hideLoading()
  103. if(res.code==200){
  104. this.docs=res.data;
  105. }else{
  106. uni.showToast({
  107. icon:'none',
  108. title: "请求失败",
  109. });
  110. }
  111. },
  112. rej => {}
  113. );
  114. },
  115. addDoc() {
  116. uni.navigateTo({
  117. url: './addDoc?type=add'
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. page{
  125. height: 100%;
  126. }
  127. .content{
  128. height: 100%;
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: space-between;
  132. .inner{
  133. flex: 1;
  134. padding: 20upx 20upx 160upx;
  135. .item{
  136. background: #FFFFFF;
  137. border-radius: 20upx;
  138. margin-bottom: 20upx;
  139. padding: 40upx 30upx;
  140. &:last-child{
  141. margin-bottom: 0;
  142. }
  143. .user-info{
  144. display: flex;
  145. align-items: center;
  146. .name{
  147. font-size: 36upx;
  148. font-family: PingFang SC;
  149. font-weight: bold;
  150. color: #111111;
  151. line-height: 1;
  152. margin-right: 20upx;
  153. }
  154. .gray-tag{
  155. height: 46upx;
  156. line-height: 46upx;
  157. padding: 0 16upx;
  158. font-size: 24upx;
  159. font-family: PingFang SC;
  160. font-weight: 500;
  161. color: #333333;
  162. background: #F7F7F7;
  163. border-radius: 8upx;
  164. margin-right: 10upx;
  165. }
  166. .blue-tag{
  167. height: 46upx;
  168. line-height: 46upx;
  169. padding: 0 16upx;
  170. font-size: 24upx;
  171. font-family: PingFang SC;
  172. font-weight: bold;
  173. color: #4BC9B1;
  174. background: #E2F6F2;
  175. border-radius: 8upx;
  176. }
  177. }
  178. .stage-box{
  179. white-space: nowrap;
  180. overflow: hidden;
  181. text-overflow: ellipsis;
  182. margin-top: 34upx;
  183. .stage{
  184. font-size: 26upx;
  185. font-family: PingFang SC;
  186. font-weight: 500;
  187. color: #111111;
  188. line-height: 1;
  189. }
  190. .stage-text{
  191. font-size: 26upx;
  192. font-family: PingFang SC;
  193. font-weight: 500;
  194. color: #666666;
  195. line-height: 1;
  196. }
  197. }
  198. .progress-box{
  199. margin-top: 18upx;
  200. }
  201. .period{
  202. font-size: 28upx;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. color: #999999;
  206. line-height: 1;
  207. margin-top: 40upx;
  208. }
  209. }
  210. }
  211. .btn-box{
  212. z-index: 9999;
  213. width: 100%;
  214. padding: 30upx;
  215. position: fixed;
  216. bottom: 120rpx;
  217. left: 0;
  218. box-sizing: border-box;
  219. background: #FFFFFF;
  220. .sub-btn{
  221. width: 100%;
  222. height: 88upx;
  223. line-height: 88upx;
  224. text-align: center;
  225. font-size: 30upx;
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. color: #FFFFFF;
  229. background: #018C39;
  230. border-radius: 44upx;
  231. }
  232. }
  233. }
  234. </style>