活动管理
This commit is contained in:
@@ -8,7 +8,15 @@
|
||||
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')" >创建活动</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict">
|
||||
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current"
|
||||
:size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict">
|
||||
<el-table-column slot="qrcode" width="200px" label="二维码" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="qrcode">
|
||||
<el-button type="text" @click="qrcode(row.qrCode, row.id)">{{ row.qrCode ? '预览' : '生成' }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" @click.native="toAdd(row.id)">详情</el-button>
|
||||
@@ -17,6 +25,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<div class="qrCode" v-viewer="{movable: true}" v-show="false">
|
||||
<img :src="img">
|
||||
</div>
|
||||
</template>
|
||||
</ai-list>
|
||||
</section>
|
||||
@@ -37,6 +48,8 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
tableData: [],
|
||||
img: '',
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -52,6 +65,7 @@ export default {
|
||||
{prop: "intoBegintime", label: "开始结束时间", align: "center", render: (h, {row}) => h('p',{textAlign:'center'},
|
||||
`${row.intoBegintime}至${row.exitEndtime}`)},
|
||||
{prop: "status", label: "活动状态", align: "center",dict:"activityStatus"},
|
||||
{ slot: "qrcode"},
|
||||
{ slot: "options", },
|
||||
]
|
||||
}
|
||||
@@ -77,6 +91,26 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
qrcode (qrcode, id) {
|
||||
if (!qrcode) {
|
||||
this.isLoading = true
|
||||
this.instance.post(`/appactivityinfo/generateQrCode?id=${id}&width=400&height=400`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('二维码生成成功!')
|
||||
this.getList()
|
||||
}
|
||||
this.isLoading = false
|
||||
})
|
||||
} else {
|
||||
this.img = qrcode
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
const viewer = this.$el.querySelector('.qrCode').$viewer
|
||||
viewer.view()
|
||||
}, 600)
|
||||
})
|
||||
}
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm('确定删除该活动?').then(() => {
|
||||
this.instance.post(`/appactivityinfo/delete?ids=${id}`).then(res=>{
|
||||
|
||||
Reference in New Issue
Block a user