my_appointment.vue 7.3 KB

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