Commit 9a3bfd85 by xiongyuwen

no message

parent d17eed53
......@@ -171,6 +171,7 @@ export default {
// 更加微信用户id获取对应得用户信息并返回
axios
.get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`)
//.get(`http://discuz.bailuntec.com/api/login?useid=chenzekai`)
.then(res => {
if (res.data.data.relationships.users.data.id) {
localStorage.setItem(
......
<template>
<div class="notice-item">
<div class="avatar">
<div
v-if="item.type === 'system'"
class="system-avatar"
>
<svg-icon
type="system-notice"
class="icon"
/>
<div v-if="item.type === 'system'" class="system-avatar">
<svg-icon type="system-notice" class="icon" />
</div>
<avatar
v-else
:user="{ id: item.user_id,username: item.user_name, avatarUrl: item.user_avatar}"
:user="{
id: item.user_id,
username: item.user_name,
avatarUrl: item.user_avatar,
}"
:size="50"
/>
</div>
......@@ -28,37 +26,51 @@
<span class="text">
<template v-if="item.type === 'questioned'">
<template v-if="item.is_answer === 0">
{{ $t('notice.questions') }}
{{ $t("notice.questions") }}
</template>
<template v-if="item.is_answer === 1">
{{ $t('notice.answersMe') }}
{{ $t("notice.answersMe") }}
</template>
</template>
<template v-else-if="item.type === 'rewarded'">
<template v-if="item.isScale">
{{ item.order_type === 1
? typeMap['registerScale'] : item.order_type === 2
? typeMap['rewardScale'] : item.order_type === 3
? typeMap['payScale'] : typeMap[item.type] }}
{{
item.order_type === 1
? typeMap["registerScale"]
: item.order_type === 2
? typeMap["rewardScale"]
: item.order_type === 3
? typeMap["payScale"]
: typeMap[item.type]
}}
</template>
<template v-else-if="item.order_type === 3">{{ typeMap['payMe'] }}</template>
<template v-else-if="item.order_type === 5">{{ typeMap['questions'] }}</template>
<template v-else-if="item.order_type === 6">{{ typeMap['watchedMe'] }}</template>
<template v-else-if="item.order_type === 3">{{
typeMap["payMe"]
}}</template>
<template v-else-if="item.order_type === 5">{{
typeMap["questions"]
}}</template>
<template v-else-if="item.order_type === 6">{{
typeMap["watchedMe"]
}}</template>
<template v-else>{{ typeMap[item.type] }}</template>
</template>
<template v-else>{{ typeMap[item.type] }}</template>
</span>
</template>
<div
v-if="item.title && item.type === 'system'"
class="user-name"
>{{ item.title }}</div>
<div class="time">{{ timerDiff(item.created_at) + $t('topic.before') }}</div>
<div v-if="item.title && item.type === 'system'" class="user-name">
{{ item.title }}
</div>
<div class="time">
{{ timerDiff(item.created_at) + $t("topic.before") }}
</div>
</div>
<nuxt-link
v-if="item.post_content"
:to="`/thread/comment?threadId=${item.thread_id}&commentId=${item.reply_post_id !== 0
? item.reply_post_id : item.post_id}`"
:to="`/thread/comment?threadId=${item.thread_id}&commentId=${
item.reply_post_id !== 0 ? item.reply_post_id : item.post_id
}`"
class="post-content"
v-html="$xss(item.post_content)"
/>
......@@ -68,8 +80,38 @@
class="post-content"
v-html="$xss(item.answer_content)"
/>
<div class="thread">
<div class="thread-user-name">{{ item.thread_username }}:</div>
<div class="thread-title">
<div v-if="item.thread_title" v-html="$xss(item.thread_title)" />
<div v-else-if="item.content" v-html="$xss(item.content)" />
</div>
<div class="to-detail" @click="onClickContent(item)">
{{ $t("notice.toDetail") }}
</div>
</div>
<!-- <nuxt-link
v-if="item.fileid!=null"
:to="`/knowledge/knowledgeDetail?id=${item.fileid}&useid=${item.qywxUserid}`"
class="thread"
target="_blank"
>
<div class="thread-user-name">{{ item.thread_username }}:</div>
<div class="thread-title">
<div
v-if="item.thread_title"
v-html="$xss(item.thread_title)"
/>
<div
v-else-if="item.content"
v-html="$xss(item.content)"
/>
</div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div>
</nuxt-link>
<nuxt-link
v-if="(item.thread_title || item.content) && item.type !== 'system'"
v-if="(item.thread_title || item.content) && item.type !== 'system'&&item.fileid==null"
:to="`/thread/${item.thread_id}`"
class="thread"
target="_blank"
......@@ -86,69 +128,88 @@
/>
</div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div>
</nuxt-link>
</nuxt-link> -->
<div
v-if="item.type === 'system'"
class="post-content"
v-html="$xss(item.content)"
/>
<div
v-if="item.type === 'withdrawal'"
class="thread"
>
<template v-if="item.cash_status === 2">{{ $t('notice.approved') }}</template>
<template v-if="item.cash_status === 3">{{ $t('notice.unapproved') }}</template>
<div v-if="item.type === 'withdrawal'" class="thread">
<template v-if="item.cash_status === 2">{{
$t("notice.approved")
}}</template>
<template v-if="item.cash_status === 3">{{
$t("notice.unapproved")
}}</template>
</div>
<div
v-if="item.type === 'withdrawal' && item.cash_actual_amount"
class="amount green"
>
- {{ $t('post.yuanItem') + item.cash_actual_amount }}
- {{ $t("post.yuanItem") + item.cash_actual_amount }}
</div>
<div
v-if="item.type === 'rewarded' && item.amount"
class="amount"
>
+ {{ $t('post.yuanItem') + item.amount }}
<div v-if="item.type === 'rewarded' && item.amount" class="amount">
+ {{ $t("post.yuanItem") + item.amount }}
</div>
</div>
</div>
</template>
<script>
import handleError from '@/mixin/handleError';
import timerDiff from '@/mixin/timerDiff';
import handleError from "@/mixin/handleError";
import timerDiff from "@/mixin/timerDiff";
import axios from "@/plugins/axios.js";
import config from "@/config.js";
export default {
name: 'NoticeItem',
name: "NoticeItem",
mixins: [timerDiff, handleError],
props: {
item: {
type: Object,
default: () => { }
}
default: () => {},
},
},
data() {
return {
typeMap: {
related: this.$t('notice.relatedMe'),
replied: this.$t('notice.repliedMe'),
liked: this.$t('notice.likedMe'),
rewarded: this.$t('notice.rewardedMe'),
payMe: this.$t('notice.payMe'),
registerScale: this.$t('notice.registerScale'),
rewardScale: this.$t('notice.rewardScale'),
payScale: this.$t('notice.payScale'),
system: this.$t('notice.system'),
questions: this.$t('notice.questions'),
watchedMe: this.$t('notice.watchedMe'),
payedMe: this.$t('notice.payedMe'),
answersMe: this.$t('notice.answersMe'),
questioned: this.$t('notice.questions')
}
related: this.$t("notice.relatedMe"),
replied: this.$t("notice.repliedMe"),
liked: this.$t("notice.likedMe"),
rewarded: this.$t("notice.rewardedMe"),
payMe: this.$t("notice.payMe"),
registerScale: this.$t("notice.registerScale"),
rewardScale: this.$t("notice.rewardScale"),
payScale: this.$t("notice.payScale"),
system: this.$t("notice.system"),
questions: this.$t("notice.questions"),
watchedMe: this.$t("notice.watchedMe"),
payedMe: this.$t("notice.payedMe"),
answersMe: this.$t("notice.answersMe"),
questioned: this.$t("notice.questions"),
},
};
},
methods: {
onClickContent(item) {
let fileid=null;
axios
.get(
`${config.WEI_PAN_URL}/weipan/GetWeiPanFileByThreadId?threadId=${item.thread_id}`
)
.then((res) => {
if (res.data.statusCode == 200) {
fileid = res.data.result.fileId;
}
if (!!fileid) {
window.open(
`/knowledge/knowledgeDetail?id=${fileid}&useid=${item.qywxUserid}`,
"_blank"
);
} else {
window.open(`/thread/${item.thread_id}`, "_blank");
}
});
},
},
};
</script>
<style lang="scss" scoped>
......@@ -246,6 +307,7 @@ export default {
}
.to-detail {
color: $color-blue-base;
cursor: pointer;
}
}
.amount {
......@@ -254,8 +316,8 @@ export default {
font-weight: bold;
color: #fa5151;
}
.green{
color: #09BB07;
.green {
color: #09bb07;
}
}
}
......
......@@ -5,6 +5,6 @@ export default {
DEV_API_URL: 'http://discuz.bailuntec.com',
// ssr api url
SSR_API_URL: 'http://discuz.bailuntec.com',
// WEI_PAN_URL: 'http://localhost:5008'
WEI_PAN_URL: 'http://pps.bailuntec.com/DiscuzApi'
WEI_PAN_URL: 'http://localhost:5008'
//WEI_PAN_URL: 'http://pps.bailuntec.com/DiscuzApi'
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment