my_consulting.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="main bg-white">
  3. <u-dropdown>
  4. <u-dropdown-item v-model="value1" :title="options1[value1].label" @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" @click="goinfoorder" :data-id="item.id" :key="index"
  10. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  11. <view class="flex justify-between align-center bg-white" style="padding: 28rpx;border-radius: 16rpx;">
  12. <view class="jinxing">
  13. <text style="display: inline-block;width: 12rpx;height: 12rpx;border-radius: 50%;background-color:#EEAA3F;margin-right: 8rpx;"></text>
  14. <text v-if="item.order_status==3">进行中</text>
  15. <text v-else-if="item.order_status==1">未支付</text>
  16. <text v-else-if="item.order_status==2">待接单</text>
  17. <text v-else-if="item.order_status==4">已完成</text>
  18. <text v-else>已取消</text>
  19. </view>
  20. <text class="phonezi" v-if="item.product_type==1">电话咨询</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. <text v-if="item.order_status==4&&item.product_type==2" class="text-blue">意见单</text>
  32. <text v-else-if="item.order_status==1" class="text-blue">去支付</text>
  33. <text v-else class="text-blue">查看详情</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. <text v-if="item.order_status==4" @click.stop="pinjia" style="width: 130rpx; text-align: right;" class="text-blue">评价</text>
  38. <text v-else-if="item.order_status==1" class="text-blue">取消</text>
  39. </view>
  40. <view class="textstyle margin-top-xs">
  41. <text style="color: #333333;">下单时间:{{item.created_at}}</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <u-empty text="暂无数据" mode="order" :show="show" margin-top="250"></u-empty>
  47. <view class="cu-tabbar-height"></view>
  48. <view class="cu-tabbar-height"></view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. onLoad(options) {
  54. },
  55. mounted() {
  56. this.getordersList()
  57. },
  58. data() {
  59. return {
  60. value1: 0, //全部类型
  61. value2: 0, //全部状态
  62. value3: 0, //时间正序
  63. options1: [{
  64. value: 0,
  65. label: "全部类型"
  66. },
  67. {
  68. value: 1,
  69. label: "电话咨询"
  70. },
  71. {
  72. value: 2,
  73. label: "图文咨询"
  74. },
  75. ],
  76. options2: [{
  77. value: 0,
  78. label: "全部状态"
  79. },
  80. {
  81. value: 1,
  82. label: "未支付"
  83. },
  84. {
  85. value: 2,
  86. label: "待接单"
  87. },
  88. {
  89. value: 3,
  90. label: "进行中"
  91. },
  92. {
  93. value: 4,
  94. label: "已完成"
  95. },
  96. {
  97. value: 5,
  98. label: "已取消"
  99. },
  100. ],
  101. options3: [{
  102. value: 0,
  103. label: "时间正序"
  104. },
  105. {
  106. value: 1,
  107. label: "时间倒序"
  108. },
  109. ],
  110. ordersList: [],
  111. pageindex: 1,
  112. show: false
  113. }
  114. },
  115. onReachBottom() {
  116. this.getordersList()
  117. },
  118. methods: {
  119. typechange(value) {
  120. this.value1 = value
  121. this.pageindex = 1
  122. this.ordersList = []
  123. this.getordersList()
  124. },
  125. paychange(value) {
  126. this.value2 = value
  127. this.pageindex = 1
  128. this.ordersList = []
  129. this.getordersList()
  130. },
  131. timechange(value) {
  132. this.value3 = value
  133. this.pageindex = 1
  134. this.ordersList = []
  135. this.getordersList()
  136. },
  137. getordersList: async function() {
  138. let res = await this.$request.post("/api/v1/order/orderList", {
  139. page: this.pageindex,
  140. list_type: this.value1,
  141. product_type: this.value1,
  142. order_status: this.value2,
  143. time_sort: this.value3
  144. })
  145. if (res.status == 0) {
  146. if (this.pageindex > res.data.last_page) {
  147. uni.showToast({
  148. title: "没有更多了",
  149. icon: "none"
  150. })
  151. } else {
  152. this.ordersList = this.ordersList.concat(res.data.data)
  153. this.ordersList.forEach((item, index) => {
  154. if (item.docter == null) {
  155. this.ordersList.splice(index, 1)
  156. }
  157. })
  158. this.ordersList.forEach((item, index) => {
  159. if (item.product_type == 6) {
  160. this.ordersList.splice(index, 1)
  161. }
  162. })
  163. console.log(this.ordersList)
  164. this.pageindex++
  165. }
  166. }
  167. if (this.ordersList.length == 0) {
  168. this.show = true
  169. } else {
  170. this.show = false
  171. }
  172. },
  173. pinjia() {
  174. console.log("ssss")
  175. },
  176. goinfoorder(e) {
  177. uni.navigateTo({
  178. url: "consultingInfo?id=" + e.currentTarget.dataset.id
  179. })
  180. }
  181. }
  182. };
  183. </script>
  184. <style lang="scss">
  185. page {
  186. background-color: #fff;
  187. }
  188. .main {}
  189. .text_style {
  190. font-weight: 400;
  191. margin-left: 15rpx;
  192. background-color: #E5F5FF;
  193. color: #0B73B9;
  194. width: 100rpx;
  195. height: 28rpx;
  196. font-size: 20rpx;
  197. border-radius: 10rpx;
  198. text-align: center;
  199. align-items: center;
  200. }
  201. .nametaile {
  202. font-size: 30rpx;
  203. font-weight: 500;
  204. color: #333333;
  205. }
  206. .textstyle {
  207. font-size: 26rpx;
  208. color: #666666;
  209. font-weight: 400;
  210. }
  211. .phonezi {
  212. width: 160rpx;
  213. height: 54rpx;
  214. background: #F6F6F6;
  215. border-radius: 27rpx;
  216. font-size: 28rpx;
  217. font-family: PingFangSC-Regular, PingFang SC;
  218. font-weight: 400;
  219. color: #666666;
  220. display: flex;
  221. align-items: center;
  222. justify-content: center;
  223. }
  224. .jinxing {
  225. height: 30rpx;
  226. font-size: 30rpx;
  227. font-family: PingFangSC-Medium, PingFang SC;
  228. font-weight: 500;
  229. color: #EEAA3F;
  230. display: flex;
  231. align-items: center;
  232. }
  233. </style>