index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <view class="luckyDraw">
  3. <image src="../../static/backImg.png" class="back" mode="widthFix"></image>
  4. <view class="luckyDrawContent">
  5. <!-- 个人信息模块 -->
  6. <view class="luckyDrawTop">
  7. <view class="left">
  8. <view class="avatarView">
  9. <open-data type="userAvatarUrl" class="avatar"></open-data>
  10. </view>
  11. <view class="userInfo">
  12. <view class="account">{{mpName}}</view>
  13. <view class="ID">ID:{{userId}}</view>
  14. </view>
  15. </view>
  16. <view class="right" @click="jumpSign">
  17. <text>签到有礼</text>
  18. </view>
  19. </view>
  20. <!-- 滚动通知 -->
  21. <view class="notice">
  22. <image src="../../static/horn.png" class="horn" mode="widthFix"></image>
  23. <view class="txts">
  24. <u-notice-bar mode="vertical" :volume-icon="false" color="#FFFFFF" type="none" :list="list"></u-notice-bar>
  25. </view>
  26. </view>
  27. <!-- 大转盘 -->
  28. <view class="turntable">
  29. <view class="decorate">
  30. <image src="../../static/decorate.png" class="decorateBack" mode="widthFix"></image>
  31. <image src="../../static/chassis.png" class="decorateChassis" mode="widthFix"></image>
  32. </view>
  33. <view class="turntableContent">
  34. <almost-lottery
  35. :canvasId="canvasConfig.canvasId"
  36. :canvasWidth="canvasConfig.width"
  37. :canvasHeight="canvasConfig.height"
  38. :outerWidth="canvasConfig.outerWidth"
  39. :outerHeight="canvasConfig.outerHeight"
  40. :colors="canvasConfig.colors"
  41. :ringCount="8"
  42. :duration="1"
  43. :prizeList="prizeList"
  44. :prizeIndex="prizeIndex"
  45. @reset-index="prizeIndex = -1"
  46. @draw-start="handleDrawStart"
  47. @draw-end="handleDrawEnd"
  48. @finish="handleDrawFinish"
  49. v-if="prizeList.length"
  50. />
  51. <view class="bottom">
  52. <view class="cont">今日剩余抽奖次数:<text>{{freeNum}}</text></view>
  53. <navigator :url="'../checkInRecord/checkInRecord' + getSerialize({...mpData, openId})" class="record" hover-class="none">
  54. <text>中奖记录</text>
  55. </navigator>
  56. </view>
  57. </view>
  58. </view>
  59. <!-- 我的奖品 -->
  60. <view class="myPrize">
  61. <view class="title">我的奖品</view>
  62. <view class="chips">
  63. <view class="chip" v-for="(item, index) in prizeCountDtoList" :key="index">
  64. <image src="../../static/iPhone12Chip.png" mode="widthFix" v-if="item.prizeType === 3"></image>
  65. <image src="../../static/vipChip.png" mode="widthFix" v-else></image>
  66. <view class="text">{{item.prizeName}}</view>
  67. <view class="progress">
  68. <view class="value" :style="{width: item.prizeCount && item.prizeCount > 0 ? (item.prizeCount/item.maxCount*100) + '%' : '0'}"></view>
  69. <text>{{item.prizeCount}}/{{item.maxCount}}</text>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="clearTime" v-if="clearTime">碎片有效期至:{{clearTime | getTimerFilter}} </view>
  74. </view>
  75. <!-- 活动规则模块 -->
  76. <view class="activityRules">
  77. <view class="top" @click="activityRulesHandle">
  78. <text>活动规则</text>
  79. <image :src="!activityRules ? '../../static/unfold.png' : '../../static/retract.png'" mode="widthFix"></image>
  80. </view>
  81. <view class="bottom" v-if="activityRules">
  82. <view>1、每个用户账户每天最多有10次抽奖机会,每天0点刷新。</view>
  83. <view>2、每天前2次可直接领取抽奖奖品,其他8次抽奖机会需要通过观看激励视频来获得。</view>
  84. <view>3、用户必须在对应公众号内登陆抽奖,否则书币将无法顺利领取。</view>
  85. <view>4、书币及7天书城VIP会员抽中后自动发放至书城账号,可在中奖记录中查看,或进入书城的“个人中心-充值记录-赠送”查看。</view>
  86. <view>5、用户可以通过完成本产品抽奖获得碎片,碎片种类由系统随机发放,兑换手机需集满50个碎片, 兑换书城VIP需集满30个碎片。碎片累计有效期为7天,在碎片超出有效期后或用户成功兑换奖品后,此前已获得的该奖品碎片都将清零。</view>
  87. <view>6、实物奖品请联系公众号内客服领取,实物奖品颜色随机寄送,以中奖用户收到的实物为准。</view>
  88. <view>7、若发现用户恶意违规行为,开发者有权取消其获奖资格。</view>
  89. <view>8、本活动解释权由开发者所有,有任何疑问请联系公众号内客服。</view>
  90. </view>
  91. </view>
  92. <!-- 弹窗 -->
  93. <view class="popup" v-if="popupShow">
  94. <view class="popupContent">
  95. <view class="content">
  96. <image src="../../static/popupBack.png"></image>
  97. <view class="textCon">
  98. <text class="ts">中奖了!</text> </br>
  99. <text class="reward">恭喜您获得{{luckyDay.name}}</text> </br>
  100. <image src="../../static/doubleBt.png" class="doubleBt" mode="widthFix" @click="lookVideo"></image> </br>
  101. <text class="bt" @click="receiveGold(false)">不了,单倍领取</text>
  102. </view>
  103. </view>
  104. <image src="../../static/close.png" class="close" mode="widthFix" @click="closeHandle"></image>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. let timer = null
  112. import AlmostLottery from '@/uni_modules/almost-lottery/components/almost-lottery/almost-lottery.vue'
  113. import { config, getHome, getOpenId, getBanner, setDrawGain, getPond, setReceive } from '@/api/api.js'
  114. import { clearCacheFile } from '@/uni_modules/almost-lottery/utils/almost-utils.js'
  115. export default {
  116. components: {
  117. AlmostLottery
  118. },
  119. data() {
  120. return {
  121. title: 'Hello',
  122. list: [
  123. '恭喜用户 “9016” 成功提现 2000书币',
  124. '恭喜用户 “9017” 成功提现 10书币',
  125. '恭喜用户 “9018” 成功提现 20书币',
  126. '恭喜用户 “9019” 成功提现 100书币'
  127. ],
  128. // canvas id、宽、高
  129. canvasConfig: {
  130. canvasId: 'almostLotteryCanvas',
  131. width: 300,
  132. height: 300,
  133. outerWidth: 325,
  134. outerHeight: 325,
  135. colors: [
  136. '#FEE3C6',
  137. '#FFFFFF'
  138. ]
  139. },
  140. // 以下是奖品配置数据
  141. // 奖品数据
  142. prizeList: [],
  143. // 奖品是否设有库存
  144. onStock: false,
  145. // 中奖下标
  146. prizeIndex: -1,
  147. // 是否正在抽奖中,避免重复触发
  148. prizeing: false,
  149. // 以下为中奖概率有关数据
  150. // 是否由前端控制概率,默认不开启,强烈建议由后端控制
  151. onFrontend: false,
  152. // 权重随机数的最大值
  153. weightTotal: 0,
  154. // 权重数组
  155. weightArr: [],
  156. // 以下为业务需求有关示例数据
  157. // 金币余额
  158. goldCoin: 50,
  159. // 当日免费抽奖次数余额
  160. freeNum: 10,
  161. // 每次消耗的金币数
  162. goldNum: 20,
  163. // 每天免费抽奖次数
  164. freeNumDay: 2,
  165. // 以下是
  166. // 活动规则开关控制
  167. activityRules: false,
  168. // 弹窗控制
  169. popupShow: false,
  170. openId: '',
  171. mpData: {},
  172. prizeCountDtoList: [], // 碎片列表
  173. mpName: null, // 渠道号
  174. userId: null, //
  175. luckyDay: {}, // 中奖信息
  176. doubleKey: "", // 领取key
  177. clearTime: "", // 碎片有效期
  178. }
  179. },
  180. computed: {
  181. isApple() {
  182. return uni.getSystemInfoSync().platform === 'ios'
  183. }
  184. },
  185. onLoad(options) {
  186. // 请求奖品数据
  187. this.mpData = options
  188. this.getData()
  189. },
  190. onUnload() {
  191. uni.hideLoading()
  192. },
  193. onShareAppMessage() {},
  194. filters: {
  195. getTimerFilter(value) { // 获取年月日时分秒
  196. if(!value) return ""
  197. let timestamp = Date.parse(new Date(value))
  198. let date = new Date(timestamp)
  199. let Y = date.getFullYear()
  200. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  201. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  202. let H = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
  203. let minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
  204. let S = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
  205. return `${Y}-${M}-${D} ${H}:${minute}:${S}`
  206. }
  207. },
  208. async onPullDownRefresh() {
  209. await this.handleInitCanvas()
  210. await this.getList()
  211. uni.stopPullDownRefresh();
  212. },
  213. methods: {
  214. // 看视频双倍
  215. lookVideo() {
  216. this.receiveGold(true)
  217. },
  218. // 领取金币
  219. receiveGold(watchVideos = false) {
  220. if(this.doubleKey) {
  221. setReceive({appId: config.appid, doubleKey: this.doubleKey, openId: this.openId, watchVideos, ...this.mpData }).then(res => {
  222. this.popupShow = false
  223. this.doubleKey = ""
  224. this.getList()
  225. })
  226. }
  227. },
  228. //
  229. getData() {
  230. uni.login({
  231. success: async res => {
  232. if (res.code) {
  233. let openIDInfo = await getOpenId({appId: config.appid, code: res.code})
  234. this.openId = openIDInfo.data
  235. let response = await this.getList()
  236. if(response) {
  237. await this.getPrizeList()
  238. getBanner({appId: config.appid, openId: this.openId, mpAppId: this.mpData.mpAppId}).then(res => {
  239. this.list = res.data
  240. })
  241. } else {
  242. this.prizeList = [{"prizeId":1,"name":"100书币","stock":100,"weight":10,"prizeImage":"/static/turntable_golds.png"},{"prizeId":2,"name":"书城VIP碎片","stock":100,"weight":10,"prizeImage":"/static/turntable_VIP.png"},{"prizeId":3,"name":"30书币","stock":100,"weight":10,"prizeImage":"/static/turntable_gold.png"},{"prizeId":4,"name":"书城VIP碎片","stock":100,"weight":10,"prizeImage":"/static/turntable_VIP.png"},{"prizeId":5,"name":"10书币","stock":100,"weight":10,"prizeImage":"/static/turntable_gold.png"},{"prizeId":6,"name":"50书币","stock":100,"weight":10,"prizeImage":"/static/turntable_golds.png"},{"prizeId":7,"name":"iPhone12碎片","stock":100,"weight":10,"prizeImage":"/static/turntable_iPhone12.png"},{"prizeId":8,"name":"20书币","stock":100,"weight":10,"prizeImage":"/static/turntable_gold.png"}]
  243. this.prizeCountDtoList = [{"prizeType":2,"prizeCount":0,"prizeName":"书城VIP碎片","maxCount":30},{"prizeType":3,"prizeCount":0,"prizeName":"iPhone12碎片","maxCount":50}]
  244. }
  245. }
  246. }
  247. })
  248. },
  249. // 跳转小程序
  250. jumpSign() {
  251. let path = 'pages/index/index'
  252. if(Object.keys(this.mpData).length > 0) {
  253. path = path + this.getSerialize(this.mpData)
  254. }
  255. uni.navigateToMiniProgram({
  256. appId: 'wxb21c3e030b8af425',
  257. path,
  258. success(res) {
  259. // 打开成功
  260. }
  261. })
  262. },
  263. // 对象序列化成 a=1&b=2
  264. getSerialize(value) {
  265. if(Object.prototype.toString.call(value) === "[object Object]") {
  266. let path = ""
  267. for (const key in value) {
  268. if (Object.prototype.hasOwnProperty.call(value, key)) {
  269. const element = value[key];
  270. if (path === "") {
  271. path = `?${key}=${element}`
  272. }else {
  273. path = path + `&${key}=${element}`
  274. }
  275. }
  276. }
  277. return path
  278. } else {
  279. return ""
  280. }
  281. },
  282. // 活动规则
  283. activityRulesHandle() {
  284. this.activityRules = !this.activityRules
  285. },
  286. // 关闭弹窗
  287. closeHandle() {
  288. this.receiveGold(false)
  289. this.popupShow = false
  290. },
  291. // 重新生成
  292. handleInitCanvas() {
  293. clearCacheFile()
  294. this.prizeList = []
  295. this.getPrizeList()
  296. },
  297. // 获取首页信息
  298. async getList() {
  299. let res = await getHome({appId: config.appid, openId: this.openId, userSource: 1, ...this.mpData})
  300. let data = res.data
  301. if(data) {
  302. this.userId = data.userId
  303. this.clearTime = data.clearTime
  304. this.prizeCountDtoList = data.prizeCountDtoList
  305. this.mpName = data.mpName
  306. this.freeNum = data.luckDraw
  307. this.mpData = {
  308. mpAppId: data.mpAppId,
  309. mpName: data.mpName,
  310. mpOpenId: data.mpOpenId
  311. }
  312. return Promise.resolve(true)
  313. } else {
  314. return Promise.resolve(false)
  315. }
  316. },
  317. // 获取奖品列表
  318. async getPrizeList() {
  319. uni.showLoading({
  320. title: '奖品准备中...'
  321. })
  322. let res = await getPond({appId: config.appid, openId: this.openId, mpAppId: this.mpData.mpAppId})
  323. if(res.data && res.data.length > 0) {
  324. this.prizeList = res.data.map(item => {
  325. let prizeImage = ""
  326. if (item.prizeType === 1) {
  327. prizeImage = '/static/turntable_gold.png'
  328. if(item.prizeCount > 30) {
  329. prizeImage = '/static/turntable_golds.png'
  330. }
  331. return {
  332. prizeId: item.id,
  333. name: item.prizeCount + item.prizeName,
  334. stock: 100,
  335. weight: 10,
  336. prizeImage
  337. }
  338. } else {
  339. prizeImage = '/static/turntable_iPhone12.png'
  340. if(item.prizeType === 2){
  341. prizeImage = '/static/turntable_VIP.png'
  342. }
  343. return {
  344. prizeId: item.id,
  345. name: item.prizeName,
  346. stock: 100,
  347. weight: 10,
  348. prizeImage
  349. }
  350. }
  351. })
  352. }else {
  353. uni.hideLoading()
  354. uni.showToast({
  355. title: '获取奖品失败'
  356. })
  357. }
  358. },
  359. // 本次抽奖开始
  360. handleDrawStart() {
  361. console.log('触发抽奖按钮')
  362. if (!this.mpName) { // 首次没有重公众号进入
  363. uni.navigateTo({
  364. url: '../officialAccount/officialAccount'
  365. })
  366. return
  367. }
  368. if (this.prizeing) return
  369. this.prizeing = true
  370. // 还有免费数次或者剩余金币足够抽一次
  371. if (this.freeNum > 0) {
  372. // 更新免费次数或金币余额
  373. if (this.freeNum > 0) {
  374. this.freeNum--
  375. }
  376. // 发起抽奖
  377. this.remoteGetPrizeIndex()
  378. } else {
  379. this.prizeing = false
  380. uni.showToast({
  381. title: '抽奖次数不足',
  382. icon:'none'
  383. })
  384. }
  385. },
  386. // 远程请求接口获取中奖下标
  387. remoteGetPrizeIndex() {
  388. console.warn('###当前处于模拟的请求接口,并返回了中奖信息###')
  389. let { mpName, ...mp } = this.mpData
  390. setDrawGain({appId: config.appid, openId: this.openId, ...mp}).then(res => {
  391. let data = res.data
  392. this.doubleKey = data.doubleKey
  393. let prizeIndex = this.prizeList.findIndex(item => item.prizeId === data.id)
  394. if(prizeIndex !== -1){
  395. this.prizeIndex = prizeIndex
  396. } else {
  397. uni.showToast({
  398. title: '抽奖异常,请稍后重试'
  399. })
  400. }
  401. })
  402. },
  403. // 本次抽奖结束
  404. handleDrawEnd() {
  405. console.log('旋转结束,执行拿到结果后到逻辑')
  406. // 旋转结束后,开始处理拿到结果后的逻辑
  407. this.prizeing = false
  408. let prizeName = this.prizeList[this.prizeIndex].name
  409. let tipContent = ''
  410. if (prizeName === '谢谢参与') {
  411. tipContent = '很遗憾,没有中奖,请再接再厉!'
  412. } else if (prizeName.indexOf('碎片') === -1 && this.freeNum >= 8) {
  413. this.popupShow = true
  414. this.luckyDay = this.prizeList[this.prizeIndex]
  415. return
  416. } else {
  417. // 如果奖品设有库存
  418. if (this.onStock) {
  419. let prizeStock = this.prizeList[this.prizeIndex].stock
  420. tipContent = prizeStock ? `恭喜您,获得 ${prizeName}` : `很抱歉,您来晚了,当前奖品 ${prizeName} 已无库存`
  421. } else {
  422. tipContent = `恭喜您,获得 ${prizeName} !`
  423. }
  424. }
  425. uni.showModal({
  426. content: tipContent,
  427. showCancel: false
  428. })
  429. this.getList()
  430. },
  431. // 抽奖转盘绘制完成
  432. handleDrawFinish(res) {
  433. console.log('抽奖转盘绘制完成', res)
  434. uni.showToast({
  435. title: res.msg,
  436. duration: 3000,
  437. mask: true,
  438. icon: 'none'
  439. })
  440. }
  441. }
  442. }
  443. </script>
  444. <style lang="scss">
  445. page{
  446. background-color: #F0524C;
  447. }
  448. .luckyDraw {
  449. position: relative;
  450. &>.back {
  451. width: 100%;
  452. }
  453. }
  454. .luckyDrawContent {
  455. position: absolute;
  456. top: 0;
  457. width: 100%;
  458. padding: 40rpx 0;
  459. margin-bottom: 20rpx;
  460. font-family: PingFangSC-Medium, PingFang SC;
  461. // 用户信息
  462. .luckyDrawTop {
  463. padding: 0 28rpx;
  464. height: 104rpx;
  465. display: flex;
  466. justify-content: space-between;
  467. align-items: center;
  468. .left{
  469. display: flex;
  470. justify-content: flex-start;
  471. align-items: center;
  472. &>.avatarView {
  473. overflow: hidden;
  474. width: 104rpx;
  475. height: 104rpx;
  476. background: #D8D8D8;
  477. border-radius: 10px;
  478. }
  479. .userInfo{
  480. margin-left: 28rpx;
  481. &>view{
  482. font-size: 32rpx;
  483. font-weight: 500;
  484. color: #FFFFFF;
  485. &.account {
  486. display: flex;
  487. justify-content: flex-start;
  488. align-items: center;
  489. &>image {
  490. width: 36rpx;
  491. height: 36rpx;
  492. margin-right: 10rpx;
  493. }
  494. }
  495. &.ID{
  496. margin-top: 4rpx;
  497. }
  498. }
  499. }
  500. }
  501. .right{
  502. width: 212rpx;
  503. height: 76rpx;
  504. background: #FEC435;
  505. border-radius: 40rpx;
  506. display: flex;
  507. justify-content: center;
  508. align-items: center;
  509. &>text {
  510. font-size: 28rpx;
  511. font-weight: 400;
  512. color: #FFFFFF;
  513. margin-left: 18rpx;
  514. }
  515. }
  516. }
  517. // 滚动通知
  518. .notice {
  519. width: 656rpx;
  520. height: 68rpx;
  521. background: #C7322C;
  522. box-shadow: 0px 4rpx 8rpx 0rpx rgba(49, 49, 49, 0.08);
  523. border-radius: 38rpx;
  524. opacity: 0.53;
  525. margin: 58rpx auto 0;
  526. padding: 0 30rpx;
  527. box-sizing: border-box;
  528. display: flex;
  529. justify-content: flex-start;
  530. align-items: center;
  531. .horn {
  532. width: 28rpx;
  533. height: 28rpx;
  534. }
  535. .txts {
  536. // flex: 1;
  537. height: 68rpx;
  538. width: 600rpx;
  539. }
  540. }
  541. // 大转盘
  542. .turntable {
  543. position: relative;
  544. margin-top: 40rpx;
  545. .decorate{
  546. position: relative;
  547. width: 100%;
  548. height: 890rpx;
  549. &>image {
  550. width: 100%;
  551. position: absolute;
  552. z-index: 10;
  553. &.decorateBack {
  554. top: 0;
  555. }
  556. &.decorateChassis{
  557. position: absolute;
  558. z-index: 1;
  559. bottom: 0;
  560. }
  561. }
  562. }
  563. .turntableContent {
  564. position: absolute;
  565. top: 0;
  566. left: 0;
  567. right: 0;
  568. bottom: 0;
  569. width: 100%;
  570. height: 100%;
  571. z-index: 20;
  572. padding-top: 20rpx;
  573. .bottom {
  574. margin-top: 20rpx;
  575. text-align: center;
  576. position: absolute;
  577. bottom: 35rpx;
  578. left: 50%;
  579. transform: translateX(-50%);
  580. .cont{
  581. font-size: 28rpx;
  582. font-weight: 400;
  583. color: #FFFFFF;
  584. margin-bottom: 22rpx;
  585. text {
  586. font-size: 36rpx;
  587. color: #FEED22;
  588. font-weight: 500;
  589. }
  590. }
  591. .record{
  592. font-size: 28rpx;
  593. font-weight: 500;
  594. color: #FFFFFF;
  595. }
  596. }
  597. }
  598. }
  599. // 我的奖品
  600. .myPrize {
  601. margin: 40rpx 26rpx 0;
  602. min-height: 352rpx;
  603. background: #F4E2CA;
  604. border-radius: 20rpx;
  605. position: relative;
  606. padding: 58rpx 0 20rpx;
  607. .title {
  608. position: absolute;
  609. width: 232rpx;
  610. height: 64rpx;
  611. background: linear-gradient(180deg, #FFEDD1 0%, #FFC954 100%);
  612. box-shadow: 0 4rpx 8rpx 0 rgba(0, 0, 0, 0.07);
  613. border-radius: 0 0 24rpx 24rpx;
  614. font-size: 32rpx;
  615. font-weight: 500;
  616. color: #F33938;
  617. text-align: center;
  618. line-height: 64rpx;
  619. left: 50%;
  620. transform: translateX(-50%);
  621. top: -12rpx;
  622. }
  623. .chips {
  624. display: flex;
  625. justify-content: space-between;
  626. }
  627. .chip {
  628. display: flex;
  629. flex-direction: column;
  630. align-items: center;
  631. width: 50%;
  632. &>image {
  633. width: 208rpx;
  634. height: 160rpx;
  635. }
  636. .text{
  637. font-size: 32rpx;
  638. font-weight: 500;
  639. color: #F33938;
  640. line-height: 44rpx;
  641. margin-top: 12rpx;
  642. }
  643. .progress{
  644. position: relative;
  645. width: 200rpx;
  646. height: 40rpx;
  647. margin-top: 12rpx;
  648. background: #FFFCF7;
  649. border-radius: 26rpx;
  650. overflow: hidden;
  651. .value{
  652. position: absolute;
  653. width: 1%;
  654. height: 100%;
  655. top: 0;
  656. left: 0;
  657. z-index: 1;
  658. background: #F37938;
  659. }
  660. &>text {
  661. font-size: 28rpx;
  662. font-weight: 500;
  663. color: #333333;
  664. position: absolute;
  665. top: 50%;
  666. left: 50%;
  667. transform: translate(-50%, -50%);
  668. z-index: 2;
  669. }
  670. }
  671. }
  672. .clearTime{
  673. margin: 20rpx 0 0;
  674. text-align: center;
  675. font-size: 24rpx;
  676. font-weight: 400;
  677. color: #F33938;
  678. }
  679. }
  680. // 活动规则
  681. .activityRules {
  682. margin: 40rpx 28rpx 0;
  683. background: #F4E2CA;
  684. border-radius: 20rpx;
  685. color: #F33938;
  686. font-size: 32rpx;
  687. font-weight: 400;
  688. &>.top {
  689. height: 92rpx;
  690. padding: 0 28rpx;
  691. box-sizing: border-box;
  692. display: flex;
  693. justify-content: space-between;
  694. align-items: center;
  695. &>image {
  696. width: 40rpx;
  697. }
  698. }
  699. &>.bottom {
  700. padding: 0 28rpx 30rpx;
  701. box-sizing: border-box;
  702. &> view {
  703. margin-bottom: 12rpx;
  704. font-size: 28rpx;
  705. font-weight: 400;
  706. color: #666666;
  707. line-height: 46rpx;
  708. }
  709. }
  710. }
  711. // 弹窗
  712. .popup {
  713. position: fixed;
  714. width: 100%;
  715. height: 100vh;
  716. background: rgba(0, 0, 0, 0.6);
  717. top: 0;
  718. left: 0;
  719. right: 0;
  720. bottom: 0;
  721. z-index: 100;
  722. .popupContent {
  723. width: 632rpx;
  724. position: absolute;
  725. top: 50%;
  726. left: 50%;
  727. transform: translate(-50%, -50%);
  728. text-align: center;
  729. &>.content {
  730. position: relative;
  731. &>image {
  732. width: 100%;
  733. height: 652rpx;
  734. }
  735. &>.textCon {
  736. position: absolute;
  737. width: 100%;
  738. top: 0;
  739. left: 0;
  740. right: 0;
  741. bottom: 0;
  742. padding-top: 192rpx;
  743. .ts {
  744. font-size: 60rpx;
  745. font-weight: 500;
  746. color: #F5631D;
  747. }
  748. .reward {
  749. height: 60rpx;
  750. background: #FFD9A2;
  751. border-radius: 31rpx;
  752. font-size: 32rpx;
  753. font-weight: 400;
  754. display: inline-block;
  755. padding: 0 32rpx;
  756. color: #F5631E;
  757. line-height: 60rpx;
  758. margin-top: 20rpx;
  759. }
  760. .doubleBt {
  761. width: 424rpx;
  762. height: 84rpx;
  763. margin-top: 114rpx;
  764. }
  765. .bt {
  766. margin-top: 14rpx;
  767. font-size: 32rpx;
  768. font-weight: 400;
  769. color: #FCE8CD;
  770. }
  771. }
  772. }
  773. &>.close {
  774. width: 54rpx;
  775. height: 54rpx;
  776. margin-top: 76rpx;
  777. }
  778. }
  779. }
  780. }
  781. </style>