|
@@ -0,0 +1,925 @@
|
|
1
|
+module.exports =
|
|
2
|
+/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+/******/ // The module cache
|
|
4
|
+/******/ var installedModules = {};
|
|
5
|
+/******/
|
|
6
|
+/******/ // The require function
|
|
7
|
+/******/ function __webpack_require__(moduleId) {
|
|
8
|
+/******/
|
|
9
|
+/******/ // Check if module is in cache
|
|
10
|
+/******/ if(installedModules[moduleId]) {
|
|
11
|
+/******/ return installedModules[moduleId].exports;
|
|
12
|
+/******/ }
|
|
13
|
+/******/ // Create a new module (and put it into the cache)
|
|
14
|
+/******/ var module = installedModules[moduleId] = {
|
|
15
|
+/******/ i: moduleId,
|
|
16
|
+/******/ l: false,
|
|
17
|
+/******/ exports: {}
|
|
18
|
+/******/ };
|
|
19
|
+/******/
|
|
20
|
+/******/ // Execute the module function
|
|
21
|
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+/******/
|
|
23
|
+/******/ // Flag the module as loaded
|
|
24
|
+/******/ module.l = true;
|
|
25
|
+/******/
|
|
26
|
+/******/ // Return the exports of the module
|
|
27
|
+/******/ return module.exports;
|
|
28
|
+/******/ }
|
|
29
|
+/******/
|
|
30
|
+/******/
|
|
31
|
+/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+/******/ __webpack_require__.m = modules;
|
|
33
|
+/******/
|
|
34
|
+/******/ // expose the module cache
|
|
35
|
+/******/ __webpack_require__.c = installedModules;
|
|
36
|
+/******/
|
|
37
|
+/******/ // define getter function for harmony exports
|
|
38
|
+/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+/******/ }
|
|
42
|
+/******/ };
|
|
43
|
+/******/
|
|
44
|
+/******/ // define __esModule on exports
|
|
45
|
+/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+/******/ }
|
|
49
|
+/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+/******/ };
|
|
51
|
+/******/
|
|
52
|
+/******/ // create a fake namespace object
|
|
53
|
+/******/ // mode & 1: value is a module id, require it
|
|
54
|
+/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+/******/ // mode & 4: return value when already ns object
|
|
56
|
+/******/ // mode & 8|1: behave like require
|
|
57
|
+/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+/******/ if(mode & 8) return value;
|
|
60
|
+/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+/******/ var ns = Object.create(null);
|
|
62
|
+/******/ __webpack_require__.r(ns);
|
|
63
|
+/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+/******/ return ns;
|
|
66
|
+/******/ };
|
|
67
|
+/******/
|
|
68
|
+/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+/******/ __webpack_require__.n = function(module) {
|
|
70
|
+/******/ var getter = module && module.__esModule ?
|
|
71
|
+/******/ function getDefault() { return module['default']; } :
|
|
72
|
+/******/ function getModuleExports() { return module; };
|
|
73
|
+/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+/******/ return getter;
|
|
75
|
+/******/ };
|
|
76
|
+/******/
|
|
77
|
+/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+/******/
|
|
80
|
+/******/ // __webpack_public_path__
|
|
81
|
+/******/ __webpack_require__.p = "";
|
|
82
|
+/******/
|
|
83
|
+/******/
|
|
84
|
+/******/ // Load entry module and return exports
|
|
85
|
+/******/ return __webpack_require__(__webpack_require__.s = 6);
|
|
86
|
+/******/ })
|
|
87
|
+/************************************************************************/
|
|
88
|
+/******/ ({
|
|
89
|
+
|
|
90
|
+/***/ 0:
|
|
91
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
92
|
+
|
|
93
|
+"use strict";
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+var isIPhone = false;
|
|
97
|
+var deviceWidth = void 0;
|
|
98
|
+var deviceDPR = void 0;
|
|
99
|
+var BASE_DEVICE_WIDTH = 750;
|
|
100
|
+var checkDeviceWidth = function checkDeviceWidth() {
|
|
101
|
+ var info = wx.getSystemInfoSync();
|
|
102
|
+ // console.log('info', info)
|
|
103
|
+ isIPhone = info.platform === 'ios';
|
|
104
|
+ var newDeviceWidth = info.screenWidth || 375;
|
|
105
|
+ var newDeviceDPR = info.pixelRatio || 2;
|
|
106
|
+
|
|
107
|
+ if (!isIPhone) {
|
|
108
|
+ // HACK switch width and height when landscape
|
|
109
|
+ // const newDeviceHeight = info.screenHeight || 375
|
|
110
|
+ // 暂时不处理转屏的情况
|
|
111
|
+ }
|
|
112
|
+
|
|
113
|
+ if (newDeviceWidth !== deviceWidth || newDeviceDPR !== deviceDPR) {
|
|
114
|
+ deviceWidth = newDeviceWidth;
|
|
115
|
+ deviceDPR = newDeviceDPR;
|
|
116
|
+ // console.info('Updated device width: ' + newDeviceWidth + 'px DPR ' + newDeviceDPR)
|
|
117
|
+ }
|
|
118
|
+};
|
|
119
|
+checkDeviceWidth();
|
|
120
|
+
|
|
121
|
+var eps = 1e-4;
|
|
122
|
+var transformByDPR = function transformByDPR(number) {
|
|
123
|
+ if (number === 0) {
|
|
124
|
+ return 0;
|
|
125
|
+ }
|
|
126
|
+ number = number / BASE_DEVICE_WIDTH * deviceWidth;
|
|
127
|
+ number = Math.floor(number + eps);
|
|
128
|
+ if (number === 0) {
|
|
129
|
+ if (deviceDPR === 1 || !isIPhone) {
|
|
130
|
+ return 1;
|
|
131
|
+ }
|
|
132
|
+ return 0.5;
|
|
133
|
+ }
|
|
134
|
+ return number;
|
|
135
|
+};
|
|
136
|
+
|
|
137
|
+var rpxRE = /([+-]?\d+(?:\.\d+)?)rpx/gi;
|
|
138
|
+// const inlineRpxRE = /(?::|\s|\(|\/)([+-]?\d+(?:\.\d+)?)rpx/g
|
|
139
|
+
|
|
140
|
+var transformRpx = function transformRpx(style, inline) {
|
|
141
|
+ if (typeof style !== 'string') {
|
|
142
|
+ return style;
|
|
143
|
+ }
|
|
144
|
+ var re = rpxRE;
|
|
145
|
+ return style.replace(re, function (match, num) {
|
|
146
|
+ return transformByDPR(Number(num)) + (inline ? 'px' : '');
|
|
147
|
+ });
|
|
148
|
+};
|
|
149
|
+
|
|
150
|
+module.exports = {
|
|
151
|
+ transformRpx: transformRpx
|
|
152
|
+};
|
|
153
|
+
|
|
154
|
+/***/ }),
|
|
155
|
+
|
|
156
|
+/***/ 6:
|
|
157
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
158
|
+
|
|
159
|
+"use strict";
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+/* eslint complexity: ["error", {"max": 50}] */
|
|
163
|
+/* eslint-disable indent */
|
|
164
|
+var DEFAULT_SHOW_SCREENS = 4;
|
|
165
|
+var RECT_SIZE = 200;
|
|
166
|
+var systemInfo = wx.getSystemInfoSync();
|
|
167
|
+var DEBUG = false;
|
|
168
|
+var transformRpx = __webpack_require__(0).transformRpx;
|
|
169
|
+
|
|
170
|
+Component({
|
|
171
|
+ options: {
|
|
172
|
+ multipleSlots: true // 在组件定义时的选项中启用多slot支持
|
|
173
|
+ },
|
|
174
|
+ relations: {
|
|
175
|
+ '../recycle-item/recycle-item': {
|
|
176
|
+ type: 'child', // 关联的目标节点应为子节点
|
|
177
|
+ linked: function linked(target) {
|
|
178
|
+ // 检查第一个的尺寸就好了吧
|
|
179
|
+ if (!this._hasCheckSize) {
|
|
180
|
+ this._hasCheckSize = true;
|
|
181
|
+ var size = this.boundingClientRect(this._pos.beginIndex);
|
|
182
|
+ if (!size) {
|
|
183
|
+ return;
|
|
184
|
+ }
|
|
185
|
+ setTimeout(function () {
|
|
186
|
+ try {
|
|
187
|
+ target.createSelectorQuery().select('.wx-recycle-item').boundingClientRect(function (rect) {
|
|
188
|
+ if (rect && (rect.width !== size.width || rect.height !== size.height)) {
|
|
189
|
+ // eslint-disable-next-line no-console
|
|
190
|
+ console.warn('[recycle-view] the size in <recycle-item> is not the same with param ' + ('itemSize, expect {width: ' + rect.width + ', height: ' + rect.height + '} but got ') + ('{width: ' + size.width + ', height: ' + size.height + '}'));
|
|
191
|
+ }
|
|
192
|
+ }).exec();
|
|
193
|
+ } catch (e) {
|
|
194
|
+ // do nothing
|
|
195
|
+ }
|
|
196
|
+ }, 10);
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ }
|
|
200
|
+ },
|
|
201
|
+ /**
|
|
202
|
+ * 组件的属性列表
|
|
203
|
+ */
|
|
204
|
+ properties: {
|
|
205
|
+ debug: {
|
|
206
|
+ type: Boolean,
|
|
207
|
+ value: false
|
|
208
|
+ },
|
|
209
|
+ scrollY: {
|
|
210
|
+ type: Boolean,
|
|
211
|
+ value: true
|
|
212
|
+ },
|
|
213
|
+ batch: {
|
|
214
|
+ type: Boolean,
|
|
215
|
+ value: false,
|
|
216
|
+ public: true,
|
|
217
|
+ observer: '_recycleInnerBatchDataChanged'
|
|
218
|
+ },
|
|
219
|
+ batchKey: {
|
|
220
|
+ type: String,
|
|
221
|
+ value: 'batchSetRecycleData',
|
|
222
|
+ public: true
|
|
223
|
+ },
|
|
224
|
+ scrollTop: {
|
|
225
|
+ type: Number,
|
|
226
|
+ value: 0,
|
|
227
|
+ public: true,
|
|
228
|
+ observer: '_scrollTopChanged',
|
|
229
|
+ observeAssignments: true
|
|
230
|
+ },
|
|
231
|
+ height: {
|
|
232
|
+ type: Number,
|
|
233
|
+ value: systemInfo.windowHeight,
|
|
234
|
+ public: true,
|
|
235
|
+ observer: '_heightChanged'
|
|
236
|
+ },
|
|
237
|
+ width: {
|
|
238
|
+ type: Number,
|
|
239
|
+ value: systemInfo.windowWidth,
|
|
240
|
+ public: true,
|
|
241
|
+ observer: '_widthChanged'
|
|
242
|
+ },
|
|
243
|
+ // 距顶部/左边多远时,触发bindscrolltoupper
|
|
244
|
+ upperThreshold: {
|
|
245
|
+ type: Number,
|
|
246
|
+ value: 50,
|
|
247
|
+ public: true
|
|
248
|
+ },
|
|
249
|
+ // 距底部/右边多远时,触发bindscrolltolower
|
|
250
|
+ lowerThreshold: {
|
|
251
|
+ type: Number,
|
|
252
|
+ value: 50,
|
|
253
|
+ public: true
|
|
254
|
+ },
|
|
255
|
+ scrollToIndex: {
|
|
256
|
+ type: Number,
|
|
257
|
+ public: true,
|
|
258
|
+ value: 0,
|
|
259
|
+ observer: '_scrollToIndexChanged',
|
|
260
|
+ observeAssignments: true
|
|
261
|
+ },
|
|
262
|
+ scrollWithAnimation: {
|
|
263
|
+ type: Boolean,
|
|
264
|
+ public: true,
|
|
265
|
+ value: false
|
|
266
|
+ },
|
|
267
|
+ enableBackToTop: {
|
|
268
|
+ type: Boolean,
|
|
269
|
+ public: true,
|
|
270
|
+ value: false
|
|
271
|
+ },
|
|
272
|
+ // 是否节流,默认是
|
|
273
|
+ throttle: {
|
|
274
|
+ type: Boolean,
|
|
275
|
+ public: true,
|
|
276
|
+ value: true
|
|
277
|
+ },
|
|
278
|
+ placeholderImage: {
|
|
279
|
+ type: String,
|
|
280
|
+ public: true,
|
|
281
|
+ value: ''
|
|
282
|
+ },
|
|
283
|
+ screen: { // 默认渲染多少屏的数据
|
|
284
|
+ type: Number,
|
|
285
|
+ public: true,
|
|
286
|
+ value: DEFAULT_SHOW_SCREENS
|
|
287
|
+ }
|
|
288
|
+ },
|
|
289
|
+
|
|
290
|
+ /**
|
|
291
|
+ * 组件的初始数据
|
|
292
|
+ */
|
|
293
|
+ data: {
|
|
294
|
+ innerBeforeHeight: 0,
|
|
295
|
+ innerAfterHeight: 0,
|
|
296
|
+ innerScrollTop: 0,
|
|
297
|
+ innerScrollIntoView: '',
|
|
298
|
+ placeholderImageStr: '',
|
|
299
|
+ totalHeight: 0,
|
|
300
|
+ useInPage: false
|
|
301
|
+ },
|
|
302
|
+ attached: function attached() {
|
|
303
|
+ if (this.data.placeholderImage) {
|
|
304
|
+ this.setData({
|
|
305
|
+ placeholderImageStr: transformRpx(this.data.placeholderImage, true)
|
|
306
|
+ });
|
|
307
|
+ }
|
|
308
|
+ this.setItemSize({
|
|
309
|
+ array: [],
|
|
310
|
+ map: {},
|
|
311
|
+ totalHeight: 0
|
|
312
|
+ });
|
|
313
|
+ },
|
|
314
|
+ ready: function ready() {
|
|
315
|
+ var _this = this;
|
|
316
|
+
|
|
317
|
+ this._initPosition(function () {
|
|
318
|
+ _this._isReady = true; // DOM结构ready了
|
|
319
|
+ // 有一个更新的timer在了
|
|
320
|
+ if (_this._updateTimerId) return;
|
|
321
|
+
|
|
322
|
+ _this._scrollViewDidScroll({
|
|
323
|
+ detail: {
|
|
324
|
+ scrollLeft: _this._pos.left,
|
|
325
|
+ scrollTop: _this._pos.top,
|
|
326
|
+ ignoreScroll: true
|
|
327
|
+ }
|
|
328
|
+ }, true);
|
|
329
|
+ });
|
|
330
|
+ },
|
|
331
|
+ detached: function detached() {
|
|
332
|
+ this.page = null;
|
|
333
|
+ // 销毁对应的RecycleContext
|
|
334
|
+ if (this.context) {
|
|
335
|
+ this.context.destroy();
|
|
336
|
+ this.context = null;
|
|
337
|
+ }
|
|
338
|
+ },
|
|
339
|
+
|
|
340
|
+ /**
|
|
341
|
+ * 组件的方法列表
|
|
342
|
+ */
|
|
343
|
+ methods: {
|
|
344
|
+ _log: function _log() {
|
|
345
|
+ var _console;
|
|
346
|
+
|
|
347
|
+ if (!DEBUG && !this.data.debug) return;
|
|
348
|
+ var h = new Date();
|
|
349
|
+ var str = h.getHours() + ':' + h.getMinutes() + ':' + h.getSeconds() + '.' + h.getMilliseconds();
|
|
350
|
+
|
|
351
|
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
352
|
+ args[_key] = arguments[_key];
|
|
353
|
+ }
|
|
354
|
+
|
|
355
|
+ Array.prototype.splice.call(args, 0, 0, str);
|
|
356
|
+ // eslint-disable-next-line no-console
|
|
357
|
+ (_console = console).log.apply(_console, args);
|
|
358
|
+ },
|
|
359
|
+ _scrollToUpper: function _scrollToUpper(e) {
|
|
360
|
+ this.triggerEvent('scrolltoupper', e.detail);
|
|
361
|
+ },
|
|
362
|
+ _scrollToLower: function _scrollToLower(e) {
|
|
363
|
+ this.triggerEvent('scrolltolower', e.detail);
|
|
364
|
+ },
|
|
365
|
+ _beginToScroll: function _beginToScroll() {
|
|
366
|
+ if (!this._lastScrollTop) {
|
|
367
|
+ this._lastScrollTop = this._pos && (this._pos.top || 0);
|
|
368
|
+ }
|
|
369
|
+ },
|
|
370
|
+ _clearList: function _clearList(cb) {
|
|
371
|
+ this.currentScrollTop = 0;
|
|
372
|
+ this._lastScrollTop = 0;
|
|
373
|
+ var pos = this._pos;
|
|
374
|
+ pos.beginIndex = this._pos.endIndex = -1;
|
|
375
|
+ pos.afterHeight = pos.minTop = pos.maxTop = 0;
|
|
376
|
+ this.page._recycleViewportChange({
|
|
377
|
+ detail: {
|
|
378
|
+ data: pos,
|
|
379
|
+ id: this.id
|
|
380
|
+ }
|
|
381
|
+ }, cb);
|
|
382
|
+ },
|
|
383
|
+
|
|
384
|
+ // 判断RecycleContext是否Ready
|
|
385
|
+ _isValid: function _isValid() {
|
|
386
|
+ return this.page && this.context && this.context.isDataReady;
|
|
387
|
+ },
|
|
388
|
+
|
|
389
|
+ // eslint-disable-next-line no-complexity
|
|
390
|
+ _scrollViewDidScroll: function _scrollViewDidScroll(e, force) {
|
|
391
|
+ // 如果RecycleContext还没有初始化, 不做任何事情
|
|
392
|
+ if (!this._isValid()) {
|
|
393
|
+ return;
|
|
394
|
+ }
|
|
395
|
+ // 监测白屏时间
|
|
396
|
+ if (!e.detail.ignoreScroll) {
|
|
397
|
+ this.triggerEvent('scroll', e.detail);
|
|
398
|
+ }
|
|
399
|
+ this.currentScrollTop = e.detail.scrollTop;
|
|
400
|
+ // 高度为0的情况, 不做任何渲染逻辑
|
|
401
|
+ if (!this._pos.height || !this.sizeArray.length) {
|
|
402
|
+ // 没有任何数据的情况下, 直接清理所有的状态
|
|
403
|
+ this._clearList(e.detail.cb);
|
|
404
|
+ return;
|
|
405
|
+ }
|
|
406
|
+
|
|
407
|
+ // 在scrollWithAnimation动画最后会触发一次scroll事件, 这次scroll事件必须要被忽略
|
|
408
|
+ if (this._isScrollingWithAnimation) {
|
|
409
|
+ this._isScrollingWithAnimation = false;
|
|
410
|
+ return;
|
|
411
|
+ }
|
|
412
|
+ var pos = this._pos;
|
|
413
|
+ var that = this;
|
|
414
|
+ var scrollLeft = e.detail.scrollLeft;
|
|
415
|
+ var scrollTop = e.detail.scrollTop;
|
|
416
|
+ var scrollDistance = Math.abs(scrollTop - this._lastScrollTop);
|
|
417
|
+ if (!force && Math.abs(scrollTop - pos.top) < pos.height * 1.5) {
|
|
418
|
+ this._log('【not exceed height');
|
|
419
|
+ return;
|
|
420
|
+ }
|
|
421
|
+ this._lastScrollTop = scrollTop;
|
|
422
|
+ var SHOW_SCREENS = this.data.screen; // 固定4屏幕
|
|
423
|
+ this._log('SHOW_SCREENS', SHOW_SCREENS, scrollTop);
|
|
424
|
+ this._calcViewportIndexes(scrollLeft, scrollTop, function (beginIndex, endIndex, minTop, afterHeight, maxTop) {
|
|
425
|
+ that._log('scrollDistance', scrollDistance, 'indexes', beginIndex, endIndex);
|
|
426
|
+ // 渲染的数据不变
|
|
427
|
+ if (!force && pos.beginIndex === beginIndex && pos.endIndex === endIndex && pos.minTop === minTop && pos.afterHeight === afterHeight) {
|
|
428
|
+ that._log('------------is the same beginIndex and endIndex');
|
|
429
|
+ return;
|
|
430
|
+ }
|
|
431
|
+ // 如果这次渲染的范围比上一次的范围小,则忽略
|
|
432
|
+ that._log('【check】before setData, old pos is', pos.minTop, pos.maxTop, minTop, maxTop);
|
|
433
|
+ that._throttle = false;
|
|
434
|
+ pos.left = scrollLeft;
|
|
435
|
+ pos.top = scrollTop;
|
|
436
|
+ pos.beginIndex = beginIndex;
|
|
437
|
+ pos.endIndex = endIndex;
|
|
438
|
+ // console.log('render indexes', endIndex - beginIndex + 1, endIndex, beginIndex)
|
|
439
|
+ pos.minTop = minTop;
|
|
440
|
+ pos.maxTop = maxTop;
|
|
441
|
+ pos.afterHeight = afterHeight;
|
|
442
|
+ pos.ignoreBeginIndex = pos.ignoreEndIndex = -1;
|
|
443
|
+ that.page._recycleViewportChange({
|
|
444
|
+ detail: {
|
|
445
|
+ data: that._pos,
|
|
446
|
+ id: that.id
|
|
447
|
+ }
|
|
448
|
+ }, function () {
|
|
449
|
+ if (e.detail.cb) {
|
|
450
|
+ e.detail.cb();
|
|
451
|
+ }
|
|
452
|
+ });
|
|
453
|
+ });
|
|
454
|
+ },
|
|
455
|
+
|
|
456
|
+ // 计算在视窗内渲染的数据
|
|
457
|
+ _calcViewportIndexes: function _calcViewportIndexes(left, top, cb) {
|
|
458
|
+ var that = this;
|
|
459
|
+ // const st = +new Date
|
|
460
|
+ this._getBeforeSlotHeight(function () {
|
|
461
|
+ var _that$__calcViewportI = that.__calcViewportIndexes(left, top),
|
|
462
|
+ beginIndex = _that$__calcViewportI.beginIndex,
|
|
463
|
+ endIndex = _that$__calcViewportI.endIndex,
|
|
464
|
+ minTop = _that$__calcViewportI.minTop,
|
|
465
|
+ afterHeight = _that$__calcViewportI.afterHeight,
|
|
466
|
+ maxTop = _that$__calcViewportI.maxTop;
|
|
467
|
+
|
|
468
|
+ if (cb) {
|
|
469
|
+ cb(beginIndex, endIndex, minTop, afterHeight, maxTop);
|
|
470
|
+ }
|
|
471
|
+ });
|
|
472
|
+ },
|
|
473
|
+ _getBeforeSlotHeight: function _getBeforeSlotHeight(cb) {
|
|
474
|
+ if (typeof this.data.beforeSlotHeight !== 'undefined') {
|
|
475
|
+ if (cb) {
|
|
476
|
+ cb(this.data.beforeSlotHeight);
|
|
477
|
+ }
|
|
478
|
+ } else {
|
|
479
|
+ this.reRender(cb);
|
|
480
|
+ }
|
|
481
|
+ },
|
|
482
|
+ _getAfterSlotHeight: function _getAfterSlotHeight(cb) {
|
|
483
|
+ if (typeof this.data.afterSlotHeight !== 'undefined') {
|
|
484
|
+ if (cb) {
|
|
485
|
+ cb(this.data.afterSlotHeight);
|
|
486
|
+ }
|
|
487
|
+ // cb && cb(this.data.afterSlotHeight)
|
|
488
|
+ } else {
|
|
489
|
+ this.reRender(cb);
|
|
490
|
+ }
|
|
491
|
+ },
|
|
492
|
+ _getIndexes: function _getIndexes(minTop, maxTop) {
|
|
493
|
+ if (minTop === maxTop && maxTop === 0) {
|
|
494
|
+ return {
|
|
495
|
+ beginIndex: -1,
|
|
496
|
+ endIndex: -1
|
|
497
|
+ };
|
|
498
|
+ }
|
|
499
|
+ var startLine = Math.floor(minTop / RECT_SIZE);
|
|
500
|
+ var endLine = Math.ceil(maxTop / RECT_SIZE);
|
|
501
|
+ var rectEachLine = Math.floor(this.data.width / RECT_SIZE);
|
|
502
|
+ var beginIndex = void 0;
|
|
503
|
+ var endIndex = void 0;
|
|
504
|
+ var sizeMap = this.sizeMap;
|
|
505
|
+ for (var i = startLine; i <= endLine; i++) {
|
|
506
|
+ for (var col = 0; col < rectEachLine; col++) {
|
|
507
|
+ var key = i + '.' + col;
|
|
508
|
+ // 找到sizeMap里面的最小值和最大值即可
|
|
509
|
+ if (!sizeMap[key]) continue;
|
|
510
|
+ for (var j = 0; j < sizeMap[key].length; j++) {
|
|
511
|
+ if (typeof beginIndex === 'undefined') {
|
|
512
|
+ beginIndex = endIndex = sizeMap[key][j];
|
|
513
|
+ continue;
|
|
514
|
+ }
|
|
515
|
+ if (beginIndex > sizeMap[key][j]) {
|
|
516
|
+ beginIndex = sizeMap[key][j];
|
|
517
|
+ } else if (endIndex < sizeMap[key][j]) {
|
|
518
|
+ endIndex = sizeMap[key][j];
|
|
519
|
+ }
|
|
520
|
+ }
|
|
521
|
+ }
|
|
522
|
+ }
|
|
523
|
+ return {
|
|
524
|
+ beginIndex: beginIndex,
|
|
525
|
+ endIndex: endIndex
|
|
526
|
+ };
|
|
527
|
+ },
|
|
528
|
+ _isIndexValid: function _isIndexValid(beginIndex, endIndex) {
|
|
529
|
+ if (typeof beginIndex === 'undefined' || beginIndex === -1 || typeof endIndex === 'undefined' || endIndex === -1 || endIndex >= this.sizeArray.length) {
|
|
530
|
+ return false;
|
|
531
|
+ }
|
|
532
|
+ return true;
|
|
533
|
+ },
|
|
534
|
+ __calcViewportIndexes: function __calcViewportIndexes(left, top) {
|
|
535
|
+ if (!this.sizeArray.length) return {};
|
|
536
|
+ var pos = this._pos;
|
|
537
|
+ if (typeof left === 'undefined') {
|
|
538
|
+ left = pos.left;
|
|
539
|
+ }
|
|
540
|
+ if (typeof top === 'undefined') {
|
|
541
|
+ top = pos.top;
|
|
542
|
+ }
|
|
543
|
+ // top = Math.max(top, this.data.beforeSlotHeight)
|
|
544
|
+ var beforeSlotHeight = this.data.beforeSlotHeight || 0;
|
|
545
|
+ // 和direction无关了
|
|
546
|
+ var SHOW_SCREENS = this.data.screen;
|
|
547
|
+ var minTop = top - pos.height * SHOW_SCREENS - beforeSlotHeight;
|
|
548
|
+ var maxTop = top + pos.height * SHOW_SCREENS - beforeSlotHeight;
|
|
549
|
+ // maxTop或者是minTop超出了范围
|
|
550
|
+ if (maxTop > this.totalHeight) {
|
|
551
|
+ minTop -= maxTop - this.totalHeight;
|
|
552
|
+ maxTop = this.totalHeight;
|
|
553
|
+ }
|
|
554
|
+ if (minTop < beforeSlotHeight) {
|
|
555
|
+ maxTop += Math.min(beforeSlotHeight - minTop, this.totalHeight);
|
|
556
|
+ minTop = 0;
|
|
557
|
+ }
|
|
558
|
+ // 计算落在minTop和maxTop之间的方格有哪些
|
|
559
|
+ var indexObj = this._getIndexes(minTop, maxTop);
|
|
560
|
+ var beginIndex = indexObj.beginIndex;
|
|
561
|
+ var endIndex = indexObj.endIndex;
|
|
562
|
+ if (endIndex >= this.sizeArray.length) {
|
|
563
|
+ endIndex = this.sizeArray.length - 1;
|
|
564
|
+ }
|
|
565
|
+ // 校验一下beginIndex和endIndex的有效性,
|
|
566
|
+ if (!this._isIndexValid(beginIndex, endIndex)) {
|
|
567
|
+ return {
|
|
568
|
+ beginIndex: -1,
|
|
569
|
+ endIndex: -1,
|
|
570
|
+ minTop: 0,
|
|
571
|
+ afterHeight: 0,
|
|
572
|
+ maxTop: 0
|
|
573
|
+ };
|
|
574
|
+ }
|
|
575
|
+ // 计算白屏的默认占位的区域
|
|
576
|
+ var maxTopFull = this.sizeArray[endIndex].beforeHeight + this.sizeArray[endIndex].height;
|
|
577
|
+ var minTopFull = this.sizeArray[beginIndex].beforeHeight;
|
|
578
|
+
|
|
579
|
+ // console.log('render indexes', beginIndex, endIndex)
|
|
580
|
+ var afterHeight = this.totalHeight - maxTopFull;
|
|
581
|
+ return {
|
|
582
|
+ beginIndex: beginIndex,
|
|
583
|
+ endIndex: endIndex,
|
|
584
|
+ minTop: minTopFull, // 取整, beforeHeight的距离
|
|
585
|
+ afterHeight: afterHeight,
|
|
586
|
+ maxTop: maxTop
|
|
587
|
+ };
|
|
588
|
+ },
|
|
589
|
+ setItemSize: function setItemSize(size) {
|
|
590
|
+ this.sizeArray = size.array;
|
|
591
|
+ this.sizeMap = size.map;
|
|
592
|
+ if (size.totalHeight !== this.totalHeight) {
|
|
593
|
+ // console.log('---totalHeight is', size.totalHeight);
|
|
594
|
+ this.setData({
|
|
595
|
+ totalHeight: size.totalHeight,
|
|
596
|
+ useInPage: this.useInPage || false
|
|
597
|
+ });
|
|
598
|
+ }
|
|
599
|
+ this.totalHeight = size.totalHeight;
|
|
600
|
+ },
|
|
601
|
+ setList: function setList(key, newList) {
|
|
602
|
+ this._currentSetDataKey = key;
|
|
603
|
+ this._currentSetDataList = newList;
|
|
604
|
+ },
|
|
605
|
+ setPage: function setPage(page) {
|
|
606
|
+ this.page = page;
|
|
607
|
+ },
|
|
608
|
+ forceUpdate: function forceUpdate(cb, reInit) {
|
|
609
|
+ var _this2 = this;
|
|
610
|
+
|
|
611
|
+ if (!this._isReady) {
|
|
612
|
+ if (this._updateTimerId) {
|
|
613
|
+ // 合并多次的forceUpdate
|
|
614
|
+ clearTimeout(this._updateTimerId);
|
|
615
|
+ }
|
|
616
|
+ this._updateTimerId = setTimeout(function () {
|
|
617
|
+ _this2.forceUpdate(cb, reInit);
|
|
618
|
+ }, 10);
|
|
619
|
+ return;
|
|
620
|
+ }
|
|
621
|
+ this._updateTimerId = null;
|
|
622
|
+ var that = this;
|
|
623
|
+ if (reInit) {
|
|
624
|
+ this.reRender(function () {
|
|
625
|
+ that._scrollViewDidScroll({
|
|
626
|
+ detail: {
|
|
627
|
+ scrollLeft: that._pos.left,
|
|
628
|
+ scrollTop: that.currentScrollTop || that.data.scrollTop || 0,
|
|
629
|
+ ignoreScroll: true,
|
|
630
|
+ cb: cb
|
|
631
|
+ }
|
|
632
|
+ }, true);
|
|
633
|
+ });
|
|
634
|
+ } else {
|
|
635
|
+ this._scrollViewDidScroll({
|
|
636
|
+ detail: {
|
|
637
|
+ scrollLeft: that._pos.left,
|
|
638
|
+ scrollTop: that.currentScrollTop || that.data.scrollTop || 0,
|
|
639
|
+ ignoreScroll: true,
|
|
640
|
+ cb: cb
|
|
641
|
+ }
|
|
642
|
+ }, true);
|
|
643
|
+ }
|
|
644
|
+ },
|
|
645
|
+ _initPosition: function _initPosition(cb) {
|
|
646
|
+ var that = this;
|
|
647
|
+ that._pos = {
|
|
648
|
+ left: that.data.scrollLeft || 0,
|
|
649
|
+ top: that.data.scrollTop || 0,
|
|
650
|
+ width: this.data.width,
|
|
651
|
+ height: Math.max(500, this.data.height), // 一个屏幕的高度
|
|
652
|
+ direction: 0
|
|
653
|
+ };
|
|
654
|
+ this.reRender(cb);
|
|
655
|
+ },
|
|
656
|
+ _widthChanged: function _widthChanged(newVal) {
|
|
657
|
+ if (!this._isReady) return newVal;
|
|
658
|
+ this._pos.width = newVal;
|
|
659
|
+ this.forceUpdate();
|
|
660
|
+ return newVal;
|
|
661
|
+ },
|
|
662
|
+ _heightChanged: function _heightChanged(newVal) {
|
|
663
|
+ if (!this._isReady) return newVal;
|
|
664
|
+ this._pos.height = Math.max(500, newVal);
|
|
665
|
+ this.forceUpdate();
|
|
666
|
+ return newVal;
|
|
667
|
+ },
|
|
668
|
+ reRender: function reRender(cb) {
|
|
669
|
+ var _this3 = this;
|
|
670
|
+
|
|
671
|
+ var beforeSlotHeight = void 0;
|
|
672
|
+ var afterSlotHeight = void 0;
|
|
673
|
+ var that = this;
|
|
674
|
+ // const reRenderStart = Date.now()
|
|
675
|
+ function newCb() {
|
|
676
|
+ if (that._lastBeforeSlotHeight !== beforeSlotHeight || that._lastAfterSlotHeight !== afterSlotHeight) {
|
|
677
|
+ that.setData({
|
|
678
|
+ hasBeforeSlotHeight: true,
|
|
679
|
+ hasAfterSlotHeight: true,
|
|
680
|
+ beforeSlotHeight: beforeSlotHeight,
|
|
681
|
+ afterSlotHeight: afterSlotHeight
|
|
682
|
+ });
|
|
683
|
+ }
|
|
684
|
+ that._lastBeforeSlotHeight = beforeSlotHeight;
|
|
685
|
+ that._lastAfterSlotHeight = afterSlotHeight;
|
|
686
|
+ // console.log('_getBeforeSlotHeight use time', Date.now() - reRenderStart)
|
|
687
|
+ if (cb) {
|
|
688
|
+ cb();
|
|
689
|
+ }
|
|
690
|
+ }
|
|
691
|
+ // 重新渲染事件发生
|
|
692
|
+ var beforeReady = false;
|
|
693
|
+ var afterReady = false;
|
|
694
|
+ // fix:#16 确保获取slot节点实际高度
|
|
695
|
+ this.setData({
|
|
696
|
+ hasBeforeSlotHeight: false,
|
|
697
|
+ hasAfterSlotHeight: false
|
|
698
|
+ }, function () {
|
|
699
|
+ _this3.createSelectorQuery().select('.slot-before').boundingClientRect(function (rect) {
|
|
700
|
+ beforeSlotHeight = rect.height;
|
|
701
|
+ beforeReady = true;
|
|
702
|
+ if (afterReady) {
|
|
703
|
+ if (newCb) {
|
|
704
|
+ newCb();
|
|
705
|
+ }
|
|
706
|
+ }
|
|
707
|
+ }).exec();
|
|
708
|
+ _this3.createSelectorQuery().select('.slot-after').boundingClientRect(function (rect) {
|
|
709
|
+ afterSlotHeight = rect.height;
|
|
710
|
+ afterReady = true;
|
|
711
|
+ if (beforeReady) {
|
|
712
|
+ if (newCb) {
|
|
713
|
+ newCb();
|
|
714
|
+ }
|
|
715
|
+ }
|
|
716
|
+ }).exec();
|
|
717
|
+ });
|
|
718
|
+ },
|
|
719
|
+ _setInnerBeforeAndAfterHeight: function _setInnerBeforeAndAfterHeight(obj) {
|
|
720
|
+ if (typeof obj.beforeHeight !== 'undefined') {
|
|
721
|
+ this._tmpBeforeHeight = obj.beforeHeight;
|
|
722
|
+ }
|
|
723
|
+ if (obj.afterHeight) {
|
|
724
|
+ this._tmpAfterHeight = obj.afterHeight;
|
|
725
|
+ }
|
|
726
|
+ },
|
|
727
|
+ _recycleInnerBatchDataChanged: function _recycleInnerBatchDataChanged(cb) {
|
|
728
|
+ var _this4 = this;
|
|
729
|
+
|
|
730
|
+ if (typeof this._tmpBeforeHeight !== 'undefined') {
|
|
731
|
+ var setObj = {
|
|
732
|
+ innerBeforeHeight: this._tmpBeforeHeight || 0,
|
|
733
|
+ innerAfterHeight: this._tmpAfterHeight || 0
|
|
734
|
+ };
|
|
735
|
+ if (typeof this._tmpInnerScrollTop !== 'undefined') {
|
|
736
|
+ setObj.innerScrollTop = this._tmpInnerScrollTop;
|
|
737
|
+ }
|
|
738
|
+ var pageObj = {};
|
|
739
|
+ var hasPageData = false;
|
|
740
|
+ if (typeof this._currentSetDataKey !== 'undefined') {
|
|
741
|
+ pageObj[this._currentSetDataKey] = this._currentSetDataList;
|
|
742
|
+ hasPageData = true;
|
|
743
|
+ }
|
|
744
|
+ var saveScrollWithAnimation = this.data.scrollWithAnimation;
|
|
745
|
+ var groupSetData = function groupSetData() {
|
|
746
|
+ // 如果有分页数据的话
|
|
747
|
+ if (hasPageData) {
|
|
748
|
+ _this4.page.setData(pageObj);
|
|
749
|
+ }
|
|
750
|
+ _this4.setData(setObj, function () {
|
|
751
|
+ _this4.setData({
|
|
752
|
+ scrollWithAnimation: saveScrollWithAnimation
|
|
753
|
+ });
|
|
754
|
+ if (typeof cb === 'function') {
|
|
755
|
+ cb();
|
|
756
|
+ }
|
|
757
|
+ });
|
|
758
|
+ };
|
|
759
|
+ groupSetData();
|
|
760
|
+ delete this._currentSetDataKey;
|
|
761
|
+ delete this._currentSetDataList;
|
|
762
|
+ this._tmpBeforeHeight = undefined;
|
|
763
|
+ this._tmpAfterHeight = undefined;
|
|
764
|
+ this._tmpInnerScrollTop = undefined;
|
|
765
|
+ }
|
|
766
|
+ },
|
|
767
|
+ _renderByScrollTop: function _renderByScrollTop(scrollTop) {
|
|
768
|
+ // 先setData把目标位置的数据补齐
|
|
769
|
+ this._scrollViewDidScroll({
|
|
770
|
+ detail: {
|
|
771
|
+ scrollLeft: this._pos.scrollLeft,
|
|
772
|
+ scrollTop: scrollTop,
|
|
773
|
+ ignoreScroll: true
|
|
774
|
+ }
|
|
775
|
+ }, true);
|
|
776
|
+ if (this.data.scrollWithAnimation) {
|
|
777
|
+ this._isScrollingWithAnimation = true;
|
|
778
|
+ }
|
|
779
|
+ this.setData({
|
|
780
|
+ innerScrollTop: scrollTop
|
|
781
|
+ });
|
|
782
|
+ },
|
|
783
|
+ _scrollTopChanged: function _scrollTopChanged(newVal, oldVal) {
|
|
784
|
+ var _this5 = this;
|
|
785
|
+
|
|
786
|
+ // if (newVal === oldVal && newVal === 0) return
|
|
787
|
+ if (!this._isInitScrollTop && newVal === 0) {
|
|
788
|
+ this._isInitScrollTop = true;
|
|
789
|
+ return newVal;
|
|
790
|
+ }
|
|
791
|
+ this.currentScrollTop = newVal;
|
|
792
|
+ if (!this._isReady) {
|
|
793
|
+ if (this._scrollTopTimerId) {
|
|
794
|
+ clearTimeout(this._scrollTopTimerId);
|
|
795
|
+ }
|
|
796
|
+ this._scrollTopTimerId = setTimeout(function () {
|
|
797
|
+ _this5._scrollTopChanged(newVal, oldVal);
|
|
798
|
+ }, 10);
|
|
799
|
+ return newVal;
|
|
800
|
+ }
|
|
801
|
+ this._isInitScrollTop = true;
|
|
802
|
+ this._scrollTopTimerId = null;
|
|
803
|
+ // this._lastScrollTop = oldVal
|
|
804
|
+ if (typeof this._lastScrollTop === 'undefined') {
|
|
805
|
+ this._lastScrollTop = this.data.scrollTop;
|
|
806
|
+ }
|
|
807
|
+ // 滑动距离小于一个屏幕的高度, 直接setData
|
|
808
|
+ if (Math.abs(newVal - this._lastScrollTop) < this._pos.height) {
|
|
809
|
+ this.setData({
|
|
810
|
+ innerScrollTop: newVal
|
|
811
|
+ });
|
|
812
|
+ return newVal;
|
|
813
|
+ }
|
|
814
|
+ if (!this._isScrollTopChanged) {
|
|
815
|
+ // 首次的值需要延后一点执行才能生效
|
|
816
|
+ setTimeout(function () {
|
|
817
|
+ _this5._isScrollTopChanged = true;
|
|
818
|
+ _this5._renderByScrollTop(newVal);
|
|
819
|
+ }, 10);
|
|
820
|
+ } else {
|
|
821
|
+ this._renderByScrollTop(newVal);
|
|
822
|
+ }
|
|
823
|
+ return newVal;
|
|
824
|
+ },
|
|
825
|
+ _scrollToIndexChanged: function _scrollToIndexChanged(newVal, oldVal) {
|
|
826
|
+ var _this6 = this;
|
|
827
|
+
|
|
828
|
+ // if (newVal === oldVal && newVal === 0) return
|
|
829
|
+ // 首次滚动到0的不执行
|
|
830
|
+ if (!this._isInitScrollToIndex && newVal === 0) {
|
|
831
|
+ this._isInitScrollToIndex = true;
|
|
832
|
+ return newVal;
|
|
833
|
+ }
|
|
834
|
+ if (!this._isReady) {
|
|
835
|
+ if (this._scrollToIndexTimerId) {
|
|
836
|
+ clearTimeout(this._scrollToIndexTimerId);
|
|
837
|
+ }
|
|
838
|
+ this._scrollToIndexTimerId = setTimeout(function () {
|
|
839
|
+ _this6._scrollToIndexChanged(newVal, oldVal);
|
|
840
|
+ }, 10);
|
|
841
|
+ return newVal;
|
|
842
|
+ }
|
|
843
|
+ this._isInitScrollToIndex = true;
|
|
844
|
+ this._scrollToIndexTimerId = null;
|
|
845
|
+ if (typeof this._lastScrollTop === 'undefined') {
|
|
846
|
+ this._lastScrollTop = this.data.scrollTop;
|
|
847
|
+ }
|
|
848
|
+ var rect = this.boundingClientRect(newVal);
|
|
849
|
+ if (!rect) return newVal;
|
|
850
|
+ // console.log('rect top', rect, this.data.beforeSlotHeight)
|
|
851
|
+ var calScrollTop = rect.top + (this.data.beforeSlotHeight || 0);
|
|
852
|
+ this.currentScrollTop = calScrollTop;
|
|
853
|
+ if (Math.abs(calScrollTop - this._lastScrollTop) < this._pos.height) {
|
|
854
|
+ this.setData({
|
|
855
|
+ innerScrollTop: calScrollTop
|
|
856
|
+ });
|
|
857
|
+ return newVal;
|
|
858
|
+ }
|
|
859
|
+ if (!this._isScrollToIndexChanged) {
|
|
860
|
+ setTimeout(function () {
|
|
861
|
+ _this6._isScrollToIndexChanged = true;
|
|
862
|
+ _this6._renderByScrollTop(calScrollTop);
|
|
863
|
+ }, 10);
|
|
864
|
+ } else {
|
|
865
|
+ this._renderByScrollTop(calScrollTop);
|
|
866
|
+ }
|
|
867
|
+ return newVal;
|
|
868
|
+ },
|
|
869
|
+
|
|
870
|
+ // 提供给开发者使用的接口
|
|
871
|
+ boundingClientRect: function boundingClientRect(idx) {
|
|
872
|
+ if (idx < 0 || idx >= this.sizeArray.length) {
|
|
873
|
+ return null;
|
|
874
|
+ }
|
|
875
|
+ return {
|
|
876
|
+ left: 0,
|
|
877
|
+ top: this.sizeArray[idx].beforeHeight,
|
|
878
|
+ width: this.sizeArray[idx].width,
|
|
879
|
+ height: this.sizeArray[idx].height
|
|
880
|
+ };
|
|
881
|
+ },
|
|
882
|
+
|
|
883
|
+ // 获取当前出现在屏幕内数据项, 返回数据项组成的数组
|
|
884
|
+ // 参数inViewportPx表示当数据项至少有多少像素出现在屏幕内才算是出现在屏幕内,默认是1
|
|
885
|
+ getIndexesInViewport: function getIndexesInViewport(inViewportPx) {
|
|
886
|
+ if (!inViewportPx) {
|
|
887
|
+ inViewportPx = 1;
|
|
888
|
+ }
|
|
889
|
+ var scrollTop = this.currentScrollTop;
|
|
890
|
+ var minTop = scrollTop + inViewportPx;
|
|
891
|
+ if (minTop < 0) minTop = 0;
|
|
892
|
+ var maxTop = scrollTop + this.data.height - inViewportPx;
|
|
893
|
+ if (maxTop > this.totalHeight) maxTop = this.totalHeight;
|
|
894
|
+ var indexes = [];
|
|
895
|
+ for (var i = 0; i < this.sizeArray.length; i++) {
|
|
896
|
+ if (this.sizeArray[i].beforeHeight + this.sizeArray[i].height >= minTop && this.sizeArray[i].beforeHeight <= maxTop) {
|
|
897
|
+ indexes.push(i);
|
|
898
|
+ }
|
|
899
|
+ if (this.sizeArray[i].beforeHeight > maxTop) break;
|
|
900
|
+ }
|
|
901
|
+ return indexes;
|
|
902
|
+ },
|
|
903
|
+ getTotalHeight: function getTotalHeight() {
|
|
904
|
+ return this.totalHeight;
|
|
905
|
+ },
|
|
906
|
+ setUseInPage: function setUseInPage(useInPage) {
|
|
907
|
+ this.useInPage = useInPage;
|
|
908
|
+ },
|
|
909
|
+ setPlaceholderImage: function setPlaceholderImage(svgs, size) {
|
|
910
|
+ var fill = 'style=\'fill:rgb(204,204,204);\'';
|
|
911
|
+ var placeholderImages = ['data:image/svg+xml,%3Csvg height=\'' + size.height + '\' width=\'' + size.width + '\' xmlns=\'http://www.w3.org/2000/svg\'%3E'];
|
|
912
|
+ svgs.forEach(function (svg) {
|
|
913
|
+ placeholderImages.push('%3Crect width=\'' + svg.width + '\' x=\'' + svg.left + '\' height=\'' + svg.height + '\' y=\'' + svg.top + '\' ' + fill + ' /%3E');
|
|
914
|
+ });
|
|
915
|
+ placeholderImages.push('%3C/svg%3E');
|
|
916
|
+ this.setData({
|
|
917
|
+ placeholderImageStr: placeholderImages.join('')
|
|
918
|
+ });
|
|
919
|
+ }
|
|
920
|
+ }
|
|
921
|
+});
|
|
922
|
+
|
|
923
|
+/***/ })
|
|
924
|
+
|
|
925
|
+/******/ });
|