ticketlist.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  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. // console.log('this.dateList ',this.dateList);
  416. },
  417. dateClick(index){
  418. this.dateIndex = index;
  419. this.getDate()
  420. },
  421. auditoriumClick(index){
  422. this.auditoriumIndex = index;
  423. this.getDate();
  424. },
  425. confirmCalendar(e){
  426. // console.log('confirmCalendar',e);
  427. this.setDate( new Date(e),true );
  428. this.dateIndex = 0;
  429. // console.log('maxDate',this.maxDate);
  430. // console.log('dateList',this.dateList);
  431. this.calendarShow = false;
  432. },
  433. closeCalendar(){
  434. this.calendarShow = false;
  435. },
  436. tabsClick(e){
  437. // console.log('tabsClick',e);
  438. this.tabsIndex = e.index;
  439. },
  440. sessionClick(index){
  441. this.sessionIndex = index;
  442. },
  443. book(item){
  444. // console.log('book',item);
  445. // console.log('performInfo',this.performInfo);
  446. let session = this.sessionList[this.sessionIndex];
  447. // console.log('session',session);
  448. let performTimeStart = session.performTimeStart;
  449. let performTimeEnd = session.performTimeEnd;
  450. let dateOBJ = this.dateList[this.dateIndex];
  451. uni.$u.route('pages/chosenposition',{
  452. goodsId:item.id,
  453. performId:this.performId,
  454. performName:this.performInfo.name,
  455. day:`${dateOBJ.year}-${dateOBJ.month}-${dateOBJ.day}`,
  456. performTimeStart:session.performTimeStart,
  457. performTimeEnd:session.performTimeEnd,
  458. performTimeId:session.id,
  459. auditoriumId:this.auditoriumList[this.auditoriumIndex].id
  460. })
  461. },
  462. openShare(){
  463. this.shareShow = true;
  464. },
  465. // 海报相关开始
  466. getPoster(item){
  467. this.posterShow = true;
  468. this.shareShow = false;
  469. // 后端生成海报
  470. // this.$u.api.performQrcode({performId:this.performId}).then(res=>{
  471. // this.posterSrc = res.data.imageUrl;
  472. // // console.log('getPoster',res.data);
  473. // }).catch(err=>{
  474. // console.log('getPoster',err);
  475. // })
  476. //前端生成海报
  477. uni.showLoading({
  478. title: '生成海报中'
  479. });
  480. // 前端生成海报开始
  481. let that = this;
  482. const ctx = uni.createCanvasContext('canvas', this);
  483. // 加载海报背景图
  484. uni.getImageInfo({
  485. src: this.performInfo.posterImg,
  486. success: res1 => {
  487. const img1 = res1.path;
  488. // 加载海报二维码
  489. uni.getImageInfo({
  490. src: this.performInfo.appletQrcode,
  491. success: res2 => {
  492. const img2 = res2.path;
  493. // 绘制海报背景图
  494. ctx.drawImage(img1, 0, 0, 670, 900);
  495. // 绘制海报二维码
  496. ctx.drawImage(img2, 468, 724, 188, 166);
  497. // 绘制完成后导出图片并显示
  498. ctx.draw(false, () => {
  499. uni.canvasToTempFilePath({
  500. canvasId: 'canvas',
  501. success: res3 => {
  502. this.posterSrc = res3.tempFilePath;
  503. this.posterSrcType = 'local';
  504. },
  505. fail: err => {
  506. console.error(err);
  507. },
  508. }, this);
  509. });
  510. },
  511. fail: err2 => {
  512. console.error(err2);
  513. },
  514. });
  515. },
  516. fail: err1 => {
  517. console.error(err1);
  518. },
  519. complete: () => {
  520. uni.hideLoading()
  521. }
  522. });
  523. // 前端生成海报结束
  524. },
  525. saveImage() {
  526. let that = this;
  527. uni.showLoading({
  528. title: '保存中'
  529. });
  530. if(this.posterSrcType == 'local'){
  531. let params = {
  532. tempFilePath:that.posterSrc
  533. }
  534. that.saveImageToPhotosAlbum(params);
  535. return
  536. }
  537. uni.downloadFile({
  538. url: this.posterSrc,
  539. success(res) {
  540. if (res.statusCode === 200) {
  541. that.saveImageToPhotosAlbum(res)
  542. } else {
  543. uni.showToast({
  544. title: '下载图片失败',
  545. icon: 'none'
  546. });
  547. }
  548. },
  549. fail(e) {
  550. console.log('下载图片失败', e);
  551. console.log('posterSrc',that.posterSrc);
  552. uni.showToast({
  553. title: '下载图片失败',
  554. icon: 'none'
  555. });
  556. }
  557. });
  558. },
  559. saveImageToPhotosAlbum(res){
  560. let that = this;
  561. uni.saveImageToPhotosAlbum({
  562. filePath: res.tempFilePath,
  563. success() {
  564. uni.showToast({
  565. title: '保存到相册成功',
  566. icon: 'success'
  567. });
  568. },
  569. fail(err) {
  570. console.log('保存图片失败',err);
  571. if (err.errMsg === 'saveImageToPhotosAlbum:fail auth deny') {
  572. uni.getSetting({
  573. success(res) {
  574. if (!res.authSetting['scope.writePhotosAlbum']) {
  575. uni.showModal({
  576. title: '提示',
  577. content: '您还没有授权访问相册,请前往设置页面打开权限。',
  578. confirmText: '去设置',
  579. success(res) {
  580. if (res.confirm) {
  581. uni.openSetting();
  582. }
  583. }
  584. });
  585. } else {
  586. uni.showToast({
  587. title: '保存图片失败',
  588. icon: 'none'
  589. });
  590. }
  591. }
  592. });
  593. } else {
  594. uni.showToast({
  595. title: '保存图片失败',
  596. icon: 'none'
  597. });
  598. }
  599. },
  600. complete() {
  601. uni.hideLoading();
  602. that.posterShow = false;
  603. }
  604. });
  605. },
  606. // 海报相关结束
  607. goMap(){
  608. uni.openLocation({
  609. latitude:Number(this.theatre.latitude), //维度
  610. longitude: Number(this.theatre.longitude), //经度
  611. name: this.theatre.name, //目的地定位名称
  612. scale: 15, //缩放比例
  613. address: this.theatre.address //导航详细地址
  614. })
  615. },
  616. phoneCall(){
  617. // console.log('this.theatre',this.theatre);
  618. uni.makePhoneCall({
  619. phoneNumber: this.theatre.customerServiceMobile,
  620. success() {
  621. console.log('success');
  622. },
  623. fail() {
  624. console.log('fail');
  625. }
  626. });
  627. }
  628. }
  629. }
  630. </script>
  631. <style lang="scss" scoped>
  632. .banner{
  633. position: relative;
  634. .img{
  635. width: 750rpx;
  636. height: 554rpx;
  637. display: block;
  638. }
  639. .content{
  640. position: absolute;
  641. width: 100%;
  642. box-sizing: border-box;
  643. padding: 0 32rpx;
  644. left: 0;
  645. bottom: 200rpx;
  646. }
  647. .share{
  648. overflow: hidden;
  649. margin-bottom: 100rpx;
  650. .icon{
  651. float: right;
  652. display: block;
  653. width: 32rpx;
  654. height: 32rpx;
  655. padding: 10rpx;
  656. border-radius: 50%;
  657. background-color: rgba(0,0,0,0.4);
  658. }
  659. }
  660. }
  661. .base-info{
  662. position: relative;
  663. // margin-bottom: 54rpx;
  664. .inner{
  665. position: relative;
  666. padding: 50rpx 38rpx 58rpx 40rpx;
  667. background-color: #FFFFFF;
  668. border-radius: 32rpx 32rpx 0rpx 0rpx;
  669. margin-top: -30px;
  670. border-bottom: 12rpx solid #F7F8F9;
  671. }
  672. .name{
  673. font-size: 40rpx;
  674. font-weight: 800;
  675. color: #2D2D2D;
  676. margin-bottom: 26rpx;
  677. }
  678. .addr{
  679. font-size: 26rpx;
  680. font-weight: 400;
  681. color: #606060;
  682. }
  683. .menu{
  684. .item{
  685. margin-left: 18rpx;
  686. font-size: 18rpx;
  687. font-weight: 400;
  688. color: #999999;
  689. text-align: center;
  690. }
  691. .icon{
  692. width: 62rpx;
  693. height: 64rpx;
  694. display: block;
  695. margin-bottom: 4rpx;
  696. }
  697. }
  698. }
  699. .tabs-wrap{
  700. position: relative;
  701. margin-bottom: 54rpx;
  702. &::after{
  703. content: '';
  704. width: 100%;
  705. height: 1px;
  706. background-color: #eee;
  707. position: absolute;
  708. left: 0;
  709. right: 0;
  710. bottom: -46rpx;
  711. }
  712. .inner{
  713. position: relative;
  714. padding-top: 48rpx;
  715. background-color: #FFFFFF;
  716. // border-radius: 32rpx 32rpx 0rpx 0rpx;
  717. height: 46rpx;
  718. // margin-top: -30px;
  719. }
  720. }
  721. .date-block{
  722. margin-bottom: 64rpx;
  723. }
  724. .title{
  725. font-size: 32rpx;
  726. font-weight: bold;
  727. color: #2D2D2D;
  728. line-height: 48rpx;
  729. margin-bottom: 38rpx;
  730. }
  731. .empty{
  732. background-color: #636363;
  733. color: #979797;
  734. border-radius: 8rpx;
  735. padding: 24rpx;
  736. text-align: center;
  737. }
  738. .session-wrap{
  739. }
  740. .session{
  741. display: grid;
  742. grid-template-columns: repeat(3, 1fr);
  743. gap: 20rpx;
  744. .session-item{
  745. height: 80rpx;
  746. line-height: 80rpx;
  747. border-radius: 12rpx;
  748. border: 2rpx solid #636363;
  749. text-align: center;
  750. font-size: 24rpx;
  751. font-weight: 400;
  752. color: #636363;
  753. &.active{
  754. color: #ED0000;
  755. border-color: #ED0000;
  756. }
  757. }
  758. }
  759. .ticket-type{
  760. .type-item{
  761. background: #FFFFFF;
  762. box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(180,180,180,0.5);
  763. border-radius: 20rpx;
  764. margin-bottom: 20rpx;
  765. padding: 38rpx 40rpx;
  766. .name-price{
  767. margin-bottom: 26rpx;
  768. }
  769. .name{
  770. font-size: 28rpx;
  771. font-weight: 500;
  772. color: #363636;
  773. }
  774. .prices{
  775. font-size: 36rpx;
  776. font-weight: bold;
  777. color: #ED0000;
  778. }
  779. .ishave{
  780. margin-bottom: 26rpx;
  781. .text{
  782. height: 30rpx;
  783. line-height: 30rpx;
  784. padding: 0 22rpx;
  785. background: #FFC8C8;
  786. border-radius: 20rpx;
  787. font-size: 20rpx;
  788. font-weight: 400;
  789. color: #ED0000;
  790. }
  791. }
  792. .bottom{
  793. font-size: 22rpx;
  794. font-weight: 400;
  795. color: #7F7F7F;
  796. .btn{
  797. height: 60rpx;
  798. line-height: 60rpx;
  799. background: linear-gradient(90deg, #FF7979 0%, #ED0000 100%);
  800. border-radius: 30rpx;
  801. padding: 0 36rpx;
  802. font-size: 28rpx;
  803. font-weight: 500;
  804. color: #FFFFFF;
  805. &.disabled{
  806. background: #979797;
  807. }
  808. }
  809. }
  810. }
  811. }
  812. .details{
  813. .title{}
  814. .details-block{
  815. background: #FFFFFF;
  816. box-shadow: 0rpx 2rpx 12rpx 2rpx rgba(221,221,221,0.5);
  817. border-radius: 20rpx;
  818. margin-bottom: 24rpx;
  819. padding: 36rpx;
  820. &.actors{
  821. .title{
  822. .right{
  823. font-size: 24rpx;
  824. font-weight: 400;
  825. color: #7F7F7F;
  826. }
  827. }
  828. }
  829. }
  830. .intro{
  831. font-size: 26rpx;
  832. font-weight: 400;
  833. color: #4E4E4E;
  834. line-height: 40rpx;
  835. }
  836. .actor-list{
  837. .item{
  838. flex-shrink: 0;
  839. width: 160rpx;
  840. text-align: center;
  841. margin-right: 24rpx;
  842. }
  843. .img{
  844. display: block;
  845. width: 100%;
  846. height: 200rpx;
  847. margin-bottom: 16rpx;
  848. }
  849. .name{
  850. font-size: 28rpx;
  851. font-weight: 500;
  852. color: #2D2D2D;
  853. line-height: 42rpx;
  854. margin-bottom: 4rpx;
  855. }
  856. .role{
  857. font-size: 24rpx;
  858. font-weight: 400;
  859. color: #7F7F7F;
  860. line-height: 36rpx;
  861. }
  862. }
  863. }
  864. .canvas{
  865. position: absolute;
  866. left: -99999px;
  867. }
  868. </style>