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/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; +} 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/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; 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 => { 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:'累计',