doctorOrder.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <!-- tab切换 -->
  5. <view class="pub-tab-box">
  6. <view class="tab-inner">
  7. <view
  8. v-for="(item,index) in orderStatus"
  9. :key="index"
  10. :class="item.val == orderStatusValue?'item active':'item'"
  11. @click="orderStatusChange(item)"
  12. >
  13. <view class="text">
  14. {{ item.name }}
  15. <image v-show="item.val == orderStatusValue" class="tab-bg" src="../../static/images/tab_bg.png" mode=""></image>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="consu-list">
  22. <mescroll-body top="88upx" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  23. <view v-for="(item,index) in dataList" :key="index" class="item" >
  24. <view class="ordersn-box">
  25. <view class="num">订单号:{{item.orderSn}}</view>
  26. <view class="status-box">
  27. <view v-if="item.orderType==1" class="recom-box">图文问诊</view>
  28. <view v-if="item.orderType==2" class="recom-box">语音问诊</view>
  29. <text class="text success">
  30. {{utils.getDictLabelName("doctorOrderStatus",item.status)}}
  31. </text>
  32. </view>
  33. </view>
  34. <view class="doctor-info">
  35. <view class="img-box">
  36. <image :src="item.doctorHeadImg" mode="aspectFill"></image>
  37. </view>
  38. <view class="name">
  39. <text>{{item.doctorName}}</text> <text>{{item.departmentName}}</text><text>{{item.hospitalName}}</text>
  40. </view>
  41. </view>
  42. <view class="ask-text">{{item.title}}</view>
  43. <view class="patient-text" v-if="item.patientId!=null">患者:{{item.patientName}} {{utils.getAge(item.patientBirthday)}}岁 {{item.patientGender==1?'男':'女'}}</view>
  44. <view class="ask-time">{{item.createTime}}</view>
  45. <view class="bottom-box">
  46. <view class="amount-paid">
  47. <text class="label">实付金额:</text>
  48. <view class="price-box">
  49. <view class="unit">¥</view>
  50. <view class="num">{{item.payMoney.toFixed(2)}}</view>
  51. </view>
  52. </view>
  53. <view class="btn-box">
  54. <view v-if="item.status ==0 ||item.status==1" class="btn cancel" @click="cancel(item)">取消订单</view>
  55. <view v-if="item.status ==1" class="btn cancel" @click="showDetail(item)">查看会话</view>
  56. <view v-if="item.status == 0" class="btn pay" @click="pay(item)">支付</view>
  57. </view>
  58. </view>
  59. </view>
  60. </mescroll-body>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {getMyDoctorOrderList,cancelOrder} from '@/api/doctorOrder.js'
  66. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  67. export default {
  68. mixins: [MescrollMixin],
  69. data() {
  70. return {
  71. orderStatus:[
  72. {name:"全部",val:""},
  73. {name:"未支付",val:"0"},
  74. {name:"进行中",val:"1"},
  75. {name:"已完成",val:"2"},
  76. {name:"已取消",val:"-1"},
  77. ],
  78. orderStatusValue: "",
  79. mescroll:null,
  80. // 上拉加载的配置
  81. upOption: {
  82. onScroll:true,
  83. use: true, // 是否启用上拉加载; 默认true
  84. page: {
  85. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  86. size: 10 // 每页数据的数量,默认10
  87. },
  88. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  89. empty: {
  90. icon:'/static/images/no_data.png',
  91. tip: '暂无数据'
  92. }
  93. },
  94. // 列表数据
  95. dataList: []
  96. }
  97. },
  98. onLoad() {
  99. uni.$on('refreshDoctorOrder', () => {
  100. this.mescroll.resetUpScroll()
  101. })
  102. },
  103. methods: {
  104. pay(item){
  105. uni.navigateTo({
  106. url: '/pages_/doctor/paymentOrder?orderId='+item.orderId
  107. })
  108. },
  109. cancel(item){
  110. var that=this;
  111. uni.showModal({
  112. title: '提示',
  113. content: '确定取消订单吗',
  114. success: function (res) {
  115. if (res.confirm) {
  116. var data = {
  117. orderId:item.orderId
  118. };
  119. cancelOrder(data).then(res => {
  120. if(res.code==200){
  121. uni.showToast({
  122. icon:'success',
  123. title: '订单已取消',
  124. });
  125. that.mescroll.resetUpScroll()
  126. }else{
  127. uni.showToast({
  128. icon:'none',
  129. title: res.msg,
  130. });
  131. }
  132. });
  133. }
  134. else if (res.cancel) {
  135. }
  136. }
  137. });
  138. },
  139. // tab切换
  140. orderStatusChange(item) {
  141. this.orderStatusValue = item.val
  142. this.mescroll.resetUpScroll()
  143. },
  144. mescrollInit(mescroll) {
  145. this.mescroll = mescroll;
  146. },
  147. /*下拉刷新的回调 */
  148. downCallback(mescroll) {
  149. mescroll.resetUpScroll()
  150. },
  151. upCallback(page) {
  152. //联网加载数据
  153. var that = this;
  154. var data = {
  155. status:this.orderStatusValue,
  156. page: page.num,
  157. pageSize: page.size
  158. };
  159. getMyDoctorOrderList(data).then(res => {
  160. if(res.code==200){
  161. //设置列表数据
  162. if (page.num == 1) {
  163. that.dataList = res.data.list;
  164. } else {
  165. that.dataList = that.dataList.concat(res.data.list);
  166. }
  167. that.mescroll.endBySize(res.data.list.length, res.data.total);
  168. }else{
  169. uni.showToast({
  170. icon:'none',
  171. title: "请求失败",
  172. });
  173. that.dataList = null;
  174. that.mescroll.endErr();
  175. }
  176. });
  177. },
  178. showDetail(item) {
  179. if(item.orderType==1){
  180. uni.navigateTo({
  181. url: '/pages_doctor/doctorOrderIM?orderId='+item.orderId
  182. })
  183. }
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="scss">
  189. .content{
  190. padding: 20upx;
  191. .top-fixed{
  192. width: 100%;
  193. position: fixed;
  194. top: 0;
  195. left: 0;
  196. z-index: 10;
  197. }
  198. .pub-tab-box{
  199. box-sizing: border-box;
  200. width: 100%;
  201. padding: 0 40upx;
  202. background-color: #FFFFFF;
  203. .tab-inner{
  204. height: 88upx;
  205. line-height: 88upx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: space-between;
  209. overflow-x: auto;
  210. }
  211. .item{
  212. font-size: 28upx;
  213. white-space: nowrap;
  214. line-height: 1;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #666666;
  218. margin-right: 60upx;
  219. display: flex;
  220. align-items: center;
  221. justify-content: center;
  222. &:last-child{
  223. margin-right: 0;
  224. }
  225. &.active{
  226. font-weight: bold;
  227. color: #333333;
  228. }
  229. .text{
  230. position: relative;
  231. z-index: 1;
  232. }
  233. .tab-bg{
  234. width: 72upx;
  235. height: 28upx;
  236. position: absolute;
  237. top: 17upx;
  238. left: 50%;
  239. transform: translateX(-36upx);
  240. z-index: -1;
  241. }
  242. }
  243. }
  244. .consu-list{
  245. .item{
  246. background: #FFFFFF;
  247. border-radius: 16upx;
  248. padding: 40upx 30upx;
  249. position: relative;
  250. margin-bottom: 20upx;
  251. .ordersn-box{
  252. display: flex;
  253. align-items: center;
  254. justify-content: space-between;
  255. padding: 0upx 0 20upx;
  256. .num{
  257. font-size: 26upx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. color: #999999;
  261. line-height: 1;
  262. }
  263. .status-box{
  264. display: flex;
  265. align-items: center;
  266. .recom-box{
  267. width: 108upx;
  268. height: 30upx;
  269. line-height: 30upx;
  270. text-align: left;
  271. padding-left: 8upx;
  272. font-size: 22upx;
  273. font-family: PingFang SC;
  274. font-weight: 500;
  275. color: #FFFFFF;
  276. background-image: url(../../static/images/recom.png);
  277. background-repeat: no-repeat;
  278. background-size: 100% 100%;
  279. margin-right: 8upx;
  280. }
  281. .text{
  282. font-size: 28upx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. line-height: 1;
  286. &.success{
  287. color: #018C39;
  288. }
  289. &.black{
  290. color: #111111;
  291. }
  292. &.info{
  293. color: #999999;
  294. }
  295. }
  296. }
  297. }
  298. .doctor-info{
  299. display: flex;
  300. align-items: center;
  301. .img-box{
  302. width: 80upx;
  303. height: 80upx;
  304. background: #E0FFF8;
  305. border-radius: 50%;
  306. overflow: hidden;
  307. margin-right: 20upx;
  308. image{
  309. width: 100%;
  310. height: 100%;
  311. }
  312. }
  313. .name{
  314. font-size: 28upx;
  315. font-family: PingFang SC;
  316. font-weight: 500;
  317. color: #666666;
  318. line-height: 48upx;
  319. text{
  320. margin-right: 10upx;
  321. }
  322. }
  323. }
  324. .ask-text{
  325. font-size: 30upx;
  326. font-family: PingFang SC;
  327. font-weight: 500;
  328. color: #111111;
  329. line-height: 42upx;
  330. margin-top: 26upx;
  331. margin-bottom: 24upx;
  332. }
  333. .patient-text{
  334. font-size: 24upx;
  335. font-family: PingFang SC;
  336. font-weight: 500;
  337. color: #999999;
  338. margin-bottom: 24upx;
  339. }
  340. .ask-time{
  341. font-size: 24upx;
  342. font-family: PingFang SC;
  343. font-weight: 500;
  344. color: #999999;
  345. line-height: 1;
  346. }
  347. .bottom-box{
  348. height: 80upx;
  349. display: flex;
  350. align-items: center;
  351. justify-content: space-between;
  352. .amount-paid{
  353. display: flex;
  354. align-items: center;
  355. .label{
  356. font-size: 24upx;
  357. font-family: PingFang SC;
  358. font-weight: 500;
  359. color: #999999;
  360. line-height: 1;
  361. }
  362. .price-box{
  363. display: flex;
  364. align-items: flex-end;
  365. .unit{
  366. font-size: 24upx;
  367. font-family: PingFang SC;
  368. font-weight: 500;
  369. color: #FF6633;
  370. line-height: 1.2;
  371. margin-right: 4upx;
  372. }
  373. .num{
  374. font-size: 32upx;
  375. font-family: PingFang SC;
  376. font-weight: bold;
  377. color: #FF6633;
  378. line-height: 1;
  379. }
  380. }
  381. }
  382. .btn-box{
  383. box-sizing: border-box;
  384. display: flex;
  385. align-items: center;
  386. .btn{
  387. width: 155upx;
  388. height: 64upx;
  389. line-height: 64upx;
  390. font-size: 26upx;
  391. font-family: PingFang SC;
  392. font-weight: 500;
  393. text-align: center;
  394. border-radius: 32upx;
  395. margin-left: 15upx;
  396. &:first-child{
  397. margin-left: 0;
  398. }
  399. &.cancel{
  400. border: 1px solid #DDDDDD;
  401. color: #666666;
  402. }
  403. &.pay{
  404. background: #018C39;
  405. color: #FFFFFF;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. </style>