bookticket.vue 14 KB

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