my_appointment.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view class="main bg-white">
  3. <u-dropdown>
  4. <u-dropdown-item v-model="value1" :title="textcontent" @change="typechange" :options="options1"></u-dropdown-item>
  5. <u-dropdown-item v-model="value2" :title="options2[value2].label" @change="paychange" :options="options2"></u-dropdown-item>
  6. <u-dropdown-item v-model="value3" :title="options3[value3].label" @change="timechange" :options="options3"></u-dropdown-item>
  7. </u-dropdown>
  8. <view class="margin-lr-sm bg-white">
  9. <view class="margin-top-sm" v-for="(item,index) in ordersList" :key="index" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  10. <view class="flex justify-between align-center bg-white" style="padding: 28rpx;border-radius: 16rpx;">
  11. <view class="jinxing">
  12. <text style="display: inline-block;width: 12rpx;height: 12rpx;border-radius: 50%;background-color:#EEAA3F;margin-right: 8rpx;"></text>
  13. <text v-if="item.order_status==3">进行中</text>
  14. <text v-else-if="item.order_status==1">未支付</text>
  15. <text v-else-if="item.order_status==2">待接单</text>
  16. <text v-else-if="item.order_status==4">已完成</text>
  17. <text v-else>已取消</text>
  18. </view>
  19. <text class="phonezi" v-if="item.product_type==3">门诊预约</text>
  20. <text class="phonezi" v-else-if="item.product_type==4">计免预约</text>
  21. <text class="phonezi" v-else>儿保预约</text>
  22. </view>
  23. <view class="" style="background: #FBFBFB;padding: 28rpx; border-radius: 16rpx;">
  24. <view class="nametaile flex align-center">
  25. <u-avatar v-if="item.product_type==3" :src="item.docter.avatar" mode="circle"></u-avatar>
  26. <u-avatar v-else :src="item.organization.docter[0].avatar" mode="circle"></u-avatar>
  27. <text v-if="item.product_type==3" class="margin-left-sm">{{item.docter.name}}</text>
  28. <text v-else class="margin-left-sm">{{item.organization.docter[0].name}}</text>
  29. <text class="text_style" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</text>
  30. </view>
  31. <view class="textstyle margin-top-xs flex align-center justify-between">
  32. <text style="color: #333333;" v-if="item.product_type==3">科室:{{item.docter.office.name||'暂无'}}
  33. {{item.docter.qualification.name||'暂无'}}</text>
  34. </view>
  35. <view class="textstyle margin-top-xs flex align-center justify-between">
  36. <text style="color: #333333;">编号:{{item.order_sn}}</text>
  37. </view>
  38. <view class="textstyle margin-top-xs">
  39. <text style="color: #333333;">预约时间:{{format(item.order_patient.appoint_start_time*1000)+'至'+format(item.order_patient.appoint_end_time*1000)}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  45. <view class="cu-tabbar-height"></view>
  46. <view class="cu-tabbar-height"></view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. onLoad(options) {
  52. if (this.value1 == 0) {
  53. this.textcontent = "全部预约"
  54. }
  55. },
  56. mounted() {
  57. this.getordersList()
  58. console.log(this.value1)
  59. },
  60. data() {
  61. return {
  62. value1: 0, //全部类型
  63. value2: 0, //全部状态
  64. value3: 1, //时间正序
  65. options1: [{
  66. value: 0,
  67. label: "全部预约"
  68. },
  69. {
  70. value: 3,
  71. label: "门诊预约"
  72. },
  73. {
  74. value: 4,
  75. label: "计免预约"
  76. },
  77. {
  78. value: 5,
  79. label: "儿保预约"
  80. },
  81. ],
  82. options2: [{
  83. value: 0,
  84. label: "全部状态"
  85. },
  86. {
  87. value: 1,
  88. label: "未支付"
  89. },
  90. {
  91. value: 2,
  92. label: "待接单"
  93. },
  94. {
  95. value: 3,
  96. label: "进行中"
  97. },
  98. {
  99. value: 4,
  100. label: "已完成"
  101. },
  102. {
  103. value: 5,
  104. label: "已取消"
  105. },
  106. ],
  107. options3: [{
  108. value: 0,
  109. label: "时间正序"
  110. },
  111. {
  112. value: 1,
  113. label: "时间倒序"
  114. },
  115. ],
  116. ordersList: [],
  117. pageindex: 1,
  118. show: false,
  119. textcontent: ""
  120. }
  121. },
  122. onPullDownRefresh() {
  123. this.pageindex = 1
  124. this.ordersList = []
  125. this.getordersList()
  126. uni.stopPullDownRefresh()
  127. },
  128. methods: {
  129. format(t) {
  130. let time = new Date(t);
  131. let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1);
  132. str += '-';
  133. str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate();
  134. str += ' ';
  135. str += time.getHours();
  136. str += ':';
  137. str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes();
  138. return str;
  139. },
  140. typechange(value) {
  141. this.value1 = value
  142. if (value == 3) {
  143. this.textcontent = "门诊预约"
  144. } else if (value == 4) {
  145. this.textcontent = "计免预约"
  146. } else if (value == 5) {
  147. this.textcontent = "儿保预约"
  148. } else {
  149. this.textcontent = "全部预约"
  150. }
  151. this.pageindex = 1
  152. this.ordersList = []
  153. this.getordersList()
  154. },
  155. paychange(value) {
  156. this.value2 = value
  157. this.pageindex = 1
  158. this.ordersList = []
  159. this.getordersList()
  160. },
  161. timechange(value) {
  162. this.value3 = value
  163. this.pageindex = 1
  164. this.ordersList = []
  165. this.getordersList()
  166. },
  167. getordersList: async function() {
  168. let res = await this.$request.post("/api/v1/order/orderList", {
  169. page: this.pageindex,
  170. list_type: 2,
  171. product_type: this.value1,
  172. order_status: this.value2,
  173. time_sort: this.value3
  174. })
  175. console.log(this.value1)
  176. if (res.status == 0) {
  177. if (this.pageindex > res.data.last_page) {
  178. uni.showToast({
  179. title: "没有更多了",
  180. icon: "none"
  181. })
  182. } else {
  183. this.ordersList = this.ordersList.concat(res.data.data)
  184. this.pageindex++
  185. }
  186. }
  187. console.log(this.ordersList)
  188. if (this.ordersList.length == 0) {
  189. this.show = true
  190. } else {
  191. this.show = false
  192. }
  193. }
  194. }
  195. };
  196. </script>
  197. <style lang="scss">
  198. page {
  199. background-color: #fff;
  200. }
  201. .main {}
  202. .text_style {
  203. font-weight: 400;
  204. margin-left: 15rpx;
  205. background-color: #E5F5FF;
  206. color: #0B73B9;
  207. width: 100rpx;
  208. height: 28rpx;
  209. font-size: 20rpx;
  210. border-radius: 10rpx;
  211. text-align: center;
  212. align-items: center;
  213. }
  214. .nametaile {
  215. font-size: 30rpx;
  216. font-weight: 500;
  217. color: #333333;
  218. }
  219. .textstyle {
  220. font-size: 26rpx;
  221. color: #666666;
  222. font-weight: 400;
  223. }
  224. .phonezi {
  225. width: 160rpx;
  226. height: 54rpx;
  227. background: #F6F6F6;
  228. border-radius: 27rpx;
  229. font-size: 28rpx;
  230. font-family: PingFangSC-Regular, PingFang SC;
  231. font-weight: 400;
  232. color: #666666;
  233. display: flex;
  234. align-items: center;
  235. justify-content: center;
  236. }
  237. .jinxing {
  238. height: 30rpx;
  239. font-size: 30rpx;
  240. font-family: PingFangSC-Medium, PingFang SC;
  241. font-weight: 500;
  242. color: #EEAA3F;
  243. display: flex;
  244. align-items: center;
  245. }
  246. </style>