order_mark.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="content">
  3. <!-- 第一层模块 -->
  4. <view class="one-order3" :class="{'one-order3': orderList2.types == 6}" v-if="orderList2.types === 6">
  5. <view class="one-order-title">{{orderList2.orderTitle}}<text class="all-price">{{orderList2.allPrice}}</text></view>
  6. <view class="one-order-menshi">{{orderList2.orderShuidian}}<text class="menshi-price">{{orderList2.shuidianPrice}}</text></view>
  7. <view class="room-button-6">
  8. <text>删除订单</text>
  9. </view>
  10. <view class="room-button2-6">
  11. <text>再次预定</text>
  12. </view>
  13. </view>
  14. <view class="one-order" v-else>
  15. <view class="one-order-title">{{orderList2.orderTitle}}<text class="all-price">{{orderList2.allPrice}}</text></view>
  16. <view class="one-order-menshi">门市价<text class="menshi-price">{{orderList2.menshiPrice}}</text></view>
  17. <view class="one-order-fuli">教师福利<text class="fuli-price">{{orderList2.fuliPrice}}</text></view>
  18. <view class="one-order-yufukuan">预付款<text class="yufukuan-price">{{orderList2.yufukuanPrice}}</text></view>
  19. <view class="one-order-zhu">
  20. 注:水费为0.62元/吨,电费为1.1元/度;补助吨数为3吨,补助度
  21. 数为10度,超出标准需在预付款中扣除,未超出原路返回预
  22. 付款
  23. </view>
  24. <view class="room-button">
  25. <text v-if="orderList2.types === 1">支付</text>
  26. <text v-if="orderList2.types === 4">删除订单</text>
  27. <text v-if="orderList2.types === 3">办理续住</text>
  28. <text v-if="orderList2.types === 2">办理入住</text>
  29. </view>
  30. <view class="room-button2">
  31. <text v-if="orderList2.types === 1">取消订单</text>
  32. <text v-if="orderList2.types === 3">办理退房</text>
  33. <text v-if="orderList2.types === 2">取消订单</text>
  34. <text v-if="orderList2.types === 4">再次预定</text>
  35. </view>
  36. </view>
  37. <!-- 第二层模块 -->
  38. <view class="two-order" :class="{'two-order3': orderList2.types == 6||orderList2.types == 3}">
  39. <view class="two-order-title">订单信息</view>
  40. <view class="two-order-name">预定信息:<text class="two-order-txt">李老师</text></view>
  41. <view class="two-order-phone">手机号码:<text class="two-order-txt">13569855689</text></view>
  42. <view class="two-order-count">订 单 号:<text class="two-order-txt">165404161161631</text></view>
  43. <view class="two-order-time">下单时间:<text class="two-order-txt">2022.07.21 15:15:15</text></view>
  44. <view class="two-order-xing">户 型:<text class="two-order-txt">01户型</text></view>
  45. <view class="two-order-zhuTime">入离时间:<text class="two-order-txt">入住日14:00后 离店日12:00前</text></view>
  46. <view class="two-order-shui" v-if="orderList2.types === 6">水起码:</view>
  47. <view class="two-order-dian" v-if="orderList2.types === 6">电起码:</view>
  48. </view>
  49. <view class="order-mark">您的满意是我们最大的追求</view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data(){
  55. return {
  56. orderList:[
  57. // {id:1,orderTitle:'预定成功 / 等待您的支付',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:1},
  58. // {id:4,orderTitle:'预定成功 / 等待您的入住',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:2},
  59. // {id:2,orderTitle:'订单已取消 / 期待您再次光临',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:4},
  60. // {id:3,orderTitle:'订单已完成 / 期待您再次光临',allPrice:'¥10.00',orderMenshi:'门市价',shuidianPrice:'¥10',orderShuidian:'水电扣除',types:6}
  61. ],
  62. orderList2:[]
  63. }
  64. },
  65. onShow() {
  66. // 模拟从后台拿到的数据
  67. var orderList = [
  68. {id:1,orderTitle:'预定成功 / 等待您的支付',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:1},
  69. {id:4,orderTitle:'预定成功 / 等待您的入住',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:2},
  70. {id:2,orderTitle:'订单已取消 / 期待您再次光临',allPrice:'¥20.00',orderMenshi:'门市价',menshiPrice:'¥160',orderFuli:'教师福利',fuliPrice:'¥160',orderYufukuan:'预付款',yufukuanPrice:'¥20',types:4},
  71. {id:3,orderTitle:'订单已完成 / 期待您再次光临',allPrice:'¥10.00',orderMenshi:'门市价',shuidianPrice:'¥10',orderShuidian:'水电扣除',types:6}
  72. ]
  73. orderList.forEach(el => el.isChecked = false);
  74. this.orderList = orderList;
  75. this.orderList2 = orderList;//真实数据赋值给页面数据
  76. // 获取当前小程序的页面栈
  77. let pages = getCurrentPages();
  78. // 数组中索引最大的页面--当前页面
  79. let currentPage = pages[pages.length-1];
  80. // 打印出当前页面中的 options
  81. // console.log(currentPage.options) //正常打印出 options 值
  82. // console.log(this.orderList)
  83. for(let i=0;i<this.orderList.length;i++) {
  84. if(currentPage.options.orderId==this.orderList[i].types){
  85. this.orderList2=this.orderList[i]
  86. }
  87. }
  88. // console.log(this.orderList2)
  89. },
  90. onload(option){
  91. console.log('不能执行onload')
  92. },
  93. methods:{
  94. }
  95. }
  96. </script>
  97. <style>
  98. @import url("./css/order_mark.css");
  99. </style>