Lottery.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <view class="pages">
  3. <!-- <navbar ref="navbarRef" :config="config" :backColor="backColor"></navbar> -->
  4. <view class="page-content" :style="{backgroundImage: 'url('+activityInfo.imageUrl + ossImg +')'}">
  5. <view class="winning-c">
  6. <view class="winning-user" v-if="WinningUserList && WinningUserList.length > 0">
  7. <!-- 第一次进入,有数据, ,到最后一页替换数据之后在请求下一次数据,无数据时做30s轮询查询 -->
  8. <swiper class="winning-list" :disable-touch="true" circular="true" vertical="true" autoplay
  9. interval="3000" duration="1000" @change="WinningCurrent">
  10. <swiper-item class="winning-item-box" v-for="item in WinningUserList">
  11. <view class="winning-item zw-one-row">
  12. *恭喜用户:{{item.userName}}, 获得{{item.prizeName}}
  13. </view>
  14. </swiper-item>
  15. </swiper>
  16. </view>
  17. </view>
  18. <!-- strDirection="vertical" -->
  19. <view class="pedestal-bg">
  20. <template v-if="prizeList.length">
  21. <my-turntable-draw ref="raffleWheel" :canvasWidth="boxData.width" :canvasHeight="boxData.width"
  22. :prizeList="prizeList" :targetIndex="targetIndex" @befoterClick="befoterClick"
  23. @afterClick="afterClick">
  24. </my-turntable-draw>
  25. </template>
  26. <!-- <view class="share-btn" @click.stop="onShare()">
  27. 分享
  28. </view> -->
  29. </view>
  30. <view class="Lottery-info">
  31. <view class="Lottery-info-item zw-one-row">
  32. 次数:{{freeResidueNum}}
  33. </view>
  34. <view class="Lottery-info-item zw-one-row" v-if="activityInfo.pointExchangeLottery">
  35. 积分:{{integral}}
  36. </view>
  37. <!-- <view class="Lottery-info-item zw-one-row" @click="onWinningList()">
  38. 中奖记录
  39. </view> -->
  40. </view>
  41. <view class="winning-record">
  42. <text @click.stop="onWinningList()" class="record-text">中奖记录 <text class="iconfont_yige">&#xe65f;</text>
  43. </text>
  44. </view>
  45. <view class="activity-rule-box">
  46. <view class="activity-rule-top" />
  47. <view class="activity-rule">
  48. <view class="rule-title">
  49. 活动规则
  50. </view>
  51. <view class="rule-list" v-html="activityInfo.ruleExplain" />
  52. </view>
  53. <view class="activity-rule-boot" />
  54. </view>
  55. </view>
  56. <!-- 商品 -->
  57. <view class="goods-boxs">
  58. <view class="goods-box" v-if="goodsList && goodsList.length > 0">
  59. <view class="goods-module-title">
  60. 推荐商品
  61. </view>
  62. <view class="goods-item" v-for="item in goodsList"
  63. @click="goProductDetails('/pages/product/goods/goods?id=' + item.goodsId)">
  64. <!-- <image :src="item.cover" mode="aspectFill"></image> -->
  65. <view class="goods-img lazy-img">
  66. <u-image class="service-img" :src="item.goodsCover" mode="aspectFit" :lazy-load="true" />
  67. </view>
  68. <view class="goods-info">
  69. <view class="goods-title">{{item.goodsTitle}}</view>
  70. <view class="goods-price">
  71. <rich-text :nodes="$mUtil.priceBigSmall(item.goodsSalePrice)"></rich-text>
  72. <text class="line-price">¥ {{ item.goodsMarketPrice }}</text>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <EmptyDate v-else-if="status !== 'loading' && status" />
  78. </view>
  79. <Winning ref="WinningRef" :activityJoinRecordId="activityJoinRecordId" />
  80. <!-- <sharePoster ref="sharePosterRef" :posterUrl="activityInfo.posterUrl" :codeUrl="codeurl"
  81. @onShareSuccess="onShareSuccess" /> -->
  82. </view>
  83. </template>
  84. <script>
  85. import myTurntableDraw from '@/components/my-turntable-draw/my-turntable-draw'
  86. import Winning from "./popup/Winning.vue"
  87. import CONFIG from "@/config/global.config.js"
  88. import {
  89. setPrizeLevel
  90. } from "./common.js"
  91. import {
  92. myUserInfo
  93. } from "@/api/government.js"
  94. import {
  95. getActivity,
  96. getActivityPrize,
  97. getActivityLottery,
  98. getActivityUserInfo,
  99. getWinningRecords,
  100. setActivityViewVolume,
  101. getActivityGoods,
  102. setShareRecord
  103. // getActivityUvRecord,
  104. // getActivityViewVolume_pv,
  105. // getActivityViewVolume_uv
  106. } from "@/api/Lottery.js"
  107. const app = getApp();
  108. export default {
  109. components: {
  110. myTurntableDraw,
  111. Winning,
  112. },
  113. data() {
  114. return {
  115. ossImg: '',
  116. // ?x-oss-process=style/w_750_jpg
  117. codeurl: null,
  118. location: null,
  119. config: {
  120. back: true,
  121. title: '转盘抽奖',
  122. color: 'white',
  123. backgroundColor: [0, '#fff'],
  124. statusBarFontColor: 'transparent',
  125. barPlaceholder: false
  126. },
  127. backColor: '',
  128. activityId: null, // 活动ID
  129. activityInfo: {},
  130. // 转盘 ,
  131. // colors: ["#F0DDAE", "#F6F0E7"],
  132. // 以下是奖品配置数据
  133. // 奖品数据
  134. prizeList: [],
  135. // 中奖下标
  136. activityJoinRecordId: null,
  137. // 抽奖次数
  138. freeResidueNum: 0,
  139. integral: 0,
  140. // 中奖用户
  141. current: 0,
  142. WinningUserList: [],
  143. cacheWinningUser: [],
  144. clearWinningTime: null,
  145. // 是否在抽奖
  146. isRotate: false,
  147. targetIndex: -1,
  148. boxData: {
  149. width: uni.upx2px(673),
  150. height: uni.upx2px(673)
  151. },
  152. // ----商品----
  153. status: '',
  154. params: {
  155. page: 1,
  156. limit: 6
  157. },
  158. imgSize: 60,
  159. goodsList: [],
  160. Volume_Timeout: null
  161. };
  162. },
  163. onPageScroll(e) {
  164. // config: {
  165. // back: true,
  166. // title: '关注',
  167. // color: 'black',
  168. // backgroundColor: [1, '#fff'],
  169. // statusBarFontColor: 'black'
  170. // },
  171. if (e.scrollTop >= 50 && this.config.color === 'white') {
  172. this.config.color = 'black'
  173. this.config.backgroundColor = [1, '#fff']
  174. this.config.statusBarFontColor = 'black'
  175. this.backColor = '#999';
  176. // this.$refs.navbarRef.init();
  177. } else if (e.scrollTop < 50 && this.config.color === 'black') {
  178. this.config.color = 'white'
  179. this.config.backgroundColor = [0, '#fff']
  180. this.config.statusBarFontColor = 'transparent';
  181. this.backColor = '';
  182. // console.log('this.config = ', this.config)
  183. // this.$refs.navbarRef.init();
  184. }
  185. },
  186. onLoad(opt) {
  187. this.location = app.globalData.location || null;
  188. this.activityId = opt.activityId || null
  189. // this.codeurl = `${CONFIG.hostUrl}?URLType=BigTurnplate&activityId=${this.activityId}`
  190. // /api/activity/info/{activityId}
  191. // this.Volume_Timeout = setTimeout(() => {
  192. // if (this.Volume_Timeout) {
  193. // this.setActivityViewVolume_();
  194. // clearTimeout(this.Volume_Timeout);
  195. // this.Volume_Timeout = null;
  196. // }
  197. // }, 3000)
  198. this.getActivityInfo()
  199. this.guessLike()
  200. },
  201. // onReachBottom() {
  202. // if (this.status == 'more') {
  203. // this.params.page++;
  204. // this.guessLike();
  205. // }
  206. // },
  207. onUnload() {
  208. clearTimeout(this.Volume_Timeout);
  209. this.Volume_Timeout = null;
  210. },
  211. methods: {
  212. // PV,PU记录
  213. setActivityViewVolume_() {
  214. setActivityViewVolume({
  215. activityId: this.activityId
  216. }).then(res => {})
  217. },
  218. onShare() {
  219. myUserInfo().then(res => {
  220. const data = res.data || null;
  221. if (!data) {
  222. uni.showToast({
  223. title: '请先登录',
  224. icon: 'none'
  225. })
  226. setTimeout(() => {
  227. uni.redirectTo({
  228. url: '/pages/login/index'
  229. })
  230. }, 1000)
  231. } else if (!this.activityInfo.posterUrl) {
  232. uni.showToast({
  233. title: '暂未配置分享内容',
  234. icon: 'none'
  235. });
  236. return
  237. } else {
  238. // this.$refs.shareRef.open()
  239. this.$refs.sharePosterRef.open();
  240. }
  241. })
  242. },
  243. // 获取活动详情
  244. getActivityInfo() {
  245. getActivity(this.activityId).then(res => {
  246. const { data } = res || {}
  247. this.activityInfo = data || {};
  248. let list = this.activityInfo.prizes || [];
  249. const list_l = list.length;
  250. if (list_l < 8) {
  251. this.imgSize = 80
  252. } else {
  253. this.imgSize = 100
  254. }
  255. list.map((el, index) => {
  256. el.prizeId = el.activityPrizeId;
  257. el.prizeName = el.prizeName;
  258. el.prizeImage = el.imageUrl + '?x-oss-process=style/game_w_50';
  259. el.prizeChinese = setPrizeLevel(el.prizeGrade);
  260. return el
  261. });
  262. this.prizeList = list;
  263. this.getActivityPrizeList();
  264. this.getActivityUserInfo_();
  265. this.getWinningRecords_();
  266. })
  267. },
  268. // 最新中奖记录
  269. getWinningRecords_(_cache = false) {
  270. try {
  271. clearTimeout(this.clearWinningTime)
  272. } catch (e) {};
  273. this.clearWinningTime = null;
  274. getWinningRecords(this.activityId).then(res => {
  275. const data = res.data
  276. if (data && data.length > 0) {
  277. if (_cache) {
  278. this.cacheWinningUser = data;
  279. } else {
  280. this.WinningUserList = data;
  281. };
  282. } else {
  283. this.clearWinningTime = setTimeout(() => {
  284. this.getWinningRecords_()
  285. }, 30000)
  286. }
  287. })
  288. },
  289. // 获取活动的用户信息
  290. getActivityUserInfo_() {
  291. getActivityUserInfo(this.activityId).then(res => {
  292. const val = res.data || {};
  293. this.freeResidueNum = val?.freeResidueNum || 0;
  294. this.integral = val?.integral || 0;
  295. })
  296. },
  297. // 获取奖品信息
  298. getActivityPrizeList() {
  299. getActivityPrize(this.activityId).then(res => {
  300. // prizeId 奖品对应 ID Number
  301. // prizeName 奖品名称 String
  302. // prizeStock 奖品库存 Number
  303. // prizeWeight 奖品权重 Number
  304. // prizeImage 奖品图片地址,网络图片仅支持http和https协议 String
  305. let list = res.data || [];
  306. list.map((el, index) => {
  307. // prizes
  308. el.prizeId = el.activityPrizeId;
  309. el.prizeName = el.prizeName;
  310. el.prizeImage = el.imageUrl + '?x-oss-process=style/game_w_50';
  311. // console.log('el.prizeImage = ', el.prizeImage)
  312. el.prizeChinese = setPrizeLevel(el.prizeGrade);
  313. return el
  314. });
  315. this.prizeList = list;
  316. })
  317. },
  318. WinningCurrent(event) {
  319. const index = event.detail.current + 1;
  320. if (index >= this.WinningUserList.length) {
  321. if (this.cacheWinningUser.length > 0) {
  322. this.WinningUserList = this.cacheWinningUser;
  323. this.cacheWinningUser = [];
  324. }
  325. this.getWinningRecords_(true)
  326. }
  327. },
  328. async befoterClick(data) {
  329. // 当前正在抽奖
  330. // console.log(" 当前正在抽奖 ", this.isRotate)
  331. if (this.isRotate) callback(false)
  332. if (data.type == 'start') {
  333. try {
  334. this.isRotate = true;
  335. this.targetIndex = -1;
  336. let prize_ = -1;
  337. if (this.activityInfo.areaLimit) {
  338. // 抽奖限制地区 - 检查是否定位
  339. if (!this.location || !this.location.city) {
  340. uni.showModal({
  341. title: '提示',
  342. content: '当前抽奖需要定位信息,是否获取定位',
  343. confirmText: '获取定位信息',
  344. success: res => {
  345. if (res.confirm) {
  346. uni.showLoading({
  347. title: '获取中'
  348. })
  349. uni.getLocation({
  350. type: 'gcj02',
  351. geocode: true,
  352. cacheTimeout: 30 * 60,
  353. success: Location => {
  354. const address = Location.address;
  355. // 缓存全局的定位信息
  356. app.globalData.location = address;
  357. this.location = address;
  358. if (!address.city) {
  359. uni.showToast({
  360. title: '获取定位失败',
  361. icon: 'none'
  362. })
  363. } else {
  364. uni.showToast({
  365. title: '获取定位成功,请开始抽奖',
  366. icon: 'none'
  367. })
  368. }
  369. },
  370. fail: LocationErr => {
  371. uni.showToast({
  372. title: '获取定位失败',
  373. icon: 'none'
  374. })
  375. },
  376. complete: () => {
  377. uni.hideLoading()
  378. // console.log('145')
  379. }
  380. })
  381. } else if (res.cancel) {
  382. console.log('用户点击取消');
  383. }
  384. }
  385. });
  386. throw new Error('')
  387. };
  388. };
  389. // if (this.freeResidueNum > 0) {
  390. // } else
  391. if (this.freeResidueNum <= 0 && this.activityInfo.pointExchangeLottery) {
  392. const Modal = await uni.showModal({
  393. content: `是否消耗${this.activityInfo.singleExchangePoints}抽一次奖`,
  394. });
  395. if (!Modal[1].confirm) {
  396. throw new Error('用户拒接使用积分抽奖')
  397. }
  398. }
  399. const c_y = this.location?.city || undefined
  400. // console.log('本次抽奖开始')
  401. // 这里需要处理你的抽奖逻辑,并得出中奖物品的 this.targetIndex
  402. // 请查看示例项目中的代码
  403. this.activityJoinRecordId = null;
  404. getActivityLottery({
  405. activityId: this.activityId,
  406. cityName: c_y
  407. }).then(res => {
  408. const val = res.data;
  409. try {
  410. // console.log('抽奖成功 1= ', this.prizeList)
  411. this.prizeList.forEach((el, index) => {
  412. if (el.activityPrizeId === val.prizeId) {
  413. // console.log('抽奖成功 = ', el)
  414. this.targetIndex = index;
  415. this.activityJoinRecordId = val.activityJoinRecordId;
  416. throw new Error('')
  417. }
  418. })
  419. } catch (e) {
  420. //TODO handle the exception
  421. }
  422. // console.log("this.targetIndex = ", this.targetIndex)
  423. if (this.targetIndex > -1) {
  424. data.callback && data.callback(this.targetIndex)
  425. } else {
  426. throw new Error('获取奖品错误')
  427. }
  428. }).catch(err => {
  429. data.callback && data.callback(-1)
  430. this.isRotate = false;
  431. throw new Error('获取奖品错误')
  432. })
  433. } catch (e) {
  434. //TODO handle the exception
  435. this.isRotate = false;
  436. data.callback && data.callback(-1)
  437. }
  438. }
  439. },
  440. afterClick(data) {
  441. if (data.type == 'end') {
  442. // console.log(data.content.count)
  443. data.callback && data.callback();
  444. // console.log('handleDrawEnd =旋转结束,执行拿到结果后到逻辑')
  445. this.getActivityUserInfo_();
  446. // 完成抽奖后,这里处理你拿到结果后的逻辑
  447. const prizeVal = this.prizeList[this.targetIndex];
  448. this.isRotate = false
  449. this.$refs.WinningRef.onWinning(prizeVal)
  450. }
  451. },
  452. // 查看自己得中奖信息
  453. onWinningList() {
  454. uni.navigateTo({
  455. url: '/pages/game/winning-list'
  456. })
  457. },
  458. // --------商品---------------
  459. /**猜你喜欢 */
  460. guessLike() {
  461. this.status = 'loading';
  462. getActivityGoods({
  463. page: this.params.page,
  464. limit: this.params.limit,
  465. activityId: this.activityId
  466. }).then(res => {
  467. this.goodsList = res.rows
  468. // if (res && res.code == 200) {
  469. // this.goodsList = this.params.page == 1 ? res.rows : this.goodsList.concat(res.rows);
  470. // if (res.total <= res.page.currPage) {
  471. // this.status = "noMore";
  472. // } else {
  473. // this.status = "more";
  474. // }
  475. // // console.log(this.goodsList)
  476. // }
  477. }).catch(err => {
  478. // this.status = "noMore";
  479. })
  480. // this.$http.get(`/goods/smart`, {
  481. // page: this.params.page,
  482. // limit: this.params.limit,
  483. // }).then((res) => {
  484. // if (res && res.code == 200) {
  485. // this.goodsList = this.params.page == 1 ? res.page.list : this.goodsList.concat(res.page
  486. // .list);
  487. // if (res.page.totalPage <= res.page.currPage) {
  488. // this.status = "noMore";
  489. // } else {
  490. // this.status = "more";
  491. // }
  492. // // console.log(this.goodsList)
  493. // }
  494. // }).catch(err => {
  495. // this.status = "noMore";
  496. // })
  497. },
  498. goProductDetails(path) {
  499. uni.navigateTo({
  500. url: path
  501. })
  502. },
  503. //分享成功
  504. // onShareSuccess(type) {
  505. // // this.$emit('onShareSuccess', "WeChat")download
  506. // let shareMode = null;
  507. // switch (type) {
  508. // case 'download':
  509. // shareMode = 0;
  510. // break;
  511. // case 'WeChat':
  512. // shareMode = 1;
  513. // break;
  514. // }
  515. // setShareRecord({
  516. // activityId: _this.activityId,
  517. // shareMode: shareMode
  518. // }).then(res => {
  519. // console.log("success:1 图片已成功保存到相册");
  520. // })
  521. // }
  522. },
  523. watch: {
  524. // cacheWinningUser: {
  525. // handler(newV, oldA) {
  526. // if(newV)
  527. // },
  528. // immediate: true
  529. // }
  530. }
  531. }
  532. </script>
  533. <style lang="scss" scoped>
  534. $padd_: 28rpx;
  535. .pages {
  536. width: 750rpx;
  537. overflow: hidden;
  538. background-color: #C90700;
  539. }
  540. .page-content {
  541. width: 100%;
  542. // height: 1432rpx;
  543. // background-color: #fff;
  544. padding-top: 353rpx;
  545. // min-height: 100vh;
  546. background-size: 100% 1432rpx;
  547. background-repeat: no-repeat;
  548. }
  549. .winning-c {
  550. width: 100%;
  551. height: 163rpx;
  552. padding: 40rpx 0;
  553. }
  554. .Lottery-title {
  555. width: 100%;
  556. font-size: 40rpx;
  557. color: #fff;
  558. font-weight: 600;
  559. text-align: center;
  560. padding: 80rpx;
  561. }
  562. .winning-user {
  563. width: 100%;
  564. height: 83rpx;
  565. // padding: 0 20rpx 60rpx;
  566. box-sizing: border-box;
  567. background: linear-gradient(90deg, rgba(222, 28, 64, 0.00) 11%, #b10424 48%, rgba(222, 28, 64, 0.00) 89%);
  568. .winning-list {
  569. // width: 100%;
  570. height: 83rpx;
  571. padding: 0 80rpx;
  572. // background-color: red;
  573. border-radius: 40rpx;
  574. .winning-item-box {
  575. width: 100%;
  576. display: flex;
  577. align-items: center;
  578. font-size: 26rpx;
  579. font-family: PingFang SC, PingFang SC-Light;
  580. font-weight: 300;
  581. color: #ffffff;
  582. .winning-item {
  583. width: 100%;
  584. text-align: center;
  585. }
  586. }
  587. }
  588. }
  589. .pedestal-bg {
  590. position: relative;
  591. width: 100%;
  592. // height: 673rpx; + 217
  593. height: 875rpx;
  594. background: url("@/static/Lottery/pedestal.png") no-repeat center bottom;
  595. background-size: 429rpx 217rpx;
  596. .share-btn {
  597. position: absolute;
  598. right: 30rpx;
  599. bottom: 20rpx;
  600. width: 120rpx;
  601. height: 120rpx;
  602. background: linear-gradient(180deg, #c90700, #981a15);
  603. // border: 1rpx solid rgba(255, 255, 255, 0.12);
  604. border-radius: 60rpx;
  605. box-shadow: 0px -1rpx 34rpx 0px rgba(255, 199, 199, 0.16) inset;
  606. text-align: center;
  607. line-height: 119rpx;
  608. font-size: 36rpx;
  609. font-family: PingFang SC, PingFang SC-Bold;
  610. font-weight: 700;
  611. color: #ffffff;
  612. }
  613. }
  614. .Lottery-info {
  615. display: flex;
  616. justify-content: center;
  617. align-items: center;
  618. padding: 13rpx $padd_ 14rpx;
  619. .Lottery-info-item {
  620. width: calc(50% - 10rpx);
  621. flex-shrink: 0;
  622. height: 64rpx;
  623. line-height: 64rpx;
  624. text-align: center;
  625. padding: 0 20rpx;
  626. background: url("@/static/Lottery/bg_2.png") no-repeat center center;
  627. background-size: 100% 100%;
  628. font-size: 28rpx;
  629. // font-family: .PingFang SC, .PingFang SC-Light;
  630. // font-weight: 300;
  631. color: #542f10;
  632. margin-right: 20rpx;
  633. &:last-child {
  634. margin-right: 0;
  635. }
  636. }
  637. }
  638. // <view class="winning-record">
  639. // <text class="record-text">中奖记录</text>
  640. // </view>
  641. .winning-record {
  642. padding: 20rpx $padd_;
  643. text-align: right;
  644. font-weight: 600;
  645. font-size: 28rpx;
  646. font-weight: 500;
  647. color: #fff;
  648. .iconfont_yige {
  649. font-size: 26rpx;
  650. color: #fff;
  651. }
  652. }
  653. .activity-rule-box {
  654. padding: 0 $padd_;
  655. }
  656. .activity-rule-top {
  657. width: 100%;
  658. height: 40rpx;
  659. background: url("@/static/Lottery/bg_1.png") no-repeat top center;
  660. background-size: 100% 398rpx;
  661. }
  662. .activity-rule-boot {
  663. width: 100%;
  664. height: 40rpx;
  665. background: url("@/static/Lottery/bg_1.png") no-repeat bottom center;
  666. background-size: 100% 398rpx;
  667. }
  668. .activity-rule {
  669. padding: 0 40rpx;
  670. background: url("@/static/Lottery/bg_1.png") no-repeat center center;
  671. background-size: 100% 10000%;
  672. .rule-title {
  673. // font-size: 32rpx;
  674. font-weight: 600;
  675. font-size: 28rpx;
  676. // font-family: .PingFang SC, .PingFang SC-Medium;
  677. font-weight: 500;
  678. color: #1a1a1a;
  679. }
  680. .rule-list {
  681. // padding-top: 18rpx;
  682. // font-size: 24rpx;
  683. // font-weight: 300;
  684. // color: #666666;
  685. /deep/ img,
  686. /deep/ video {
  687. max-width: 100%;
  688. }
  689. }
  690. }
  691. .goods-boxs {
  692. padding: 90rpx $padd_ 0;
  693. }
  694. .goods-box {
  695. background: #fff4ea;
  696. padding: 92rpx 20rpx 10rpx;
  697. display: flex;
  698. flex-wrap: wrap;
  699. width: 100%;
  700. margin-top: $zw-gap;
  701. border: 6rpx solid #e72726;
  702. border-radius: 10rpx;
  703. display: flex;
  704. justify-content: space-between;
  705. align-items: stretch;
  706. position: relative;
  707. .goods-module-title {
  708. position: absolute;
  709. left: 50%;
  710. top: -40rpx;
  711. transform: translateX(-50%);
  712. width: 337rpx;
  713. height: 114rpx;
  714. text-align: center;
  715. line-height: 80rpx;
  716. background: url('@/static/Lottery/goods.png') no-repeat center center;
  717. background-size: 100% 100%;
  718. font-size: 28rpx;
  719. // font-family: PingFang SC, PingFang SC-Bold;
  720. font-weight: 700;
  721. color: #ffffff;
  722. }
  723. .goods-item {
  724. width: 316rpx;
  725. height: 482rpx;
  726. // margin-right: 18rpx;
  727. margin-bottom: 38rpx;
  728. background: #ffffff;
  729. border-radius: 18rpx;
  730. overflow: hidden;
  731. box-shadow: 0 2rpx 12rpx 0 rgba(0, 0, 0, 0.1);
  732. // &:nth-child(2n) {
  733. // margin-right: 0;
  734. // }
  735. .goods-img {
  736. width: 316rpx;
  737. height: 316rpx;
  738. border-radius: 18rpx 18rpx 0 0;
  739. vertical-align: middle;
  740. }
  741. .goods-info {
  742. padding: 0 20rpx 20rpx;
  743. padding-top: 14rpx;
  744. height: calc(100% - 316rpx);
  745. display: flex;
  746. flex-direction: column;
  747. justify-content: space-between;
  748. .goods-title {
  749. // height: 90rpx;
  750. margin-bottom: 10rpx;
  751. overflow: hidden;
  752. text-overflow: ellipsis;
  753. display: -webkit-box;
  754. -webkit-box-orient: vertical;
  755. -webkit-line-clamp: 2;
  756. }
  757. .goods-price {
  758. display: flex;
  759. align-items: baseline;
  760. color: #FF6600;
  761. font-size: 36rpx;
  762. .line-price {
  763. font-size: 22rpx;
  764. color: #999999;
  765. margin-left: 16rpx;
  766. text-decoration: line-through;
  767. }
  768. }
  769. }
  770. }
  771. }
  772. </style>