武汉大学抽奖

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%)`
} }
} }

@ -1,183 +1,187 @@
<template> <template>
<div> <div>
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目用户管理"> <lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目用户管理">
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div class="selects"> <div class="selects">
<div style="display: flex;align-items: center;" v-show="!sysInfo"> <div style="display: flex;align-items: center;" v-show="!sysInfo">
<span style="padding: 0 6px;word-break: keep-all;"> <span style="padding: 0 6px;word-break: keep-all;">
项目 项目
</span> </span>
<Select v-model="select.activity_list_id" style="width: 180px;"> <Select v-model="select.activity_list_id" style="width: 180px;">
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name"> <Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
</Option> </Option>
</Select> </Select>
</div> </div>
<div> <div>
<span style="padding: 0 6px;word-break: keep-all;"> <span style="padding: 0 6px;word-break: keep-all;">
关键字 关键字
</span> </span>
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input> <Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
</div> </div>
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}"> <Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">
</Button> </Button>
<Button style="margin-left: 10px" type="primary" @click="doSearch"></Button> <Button style="margin-left: 10px" type="primary" @click="doSearch"></Button>
<Button style="margin-left: 10px" type="primary" @click="add"></Button> <Button style="margin-left: 10px" type="primary" @click="add"></Button>
</div> </div>
</slot> </slot>
</lx-header> </lx-header>
<xy-table :list="list" :total="total" :table-item="table" @delete="deleteitem" <xy-table :list="list" :total="total" :table-item="table" @delete="deleteitem"
@editor="(row)=>{$refs['addActivityUser'].id = row.id;$refs['addActivityUser'].isShow = true;$refs['addActivityUser'].type = 'editor'}" @editor="(row)=>{$refs['addActivityUser'].id = row.id;$refs['addActivityUser'].isShow = true;$refs['addActivityUser'].type = 'editor'}"
@pageSizeChange="e => {select.page_size = e;doSearch()}" @pageIndexChange="pageChange" @pageSizeChange="e => {select.page_size = e;doSearch()}" @pageIndexChange="pageChange"
:pageSize="select.page_size"> :pageSize="select.page_size">
<template v-slot:btns v-if="type==0 "> <template v-slot:btns v-if="type==0 ">
</template> </template>
</xy-table> </xy-table>
<addActivityUser ref="addActivityUser" :listActivity="listActivity" @refresh="load()"></addActivityUser> <addActivityUser ref="addActivityUser" :listActivity="listActivity" @refresh="load()"></addActivityUser>
</div> </div>
</template> </template>
<script> <script>
import { import {
index, index,
destroy, destroy,
show show
} from "@/api/activity/activityUser"; } from "@/api/activity/activityUser";
import { import {
index as activityIndex index as activityIndex
} from "@/api/activity/index"; } from "@/api/activity/index";
import addActivityUser from '@/views/activity/components/addActivityUser' import addActivityUser from '@/views/activity/components/addActivityUser'
export default { export default {
components: { components: {
addActivityUser addActivityUser
}, },
data() { data() {
return { return {
sysInfo:null, sysInfo:null,
select: { select: {
page: 1, page: 1,
page_size: 20, page_size: 20,
keyword: '', keyword: '',
activity_list_id: "" activity_list_id: ""
}, },
listActivity: [], listActivity: [],
total: 0, total: 0,
list: [], list: [],
table: [{ table: [{
prop: 'activity_list.name', prop: 'activity_list.name',
label: '项目名称', label: '项目名称',
fixed: 'left', fixed: 'left',
align: 'left' align: 'left'
}, { }, {
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', )
label: '排名', }
align: 'center',
}, {
prop: 'top_department_id',
}, label: '排名',
align: 'center',
{
prop: 'company_name',
label: '所属部门/分公司', },
align: 'center'
}, {
{ prop: 'company_name',
prop: 'username', label: '所属部门/分公司',
label: '登录账号', align: 'center'
align: 'center' },
}, { {
prop: 'mobile', prop: 'username',
label: '手机号', label: '登录账号',
align: 'center' align: 'center'
}, }, {
{ prop: 'mobile',
prop: 'created_at', label: '手机号',
label: '创建信息', align: 'center'
width: 190, },
formatter: (v1, v2, value) => { {
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss"); prop: 'created_at',
} label: '创建信息',
} width: 190,
], formatter: (v1, v2, value) => {
} return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
}, }
methods: { }
],
async loadActivity() { }
const res = await activityIndex({ },
page: 1, methods: {
page_size: 999
}) async loadActivity() {
this.listActivity = res.data; const res = await activityIndex({
}, page: 1,
doSearch() { page_size: 999
this.select.page = 1; })
this.load(); this.listActivity = res.data;
}, },
add() { doSearch() {
this.$refs['addActivityUser'].isShow = true this.select.page = 1;
}, this.load();
pageSizeChange(e) { },
this.select.page_size = e; add() {
this.select.page = 1; this.$refs['addActivityUser'].isShow = true
this.load(); },
}, pageSizeChange(e) {
async load() { this.select.page_size = e;
const res = await index(this.select) this.select.page = 1;
this.total = res.total this.load();
this.list = res.data },
}, async load() {
deleteitem(row) { const res = await index(this.select)
destroy({ this.total = res.total
id: row.id this.list = res.data
}).then(res => { },
this.load(); deleteitem(row) {
this.$Message.success("操作成功"); destroy({
}) id: row.id
}, }).then(res => {
pageChange(e) { this.load();
this.select.page = e this.$Message.success("操作成功");
this.load() })
}, },
}, pageChange(e) {
created() { this.select.page = e
let that = this; this.load()
let type = parseInt(this.$route.path.split("_")[1]); },
this.type = this.select.is_auth = type; },
let sysInfo = sessionStorage.getItem('sys_info') created() {
if (sysInfo && sysInfo != "") { let that = this;
let type = parseInt(this.$route.path.split("_")[1]);
this.type = this.select.is_auth = type;
let sysInfo = sessionStorage.getItem('sys_info')
if (sysInfo && sysInfo != "") {
let _sys = JSON.parse(sysInfo); let _sys = JSON.parse(sysInfo);
if(_sys.tag!='h5'){ if(_sys.tag!='h5'){
that.select.activity_list_id = _sys.id; that.select.activity_list_id = _sys.id;
that.sysInfo=_sys; that.sysInfo=_sys;
} }
} }
this.load(); this.load();
this.loadActivity() this.loadActivity()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.selects { .selects {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
&>div { &>div {
margin-bottom: 6px; margin-bottom: 6px;
} }
} }
</style> </style>

@ -33,54 +33,57 @@
<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>
<img class="start-container__shop" :src="product.image_file ? product.image_file.url : ''" alt="">
<div class="start-container__name"> <img class="start-container__shop" :src="product.image_file ? product.image_file.url : ''" alt="">
奖品{{ product.name }}
</div>
<div class="start-container__support"> <div class="start-container__name">
赞助商 : {{ product.apply }} 奖品{{ product.name }}
</div> </div>
<img class="start-container__start" src="~@/assets/xhxcelsh/btn-start.png" alt="" @click="startDraw"> <div class="start-container__support">
赞助商 : {{ product.apply }}
</div> </div>
<img class="start-container__start" src="~@/assets/xhxcelsh/btn-start.png" alt="" @click="startDraw">
</div> </div>
</transition> </div>
</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>
<div class="title"> <div class="title">
{{ product.price_item }}{{ product.total }} {{ product.price_item }}{{ product.total }}
</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>
</transition> </div>
</div> </transition>
</div> </div>
</template> </template>
@ -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%;
} }

@ -1,148 +1,148 @@
'use strict' 'use strict'
const path = require('path') const path = require('path')
const defaultSettings = require('./src/settings.js') const defaultSettings = require('./src/settings.js')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
} }
const name = defaultSettings.title // page title const name = defaultSettings.title // page title
// If your port is set to 80, // If your port is set to 80,
// use administrator privileges to execute the command line. // use administrator privileges to execute the command line.
// For example, Mac: sudo npm run // For example, Mac: sudo npm run
// You can change the port by the following methods: // You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528 // port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 8013 // dev port const port = process.env.port || process.env.npm_config_port || 8013 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/ // All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = { module.exports = {
/** /**
* You will need to set publicPath if you plan to deploy your site under a sub path, * You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/, * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/". * then publicPath should be set to "/bar/".
* In most cases please use '/' !!! * In most cases please use '/' !!!
* 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 传递选项
less: { less: {
javascriptEnabled: true javascriptEnabled: true
} }
} }
}, },
lintOnSave: process.env.NODE_ENV === 'development', lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
port: port, port: port,
open: true, open: true,
overlay: { overlay: {
warnings: false, warnings: false,
errors: true errors: true
}, },
//before: require('./mock/mock-server.js'), //before: require('./mock/mock-server.js'),
proxy: { proxy: {
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_BASE_API, target: process.env.VUE_APP_BASE_API,
changeOrigin: true, //配置跨域 changeOrigin: true, //配置跨域
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API ['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API
} }
} }
} }
}, },
configureWebpack: { configureWebpack: {
// provide the app's title in webpack's name field, so that // provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title. // it can be accessed in index.html to inject the correct title.
name: name, name: name,
resolve: { resolve: {
alias: { alias: {
'@': resolve('src') '@': resolve('src')
} }
} }
}, },
chainWebpack(config) { chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload // it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [{ config.plugin('preload').tap(() => [{
rel: 'preload', rel: 'preload',
// to ignore runtime.js // to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial' include: 'initial'
}]) }])
// when there are many pages, it will cause too many meaningless requests // when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch') config.plugins.delete('prefetch')
// set svg-sprite-loader // set svg-sprite-loader
config.module config.module
.rule('svg') .rule('svg')
.exclude.add(resolve('src/icons')) .exclude.add(resolve('src/icons'))
.end() .end()
config.module config.module
.rule('icons') .rule('icons')
.test(/\.svg$/) .test(/\.svg$/)
.include.add(resolve('src/icons')) .include.add(resolve('src/icons'))
.end() .end()
.use('svg-sprite-loader') .use('svg-sprite-loader')
.loader('svg-sprite-loader') .loader('svg-sprite-loader')
.options({ .options({
symbolId: 'icon-[name]' symbolId: 'icon-[name]'
}) })
.end() .end()
// set preserveWhitespace // set preserveWhitespace
config.module config.module
.rule('vue') .rule('vue')
.use('vue-loader') .use('vue-loader')
.loader('vue-loader') .loader('vue-loader')
.tap(options => { .tap(options => {
options.compilerOptions.preserveWhitespace = true options.compilerOptions.preserveWhitespace = true
return options return options
}) })
.end() .end()
config config
.when(process.env.NODE_ENV !== 'development', .when(process.env.NODE_ENV !== 'development',
config => { config => {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')
.use('script-ext-html-webpack-plugin', [{ .use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime` // `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/ inline: /runtime\..*\.js$/
}]) }])
.end() .end()
config config
.optimization.splitChunks({ .optimization.splitChunks({
chunks: 'all', chunks: 'all',
cacheGroups: { cacheGroups: {
libs: { libs: {
name: 'chunk-libs', name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
priority: 10, priority: 10,
chunks: 'initial' // only package third parties that are initially dependent chunks: 'initial' // only package third parties that are initially dependent
}, },
elementUI: { elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
}, },
commons: { commons: {
name: 'chunk-commons', name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number minChunks: 3, // minimum common number
priority: 5, priority: 5,
reuseExistingChunk: true reuseExistingChunk: true
} }
} }
}) })
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single') config.optimization.runtimeChunk('single')
} }
) )
} }
} }

Loading…
Cancel
Save