From 75e366b1ba202dec9619e0407acb2ede41c38c6a Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期日, 24 八月 2025 19:31:58 +0800 Subject: [PATCH] 课程样式修改 --- src/views/personalCenter/teacherCertification.vue | 569 +++++++++++++++---------------- src/assets/main.css | 21 + src/views/personalCenter/class.vue | 6 src/views/personalCenter/myCollection.vue | 120 +++--- src/assets/images/personalCenter/collect-click.png | 0 src/views/personalCenter/config.ts | 44 +- src/views/personalCenter/index.vue | 74 ++- src/views/classManage/index.vue | 30 + src/views/personalCenter/userInfo.vue | 62 -- src/views/courseManage/components/class.vue | 44 +- src/layout/baseLayout.vue | 6 src/views/classManage/classHome.vue | 38 + src/views/personalCenter/activeCode.vue | 4 src/views/personalCenter/myApply.vue | 4 src/layout/components/footerPage.vue | 3 src/App.vue | 6 16 files changed, 517 insertions(+), 514 deletions(-) diff --git a/src/App.vue b/src/App.vue index 91dc281..53ed234 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,9 +7,3 @@ <template> <el-config-provider :locale="zhCn"> <RouterView /></el-config-provider> </template> - -<style scoped> -#app { - width: 100%; -} -</style> diff --git a/src/assets/images/personalCenter/collect-click.png b/src/assets/images/personalCenter/collect-click.png index 633b0a9..28091a3 100644 --- a/src/assets/images/personalCenter/collect-click.png +++ b/src/assets/images/personalCenter/collect-click.png Binary files differ diff --git a/src/assets/main.css b/src/assets/main.css index 9a30762..b14c702 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -15,6 +15,17 @@ outline: none; } +html, +body { + width: 100%; + height: 100%; +} + +#app { + width: 100%; + height: 100%; +} + /* 灞呬腑甯冨眬 */ .contentBox { width: 1200px; @@ -52,11 +63,11 @@ } .titleBox { - background: #d8f7e6; padding: 8px 10px; font-weight: 700; - color: #00873c; + color: #019e58; font-size: 14px; + padding: 10px; box-sizing: border-box; } @@ -222,8 +233,12 @@ } .wait, .main { - color: #019e58; + color: #fc9b1e; } .grey { color: #949494; } +.mainbg{ + background:#00873c; + color:#fff; +} \ No newline at end of file diff --git a/src/layout/baseLayout.vue b/src/layout/baseLayout.vue index 8ebe117..847ca3f 100644 --- a/src/layout/baseLayout.vue +++ b/src/layout/baseLayout.vue @@ -3,8 +3,8 @@ <Header class="header"></Header> <div class="layoutContentBox" id="layout"> <RouterView /> - <Footer class="footer"></Footer> </div> + <Footer class="footer"></Footer> <login ref="loginRef"></login> </div> </template> @@ -35,14 +35,13 @@ <style lang="less" scoped> .layoutBox { width: 100%; - height: 100vh; + height: 100%; display: flex; flex-direction: column; background-color: #fff; .layoutContentBox { flex: 1; - height: auto; } .header { @@ -54,7 +53,6 @@ @media screen and (min-width: 1200px) { .layoutContentBox { flex: 1; - overflow: auto; } } </style> diff --git a/src/layout/components/footerPage.vue b/src/layout/components/footerPage.vue index 184da08..4ebce5c 100644 --- a/src/layout/components/footerPage.vue +++ b/src/layout/components/footerPage.vue @@ -115,6 +115,9 @@ .pageFooter { background: #444444; background-image: url('@/assets/images/xiehe/home/footer-bg.png'); + background-repeat: no-repeat; + background-position: center; + background-size: 100% 100%; .footerContent { padding: 30px 0; .infoBox { diff --git a/src/views/classManage/classHome.vue b/src/views/classManage/classHome.vue index 9a0dfad..f4fa90a 100644 --- a/src/views/classManage/classHome.vue +++ b/src/views/classManage/classHome.vue @@ -26,8 +26,8 @@ </div> <div class="infoBox"> <div class="main">{{ currentClass?.bookName }}</div> - <div class="job">浣滆�咃細{{ classInfo?.author ?? '-' }}</div> - <div class="job">ISBN锛歿{ classInfo?.isbn ?? '-' }}</div> + <div class="job">浣滆�咃細{{ currentClass?.author ?? '-' }}</div> + <div class="job">ISBN锛歿{ currentClass?.isbn ?? '-' }}</div> </div> </div> <div class="line"></div> @@ -283,10 +283,13 @@ .getCourseClass({ ClassIdOrRefCode: String(classInfo.id), }) - .then((res: any) => { + .then(async (res: any) => { if (res) { + const detail = await getBookDetail(res.linkProductDto.product.id) res.bookName = res.linkProductDto.product.name - res.bookIcon = getPublicImage(res.linkProductDto.product.icon, 100) + res.bookIcon = detail.icon ?? defaultImg + res.author = detail.author + res.isbn = detail.isbn res.classTime = moment(res.beginDate).format('YYYY.MM.DD') + '--' + @@ -507,9 +510,30 @@ console.log(e) }) } +// 鑾峰彇鏁欐潗璇︽儏 +const getBookDetail = async (id: string) => { + const query = { + path: '*', + queryType: '*', + productId: id, + coverSize: { + height: 300, + width: 210, + }, + fields: { + author: [], + isbn: [], + }, + } + const res = await MG.store.getProductDetail(query) + return res.datas ?? null +} </script> <style lang="less" scoped> +.main { + color: #019e58; +} .nullBox { width: 100%; display: flex; @@ -532,6 +556,7 @@ height: 190px; margin-top: 30px; border-radius: 10px; + border: 1px solid #019e58; .title { width: 80px; text-align: center; @@ -626,8 +651,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px 0; - font-size: 16px; .title { width: 100%; display: flex; @@ -665,7 +688,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px 0; .border { width: 4px; height: 23px; @@ -676,7 +698,7 @@ } .notBox { width: 100%; - height: 100px; + height: 120px; display: flex; align-items: center; justify-content: center; diff --git a/src/views/classManage/index.vue b/src/views/classManage/index.vue index 8495815..d9f0324 100644 --- a/src/views/classManage/index.vue +++ b/src/views/classManage/index.vue @@ -90,9 +90,29 @@ path.value = to.path }) -onMounted(() => { +// 鑾峰彇鏁欐潗璇︽儏 +const getBookDetail = async (id: string) => { + const query = { + path: '*', + queryType: '*', + productId: id, + coverSize: { + height: 300, + width: 210, + }, + fields: { + author: [], + isbn: [], + }, + } + const res = await MG.store.getProductDetail(query) + return res.datas ?? null +} + +onMounted(async () => { classInfo.value = JSON.parse(route.query.classInfo) - classIcon.value = classInfo.value.icon ?? defaultImg + const detail = await getBookDetail(classInfo.value.bookId) + classIcon.value = detail.icon ?? defaultImg menu.forEach((item) => { if ('/' + item.path === path.value) { label.value = item.label @@ -173,6 +193,9 @@ flex: 1; height: auto; } + .main { + color: #019e58; + } .classContentBox { padding: 10px 40px; display: flex; @@ -198,7 +221,7 @@ margin-bottom: 10px; display: flex; .iconBox { - width: 90px; + width: 100px; height: 120px; img { width: 100%; @@ -212,6 +235,7 @@ .main { font-size: 16px; line-height: 20px; + color: #019e58; } .job { // padding:10px; diff --git a/src/views/courseManage/components/class.vue b/src/views/courseManage/components/class.vue index bac25b3..debe2a1 100644 --- a/src/views/courseManage/components/class.vue +++ b/src/views/courseManage/components/class.vue @@ -10,7 +10,7 @@ </div> <el-button type="primary" class="applyStartClasses" @click="applyClass">鐢宠寮�鐝�</el-button> </div> - <div class="classListBox" v-loading="pages.loading"> + <div class="classListBox" v-if="classList.length > 0" v-loading="pages.loading"> <div class="classItem" v-for="(item, index) in classList" :key="index"> <div class="itemHeader"> <div class="title">{{ item.name }}</div> @@ -137,7 +137,7 @@ page: 1, pageSize: 6, count: 0, - loading: true + loading: true, }) const searchData = () => { @@ -156,7 +156,7 @@ size: pages.pageSize, sort: { type: 'Desc', - field: 'CreateDate' + field: 'CreateDate', }, filterList: [], searchList: searchKey.value @@ -164,14 +164,14 @@ { keywords: searchKey.value, field: 'Name', - compareType: 'Contains' - } + compareType: 'Contains', + }, ] - : [] + : [], }) .then((res: any) => { pages.loading = false - pages.count = res.totalSize; + pages.count = res.totalSize classList.value = res.datas.map((item: any) => { return { ...item, @@ -179,7 +179,7 @@ id: item.id, icon: item.icon ? getPublicImage(item.icon, 80) : '', introduction: item.description, - reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason : '' + reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason : '', } }) refreshParent() @@ -191,7 +191,7 @@ formData.value = { name: '', num: '', - date: '' + date: '', } applyClassDialog.value = true } @@ -205,7 +205,7 @@ const formData = ref({ name: '', num: '', - date: '' + date: '', }) const submit = () => { @@ -221,7 +221,7 @@ endDate: moment(formData.value.date[1]).format('YYYY-MM-DD'), config: '', price: 0, - maxUserCount: formData.value.num + maxUserCount: formData.value.num, }) .then((res: any) => { if (res) { @@ -247,7 +247,7 @@ await toClipboard(text) ElMessage({ message: '澶嶅埗鎴愬姛', - type: 'success' + type: 'success', }) } catch (e) { console.error(e) @@ -257,7 +257,7 @@ // 鍒犻櫎鐝骇 const delClass = (item: any) => { const data = { - ids: [item.id] + ids: [item.id], } MG.edu .delCourseClass(data) @@ -265,7 +265,7 @@ if (res) { ElMessage({ message: '宸插垹闄�', - type: 'success' + type: 'success', }) getData() } @@ -273,7 +273,7 @@ .catch((err: any) => { ElMessage({ message: '鍒犻櫎澶辫触', - type: 'error' + type: 'error', }) console.log(err) }) @@ -284,7 +284,7 @@ page: 1, pageSize: 10, count: 0, - loading: false + loading: false, }) const courseListData = ref([]) @@ -335,14 +335,14 @@ if (item.applyState == 'WaitAudit') { ElMessage({ message: '姝e湪瀹℃牳涓�....', - type: 'warning' + type: 'warning', }) return false } if (item.applyState == 'Reject') { ElMessage({ message: '瀹℃牳鏈�氳繃', - type: 'warning' + type: 'warning', }) return false } @@ -356,13 +356,13 @@ bookId: bookData.id, author: bookData.author, isbn: bookData.isbn, - bookRefCode: bookData.refCode + bookRefCode: bookData.refCode, } let page = uRouter.resolve({ path: '/classManage', query: { - classInfo: JSON.stringify(classinfo) - } + classInfo: JSON.stringify(classinfo), + }, }) window.open(page.href, '_blank') } @@ -423,7 +423,7 @@ margin-top: 10px; font-size: 12px; background-color: #fff; - color: #3b93fe; + color: #019e58; padding: 0 6px; border-radius: 50px; overflow: hidden; diff --git a/src/views/personalCenter/activeCode.vue b/src/views/personalCenter/activeCode.vue index 169a009..8a5b72d 100644 --- a/src/views/personalCenter/activeCode.vue +++ b/src/views/personalCenter/activeCode.vue @@ -7,7 +7,7 @@ <el-input class="inputBox" v-model="activateCode" placeholder="璇疯緭鍏ユ縺娲荤爜"> <template #append> <el-button - style="background-color: #019e58; color: #fff" + style="background-color: #144941; color: #fff" @click="userActiveCodeGet" :loading="loading" >婵�娲�</el-button @@ -232,7 +232,7 @@ border: 1px solid #edecec; background: #edf4f2; .flex1 span { - color: #019e58; + color: #000; } } diff --git a/src/views/personalCenter/class.vue b/src/views/personalCenter/class.vue index f6a6dff..b614495 100644 --- a/src/views/personalCenter/class.vue +++ b/src/views/personalCenter/class.vue @@ -42,7 +42,9 @@ <template #footer> <div class="dialog-footer"> <el-button @click="dialogVisible = false"> 鍙栨秷 </el-button> - <el-button type="primary" @click="joinClass()"> 纭 </el-button> + <el-button type="primary" :disabled="!classDetail?.name" @click="joinClass()"> + 鍔犲叆 + </el-button> </div> </template> </el-dialog> @@ -394,7 +396,7 @@ margin-top: 10px; font-size: 12px; background-color: #fff; - color: #3b93fe; + color: #019e58; padding: 0 6px; border-radius: 50px; overflow: hidden; diff --git a/src/views/personalCenter/config.ts b/src/views/personalCenter/config.ts index 3d72291..e4b662a 100644 --- a/src/views/personalCenter/config.ts +++ b/src/views/personalCenter/config.ts @@ -9,16 +9,16 @@ </svg> `, }, - { - label: '璐墿杞�', - key: '2', - path: 'myCart', - icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> - <path - d="M1 2.68571C1 2.30701 1.32622 2 1.72862 2H2.27096C3.19434 2 3.74721 2.58422 4.06336 3.1273C4.27408 3.48932 4.42653 3.90919 4.54577 4.28933C4.57806 4.28694 4.61078 4.28571 4.64387 4.28571H16.7849C17.5914 4.28571 18.1738 5.01204 17.9527 5.74199L16.177 11.6017C15.8498 12.6818 14.8012 13.4266 13.6079 13.4266H7.82937C6.62618 13.4266 5.57145 12.6696 5.25303 11.5777L4.51422 9.04411L3.2915 5.15957L3.28952 5.15277C3.13825 4.63361 2.99629 4.14862 2.78534 3.78624C2.58048 3.43433 2.41718 3.37143 2.27096 3.37143H1.72862C1.32622 3.37143 1 3.06442 1 2.68571ZM5.92822 8.71113L6.6583 11.2147C6.80304 11.7111 7.28247 12.0551 7.82937 12.0551H13.6079C14.1503 12.0551 14.6269 11.7166 14.7758 11.2257L16.463 5.65714H4.96902L5.91484 8.66222C5.91997 8.67849 5.92442 8.69477 5.92822 8.71113ZM9.25768 16.1714C9.25768 17.1813 8.38781 18 7.3147 18C6.24162 18 5.37172 17.1813 5.37172 16.1714C5.37172 15.1615 6.24162 14.3429 7.3147 14.3429C8.38781 14.3429 9.25768 15.1615 9.25768 16.1714ZM7.80045 16.1714C7.80045 15.919 7.58297 15.7143 7.3147 15.7143C7.04643 15.7143 6.82895 15.919 6.82895 16.1714C6.82895 16.4239 7.04643 16.6286 7.3147 16.6286C7.58297 16.6286 7.80045 16.4239 7.80045 16.1714ZM16.0581 16.1714C16.0581 17.1813 15.1883 18 14.1151 18C13.042 18 12.1722 17.1813 12.1722 16.1714C12.1722 15.1615 13.042 14.3429 14.1151 14.3429C15.1883 14.3429 16.0581 15.1615 16.0581 16.1714ZM14.6009 16.1714C14.6009 15.919 14.3834 15.7143 14.1151 15.7143C13.8469 15.7143 13.6294 15.919 13.6294 16.1714C13.6294 16.4239 13.8469 16.6286 14.1151 16.6286C14.3834 16.6286 14.6009 16.4239 14.6009 16.1714Z" - /> -</svg>`, - }, +// { +// label: '璐墿杞�', +// key: '2', +// path: 'myCart', +// icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> +// <path +// d="M1 2.68571C1 2.30701 1.32622 2 1.72862 2H2.27096C3.19434 2 3.74721 2.58422 4.06336 3.1273C4.27408 3.48932 4.42653 3.90919 4.54577 4.28933C4.57806 4.28694 4.61078 4.28571 4.64387 4.28571H16.7849C17.5914 4.28571 18.1738 5.01204 17.9527 5.74199L16.177 11.6017C15.8498 12.6818 14.8012 13.4266 13.6079 13.4266H7.82937C6.62618 13.4266 5.57145 12.6696 5.25303 11.5777L4.51422 9.04411L3.2915 5.15957L3.28952 5.15277C3.13825 4.63361 2.99629 4.14862 2.78534 3.78624C2.58048 3.43433 2.41718 3.37143 2.27096 3.37143H1.72862C1.32622 3.37143 1 3.06442 1 2.68571ZM5.92822 8.71113L6.6583 11.2147C6.80304 11.7111 7.28247 12.0551 7.82937 12.0551H13.6079C14.1503 12.0551 14.6269 11.7166 14.7758 11.2257L16.463 5.65714H4.96902L5.91484 8.66222C5.91997 8.67849 5.92442 8.69477 5.92822 8.71113ZM9.25768 16.1714C9.25768 17.1813 8.38781 18 7.3147 18C6.24162 18 5.37172 17.1813 5.37172 16.1714C5.37172 15.1615 6.24162 14.3429 7.3147 14.3429C8.38781 14.3429 9.25768 15.1615 9.25768 16.1714ZM7.80045 16.1714C7.80045 15.919 7.58297 15.7143 7.3147 15.7143C7.04643 15.7143 6.82895 15.919 6.82895 16.1714C6.82895 16.4239 7.04643 16.6286 7.3147 16.6286C7.58297 16.6286 7.80045 16.4239 7.80045 16.1714ZM16.0581 16.1714C16.0581 17.1813 15.1883 18 14.1151 18C13.042 18 12.1722 17.1813 12.1722 16.1714C12.1722 15.1615 13.042 14.3429 14.1151 14.3429C15.1883 14.3429 16.0581 15.1615 16.0581 16.1714ZM14.6009 16.1714C14.6009 15.919 14.3834 15.7143 14.1151 15.7143C13.8469 15.7143 13.6294 15.919 13.6294 16.1714C13.6294 16.4239 13.8469 16.6286 14.1151 16.6286C14.3834 16.6286 14.6009 16.4239 14.6009 16.1714Z" +// /> +// </svg>`, +// }, { label: '鎴戠殑涔︽灦', key: '3', @@ -112,18 +112,18 @@ </g> </svg>`, }, - { - label: '鎴戠殑璁㈠崟', - key: '8', - path: 'myOrder', - icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> - <g id="Group 201"> - <path id="Vector" - d="M17.4571 4C17.4571 3.80109 17.5384 3.61032 17.6831 3.46967C17.8278 3.32902 18.024 3.25 18.2286 3.25C18.4332 3.25 18.6294 3.32902 18.7741 3.46967C18.9187 3.61032 19 3.80109 19 4V17.25C19 18.7687 17.7336 20 16.1714 20H3.82857C2.26643 20 1 18.7687 1 17.25V2.75C1 1.23125 2.26643 2.34375e-08 3.82857 0H18.2286C18.4332 4.19176e-09 18.6294 0.0790176 18.7741 0.21967C18.9187 0.360322 19 0.551088 19 0.75C19 0.948912 18.9187 1.13968 18.7741 1.28033C18.6294 1.42098 18.4332 1.5 18.2286 1.5H3.82857C3.65973 1.5 3.49254 1.53233 3.33655 1.59515C3.18056 1.65797 3.03882 1.75004 2.91943 1.86612C2.80004 1.98219 2.70534 2.11999 2.64073 2.27165C2.57611 2.4233 2.54286 2.58585 2.54286 2.75V17.25C2.54286 17.4142 2.57611 17.5767 2.64073 17.7284C2.70534 17.88 2.80004 18.0178 2.91943 18.1339C3.03882 18.25 3.18056 18.342 3.33655 18.4048C3.49254 18.4677 3.65973 18.5 3.82857 18.5H16.1714C16.3403 18.5 16.5075 18.4677 16.6635 18.4048C16.8194 18.342 16.9612 18.25 17.0806 18.1339C17.2 18.0178 17.2947 17.88 17.3593 17.7284C17.4239 17.5767 17.4571 17.4142 17.4571 17.25V4ZM5.88571 8.25C5.68112 8.25 5.4849 8.17098 5.34023 8.03033C5.19556 7.88968 5.11429 7.69891 5.11429 7.5C5.11429 7.30109 5.19556 7.11032 5.34023 6.96967C5.4849 6.82902 5.68112 6.75 5.88571 6.75H14.1143C14.3189 6.75 14.5151 6.82902 14.6598 6.96967C14.8044 7.11032 14.8857 7.30109 14.8857 7.5C14.8857 7.69891 14.8044 7.88968 14.6598 8.03033C14.5151 8.17098 14.3189 8.25 14.1143 8.25H5.88571ZM5.88571 12.25C5.68112 12.25 5.4849 12.171 5.34023 12.0303C5.19556 11.8897 5.11429 11.6989 5.11429 11.5C5.11429 11.3011 5.19556 11.1103 5.34023 10.9697C5.4849 10.829 5.68112 10.75 5.88571 10.75H11.0286C11.2332 10.75 11.4294 10.829 11.5741 10.9697C11.7187 11.1103 11.8 11.3011 11.8 11.5C11.8 11.6989 11.7187 11.8897 11.5741 12.0303C11.4294 12.171 11.2332 12.25 11.0286 12.25H5.88571Z" - /> - </g> -</svg>`, - }, +// { +// label: '鎴戠殑璁㈠崟', +// key: '8', +// path: 'myOrder', +// icon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> +// <g id="Group 201"> +// <path id="Vector" +// d="M17.4571 4C17.4571 3.80109 17.5384 3.61032 17.6831 3.46967C17.8278 3.32902 18.024 3.25 18.2286 3.25C18.4332 3.25 18.6294 3.32902 18.7741 3.46967C18.9187 3.61032 19 3.80109 19 4V17.25C19 18.7687 17.7336 20 16.1714 20H3.82857C2.26643 20 1 18.7687 1 17.25V2.75C1 1.23125 2.26643 2.34375e-08 3.82857 0H18.2286C18.4332 4.19176e-09 18.6294 0.0790176 18.7741 0.21967C18.9187 0.360322 19 0.551088 19 0.75C19 0.948912 18.9187 1.13968 18.7741 1.28033C18.6294 1.42098 18.4332 1.5 18.2286 1.5H3.82857C3.65973 1.5 3.49254 1.53233 3.33655 1.59515C3.18056 1.65797 3.03882 1.75004 2.91943 1.86612C2.80004 1.98219 2.70534 2.11999 2.64073 2.27165C2.57611 2.4233 2.54286 2.58585 2.54286 2.75V17.25C2.54286 17.4142 2.57611 17.5767 2.64073 17.7284C2.70534 17.88 2.80004 18.0178 2.91943 18.1339C3.03882 18.25 3.18056 18.342 3.33655 18.4048C3.49254 18.4677 3.65973 18.5 3.82857 18.5H16.1714C16.3403 18.5 16.5075 18.4677 16.6635 18.4048C16.8194 18.342 16.9612 18.25 17.0806 18.1339C17.2 18.0178 17.2947 17.88 17.3593 17.7284C17.4239 17.5767 17.4571 17.4142 17.4571 17.25V4ZM5.88571 8.25C5.68112 8.25 5.4849 8.17098 5.34023 8.03033C5.19556 7.88968 5.11429 7.69891 5.11429 7.5C5.11429 7.30109 5.19556 7.11032 5.34023 6.96967C5.4849 6.82902 5.68112 6.75 5.88571 6.75H14.1143C14.3189 6.75 14.5151 6.82902 14.6598 6.96967C14.8044 7.11032 14.8857 7.30109 14.8857 7.5C14.8857 7.69891 14.8044 7.88968 14.6598 8.03033C14.5151 8.17098 14.3189 8.25 14.1143 8.25H5.88571ZM5.88571 12.25C5.68112 12.25 5.4849 12.171 5.34023 12.0303C5.19556 11.8897 5.11429 11.6989 5.11429 11.5C5.11429 11.3011 5.19556 11.1103 5.34023 10.9697C5.4849 10.829 5.68112 10.75 5.88571 10.75H11.0286C11.2332 10.75 11.4294 10.829 11.5741 10.9697C11.7187 11.1103 11.8 11.3011 11.8 11.5C11.8 11.6989 11.7187 11.8897 11.5741 12.0303C11.4294 12.171 11.2332 12.25 11.0286 12.25H5.88571Z" +// /> +// </g> +// </svg>`, +// }, { label: '鎴戠殑鐢宠', key: '9', diff --git a/src/views/personalCenter/index.vue b/src/views/personalCenter/index.vue index 978d06c..9217fa1 100644 --- a/src/views/personalCenter/index.vue +++ b/src/views/personalCenter/index.vue @@ -1,43 +1,41 @@ <template> - <page> - <div class="contentBox"> - <div class="breadcrumbBox"> - <span>浣嶇疆锛�</span> - <el-breadcrumb :separator-icon="ArrowRight"> - <el-breadcrumb-item>涓汉涓績</el-breadcrumb-item> - <el-breadcrumb-item>{{ label }}</el-breadcrumb-item> - </el-breadcrumb> - </div> - <el-divider /> - <div class="personalPage clear"> - <div class="leftList fl"> - <ul class="menu"> - <li - v-for="item in listMenu" - :key="item.key" - @click="goRouter(item)" - :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + <div class="contentBox"> + <div class="breadcrumbBox"> + <span>浣嶇疆锛�</span> + <el-breadcrumb :separator-icon="ArrowRight"> + <el-breadcrumb-item>涓汉涓績</el-breadcrumb-item> + <el-breadcrumb-item>{{ label }}</el-breadcrumb-item> + </el-breadcrumb> + </div> + <el-divider /> + <div class="personalPage clear"> + <div class="leftList fl"> + <ul class="menu"> + <li + v-for="item in listMenu" + :key="item.key" + @click="goRouter(item)" + :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + > + <span + :style="{ + fill: `/${item.path}` === path ? '#fff' : '#000', + }" + v-html="item.icon" > - <span - :style="{ - fill: `/${item.path}` === path ? '#fff' : '#000', - }" - v-html="item.icon" - > - </span> - <span>{{ item.label }}</span> - </li> - </ul> - </div> - <div class="rightContent"> - <div> - <!-- 璁╀富浣撳仛瀛愯矾鐢辩殑鏄剧ず --> - <router-view /> - </div> + </span> + <span>{{ item.label }}</span> + </li> + </ul> + </div> + <div class="rightContent"> + <div> + <!-- 璁╀富浣撳仛瀛愯矾鐢辩殑鏄剧ず --> + <router-view /> </div> </div> </div> - </page> + </div> </template> <script setup lang="ts"> @@ -92,6 +90,12 @@ } </script> <style lang="less" scoped> +.homePage { + min-width: 1220px; + min-height: calc(100vh - 61.8%); + background-color: #fff; + padding-bottom: 100px; +} .breadcrumbBox { display: flex; padding: 20px; diff --git a/src/views/personalCenter/myApply.vue b/src/views/personalCenter/myApply.vue index 6bf18b6..cb67f0c 100644 --- a/src/views/personalCenter/myApply.vue +++ b/src/views/personalCenter/myApply.vue @@ -31,7 +31,9 @@ 璇曠敤鏈熼檺锛�<span>{{ item.updateDate }}</span> -- <span>{{ item.feedBack.endDate }}</span> </div> - <div style="color: orangered" v-if="item.isExpiry">闃呰鏈熼檺锛�<span>宸茶繃鏈�</span></div> + <div class="no" style="color: orangered" v-if="item.isExpiry"> + 闃呰鏈熼檺锛�<span>宸茶繃鏈�</span> + </div> <div class="time">鐢宠鏃堕棿锛歿{ item.updateDate }}</div> </div> <div class="reasonForFailure" style="margin: 10px 0" v-if="item.state == 'Reject'"> diff --git a/src/views/personalCenter/myCollection.vue b/src/views/personalCenter/myCollection.vue index c2b0b54..fccd321 100644 --- a/src/views/personalCenter/myCollection.vue +++ b/src/views/personalCenter/myCollection.vue @@ -15,19 +15,15 @@ currentCollect == 'book' || currentCollect == 'textBooks' ? 'bookCartContent cartContent' : currentCollect == 'course' - ? 'courseCartContent cartContent' - : 'cartContent' + ? 'courseCartContent cartContent' + : 'cartContent' " > <div class="collectList flex jc-sb clear" v-if="collectList.length > 0 && !pages.loading" > - <div - v-for="(item, index) in collectList" - :key="index" - class="collectList-item fl" - > + <div v-for="(item, index) in collectList" :key="index" class="collectList-item fl"> <div class="cover" @click="goBookDetails(item.id, item.name)"> <img :src="item.icon" alt="" /> </div> @@ -35,10 +31,7 @@ <span>{{ item.name }}</span> </div> <div class="currentBtn hover" @click="setCoolect(item)"> - <img - src="@/assets/images/personalCenter/collect-click.png" - alt="star" - /> + <img src="@/assets/images/personalCenter/collect-click.png" alt="star" /> </div> </div> </div> @@ -66,43 +59,43 @@ </template> <script setup lang="ts"> -import { reactive, ref, onMounted, inject, watch } from "vue"; -import { ElMessage, ElMessageBox } from "element-plus"; -import { useUserStore } from "@/store"; -import { useRouter } from "vue-router"; -const userStore = useUserStore(); -const router = useRouter(); -const MG: any = inject("MG"); -const config: any = inject("config"); -let currentCollect = ref("book"); -let collectList = ref([]); -const background = ref(false); -const disabled = ref(false); +import { reactive, ref, onMounted, inject, watch } from 'vue' +import { ElMessage, ElMessageBox } from 'element-plus' +import { useUserStore } from '@/store' +import { useRouter } from 'vue-router' +const userStore = useUserStore() +const router = useRouter() +const MG: any = inject('MG') +const config: any = inject('config') +let currentCollect = ref('textBooks') +let collectList = ref([]) +const background = ref(false) +const disabled = ref(false) let pages = reactive({ page: 1, pageSize: 10, count: 0, loading: false, -}); -let linkType = ref("FavoriteBookCity"); +}) +let linkType = ref('FavoriteBookCity') const tabCart = (event: Event) => { - pages.page = 1; - pages.loading = true; - collectList.value = []; - currentCollect.value = event.props.name; - if (currentCollect.value == "textBooks") { - linkType.value = "FavoriteBookCity"; + pages.page = 1 + pages.loading = true + collectList.value = [] + currentCollect.value = event.props.name + if (currentCollect.value == 'textBooks') { + linkType.value = 'FavoriteBookCity' } - getDataList(); -}; + getDataList() +} function getDataList() { - pages.loading = true; + pages.loading = true MG.store .getProductList({ handelEBooK: true, - queryType: "AppUserProductLink", + queryType: 'AppUserProductLink', linkType: linkType.value, paging: { start: pages.pageSize * pages.page - pages.pageSize, @@ -110,17 +103,17 @@ }, }) .then((res) => { - collectList.value = res.datas; - pages.count = res.total; - pages.loading = false; + collectList.value = res.datas + pages.count = res.total + pages.loading = false }) .catch(() => { - pages.loading = false; - }); + pages.loading = false + }) } onMounted(() => { - getDataList(); -}); + getDataList() +}) // watch( // () => userStore.token, @@ -130,16 +123,16 @@ // ) const handleCurrentChange = (val: number) => { - pages.page = val; - getDataList(); -}; + pages.page = val + getDataList() +} const setCoolect = (item) => { - ElMessageBox.confirm("纭畾瑕佸彇娑堟敹钘忓悧锛�", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", + ElMessageBox.confirm('纭畾瑕佸彇娑堟敹钘忓悧锛�', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', autofocus: false, - type: "warning", + type: 'warning', }) .then(() => { MG.store @@ -149,24 +142,24 @@ }) .then(() => { ElMessage({ - message: "鏀惰棌宸插彇娑堬紒", - type: "success", - }); - pages.page = 1; - getDataList(); - }); + message: '鏀惰棌宸插彇娑堬紒', + type: 'success', + }) + pages.page = 1 + getDataList() + }) }) - .catch(() => {}); -}; + .catch(() => {}) +} // 璺宠浆涔︽湰璇︽儏 const goBookDetails = (id: number, name: string) => { router.push({ - path: "/bookdetail", + path: '/bookdetail', query: { bookId: id, }, - }); -}; + }) +} </script> <style lang="less" scoped> .cartClass { @@ -287,12 +280,11 @@ padding: 2px; background-color: #fff; position: absolute; - top: 10px; - right: 10px; + top: 5px; + right: 2px; img { - width: 16px; - height: 16px; + height: 20px; } } diff --git a/src/views/personalCenter/teacherCertification.vue b/src/views/personalCenter/teacherCertification.vue index 65747f0..833f624 100644 --- a/src/views/personalCenter/teacherCertification.vue +++ b/src/views/personalCenter/teacherCertification.vue @@ -35,7 +35,7 @@ <span class="wait" v-else>寰呰璇�</span> </el-form-item> <el-form-item label="瀛︽牎锛�" prop="schoolName"> - <span v-if="!editState">{{ teacherInfo.schoolName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.schoolName || '-' }}</span> <el-input v-else v-model="teacherInfo.schoolName" @@ -44,7 +44,7 @@ /> </el-form-item> <el-form-item label="鐪熷疄濮撳悕锛�" prop="fullName"> - <span v-if="!editState">{{ teacherInfo.fullName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.fullName || '-' }}</span> <el-input v-else v-model="teacherInfo.fullName" @@ -53,12 +53,8 @@ /> </el-form-item> <el-form-item label="鑱岀О锛�"> - <span v-if="!editState">{{ teacherInfo.positionalTitle || "-" }}</span> - <el-select - v-else - v-model="teacherInfo.positionalTitle" - placeholder="璇烽�夋嫨鑱岀О" - > + <span v-if="!editState">{{ teacherInfo.positionalTitle || '-' }}</span> + <el-select v-else v-model="teacherInfo.positionalTitle" placeholder="璇烽�夋嫨鑱岀О"> <el-option v-for="item in teachPosts" :key="item.value" @@ -68,7 +64,7 @@ </el-select> </el-form-item> <el-form-item label="浠绘暀璇剧▼锛�" prop="courseName"> - <span v-if="!editState">{{ teacherInfo.courseName || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.courseName || '-' }}</span> <el-input v-else v-model="teacherInfo.courseName" @@ -77,7 +73,7 @@ /> </el-form-item> <el-form-item label="鎵嬫満鍙凤細" prop="phone"> - <span v-if="!editState">{{ teacherInfo.phone || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.phone || '-' }}</span> <el-input v-else v-model="teacherInfo.phone" @@ -86,7 +82,7 @@ /> </el-form-item> <el-form-item label="搴ф満锛�" prop="telphone"> - <span v-if="!editState">{{ teacherInfo.telphone || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.telphone || '-' }}</span> <el-input v-else v-model="teacherInfo.telphone" @@ -95,7 +91,7 @@ /> </el-form-item> <el-form-item label="閭锛�" prop="email"> - <span v-if="!editState">{{ teacherInfo.email || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.email || '-' }}</span> <el-input v-else v-model="teacherInfo.email" @@ -104,7 +100,7 @@ /> </el-form-item> <el-form-item label="璇︾粏鍦板潃锛�" prop="detailedAddress"> - <span v-if="!editState">{{ teacherInfo.detailedAddress || "-" }}</span> + <span v-if="!editState">{{ teacherInfo.detailedAddress || '-' }}</span> <el-input v-else v-model="teacherInfo.detailedAddress" @@ -182,11 +178,7 @@ <div class="footer-box"> <span class="myDialog-footer" v-if="!loading && editState"> <el-button @click="closeDialog(teacherFormRef)"> 鍙栨秷</el-button> - <el-button - type="primary" - @click="submitBtn(teacherFormRef)" - :loading="subLoading" - > + <el-button type="primary" @click="submitBtn(teacherFormRef)" :loading="subLoading"> 鎻愪氦</el-button > </span> @@ -210,12 +202,7 @@ </template> </el-dialog> <!-- 鏌ョ湅鍘熷洜 --> - <el-dialog - align-center - :close-on-click-modal="false" - v-model="dialogReason" - title="椹冲洖鍘熷洜" - > + <el-dialog align-center :close-on-click-modal="false" v-model="dialogReason" title="椹冲洖鍘熷洜"> <div class="reason" v-if="reasonTxt"> {{ reasonTxt }} </div> @@ -225,23 +212,23 @@ </template> <script setup lang="ts"> -import { reactive, ref, watch, defineEmits, inject, onMounted } from "vue"; -import type { FormInstance, FormRules } from "element-plus"; -import { ElMessage } from "element-plus"; -import tool from "@/assets/js/toolClass.js"; -import { getTopicMsgCmsItemFile } from "@/assets/js/middleGround/tool.js"; -import { useUserStore } from "@/store"; -const userStore = useUserStore(); -const MG: any = inject("MG"); -const config: any = inject("config"); +import { reactive, ref, watch, defineEmits, inject, onMounted } from 'vue' +import type { FormInstance, FormRules } from 'element-plus' +import { ElMessage } from 'element-plus' +import tool from '@/assets/js/toolClass.js' +import { getTopicMsgCmsItemFile } from '@/assets/js/middleGround/tool.js' +import { useUserStore } from '@/store' +const userStore = useUserStore() +const MG: any = inject('MG') +const config: any = inject('config') // 璇佷欢楠岃瘉 const valiCertificate = (rule: any, value: any, callback: any) => { if (fileList.value.length == 0) { - callback(new Error("璇蜂笂浼犵浉鍏宠瘉浠�")); + callback(new Error('璇蜂笂浼犵浉鍏宠瘉浠�')) } else { - callback(); + callback() } -}; +} // const validateTelphone = (rule: any, value: any, callback: any) => { // if (value !== "" && !config.reg_telphone.test(value)) { @@ -251,128 +238,125 @@ // }; const validatePhone = (rule: any, value: any, callback: any) => { - if (value === "") { - callback(new Error("璇疯緭鍏ヨ仈绯荤數璇�")); + if (value === '') { + callback(new Error('璇疯緭鍏ヨ仈绯荤數璇�')) } else { if (!config.reg_tel.test(value)) { - callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢佃瘽")); + callback(new Error('璇疯緭鍏ユ纭牸寮忕殑鐢佃瘽')) } - callback(); + callback() } -}; +} const validateEmail = (rule: any, value: any, callback: any) => { - let myreg = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/; - if (value === "") { - callback(new Error("璇疯緭鍏ョ數瀛愰偖绠�")); + let myreg = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/ + if (value === '') { + callback(new Error('璇疯緭鍏ョ數瀛愰偖绠�')) } else { if (!myreg.test(value)) { - callback(new Error("璇疯緭鍏ユ纭牸寮忕殑鐢靛瓙閭")); + callback(new Error('璇疯緭鍏ユ纭牸寮忕殑鐢靛瓙閭')) } - callback(); + callback() } -}; +} const props = defineProps({ isShow: Boolean, -}); +}) -let teacherDialog = ref(false); //寮圭獥 -let loading = ref(false); -let subLoading = ref(false); -const teachPosts = ref([]); +let teacherDialog = ref(false) //寮圭獥 +let loading = ref(false) +let subLoading = ref(false) +const teachPosts = ref([]) const teacherInfo = reactive({ - schoolName: "", //瀛︽牎鍚嶇О - fullName: "", //濮撳悕 - positionalTitle: "", //鑱岀О - courseName: "", //浠昏鏁欑▼ - phone: "", //鑱旂郴鐢佃瘽 - telphone: "", //搴ф満 - email: "", //鑱旂郴閭 - detailedAddress: "", //閫氳鍦板潃 + schoolName: '', //瀛︽牎鍚嶇О + fullName: '', //濮撳悕 + positionalTitle: '', //鑱岀О + courseName: '', //浠昏鏁欑▼ + phone: '', //鑱旂郴鐢佃瘽 + telphone: '', //搴ф満 + email: '', //鑱旂郴閭 + detailedAddress: '', //閫氳鍦板潃 relevantCertificates: [], //鐩稿叧璇佷欢 - state: "", //瀹℃牳鐘舵�侀粯璁ゅ緟瀹℃牳 + state: '', //瀹℃牳鐘舵�侀粯璁ゅ緟瀹℃牳 agree: false, -}); -const topicMessageList = ref([]); -const topicId = ref(); -const worksInfo = ref([]); -const userId = ref(); -const teacherFormRef = ref<FormInstance>(); +}) +const topicMessageList = ref([]) +const topicId = ref() +const worksInfo = ref([]) +const userId = ref() +const teacherFormRef = ref<FormInstance>() interface TeacherInfo { - schoolName: string; - fullName: string; - courseName: string; - telphone: string; - phone: string; - email: string; - detailedAddress: string; - relevantCertificates: string[]; + schoolName: string + fullName: string + courseName: string + telphone: string + phone: string + email: string + detailedAddress: string + relevantCertificates: string[] } const teacherRules = reactive<FormRules<TeacherInfo>>({ - schoolName: [{ required: true, message: "瀛︽牎鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }], - fullName: [{ required: true, message: "鐪熷疄濮撳悕涓嶈兘涓虹┖", trigger: "blur" }], - courseName: [{ required: true, message: "浠绘暀璇剧▼涓嶈兘涓虹┖", trigger: "blur" }], + schoolName: [{ required: true, message: '瀛︽牎鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' }], + fullName: [{ required: true, message: '鐪熷疄濮撳悕涓嶈兘涓虹┖', trigger: 'blur' }], + courseName: [{ required: true, message: '浠绘暀璇剧▼涓嶈兘涓虹┖', trigger: 'blur' }], // telphone: [{ validator: validateTelphone, trigger: "blur" }], - phone: [{ required: true, validator: validatePhone, trigger: "blur" }], - email: [{ required: true, validator: validateEmail, trigger: "blur" }], - detailedAddress: [{ required: true, message: "璇︾粏鍦板潃涓嶈兘涓虹┖", trigger: "blur" }], - relevantCertificates: [ - { required: true, validator: valiCertificate, trigger: "change" }, - ], -}); -const fileList = ref([]); -const editState = ref<boolean>(true); + phone: [{ required: true, validator: validatePhone, trigger: 'blur' }], + email: [{ required: true, validator: validateEmail, trigger: 'blur' }], + detailedAddress: [{ required: true, message: '璇︾粏鍦板潃涓嶈兘涓虹┖', trigger: 'blur' }], + relevantCertificates: [{ required: true, validator: valiCertificate, trigger: 'change' }], +}) +const fileList = ref([]) +const editState = ref<boolean>(true) watch(props, (newValue) => { // 缁熺洃鍚琾rops鐨勫�煎彉鍖栵紝鍔ㄦ�佷慨鏀筰sShow鐨勫�� - teacherDialog.value = newValue.isShow; + teacherDialog.value = newValue.isShow if (teacherDialog.value) { - getpositionalTitle(); - getAgreement(); + getpositionalTitle() + getAgreement() if (localStorage.getItem(config.tokenKey)) { - getUserRole(); + getUserRole() } } -}); +}) // 鑾峰彇鑱岀О function getpositionalTitle() { const data = { - refCodes: ["positionalTitle"], - }; + refCodes: ['positionalTitle'], + } MG.store.getProductTypeField(data).then((res) => { try { - const list = res[0]; - const options = JSON.parse(list.config).option; - teachPosts.value = options; + const list = res[0] + const options = JSON.parse(list.config).option + teachPosts.value = options } catch (error) { - teachPosts.value = []; + teachPosts.value = [] } - }); + }) } // 鑾峰彇鐧诲綍鐢ㄦ埛韬唤 function getUserRole() { - loading.value = true; + loading.value = true MG.identity.getCurrentAppUser().then((res) => { if (res) { - getType(); - userId.value = res.userId; - let userInfo = res.infoList.find((item: any) => item.type == "userInfo"); - let userTypeObj = res.infoList.find((item: any) => item.type == "userType"); + getType() + userId.value = res.userId + let userInfo = res.infoList.find((item: any) => item.type == 'userInfo') + let userTypeObj = res.infoList.find((item: any) => item.type == 'userType') const userData = { - userName: userInfo && userInfo.data ? JSON.parse(userInfo.data).name : "", - school: userInfo && userInfo.data ? JSON.parse(userInfo.data).school : "", - address: userInfo && userInfo.data ? JSON.parse(userInfo.data).address : "", - userType: - userTypeObj && userTypeObj.data ? JSON.parse(userTypeObj.data).userType : "", - }; - let teacherRole = res.roleLinks.find((item) => item.role.refCode == "teacher"); - let teacherInfos = res.infoList.find((item) => item.type == "teacherInfo"); - let wechatInfo = res.infoList.find((item) => item.type == "WeChat"); - let studentInfo = res.infoList.find((item) => item.type == "Default"); - let phoneInfo = res.secretList.find((item) => item.type == "MobilePhone"); - let emailInfo = res.secretList.find((item) => item.type == "EMail"); + userName: userInfo && userInfo.data ? JSON.parse(userInfo.data).name : '', + school: userInfo && userInfo.data ? JSON.parse(userInfo.data).school : '', + address: userInfo && userInfo.data ? JSON.parse(userInfo.data).address : '', + userType: userTypeObj && userTypeObj.data ? JSON.parse(userTypeObj.data).userType : '', + } + let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') + let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') + let wechatInfo = res.infoList.find((item) => item.type == 'WeChat') + let studentInfo = res.infoList.find((item) => item.type == 'Default') + let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') + let emailInfo = res.secretList.find((item) => item.type == 'EMail') if (teacherRole && teacherInfos) { userStore.setUserInfo({ ...userData, @@ -380,22 +364,22 @@ phoneNumber: phoneInfo?.credential, Email: emailInfo ? emailInfo.credential : JSON.parse(teacherInfos.data).email, icon: wechatInfo?.icon, - role: "Teacher", + role: 'Teacher', roleId: teacherRole.role.id, userId: res.userId, - }); + }) } else if (wechatInfo) { userStore.setUserInfo({ ...userData, ...wechatInfo, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } else if (studentInfo) { if (!studentInfo?.fullName) { - teacherInfo.fullName = userStore.userInfo!.userName; + teacherInfo.fullName = userStore.userInfo!.userName } userStore.setUserInfo({ ...userData, @@ -403,9 +387,9 @@ icon: wechatInfo?.icon, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } else if (phoneInfo) { userStore.setUserInfo({ ...userData, @@ -413,321 +397,313 @@ name: phoneInfo?.credential, icon: phoneInfo?.icon, phoneNumber: phoneInfo?.credential, - role: "Student", + role: 'Student', userId: res.userId, - }); + }) } - teacherInfo.phone = userStore.userInfo!.phoneNumber; - teacherInfo.schoolName = userStore.userInfo!.school; - teacherInfo.detailedAddress = userStore.userInfo!.address; + teacherInfo.phone = userStore.userInfo!.phoneNumber + teacherInfo.schoolName = userStore.userInfo!.school + teacherInfo.detailedAddress = userStore.userInfo!.address } - }); + }) } function getType() { const data = { - refCodes: ["teacherCertification"], - }; + refCodes: ['teacherCertification'], + } MG.resource.getCmsTypeByRefCode(data).then((res) => { - worksInfo.value = res[0].cmsTypeLinks[0].children; - newGetTeacherInfo(); - }); + worksInfo.value = res[0].cmsTypeLinks[0].children + newGetTeacherInfo() + }) } // 鏂囦欢涓婁紶 function fileUpload(file) { - console.log(file, 2); + console.log(file, 2) return new Promise((resolve, reject) => { - const isJPG = file.file.type === "image/jpeg" || file.file.type === "image/png"; - const isLt2M = (0.5 * file.file.size) / 1024 / 1024 < 0.5; + const isJPG = file.file.type === 'image/jpeg' || file.file.type === 'image/png' + const isLt2M = (0.5 * file.file.size) / 1024 / 1024 < 0.5 if (!isJPG) { - ElMessage.error("涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!"); - return reject(); + ElMessage.error('涓婁紶鏂囦欢鍙兘鏄� jpg/png 鏍煎紡!') + return reject() } if (!isLt2M) { - ElMessage.error("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 500KB!"); - return reject(); + ElMessage.error('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃 500KB!') + return reject() } - const FileName = file.file.name.split(".")[0]; - const Extension = file.file.name.split(".")[1]; - const FileType = file.file.type; - let size = 1024; + const FileName = file.file.name.split('.')[0] + const Extension = file.file.name.split('.')[1] + const FileType = file.file.type + let size = 1024 tool .getFileMd5(file.file, size * 1024) .then((e) => { - console.log(e, 2); + console.log(e, 2) if (!fileList.value.find((item) => item.md5 == e)) { - const imgData = new FormData(); - imgData.append("Md5", e); - imgData.append("FileName", FileName); - imgData.append("Extension", Extension); - imgData.append("FileType", FileType); - imgData.append("MetaData", null); - imgData.append("file", file.file); + const imgData = new FormData() + imgData.append('Md5', e) + imgData.append('FileName', FileName) + imgData.append('Extension', Extension) + imgData.append('FileType', FileType) + imgData.append('MetaData', null) + imgData.append('file', file.file) MG.file.upload(imgData).then(() => { fileList.value.push({ md5: e, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: config.requestCtx + `/file/GetPreViewImage?md5=` + e, - }); - }); + }) + }) } else { - ElMessage.error("褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�"); + ElMessage.error('褰撳墠鏂囦欢宸蹭笂浼狅紝璇峰嬁閲嶅鎿嶄綔锛�') } }) .catch((e) => { - console.error(e); - }); - }); + console.error(e) + }) + }) } // 璇佷欢鍒犻櫎 function handleRemove(file) { for (let i = 0; i < fileList.value.length; i++) { if (fileList.value[i].md5 == file.md5) { - fileList.value.splice(i, 1); + fileList.value.splice(i, 1) } } } // 鐩戝惉鏂囦欢鍒楄〃鍙樺寲锛屽悓姝ヤ慨鏀瑰睍绀哄垪琛� -const showFileList = ref([]); +const showFileList = ref([]) watch( fileList, (newValue) => { showFileList.value = newValue.map( - (item) => config.requestCtx + `/file/GetPreViewImage?md5=` + item.md5 - ); + (item) => config.requestCtx + `/file/GetPreViewImage?md5=` + item.md5, + ) }, - { immediate: true, deep: true } -); + { immediate: true, deep: true }, +) // 鍏抽棴寮规锛屽洖璋冪埗灞傛柟娉� -const emit = defineEmits(["dialogChange"]); +const emit = defineEmits(['dialogChange']) const closeDialog = (formEl: FormInstance | undefined) => { - if (!formEl) return; - formEl.resetFields(); - teacherDialog.value = false; - emit("dialogChange", teacherDialog.value); -}; + if (!formEl) return + formEl.resetFields() + teacherDialog.value = false + emit('dialogChange', teacherDialog.value) +} // 鏁欏笀鍗忚 -const dialogVisibleTecher = ref(false); -const protocolTxt = ref(""); +const dialogVisibleTecher = ref(false) +const protocolTxt = ref('') const getAgreement = () => { let query = { - path: "protocol", + path: 'protocol', fields: { content: [], }, - }; + } MG.resource.getItem(query).then((res) => { try { - const data = res.datas.find( - (e) => e.refCode == "teacherCertificationAgreement" - ); - protocolTxt.value = data ? data.content : "鏆傛棤鍗忚"; + const data = res.datas.find((e) => e.refCode == 'teacherCertificationAgreement') + protocolTxt.value = data ? data.content : '鏆傛棤鍗忚' } catch (error) { - protocolTxt.value = "鏆傛棤鍗忚"; + protocolTxt.value = '鏆傛棤鍗忚' } - }); -}; + }) +} //鏁欏笀淇℃伅 function newGetTeacherInfo() { const data = { start: 0, size: 10, - topicIdOrRefCode: "teacherRoleApproval", + topicIdOrRefCode: 'teacherRoleApproval', appRefCode: config.appRefCode, sort: { - type: "Desc", - field: "CreateDate", + type: 'Desc', + field: 'CreateDate', }, - }; + } MG.ugc.getTopicMessageList(data).then((res) => { try { - fileList.value = []; - const resData = res.datas.find((i) => i.appUserCreator.userId === userId.value); + fileList.value = [] + const resData = res.datas.find((i) => i.appUserCreator.userId === userId.value) if (resData) { - if (resData.state == "WaitAudit") { - editState.value = false; + if (resData.state == 'WaitAudit') { + editState.value = false } else { - editState.value = true; + editState.value = true } - let info = getTopicMsgCmsItemFile(worksInfo.value, resData.cmsItemDataList); - teacherInfo.fullName = info.fullName; - teacherInfo.schoolName = info.schoolName; - teacherInfo.positionalTitle = info.positionalTitle; - teacherInfo.courseName = info.courseName; - teacherInfo.phone = info.phone; - teacherInfo.telphone = info.telphone ? info.telphone : ""; - teacherInfo.email = info.email; - teacherInfo.detailedAddress = info.detailedAddress ? info.detailedAddress : ""; - teacherInfo.relevantCertificates = info.relevantCertificates; - teacherInfo.agree = true; - teacherInfo.state = resData.state; - topicId.value = resData.id; - topicMessageList.value = resData.cmsItemDataList; + let info = getTopicMsgCmsItemFile(worksInfo.value, resData.cmsItemDataList) + teacherInfo.fullName = info.fullName + teacherInfo.schoolName = info.schoolName + teacherInfo.positionalTitle = info.positionalTitle + teacherInfo.courseName = info.courseName + teacherInfo.phone = info.phone + teacherInfo.telphone = info.telphone ? info.telphone : '' + teacherInfo.email = info.email + teacherInfo.detailedAddress = info.detailedAddress ? info.detailedAddress : '' + teacherInfo.relevantCertificates = info.relevantCertificates + teacherInfo.agree = true + teacherInfo.state = resData.state + topicId.value = resData.id + topicMessageList.value = resData.cmsItemDataList if (resData.feedBack != null) { - reasonTxt.value = JSON.parse(resData.feedBack).reason; + reasonTxt.value = JSON.parse(resData.feedBack).reason } if (teacherInfo.relevantCertificates.length > 0) { - if (typeof teacherInfo.relevantCertificates == "object") { + if (typeof teacherInfo.relevantCertificates == 'object') { teacherInfo.relevantCertificates.forEach((ele) => { let imgObj = { md5: ele.file.md5, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: config.requestCtx + `/file/GetPreViewImage?md5=` + ele.file.md5, - }; - fileList.value.push(imgObj); - }); + } + fileList.value.push(imgObj) + }) } else { let imgObj = { md5: teacherInfo.relevantCertificates, - linkType: "LinkFile", - linkProtectType: "Public", + linkType: 'LinkFile', + linkProtectType: 'Public', url: - config.requestCtx + - `/file/GetPreViewImage?md5=` + - teacherInfo.relevantCertificates, - }; - fileList.value.push(imgObj); + config.requestCtx + `/file/GetPreViewImage?md5=` + teacherInfo.relevantCertificates, + } + fileList.value.push(imgObj) } } - loading.value = false; + loading.value = false } else { - loading.value = false; + loading.value = false } } catch (error) { - loading.value = false; + loading.value = false } - }); + }) } //鏁欏笀璁よ瘉鎻愪氦 const submitBtn = async (formEl: FormInstance | undefined) => { - if (!formEl) return; + if (!formEl) return await formEl.validate((valid, fields) => { if (valid) { if (teacherInfo.agree) { - subLoading.value = true; + subLoading.value = true if (topicMessageList.value.length > 0) { let dataRequests = tool.UpdateworksDataBytool( worksInfo.value, topicMessageList.value, teacherInfo, - fileList.value - ); + fileList.value, + ) const data = { - description: "", - icon: "", + description: '', + icon: '', id: topicId.value, - topicIdOrRefCode: "teacherRoleApproval", - name: teacherInfo.fullName + "", - content: "", - state: "WaitAudit", - type: "teacherRegister", + topicIdOrRefCode: 'teacherRoleApproval', + name: teacherInfo.fullName + '', + content: '', + state: 'WaitAudit', + type: 'teacherRegister', newDataRequests: dataRequests.newData, updateDataRequests: dataRequests.updateData, delDataRequest: { ids: [], }, - }; - let basicInfo = JSON.parse(JSON.stringify(teacherInfo)); - delete basicInfo.worksInfo; - delete basicInfo.state; + } + let basicInfo = JSON.parse(JSON.stringify(teacherInfo)) + delete basicInfo.worksInfo + delete basicInfo.state const userInfo = { requests: [ { data: JSON.stringify(basicInfo), - name: teacherInfo.fullName + "", - type: "newTeacherInfo", + name: teacherInfo.fullName + '', + type: 'newTeacherInfo', }, ], - }; + } MG.identity.setAppUserInfo(userInfo).then((res) => { if (res) { MG.ugc.updateTopicMessage(data).then(() => { if (res !== false) { ElMessage({ - message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...", - type: "success", - }); - teacherDialog.value = false; - subLoading.value = false; - newGetTeacherInfo(); + message: '鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...', + type: 'success', + }) + teacherDialog.value = false + subLoading.value = false + newGetTeacherInfo() } else { - subLoading.value = false; + subLoading.value = false } - }); + }) } else { - subLoading.value = true; + subLoading.value = true } - }); + }) } else { const data = { - topicIdOrRefCode: "teacherRoleApproval", - name: teacherInfo.fullName + "", - content: "", - state: "WaitAudit", - type: "teacherRegister", - cmsTypeRefCode: "teacherCertification", - newDataListRequest: tool.worksDataBytool( - worksInfo.value, - teacherInfo, - fileList.value - ), - }; + topicIdOrRefCode: 'teacherRoleApproval', + name: teacherInfo.fullName + '', + content: '', + state: 'WaitAudit', + type: 'teacherRegister', + cmsTypeRefCode: 'teacherCertification', + newDataListRequest: tool.worksDataBytool(worksInfo.value, teacherInfo, fileList.value), + } - let basicInfo = JSON.parse(JSON.stringify(teacherInfo)); - delete basicInfo.worksInfo; - delete basicInfo.state; + let basicInfo = JSON.parse(JSON.stringify(teacherInfo)) + delete basicInfo.worksInfo + delete basicInfo.state const userInfo = { requests: [ { data: JSON.stringify(basicInfo), - name: teacherInfo.fullName + "", - type: "teacherInfo", + name: teacherInfo.fullName + '', + type: 'teacherInfo', }, ], - }; + } MG.identity.setAppUserInfo(userInfo).then((res) => { MG.ugc.newTopicMessage(data).then(() => { if (res !== false) { ElMessage({ - message: "鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...", - type: "success", - }); - teacherDialog.value = false; - newGetTeacherInfo(); - subLoading.value = false; + message: '鎻愪氦鎴愬姛锛佽绛夊緟瀹℃牳...', + type: 'success', + }) + teacherDialog.value = false + newGetTeacherInfo() + subLoading.value = false } else { - subLoading.value = false; + subLoading.value = false } - }); - }); + }) + }) } } else { ElMessage({ - message: "璇峰悓鎰忋�婃暀甯堣璇佹湇鍔℃潯娆俱�嬶紒", - type: "warning", - }); + message: '璇峰悓鎰忋�婃暀甯堣璇佹湇鍔℃潯娆俱�嬶紒', + type: 'warning', + }) } } - }); -}; + }) +} //鍘熷洜鏌ョ湅 -const dialogReason = ref(false); -const reasonTxt = ref(""); +const dialogReason = ref(false) +const reasonTxt = ref('') const lookReason = () => { - dialogReason.value = true; -}; -defineExpose({ getUserRole }); + dialogReason.value = true +} +defineExpose({ getUserRole }) </script> <style lang="less"> .myDialog { @@ -737,7 +713,7 @@ } .body-box { padding: 10px 20px 40px; - height: 80vh; + height: 70vh; overflow-y: auto; } @@ -760,7 +736,7 @@ padding: 15px; border-top: 1px solid #f4f4f4; text-align: right; - height: 63px; + box-sizing: border-box; } .myDialog-footer { @@ -784,6 +760,7 @@ .main { font-weight: bold; text-align: center; + color: #019e58; } } @@ -831,7 +808,7 @@ } .fileList .fileImgBox:hover { - border-color: #019E58; + border-color: #019e58; } .agree-msg { @@ -842,10 +819,14 @@ .agree { margin-left: 5px; + .main { + text-align: center; + color: #019e58; + } } .term { - color: #019E58; + color: #019e58; } } .reason { diff --git a/src/views/personalCenter/userInfo.vue b/src/views/personalCenter/userInfo.vue index ef1bb0f..3f2c5c2 100644 --- a/src/views/personalCenter/userInfo.vue +++ b/src/views/personalCenter/userInfo.vue @@ -8,7 +8,7 @@ <div class="info-box flex"> <span class="label">鐢ㄦ埛鍚嶏細</span> <span class="text">{{ userStore?.userInfo.name }}</span> - <span class="change-info hover" @click="changeUserInfo('password')">淇敼瀵嗙爜</span> + <!-- <span class="change-info hover" @click="changeUserInfo('password')">淇敼瀵嗙爜</span> --> </div> <div class="info-box flex"> <span class="label">寰俊璁よ瘉:</span> @@ -28,7 +28,7 @@ userStore?.userInfo?.phoneNumber ? '鏇存崲鎵嬫満鍙�' : '缁戝畾' }}</span> </div> - <div class="info-box flex"> + <!-- <div class="info-box flex"> <span class="label">閭锛�</span> <span class="text">{{ userStore?.userInfo?.Email ? userStore.userInfo?.Email : '--' @@ -36,21 +36,9 @@ <span class="change-info hover" @click="changeUserInfo('email')">{{ userStore?.userInfo?.Email ? '鏇存崲閭' : '缁戝畾閭' }}</span> - </div> + </div> --> </div> </div> - <!-- <div class="content-item"> - <div class="item-title flex jc-sb"> - <span>鐢ㄦ埛绫诲瀷</span> - <span class="change-info hover" @click="updateUserInfo()">淇敼</span> - </div> - <div class="item-box"> - <div class="info-box flex"> - <span class="label">鐢ㄦ埛绫诲瀷锛�</span> - <span class="text">{{ userInfo.userType }}</span> - </div> - </div> - </div> --> <div class="content-item"> <div class="item-title flex jc-sb"> <span>鏁欏笀璁よ瘉</span> @@ -73,24 +61,12 @@ <span class="text wait" v-if="teacherState == 'WaitAudit'">绛夊緟瀹℃牳</span> <span class="text yes" v-else-if="teacherState == 'Normal'">宸茶璇�</span> <span class="text no" v-else-if="teacherState == 'Reject'">宸查┏鍥�</span> - <span class="text wait" v-if="teacherState === ''">寰呰璇�</span> + <span class="text no" v-if="teacherState === ''">寰呰璇�</span> </div> <div v-if="teacherState == 'Reject'"> <span class="title">椹冲洖鍘熷洜</span> : <span @click="lookReason()" class="wait hover">鏌ョ湅鍘熷洜</span> </div> - </div> - </div> - </div> - <div class="content-item"> - <div class="item-title flex jc-sb"> - <span>鎴戠殑绉垎</span> - <span class="record hover" @click="recordDialog()">绉垎璁板綍</span> - </div> - <div class="item-box"> - <div class="info-box flex"> - <span class="label">绉垎锛�</span> - <span class="text">{{ userInfo.integral }}</span> </div> </div> </div> @@ -109,7 +85,7 @@ class="myDialogs" @close="closeUserInfoDialog(userFormRef)" > - <div> + <div class="dialog-content"> <el-form ref="userFormRef" :model="userInfoForm" @@ -161,22 +137,6 @@ </el-button> </div> </el-form-item> - <el-form-item label="鏂板瘑鐮侊細" prop="password" v-if="changeType == 'password'"> - <el-input - type="password" - v-model="userInfoForm.password" - autocomplete="off" - placeholder="璇疯緭鍏�8-16浣嶆柊瀵嗙爜,涓斾笉鑳戒负绾暟瀛�" - /> - </el-form-item> - <el-form-item label="纭瀵嗙爜锛�" prop="confirmPassword" v-if="changeType == 'password'"> - <el-input - type="password" - v-model="userInfoForm.confirmPassword" - autocomplete="off" - placeholder="璇疯緭鍏ョ‘璁ゅ瘑鐮�" - /> - </el-form-item> </el-form> </div> <template #footer> @@ -211,7 +171,7 @@ </div> </el-dialog> <!-- 鐢ㄦ埛绫诲瀷淇敼 --> - <login ref="loginRef"></login> + <!-- <login ref="loginRef"></login> --> <!-- 鏌ョ湅鍘熷洜 --> <el-dialog align-center @@ -272,11 +232,12 @@ <script setup lang="ts"> import { reactive, ref, inject, onMounted, watch } from 'vue' import type { FormInstance, FormRules } from 'element-plus' +import verify from '@/components/sliderImg/component/verify.vue' +import '@/components/sliderImg/sliderImg.js' +import '@/components/sliderImg/sliderImg.css' import { ElMessage } from 'element-plus' import { useUserStore } from '@/store' -// import wxlogin from 'vue-wxlogin' import teacherCertification from './teacherCertification.vue' -import login from '@/layout/components/login.vue' const userStore = useUserStore() import moment from 'moment' const MG: any = inject('MG') @@ -1053,6 +1014,11 @@ .myDialogs { width: 628px; + .dialog-content { + padding: 20px 0; + box-sizing: border-box; + } + .el-dialog__header { padding: 15px; margin-right: 0; -- Gitblit v1.9.1