武汉大学抽奖

master
xy 2 years ago
parent 4383ffaf27
commit 5ba510eabb

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@ -17,7 +17,8 @@ export default {
data() { data() {
return { return {
// * 定时函数 // * 定时函数
drawTiming: null drawTiming: null,
mixinTransform: '',
} }
}, },
mounted () { mounted () {
@ -38,11 +39,13 @@ export default {
// 表示更宽 // 表示更宽
scale.width = ((window.innerHeight * baseProportion) / baseWidth).toFixed(5) scale.width = ((window.innerHeight * baseProportion) / baseWidth).toFixed(5)
scale.height = (window.innerHeight / baseHeight).toFixed(5) scale.height = (window.innerHeight / baseHeight).toFixed(5)
this.mixinTransform = `scale(${scale.width}, ${scale.height})`
appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)` appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)`
} else { } else {
// 表示更高 // 表示更高
scale.height = ((window.innerWidth / baseProportion) / baseHeight).toFixed(5) scale.height = ((window.innerWidth / baseProportion) / baseHeight).toFixed(5)
scale.width = (window.innerWidth / baseWidth).toFixed(5) scale.width = (window.innerWidth / baseWidth).toFixed(5)
this.mixinTransform = `scale(${scale.width}, ${scale.height})`
appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)` appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)`
} }
} }

