my_appointment.vue 5.7 KB

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