Commit 8bfe9e60 by 赖慧粮

合并分支 'dev' 到 'master'

Publisher 自动合并请求 [HjcKzHJTOsI8kSKRDfaQY]

## fix(api): 网关地址修复


------

## Merge branch 'private/cbnclouds' into test


------

## Merge branch 'test' of gitlab.aodianyun.com:activities/web-lottery into test


------

## feat(sentry): 增加sentry,记录开奖接口日志


------

## chore(release): 1.2.1


------

## auto deploy


------

## 合并分支 'test' 到 'dev'

Publisher 自动合并请求 [H_yixw8lchnJUkOM_QFnY]

## fix(api): 网关地址修复


------

## Merge branch 'private/cbnclouds' into test


------

## Merge branch 'test' of gitlab.aodianyun.com:activities/web-lottery into test


------

## feat(sentry): 增加sentry,记录开奖接口日志


------



查看合并请求 !24

------



查看合并请求 !25
parents aa7db185 c4014d48
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [1.2.1](https://gitlab.aodianyun.com/activities/web-lottery/compare/v1.1.1...v1.2.1) (2022-03-14)
### Features
* **sentry:** 增加sentry,记录开奖接口日志 ([afbd994](https://gitlab.aodianyun.com/activities/web-lottery/commit/afbd994f9694a1c26598cfe9045460d96ed378c6))
### Bug Fixes
* **api:** 网关地址修复 ([04c3955](https://gitlab.aodianyun.com/activities/web-lottery/commit/04c39556c7e66e0d341ba04ee1679fa7c03c9fc7))
### [1.1.1](https://gitlab.aodianyun.com/activities/web-lottery/compare/v1.1.0...v1.1.1) (2022-01-13) ### [1.1.1](https://gitlab.aodianyun.com/activities/web-lottery/compare/v1.1.0...v1.1.1) (2022-01-13)
......
<template>
<section class="grid-table">
<div class="grid-table__lantern">
<span v-for="item in 26" :key="item"></span>
</div>
<div class="grid-table__prize">
<div
v-for="(item, index) in giftList"
:key="index"
class="grid-table__prize__item"
:class="{ active: activeItem === index }"
>
<div v-if="index !== 4" class="item-box">
<template v-if="parseInt(item.id, 10) !== 0">
<img :src="img" alt />
<p>{{ item.name }}</p>
</template>
<p v-else>谢谢参与</p>
</div>
<div v-else class="item-btn" @click="lottery">
<span>立即抽奖</span>
</div>
</div>
</div>
</section>
</template>
<script>
import { mapGetters } from 'vuex'
import { shuffle } from '@/utils/common'
import img from '@/assets/images/lottery/prize.png'
export default {
name: 'GridTable',
props: {
loading: {
default: false,
type: Boolean
},
winId: {
default: 0,
type: Number
}
},
data() {
return {
img,
activeItem: 5,
giftList: [],
transitionList: [0, 1, 2, 5, 8, 7, 6, 3],
timer: null,
roundOne: 3,
winItem: null
}
},
computed: {
...mapGetters({ lotteryInfo: 'lottery/lotteryInfo' }),
state() {
return this.lotteryInfo.status
},
config() {
const list =
typeof this.lotteryInfo.prizeConfigs === 'object'
? Object.values(this.lotteryInfo.prizeConfigs)
: this.lotteryInfo.prizeConfigs
return list
},
times() {
return this.lotteryInfo.userTimes
}
},
watch: {
config(nval, oval) {
if (JSON.stringify(nval) !== JSON.stringify(oval)) {
this.computList(nval)
}
},
loading(nVal) {
if (nVal) {
this.runGrid(60)
}
},
winId(val) {
let index
this.giftList.forEach((v, i) => {
if (v.id === val) {
index = i
}
})
this.winItem = index
}
},
mounted() {
this.computList(this.config)
this.dataInit()
},
methods: {
// 数据初始化
dataInit() {
this.giftList.forEach((v, i) => {
if (v.id === this.winId) {
this.winItem = i
}
})
},
// 点击触发
lottery() {
this.$emit('start')
},
// 动画运行
runGrid(speed) {
this.timer && clearInterval(this.timer)
let roundOne = 0
let sPosition = this.transitionList.indexOf(this.activeItem)
this.timer = setInterval(() => {
sPosition++
roundOne++
if (sPosition > 7) {
sPosition = 0
}
this.activeItem = this.transitionList[sPosition]
if (roundOne === this.roundOne * this.transitionList.length) {
this.runGrid(speed * 2)
}
// if (speed > 220 && this.activeItem == this.winItem && roundOne>(this.roundOne * this.transitionList.length)/2) {
if (speed > 220 && parseInt(this.activeItem, 10) === parseInt(this.winItem, 10)) {
clearInterval(this.timer)
this.$emit('end')
}
}, speed)
},
// 计算奖项的数组
computList(config) {
const levelList = []
config.forEach(item => {
levelList.push({ id: item.id, levelAlias: item.prizeAlias || '', name: item.name })
})
for (let i = 9 - levelList.length; i > 0; i--) {
levelList.push({ id: 0 })
}
this.shuffleLevelList(levelList)
},
// 把奖项从第五个格子筛选出来
shuffleLevelList(arr) {
// 洗牌
const result = shuffle(arr)
if (result[4].id !== 0) {
this.shuffleLevelList(arr)
return
} else {
result.splice(4, 1, { id: -1 })
}
this.giftList = result
}
}
}
</script>
<style lang="less">
@lantenStyle: {
background-color: #f9f4f4;
box-shadow: 0 0 3px 0 #f9f4f4;
};
@lantenActiveStyle: {
background-color: #fe3426;
box-shadow: 0 0 3px 0 #fe3426;
};
// @start 开始位置
// @end 结束位置
// @add 增量变量
.lanpositon(left, @top:0, @left:0, @start:0, @end: 0, @add: 0 ) when (@start =< @end) {
&:nth-child(@{start}) {
left: @left;
top: @add + @top;
}
.lanpositon(left, @top, @left, (@start + 1), @end, @add + @top);
}
.lanpositon(top, @top:0, @left:0, @start:0, @end: 0, @add: 0 ) when (@start =< @end) {
&:nth-child(@{start}) {
top: @top;
left: @add + @left;
}
.lanpositon(top, @top, @left, (@start + 1), @end, @add + @left);
}
@keyframes flicker {
0%,
50% {
@lantenStyle();
}
51%,
100% {
@lantenActiveStyle();
}
}
@keyframes flickerTwo {
0%,
50% {
@lantenActiveStyle();
}
51%,
100% {
@lantenStyle();
}
}
.grid-table {
width: 346px;
height: 292px;
margin: 0 auto;
background-image: url('~@/assets/images/lottery/table_bg.png');
background-size: cover;
background-repeat: no-repeat;
padding: 18px;
position: relative;
background: #ffd904;
border-radius: 14px;
&__prize {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
background-color: #f49805;
border-radius: 14px;
padding: 2px;
&__item {
width: 33.33333%;
height: 33.33333%;
padding: 2px;
color: #ff464c;
display: flex;
text-align: center;
&.active {
.item-box {
background-color: #fc5147;
color: #fdf3ab;
}
}
&:nth-child(-n + 3) {
margin-top: 0;
}
.item-btn {
width: 100%;
height: 100%;
overflow: hidden;
border-radius: 13px;
position: relative;
background: repeating-linear-gradient(-45deg, #fc5147, #fc5147 6px, #fd736a 6px, #fd736a 12px);
display: flex;
justify-content: center;
align-items: center;
> span {
font-size: 18px;
font-weight: 600;
color: #fdf3ab;
}
}
.item-box {
background-color: #fdf3ab;
border-radius: 13px;
display: flex;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
text-align: center;
flex-wrap: wrap;
img {
display: block;
width: 50px;
height: 50px;
}
p {
width: 100%;
padding: 0 10px 0 15px;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 16px;
font-weight: 600;
}
}
}
}
&__lantern {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
span {
position: absolute;
top: 0;
left: 0;
display: block;
width: 9px;
height: 9px;
border-radius: 50%;
background-color: #f9f4f4;
box-shadow: 0 0 3px 0 #f9f4f4;
&:first-child {
top: 12.5px;
left: 8px;
}
&:nth-child(8) {
top: 12.5px;
left: 330px;
}
&:nth-child(14) {
top: 274px;
left: 330px;
}
&:nth-child(21) {
top: 274px;
left: 8px;
}
.lanpositon(top, 6px, 46px, 2, 7, 8px);
.lanpositon(left, 44px, 332px, 9, 13, 11.4px);
.lanpositon(top, 279px, -46px, 15, 20, 330px);
.lanpositon(left, -44px, 6px, 22, 26, 275px);
&:nth-child(2n) {
@lantenStyle();
animation: flicker 1s infinite linear;
}
&:nth-child(2n + 1) {
@lantenActiveStyle();
animation: flickerTwo 1s infinite linear;
}
}
}
}
</style>
...@@ -114,8 +114,8 @@ ...@@ -114,8 +114,8 @@
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__wheel" :class="{ 'lottery-instant__wheel--no-lightning': !isLottering }"> <div class="lottery-instant__wheel" :class="{ 'lottery-instant__wheel--no-lightning': !isLottering }">
<PrizeWheel <PrizeWheel
ref="prizeWhell" ref="prizeWheel"
:list="formatedPrizeList" :list="formattedPrizeList"
:light-num="16" :light-num="16"
:container-border="24" :container-border="24"
@onEnd="runEnd" @onEnd="runEnd"
...@@ -222,13 +222,14 @@ export default { ...@@ -222,13 +222,14 @@ export default {
...mapGetters({ ...mapGetters({
uin: 'users/uin', uin: 'users/uin',
isLogin: 'users/isLogin', isLogin: 'users/isLogin',
userInfo: 'users/userInfo',
lotteryInfo: 'lottery/lotteryInfo', lotteryInfo: 'lottery/lotteryInfo',
isBindPhone: 'users/isBindPhone' isBindPhone: 'users/isBindPhone'
}), }),
prizeList() { prizeList() {
return this.lotteryInfo.prizeConfigs return this.lotteryInfo.prizeConfigs
}, },
formatedPrizeList() { formattedPrizeList() {
const prizeLen = this.lotteryInfo?.prizeConfigs?.length || 0 const prizeLen = this.lotteryInfo?.prizeConfigs?.length || 0
if (prizeLen >= 6 && prizeLen % 2 === 0) { if (prizeLen >= 6 && prizeLen % 2 === 0) {
const freePrizes = new Array(2).fill({ id: 0, name: '谢谢参与' }) const freePrizes = new Array(2).fill({ id: 0, name: '谢谢参与' })
...@@ -243,7 +244,7 @@ export default { ...@@ -243,7 +244,7 @@ export default {
}, },
buttonClass() { buttonClass() {
if (!this.lotteryInfo.userTimes || this.isNotStart) { if (!this.lotteryInfo.userTimes || this.isNotStart) {
return 'disbaled' return 'disabled'
} }
if (this.isLottering) { if (this.isLottering) {
return 'loading' return 'loading'
...@@ -307,10 +308,12 @@ export default { ...@@ -307,10 +308,12 @@ export default {
this.$toast('抽奖次数已用完') this.$toast('抽奖次数已用完')
return return
} }
// this.$refs.prizeGrid.start(0) // ===== test start =====
// this.$refs.prizeWheel.start(0)
// if(this.isLogin){ // if(this.isLogin){
// return // return
// } // }
// ===== test end =====
this.isLoading = true this.isLoading = true
const params = { const params = {
id: this.id, id: this.id,
...@@ -328,29 +331,48 @@ export default { ...@@ -328,29 +331,48 @@ export default {
times-- times--
this.updateInfo({ userTimes: times }) this.updateInfo({ userTimes: times })
/* 执行动画 */ /* 执行动画 */
this.$refs?.prizeGrid && this.$refs.prizeGrid.start(+data?.id || 0) if (+this.lotteryInfo.showType === LOTTERY_STYLE.grid) {
this.$refs?.prizeWhell && this.$refs.prizeWhell.start(+data?.id || 0) this.$refs.prizeGrid.start(+data?.id || 0)
this.isLottering = true }
this.isLoading = false if (+this.lotteryInfo.showType === LOTTERY_STYLE.wheel) {
this.$refs.prizeWheel.start(+data?.id || 0)
if (this.lotteryInfo.showType === LOTTERY_STYLE.scratch) { }
if (+this.lotteryInfo.showType === LOTTERY_STYLE.scratch) {
this.$refs.typeScratchRef.drawAnimation() this.$refs.typeScratchRef.drawAnimation()
} }
if (this.lotteryInfo.showType === LOTTERY_STYLE.gashapon) { if (+this.lotteryInfo.showType === LOTTERY_STYLE.gashapon) {
this.$refs.typeGashaponRef.drawAnimation() this.$refs.typeGashaponRef.drawAnimation()
} }
if (this.lotteryInfo.showType === LOTTERY_STYLE.guess) { if (+this.lotteryInfo.showType === LOTTERY_STYLE.guess) {
this.$refs.typeGuessRef.drawAnimation() this.$refs.typeGuessRef.drawAnimation()
} }
this.isLottering = true
this.isLoading = false
/* 开奖信息 */ /* 开奖信息 */
this.winInfo = data this.winInfo = data
} else { } else {
this.isLoading = false this.isLoading = false
this.$toast(errorMessage) this.$toast(errorMessage)
} }
/* sentry 日志 */
this.$sentry.setTag('lotteryId', this.id || 0)
this.$sentry.setTag('sessionId', this.$route.query?.sessionId || 0)
this.$sentry.setTag('uin', this.uin || 0)
this.$sentry.setTag('userId', this.userInfo?.id || 0)
this.$sentry.setExtra('requestData', params)
this.$sentry.setExtra('responseData', res)
this.$sentry.captureMessage('独立链接开奖-请求成功', 'info')
}) })
.catch(() => { .catch((error) => {
this.isLoading = false this.isLoading = false
/* sentry 日志 */
this.$sentry.setTag('lotteryId', this.id || 0)
this.$sentry.setTag('sessionId', this.$route.query?.sessionId || 0)
this.$sentry.setTag('uin', this.uin || 0)
this.$sentry.setTag('userId', this.userInfo?.id || 0)
this.$sentry.setExtra('requestData', params)
this.$sentry.setExtra('errorMsg', error)
this.$sentry.captureMessage('独立链接开奖-请求失败', 'error')
}) })
}, },
// 转盘停止回调 // 转盘停止回调
...@@ -534,7 +556,7 @@ export default { ...@@ -534,7 +556,7 @@ export default {
background: repeating-linear-gradient(-50deg, #fff257, #fff257 6px, #fee938 6px, #fee938 9px); background: repeating-linear-gradient(-50deg, #fff257, #fff257 6px, #fee938 6px, #fee938 9px);
} }
} }
&--disbaled { &--disabled {
background-color: #ccc; background-color: #ccc;
.lottery-instant__button { .lottery-instant__button {
background: repeating-linear-gradient(-50deg, #dcdcdc, #dcdcdc 6px, #d7d7d7 6px, #d7d7d7 9px); background: repeating-linear-gradient(-50deg, #dcdcdc, #dcdcdc 6px, #d7d7d7 6px, #d7d7d7 9px);
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__wheel" :class="{ 'lottery-instant__wheel--no-lightning': !isLottering }"> <div class="lottery-instant__wheel" :class="{ 'lottery-instant__wheel--no-lightning': !isLottering }">
<PrizeWheel <PrizeWheel
ref="prizeWhell" ref="prizeWheel"
:list="formatedPrizeList" :list="formatedPrizeList"
:light-num="16" :light-num="16"
:container-border="24" :container-border="24"
...@@ -247,7 +247,7 @@ export default { ...@@ -247,7 +247,7 @@ export default {
}, },
buttonClass() { buttonClass() {
if (!this.lotteryInfo.userTimes || this.isNotStart) { if (!this.lotteryInfo.userTimes || this.isNotStart) {
return 'disbaled' return 'disabled'
} }
if (this.isLottering) { if (this.isLottering) {
return 'loading' return 'loading'
...@@ -329,29 +329,48 @@ export default { ...@@ -329,29 +329,48 @@ export default {
times-- times--
this.updateInfo({ userTimes: times }) this.updateInfo({ userTimes: times })
/* 执行动画 */ /* 执行动画 */
this.$refs?.prizeGrid && this.$refs.prizeGrid.start(+data?.id || 0) if (+this.lotteryInfo.showType === LOTTERY_STYLE.grid) {
this.$refs?.prizeWhell && this.$refs.prizeWhell.start(+data?.id || 0) this.$refs.prizeGrid.start(+data?.id || 0)
this.isLottering = true }
this.isLoading = false if (+this.lotteryInfo.showType === LOTTERY_STYLE.wheel) {
this.$refs.prizeWheel.start(+data?.id || 0)
if (this.lotteryInfo.showType === LOTTERY_STYLE.scratch) { }
if (+this.lotteryInfo.showType === LOTTERY_STYLE.scratch) {
this.$refs.typeScratchRef.drawAnimation() this.$refs.typeScratchRef.drawAnimation()
} }
if (this.lotteryInfo.showType === LOTTERY_STYLE.gashapon) { if (+this.lotteryInfo.showType === LOTTERY_STYLE.gashapon) {
this.$refs.typeGashaponRef.drawAnimation() this.$refs.typeGashaponRef.drawAnimation()
} }
if (this.lotteryInfo.showType === LOTTERY_STYLE.guess) { if (+this.lotteryInfo.showType === LOTTERY_STYLE.guess) {
this.$refs.typeGuessRef.drawAnimation() this.$refs.typeGuessRef.drawAnimation()
} }
this.isLottering = true
this.isLoading = false
/* 开奖信息 */ /* 开奖信息 */
this.winInfo = data this.winInfo = data
} else { } else {
this.isLoading = false this.isLoading = false
this.$toast(errorMessage) this.$toast(errorMessage)
} }
/* sentry 日志 */
this.$sentry.setTag('lotteryId', this.id || 0)
this.$sentry.setTag('sessionId', this.$route.query?.sessionId || 0)
this.$sentry.setTag('uin', this.uin || 0)
this.$sentry.setTag('userId', this.userInfo?.id || 0)
this.$sentry.setExtra('requestData', params)
this.$sentry.setExtra('responseData', res)
this.$sentry.captureMessage('直播间内嵌开奖-请求成功', 'info')
}) })
.catch(() => { .catch((error) => {
this.isLoading = false this.isLoading = false
/* sentry 日志 */
this.$sentry.setTag('lotteryId', this.id || 0)
this.$sentry.setTag('sessionId', this.$route.query?.sessionId || 0)
this.$sentry.setTag('uin', this.uin || 0)
this.$sentry.setTag('userId', this.userInfo?.id || 0)
this.$sentry.setExtra('requestData', params)
this.$sentry.setExtra('errorMsg', error)
this.$sentry.captureMessage('独立链接开奖-请求失败', 'error')
}) })
}, },
// 转盘停止回调 // 转盘停止回调
...@@ -535,7 +554,7 @@ export default { ...@@ -535,7 +554,7 @@ export default {
background: repeating-linear-gradient(-50deg, #fff257, #fff257 6px, #fee938 6px, #fee938 9px); background: repeating-linear-gradient(-50deg, #fff257, #fff257 6px, #fee938 6px, #fee938 9px);
} }
} }
&--disbaled { &--disabled {
background-color: #ccc; background-color: #ccc;
.lottery-instant__button { .lottery-instant__button {
background: repeating-linear-gradient(-50deg, #dcdcdc, #dcdcdc 6px, #d7d7d7 6px, #d7d7d7 9px); background: repeating-linear-gradient(-50deg, #dcdcdc, #dcdcdc 6px, #d7d7d7 6px, #d7d7d7 9px);
......
<template>
<div class="prize-whell">
<div class="prize-whell__content">
<div class="prize-whell__content__wrap">
<div class="prize-whell__content__wrap__lights">
<span
v-for="index in lightNum"
:key="index"
:style="`transform: rotate(${(360 / lightNum) * index}deg)`"
></span>
</div>
<div class="prize-whell__content__wrap__insert">
<div class="prize-whell__pointer" @click.stop="beforeStart">
<span>立即 抽奖</span>
</div>
<ul class="prize-whell__prizes" :style="angleStyle">
<li
class="prize-whell__prizes__item"
v-for="(item, index) in prizes"
:key="index"
:style="`transform: rotate(${(360 / prizesLen) * index}deg) skewX(${
(360 - 90 * prizesLen) / -prizesLen
}deg);`"
>
<div
class="prize-whell__prizes__item__wrap"
:style="`transform: skewX(-${(360 - 90 * prizesLen) / -prizesLen}deg) rotate(${
360 / prizesLen - 90 - 360 / prizesLen / 2
}deg);`"
>
<div class="item__text">
<p class="item__text__line-one">{{ item.name | formatLineOne }}</p>
<p class="item__text__line-two">{{ item.name | formatLineTwo }}</p>
<p class="item__text__line-three">{{ item.name | formatLineThree }}</p>
</div>
<img class="item__img" v-if="item.id && false" :src="item.icon || giftImg" alt />
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
import giftImg from '@/assets/images/lottery/gift.png'
import { shuffle, getRandomNum, getIsEven } from '@/utils/common'
export default {
name: 'PrizeWhell',
data() {
return {
giftImg,
lightNum: 18, // 彩灯数量
laps: 4, // 圈数
time: 2000, // ms 动画时间
timer: null, // 定时器
winItem: null, // 中奖的item
angleStyle: {}, // 旋转样式
targetAngle: 0, // 目标角度
counter: 1
}
},
props: {
info: {
type: Array,
default: () => []
},
loading: {
default: false,
type: Boolean
},
winId: {
default: 0,
type: Number
}
},
computed: {
prizes() {
const list = Array.from(this.info)
const len = list.length
if (len >= 6) {
list.push({ name: '谢谢参与', id: 0 })
if (getIsEven(len)) {
list.push({ name: '谢谢参与', id: 0 })
}
return list
}
for (let i = 6 - len; i > 0; i--) {
list.push({ name: '谢谢参与', id: 0 })
}
return shuffle(list)
},
prizesLen() {
return this.prizes.length
}
},
filters: {
formatLineOne(name) {
return name.substr(0, 6)
},
formatLineTwo(name) {
return name.substr(6, 4)
},
formatLineThree(name) {
const text = name.length > 12 ? name.substr(10, 2) + '...' : name.substr(10, 2)
return text
}
},
watch: {
loading(nVal) {
if (nVal) {
setTimeout(() => {
this.start()
}, 50)
}
},
winId(val) {
let index
this.prizes.forEach((v, i) => {
if (v.id === val) {
index = i
}
})
this.winItem = index
}
},
mounted() {
this.dataInit()
},
methods: {
// 数据初始化
dataInit() {
this.prizes.forEach((v, i) => {
if (v.id === this.winId) {
this.winItem = i
}
})
},
// 点击开始抽奖
beforeStart() {
this.$emit('start')
},
// 开始逻辑
start() {
const { winItem: index, laps, prizesLen, time } = this
/* 每个奖品的平均角度 */
const itemAngle = 360 / prizesLen
/* 指针开始角度 */
const pointAngle = 90
/* 至少要转圈数的总角度 */
const lapsAngle = 360 * laps
/* 到达中奖的那个块的最小角度 */
const ItemAngleMin = index * itemAngle
/* 指针偏移值 从最大和最小角度中取出一个随机值 */
const randomAngle = -getRandomNum(0 + 1, itemAngle - 1)
// const randomAngle = -(itemAngle/2);
/* 单圈每个块该转的角度 */
const singleAngle =
ItemAngleMin - pointAngle < 0 ? Math.abs(ItemAngleMin - pointAngle) : 360 - (ItemAngleMin - pointAngle)
/* 累积角度 */
const lapsCounter = this.counter * lapsAngle
/* 目标角度 */
this.targetAngle = lapsCounter + singleAngle + randomAngle
/* 计数器 */
this.counter += 1
/* 设置样式 */
this.angleStyle = {
transform: `rotate(${this.targetAngle}deg)`,
transition: `${time}ms all`
}
/* 定时清除样式 */
setTimeout(() => {
this.$emit('end')
}, time)
}
}
}
</script>
<style lang="less" scoped>
@wheelWidth: 100%;
@wheelHeight: 100%;
@pointWidth: 80px;
@pointHeight: 80px;
@keyframes rotate-infinite {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(-360deg);
}
}
@keyframes lights-flashing {
0% {
background: #fff;
box-shadow: 0 0 5px 0 #fff;
}
100% {
background: #ffde2b;
box-shadow: 0 0 5px 0 #ffde2b;
}
}
.prize-whell {
width: @wheelWidth;
height: 0;
padding-top: @wheelHeight;
position: relative;
/* 布局样式 */
&__content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
border-radius: 50%;
/* 外环 */
&__wrap {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #fa3e3f;
box-shadow: 0 0 5px 2px #ed3a3a, 0 0 25px 6px #fa3e3f, inset 0px 0px 7px -2px rgba(255, 255, 255, 0.4),
inset 0px 0px 10px -1px rgba(255, 255, 255, 0.2);
padding: 18px;
position: relative;
/* 内环 */
&__insert {
box-shadow: inset 0px 0px 3px 1px #ec3327;
background-color: #ff2b00;
border-radius: 50%;
width: 100%;
height: 100%;
position: relative;
padding: 2px;
overflow: hidden;
}
/* 彩灯 */
&__lights {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background: transparent;
animation: rotate 5s linear infinite;
> span {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
width: 10px;
height: 100%;
border-radius: 50%;
transform-origin: center center;
&::before {
content: '';
position: absolute;
top: 4px;
left: 0;
right: 0;
margin: 0 auto;
width: 10px;
height: 10px;
border-radius: 50%;
}
&:nth-of-type(even):before {
background: #fff;
animation: lights-flashing 1s linear infinite;
}
&:nth-of-type(odd):before {
background: #d7a945;
animation: lights-flashing 1s linear reverse infinite;
}
}
}
}
}
/* 奖品样式 */
&__prizes {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
z-index: 1;
overflow: hidden;
&__item {
overflow: hidden;
position: absolute;
top: 0;
left: 0;
width: 50%;
height: 50%;
transform-origin: 100% 100%;
&:nth-child(even) {
background-color: #fdf3aa;
}
&:nth-child(odd) {
background-color: #f1d5b0;
}
&__wrap {
color: #ff2b00;
width: 200%;
height: 200%;
text-align: center;
// padding: 10px 50% 130%;
padding: 20px 55% 130%;
line-height: 0;
/* 文字 */
.item__text {
font-size: 14px;
height: 52px;
font-weight: 700;
line-height: 14px;
width: 100%;
padding: 0 15%;
display: flex;
flex-direction: column;
justify-content: center;
> p {
font-weight: 700;
}
}
.item__img {
display: block;
width: 40px;
height: 40px;
margin: 0px auto 0;
}
}
}
}
/* 指针样式 */
&__pointer {
position: absolute;
z-index: 2;
width: @pointWidth;
height: @pointHeight;
line-height: @pointHeight;
border-radius: 50%;
left: 50%;
top: 50%;
border: 5px solid #ff8a00;
transform: translate(-50%, -50%);
background: linear-gradient(0deg, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0.9) 100%) no-repeat 100% 0,
radial-gradient(circle, #fee47b 35%, rgb(252, 193, 88) 65%) no-repeat 100% 0;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
&:after {
content: '';
position: absolute;
left: 50%;
top: -34px;
border-color: transparent;
border-bottom-color: #ff8a00;
border-style: solid;
border-width: 16px 8px;
transform: translateX(-50%);
}
> span {
font-size: 20px;
font-weight: 600;
text-align: center;
color: #fa4445;
line-height: 24px;
word-break: keep-all;
}
}
}
</style>
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
export { default as Banner } from '@/components/Lottery/Instant/Banner' export { default as Banner } from '@/components/Lottery/Instant/Banner'
// 倒计时提醒 // 倒计时提醒
export { default as CountdownBar } from '@/components/Lottery/Instant/CountdownBar' export { default as CountdownBar } from '@/components/Lottery/Instant/CountdownBar'
// 九宫格抽奖
export { default as GridTable } from '@/components/Lottery/Instant/GridTable'
// 大转盘抽奖
export { default as PrizeWhell } from '@/components/Lottery/Instant/PrizeWhell'
// 我的抽奖记录, 中奖名单 // 我的抽奖记录, 中奖名单
export { default as Records } from '@/components/Lottery/Instant/Records' export { default as Records } from '@/components/Lottery/Instant/Records'
// 活动介绍 // 活动介绍
......
...@@ -18,10 +18,12 @@ export default { ...@@ -18,10 +18,12 @@ export default {
/* sentry */ /* sentry */
export const sentryOptions = { export const sentryOptions = {
dsn: `${protocol}//f28c699ad832413c8b529520ea4b6df0@sentry.guangdianyun.tv/22`, dsn: `${protocol}//610a9f4b831d4d10b228658886eaa18d@sentry.guangdianyun.tv/14`,
version: packageEnv.version, version: packageEnv.version,
env: process.env.X_CA_STAGE, env: process.env.X_CA_STAGE,
name: packageEnv.name name: packageEnv.name,
isAjax: false,
isError: false,
} }
/* 谷歌统计 */ /* 谷歌统计 */
......
/* 正式:私有化部署(private)环境变量 */ /* 正式:私有化部署(private)环境变量 */
module.exports = { module.exports = {
X_CA_STAGE: '', X_CA_STAGE: '',
API_DOMAIN: '//cgateway.huaguangyun.cn/v1', API_DOMAIN: '//cgateway.cbnclouds.cn/v1',
OSS_DOMAIN: '//gd-resource.cbnclouds.cn', OSS_DOMAIN: '//gd-resource.cbnclouds.cn',
ROP_DOMAIN: 'cbnclouds.cn', ROP_DOMAIN: 'cbnclouds.cn',
private: true, private: true,
......
...@@ -34,6 +34,32 @@ const plugins = IS_USE_OSS ...@@ -34,6 +34,32 @@ const plugins = IS_USE_OSS
: [] : []
const REMOTE_OSS_DOMAIN = `//static-${env.run_server}.guangdianyun.tv` const REMOTE_OSS_DOMAIN = `//static-${env.run_server}.guangdianyun.tv`
const sentryConfig = IS_USE_OSS
? {
sentry: {
dsn: 'https://610a9f4b831d4d10b228658886eaa18d@sentry.guangdianyun.tv/14',
config: {
environment: env.run_server,
release: version,
autoSessionTracking: false
},
lazy: true
}
}
: {}
const gtagConfig = IS_USE_OSS
? {
'google-gtag': {
id: 'G-HZHJLDPT80', // required
config: {
anonymize_ip: true,
send_page_view: false
}
}
}
: {}
export default { export default {
buildDir: 'nuxt-dist', buildDir: 'nuxt-dist',
env, env,
...@@ -110,7 +136,6 @@ export default { ...@@ -110,7 +136,6 @@ export default {
plugins: [ plugins: [
{ src: '@/plugins/routeHooks' }, { src: '@/plugins/routeHooks' },
{ src: '@/plugins/vant' }, { src: '@/plugins/vant' },
{ src: '@/plugins/gtag' },
{ src: '@/filters' }, { src: '@/filters' },
{ src: '@/plugins/vueClipboard' }, { src: '@/plugins/vueClipboard' },
{ src: '@/plugins/dmsService', ssr: false }, { src: '@/plugins/dmsService', ssr: false },
...@@ -132,11 +157,13 @@ export default { ...@@ -132,11 +157,13 @@ export default {
less: './assets/styles/variable.less' less: './assets/styles/variable.less'
}, },
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: ['@nuxtjs/axios'], modules: ['@nuxtjs/axios', '@nuxtjs/sentry', '@nuxtjs/google-gtag'],
/* /*
** Axios module configuration ** Axios module configuration
** See https://axios.nuxtjs.org/options ** See https://axios.nuxtjs.org/options
*/ */
...sentryConfig,
...gtagConfig,
axios: {}, axios: {},
server: { server: {
port: env.run_port, // default: 3000 port: env.run_port, // default: 3000
......
...@@ -49,12 +49,14 @@ ...@@ -49,12 +49,14 @@
"@gdyfe/gdy-component-lib": "^0.4.1", "@gdyfe/gdy-component-lib": "^0.4.1",
"@gdyfe/rop-client": "1.1.10", "@gdyfe/rop-client": "1.1.10",
"@nuxtjs/axios": "^5.13.6", "@nuxtjs/axios": "^5.13.6",
"@nuxtjs/google-gtag": "^1.0.4",
"@nuxtjs/sentry": "^5.1.7",
"alife-logger": "1.8.6", "alife-logger": "1.8.6",
"core-js": "^3.15.1", "core-js": "^3.15.1",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
"lotteries": "^1.2.0", "lotteries": "^1.2.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nuxt": "^2.15.7", "nuxt": "^2.15.8",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"tippy.js": "^6.3.1", "tippy.js": "^6.3.1",
"uuid": "^8.3.2", "uuid": "^8.3.2",
...@@ -62,7 +64,6 @@ ...@@ -62,7 +64,6 @@
"vconsole": "^3.9.1", "vconsole": "^3.9.1",
"vue-clipboard2": "^0.3.1", "vue-clipboard2": "^0.3.1",
"vue-cookie": "^1.1.4", "vue-cookie": "^1.1.4",
"vue-gtag": "^1.16.1",
"vuescroll": "^4.17.3", "vuescroll": "^4.17.3",
"weixin-js-sdk": "^1.6.0" "weixin-js-sdk": "^1.6.0"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment