Authored by huangyi

Merge branch 'feature/wheel-surf' of http://git.yoho.cn/fe/yoho-activity-platfor…

…m into feature/wheel-surf
... ... @@ -2,7 +2,7 @@ import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
import App from 'vue@/App.vue';
import {create, list, conf} from 'vue@/wheel-surf';
import {create, list, conf, prize} from 'vue@/wheel-surf';
import 'admin/wheel-surf.page.css';
import 'iview/dist/styles/iview.css';
... ... @@ -14,7 +14,8 @@ const router = new VueRouter({
routes: [
{path: '/admin/wheelSurf', name: 'list', component: list},
{path: '/admin/wheelSurf/conf', name: 'conf', component: conf},
{path: '/admin/wheelSurf/create', name: 'create', component: create}
{path: '/admin/wheelSurf/create', name: 'create', component: create},
{path: '/admin/wheelSurf/prizeSent', name: 'prizeSent', component: prize},
],
mode: 'history'
});
... ...
import list from './list';
import conf from './conf';
import create from './create';
import prize from './prize-sent-list';
export {
list,
conf,
create
create,
prize
}
... ...
... ... @@ -52,6 +52,20 @@
}
}, '配置'),
h('Button', {
props: {
type: 'success',
size: 'small'
},
style: {
marginRight: '5px'
},
on: {
click: () => {
this.prizeSent(row.id);
}
}
}, '中奖一览'),
h('Button', {
props: {
type: 'error',
size: 'small'
... ... @@ -61,7 +75,7 @@
this.delete(row.id);
}
}
}, '删除'),
}, '删除')
]);
}
}
... ... @@ -76,6 +90,9 @@
conf(actId) {
this.$router.push({name: 'conf', query: {actId}});
},
prizeSent(actId) {
this.$router.push({name: 'prizeSent', query: {actId}});
},
delete(id) {
this.$Modal.warning({
title: '删除',
... ...
<template>
<div class="list">
<Table :columns="columns1" :data="data"></Table>
</div>
</template>
<script>
module.exports = {
data() {
return {
columns1: [
{
title: '用户UID',
key: 'id'
},
{
title: '奖品类型',
key: 'title'
},
{
title: '奖品名称',
key: 'startTime',
render: (h, {row}) => {
return h('span', {}, moment(row.startTime * 1000).format('YYYY-MM-DD HH:mm:ss '));
}
},
{
title: '中奖时间',
key: 'endTime',
render: (h, {row}) => {
return h('span', {}, moment(row.endTime * 1000).format('YYYY-MM-DD HH:mm:ss '));
}
}
],
data: []
};
},
methods: {
list() {
$.ajax({
url: '/admin/wheelSurf/api/prizeSent',
}).then(res => {
this.data = res.data;
});
}
},
created() {
this.list();
}
};
</script>
<style lang="scss">
.activity-list {
}
.create-btn {
margin-bottom: 10px;
}
</style>
... ...