Browse Source

fix: 开发抽奖页面

wuguojie 1 day ago
parent
commit
51ac3fc3ac
2 changed files with 173 additions and 0 deletions
  1. 87 0
      src/views/application/lottery/add.vue
  2. 86 0
      src/views/application/lottery/list.vue

+ 87 - 0
src/views/application/lottery/add.vue

@@ -0,0 +1,87 @@
+<template>
+    <div>
+        <div class="g-card">
+            <h4 class="g-card-title">{{ title }}</h4>
+            <el-form ref="LotteryAdd" :model="addForm" :rules="addRules" label-position="left">
+                <el-form-item label="活动名称" prop="a">
+                    <el-input v-model="addForm.a" placeholder="请输入活动名称"></el-input>
+                </el-form-item>
+                <el-form-item label="活动类型" prop="b">
+                    <el-select v-model="addForm.b" placeholder="请选择活动类型">
+                        <el-option value="1" label="抽奖"></el-option>
+                        <el-option value="2" label="红包"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="活动时间" prop="c">
+                    <el-date-picker
+                        type="daterange"
+                        v-model="addForm.c"
+                        range-separator="至"
+                        start-placeholder="开始日期"
+                        end-placeholder="结束日期"
+                        align="right"
+                        value-format="yyyy-MM-dd"
+                    ></el-date-picker>
+                </el-form-item>
+                <el-form-item label="奖品设置" prop="d">
+                    <el-radio-group v-model="addForm.d" v-if="addForm.b ==='2' ">
+                        <el-radio label="1">单等级奖品</el-radio>
+                        <el-radio label="2">多等级奖品</el-radio>
+                    </el-radio-group>
+                    <el-input v-model="addForm.d" v-else-if="addForm.b === '1' "></el-input>
+                </el-form-item>
+                <el-form-item label="奖品等级" v-if="addForm.d === '2' ">
+                    <el-select v-model="addForm.e" placeholder="请选择奖品等级">
+                        <el-option value="1" label="等级1"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="活动奖品" prop="f">
+                    <el-radio-group v-model="addForm.f">
+                        <el-radio label="1">优惠券</el-radio>
+                        <el-radio label="2">积分</el-radio>
+                        <el-radio label="3">平台会员</el-radio>
+                    </el-radio-group>
+                </el-form-item>
+                <el-form-item label="" prop="g">
+                    <el-select v-model="addForm.g" filterable v-if="addForm.f === '1' ">
+                        <el-option label="选项1" value="1"></el-option>
+                    </el-select>
+                    <el-input v-else-if="addForm.f === '2' || addForm.f === '3'" v-model="addForm.g" :placeholder="addForm.f === '2'?'请输入积分':addForm.f === '3'?'请输入天数':''"></el-input>
+                </el-form-item>
+            </el-form>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: "lotteryAdd",
+    data() {
+        return {
+            title: '新增',
+            addForm: {
+                a: '',
+                b: '2',
+                c: '',
+                d: '1',
+                e: '',
+                f: '',
+                g: '1'
+            },
+            addRules: {
+                a: [{ required: true, message: '请输入活动名称', trigger: 'blur' }]
+            }
+        }
+    },
+    created() {
+
+    },
+    methods: {
+
+    },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 86 - 0
src/views/application/lottery/list.vue

@@ -0,0 +1,86 @@
+<template>
+    <div>
+        <el-form ref="LotteryForm" :inline="true" :model="lotteryForm" class="top-search">
+            <el-form-item label="类型" prop="type">
+                <el-select v-model="lotteryForm.type">
+                    <el-option value="1" label="1"></el-option>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="">
+                <el-button type="primary" :loading="loading" @click="initList">查询</el-button>
+                <el-button type="primary" icon="el-icon-plus" @click="addLottery" style="background: #fa7216; color: #ffffff; border-color: #fa7216;">新增活动</el-button>
+            </el-form-item>
+        </el-form>
+        <div class="g-card">
+            <el-table
+                :data="tableData"
+            >
+                <el-table-column type="index" width="55"></el-table-column>
+                <el-table-column prop="a" label="活动名称"></el-table-column>
+                <el-table-column prop="a" label="新建时间"></el-table-column>
+                <el-table-column prop="a" label="活动类型"></el-table-column>
+                <el-table-column prop="a" label="奖品"></el-table-column>
+                <el-table-column prop="a" label="参与用户"></el-table-column>
+                <el-table-column prop="a" label="活动时间"></el-table-column>
+                <el-table-column prop="a" label="中奖人数"></el-table-column>
+                <el-table-column prop="a" label="状态"></el-table-column>
+                <el-table-column prop="a" label="操作人"></el-table-column>
+                <el-table-column label="操作" width="200">
+                    <template slot-scope="scope">
+                        <el-button type="text" @click="handleClose(scope.row)">关闭</el-button>
+                        <el-button type="text" @click="handleStart(scope.row)">开启</el-button>
+                        <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
+                        <el-button type="text" @click="handleShare(scope.row)">转发企微</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+    </div>
+</template>
+
+<script>
+import * as api from '@/api/task'
+export default {
+    name: "lotteryList",
+    data() {
+        return {
+            lotteryForm: {
+                type: ''
+            },
+            loading: false,
+            tableData: [{
+                a: 1
+            }]
+        }
+    },
+    created() {
+
+    },
+    methods: {
+        initList() {
+
+        },
+        addLottery() {
+            this.$router.push({
+                path: 'add'
+            })
+        },
+        handleClose(row) {
+
+        },
+        handleStart(row) {
+
+        },
+        handleEdit(row) {
+
+        },
+        handleShare(row) {
+
+        }
+    }
+}
+</script>
+
+<style scoped>
+
+</style>