You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
volunteer-pc/src/views/volunteer/gxhzs/mygxhzs/index.vue

196 lines
5.3 KiB

2 years ago
<template>
<div class="app-container" ref="main">
2 years ago
<div ref="search" class="search">
<MyInput v-model="queryParams.name" @clickSearch="handleSearch" />
2 years ago
</div>
2 years ago
<ul class="book-main" :style="listStyle" v-if="certificatesList.length > 0">
<li
v-for="(item, index) in certificatesList"
:key="item.id"
:style="{ marginBottom: isLastRow(index) ? '0px' : '' }"
2 years ago
>
2 years ago
<el-image
style="width: 100%; height: 87%"
:src="baseUrl + item.cover"
fit="fill"
>
</el-image>
<div class="operate">
<div class="integral">
{{ item.certificateName }}
</div>
<div class="operate-child">
<el-button
type="text"
size="mini"
style="color: #909399"
@click="handleInfo(item)"
>查看</el-button
>
</div>
</div>
</li>
</ul>
<div v-if="certificatesList.length == 0" :style="listStyle" class="noData">
<el-empty description="暂无证书"></el-empty>
</div>
2 years ago
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
2 years ago
<!-- 查看 -->
<el-dialog :visible.sync="infoShow" width="600px" append-to-body>
2 years ago
<div slot="title" class="dialog-title">
<span class="title-line"></span>
2 years ago
查看
2 years ago
</div>
<div class="conversionInfo">
<div class="basicInfo">
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>证书详情</span>
</div>
<div class="info">
<div class="lists">
<div class="list-left">
<div>证书名称</div>
2 years ago
<div>{{ form.certificateName }}</div>
2 years ago
</div>
<div class="list-right">
2 years ago
<div>志愿者</div>
2 years ago
<div>{{ form.userName }}</div>
2 years ago
</div>
</div>
<div class="lists">
<div class="list-left">
<div>兑换时间</div>
2 years ago
<div>{{ form.createTime }}</div>
2 years ago
</div>
<div class="list-left">
2 years ago
<div>状态</div>
<div>{{ form.status == 1 ? "已发放" : "未发放" }}</div>
2 years ago
</div>
</div>
</div>
</div>
2 years ago
<div class="logisticsInfo" v-show="form.type == 2">
2 years ago
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
2 years ago
<span>纸制证书</span>
2 years ago
</div>
<div class="info">
<div class="lists">
<div class="list-left">
2 years ago
<div>快递公司</div>
2 years ago
<div>{{ form.courierCompanies }}</div>
2 years ago
</div>
<div class="list-right">
2 years ago
<div>快递单号</div>
2 years ago
<div>{{ form.trackingNumber }}</div>
2 years ago
</div>
</div>
</div>
</div>
2 years ago
<div class="logisticsInfo" v-show="form.type == 1">
<div class="title">
<img src="@/assets/images/huodong.png" alt="" />
<span>电子证书</span>
</div>
<div class="info"></div>
</div>
2 years ago
</div>
</el-dialog>
</div>
</template>
<script>
import {
2 years ago
dsbrecordsList,
dsbrecordsInfo,
2 years ago
} from "@/api/volunteer/gxhzs/hdzsff/index.js";
export default {
data() {
return {
2 years ago
listStyle: {
height: 0,
overflowY: "auto",
},
infoShow: false,
baseUrl: process.env.VUE_APP_BASE_API,
certificatesList: [],
2 years ago
loading: false,
2 years ago
tableData: [],
total: 0,
2 years ago
queryParams: {
2 years ago
status: 1,
UId: undefined,
certificateName: undefined,
2 years ago
pageNum: 1,
2 years ago
pageSize: 10,
2 years ago
},
2 years ago
form: {},
rules: {},
2 years ago
};
},
created() {
2 years ago
this.queryParams.UId = this.$store.getters.userId;
2 years ago
// //给表格一个固定值
this.$nextTick(() => {
2 years ago
this.listStyle.height =
this.$refs.main.offsetHeight -
40 -
this.$refs.search.offsetHeight -
42 +
"px";
2 years ago
this.getList();
});
},
methods: {
2 years ago
isLastRow(index) {
const rowCount = Math.ceil(this.certificatesList.length / 5);
const row = Math.floor(index / 5);
return row === rowCount - 1;
},
/**搜索 */
handleSearch(keyWord) {
this.queryParams = {
status: 1,
UId: this.$store.getters.userId,
certificateName: keyWord,
pageNum: 1,
pageSize: 10,
};
this.getList();
},
/** 查询证书管理列表 */
getList() {
this.loading = true;
dsbrecordsList(this.queryParams).then((response) => {
this.certificatesList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/**查看 */
/**查详情 */
async handleInfo(row) {
let res = await this.getInfo(row.id);
this.form = res.data;
this.infoShow = true;
2 years ago
},
2 years ago
async getInfo(id) {
let res = await dsbrecordsInfo(id);
return res;
2 years ago
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/myTable.scss";
</style>