1
PC-20250623MANY\Administrator
2025-09-17 cdd46caef517696298e394579d6819fa0ca8388d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<template>
  <div class="news page-content">
    <div class="box_head">
      <div class="page-w2 head_content flex-between">
        <div class="head_left flex-center">
          <img src="@/assets/images/news_icon.png" alt="news Investment" />
          <span>{{ $t("hj6") }}</span>
        </div>
      </div>
    </div>
 
    <template v-if="tableData && tableData.length > 0">
      <div class="box_content page-w2">
        <div class="content_item" v-for="i in tableData" :key="i.id" @click="buyOpen(i)">
          <el-row :gutter="20">
            <el-col :span="18">
              <div class="flex-start item_label">
                <div class="label_1">{{ i.title }}</div>
              </div>
              <div class="flex-start item_label">
                <div class="label_2">{{ i.showTime | gettime }}</div>
              </div>
            </el-col>
 
            <el-col :span="6">
              <img :src="i.imgurl" alt="" class="item_img" />
            </el-col>
          </el-row>
        </div>
      </div>
 
      <div class="flex-end page-w2">
        <el-pagination
          background
          layout="prev, pager, next"
          :total="total"
          :current-page="pageNum"
          :page-size="pageSize"
          @current-change="handleCurrentChange"
        >
        </el-pagination>
      </div>
    </template>
 
    <el-empty :description="$t('zwsj')" v-else></el-empty>
 
    <Details
      :dialogVisible.sync="buyVisible"
      v-if="buyVisible"
      :dataObj="openObj"
      @onClose="onClose"
    ></Details>
  </div>
</template>
 
<script>
import * as api from "@/axios/api";
import Details from "./components/Details";
import mixins from "@/mixins/myMixins"; // 混入
export default {
  name: "news",
  mixins: [mixins],
  components: {
    Details,
  },
  data() {
    return {
      // 列表参数,必须是opt和myMixins混入配合使用
      opt: {
        type: 1,
      },
      buyVisible: false,
      openObj: {}, // 打开弹窗的数据
    };
  },
  created() {
    this.apiInterface = api.getNewsList; // 赋值接口
    this.init(); // 获取列表
  },
  methods: {
    // 打开详情弹窗
    buyOpen(item) {
      this.openObj = item; // 赋值
      this.buyVisible = true; // 打开弹窗
    },
    // 关闭弹窗
    onClose() {
      this.openObj = {};
    },
  },
};
</script>
 
<style lang="scss" scoped>
.news {
  .box_content {
    padding: 16px 0;
    .content_item {
      border: 1px solid #f1f1f1;
      border-radius: 16px;
      padding: 10px;
      margin: 16px 0;
      background-color: #444;
      font-size: 14px;
      cursor: pointer;
      .item_img {
        width: 200px;
        height: auto;
        border-radius: 10px;
      }
      .item_head {
        font-size: 16px;
        margin-bottom: 20px;
      }
      .item_label {
        padding-bottom: 16px;
        .label_1 {
          color: #ccc;
          font-size: 18px;
          //   margin-right: 28px;
        }
        .label_2 {
          font-size: 16px;
          color: #aaa;
        }
      }
    }
  }
  .box_head {
    background-color: #444;
 
    .head_content {
      padding: 32px 0;
 
      .head_left {
        font-size: 28px;
        font-weight: 700;
 
        img {
          width: 32px;
          height: 32px;
          margin-right: 8px;
        }
      }
    }
  }
}
</style>