index.vue 22 KB

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