menzhen.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template style="background-color: #b8b8b8;">
  2. <view style="width: 100%;height: 100%;">
  3. <view class="topmenu">
  4. <u-dropdown>
  5. <u-dropdown-item v-model="value1" :title="options1[value1].label" :options="options1" @change="close1"></u-dropdown-item>
  6. <u-dropdown-item v-model="value2" :title="options2[value2].label" :options="options2" @change="close2"></u-dropdown-item>
  7. </u-dropdown>
  8. </view>
  9. <!-- 上面的下拉菜单中 -->
  10. <!-- value2状态 0为处理中 1为历史记录-->
  11. <view v-for="item,index in list" :key='index' :data-index="index" @click="xiangqing">
  12. <view class="list_view">
  13. <!-- 状态 0待履行 1已完成 -->
  14. <view class="flex align-center" style="margin-bottom: 30rpx;">
  15. <view style="width: 70%;" v-if="item.zt == 1" class="flex align-center">
  16. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  17. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">未支付</view>
  18. </view>
  19. <view style="width: 70%;" v-if="item.zt == 2" class="flex align-center">
  20. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  21. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">待接单</view>
  22. </view>
  23. <view style="width: 70%;" v-if="item.zt == 3" class="flex align-center">
  24. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  25. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">进行中</view>
  26. </view>
  27. <view style="width: 70%;" v-if="item.zt == 4" class="flex align-center">
  28. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  29. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已完成</view>
  30. </view>
  31. <view style="width: 70%;" v-if="item.zt == 5" class="flex align-center">
  32. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  33. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已取消</view>
  34. </view>
  35. <view style="width: 70%;" v-if="item.zt == 6" class="flex align-center">
  36. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  37. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已超时</view>
  38. </view>
  39. <view style="width: 70%;" v-if="item.zt == 7" class="flex align-center">
  40. <view style="width: 12rpx;height: 12rpx;border-radius: 50rpx;background-color: #ff9294;margin-right: 20rpx;"></view>
  41. <view style="color: #ff9294;font-size: 30rpx;font-weight:bold ;">已预约</view>
  42. </view>
  43. <view style="width: 30%;" class="flex align-center">
  44. <view style="font-size: 28rpx;padding: 8rpx 24rpx;border-radius: 20rpx;background-color: #F6F6F6;">门诊预约</view>
  45. </view>
  46. </view>
  47. <!-- 线 -->
  48. <u-line color="#ebebeb" />
  49. <!-- 资料 -->
  50. <view class="">
  51. <view class="nr">
  52. <view class="left">患者:</view>
  53. <view class="right">{{item.name}}</view>
  54. </view>
  55. <view class="nr">
  56. <view class="left">年龄:</view>
  57. <view class="right">{{item.birthday}}</view>
  58. </view>
  59. <view class="nr">
  60. <view class="left">订单号:</view>
  61. <view class="right">{{item.order_sn}}</view>
  62. </view>
  63. <view class="nr">
  64. <view class="left">下单时间:</view>
  65. <view class="right">{{item.created_at}}</view>
  66. </view>
  67. <view class="nr">
  68. <view class="left">预约时间:</view>
  69. <view class="right">{{item.appoint_time}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view style="width: 100%;height: 100rpx;"></view>
  75. <u-empty text="暂无数据" mode="order" margin-top="250" v-if="list.length<=0"></u-empty>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. // onLoad(e) {
  81. // this.getLists(this.num,this.value1,this.value2)
  82. // },
  83. onShow(e){
  84. this.getLists(this.num,this.value1,this.value2)
  85. },
  86. data() {
  87. return {
  88. //暂无数据
  89. show:false,
  90. value1: 0,
  91. value2: 0,
  92. options1: [{
  93. label: '预约时间正序',
  94. value: 0,
  95. },
  96. {
  97. label: '预约时间倒序',
  98. value: 1,
  99. },
  100. {
  101. label: '下单时间正序',
  102. value: 2,
  103. },
  104. {
  105. label: '下单时间倒序',
  106. value: 3,
  107. }
  108. ],
  109. options2: [{
  110. label: '未完成',
  111. value: 0,
  112. },
  113. {
  114. label: '已完成',
  115. value: 1,
  116. },
  117. ],
  118. list: [],
  119. num:1
  120. }
  121. },
  122. methods: {
  123. getLists: async function(curPage,timeSort,comStatus) {
  124. //备注:curPage当前页,pageSize一页显示多少条,appointment 固定值为1
  125. // timeSort:排序条件(不填写为默认排序,0=预约时间正序,1=预约时间倒叙,2=下单时间正序,3=下单时间倒叙),comStatus完成状态(不填写为全部类型,0=已完成,1=未完成)
  126. // 根据备注去操作接口
  127. let res = await this.$request.post('patient/orderPatientList', {
  128. 'curPage': curPage,
  129. 'pageSize': 5,
  130. 'appointment':1,
  131. 'timeSort':timeSort,
  132. 'comStatus':comStatus
  133. })
  134. // 如果要加载第二页
  135. if(curPage!=1){
  136. console.log('页数curPage',curPage)
  137. console.log('类型typeAll',timeSort)
  138. console.log('状态processing',comStatus)
  139. let data = res.data;
  140. this.list= this.list.concat(data)
  141. // Array.prototype.push.apply(this.list, data);
  142. console.log('list',this.list)
  143. }else{
  144. console.log('c',curPage)
  145. console.log('t',timeSort)
  146. console.log('p',comStatus)
  147. let data = res.data;
  148. this.list = data
  149. console.log(this.list)
  150. }
  151. },
  152. close1(e) {
  153. this.value1 = e
  154. //重新选择就清空
  155. this.list = []
  156. this.num= 1
  157. //调用接口 页数 类型 状态
  158. this.getLists(this.num,this.value1,this.value2)
  159. },
  160. close2(e) {
  161. this.value2 = e
  162. //重新选择就清空
  163. this.list = []
  164. this.num= 1
  165. //调用接口 页数 类型 状态
  166. this.getLists(this.num,this.value1,this.value2)
  167. },
  168. // 详情
  169. xiangqing(e) {
  170. console.log(this.list[e.currentTarget.dataset.index])
  171. uni.navigateTo({
  172. url: 'menzhenxq?data=' + this.list[e.currentTarget.dataset.index].id
  173. })
  174. }
  175. },
  176. //页面到底监听
  177. onReachBottom() {
  178. this.num++
  179. console.log('到底', this.num);
  180. setTimeout(function() {
  181. uni.stopPullDownRefresh();
  182. }, 1000);
  183. this.getLists(this.num,this.value1,this.value2)
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .topmenu {
  189. // position: fixed;
  190. // top: 0;
  191. // left: 0;
  192. width: 100%;
  193. height: 100rpx;
  194. background-color: #FFFFFF;
  195. z-index: 1;
  196. }
  197. .list_view {
  198. margin: 20rpx 28rpx 10rpx 28rpx;
  199. background-color: #FFFFFF;
  200. border-radius: 12rpx;
  201. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  202. padding: 28rpx;
  203. }
  204. .nr {
  205. margin: 28rpx 0;
  206. display: flex;
  207. .left {
  208. width: 25%;
  209. color: #666666;
  210. }
  211. .right {
  212. width: 75%;
  213. font-weight: 400;
  214. }
  215. }
  216. </style>