From ef37c59e055a990ce247b265b27d3fcef430a243 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 15 八月 2025 10:19:18 +0800 Subject: [PATCH] first submit --- src/views/personalCenter/components/paperSampleBook.vue | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 297 insertions(+), 0 deletions(-) diff --git a/src/views/personalCenter/components/paperSampleBook.vue b/src/views/personalCenter/components/paperSampleBook.vue new file mode 100644 index 0000000..59e3116 --- /dev/null +++ b/src/views/personalCenter/components/paperSampleBook.vue @@ -0,0 +1,297 @@ +<template> + <div class="wrap" v-loading="loading"> + <el-empty + description="鏆傛棤鏁版嵁" + class="empty" + :image-size="200" + v-if="orderList.length == 0" + ></el-empty> + <template v-else> + <div class="bookItem" v-for="(item, index) in orderList" :key="index"> + <div class="orderInformation"> + <span class="primaryTxt" v-if="item.state == 'Normal'" + >瀹℃牳鐘舵�侊細 + <template>閫氳繃</template> + </span> + <span class="toBeReviewed" v-else-if="item.state == 'WaitAudit'" + >瀹℃牳鐘舵�侊細 + <template>瀹℃牳涓�</template> + </span> + <span class="auditFailed" v-else-if="item.state == 'Reject'" + >瀹℃牳鐘舵�侊細 + <template>瀹℃牳澶辫触</template> + </span> + <span> + <span class="c999">鐢宠鏃ユ湡锛�</span> + {{ item.createDate }}</span + > + <div class="reason" v-if="item.state == 'Reject'"> + <p class="reasonIntroduction"> + <span class="c999">鐞嗙敱锛�</span> + <span class="reasonContent"> + {{ item.feedBack.reason ? item.feedBack.reason : "-" }} + </span> + </p> + </div> + <span v-if="item.state == 'Normal'"> + <span class="c999">蹇�掑崟鍙凤細</span> + {{ item.feedBack.mailNum || "-" }}</span + > + <span v-if="item.state == 'Normal'"> + <span class="c999">蹇�掑叕鍙革細</span> + {{ item.feedBack.mailName || "-" }}</span + > + </div> + <div class="orderBookList"> + <div + v-for="(itemBook, index) in item.content" + style="cursor: pointer" + class="orderBook" + :key="index" + @click="toDetail(itemBook)" + > + <div class="wrapImg"> + <img class="autoImg" :src="itemBook.icon" alt="" /> + </div> + <p style="width: 150px" class="ellipsis" :title="itemBook.title"> + {{ itemBook.title }} + </p> + <p style="width: 150px" class="c999 ellipsis">{{ itemBook.author }}</p> + </div> + </div> + <div v-if="item.state == 'Reject'" @click="deleteItem(item)"> + <i class="el-icon-delete-solid red"></i> + </div> + </div> + <!-- 鍒嗛〉 --> + <div class="pageinateBox" v-if="orderList.length > 0"> + <el-pagination + @size-change=" + (val) => { + paginationData.limit = val; + getData(); + } + " + @current-change=" + (val) => { + paginationData.page = val; + getData(); + } + " + background="" + :current-page="paginationData.page - 0" + :page-size="paginationData.limit" + prev-text="涓婁竴椤�" + next-text="涓嬩竴椤�" + layout="total, prev, pager, next, slot, jumper" + :total="paginationData.totalCount" + > + </el-pagination> + </div> + </template> + </div> +</template> +<script> +export default { + data() { + return { + orderList: [], + orderBookList: [], + loading: true, + paginationData: { + page: 1, + totalCount: 0, + limit: 5, + totalPage: 0, + }, + }; + }, + created() { + this.getData(); + }, + methods: { + getData() { + this.loading = true; + let { limit, page } = this.paginationData; + + const data = { + start: limit * page - limit, + size: limit, + sort: { + field: "createDate", + type: "Desc", + }, + appRefCode: this.config.appRefCode, + topicIdOrRefCode: this.config.refCodes.applyEntityBook, + }; + this.MG.ugc.getTopicMessageList(data).then((res) => { + this.loading = false; + try { + this.paginationData.totalCount = res.totalSize; + + if (res && res.datas.length > 0) { + let list = []; + for (let i = 0; i < res.datas.length; i++) { + const ele = res.datas[i]; + ele.createDate = ele.createDate.split("T")[0]; + if (ele.content) { + ele.content = JSON.parse(ele.content); + } + if (ele.feedBack) { + ele.feedBack = JSON.parse(ele.feedBack); + } + list.push(ele); + } + this.orderList = list; + } + } catch (error) { + this.orderList = []; + } + }); + }, + toDetail(row) { + console.log(row); + if (row.id && row.cmsPath) { + let url = this.$router.resolve({ + name: "teachingServices-detail", + query: { + id: row.id, + cmsPath: row.cmsPath, + }, + }); + window.open(url.href, "_blank"); + } + }, + deleteItem(item) { + this.$confirm("纭畾绉婚櫎鍚楋紵", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + const data = { + messageIds: [item.id], + }; + this.MG.ugc.delTopicMessage(data).then((res) => { + if (res) { + this.$message({ + type: "success", + message: "宸茬Щ闄よ绾歌川鏍蜂功!", + }); + this.getData(); + } + }); + }) + .catch(() => { + this.$message({ + type: "fail", + message: "鍙栨秷鎿嶄綔!", + }); + }); + }, + }, +}; +</script> +<style lang="less" scoped> +.wrap { + padding: 40px; + .tips { + padding: 20px; + background: #f2f7f4; + border-radius: 4px; + font-size: 14px; + color: #666666; + } + .bookItem { + border-bottom: 1px solid #eeeeee; + padding-bottom: 40px; + // margin-bottom: 40px; + .spaceBetween { + width: 100%; + display: flex; + justify-content: space-between; + align-items: flex-end; + font-size: 18px; + font-weight: 700; + line-height: 24px; + } + .orderInformation { + background: #f2f7f4; + border-radius: 4px; + padding: 20px; + font-size: 16px; + color: #333333; + margin: 30px 0; + .auditFailed { + color: #e50021; + } + .toBeReviewed { + color: #d18252; + } + span { + display: inline-block; + width: 330px; + line-height: 40px; + } + .c999 { + display: inline; + color: #999; + } + .reason { + display: flex; + line-height: 28px; + padding: 20px 0; + .reasonIntroduction { + width: 590px; + display: inline-block; + line-height: 22px; + .reasonContent { + display: inline; + width: 100%; + line-height: 30px; + } + } + } + } + .orderBookList { + display: flex; + justify-content: flex-start; + flex-wrap: wrap; + font-size: 16px; + color: #333; + .orderBook { + margin: 0 15px; + } + .wrapImg { + position: relative; + width: 150px; + height: 200px; + background-color: #f2f2f2; + border: 1px solid #e6e6e6; + } + > div > p { + margin: 10px 0; + } + .c999 { + color: #999; + } + } + .red { + font-size: 16px; + color: #e50021; + float: right; + cursor: pointer; + } + } + .pageinateBox { + text-align: center; + padding: 40px 0; + :deep(.el-pagination.is-background .btn-next) { + padding: 0 10px; + } + :deep(.el-pagination.is-background .btn-prev) { + padding: 0 10px; + } + } +} +</style> -- Gitblit v1.9.1