Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
nongzhenli committed Jul 2, 2018
1 parent 7cee2e9 commit 7912d96
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 40 deletions.
49 changes: 29 additions & 20 deletions element/data.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
{
"code": 20000,
"data": {
"items": [{
"id": "1",
"name": "桂林九宫格抽奖活动",
"type": "报名抽奖",
"status": 0,
"author": "cc",
"create_time": "1980-04-13 21:14:41",
"pageviews": 786
},
{
"id": "2",
"name": "桂林安格贝妮公众号吸粉",
"type": "公众号吸粉",
"status": 1,
"author": "大黑",
"create_time": "1980-04-13 21:14:41",
"pageviews": 786
}
]
"items": [
{
"user_id": "1",
"custname": "大黑",
"nickname": "big黑钦",
"mobile": 13132777334,
"status": "已完成",
"parent_id": 0,
"parent_name": "cc",
"complete_time": "04-13 21:14",
"sign_time": "04-16 09:14",
"get_time": "04-20 16:01",
"create_time": "04-10 21:14"
},
{
"user_id": "2",
"custname": "大秦",
"nickname": "VIP秦",
"mobile": 13132777335,
"status": "关注",
"parent_id": 1,
"parent_name": "大黑",
"complete_time": "04-13 21:14",
"sign_time": "04-16 09:14",
"get_time": "04-20 16:01",
"create_time": "04-12 21:14"
}
]
}
}
}
3 changes: 1 addition & 2 deletions element/src/api/marketing.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ export function getMarktingNumber(params) {
method: 'get',
params
})
}

}
2 changes: 2 additions & 0 deletions element/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const constantRouterMap = [
component: Layout,
redirect: '/example/table',
name: 'Example',
hidden: true,
meta: { title: 'Example', icon: 'example' },
children: [
{
Expand All @@ -61,6 +62,7 @@ export const constantRouterMap = [

{
path: '/form',
hidden: true,
component: Layout,
children: [
{
Expand Down
87 changes: 86 additions & 1 deletion element/src/views/marketing/activity.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,81 @@
<template>
<div class="app-container view-marketing-activity">
test
<el-table :data="list"
v-loading.body="listLoading"
element-loading-text="Loading"
stripe
border
fit
highlight-current-row
header-row-class-name="thead-row__header">
<el-table-column align="left"
label='序号'
width="95">
<template slot-scope="scope">
{{scope.$index}}
</template>
</el-table-column>
<el-table-column label="昵称"
width="120"
align="left">
<template slot-scope="scope">
{{scope.row.nickname}}
</template>
</el-table-column>
<el-table-column label="姓名"
class-name="el-table-cell__activity-name"
width="100">
<template slot-scope="scope">
{{scope.row.custname}}
<!-- <router-link :to="'activity/'+ scope.row.id "></router-link> -->
</template>
</el-table-column>
<el-table-column label="手机号码"
width="110"
align="left">
<template slot-scope="scope">
{{scope.row.mobile}}
</template>
</el-table-column>

<el-table-column label="奖品名称"
width="150"
align="left">
<template slot-scope="scope">
{{scope.row.pageviews}}
</template>
</el-table-column>
<el-table-column label="操作人"
width="110"
align="left">
<template slot-scope="scope">
<span>{{scope.row.author}}</span>
</template>
</el-table-column>
<el-table-column align="left"
prop="created_at"
label="开始时间"
max-width="150">
<template slot-scope="scope">
<span>{{scope.row.create_time}}</span>
</template>
</el-table-column>
<el-table-column align="left"
prop="created_at"
label="结束时间">
<template slot-scope="scope">
<span>N/A</span>
</template>
</el-table-column>
<el-table-column align="left"
prop="created_at"
label="创建时间"
max-width="150">
<template slot-scope="scope">
<span>{{scope.row.create_time}}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>

Expand All @@ -9,11 +84,16 @@ import { getMarktingNumber } from '@/api/marketing'
export default {
data() {
return {
list: null,
listLoading: true
}
},
created() {
this.listLoading = true
getMarktingNumber({ act_id: 1 }).then(response => {
console.log(response);
this.list = response.data.items
this.listLoading = false
})
},
mounted() {
Expand All @@ -22,5 +102,10 @@ export default {
}
</script>
<style lang="less">
.el-table__header-wrapper {
.thead-row__header {
color: #333;
}
}
</style>

38 changes: 21 additions & 17 deletions element/src/views/marketing/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
<el-table :data="list"
v-loading.body="listLoading"
element-loading-text="Loading"
border
stripe
fit
highlight-current-row
header-row-class-name="thead-row__header">
<el-table-column align="center"
<el-table-column align="left"
label='序号'
width="95">
<template slot-scope="scope">
Expand All @@ -23,7 +22,7 @@
</el-table-column>
<el-table-column label="活动类型"
width="160"
align="center"
align="left"
prop="type"
:filters="[{text: '报名抽奖', value: '报名抽奖'}, {text: '公众号吸粉', value: '公众号吸粉'}]"
:filter-method="filterHandler"
Expand All @@ -32,44 +31,44 @@
{{scope.row.type}}
</template>
</el-table-column>
<el-table-column label="报名量(人)"
<el-table-column label="报名量"
width="110"
align="center">
align="left">
<template slot-scope="scope">
{{scope.row.pageviews}}
{{scope.row.pageviews}}
</template>
</el-table-column>
<el-table-column label="支付量(人)"
<el-table-column label="支付量"
width="110"
align="center">
align="left">
<template slot-scope="scope">
{{scope.row.pageviews}}
{{scope.row.pageviews}}
</template>
</el-table-column>
<el-table-column label="支付总金额(元)"
<el-table-column label="支付总金额"
width="150"
align="center">
align="left">
<template slot-scope="scope">
{{scope.row.pageviews}}
{{scope.row.pageviews}}
</template>
</el-table-column>

<el-table-column class-name="status-col"
label="活动状态"
width="110"
align="center">
align="left">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{scope.row.status| statusFilter | statusNameFilter}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作人"
width="110"
align="center">
align="left">
<template slot-scope="scope">
<span>{{scope.row.author}}</span>
</template>
</el-table-column>
<el-table-column align="center"
<el-table-column align="left"
prop="created_at"
label="开始时间"
max-width="150">
Expand All @@ -78,14 +77,14 @@
<span>{{scope.row.create_time}}</span>
</template>
</el-table-column>
<el-table-column align="center"
<el-table-column align="left"
prop="created_at"
label="结束时间">
<template slot-scope="scope">
<span>N/A</span>
</template>
</el-table-column>
<el-table-column align="center"
<el-table-column align="left"
prop="created_at"
label="创建时间"
max-width="150">
Expand Down Expand Up @@ -147,6 +146,11 @@ export default {
</script>

<style lang="less">
.el-table__header-wrapper {
.thead-row__header {
color: #333;
}
}
</style>


0 comments on commit 7912d96

Please sign in to comment.