| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <div class="home_page">
- <div class="title">
- <span>咨询列表</span>
- </div>
- <div>
- <div
- v-for="(item, index) of 6"
- :key="index"
- class="li"
- >
- <div class="li_top">
- <div class="li_left">
- <span>标题</span>
- <span class="hint">作者</span>
- </div>
- <!-- <img src="@/assets/img/rightArrows.png" class="li_img" /> -->
- </div>
- <div class="text">
- <span>我是测试啊</span>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { post } from "@/request/api.js";
- export default {
- data() {
- return {
- noticeList: [],
- page: 1,
- pageSize: 10, //页数
- totalPage: 0, //总页数
- loading: false,
- finished: false,
- };
- },
- methods: {
- //跳转
- init() {
- if (this.account) {
- this.getNoticeList();
- }
- },
- getNoticeList() {
- let data = {
- page: this.page,
- page_size: this.pageSize,
- };
- basicApi.noticeList(data).then((res) => {
- if (res.code == 200) {
- this.noticeList = this.noticeList.concat(res.data.list);
- this.totalPage = Math.ceil(res.data.total_count / this.pageSize);
- this.page++;
- this.loading = false;
- if (this.page > this.totalPage) return (this.finished = true);
- } else {
- this.$toast(res.msg);
- }
- });
- },
- switchovers(route, item) {
- if (route == "") return this.$toast(this.$t("lang.swap109"));
- this.$router.push({ name: route, query: { item: JSON.stringify(item) } });
- // this.$Router.pushPage({
- // name: route
- // })
- },
- },
- computed: {
- ...mapState(["account"]),
- },
- created() {
- this.init();
- },
- watch: {
- account() {
- this.init();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .home_page {
- padding: 20px;
- }
- .title {
- color: #fff;
- margin: 20px 0;
- }
- .li {
- background: #232b3e;
- border-radius: 8px;
- padding: 10px;
- margin-bottom: 20px;
- .li_top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1px solid #2a272a;
- padding-bottom: 10px;
- .li_left {
- display: flex;
- flex-direction: column;
- font-size: 14px;
- color: #fff;
- .hint {
- color: #999;
- font-size: 12px;
- margin-top: 6px;
- }
- }
- .li_img {
- width: 10px;
- height: 10px;
- }
- }
- .text {
- color: #999;
- font-size: 12px;
- margin-top: 10px;
- }
- }
- .bare {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translateX(-50%) translateY(-50%);
- display: flex;
- flex-direction: column;
- align-items: center;
- font-size: 14px;
- padding: 40px 0;
- .bare_img {
- width: 120px;
- height: 100px;
- margin-bottom: 8px;
- }
- }
- </style>
|