bi-element-ui 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bi-element-ui",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "private": false,
5
5
  "description": "基于element-ui编写的ui组件库",
6
6
  "main": "lib/bi-element-ui.common.js",
package/src/App.vue CHANGED
@@ -7,6 +7,7 @@
7
7
  <router-link to="/date">date</router-link>
8
8
  <router-link to="/scene">场景使用</router-link>
9
9
  <router-link to="/table">Table</router-link>
10
+ <router-link to="/showData">Data</router-link>
10
11
  </div>
11
12
  </el-aside>
12
13
  <el-main>
@@ -24,6 +24,11 @@ const routes = [
24
24
  path: '/table',
25
25
  name: 'Table',
26
26
  component: () => import(/* webpackChunkName: "about" */ '../views/Table.vue')
27
+ },
28
+ {
29
+ path: '/showData',
30
+ name: 'showData',
31
+ component: () => import(/* webpackChunkName: "about" */ '../views/showData.vue')
27
32
  }
28
33
  ]
29
34
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,369 @@
1
+ <template>
2
+ <div class="content">
3
+ <div class="swiper">
4
+ <el-carousel class="swiper_data" height="19.5vw" :autoplay="true">
5
+ <el-carousel-item v-for="(item, index) in swiperData" :key="index">
6
+ <div class="swiper_content" :style="'background: url(' + item.image_path + ') no-repeat;background-size: 100% 100%;'" @click="swiperClick(item)"></div>
7
+ </el-carousel-item>
8
+ </el-carousel>
9
+ </div>
10
+ <div class="data">
11
+ <div class="data_search">
12
+ <el-input placeholder="输入标题/关键字" v-model="searchData.combination" size="small" style="width:14vw;">
13
+ <el-button icon="el-icon-search" slot="append" style="width:3vw;height:32px;" @click="clickSearch"></el-button>
14
+ </el-input>
15
+ <div>
16
+ <el-button v-for="(item, index) in options.buttonList" :key="index" size="small" style="width:84px;height:32px;" @click="buttonClick(item.value)">{{ item.label }}</el-button>
17
+ </div>
18
+ </div>
19
+ <div class="data_content">
20
+ <div v-for="(item, index) in messageData" :key="index" class="message_item" @click="getDataDetail(item)">
21
+ <div class="item_title">
22
+ <img :src="returnCategoryImg(item.category_id)" alt="" />
23
+ <p>{{ returnCategory(item.category_id) }}</p>
24
+ </div>
25
+ <div class="item_content">
26
+ <img :src="item.cover_image" alt="" />
27
+ <div class="content_content">
28
+ <div class="content_title">{{ item.title }}</div>
29
+ <div class="content_desc">{{ item.short_desc }}</div>
30
+ <div class="content_time">{{ item.create_time }}</div>
31
+ </div>
32
+ </div>
33
+ <img v-if="!item.is_read" class="is_read" src="./img/new.png" alt="" />
34
+ </div>
35
+ </div>
36
+ </div>
37
+ <el-drawer title="消息详情" :visible.sync="dataDetail.isShow" direction="rtl" :size="560" :before-close="handleClose">
38
+ <div class="detail">
39
+ <div class="detail_title">{{ dataDetail.data.title }}</div>
40
+ <div class="detail_time">{{ dataDetail.data.create_time }}</div>
41
+ <div class="detail_desc">{{ dataDetail.data.short_desc }}</div>
42
+ <div class="detail_content">
43
+ <div class="content_content" v-html="dataDetail.data.content"></div>
44
+ </div>
45
+ </div>
46
+ </el-drawer>
47
+ </div>
48
+ </template>
49
+
50
+ <script>
51
+ import moment from 'moment'
52
+ import axios from 'axios'
53
+ export default {
54
+ name: 'HomeData',
55
+ props: {
56
+ userId: {
57
+ type: String,
58
+ default: '1919'
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ uid: '',
64
+ searchData: {
65
+ uid: '1919',
66
+ combination: '',
67
+ category_id: ''
68
+ },
69
+ url: 'http://applause.zwwlkj03.top/api',
70
+ options: {
71
+ buttonList: []
72
+ },
73
+ swiperData: [],
74
+ messageData: [],
75
+ dataDetail: {
76
+ isShow: false,
77
+ data: {}
78
+ }
79
+ }
80
+ },
81
+ mounted() {
82
+ this.uid = this.userId
83
+ this.searchData.uid = this.userId
84
+ this.init()
85
+ },
86
+ methods: {
87
+ init() {
88
+ this.Searchcondition()
89
+ this.getSwiper()
90
+ this.getMessage()
91
+ },
92
+ swiperClick(item) {
93
+ if (item.type === '1') {
94
+ window.open(item.jump_url, '_blank')
95
+ }
96
+ if (item.type === '2') {
97
+ this.getDetail(this.uid, item.notify_id)
98
+ }
99
+ },
100
+ clickSearch() {
101
+ this.searchData.category_id = ''
102
+ this.getMessage()
103
+ },
104
+ buttonClick(id) {
105
+ this.searchData.category_id = id
106
+ this.getMessage()
107
+ },
108
+ async Searchcondition() {
109
+ const res = await axios.post(this.url + '/home/Searchcondition/index', { uid: this.uid, notify_category: 1 })
110
+ if (res.data.status_code === 1) {
111
+ this.options.buttonList = res.data.data.notify_category
112
+ }
113
+ },
114
+ async getMessage() {
115
+ const res = await axios.post(this.url + '/home/notify/list', this.searchData)
116
+ if (res.data.status_code === 1) {
117
+ this.messageData = res.data.data.data
118
+ }
119
+ },
120
+ async getSwiper() {
121
+ const res = await axios.post(this.url + '/home/carousel/list', { uid: this.uid })
122
+ if (res.data.status_code === 1) {
123
+ this.swiperData = res.data.data.data
124
+ }
125
+ },
126
+ returnCategory(id) {
127
+ const list = this.options.buttonList.filter(data => {
128
+ return data.value === id
129
+ })
130
+ if (list.length) {
131
+ return list[0].label
132
+ } else {
133
+ return '掌资讯'
134
+ }
135
+ },
136
+ returnCategoryImg(id) {
137
+ switch (id) {
138
+ case '1':
139
+ return require('./img/1.png')
140
+ break
141
+ case '2':
142
+ return require('./img/2.png')
143
+ break
144
+ case '3':
145
+ return require('./img/3.png')
146
+ break
147
+ case '4':
148
+ return require('./img/4.png')
149
+ break
150
+ default:
151
+ return require('./img/1.png')
152
+ }
153
+ },
154
+ getDataDetail(data) {
155
+ this.sendRaed(data)
156
+ this.getDetail(this.uid, data.id)
157
+ },
158
+ // 数据已读
159
+ async sendRaed(data) {
160
+ const res = await axios.post(this.url + '/home/notify/read', { uid: this.uid, notify_id: data.id })
161
+ if (res.data.status_code === 1) {
162
+ data.is_read = true
163
+ }
164
+ },
165
+ // 数据详情
166
+ async getDetail(uid, notify_id) {
167
+ const res = await axios.post(this.url + '/home/notify/detail', { uid, notify_id })
168
+ if (res.data.status_code === 1) {
169
+ this.dataDetail.data = res.data.data.data
170
+ this.dataDetail.isShow = true
171
+ }
172
+ },
173
+ handleClose() {
174
+ this.dataDetail.isShow = false
175
+ }
176
+ }
177
+ }
178
+ </script>
179
+
180
+ <style lang="scss" scoped>
181
+ .content {
182
+ width: 100%;
183
+ background: #ffffff;
184
+ border-radius: 2px;
185
+ .swiper {
186
+ width: 100%;
187
+ height: 19.5vw;
188
+ .swiper_data {
189
+ .swiper_content {
190
+ width: 100%;
191
+ height: 19.5vw;
192
+ background: url(./img/swiperBg.png) no-repeat;
193
+ background-size: 100% 100%;
194
+ display: flex;
195
+ box-sizing: border-box;
196
+ padding: 1.5vw 6vw;
197
+ .swiper_message {
198
+ .title {
199
+ width: 31.5vw;
200
+ height: 3vw;
201
+ font-size: 2.1vw;
202
+ font-weight: 500;
203
+ color: #333333;
204
+ line-height: 3vw;
205
+ }
206
+ .desc {
207
+ width: 31.5vw;
208
+ height: 1.1vw;
209
+ font-size: 0.8vw;
210
+ font-weight: 400;
211
+ color: #333333;
212
+ line-height: 1.1vw;
213
+ margin-top: 1.5vw;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ .data {
220
+ .data_search {
221
+ margin: 1vw 3.5vw;
222
+ display: flex;
223
+ justify-content: space-between;
224
+ }
225
+ .data_content {
226
+ margin: 0 3.5vw;
227
+ display: flex;
228
+ justify-content: space-between;
229
+ flex-wrap: wrap;
230
+ .message_item {
231
+ width: 37vw;
232
+ height: 9vw;
233
+ background: #f8f8fa;
234
+ box-shadow: 0px 0.1vw 0.45vw 0px rgba(168, 203, 255, 0.36);
235
+ border-radius: 0.2vw;
236
+ border: 0.1vw solid #ffffff;
237
+ margin-bottom: 1.5vw;
238
+ box-sizing: border-box;
239
+ padding: 1vw;
240
+ position: relative;
241
+ left: 0;
242
+ top: 0;
243
+ &:nth-child(3) {
244
+ margin-bottom: 0;
245
+ }
246
+ &:nth-child(4) {
247
+ margin-bottom: 0;
248
+ }
249
+ .item_title {
250
+ display: flex;
251
+ height: 1vw;
252
+ img {
253
+ width: 1vw;
254
+ height: 1vw;
255
+ }
256
+ p {
257
+ height: 1vw;
258
+ line-height: 1vw;
259
+ margin: 0 0 0 0.5vw;
260
+ }
261
+ }
262
+ .item_content {
263
+ margin-top: 1.6vw;
264
+ display: flex;
265
+ img {
266
+ width: 4vw;
267
+ height: 4vw;
268
+ margin-right: 1.2vw;
269
+ }
270
+ .content_content {
271
+ width: 31vw;
272
+ position: relative;
273
+ top: 0;
274
+ left: 0;
275
+ .content_title {
276
+ max-width: 20vw;
277
+ height: 1.1vw;
278
+ font-size: 0.8vw;
279
+ font-weight: 500;
280
+ color: #333333;
281
+ line-height: 1.1vw;
282
+ overflow: hidden;
283
+ white-space: nowrap;
284
+ text-overflow: ellipsis;
285
+ }
286
+ .content_desc {
287
+ max-width: 26vw;
288
+ height: 1vw;
289
+ margin-top: 0.8vw;
290
+ font-size: 0.7vw;
291
+ font-weight: 400;
292
+ color: #333333;
293
+ line-height: 1vw;
294
+ overflow: hidden;
295
+ white-space: nowrap;
296
+ text-overflow: ellipsis;
297
+ }
298
+ .content_time {
299
+ position: absolute;
300
+ left: 22vw;
301
+ top: 0.05vw;
302
+ width: 8vw;
303
+ height: 1vw;
304
+ font-size: 0.7vw;
305
+ font-weight: 400;
306
+ color: #333333;
307
+ line-height: 1vw;
308
+ overflow: hidden;
309
+ white-space: nowrap;
310
+ text-overflow: ellipsis;
311
+ }
312
+ }
313
+ }
314
+ .is_read {
315
+ position: absolute;
316
+ right: 0.1vw;
317
+ top: 0.3vw;
318
+ width: 1.5vw;
319
+ height: 0.8vw;
320
+ }
321
+ }
322
+ }
323
+ }
324
+ .detail {
325
+ width: 100%;
326
+ box-sizing: border-box;
327
+ padding: 0 20px;
328
+ .detail_title {
329
+ width: 440px;
330
+ height: 22px;
331
+ font-size: 16px;
332
+ font-weight: 500;
333
+ color: #333333;
334
+ line-height: 22px;
335
+ overflow: hidden;
336
+ white-space: nowrap;
337
+ text-overflow: ellipsis;
338
+ }
339
+ .detail_time {
340
+ width: 320px;
341
+ height: 16px;
342
+ margin-top: 12px;
343
+ font-size: 12px;
344
+ font-weight: 400;
345
+ color: #999999;
346
+ line-height: 16px;
347
+ overflow: hidden;
348
+ white-space: nowrap;
349
+ text-overflow: ellipsis;
350
+ }
351
+ .detail_desc {
352
+ margin-top: 24px;
353
+ width: 500px;
354
+ font-size: 14px;
355
+ font-weight: 400;
356
+ color: #333333;
357
+ line-height: 20px;
358
+ }
359
+ .detail_content {
360
+ width: 520px;
361
+ margin-top: 24px;
362
+ overflow-y: auto;
363
+ .content_content {
364
+ width: 500px;
365
+ }
366
+ }
367
+ }
368
+ }
369
+ </style>
@@ -1 +0,0 @@
1
- .example-table-box[data-v-a1daa0cc]{margin:25px 50px}.example-table-box p[data-v-a1daa0cc]{text-align:left;font-weight:700}.example-table-box[data-v-553b4a77]{margin:25px 50px}.example-table-box p[data-v-553b4a77]{text-align:left;font-weight:700}