ticketlist.vue 25 KB

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