confirmOrder.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <div class="confirmOrder">
  3. <div class="MoviceInfo card">
  4. <img :src="OrderDa.m.posterUrl" alt="" class="l_img">
  5. <div class="r_info">
  6. <div class="p_tit">{{ OrderDa.m.movieName }}</div>
  7. <div class="p1 p_num">共{{OrderDa.oldArray.length}}张,原价¥{{cartTotal}}</div>
  8. <div class="p1">{{ OrderDa.s.showTime }}</div>
  9. <div class="p1">
  10. <span>{{ OrderDa.s.hallName }}</span>
  11. <span v-for="(i,s) in OrderDa.oldArray" :key="s">{{ i.seatNo }}</span>
  12. </div>
  13. <div class="p1">{{ cinemaInfo.restaurant_name }}</div>
  14. <div class="p1">{{ cinemaInfo.restaurant_address }}</div>
  15. </div>
  16. </div>
  17. <div class="phone card flex_r flex_jb">
  18. <span>联系方式</span>
  19. <span>{{ userinfo.mobile }}</span>
  20. </div>
  21. <div class="money card">
  22. <div class="li flex_r flex_jb">
  23. <span>消费金额</span>
  24. <span>¥{{ cartTotal || 0 }}</span>
  25. </div>
  26. <div class="li flex_r flex_jb">
  27. <span>消费金抵扣<span class="corg">{{Integral}}%</span></span>
  28. <span class="corg">-¥{{ deduction || 0 }}</span>
  29. </div>
  30. <div class="li flex_r flex_jb">
  31. <span>实付金额</span>
  32. <span>¥{{ actuallypaid || 0 }}</span>
  33. </div>
  34. </div>
  35. <div class="money card">
  36. <div class="li flex_r flex_jb">
  37. <span>赠送茶宝</span>
  38. <span>{{ chabao || 0 }}</span>
  39. </div>
  40. </div>
  41. <div class="msg card">
  42. <div class="m_tit">购票须知</div>
  43. <p>1.请确认场次和时间无误,购买成功后将不予退换</p>
  44. <p>2.由于设备故障等不可抗力因素,存在少量场次取消的情况,会进行退票退款</p>
  45. <p>3.由于影院系统不稳定等因素,存在出票失败的情况,会进行退款</p>
  46. <p>4.取票码可以在“我的-本地生活-历史订单”中查看</p>
  47. </div>
  48. <div class="btnbar" @click="pay">立即支付</div>
  49. </div>
  50. </template>
  51. <script>
  52. import { ToPayOpre } from "@/utils/reqTools.js";
  53. let toPayOpre = new ToPayOpre();
  54. import { post } from "@/request/api.js";
  55. export default {
  56. name: "confirmOrder",
  57. props: {},
  58. components: {},
  59. data() {
  60. return {
  61. OrderDa: uni.getStorageSync("confirmOrder"),
  62. cinemaInfo: uni.getStorageSync("cinemaItem"),
  63. userinfo: uni.getStorageSync("userinfo"),
  64. cartTotal: 0,
  65. Integral: 0,
  66. deduction: 0,
  67. actuallypaid: 0,
  68. chabao: 0,
  69. };
  70. },
  71. methods: {
  72. getIntegral(){
  73. post("local/getIntegral",{type:2}).then(res=>{
  74. if (res.code == 0) {
  75. let i1 = res.data.integral, i2 = res.data.chabao;
  76. this.Integral = this.$h.Mul(i1,100);
  77. this.deduction = this.$h.Mul(this.cartTotal,i1).toFixed(2);
  78. this.actuallypaid = this.$h.Sub(this.cartTotal,this.deduction);
  79. this.chabao = this.$h.Mul(this.actuallypaid,i2).toFixed(2);
  80. }
  81. })
  82. },
  83. pay(){
  84. let ar = []
  85. for (let it of this.OrderDa.oldArray) {
  86. ar.push({
  87. seatId: it.SeatCode,
  88. seatName: it.seatNo
  89. })
  90. }
  91. let da = {
  92. cinemaId: this.cinemaInfo.restaurant_id,
  93. showId: this.OrderDa.s.showId,
  94. phone: this.userinfo.mobile,
  95. showInfor: JSON.stringify(ar)
  96. }
  97. post("local/cinemaOrder", da).then(res => {
  98. if (res.code == 0 && res.data.prepayid) {
  99. toPayOpre.toPay(res.data, (rea) => {
  100. if (!rea) {
  101. // 支付成功
  102. this.goto("/pagesB/orderingfood/orderlist")
  103. } else {
  104. // 支付失败
  105. }
  106. });
  107. }
  108. })
  109. }
  110. },
  111. onLoad(da) {
  112. for (let p of this.OrderDa.oldArray) {
  113. this.cartTotal = this.$h.Add(this.cartTotal,p.Price)
  114. }
  115. this.getIntegral()
  116. },
  117. onShow() {},
  118. mounted() {},
  119. };
  120. </script>
  121. <style scoped lang='scss'>
  122. .confirmOrder{
  123. padding: 30rpx;
  124. }
  125. .card {
  126. background-color: #fff;
  127. border-radius: 26rpx;
  128. margin-bottom: 30rpx;
  129. padding: 28rpx 30rpx;
  130. font-size: 32rpx;
  131. &:last-child {
  132. margin-bottom: 0;
  133. }
  134. }
  135. .MoviceInfo{
  136. .l_img,.r_info{
  137. display: inline-block;
  138. vertical-align: top;
  139. }
  140. .l_img{
  141. width: 188rpx;
  142. height: 280rpx;
  143. border-radius: 8rpx;
  144. }
  145. .r_info{
  146. width: calc(100% - 188rpx);
  147. padding-left: 28rpx;
  148. }
  149. .p_tit{
  150. font-size: 36rpx;
  151. font-weight: bold;
  152. margin-bottom: 16rpx;
  153. }
  154. .p1{
  155. margin-top: 6rpx;
  156. font-size: 25rpx;
  157. color: #666;
  158. span{
  159. margin-right: 16rpx;
  160. }
  161. }
  162. .p_num{
  163. font-size: 24rpx;
  164. color: #999;
  165. }
  166. }
  167. .money{
  168. .li{
  169. margin-bottom: 16rpx;
  170. &:last-child{
  171. margin-bottom: 0;
  172. }
  173. span{
  174. font-size: 30rpx;
  175. }
  176. }
  177. .corg{
  178. color: #EB5A5F;
  179. margin-left: 5rpx;
  180. }
  181. }
  182. .msg{
  183. .m_tit{
  184. font-size: 30rpx;
  185. margin-bottom: 12rpx;
  186. }
  187. p{
  188. font-size: 24rpx;
  189. color: #999;
  190. margin-bottom: 6rpx;
  191. }
  192. }
  193. .btnbar{
  194. width: calc(100% - 60rpx);
  195. height: 80rpx;
  196. background: #EB5A5F;
  197. border-radius: 45rpx;
  198. position: fixed;
  199. bottom: 50rpx;
  200. left: 30rpx;
  201. color: #fff;
  202. font-size: 36rpx;
  203. text-align: center;
  204. line-height: 80rpx;
  205. }
  206. </style>