my_appointment.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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}}
  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: 0, //时间正序
  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. methods: {
  123. format(t) {
  124. let time = new Date(t);
  125. let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1);
  126. str += '-';
  127. str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate();
  128. str += ' ';
  129. str += time.getHours();
  130. str += ':';
  131. str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes();
  132. return str;
  133. },
  134. typechange(value) {
  135. this.value1 = value
  136. if (value == 3) {
  137. this.textcontent = "门诊预约"
  138. } else if (value == 4) {
  139. this.textcontent = "计免预约"
  140. } else if (value == 5) {
  141. this.textcontent = "儿保预约"
  142. } else {
  143. this.textcontent = "全部预约"
  144. }
  145. this.pageindex = 1
  146. this.ordersList = []
  147. this.getordersList()
  148. },
  149. paychange(value) {
  150. this.value2 = value
  151. this.pageindex = 1
  152. this.ordersList = []
  153. this.getordersList()
  154. },
  155. timechange(value) {
  156. this.value3 = value
  157. this.pageindex = 1
  158. this.ordersList = []
  159. this.getordersList()
  160. },
  161. getordersList: async function() {
  162. let res = await this.$request.post("/api/v1/order/orderList", {
  163. page: this.pageindex,
  164. list_type: 2,
  165. product_type: this.value1,
  166. order_status: this.value2,
  167. time_sort: this.value3
  168. })
  169. console.log(this.value1)
  170. if (res.status == 0) {
  171. if (this.pageindex > res.data.last_page) {
  172. uni.showToast({
  173. title: "没有更多了",
  174. icon: "none"
  175. })
  176. } else {
  177. this.ordersList = this.ordersList.concat(res.data.data)
  178. this.pageindex++
  179. }
  180. }
  181. console.log(this.ordersList)
  182. if (this.ordersList.length == 0) {
  183. this.show = true
  184. } else {
  185. this.show = false
  186. }
  187. }
  188. }
  189. };
  190. </script>
  191. <style lang="scss">
  192. page {
  193. background-color: #fff;
  194. }
  195. .main {}
  196. .text_style {
  197. font-weight: 400;
  198. margin-left: 15rpx;
  199. background-color: #E5F5FF;
  200. color: #0B73B9;
  201. width: 100rpx;
  202. height: 28rpx;
  203. font-size: 20rpx;
  204. border-radius: 10rpx;
  205. text-align: center;
  206. align-items: center;
  207. }
  208. .nametaile {
  209. font-size: 30rpx;
  210. font-weight: 500;
  211. color: #333333;
  212. }
  213. .textstyle {
  214. font-size: 26rpx;
  215. color: #666666;
  216. font-weight: 400;
  217. }
  218. .phonezi {
  219. width: 160rpx;
  220. height: 54rpx;
  221. background: #F6F6F6;
  222. border-radius: 27rpx;
  223. font-size: 28rpx;
  224. font-family: PingFangSC-Regular, PingFang SC;
  225. font-weight: 400;
  226. color: #666666;
  227. display: flex;
  228. align-items: center;
  229. justify-content: center;
  230. }
  231. .jinxing {
  232. height: 30rpx;
  233. font-size: 30rpx;
  234. font-family: PingFangSC-Medium, PingFang SC;
  235. font-weight: 500;
  236. color: #EEAA3F;
  237. display: flex;
  238. align-items: center;
  239. }
  240. </style>