orderInfo.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="订单详情" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
  4. <view class="body">
  5. <!-- 个人信息 -->
  6. <view class="uname">
  7. <text style="margin-right: 20rpx;">{{orderInfo.guestName}}</text>
  8. <text>{{orderInfo.guestPhone}}</text>
  9. </view>
  10. <!-- 房间信息 -->
  11. <view class="room">
  12. <!-- 房间/预定信息 -->
  13. <view class="reservations">
  14. <text style="font-size: 30rpx; color: #333333; font-weight: 700;">{{orderInfo.houseBaseName}}-{{orderInfo.roomNumber}}</text>
  15. <text style="font-size: 24rpx; color: #39CE77;" v-if="isOrderPanding">{{getStatusText()}}</text>
  16. </view>
  17. <!-- 时间/价格 -->
  18. <view class="time-price">
  19. <text style="font-size: 30rpx; color: #777;">{{orderInfo.arriveDate}}入住 {{orderInfo.num}}晚</text>
  20. <text style="font-size: 30rpx; color: #245BED;">¥{{orderInfo.orderAmount}}</text>
  21. </view>
  22. <!-- 入住人数 -->
  23. <view class="house-person">
  24. <text style="font-size: 30rpx; color: #777;">入住人</text>
  25. <view class="right" >
  26. <text style="font-size: 30rpx; color: #777; ">{{orderInfo.checkInNums}}人 </text>
  27. <u-icon name="arrow-right" @click.native="goStayCheck"></u-icon>
  28. <!-- <u-icon name="arrow-right" ></u-icon> -->
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 订单信息 -->
  33. <u-cell-group :border="false"
  34. customStyle="background-color: #fff;border-radius: 16rpx;width: 690rpx;margin:0 auto;">
  35. <u-cell>
  36. <text slot="icon" style="font-size: 30rpx; margin-right: 50rpx;">订单号</text>
  37. <view slot="title" class="title">
  38. <text>{{orderInfo.orderCode}}</text>
  39. </view>
  40. </u-cell>
  41. <u-cell>
  42. <text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">创建时间</text>
  43. <view slot="title" class="title">
  44. <text>{{orderInfo.orderTime}}</text>
  45. </view>
  46. </u-cell>
  47. <u-cell>
  48. <text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">办理员工</text>
  49. <view slot="title" class="title">
  50. <text>何伟婷</text>
  51. </view>
  52. </u-cell>
  53. <u-cell>
  54. <text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">取消原因</text>
  55. <view slot="title" class="title">
  56. <text>-</text>
  57. </view>
  58. </u-cell>
  59. <u-cell>
  60. <text slot="icon" style="font-size: 30rpx; margin-right: 80rpx;">备注</text>
  61. <view slot="title" class="title">
  62. <text>-</text>
  63. </view>
  64. </u-cell>
  65. </u-cell-group>
  66. <!-- 按钮 -->
  67. <view class="button">
  68. <button class="edit" @click="editOrder(id)">编辑订单</button>
  69. <button class="goRoom">办理入住</button>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. export default{
  76. data(){
  77. return {
  78. orderId:'1744697594837209090',
  79. orderInfo:[]
  80. }
  81. },
  82. onLoad(){
  83. this.getOrderInfo()
  84. },
  85. methods:{
  86. // 获取数据
  87. getOrderInfo(){
  88. this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`,{
  89. orderId:'1744697594837209090',
  90. }).then((res)=>{
  91. // console.log(res)
  92. if(res.data.code==0){
  93. this.orderInfo = res.data.data
  94. // console.log(this.orderInfo)
  95. }
  96. })
  97. },
  98. // 客房状态
  99. getStatusText(){
  100. if(this.orderInfo.orderStatus === -1){
  101. return '待确定'
  102. }else if(this.orderInfo.orderStatus ===1){
  103. return '已预订'
  104. }else if(this.orderInfo.orderStatus ===2){
  105. return '已入住'
  106. }else if(this.orderInfo.orderStatus ===3){
  107. return '已退房'
  108. }else if(this.orderInfo.orderStatus ===4){
  109. return '已取消'
  110. }else{
  111. return '状态异常'
  112. }
  113. },
  114. goStayCheck(id){
  115. uni.navigateTo({
  116. url: '/pages/house/stayCheck'
  117. })
  118. // console.log(1111)
  119. },
  120. editOrder(id){
  121. uni.navigateTo({
  122. url:`/pages/house/stayCheck?id=${this.orderId}`
  123. })
  124. }
  125. },
  126. computed:{
  127. isOrderPanding(){
  128. return this.orderInfo.orderStatus === 1
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. .page {
  135. background: #F3F4F4;
  136. padding-bottom: 260rpx;
  137. box-sizing: border-box;
  138. overflow-y: auto;
  139. overflow-x: auto;
  140. }
  141. .body{
  142. padding-top: 20rpx;
  143. padding-left: 30rpx;
  144. padding-right: 30rpx;
  145. }
  146. .uname{
  147. width: 665rpx;
  148. height: 100rpx;
  149. line-height: 100rpx;
  150. background-color: #fff;
  151. padding-left: 30rpx;
  152. font-size: 30rpx;
  153. border-radius: 10rpx;
  154. }
  155. .room{
  156. margin-top: 20rpx;
  157. width: 92%;
  158. height: 246rpx;
  159. background-color: #fff;
  160. margin-bottom: 20rpx;
  161. border-radius: 10rpx;
  162. padding: 30rpx;
  163. }
  164. .orderTip{
  165. padding: 30rpx;
  166. padding-top: 0;
  167. width: 690rpx;
  168. height: 514rpx;
  169. background-color: #fff;
  170. border-radius: 10rpx;
  171. }
  172. .button{
  173. position: fixed;
  174. bottom: 120rpx;
  175. height: 96rpx;
  176. width: 690rpx;
  177. // background-color: teal;
  178. margin-top: 20rpx;
  179. display: flex;
  180. justify-content: space-between;
  181. border-radius: 10rpx;
  182. }
  183. .goRoom{
  184. // border-radius: ;
  185. width: 330rpx;
  186. height: 96rpx;
  187. border-radius: 48rpx;
  188. font-size: 34rpx;
  189. background-color: #1372FF;
  190. color: #fff;
  191. }
  192. .edit{
  193. width: 330rpx;
  194. height: 96rpx;
  195. border-radius: 48rpx;
  196. font-size: 34rpx;
  197. background-color: #E2EDFC;
  198. color: #1372FF;
  199. }
  200. .reservations{
  201. display: flex;
  202. justify-content: space-between;
  203. }
  204. .time-price{
  205. display: flex;
  206. justify-content: space-between;
  207. margin-top: 30rpx;
  208. }
  209. .house-person{
  210. display: flex;
  211. justify-content: space-between;
  212. margin-top: 30rpx;
  213. }
  214. .right{
  215. display: flex;
  216. }
  217. </style>