opinion.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template style="background-color: #b1b1b1;">
  2. <view style="width: 100%;height: 100%;">
  3. <view class="topbut">
  4. <!-- 正序 -->
  5. <view v-if="sort" @click="timeSort">
  6. <text style="margin-right: 20rpx;">时间正序</text>
  7. <u-icon name="arrow-down"></u-icon>
  8. </view>
  9. <!-- 倒序 -->
  10. <view v-else @click="timeSort">
  11. <text style="margin-right: 20rpx;">时间倒序</text>
  12. <u-icon name="arrow-up"></u-icon>
  13. </view>
  14. </view>
  15. <view style="width: 100%;height: 100rpx;"></view>
  16. <!-- 卡片 -->
  17. <view class="list_view" v-for="item,index in list" :key='index' @click="next" :data-index="index">
  18. <!-- 左边内容 -->
  19. <view style="width: 80%;">
  20. <!-- 名字 -->
  21. <view style="margin-bottom: 20rpx;">
  22. <text style="width: 130rpx;color: #666666;display: inline-block;">患者:</text>
  23. <text>{{item.patient_name}}</text>
  24. </view>
  25. <!-- 年龄 -->
  26. <view style="margin-bottom: 20rpx;">
  27. <text style="width: 130rpx;color: #666666;display: inline-block;">年龄:</text>
  28. <text>{{item.numBirthday}}</text>
  29. </view>
  30. <!-- 订单号 -->
  31. <view style="margin-bottom: 20rpx;">
  32. <text style="width: 130rpx;color: #666666;display: inline-block;">订单号:</text>
  33. <text>{{item.order_sn}}</text>
  34. </view>
  35. <!-- 填写时间 -->
  36. <view style="margin-bottom: 20rpx;">
  37. <text style="width: 130rpx;color: #666666;display: inline-block;">填写时间:</text>
  38. <text>{{item.created_at}}</text>
  39. </view>
  40. </view>
  41. <!-- 右边按钮 -->
  42. <view style="width: 20%;" class="flex justify-center">
  43. <view style="padding: 8rpx 16rpx;border-radius: 20rpx;background-color:#eaeaea ;height: 50rpx;color: b1b1b1;" class="flex justify-center align-center">意见单</view>
  44. </view>
  45. </view>
  46. <u-empty text="暂无数据" :show="list.length==0" mode="order" margin-top="250" v-if="list.length==0"></u-empty>
  47. <view style="width: 100%;height: 100rpx;"></view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. onLoad(options) {
  53. },
  54. mounted() {
  55. },
  56. data() {
  57. return {
  58. //排序
  59. sort: true,
  60. //列表
  61. list: [],
  62. num:1
  63. }
  64. },
  65. onLoad() {
  66. this.getList();
  67. },
  68. methods: {
  69. timeSort(e){
  70. this.sort = !this.sort
  71. this.list = []
  72. this.$nextTick(function(){
  73. //调用接口 页数 类型 状态
  74. if(this.sort){//正序
  75. this.getList(1)
  76. }else{//倒序
  77. this.getList(2)
  78. }
  79. })
  80. },
  81. next(e){
  82. console.log()
  83. uni.navigateTo({
  84. url:'opiniondetails?id='+this.list[e.currentTarget.dataset.index].id+'&type=1'
  85. })
  86. },
  87. /**
  88. * 渲染患者列表
  89. */
  90. getList:async function(orderby=0){
  91. let obj = {"curPage":1,'pageSize':10,'orders':orderby};
  92. let that = this;
  93. console.log("obj",obj)
  94. let res = await that.$request.post('suggest/suggestList',obj);
  95. console.log("res",res)
  96. if(res.status==0 && res.data!=''){
  97. let data = res.data;
  98. console.log('我是data',data);
  99. that.list=data;
  100. }else{
  101. uni.showToast({
  102. icon:'none',
  103. title:'请求失败 请稍后重试'
  104. })
  105. }
  106. },
  107. },
  108. onReachBottom() {
  109. this.num++
  110. console.log('到底', this.num);//到底次数
  111. setTimeout(function() {
  112. uni.stopPullDownRefresh();
  113. }, 1000);
  114. }
  115. };
  116. </script>
  117. <style lang="scss">
  118. .topbut {
  119. position: fixed;
  120. top: 0;
  121. left: 0;
  122. width: 100%;
  123. height: 100rpx;
  124. display: flex;
  125. align-items: center;
  126. padding-left: 20rpx;
  127. // justify-content: center;
  128. background-color: #FFFFFF;
  129. z-index: 1;
  130. }
  131. //每张卡片的样式
  132. .list_view {
  133. margin: 20rpx 28rpx 0 28rpx;
  134. padding: 35rpx 40rpx;
  135. background-color: #FFFFFF;
  136. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  137. border-radius: 12px;
  138. display: flex;
  139. font-size: 26rpx;
  140. }
  141. </style>