index.vue 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  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" :duration="200" @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" :duration="0" :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. }, 200)
  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. }, 200)
  199. }
  200. },
  201. // 点击名称
  202. clickTicketTitle(index) {
  203. this.ticketIndex = index
  204. this.ticketTitleIndex = index
  205. this.getTicketDetail(this.ticketList[index].boxId)
  206. this.setNum(index)
  207. },
  208. setNum(index) {
  209. let num = Math.round(100 / this.list.length)
  210. if (index == 0) {
  211. this.percentage = uni.$u.range(0, 100, num)
  212. } else if (index == this.list.length - 1) {
  213. this.percentage = uni.$u.range(0, 100, 100)
  214. } else {
  215. this.percentage = uni.$u.range(0, 100, num * (index + 1))
  216. }
  217. },
  218. // 投诉建议
  219. contactService() {
  220. // #ifdef MP-WEIXIN
  221. wx.openCustomerServiceChat({
  222. extInfo: {
  223. url: 'https://work.weixin.qq.com/kfid/kfc36c0d90028adbd24'
  224. },
  225. corpId: 'ww02da63d80c66284b',
  226. })
  227. // #endif
  228. },
  229. // 活动
  230. getActivityList() {
  231. $http.post(`/api/v1/mp/user/marketing/recent`, {}).then(res => {
  232. if(res && res.data) {
  233. let data = res && res.data
  234. let timestamp = parseInt(new Date().getTime())
  235. this.activityTime = data.endTime - timestamp
  236. }
  237. })
  238. },
  239. // 获取盲票列表
  240. getList() {
  241. uni.showLoading({
  242. title: '加载中'
  243. });
  244. let data = {
  245. categoryId: '',
  246. tagId: '',
  247. type: 'online',
  248. noToken: true
  249. }
  250. $http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
  251. res => {
  252. uni.hideLoading();
  253. if (res.code == 0) {
  254. res.rows.forEach(item => item.picUrl = item.picUrl.split(',').map(item => env.filePublic + item + '?imageView2/2/w/750'))
  255. this.ticketList = res.rows
  256. this.getTicketDetail(this.ticketList[0].boxId)
  257. }
  258. }).catch(() => {
  259. uni.hideLoading();
  260. })
  261. },
  262. // 获取弹幕列表
  263. getPrizeNews() {
  264. $http.post('/api/v1/mp/user/ticket/hitPrizeBarrage', {}).then(res => {
  265. const {
  266. listOne,
  267. listTwo
  268. } = res && res.data
  269. listOne.forEach(item => {
  270. item.avatar = item.avatar ? env.filePublic + item.avatar : env.filePublic +
  271. '70/EJ305PQR2IBE45O9AFAI'
  272. item.prizeInfo = item.prizeInfo && (item.prizeInfo.length > 14) ? item.prizeInfo
  273. .substring(0, 15) + '...' : item.prizeInfo
  274. })
  275. listTwo.forEach(item => {
  276. item.avatar = item.avatar ? env.filePublic + item.avatar : env.filePublic +
  277. '70/EJ305PQR2IBE45O9AFAI'
  278. item.prizeInfo = item.prizeInfo && (item.prizeInfo.length > 14) ? item.prizeInfo
  279. .substring(0, 15) + '...' : item.prizeInfo
  280. })
  281. this.prizeNewsListOne = listOne
  282. this.prizeNewsListTwo = listTwo
  283. })
  284. },
  285. // 获取当前盲票的详情
  286. getTicketDetail(id) {
  287. this.prizeList = []
  288. $http.post('/api/v1/mp/user/mall/ticket/detail', {
  289. boxId: id,
  290. noToken: true
  291. }).then(res => {
  292. uni.hideLoading();
  293. if (res.code == 0) {
  294. this.ticketInfo = {
  295. ...res.data,
  296. ticketAwardsLabelList: res.data.ticketAwardsLabelList.map(item => {
  297. return { ...item, picUrl: env.filePublic + item.picUrl }
  298. })
  299. }
  300. this.payInfo = this.ticketList[this.ticketIndex]
  301. }
  302. }).catch(() => {
  303. uni.hideLoading();
  304. })
  305. },
  306. // 立即开刮
  307. payment() {
  308. this.payInfo = this.ticketList[this.ticketIndex]
  309. let data = {
  310. userCouponIds: [],
  311. autoCoupon: 1,
  312. boxId: this.payInfo.boxId,
  313. orderNum: 1
  314. }
  315. $http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
  316. if (res.code == 0) {
  317. let info = {
  318. ...res.data,
  319. ...this.payInfo,
  320. picUrl: this.payInfo.picUrl[0],
  321. couponTitle: res.data && res.data.couponList && res.data.couponList.length && res
  322. .data.couponList[0].title,
  323. couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
  324. .couponList[0].id
  325. }
  326. this.payInfo = info
  327. this.payShow = true
  328. }
  329. }).catch(() => {
  330. uni.$u.toast('开刮失败,请重试!');
  331. })
  332. },
  333. // 关闭支付弹框
  334. close() {
  335. this.payShow = false
  336. },
  337. changeList() {
  338. let data = {
  339. categoryId: '',
  340. tagId: '',
  341. type: 'online',
  342. noToken: true
  343. }
  344. $http.post(`/api/v1/mp/user/mall/ticket/list?pageNum=${this.pageNum}&pageSize=100`, data).then(
  345. res => {
  346. const boxIdStr = this.ticketList.map(item => item.boxId).join()
  347. let boxIdStrNew = res && res.rows && res.rows.map(item => item.boxId).join()
  348. if (boxIdStr != boxIdStrNew) {
  349. this.currentIndex = 0
  350. this.getList()
  351. }
  352. })
  353. },
  354. // 盲票向左箭头
  355. ticketLeft() {
  356. if ((this.currentIndex >= 0) && (this.currentIndex < (this.ticketList.length - 1))) {
  357. this.currentIndex++
  358. } else if (this.currentIndex == (this.ticketList.length - 1)) {
  359. this.currentIndex = 0
  360. }
  361. this.changeList()
  362. },
  363. // 盲票向右箭头
  364. ticketRight() {
  365. if (this.currentIndex > 0) {
  366. this.currentIndex--
  367. } else if (this.currentIndex == 0) {
  368. this.currentIndex = this.ticketList.length - 1
  369. }
  370. this.changeList()
  371. },
  372. toRollingGame() {
  373. if (!uni.getStorageSync('token')) {
  374. uni.navigateTo({
  375. url: '/pages/login/index'
  376. })
  377. return
  378. }
  379. uni.navigateTo({
  380. url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&isTry=1`
  381. })
  382. },
  383. // 线上立即刮票成功,跳转到刮奖过程
  384. toProcess(id) {
  385. this.payShow = false
  386. uni.navigateTo({
  387. url: `/packagePrize/rolling/index?boxId=${ this.ticketInfo.boxId }&orderId=${ id }&isTry=0`
  388. })
  389. },
  390. // 点击盲票,跳转盲票详情
  391. toTicketBox(item) {
  392. uni.navigateTo({
  393. url: `/pages/ticketBox/detail?boxId=${ item.boxId }`
  394. })
  395. },
  396. // 点击奖品,跳转到奖品详情
  397. toPrizeGoods(item) {
  398. if (item.prizeType == "goods") {
  399. uni.navigateTo({
  400. url: `/packagePrize/goods/detail?id=${ item.refId }`
  401. })
  402. }
  403. //门店优惠券
  404. if (item.prizeType == "coupon") {
  405. // if (item.couponType == "1") {
  406. // uni.navigateTo({
  407. // url: `/packagePrize/goods/detail?id=426`
  408. // })
  409. // }
  410. // if (item.couponType == "2") {
  411. // uni.navigateTo({
  412. // url: `/packagePrize/goods/detail?id=425`
  413. // })
  414. // }
  415. uni.navigateTo({
  416. url: `/packagePrize/goods/detail?id=425`
  417. })
  418. }
  419. // 盲豆
  420. if (item.prizeType == "coin") {
  421. uni.navigateTo({
  422. url: `/packagePrize/goods/detail?id=424`
  423. })
  424. }
  425. },
  426. toActivity() {
  427. uni.switchTab({
  428. url: '/pages/activity/index'
  429. })
  430. },
  431. // 点击所有盲票
  432. toTicket() {
  433. uni.navigateTo({
  434. url: '/packageGoods/ticket/index'
  435. })
  436. },
  437. // 点击仓库
  438. toPrize() {
  439. if (!this.loginState) {
  440. uni.navigateTo({
  441. url: "/pages/login/index"
  442. })
  443. return
  444. }
  445. uni.navigateTo({
  446. url: '/packagePrize/prize/index'
  447. })
  448. },
  449. // 点击规则说明
  450. toRule() {
  451. uni.navigateTo({
  452. url: '/packageOther/rule/index'
  453. })
  454. }
  455. },
  456. onShareAppMessage(res) {
  457. return {
  458. title: '盲票,玩的就是有趣',
  459. path: '/pages/index/index'
  460. }
  461. }
  462. }
  463. </script>
  464. <style lang="scss" scoped>
  465. .status_bar {
  466. width: 100%;
  467. height: var(--status-bar-height);
  468. }
  469. /deep/ .u-tabbar__placeholder {
  470. display: none;
  471. }
  472. </style>
  473. <style lang="scss" scoped>
  474. .box {
  475. position: relative;
  476. width: 100%;
  477. height: calc(100vh - 50px);
  478. background: url(https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/front_bk.png) center center no-repeat;
  479. background-size: 100vw calc(100vh - 50px);
  480. .index {
  481. position: absolute;
  482. width: 100%;
  483. }
  484. }
  485. // 中奖信息
  486. .barrage {
  487. position: relative;
  488. width: 518rpx;
  489. height: 70rpx;
  490. border-radius: 42rpx;
  491. margin-bottom: 16rpx;
  492. margin-left: 34rpx;
  493. &-bg {
  494. position: absolute;
  495. width: 518rpx;
  496. height: 70rpx;
  497. }
  498. &-swiper {
  499. position: absolute;
  500. z-index: 10;
  501. width: 100%;
  502. height: 100%;
  503. border-radius: 42rpx;
  504. overflow: hidden;
  505. &-item {
  506. width: 100%;
  507. height: 100%;
  508. &-content {
  509. display: flex;
  510. align-items: center;
  511. width: 510rpx;
  512. height: 70rpx;
  513. image {
  514. width: 58rpx;
  515. height: 58rpx;
  516. border-radius: 50%;
  517. margin-right: 14rpx;
  518. border: 1px solid #fff;
  519. margin-left: 8rpx;
  520. }
  521. .title {
  522. flex: 1;
  523. font-size: 26rpx;
  524. font-weight: 500;
  525. color: #fff;
  526. }
  527. }
  528. }
  529. }
  530. &-none {
  531. position: absolute;
  532. width: 518rpx;
  533. height: 70rpx;
  534. z-index: 20;
  535. }
  536. }
  537. // 查看规则
  538. .rule {
  539. display: flex;
  540. align-items: center;
  541. justify-content: flex-end;
  542. height: 34rpx;
  543. padding-right: 34rpx;
  544. margin-bottom: 24rpx;
  545. &-content {
  546. image {
  547. width: 34rpx;
  548. height: 34rpx;
  549. margin-right: 14rpx;
  550. }
  551. text {
  552. font-size: 40rpx;
  553. font-family: 'YouSheBiaoTiHei';
  554. font-weight: 400;
  555. color: #FFFFFF;
  556. }
  557. }
  558. }
  559. // 盲票
  560. .ticket {
  561. height: 36vh;
  562. &-swiper {
  563. height: 100%;
  564. &-item {
  565. position: relative;
  566. height: 100%;
  567. &-box {
  568. position: absolute;
  569. bottom: 0;
  570. width: 75vw;
  571. height: 75%;
  572. }
  573. &-prize {
  574. position: absolute;
  575. top: 0;
  576. width: 85vw;
  577. height: 75%;
  578. animation: movePrize 2s linear infinite;
  579. }
  580. }
  581. }
  582. }
  583. // 投诉建议
  584. .proposal {
  585. position: relative;
  586. height: 66rpx;
  587. margin-bottom: 30rpx;
  588. &-time {
  589. position: absolute;
  590. left: 30rpx;
  591. bottom: 0;
  592. flex-direction: column;
  593. align-items: flex-start;
  594. image {
  595. width: 140rpx;
  596. height: 78rpx;
  597. margin-bottom: 12rpx;
  598. animation: scaleTime 3s linear infinite;
  599. }
  600. .time {
  601. animation: moveTime 0.5s linear infinite;
  602. /deep/ .u-count-down__text {
  603. line-height: 30rpx;
  604. font-size: 30rpx;
  605. font-family: YouSheBiaoTiHei;
  606. font-weight: 400;
  607. color: #FFFFFF;
  608. }
  609. }
  610. }
  611. &-progress {
  612. position: absolute;
  613. bottom: 0;
  614. width: 140rpx;
  615. }
  616. &-tip {
  617. display: flex;
  618. align-items: center;
  619. position: absolute;
  620. right: 0;
  621. bottom: 0;
  622. width: 212rpx;
  623. height: 66rpx;
  624. image {
  625. position: absolute;
  626. right: 0;
  627. bottom: 0;
  628. width: 212rpx;
  629. height: 66rpx;
  630. }
  631. text {
  632. position: absolute;
  633. right: 16rpx;
  634. font-size: 40rpx;
  635. font-family: YouSheBiaoTiHei;
  636. font-weight: 400;
  637. color: #FFFFFF;
  638. }
  639. }
  640. }
  641. // 中奖概率
  642. .chance {
  643. justify-content: flex-start;
  644. height: 44rpx;
  645. margin: 0 34rpx 26rpx;
  646. background-color: rgba(000, 000, 000, .36);
  647. border-radius: 22rpx;
  648. color: #FFFFFF;
  649. font-family: YouSheBiaoTiHei;
  650. font-size: 14px;
  651. &-title {
  652. margin-left: 8rpx;
  653. }
  654. &-hitRate {
  655. flex: 1;
  656. justify-content: space-evenly;
  657. &-content {
  658. image {
  659. width: 56rpx;
  660. height: 50rpx;
  661. }
  662. }
  663. }
  664. }
  665. // 盲票名称轮播
  666. .ticket-title {
  667. height: 66rpx;
  668. padding: 0 34rpx;
  669. &-swiper {
  670. width: calc(100vw - 34px);
  671. height: 100%;
  672. &-item {
  673. height: 100%;
  674. background: rgba(255, 255, 255, .16);
  675. margin: 0 17rpx;
  676. color: #fff;
  677. font-size: 34rpx;
  678. }
  679. .action {
  680. background: #FFAE00;
  681. box-shadow: 0px 3px 3px 0px rgba(220, 145, 107, 0.57);
  682. }
  683. }
  684. }
  685. // 刮开盲票
  686. .ticket-btn {
  687. justify-content: space-between;
  688. height: 20vh;
  689. padding: 0 30rpx;
  690. &-left {
  691. flex-direction: column;
  692. image {
  693. width: 142rpx;
  694. height: 142rpx;
  695. margin-bottom: 16rpx;
  696. }
  697. &__title {
  698. line-height: 30rpx;
  699. font-size: 30rpx;
  700. font-family: YouSheBiaoTiHei;
  701. font-weight: 400;
  702. color: #FFFFFF;
  703. }
  704. }
  705. &-center {
  706. position: relative;
  707. flex-direction: column;
  708. height: 100%;
  709. .image-wrap {
  710. position: absolute;
  711. width: 310rpx;
  712. height: 90%;
  713. border-radius: 50%;
  714. overflow: hidden;
  715. 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);
  716. .btn {
  717. width: 310rpx;
  718. height: 100%;
  719. }
  720. .shadow {
  721. position: absolute;
  722. width: 310rpx;
  723. height: 130%;
  724. left: 0;
  725. animation: shadowMove 1.5s linear infinite;
  726. }
  727. }
  728. &-wrap {
  729. width: 300rpx;
  730. position: absolute;
  731. animation: scaleBtn 1.5s linear infinite;
  732. &__title {
  733. width: 300rpx;
  734. text-align: center;
  735. font-size: 84rpx;
  736. font-family: YouSheBiaoTiHei;
  737. font-weight: 400;
  738. color: #FFFFFF;
  739. line-height: 72rpx;
  740. animation: shadowBtn 1.5s linear infinite;
  741. }
  742. }
  743. }
  744. &-right {
  745. flex-direction: column;
  746. image {
  747. width: 142rpx;
  748. height: 142rpx;
  749. margin-bottom: 16rpx;
  750. }
  751. &__title {
  752. line-height: 30rpx;
  753. font-size: 30rpx;
  754. font-family: YouSheBiaoTiHei;
  755. font-weight: 400;
  756. color: #FFFFFF;
  757. }
  758. }
  759. }
  760. // 盲票价格
  761. .ticket-price {
  762. height: 44rpx;
  763. &-checkbox {
  764. width: 44rpx;
  765. height: 44rpx;
  766. background-color: #fff;
  767. border-radius: 50%;
  768. overflow: hidden;
  769. margin-right: 20rpx;
  770. image {
  771. width: 44rpx;
  772. height: 44rpx;
  773. }
  774. }
  775. &-amt {
  776. height: 44rpx;
  777. font-family: YouSheBiaoTiHei;
  778. font-weight: 400;
  779. align-items: flex-end;
  780. color: #FFFFFF;
  781. margin-right: 20rpx;
  782. .num {
  783. font-size: 56rpx;
  784. line-height: 40rpx;
  785. }
  786. .txt {
  787. line-height: 36rpx;
  788. font-size: 40rpx;
  789. }
  790. }
  791. &-discount {
  792. height: 44rpx;
  793. align-items: flex-end;
  794. .num {
  795. line-height: 26rpx;
  796. font-size: 26rpx;
  797. text-decoration: line-through;
  798. font-style: italic;
  799. color: #FFFEFE;
  800. }
  801. }
  802. }
  803. // 奖品移动动画
  804. @keyframes movePrize {
  805. 0% {
  806. transform: translate(0, 10px)
  807. }
  808. 25% {
  809. transform: translate(0, 5px)
  810. }
  811. 50% {
  812. transform: translate(0, 0px)
  813. }
  814. 75% {
  815. transform: translate(0, 5px)
  816. }
  817. 100% {
  818. transform: translate(0, 10px)
  819. }
  820. }
  821. // 倒计时移动动画
  822. @keyframes moveTime {
  823. 0% {
  824. transform: translate(2px, 0)
  825. }
  826. 25% {
  827. transform: translate(0, 0)
  828. }
  829. 50% {
  830. transform: translate(1px, 0)
  831. }
  832. 75% {
  833. transform: translate(0, 0)
  834. }
  835. 100% {
  836. transform: translate(2px, 0)
  837. }
  838. }
  839. // 放大缩小动画
  840. @keyframes scaleTime {
  841. 0% {
  842. transform: scale(1.05)
  843. }
  844. 25% {
  845. transform: scale(1.02)
  846. }
  847. 50% {
  848. transform: scale(0.9)
  849. }
  850. 75% {
  851. transform: scale(1.02)
  852. }
  853. 100% {
  854. transform: scale(1.05)
  855. }
  856. }
  857. // 刮开刮票呼吸动画
  858. @keyframes scaleBtn {
  859. 0% {
  860. transform: scale(1.04)
  861. }
  862. 25% {
  863. transform: scale(1.02)
  864. }
  865. 50% {
  866. transform: scale(1)
  867. }
  868. 75% {
  869. transform: scale(1.02)
  870. }
  871. 100% {
  872. transform: scale(1.04)
  873. }
  874. }
  875. // 刮开刮票阴影动画
  876. @keyframes shadowBtn {
  877. 0% {
  878. text-shadow: 2px -2px 3px #fff;
  879. }
  880. 25% {
  881. text-shadow: none;
  882. }
  883. 50% {
  884. text-shadow: none;
  885. }
  886. 75% {
  887. text-shadow: none;
  888. }
  889. 100% {
  890. text-shadow: 2px -2px 3px #fff;
  891. }
  892. }
  893. // 刮开盲票光影移动动画
  894. @keyframes shadowMove {
  895. 0% {
  896. left: -100%;
  897. }
  898. 100% {
  899. left: 110%;
  900. }
  901. }
  902. </style>