ticketlist.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. <template>
  2. <view class="pages">
  3. <view class="navbar-box">
  4. <u-navbar title="票务购买" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="transparent"></u-navbar>
  5. </view>
  6. <view class="banner">
  7. <!-- <image class="img" :src="staticUrl+'/img/bookticket-banner.png'" alt=""> -->
  8. <!-- <image class="img" :src="theatre.showImg" alt=""> -->
  9. <u-swiper
  10. :list="performInfo.photoList"
  11. height="554rpx"
  12. indicatorMode="dot"
  13. :indicatorStyle="{bottom:'100rpx'}"
  14. keyName="imageUrl"
  15. radius="0"
  16. :indicator="false"
  17. circular
  18. ></u-swiper>
  19. <view class="content">
  20. <view class="share" @click="openShare(item)">
  21. <image class="icon" :src="staticUrl+'/img/share-ico.png'" ></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="base-info">
  26. <view class="inner">
  27. <view class="name">{{performInfo.name}}</view>
  28. <view class="addr u-flex u-row-between">
  29. <view class="text">演出地址:{{theatre.address||''}}</view>
  30. <view class="menu u-flex">
  31. <view class="item" @click="goMap">
  32. <image class="icon" :src="staticUrl+'/img/map-ico.png'" ></image>
  33. <text>导航</text>
  34. </view>
  35. <view class="item" @click="phoneCall">
  36. <image class="icon" :src="staticUrl+'/img/phone-call-ico.png'" ></image>
  37. <text>电话</text>
  38. </view>
  39. <!-- <u-icon name="arrow-right" color="#ffffff" size="36rpx" @click="goMap"></u-icon>
  40. <u-icon name="arrow-right" color="#ffffff" size="36rpx" @click="goMap"></u-icon> -->
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="tabs-wrap">
  46. <view class="inner">
  47. <u-tabs
  48. :list="tabsArr"
  49. @click="tabsClick"
  50. lineColor="#ED0000"
  51. lineWidth="82rpx"
  52. :activeStyle="{color: '#2D2D2D',fontWeight: 'bold'}"
  53. itemStyle="width:33%; height: 46px;box-sizing:border-box"
  54. >
  55. </u-tabs>
  56. </view>
  57. </view>
  58. <view class="page-wrap">
  59. <view class="ticket" v-if="tabsIndex==0">
  60. <view class="date-block">
  61. <view class="title">演出日期</view>
  62. <view class="date-list u-flex">
  63. <view class="date-item"
  64. :class="{active:dateIndex==index,dot:performDateList.find(item => item.performDate === `${date.year}-${date.month}-${date.day}`) !== undefined}"
  65. @click="dateClick(index)"
  66. v-for="(date,index) in dateList" :key="index">
  67. <!-- <view class="name">{{ date.name || ' ' }}</view> -->
  68. <!-- <view class="name">
  69. {{ performDateList.find(item => item.performDate === date.fullDay ) !== undefined?'有演出':'无演出' }}
  70. </view> -->
  71. <view class="name">
  72. {{date.fullDay|checkWeekDate}}
  73. </view>
  74. <view class="date">{{ date.month }} - {{ date.day }}</view>
  75. <image class="selected-img" :src="staticUrl+'/img/selected.png'"></image>
  76. </view>
  77. <view class="date-item more-date u-flex u-row-center" @click="calendarShow = true">
  78. <view class="text">
  79. <view class="">更多</view>
  80. <view class="">日期</view>
  81. </view>
  82. <u-icon name="arrow-right" color="#7F7F7F" size="24rpx"></u-icon>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="date-block auditorium">
  87. <view class="title">演出厅</view>
  88. <view class="date-list u-flex u-flex-wrap">
  89. <view class="date-item" :class="{active:auditoriumIndex==index}" @click="auditoriumClick(index)" v-for="(date,index) in auditoriumList" :key="index">
  90. <view class="name">{{ date.name }}</view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="date-block session-wrap">
  95. <view class="title">演出场次</view>
  96. <view class="session">
  97. <view class="session-item" :class="{active:sessionIndex==index}" @click="sessionClick(index)" v-for="(date,index) in sessionList" :key="index">
  98. {{ date.performTimeStart}} - {{date.performTimeEnd}}
  99. </view>
  100. </view>
  101. <view class="empty" v-if="auditoriumList.length>=1&&sessionList.length<1">
  102. 当前日期暂无演出场次,请重新选择
  103. </view>
  104. </view>
  105. <view class="date-block ticket-type">
  106. <view class="title">门票</view>
  107. <view class="empty" v-if="ticketTypeList.length<1">
  108. 暂无门票
  109. </view>
  110. <view class="type-item" :class="{active:sessionIndex==index}" v-for="(item,index) in ticketTypeList" :key="index">
  111. <view class="name-price u-flex u-row-between">
  112. <view class="name">{{item.goodsName}}</view>
  113. <view class="prices">¥ {{item.salePrice}} 起</view>
  114. </view>
  115. <!-- <view class="ishave">
  116. <text class="text">{{(item.quantity>0&&sessionList.length>=1)?'有票':'无票'}}</text>
  117. </view> -->
  118. <view class="bottom u-flex u-row-between">
  119. <view class="left u-flex" v-html="item.goodsSnapshot||''">
  120. <!-- 购票须知
  121. <u-icon name="arrow-right" color="#7F7F7F" size="24rpx"></u-icon> -->
  122. <!-- {{item.goodsSnapshot||''}} -->
  123. </view>
  124. <view class="btn" @click="book(item)" v-if="item.quantity!==0&&sessionList.length>=1">预定</view>
  125. <view class="btn disabled" v-else>无票</view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- ticket end -->
  131. <view class="details" v-if="tabsIndex==1">
  132. <view class="details-block">
  133. <view class="title">剧情简介</view>
  134. <view class="intro parse-content">
  135. <u-parse :content="performInfo.performSnapshot"></u-parse>
  136. </view>
  137. </view>
  138. <view class="details-block actors">
  139. <view class="title u-flex u-row-between">
  140. 演职人员
  141. <view class="right u-flex" @click="$u.route('pages/actors',{performId:performId})">
  142. <text>更多</text>
  143. <u-icon name="arrow-right" color="#7F7F7F" size="24rpx"></u-icon>
  144. </view>
  145. </view>
  146. <view class="actor-list">
  147. <u-scroll-list :indicator="false">
  148. <view class="item" v-for="(item, index) in actorsArr" :key="index">
  149. <image class="img" :src="item.performerHead||staticUrl+'/img/actors.png'"></image>
  150. <view class="text">
  151. <view class="name">{{item.performerName}}</view>
  152. <view class="role u-line-1">{{item.performerRole}}</view>
  153. </view>
  154. </view>
  155. </u-scroll-list>
  156. <u-empty text="暂无" v-if="actorsArr.length<1"></u-empty>
  157. </view>
  158. </view>
  159. </view>
  160. <view class="viewingTips parse-content" v-if="tabsIndex==2">
  161. <u-parse :content="formerNotice"></u-parse>
  162. </view>
  163. </view>
  164. <!-- :maxDate="maxDate" -->
  165. <u-calendar
  166. ref="calendar"
  167. :formatter="formatter"
  168. :maxDate="maxDate"
  169. monthNum="12"
  170. :show="calendarShow"
  171. color="#EF1010"
  172. :closeOnClickOverlay="true"
  173. @close="closeCalendar"
  174. @confirm="confirmCalendar">
  175. </u-calendar>
  176. <!-- 分享选择弹出内容 -->
  177. <view class="share-option" :class="{shareShow:shareShow}">
  178. <view class="overlay" v-if="shareShow" @click="shareShow=false"></view>
  179. <button class="share-option-item wx-share" data-name="shareBtn" open-type="share">
  180. 发送给朋友
  181. </button>
  182. <view class="share-option-item" @click="getPoster">生成海报</view>
  183. <view class="share-option-item" @click="shareShow=false">取消</view>
  184. </view>
  185. <u-popup :show="posterShow" @close="posterShow=false" ref="uni-popup">
  186. <view class="poster-wrap u-flex u-col-center">
  187. <view class="poster-inner">
  188. <view class="close-wrap" @click="posterShow=false">
  189. <u-icon name="close-circle" color="#fff" size="56rpx"></u-icon>
  190. </view>
  191. <view class="poster" id="poster" ref="poster" >
  192. <u--image :showLoading="true" :src="posterSrc" width="100%" height="65vh" mode="aspectFit"></u--image>
  193. </view>
  194. <!-- savePoster -->
  195. <view class="poster-btn" @click="saveImage">保存图片</view>
  196. </view>
  197. </view>
  198. </u-popup>
  199. <canvas canvas-id="canvas" class="canvas" style="width: 670px; height: 900px;"></canvas>
  200. </view>
  201. </template>
  202. <script>
  203. import moment from 'moment';
  204. import { systemInfo } from "@/mixin.js";
  205. // 日历
  206. const d = new Date()
  207. const year = d.getFullYear()
  208. let month = d.getMonth() + 1
  209. month = month < 10 ? `0${month}` : month
  210. const date = d.getDate()
  211. // 日历
  212. // 算最大日期
  213. const maxd = new Date()
  214. maxd.setMonth(maxd.getMonth() + 12) // 将月份加3
  215. const maxdyear = maxd.getFullYear()
  216. let maxdmonth = maxd.getMonth() + 1
  217. maxdmonth = maxdmonth < 10 ? `0${maxdmonth}` : maxdmonth
  218. const maxddate = maxd.getDate()
  219. const theMaxDate = `${maxdyear}-${maxdmonth}-${maxddate}`
  220. // console.log('theMaxDate=============================',theMaxDate) //输出:
  221. //算最大日期
  222. let parentThis= null;
  223. export default {
  224. mixins:[systemInfo],
  225. data() {
  226. return {
  227. performId:'',
  228. staticUrl:this.$commonConfig.staticUrl,
  229. tabsArr:[
  230. {name:'票务购买'},
  231. {name:'演出详情'},
  232. {name:'观影须知'}
  233. ],
  234. theatre:{},
  235. tabsIndex:0,
  236. dateList:[],
  237. dateIndex:0,
  238. calendarShow:false,//日历
  239. // maxDate:`${year}-${month}-${date + 30}`,
  240. maxDate:theMaxDate,
  241. auditoriumList:[],//演艺厅
  242. auditoriumIndex:0,
  243. sessionList:[],//演出场次
  244. sessionIndex:0,
  245. ticketTypeList:[],//门票
  246. actorsArr:[],
  247. shareShow:false,
  248. posterShow:false,
  249. posterSrc:'',
  250. posterSrcType:null,
  251. performInfo:{},//节目详情
  252. formerNotice:{},//节目观影须知
  253. performDateList:[],//有票的日期
  254. // firstGet:0,
  255. }
  256. },
  257. onShow() {
  258. },
  259. onLoad(page) {
  260. parentThis = this;
  261. console.log('page',page);
  262. this.performId = page.id;
  263. this.getPerformData();
  264. // this.getSystemInfo();
  265. let today = new Date();
  266. this.setDate(today);
  267. this.getPerformInfo();
  268. this.getPerformerNotice();
  269. },
  270. onReady() {
  271. // 如果需要兼容微信小程序的话,需要用此写法
  272. this.$refs.calendar.setFormatter(this.formatter);
  273. },
  274. methods: {
  275. leftClick(e){
  276. let pages = getCurrentPages();
  277. if(pages.length==1){
  278. uni.$u.route('/pages/index/index')
  279. }else{
  280. uni.navigateBack()
  281. };
  282. },
  283. getPerformData(){
  284. this.$u.api.performSell({performId:this.performId}).then(res=>{
  285. // console.log('getPerformData',res.data);
  286. this.theatre = res.data.theatreList[0];
  287. this.auditoriumList = res.data.theatreList[0].auditoriumList;
  288. this.ticketTypeList = res.data.goodsList;
  289. this.performDateList = this.auditoriumList[this.auditoriumIndex].performDateList;
  290. this.getDate()
  291. // console.log('auditoriumList',this.auditoriumList);
  292. }).catch(err=>{
  293. console.log('getPoster',err);
  294. })
  295. },
  296. getPerformInfo(){
  297. this.$u.api.performInfo({id:this.performId}).then(res=>{
  298. // console.log('getPerformInfo',res.data);
  299. this.performInfo = res.data;
  300. this.actorsArr = res.data.performerList;
  301. }).catch(err=>{
  302. console.log('getPerformInfo',err);
  303. })
  304. },
  305. getPerformerNotice(){
  306. this.$u.api.performerNotice({performId:this.performId}).then(res=>{
  307. // console.log('getPerformerNotice',res.data);
  308. this.formerNotice = res.data.performNotice;
  309. }).catch(err=>{
  310. console.log('getPerformerNotice',err);
  311. })
  312. },
  313. getDate(){
  314. let param = {
  315. auditoriumId:this.auditoriumList[this.auditoriumIndex]?.id,//演艺厅ID(演艺厅列表)
  316. performId:this.performId,
  317. };
  318. this.$u.api.getAuditoriumDate(param).then(res=>{
  319. console.log('getDate',res.data);
  320. this.performDateList = res.data.list||[];
  321. this.setDate();
  322. // this.getTimes();
  323. }).catch(err=>{
  324. console.log('getDate',err);
  325. })
  326. },
  327. getTimes(){
  328. // this.firstGet++;
  329. uni.showLoading();
  330. let auditoriumId= this.auditoriumList[this.auditoriumIndex]?.id;
  331. if(!auditoriumId){return}
  332. let dateOBJ = this.dateList[this.dateIndex];
  333. let param = {
  334. auditoriumId:auditoriumId,//演艺厅ID(演艺厅列表)
  335. performId:this.performId,
  336. date:`${dateOBJ.year}-${dateOBJ.month}-${dateOBJ.day}`
  337. };
  338. // console.log('param',param);
  339. this.$u.api.getAuditoriumTimes(param).then(res=>{
  340. // console.log('getTimes',res.data);
  341. this.sessionList = res.data.list.map(item=>{
  342. item.performTimeStart = item.performTimeStart;
  343. item.performTimeEnd = item.performTimeEnd;
  344. return item
  345. });
  346. uni.hideLoading();
  347. }).catch(err=>{
  348. console.log('getPoster',err);
  349. })
  350. },
  351. formatter: (day) => {
  352. day.date = moment(day.date).format("YYYY-MM-DD HH:mm:ss")
  353. // console.log('day',day);
  354. // console.log('thisthisthisthisthisthisthisthisthis',parentThis);
  355. // console.log('==================================',day.date.toISOString().split('T')[0]);
  356. let ticket = parentThis.performDateList.find(item => item.performDate === day.date.split(' ')[0]);
  357. if(ticket){
  358. day.dot = true
  359. }
  360. // if(ticket&&ticket.ishave){
  361. // day.bottomInfo = '有票'
  362. // day.dot = true
  363. // }else if(ticket){
  364. // day.dot = true
  365. // }
  366. return day
  367. },
  368. setDate(firstDay,isSelect){
  369. if(this.performDateList[0]?.performDate&&!isSelect){
  370. // firstDay = new Date(this.performDateList[0].performDate);
  371. const uniquePerformDateList = Array.from(new Set(this.performDateList.map(JSON.stringify))).map(JSON.parse);//去重
  372. // console.log('uniquePerformDateList',uniquePerformDateList);
  373. let arr = uniquePerformDateList.slice(0, 3);//只要前三项
  374. this.dateList = arr.map(item=>{
  375. // console.log('uniquePerformDateList item',item);
  376. let day = item.performDate.split('-');
  377. // console.log('setDate day',day);
  378. return { year:day[0],month:String(day[1]),day:String(day[2]), fullDay:`${day[0]}-${String(day[1])}-${String(day[2])}`}
  379. });
  380. // console.log('this.firstGet',this.firstGet);
  381. this.getTimes();
  382. //
  383. return
  384. }
  385. // console.log('this.dateListthis.dateListthis.dateListthis.dateList',this.dateList);
  386. // 前端写演出日期(今天,明天,后天)
  387. let today = firstDay;
  388. let tomorrow = new Date();
  389. tomorrow.setDate(today.getDate() + 1);
  390. let afterTomorrow = new Date();
  391. afterTomorrow.setDate(today.getDate() + 2);
  392. this.dateList = [
  393. {
  394. year: today.getFullYear(),
  395. month: String(today.getMonth() + 1).padStart(2, '0'),
  396. day: String(today.getDate()).padStart(2, '0'),
  397. name: '日期',
  398. fullDay:`${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${ String(today.getDate()).padStart(2, '0')}`
  399. },
  400. {
  401. year: tomorrow.getFullYear(),
  402. month: String(tomorrow.getMonth() + 1).padStart(2, '0'),
  403. day: String(tomorrow.getDate()).padStart(2, '0'),
  404. name: '日期',
  405. fullDay:`${tomorrow.getFullYear()}-${String(tomorrow.getMonth() + 1).padStart(2, '0')}-${ String(tomorrow.getDate()).padStart(2, '0')}`
  406. },
  407. {
  408. year: afterTomorrow.getFullYear(),
  409. month: String(afterTomorrow.getMonth() + 1).padStart(2, '0'),
  410. day: String(afterTomorrow.getDate()).padStart(2, '0'),
  411. name: '日期',
  412. fullDay:`${afterTomorrow.getFullYear()}-${String(afterTomorrow.getMonth() + 1).padStart(2, '0')}-${ String(afterTomorrow.getDate()).padStart(2, '0')}`
  413. }
  414. ];
  415. this.getTimes()
  416. // console.log('this.dateList ',this.dateList);
  417. },
  418. dateClick(index){
  419. this.dateIndex = index;
  420. this.getTimes()
  421. },
  422. auditoriumClick(index){
  423. this.auditoriumIndex = index;
  424. this.getDate();
  425. },
  426. confirmCalendar(e){
  427. console.log('confirmCalendar',e);
  428. // this.getDate(e)
  429. this.dateIndex = 0;
  430. this.setDate( new Date(e),true );
  431. // console.log('maxDate',this.maxDate);
  432. // console.log('dateList',this.dateList);
  433. this.calendarShow = false;
  434. },
  435. closeCalendar(){
  436. this.calendarShow = false;
  437. },
  438. tabsClick(e){
  439. // console.log('tabsClick',e);
  440. this.tabsIndex = e.index;
  441. },
  442. sessionClick(index){
  443. this.sessionIndex = index;
  444. },
  445. book(item){
  446. // console.log('book',item);
  447. // console.log('performInfo',this.performInfo);
  448. let session = this.sessionList[this.sessionIndex];
  449. // console.log('session',session);
  450. let performTimeStart = session.performTimeStart;
  451. let performTimeEnd = session.performTimeEnd;
  452. let dateOBJ = this.dateList[this.dateIndex];
  453. uni.$u.route('pages/chosenposition',{
  454. goodsId:item.id,
  455. performId:this.performId,
  456. performName:this.performInfo.name,
  457. day:`${dateOBJ.year}-${dateOBJ.month}-${dateOBJ.day}`,
  458. performTimeStart:session.performTimeStart,
  459. performTimeEnd:session.performTimeEnd,
  460. performTimeId:session.id,
  461. auditoriumId:this.auditoriumList[this.auditoriumIndex].id
  462. })
  463. },
  464. openShare(){
  465. this.shareShow = true;
  466. },
  467. // 海报相关开始
  468. getPoster(item){
  469. this.posterShow = true;
  470. this.shareShow = false;
  471. // 后端生成海报
  472. // this.$u.api.performQrcode({performId:this.performId}).then(res=>{
  473. // this.posterSrc = res.data.imageUrl;
  474. // // console.log('getPoster',res.data);
  475. // }).catch(err=>{
  476. // console.log('getPoster',err);
  477. // })
  478. //前端生成海报
  479. uni.showLoading({
  480. title: '生成海报中'
  481. });
  482. // 前端生成海报开始
  483. let that = this;
  484. const ctx = uni.createCanvasContext('canvas', this);
  485. // 加载海报背景图
  486. uni.getImageInfo({
  487. src: this.performInfo.posterImg,
  488. success: res1 => {
  489. const img1 = res1.path;
  490. // 加载海报二维码
  491. uni.getImageInfo({
  492. src: this.performInfo.appletQrcode,
  493. success: res2 => {
  494. const img2 = res2.path;
  495. // 绘制海报背景图
  496. ctx.drawImage(img1, 0, 0, 670, 900);
  497. // 绘制海报二维码
  498. ctx.drawImage(img2, 468, 724, 188, 166);
  499. // 绘制完成后导出图片并显示
  500. ctx.draw(false, () => {
  501. uni.canvasToTempFilePath({
  502. canvasId: 'canvas',
  503. success: res3 => {
  504. this.posterSrc = res3.tempFilePath;
  505. this.posterSrcType = 'local';
  506. },
  507. fail: err => {
  508. console.error(err);
  509. },
  510. }, this);
  511. });
  512. },
  513. fail: err2 => {
  514. console.error(err2);
  515. },
  516. });
  517. },
  518. fail: err1 => {
  519. console.error(err1);
  520. },
  521. complete: () => {
  522. uni.hideLoading()
  523. }
  524. });
  525. // 前端生成海报结束
  526. },
  527. saveImage() {
  528. let that = this;
  529. uni.showLoading({
  530. title: '保存中'
  531. });
  532. if(this.posterSrcType == 'local'){
  533. let params = {
  534. tempFilePath:that.posterSrc
  535. }
  536. that.saveImageToPhotosAlbum(params);
  537. return
  538. }
  539. uni.downloadFile({
  540. url: this.posterSrc,
  541. success(res) {
  542. if (res.statusCode === 200) {
  543. that.saveImageToPhotosAlbum(res)
  544. } else {
  545. uni.showToast({
  546. title: '下载图片失败',
  547. icon: 'none'
  548. });
  549. }
  550. },
  551. fail(e) {
  552. console.log('下载图片失败', e);
  553. console.log('posterSrc',that.posterSrc);
  554. uni.showToast({
  555. title: '下载图片失败',
  556. icon: 'none'
  557. });
  558. }
  559. });
  560. },
  561. saveImageToPhotosAlbum(res){
  562. let that = this;
  563. uni.saveImageToPhotosAlbum({
  564. filePath: res.tempFilePath,
  565. success() {
  566. uni.showToast({
  567. title: '保存到相册成功',
  568. icon: 'success'
  569. });
  570. },
  571. fail(err) {
  572. console.log('保存图片失败',err);
  573. if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
  574. uni.getSetting({
  575. success(res) {
  576. if (!res.authSetting['scope.writePhotosAlbum']) {
  577. uni.showModal({
  578. title: '提示',
  579. content: '您还没有授权访问相册,请前往设置页面打开权限。',
  580. confirmText: '去设置',
  581. success(res) {
  582. if (res.confirm) {
  583. uni.openSetting();
  584. }
  585. }
  586. });
  587. } else {
  588. uni.showToast({
  589. title: '保存图片失败',
  590. icon: 'none'
  591. });
  592. }
  593. }
  594. });
  595. } else {
  596. uni.showToast({
  597. title: '保存图片失败',
  598. icon: 'none'
  599. });
  600. }
  601. },
  602. complete() {
  603. uni.hideLoading();
  604. that.posterShow = false;
  605. }
  606. });
  607. },
  608. // 海报相关结束
  609. goMap(){
  610. uni.openLocation({
  611. latitude:Number(this.theatre.latitude), //维度
  612. longitude: Number(this.theatre.longitude), //经度
  613. name: this.theatre.name, //目的地定位名称
  614. scale: 15, //缩放比例
  615. address: this.theatre.address //导航详细地址
  616. })
  617. },
  618. phoneCall(){
  619. // console.log('this.theatre',this.theatre);
  620. uni.makePhoneCall({
  621. phoneNumber: this.theatre.customerServiceMobile,
  622. success() {
  623. console.log('success');
  624. },
  625. fail() {
  626. console.log('fail');
  627. }
  628. });
  629. }
  630. }
  631. }
  632. </script>
  633. <style lang="scss" scoped>
  634. .banner{
  635. position: relative;
  636. .img{
  637. width: 750rpx;
  638. height: 554rpx;
  639. display: block;
  640. }
  641. .content{
  642. position: absolute;
  643. width: 100%;
  644. box-sizing: border-box;
  645. padding: 0 32rpx;
  646. left: 0;
  647. bottom: 200rpx;
  648. }
  649. .share{
  650. overflow: hidden;
  651. margin-bottom: 100rpx;
  652. .icon{
  653. float: right;
  654. display: block;
  655. width: 32rpx;
  656. height: 32rpx;
  657. padding: 10rpx;
  658. border-radius: 50%;
  659. background-color: rgba(0,0,0,0.4);
  660. }
  661. }
  662. }
  663. .base-info{
  664. position: relative;
  665. // margin-bottom: 54rpx;
  666. .inner{
  667. position: relative;
  668. padding: 50rpx 38rpx 58rpx 40rpx;
  669. background-color: #FFFFFF;
  670. border-radius: 32rpx 32rpx 0rpx 0rpx;
  671. margin-top: -30px;
  672. border-bottom: 12rpx solid #F7F8F9;
  673. }
  674. .name{
  675. font-size: 40rpx;
  676. font-weight: 800;
  677. color: #2D2D2D;
  678. margin-bottom: 26rpx;
  679. }
  680. .addr{
  681. font-size: 26rpx;
  682. font-weight: 400;
  683. color: #606060;
  684. }
  685. .menu{
  686. .item{
  687. margin-left: 18rpx;
  688. font-size: 18rpx;
  689. font-weight: 400;
  690. color: #999999;
  691. text-align: center;
  692. }
  693. .icon{
  694. width: 62rpx;
  695. height: 64rpx;
  696. display: block;
  697. margin-bottom: 4rpx;
  698. }
  699. }
  700. }
  701. .tabs-wrap{
  702. position: relative;
  703. margin-bottom: 54rpx;
  704. &::after{
  705. content: '';
  706. width: 100%;
  707. height: 1px;
  708. background-color: #eee;
  709. position: absolute;
  710. left: 0;
  711. right: 0;
  712. bottom: -46rpx;
  713. }
  714. .inner{
  715. position: relative;
  716. padding-top: 48rpx;
  717. background-color: #FFFFFF;
  718. // border-radius: 32rpx 32rpx 0rpx 0rpx;
  719. height: 46rpx;
  720. // margin-top: -30px;
  721. }
  722. }
  723. .date-block{
  724. margin-bottom: 64rpx;
  725. }
  726. .title{
  727. font-size: 32rpx;
  728. font-weight: bold;
  729. color: #2D2D2D;
  730. line-height: 48rpx;
  731. margin-bottom: 38rpx;
  732. }
  733. .empty{
  734. background-color: #636363;
  735. color: #979797;
  736. border-radius: 8rpx;
  737. padding: 24rpx;
  738. text-align: center;
  739. }
  740. .session-wrap{
  741. }
  742. .session{
  743. display: grid;
  744. grid-template-columns: repeat(3, 1fr);
  745. gap: 20rpx;
  746. .session-item{
  747. height: 80rpx;
  748. line-height: 80rpx;
  749. border-radius: 12rpx;
  750. border: 2rpx solid #636363;
  751. text-align: center;
  752. font-size: 24rpx;
  753. font-weight: 400;
  754. color: #636363;
  755. &.active{
  756. color: #ED0000;
  757. border-color: #ED0000;
  758. }
  759. }
  760. }
  761. .ticket-type{
  762. .type-item{
  763. background: #FFFFFF;
  764. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(180,180,180,0.5);
  765. border-radius: 20rpx;
  766. margin-bottom: 20rpx;
  767. padding: 38rpx 40rpx;
  768. .name-price{
  769. margin-bottom: 26rpx;
  770. }
  771. .name{
  772. font-size: 28rpx;
  773. font-weight: 500;
  774. color: #363636;
  775. }
  776. .prices{
  777. font-size: 36rpx;
  778. font-weight: bold;
  779. color: #ED0000;
  780. }
  781. .ishave{
  782. margin-bottom: 26rpx;
  783. .text{
  784. height: 30rpx;
  785. line-height: 30rpx;
  786. padding: 0 22rpx;
  787. background: #FFC8C8;
  788. border-radius: 20rpx;
  789. font-size: 20rpx;
  790. font-weight: 400;
  791. color: #ED0000;
  792. }
  793. }
  794. .bottom{
  795. font-size: 22rpx;
  796. font-weight: 400;
  797. color: #7F7F7F;
  798. .btn{
  799. height: 60rpx;
  800. line-height: 60rpx;
  801. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  802. border-radius: 30rpx;
  803. padding: 0 36rpx;
  804. font-size: 28rpx;
  805. font-weight: 500;
  806. color: #FFFFFF;
  807. &.disabled{
  808. background: #979797;
  809. }
  810. }
  811. }
  812. }
  813. }
  814. .details{
  815. .title{}
  816. .details-block{
  817. background: #FFFFFF;
  818. box-shadow: 0rpx 2rpx 12rpx 2rpx rgba(221,221,221,0.5);
  819. border-radius: 20rpx;
  820. margin-bottom: 24rpx;
  821. padding: 36rpx;
  822. &.actors{
  823. .title{
  824. .right{
  825. font-size: 24rpx;
  826. font-weight: 400;
  827. color: #7F7F7F;
  828. }
  829. }
  830. }
  831. }
  832. .intro{
  833. font-size: 26rpx;
  834. font-weight: 400;
  835. color: #4E4E4E;
  836. line-height: 40rpx;
  837. }
  838. .actor-list{
  839. .item{
  840. flex-shrink: 0;
  841. width: 160rpx;
  842. text-align: center;
  843. margin-right: 24rpx;
  844. }
  845. .img{
  846. display: block;
  847. width: 100%;
  848. height: 200rpx;
  849. margin-bottom: 16rpx;
  850. }
  851. .name{
  852. font-size: 28rpx;
  853. font-weight: 500;
  854. color: #2D2D2D;
  855. line-height: 42rpx;
  856. margin-bottom: 4rpx;
  857. }
  858. .role{
  859. font-size: 24rpx;
  860. font-weight: 400;
  861. color: #7F7F7F;
  862. line-height: 36rpx;
  863. }
  864. }
  865. }
  866. .canvas{
  867. position: absolute;
  868. left: -99999px;
  869. }
  870. </style>