@conecli/cone-render 0.8.7 → 0.8.10

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,48 @@
1
- import { isProd, isPublishToWxapp } from '../config/env'
1
+ import { isProd, isPublishToWxapp } from '../config/env'
2
+ import { JD_DEFAULT_SHOP_LOGO } from '../common/const'
3
+ interface AppIdInfo {
4
+ appId?: string
5
+ shopId?: string
6
+ vendorId?: string
7
+ projectId?: string
8
+ pageId?: string
9
+ }
10
+ interface UserPinKeyType {
11
+ pin: string
12
+ ptkey: string
13
+ wqCookie: string
14
+ encodePin: string
15
+ }
16
+ let appIdInfo: AppIdInfo = {
17
+ appId: '',
18
+ }
19
+ let userPinKey: UserPinKeyType = {
20
+ pin: '',
21
+ encodePin: '',
22
+ ptkey: '',
23
+ wqCookie: '',
24
+ }
25
+ let appEid: string | null = ''
26
+ let jdUserLoginState = true
27
+ if (isProd) {
28
+ appIdInfo = {
29
+ appId: '',
30
+ shopId: '',
31
+ }
32
+ }
33
+ if (isProd) {
34
+ userPinKey = {
35
+ pin: '',
36
+ ptkey: '',
37
+ wqCookie: '',
38
+ encodePin: '',
39
+ }
40
+ appEid = null
41
+ jdUserLoginState = false
42
+ }
43
+ const developerPinList = []
44
+ export { userPinKey, appEid, developerPinList, jdUserLoginState }
45
+ export default {
46
+ ...appIdInfo,
47
+ defaultSquareLogo: JD_DEFAULT_SHOP_LOGO,
48
+ }
@@ -1 +1 @@
1
- import { isApp, getUrlQuery } from '../utils/jm-common'
1
+ import { isApp, getUrlQuery } from '../utils/jm-common'
@@ -12,15 +12,16 @@
12
12
  }
13
13
  .taro_router,
14
14
  .taro_page {
15
- // height: auto;
16
- // max-height: inherit;
17
- min-height: auto;
18
- overflow: auto;
15
+ height: auto!important;
16
+ max-height: inherit!important;
17
+ overflow: auto!important;
19
18
  }
20
-
19
+
21
20
  .taro_router {
21
+ min-height: 800PX;
22
+ padding-bottom: 50PX;
22
23
  .taro_page {
23
- position: static;
24
+ position: static!important;
24
25
  }
25
26
  }
26
27
  }
