|
|
@@ -673,10 +673,21 @@ std::string CPosPrinterData::PrintWaimaiOrderBiaoqian(CWaimaiOrder& order)
|
|
|
|
|
|
if (biaoqian_width >= 60)
|
|
|
{
|
|
|
- nHeightNow = nHeightNow + 30 + 30 + 30;
|
|
|
-
|
|
|
//这种是很宽的纸,接着打印姓名、电话、地址等信息
|
|
|
+ nHeightNow = nHeightNow + 30 + 30;
|
|
|
+
|
|
|
+ //先打印一个分割线
|
|
|
+ int nZimuNum = (int)(biaoqian_width * 24 / 40);
|
|
|
+
|
|
|
+ std::string line = "";
|
|
|
+ for (int i = 0; i < nZimuNum; i++)
|
|
|
+ {
|
|
|
+ line += "-";
|
|
|
+ }
|
|
|
|
|
|
+ textData += BIAOQIAN_TEXTGet(line, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
+
|
|
|
if (order.m_is_selftake == "1")
|
|
|
{
|
|
|
string date = "配送时间:【自取单】" + CLewaimaiString::UTF8ToANSI(order.m_delivery_date);
|
|
|
@@ -697,17 +708,23 @@ std::string CPosPrinterData::PrintWaimaiOrderBiaoqian(CWaimaiOrder& order)
|
|
|
textData += BIAOQIAN_TEXTGet(date, 12, nHeightNow, 1, 1);
|
|
|
}
|
|
|
}
|
|
|
+ nHeightNow += 30;
|
|
|
|
|
|
std::string pay_type = "支付方式:" + CLewaimaiString::UTF8ToANSI(order.m_pay_type);
|
|
|
- textData += BIAOQIAN_TEXTGet(pay_type, 12, nHeightNow + 30, 1, 1);
|
|
|
+ textData += BIAOQIAN_TEXTGet(pay_type, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
+
|
|
|
+ //打印分割线
|
|
|
+ textData += BIAOQIAN_TEXTGet(line, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
|
|
|
std::string name = "姓名:" + CLewaimaiString::UTF8ToANSI(order.m_customer_name);
|
|
|
- textData += BIAOQIAN_TEXTGet(name, 12, nHeightNow + 60, 1, 1);
|
|
|
+ textData += BIAOQIAN_TEXTGet(name, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
|
|
|
std::string phone = "电话:" + CLewaimaiString::UTF8ToANSI(order.m_phone);
|
|
|
- textData += BIAOQIAN_TEXTGet(phone, 12, nHeightNow + 90, 1, 1);
|
|
|
-
|
|
|
- int nHeightAddress = nHeightNow + 120;
|
|
|
+ textData += BIAOQIAN_TEXTGet(phone, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
|
|
|
//地址有可能很长要换行,要处理一下
|
|
|
std::string address = "地址:" + CLewaimaiString::UTF8ToANSI(order.m_address);
|
|
|
@@ -719,11 +736,11 @@ std::string CPosPrinterData::PrintWaimaiOrderBiaoqian(CWaimaiOrder& order)
|
|
|
int nRow = 0;
|
|
|
for (std::vector<std::string>::iterator it = addressVector.begin(); it != addressVector.end(); it++)
|
|
|
{
|
|
|
- textData += BIAOQIAN_TEXTGet(*it, 12, nHeightNow + 120 + 30 * nRow, 1, 1);
|
|
|
+ textData += BIAOQIAN_TEXTGet(*it, 12, nHeightNow, 1, 1);
|
|
|
|
|
|
nRow++;
|
|
|
|
|
|
- nHeightAddress += 30;
|
|
|
+ nHeightNow += 30;
|
|
|
}
|
|
|
|
|
|
//预设选项
|
|
|
@@ -732,11 +749,24 @@ std::string CPosPrinterData::PrintWaimaiOrderBiaoqian(CWaimaiOrder& order)
|
|
|
for (std::vector<CWaimaiOrderField>::iterator it = order.m_order_field.begin(); it != order.m_order_field.end() - 1; it++)
|
|
|
{
|
|
|
string order_field = CLewaimaiString::UTF8ToANSI((*it).name) + ":" + CLewaimaiString::UTF8ToANSI((*it).value);
|
|
|
- textData += BIAOQIAN_TEXTGet(order_field, 12, nHeightAddress, 1, 1);
|
|
|
+ textData += BIAOQIAN_TEXTGet(order_field, 12, nHeightNow, 1, 1);
|
|
|
|
|
|
- nHeightAddress += 30;
|
|
|
+ nHeightNow += 30;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //判断是否有备注
|
|
|
+ if (order.m_memo.length() > 0)
|
|
|
+ {
|
|
|
+ //打印分割线
|
|
|
+ textData += BIAOQIAN_TEXTGet(line, 12, nHeightNow, 1, 1);
|
|
|
+ nHeightNow += 30;
|
|
|
+
|
|
|
+ string memo = "顾客备注:" + CLewaimaiString::UTF8ToANSI(order.m_memo);
|
|
|
+ textData += BIAOQIAN_TEXTGet(memo, 12, nHeightNow, 1, 1);
|
|
|
+
|
|
|
+ nHeightNow += 30;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
WriteData(textData);
|