orderdetails.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="订单详情" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="transparent"></u-navbar>
  6. </view>
  7. <view class="page-wrap">
  8. <view class="status-content">
  9. <view class="status-item">
  10. <view class="text">请尽快完成付款,还剩 {{countdown}}</view>
  11. <view class="btn-wrap u-flex u-row-center">
  12. <view class="btn cancel">取消订单</view>
  13. <view class="btn">立即支付</view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="base-info">
  18. <view class="top u-flex u-row-between">
  19. <view class="name">遵义《伟大转折》演艺中心</view>
  20. <view class="icon-wrap u-flex">
  21. <u-icon name="phone-fill" color="#999999" size="42rpx"></u-icon>
  22. <u-icon name="map-fill" color="#999999" size="42rpx"></u-icon>
  23. </view>
  24. </view>
  25. <view class="info u-flex u-row-between">
  26. <image class="img" :src="item.showImg||staticUrl+'/img/newsdetails-banner.png'"></image>
  27. <view class="text">
  28. <view class="name u-flex u-row-between">
  29. 《伟大转折》-【成人票】
  30. <text class="status">未开始</text>
  31. </view>
  32. <view class="time">2023-11–03 14:00-16:00</view>
  33. <view class="position">5排6座</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="box qr-wrap">
  38. <view class="title">二维码</view>
  39. <view class="qr-content">
  40. <view class="img-wrap">
  41. <image class="img" :src="item.showImg||staticUrl+'/img/newsdetails-banner.png'"></image>
  42. <image class="refund-ico" :src="staticUrl+'/img/refund-ico.png'"></image>
  43. </view>
  44. <view class="">1张演出票</view>
  45. <view class="order-num del-line">取票号:211277</view>
  46. </view>
  47. </view>
  48. <view class="box order-info">
  49. <view class="title u-flex u-row-between">
  50. 订单信息
  51. <text class="btn" @click="refund">申请退款</text>
  52. </view>
  53. <view class="order-info-item" v-for="(item,index) in orderInfo[orderDetails.status]" :key="index">
  54. <text class="til">{{item.name}}</text>
  55. <text class="con">
  56. <text v-if="item.key=='payType'">{{orderDetails[item.key]|filterPayType}}</text>
  57. <text v-else>{{orderDetails[item.key]}}</text>
  58. <text class="copy-btn" @click="copyOrderNum(orderDetails[item.key])" v-if="item.key=='orderNum'">复制</text>
  59. </text>
  60. </view>
  61. </view>
  62. <view class="box tips">
  63. <view class="title">观影须知</view>
  64. <view class="tips-item" v-for="(item,index) in tipsArr" :key="index">
  65. {{item}}
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { systemInfo } from "@/mixin.js";
  73. export default {
  74. mixins:[systemInfo],
  75. data() {
  76. return {
  77. id:'',
  78. staticUrl:this.$commonConfig.staticUrl,
  79. orderDetails:{status:1},
  80. deadline: new Date("2023-12-01").getTime(), // 设置截止时间为某个日期的时间戳
  81. countdown: '', // 用于显示倒计时时间
  82. orderInfo:{
  83. 0:[],
  84. 1:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'}],
  85. 2:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'}],
  86. 3:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'},{name:'收货时间',key:'receiveTime'}],
  87. 4:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'}],
  88. 5:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'}],
  89. 6:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'}],
  90. 7:[{name:'订单编号',key:'orderNum'},{name:'下单时间',key:'createTime'},{name:'支付方式',key:'payType'},{name:'支付时间',key:'payTime'}],
  91. },
  92. tipsArr:[
  93. '1.请提前到达影院现场,找到自助取票机,打印纸质电影票,完成取票',
  94. '2.如现场自助取票机无法打印电影票,请联系影院工作人员处理',
  95. '3.凭打印好的纸质电影票、检票入场观影',
  96. '4.如果订单使用了兑换券,或购买了特殊场次,暂不支持退票和改签'
  97. ],
  98. params:{
  99. }
  100. }
  101. },
  102. onShow() {
  103. },
  104. onLoad(page) {
  105. console.log('page',page);
  106. this.getSystemInfo();
  107. },
  108. mounted() {
  109. // 每秒更新倒计时时间
  110. setInterval(() => {
  111. const now = new Date().getTime();
  112. const distance = this.deadline - now;
  113. // 计算倒计时时间,可以根据需求自定义显示方式
  114. const days = Math.floor(distance / (1000 * 60 * 60 * 24));
  115. const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  116. const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  117. const seconds = Math.floor((distance % (1000 * 60)) / 1000);
  118. // 更新倒计时时间
  119. this.countdown = `${days}天 ${hours}小时 ${minutes}分钟 ${seconds}秒`;
  120. }, 1000);
  121. },
  122. methods: {
  123. leftClick(e){
  124. let pages = getCurrentPages();
  125. if(pages.length==1){
  126. uni.$u.route('/pages/index/index')
  127. }else{
  128. uni.navigateBack()
  129. };
  130. },
  131. refund(){
  132. uni.$u.route('/center/refund',{
  133. id:this.id
  134. })
  135. },
  136. copyOrderNum(orderNum){
  137. // console.log('copyOrderNum',orderNum);
  138. uni.setClipboardData({
  139. data: orderNum,
  140. success: function () {
  141. uni.showToast({
  142. title: '复制成功'
  143. });
  144. },
  145. fail(e) {
  146. // console.log('copyOrderNumfail',e);
  147. uni.showToast({
  148. title: '复制失败',
  149. icon:"error"
  150. });
  151. }
  152. });
  153. }
  154. }
  155. }
  156. </script>
  157. <style>
  158. page{
  159. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%,#F9FBFD 100%);
  160. background-repeat: no-repeat;
  161. }
  162. </style>
  163. <style lang="scss" scoped>
  164. .status-content{
  165. text-align: center;
  166. padding-top: 30rpx;
  167. margin-bottom: 52rpx;
  168. .text{
  169. font-size: 32rpx;
  170. font-weight: 400;
  171. color: #FFFFFF;
  172. margin-bottom: 52rpx;
  173. }
  174. .btn-wrap{
  175. margin-bottom: 40rpx;
  176. .btn{
  177. height: 64rpx;
  178. line-height: 64rpx;
  179. padding: 0 28rpx;
  180. border-radius: 8rpx;
  181. border: 2rpx solid #FFFFFF;
  182. font-size: 24rpx;
  183. font-weight: 500;
  184. color: #FFFFFF;
  185. &.cancel{
  186. border-color: #F9B4B4;
  187. color: #F9B4B4;
  188. }
  189. &:not(:last-of-type){
  190. margin-right: 100rpx;
  191. }
  192. }
  193. }
  194. }
  195. .base-info{
  196. background: #FFFFFF;
  197. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(221,221,221,0.5);
  198. border-radius: 20rpx;
  199. overflow: hidden;
  200. margin-bottom: 24rpx;
  201. .top{
  202. padding: 36rpx 24rpx;
  203. background: #F9FAFD;
  204. font-size: 24rpx;
  205. font-weight: 400;
  206. color: #7F7F7F;
  207. }
  208. .info{
  209. padding: 28rpx 20rpx 30rpx 24rpx;
  210. .img{
  211. width: 180rpx;
  212. height: 160rpx;
  213. }
  214. .text{
  215. font-size: 24rpx;
  216. font-weight: 400;
  217. color: #7F7F7F;
  218. padding-left: 26rpx;
  219. flex: 1;
  220. .name{
  221. font-size: 28rpx;
  222. font-weight: bold;
  223. color: #363636;
  224. margin-bottom: 20rpx;
  225. }
  226. .time{
  227. margin-bottom: 20rpx;
  228. }
  229. .position{
  230. margin-bottom: 20rpx;
  231. }
  232. .status{
  233. font-size: 24rpx;
  234. font-weight: 400;
  235. color: #EE0606;
  236. }
  237. }
  238. }
  239. }
  240. .box{
  241. margin-bottom: 24rpx;
  242. background: #FFFFFF;
  243. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221,221,221,0.5);
  244. border-radius: 20rpx;
  245. padding: 36rpx 24rpx;
  246. .title{
  247. font-size: 28rpx;
  248. font-weight: bold;
  249. color: #2D2D2D;
  250. padding-bottom: 20rpx;
  251. margin-bottom: 24rpx;
  252. border-bottom: 1px solid #F4F4F4;
  253. .btn{
  254. height: 40rpx;
  255. line-height: 40rpx;
  256. padding: 0 20rpx;
  257. border-radius: 8rpx;
  258. border: 2rpx solid #606060;
  259. font-size: 24rpx;
  260. font-weight: 400;
  261. color: #606060;
  262. cursor: pointer;
  263. }
  264. }
  265. }
  266. .order-info{
  267. .order-info-item{
  268. font-size: 30rpx;
  269. font-weight: 400;
  270. color: #333333;
  271. padding: 10rpx 0;
  272. // &:not(:last-child){
  273. // border-bottom: 0.5px solid #eee;
  274. // }
  275. .til{
  276. font-size: 24rpx;
  277. font-weight: 400;
  278. color: #999999;
  279. margin-right: 90rpx;
  280. }
  281. .copy-btn{
  282. margin-left: 32rpx;
  283. height: 30rpx;
  284. line-height: 30rpx;
  285. padding: 0 14rpx;
  286. border-radius: 8rpx;
  287. font-size: 20rpx;
  288. font-weight: 400;
  289. color: #999999;
  290. background: #EDEDED;
  291. }
  292. }
  293. }
  294. .tips{
  295. .tips-item{
  296. font-size: 24rpx;
  297. font-weight: 400;
  298. color: #7F7F7F;
  299. line-height: 36rpx;
  300. margin-bottom: 20rpx;
  301. }
  302. }
  303. .qr-wrap{
  304. .qr-content{
  305. text-align: center;
  306. font-size: 24rpx;
  307. font-weight: 400;
  308. color: #7F7F7F;
  309. }
  310. .img-wrap{
  311. position: relative;
  312. }
  313. .img{
  314. width: 360rpx;
  315. height: 360rpx;
  316. display: block;
  317. margin: 0 auto 20rpx;
  318. }
  319. .refund-ico{
  320. width: 200rpx;
  321. height: 152rpx;
  322. position: absolute;
  323. bottom: -10rpx;
  324. right: 60rpx;
  325. }
  326. .order-num{
  327. position: relative;
  328. margin: 30rpx auto 0;
  329. font-size: 24rpx;
  330. font-weight: 400;
  331. color: #363636;
  332. border: 1px solid #363636;
  333. padding: 5rpx 20rpx;
  334. border-radius: 8rpx;
  335. width: fit-content;
  336. &.del-line{
  337. color: #BCBCBC;
  338. border: 1px solid #BCBCBC;
  339. }
  340. &.del-line::after{
  341. content: '';
  342. width: 110%;
  343. height: 1px;
  344. background-color: #BCBCBC;
  345. position: absolute;
  346. top: 50%;
  347. left: -5%;
  348. }
  349. }
  350. }
  351. </style>