diff --git a/src/assets/xhxcelsh/res-btn.png b/src/assets/xhxcelsh/res-btn.png new file mode 100644 index 0000000..04d2f04 Binary files /dev/null and b/src/assets/xhxcelsh/res-btn.png differ diff --git a/src/mixins/drawMixin.js b/src/mixins/drawMixin.js index fdcb235..2cf1cb3 100644 --- a/src/mixins/drawMixin.js +++ b/src/mixins/drawMixin.js @@ -17,7 +17,8 @@ export default { data() { return { // * 定时函数 - drawTiming: null + drawTiming: null, + mixinTransform: '', } }, mounted () { @@ -38,11 +39,13 @@ export default { // 表示更宽 scale.width = ((window.innerHeight * baseProportion) / baseWidth).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%)` } else { // 表示更高 scale.height = ((window.innerWidth / baseProportion) / baseHeight).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%)` } } diff --git a/src/views/activity/activityUser.vue b/src/views/activity/activityUser.vue index 45dcef1..89df82b 100644 --- a/src/views/activity/activityUser.vue +++ b/src/views/activity/activityUser.vue @@ -1,183 +1,187 @@ - - - - - diff --git a/src/views/page/xhxcelshDraw.vue b/src/views/page/xhxcelshDraw.vue index ef0b394..94060cc 100644 --- a/src/views/page/xhxcelshDraw.vue +++ b/src/views/page/xhxcelshDraw.vue @@ -33,54 +33,57 @@
+
+ +
+ - -
-
-
-
- {{ product.price_item }}{{ product.total }}名 -
- - + +
+
+
+
+ {{ product.price_item }}{{ product.total }}名 +
-
- 奖品:{{ product.name }} -
+ -
- 赞助商 : {{ product.apply }} -
+
+ 奖品:{{ product.name }} +
- +
+ 赞助商 : {{ product.apply }}
+ +
- +
+
- -
-
+ +
+
-
-
- -
+
+
+ +
-
- {{ product.price_item }}{{ product.total }}名 -
+
+ {{ product.price_item }}{{ product.total }}名 +
-
-
- -
abc
-
+
+
+ +
{{ i.nickname ? JSON.parse(i.nickname) : '' }}
- -
+
+
@@ -91,6 +94,7 @@ import { index } from '@/api/activity/activityUser' import drawMixin from '@/mixins/drawMixin' import { draw } from "@/api/mdLotteryDraw"; import { + drawLog, show } from "@/api/activity/drawPrize"; export default { @@ -99,21 +103,36 @@ export default { mixins: [drawMixin], data() { return { + showEnd: false, isResult: false, start: false, avatars: [], timer: null, product: {}, + originalUsers: [], columnIndex: 0, + resultUsers: [], } }, 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() { const res = await show({ id: this.$route.params.id, },false); - console.log(444,res) this.product = res }, async getUsers() { @@ -123,6 +142,7 @@ export default { page_size: 9999, activity_list_id: 16 },false)).data + this.originalUsers = res; let users = []; //19x6 if (res.length < (19*6*2)) { @@ -191,13 +211,16 @@ export default { }), async end() { try { - const result = await draw({ + const result = (await draw({ id: this.$route.params.id, - }); - console.log(result) + })).draw_numbers; + this.resultUsers = this.originalUsers.filter(item => result.indexOf(item.id) !== -1) clearInterval(this.timer) this.start = false + this.isResult = true + this.showEnd = true } catch (err) { + console.log(err) this.$message.warning({ message: "操作失败" }) @@ -214,7 +237,12 @@ export default { this.getProduct() }, mounted() { - this.getUsers() + this.getUsers().then(_ => { + if(this.$route.query.result == 1) { + this.isResult = true + this.getResult() + } + }) }, beforeDestroy() { clearInterval(this.timer) @@ -239,6 +267,7 @@ export default { left: 50%; transform: translate(-50%, -50%); transform-origin: left top; + overflow: hidden; .img { @mixin img { @@ -422,7 +451,7 @@ export default { .body { width: 2334px; height: 1425px; - position: relative; + position: absolute; background: url("~@/assets/xhxcelsh/result-bkg.png") no-repeat #ffffff; background-size: cover; border-radius: 10px; @@ -475,8 +504,8 @@ export default { &-item { &__avatar { - width: 292px; - height: 292px; + width: 280px; + height: 280px; object-fit: cover; border-radius: 100%; } diff --git a/vue.config.js b/vue.config.js index b031d72..721d71d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,148 +1,148 @@ -'use strict' -const path = require('path') -const defaultSettings = require('./src/settings.js') - -function resolve(dir) { - return path.join(__dirname, dir) -} - -const name = defaultSettings.title // page title - -// If your port is set to 80, -// use administrator privileges to execute the command line. -// For example, Mac: sudo npm run -// You can change the port by the following methods: -// port = 9528 npm run dev OR npm run dev --port = 9528 -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/ -module.exports = { - /** - * 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/, - * then publicPath should be set to "/bar/". - * In most cases please use '/' !!! - * Detail: https://cli.vuejs.org/config/#publicpath - */ - publicPath: '/admin/', - outputDir: '/Users/mac/Documents/朗业/0-朗业基础库/h5/public/admin', - assetsDir: 'static', - css: { - loaderOptions: { // 向 CSS 相关的 loader 传递选项 - less: { - javascriptEnabled: true - } - } - }, - lintOnSave: process.env.NODE_ENV === 'development', - productionSourceMap: false, - devServer: { - port: port, - open: true, - overlay: { - warnings: false, - errors: true - }, - //before: require('./mock/mock-server.js'), - proxy: { - [process.env.VUE_APP_BASE_API]: { - target: process.env.VUE_APP_BASE_API, - changeOrigin: true, //配置跨域 - pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API - } - } - } - }, - configureWebpack: { - // provide the app's title in webpack's name field, so that - // it can be accessed in index.html to inject the correct title. - name: name, - resolve: { - alias: { - '@': resolve('src') - } - } - }, - chainWebpack(config) { - // it can improve the speed of the first screen, it is recommended to turn on preload - config.plugin('preload').tap(() => [{ - rel: 'preload', - // to ignore runtime.js - // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 - fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], - include: 'initial' - }]) - - // when there are many pages, it will cause too many meaningless requests - config.plugins.delete('prefetch') - - // set svg-sprite-loader - config.module - .rule('svg') - .exclude.add(resolve('src/icons')) - .end() - config.module - .rule('icons') - .test(/\.svg$/) - .include.add(resolve('src/icons')) - .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') - .options({ - symbolId: 'icon-[name]' - }) - .end() - - // set preserveWhitespace - config.module - .rule('vue') - .use('vue-loader') - .loader('vue-loader') - .tap(options => { - options.compilerOptions.preserveWhitespace = true - return options - }) - .end() - - config - .when(process.env.NODE_ENV !== 'development', - config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() - config - .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - 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 - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk - config.optimization.runtimeChunk('single') - } - ) - } +'use strict' +const path = require('path') +const defaultSettings = require('./src/settings.js') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const name = defaultSettings.title // page title + +// If your port is set to 80, +// use administrator privileges to execute the command line. +// For example, Mac: sudo npm run +// You can change the port by the following methods: +// port = 9528 npm run dev OR npm run dev --port = 9528 +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/ +module.exports = { + /** + * 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/, + * then publicPath should be set to "/bar/". + * In most cases please use '/' !!! + * Detail: https://cli.vuejs.org/config/#publicpath + */ + publicPath: '/admin/', + outputDir: './dist', + assetsDir: 'static', + css: { + loaderOptions: { // 向 CSS 相关的 loader 传递选项 + less: { + javascriptEnabled: true + } + } + }, + lintOnSave: process.env.NODE_ENV === 'development', + productionSourceMap: false, + devServer: { + port: port, + open: true, + overlay: { + warnings: false, + errors: true + }, + //before: require('./mock/mock-server.js'), + proxy: { + [process.env.VUE_APP_BASE_API]: { + target: process.env.VUE_APP_BASE_API, + changeOrigin: true, //配置跨域 + pathRewrite: { + ['^' + process.env.VUE_APP_BASE_API]: process.env.VUE_APP_BASE_API + } + } + } + }, + configureWebpack: { + // provide the app's title in webpack's name field, so that + // it can be accessed in index.html to inject the correct title. + name: name, + resolve: { + alias: { + '@': resolve('src') + } + } + }, + chainWebpack(config) { + // it can improve the speed of the first screen, it is recommended to turn on preload + config.plugin('preload').tap(() => [{ + rel: 'preload', + // to ignore runtime.js + // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 + fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], + include: 'initial' + }]) + + // when there are many pages, it will cause too many meaningless requests + config.plugins.delete('prefetch') + + // set svg-sprite-loader + config.module + .rule('svg') + .exclude.add(resolve('src/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + // set preserveWhitespace + config.module + .rule('vue') + .use('vue-loader') + .loader('vue-loader') + .tap(options => { + options.compilerOptions.preserveWhitespace = true + return options + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + 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 + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk + config.optimization.runtimeChunk('single') + } + ) + } }