index.vue 28 KB

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