my_appointment.vue 5.4 KB

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