inquiryOrderList.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <u-tabs
  5. :scrollable="false"
  6. :list="tabs"
  7. lineColor="#2583EB"
  8. @change="inquiryTypeChange">
  9. </u-tabs>
  10. </view>
  11. <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback">
  12. <view class="order-list">
  13. <view class="order-item" v-for="(item) in dataList" @click="navTo('./inquiryOrderDetails?orderId='+item.orderId)">
  14. <view class="order-top" >
  15. <view class="left" v-if="item.doctorId!=null">
  16. <image class="head" mode="aspectFill" :src="item.avatar"></image>
  17. <view class="name">
  18. {{item.doctorName}}
  19. </view>
  20. <view class="dept">
  21. {{item.deptName}}
  22. </view>
  23. </view>
  24. <view class="left" v-if="item.inquiryType==2">
  25. <view class="title" v-if="item.status==1">
  26. 支付后为您安排医生接诊
  27. </view>
  28. <view class="title" v-if="item.status==2">
  29. 正在为您安排医生接诊
  30. </view>
  31. <view class="title" v-if="item.status==-1">
  32. 订单已取消
  33. </view>
  34. <view class="title" v-if="item.status==-2">
  35. 订单已退款
  36. </view>
  37. <view class="title" v-if="item.status==-3">
  38. 医生已拒单
  39. </view>
  40. </view>
  41. <view class="status red" v-if="item.status==1">
  42. {{$getDictLabelName(orderStatusOptions,item.status)}}
  43. </view>
  44. <view class="status red" v-if="item.status==2">
  45. {{$getDictLabelName(orderStatusOptions,item.status)}}
  46. </view>
  47. <view class="status green" v-if="item.status==3">
  48. {{$getDictLabelName(orderStatusOptions,item.status)}}
  49. </view>
  50. <view class="status green" v-if="item.status==4">
  51. {{$getDictLabelName(orderStatusOptions,item.status)}}
  52. </view>
  53. <view class="status gray" v-if="item.status<0">
  54. {{$getDictLabelName(orderStatusOptions,item.status)}}
  55. </view>
  56. </view>
  57. <view class="order-cont">
  58. <view class="order-type" >
  59. 订单类型:
  60. <text>{{$getDictLabelName(inquiryTypeOptions,item.inquiryType)}}</text>
  61. <text>-{{$getDictLabelName(orderTypeOptions,item.orderType)}}</text>
  62. </view>
  63. <view class="order-desc">病情描述:{{item.title}}</view>
  64. <view class="order-time-box">
  65. <view class="order-time">
  66. {{item.createTime}}
  67. </view>
  68. <view class="right">
  69. <view class="btn" @click.stop="navTo('./inquiryOrderDetails?orderId='+item.orderId)" >查看</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </mescroll-body>
  76. </view>
  77. </template>
  78. <script>
  79. import store from "@/store";
  80. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  81. import {cancel,getCompanyUserInquiryOrderList} from '@/api/inquiryOrder.js'
  82. import {getDictByKey} from '@/api/common.js'
  83. import {navigateToDesignatedConversation,setConversation} from "@/pages_im/util/imCommon";
  84. import IMSDK, {SessionType} from "openim-uniapp-polyfill";
  85. export default {
  86. mixins: [MescrollMixin], // 使用mixin
  87. data() {
  88. return {
  89. orderStatusOptions:[],
  90. orderTypeOptions:[],
  91. inquiryTypeOptions:[],
  92. tabs:[
  93. {
  94. id:2,
  95. name:'快速问诊'
  96. },
  97. {
  98. id:1,
  99. name:'专家问诊'
  100. },
  101. {
  102. id:3,
  103. name:'开药问诊'
  104. }
  105. ],
  106. inquiryType:2,
  107. mescroll:null,
  108. downOption: { //下拉刷新
  109. use:true,
  110. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  111. },
  112. upOption: {
  113. onScroll:false,
  114. use: true, // 是否启用上拉加载; 默认true
  115. page: {
  116. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  117. size: 10 // 每页数据的数量,默认10
  118. },
  119. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  120. textNoMore:"已经到底了",
  121. empty: {
  122. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  123. tip: '暂无数据'
  124. }
  125. },
  126. dataList: []
  127. }
  128. },
  129. onLoad() {
  130. this.getDictByKey("sys_inquiry_order_type");
  131. this.getDictByKey("sys_inquiry_type");
  132. this.getDictByKey("sys_inquiry_status");
  133. var that=this;
  134. uni.$on('refreshInquiryOrder', () => {
  135. that.mescroll.resetUpScroll()
  136. })
  137. },
  138. onShow() {
  139. },
  140. methods: {
  141. cancel(item){
  142. var that=this;
  143. uni.showModal({
  144. title:"提示",
  145. content:"确认取消订单吗?",
  146. showCancel:true,
  147. cancelText:'取消',
  148. confirmText:'确定',
  149. success:res=>{
  150. if(res.confirm){
  151. // 用户点击确定
  152. var data={orderId:item.orderId}
  153. cancel(data).then(
  154. res => {
  155. if(res.code==200){
  156. this.mescroll.resetUpScroll()
  157. uni.showToast({
  158. icon:'success',
  159. title: "操作成功",
  160. });
  161. }else{
  162. uni.showToast({
  163. icon:'none',
  164. title: res.msg,
  165. });
  166. }
  167. },
  168. rej => {}
  169. );
  170. }else{
  171. // 否则点击了取消
  172. }
  173. }
  174. })
  175. },
  176. ping(item){
  177. uni.navigateTo({
  178. url: "/pages_order/pingOrder?orderId="+item.orderId
  179. })
  180. },
  181. pay(item){
  182. uni.navigateTo({
  183. url: "/pages_order/inquiryPay?orderId="+item.orderId
  184. })
  185. },
  186. toIM(item){
  187. var that=this;
  188. var userId=uni.getStorageSync('userId');
  189. var did='D' + item.doctorId;
  190. var conversationID=`si_D${item.doctorId}_U${userId}`;
  191. this.$store.commit("timStore/setImType", 1);
  192. this.$store.commit("timStore/setConversationID", conversationID);
  193. navigateToDesignatedConversation(did,SessionType.Single,false).then((res) => {
  194. }).catch(() => {
  195. console.warn("获取会话 异常 = ");
  196. });
  197. },
  198. getDictByKey(key){
  199. var data={key:key}
  200. getDictByKey(data).then(
  201. res => {
  202. if(res.code==200){
  203. if(key=="sys_inquiry_order_type"){
  204. this.orderTypeOptions=res.data;
  205. }
  206. if(key=="sys_inquiry_type"){
  207. this.inquiryTypeOptions=res.data;
  208. }
  209. if(key=="sys_inquiry_status"){
  210. this.orderStatusOptions=res.data;
  211. }
  212. }
  213. },
  214. err => {
  215. }
  216. );
  217. },
  218. inquiryTypeChange(item){
  219. this.inquiryType=item.id
  220. console.log(item)
  221. this.mescroll.resetUpScroll()
  222. },
  223. navTo(url){
  224. uni.navigateTo({
  225. url: url
  226. })
  227. },
  228. mescrollInit(mescroll) {
  229. this.mescroll = mescroll;
  230. },
  231. /*下拉刷新的回调 */
  232. downCallback() {
  233. this.mescroll.resetUpScroll()
  234. },
  235. /*上拉加载的回调*/
  236. upCallback(page) {
  237. //联网加载数据
  238. var that = this;
  239. var data = {
  240. inquiryType:this.inquiryType,
  241. pageNum: page.num,
  242. pageSize: page.size
  243. };
  244. getCompanyUserInquiryOrderList(data).then(res => {
  245. if(res.code==200){
  246. if (page.num == 1) {
  247. that.dataList = res.data.list;
  248. } else {
  249. that.dataList = that.dataList.concat(res.data.list);
  250. }
  251. that.mescroll.endBySize(res.data.list.length, res.data.total);
  252. }else{
  253. uni.showToast({
  254. icon:'none',
  255. title: "请求失败",
  256. });
  257. that.dataList = null;
  258. that.mescroll.endErr();
  259. }
  260. });
  261. },
  262. }
  263. }
  264. </script>
  265. <style lang="scss">
  266. page{
  267. height: 100%;
  268. background: #f6f6f6;
  269. }
  270. </style>
  271. <style scoped lang="scss">
  272. .content{
  273. height: 100%;
  274. .top-fixed{
  275. width: 100%;
  276. position: fixed;
  277. top: 0;
  278. left: 0;
  279. z-index: 10;
  280. height: 88upx;
  281. background-color: #fff;
  282. }
  283. .order-list{
  284. width: 100%;
  285. padding: 15rpx;
  286. display: flex;
  287. flex-direction: column;
  288. align-items: flex-start;
  289. justify-content: flex-start;
  290. .order-item{
  291. margin-bottom: 15rpx;
  292. width: 100%;
  293. padding: 15rpx;
  294. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  295. background-color: #fff;
  296. border-radius: 15rpx;
  297. display: flex;
  298. flex-direction: column;
  299. align-items: flex-start;
  300. justify-content: flex-start;
  301. .order-top{
  302. display: flex;
  303. align-items: center;
  304. justify-content: space-between;
  305. width: 100%;
  306. padding-bottom: 15rpx;
  307. border-bottom: 1px solid #efefef;
  308. .left{
  309. display: flex;
  310. align-items: center;
  311. justify-content: flex-start;
  312. image{
  313. width:80rpx;
  314. height:80rpx;
  315. border-radius: 50%;
  316. }
  317. .title{
  318. font-size: 32upx;
  319. font-family: PingFang SC;
  320. font-weight: bold;
  321. color: #111111;
  322. }
  323. .name{
  324. margin-left: 20rpx;
  325. font-size: 32upx;
  326. font-family: PingFang SC;
  327. font-weight: bold;
  328. color: #111111;
  329. }
  330. .dept{
  331. margin-left: 15rpx;
  332. font-size: 28upx;
  333. font-family: PingFang SC;
  334. color: #9a9a9c;
  335. }
  336. }
  337. .status{
  338. font-size: 28upx;
  339. font-family: PingFang SC;
  340. }
  341. .red{
  342. color: #db5053;
  343. }
  344. .green{
  345. color: #2583EB;
  346. }
  347. .gray{
  348. color: #9c9c9c;
  349. }
  350. }
  351. .order-cont{
  352. width: 100%;
  353. margin-top: 15rpx;
  354. .order-type{
  355. font-size: 32upx;
  356. font-family: PingFang SC;
  357. // font-weight: bold;
  358. color: #111111;
  359. }
  360. .order-desc{
  361. margin-top: 15rpx;
  362. font-size: 28upx;
  363. font-family: PingFang SC;
  364. // font-weight: bold;
  365. color: #111111;
  366. }
  367. .order-time-box{
  368. width: 100%;
  369. margin-top: 15rpx;
  370. display: flex;
  371. align-items: center;
  372. justify-content: space-between;
  373. .order-time{
  374. font-size: 32upx;
  375. font-family: PingFang SC;
  376. color: #9a9a9c;
  377. }
  378. .right{
  379. .btn{
  380. padding: 10rpx 30rpx;
  381. border: 1rpx solid #2583EB;
  382. color: #2583EB;
  383. font-size: 28rpx;
  384. border-radius: 30rpx;
  385. }
  386. }
  387. }
  388. }
  389. }
  390. }
  391. }
  392. </style>