|
@@ -1,31 +1,63 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
<admin-frame @search="search" :limit="limit" :total="total" :useNav="false">
|
|
|
- <template v-slot:info> 交流互动 </template>
|
|
|
+ <template v-slot:info>
|
|
|
+ <list-1 :list="list" @detail="detail"></list-1>
|
|
|
+ </template>
|
|
|
</admin-frame>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import list1 from './parts/list-1.vue';
|
|
|
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: column } = createNamespacedHelpers('column');
|
|
|
+const { mapActions: news } = createNamespacedHelpers('news');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
adminFrame,
|
|
|
+ list1,
|
|
|
},
|
|
|
data: function () {
|
|
|
return {
|
|
|
+ // 栏目信息
|
|
|
+ columnInfo: {},
|
|
|
+ list: [],
|
|
|
limit: 5,
|
|
|
total: 0,
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
- await this.search();
|
|
|
+ await this.searchOther();
|
|
|
},
|
|
|
methods: {
|
|
|
- async search({ skip = 0, limit = 10, ...info } = {}) {},
|
|
|
+ ...column({ columnQuery: 'query' }),
|
|
|
+ ...news(['query']),
|
|
|
+ async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
|
+ info.column_id = this.columnInfo.id;
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ detail(data) {
|
|
|
+ this.$router.push({ path: '/service/interflow/detail', query: { id: data.id } });
|
|
|
+ },
|
|
|
+ // 查询其他
|
|
|
+ async searchOther() {
|
|
|
+ let res = await this.columnQuery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let data = res.data.find((i) => i.site == 'xsjl');
|
|
|
+ console.log(data);
|
|
|
+ if (data) this.$set(this, `columnInfo`, data);
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|