示例模板代码
示例模板代码
xml
<?xml version="1.0" encoding="UTF-8"?>
<page
xmlns="http://cloudprint.cainiao.com/print"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://cloudprint.cainiao.com/print http://cloudprint-docs-resource.oss-cn-shanghai.aliyuncs.com/lpml_schema.xsd"
xmlns:editor="http://cloudprint.cainiao.com/schema/editor"
width="100" height="180" splitable="true" ><%
var services = ((_data || {}).shippingOption ||{}||{}).services|| {};
//@name=服务-代收货款金额;@group=CP服务;@scope=condition,display;@type=string
var SVC_COD_VALUE = ((services["SVC-COD"]||{}).value||"").toString();
//@name=服务-海外直送;@scope=condition;@type=bool
var SVC_INTERNATIONAL = (services["SVC-INTERNATIONAL"]||false);
//@name=服务-特色经济;@scope=condition;@type=bool
var SVC_YTTS = (services["SVC-YTTS"]||false);
//@name=服务-圆准达月结;@scope=condition;@type=bool
var SVC_YZDY = (services["SVC-YZDY"]||false);
//@name=服务-圆通VIP月结;@scope=condition;@type=bool
var SVC_VIPY = (services["SVC-VIPY"]||false);
//@name=服务-圆准达;@scope=condition;@type=bool
var SVC_YZDR = (services["SVC-YZDR"]||false);
//@name=服务-保价金额;@group=CP服务;@scope=condition,display;@type=string
var SVC_INSURE_VALUE = ((services["SVC-INSURE"]||{}).value||"").toString();
//@name=服务-拦截件;@scope=condition;@type=bool
var SVC_PACKAGE_INTERCEPT = (services["SVC-PACKAGE-INTERCEPT"]||false);
function isNotBlank(str){
return str !=undefined && str!=''
}
function isBlank(str){
return !isNotBlank(str)
}
var rplAddData = function (a, b) {
try {
var v = eval(b);
if (v != undefined) {
eval(a + ' = ' + b);
}
} catch (e) { }
}
rplAddData('_data.sender.name', '_data.addData.sender.name');
rplAddData('_data.sender.phone', '_data.addData.sender.phone');
rplAddData('_data.sender.mobile', '_data.addData.sender.mobile');
rplAddData('_data.sender.address.province', '_data.addData.sender.address.province');
rplAddData('_data.sender.address.city', '_data.addData.sender.address.city');
rplAddData('_data.sender.address.district', '_data.addData.sender.address.district');
rplAddData('_data.sender.address.town', '_data.addData.sender.address.town');
rplAddData('_data.sender.address.detail', '_data.addData.sender.address.detail');
var services = ((_data || {}).shippingOption || {} || {}).services || {};
//@name=打印顶部LOGO;@scope=condition
var isNeedTopLogo = _config.needTopLogo || false;
//@name=打印底部LOGO;@scope=condition
var isNeedBottomLogo = _config.needBottomLogo || false;
/**
* 基本信息
*/
//@name=面单号;@group=基本信息
var waybillCode = _data.waybillCode;
//@name=母单号;@group=基本信息
var parentWaybillCode = _data.parentWaybillCode;
//@name=子母件;@scope=condition
var parentWaybillCodeCondition = _data.parentWaybillCode || false;
//@name=打印日期;@group=基本信息
var yyyyMMdd = _context.formatStartTime('yyyy/MM/dd')
//@name=打印时间;@group=基本信息
var hhmmss = _context.formatStartTime('HH:mm:ss')
var docSeq = _context.documentNumber();
if (typeof _context.documentCount == "function") {
docSeq = docSeq + "/" + _context.documentCount();
}
//@name=序号;@group=基本信息
var docSeqText = docSeq;
/**
* 寄件人
*/
//@name=寄件人姓名;@group=寄件人
var senderName = ((_data || {}).sender || {}).name || "";
//@name=寄件人姓名截取;@group=寄件人
var senderShortName = senderName.length > 7 ? senderName.substring(0, 6) + "…" : senderName;
//@name=寄件人手机号;@group=寄件人
var senderMobile = ((_data || {}).sender || {}).mobile || "";
//@name=寄件人座机;@group=寄件人
var senderPhone = ((_data || {}).sender || {}).phone || "";
if (!senderMobile) {
senderMobile = senderPhone;
senderPhone = '';
}
//@name=寄件省;@group=寄件人
var sendProvince = _data.sender.address.province
//@name=寄件市;@group=寄件人
var sendCity = _data.sender.address.city
//@name=寄件区;@group=寄件人
var sendDistrict = _data.sender.address.district
//@name=寄件街道;@group=寄件人
var sendTown = _data.sender.address.town
//@name=寄件详址;@group=寄件人
var sendDetail = _data.sender.address.detail
//@name=寄件完整地址截取;@group=寄件人
var senderShortAddr = _data.sender.address.province + " " + _data.sender.address.city;
var senderShortAddr = senderShortAddr.replace(/省|市|县|区/g, "");
/**
* 收件人
*/
//@name=收件人姓名;@group=收件人
var recipientName = ((_data || {}).recipient || {}).name || "";
//@name=收件人手机号;@group=收件人
var recipientMobile = ((_data || {}).recipient || {}).mobile || "";
//@name=收件人座机;@group=收件人
var recipientPhone = ((_data || {}).recipient || {}).phone || "";
if(recipientMobile == ''){
recipientMobile = recipientPhone;
recipientPhone = '';
}
//@name=收件省;@group=收件人
var recipientProvince = _data.recipient.address.province
//@name=收件市;@group=收件人
var recipientCity = _data.recipient.address.city
//@name=收件区;@group=收件人
var recipientDistrict = _data.recipient.address.district
//@name=收件街道;@group=收件人
var recipientTown = _data.recipient.address.town
//@name=收件详址;@group=收件人
var recipientDetail = _data.recipient.address.detail
//@name=打印驿站地址;@scope=condition;@type=bool
var needPrintStationAddr = _data.extraInfo.printStaAddress
//@name=驿站详细地址;@group=驿站
var stationDetailAddr = _data.extraInfo.staAddressDetail
//@name=驿站省份;@group=驿站
var staAddressProvince = _data.extraInfo.staAddressProvince
//@name=驿站市;@group=驿站
var staAddressCity = _data.extraInfo.staAddressCity
//@name=驿站区;@group=驿站
var staAddressArea = _data.extraInfo.staAddressArea
//@name=驿站街道;@group=驿站
var staAddressTown = _data.extraInfo.staAddressTown
if(isBlank(stationDetailAddr) || isBlank(staAddressTown)){
needPrintStationAddr=false
}
if(!needPrintStationAddr){
stationDetailAddr=""
staAddressProvince=""
staAddressCity=""
staAddressArea=""
staAddressTown=""
}
//@name=不打印驿站地址;@scope=condition;@type=bool
var noNeedPrintStationAddr = !needPrintStationAddr
//@name=收件人手机号脱敏;@group=收件人
var hideRecipientMobile = recipientMobile;
//@name=收件人座机脱敏;@group=收件人
var hideRecipientPhone = recipientPhone;
var isPrivacy = true;
/**
* 脱敏
*/
if (isPrivacy) {
if (recipientMobile.length >= 11) {
hideRecipientMobile = recipientMobile.slice(0, recipientMobile.length - 8) + "****" + recipientMobile.slice(-4);
}
if (recipientPhone.length >= 8) {
hideRecipientPhone = recipientPhone.slice(0, recipientPhone.length - 8) + "****" + recipientPhone.slice(-4);
}
}
/**
* 分单信息
*/
//@name=大头笔;@group=分单
var sortation_name = (((_data || {}).routingInfo || {} || {}).sortation || {} || {}).name || "";
//@name=二段码三段码;@group=分单
var route_code = ((_data || {}).routingInfo || {} || {}).routeCode || "";
//@name=四段码;@group=分单
var newBlockCode = ((_data || {}).routingInfo || {} || {}).newBlockCode || "";
//top 的 sdk错误识别成了数组,实际上是字符串
if(newBlockCode){
newBlockCode=newBlockCode.toString()
}
var blockCodeArr = newBlockCode.split('-')
//@name=四段码前缀;@group=分单
var newBlockCodePrefix = ''
//@name=四段码后缀;@group=分单
var newBlockCodePost = ''
//如果没有-或者数量超过 1 个说明数据有问题,面单不展示
if(blockCodeArr.length==2){
newBlockCodePrefix = blockCodeArr[0]
newBlockCodePost = blockCodeArr[1]
}
//@name=大头笔二段码三段码四段码;@group=分单
var datoubi = sortation_name + " " + route_code+" "+newBlockCode;
//@name=大头笔二段码三段码四段码短线;@group=分单
var datoubi_line = sortation_name + "-" + route_code+"-"+newBlockCode;
//@name=大头笔二段码三段码;@group=分单
var datoubi2 = sortation_name + " " + route_code;
//@name=大头笔二段码三段码短线;@group=分单
var datoubi2_line = sortation_name + "-" + route_code;
//@name=二段码;@group=分单;@scope=condition,display
var secondRouteCode = '';
if (route_code) {
if (route_code.length >= 3) {
secondRouteCode = route_code.slice(0, 3);
}
}
//@name=集包地;@group=分单
var consolidation = (((_data || {}).routingInfo || {} || {}).consolidation || {} || {}).name || "";
//@name=集包地code;@group=分单
var consolidationCode = (((_data || {}).routingInfo || {} || {}).consolidation || {} || {}).code || "";
var routes=route_code.split(" ");
var routes_str=""
for(var i=0;i<routes.length;i++){
routes_str+="-"
routes_str+=routes[i]
}
if(routes.length==1){
routes_str+="-"
}
//@name=集包地大头笔二段码三段码短线;@group=分单
var datoubi3_line = consolidation+"-"+sortation_name + routes_str;
/**
* blockCode 四段码
* endCode 驿站码或者柜子码
* 三者统称为末端码, 模板优先显示endCode
*/
//@name=末端码为驿站码;@scope=condition
var isPostStationCode = false;
//@name=末端码为柜子码;@scope=condition
var isGuiziCode = false;
//@name=末端码为四段码;@scope=condition
var isSiDuanCode = false;
var endCode = ((_data || {}).routingInfo || {} || {}).endCode || "";
var endCodeType = ((_data || {}).routingInfo || {} || {}).endCodeType || "";
//@name=末端码;@group=分单;@scope=condition,display
var blockCode = ((_data || {}).routingInfo || {} || {}).blockCode || "";
var heituSiteCode = ((_data || {}).routingInfo || {} || {}).heituSiteCode || "";
//淘系上门
var isSpecialUser = ((_data || {}).extraInfo || {} || {}).isSpecialUser || "";
//楼栋码
var S_B_N = ((_data || {}).extraInfo || {} || {}).S_B_N || "";
//@name=末端码前缀;@group=分单
var prefixCode = "末";
if (endCodeType.length > 0) {
var preBlockCode = blockCode;
if (endCodeType == 1 && endCode.length > 0) {
prefixCode = "驿";
blockCode = endCode;
isPostStationCode = true;
} else if (endCodeType == "2") {
prefixCode = "柜";
isGuiziCode = true;
} else if (endCodeType == "3" && endCode.length > 0) {
prefixCode = "驿";
blockCode = endCode;
isPostStationCode = true;
} else if (endCodeType == "4") {
prefixCode = "柜";
isGuiziCode = true;
}
}
if (blockCode && !isPostStationCode && !isGuiziCode) {
isSiDuanCode = true;
}
//@name=网点编号;@group=分单
var receiveBranchCode = (((_data || {}).routingInfo || {}).receiveBranch || {}).code || "";
//@name=网点名称;@group=分单
var receiveBranchName = (((_data || {}).routingInfo || {}).receiveBranch || {}).name || "";
/**
* 隐私面单
*/
var secretWaybillType = ((_data || {}).secretWaybillType || "");
//@name=隐私面单;@scope=condition
var secretWaybillService = false;
if (secretWaybillType == "recipientSecret") {
secretWaybillService = true;
}
if(secretWaybillType == "privacy2"){
secretWaybillService = true;
}
var secretConsigneeMobile = ((_data || {}).recipient || {}).secretConsigneeMobile || "";
//@name=隐私号码;@group=隐私面单;@scope=condition,display
var privacyNumber = "";
if (secretWaybillService) {
if (recipientMobile != "" && recipientMobile.length >= 8) {
recipientMobile = "*******" + recipientMobile.slice(-4);
}
if (secretConsigneeMobile.indexOf("-") != -1) {
privacyNumber = secretConsigneeMobile.replace("-", "转");
} else {
privacyNumber = secretConsigneeMobile;
}
if (recipientMobile.length >= 11) {
hideRecipientMobile = "*******" + recipientMobile.slice(-4);
}
if (recipientPhone.length >= 8) {
hideRecipientPhone = "****" + recipientPhone.slice(-4);
}
recipientPhone = '';
}
var appointTag = ((_data || {}).extraInfo || {}).appointTag || "";
//@name=上门送;@scope=condition;
var appointService = false;
if (appointTag == '1') {
appointService = true;
}
//@name=上门送真实姓名;@group=上门送;@scope=condition,display
var realRecName = (((_data || {}).extraInfo || {}).realRec || {}).name || "";
//@name=上门送真实电话;@group=上门送;@scope=condition,display
var realRecMobile = (((_data || {}).extraInfo || {}).realRec || {}).mobile || "";
var orgBlockCode = ((_data || {}).routingInfo || {} || {}).blockCode || "";
if (realRecMobile != "" && realRecMobile.length >= 8) {
realRecMobile = realRecMobile.slice(0, realRecMobile.length - 8) + "****" + realRecMobile.slice(-4);
}
if (appointService) {
if (orgBlockCode != '') {
blockCode = orgBlockCode;
prefixCode = "末";
} else {
blockCode = '';
}
}
if(isSpecialUser == 'true'){
prefixCode = '特'
}
//楼栋码不为空的情况下,显示楼栋码
if(S_B_N!=''){
blockCode = S_B_N
}
/**
* 广告
*/
//@name=展示广告;@scope=condition;
var displayAds = true;
//@name=展示隐私底部区域(仅在原有的情况下展示时进行控制);@scope=condition;
var isDispalyPrivacyBackup = true;
if(_data.extraInfo && _data.extraInfo.displayPrivacyBackup !== undefined && _data.extraInfo.displayPrivacyBackup === false){
isDispalyPrivacyBackup = false;
}
if (secretWaybillService) {
displayAds = false;
//_data.adsInfo.trackUrl = "https://page.cainiao.com/waybill/waybill-marketing/ysmd.html";
var encryptWaybillCode = ((_data || {}).extraInfo || {}).encryptWaybillCode || "";
//_data.adsInfo.trackUrl = "https://page.cainiao.com/wa/w/#/?"+encryptWaybillCode;
}
//@name=广告二维码;@group=广告
var trackUrl = ((_data || {}).adsInfo || {}).trackUrl || "";
//@name=广告图片;@group=广告;@scope=condition,display
var miniBannerUrl = ((_data || {}).adsInfo || {}).miniBannerUrl || "";
//@name=二联单广告图片;@group=广告;@scope=condition,display
var bannerUrl = ((_data || {}).adsInfo || {}).bannerUrl || "";
var userLogisticsSelectVaule = ((services["SVC-USER-LOGISTICS-SELECT"] || {})["USER_LOGISTICS_SELECT_VALUE"]) || '';
//@name=精准派送;@scope=condition
var accurateDelivery = false;
if(userLogisticsSelectVaule == 'CE10002'){
accurateDelivery = true;
}
//@name=服务-快递包裹;@type=bool;@scope=condition
var kdbg = true;
//@name=个性面单;@scope=condition
var showpersonalizedWaybill=isNotBlank(((_data || {}).personalizedWaybill || {}).id || "");
var personalizedWaybill={};
//生成图片的个性面单
function generatorImagePersonalizedWaybill(url,width){
return '<layout top="0" left="0" width="'+width+'" height="16"><image src="'+url+'"/></layout>'
}
//生成自定义内容的个性面单
function generatorContentPersonalizedWaybill(params){
var background=generatorImagePersonalizedWaybill(params.url,params.pageWidth)
var con='<layout width="'+params.width+'" height="'+params.height+'" left="'+params.left+'" top="'+params.top+'"><text style="fontFamily:'+params.fontFamily+';fontSize:auto;fontColor:'+params.color+';align:center;valign:middle;"><![CDATA['+params.content+']]></text></layout>'
return '<layout>'+background+con+'</layout>';
}
//生成个性面单内容
function generatorPersonalizedWaybill(width,height){
var personalizedWaybillId = _data. personalizedWaybill.id;
var personalizedWaybillContent = _data. personalizedWaybill.content;
var personalizedResource = _data. personalizedWaybill.resources;
//如果存在资源信息
if(personalizedResource){
return generatorPersonalizedWaybill2(personalizedResource,width,height)
}
return ''
}
function generatorPersonalizedWaybill2(resources,width,height){
var prefix='<layout width="'+width+'" height="'+height+'" style="overflow:hidden;">'
var scaleX = width/76
var scaleY = height/16
var content='';
for(var i=0;i<resources.length;i++){
content += generatorPersonalizedWaybillResource(resources[i],scaleX,scaleY)
}
var post='</layout>'
return prefix + content + post;
}
function generatorPersonalizedWaybillResource(resource,scaleX,scaleY){
//支持多种尺寸的模板
var rw=resource.width * scaleX
var rh=resource.height * scaleY
var rt=resource.top * scaleY
var rl=resource.left * scaleX
var style='alpha:'+resource.alpha+';rotation:'+resource.rotation+';';
var image = '<image src="'+resource.url+'" style="'+style+'" allowFailure="true"/>'
if(resource.shareCode && resource.shareCode!=''){
rw = rh
image='<barcode type="qrcode">'+resource.url+'</barcode>'
}
var prefix='<layout width="'+rw+'" height="'+rh+'" top="'+rt+'" left="'+rl+'">'
var post="</layout>"
return prefix + image + post;
}
function generatorAd(single,width,height){
if(!_data.adsInfo){
return ''
}
//仅底部的广告
var adDynamicInfo = single ? _data.adsInfo.oneWaybillDynamicInfo : _data.adsInfo.twoWaybillDynamicInfo
var adUrl = single?_data.adsInfo.miniBannerUrl:_data.adsInfo.bannerUrl
var scaleX = width / 76
var scaleY = height / 16
if(!single){
scaleX = width / 100
scaleY = height / 16
}
var scale = scaleX
if(scaleX < scaleY){
scale = scaleY
}
var trackUrl= _data.adsInfo.trackUrl
if(adDynamicInfo){
var qrCodeW = adDynamicInfo.QR_W * scale
var qrCodeH = adDynamicInfo.QR_H * scale
var qrCOdeT = adDynamicInfo.QR_T * scale
var qrCOdeL = adDynamicInfo.QR_L * scale
var simpleAdImage = '<layout width="'+width+'" height="'+height+'" top="'+0+'" left="'+0+'"><image src="'+adUrl+'" allowFailure="true"/></layout>'
if(adUrl== undefined){
simpleAdImage=''
}
var post ='<layout width="'+qrCodeW+'" height="'+qrCodeH+'" left="'+qrCOdeL+'" top="'+qrCOdeT+'" style="zIndex:2;"><barcode type="qrcode" ratioMode="keepRatio"><![CDATA['+trackUrl+']]></barcode></layout>'
if(trackUrl==undefined){
post=''
}
return simpleAdImage + post
}else{
var barSize = 16 * scale
var simpleAdImage = '<layout width="'+(width-barSize)+'" height="'+height+'" top="'+0+'" left="'+0+'"><image src="'+adUrl+'" allowFailure="true"/></layout>'
if(adUrl== undefined){
simpleAdImage=''
}
var post = '<layout width="'+barSize+'" height="'+barSize+'" left="'+(width-barSize-6)+'" top="0"><barcode type="qrcode" ratioMode="keepRatio"><![CDATA['+trackUrl+']]></barcode></layout>'
if(trackUrl==undefined){
post=''
}
return simpleAdImage + post
}
}
function useCustomArea(){
if(_data. personalizedWaybill){
return true
}
//隐私面单
if(_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret'){
return true
}
return !_data.adsInfo.useCustomArea
}
//@name=展示自定义区;@scope=condition;
var use_custom_area=useCustomArea()
var CUSTOM_AREA = use_custom_area ? "CUSTOM_AREA" : ""
function generatorBottom(single,width,height){
var prefix = '<footer height="'+height+'">'
var post = '</footer>'
//个性面单
if(_data. personalizedWaybill){
return prefix+generatorPersonalizedWaybill(width,height)+post
}
//隐私面单
if(isDispalyPrivacyBackup && (_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret')){
return prefix+generatorPrivacy(width,height)+post
}
//广告
if(!_data.adsInfo.useCustomArea){
return prefix+generatorAd(single,width,height)+post
}
return ''
}
function generatorLargeAd(single,width,height){
if(_data. personalizedWaybill){
return ''
}
//隐私面单
if(_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret'){
return ''
}
var adUrl = single?_data.adsInfo.miniBannerUrl:_data.adsInfo.bannerUrl
if(_data.adsInfo.useCustomArea){
var barSize = 15
var barLeft = (width-barSize)/2
var barTop = (height-barSize)/2
return '<layout width="' + width + '" height="' + height + '"><image src="'+adUrl+'" allowFailure="true"></image></layout>'+
'<layout width="'+barSize+'" height="'+barSize+'" top="'+barTop+'" left="'+barLeft+'"><barcode type="qrcode"><![CDATA['+_data.adsInfo.trackUrl+']]></barcode></layout>'
}else{
return ''
}
}
/*
* 生成隐私区域
*/
function generatorPrivacy(width,height){
var privacyQrCodeContent ="https://page.cainiao.com/wa/w/#/?"+_data.extraInfo.encryptWaybillCode
//淘宝隐私
if(_data.orderChannelsType =='TB' || _data.orderChannelsType =='TM' || _data.orderChannelsType =='1688' || _data.orderChannelsType =='KAO_LA'){
tipMessage = "淘宝号码保护生效中 " + _data.recipient.secretConsigneeMobile
privacyImage = 'http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/69562fe063bc46a1ac772b70dbdc313f.png'
}else{
tipMessage = '菜鸟虚拟号码生效中 ' + _data.recipient.secretConsigneeMobile
privacyImage = 'http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/90189be145cb4be194c8d377ae003b68.png'
}
//1 2 1布局
var itemWidth = width/4.0
var barSize = itemWidth
if(barSize>height){
barSize = height
}
return '<layout width="'+itemWidth+'" height="'+height+'"><image src="'+privacyImage+'" allowFailure="true"/></layout>'+
'<layout height="'+height+'" width="'+itemWidth*2+'" ><text style="fontSize:8;fontWeight:bold;"><![CDATA['+tipMessage+'\n若无法拨通,扫二维码获取备用号码]]></text></layout>'+
'<layout width="'+barSize+'" height="'+barSize+'"><barcode type="qrcode"><![CDATA['+privacyQrCodeContent+']]></barcode></layout>'
}
//@name=弱拦截;@type=bool;@scope=condition
var weakReach = _data.weakReach=="1";
//访问到真实 cp的 logo
var realCpCode = _data.realCpCode
var realCpLogoMapping ={
"YTO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474252117783.jpg",
"STO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474274333786.jpg",
"ZTO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474194075206.jpg",
"YUNDA":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474282421511.jpg",
"HTKY":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/8687290523cd4807ae2b3dfc40fa798a.png",
"DBKD":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474258599980.jpg",
"POSTB":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/7b351e510b9948d989d316506c791037.jpg",
"EMS":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474192819846.jpg",
"EYB":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/8f1fb8be2a824dd4aafb60619b1985d0.png"
}
//@name=真实的CPLOGO;@group=基本信息;
var realCpLogo = 'https://cdn-cloudprint.cainiao.com/waybill-print/templateImages/blank.png';
if(isNeedTopLogo){
realCpLogo=realCpLogoMapping[realCpCode]
}
//@name=订单渠道LOGO;@group=基本信息;
var orderChannelLogo = _data.orderChannelLogo
if(isBlank(orderChannelLogo)){
orderChannelLogo='https://cdn-cloudprint.cainiao.com/waybill-print/templateImages/blank.png'
}
//@name=序号总件数;@group=包裹信息
var sequenceTotalPackagesCount = "";
if (_data.packageInfo.currentPackageSequence) {
sequenceTotalPackagesCount += _data.packageInfo.currentPackageSequence;
}
if (_data.packageInfo.currentPackageSequence && _data.packageInfo.totalPackagesCount) {
sequenceTotalPackagesCount += "/";
}
if (_data.packageInfo.totalPackagesCount) {
sequenceTotalPackagesCount += _data.packageInfo.totalPackagesCount;
}
//@name=淘系订单;@type=bool;@scope=condition
var isTao = _data.orderChannelsType =='TB' || _data.orderChannelsType =='TM' || _data.orderChannelsType =='1688' || _data.orderChannelsType =='KAO_LA'
//@name=非淘系隐私订单;@type=bool;@scope=condition
var isPrivacyTao = !isTao & secretWaybillService
//@name=寄件站;@group=包裹信息
var routingInfoOriginName=_data.routingInfo.origin.name
//@name=通用送货上门;@group=分单信息;@scope=condition,display
var asdpAddedService = false
if(_data.shippingOption){
var shippingOption=_data.shippingOption
var encryptServices=shippingOption.encryptServices
if(encryptServices && encryptServices.services){
var innerWaybillCode=encryptServices.waybillCode
if(waybillCode==innerWaybillCode){
var rc_s102=encryptServices.services["RC-S102"]
if(rc_s102){
//送货上门类型
var siteHomePromiseType=rc_s102.siteHomePromiseType
asdpAddedService = (rc_s102.asdpServiceType=='siteHomePromise')
}
}
}
}
if (route_code == "") {
datoubi = sortation_name;
} else {
datoubi = route_code;
}
if (route_code) {
var fixRouteCode = route_code.split(/-| /);
if (fixRouteCode.length >= 2) {
if (fixRouteCode[2] == "00") {
secondRouteCode = fixRouteCode[1];
} else {
secondRouteCode = fixRouteCode[1] + "-" + fixRouteCode[2];
}
}
}
//@name=是否为猫超上门送;@scope=condition
var isTmallSmDemand = false;
var transType = (((_data || {}).extraInfo || {}).transFeatureMap || {}).transType || "";
if("tmallSupermarket" == transType){
isTmallSmDemand = true;
var realAddress = (((_data || {}).extraInfo || {}).realRec || {}).address || {};
if(realAddress.province){
recipientProvince = realAddress.province;
}
if(realAddress.city){
recipientCity = realAddress.city;
}
if(realAddress.district){
recipientDistrict = realAddress.district;
}
if(realAddress.town){
recipientTown = realAddress.town;
}
if(realAddress.detail){
recipientDetail = realAddress.detail;
}
}
//@name=中转站站点名称;@group=中转站
var transName = (((_data || {}).extraInfo || {}).transFeatureMap || {}).transName || "";
//@name=中转路区编码;@group=中转站
var siteAreaCode = (((_data || {}).extraInfo || {}).transFeatureMap || {}).siteAreaCode || "";
//@name=服务-代收货款文案;@scope=condition;@type=bool
var DISPLAY_COD_TEXT = false;
//@name=服务-圆通VIP月结;@scope=condition;@type=bool
var SVC_VIPY = (services["SVC-VIPY"]||false);
//@name=服务-圆准达月结;@scope=condition;@type=bool
var SVC_YZDY = (services["SVC-YZDY"]||false);
//@name=服务-圆通VIP非月结;@scope=condition;@type=bool
var SVC_VIP = (services["SVC-VIP"]||false);
//@name=服务-圆准达非月结;@scope=condition;@type=bool
var SVC_YZDR = (services["SVC-YZDR"]||false);
/*
送货上门>圆准达(现结&月结)> vip(现结&月结)> 代收货款>保价
保价:SVC-INSURE
圆准达现结:SVC-YZDR
圆准达月结:SVC-YZDY
VIP现结:SVC-VIP
VIP月结:SVC-
代收货款:SVC-COD
*/
if(asdpAddedService){
SVC_YZDR =false
SVC_YZDY=false
SVC_VIPY=false
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_YZDR || SVC_YZDY){
SVC_VIPY=false
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_VIPY){
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_COD_VALUE){
SVC_INSURE_VALUE=false
}
if (route_code) {
var fixRouteCode2 = route_code.split(/-| /);
if (fixRouteCode2.length >= 2) {
secondRouteCode=fixRouteCode2[1];
}
}
%>
<header height="0" >
</header>
<layout
id="element_layout_C2703061CD5215F7" width="100" height="164" style="overflow:visible;zIndex:371;"><line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="15.00"
endX="98"
endY="15"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="30.00"
endX="98"
endY="30"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="54"
endX="98"
endY="54"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="66"
endX="98"
endY="66"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="86"
endX="98"
endY="86"
>
</line>
<line
style="lineType:solid;lineColor:#000;"
startX="20.00"
startY="86"
endX="20"
endY="109.5"
editor:_deg_="90">
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="120"
endX="98"
endY="120"
>
</line>
<line
style="lineType:solid;lineColor:#000;"
startX="70"
startY="120"
endX="70"
endY="130"
editor:_deg_="90">
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="130"
endX="99"
endY="130"
>
</line>
<%if(kdbg){%>
<layout
editor:_for_="element_text_D0362864BFE67RCB"
id="element_layout_A2D8F71EC01XXX8C" width="14" height="14" left="60.4" top="0.74" style="overflow:visible;zIndex:21;">
<text
style="fontFamily:simhei;fontWeight:bold;fontSize:15;align:center;valign:middle;"
>
<![CDATA[标准快递]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="element_text_D0362864BFED5BCB"
id="element_layout_A2D8F71EC01AAA8C" width="76.66" height="17.14" left="9.91" top="30.56" style="overflow:visible;zIndex:30;">
<text editor:_printName_="收件人姓名 座机 手机 -收件人地址"
style="fontFamily:SimHei;fontSize:auto;"
condition="">
<![CDATA[<%=recipientName%> <%=recipientPhone%> <%=recipientMobile%> <%=privacyNumber%>
<%=recipientProvince%><%=recipientCity%><%=recipientDistrict%><%=recipientTown%><%=recipientDetail%>]]>
</text>
</layout><layout
editor:_for_="element_text_39EAD4AA7158C60E"
id="element_layout_2F4B3DAFC5CD6CDA" width="88.5" height="4.5" left="9.18" top="54.29" style="overflow:visible;zIndex:31;">
<text editor:_printName_="寄件人姓名 座机 手机"
style="fontFamily:simhei;fontSize:auto;"
condition="">
<![CDATA[<%=senderName%> <%=senderPhone%> <%=senderMobile%>]]>
</text>
</layout><layout
editor:_for_="element_text_0C29FB167353E125"
id="element_layout_BDDA5CD4BF325616" width="56.9" height="4" left="11" top="120.35" style="overflow:visible;zIndex:34;">
<text editor:_printName_="收件人姓名 座机 手机"
style="fontFamily:simhei;fontSize:7;"
condition="">
<![CDATA[<%=recipientName%> <%=hideRecipientPhone%> <%=hideRecipientMobile%>]]>
</text>
</layout><layout
editor:_for_="element_text_5EEB4684D5099746"
id="element_layout_BCCEE46036FB5554" width="78" height="14.06" left="1" top="15.5" style="overflow:visible;zIndex:17;">
<text
style="fontFamily:simhei;fontWeight:bold;fontSize:auto;align:center;valign:middle;"
condition="">
<![CDATA[<%=datoubi%>]]>
</text>
</layout><layout
editor:_for_="element_text_5D213708D1B2017A"
id="element_layout_69EECF1EB66409AD" width="87.12" height="6.85" left="8.66" top="58.79" style="overflow:visible;zIndex:18;">
<text editor:_printName_="寄件人地址"
style="fontFamily:simhei;fontSize:auto;lineHeight:4;"
condition="">
<![CDATA[<%=sendProvince%><%=sendCity%><%=sendDistrict%><%=sendTown%><%=sendDetail%>]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A8002"
id="element_layout_F941B52EC5172936002" width="50.53" height="14.95" left="47" top="89.35" style="overflow:visible;zIndex:19;">
<text
style="fontFamily:黑体;fontSize:7;lineHeight:3;valign:middle;"
condition="">
<![CDATA[快件送达收件人地址,经收件人或收件人(寄件人)允许的代收人签字,视为送达。您的签字代表您已经签收此包裹,并已确认商品信息无误、包装完好、没有划痕、破损等表面质量问题。]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A8003"
id="element_layout_F941B52EC5172936003" width="5" height="4" left="90.34" top="104" style="overflow:visible;zIndex:12;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191623743.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_text_4502C5900F885A8001"
id="element_layout_F941B52EC5172936001" width="9.6" height="3.89" left="80.53" top="104.3" style="overflow:visible;zIndex:23;">
<text
style="fontFamily:黑体;fontSize:7;align:right;valign:bottom;"
condition="">
<![CDATA[签收栏]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A80"
id="element_layout_F941B52EC5172936" width="12.78" height="3.87" left="1" top="103.3" style="overflow:visible;zIndex:20;">
<text
style="fontFamily:simhei;fontSize:7;align:right;valign:bottom;"
condition="">
<![CDATA[打印时间]]>
</text>
</layout><layout
editor:_for_="element_brcode_A48601852409D928"
id="element_layout_92B7062628BED605" width="80.11" height="18.4" left="7.79" top="67.6" style="overflow:visible;zIndex:32;"><barcode type="code128" style="hideText:false;rotation:0" value="<%=waybillCode%>" ratioMode="keepRatio" condition=""/>
</layout><layout
editor:_for_="element_text_B12AA29A2A78E991"
id="element_layout_2EB6125289467429" width="18.3" height="4.5" left="1.5" top="92.5" style="overflow:visible;zIndex:24;">
<text editor:_printName_="时间"
style="fontFamily:simhei;fontSize:11;"
condition="">
<![CDATA[<%=hhmmss%>]]>
</text>
</layout><layout
editor:_for_="element_text_48F9C47B8972EA41"
id="element_layout_3ADDAF57FC4C5E3C" width="17" height="6" left="1.5" top="97" style="overflow:visible;zIndex:26;">
<text editor:_printName_="序号"
style="fontFamily:simhei;fontSize:13;"
condition="">
<![CDATA[<%=docSeqText%>]]>
</text>
</layout><layout
editor:_for_="element_brcode_CEDB3635C33FF1B2"
id="element_layout_168920CEB02D8246" width="67.72" height="10" left="31.2" top="110" style="overflow:visible;zIndex:16;"><barcode type="code128" style="hideText:false;rotation:0" value="<%=waybillCode%>" ratioMode="keepRatio" condition=""/>
</layout><layout
editor:_for_="element_text_AF8FF0813794EB22"
id="element_layout_4FA8E0FB8CD621DD" width="58.72" height="5.48" left="10.23" top="123.99" style="overflow:visible;zIndex:28;">
<text editor:_printName_="地址"
style="fontFamily:simhei;fontSize:7;lineHeight:3;valign:middle;"
condition="">
<![CDATA[<%=recipientProvince%><%=recipientCity%><%=recipientDistrict%><%=recipientTown%><%=recipientDetail%>]]>
</text>
</layout><layout
editor:_for_="element_image_5DEEBD4D81722C69"
id="element_layout_60E64A5F027DD9D3" width="7" height="7" left="1.74" top="31.72" style="overflow:visible;zIndex:15;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191080248.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_168D6EAC905903E7"
id="element_layout_9B51040B49260B8C" width="6" height="6" left="1.47" top="54.7" style="overflow:visible;zIndex:14;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191355903.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_E1D398D19CE8A2FF"
id="element_layout_E6869E33FA3367C2" width="6.5" height="7" left="2" top="121.47" style="overflow:visible;zIndex:13;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191080248.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_6926397889F65589"
id="element_layout_D88365A374B21DDE" width="4" height="4" left="15.41" top="103" style="overflow:visible;zIndex:10;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191519187.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_text_B3A52D78379DB84B"
id="element_layout_FBE3EDA35582F047" width="17.5" height="4.5" left="1.5" top="88.35" style="overflow:visible;zIndex:22;">
<text editor:_printName_="日期"
style="fontFamily:simhei;"
condition="">
<![CDATA[<%=yyyyMMdd%>]]>
</text>
</layout><layout
editor:_for_="element_text_9F41AE2F911CB4E3"
id="element_layout_F541A2BF47B0C8C8" width="9.6" height="4" left="88" top="156" style="overflow:visible;zIndex:29;">
<text
style="fontFamily:simhei;fontSize:7;"
condition="">
<![CDATA[已验视]]>
</text>
</layout><line
style="lineType:solid;lineColor:#000;"
startX="46"
startY="86"
endX="46"
endY="109.5"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_qrcode_1472627448349"
id="element_layout_A81E2E88D84F437E" width="21.94" height="21.94" left="21.70" top="87.00" style="overflow:visible;zIndex:35;"><barcode type="qrcode" ratioMode="keepRatio" condition=""><![CDATA[]]></barcode>
</layout>
<%if(secondRouteCode){%>
<layout
editor:_for_="element_text_491F1481F4B3498D"
id="element_layout_B026B589B5FDC7AE" width="67.83" height="22" left="12.8" top="38.03" style="overflow:visible;zIndex:39;">
<text editor:_printName_="二段码水印"
style="fontFamily:SimHei;fontWeight:bold;fontSize:64;letterSpacing:5;lineHeight:0;align:center;valign:middle;alpha:0.65;"
>
<![CDATA[<%=secondRouteCode%>]]>
</text>
</layout>
<%}%>
<layout
id="1516954619218360" width="65" height="15" left="34" top="0" style="overflow:visible;zIndex:100;">
</layout>
<%if(!isPostStationCode){%>
<layout
editor:_for_="1555663062681567"
id="1555663062681219" width="12" height="14" left="87.95" top="16.12" style="zIndex:38;">
<text editor:_printName_="蝶园北区"
style="fontFamily:SimHei;fontSize:16;"
>
<![CDATA[<%=blockCode%>]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="1555663134007883"
id="1555663134008512" width="7" height="6.26" left="80.75" top="15.59" style="zIndex:40;">
<text editor:_printName_="驿"
style="fontFamily:SimHei;fontSize:auto;backgroundColor:#000;fontColor:#fff;"
condition="">
<![CDATA[<%=prefixCode%>]]>
</text>
</layout><line
style="lineType:dashed;lineColor:#000;"
startX="80"
startY="15"
endX="80"
endY="30"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_image_B520FBC513E2D3A4"
id="element_layout_C19C8F7A5A859B82" width="5.5" height="5.5" left="71.32" top="121.58" style="overflow:visible;zIndex:11;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191355903.png" allowFailure="false" condition=""/>
</layout><line
style="lineType:dashed;lineColor:#000;"
startX="80"
startY="15"
endX="80"
endY="30"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_text_A12AE8F34C37818E"
id="element_layout_61E86C4D84D36270" width="20" height="3" left="79" top="120.56" style="overflow:visible;zIndex:25;">
<text editor:_printName_="寄件人姓名"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderShortName%>]]>
</text>
</layout><layout
editor:_for_="1556099716510977"
id="1556099716510984" width="20" height="3" left="79" top="123.56" style="zIndex:37;">
<text editor:_printName_="手机"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderMobile%>]]>
</text>
</layout><layout
editor:_for_="1556099736189841"
id="1556099736189530" width="20" height="3" left="79" top="126.56" style="zIndex:41;">
<text editor:_printName_="地址"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderShortAddr%>]]>
</text>
</layout>
<%if(isPostStationCode){%>
<layout
editor:_for_="158280896510449"
id="1582808965104535" width="18.65" height="7.12" left="80.7" top="22.75" style="zIndex:42;">
<text
style="fontFamily:SimHei;fontSize:auto;"
>
<![CDATA[<%=blockCode%>]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="1593682180947319"
id="1593682180948182" width="36.38" height="5" left="0.53" top="9.79" style="zIndex:43;">
<text editor:_printName_="CN4123456789000"
style="fontFamily:SimHei;fontSize:auto;valign:bottom;"
condition="">
<![CDATA[<%=waybillCode%>]]>
</text>
</layout>
<%if(SVC_YZDY || SVC_YZDR || asdpAddedService){%>
<layout
editor:_for_="1641781707571569"
id="1641781707571550" width="22.16" height="12.46" left="57.73" top="1.59" style="zIndex:44;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/0e3a7599a4674efcaf9609541f44e40f.png" allowFailure="false" />
</layout>
<%}%>
<%if(SVC_COD_VALUE){%>
<layout
editor:_for_="164179169016043"
id="1641791690160683" width="19.97" height="10.03" left="37.56" top="2.9" style="zIndex:47;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:11;"
>
<![CDATA[代收货款:<%=SVC_COD_VALUE%>]]>
</text>
</layout>
<%}%>
<%if(secretWaybillService){%>
<layout
editor:_for_="1692955843464547"
id="1692955843464968" width="12.04" height="11.08" left="85.72" top="31.49" style="zIndex:48;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:12;backgroundColor:#000;fontColor:#fff;align:center;valign:middle;"
>
<![CDATA[虚拟
号码]]>
</text>
</layout>
<%}%>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="48"
endX="98"
endY="48"
>
</line>
<%if(needPrintStationAddr){%>
<layout
editor:_for_="169295592045860"
id="1692955920458251" width="95.38" height="5" left="2.12" top="48.95" style="zIndex:49;">
<text
style="fontFamily:SimHei;fontSize:auto;valign:middle;"
>
<![CDATA[【菜鸟驿站】<%=staAddressTown%><%=stationDetailAddr%>]]>
</text>
</layout>
<%}%>
<%if(asdpAddedService){%>
<layout
editor:_for_="1693290051349202"
id="1693290051350843" width="17.86" height="11.61" left="79.9" top="2.64" style="zIndex:50;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:auto;backgroundColor:#000;fontColor:#fff;align:center;valign:middle;"
>
<![CDATA[送货上门
淘宝专送]]>
</text>
</layout>
<%}%>
<%if(isNeedBottomLogo){%>
<layout
editor:_for_="1693533295194765"
id="169353329519451" width="19.83" height="9.25" left="3.17" top="111.12" style="zIndex:51;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/b4f65a4b7fb640fd9db4541bcd45b339.jpg" allowFailure="false" />
</layout>
<%}%>
<%if(isNeedTopLogo){%>
<layout
editor:_for_="1693549816139480"
id="16935498161396" width="23.27" height="10.85" left="0.79" top="0.26" style="zIndex:53;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/b4f65a4b7fb640fd9db4541bcd45b339.jpg" allowFailure="false" />
</layout>
<%}%>
</layout>
<layout
ref="CUSTOM_AREA"
id="element_layout_CBD1AEE6FA74C93E" width="100" height="40" left="1" top="130" style="overflow:hidden;zIndex:37;">
</layout>
<footer height="10" ><layout
id="1647311470141271" left="1" top="-6" style="zIndex:2;"><%=generatorBottom(false,100,16)%>
</layout>
</footer>
</page>
<?xml version="1.0" encoding="UTF-8"?>
<page
xmlns="http://cloudprint.cainiao.com/print"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://cloudprint.cainiao.com/print http://cloudprint-docs-resource.oss-cn-shanghai.aliyuncs.com/lpml_schema.xsd"
xmlns:editor="http://cloudprint.cainiao.com/schema/editor"
width="100" height="180" splitable="true" ><%
var services = ((_data || {}).shippingOption ||{}||{}).services|| {};
//@name=服务-代收货款金额;@group=CP服务;@scope=condition,display;@type=string
var SVC_COD_VALUE = ((services["SVC-COD"]||{}).value||"").toString();
//@name=服务-海外直送;@scope=condition;@type=bool
var SVC_INTERNATIONAL = (services["SVC-INTERNATIONAL"]||false);
//@name=服务-特色经济;@scope=condition;@type=bool
var SVC_YTTS = (services["SVC-YTTS"]||false);
//@name=服务-圆准达月结;@scope=condition;@type=bool
var SVC_YZDY = (services["SVC-YZDY"]||false);
//@name=服务-圆通VIP月结;@scope=condition;@type=bool
var SVC_VIPY = (services["SVC-VIPY"]||false);
//@name=服务-圆准达;@scope=condition;@type=bool
var SVC_YZDR = (services["SVC-YZDR"]||false);
//@name=服务-保价金额;@group=CP服务;@scope=condition,display;@type=string
var SVC_INSURE_VALUE = ((services["SVC-INSURE"]||{}).value||"").toString();
//@name=服务-拦截件;@scope=condition;@type=bool
var SVC_PACKAGE_INTERCEPT = (services["SVC-PACKAGE-INTERCEPT"]||false);
function isNotBlank(str){
return str !=undefined && str!=''
}
function isBlank(str){
return !isNotBlank(str)
}
var rplAddData = function (a, b) {
try {
var v = eval(b);
if (v != undefined) {
eval(a + ' = ' + b);
}
} catch (e) { }
}
rplAddData('_data.sender.name', '_data.addData.sender.name');
rplAddData('_data.sender.phone', '_data.addData.sender.phone');
rplAddData('_data.sender.mobile', '_data.addData.sender.mobile');
rplAddData('_data.sender.address.province', '_data.addData.sender.address.province');
rplAddData('_data.sender.address.city', '_data.addData.sender.address.city');
rplAddData('_data.sender.address.district', '_data.addData.sender.address.district');
rplAddData('_data.sender.address.town', '_data.addData.sender.address.town');
rplAddData('_data.sender.address.detail', '_data.addData.sender.address.detail');
var services = ((_data || {}).shippingOption || {} || {}).services || {};
//@name=打印顶部LOGO;@scope=condition
var isNeedTopLogo = _config.needTopLogo || false;
//@name=打印底部LOGO;@scope=condition
var isNeedBottomLogo = _config.needBottomLogo || false;
/**
* 基本信息
*/
//@name=面单号;@group=基本信息
var waybillCode = _data.waybillCode;
//@name=母单号;@group=基本信息
var parentWaybillCode = _data.parentWaybillCode;
//@name=子母件;@scope=condition
var parentWaybillCodeCondition = _data.parentWaybillCode || false;
//@name=打印日期;@group=基本信息
var yyyyMMdd = _context.formatStartTime('yyyy/MM/dd')
//@name=打印时间;@group=基本信息
var hhmmss = _context.formatStartTime('HH:mm:ss')
var docSeq = _context.documentNumber();
if (typeof _context.documentCount == "function") {
docSeq = docSeq + "/" + _context.documentCount();
}
//@name=序号;@group=基本信息
var docSeqText = docSeq;
/**
* 寄件人
*/
//@name=寄件人姓名;@group=寄件人
var senderName = ((_data || {}).sender || {}).name || "";
//@name=寄件人姓名截取;@group=寄件人
var senderShortName = senderName.length > 7 ? senderName.substring(0, 6) + "…" : senderName;
//@name=寄件人手机号;@group=寄件人
var senderMobile = ((_data || {}).sender || {}).mobile || "";
//@name=寄件人座机;@group=寄件人
var senderPhone = ((_data || {}).sender || {}).phone || "";
if (!senderMobile) {
senderMobile = senderPhone;
senderPhone = '';
}
//@name=寄件省;@group=寄件人
var sendProvince = _data.sender.address.province
//@name=寄件市;@group=寄件人
var sendCity = _data.sender.address.city
//@name=寄件区;@group=寄件人
var sendDistrict = _data.sender.address.district
//@name=寄件街道;@group=寄件人
var sendTown = _data.sender.address.town
//@name=寄件详址;@group=寄件人
var sendDetail = _data.sender.address.detail
//@name=寄件完整地址截取;@group=寄件人
var senderShortAddr = _data.sender.address.province + " " + _data.sender.address.city;
var senderShortAddr = senderShortAddr.replace(/省|市|县|区/g, "");
/**
* 收件人
*/
//@name=收件人姓名;@group=收件人
var recipientName = ((_data || {}).recipient || {}).name || "";
//@name=收件人手机号;@group=收件人
var recipientMobile = ((_data || {}).recipient || {}).mobile || "";
//@name=收件人座机;@group=收件人
var recipientPhone = ((_data || {}).recipient || {}).phone || "";
if(recipientMobile == ''){
recipientMobile = recipientPhone;
recipientPhone = '';
}
//@name=收件省;@group=收件人
var recipientProvince = _data.recipient.address.province
//@name=收件市;@group=收件人
var recipientCity = _data.recipient.address.city
//@name=收件区;@group=收件人
var recipientDistrict = _data.recipient.address.district
//@name=收件街道;@group=收件人
var recipientTown = _data.recipient.address.town
//@name=收件详址;@group=收件人
var recipientDetail = _data.recipient.address.detail
//@name=打印驿站地址;@scope=condition;@type=bool
var needPrintStationAddr = _data.extraInfo.printStaAddress
//@name=驿站详细地址;@group=驿站
var stationDetailAddr = _data.extraInfo.staAddressDetail
//@name=驿站省份;@group=驿站
var staAddressProvince = _data.extraInfo.staAddressProvince
//@name=驿站市;@group=驿站
var staAddressCity = _data.extraInfo.staAddressCity
//@name=驿站区;@group=驿站
var staAddressArea = _data.extraInfo.staAddressArea
//@name=驿站街道;@group=驿站
var staAddressTown = _data.extraInfo.staAddressTown
if(isBlank(stationDetailAddr) || isBlank(staAddressTown)){
needPrintStationAddr=false
}
if(!needPrintStationAddr){
stationDetailAddr=""
staAddressProvince=""
staAddressCity=""
staAddressArea=""
staAddressTown=""
}
//@name=不打印驿站地址;@scope=condition;@type=bool
var noNeedPrintStationAddr = !needPrintStationAddr
//@name=收件人手机号脱敏;@group=收件人
var hideRecipientMobile = recipientMobile;
//@name=收件人座机脱敏;@group=收件人
var hideRecipientPhone = recipientPhone;
var isPrivacy = true;
/**
* 脱敏
*/
if (isPrivacy) {
if (recipientMobile.length >= 11) {
hideRecipientMobile = recipientMobile.slice(0, recipientMobile.length - 8) + "****" + recipientMobile.slice(-4);
}
if (recipientPhone.length >= 8) {
hideRecipientPhone = recipientPhone.slice(0, recipientPhone.length - 8) + "****" + recipientPhone.slice(-4);
}
}
/**
* 分单信息
*/
//@name=大头笔;@group=分单
var sortation_name = (((_data || {}).routingInfo || {} || {}).sortation || {} || {}).name || "";
//@name=二段码三段码;@group=分单
var route_code = ((_data || {}).routingInfo || {} || {}).routeCode || "";
//@name=四段码;@group=分单
var newBlockCode = ((_data || {}).routingInfo || {} || {}).newBlockCode || "";
//top 的 sdk错误识别成了数组,实际上是字符串
if(newBlockCode){
newBlockCode=newBlockCode.toString()
}
var blockCodeArr = newBlockCode.split('-')
//@name=四段码前缀;@group=分单
var newBlockCodePrefix = ''
//@name=四段码后缀;@group=分单
var newBlockCodePost = ''
//如果没有-或者数量超过 1 个说明数据有问题,面单不展示
if(blockCodeArr.length==2){
newBlockCodePrefix = blockCodeArr[0]
newBlockCodePost = blockCodeArr[1]
}
//@name=大头笔二段码三段码四段码;@group=分单
var datoubi = sortation_name + " " + route_code+" "+newBlockCode;
//@name=大头笔二段码三段码四段码短线;@group=分单
var datoubi_line = sortation_name + "-" + route_code+"-"+newBlockCode;
//@name=大头笔二段码三段码;@group=分单
var datoubi2 = sortation_name + " " + route_code;
//@name=大头笔二段码三段码短线;@group=分单
var datoubi2_line = sortation_name + "-" + route_code;
//@name=二段码;@group=分单;@scope=condition,display
var secondRouteCode = '';
if (route_code) {
if (route_code.length >= 3) {
secondRouteCode = route_code.slice(0, 3);
}
}
//@name=集包地;@group=分单
var consolidation = (((_data || {}).routingInfo || {} || {}).consolidation || {} || {}).name || "";
//@name=集包地code;@group=分单
var consolidationCode = (((_data || {}).routingInfo || {} || {}).consolidation || {} || {}).code || "";
var routes=route_code.split(" ");
var routes_str=""
for(var i=0;i<routes.length;i++){
routes_str+="-"
routes_str+=routes[i]
}
if(routes.length==1){
routes_str+="-"
}
//@name=集包地大头笔二段码三段码短线;@group=分单
var datoubi3_line = consolidation+"-"+sortation_name + routes_str;
/**
* blockCode 四段码
* endCode 驿站码或者柜子码
* 三者统称为末端码, 模板优先显示endCode
*/
//@name=末端码为驿站码;@scope=condition
var isPostStationCode = false;
//@name=末端码为柜子码;@scope=condition
var isGuiziCode = false;
//@name=末端码为四段码;@scope=condition
var isSiDuanCode = false;
var endCode = ((_data || {}).routingInfo || {} || {}).endCode || "";
var endCodeType = ((_data || {}).routingInfo || {} || {}).endCodeType || "";
//@name=末端码;@group=分单;@scope=condition,display
var blockCode = ((_data || {}).routingInfo || {} || {}).blockCode || "";
var heituSiteCode = ((_data || {}).routingInfo || {} || {}).heituSiteCode || "";
//淘系上门
var isSpecialUser = ((_data || {}).extraInfo || {} || {}).isSpecialUser || "";
//楼栋码
var S_B_N = ((_data || {}).extraInfo || {} || {}).S_B_N || "";
//@name=末端码前缀;@group=分单
var prefixCode = "末";
if (endCodeType.length > 0) {
var preBlockCode = blockCode;
if (endCodeType == 1 && endCode.length > 0) {
prefixCode = "驿";
blockCode = endCode;
isPostStationCode = true;
} else if (endCodeType == "2") {
prefixCode = "柜";
isGuiziCode = true;
} else if (endCodeType == "3" && endCode.length > 0) {
prefixCode = "驿";
blockCode = endCode;
isPostStationCode = true;
} else if (endCodeType == "4") {
prefixCode = "柜";
isGuiziCode = true;
}
}
if (blockCode && !isPostStationCode && !isGuiziCode) {
isSiDuanCode = true;
}
//@name=网点编号;@group=分单
var receiveBranchCode = (((_data || {}).routingInfo || {}).receiveBranch || {}).code || "";
//@name=网点名称;@group=分单
var receiveBranchName = (((_data || {}).routingInfo || {}).receiveBranch || {}).name || "";
/**
* 隐私面单
*/
var secretWaybillType = ((_data || {}).secretWaybillType || "");
//@name=隐私面单;@scope=condition
var secretWaybillService = false;
if (secretWaybillType == "recipientSecret") {
secretWaybillService = true;
}
if(secretWaybillType == "privacy2"){
secretWaybillService = true;
}
var secretConsigneeMobile = ((_data || {}).recipient || {}).secretConsigneeMobile || "";
//@name=隐私号码;@group=隐私面单;@scope=condition,display
var privacyNumber = "";
if (secretWaybillService) {
if (recipientMobile != "" && recipientMobile.length >= 8) {
recipientMobile = "*******" + recipientMobile.slice(-4);
}
if (secretConsigneeMobile.indexOf("-") != -1) {
privacyNumber = secretConsigneeMobile.replace("-", "转");
} else {
privacyNumber = secretConsigneeMobile;
}
if (recipientMobile.length >= 11) {
hideRecipientMobile = "*******" + recipientMobile.slice(-4);
}
if (recipientPhone.length >= 8) {
hideRecipientPhone = "****" + recipientPhone.slice(-4);
}
recipientPhone = '';
}
var appointTag = ((_data || {}).extraInfo || {}).appointTag || "";
//@name=上门送;@scope=condition;
var appointService = false;
if (appointTag == '1') {
appointService = true;
}
//@name=上门送真实姓名;@group=上门送;@scope=condition,display
var realRecName = (((_data || {}).extraInfo || {}).realRec || {}).name || "";
//@name=上门送真实电话;@group=上门送;@scope=condition,display
var realRecMobile = (((_data || {}).extraInfo || {}).realRec || {}).mobile || "";
var orgBlockCode = ((_data || {}).routingInfo || {} || {}).blockCode || "";
if (realRecMobile != "" && realRecMobile.length >= 8) {
realRecMobile = realRecMobile.slice(0, realRecMobile.length - 8) + "****" + realRecMobile.slice(-4);
}
if (appointService) {
if (orgBlockCode != '') {
blockCode = orgBlockCode;
prefixCode = "末";
} else {
blockCode = '';
}
}
if(isSpecialUser == 'true'){
prefixCode = '特'
}
//楼栋码不为空的情况下,显示楼栋码
if(S_B_N!=''){
blockCode = S_B_N
}
/**
* 广告
*/
//@name=展示广告;@scope=condition;
var displayAds = true;
//@name=展示隐私底部区域(仅在原有的情况下展示时进行控制);@scope=condition;
var isDispalyPrivacyBackup = true;
if(_data.extraInfo && _data.extraInfo.displayPrivacyBackup !== undefined && _data.extraInfo.displayPrivacyBackup === false){
isDispalyPrivacyBackup = false;
}
if (secretWaybillService) {
displayAds = false;
//_data.adsInfo.trackUrl = "https://page.cainiao.com/waybill/waybill-marketing/ysmd.html";
var encryptWaybillCode = ((_data || {}).extraInfo || {}).encryptWaybillCode || "";
//_data.adsInfo.trackUrl = "https://page.cainiao.com/wa/w/#/?"+encryptWaybillCode;
}
//@name=广告二维码;@group=广告
var trackUrl = ((_data || {}).adsInfo || {}).trackUrl || "";
//@name=广告图片;@group=广告;@scope=condition,display
var miniBannerUrl = ((_data || {}).adsInfo || {}).miniBannerUrl || "";
//@name=二联单广告图片;@group=广告;@scope=condition,display
var bannerUrl = ((_data || {}).adsInfo || {}).bannerUrl || "";
var userLogisticsSelectVaule = ((services["SVC-USER-LOGISTICS-SELECT"] || {})["USER_LOGISTICS_SELECT_VALUE"]) || '';
//@name=精准派送;@scope=condition
var accurateDelivery = false;
if(userLogisticsSelectVaule == 'CE10002'){
accurateDelivery = true;
}
//@name=服务-快递包裹;@type=bool;@scope=condition
var kdbg = true;
//@name=个性面单;@scope=condition
var showpersonalizedWaybill=isNotBlank(((_data || {}).personalizedWaybill || {}).id || "");
var personalizedWaybill={};
//生成图片的个性面单
function generatorImagePersonalizedWaybill(url,width){
return '<layout top="0" left="0" width="'+width+'" height="16"><image src="'+url+'"/></layout>'
}
//生成自定义内容的个性面单
function generatorContentPersonalizedWaybill(params){
var background=generatorImagePersonalizedWaybill(params.url,params.pageWidth)
var con='<layout width="'+params.width+'" height="'+params.height+'" left="'+params.left+'" top="'+params.top+'"><text style="fontFamily:'+params.fontFamily+';fontSize:auto;fontColor:'+params.color+';align:center;valign:middle;"><![CDATA['+params.content+']]></text></layout>'
return '<layout>'+background+con+'</layout>';
}
//生成个性面单内容
function generatorPersonalizedWaybill(width,height){
var personalizedWaybillId = _data. personalizedWaybill.id;
var personalizedWaybillContent = _data. personalizedWaybill.content;
var personalizedResource = _data. personalizedWaybill.resources;
//如果存在资源信息
if(personalizedResource){
return generatorPersonalizedWaybill2(personalizedResource,width,height)
}
return ''
}
function generatorPersonalizedWaybill2(resources,width,height){
var prefix='<layout width="'+width+'" height="'+height+'" style="overflow:hidden;">'
var scaleX = width/76
var scaleY = height/16
var content='';
for(var i=0;i<resources.length;i++){
content += generatorPersonalizedWaybillResource(resources[i],scaleX,scaleY)
}
var post='</layout>'
return prefix + content + post;
}
function generatorPersonalizedWaybillResource(resource,scaleX,scaleY){
//支持多种尺寸的模板
var rw=resource.width * scaleX
var rh=resource.height * scaleY
var rt=resource.top * scaleY
var rl=resource.left * scaleX
var style='alpha:'+resource.alpha+';rotation:'+resource.rotation+';';
var image = '<image src="'+resource.url+'" style="'+style+'" allowFailure="true"/>'
if(resource.shareCode && resource.shareCode!=''){
rw = rh
image='<barcode type="qrcode">'+resource.url+'</barcode>'
}
var prefix='<layout width="'+rw+'" height="'+rh+'" top="'+rt+'" left="'+rl+'">'
var post="</layout>"
return prefix + image + post;
}
function generatorAd(single,width,height){
if(!_data.adsInfo){
return ''
}
//仅底部的广告
var adDynamicInfo = single ? _data.adsInfo.oneWaybillDynamicInfo : _data.adsInfo.twoWaybillDynamicInfo
var adUrl = single?_data.adsInfo.miniBannerUrl:_data.adsInfo.bannerUrl
var scaleX = width / 76
var scaleY = height / 16
if(!single){
scaleX = width / 100
scaleY = height / 16
}
var scale = scaleX
if(scaleX < scaleY){
scale = scaleY
}
var trackUrl= _data.adsInfo.trackUrl
if(adDynamicInfo){
var qrCodeW = adDynamicInfo.QR_W * scale
var qrCodeH = adDynamicInfo.QR_H * scale
var qrCOdeT = adDynamicInfo.QR_T * scale
var qrCOdeL = adDynamicInfo.QR_L * scale
var simpleAdImage = '<layout width="'+width+'" height="'+height+'" top="'+0+'" left="'+0+'"><image src="'+adUrl+'" allowFailure="true"/></layout>'
if(adUrl== undefined){
simpleAdImage=''
}
var post ='<layout width="'+qrCodeW+'" height="'+qrCodeH+'" left="'+qrCOdeL+'" top="'+qrCOdeT+'" style="zIndex:2;"><barcode type="qrcode" ratioMode="keepRatio"><![CDATA['+trackUrl+']]></barcode></layout>'
if(trackUrl==undefined){
post=''
}
return simpleAdImage + post
}else{
var barSize = 16 * scale
var simpleAdImage = '<layout width="'+(width-barSize)+'" height="'+height+'" top="'+0+'" left="'+0+'"><image src="'+adUrl+'" allowFailure="true"/></layout>'
if(adUrl== undefined){
simpleAdImage=''
}
var post = '<layout width="'+barSize+'" height="'+barSize+'" left="'+(width-barSize-6)+'" top="0"><barcode type="qrcode" ratioMode="keepRatio"><![CDATA['+trackUrl+']]></barcode></layout>'
if(trackUrl==undefined){
post=''
}
return simpleAdImage + post
}
}
function useCustomArea(){
if(_data. personalizedWaybill){
return true
}
//隐私面单
if(_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret'){
return true
}
return !_data.adsInfo.useCustomArea
}
//@name=展示自定义区;@scope=condition;
var use_custom_area=useCustomArea()
var CUSTOM_AREA = use_custom_area ? "CUSTOM_AREA" : ""
function generatorBottom(single,width,height){
var prefix = '<footer height="'+height+'">'
var post = '</footer>'
//个性面单
if(_data. personalizedWaybill){
return prefix+generatorPersonalizedWaybill(width,height)+post
}
//隐私面单
if(isDispalyPrivacyBackup && (_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret')){
return prefix+generatorPrivacy(width,height)+post
}
//广告
if(!_data.adsInfo.useCustomArea){
return prefix+generatorAd(single,width,height)+post
}
return ''
}
function generatorLargeAd(single,width,height){
if(_data. personalizedWaybill){
return ''
}
//隐私面单
if(_data.secretWaybillType =='privacy' || _data.secretWaybillType =='recipientSecret'){
return ''
}
var adUrl = single?_data.adsInfo.miniBannerUrl:_data.adsInfo.bannerUrl
if(_data.adsInfo.useCustomArea){
var barSize = 15
var barLeft = (width-barSize)/2
var barTop = (height-barSize)/2
return '<layout width="' + width + '" height="' + height + '"><image src="'+adUrl+'" allowFailure="true"></image></layout>'+
'<layout width="'+barSize+'" height="'+barSize+'" top="'+barTop+'" left="'+barLeft+'"><barcode type="qrcode"><![CDATA['+_data.adsInfo.trackUrl+']]></barcode></layout>'
}else{
return ''
}
}
/*
* 生成隐私区域
*/
function generatorPrivacy(width,height){
var privacyQrCodeContent ="https://page.cainiao.com/wa/w/#/?"+_data.extraInfo.encryptWaybillCode
//淘宝隐私
if(_data.orderChannelsType =='TB' || _data.orderChannelsType =='TM' || _data.orderChannelsType =='1688' || _data.orderChannelsType =='KAO_LA'){
tipMessage = "淘宝号码保护生效中 " + _data.recipient.secretConsigneeMobile
privacyImage = 'http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/69562fe063bc46a1ac772b70dbdc313f.png'
}else{
tipMessage = '菜鸟虚拟号码生效中 ' + _data.recipient.secretConsigneeMobile
privacyImage = 'http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/90189be145cb4be194c8d377ae003b68.png'
}
//1 2 1布局
var itemWidth = width/4.0
var barSize = itemWidth
if(barSize>height){
barSize = height
}
return '<layout width="'+itemWidth+'" height="'+height+'"><image src="'+privacyImage+'" allowFailure="true"/></layout>'+
'<layout height="'+height+'" width="'+itemWidth*2+'" ><text style="fontSize:8;fontWeight:bold;"><![CDATA['+tipMessage+'\n若无法拨通,扫二维码获取备用号码]]></text></layout>'+
'<layout width="'+barSize+'" height="'+barSize+'"><barcode type="qrcode"><![CDATA['+privacyQrCodeContent+']]></barcode></layout>'
}
//@name=弱拦截;@type=bool;@scope=condition
var weakReach = _data.weakReach=="1";
//访问到真实 cp的 logo
var realCpCode = _data.realCpCode
var realCpLogoMapping ={
"YTO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474252117783.jpg",
"STO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474274333786.jpg",
"ZTO":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474194075206.jpg",
"YUNDA":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474282421511.jpg",
"HTKY":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/8687290523cd4807ae2b3dfc40fa798a.png",
"DBKD":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474258599980.jpg",
"POSTB":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/7b351e510b9948d989d316506c791037.jpg",
"EMS":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474192819846.jpg",
"EYB":"http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/8f1fb8be2a824dd4aafb60619b1985d0.png"
}
//@name=真实的CPLOGO;@group=基本信息;
var realCpLogo = 'https://cdn-cloudprint.cainiao.com/waybill-print/templateImages/blank.png';
if(isNeedTopLogo){
realCpLogo=realCpLogoMapping[realCpCode]
}
//@name=订单渠道LOGO;@group=基本信息;
var orderChannelLogo = _data.orderChannelLogo
if(isBlank(orderChannelLogo)){
orderChannelLogo='https://cdn-cloudprint.cainiao.com/waybill-print/templateImages/blank.png'
}
//@name=序号总件数;@group=包裹信息
var sequenceTotalPackagesCount = "";
if (_data.packageInfo.currentPackageSequence) {
sequenceTotalPackagesCount += _data.packageInfo.currentPackageSequence;
}
if (_data.packageInfo.currentPackageSequence && _data.packageInfo.totalPackagesCount) {
sequenceTotalPackagesCount += "/";
}
if (_data.packageInfo.totalPackagesCount) {
sequenceTotalPackagesCount += _data.packageInfo.totalPackagesCount;
}
//@name=淘系订单;@type=bool;@scope=condition
var isTao = _data.orderChannelsType =='TB' || _data.orderChannelsType =='TM' || _data.orderChannelsType =='1688' || _data.orderChannelsType =='KAO_LA'
//@name=非淘系隐私订单;@type=bool;@scope=condition
var isPrivacyTao = !isTao & secretWaybillService
//@name=寄件站;@group=包裹信息
var routingInfoOriginName=_data.routingInfo.origin.name
//@name=通用送货上门;@group=分单信息;@scope=condition,display
var asdpAddedService = false
if(_data.shippingOption){
var shippingOption=_data.shippingOption
var encryptServices=shippingOption.encryptServices
if(encryptServices && encryptServices.services){
var innerWaybillCode=encryptServices.waybillCode
if(waybillCode==innerWaybillCode){
var rc_s102=encryptServices.services["RC-S102"]
if(rc_s102){
//送货上门类型
var siteHomePromiseType=rc_s102.siteHomePromiseType
asdpAddedService = (rc_s102.asdpServiceType=='siteHomePromise')
}
}
}
}
if (route_code == "") {
datoubi = sortation_name;
} else {
datoubi = route_code;
}
if (route_code) {
var fixRouteCode = route_code.split(/-| /);
if (fixRouteCode.length >= 2) {
if (fixRouteCode[2] == "00") {
secondRouteCode = fixRouteCode[1];
} else {
secondRouteCode = fixRouteCode[1] + "-" + fixRouteCode[2];
}
}
}
//@name=是否为猫超上门送;@scope=condition
var isTmallSmDemand = false;
var transType = (((_data || {}).extraInfo || {}).transFeatureMap || {}).transType || "";
if("tmallSupermarket" == transType){
isTmallSmDemand = true;
var realAddress = (((_data || {}).extraInfo || {}).realRec || {}).address || {};
if(realAddress.province){
recipientProvince = realAddress.province;
}
if(realAddress.city){
recipientCity = realAddress.city;
}
if(realAddress.district){
recipientDistrict = realAddress.district;
}
if(realAddress.town){
recipientTown = realAddress.town;
}
if(realAddress.detail){
recipientDetail = realAddress.detail;
}
}
//@name=中转站站点名称;@group=中转站
var transName = (((_data || {}).extraInfo || {}).transFeatureMap || {}).transName || "";
//@name=中转路区编码;@group=中转站
var siteAreaCode = (((_data || {}).extraInfo || {}).transFeatureMap || {}).siteAreaCode || "";
//@name=服务-代收货款文案;@scope=condition;@type=bool
var DISPLAY_COD_TEXT = false;
//@name=服务-圆通VIP月结;@scope=condition;@type=bool
var SVC_VIPY = (services["SVC-VIPY"]||false);
//@name=服务-圆准达月结;@scope=condition;@type=bool
var SVC_YZDY = (services["SVC-YZDY"]||false);
//@name=服务-圆通VIP非月结;@scope=condition;@type=bool
var SVC_VIP = (services["SVC-VIP"]||false);
//@name=服务-圆准达非月结;@scope=condition;@type=bool
var SVC_YZDR = (services["SVC-YZDR"]||false);
/*
送货上门>圆准达(现结&月结)> vip(现结&月结)> 代收货款>保价
保价:SVC-INSURE
圆准达现结:SVC-YZDR
圆准达月结:SVC-YZDY
VIP现结:SVC-VIP
VIP月结:SVC-
代收货款:SVC-COD
*/
if(asdpAddedService){
SVC_YZDR =false
SVC_YZDY=false
SVC_VIPY=false
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_YZDR || SVC_YZDY){
SVC_VIPY=false
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_VIPY){
SVC_COD_VALUE = false
SVC_INSURE_VALUE=false
}
if(SVC_COD_VALUE){
SVC_INSURE_VALUE=false
}
if (route_code) {
var fixRouteCode2 = route_code.split(/-| /);
if (fixRouteCode2.length >= 2) {
secondRouteCode=fixRouteCode2[1];
}
}
%>
<header height="0" >
</header>
<layout
id="element_layout_C2703061CD5215F7" width="100" height="164" style="overflow:visible;zIndex:371;"><line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="15.00"
endX="98"
endY="15"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="30.00"
endX="98"
endY="30"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="54"
endX="98"
endY="54"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="66"
endX="98"
endY="66"
>
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="86"
endX="98"
endY="86"
>
</line>
<line
style="lineType:solid;lineColor:#000;"
startX="20.00"
startY="86"
endX="20"
endY="109.5"
editor:_deg_="90">
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="120"
endX="98"
endY="120"
>
</line>
<line
style="lineType:solid;lineColor:#000;"
startX="70"
startY="120"
endX="70"
endY="130"
editor:_deg_="90">
</line>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="130"
endX="99"
endY="130"
>
</line>
<%if(kdbg){%>
<layout
editor:_for_="element_text_D0362864BFE67RCB"
id="element_layout_A2D8F71EC01XXX8C" width="14" height="14" left="60.4" top="0.74" style="overflow:visible;zIndex:21;">
<text
style="fontFamily:simhei;fontWeight:bold;fontSize:15;align:center;valign:middle;"
>
<![CDATA[标准快递]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="element_text_D0362864BFED5BCB"
id="element_layout_A2D8F71EC01AAA8C" width="76.66" height="17.14" left="9.91" top="30.56" style="overflow:visible;zIndex:30;">
<text editor:_printName_="收件人姓名 座机 手机 -收件人地址"
style="fontFamily:SimHei;fontSize:auto;"
condition="">
<![CDATA[<%=recipientName%> <%=recipientPhone%> <%=recipientMobile%> <%=privacyNumber%>
<%=recipientProvince%><%=recipientCity%><%=recipientDistrict%><%=recipientTown%><%=recipientDetail%>]]>
</text>
</layout><layout
editor:_for_="element_text_39EAD4AA7158C60E"
id="element_layout_2F4B3DAFC5CD6CDA" width="88.5" height="4.5" left="9.18" top="54.29" style="overflow:visible;zIndex:31;">
<text editor:_printName_="寄件人姓名 座机 手机"
style="fontFamily:simhei;fontSize:auto;"
condition="">
<![CDATA[<%=senderName%> <%=senderPhone%> <%=senderMobile%>]]>
</text>
</layout><layout
editor:_for_="element_text_0C29FB167353E125"
id="element_layout_BDDA5CD4BF325616" width="56.9" height="4" left="11" top="120.35" style="overflow:visible;zIndex:34;">
<text editor:_printName_="收件人姓名 座机 手机"
style="fontFamily:simhei;fontSize:7;"
condition="">
<![CDATA[<%=recipientName%> <%=hideRecipientPhone%> <%=hideRecipientMobile%>]]>
</text>
</layout><layout
editor:_for_="element_text_5EEB4684D5099746"
id="element_layout_BCCEE46036FB5554" width="78" height="14.06" left="1" top="15.5" style="overflow:visible;zIndex:17;">
<text
style="fontFamily:simhei;fontWeight:bold;fontSize:auto;align:center;valign:middle;"
condition="">
<![CDATA[<%=datoubi%>]]>
</text>
</layout><layout
editor:_for_="element_text_5D213708D1B2017A"
id="element_layout_69EECF1EB66409AD" width="87.12" height="6.85" left="8.66" top="58.79" style="overflow:visible;zIndex:18;">
<text editor:_printName_="寄件人地址"
style="fontFamily:simhei;fontSize:auto;lineHeight:4;"
condition="">
<![CDATA[<%=sendProvince%><%=sendCity%><%=sendDistrict%><%=sendTown%><%=sendDetail%>]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A8002"
id="element_layout_F941B52EC5172936002" width="50.53" height="14.95" left="47" top="89.35" style="overflow:visible;zIndex:19;">
<text
style="fontFamily:黑体;fontSize:7;lineHeight:3;valign:middle;"
condition="">
<![CDATA[快件送达收件人地址,经收件人或收件人(寄件人)允许的代收人签字,视为送达。您的签字代表您已经签收此包裹,并已确认商品信息无误、包装完好、没有划痕、破损等表面质量问题。]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A8003"
id="element_layout_F941B52EC5172936003" width="5" height="4" left="90.34" top="104" style="overflow:visible;zIndex:12;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191623743.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_text_4502C5900F885A8001"
id="element_layout_F941B52EC5172936001" width="9.6" height="3.89" left="80.53" top="104.3" style="overflow:visible;zIndex:23;">
<text
style="fontFamily:黑体;fontSize:7;align:right;valign:bottom;"
condition="">
<![CDATA[签收栏]]>
</text>
</layout><layout
editor:_for_="element_text_4502C5900F885A80"
id="element_layout_F941B52EC5172936" width="12.78" height="3.87" left="1" top="103.3" style="overflow:visible;zIndex:20;">
<text
style="fontFamily:simhei;fontSize:7;align:right;valign:bottom;"
condition="">
<![CDATA[打印时间]]>
</text>
</layout><layout
editor:_for_="element_brcode_A48601852409D928"
id="element_layout_92B7062628BED605" width="80.11" height="18.4" left="7.79" top="67.6" style="overflow:visible;zIndex:32;"><barcode type="code128" style="hideText:false;rotation:0" value="<%=waybillCode%>" ratioMode="keepRatio" condition=""/>
</layout><layout
editor:_for_="element_text_B12AA29A2A78E991"
id="element_layout_2EB6125289467429" width="18.3" height="4.5" left="1.5" top="92.5" style="overflow:visible;zIndex:24;">
<text editor:_printName_="时间"
style="fontFamily:simhei;fontSize:11;"
condition="">
<![CDATA[<%=hhmmss%>]]>
</text>
</layout><layout
editor:_for_="element_text_48F9C47B8972EA41"
id="element_layout_3ADDAF57FC4C5E3C" width="17" height="6" left="1.5" top="97" style="overflow:visible;zIndex:26;">
<text editor:_printName_="序号"
style="fontFamily:simhei;fontSize:13;"
condition="">
<![CDATA[<%=docSeqText%>]]>
</text>
</layout><layout
editor:_for_="element_brcode_CEDB3635C33FF1B2"
id="element_layout_168920CEB02D8246" width="67.72" height="10" left="31.2" top="110" style="overflow:visible;zIndex:16;"><barcode type="code128" style="hideText:false;rotation:0" value="<%=waybillCode%>" ratioMode="keepRatio" condition=""/>
</layout><layout
editor:_for_="element_text_AF8FF0813794EB22"
id="element_layout_4FA8E0FB8CD621DD" width="58.72" height="5.48" left="10.23" top="123.99" style="overflow:visible;zIndex:28;">
<text editor:_printName_="地址"
style="fontFamily:simhei;fontSize:7;lineHeight:3;valign:middle;"
condition="">
<![CDATA[<%=recipientProvince%><%=recipientCity%><%=recipientDistrict%><%=recipientTown%><%=recipientDetail%>]]>
</text>
</layout><layout
editor:_for_="element_image_5DEEBD4D81722C69"
id="element_layout_60E64A5F027DD9D3" width="7" height="7" left="1.74" top="31.72" style="overflow:visible;zIndex:15;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191080248.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_168D6EAC905903E7"
id="element_layout_9B51040B49260B8C" width="6" height="6" left="1.47" top="54.7" style="overflow:visible;zIndex:14;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191355903.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_E1D398D19CE8A2FF"
id="element_layout_E6869E33FA3367C2" width="6.5" height="7" left="2" top="121.47" style="overflow:visible;zIndex:13;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191080248.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_image_6926397889F65589"
id="element_layout_D88365A374B21DDE" width="4" height="4" left="15.41" top="103" style="overflow:visible;zIndex:10;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191519187.png" allowFailure="false" condition=""/>
</layout><layout
editor:_for_="element_text_B3A52D78379DB84B"
id="element_layout_FBE3EDA35582F047" width="17.5" height="4.5" left="1.5" top="88.35" style="overflow:visible;zIndex:22;">
<text editor:_printName_="日期"
style="fontFamily:simhei;"
condition="">
<![CDATA[<%=yyyyMMdd%>]]>
</text>
</layout><layout
editor:_for_="element_text_9F41AE2F911CB4E3"
id="element_layout_F541A2BF47B0C8C8" width="9.6" height="4" left="88" top="156" style="overflow:visible;zIndex:29;">
<text
style="fontFamily:simhei;fontSize:7;"
condition="">
<![CDATA[已验视]]>
</text>
</layout><line
style="lineType:solid;lineColor:#000;"
startX="46"
startY="86"
endX="46"
endY="109.5"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_qrcode_1472627448349"
id="element_layout_A81E2E88D84F437E" width="21.94" height="21.94" left="21.70" top="87.00" style="overflow:visible;zIndex:35;"><barcode type="qrcode" ratioMode="keepRatio" condition=""><![CDATA[]]></barcode>
</layout>
<%if(secondRouteCode){%>
<layout
editor:_for_="element_text_491F1481F4B3498D"
id="element_layout_B026B589B5FDC7AE" width="67.83" height="22" left="12.8" top="38.03" style="overflow:visible;zIndex:39;">
<text editor:_printName_="二段码水印"
style="fontFamily:SimHei;fontWeight:bold;fontSize:64;letterSpacing:5;lineHeight:0;align:center;valign:middle;alpha:0.65;"
>
<![CDATA[<%=secondRouteCode%>]]>
</text>
</layout>
<%}%>
<layout
id="1516954619218360" width="65" height="15" left="34" top="0" style="overflow:visible;zIndex:100;">
</layout>
<%if(!isPostStationCode){%>
<layout
editor:_for_="1555663062681567"
id="1555663062681219" width="12" height="14" left="87.95" top="16.12" style="zIndex:38;">
<text editor:_printName_="蝶园北区"
style="fontFamily:SimHei;fontSize:16;"
>
<![CDATA[<%=blockCode%>]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="1555663134007883"
id="1555663134008512" width="7" height="6.26" left="80.75" top="15.59" style="zIndex:40;">
<text editor:_printName_="驿"
style="fontFamily:SimHei;fontSize:auto;backgroundColor:#000;fontColor:#fff;"
condition="">
<![CDATA[<%=prefixCode%>]]>
</text>
</layout><line
style="lineType:dashed;lineColor:#000;"
startX="80"
startY="15"
endX="80"
endY="30"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_image_B520FBC513E2D3A4"
id="element_layout_C19C8F7A5A859B82" width="5.5" height="5.5" left="71.32" top="121.58" style="overflow:visible;zIndex:11;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/1474191355903.png" allowFailure="false" condition=""/>
</layout><line
style="lineType:dashed;lineColor:#000;"
startX="80"
startY="15"
endX="80"
endY="30"
editor:_deg_="90">
</line>
<layout
editor:_for_="element_text_A12AE8F34C37818E"
id="element_layout_61E86C4D84D36270" width="20" height="3" left="79" top="120.56" style="overflow:visible;zIndex:25;">
<text editor:_printName_="寄件人姓名"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderShortName%>]]>
</text>
</layout><layout
editor:_for_="1556099716510977"
id="1556099716510984" width="20" height="3" left="79" top="123.56" style="zIndex:37;">
<text editor:_printName_="手机"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderMobile%>]]>
</text>
</layout><layout
editor:_for_="1556099736189841"
id="1556099736189530" width="20" height="3" left="79" top="126.56" style="zIndex:41;">
<text editor:_printName_="地址"
style="fontFamily:黑体;fontSize:7;"
condition="">
<![CDATA[<%=senderShortAddr%>]]>
</text>
</layout>
<%if(isPostStationCode){%>
<layout
editor:_for_="158280896510449"
id="1582808965104535" width="18.65" height="7.12" left="80.7" top="22.75" style="zIndex:42;">
<text
style="fontFamily:SimHei;fontSize:auto;"
>
<![CDATA[<%=blockCode%>]]>
</text>
</layout>
<%}%>
<layout
editor:_for_="1593682180947319"
id="1593682180948182" width="36.38" height="5" left="0.53" top="9.79" style="zIndex:43;">
<text editor:_printName_="CN4123456789000"
style="fontFamily:SimHei;fontSize:auto;valign:bottom;"
condition="">
<![CDATA[<%=waybillCode%>]]>
</text>
</layout>
<%if(SVC_YZDY || SVC_YZDR || asdpAddedService){%>
<layout
editor:_for_="1641781707571569"
id="1641781707571550" width="22.16" height="12.46" left="57.73" top="1.59" style="zIndex:44;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/0e3a7599a4674efcaf9609541f44e40f.png" allowFailure="false" />
</layout>
<%}%>
<%if(SVC_COD_VALUE){%>
<layout
editor:_for_="164179169016043"
id="1641791690160683" width="19.97" height="10.03" left="37.56" top="2.9" style="zIndex:47;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:11;"
>
<![CDATA[代收货款:<%=SVC_COD_VALUE%>]]>
</text>
</layout>
<%}%>
<%if(secretWaybillService){%>
<layout
editor:_for_="1692955843464547"
id="1692955843464968" width="12.04" height="11.08" left="85.72" top="31.49" style="zIndex:48;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:12;backgroundColor:#000;fontColor:#fff;align:center;valign:middle;"
>
<![CDATA[虚拟
号码]]>
</text>
</layout>
<%}%>
<line
style="lineType:dotted;lineColor:#000;"
startX="1"
startY="48"
endX="98"
endY="48"
>
</line>
<%if(needPrintStationAddr){%>
<layout
editor:_for_="169295592045860"
id="1692955920458251" width="95.38" height="5" left="2.12" top="48.95" style="zIndex:49;">
<text
style="fontFamily:SimHei;fontSize:auto;valign:middle;"
>
<![CDATA[【菜鸟驿站】<%=staAddressTown%><%=stationDetailAddr%>]]>
</text>
</layout>
<%}%>
<%if(asdpAddedService){%>
<layout
editor:_for_="1693290051349202"
id="1693290051350843" width="17.86" height="11.61" left="79.9" top="2.64" style="zIndex:50;">
<text
style="fontFamily:SimHei;fontWeight:bold;fontSize:auto;backgroundColor:#000;fontColor:#fff;align:center;valign:middle;"
>
<![CDATA[送货上门
淘宝专送]]>
</text>
</layout>
<%}%>
<%if(isNeedBottomLogo){%>
<layout
editor:_for_="1693533295194765"
id="169353329519451" width="19.83" height="9.25" left="3.17" top="111.12" style="zIndex:51;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/b4f65a4b7fb640fd9db4541bcd45b339.jpg" allowFailure="false" />
</layout>
<%}%>
<%if(isNeedTopLogo){%>
<layout
editor:_for_="1693549816139480"
id="16935498161396" width="23.27" height="10.85" left="0.79" top="0.26" style="zIndex:53;"><image src="http://cdn-cloudprint.cainiao.com/waybill-print/cloudprint-imgs/b4f65a4b7fb640fd9db4541bcd45b339.jpg" allowFailure="false" />
</layout>
<%}%>
</layout>
<layout
ref="CUSTOM_AREA"
id="element_layout_CBD1AEE6FA74C93E" width="100" height="40" left="1" top="130" style="overflow:hidden;zIndex:37;">
</layout>
<footer height="10" ><layout
id="1647311470141271" left="1" top="-6" style="zIndex:2;"><%=generatorBottom(false,100,16)%>
</layout>
</footer>
</page>