From 1ea3894be8d0b0871da71c602977f6c6cd3fffd7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Thu, 10 Apr 2025 18:56:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84console.log=E8=AF=AD=E5=8F=A5=E4=BB=A5?= =?UTF-8?q?=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理了多个组件和视图中的console.log语句,以提高代码的可读性和维护性,避免在生产环境中输出不必要的调试信息。 --- src/App.vue | 1 - src/components/apartment/seach.vue | 1 - src/components/apartment/seachModule.vue | 1 - src/components/checkGroup/checkBoxGroup.vue | 1 - src/components/detail/imageWatch.vue | 1 - src/components/edit/about-pop.vue | 2 -- src/components/edit/choosingIdentity.vue | 1 - src/components/indexSeachInfo/indexSeachInfo.vue | 1 - src/components/public/report.vue | 1 - src/components/public/transmitBtn.vue | 1 - src/components/public/video-box.vue | 8 +++----- src/components/seachModule/seachModule.vue | 9 ++------- src/components/seachPage/input.vue | 4 +--- src/components/selectTabBox/selectTabBox.vue | 2 -- src/main.js | 2 -- src/router/index.js | 1 - src/views/HomeView.vue | 1 - src/views/detail.vue | 1 - src/views/edit.vue | 1 - src/views/seachIndex.vue | 5 ----- 20 files changed, 6 insertions(+), 39 deletions(-) diff --git a/src/App.vue b/src/App.vue index 583e7fa..cae876f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,7 +73,6 @@ const timedTransmission = () => { if (socketTask.readyState != 1) return // timedTransmissionState = true socketTask.send(JSON.stringify({ type: "ping" })) - console.log("ping", new Date()) setTimeout(() => timedTransmission(), useSocketInterval) } diff --git a/src/components/apartment/seach.vue b/src/components/apartment/seach.vue index 32df600..70ea5de 100644 --- a/src/components/apartment/seach.vue +++ b/src/components/apartment/seach.vue @@ -229,7 +229,6 @@ const selectOption = (type, value) => { break; } - console.log('pitchValue', pitchValue.value); emit('handleTransfer', pitchValue) } diff --git a/src/components/apartment/seachModule.vue b/src/components/apartment/seachModule.vue index 7977917..682510f 100644 --- a/src/components/apartment/seachModule.vue +++ b/src/components/apartment/seachModule.vue @@ -290,7 +290,6 @@ let pitchValue = ref({ watchEffect(() => { // nearSchoolList = store.state.apartment.school || [] nearSchoolList = store.state.schoolList || [] - console.log("nearSchoolList", nearSchoolList) roomTypeList = store.state.apartment.roomtype || [] roomTypeKey = store.state.roomTypeKey || {} roomlistingsList = store.state.apartment.roomlistings || [] diff --git a/src/components/checkGroup/checkBoxGroup.vue b/src/components/checkGroup/checkBoxGroup.vue index 661325c..3f50f82 100644 --- a/src/components/checkGroup/checkBoxGroup.vue +++ b/src/components/checkGroup/checkBoxGroup.vue @@ -69,7 +69,6 @@ watchEffect(() => { show = props.show list.splice(0, list.length) list.push(...props.list) - // console.log(show) if (show && props.clearList) { checkList.list = [] } diff --git a/src/components/detail/imageWatch.vue b/src/components/detail/imageWatch.vue index b7455ce..a800c96 100644 --- a/src/components/detail/imageWatch.vue +++ b/src/components/detail/imageWatch.vue @@ -83,7 +83,6 @@ let prev = () => carousel.value.prev() // 轮播图滚动后事件 const carouselChange = value => { - console.log("value") imageTab.value = value } diff --git a/src/components/edit/about-pop.vue b/src/components/edit/about-pop.vue index d244b84..01cabe0 100644 --- a/src/components/edit/about-pop.vue +++ b/src/components/edit/about-pop.vue @@ -38,13 +38,11 @@ export default { let tab = ref("person"); // person intermediary more - // console.log("props['intermediary']", props['intermediary']); // if (props['intermediary'] == 1) tab.value = "intermediary" // else tab.value = "person" watch(() => props.intermediary, (newValue, oldValue) => { // 在这里处理popState属性的变化 - // console.log('popState属性发生变化', newValue, oldValue); if (newValue == 1) tab.value = "intermediary" else tab.value = "person" diff --git a/src/components/edit/choosingIdentity.vue b/src/components/edit/choosingIdentity.vue index 3e7e6f7..5a61fc7 100644 --- a/src/components/edit/choosingIdentity.vue +++ b/src/components/edit/choosingIdentity.vue @@ -104,7 +104,6 @@ async function init() { isintermediary.value = data.isintermediary // isintermediary.value = 1 - // console.log("data.isintermediary",data.isintermediary); // if (data['ispopup'] == 0) overallJump() if (data['ispopup'] == 0) overallJump() else popType.value = 'choice' diff --git a/src/components/indexSeachInfo/indexSeachInfo.vue b/src/components/indexSeachInfo/indexSeachInfo.vue index 2947814..b5d7a59 100644 --- a/src/components/indexSeachInfo/indexSeachInfo.vue +++ b/src/components/indexSeachInfo/indexSeachInfo.vue @@ -92,7 +92,6 @@ let closeSeach = () => { //确认按钮 let selectSeach = (data) => { props.checkBtn(data,'location',JSON.stringify(nowSelectArea.data)) - // console.log(data) } diff --git a/src/components/public/report.vue b/src/components/public/report.vue index e1ee2fa..7898ebf 100644 --- a/src/components/public/report.vue +++ b/src/components/public/report.vue @@ -54,7 +54,6 @@ const submit = () => { id: props['id'], message }).then(res => { - console.log("res", res); if (res.code == 200) { ElMessage.success(res.message) checkList.value = [] diff --git a/src/components/public/transmitBtn.vue b/src/components/public/transmitBtn.vue index a8a3780..d811411 100644 --- a/src/components/public/transmitBtn.vue +++ b/src/components/public/transmitBtn.vue @@ -55,7 +55,6 @@ const popperOptions = ref({ // if (props['type'] == 'housingTop') popperOptions.value['modifiers'][0]['options']['offset'][0] = 14 if (props['type'] == 'housingTop') popperOptions.value['modifiers'][0]['options']['offset'][0] = 18 if (props['type'] == 'housing') popperOptions.value['modifiers'][0]['options']['offset'][0] = 38 -// console.log("newValue", props['type']); watch(() => props.concatType, (newValue, oldValue) => { diff --git a/src/components/public/video-box.vue b/src/components/public/video-box.vue index 6ff4e7c..abce9fc 100644 --- a/src/components/public/video-box.vue +++ b/src/components/public/video-box.vue @@ -17,7 +17,7 @@ import videojs from "video.js" import { reactive, onMounted, ref, defineProps, watchEffect, watch, onUnmounted, nextTick } from "vue" const onCanPlay = event => { - console.log("视频可以播放了") + // console.log("视频可以播放了") // 这里可以添加额外的逻辑,例如显示播放按钮等 } const onError = event => { @@ -47,17 +47,16 @@ watch( () => props.imageTab, newVal => { if (newVal != props.val) { - // console.log("videoRef", videoRef.value) if (player.value != null) { player.value.pause() // dispose()会直接删除Dom元素 } if (videoRef.value) { if (!videoRef.value.paused) { - console.log("视频正在播放,现在停止.") + // console.log("视频正在播放,现在停止.") videoRef.value.pause() } else { - console.log("视频已经暂停.") + // console.log("视频已经暂停.") } } else { // console.error("Video element not found.") @@ -75,7 +74,6 @@ let ism3u8 = ref(false) // 是否是 m3u8 格式 onMounted(() => { if (props.src.indexOf("m3u8") == -1) { - // console.log("mp4") return } ism3u8.value = true diff --git a/src/components/seachModule/seachModule.vue b/src/components/seachModule/seachModule.vue index a9683a0..e917276 100644 --- a/src/components/seachModule/seachModule.vue +++ b/src/components/seachModule/seachModule.vue @@ -211,7 +211,6 @@ let setLocation = (type, data, isupdate = true) => { //设置搜索数据 type: 类型 data: 数据 second: 二级数据 let setSeachConditions = (type, data, second = null) => { - console.log("赋值前的数据:", seachAllType) if (type === "rent") { seachAllType["rent_min"] = data.min seachAllType["rent_max"] = data.max @@ -229,12 +228,8 @@ let setSeachConditions = (type, data, second = null) => { if (type === "school") seachAllType.location = [] if (type === "location") seachAllType.school = "" - if (second) { - seachAllType[second.type] = second.id - } - console.log(type, data, second) - console.log("保存前的处理数据:", seachAllType) - + if (second) seachAllType[second.type] = second.id + getDataList(seachAllType) } diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index 34c4335..03b0a2d 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -376,9 +376,7 @@ let searchInit = data => { }) } }) - .catch(err => { - console.log("1111") - }) + } //判断搜索数据数量 diff --git a/src/components/selectTabBox/selectTabBox.vue b/src/components/selectTabBox/selectTabBox.vue index a45a722..3f9d3e5 100644 --- a/src/components/selectTabBox/selectTabBox.vue +++ b/src/components/selectTabBox/selectTabBox.vue @@ -290,8 +290,6 @@ const props = defineProps({ const pitchValue = inject('pitchValue') || {} onMounted(()=>{ - console.log("min", pitchValue); - if (pitchValue['gender']) gender.id = pitchValue['gender'] if (pitchValue['publish']) releaseObj.id = pitchValue['publish'] if (pitchValue['leaseterm']) hireDate.id = pitchValue['leaseterm'] diff --git a/src/main.js b/src/main.js index cd1bc66..1efaf70 100644 --- a/src/main.js +++ b/src/main.js @@ -80,8 +80,6 @@ api.index() .then(res => { const data = res.data // const url = import("@/assets/homeImage/informationO.png") - // console.log("url", url) - // console.log("data", data.articleList) store.state.seachTypeData = data.combination store.state.indexData = data store.state.ListSelectBtn = data.recommendedTab diff --git a/src/router/index.js b/src/router/index.js index c26ce28..e22734c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -151,7 +151,6 @@ router.beforeEach((to, from, next) => { isInitialNavigation = false; } else { // return - // console.log("1111111,", to.path, to.fullPath); // if (window._hmt) { // if (to.path) { // // window._hmt.push(['_trackPageview', '/#' + to.fullPath]) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 7da09ae..0721c19 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -231,7 +231,6 @@ let getRecommendList = () => { type: ListSelectBtn.selectType, pagevalue: pagevalue.value, }).then(res => { - // console.log(res) if (res.code === 200) { if (res.data.pagevalue) { if (pages.value === 1) waterfallList.value = [] diff --git a/src/views/detail.vue b/src/views/detail.vue index 9668789..bcd347a 100644 --- a/src/views/detail.vue +++ b/src/views/detail.vue @@ -834,7 +834,6 @@ let scrollWidth = ref(null) let scrollMove = false //点击方向按钮 let moveImageList = type => { - console.log("type", type, imgListTab.value, imageLIstLeft) if (type === "right" && imgScrollBottom()) return if ((type === "left" && imgListTab.value === 0) || (imgListTab.value === imageLIstLeft.value.length - 1 && type === "right")) return type === "left" ? imgListTab.value-- : imgListTab.value++ diff --git a/src/views/edit.vue b/src/views/edit.vue index cd97e07..2b1ee9e 100644 --- a/src/views/edit.vue +++ b/src/views/edit.vue @@ -1154,7 +1154,6 @@ export default { formData.append("name", target.name) // 文件名 formData.append("type", type) // 文件名 formData.append("data", this.uploadData) // 文件名 - console.log("formData", formData) // this.$axios.post('/tenement/pc/api/publish/upload', formData).then(res => { this.$axios .post("https://oss.gter.net/upload", formData) diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index 274fe42..cb4ca21 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -77,9 +77,6 @@ let setInitial = () => { //获取搜索数据 let getDataList = (data, type = true) => { - // console.log("11414"); - // console.log(data,type) - // console.log(type); if (!type) { //是否继续搜索 seachSelectData.data.tabType !== "apartment" ? (pageList.value = []) : (listApartment.value = []) @@ -102,10 +99,8 @@ let getDataList = (data, type = true) => { } else { seachApi = api.apartment(postData) } - // console.log("555"); seachApi.then(res => { if (res.code === 200) { - // console.log(res.data) dataList.data = res.data.data if (res.data.data.length < 20) { loadingText.value = ` 到底了 `