orderDetails.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <view class="container" :class="{disableScroll:disableScroll}">
  3. <view class="info-box order-status">
  4. <view class="status-text">
  5. <span class="status">订单状态:{{getStatusTxt(orderInfo.status)}}</span>
  6. </view>
  7. </view>
  8. <view class="order-info">
  9. <image :src="orderInfo.hospitalVo.logoUrl" mode="aspectFill"></image>
  10. <view class="info-content">
  11. <span class="name">{{orderInfo.hospitalVo.name || '-'}}</span>
  12. <span class="address">
  13. <u-icon name="map" color="#999999" size="14"></u-icon>
  14. <span class="txt">{{orderInfo.hospitalVo.address || '-'}}</span>
  15. </span>
  16. <!-- <span class="area">所属区:{{orderInfo.hospitalVo.areaName || '-'}}</span> -->
  17. </view>
  18. </view>
  19. <view class="info-box">
  20. <view class="info-item">
  21. <span class="title">所在科室</span>
  22. <span class="txt">{{orderInfo.hospitalDepartmentName || '-'}}</span>
  23. </view>
  24. <u-line></u-line>
  25. <view class="info-item">
  26. <span class="title">房床号</span>
  27. <span class="txt">{{orderInfo.roomNumber || '-'}}</span>
  28. </view>
  29. <u-line></u-line>
  30. <view class="info-item info-item-spa">
  31. <span class="title">备注</span>
  32. <span class="txt">{{orderInfo.remarks || '-'}}</span>
  33. </view>
  34. </view>
  35. <view class="info-box">
  36. <view class="info-item">
  37. <span class="title">就诊人</span>
  38. <span class="txt">{{orderInfo.patientVo.name || '-'}}({{orderInfo.patientVo.mobile || '-'}})</span>
  39. </view>
  40. </view>
  41. <view class="info-box">
  42. <view class="info-item">
  43. <span class="title">服务产品</span>
  44. <span class="txt">{{orderInfo.serviceName || '-'}}</span>
  45. </view>
  46. <u-line></u-line>
  47. <view class="info-item">
  48. <span class="title">期望时间</span>
  49. <span class="txt">{{orderInfo.expectedTime}}</span>
  50. </view>
  51. </view>
  52. <view class="info-box">
  53. <span class="title-m">基本信息</span>
  54. <view class="info-item">
  55. <span class="title">订单号</span>
  56. <span class="txt">{{orderInfo.orderNo || '-'}}</span>
  57. </view>
  58. <u-line></u-line>
  59. <view class="info-item">
  60. <span class="title">下单时间</span>
  61. <span class="txt">{{orderInfo.createTime}}</span>
  62. </view>
  63. <u-line></u-line>
  64. <view class="info-item">
  65. <span class="title">下单数量</span>
  66. <span
  67. class="txt">{{orderInfo.orderNum || '-'}}({{ orderInfo.serviceUnit ? getUnitTxt(orderInfo.serviceUnit) : ''}})</span>
  68. </view>
  69. <u-line></u-line>
  70. <view class="info-item">
  71. <span class="title">销售价格</span>
  72. <span class="txt">¥{{orderInfo.sellingPrice || "0.00"}}</span>
  73. </view>
  74. <u-line></u-line>
  75. <view class="info-item">
  76. <span class="title">应付金额</span>
  77. <span class="txt">¥{{orderInfo.totalPrice || "0.00"}}</span>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. getOrderDetail,
  85. getServiceUnit,
  86. getOrderStatus,
  87. } from '@/api/order.js'
  88. export default {
  89. components: {},
  90. data() {
  91. return {
  92. orderInfo: {
  93. serviceUnit: ''
  94. },
  95. typeList: [],
  96. couponList: [],
  97. disableScroll: false,
  98. timer: null,
  99. unitList: [],
  100. }
  101. },
  102. onLoad(options) {
  103. this.getInfoById(options.id);
  104. this.getOrderStatus();
  105. this.getServiceUnit();
  106. },
  107. onShow() {
  108. // this.getOrderStatus();
  109. // this.getInfoById(options.id);
  110. },
  111. onUnload() {
  112. // 当页面关闭或卸载时清除定时器
  113. },
  114. methods: {
  115. getStatusTxt(value) {
  116. let obj = this.typeList.find(item => item.code == value);;
  117. return obj ? obj.value : '待确认'
  118. },
  119. getUnitTxt(value) {
  120. let obj = this.unitList.find(item => item.code == value);;
  121. return obj ? obj.value : ''
  122. },
  123. //查询订单状态
  124. getOrderStatus() {
  125. let that = this;
  126. getOrderStatus().then(res => {
  127. if (res.code == 200) {
  128. let data = res.data.orderStatus;
  129. data.unshift({
  130. value: '全部',
  131. code: '',
  132. })
  133. this.typeList = data;
  134. }
  135. })
  136. .catch((err) => {
  137. console.log(err);
  138. })
  139. },
  140. //查询订单状态
  141. getServiceUnit() {
  142. let that = this;
  143. getServiceUnit().then(res => {
  144. if (res.code == 200) {
  145. this.unitList = res.data.serviceUnit;
  146. }
  147. })
  148. .catch((err) => {
  149. console.log(err);
  150. })
  151. },
  152. getInfoById(id) {
  153. let that = this;
  154. uni.showLoading({
  155. title: '加载中',
  156. mask: true,
  157. });
  158. getOrderDetail(id).then(res => {
  159. if (res.code == 200) {
  160. let data = res.data;
  161. this.orderInfo = data;
  162. }
  163. })
  164. .catch((err) => {
  165. console.log(err);
  166. })
  167. .finally(() => {
  168. uni.hideLoading();
  169. });
  170. },
  171. },
  172. }
  173. </script>
  174. <style lang='scss' scoped>
  175. .container {
  176. padding: 20rpx 20rpx 100rpx;
  177. .order-status {
  178. padding: 40rpx 20rpx !important;
  179. .status-text {
  180. text-align: center;
  181. font-weight: bold;
  182. font-size: 40rpx;
  183. color: #4c96d6;
  184. }
  185. }
  186. .order-info {
  187. display: flex;
  188. align-items: center;
  189. padding: 20rpx;
  190. background: #fff;
  191. border-radius: 10rpx;
  192. margin-bottom: 20rpx;
  193. image {
  194. width: 180rpx;
  195. height: 180rpx;
  196. border-radius: 10rpx;
  197. margin-right: 20rpx;
  198. }
  199. .info-content {
  200. display: flex;
  201. flex-direction: column;
  202. flex: 1;
  203. .name {
  204. word-break: break-all;
  205. font-size: 32rpx;
  206. color: #333;
  207. font-weight: bold;
  208. }
  209. .address {
  210. font-size: 28rpx;
  211. color: #666;
  212. margin-top: 20rpx;
  213. width: 100%;
  214. font-weight: 500;
  215. line-height: 35rpx;
  216. display: flex;
  217. justify-content: flex-start;
  218. align-items: flex-start;
  219. overflow: hidden; //超出的文本隐藏
  220. text-overflow: ellipsis; //溢出用省略号显示
  221. white-space: normal; //处理元素中的 空白
  222. display: -webkit-box;
  223. -webkit-line-clamp: 2;
  224. -webkit-box-orient: vertical;
  225. display: -moz-box;
  226. -moz-line-clamp: 2;
  227. -moz-box-orient: vertical;
  228. overflow-wrap: break-word;
  229. word-break: break-all;
  230. ::v-deep .u-icon {
  231. display: inline-block;
  232. }
  233. .txt {
  234. margin-left: 15rpx;
  235. }
  236. }
  237. .area {
  238. font-size: 28rpx;
  239. color: #666;
  240. margin-top: 10rpx;
  241. }
  242. }
  243. }
  244. .info-box {
  245. padding: 20rpx;
  246. background: #fff;
  247. border-radius: 10rpx;
  248. margin-bottom: 20rpx;
  249. .info-item {
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. padding: 30rpx 0;
  254. .title {
  255. width: 250rpx;
  256. font-size: 28rpx;
  257. color: #333;
  258. }
  259. .txt {
  260. /* flex: 1; */
  261. max-width: 540rpx;
  262. text-align: left;
  263. font-size: 28rpx;
  264. color: #757575;
  265. }
  266. }
  267. .info-item-spa {
  268. align-items: flex-start;
  269. flex-direction: column;
  270. .txt {
  271. margin-left: 0;
  272. margin-top: 20rpx;
  273. text-align: left;
  274. }
  275. }
  276. }
  277. .title-m {
  278. /* 竖线和文字对齐 */
  279. display: flex;
  280. align-items: center;
  281. padding: 20rpx 0;
  282. font-size: 28rpx;
  283. color: #333;
  284. font-weight: bold;
  285. line-height: 28rpx;
  286. /* 左边加一个竖线 */
  287. &::before {
  288. content: '';
  289. display: inline-block;
  290. width: 6rpx;
  291. height: 30rpx;
  292. background: #4B91D1;
  293. margin-right: 10rpx;
  294. }
  295. }
  296. }
  297. </style>