WMS_MAIN/app/controller/template.js
liufumingren 05b71b2f31 feat: 抖音面单自定义区模板出口域名改为可配置路由
- config.default.js: 新增 customAreaBaseUrl 出口域名配置
- router.js: 新增 GET /mb/douyin1.xml 路由
- controller/template.js: 新增 douyinCustomArea() 方法输出静态 XML
- printer_data_builder.js: applyDouyinExpressFieldMapping 支持 customAreaBaseUrl 参数
- order_print.js: 将 app.config.customAreaBaseUrl 传入 buildPlatformRequestSkeleton
- douyin.json: 移除硬编码 templateURL,由运行时代码动态拼装
2026-08-02 00:35:08 +08:00

27 lines
791 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const {
Controller,
} = require('egg');
class TemplateController extends Controller {
async xml() {
const { service, ctx } = this;
const result = await service.systems.setting.printTemplate.getXmlByTemplate(ctx.params.id);
ctx.body = result;
}
/**
* 输出抖音面单自定义区模板 XML(douyin1.xml)
*/
async douyinCustomArea() {
const { ctx } = this;
ctx.type = 'application/xml';
ctx.body = `<?xml version="1.0" encoding="UTF-8"?>
<layout id="CUSTOM_AREA" width="97" height="60" left="0" top="111" style="">
<layout width="57" height="30" left="2" top="2" style="">
<text style="fontFamily:宋体;fontSize:9;fontWeight:600"><![CDATA[<%=_data.productInfo%>]]></text>
</layout>
</layout>`;
}
}
module.exports = TemplateController;