index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="index" :style="{ top: statusHeight + 'px' }">
  5. <view class="barrage">
  6. <!-- 中奖信息轮播 -->
  7. <swiper class="barrage-swiper" :interval="2000" :autoplay="true" :vertical="true" :circular="true">
  8. <swiper-item v-for="(item, index) in prizeNewsListOne" :key="index">
  9. <view class="barrage-swiper-item flex">
  10. <view class="barrage-swiper-item-content flex">
  11. <image :src="item.avatar" mode="" />
  12. <view class="title ells-one">{{ item.nickName }} {{ item.type == 1 ? '刮出了' : '兑换了' }} {{ item.prizeInfo }}</view>
  13. </view>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. <!-- 查看规则 -->
  19. <view class="rule">
  20. <view class="rule-content flex" @click="toRule">
  21. <image src="../../static/index/index_tip.png" mode=""></image>
  22. <text>查看规则</text>
  23. </view>
  24. </view>
  25. <!-- 盲票轮播 -->
  26. <view class="ticket">
  27. <swiper class="ticket-swiper" :current="ticketIndex" :autoplay="false" :circular="true" @change="changeTicket">
  28. <swiper-item v-for="(item, index) in list" :key="index">
  29. <view class="ticket-swiper-item flex">
  30. <image class="box" src="../../static/index/index_ticket.png" mode="scaleToFill"></image>
  31. <image class="prize" src="../../static/index/index_prize.png" mode="scaleToFill"></image>
  32. </view>
  33. </swiper-item>
  34. </swiper>
  35. </view>
  36. <!-- 投诉建议 -->
  37. <view class="proposal flex">
  38. <view class="proposal-time flex">
  39. <image src="../../static/index/index_time_top.png" mode="scaleToFill"></image>
  40. <view class="time">
  41. <u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss:SSS" autoStart millisecond></u-count-down>
  42. </view>
  43. </view>
  44. <view class="proposal-progress">
  45. <u-line-progress :percentage="percentage" height="3" :showText="false" inactiveColor="rgba(255, 255, 255, .36)" activeColor="#fff" />
  46. </view>
  47. <view class="proposal-tip" @click="contactService">
  48. <image src="../../static/index/index_tip_bg.png" mode=""></image>
  49. <text>投诉建议</text>
  50. </view>
  51. </view>
  52. <!-- 中奖概率 -->
  53. <view class="chance flex">
  54. <view class="chance-title">中奖概率:</view>
  55. <view class="chance-content flex">
  56. <image src="../../static/index/index_chance_1.png" mode="scaleToFill"></image>
  57. <text>0.1%</text>
  58. </view>
  59. <view class="chance-content flex">
  60. <image src="../../static/index/index_chance_2.png" mode="scaleToFill"></image>
  61. <text>10.0%</text>
  62. </view>
  63. <view class="chance-content flex">
  64. <image src="../../static/index/index_chance_3.png" mode="scaleToFill"></image>
  65. <text>10.0%</text>
  66. </view>
  67. <view class="chance-content flex">
  68. <image src="../../static/index/index_chance_4.png" mode="scaleToFill"></image>
  69. <text>10.0%</text>
  70. </view>
  71. </view>
  72. <!-- 盲票名称轮播 -->
  73. <view class="ticket-title" flex>
  74. <swiper class="ticket-title-swiper flex" :current="ticketTitleIndex" previous-margin="110px" next-margin="110px" :autoplay="false" :circular="true" @change="changeTicketTitle">
  75. <swiper-item v-for="(item, index) in list" :key="index">
  76. <view class="ticket-title-swiper-item flex" :class="{ 'action': ticketTitleIndex == index }">
  77. <text>爆款必抽</text>
  78. </view>
  79. </swiper-item>
  80. </swiper>
  81. </view>
  82. <!-- 刮开盲票 -->
  83. <view class="ticket-btn flex">
  84. <view class="ticket-btn-left flex">
  85. <image src="../../static/index/index_btn_left.png" mode="scaleToFill"></image>
  86. <view class="ticket-btn-left__title">试玩</view>
  87. </view>
  88. <view class="ticket-btn-center flex">
  89. <view class="image-wrap flex">
  90. <image class="btn" src="../../static/index/index_btn.png" mode="scaleToFill"></image>
  91. <image class="shadow" src="../../static/index/index_btn_shadow.png" mode="scaleToFill"></image>
  92. </view>
  93. <view class="ticket-btn-center-wrap flex">
  94. <view class="ticket-btn-center-wrap__title">刮开<br />盲票</view>
  95. </view>
  96. </view>
  97. <view class="ticket-btn-right flex" @click="toTicket">
  98. <view class="ticket-btn-right__image flex">
  99. <image src="../../static/index/index_btn_right_cir.png" mode="scaleToFill"></image>
  100. <image src="../../static/index/index_btn_cir_center.png" mode="scaleToFill"></image>
  101. </view>
  102. <view class="ticket-btn-right__title">更多盲票</view>
  103. </view>
  104. </view>
  105. <!-- 盲票价格 -->
  106. <view class="ticket-price flex">
  107. <view class="ticket-price-checkbox flex">
  108. <image src="../../static/index/index_price_checkout.png" mode="scaleToFill"></image>
  109. </view>
  110. <view class="ticket-price-amt flex">
  111. <view class="num">49.00</view>
  112. <view class="txt">元/个</view>
  113. </view>
  114. <view class="ticket-price-discount flex">
  115. <view class="num">原价¥68.00元</view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <!-- tabbar组件 -->
  121. <custom-tab-bar :activeValue="'index'" />
  122. <!-- 支付弹框组件 -->
  123. <pay-popup :pay-show="payShow" :pay-info="payInfo" @close="close" @success="toProcess" v-if="payShow" />
  124. </view>
  125. </template>
  126. <script>
  127. import env from '../../config/env.js'
  128. import $http from '@/utils/request.js'
  129. import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
  130. import PayPopup from '../../components/pay-popup/pay-popup.vue'
  131. import PrizeBarrage from '@/components/prize-barrage/prize-barrage.vue'
  132. export default {
  133. components: {
  134. CustomTabBar,
  135. PayPopup,
  136. PrizeBarrage
  137. },
  138. data() {
  139. return {
  140. loginState: false, // 登录状态
  141. ticketList: [], // 盲票列表
  142. prizeList: [], // 奖品列表
  143. prizeNewsListOne: [], // 弹幕列表
  144. prizeNewsListTwo: [], // 弹幕列表
  145. payShow: false, // 支付弹框显示
  146. payInfo: {}, // 支付详情
  147. currentIndex: 0, // 盲票选中下标
  148. activeAnimation: 'moveLeft 10s linear infinite normal', // 奖品动画
  149. statusHeight: 20,
  150. ticketIndex: 0, // 盲票选中下标
  151. ticketTitleIndex: 0, // 盲票标题选中下边
  152. list: [1,2,3,4,5],
  153. percentage: 0,
  154. checkStatus: true,
  155. };
  156. },
  157. onLoad(opthios) {
  158. /**
  159. * 票赢天下小程序分享盲票跳转接受的参数
  160. * shareUid: 用户ID
  161. * shareType: 分享类型
  162. * */
  163. if (opthios.scene) {
  164. let sceneStr = decodeURIComponent(opthios.scene)
  165. this.sceneArr = sceneStr.split('&')
  166. uni.setStorageSync('shareUid', this.sceneArr[0])
  167. uni.setStorageSync('shareType', this.sceneArr[1])
  168. }
  169. // #ifdef MP-WEIXIN
  170. const res = uni.getMenuButtonBoundingClientRect()
  171. this.statusHeight = res.top //胶囊距离顶部
  172. // #endif
  173. let num = Math.round(100 / this.list.length)
  174. this.percentage = num
  175. this.getList()
  176. },
  177. onShow(opthios) {
  178. this.loginState = uni.getStorageSync('token') ? true : false
  179. this.getPrizeNews()
  180. },
  181. methods: {
  182. // 切换盲票
  183. changeTicket({ detail }) {
  184. console.log(detail);
  185. this.ticketIndex = detail.current
  186. this.ticketTitleIndex = detail.current
  187. this.setNum(detail.current)
  188. },
  189. // 切换盲票名称
  190. changeTicketTitle({ detail }) {
  191. console.log(detail);
  192. this.ticketIndex = detail.current
  193. this.ticketTitleIndex = detail.current
  194. this.setNum(detail.current)
  195. },
  196. setNum(index) {
  197. let num = Math.round(100 / this.list.length)
  198. if (index == 0) {
  199. this.percentage = uni.$u.range(0, 100, num)
  200. } else if (index == this.list.length - 1) {
  201. this.percentage = uni.$u.range(0, 100, 100)
  202. } else {
  203. this.percentage = uni.$u.range(0, 100, num * (index + 1))
  204. }
  205. },
  206. // 投诉建议
  207. contactService() {
  208. // #ifdef MP-WEIXIN
  209. wx.openCustomerServiceChat({
  210. extInfo: {
  211. url: 'https://work.weixin.qq.com/kfid/kfc36c0d90028adbd24'
  212. },
  213. corpId: 'ww02da63d80c66284b',
  214. })
  215. // #endif
  216. },
  217. // 获取盲票列表
  218. getList() {
  219. uni.showLoading({
  220. title: '加载中'
  221. });
  222. let data = {
  223. categoryId: '',
  224. tagId: '',
  225. type: 'online',
  226. noToken: true
  227. }
  228. $http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
  229. res => {
  230. uni.hideLoading();
  231. if (res.code == 0) {
  232. res.rows.forEach(item => item.picUrl = env.filePublic + item.picUrl.split(',')[0] +
  233. '?imageView2/2/w/375')
  234. this.ticketList = res.rows
  235. this.getPrize(this.ticketList[0].boxId)
  236. }
  237. }).catch(() => {
  238. uni.hideLoading();
  239. })
  240. },
  241. // 获取弹幕列表
  242. getPrizeNews() {
  243. $http.post('/api/v1/mp/user/ticket/hitPrizeBarrage', {}).then(res => {
  244. const {
  245. listOne,
  246. listTwo
  247. } = res && res.data
  248. listOne.forEach(item => {
  249. item.avatar = item.avatar ? env.filePublic + item.avatar : env.filePublic +
  250. '70/EJ305PQR2IBE45O9AFAI'
  251. item.prizeInfo = item.prizeInfo && (item.prizeInfo.length > 14) ? item.prizeInfo
  252. .substring(0, 15) + '...' : item.prizeInfo
  253. })
  254. listTwo.forEach(item => {
  255. item.avatar = item.avatar ? env.filePublic + item.avatar : env.filePublic +
  256. '70/EJ305PQR2IBE45O9AFAI'
  257. item.prizeInfo = item.prizeInfo && (item.prizeInfo.length > 14) ? item.prizeInfo
  258. .substring(0, 15) + '...' : item.prizeInfo
  259. })
  260. this.prizeNewsListOne = listOne
  261. this.prizeNewsListTwo = listTwo
  262. })
  263. },
  264. // 获取当前盲票的奖品列表
  265. getPrize(id) {
  266. this.prizeList = []
  267. $http.post('/api/v1/mp/user/mall/ticket/detail', {
  268. boxId: id,
  269. noToken: true
  270. }).then(res => {
  271. uni.hideLoading();
  272. if (res.code == 0) {
  273. let prizeList = res.data.prizeList
  274. prizeList.forEach(item => {
  275. let picUrlArr = item.picUrl.split(',')
  276. item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170'
  277. })
  278. this.prizeList = prizeList
  279. // 根据奖品数量动态设置动画时间
  280. let time = Math.ceil(this.prizeList.length / 5 * 10)
  281. this.activeAnimation = `moveLeft ${ time }s linear infinite normal`,
  282. this.payInfo = this.ticketList[this.currentIndex]
  283. }
  284. }).catch(() => {
  285. uni.hideLoading();
  286. })
  287. },
  288. // 立即开刮
  289. payment() {
  290. this.payInfo = this.ticketList[this.currentIndex]
  291. let data = {
  292. userCouponIds: [],
  293. autoCoupon: 1,
  294. boxId: this.payInfo.boxId,
  295. orderNum: 1
  296. }
  297. $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
  298. if (res.code == 0) {
  299. let info = {
  300. ...res.data,
  301. ...this.payInfo,
  302. couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
  303. .data.couponList[0].title,
  304. couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
  305. .couponList[0].id
  306. }
  307. this.payInfo = info
  308. this.payShow = true
  309. }
  310. }).catch(() => {
  311. uni.$u.toast('开刮失败,请重试!');
  312. })
  313. },
  314. // 关闭支付弹框
  315. close() {
  316. this.payShow = false
  317. },
  318. // // 盲票选中改变
  319. // changeTicket({
  320. // detail
  321. // }) {
  322. // this.currentIndex = detail.current
  323. // this.getPrize(this.ticketList[this.currentIndex].boxId)
  324. // },
  325. changeList() {
  326. let data = {
  327. categoryId: '',
  328. tagId: '',
  329. type: 'online',
  330. noToken: true
  331. }
  332. $http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
  333. res => {
  334. const boxIdStr = this.ticketList.map(item => item.boxId).join()
  335. let boxIdStrNew = res && res.rows && res.rows.map(item => item.boxId).join()
  336. if (boxIdStr != boxIdStrNew) {
  337. this.currentIndex = 0
  338. this.getList()
  339. }
  340. })
  341. },
  342. // 盲票向左箭头
  343. ticketLeft() {
  344. if ((this.currentIndex >= 0) && (this.currentIndex < (this.ticketList.length - 1))) {
  345. this.currentIndex++
  346. } else if (this.currentIndex == (this.ticketList.length - 1)) {
  347. this.currentIndex = 0
  348. }
  349. this.changeList()
  350. },
  351. // 盲票向右箭头
  352. ticketRight() {
  353. if (this.currentIndex > 0) {
  354. this.currentIndex--
  355. } else if (this.currentIndex == 0) {
  356. this.currentIndex = this.ticketList.length - 1
  357. }
  358. this.changeList()
  359. },
  360. // 线上立即刮票成功,跳转到刮奖过程
  361. toProcess(id) {
  362. this.payShow = false
  363. uni.navigateTo({
  364. url: `/packageOperate/process/index?id=${ id }`
  365. })
  366. },
  367. // 点击盲票,跳转盲票详情
  368. toTicketBox() {
  369. let item = this.ticketList[this.currentIndex]
  370. uni.navigateTo({
  371. url: `/pages/ticketBox/detail?boxId=${ item.boxId }`
  372. })
  373. },
  374. // 点击奖品,跳转到奖品详情
  375. toPrizeGoods(item) {
  376. if (item.prizeType == "goods") {
  377. uni.navigateTo({
  378. url: `/packagePrize/goods/detail?id=${ item.refId }`
  379. })
  380. }
  381. //门店优惠券
  382. if (item.prizeType == "coupon") {
  383. // if (item.couponType == "1") {
  384. // uni.navigateTo({
  385. // url: `/packagePrize/goods/detail?id=426`
  386. // })
  387. // }
  388. // if (item.couponType == "2") {
  389. // uni.navigateTo({
  390. // url: `/packagePrize/goods/detail?id=425`
  391. // })
  392. // }
  393. uni.navigateTo({
  394. url: `/packagePrize/goods/detail?id=425`
  395. })
  396. }
  397. // 盲豆
  398. if (item.prizeType == "coin") {
  399. uni.navigateTo({
  400. url: `/packagePrize/goods/detail?id=424`
  401. })
  402. }
  403. },
  404. // 点击所有盲票
  405. toTicket() {
  406. uni.navigateTo({
  407. url: '/packageGoods/ticket/index'
  408. })
  409. },
  410. // 点击奖品库
  411. toPrize() {
  412. if (!this.loginState) {
  413. uni.navigateTo({
  414. url: "/pages/login/index"
  415. })
  416. return
  417. }
  418. uni.navigateTo({
  419. url: '/packagePrize/prize/index'
  420. })
  421. },
  422. // 点击规则说明
  423. toRule() {
  424. uni.navigateTo({
  425. url: '/packageOther/rule/index'
  426. })
  427. }
  428. },
  429. onShareAppMessage(res) {
  430. return {
  431. title: '盲票,玩的就是有趣',
  432. path: '/pages/index/index'
  433. }
  434. }
  435. }
  436. </script>
  437. <style lang="scss" scoped>
  438. .status_bar {
  439. width: 100%;
  440. height: var(--status-bar-height);
  441. }
  442. /deep/ .u-tabbar__placeholder {
  443. display: none;
  444. }
  445. </style>
  446. <style lang="scss" scoped>
  447. .box {
  448. position: relative;
  449. width: 100%;
  450. height: calc(100vh - 50px);
  451. background: url(https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/front_bk.png) center center no-repeat;
  452. background-size: 100vw calc(100vh - 50px);
  453. .index {
  454. position: absolute;
  455. width: 100%;
  456. }
  457. }
  458. // 中奖信息
  459. .barrage {
  460. width: 518rpx;
  461. height: 84rpx;
  462. background: linear-gradient(90deg, #FFD220, #FFF7A2);
  463. border-radius: 42rpx;
  464. margin-bottom: 16rpx;
  465. margin-left: 34rpx;
  466. &-swiper {
  467. width: 100%;
  468. height: 100%;
  469. border-radius: 42rpx;
  470. overflow: hidden;
  471. &-item {
  472. width: 100%;
  473. height: 100%;
  474. &-content {
  475. display: flex;
  476. align-items: center;
  477. width: 510rpx;
  478. height: 76rpx;
  479. image {
  480. width: 66rpx;
  481. height: 66rpx;
  482. border-radius: 50%;
  483. margin-right: 14rpx;
  484. }
  485. .title {
  486. flex: 1;
  487. font-size: 26rpx;
  488. font-family: PingFang SC;
  489. font-weight: 500;
  490. color: #333333;
  491. }
  492. }
  493. }
  494. }
  495. }
  496. // 查看规则
  497. .rule {
  498. display: flex;
  499. align-items: center;
  500. justify-content: flex-end;
  501. height: 34rpx;
  502. padding-right: 34rpx;
  503. margin-bottom: 24rpx;
  504. &-content {
  505. image {
  506. width: 34rpx;
  507. height: 34rpx;
  508. margin-right: 14rpx;
  509. }
  510. text {
  511. font-size: 40rpx;
  512. font-family: 'YouSheBiaoTiHei';
  513. font-weight: 400;
  514. color: #FFFFFF;
  515. }
  516. }
  517. }
  518. // 盲票
  519. .ticket {
  520. height: 36vh;
  521. &-swiper {
  522. height: 100%;
  523. &-item {
  524. position: relative;
  525. height: 100%;
  526. .box {
  527. position: absolute;
  528. bottom: 0;
  529. width: 75vw;
  530. height: 75%;
  531. }
  532. .prize {
  533. position: absolute;
  534. top: 0;
  535. width: 85vw;
  536. height: 75%;
  537. animation: movePrize 2s linear infinite;
  538. }
  539. }
  540. }
  541. }
  542. // 投诉建议
  543. .proposal {
  544. position: relative;
  545. height: 66rpx;
  546. margin-bottom: 30rpx;
  547. &-time {
  548. position: absolute;
  549. left: 30rpx;
  550. bottom: 0;
  551. flex-direction: column;
  552. align-items: flex-start;
  553. image {
  554. width: 140rpx;
  555. height: 78rpx;
  556. margin-bottom: 12rpx;
  557. animation: scaleTime 3s linear infinite;
  558. }
  559. .time {
  560. animation: moveTime 0.5s linear infinite;
  561. /deep/ .u-count-down__text {
  562. line-height: 30rpx;
  563. font-size: 30rpx;
  564. font-family: YouSheBiaoTiHei;
  565. font-weight: 400;
  566. color: #FFFFFF;
  567. }
  568. }
  569. }
  570. &-progress {
  571. position: absolute;
  572. bottom: 0;
  573. width: 140rpx;
  574. }
  575. &-tip {
  576. display: flex;
  577. align-items: center;
  578. position: absolute;
  579. right: 0;
  580. bottom: 0;
  581. width: 212rpx;
  582. height: 66rpx;
  583. image {
  584. position: absolute;
  585. right: 0;
  586. bottom: 0;
  587. width: 212rpx;
  588. height: 66rpx;
  589. }
  590. text {
  591. position: absolute;
  592. right: 16rpx;
  593. font-size: 40rpx;
  594. font-family: YouSheBiaoTiHei;
  595. font-weight: 400;
  596. color: #FFFFFF;
  597. }
  598. }
  599. }
  600. // 中奖概率
  601. .chance {
  602. height: 44rpx;
  603. margin: 0 34rpx 26rpx;
  604. background-color: rgba(000, 000, 000, .36);
  605. border-radius: 22rpx;
  606. color: #FFFFFF;
  607. font-family: YouSheBiaoTiHei;
  608. font-size: 14px;
  609. &-content {
  610. margin-right: 16rpx;
  611. image {
  612. width: 44rpx;
  613. height: 44rpx;
  614. }
  615. }
  616. &-content:last-child {
  617. margin: 0;
  618. }
  619. }
  620. // 盲票名称轮播
  621. .ticket-title {
  622. height: 66rpx;
  623. padding: 0 34rpx;
  624. &-swiper {
  625. width: calc(100vw - 34px);
  626. height: 100%;
  627. &-item {
  628. height: 100%;
  629. background: rgba(255, 255, 255, .16);
  630. margin: 0 17rpx;
  631. color: #fff;
  632. font-size: 34rpx;
  633. }
  634. .action {
  635. background: #FFAE00;
  636. box-shadow: 0px 3px 3px 0px rgba(220, 145, 107, 0.57);
  637. }
  638. }
  639. }
  640. // 刮开盲票
  641. .ticket-btn {
  642. justify-content: space-between;
  643. height: 20vh;
  644. padding: 0 30rpx;
  645. &-left {
  646. flex-direction: column;
  647. image {
  648. width: 142rpx;
  649. height: 142rpx;
  650. margin-bottom: 16rpx;
  651. }
  652. &__title {
  653. line-height: 30rpx;
  654. font-size: 30rpx;
  655. font-family: YouSheBiaoTiHei;
  656. font-weight: 400;
  657. color: #FFFFFF;
  658. }
  659. }
  660. &-center {
  661. position: relative;
  662. flex-direction: column;
  663. height: 100%;
  664. .image-wrap {
  665. position: absolute;
  666. width: 310rpx;
  667. height: 90%;
  668. border-radius: 50%;
  669. border: 5px solid #FFFED1;
  670. overflow: hidden;
  671. .btn {
  672. width: 310rpx;
  673. height: 100%;
  674. }
  675. .shadow {
  676. position: absolute;
  677. width: 310rpx;
  678. height: 130%;
  679. left: 0;
  680. animation: shadowMove 1.5s linear infinite;
  681. }
  682. }
  683. &-wrap {
  684. width: 300rpx;
  685. position: absolute;
  686. animation: scaleBtn 1.5s linear infinite;
  687. &__title {
  688. width: 300rpx;
  689. text-align: center;
  690. font-size: 84rpx;
  691. font-family: YouSheBiaoTiHei;
  692. font-weight: 400;
  693. color: #FFFFFF;
  694. line-height: 72rpx;
  695. animation: shadowBtn 1.5s linear infinite;
  696. }
  697. }
  698. }
  699. &-right {
  700. flex-direction: column;
  701. &__image {
  702. position: relative;
  703. width: 142rpx;
  704. height: 142rpx;
  705. margin-bottom: 16rpx;
  706. image:first-child {
  707. width: 142rpx;
  708. height: 142rpx;
  709. margin-bottom: 16rpx;
  710. }
  711. image:last-child {
  712. position: absolute;
  713. width: 60rpx;
  714. height: 60rpx;
  715. margin-bottom: 16rpx;
  716. }
  717. }
  718. &__title {
  719. line-height: 30rpx;
  720. font-size: 30rpx;
  721. font-family: YouSheBiaoTiHei;
  722. font-weight: 400;
  723. color: #FFFFFF;
  724. }
  725. }
  726. }
  727. // 盲票价格
  728. .ticket-price {
  729. height: 44rpx;
  730. &-checkbox {
  731. width: 44rpx;
  732. height: 44rpx;
  733. background-color: #fff;
  734. border-radius: 50%;
  735. overflow: hidden;
  736. margin-right: 20rpx;
  737. image {
  738. width: 44rpx;
  739. height: 44rpx;
  740. }
  741. }
  742. &-amt {
  743. height: 44rpx;
  744. font-family: YouSheBiaoTiHei;
  745. font-weight: 400;
  746. align-items: flex-end;
  747. color: #FFFFFF;
  748. margin-right: 20rpx;
  749. .num {
  750. font-size: 56rpx;
  751. line-height: 40rpx;
  752. }
  753. .txt {
  754. line-height: 36rpx;
  755. font-size: 40rpx;
  756. }
  757. }
  758. &-discount {
  759. height: 44rpx;
  760. align-items: flex-end;
  761. .num {
  762. line-height: 24rpx;
  763. font-size: 24rpx;
  764. text-decoration: line-through;
  765. }
  766. }
  767. }
  768. // 奖品移动动画
  769. @keyframes movePrize {
  770. 0% {
  771. transform: translate(0, 10px)
  772. }
  773. 25% {
  774. transform: translate(0, 5px)
  775. }
  776. 50% {
  777. transform: translate(0, 0px)
  778. }
  779. 75% {
  780. transform: translate(0, 5px)
  781. }
  782. 100% {
  783. transform: translate(0, 10px)
  784. }
  785. }
  786. // 倒计时移动动画
  787. @keyframes moveTime {
  788. 0% {
  789. transform: translate(2px, 0)
  790. }
  791. 25% {
  792. transform: translate(0, 0)
  793. }
  794. 50% {
  795. transform: translate(1px, 0)
  796. }
  797. 75% {
  798. transform: translate(0, 0)
  799. }
  800. 100% {
  801. transform: translate(2px, 0)
  802. }
  803. }
  804. // 放大缩小动画
  805. @keyframes scaleTime {
  806. 0% {
  807. transform: scale(1.05)
  808. }
  809. 25% {
  810. transform: scale(1.02)
  811. }
  812. 50% {
  813. transform: scale(0.9)
  814. }
  815. 75% {
  816. transform: scale(1.02)
  817. }
  818. 100% {
  819. transform: scale(1.05)
  820. }
  821. }
  822. // 刮开刮票呼吸动画
  823. @keyframes scaleBtn {
  824. 0% {
  825. transform: scale(1.04)
  826. }
  827. 25% {
  828. transform: scale(1.02)
  829. }
  830. 50% {
  831. transform: scale(1)
  832. }
  833. 75% {
  834. transform: scale(1.02)
  835. }
  836. 100% {
  837. transform: scale(1.04)
  838. }
  839. }
  840. // 刮开刮票阴影动画
  841. @keyframes shadowBtn {
  842. 0% {
  843. text-shadow: 2px -2px 3px #fff;
  844. }
  845. 25% {
  846. text-shadow: none;
  847. }
  848. 50% {
  849. text-shadow: none;
  850. }
  851. 75% {
  852. text-shadow: none;
  853. }
  854. 100% {
  855. text-shadow: 2px -2px 3px #fff;
  856. }
  857. }
  858. // 刮开盲票光影移动动画
  859. @keyframes shadowMove {
  860. 0% {
  861. left: -100%;
  862. }
  863. 100% {
  864. left: 110%;
  865. }
  866. }
  867. </style>