bookticket.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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="base-info">
  9. <view class="up u-flex">
  10. <image class="img" :src="performInfo.showImg" alt="">
  11. <view class="text">
  12. <view class="name text-item">{{performInfo.name}}-【成人票】</view>
  13. <view class="time text-item">日期 {{pageData.day}}</view>
  14. <view class="time text-item">场次 {{pageData.time}}</view>
  15. <view class="num text-item">成人票 / {{pageData.positionName}}</view>
  16. <!-- <view class="position text-item">{{performInfo.name}}</view> -->
  17. <!-- <view class="addr u-flex u-row-between">
  18. <view class="u-line-1">地址:遵义市《伟大转折》演艺中心</view>
  19. <u-icon name="arrow-right" color="#2D2D2D" size="36rpx"></u-icon>
  20. </view> -->
  21. </view>
  22. </view>
  23. <view class="down">
  24. <view class="num-wrap u-flex u-row-between">
  25. <view class="title">选购数量</view>
  26. <view class="num">{{totalVisitor}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="block-wrap purchaser">
  31. <view class="block-title u-flex">
  32. <view class="name">购票人信息</view>
  33. <!-- <text>用于入园身份验证</text> -->
  34. </view>
  35. <view class="" v-if="vuex_member_info.isAuth">
  36. <view class="item">姓名:{{vuex_member_info.name}}</view>
  37. <view class="item">手机号:{{vuex_member_info.mobile|hidePhoneNumber}}</view>
  38. <view class="item">身份证:{{vuex_member_info.id|maskID}}</view>
  39. </view>
  40. <view class="un-auth" v-else @click="$u.route('center/factorauth',{from:'bookticket'})">
  41. 请先<text style="color: #ED0000;">实名认证</text>
  42. </view>
  43. </view>
  44. <view class="block-wrap visitors">
  45. <view class="block-title u-flex">
  46. <view class="name">观影人信息</view>
  47. <!-- <text>用于入园身份验证</text> -->
  48. </view>
  49. <view class="people-list u-flex u-flex-wrap">
  50. <view class="people btn" v-if="visitors.length>0" v-for="(visitor,index) in visitors" :key="index">
  51. {{visitor.name}}
  52. </view>
  53. <view class="btn u-flex u-row-center" @click="visitorShow = true">
  54. <u-icon name="plus-circle" color="#2D2D2D" size="32rpx"></u-icon>
  55. <text class="text">新增/更换</text>
  56. </view>
  57. </view>
  58. <!-- <view class="no-people u-flex" v-if="!visitors.length>0">
  59. <text>游客</text>
  60. <text class="right" @click="visitorShow = true">点击选择游客</text>
  61. </view> -->
  62. <view class="peoples" v-if="visitors.length>0">
  63. <view class="peoples-item u-flex u-row-between" v-for="(visitor,index) in visitors" :key="index">
  64. <view class="left u-flex">
  65. <u-icon @click="delVisitor(visitor)" name="close-circle" color="#2D2D2D" size="32rpx"></u-icon>
  66. <text style="margin-left: 8rpx;">观影人{{ index + 1 }}</text>
  67. <text class="name">{{visitor.name}}</text>
  68. <text class="people-id">{{ visitor.sfz | maskID }}</text>
  69. </view>
  70. <view class="right" @click="editVisitor(visitor)">编辑</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="coupon">
  75. <view class="title u-flex u-row-between u-border-bottom">
  76. <text>本单可享优惠</text>
  77. </view>
  78. <view class="single-til u-flex u-row-between">
  79. <view class="text">优惠券</view>
  80. <view class="more-text u-flex">
  81. <text>未使用</text>
  82. <u-icon name="arrow-right" color="#E6E6E6" size="24rpx"></u-icon>
  83. </view>
  84. </view>
  85. <view class="no-coupon">
  86. 您暂无可使用优惠券~
  87. </view>
  88. </view>
  89. <view class="notice">
  90. <view class="title u-flex u-row-between u-border-bottom">
  91. <text>购票须知</text>
  92. </view>
  93. <view class="notice-item">
  94. 1.由于设备故障等不可抗力因素,存在少量场次取消的情况,会
  95. 进行退票退款
  96. </view>
  97. <view class="notice-item">
  98. 2.由于影院系统不稳定等因素,存在出票失败的情况,会进行退款
  99. </view>
  100. <view class="notice-item">
  101. 3.取票码可以在“我的-订单页”中查看
  102. </view>
  103. </view>
  104. </view>
  105. <u-popup :show="visitorShow">
  106. <view class="people-show-content">
  107. <view class="title">
  108. <view class="cancel" @click="visitorShow=false">取消</view>
  109. 选择观影人
  110. </view>
  111. <view class="add-btn u-flex u-row-center" @click="addVisitor">
  112. <image class="img" :src="staticUrl+'/img/car.png'" ></image>
  113. 添加观影人信息
  114. </view>
  115. <view class="list">
  116. <u-checkbox-group
  117. v-model="selectedVisitor"
  118. iconPlacement="left">
  119. <view class="people u-flex u-row-between" v-for="(item,index) in visitorList" :key="index">
  120. <u-checkbox activeColor="#ED0303" :label="item.name" :name="item.id"></u-checkbox>
  121. <u-icon name="edit-pen-fill" color="#7F7F7F" size="32rpx" @click="editVisitor(item)"></u-icon>
  122. </view>
  123. </u-checkbox-group>
  124. </view>
  125. <view class="full-btn" @click="confirmVisitor">确定</view>
  126. </view>
  127. </u-popup>
  128. <view class="page-bottom">
  129. <view class="inner u-flex u-row-between">
  130. <view class="left u-flex">
  131. <text>应付金额:</text>
  132. <view class="total-price">
  133. {{totalPrice}}
  134. </view>
  135. </view>
  136. <view class="right">
  137. <view class="btn active" v-if="totalPrice>0&&cansubmit&&vuex_member_info.isAuth" @click="submitorder">立即支付</view>
  138. <view class="btn" v-else>立即支付</view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import { systemInfo } from "@/mixin.js";
  146. export default {
  147. mixins:[systemInfo],
  148. data() {
  149. return {
  150. performId:'',
  151. performInfo:{},
  152. pageData:{},//上个页面传过来的数据
  153. cansubmit:true,
  154. staticUrl:this.$commonConfig.staticUrl,
  155. visitors:[],//游客
  156. visitorShow:false,//游客弹层
  157. visitorList:[
  158. {id:'1',name:'张三',sfz:'522501199012037605'},
  159. {id:'2',name:'李四',sfz:'522501196012037605'},
  160. {id:'3',name:'王五',sfz:'522501202112037605'},
  161. ],//游客列表
  162. selectedVisitor:[],//选中的游客
  163. params:{},//要提交的数据
  164. }
  165. },
  166. computed: {
  167. totalPrice() {
  168. let that = this;
  169. return this.visitors.reduce((total, item) => {
  170. let price = null;
  171. price = Number(that.pageData.price);
  172. total += price;
  173. return total;
  174. }, 0).toFixed(2);
  175. },
  176. totalVisitor() {
  177. let that = this;
  178. return this.visitors.reduce((total, item) => {
  179. total += 1;
  180. return total;
  181. },0);
  182. },
  183. },
  184. onShow() {
  185. },
  186. onLoad(page) {
  187. console.log('page',page);
  188. this.pageData = page;
  189. this.performId = page.performId;
  190. this.getSystemInfo();
  191. this.getPerformInfo();
  192. },
  193. methods: {
  194. leftClick(e){
  195. let pages = getCurrentPages();
  196. if(pages.length==1){
  197. uni.$u.route('/pages/index/index')
  198. }else{
  199. uni.navigateBack()
  200. };
  201. },
  202. getPerformInfo(){
  203. this.$u.api.performInfo({id:this.performId}).then(res=>{
  204. console.log('getPerformInfo',res.data);
  205. this.performInfo = res.data;
  206. this.actorsArr = res.data.performerList;
  207. }).catch(err=>{
  208. console.log('getPerformInfo',err);
  209. })
  210. },
  211. confirmVisitor(){
  212. let that = this;
  213. // console.log('selectedVisitor',this.selectedVisitor);
  214. this.visitorShow = false;
  215. this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.id));
  216. // console.log('this.visitors',this.visitors);
  217. },
  218. delVisitor(visitor){
  219. // console.log('delVisitor',visitor);
  220. this.visitors = this.visitors.filter(obj => obj.id!=visitor.id );
  221. },
  222. addVisitor(){
  223. uni.$u.route('/center/people', {
  224. type: 'addVisitor',
  225. fromPage:'bookticket'
  226. });
  227. },
  228. editVisitor(item){
  229. uni.$u.route('/center/people', {
  230. type: 'editVisitor',
  231. fromPage:'bookticket',
  232. id:item.id
  233. });
  234. },
  235. submitorder(){
  236. this.cansubmit = false;
  237. console.log('params',this.params);
  238. },
  239. }
  240. }
  241. </script>
  242. <style>
  243. page{
  244. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%,#fff 100%);
  245. background-repeat: no-repeat;
  246. }
  247. </style>
  248. <style lang="scss" scoped>
  249. .base-info{
  250. border-radius: 30rpx;
  251. overflow: hidden;
  252. background: radial-gradient(circle at -26rpx 294rpx, transparent 8%, #fff 4%) left, radial-gradient(circle at calc( 100% + 26rpx ) 294rpx, transparent 8%, #fff 4%) right;
  253. background-size: 50% 100%;
  254. background-repeat: no-repeat;
  255. padding: 34rpx 36rpx;
  256. box-sizing: border-box;
  257. margin: 30rpx 0 40rpx;
  258. .up{
  259. margin-bottom: 36rpx;
  260. .img{
  261. display: block;
  262. width: 172rpx;
  263. height: 230rpx;
  264. border-radius: 20rpx;
  265. margin-right: 32rpx;
  266. }
  267. .text{
  268. font-size: 22rpx;
  269. font-weight: 400;
  270. color: #606060;
  271. line-height: 1;
  272. }
  273. .text-item{
  274. margin-bottom: 18rpx;
  275. }
  276. .name{
  277. font-size: 32rpx;
  278. font-weight: bold;
  279. color: #2D2D2D;
  280. }
  281. .addr{
  282. font-size: 24rpx;
  283. font-weight: 500;
  284. color: #2D2D2D;
  285. }
  286. }
  287. .down{
  288. position: relative;
  289. &:before{
  290. content: '';
  291. width: calc( 100% + 26rpx );
  292. height: 1px;
  293. position: absolute;
  294. left: -13rpx;
  295. top: -2rpx;
  296. border-top: 4rpx dashed #F39FA0;
  297. }
  298. .num-wrap{
  299. padding-top: 36rpx;
  300. }
  301. }
  302. }
  303. .block-wrap{
  304. background: #FFFFFF;
  305. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221,221,221,0.5);
  306. border-radius: 20rpx;
  307. margin-bottom: 28rpx;
  308. padding: 32rpx 30rpx 34rpx;
  309. .block-title{
  310. // padding-left: 16rpx;
  311. position: relative;
  312. margin-bottom: 22rpx;
  313. font-size: 24rpx;
  314. font-weight: 500;
  315. color: #CACACA;
  316. // &:before{
  317. // content: '';
  318. // width: 6rpx;
  319. // height: 32rpx;
  320. // background: #1677FF;
  321. // border-radius: 4rpx;
  322. // position: absolute;
  323. // left: 0;
  324. // top: 50%;
  325. // margin-top: -16rpx;
  326. // }
  327. .name{
  328. font-size: 32rpx;
  329. font-weight: bold;
  330. color: #2D2D2D;
  331. margin-right: 20rpx;
  332. }
  333. }
  334. .no-people{
  335. font-size: 28rpx;
  336. font-weight: 400;
  337. color: #7F7F7F;
  338. .right{
  339. margin-left: 20rpx;
  340. color: #1677FF;
  341. }
  342. }
  343. .peoples{
  344. font-size: 28rpx;
  345. font-weight: 400;
  346. color: #7F7F7F;
  347. margin-bottom: 24rpx;
  348. .peoples-item{
  349. margin-bottom: 10rpx;
  350. }
  351. .name{
  352. margin-left: 20rpx;
  353. margin-right: 28rpx;
  354. font-size: 28rpx;
  355. font-weight: bold;
  356. color: #363636;
  357. }
  358. .people-id{
  359. font-size: 20rpx;
  360. font-weight: 400;
  361. color: #606060;
  362. }
  363. .right{
  364. font-size: 28rpx;
  365. font-weight: 400;
  366. color: #ED0303;
  367. }
  368. }
  369. }
  370. .people-list{
  371. margin-bottom: 20rpx;
  372. .btn{
  373. width: 200rpx;
  374. height: 60rpx;
  375. line-height: 60rpx;
  376. font-size: 24rpx;
  377. font-weight: 500;
  378. color: #2D2D2D;
  379. background-color: #F1F1F1;
  380. border: 1px solid #F1F1F1;
  381. border-radius: 8rpx;
  382. margin-bottom: 12rpx;
  383. .text{
  384. margin-left: 16rpx;
  385. }
  386. &.people{
  387. margin-right: 16rpx;
  388. text-align: center;
  389. background-color: #FFF2F2;
  390. border-color: #ED0303;
  391. }
  392. }
  393. }
  394. .visitors{
  395. margin-bottom: 20rpx;
  396. }
  397. .people-show-content{
  398. background: #FFFFFF;
  399. border-radius: 40rpx 40rpx 0rpx 0rpx;
  400. padding: 30rpx 40rpx;
  401. .title{
  402. position: relative;
  403. font-size: 32rpx;
  404. font-weight: 500;
  405. color: #606060;
  406. margin-bottom: 46rpx;
  407. text-align: center;
  408. .cancel{
  409. position: absolute;
  410. left: 0;
  411. top: 0;
  412. }
  413. }
  414. .add-btn{
  415. margin-bottom: 28rpx;
  416. background: #E5F0FF;
  417. border-radius: 44rpx;
  418. padding: 26rpx;
  419. font-size: 24rpx;
  420. font-weight: 400;
  421. color: #1677FF;
  422. .img{
  423. width: 28rpx;
  424. height: 36rpx;
  425. margin-right: 36rpx;
  426. }
  427. }
  428. .list{
  429. /deep/ .u-radio-group{
  430. flex-wrap: wrap;
  431. }
  432. /deep/ .u-checkbox-group{
  433. flex-wrap: wrap;
  434. }
  435. overflow-y: auto;
  436. height: 40vh;
  437. .people{
  438. width: 100%;
  439. margin-bottom: 24rpx;
  440. }
  441. }
  442. .btn{}
  443. }
  444. .coupon{
  445. background: #FFFFFF;
  446. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232,232,232,0.5);
  447. border-radius: 16rpx;
  448. padding: 44rpx 36rpx;
  449. margin-bottom: 24rpx;
  450. .title{
  451. font-size: 28rpx;
  452. font-weight: bold;
  453. color: #2D2D2D;
  454. padding-bottom: 20rpx;
  455. margin-bottom: 26rpx;
  456. border-bottom-style:dashed;
  457. }
  458. .single-til{
  459. margin-bottom: 28rpx;
  460. .text{
  461. font-weight: 400;
  462. }
  463. }
  464. .no-coupon{
  465. height: 116rpx;
  466. line-height: 116rpx;
  467. text-align: center;
  468. background: #F9FAFD;
  469. border-radius: 8rpx;
  470. font-size: 24rpx;
  471. font-weight: 400;
  472. color: #C0C0C0;
  473. }
  474. }
  475. .notice{
  476. background: #FFFFFF;
  477. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232,232,232,0.5);
  478. border-radius: 16rpx;
  479. padding: 44rpx 36rpx;
  480. margin-bottom: 24rpx;
  481. .title{
  482. font-size: 28rpx;
  483. font-weight: bold;
  484. color: #2D2D2D;
  485. padding-bottom: 20rpx;
  486. margin-bottom: 26rpx;
  487. border-bottom-style:dashed;
  488. }
  489. .notice-item{
  490. font-size: 24rpx;
  491. font-weight: 400;
  492. color: #7F7F7F;
  493. line-height: 36rpx;
  494. margin-bottom: 8rpx;
  495. }
  496. }
  497. .page-bottom{
  498. position: relative;
  499. z-index: 1001;
  500. height: 98rpx;
  501. padding: 24rpx 20rpx 50rpx;
  502. .inner{
  503. position: fixed;
  504. background-color: #fff;
  505. height: 98rpx;
  506. left: 0;
  507. right: 0;
  508. bottom: 0;
  509. padding: 24rpx 20rpx 50rpx;
  510. box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215,215,215,0.5);
  511. .total-price{
  512. font-size: 40rpx;
  513. font-weight: bold;
  514. color: #ED0000;
  515. }
  516. .btn{
  517. font-size: 28rpx;
  518. height: 80rpx;
  519. line-height: 80rpx;
  520. border-radius: 50rpx;
  521. padding: 0 50rpx;
  522. background-color: #eee;
  523. color: #333;
  524. text-align: center;
  525. &.active{
  526. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  527. color: #fff;
  528. }
  529. }
  530. }
  531. }
  532. .purchaser{
  533. .item{
  534. margin-bottom: 10rpx;
  535. font-size: 26rpx;
  536. color: #333;
  537. }
  538. .un-auth{
  539. padding: 26rpx;
  540. background-color: #eee;
  541. color: #333;
  542. text-align: center;
  543. border-radius: 8rpx;
  544. }
  545. }
  546. </style>