orderdes.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view>
  3. <loadSke :loading='loading'>
  4. <view class="remind">请到影院现场柜台或取票机取票</view>
  5. <view class="des-box">
  6. <loadSke :loading='!orderDes.orderDataJson.FilmOrderNotifyDTO'>
  7. <view class="code-box">
  8. <view class="code">
  9. <text>取票码</text>
  10. <text>{{JSON.parse(orderDes.orderDataJson.FilmOrderNotifyDTO.ticketCode).join(' ')}}</text>
  11. </view>
  12. <image class="qrcode" :src="JSON.parse(orderDes.orderDataJson.FilmOrderNotifyDTO.ticketImage)[0]" mode="widthFix"></image>
  13. </view>
  14. </loadSke>
  15. <view class="order-num">
  16. <text>订单号:{{orderDes.outTradeNo}}</text>
  17. <text>{{orderDes.orderDataJson.FilmOrderNotifyDTO ? `出票成功` : `正在出票`}}</text>
  18. </view>
  19. <view class="des">
  20. <text class="film-name">{{orderDes.orderDataJson.cinemaData.filmName}}</text>
  21. <view class="film-time">
  22. <text>时间</text>
  23. <text>{{orderDes.orderDataJson.cinemaData.showTime}}</text>
  24. </view>
  25. <view class="film-address">
  26. <text>影院</text>
  27. <text>{{orderDes.orderDataJson.cinemaData.cinemaName}}</text>
  28. </view>
  29. <view class="film-video">
  30. <text>影厅</text>
  31. <text>{{orderDes.orderDataJson.cinemaData.hallName}}</text>
  32. </view>
  33. <view class="film-seat">
  34. <text>座位</text>
  35. <view class="seat-box">
  36. <text v-for="(item,index) in seatList" :key='index'>{{item}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="price">
  41. <text>总价</text>
  42. <text>¥{{orderDes.total/100}}</text>
  43. </view>
  44. </view>
  45. </loadSke>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. getWxOrder
  51. } from '@/api/order.js'
  52. export default {
  53. data: () => ({
  54. orderDes: {},
  55. seatList: [],
  56. outTradeNo: null,
  57. loading: true,
  58. pollingTiemId:null
  59. }),
  60. onLoad: function(option) {
  61. this.outTradeNo = option.outTradeNo
  62. },
  63. mounted() {
  64. this.init()
  65. },
  66. methods: {
  67. async init() {
  68. let orderRes = await getWxOrder(this.outTradeNo)
  69. orderRes.data.orderDataJson = JSON.parse(orderRes.data.orderDataJson)
  70. this.orderDes = orderRes.data
  71. this.seatList = this.orderDes.orderDataJson.filmOrderCreateDTO.seat.split(',')
  72. this.loading = false
  73. this.polling()
  74. },
  75. polling() {
  76. this.pollingTiemId = setInterval(async () => {
  77. let orderRes = await getWxOrder(this.outTradeNo)
  78. orderRes.data.orderDataJson = JSON.parse(orderRes.data.orderDataJson)
  79. this.orderDes = orderRes.data
  80. this.seatList = this.orderDes.orderDataJson.filmOrderCreateDTO.seat.split(',')
  81. if(false) clearInterval(this.pollingTiemId)
  82. }, 3000)
  83. }
  84. },
  85. beforeDestroy() {
  86. clearInterval(this.pollingTiemId)
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .remind {
  92. margin-top: 36rpx;
  93. font-size: 26rpx;
  94. font-weight: 400;
  95. color: #0F0404;
  96. text-align: center;
  97. }
  98. .des-box {
  99. width: 564rpx;
  100. background: #FFFFFF;
  101. border-radius: 20rpx;
  102. margin: auto;
  103. margin-top: 30rpx;
  104. .code-box {
  105. display: flex;
  106. flex-direction: column;
  107. align-items: center;
  108. padding-bottom: 38rpx;
  109. .code {
  110. margin-top: 43rpx;
  111. text {
  112. font-size: 26rpx;
  113. font-weight: 400;
  114. color: #666666;
  115. margin-right: 20rpx;
  116. &:nth-child(2) {
  117. color: #0F0404;
  118. }
  119. }
  120. }
  121. .qrcode {
  122. margin-top: 43rpx;
  123. width: 260rpx;
  124. height: 260rpx;
  125. }
  126. }
  127. .order-num {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. padding: 34rpx 31rpx;
  132. border-top: 1rpx dashed #D9D9D9;
  133. border-bottom: 1rpx dashed #D9D9D9;
  134. position: relative;
  135. &::after {
  136. content: '';
  137. width: 24rpx;
  138. height: 24rpx;
  139. border-radius: 50%;
  140. background-color: #F1F1F1;
  141. position: absolute;
  142. top: 0;
  143. left: 0;
  144. transform: translate(-50%, -50%);
  145. }
  146. &::before {
  147. content: '';
  148. width: 24rpx;
  149. height: 24rpx;
  150. border-radius: 50%;
  151. background-color: #F1F1F1;
  152. position: absolute;
  153. top: 0;
  154. right: 0;
  155. transform: translate(50%, -50%);
  156. }
  157. text {
  158. &:nth-child(1) {
  159. width: 60%;
  160. word-break: break-all;
  161. font-size: 26rpx;
  162. font-weight: 400;
  163. color: #666666;
  164. }
  165. &:nth-child(2) {
  166. padding: 10rpx;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. background: #FFE5E5;
  171. border: 1rpx solid #E31818;
  172. border-radius: 20rpx;
  173. font-size: 20rpx;
  174. font-weight: 400;
  175. color: #E31818;
  176. }
  177. }
  178. }
  179. .des {
  180. padding: 45rpx 30rpx;
  181. border-bottom: 1rpx dashed #D9D9D9;
  182. display: flex;
  183. flex-direction: column;
  184. .film-name {
  185. font-size: 30rpx;
  186. font-weight: 400;
  187. color: #0F0404;
  188. }
  189. text {
  190. font-size: 26rpx;
  191. font-weight: 400;
  192. color: #666666;
  193. margin-right: 20rpx;
  194. white-space: nowrap;
  195. }
  196. .film-time {
  197. text:nth-child(2) {
  198. color: #999999;
  199. }
  200. }
  201. .film-address {
  202. text:nth-child(2) {
  203. color: #999999;
  204. }
  205. }
  206. .film-video {
  207. text:nth-child(2) {
  208. color: #999999;
  209. }
  210. }
  211. .film-seat {
  212. display: flex;
  213. justify-content: flex-start;
  214. align-items: stretch;
  215. margin-top: 10rpx;
  216. .seat-box {
  217. display: flex;
  218. flex-wrap: wrap;
  219. text {
  220. height: 40rpx;
  221. padding: 4rpx 15rpx;
  222. margin-bottom: 10rpx;
  223. background: #EBEBEB;
  224. border-radius: 4rpx;
  225. color: #999999;
  226. }
  227. }
  228. }
  229. }
  230. .price {
  231. padding: 40rpx 30rpx;
  232. text {
  233. font-size: 26rpx;
  234. font-weight: 400;
  235. color: #666666;
  236. margin-right: 20rpx;
  237. &:nth-child(2) {
  238. color: #E31818;
  239. }
  240. }
  241. }
  242. }
  243. </style>