parent
b98e7e80ea
commit
f6b1e98ecf
@ -1,172 +1,120 @@
|
||||
<!--
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: JC9527
|
||||
* @Date: 2023-09-18 10:08:30
|
||||
* @LastEditors: JC9527
|
||||
* @LastEditTime: 2023-09-24 10:33:30
|
||||
-->
|
||||
<template>
|
||||
<div class="mainBox">
|
||||
<div class="convert-topBox">
|
||||
<my-input @changeInput="changeInput" placeholder="请输入证书名称" @changeValue="changeValue"></my-input>
|
||||
<div class="app-container" ref="main">
|
||||
<div class="search" ref="search">
|
||||
<MyInput v-model="queryParams.name" @clickSearch="handleSearch" />
|
||||
</div>
|
||||
<div class="convert-content" v-loading="loading">
|
||||
<div class="integral-lists">
|
||||
<div class="list" v-for="item in certificateList">
|
||||
<div class="list-top" :style="{'background-image': 'url(' + basicUrl + item.cover + ')'}"></div>
|
||||
<div class="list-bottom">
|
||||
<span class="bottom-left">{{ item.name }}</span>
|
||||
<span class="bottom-right" @click="conversion(item)">兑换</span>
|
||||
|
||||
<ul class="book-main" :style="{ height: tableHeigth + 'px' }">
|
||||
<li v-for="item in certificatesList" :key="item.id">
|
||||
<div class="integral-num">50</div>
|
||||
<el-image
|
||||
style="width: 100%; height: 87%"
|
||||
:src="baseUrl + item.cover"
|
||||
fit="fill"
|
||||
:preview-src-list="[`${baseUrl + item.cover}`]"
|
||||
>
|
||||
</el-image>
|
||||
<div class="operate">
|
||||
<div class="integral">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<div class="operate-child">
|
||||
<div class="exchange-btn" @click="conversion(item)">兑 换</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import myInput from "@/views/components/myInput/index.vue"
|
||||
import myPagination from "@/views/components/myPagination/index.vue"
|
||||
import { listCertificates } from "@/api/volunteer/gxhzs/gxhzsgl/index.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
total:0,
|
||||
certificateList:[],
|
||||
basicUrl:process.env.VUE_APP_BASE_API,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
certificatesList: [],
|
||||
tableHeigth: 0,
|
||||
loading: false,
|
||||
tableData: [],
|
||||
total: 0,
|
||||
queryParams: {
|
||||
name: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loading:false,
|
||||
value:{
|
||||
name:''
|
||||
},
|
||||
isClick:false,
|
||||
form: {},
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
myInput,myPagination
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
created() {
|
||||
// //给表格一个固定值
|
||||
this.$nextTick(() => {
|
||||
this.tableHeigth =
|
||||
this.$refs.main.offsetHeight - 40 - this.$refs.search.offsetHeight - 42;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 页码切换
|
||||
pagesChange(pages){
|
||||
this.queryParams = pages;
|
||||
this.getList()
|
||||
/**兑换 */
|
||||
conversion(item) {
|
||||
console.log(item);
|
||||
},
|
||||
// 点击搜索输入框的值
|
||||
changeInput(e){
|
||||
this.isClick = true;
|
||||
this.queryParams= {
|
||||
/**搜索 */
|
||||
handleSearch(keyWord) {
|
||||
this.queryParams = {
|
||||
name: keyWord,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
this.value.name = e;
|
||||
this.getList()
|
||||
},
|
||||
// 监听输入框是否清空
|
||||
changeValue(value){
|
||||
if(this.isClick && value == ''){
|
||||
this.value.name = '';
|
||||
this.pages= {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
this.getList();
|
||||
this.isClick = false;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
// 点击兑换
|
||||
conversion(item){
|
||||
console.log(item)
|
||||
},
|
||||
getList(){
|
||||
/** 查询证书管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let obj = { ...this.queryParams,...this.value }
|
||||
listCertificates(obj).then((response) => {
|
||||
this.certificateList = response.rows;
|
||||
listCertificates(this.queryParams).then((response) => {
|
||||
this.certificatesList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
type: null,
|
||||
cover: null,
|
||||
content: null,
|
||||
datetime: null,
|
||||
serviceDuration: null,
|
||||
createId: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateId: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
userId: null,
|
||||
deptId: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mainBox {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 10px 10px 0 0;
|
||||
background-color: #fff;
|
||||
padding: 0 20px 10px 20px;
|
||||
box-shadow: 0px 0px 15px 0px rgba(229,212,212,0.58);
|
||||
.convert-topBox {
|
||||
padding: 20px 0 0 0;
|
||||
}
|
||||
.convert-content {
|
||||
height: 100%;
|
||||
.integral-lists {
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
margin-top: 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 19%);
|
||||
grid-column-gap: 25px;
|
||||
grid-row-gap: 25px;
|
||||
height: 80%;
|
||||
.list {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background: linear-gradient(0deg, #EFE6D9, #DDC9AC);
|
||||
box-shadow: 0px 3px 15px 0px rgba(184,184,184,0.22);
|
||||
border-radius: 10px;
|
||||
.list-top {
|
||||
// background: url('../../../assets/images/icon1.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
height: 80%;
|
||||
width: 100%;
|
||||
}
|
||||
// .top-two {
|
||||
// background: url('../../../assets/images/icon2.png') no-repeat center center;
|
||||
// background-size: 100% 100%;
|
||||
// }
|
||||
// .top-three {
|
||||
// background: url('../../../assets/images/icon3.png') no-repeat center center;
|
||||
// background-size: 100% 100%;
|
||||
// }
|
||||
.list-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 20px;
|
||||
.bottom-left {
|
||||
font-size: 16px;
|
||||
font-family: FZDaBiaoSong-B06S;
|
||||
font-weight: 400;
|
||||
color: #4D4949;
|
||||
}
|
||||
.bottom-right {
|
||||
padding: 3px 15px;
|
||||
border-radius: 4px;
|
||||
background-color: rgba(249,86,95,0.1);
|
||||
font-size: 14px;
|
||||
font-family: 'Alibaba PuHuiTi';
|
||||
font-weight: 400;
|
||||
color: #F8414D;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.pagination {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@import "@/assets/styles/myTable.scss";
|
||||
</style>
|
||||
|
Loading…
Reference in new issue