my_appointment.vue 6.5 KB

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