my_appointment.vue 7.9 KB

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