orderDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <view class="container">
  3. <!-- 顶部订单状态信息区域 -->
  4. <view class="header">
  5. <!-- 背景图片区域 -->
  6. <img src="../../static/my/headerImg.png" />
  7. <!-- 标题区域 -->
  8. <view class="header_title">订单详情</view>
  9. <!-- 返回图标区域 -->
  10. <img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
  11. <view class="header_type" v-if="type === '1'">代付款</view>
  12. <view class="header_info" v-if="type === '1'">超时后,订单将会自动取消</view>
  13. <view class="header_type" v-if="type === '2'">支付超时</view>
  14. <view class="header_info" v-if="type === '2'">订单已超过可支付时间,请重新下单</view>
  15. <view class="header_type" v-if="type === '3'">已支付</view>
  16. <view class="header_info" v-if="type === '3'">订单已支付,请等待商家接单</view>
  17. <view class="header_type" v-if="type === '4'">已取消</view>
  18. <view class="header_info" v-if="type === '4'">订单已取消,请重新下单</view>
  19. <view class="header_type" v-if="type === '5'">已退单</view>
  20. <view class="header_info" v-if="type === '5'">订单已被商家退单,请重新下单</view>
  21. <view class="header_type" v-if="type === '6'">待入住</view>
  22. <view class="header_info" v-if="type === '6'">订单已被商家接单,请前往办理入住</view>
  23. <view class="header_type" v-if="type === '7'">已入住</view>
  24. <view class="header_info" v-if="type === '7'">订单已办理入住</view>
  25. <view class="header_type" v-if="type === '8'">已退款</view>
  26. <view class="header_info" v-if="type === '8'">订单已退款</view>
  27. <view class="header_type" v-if="type === '9'">已消费</view>
  28. <view class="header_info" v-if="type === '9'">您的订单已消费,期待您再次预定哦</view>
  29. <view class="header_btn">
  30. <view class="btn_box" v-if="type === '1'" @click="handlePay">去支付 ¥280.00</view>
  31. <view class="btn_box" v-if="type === '3' || type === '6'" @click="handleCancel">取消订单</view>
  32. <view class="btn_box" v-if="type === '2' || type === '4' || type === '5' || type === '7' || type === '8' || type === '9'" @click="handleAgain">再次预定</view>
  33. <view class="btn_box" @click="handleDelete">删除订单</view>
  34. </view>
  35. <view class="header_msg" v-if="type === '1'">预定成功后,07月26日12:00前可免费取消</view>
  36. <view class="header_msg" v-if="type === '3' || type === '6'">办理入住前,您均可取消订单</view>
  37. <view class="header_msg" v-if="type === '8'">您的订单被商家退款了,请重新预定</view>
  38. </view>
  39. <!-- 主体内容区域 -->
  40. <view class="body">
  41. <!-- 费用信息区域 -->
  42. <view class="body_box">
  43. <view class="box_title">费用信息</view>
  44. <view class="box_container">
  45. <view class="container_key">在线支付</view>
  46. <view class="container_value price">¥280</view>
  47. </view>
  48. <view class="box_container">
  49. <view class="container_key">发票报销</view>
  50. <view class="container_value">如需发票,请先与酒店确认</view>
  51. </view>
  52. </view>
  53. <!-- 民宿信息区域 -->
  54. <view class="body_box">
  55. <view class="box_info">
  56. <img src="../../static/index/banner.png" />
  57. <view class="info_msg">
  58. <view class="msg_name">民宿名称</view>
  59. <view class="msg_address">详细地址详细地址详细地址详细地址详细地址详细地址详细详细地址详细地址详细地址详</view>
  60. </view>
  61. </view>
  62. <view class="box_btn">
  63. <view class="btn_item" @click="handleMap">
  64. <img class="img" src="../../static/my/map.png" />
  65. 地图/导航
  66. </view>
  67. <view class="btn_item" @click="handlePhone('18320846714')">
  68. <img class="img2" src="../../static/my/phone.png" />
  69. 联系商家
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 房型信息和用户信息区域 -->
  74. <view class="body_box2">
  75. <view class="info_time">
  76. 7月26日
  77. <text class="gap">今天</text>
  78. <view class="time_line"></view>
  79. <view class="time_num">1晚</view>
  80. <view class="time_line"></view>
  81. <view class="gap">7月26日</view>
  82. <text>明天</text>
  83. </view>
  84. <view class="info_msg">大床房</view>
  85. <view class="info_type">
  86. <view class="type_item">包吃住型</view>
  87. <view class="type_item">包吃住型</view>
  88. <view class="type_item">包吃住型</view>
  89. </view>
  90. <view class="info_tag">
  91. <view class="tag_item">16-20㎡</view>
  92. <view class="tag_item">双人床</view>
  93. <view class="tag_item">窗户位于走廊/窗户较小</view>
  94. </view>
  95. <view class="info_box">
  96. <view class="box_key">住客姓名</view>
  97. <view class="box_value">张三</view>
  98. </view>
  99. <view class="info_box">
  100. <view class="box_key">联系电话</view>
  101. <view class="box_value">13677985689</view>
  102. </view>
  103. <view class="info_box">
  104. <view class="box_key">预计到店</view>
  105. <view class="box_value">7月26日14:00之前</view>
  106. </view>
  107. </view>
  108. <!-- 订单信息区域 -->
  109. <view class="body_box">
  110. <view class="box_title">订单信息</view>
  111. <view class="box_container">
  112. <view class="container_key">订单号</view>
  113. <view class="container_value">2626262626260660606</view>
  114. <view class="container_copy" @click="handleCopy('2626262626260660606')">复制</view>
  115. </view>
  116. <view class="box_container">
  117. <view class="container_key">下单时间</view>
  118. <view class="container_value">2023-06-27 15:15:15</view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <script>
  125. export default {
  126. data() {
  127. return {
  128. // 订单类型
  129. type: null
  130. }
  131. },
  132. onLoad(options) {
  133. this.type = options.type
  134. },
  135. methods: {
  136. // 点击复制文字回调
  137. handleCopy(text) {
  138. uni.setClipboardData({
  139. data: text,
  140. success: () => {}
  141. })
  142. },
  143. handleBack() {
  144. uni.navigateBack(1)
  145. },
  146. // 点击地图/导航文字回调
  147. handleMap() {
  148. uni.openLocation({
  149. latitude: 28.86054,
  150. longitude: 115.361744,
  151. name: '',
  152. address: '靖安县---详细地址',
  153. success: () => {}
  154. })
  155. },
  156. // 点击联系商家文字回调
  157. handlePhone(phone) {
  158. uni.makePhoneCall({
  159. phoneNumber: phone
  160. })
  161. },
  162. // 点击去支付按钮回调
  163. handlePay() {
  164. uni.navigateTo({
  165. url: '/pages/pay/pay'
  166. })
  167. },
  168. // 点击取消订单按钮回调
  169. handleCancel() {
  170. uni.showModal({
  171. title: '提示',
  172. content: '确定取消该订单吗?',
  173. success: (res) => {
  174. if (res.confirm) {
  175. uni.showToast({
  176. title: '取消成功',
  177. icon: 'success'
  178. })
  179. setTimeout(() => {
  180. uni.redirectTo({
  181. url: '/pages/orderManage/orderManage'
  182. })
  183. }, 1500)
  184. }
  185. }
  186. })
  187. },
  188. // 点击再次预定按钮回调
  189. handleAgain() {
  190. uni.navigateTo({
  191. url: '/pages/detail/detail'
  192. })
  193. },
  194. // 点击删除订单按钮回调
  195. handleDelete() {
  196. uni.showModal({
  197. title: '提示',
  198. content: '确定删除该订单吗?',
  199. success: (res) => {
  200. if (res.confirm) {
  201. uni.showToast({
  202. title: '删除成功',
  203. icon: 'success'
  204. })
  205. setTimeout(() => {
  206. uni.redirectTo({
  207. url: '/pages/orderManage/orderManage'
  208. })
  209. }, 1500)
  210. }
  211. }
  212. })
  213. }
  214. }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. .container {
  219. position: relative;
  220. height: 100vh;
  221. background-color: #f2f2f2;
  222. .header {
  223. height: 480rpx;
  224. color: #fff;
  225. img {
  226. width: 100%;
  227. }
  228. .header_title {
  229. position: absolute;
  230. top: 65rpx;
  231. left: 308rpx;
  232. color: #fff;
  233. font-size: 28rpx;
  234. }
  235. .header_icon {
  236. position: absolute;
  237. top: 76rpx;
  238. left: 10rpx;
  239. width: 47rpx;
  240. height: 47rpx;
  241. }
  242. .header_type {
  243. position: absolute;
  244. top: 162rpx;
  245. left: 30rpx;
  246. font-size: 40rpx;
  247. font-weight: bold;
  248. }
  249. .header_info {
  250. position: absolute;
  251. top: 235rpx;
  252. left: 30rpx;
  253. font-size: 24rpx;
  254. }
  255. .header_btn {
  256. position: absolute;
  257. top: 290rpx;
  258. left: 30rpx;
  259. right: 30rpx;
  260. display: flex;
  261. justify-content: space-between;
  262. .btn_box {
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. width: 335rpx;
  267. height: 72rpx;
  268. border-radius: 10rpx;
  269. color: #096562;
  270. font-size: 28rpx;
  271. background-color: #fff;
  272. }
  273. }
  274. .header_msg {
  275. position: absolute;
  276. top: 378rpx;
  277. left: 30rpx;
  278. font-size: 24rpx;
  279. }
  280. }
  281. .body {
  282. position: absolute;
  283. top: 430rpx;
  284. left: 0;
  285. right: 0;
  286. box-sizing: border-box;
  287. padding: 20rpx;
  288. height: calc(100vh - 430rpx);
  289. border-radius: 20rpx 20rpx 0 0;
  290. background-color: #ebeced;
  291. overflow-y: auto;
  292. .body_box {
  293. box-sizing: border-box;
  294. padding: 0 30rpx;
  295. margin-bottom: 20rpx;
  296. display: flex;
  297. flex-direction: column;
  298. height: 240rpx;
  299. border-radius: 14rpx;
  300. background-color: #fff;
  301. .box_title {
  302. line-height: 90rpx;
  303. font-size: 28rpx;
  304. font-weight: bold;
  305. border-bottom: 1rpx solid #e5e5e5;
  306. }
  307. .box_container {
  308. display: flex;
  309. margin-top: 25rpx;
  310. font-size: 28rpx;
  311. .container_key {
  312. width: 160rpx;
  313. color: #808080;
  314. }
  315. .container_value {
  316. }
  317. .container_copy {
  318. margin-left: auto;
  319. color: #096562;
  320. }
  321. .price {
  322. color: #ff5733;
  323. }
  324. }
  325. .box_info {
  326. display: flex;
  327. margin-top: 20rpx;
  328. height: 130rpx;
  329. img {
  330. width: 100rpx;
  331. height: 100rpx;
  332. border-radius: 10rpx;
  333. }
  334. .info_msg {
  335. display: flex;
  336. flex-direction: column;
  337. justify-content: space-around;
  338. margin-top: -10rpx;
  339. margin-left: 18rpx;
  340. width: 540rpx;
  341. .msg_name {
  342. font-size: 28rpx;
  343. font-weight: bold;
  344. }
  345. .msg_address {
  346. color: #808080;
  347. font-size: 24rpx;
  348. display: -webkit-box;
  349. -webkit-box-orient: vertical;
  350. -webkit-line-clamp: 2;
  351. overflow: hidden;
  352. }
  353. }
  354. }
  355. .box_btn {
  356. display: flex;
  357. justify-content: space-around;
  358. align-items: center;
  359. height: 110rpx;
  360. .btn_item {
  361. display: flex;
  362. align-items: center;
  363. width: 200rpx;
  364. .img {
  365. margin-right: 14rpx;
  366. width: 38rpx;
  367. height: 38rpx;
  368. }
  369. .img2 {
  370. width: 66rpx;
  371. height: 66rpx;
  372. }
  373. }
  374. }
  375. }
  376. .body_box2 {
  377. display: flex;
  378. flex-direction: column;
  379. box-sizing: border-box;
  380. padding: 0 30rpx;
  381. margin-bottom: 20rpx;
  382. height: 478rpx;
  383. border-radius: 15rpx;
  384. background-color: #fff;
  385. .info_time {
  386. display: flex;
  387. align-items: center;
  388. margin-top: 20rpx;
  389. font-size: 32rpx;
  390. font-weight: bold;
  391. .time_line {
  392. width: 17rpx;
  393. height: 1rpx;
  394. background-color: #096562;
  395. }
  396. .time_num {
  397. box-sizing: border-box;
  398. padding: 0 15rpx;
  399. height: 46rpx;
  400. line-height: 46rpx;
  401. font-size: 24rpx;
  402. font-weight: 400;
  403. border-radius: 66rpx;
  404. border: 1rpx solid #096562;
  405. background-color: #f0f2f5;
  406. }
  407. .gap {
  408. margin: 0 10rpx;
  409. }
  410. text {
  411. font-size: 24rpx;
  412. font-weight: 400;
  413. }
  414. }
  415. .info_msg {
  416. margin-top: 15rpx;
  417. font-size: 28rpx;
  418. font-weight: bold;
  419. }
  420. .info_type {
  421. display: flex;
  422. flex-wrap: wrap;
  423. margin-top: 15rpx;
  424. .type_item {
  425. box-sizing: border-box;
  426. padding: 0 15rpx;
  427. margin-right: 20rpx;
  428. height: 41rpx;
  429. line-height: 41rpx;
  430. font-size: 24rpx;
  431. color: #fff;
  432. border-radius: 34rpx;
  433. background-color: #096562;
  434. }
  435. }
  436. .info_tag {
  437. display: flex;
  438. flex-wrap: wrap;
  439. margin: 18rpx 0 0;
  440. box-sizing: border-box;
  441. padding-bottom: 30rpx;
  442. color: #808080;
  443. font-size: 24rpx;
  444. border-bottom: 1rpx solid #e5e5e5;
  445. .tag_item {
  446. margin-right: 20rpx;
  447. }
  448. }
  449. .info_box {
  450. display: flex;
  451. margin-top: 23rpx;
  452. font-size: 28rpx;
  453. .box_key {
  454. width: 160rpx;
  455. color: #808080;
  456. }
  457. .box_value {
  458. }
  459. }
  460. }
  461. }
  462. }
  463. </style>