film-orderList.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <script setup lang="ts">
  2. import router from '@/router'
  3. defineProps<{
  4. order: Api.xsbOrderList
  5. }>()
  6. const _emit = defineEmits<{
  7. refresh: []
  8. }>()
  9. async function handlePay(orderNumber: string) {
  10. const res = await useUserStore().handleCommonPayMent(orderNumber)
  11. if (res.payType !== 1) {
  12. // await useUserStore().getWxCommonPayment(res, 1)
  13. useGlobalToast().show('当前只支持积分支付')
  14. }
  15. else {
  16. _emit('refresh')
  17. }
  18. }
  19. async function handleCancel(order: Api.xsbOrderList) {
  20. await useUserStore().handleCommonCancelOrder(order)
  21. _emit('refresh')
  22. }
  23. function handleCopy(data: string) {
  24. uni.setClipboardData({
  25. data,
  26. showToast: true,
  27. })
  28. }
  29. function handleOrder(orderNo: string) {
  30. router.push({
  31. name: 'film-order-detail',
  32. params: {
  33. orderNo,
  34. },
  35. })
  36. }
  37. </script>
  38. <template>
  39. <view
  40. class="blockc order-item"
  41. @click.self="handleOrder(order.orderNumber as string)"
  42. >
  43. <view class="top-box">
  44. <view class="title">
  45. {{ order.movieName }}
  46. </view>
  47. <view class="status">
  48. <template v-if="order.hbOrderStatus === OrderStatus.PaddingPay">
  49. <view class="flex items-center">
  50. 待支付( 还剩 <wd-count-down
  51. :time="useUserStore().handleFilmCommonOrderStatusText(order)"
  52. @finish="() => _emit('refresh')"
  53. /> )
  54. </view>
  55. </template>
  56. <text v-else>
  57. {{ useUserStore().handleFilmCommonOrderStatusText(order) }}
  58. </text>
  59. </view>
  60. </view>
  61. <!-- <view class="status-box">
  62. <view class="reason-box">
  63. <image class="icon" :src="`${StaticUrl}/film-error.png`" mode="scaleToFill" />
  64. <view class="reason">
  65. 订单取消原因
  66. </view>
  67. </view>
  68. <view class="info">
  69. 退款金额 ¥240 预计1-3个工作日到账
  70. </view>
  71. </view> -->
  72. <view class="info-box">
  73. <image class="img" :src="order.orderImage" mode="scaleToFill" />
  74. <view class="info">
  75. <view class="info-item">
  76. 影院:{{ order.cinemaName }}
  77. </view>
  78. <view class="info-item">
  79. 场次:{{ order.session.replace('T', ' ') }}
  80. </view>
  81. <view class="info-item">
  82. 数量:{{ order.orderMovieItems?.length }}张
  83. </view>
  84. <view class="info-item">
  85. 总价:¥{{ order.orderMoney }}
  86. </view>
  87. </view>
  88. </view>
  89. <view class="btn-box">
  90. <template v-if="order.hbOrderStatus === OrderStatus.PaddingPay">
  91. <!-- 待支付 -->
  92. <view
  93. class="btn cancel"
  94. custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #AAAAAA;box-sizing: border-box;"
  95. @click.stop="handleCancel(order)"
  96. >
  97. 取消订单
  98. </view>
  99. <view
  100. class="btn"
  101. custom-style="width: 128rpx;height: 38rpx;font-size: 24rpx;color: #222222;box-sizing: border-box"
  102. @click.stop="handlePay(order.orderNumber as string)"
  103. >
  104. 付款
  105. </view>
  106. </template>
  107. <wd-button
  108. v-if="order.orderMovieItems[0].ticketCode"
  109. custom-style="width: 188rpx;height: 44rpx;font-size: 28rpx;box-sizing: border-box"
  110. @click.stop="handleCopy(order.orderMovieItems[0].ticketCode as string)"
  111. >
  112. 复制取票码
  113. </wd-button>
  114. </view>
  115. </view>
  116. </template>
  117. <style lang="scss" scoped>
  118. .blockc {
  119. background: #FFFFFF;
  120. border-radius: 16rpx 16rpx 16rpx 16rpx;
  121. padding: 24rpx;
  122. margin-bottom: 20rpx;
  123. }
  124. .order-item {
  125. .top-box {
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. .title {
  130. font-size: 32rpx;
  131. color: #222222;
  132. font-weight: bold;
  133. }
  134. .status {
  135. font-size: 28rpx;
  136. color: #222222;
  137. }
  138. }
  139. .status-box {
  140. margin-top: 24rpx;
  141. background: #F9F9F9;
  142. border-radius: 16rpx 16rpx 16rpx 16rpx;
  143. padding: 24rpx;
  144. .reason-box {
  145. display: flex;
  146. align-items: center;
  147. .icon {
  148. width: 30rpx;
  149. height: 30rpx;
  150. }
  151. .reason {
  152. font-size: 28rpx;
  153. color: #999999;
  154. margin-left: 10rpx;
  155. }
  156. }
  157. .info {
  158. font-size: 24rpx;
  159. color: #AAAAAA;
  160. margin-top: 20rpx;
  161. line-height: 44rpx;
  162. }
  163. }
  164. .info-box {
  165. margin-top: 20rpx;
  166. display: flex;
  167. .img {
  168. width: 160rpx;
  169. height: 160rpx;
  170. border-radius: 16rpx 16rpx 16rpx 16rpx;
  171. background: #999999;
  172. margin-right: 20rpx;
  173. }
  174. .info {
  175. display: flex;
  176. flex-direction: column;
  177. justify-content: space-between;
  178. .info-item {
  179. font-size: 24rpx;
  180. color: #222222;
  181. }
  182. }
  183. }
  184. .btn-box {
  185. display: flex;
  186. align-items: center;
  187. justify-content: flex-end;
  188. margin-top: 20rpx;
  189. .btn {
  190. width: 128rpx;
  191. height: 48rpx;
  192. line-height: 48rpx;
  193. text-align: center;
  194. background: #FFFFFF;
  195. border-radius: 24rpx 24rpx 24rpx 24rpx;
  196. border: 1rpx solid #222222;
  197. font-size: 24rpx;
  198. color: #222222;
  199. }
  200. .btn.cancel {
  201. color: #AAAAAA;
  202. border: 1rpx solid #AAAAAA;
  203. margin-right: 20rpx;
  204. }
  205. }
  206. }
  207. </style>