@@ -1 +1 @@
1
- import React, { useEffect, useRef, useState } from 'react'
1
+ import React, { useEffect, useRef, useState } from 'react'
@@ -1 +1 @@
1
- import taroJdBaseInfo from '../common'
1
+ import '../sass/base.scss';
@@ -0,0 +1,284 @@
1
+
2
+
3
+ .border-box {
4
+ box-sizing: border-box;
5
+ }
6
+
7
+
8
+ .content-box {
9
+ box-sizing: content-box;
10
+ }
11
+
12
+
13
+ .flexible-box {
14
+ display: flex;
15
+ }
16
+
17
+ .flexible-box-important {
18
+ display: flex !important;
19
+ }
20
+
21
+ //竖向布局
22
+ .flexible-box-h {
23
+ display: flex;
24
+ flex-direction: column;
25
+ }
26
+
27
+ .flexible-box-h-important {
28
+ display: flex !important;
29
+ flex-direction: column !important;
30
+ }
31
+
32
+ //垂直居中布局
33
+ .flexible-vertical-center-box {
34
+ display: flex;
35
+ align-items: center;
36
+ }
37
+
38
+ //水平居中布局
39
+ .flexible-horizontal-center-box {
40
+ display: flex;
41
+ justify-content: center;
42
+ }
43
+
44
+ //水平垂直居中布局
45
+ .flexible-center-box {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ }
50
+
51
+
52
+ .adaptive-box-flex {
53
+ flex: 1;
54
+ }
55
+
56
+ .left {
57
+ float: left;
58
+ }
59
+
60
+ .right {
61
+ float: right;
62
+ }
63
+
64
+ .vertical-align-t {
65
+ vertical-align: top;
66
+ }
67
+
68
+ .vertical-align-m {
69
+ vertical-align: middle;
70
+ }
71
+
72
+ .vertical-align-b {
73
+ vertical-align: bottom;
74
+ }
75
+
76
+ .margin-lr-auto {
77
+ margin: 0 auto;
78
+ }
79
+
80
+ .pos-relative {
81
+ position: relative;
82
+ }
83
+
84
+ .pos-absolute {
85
+ position: absolute;
86
+ }
87
+
88
+ .pos-fixed {
89
+ position: fixed;
90
+ }
91
+
92
+ .align-left {
93
+ text-align: left;
94
+ }
95
+
96
+ .align-center {
97
+ text-align: center;
98
+ }
99
+
100
+ .align-right {
101
+ text-align: right;
102
+ }
103
+
104
+ .display-none {
105
+ display: none;
106
+ }
107
+
108
+ .display-none-important {
109
+ display: none !important;
110
+ }
111
+
112
+ .display-block {
113
+ display: block;
114
+ }
115
+
116
+ .display-block-important {
117
+ display: block !important;
118
+ }
119
+
120
+ .display-inline-block {
121
+ display: inline-block;
122
+ }
123
+
124
+ .display-inline-block-important {
125
+ display: inline-block !important;
126
+ }
127
+
128
+ .display-inline {
129
+ display: inline;
130
+ }
131
+
132
+ .display-inline-important {
133
+ display: inline !important;
134
+ }
135
+
136
+ .font-bold {
137
+ font-weight: bold;
138
+ }
139
+
140
+ .pointer {
141
+ cursor: pointer;
142
+ }
143
+
144
+ .over-hidden {
145
+ overflow: hidden;
146
+ }
147
+
148
+ .over-auto {
149
+ overflow: auto;
150
+ }
151
+
152
+ .over-auto-hidden-x {
153
+ overflow: auto;
154
+ overflow-x: hidden;
155
+ }
156
+
157
+ .over-auto-hidden-y {
158
+ overflow: auto;
159
+ overflow-y: hidden;
160
+ }
161
+
162
+ .over-x-auto {
163
+ overflow-x: auto;
164
+ overflow-y: hidden;
165
+ }
166
+
167
+ .over-y-auto {
168
+ overflow-y: auto;
169
+ overflow-x: hidden;
170
+ }
171
+
172
+ .font-size-0 {
173
+ font-size: 0;
174
+ }
175
+
176
+
177
+ .text-ellipsis {
178
+ overflow: hidden;
179
+ white-space: nowrap;
180
+ text-overflow: ellipsis;
181
+ }
182
+
183
+ .text-ellipsis-2 {
184
+ display: -webkit-box;
185
+ overflow: hidden;
186
+ word-break: break-all;
187
+ text-overflow: ellipsis;
188
+ -webkit-line-clamp: 2;
189
+
190
+ -webkit-box-orient: vertical;
191
+ }
192
+
193
+ .text-ellipsis-3 {
194
+ display: -webkit-box;
195
+ overflow: hidden;
196
+ word-break: break-all;
197
+ text-overflow: ellipsis;
198
+ -webkit-line-clamp: 3;
199
+
200
+ -webkit-box-orient: vertical;
201
+ }
202
+
203
+ .text-ellipsis-no-omit {
204
+ overflow: hidden;
205
+ white-space: nowrap;
206
+ text-overflow: clip;
207
+ }
208
+
209
+ .text-ellipsis-2-no-omit {
210
+ display: -webkit-box;
211
+ overflow: hidden;
212
+ word-break: break-all;
213
+ text-overflow: ellipsis;
214
+ -webkit-line-clamp: 2;
215
+
216
+ -webkit-box-orient: inherit;
217
+ }
218
+
219
+ .text-ellipsis-3-no-omit {
220
+ display: -webkit-box;
221
+ overflow: hidden;
222
+ word-break: break-all;
223
+ text-overflow: ellipsis;
224
+ -webkit-line-clamp: 3;
225
+
226
+ -webkit-box-orient: inherit;
227
+ }
228
+
229
+
230
+
231
+ .d-half-1px-line, .d-half-1px-border {
232
+ position: relative;
233
+ &:after {
234
+ content: '';
235
+ position: absolute;
236
+ width: 200%;
237
+ height: 200%;
238
+ top: 0;
239
+ left: 0;
240
+ transform-origin: 0 0;
241
+ border: 1PX solid #fa2c19;
242
+ //transform: perspective(1PX) translate3d(0, 0, 0) scale(0.5, 0.5);
243
+ transform: scale(0.5, 0.5);
244
+ border-radius: 1PX;
245
+ box-sizing: border-box;
246
+ pointer-events: none;
247
+ //-webkit-backface-visibility: hidden;
248
+ //-webkit-transform-style: preserve-3d;
249
+ }
250
+ }
251
+
252
+
253
+ .d-half-1px-line::after {
254
+ border-width: 0;
255
+ border-radius: 0;
256
+ border-bottom-width: 1PX;
257
+ }
258
+ //解决安卓行高不居中对齐问题
259
+ .d-android-vertical-align {
260
+ &:before {
261
+ content: '';
262
+ display: inline-block;
263
+ margin-top: 1px;
264
+ width: 0;
265
+ min-height: 10px;
266
+ height: 100%;
267
+ vertical-align: middle;
268
+ }
269
+ }
270
+
271
+ .d-button-no-border {
272
+ &::after {
273
+ border: none;
274
+ }
275
+ }
276
+
277
+
278
+ .d-imag-rendering-crisp-edges {
279
+ image-rendering: -moz-crisp-edges;
280
+ image-rendering: -o-crisp-edges;
281
+ image-rendering: -webkit-optimize-contrast;
282
+ image-rendering: crisp-edges;
283
+ -ms-interpolation-mode: nearest-neighbor;
284
+ }
@@ -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.7",
3
+ "version": "0.8.10",
4
4
  "private": false,
5
5
  "main": "dist/open/index.ts",
6
6
  "files": [