my_appointment.vue 6.0 KB

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