bookticket.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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:'',viewerList:[]},//页面信息
  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. const userId = this.pageContent.viewerList[0]?.id;
  217. this.$u.api.selectMemberAll({userid:userId}).then(res=>{
  218. // console.log('getMemberAll',res.data);
  219. this.visitorList = res.data.list;
  220. console.log('this.visitorList',this.visitorList);
  221. this.visitors = this.visitorList.filter(obj => obj.memberId==userId);
  222. this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.id));
  223. console.log('this.visitors',this.visitors);
  224. }).catch(err=>{
  225. console.log('getMemberAll',err);
  226. })
  227. },
  228. confirmVisitor(){
  229. let that = this;
  230. // console.log('selectedVisitor',this.selectedVisitor);
  231. this.visitorShow = false;
  232. this.visitors = this.visitorList.filter(obj => that.selectedVisitor.includes(obj.id));
  233. // console.log('this.visitors',this.visitors);
  234. },
  235. delVisitor(visitor){
  236. // console.log('delVisitor',visitor);
  237. this.visitors = this.visitors.filter(obj => obj.id!=visitor.id );
  238. },
  239. addVisitor(){
  240. uni.$u.route('/center/people', {
  241. type: 'addVisitor',
  242. fromPage:'bookticket'
  243. });
  244. },
  245. editVisitor(item){
  246. uni.$u.route('/center/people', {
  247. type: 'editVisitor',
  248. fromPage:'bookticket',
  249. id:item.id,
  250. name:item.name,
  251. mobile:item.mobile,
  252. idcard:item.idcard,
  253. });
  254. },
  255. submitorder(){
  256. this.cansubmit = false;
  257. console.log('pageData',this.pageData);
  258. console.log('visitors',this.visitors);
  259. console.log('params',this.params);
  260. },
  261. }
  262. }
  263. </script>
  264. <style>
  265. page{
  266. background: linear-gradient(180deg, #ED0000 0%, #F9FBFD 50%,#fff 100%);
  267. background-repeat: no-repeat;
  268. }
  269. </style>
  270. <style lang="scss" scoped>
  271. .base-info{
  272. border-radius: 30rpx;
  273. overflow: hidden;
  274. 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;
  275. background-size: 50% 100%;
  276. background-repeat: no-repeat;
  277. padding: 34rpx 36rpx;
  278. box-sizing: border-box;
  279. margin: 30rpx 0 40rpx;
  280. .up{
  281. margin-bottom: 36rpx;
  282. .img{
  283. display: block;
  284. width: 172rpx;
  285. height: 230rpx;
  286. border-radius: 20rpx;
  287. margin-right: 32rpx;
  288. }
  289. .text{
  290. font-size: 22rpx;
  291. font-weight: 400;
  292. color: #606060;
  293. line-height: 1;
  294. }
  295. .text-item{
  296. margin-bottom: 18rpx;
  297. }
  298. .name{
  299. font-size: 32rpx;
  300. font-weight: bold;
  301. color: #2D2D2D;
  302. }
  303. .addr{
  304. font-size: 24rpx;
  305. font-weight: 500;
  306. color: #2D2D2D;
  307. }
  308. }
  309. .down{
  310. position: relative;
  311. &:before{
  312. content: '';
  313. width: calc( 100% + 26rpx );
  314. height: 1px;
  315. position: absolute;
  316. left: -13rpx;
  317. top: -2rpx;
  318. border-top: 4rpx dashed #F39FA0;
  319. }
  320. .num-wrap{
  321. padding-top: 36rpx;
  322. }
  323. }
  324. }
  325. .block-wrap{
  326. background: #FFFFFF;
  327. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221,221,221,0.5);
  328. border-radius: 20rpx;
  329. margin-bottom: 28rpx;
  330. padding: 32rpx 30rpx 34rpx;
  331. .block-title{
  332. // padding-left: 16rpx;
  333. position: relative;
  334. margin-bottom: 22rpx;
  335. font-size: 24rpx;
  336. font-weight: 500;
  337. color: #CACACA;
  338. // &:before{
  339. // content: '';
  340. // width: 6rpx;
  341. // height: 32rpx;
  342. // background: #1677FF;
  343. // border-radius: 4rpx;
  344. // position: absolute;
  345. // left: 0;
  346. // top: 50%;
  347. // margin-top: -16rpx;
  348. // }
  349. .name{
  350. font-size: 32rpx;
  351. font-weight: bold;
  352. color: #2D2D2D;
  353. margin-right: 20rpx;
  354. }
  355. }
  356. .no-people{
  357. font-size: 28rpx;
  358. font-weight: 400;
  359. color: #7F7F7F;
  360. .right{
  361. margin-left: 20rpx;
  362. color: #1677FF;
  363. }
  364. }
  365. .peoples{
  366. font-size: 28rpx;
  367. font-weight: 400;
  368. color: #7F7F7F;
  369. margin-bottom: 24rpx;
  370. .peoples-item{
  371. margin-bottom: 10rpx;
  372. }
  373. .name{
  374. margin-left: 20rpx;
  375. margin-right: 28rpx;
  376. font-size: 28rpx;
  377. font-weight: bold;
  378. color: #363636;
  379. }
  380. .people-id{
  381. font-size: 20rpx;
  382. font-weight: 400;
  383. color: #606060;
  384. }
  385. .right{
  386. font-size: 28rpx;
  387. font-weight: 400;
  388. color: #ED0303;
  389. }
  390. }
  391. }
  392. .people-list{
  393. margin-bottom: 20rpx;
  394. .btn{
  395. width: 185rpx;
  396. height: 60rpx;
  397. line-height: 60rpx;
  398. font-size: 24rpx;
  399. font-weight: 500;
  400. color: #2D2D2D;
  401. background-color: #F1F1F1;
  402. border: 1px solid #F1F1F1;
  403. border-radius: 8rpx;
  404. margin-bottom: 12rpx;
  405. .text{
  406. margin-left: 16rpx;
  407. }
  408. &.people{
  409. margin-right: 16rpx;
  410. text-align: center;
  411. background-color: #FFF2F2;
  412. border-color: #ED0303;
  413. }
  414. }
  415. }
  416. .visitors{
  417. margin-bottom: 20rpx;
  418. }
  419. .people-show-content{
  420. background: #FFFFFF;
  421. border-radius: 40rpx 40rpx 0rpx 0rpx;
  422. padding: 30rpx 40rpx;
  423. .title{
  424. position: relative;
  425. font-size: 32rpx;
  426. font-weight: 500;
  427. color: #606060;
  428. margin-bottom: 46rpx;
  429. text-align: center;
  430. .cancel{
  431. position: absolute;
  432. left: 0;
  433. top: 0;
  434. }
  435. }
  436. .add-btn{
  437. margin-bottom: 28rpx;
  438. background: #E5F0FF;
  439. border-radius: 44rpx;
  440. padding: 26rpx;
  441. font-size: 24rpx;
  442. font-weight: 400;
  443. color: #1677FF;
  444. .img{
  445. width: 28rpx;
  446. height: 36rpx;
  447. margin-right: 36rpx;
  448. }
  449. }
  450. .list{
  451. /deep/ .u-radio-group{
  452. flex-wrap: wrap;
  453. }
  454. /deep/ .u-checkbox-group{
  455. flex-wrap: wrap;
  456. }
  457. overflow-y: auto;
  458. height: 40vh;
  459. .people{
  460. width: 100%;
  461. margin-bottom: 24rpx;
  462. }
  463. }
  464. .btn{}
  465. }
  466. .coupon{
  467. background: #FFFFFF;
  468. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232,232,232,0.5);
  469. border-radius: 16rpx;
  470. padding: 44rpx 36rpx;
  471. margin-bottom: 24rpx;
  472. .title{
  473. font-size: 28rpx;
  474. font-weight: bold;
  475. color: #2D2D2D;
  476. padding-bottom: 20rpx;
  477. margin-bottom: 26rpx;
  478. border-bottom-style:dashed;
  479. }
  480. .single-til{
  481. margin-bottom: 28rpx;
  482. .text{
  483. font-weight: 400;
  484. }
  485. }
  486. .no-coupon{
  487. height: 116rpx;
  488. line-height: 116rpx;
  489. text-align: center;
  490. background: #F9FAFD;
  491. border-radius: 8rpx;
  492. font-size: 24rpx;
  493. font-weight: 400;
  494. color: #C0C0C0;
  495. }
  496. }
  497. .notice{
  498. background: #FFFFFF;
  499. box-shadow: 0rpx 0rpx 16rpx 2rpx rgba(232,232,232,0.5);
  500. border-radius: 16rpx;
  501. padding: 44rpx 36rpx;
  502. margin-bottom: 24rpx;
  503. .title{
  504. font-size: 28rpx;
  505. font-weight: bold;
  506. color: #2D2D2D;
  507. padding-bottom: 20rpx;
  508. margin-bottom: 26rpx;
  509. border-bottom-style:dashed;
  510. }
  511. .notice-item{
  512. font-size: 24rpx;
  513. font-weight: 400;
  514. color: #7F7F7F;
  515. line-height: 36rpx;
  516. margin-bottom: 8rpx;
  517. }
  518. }
  519. .page-bottom{
  520. position: relative;
  521. z-index: 1001;
  522. height: 98rpx;
  523. padding: 24rpx 20rpx 50rpx;
  524. .inner{
  525. position: fixed;
  526. background-color: #fff;
  527. height: 98rpx;
  528. left: 0;
  529. right: 0;
  530. bottom: 0;
  531. padding: 24rpx 20rpx 50rpx;
  532. box-shadow: 0rpx -4rpx 12rpx 0rpx rgba(215,215,215,0.5);
  533. .total-price{
  534. font-size: 40rpx;
  535. font-weight: bold;
  536. color: #ED0000;
  537. }
  538. .btn{
  539. font-size: 28rpx;
  540. height: 80rpx;
  541. line-height: 80rpx;
  542. border-radius: 50rpx;
  543. padding: 0 50rpx;
  544. background-color: #eee;
  545. color: #333;
  546. text-align: center;
  547. &.active{
  548. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  549. color: #fff;
  550. }
  551. }
  552. }
  553. }
  554. .purchaser{
  555. .item{
  556. margin-bottom: 10rpx;
  557. font-size: 26rpx;
  558. color: #333;
  559. }
  560. .un-auth{
  561. padding: 26rpx;
  562. background-color: #eee;
  563. color: #333;
  564. text-align: center;
  565. border-radius: 8rpx;
  566. }
  567. }
  568. </style>