|
|
@@ -1,667 +1,685 @@
|
|
|
<template>
|
|
|
<div class="page">
|
|
|
- <div class="user-info" @click="$router.push('/setting')">
|
|
|
- <div>
|
|
|
- <van-image
|
|
|
- lazy-load
|
|
|
- round
|
|
|
- width="40"
|
|
|
- height="40"
|
|
|
- :src="userInfo.avatar || require('@assets/img_default_photo.png')"
|
|
|
- fit="cover"
|
|
|
- />
|
|
|
- <span class="van-ellipsis">{{ userInfo.nickname }}</span>
|
|
|
- </div>
|
|
|
- <van-icon name="arrow" color="#8f9195"/>
|
|
|
- </div>
|
|
|
- <!-- 内容 -->
|
|
|
- <div class="content">
|
|
|
- <div class="class-box">
|
|
|
- <div class="class-box_left" @click="$router.push('/welfareintegral')">
|
|
|
- <div><span>{{availableIntegral}}</span>积分</div>
|
|
|
- <div class="class-box_tips">收支兑换记录</div>
|
|
|
- <button>点击查看</button>
|
|
|
- </div>
|
|
|
- <div class="class-box_right">
|
|
|
- <div><span>每日签到</span></div>
|
|
|
- <div class="class-box_tips">做任务赚取积分</div>
|
|
|
- <button>点击签到</button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 抽奖部分 -->
|
|
|
- <div class="draw-box">
|
|
|
- <!-- 抽奖头部 -->
|
|
|
- <div class="draw-box_top">
|
|
|
- <img src="../../assets/yuanyu/icon-left.png" alt="">
|
|
|
- <span>参与抽奖免费赢豪礼</span>
|
|
|
- <img src="../../assets/yuanyu/icon-right.png" alt="">
|
|
|
- </div>
|
|
|
- <div v-if="activityId">
|
|
|
- <!-- 排名奖品 -->
|
|
|
- <div class="draw-box_ranking">
|
|
|
- <template v-for="(item,index) in rankingList" :key="index">
|
|
|
- <div>
|
|
|
- <div :class="['ranking-box','ranking-box'+index]">
|
|
|
- <img v-if="item.pic" :src="item.pic" class="ranking-img">
|
|
|
- <img v-if="index == 0" src="../../assets/yuanyu/bg-icon1.png" class="ranking-bg" />
|
|
|
- <img v-if="index == 1" src="../../assets/yuanyu/bg-icon2.png" class="ranking-bg" />
|
|
|
- <img v-if="index == 2" src="../../assets/yuanyu/bg-icon3.png" class="ranking-bg" />
|
|
|
- </div>
|
|
|
- <span>{{item.name || ''}}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- <!-- 中奖提示公告 -->
|
|
|
- <div class="notice-box" v-if="noticeList.length > 0">
|
|
|
- <van-notice-bar
|
|
|
- :left-icon="require('../../assets/yuanyu/icon1.png')"
|
|
|
- :scrollable="false"
|
|
|
- color="#fff">
|
|
|
- <van-swipe vertical
|
|
|
- class="notice-swipe"
|
|
|
- :autoplay="3000"
|
|
|
- :show-indicators="false">
|
|
|
- <van-swipe-item v-for="(item,index) in noticeList" :key="index">
|
|
|
- {{item.userName }} {{item.awardName}}
|
|
|
- </van-swipe-item>
|
|
|
- </van-swipe>
|
|
|
- </van-notice-bar>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 抽奖点击部分 -->
|
|
|
- <div class="gift-box" v-if="awards.length >= 9">
|
|
|
- <van-grid square :column-num="3" :border="false" gutter="6">
|
|
|
- <van-grid-item v-for="(item,index) in awards" :key="index">
|
|
|
- <div :class="['gift-box_view',item.num == current ?'active':'']">
|
|
|
- <div v-if="index == 4" @click="start()">
|
|
|
- <img class="gift-button" src="../../assets/yuanyu/button1.png" alt="">
|
|
|
- </div>
|
|
|
- <div v-else class="gift-box_view2" >
|
|
|
- <div>
|
|
|
- <img v-if="item.type != 'EMPTY'" :src="item.pic" alt="" class="grid-img">
|
|
|
- <div>{{item.name}}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </van-grid-item>
|
|
|
- </van-grid>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <van-empty v-else description="暂无活动哦~" :image="require('@assets/kong_png_wudingdan.png')" />
|
|
|
- </div>
|
|
|
- <!-- 我的奖品 -->
|
|
|
- <div class="prize-title">我的奖品</div>
|
|
|
- <!-- 奖品列表 -->
|
|
|
-
|
|
|
- <van-list class="list" v-model:loading="loading" :finished="finished" finished-text="" @load="getData">
|
|
|
- <div class="prize-item" v-for="(item,index) in list" :key="index">
|
|
|
- <div class="prize-item_top">
|
|
|
- <van-image
|
|
|
- lazy-load
|
|
|
- width="40"
|
|
|
- height="40"
|
|
|
- :src="item.pic"
|
|
|
- fit="cover"
|
|
|
- class="prize-item_img"
|
|
|
- />
|
|
|
- <div>
|
|
|
- <div class="prize-item_name">{{item.awardName}}</div>
|
|
|
- <div class="prize-item_date">有效期至:<span>{{item.issueTime}}</span></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="prize-item_tips">请在有效期内,尽快领取您的大奖</div>
|
|
|
- <div :class="['prize-item_zt',item.status == 'RECEIVED' ? '' : 'active']">{{item.status == 'RECEIVED' ? '已领取' : '未领取' }}</div>
|
|
|
- </div>
|
|
|
- <van-empty v-if="empty" description="你还没有中奖哦~" :image="require('@assets/kong_png_wudingdan.png')" />
|
|
|
- </van-list>
|
|
|
- </div>
|
|
|
- <!-- 中奖弹框 -->
|
|
|
- <van-overlay :show="show" @click="show = false">
|
|
|
- <div class="code-img" @click.stop ="show = false">
|
|
|
- <div class="code-bg">
|
|
|
- <img class="code-title" src="../../assets/yuanyu/icon-title.png" alt="">
|
|
|
- <img class="code-title2" src="../../assets/yuanyu/icon-title2.png" alt="">
|
|
|
- <img class="code-liping" :src="award.pic" alt="">
|
|
|
- <img class="code-close" src="../../assets/raex/icon_fenxiang_close.png" alt="">
|
|
|
- <!-- <van-image lazy-load class="code" width="70vw" src="../../assets/yuanyu/liping.png" fit="scale-down" /> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </van-overlay>
|
|
|
- </div>
|
|
|
+ <div class="user-info" @click="$router.push('/setting')">
|
|
|
+ <div>
|
|
|
+ <van-image
|
|
|
+ lazy-load
|
|
|
+ round
|
|
|
+ width="40"
|
|
|
+ height="40"
|
|
|
+ :src="userInfo.avatar || require('@assets/img_default_photo.png')"
|
|
|
+ fit="cover"
|
|
|
+ />
|
|
|
+ <span class="van-ellipsis">{{ userInfo.nickname }}</span>
|
|
|
+ </div>
|
|
|
+ <van-icon name="arrow" color="#8f9195" />
|
|
|
+ </div>
|
|
|
+ <!-- 内容 -->
|
|
|
+ <div class="content">
|
|
|
+ <div class="class-box">
|
|
|
+ <div class="class-box_left" @click="$router.push('/welfareintegral')">
|
|
|
+ <div>
|
|
|
+ <span>{{ availableIntegral }}</span
|
|
|
+ >积分
|
|
|
+ </div>
|
|
|
+ <div class="class-box_tips">收支兑换记录</div>
|
|
|
+ <button>点击查看</button>
|
|
|
+ </div>
|
|
|
+ <div class="class-box_right">
|
|
|
+ <div><span>每日签到</span></div>
|
|
|
+ <div class="class-box_tips">做任务赚取积分</div>
|
|
|
+ <button>点击签到</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 抽奖部分 -->
|
|
|
+ <div class="draw-box">
|
|
|
+ <!-- 抽奖头部 -->
|
|
|
+ <div class="draw-box_top">
|
|
|
+ <img src="../../assets/yuanyu/icon-left.png" alt="" />
|
|
|
+ <span>参与抽奖免费赢豪礼</span>
|
|
|
+ <img src="../../assets/yuanyu/icon-right.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div v-if="activityId">
|
|
|
+ <!-- 排名奖品 -->
|
|
|
+ <div class="draw-box_ranking">
|
|
|
+ <template v-for="(item, index) in rankingList" :key="index">
|
|
|
+ <div>
|
|
|
+ <div :class="['ranking-box', 'ranking-box' + index]">
|
|
|
+ <img v-if="item.pic" :src="item.pic" class="ranking-img" />
|
|
|
+ <img v-if="index == 0" src="../../assets/yuanyu/bg-icon1.png" class="ranking-bg" />
|
|
|
+ <img v-if="index == 1" src="../../assets/yuanyu/bg-icon2.png" class="ranking-bg" />
|
|
|
+ <img v-if="index == 2" src="../../assets/yuanyu/bg-icon3.png" class="ranking-bg" />
|
|
|
+ </div>
|
|
|
+ <span>{{ item.name || '' }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <!-- 中奖提示公告 -->
|
|
|
+ <div class="notice-box" v-if="noticeList.length > 0">
|
|
|
+ <van-notice-bar
|
|
|
+ :left-icon="require('../../assets/yuanyu/icon1.png')"
|
|
|
+ :scrollable="false"
|
|
|
+ color="#fff"
|
|
|
+ >
|
|
|
+ <van-swipe vertical class="notice-swipe" :autoplay="3000" :show-indicators="false">
|
|
|
+ <van-swipe-item v-for="(item, index) in noticeList" :key="index">
|
|
|
+ {{ item.userName }} {{ item.awardName }}
|
|
|
+ </van-swipe-item>
|
|
|
+ </van-swipe>
|
|
|
+ </van-notice-bar>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 抽奖点击部分 -->
|
|
|
+ <div class="gift-box" v-if="awards.length >= 9">
|
|
|
+ <van-grid square :column-num="3" :border="false" gutter="6">
|
|
|
+ <van-grid-item v-for="(item, index) in awards" :key="index">
|
|
|
+ <div :class="['gift-box_view', item.num == current ? 'active' : '']">
|
|
|
+ <div v-if="index == 4" @click="start()">
|
|
|
+ <img class="gift-button" src="../../assets/yuanyu/button1.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div v-else class="gift-box_view2">
|
|
|
+ <div>
|
|
|
+ <img v-if="item.type != 'EMPTY'" :src="item.pic" alt="" class="grid-img" />
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-grid-item>
|
|
|
+ </van-grid>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-empty v-else description="暂无活动哦~" :image="require('@assets/kong_png_wudingdan.png')" />
|
|
|
+ </div>
|
|
|
+ <!-- 我的奖品 -->
|
|
|
+ <div class="prize-title">我的奖品</div>
|
|
|
+ <!-- 奖品列表 -->
|
|
|
+
|
|
|
+ <van-list class="list" v-model:loading="loading" :finished="finished" finished-text="" @load="getData">
|
|
|
+ <div class="prize-item" v-for="(item, index) in list" :key="index">
|
|
|
+ <div class="prize-item_top">
|
|
|
+ <van-image
|
|
|
+ lazy-load
|
|
|
+ width="40"
|
|
|
+ height="40"
|
|
|
+ :src="item.pic"
|
|
|
+ fit="cover"
|
|
|
+ class="prize-item_img"
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <div class="prize-item_name">{{ item.awardName }}</div>
|
|
|
+ <div class="prize-item_date">
|
|
|
+ 有效期至:<span>{{ item.issueTime }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="prize-item_tips">请在有效期内,尽快领取您的大奖</div>
|
|
|
+ <div :class="['prize-item_zt', item.status == 'RECEIVED' ? '' : 'active']">
|
|
|
+ {{ item.status == 'RECEIVED' ? '已领取' : '未领取' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-empty
|
|
|
+ v-if="empty"
|
|
|
+ description="你还没有中奖哦~"
|
|
|
+ :image="require('@assets/kong_png_wudingdan.png')"
|
|
|
+ />
|
|
|
+ </van-list>
|
|
|
+ </div>
|
|
|
+ <!-- 中奖弹框 -->
|
|
|
+ <van-overlay :show="show" @click="show = false">
|
|
|
+ <div class="code-img" @click.stop="show = false">
|
|
|
+ <div class="code-bg">
|
|
|
+ <img class="code-title" src="../../assets/yuanyu/icon-title.png" alt="" />
|
|
|
+ <img class="code-title2" src="../../assets/yuanyu/icon-title2.png" alt="" />
|
|
|
+ <img class="code-liping" :src="award.pic" alt="" />
|
|
|
+ <img class="code-close" src="../../assets/raex/icon_fenxiang_close.png" alt="" />
|
|
|
+ <!-- <van-image lazy-load class="code" width="70vw" src="../../assets/yuanyu/liping.png" fit="scale-down" /> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-overlay>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapState } from 'vuex';
|
|
|
import list from '../../mixins/list';
|
|
|
export default {
|
|
|
- mixins: [list],
|
|
|
+ mixins: [list],
|
|
|
data() {
|
|
|
return {
|
|
|
- current: 0, // 当前索引值
|
|
|
- speed: 200, // 时间->速度
|
|
|
- diff: 15, // 基数
|
|
|
- award: {}, // 抽中的奖品
|
|
|
- time: 0, // 当前时间戳
|
|
|
- timer: null, // 定时器
|
|
|
- show:false,
|
|
|
- awards:[],//抽奖列表
|
|
|
- availableIntegral:0,//用户可用积分
|
|
|
- activityId:'',//积分活动id;
|
|
|
- noticeList:[],//中奖公告
|
|
|
- list:[],//我的奖品列表
|
|
|
- rankingList:[],//奖品排名
|
|
|
- click:true,//
|
|
|
- url: '/pointActivity/awards',
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState(['userInfo']),
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.$store.dispatch('getUserInfo');
|
|
|
- this.userIntegralGetInfo();//获取用户积分
|
|
|
- this.pointActivityNow();// 最新积分抽奖活动
|
|
|
- this.pointActivityAwards();//最近中奖名单
|
|
|
+ current: 0, // 当前索引值
|
|
|
+ speed: 200, // 时间->速度
|
|
|
+ diff: 15, // 基数
|
|
|
+ award: {}, // 抽中的奖品
|
|
|
+ time: 0, // 当前时间戳
|
|
|
+ timer: null, // 定时器
|
|
|
+ show: false,
|
|
|
+ awards: [], //抽奖列表
|
|
|
+ availableIntegral: 0, //用户可用积分
|
|
|
+ activityId: '', //积分活动id;
|
|
|
+ noticeList: [], //中奖公告
|
|
|
+ list: [], //我的奖品列表
|
|
|
+ rankingList: [], //奖品排名
|
|
|
+ click: true, //
|
|
|
+ url: '/pointActivity/awards'
|
|
|
+ };
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 我的奖品自定义额外请求参数
|
|
|
- beforeData() {
|
|
|
- return {
|
|
|
- query: {}
|
|
|
- };
|
|
|
- },
|
|
|
- // 获取用户积分
|
|
|
- userIntegralGetInfo(){
|
|
|
- this.$http.post('/userIntegral/getInfo').then(res => {
|
|
|
- this.availableIntegral = res.totalIntegral;//总积分
|
|
|
- }).catch(e=>{
|
|
|
- this.$toast(e.error);
|
|
|
- })
|
|
|
- },
|
|
|
- // 最新积分抽奖活动
|
|
|
- pointActivityNow(){
|
|
|
- this.$http.post('/pointActivity/now').then(res => {
|
|
|
- this.activityId = res.id;
|
|
|
- // 打乱顺序
|
|
|
- res.awards.sort(function () {
|
|
|
- return Math.random() > 0.5 ? -1 : 1
|
|
|
- })
|
|
|
- this.awards = res.awards;
|
|
|
- // 定义抽奖按钮
|
|
|
- this.awards.splice(4, 0, {
|
|
|
- id:0,
|
|
|
- name:'开始抽奖',
|
|
|
- image:'../../assets/yuanyu/button1.png',
|
|
|
- num:9,
|
|
|
- orderNum:9999
|
|
|
- })
|
|
|
- this.awards.forEach((item,i)=>{
|
|
|
- // 定义转圈展示顺序
|
|
|
- switch(i+1){
|
|
|
- case 1:
|
|
|
- case 2:
|
|
|
- case 3:
|
|
|
- case 7:
|
|
|
- item.num = i+1;
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- item.num = 8;
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- item.num = 4;
|
|
|
- break;
|
|
|
- case 8:
|
|
|
- item.num = 6;
|
|
|
- break;
|
|
|
- case 9:
|
|
|
- item.num = 5;
|
|
|
- break;
|
|
|
- }
|
|
|
- });
|
|
|
- // 更改排序,小到大
|
|
|
- let arr = [...this.awards];
|
|
|
- arr.sort((a,b)=>{
|
|
|
- return a.orderNum - b.orderNum
|
|
|
- }).forEach((item,i)=>{// 获取前三个奖品,并赋值排名展示
|
|
|
- if(item.type != 'EMPTY'){
|
|
|
- if(!this.rankingList[1]){
|
|
|
- this.rankingList[1] = item;
|
|
|
- }else if(!this.rankingList[0]){
|
|
|
- this.rankingList[0] = item;
|
|
|
- }else if(!this.rankingList[2]){
|
|
|
- this.rankingList[2] = item;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- // 超出九个数过滤掉
|
|
|
- if(this.awards.length > 9){
|
|
|
- this.awards.splice(9, this.awards.length - 9);
|
|
|
- }
|
|
|
- }).catch(e=>{
|
|
|
- this.$toast(e.error);
|
|
|
- })
|
|
|
- },
|
|
|
- //最近中奖名单
|
|
|
- pointActivityAwards(){
|
|
|
- this.$http.post('/pointActivity/nowActivityAwards', {}, { body: 'json' }).then(res => {
|
|
|
- this.noticeList = res;
|
|
|
- }).catch(e=>{
|
|
|
- this.$toast(e.error);
|
|
|
- })
|
|
|
- },
|
|
|
- // 开始抽奖
|
|
|
- start() {
|
|
|
- if(this.click){
|
|
|
- this.time = Date.now();
|
|
|
- this.speed = 200;
|
|
|
- this.diff = 12;
|
|
|
- this.click = false;//锁定点击事件
|
|
|
- this.current = 0;//每次点击从第一个开始转
|
|
|
- // 请求接口,获取中奖物品,并开始转圈
|
|
|
- this.$http.post('/pointActivity/draw',
|
|
|
- { id: this.activityId },
|
|
|
- { body: 'json' }).then(res => {
|
|
|
- this.award = res;//奖品
|
|
|
- this.move();
|
|
|
- this.userIntegralGetInfo();//更新用户积分
|
|
|
- }).catch(e=>{//请求失败了
|
|
|
- this.click = true;//解锁点击事件
|
|
|
- this.$toast(e.error);
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- // 开始转动
|
|
|
- move() {
|
|
|
- this.timer = setTimeout(() => {
|
|
|
- // 转圈变化
|
|
|
- this.current++;
|
|
|
- if (this.current > 8) {
|
|
|
- this.current = 1;
|
|
|
- }
|
|
|
- // 若抽中的奖品id存在,则开始减速转动
|
|
|
- if (this.award.id && (Date.now() - this.time) / 1000 > 2) {
|
|
|
- this.speed += this.diff; // 转动减速
|
|
|
-
|
|
|
- // 找到当前转圈标记所在的下标
|
|
|
- let index = this.awards.findIndex((item)=>{
|
|
|
- return this.current == item.num;
|
|
|
- })
|
|
|
- // 若转动时间超过4秒,并且奖品id等于小格子的奖品id,则停下来
|
|
|
- if ((Date.now() - this.time) / 1000 > 4 && this.award.id == this.awards[index].id) {
|
|
|
- clearTimeout(this.timer);
|
|
|
- this.click = true;//解锁点击事件
|
|
|
- setTimeout(() => {
|
|
|
- if(this.award.type == "EMPTY"){//抽中谢谢参与时
|
|
|
- this.$toast('很遗憾,没有抽中哦~')
|
|
|
- }else{
|
|
|
- // console.log(`恭喜中奖${this.award.name}`);
|
|
|
- this.pointActivityAwards();//重新刷新公告
|
|
|
- this.getData(true);//刷新我的奖品列表
|
|
|
- this.show = true;//显示中奖弹框
|
|
|
- }
|
|
|
- },20);
|
|
|
- return;
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 若抽中的奖品不存在,则加速转动
|
|
|
- this.speed -= this.diff;
|
|
|
- }
|
|
|
- this.move();
|
|
|
- }, this.speed);
|
|
|
- },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['userInfo'])
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.$store.dispatch('getUserInfo');
|
|
|
+ this.userIntegralGetInfo(); //获取用户积分
|
|
|
+ this.pointActivityNow(); // 最新积分抽奖活动
|
|
|
+ this.pointActivityAwards(); //最近中奖名单
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 我的奖品自定义额外请求参数
|
|
|
+ beforeData() {
|
|
|
+ return {
|
|
|
+ query: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // 获取用户积分
|
|
|
+ userIntegralGetInfo() {
|
|
|
+ this.$http
|
|
|
+ .post('/userIntegral/getInfo')
|
|
|
+ .then(res => {
|
|
|
+ this.availableIntegral = res.totalIntegral; //总积分
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 最新积分抽奖活动
|
|
|
+ pointActivityNow() {
|
|
|
+ this.$http
|
|
|
+ .post('/pointActivity/now')
|
|
|
+ .then(res => {
|
|
|
+ this.activityId = res.id;
|
|
|
+ // 打乱顺序
|
|
|
+ res.awards.sort(function () {
|
|
|
+ return Math.random() > 0.5 ? -1 : 1;
|
|
|
+ });
|
|
|
+ this.awards = res.awards;
|
|
|
+ // 定义抽奖按钮
|
|
|
+ this.awards.splice(4, 0, {
|
|
|
+ id: 0,
|
|
|
+ name: '开始抽奖',
|
|
|
+ image: '../../assets/yuanyu/button1.png',
|
|
|
+ num: 9,
|
|
|
+ orderNum: 9999
|
|
|
+ });
|
|
|
+ this.awards.forEach((item, i) => {
|
|
|
+ // 定义转圈展示顺序
|
|
|
+ switch (i + 1) {
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ case 3:
|
|
|
+ case 7:
|
|
|
+ item.num = i + 1;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ item.num = 8;
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ item.num = 4;
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ item.num = 6;
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ item.num = 5;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 更改排序,小到大
|
|
|
+ let arr = [...this.awards];
|
|
|
+ arr.sort((a, b) => {
|
|
|
+ return a.orderNum - b.orderNum;
|
|
|
+ }).forEach((item, i) => {
|
|
|
+ // 获取前三个奖品,并赋值排名展示
|
|
|
+ if (item.type != 'EMPTY') {
|
|
|
+ if (!this.rankingList[1]) {
|
|
|
+ this.rankingList[1] = item;
|
|
|
+ } else if (!this.rankingList[0]) {
|
|
|
+ this.rankingList[0] = item;
|
|
|
+ } else if (!this.rankingList[2]) {
|
|
|
+ this.rankingList[2] = item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 超出九个数过滤掉
|
|
|
+ if (this.awards.length > 9) {
|
|
|
+ this.awards.splice(9, this.awards.length - 9);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //最近中奖名单
|
|
|
+ pointActivityAwards() {
|
|
|
+ this.$http
|
|
|
+ .post('/pointActivity/nowActivityAwards', {}, { body: 'json' })
|
|
|
+ .then(res => {
|
|
|
+ this.noticeList = res;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 开始抽奖
|
|
|
+ start() {
|
|
|
+ if (this.click) {
|
|
|
+ this.time = Date.now();
|
|
|
+ this.speed = 200;
|
|
|
+ this.diff = 12;
|
|
|
+ this.click = false; //锁定点击事件
|
|
|
+ this.current = 0; //每次点击从第一个开始转
|
|
|
+ // 请求接口,获取中奖物品,并开始转圈
|
|
|
+ this.$http
|
|
|
+ .post('/pointActivity/draw', { id: this.activityId }, { body: 'json' })
|
|
|
+ .then(res => {
|
|
|
+ this.award = res; //奖品
|
|
|
+ this.move();
|
|
|
+ this.userIntegralGetInfo(); //更新用户积分
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ //请求失败了
|
|
|
+ this.click = true; //解锁点击事件
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 开始转动
|
|
|
+ move() {
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ // 转圈变化
|
|
|
+ this.current++;
|
|
|
+ if (this.current > 8) {
|
|
|
+ this.current = 1;
|
|
|
+ }
|
|
|
+ // 若抽中的奖品id存在,则开始减速转动
|
|
|
+ if (this.award.id && (Date.now() - this.time) / 1000 > 2) {
|
|
|
+ this.speed += this.diff; // 转动减速
|
|
|
+
|
|
|
+ // 找到当前转圈标记所在的下标
|
|
|
+ let index = this.awards.findIndex(item => {
|
|
|
+ return this.current == item.num;
|
|
|
+ });
|
|
|
+ // 若转动时间超过4秒,并且奖品id等于小格子的奖品id,则停下来
|
|
|
+ if ((Date.now() - this.time) / 1000 > 4 && this.award.id == this.awards[index].id) {
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ this.click = true; //解锁点击事件
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.award.type == 'EMPTY') {
|
|
|
+ //抽中谢谢参与时
|
|
|
+ this.$toast('很遗憾,没有抽中哦~');
|
|
|
+ } else {
|
|
|
+ // console.log(`恭喜中奖${this.award.name}`);
|
|
|
+ this.pointActivityAwards(); //重新刷新公告
|
|
|
+ this.getData(true); //刷新我的奖品列表
|
|
|
+ this.show = true; //显示中奖弹框
|
|
|
+ }
|
|
|
+ }, 20);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 若抽中的奖品不存在,则加速转动
|
|
|
+ this.speed -= this.diff;
|
|
|
+ }
|
|
|
+ this.move();
|
|
|
+ }, this.speed);
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- // 用户信息
|
|
|
- .user-info{
|
|
|
- .flex();
|
|
|
- justify-content: space-between;
|
|
|
- padding: 15px;
|
|
|
- border-bottom: 2px solid @text1;
|
|
|
- >div{
|
|
|
- .flex();
|
|
|
- justify-content: space-between;
|
|
|
- color: #fff;
|
|
|
- span{
|
|
|
- margin-left: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 内容区
|
|
|
- .content{
|
|
|
- padding: 15px;
|
|
|
- color: #fff;
|
|
|
- // 积分/签到分类
|
|
|
- .class-box{
|
|
|
- .flex();
|
|
|
- justify-content: space-between;
|
|
|
- &_left{
|
|
|
- background: url('../../assets/yuanyu/bg-jifen.png')no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- button{
|
|
|
- background-color: @bg4;
|
|
|
- }
|
|
|
- }
|
|
|
- &_right{
|
|
|
- background: url('../../assets/yuanyu/bg-qiandao.png')no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- button{
|
|
|
- background-color: @bg5;
|
|
|
- }
|
|
|
- }
|
|
|
- &_tips{
|
|
|
- line-height: 2;
|
|
|
- }
|
|
|
- >div{
|
|
|
- width: calc(50vw - 20px);
|
|
|
- height: 85px;
|
|
|
- color: #fff;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: center;
|
|
|
- align-items: flex-start;
|
|
|
- padding-left: 10px;
|
|
|
- box-sizing: border-box;
|
|
|
- font-size: 12px;
|
|
|
- button{
|
|
|
- color: #fff;
|
|
|
- font-size: 12px;
|
|
|
- border: none;
|
|
|
- border-radius: 10px;
|
|
|
- }
|
|
|
- span{
|
|
|
- font-size: 15px;
|
|
|
- margin-right: 1px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 抽奖部分
|
|
|
- .draw-box{
|
|
|
- border:1px solid #4b5783;
|
|
|
- border-radius: 10px;
|
|
|
- padding:20px 15px;
|
|
|
- margin-top: 15px;
|
|
|
- text-align: center;
|
|
|
- &_top{
|
|
|
- .flex();
|
|
|
- justify-content: space-around;
|
|
|
- color: @text0;
|
|
|
- }
|
|
|
- // 奖品排名区
|
|
|
- &_ranking{
|
|
|
- display: flex;
|
|
|
- justify-content: space-around;
|
|
|
- align-items: flex-end;
|
|
|
- >div{
|
|
|
- width: 33.33%;
|
|
|
- }
|
|
|
- .ranking-box{
|
|
|
- position: relative;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: flex-end;
|
|
|
- margin: 0 auto 10px;
|
|
|
- }
|
|
|
- .ranking-box0{
|
|
|
- width: 62px;
|
|
|
- height: 90px;
|
|
|
- .ranking-img{
|
|
|
- width: 61px;
|
|
|
- height: 61px;
|
|
|
- border-radius: 50%;
|
|
|
- margin-bottom: 1px;
|
|
|
- }
|
|
|
- }
|
|
|
- .ranking-bg{
|
|
|
- position: absolute;
|
|
|
- bottom:0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- }
|
|
|
- .ranking-box1{
|
|
|
- width: 103px;
|
|
|
- height: 141px;
|
|
|
- .ranking-img{
|
|
|
- width: 102px;
|
|
|
- height: 102px;
|
|
|
- border-radius: 50%;
|
|
|
- margin-bottom: 1px;
|
|
|
- }
|
|
|
- }
|
|
|
- .ranking-box2{
|
|
|
- width: 62px;
|
|
|
- height: 90px;
|
|
|
- .ranking-img{
|
|
|
- width: 61px;
|
|
|
- height: 61px;
|
|
|
- border-radius: 50%;
|
|
|
- margin-bottom: 1px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- // 公告区
|
|
|
- .notice-box{
|
|
|
- height: 40px;
|
|
|
- border-radius: 6px;
|
|
|
- overflow: hidden;
|
|
|
- margin: 15px 0 0;
|
|
|
- .notice-swipe {
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- }
|
|
|
- }
|
|
|
- // 抽奖区
|
|
|
- .gift-box{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- background: url('../../assets/yuanyu/bg-game.png');
|
|
|
- background-size: 100% 100%;
|
|
|
- padding:25px 20px 20px;
|
|
|
- box-sizing: border-box;
|
|
|
- color:@text5;
|
|
|
- font-size:12px;
|
|
|
- margin: 15px 0 0;
|
|
|
- .gift-button{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- border-radius: 6px;
|
|
|
- }
|
|
|
- &_view{
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- background-color: rgba(255,255,255,.6);
|
|
|
- border-radius: 6px;
|
|
|
- overflow: hidden;
|
|
|
- &.active{
|
|
|
- background-color: @bg6;
|
|
|
- .gift-box_view2{
|
|
|
- background-color: #fff63e;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- &_view2{
|
|
|
- .flex();
|
|
|
- width: 96%;
|
|
|
- height: 92%;
|
|
|
- background-color: @text0;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- justify-content: center;
|
|
|
- flex-direction: column;
|
|
|
- text-align: center;
|
|
|
- padding-right: 2%;
|
|
|
- padding-top: 2.8%;
|
|
|
- box-sizing: border-box;
|
|
|
- .grid-img{
|
|
|
- width: 44px;
|
|
|
- height: 44px;
|
|
|
- border-radius: 4px;
|
|
|
- margin-bottom: 1px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 我的奖品区
|
|
|
- .prize-title{
|
|
|
- color: @text0;
|
|
|
- .flex();
|
|
|
- justify-content: center;
|
|
|
- margin: 20px 0;
|
|
|
- &::after{
|
|
|
- content: '';
|
|
|
- width: 50px;
|
|
|
- height: 1px;
|
|
|
- background:linear-gradient(to left, rgba(255,255,255,0), @text0);
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
- &::before{
|
|
|
- content: '';
|
|
|
- width: 50px;
|
|
|
- height: 1px;
|
|
|
- background:linear-gradient(to right, rgba(255,255,255,0), @text0);
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- }
|
|
|
- .prize-item{
|
|
|
- border-radius: 6px;
|
|
|
- border: 1px solid @text2;
|
|
|
- position: relative;
|
|
|
- margin-bottom: 11px;
|
|
|
- background-color: @bg2;
|
|
|
- &_img{
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- border-radius: 4px;
|
|
|
- margin-right: 6px;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- &_top{
|
|
|
- padding: 12px;
|
|
|
- .flex();
|
|
|
- position: relative;
|
|
|
- border-bottom: 1px @border dashed;
|
|
|
- &::after{
|
|
|
- content: '';
|
|
|
- width: 10px;
|
|
|
- height: 10px;
|
|
|
- background-color: @bg;
|
|
|
- position: absolute;
|
|
|
- bottom: -5px;
|
|
|
- right:-5px;
|
|
|
- }
|
|
|
- &::before{
|
|
|
- content: '';
|
|
|
- width: 10px;
|
|
|
- height: 10px;
|
|
|
- background-color: @bg;
|
|
|
- position: absolute;
|
|
|
- bottom: -5px;
|
|
|
- left:-5px;
|
|
|
- }
|
|
|
- }
|
|
|
- &_name{
|
|
|
- font-size: 16px;
|
|
|
- color:@text0
|
|
|
- }
|
|
|
- &_date{
|
|
|
- font-size: 12px;
|
|
|
- color:rgba(255,255,255,.3);
|
|
|
- margin-top: 2px;
|
|
|
- span{
|
|
|
- color:@text0
|
|
|
- }
|
|
|
- }
|
|
|
- &_tips{
|
|
|
- padding: 10px 12px;
|
|
|
- font-size: 12px;
|
|
|
- color:rgba(255,255,255,.3);
|
|
|
- }
|
|
|
- &_zt{
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- border-radius:0 6px 0 6px;
|
|
|
- background-color: @border;
|
|
|
- padding:2px 4px;
|
|
|
- font-size: 12px;
|
|
|
- &.active{
|
|
|
- background-color: @text5;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- // 中奖弹框区
|
|
|
- .code-img {
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- width: 375px;
|
|
|
- height: 490px;
|
|
|
- background: url('../../assets/yuanyu/bg-zhj.png')no-repeat;
|
|
|
- background-size: 100% auto;
|
|
|
- .code-bg{
|
|
|
- width: 298px;
|
|
|
- height: 298px;
|
|
|
- background: url('../../assets/yuanyu/bg-zhj2.png')no-repeat 100% 100%;
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- z-index: 9;
|
|
|
- }
|
|
|
- .code-title{
|
|
|
- position: absolute;
|
|
|
- top: -6px;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- z-index: 10;
|
|
|
- }
|
|
|
- .code-title2{
|
|
|
- position: absolute;
|
|
|
- top: -6px;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- }
|
|
|
- .code-liping{
|
|
|
- width: 284px;
|
|
|
- height: 284px;
|
|
|
- background-color: @bg3;
|
|
|
- border-radius: 24px;
|
|
|
- position: absolute;
|
|
|
- top: 50%;
|
|
|
- left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
- }
|
|
|
- .code-close{
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- bottom: -60px;
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- }
|
|
|
- }
|
|
|
- // 公告样式调整
|
|
|
- /deep/ .van-notice-bar{
|
|
|
- background: linear-gradient(to right,@text6,@text7);
|
|
|
- .van-icon__image{
|
|
|
- width: 22px;
|
|
|
- height: 22px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-</style>
|
|
|
+// 用户信息
|
|
|
+.user-info {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 15px;
|
|
|
+ border-bottom: 2px solid @text1;
|
|
|
+ > div {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ color: #fff;
|
|
|
+ span {
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+// 内容区
|
|
|
+.content {
|
|
|
+ padding: 15px;
|
|
|
+ color: #fff;
|
|
|
+ // 积分/签到分类
|
|
|
+ .class-box {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ &_left {
|
|
|
+ background: url('../../assets/yuanyu/bg-jifen.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ button {
|
|
|
+ background-color: @bg4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &_right {
|
|
|
+ background: url('../../assets/yuanyu/bg-qiandao.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ button {
|
|
|
+ background-color: @bg5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &_tips {
|
|
|
+ line-height: 2;
|
|
|
+ }
|
|
|
+ > div {
|
|
|
+ width: calc(50vw - 20px);
|
|
|
+ height: 85px;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: flex-start;
|
|
|
+ padding-left: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-size: 12px;
|
|
|
+ button {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ border: none;
|
|
|
+ border-radius: 10px;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ font-size: 15px;
|
|
|
+ margin-right: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 抽奖部分
|
|
|
+ .draw-box {
|
|
|
+ border: 1px solid #4b5783;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 20px 15px;
|
|
|
+ margin-top: 15px;
|
|
|
+ text-align: center;
|
|
|
+ &_top {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-around;
|
|
|
+ color: @text0;
|
|
|
+ }
|
|
|
+ // 奖品排名区
|
|
|
+ &_ranking {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: flex-end;
|
|
|
+ > div {
|
|
|
+ width: 33.33%;
|
|
|
+ }
|
|
|
+ .ranking-box {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: flex-end;
|
|
|
+ margin: 0 auto 10px;
|
|
|
+ }
|
|
|
+ .ranking-box0 {
|
|
|
+ width: 62px;
|
|
|
+ height: 90px;
|
|
|
+ .ranking-img {
|
|
|
+ width: 61px;
|
|
|
+ height: 61px;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-bottom: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .ranking-bg {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+ .ranking-box1 {
|
|
|
+ width: 103px;
|
|
|
+ height: 141px;
|
|
|
+ .ranking-img {
|
|
|
+ width: 102px;
|
|
|
+ height: 102px;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-bottom: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .ranking-box2 {
|
|
|
+ width: 62px;
|
|
|
+ height: 90px;
|
|
|
+ .ranking-img {
|
|
|
+ width: 61px;
|
|
|
+ height: 61px;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-bottom: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 公告区
|
|
|
+ .notice-box {
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 6px;
|
|
|
+ overflow: hidden;
|
|
|
+ margin: 15px 0 0;
|
|
|
+ .notice-swipe {
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 抽奖区
|
|
|
+ .gift-box {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: url('../../assets/yuanyu/bg-game.png');
|
|
|
+ background-size: 100% 100%;
|
|
|
+ padding: 25px 20px 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ color: @text5;
|
|
|
+ font-size: 12px;
|
|
|
+ margin: 15px 0 0;
|
|
|
+ .gift-button {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 6px;
|
|
|
+ }
|
|
|
+ &_view {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ background-color: rgba(255, 255, 255, 0.6);
|
|
|
+ border-radius: 6px;
|
|
|
+ overflow: hidden;
|
|
|
+ &.active {
|
|
|
+ background-color: @bg6;
|
|
|
+ .gift-box_view2 {
|
|
|
+ background-color: #fff63e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &_view2 {
|
|
|
+ .flex();
|
|
|
+ width: 96%;
|
|
|
+ height: 92%;
|
|
|
+ background-color: @text0;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+ text-align: center;
|
|
|
+ padding-right: 2%;
|
|
|
+ padding-top: 2.8%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .grid-img {
|
|
|
+ width: 44px;
|
|
|
+ height: 44px;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-bottom: 1px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 我的奖品区
|
|
|
+ .prize-title {
|
|
|
+ color: @text0;
|
|
|
+ .flex();
|
|
|
+ justify-content: center;
|
|
|
+ margin: 20px 0;
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ width: 50px;
|
|
|
+ height: 1px;
|
|
|
+ background: linear-gradient(to left, rgba(255, 255, 255, 0), @text0);
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ width: 50px;
|
|
|
+ height: 1px;
|
|
|
+ background: linear-gradient(to right, rgba(255, 255, 255, 0), @text0);
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .prize-item {
|
|
|
+ border-radius: 6px;
|
|
|
+ border: 1px solid @text2;
|
|
|
+ position: relative;
|
|
|
+ margin-bottom: 11px;
|
|
|
+ background-color: @bg2;
|
|
|
+ &_img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-right: 6px;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ &_top {
|
|
|
+ padding: 12px;
|
|
|
+ .flex();
|
|
|
+ position: relative;
|
|
|
+ border-bottom: 1px @border dashed;
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ background-color: @bg;
|
|
|
+ position: absolute;
|
|
|
+ bottom: -5px;
|
|
|
+ right: -5px;
|
|
|
+ }
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ background-color: @bg;
|
|
|
+ position: absolute;
|
|
|
+ bottom: -5px;
|
|
|
+ left: -5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &_name {
|
|
|
+ font-size: 16px;
|
|
|
+ color: @text0;
|
|
|
+ }
|
|
|
+ &_date {
|
|
|
+ font-size: 12px;
|
|
|
+ color: rgba(255, 255, 255, 0.3);
|
|
|
+ margin-top: 2px;
|
|
|
+ span {
|
|
|
+ color: @text0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &_tips {
|
|
|
+ padding: 10px 12px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: rgba(255, 255, 255, 0.3);
|
|
|
+ }
|
|
|
+ &_zt {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ border-radius: 0 6px 0 6px;
|
|
|
+ background-color: @border;
|
|
|
+ padding: 2px 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ &.active {
|
|
|
+ background-color: @text5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+// 中奖弹框区
|
|
|
+.code-img {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ width: 375px;
|
|
|
+ height: 490px;
|
|
|
+ background: url('../../assets/yuanyu/bg-zhj.png') no-repeat;
|
|
|
+ background-size: 100% auto;
|
|
|
+ .code-bg {
|
|
|
+ width: 298px;
|
|
|
+ height: 298px;
|
|
|
+ background: url('../../assets/yuanyu/bg-zhj2.png') no-repeat 100% 100%;
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ top: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ z-index: 9;
|
|
|
+ }
|
|
|
+ .code-title {
|
|
|
+ position: absolute;
|
|
|
+ top: -6px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ z-index: 10;
|
|
|
+ }
|
|
|
+ .code-title2 {
|
|
|
+ position: absolute;
|
|
|
+ top: -6px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+ .code-liping {
|
|
|
+ width: 284px;
|
|
|
+ height: 284px;
|
|
|
+ background-color: @bg3;
|
|
|
+ border-radius: 24px;
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ }
|
|
|
+ .code-close {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ bottom: -60px;
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+}
|
|
|
+// 公告样式调整
|
|
|
+/deep/ .van-notice-bar {
|
|
|
+ background: linear-gradient(to right, @text6, @text7);
|
|
|
+ .van-icon__image {
|
|
|
+ width: 22px;
|
|
|
+ height: 22px;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|