ts-glitter 13.8.61 → 13.8.62

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/lowcode/Entry.js CHANGED
@@ -64,7 +64,7 @@ export class Entry {
64
64
  }
65
65
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
66
66
  console.log(`Entry-time:`, window.renderClock.stop());
67
- glitter.share.editerVersion = 'V_13.8.61';
67
+ glitter.share.editerVersion = 'V_13.8.62';
68
68
  glitter.share.start = new Date();
69
69
  const vm = {
70
70
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -65,7 +65,7 @@ export class Entry {
65
65
  }
66
66
  (window as any).renderClock = (window as any).renderClock ?? clockF();
67
67
  console.log(`Entry-time:`, (window as any).renderClock.stop());
68
- glitter.share.editerVersion = 'V_13.8.61';
68
+ glitter.share.editerVersion = 'V_13.8.62';
69
69
  glitter.share.start = new Date();
70
70
  const vm: {
71
71
  appConfig: any;
@@ -170,6 +170,10 @@ height: 51px;
170
170
  ], () => {
171
171
  }, () => {
172
172
  });
173
+ setTimeout(() => {
174
+ window.IminPrintInstance = new IminPrinter();
175
+ window.IminPrintInstance.connect();
176
+ }, 3000);
173
177
  gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
174
178
  PayConfig.deviceType = res.deviceType || 'web';
175
179
  });
@@ -199,6 +199,12 @@ height: 51px;
199
199
  ], () => {
200
200
  }, () => {
201
201
  })
202
+ setTimeout(()=>{
203
+ //@ts-ignore
204
+ window.IminPrintInstance = new IminPrinter();
205
+ //@ts-ignore
206
+ window.IminPrintInstance.connect()
207
+ },3000)
202
208
  //設定裝置類型
