gm-printer-label 3.0.9 → 3.0.10-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.
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/Users/
|
|
1
|
+
[{"/Users/xurora/Desktop/gm-printer-label/src/util.js":"1","/Users/xurora/Desktop/gm-printer-label/src/printer/block.js":"2","/Users/xurora/Desktop/gm-printer-label/src/common/editor_compoents/store.js":"3"},{"size":1935,"mtime":1655908329945,"results":"4","hashOfConfig":"5"},{"size":10382,"mtime":1655964450049,"results":"6","hashOfConfig":"5"},{"size":7160,"mtime":1655951736143,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10llghp",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/xurora/Desktop/gm-printer-label/src/util.js",[],"/Users/xurora/Desktop/gm-printer-label/src/printer/block.js",[],"/Users/xurora/Desktop/gm-printer-label/src/common/editor_compoents/store.js",[]]
|
package/package.json
CHANGED
|
@@ -106,6 +106,19 @@ class EditStore {
|
|
|
106
106
|
}
|
|
107
107
|
})
|
|
108
108
|
break
|
|
109
|
+
case 'merchandise_trace_qrcode':
|
|
110
|
+
this.config.blocks.push({
|
|
111
|
+
type,
|
|
112
|
+
merchandise_trace_qrcode: i18next.t('{{商品溯源二维码}}'),
|
|
113
|
+
style: {
|
|
114
|
+
position: 'absolute',
|
|
115
|
+
left: '0px',
|
|
116
|
+
top: '0px',
|
|
117
|
+
width: '100px',
|
|
118
|
+
height: '100px'
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
break
|
|
109
122
|
case 'order_qrcode':
|
|
110
123
|
this.config.blocks.push({
|
|
111
124
|
type,
|
|
@@ -202,6 +202,8 @@
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
|
|
206
|
+
|
|
205
207
|
&.gm-printer-label-block-type-diyqrcode {
|
|
206
208
|
div[data-diyqrcode] {
|
|
207
209
|
outline: 1px solid red;
|
|
@@ -265,6 +267,18 @@
|
|
|
265
267
|
top: calc(50% - 0.5em);
|
|
266
268
|
}
|
|
267
269
|
}
|
|
270
|
+
|
|
271
|
+
div[data-merchandise_trace_qrcode] {
|
|
272
|
+
outline: 1px solid red;
|
|
273
|
+
|
|
274
|
+
&::before {
|
|
275
|
+
content: '商品溯源二维码';
|
|
276
|
+
position: absolute;
|
|
277
|
+
font-style: italic;
|
|
278
|
+
left: calc(50% - 1.5em);
|
|
279
|
+
top: calc(50% - 0.5em);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
268
282
|
|
|
269
283
|
div[data-diycode] {
|
|
270
284
|
outline: 1px solid red;
|
package/src/printer/block.js
CHANGED
|
@@ -100,13 +100,15 @@ class Block extends React.Component {
|
|
|
100
100
|
url,
|
|
101
101
|
fieldType,
|
|
102
102
|
fieldKey,
|
|
103
|
-
production_barcode
|
|
103
|
+
production_barcode,
|
|
104
|
+
merchandise_trace_qrcode
|
|
104
105
|
},
|
|
105
106
|
data,
|
|
106
107
|
className,
|
|
107
108
|
isStation,
|
|
108
109
|
...rest
|
|
109
110
|
} = this.props
|
|
111
|
+
console.log('test', merchandise_trace_qrcode)
|
|
110
112
|
const { isEdit } = this.state
|
|
111
113
|
let content = null
|
|
112
114
|
if (!type || type === 'text') {
|
|
@@ -156,6 +158,23 @@ class Block extends React.Component {
|
|
|
156
158
|
data-placeholder='订单溯源'
|
|
157
159
|
/>
|
|
158
160
|
)
|
|
161
|
+
} else if (type === 'merchandise_trace_qrcode') {
|
|
162
|
+
console.log('template(merchandise_trace_qrcode, data)', merchandise_trace_qrcode, data, template(merchandise_trace_qrcode, data))
|
|
163
|
+
content = isStation ? (
|
|
164
|
+
<QrCode
|
|
165
|
+
value={miniAppLink + template(merchandise_trace_qrcode, data)}
|
|
166
|
+
size={parseInt(style.height)}
|
|
167
|
+
/>
|
|
168
|
+
) : (
|
|
169
|
+
<div
|
|
170
|
+
data-merchandise_trace_qrcode={template(merchandise_trace_qrcode, data)}
|
|
171
|
+
data-width={style.width}
|
|
172
|
+
data-height={style.height}
|
|
173
|
+
data-name={index}
|
|
174
|
+
style={{ width: '100%', height: '100%' }}
|
|
175
|
+
data-placeholder='商品溯源二维码'
|
|
176
|
+
/>
|
|
177
|
+
)
|
|
159
178
|
} else if (type === 'barcode') {
|
|
160
179
|
content = isStation ? (
|
|
161
180
|
<>
|
package/src/util.js
CHANGED
|
@@ -75,7 +75,7 @@ function afterImgAndSvgLoaded (callback, $printer) {
|
|
|
75
75
|
timer = setTimeout(afterImgAndSvgLoaded.bind(this, callback, $printer), 300)
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const miniAppLink = 'https://
|
|
78
|
+
const miniAppLink = 'https://q.guanmai.cn/trace#/commodity_arch'
|
|
79
79
|
export {
|
|
80
80
|
pxAdd,
|
|
81
81
|
getStyleWithDiff,
|