index.vue 22 KB

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