ticketlist.vue 25 KB

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