|
21 | 21 | <script> |
22 | 22 | import mediaList from '@/components/tab-nvue/mediaList.vue'; |
23 | 23 | import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'; |
| 24 | +
|
| 25 | + const tpl = { |
| 26 | + data0: { |
| 27 | + "datetime": "40分钟前", |
| 28 | + "article_type": 0, |
| 29 | + "title": "uni-app行业峰会频频亮相,开发者反响热烈!", |
| 30 | + "source": "DCloud", |
| 31 | + "comment_count": 639 |
| 32 | + }, |
| 33 | + data1: { |
| 34 | + "datetime": "一天前", |
| 35 | + "article_type": 1, |
| 36 | + "title": "DCloud完成B2轮融资,uni-app震撼发布!", |
| 37 | + "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg?imageView2/3/w/200/h/100/q/90", |
| 38 | + "source": "DCloud", |
| 39 | + "comment_count": 11395 |
| 40 | + }, |
| 41 | + data2: { |
| 42 | + "datetime": "一天前", |
| 43 | + "article_type": 2, |
| 44 | + "title": "中国技术界小奇迹:HBuilder开发者突破200万", |
| 45 | + "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/muwu.jpg?imageView2/3/w/200/h/100/q/90", |
| 46 | + "source": "DCloud", |
| 47 | + "comment_count": 11395 |
| 48 | + }, |
| 49 | + data3: { |
| 50 | + "article_type": 3, |
| 51 | + "image_list": [{ |
| 52 | + "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/cbd.jpg?imageView2/3/w/200/h/100/q/90", |
| 53 | + "width": 563, |
| 54 | + "height": 316 |
| 55 | + }, { |
| 56 | + "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/muwu.jpg?imageView2/3/w/200/h/100/q/90", |
| 57 | + "width": 641, |
| 58 | + "height": 360 |
| 59 | + }, { |
| 60 | + "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg?imageView2/3/w/200/h/100/q/90", |
| 61 | + "width": 640, |
| 62 | + "height": 360 |
| 63 | + }], |
| 64 | + "datetime": "5分钟前", |
| 65 | + "title": "uni-app 支持使用 npm 安装第三方包,生态更趋丰富", |
| 66 | + "source": "DCloud", |
| 67 | + "comment_count": 11 |
| 68 | + }, |
| 69 | + data4: { |
| 70 | + "datetime": "2小时前", |
| 71 | + "article_type": 4, |
| 72 | + "title": "uni-app 支持原生小程序自定义组件,更开放、更自由", |
| 73 | + "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/cbd.jpg?imageView2/3/w/200/h/100/q/90", |
| 74 | + "source": "DCloud", |
| 75 | + "comment_count": 69 |
| 76 | + } |
| 77 | + }; |
| 78 | +
|
24 | 79 | export default { |
25 | 80 | components: { |
26 | 81 | mediaList, |
|
37 | 92 | isClickChange: false, |
38 | 93 | tabIndex: 0, |
39 | 94 | newsitems: [], |
40 | | - data0: { |
41 | | - "datetime": "40分钟前", |
42 | | - "article_type": 0, |
43 | | - "title": "uni-app行业峰会频频亮相,开发者反响热烈!", |
44 | | - "source": "DCloud", |
45 | | - "comment_count": 639 |
46 | | - }, |
47 | | - data1: { |
48 | | - "datetime": "一天前", |
49 | | - "article_type": 1, |
50 | | - "title": "DCloud完成B2轮融资,uni-app震撼发布!", |
51 | | - "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg?imageView2/3/w/200/h/100/q/90", |
52 | | - "source": "DCloud", |
53 | | - "comment_count": 11395 |
54 | | - }, |
55 | | - data2: { |
56 | | - "datetime": "一天前", |
57 | | - "article_type": 2, |
58 | | - "title": "中国技术界小奇迹:HBuilder开发者突破200万", |
59 | | - "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/muwu.jpg?imageView2/3/w/200/h/100/q/90", |
60 | | - "source": "DCloud", |
61 | | - "comment_count": 11395 |
62 | | - }, |
63 | | - data4: { |
64 | | - "datetime": "2小时前", |
65 | | - "article_type": 4, |
66 | | - "title": "uni-app 支持原生小程序自定义组件,更开放、更自由", |
67 | | - "image_url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/cbd.jpg?imageView2/3/w/200/h/100/q/90", |
68 | | - "source": "DCloud", |
69 | | - "comment_count": 69 |
70 | | - }, |
71 | | - data3: { |
72 | | - "article_type": 3, |
73 | | - "image_list": [{ |
74 | | - "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/cbd.jpg?imageView2/3/w/200/h/100/q/90", |
75 | | - "width": 563, |
76 | | - "height": 316 |
77 | | - }, { |
78 | | - "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/muwu.jpg?imageView2/3/w/200/h/100/q/90", |
79 | | - "width": 641, |
80 | | - "height": 360 |
81 | | - }, { |
82 | | - "url": "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg?imageView2/3/w/200/h/100/q/90", |
83 | | - "width": 640, |
84 | | - "height": 360 |
85 | | - }], |
86 | | - "datetime": "5分钟前", |
87 | | - "title": "uni-app 支持使用 npm 安装第三方包,生态更趋丰富", |
88 | | - "source": "DCloud", |
89 | | - "comment_count": 11 |
90 | | - }, |
91 | 95 | tabBars: [{ |
92 | 96 | name: '关注', |
93 | 97 | id: 'guanzhu' |
|
209 | 213 | data: [] |
210 | 214 | }; |
211 | 215 | for (let j = 1; j <= 10; j++) { |
212 | | - aryItem.data.push(this['data' + Math.floor(Math.random() * 5)]); |
| 216 | + aryItem.data.push(tpl['data' + Math.floor(Math.random() * 5)]); |
213 | 217 | } |
214 | 218 | ary.push(aryItem); |
215 | 219 | } |
|
224 | 228 | .swiper-tab-list { |
225 | 229 | display: inline-block; |
226 | 230 | } |
| 231 | +
|
227 | 232 | /* #endif */ |
228 | 233 | </style> |
0 commit comments