From 8a4acbba2e1bf0e3a268fe4d16ef47a6e0fed62b Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Tue, 18 Oct 2022 17:47:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=9AformatSecondToHour=EF=BC=88=E5=B0=86?= =?UTF-8?q?=E7=A7=92=E8=BD=AC=E6=8D=A2=E6=88=90=E5=B0=8F=E6=97=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tools.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/utils/tools.js b/src/utils/tools.js index 1c3c6cb6..55886e4e 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -374,3 +374,19 @@ export function formatUserNumber(num) { } return 0; } + + +/** + * 将秒转换成小时 + * @author wn + * @date 2022.10.18 + * @param {Object} second 秒 + * @@return 小时 + */ +export function formatSecondToHour(second) { + var n = 1; // 保留小数位 + second = Number(second); + var h = second / 3600; + h = h.toFixed(n); + return h; +} From 442d41f3669470d02157c64d4d4f409c7f034d8c Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Tue, 18 Oct 2022 17:47:41 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B0=86=E5=AD=A6=E4=B9=A0=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E7=9A=84=E7=BB=93=E6=9E=9C=E8=BD=AC=E6=8D=A2=E6=88=90?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/ranking.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/views/user/ranking.vue b/src/views/user/ranking.vue index a7cd71f1..5820126b 100644 --- a/src/views/user/ranking.vue +++ b/src/views/user/ranking.vue @@ -125,7 +125,7 @@ 我的排名 : {{learningDurationTotalData.rankNo}}
- 我的学习时长: {{learningDurationTotalData.rankValue}} h + 我的学习时长: {{formatSecondToHour(learningDurationTotalData.rankValue)}} h
@@ -151,10 +151,10 @@
-
{{lan.total}}
-
{{lan.months}}
-
{{lan.years}}
-
{{lan.weeks}}
+
{{formatSecondToHour(lan.total)}}
+
{{formatSecondToHour(lan.months)}}
+
{{formatSecondToHour(lan.years)}}
+
{{formatSecondToHour(lan.weeks)}}
@@ -275,7 +275,7 @@ import apiStat from '@/api/phase2/stat.js'; import { mapGetters } from 'vuex'; import authorImg from '@/components/Portal/authorImg.vue'; - import {translate,experienceValue} from "@/utils/tools.js"; + import {translate,experienceValue,formatSecondToHour} from "@/utils/tools.js"; export default { computed: { ...mapGetters(['userInfo']), @@ -292,6 +292,7 @@ export default { endValue:0 // 累计经验值进度条最大值 }, translate, + formatSecondToHour:formatSecondToHour, experience:{ field:'total', name:'累计', From 18d31fffb0f7d1dcb6b6f015eb93f8d5c2698e9f Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Tue, 18 Oct 2022 18:53:01 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=97=AE=E7=AD=94?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Article/ucItems.vue | 51 +++++++++--------------------- src/components/PortalHeader.vue | 2 +- src/components/Qa/replyList.vue | 40 ++++++++++++++++------- src/components/Qa/ucList.vue | 14 ++++---- src/views/article/MyList.vue | 11 ++++--- src/views/qa/MyReplys.vue | 12 ++++--- 6 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/components/Article/ucItems.vue b/src/components/Article/ucItems.vue index fc75673b..7742bdef 100644 --- a/src/components/Article/ucItems.vue +++ b/src/components/Article/ucItems.vue @@ -2,14 +2,10 @@
-
+
登出
diff --git a/src/components/Qa/replyList.vue b/src/components/Qa/replyList.vue index e38cc67b..858fdbfb 100644 --- a/src/components/Qa/replyList.vue +++ b/src/components/Qa/replyList.vue @@ -6,11 +6,11 @@
  • 这里的路由传参存在问题
  • -
    +
    @@ -100,6 +100,19 @@ export default { }; }, methods: { + //展示全部 + displayAll(item) { + let content = ''; + content = item.answercontent.replace(/(\n){2,}/,'
    '); + item.answercontent = content; + if (!item.isAll && item.answercontent.length > 170) { + return item.answercontent.slice(0, 170) + "..."; + } + return item.answercontent; + }, + changeIsAll(item) { + item.isAll = !item.isAll; + }, // deleteData(item){ // console.log(item,"我拿到准备删除的数据") // apiQa.delAnswer() @@ -160,6 +173,7 @@ export default { color: #333330; font-weight: 400; margin-bottom: 10px; + word-break:break-all; } .titcontent{ font-size: 14px; @@ -293,6 +307,10 @@ export default { .article-info-tools { height: 30px; position: relative; + ::v-deep .interact-bar-btn{ + min-width: 80px !important; + text-align: right; + } .article-info-tools-auth { float: left; height: 30px; diff --git a/src/components/Qa/ucList.vue b/src/components/Qa/ucList.vue index d5d5e4b3..d0ba0b2a 100644 --- a/src/components/Qa/ucList.vue +++ b/src/components/Qa/ucList.vue @@ -6,7 +6,7 @@ -
    +
    编辑 删除
    @@ -35,12 +35,6 @@
    - - -
    @@ -234,11 +228,15 @@ export default { .button-cla{ position: absolute; right:0px; + ::v-deep .interact-bar-btn{ + min-width: 90px !important; + text-align: right; + } } .edit{ color: #8590A6; font-size: 14px; - margin-right: 10px; + margin-right: 45px; } .del{ color: #8590A6; diff --git a/src/views/article/MyList.vue b/src/views/article/MyList.vue index 51d2e13b..2680c4fe 100644 --- a/src/views/article/MyList.vue +++ b/src/views/article/MyList.vue @@ -46,11 +46,12 @@ :total="total" >
    -
    -
    没有查询到相关内容
    -
    暂无数据
    -
    -
    +
    + +
    没有查询到相关内容
    +
    你还没有发布文章~
    +
    +
    diff --git a/src/views/qa/MyReplys.vue b/src/views/qa/MyReplys.vue index 5fa7a0a3..f491d5c3 100644 --- a/src/views/qa/MyReplys.vue +++ b/src/views/qa/MyReplys.vue @@ -36,9 +36,10 @@ >
    -
    +
    +
    没有查询到相关内容
    -
    暂无数据
    +
    你还没有回答问题哦~
    @@ -78,6 +79,7 @@ export default { }; }, methods: { + getList() { this.queryObj.pageIndex = 1; this.isSearh = true; @@ -90,8 +92,10 @@ export default { .then(res => { if (res.status == 200) { this.total = res.result.count; - res = res.result.list; - this.qaList = res; + res.result.list.forEach(item => { + item.isAll = false; + }); + this.qaList = res.result.list; } }) .catch(err => { From 4e43296bf6bf56f10e04cfc538beaf1815287a99 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Tue, 18 Oct 2022 19:12:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BB=96=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=95=99=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homepage/leavingMessage.vue | 61 ++++++++++++++++++--------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/src/views/homepage/leavingMessage.vue b/src/views/homepage/leavingMessage.vue index 0b2d5b16..e94ca51b 100644 --- a/src/views/homepage/leavingMessage.vue +++ b/src/views/homepage/leavingMessage.vue @@ -34,7 +34,7 @@
    -

    {{rep.authorInfo.name}} 个性签名:不要期待,不要假想

    +

    {{rep.authorInfo.name}} 个性签名:{{rep.authorInfo.sign}}

    {{rep.content}}

    @@ -162,7 +162,7 @@ res.result.list.forEach(item=>{ item.replysList = []; item.isReplys = false; - item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null } + item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' } if(item.replys != '') { item.replysList = JSON.parse(item.replys); } @@ -189,24 +189,45 @@ }) }, getUserData(list) { - let ids = list.map(item=> item.aid); - const noReapetIds = [...new Set(ids)]; - apiUser.getByIds(noReapetIds).then(res => { - if (res.status == 200) { - list.forEach((item, index) => { - res.result.some(author => { - if (author.aid == item.aid) { - item.authorInfo = author; - return true; - } else { - return false; - } - }); - }); - } else { - this.$message.error(res.message); - } - }); + if(this.pageId == this.userInfo.aid) { + let ids = list.map(item=> item.aid); + const noReapetIds = [...new Set(ids)]; + apiUser.getByIds(noReapetIds).then(res => { + if (res.status == 200) { + list.forEach((item, index) => { + res.result.some(author => { + if (author.aid == item.aid) { + item.authorInfo = author; + return true; + } else { + return false; + } + }); + }); + } else { + this.$message.error(res.message); + } + }); + } else { + let ids = list.map(item=> item.sysCreateAid); + const noReapetIds = [...new Set(ids)]; + apiUser.getByIds(noReapetIds).then(res => { + if (res.status == 200) { + list.forEach((item, index) => { + res.result.some(author => { + if (author.aid == item.sysCreateAid) { + item.authorInfo = author; + return true; + } else { + return false; + } + }); + }); + } else { + this.$message.error(res.message); + } + }); + } }, handleSizeChange(val) { this.page.pageSize = val;