bookticket.vue 14 KB

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