@ -78,7 +78,11 @@
prop: 'name', prop: 'name',
label: '用户名称', label: '用户名称',
align: 'left', align: 'left',
customFn: row => {
return (
<span>{ row.name ? row.name : (row.nickname ? JSON.parse(row.nickname) : '')}</span>
)
}
}, { }, {
prop: 'top_department_id', prop: 'top_department_id',

@ -33,12 +33,16 @@
<div class="btn-end" v-show="!isResult && start"> <div class="btn-end" v-show="!isResult && start">
<img src="~@/assets/xhxcelsh/btn-end.png" alt="" @click="end"> <img src="~@/assets/xhxcelsh/btn-end.png" alt="" @click="end">
</div> </div>
<div class="btn-end" v-show="isResult && !start">
<img src="~@/assets/xhxcelsh/res-btn.png" alt="" @click="showEnd = true">
</div>
</div>
<transition name="fade"> <transition name="fade">
<div class="start-container" v-show="!start && !isResult"> <div class="start-container" v-show="!start && !isResult">
<div class="mask"></div> <div class="mask"></div>
<div style="display: flex;flex-direction: column;justify-content: center;align-items: center;"> <div style="display: flex;flex-direction: column;justify-content: center;align-items: center;" :style="{ transform: mixinTransform }">
<div class="start-container__title"> <div class="start-container__title">
{{ product.price_item }}{{ product.total }} {{ product.price_item }}{{ product.total }}
</div> </div>
@ -59,11 +63,11 @@
</transition> </transition>
<transition name="fade"> <transition name="fade">
<div class="end-container" v-show="!start && isResult"> <div class="end-container" v-show="!start && isResult && showEnd">
<div class="mask"></div> <div class="mask"></div>
<div class="body"> <div class="body" :style="{ transform: mixinTransform }">
<div class="close"> <div class="close" @click="showEnd = false">
<i class="el-icon-close"></i> <i class="el-icon-close"></i>
</div> </div>
@ -72,16 +76,15 @@
</div> </div>
<div class="result-users"> <div class="result-users">
<div class="result-users-item" v-for="i in 10"> <div class="result-users-item" v-for="i in resultUsers">
<img class="result-users-item__avatar" src="https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIIMRcKFGZTZCqa5TZlKYogFOHrDQUe1iacWUJYcS3fjrwib2K5lG52Cd1y93UUd7Ynnvvw1tTYR2lw/132" alt=""> <img class="result-users-item__avatar" :src="i.headimgurl" alt="">
<div class="result-users-item__name">abc</div> <div class="result-users-item__name">{{ i.nickname ? JSON.parse(i.nickname) : '' }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</transition> </transition>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -91,6 +94,7 @@ import { index } from '@/api/activity/activityUser'
import drawMixin from '@/mixins/drawMixin' import drawMixin from '@/mixins/drawMixin'
import { draw } from "@/api/mdLotteryDraw"; import { draw } from "@/api/mdLotteryDraw";
import { import {
drawLog,
show show
} from "@/api/activity/drawPrize"; } from "@/api/activity/drawPrize";
export default { export default {
@ -99,21 +103,36 @@ export default {
mixins: [drawMixin], mixins: [drawMixin],
data() { data() {
return { return {
showEnd: false,
isResult: false, isResult: false,
start: false, start: false,
avatars: [], avatars: [],
timer: null, timer: null,
product: {}, product: {},
originalUsers: [],
columnIndex: 0, columnIndex: 0,
resultUsers: [],
} }
}, },
methods: { methods: {
async getResult() {
const res = await drawLog(
{
page: 1,
page_size: 9999,
activity_list_id: 16,
},
false
);
const resUsers = res.data.filter((i) => i.draw_prize_id == this.$route.params.id)
this.resultUsers = this.originalUsers.filter(i => resUsers.find(j => j.mobile == i.id))
this.showEnd = true
},
async getProduct() { async getProduct() {
const res = await show({ const res = await show({
id: this.$route.params.id, id: this.$route.params.id,
},false); },false);
console.log(444,res)
this.product = res this.product = res
}, },
async getUsers() { async getUsers() {
@ -123,6 +142,7 @@ export default {
page_size: 9999, page_size: 9999,
activity_list_id: 16 activity_list_id: 16
},false)).data },false)).data
this.originalUsers = res;
let users = []; let users = [];
//19x6 //19x6
if (res.length < (19*6*2)) { if (res.length < (19*6*2)) {
@ -191,13 +211,16 @@ export default {
}), }),
async end() { async end() {
try { try {
const result = await draw({ const result = (await draw({
id: this.$route.params.id, id: this.$route.params.id,
}); })).draw_numbers;
console.log(result) this.resultUsers = this.originalUsers.filter(item => result.indexOf(item.id) !== -1)
clearInterval(this.timer) clearInterval(this.timer)
this.start = false this.start = false
this.isResult = true
this.showEnd = true
} catch (err) { } catch (err) {
console.log(err)
this.$message.warning({ this.$message.warning({
message: "操作失败" message: "操作失败"
}) })
@ -214,7 +237,12 @@ export default {
this.getProduct() this.getProduct()
}, },
mounted() { mounted() {
this.getUsers() this.getUsers().then(_ => {
if(this.$route.query.result == 1) {
this.isResult = true
this.getResult()
}
})
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer) clearInterval(this.timer)
@ -239,6 +267,7 @@ export default {
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
transform-origin: left top; transform-origin: left top;
overflow: hidden;
.img { .img {
@mixin img { @mixin img {
@ -422,7 +451,7 @@ export default {
.body { .body {
width: 2334px; width: 2334px;
height: 1425px; height: 1425px;
position: relative; position: absolute;
background: url("~@/assets/xhxcelsh/result-bkg.png") no-repeat #ffffff; background: url("~@/assets/xhxcelsh/result-bkg.png") no-repeat #ffffff;
background-size: cover; background-size: cover;
border-radius: 10px; border-radius: 10px;
@ -475,8 +504,8 @@ export default {
&-item { &-item {
&__avatar { &__avatar {
width: 292px; width: 280px;
height: 292px; height: 280px;
object-fit: cover; object-fit: cover;
border-radius: 100%; border-radius: 100%;
} }

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath * Detail: https://cli.vuejs.org/config/#publicpath
*/ */
publicPath: '/admin/', publicPath: '/admin/',
outputDir: '/Users/mac/Documents/朗业/0-朗业基础库/h5/public/admin', outputDir: './dist',
assetsDir: 'static', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save