@dcloudio/uni-cli-shared 2.0.1-alpha-34920220508001 → 2.0.1-alpha-34920220512001

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.
@@ -213,6 +213,7 @@ class AdHelper {
213
213
  const ad = this.get(options)
214
214
 
215
215
  if (ad.isLoad) {
216
+ this._lastWaterfallIndex = -1
216
217
  ad.show((e) => {
217
218
  onclose && onclose(e)
218
219
  }, () => {
@@ -220,6 +221,7 @@ class AdHelper {
220
221
  })
221
222
  } else {
222
223
  ad.load(() => {
224
+ this._lastWaterfallIndex = -1
223
225
  onload && onload()
224
226
  ad.show((e) => {
225
227
  onclose && onclose(e)
@@ -242,16 +244,14 @@ class AdHelper {
242
244
  return
243
245
  }
244
246
 
245
- if (index === 0) {
246
- this._lastWaterfallIndex = -1
247
- }
248
-
249
247
  const options2 = {
250
248
  adpid: adpid[index],
251
249
  urlCallback,
252
250
  retry: false
253
251
  }
254
252
 
253
+ console.log('ad.loadWaterfall::index=' + index)
254
+
255
255
  this.load(options2, (res) => {
256
256
  this._lastWaterfallIndex = index
257
257
  onload(options2)
@@ -260,7 +260,6 @@ class AdHelper {
260
260
  if (index >= adpid.length) {
261
261
  onfail(err)
262
262
  } else {
263
- console.log('loadWaterfall::index=' + index)
264
263
  this.loadWaterfall(options, onload, onfail, index)
265
264
  }
266
265
  })
@@ -276,17 +275,18 @@ class AdHelper {
276
275
  return
277
276
  }
278
277
 
279
- let idx = index
280
278
  if (this._lastWaterfallIndex > -1) {
281
- idx = this._lastWaterfallIndex
279
+ index = this._lastWaterfallIndex
282
280
  }
283
281
 
284
282
  const options2 = {
285
- adpid: adpid[idx],
283
+ adpid: adpid[index],
286
284
  urlCallback,
287
285
  retry: false
288
286
  }
289
287
 
288
+ console.log('ad.showWaterfall::index=' + index)
289
+
290
290
  this.show(options2, () => {
291
291
  onload()
292
292
  }, (err) => {
@@ -444,6 +444,9 @@ export default {
444
444
  },
445
445
  methods: {
446
446
  load () {
447
+ if (this.isLoading) {
448
+ return
449
+ }
447
450
  this._startLoading()
448
451
  const invoke = this._isWaterfall() ? 'loadWaterfall' : 'load'
449
452
  this._adHelper[invoke](this._getAdOptions(), () => {
@@ -454,6 +457,9 @@ export default {
454
457
  },
455
458
 
456
459
  show () {
460
+ if (this.isLoading) {
461
+ return
462
+ }
457
463
  this._startLoading()
458
464
  const invoke = this._isWaterfall() ? 'showWaterfall' : 'show'
459
465
  this._adHelper[invoke](this._getAdOptions(), () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.1-alpha-34920220508001",
3
+ "version": "2.0.1-alpha-34920220512001",
4
4
  "description": "uni-cli-shared",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "postcss-urlrewrite": "^0.2.2",
24
24
  "strip-json-comments": "^2.0.1"
25
25
  },
26
- "gitHead": "332c89c762a3548396dce5fab244f0817d136a55"
26
+ "gitHead": "f1e8a95ca6df4b7634ed03d42e91e8a524e62b3d"
27
27
  }