|
@@ -130,7 +130,7 @@ export default {
|
|
|
// 选中的管理端模板 id(未使用管理端模板时为 null)
|
|
// 选中的管理端模板 id(未使用管理端模板时为 null)
|
|
|
activeTemplateId: null,
|
|
activeTemplateId: null,
|
|
|
// 可选的背景色(渐变模板下展示)
|
|
// 可选的背景色(渐变模板下展示)
|
|
|
- bgColors: ['#FF8C42', '#6366F1', '#F59E0B', '#10B981', '#FF6B9D', '#1E293B', '#FFFFFF']
|
|
|
|
|
|
|
+ bgColors: ['BrandColors.body', 'BrandColors.wisdom', '#F59E0B', 'BrandColors.success', '#FF6B9D', '#1E293B', 'BrandColors.white']
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -179,19 +179,19 @@ export default {
|
|
|
var tpl = this.getActiveTemplate()
|
|
var tpl = this.getActiveTemplate()
|
|
|
if (tpl) {
|
|
if (tpl) {
|
|
|
return {
|
|
return {
|
|
|
- main: tpl.mainColor || '#F97316',
|
|
|
|
|
|
|
+ main: tpl.mainColor || 'BrandColors.primary',
|
|
|
dark: tpl.darkColor || '#EA580C',
|
|
dark: tpl.darkColor || '#EA580C',
|
|
|
- light: tpl.lightColor || '#FFF7ED'
|
|
|
|
|
|
|
+ light: tpl.lightColor || 'BrandColors.primaryPale'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
var map = {
|
|
var map = {
|
|
|
- body: { main: '#FF8C42', dark: '#EA580C', light: '#FFF7ED' },
|
|
|
|
|
|
|
+ body: { main: 'BrandColors.body', dark: '#EA580C', light: 'BrandColors.primaryPale' },
|
|
|
mind: { main: '#FF6B9D', dark: '#DB2777', light: '#FDF2F8' },
|
|
mind: { main: '#FF6B9D', dark: '#DB2777', light: '#FDF2F8' },
|
|
|
- wisdom: { main: '#6366F1', dark: '#4F46E5', light: '#EEF2FF' },
|
|
|
|
|
- action: { main: '#10B981', dark: '#059669', light: '#ECFDF5' },
|
|
|
|
|
|
|
+ wisdom: { main: 'BrandColors.wisdom', dark: '#4F46E5', light: '#EEF2FF' },
|
|
|
|
|
+ action: { main: 'BrandColors.success', dark: '#059669', light: '#ECFDF5' },
|
|
|
wealth: { main: '#F59E0B', dark: '#D97706', light: '#FFFBEB' }
|
|
wealth: { main: '#F59E0B', dark: '#D97706', light: '#FFFBEB' }
|
|
|
}
|
|
}
|
|
|
- return map[this.dimensionCode] || { main: '#F97316', dark: '#EA580C', light: '#FFF7ED' }
|
|
|
|
|
|
|
+ return map[this.dimensionCode] || { main: 'BrandColors.primary', dark: '#EA580C', light: 'BrandColors.primaryPale' }
|
|
|
},
|
|
},
|
|
|
// 海报模板配色
|
|
// 海报模板配色
|
|
|
getTemplateConfig() {
|
|
getTemplateConfig() {
|
|
@@ -209,7 +209,7 @@ export default {
|
|
|
return { template: 'minimal', bgColor: dark, main: colors.main, dark: colors.dark, light: colors.light }
|
|
return { template: 'minimal', bgColor: dark, main: colors.main, dark: colors.dark, light: colors.light }
|
|
|
}
|
|
}
|
|
|
// 卡片模板:浅色背景+彩色顶栏
|
|
// 卡片模板:浅色背景+彩色顶栏
|
|
|
- return { template: 'card', bgColor: bgColor || '#FFFFFF', main: colors.main, dark: colors.dark, light: colors.light }
|
|
|
|
|
|
|
+ return { template: 'card', bgColor: bgColor || 'BrandColors.white', main: colors.main, dark: colors.dark, light: colors.light }
|
|
|
},
|
|
},
|
|
|
// 获取当前模板的背景样式
|
|
// 获取当前模板的背景样式
|
|
|
getBgStyle() {
|
|
getBgStyle() {
|
|
@@ -221,7 +221,7 @@ export default {
|
|
|
if (cfg.template === 'minimal') {
|
|
if (cfg.template === 'minimal') {
|
|
|
return 'linear-gradient(135deg, ' + cfg.bgColor + ', ' + cfg.dark + ')'
|
|
return 'linear-gradient(135deg, ' + cfg.bgColor + ', ' + cfg.dark + ')'
|
|
|
}
|
|
}
|
|
|
- return 'linear-gradient(135deg, ' + cfg.main + ', ' + (cfg.bgColor || '#FFFFFF') + ')'
|
|
|
|
|
|
|
+ return 'linear-gradient(135deg, ' + cfg.main + ', ' + (cfg.bgColor || 'BrandColors.white') + ')'
|
|
|
},
|
|
},
|
|
|
drawPoster() {
|
|
drawPoster() {
|
|
|
var self = this
|
|
var self = this
|
|
@@ -267,7 +267,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
// 【模板3 · card】白色背景
|
|
// 【模板3 · card】白色背景
|
|
|
else {
|
|
else {
|
|
|
- ctx.setFillStyle('#FFFFFF')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
ctx.fillRect(0, 0, w, h)
|
|
ctx.fillRect(0, 0, w, h)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -342,7 +342,7 @@ export default {
|
|
|
|
|
|
|
|
_drawTopDecoration(ctx, w, colors) {
|
|
_drawTopDecoration(ctx, w, colors) {
|
|
|
var centerX = w / 2
|
|
var centerX = w / 2
|
|
|
- var dotColors = ['#FF8C42', '#6366F1', '#F59E0B', '#10B981', '#FF6B9D']
|
|
|
|
|
|
|
+ var dotColors = ['BrandColors.body', 'BrandColors.wisdom', '#F59E0B', 'BrandColors.success', '#FF6B9D']
|
|
|
var dotY = 28
|
|
var dotY = 28
|
|
|
var dotR = 5
|
|
var dotR = 5
|
|
|
var dotSpacing = 26
|
|
var dotSpacing = 26
|
|
@@ -357,7 +357,7 @@ export default {
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ctx.setFillStyle('#ffffff')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
ctx.setFontSize(this._fs(20))
|
|
ctx.setFontSize(this._fs(20))
|
|
|
ctx.setTextAlign('center')
|
|
ctx.setTextAlign('center')
|
|
|
ctx.setTextBaseline('top')
|
|
ctx.setTextBaseline('top')
|
|
@@ -390,7 +390,7 @@ export default {
|
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
|
- ctx.setFillStyle('#F97316')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.primary')
|
|
|
ctx.setFontSize(this._fs(16))
|
|
ctx.setFontSize(this._fs(16))
|
|
|
ctx.setTextAlign('center')
|
|
ctx.setTextAlign('center')
|
|
|
ctx.setTextBaseline('middle')
|
|
ctx.setTextBaseline('middle')
|
|
@@ -402,7 +402,7 @@ export default {
|
|
|
var data = this.energyData || {}
|
|
var data = this.energyData || {}
|
|
|
var dims = data.dims || []
|
|
var dims = data.dims || []
|
|
|
|
|
|
|
|
- ctx.setFillStyle('#FFFFFF')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
@@ -446,7 +446,7 @@ export default {
|
|
|
ctx.arc(cx, y + 94, 17, 0, 2 * Math.PI)
|
|
ctx.arc(cx, y + 94, 17, 0, 2 * Math.PI)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
|
- ctx.setFillStyle('#FFFFFF')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
ctx.setFontSize(this._fs(15))
|
|
ctx.setFontSize(this._fs(15))
|
|
|
ctx.setTextAlign('center')
|
|
ctx.setTextAlign('center')
|
|
|
ctx.setTextBaseline('middle')
|
|
ctx.setTextBaseline('middle')
|
|
@@ -487,7 +487,7 @@ export default {
|
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
this._roundRect(ctx, x, y, w, h, 8)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
|
- var dotColors = ['#FF8C42', '#6366F1', '#F59E0B', '#10B981', '#FF6B9D']
|
|
|
|
|
|
|
+ var dotColors = ['BrandColors.body', 'BrandColors.wisdom', '#F59E0B', 'BrandColors.success', '#FF6B9D']
|
|
|
var centerX = x + w / 2
|
|
var centerX = x + w / 2
|
|
|
for (var i = 0; i < 5; i++) {
|
|
for (var i = 0; i < 5; i++) {
|
|
|
ctx.setFillStyle(dotColors[i])
|
|
ctx.setFillStyle(dotColors[i])
|
|
@@ -496,7 +496,7 @@ export default {
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ctx.setFillStyle('#FFFFFF')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
ctx.setFontSize(this._fs(24))
|
|
ctx.setFontSize(this._fs(24))
|
|
|
ctx.setTextAlign('center')
|
|
ctx.setTextAlign('center')
|
|
|
ctx.setTextBaseline('top')
|
|
ctx.setTextBaseline('top')
|
|
@@ -579,7 +579,7 @@ export default {
|
|
|
data: base64Data,
|
|
data: base64Data,
|
|
|
encoding: 'base64',
|
|
encoding: 'base64',
|
|
|
success: function() {
|
|
success: function() {
|
|
|
- ctx.setFillStyle('#ffffff')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
self._roundRect(ctx, qrX - 10, qrY - 10, qrSize + 20, qrSize + 20, 8)
|
|
self._roundRect(ctx, qrX - 10, qrY - 10, qrSize + 20, qrSize + 20, 8)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
@@ -637,7 +637,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
_drawQrPlaceholder(ctx, x, y, size) {
|
|
_drawQrPlaceholder(ctx, x, y, size) {
|
|
|
- ctx.setFillStyle('#ffffff')
|
|
|
|
|
|
|
+ ctx.setFillStyle('BrandColors.white')
|
|
|
this._roundRect(ctx, x - 10, y - 10, size + 20, size + 20, 8)
|
|
this._roundRect(ctx, x - 10, y - 10, size + 20, size + 20, 8)
|
|
|
ctx.fill()
|
|
ctx.fill()
|
|
|
|
|
|
|
@@ -680,7 +680,7 @@ export default {
|
|
|
ctx.setTextBaseline('top')
|
|
ctx.setTextBaseline('top')
|
|
|
ctx.fillText(this.ctaText || '长按识别二维码 · 查看详情', centerX, bottomY)
|
|
ctx.fillText(this.ctaText || '长按识别二维码 · 查看详情', centerX, bottomY)
|
|
|
|
|
|
|
|
- var dotColors = ['#FF8C42', '#6366F1', '#F59E0B', '#10B981', '#FF6B9D']
|
|
|
|
|
|
|
+ var dotColors = ['BrandColors.body', 'BrandColors.wisdom', '#F59E0B', 'BrandColors.success', '#FF6B9D']
|
|
|
var dotY = h - 22
|
|
var dotY = h - 22
|
|
|
var dotR = 4
|
|
var dotR = 4
|
|
|
var dotSpacing = 20
|
|
var dotSpacing = 20
|
|
@@ -765,6 +765,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+import { body, primary, primaryPale, success, white, wisdom } from '@/utils/brand-colors.js'
|
|
|
|
|
|
|
|
<stylescoped lang="scss">
|
|
<stylescoped lang="scss">
|
|
|
.poster-overlay {
|
|
.poster-overlay {
|