203
209
  gvc.glitter.runJsInterFace("pos-device", {}, (res) => {
204
210
  PayConfig.deviceType = res.deviceType || 'web';
@@ -1712,31 +1712,31 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
1712
1712
  yield new Promise((resolve, reject) => {
1713
1713
  gvc.glitter.innerDialog((gvc) => {
1714
1714
  return html `
1715
- <div class="dialog-box">
1716
- <div class="dialog-content position-relative pb-5"
1717
- style="width: 452px;max-width: calc(100% - 20px);">
1718
- <div
1719
- class="my-3 fs-6 fw-500 text-center"
1720
- style="white-space: normal; overflow-wrap: anywhere;font-size: 36px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
1721
- >
1722
- 請撕取收執聯後,在按下『 下一步 』。
1723
- </div>
1724
- <div class="d-flex align-items-center justify-content-center"
1725
- style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
1726
- <div
1727
- style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:240px;text-align:center;"
1728
- onclick="${gvc.event(() => {
1715
+ <div class="dialog-box">
1716
+ <div class="dialog-content position-relative pb-5"
1717
+ style="width: 452px;max-width: calc(100% - 20px);">
1718
+ <div
1719
+ class="my-3 fs-6 fw-500 text-center"
1720
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 36px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
1721
+ >
1722
+ 請撕取收執聯後,在按下『 下一步 』。
1723
+ </div>
1724
+ <div class="d-flex align-items-center justify-content-center"
1725
+ style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
1726
+ <div
1727
+ style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:240px;text-align:center;"
1728
+ onclick="${gvc.event(() => {
1729
1729
  gvc.closeDialog();
1730
1730
  print('client');
1731
1731
  resolve(true);
1732
1732
  })}"
1733
- >
1734
- 下一步
1735
- </div>
1736
- </div>
1737
- </div>
1738
- </div>
1739
- `;
1733
+ >
1734
+ 下一步
1735
+ </div>
1736
+ </div>
1737
+ </div>
1738
+ </div>
1739
+ `;
1740
1740
  }, 'save_invoice', {
1741
1741
  dismiss: () => {
1742
1742
  },
@@ -1661,178 +1661,198 @@ text-transform: uppercase;" onclick="${gvc.event(() => {
1661
1661
  const invoice = res.response.data.invoice
1662
1662
  if (res.response.data.invoice && PayConfig.deviceType === 'pos' && c_vm.invoice_select !== 'carry') {
1663
1663
  POSSetting.config.pickup_number++
1664
- function print(type:'save'|'client'){
1665
- let command_line: any = []
1666
1664
 
1667
- function addCommandLine(cmd: string, data: any, callback: () => void) {
1668
- command_line.push({cmd, data, callback})
1669
- }
1670
- if(type==='client'){
1671
- addCommandLine("print_text", {
1672
- size: 2,
1673
- align: 1,
1674
- text: PayConfig.pos_config.shop_name
1675
- }, () => {
1676
- })
1677
- addCommandLine("print_text", {size: 2, align: 1, text: ""}, () => {
1678
- })
1679
- addCommandLine("print_text", {size: 2, align: 1, text: "電子發證明聯"}, () => {
1680
- })
1681
- addCommandLine("print_text", {size: 2, align: 1, text: invoice.date}, () => {
1682
- })
1683
- addCommandLine("print_text", {size: 2, align: 1, text: invoice.invoice_code}, () => {
1684
- })
1685
- addCommandLine("print_text", {size: 1, align: 0, text: invoice.create_date}, () => {
1686
- })
1687
- addCommandLine("print_text", {
1688
- size: 1,
1689
- align: 0,
1690
- text: `${invoice.random_code} ${invoice.total}`
1691
- }, () => {
1692
- })
1693
- addCommandLine("print_text", {
1694
- size: 1,
1695
- align: 0,
1696
- text: `${invoice.sale_gui} ${invoice.buy_gui}`
1697
- }, () => {
1698
- })
1699
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1700
- })
1701
- addCommandLine("print_bar_code", {text: invoice.bar_code}, () => {
1702
- })
1703
- addCommandLine("print_qr_code_2", {
1704
- qrcode_0: invoice.qrcode_0,
1705
- qrcode_1: invoice.qrcode_1
1706
- }, () => {
1707
- })
1708
- }else{
1709
- addCommandLine("print_text", {size: 2, align: 1, text: "收執聯"}, () => {
1710
- })
1711
- }
1712
- if (PayConfig.pos_config.pos_type === 'eat') {
1665
+ function print(type: 'save' | 'client') {
1666
+ let command_line: any = []
1713
1667
 
1714
- if (orderDetail.table_set) {
1715
- addCommandLine("print_text", {
1716
- size: 2,
1717
- align: 1,
1718
- text: "桌位選擇:" + orderDetail.table_set
1719
- }, () => {
1720
- })
1721
- }
1722
- if (PayConfig.pos_config.call_order) {
1723
- addCommandLine("print_text", {
1724
- size: 2, align: 1, text: "取餐編號:" + (() => {
1725
- let numb = `${POSSetting.config.pickup_number}`;
1726
- while (numb.length < 4) {
1727
- numb = `0${numb}`
1728
- }
1729
- return numb
1730
- })()
1731
- }, () => {
1732
- })
1733
- }
1668
+ /***
1669
+ * 列印間隔
1670
+ * IminPrintInstance.printAndFeedPaper(100)
1671
+ * 設定字體位置0-2
1672
+ * IminPrintInstance.setAlignment(1);
1673
+ * 設定字體大小
1674
+ * IminPrintInstance.setTextSize(28)
1675
+ * 設定字體[DEFAULT,MONOSPACE,DEFAULT_BOLD,SANS_SERIF,SERIF]
1676
+ * IminPrintInstance.setTextTypeface(0)
1677
+ * 設定字體粗度[NORMAL,BOLD,ITALIC,BOLD_ITALIC]
1678
+ * IminPrintInstance.setTextStyle(0)
1679
+ * 打印文字
1680
+ * IminPrintInstance.printText('萊恩設計')
1681
+ * */
1734
1682
 
1735
- addCommandLine("print_text", {size: 2, align: 0, text: "\n\n\n\n"}, () => {
1736
- })
1737
- }
1738
1683
 
1739
- addCommandLine("print_text", {size: 2, align: 1, text: "交易明細"}, () => {
1740
- })
1741
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1742
- })
1743
- addCommandLine("print_text", {size: 1, align: 0, text: "2024-09-14 01:27:39"}, () => {
1744
- })
1745
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1746
- })
1747
- addCommandLine("print_text", {
1748
- size: 1,
1749
- align: 0,
1750
- text: "品名 單價*數量 金額"
1751
- }, () => {
1752
- })
1753
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1754
- })
1755
- PaymentPage.stripHtmlTags(invoice.pay_detail).map((dd, index) => {
1756
- addCommandLine("print_text", {size: 1, align: index % 3, text: dd}, () => {
1757
- })
1758
- })
1759
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1760
- })
1761
- addCommandLine("print_text", {size: 1, align: 1, text: "------------------------"}, () => {
1762
- });
1763
- (() => {
1764
- let tempDiv = document.createElement("div");
1765
- // 设置其内容为给定的HTML字符串
1766
- tempDiv.innerHTML = invoice.pay_detail_footer;
1767
- addCommandLine("print_text", {
1768
- size: 1,
1769
- align: 0,
1770
- text: `${tempDiv.querySelector('.invoice-detail-sum')!!.children[0].textContent}
1684
+
1685
+ function addCommandLine(cmd: string, data: any, callback: () => void) {
1686
+ command_line.push({cmd, data, callback})
1687
+ }
1688
+
1689
+ if (type === 'client') {
1690
+ addCommandLine("print_text", {
1691
+ size: 2,
1692
+ align: 1,
1693
+ text: PayConfig.pos_config.shop_name
1694
+ }, () => {
1695
+ })
1696
+ addCommandLine("print_text", {size: 2, align: 1, text: ""}, () => {
1697
+ })
1698
+ addCommandLine("print_text", {size: 2, align: 1, text: "電子發證明聯"}, () => {
1699
+ })
1700
+ addCommandLine("print_text", {size: 2, align: 1, text: invoice.date}, () => {
1701
+ })
1702
+ addCommandLine("print_text", {size: 2, align: 1, text: invoice.invoice_code}, () => {
1703
+ })
1704
+ addCommandLine("print_text", {size: 1, align: 0, text: invoice.create_date}, () => {
1705
+ })
1706
+ addCommandLine("print_text", {
1707
+ size: 1,
1708
+ align: 0,
1709
+ text: `${invoice.random_code} ${invoice.total}`
1710
+ }, () => {
1711
+ })
1712
+ addCommandLine("print_text", {
1713
+ size: 1,
1714
+ align: 0,
1715
+ text: `${invoice.sale_gui} ${invoice.buy_gui}`
1716
+ }, () => {
1717
+ })
1718
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1719
+ })
1720
+ addCommandLine("print_bar_code", {text: invoice.bar_code}, () => {
1721
+ })
1722
+ addCommandLine("print_qr_code_2", {
1723
+ qrcode_0: invoice.qrcode_0,
1724
+ qrcode_1: invoice.qrcode_1
1725
+ }, () => {
1726
+ })
1727
+ } else {
1728
+ addCommandLine("print_text", {size: 2, align: 1, text: "收執聯"}, () => {
1729
+ })
1730
+ }
1731
+ if (PayConfig.pos_config.pos_type === 'eat') {
1732
+
1733
+ if (orderDetail.table_set) {
1734
+ addCommandLine("print_text", {
1735
+ size: 2,
1736
+ align: 1,
1737
+ text: "桌位選擇:" + orderDetail.table_set
1738
+ }, () => {
1739
+ })
1740
+ }
1741
+ if (PayConfig.pos_config.call_order) {
1742
+ addCommandLine("print_text", {
1743
+ size: 2, align: 1, text: "取餐編號:" + (() => {
1744
+ let numb = `${POSSetting.config.pickup_number}`;
1745
+ while (numb.length < 4) {
1746
+ numb = `0${numb}`
1747
+ }
1748
+ return numb
1749
+ })()
1750
+ }, () => {
1751
+ })
1752
+ }
1753
+
1754
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n\n\n\n"}, () => {
1755
+ })
1756
+ }
1757
+
1758
+ addCommandLine("print_text", {size: 2, align: 1, text: "交易明細"}, () => {
1759
+ })
1760
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1761
+ })
1762
+ addCommandLine("print_text", {size: 1, align: 0, text: "2024-09-14 01:27:39"}, () => {
1763
+ })
1764
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1765
+ })
1766
+ addCommandLine("print_text", {
1767
+ size: 1,
1768
+ align: 0,
1769
+ text: "品名 單價*數量 金額"
1770
+ }, () => {
1771
+ })
1772
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1773
+ })
1774
+ PaymentPage.stripHtmlTags(invoice.pay_detail).map((dd, index) => {
1775
+ addCommandLine("print_text", {size: 1, align: index % 3, text: dd}, () => {
1776
+ })
1777
+ })
1778
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1779
+ })
1780
+ addCommandLine("print_text", {size: 1, align: 1, text: "------------------------"}, () => {
1781
+ });
1782
+ (() => {
1783
+ let tempDiv = document.createElement("div");
1784
+ // 设置其内容为给定的HTML字符串
1785
+ tempDiv.innerHTML = invoice.pay_detail_footer;
1786
+ addCommandLine("print_text", {
1787
+ size: 1,
1788
+ align: 0,
1789
+ text: `${tempDiv.querySelector('.invoice-detail-sum')!!.children[0].textContent}
1771
1790
  ${tempDiv.querySelector('.invoice-detail-sum')!!.children[1].textContent}
1772
1791
  ${tempDiv.querySelector('.invoice-detail-sum')!!.children[2].textContent!.replace(/ /g, '')}`
1773
- }, () => {
1774
- })
1775
- })()
1776
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1777
- })
1778
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1779
- })
1780
- addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1781
- })
1782
- new Promise(async (resolve, reject) => {
1783
- for (const b of command_line) {
1784
- await new Promise(async (resolve, reject) => {
1785
- glitter.runJsInterFace(b.cmd, b.data, () => {
1786
- resolve(true)
1787
- })
1788
- })
1789
- }
1790
- resolve(true)
1791
- })
1792
- }
1793
- if(PayConfig.pos_config.execution_slip){
1794
- print('save')
1795
- await new Promise((resolve, reject)=>{
1796
- gvc.glitter.innerDialog(
1797
- (gvc: GVC) => {
1798
- return html`
1799
- <div class="dialog-box">
1800
- <div class="dialog-content position-relative pb-5"
1801
- style="width: 452px;max-width: calc(100% - 20px);">
1802
- <div
1803
- class="my-3 fs-6 fw-500 text-center"
1804
- style="white-space: normal; overflow-wrap: anywhere;font-size: 36px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
1805
- >
1806
- 請撕取收執聯後,在按下『 下一步 』。
1807
- </div>
1808
- <div class="d-flex align-items-center justify-content-center"
1809
- style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
1810
- <div
1811
- style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:240px;text-align:center;"
1812
- onclick="${gvc.event(() => {
1813
- gvc.closeDialog()
1814
- print('client')
1815
- resolve(true)
1816
- })}"
1817
- >
1818
- 下一步
1819
- </div>
1820
- </div>
1821
- </div>
1822
- </div>
1823
- `;
1824
- },
1825
- 'save_invoice',
1826
- {
1827
- dismiss: () => {
1828
- // vm.type = "list";
1829
- },
1830
- }
1831
- );
1832
- })
1833
- }else{
1834
- print('client')
1835
- }
1792
+ }, () => {
1793
+ })
1794
+ })()
1795
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1796
+ })
1797
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1798
+ })
1799
+ addCommandLine("print_text", {size: 2, align: 0, text: "\n"}, () => {
1800
+ })
1801
+ new Promise(async (resolve, reject) => {
1802
+ for (const b of command_line) {
1803
+ await new Promise(async (resolve, reject) => {
1804
+ glitter.runJsInterFace(b.cmd, b.data, () => {
1805
+ resolve(true)
1806
+ })
1807
+ })
1808
+ }
1809
+ resolve(true)
1810
+ })
1811
+ }
1812
+
1813
+ if (PayConfig.pos_config.execution_slip) {
1814
+ print('save')
1815
+ await new Promise((resolve, reject) => {
1816
+ gvc.glitter.innerDialog(
1817
+ (gvc: GVC) => {
1818
+ return html`
1819
+ <div class="dialog-box">
1820
+ <div class="dialog-content position-relative pb-5"
1821
+ style="width: 452px;max-width: calc(100% - 20px);">
1822
+ <div
1823
+ class="my-3 fs-6 fw-500 text-center"
1824
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 36px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
1825
+ >
1826
+ 請撕取收執聯後,在按下『 下一步 』。
1827
+ </div>
1828
+ <div class="d-flex align-items-center justify-content-center"
1829
+ style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
1830
+ <div
1831
+ style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:240px;text-align:center;"
1832
+ onclick="${gvc.event(() => {
1833
+ gvc.closeDialog()
1834
+ print('client')
1835
+ resolve(true)
1836
+ })}"
1837
+ >
1838
+ 下一步
1839
+ </div>
1840
+ </div>
1841
+ </div>
1842
+ </div>
1843
+ `;
1844
+ },
1845
+ 'save_invoice',
1846
+ {
1847
+ dismiss: () => {
1848
+ // vm.type = "list";
1849
+ },
1850
+ }
1851
+ );
1852
+ })
1853
+ } else {
1854
+ print('client')
1855
+ }
1836
1856
  }
1837
1857
  dialog.dataLoading({visible: false});
1838
1858
  orderDetail.lineItems = [];