Commit 9a3bfd85 by xiongyuwen

no message

parent d17eed53
...@@ -159,8 +159,8 @@ export default { ...@@ -159,8 +159,8 @@ export default {
mounted() { mounted() {
// 获取cookies拿到token // 获取cookies拿到token
var token = this.getCookie("BailunToken"); var token = this.getCookie("BailunToken");
// var token = // var token =
// "Bearer%20eyJhbGciOiJSUzI1NiIsImtpZCI6IjQ1ZmMzZDYzYjRmNGM5YjAzMWVhNjQ0MzhhNTE1NmM3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2MTAxNzMxNTAsImV4cCI6MTYxMDIwOTE1MCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo1MDAxIiwiYXVkIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NTAwMS9yZXNvdXJjZXMiLCJiYWlsdW5BcGkiXSwiY2xpZW50X2lkIjoiYmFpbHVuQ2xpZW50Iiwic3ViIjoi54aK6KOV5paHIiwiYXV0aF90aW1lIjoxNjEwMTczMTUwLCJpZHAiOiJsb2NhbCIsIlVzZXJJZCI6IjI5MjEyNzAiLCJXeFVzZXJJZCI6Inhpb25neXV3ZW4iLCJzdWNlc3NzIjoidHJ1ZSIsIkNvbXBhbnkiOiJ7XCJJZFwiOjEsXCJDb21wYW55Q29kZVwiOlwiYmFpbHVuXCIsXCJDb21wYW55TmFtZVwiOlwi5bm_5bee55m-5Lym5L6b5bqU6ZO-56eR5oqA5pyJ6ZmQ5YWs5Y-4XCJ9IiwiQWxsQ29tcGFueSI6IkZhbHNlIiwiVXNlckNvZGVOZXciOiJCTDE4ODQiLCJVc2VyQ29kZSI6IkJMNTU2NjkyMiIsIk9hVXNlcklkIjoiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3RvbSJdfQ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joiMzk4OCIsIkRlcGFydG1lbnQiOiJ7XCJEZXBhcnRtZW50SWRcIjoyNTYsXCJOYW1lXCI6XCLliIrnmbvlsI_nu4RcIixcIkNvZGVcIjpcIlwifSIsInNjb3BlIjpbIm9wZW5pZCIsInByb2ZpbGUiLCJiYWlsdW5BcGkiXSwiYW1yIjpbImN1c3RvbSJdfQ.LWd_QutKJiG_zgE8kW2om5I5SB-rEA-c4LHvDZ0CzMLDGNNq-n40WodpD6W3W0nncKSObmvAycGo4Ko5bboAdP4zJykpoHEqSZ2naOZGwpvq8YnE50Ce0Nw1QgLWm0sXdNK6AfxItT04MOqjmhGrZ3KkQsS6VujXFCxBq1Mt2aVjhAgZjH5MKNMrPBuFN2h1l-fDWsjDoJw7JBNQQOJ2PlXHTCXIKLN3GzLt7VTmUa1Up8UozfoXu2k5Vzl5tCrNgGIUAmgdvME_I_eE3M-Klmqa6Tb2XfSRGqkmc7fnbF79ni4YtvxgYhQHAl-v9BNJF3OtQKXnGtGSaUC8rMTxzg";
var token = token.replace("Bearer%20", "").replace("Bearer ", ""); var token = token.replace("Bearer%20", "").replace("Bearer ", "");
if (token) { if (token) {
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
// 更加微信用户id获取对应得用户信息并返回 // 更加微信用户id获取对应得用户信息并返回
axios axios
.get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`) .get(`http://discuz.bailuntec.com/api/login?useid=${wxUserid}`)
//.get(`http://discuz.bailuntec.com/api/login?useid=chenzekai`)
.then(res => { .then(res => {
if (res.data.data.relationships.users.data.id) { if (res.data.data.relationships.users.data.id) {
localStorage.setItem( localStorage.setItem(
......
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
onClickContent(e) { onClickContent(e) {
const event = e || window.event; const event = e || window.event;
const target = event.target || event.srcElement; const target = event.target || event.srcElement;
if (target.nodeName.toLocaleLowerCase() !== 'a') { if (target.nodeName.toLocaleLowerCase() !== 'a') {
this.toDetail(); this.toDetail();
} }
}, },
......
<template> <template>
<div class="notice-item"> <div class="notice-item">
<div class="avatar"> <div class="avatar">
<div <div v-if="item.type === 'system'" class="system-avatar">
v-if="item.type === 'system'" <svg-icon type="system-notice" class="icon" />
class="system-avatar"
>
<svg-icon
type="system-notice"
class="icon"
/>
</div> </div>
<avatar <avatar
v-else 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" :size="50"
/> />
</div> </div>
...@@ -23,42 +21,56 @@ ...@@ -23,42 +21,56 @@
v-if="item.user_name" v-if="item.user_name"
:to="`/user/${item.user_id}`" :to="`/user/${item.user_id}`"
class="user-name" class="user-name"
>{{ item.user_name }} >{{ item.user_name }}
</nuxt-link> </nuxt-link>
<span class="text"> <span class="text">
<template v-if="item.type === 'questioned'"> <template v-if="item.type === 'questioned'">
<template v-if="item.is_answer === 0"> <template v-if="item.is_answer === 0">
{{ $t('notice.questions') }} {{ $t("notice.questions") }}
</template> </template>
<template v-if="item.is_answer === 1"> <template v-if="item.is_answer === 1">
{{ $t('notice.answersMe') }} {{ $t("notice.answersMe") }}
</template> </template>
</template> </template>
<template v-else-if="item.type === 'rewarded'"> <template v-else-if="item.type === 'rewarded'">
<template v-if="item.isScale"> <template v-if="item.isScale">
{{ item.order_type === 1 {{
? typeMap['registerScale'] : item.order_type === 2 item.order_type === 1
? typeMap['rewardScale'] : item.order_type === 3 ? typeMap["registerScale"]
? typeMap['payScale'] : typeMap[item.type] }} : item.order_type === 2
? typeMap["rewardScale"]
: item.order_type === 3
? typeMap["payScale"]
: typeMap[item.type]
}}
</template> </template>
<template v-else-if="item.order_type === 3">{{ typeMap['payMe'] }}</template> <template v-else-if="item.order_type === 3">{{
<template v-else-if="item.order_type === 5">{{ typeMap['questions'] }}</template> typeMap["payMe"]
<template v-else-if="item.order_type === 6">{{ typeMap['watchedMe'] }}</template> }}</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 v-else>{{ typeMap[item.type] }}</template>
</template> </template>
<template v-else>{{ typeMap[item.type] }}</template> <template v-else>{{ typeMap[item.type] }}</template>
</span> </span>
</template> </template>
<div <div v-if="item.title && item.type === 'system'" class="user-name">
v-if="item.title && item.type === 'system'" {{ item.title }}
class="user-name" </div>
>{{ item.title }}</div> <div class="time">
<div class="time">{{ timerDiff(item.created_at) + $t('topic.before') }}</div> {{ timerDiff(item.created_at) + $t("topic.before") }}
</div>
</div> </div>
<nuxt-link <nuxt-link
v-if="item.post_content" v-if="item.post_content"
:to="`/thread/comment?threadId=${item.thread_id}&commentId=${item.reply_post_id !== 0 :to="`/thread/comment?threadId=${item.thread_id}&commentId=${
? item.reply_post_id : item.post_id}`" item.reply_post_id !== 0 ? item.reply_post_id : item.post_id
}`"
class="post-content" class="post-content"
v-html="$xss(item.post_content)" v-html="$xss(item.post_content)"
/> />
...@@ -68,8 +80,38 @@ ...@@ -68,8 +80,38 @@
class="post-content" class="post-content"
v-html="$xss(item.answer_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 <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}`" :to="`/thread/${item.thread_id}`"
class="thread" class="thread"
target="_blank" target="_blank"
...@@ -86,69 +128,88 @@ ...@@ -86,69 +128,88 @@
/> />
</div> </div>
<div class="to-detail">{{ $t('notice.toDetail') }}</div> <div class="to-detail">{{ $t('notice.toDetail') }}</div>
</nuxt-link> </nuxt-link> -->
<div <div
v-if="item.type === 'system'" v-if="item.type === 'system'"
class="post-content" class="post-content"
v-html="$xss(item.content)" v-html="$xss(item.content)"
/> />
<div <div v-if="item.type === 'withdrawal'" class="thread">
v-if="item.type === 'withdrawal'" <template v-if="item.cash_status === 2">{{
class="thread" $t("notice.approved")
> }}</template>
<template v-if="item.cash_status === 2">{{ $t('notice.approved') }}</template> <template v-if="item.cash_status === 3">{{
<template v-if="item.cash_status === 3">{{ $t('notice.unapproved') }}</template> $t("notice.unapproved")
}}</template>
</div> </div>
<div <div
v-if="item.type === 'withdrawal' && item.cash_actual_amount" v-if="item.type === 'withdrawal' && item.cash_actual_amount"
class="amount green" class="amount green"
> >
- {{ $t('post.yuanItem') + item.cash_actual_amount }} - {{ $t("post.yuanItem") + item.cash_actual_amount }}
</div> </div>
<div <div v-if="item.type === 'rewarded' && item.amount" class="amount">
v-if="item.type === 'rewarded' && item.amount" + {{ $t("post.yuanItem") + item.amount }}
class="amount"
>
+ {{ $t('post.yuanItem') + item.amount }}
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import handleError from '@/mixin/handleError'; import handleError from "@/mixin/handleError";
import timerDiff from '@/mixin/timerDiff'; import timerDiff from "@/mixin/timerDiff";
import axios from "@/plugins/axios.js";
import config from "@/config.js";
export default { export default {
name: 'NoticeItem', name: "NoticeItem",
mixins: [timerDiff, handleError], mixins: [timerDiff, handleError],
props: { props: {
item: { item: {
type: Object, type: Object,
default: () => { } default: () => {},
} },
}, },
data() { data() {
return { return {
typeMap: { typeMap: {
related: this.$t('notice.relatedMe'), related: this.$t("notice.relatedMe"),
replied: this.$t('notice.repliedMe'), replied: this.$t("notice.repliedMe"),
liked: this.$t('notice.likedMe'), liked: this.$t("notice.likedMe"),
rewarded: this.$t('notice.rewardedMe'), rewarded: this.$t("notice.rewardedMe"),
payMe: this.$t('notice.payMe'), payMe: this.$t("notice.payMe"),
registerScale: this.$t('notice.registerScale'), registerScale: this.$t("notice.registerScale"),
rewardScale: this.$t('notice.rewardScale'), rewardScale: this.$t("notice.rewardScale"),
payScale: this.$t('notice.payScale'), payScale: this.$t("notice.payScale"),
system: this.$t('notice.system'), system: this.$t("notice.system"),
questions: this.$t('notice.questions'), questions: this.$t("notice.questions"),
watchedMe: this.$t('notice.watchedMe'), watchedMe: this.$t("notice.watchedMe"),
payedMe: this.$t('notice.payedMe'), payedMe: this.$t("notice.payedMe"),
answersMe: this.$t('notice.answersMe'), answersMe: this.$t("notice.answersMe"),
questioned: this.$t('notice.questions') questioned: this.$t("notice.questions"),
} },
}; };
}, },
methods: { 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -246,6 +307,7 @@ export default { ...@@ -246,6 +307,7 @@ export default {
} }
.to-detail { .to-detail {
color: $color-blue-base; color: $color-blue-base;
cursor: pointer;
} }
} }
.amount { .amount {
...@@ -254,8 +316,8 @@ export default { ...@@ -254,8 +316,8 @@ export default {
font-weight: bold; font-weight: bold;
color: #fa5151; color: #fa5151;
} }
.green{ .green {
color: #09BB07; color: #09bb07;
} }
} }
} }
......
...@@ -5,6 +5,6 @@ export default { ...@@ -5,6 +5,6 @@ export default {
DEV_API_URL: 'http://discuz.bailuntec.com', DEV_API_URL: 'http://discuz.bailuntec.com',
// ssr api url // ssr api url
SSR_API_URL: 'http://discuz.bailuntec.com', SSR_API_URL: 'http://discuz.bailuntec.com',
// WEI_PAN_URL: 'http://localhost:5008' WEI_PAN_URL: 'http://localhost:5008'
WEI_PAN_URL: 'http://pps.bailuntec.com/DiscuzApi' //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