|
@@ -54,29 +54,26 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
- await this.Detail();
|
|
|
- await this.setTitle();
|
|
|
+ await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...journnews(['fetch']),
|
|
|
...scienceNews({ xwzxFetch: 'fetch' }),
|
|
|
- async Detail() {
|
|
|
- let res = await this.fetch(this.id);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `tztgInfo`, res.data);
|
|
|
- }
|
|
|
- res = await this.xwzxFetch(this.id);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `xwzxInfo`, res.data);
|
|
|
- }
|
|
|
- },
|
|
|
- //设置标题
|
|
|
- setTitle() {
|
|
|
+ //查询
|
|
|
+ async search() {
|
|
|
let type = this.type;
|
|
|
if (type == 'tztg') {
|
|
|
this.$set(this, `title`, '通知通告详情');
|
|
|
- } else if (type == 'xwzx') {
|
|
|
+ let res = await this.fetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `tztgInfo`, res.data);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.$set(this, `title`, '新闻资讯详情');
|
|
|
+ res = await this.xwzxFetch(this.id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `xwzxInfo`, res.data);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 返回首页
|