@conecli/cone-render 0.8.8 → 0.8.11-beta.0

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.
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
@@ -1 +1 @@
1
- import { isProd, isPublishToWxapp } from '../config/env'
1
+ import { isProd, isPublishToWxapp } from '../config/env'
@@ -1 +1 @@
1
- import { isApp, getUrlQuery } from '../utils/jm-common'
1
+ import { isApp, getUrlQuery } from '../utils/jm-common'
@@ -10,20 +10,18 @@
10
10
  width: 0;
11
11
  }
12
12
  }
13
-
14
13
  .taro_router,
15
14
  .taro_page {
16
- height: auto;
17
- // max-height: inherit;
18
- // min-height: auto;
19
- min-height: 800PX;
20
- padding-bottom: 44PX;
21
- overflow: auto;
15
+ height: auto!important;
16
+ max-height: inherit!important;
17
+ overflow: auto!important;
22
18
  }
23
-
19
+
24
20
  .taro_router {
21
+ min-height: 800PX;
22
+ padding-bottom: 50PX;
25
23
  .taro_page {
26
- position: static;
24
+ position: static!important;
27
25
  }
28
26
  }
29
27
  }
@@ -1 +1 @@
1
- import React, { useEffect, useRef, useState } from 'react'
1
+ import React, { useEffect, useRef, useState } from 'react'
@@ -0,0 +1 @@
1
+ interface Message {
2
  callback:Function
1
3
  time: number
2
4
  messages: Message[]
3
5
  timerId: number
4
6
  timeGap: number
5
7
  mqDelay: number
6
8
  constructor() {
7
9
  this.messages = []
8
10
  this.timerId = 0
9
11
  this.timeGap = 17
10
12
  this.mqDelay = 50
11
13
  }
12
14
 
13
15
  static getInstance() {
14
16
  if (window.top._mq == null) {
15
17
  window.top._mq = new MQ()
16
18
  }
17
19
  return window.top._mq
18
20
  }
19
21
  onTimer() {
20
22
  const nowTime = Date.now()
21
23
  let leftMsgList:Message[] = []
22
24
  const msgList = this.messages.filter((item:Message)=>{
23
25
  if(nowTime - item.time >= this.mqDelay){
24
26
  return true
25
27
  }
26
28
  else{
27
29
  leftMsgList.push(item)
28
30
  return false
29
31
  }
30
32
  })
31
33
  msgList.forEach((msg)=>{
32
34
  msg.callback()
33
35
  })
34
36
  this.messages = leftMsgList
35
37
  if(this.messages.length>0){
36
38
  this.timerId = 0
37
39
  this.starTimer()
38
40
  }
39
41
  else{
40
42
  this.stopTimer()
41
43
  }
42
44
  }
43
45
  starTimer() {
44
46
  if(this.timerId== 0){
45
47
  this.timerId = setTimeout(()=>{
46
48
  this.onTimer()
47
49
  }, this.timeGap)
48
50
  }
49
51
  }
50
52
  stopTimer() {
51
53
  if(this.timerId>0){
52
54
  clearTimeout(this.timerId)
53
55
  }
54
56
  this.timerId = 0
55
57
  }
56
58
 
57
59
  addCallBack(callback: Function) {
58
60
  if(callback){
59
61
  const msg: Message = {
60
62
  callback,
61
63
  time: Date.now()
62
64
  }
63
65
  this.messages.push(msg)
64
66
  this.starTimer()
65
67
  }
66
68
  }
67
69
  clear() {
68
70
  this.messages = []
69
71
  this.stopTimer()
70
72
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.8",
3
+ "version": "0.8.11-beta.0",
4
4
  "private": false,
5
5
  "main": "dist/open/index.ts",
6
6
  "files": [