ts-glitter 21.5.9 → 21.6.0

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.
Files changed (201) hide show
  1. package/lib/glitterBundle/html-component/editor.ts +5 -5
  2. package/lib/glitterBundle/html-component/widget.ts +1 -1
  3. package/lib/glitterBundle/plugins/add_item_dia.ts +3 -3
  4. package/lib/glitterBundle/plugins/dialog-style-editor.ts +4 -4
  5. package/lib/glitterBundle/plugins/editor-elem.ts +8 -8
  6. package/lib/glitterBundle/plugins/editor.ts +3 -3
  7. package/lowcode/Entry.js +1 -1
  8. package/lowcode/Entry.ts +1 -1
  9. package/lowcode/backend-manager/bg-customer-message.js +4 -4
  10. package/lowcode/backend-manager/bg-customer-message.ts +4 -4
  11. package/lowcode/backend-manager/bg-global-event.js +1 -1
  12. package/lowcode/backend-manager/bg-global-event.ts +1 -1
  13. package/lowcode/backend-manager/bg-guide.js +21 -21
  14. package/lowcode/backend-manager/bg-guide.ts +22 -22
  15. package/lowcode/backend-manager/bg-mobile-guide.js +4 -4
  16. package/lowcode/backend-manager/bg-mobile-guide.ts +4 -4
  17. package/lowcode/backend-manager/bg-seo.js +1 -1
  18. package/lowcode/backend-manager/bg-seo.ts +1 -1
  19. package/lowcode/backend-manager/bg-shopping.js +6 -6
  20. package/lowcode/backend-manager/bg-shopping.ts +6 -6
  21. package/lowcode/backend-manager/bg-wallet.js +3 -3
  22. package/lowcode/backend-manager/bg-wallet.ts +3 -3
  23. package/lowcode/backend-manager/bg-widget.js +6 -0
  24. package/lowcode/backend-manager/bg-widget.ts +7 -0
  25. package/lowcode/cms-plugin/POS-setting.js +1 -1
  26. package/lowcode/cms-plugin/POS-setting.ts +1 -1
  27. package/lowcode/cms-plugin/ai-generator/member-ai.js +2 -2
  28. package/lowcode/cms-plugin/ai-generator/member-ai.ts +2 -2
  29. package/lowcode/cms-plugin/ai-generator/product-ai.js +2 -2
  30. package/lowcode/cms-plugin/ai-generator/product-ai.ts +2 -2
  31. package/lowcode/cms-plugin/ai-message.js +2 -2
  32. package/lowcode/cms-plugin/ai-message.ts +2 -2
  33. package/lowcode/cms-plugin/ai-points-list.js +2 -2
  34. package/lowcode/cms-plugin/ai-points-list.ts +2 -2
  35. package/lowcode/cms-plugin/app-design.js +3 -3
  36. package/lowcode/cms-plugin/app-design.ts +3 -3
  37. package/lowcode/cms-plugin/app-release.js +2 -2
  38. package/lowcode/cms-plugin/app-release.ts +2 -2
  39. package/lowcode/cms-plugin/customer-message-user.js +5 -5
  40. package/lowcode/cms-plugin/customer-message-user.ts +5 -5
  41. package/lowcode/cms-plugin/data-analyze-module.js +3 -3
  42. package/lowcode/cms-plugin/data-analyze-module.ts +3 -3
  43. package/lowcode/cms-plugin/domain-setting.js +2 -2
  44. package/lowcode/cms-plugin/domain-setting.ts +2 -2
  45. package/lowcode/cms-plugin/live_capture.js +17 -17
  46. package/lowcode/cms-plugin/live_capture.ts +17 -17
  47. package/lowcode/cms-plugin/member-type-list.js +4 -4
  48. package/lowcode/cms-plugin/member-type-list.ts +4 -4
  49. package/lowcode/cms-plugin/module/form-module.js +1 -1
  50. package/lowcode/cms-plugin/module/form-module.ts +1 -1
  51. package/lowcode/cms-plugin/permission-setting.js +5 -5
  52. package/lowcode/cms-plugin/permission-setting.ts +5 -5
  53. package/lowcode/cms-plugin/pos-basic-setting.js +1 -1
  54. package/lowcode/cms-plugin/pos-basic-setting.ts +2 -2
  55. package/lowcode/cms-plugin/pos-checkout-setting.js +3 -3
  56. package/lowcode/cms-plugin/pos-checkout-setting.ts +4 -4
  57. package/lowcode/cms-plugin/pos-pages/payment-page.js +449 -232
  58. package/lowcode/cms-plugin/pos-pages/payment-page.ts +501 -278
  59. package/lowcode/cms-plugin/pos-pages/pos-function.js +3 -2
  60. package/lowcode/cms-plugin/pos-pages/pos-function.ts +4 -3
  61. package/lowcode/cms-plugin/pos-pages/pos-home-page.js +9 -9
  62. package/lowcode/cms-plugin/pos-pages/pos-home-page.ts +9 -9
  63. package/lowcode/cms-plugin/pos-pages/pos-summary.js +2 -2
  64. package/lowcode/cms-plugin/pos-pages/pos-summary.ts +2 -2
  65. package/lowcode/cms-plugin/pos-pages/products-page.js +6 -180
  66. package/lowcode/cms-plugin/pos-pages/products-page.ts +6 -185
  67. package/lowcode/cms-plugin/product-service.js +4 -4
  68. package/lowcode/cms-plugin/product-service.ts +4 -5
  69. package/lowcode/cms-plugin/reconciliation-area.js +24 -24
  70. package/lowcode/cms-plugin/reconciliation-area.ts +24 -24
  71. package/lowcode/cms-plugin/seo-blog.js +2 -2
  72. package/lowcode/cms-plugin/seo-blog.ts +2 -2
  73. package/lowcode/cms-plugin/seo-setting-v2.js +5 -5
  74. package/lowcode/cms-plugin/seo-setting-v2.ts +5 -5
  75. package/lowcode/cms-plugin/shopping-allowance-manager.js +4 -4
  76. package/lowcode/cms-plugin/shopping-allowance-manager.ts +4 -4
  77. package/lowcode/cms-plugin/shopping-collections.js +6 -6
  78. package/lowcode/cms-plugin/shopping-collections.ts +6 -6
  79. package/lowcode/cms-plugin/shopping-invoice-manager.js +11 -11
  80. package/lowcode/cms-plugin/shopping-invoice-manager.ts +11 -11
  81. package/lowcode/cms-plugin/shopping-order-manager.js +21 -13
  82. package/lowcode/cms-plugin/shopping-order-manager.ts +21 -13
  83. package/lowcode/cms-plugin/shopping-product-setting.js +1 -1
  84. package/lowcode/cms-plugin/shopping-product-setting.ts +1 -1
  85. package/lowcode/cms-plugin/shopping-product-text.js +5 -5
  86. package/lowcode/cms-plugin/shopping-product-text.ts +5 -5
  87. package/lowcode/cms-plugin/shopping-setting-basic.js +5 -6
  88. package/lowcode/cms-plugin/shopping-setting-basic.ts +5 -6
  89. package/lowcode/cms-plugin/shopping-shipment-setting.js +2 -2
  90. package/lowcode/cms-plugin/shopping-shipment-setting.ts +2 -2
  91. package/lowcode/cms-plugin/stock-history.js +7 -7
  92. package/lowcode/cms-plugin/stock-history.ts +7 -7
  93. package/lowcode/cms-plugin/stock-stores.js +2 -2
  94. package/lowcode/cms-plugin/stock-stores.ts +2 -2
  95. package/lowcode/cms-plugin/stock-vendors.js +2 -2
  96. package/lowcode/cms-plugin/stock-vendors.ts +2 -2
  97. package/lowcode/cms-plugin/third-party-google.js +1 -1
  98. package/lowcode/cms-plugin/third-party-google.ts +1 -1
  99. package/lowcode/cms-plugin/user-list.js +6 -2
  100. package/lowcode/cms-plugin/user-list.ts +7 -2
  101. package/lowcode/cms-plugin/user-login-setting.js +1 -1
  102. package/lowcode/cms-plugin/user-login-setting.ts +1 -1
  103. package/lowcode/cms-plugin/wallet-list.js +3 -3
  104. package/lowcode/cms-plugin/wallet-list.ts +3 -3
  105. package/lowcode/dialog/addTemplate.js +9 -9
  106. package/lowcode/dialog/addTemplate.ts +9 -9
  107. package/lowcode/dialog/dialog.js +1 -1
  108. package/lowcode/dialog/dialog.ts +1 -1
  109. package/lowcode/dialog/dialog_setting.js +1 -1
  110. package/lowcode/dialog/dialog_setting.ts +1 -1
  111. package/lowcode/dialog/image-preview.js +2 -2
  112. package/lowcode/dialog/image-preview.ts +2 -2
  113. package/lowcode/editor/add-component.js +4 -4
  114. package/lowcode/editor/add-component.ts +9 -9
  115. package/lowcode/editor/add-page.js +1 -1
  116. package/lowcode/editor/add-page.ts +1 -1
  117. package/lowcode/editor/page-code-setting.js +1 -1
  118. package/lowcode/editor/page-code-setting.ts +1 -1
  119. package/lowcode/editor/page-editor.js +15 -15
  120. package/lowcode/editor/page-editor.ts +15 -15
  121. package/lowcode/editor/page-setting-view.js +6 -6
  122. package/lowcode/editor/page-setting-view.ts +6 -6
  123. package/lowcode/editor/preview-app.js +1 -1
  124. package/lowcode/editor/preview-app.ts +1 -1
  125. package/lowcode/editor/search-idea.js +2 -2
  126. package/lowcode/editor/search-idea.ts +2 -2
  127. package/lowcode/editor/set-global-value.js +9 -9
  128. package/lowcode/editor/set-global-value.ts +9 -9
  129. package/lowcode/editor-bridge/trigger-event.js +1 -1
  130. package/lowcode/editor-bridge/trigger-event.ts +1 -1
  131. package/lowcode/editor-components/global-widget/global-widget.js +1 -1
  132. package/lowcode/editor-components/global-widget/global-widget.ts +1 -1
  133. package/lowcode/editor-config.js +1 -1
  134. package/lowcode/editor-config.ts +1 -1
  135. package/lowcode/form-view/e-commerce/path-select.js +1 -1
  136. package/lowcode/form-view/e-commerce/path-select.ts +1 -1
  137. package/lowcode/form-view/e-commerce/product-select.js +1 -1
  138. package/lowcode/form-view/e-commerce/product-select.ts +1 -1
  139. package/lowcode/form-view/editor/color-theme-selector.js +2 -2
  140. package/lowcode/form-view/editor/color-theme-selector.ts +2 -2
  141. package/lowcode/form-view/editor/image-selector.js +5 -5
  142. package/lowcode/form-view/editor/image-selector.ts +5 -5
  143. package/lowcode/glitterBundle/html-component/custom-style.js +6 -6
  144. package/lowcode/glitterBundle/html-component/custom-style.ts +6 -6
  145. package/lowcode/glitterBundle/html-component/global-widget.js +2 -2
  146. package/lowcode/glitterBundle/html-component/global-widget.ts +2 -2
  147. package/lowcode/glitterBundle/html-component/widget.js +1 -1
  148. package/lowcode/glitterBundle/html-component/widget.ts +1 -1
  149. package/lowcode/glitterBundle/module/html-generate.js +2 -2
  150. package/lowcode/glitterBundle/module/html-generate.ts +2 -2
  151. package/lowcode/glitterBundle/plugins/add_item_dia.js +7 -7
  152. package/lowcode/glitterBundle/plugins/add_item_dia.ts +7 -7
  153. package/lowcode/glitterBundle/plugins/editor.js +3 -3
  154. package/lowcode/glitterBundle/plugins/editor.ts +3 -3
  155. package/lowcode/glitterBundle/plugins/style-editor.js +5 -5
  156. package/lowcode/glitterBundle/plugins/style-editor.ts +5 -5
  157. package/lowcode/jspage/editor.js +3 -3
  158. package/lowcode/jspage/editor.ts +3 -3
  159. package/lowcode/jspage/function-page/main_editor.js +6 -6
  160. package/lowcode/jspage/function-page/main_editor.ts +6 -6
  161. package/lowcode/jspage/function-page/page_editor.js +4 -4
  162. package/lowcode/jspage/function-page/page_editor.ts +4 -4
  163. package/lowcode/jspage/function-page/server-editor/router/domain-manager.js +3 -3
  164. package/lowcode/jspage/function-page/server-editor/router/domain-manager.ts +3 -3
  165. package/lowcode/jspage/function-page/tool-setting.js +2 -2
  166. package/lowcode/jspage/function-page/tool-setting.ts +2 -2
  167. package/lowcode/landing-page/about-us.js +5 -5
  168. package/lowcode/landing-page/about-us.ts +5 -5
  169. package/lowcode/modules/file-system.js +2 -2
  170. package/lowcode/modules/file-system.ts +2 -2
  171. package/lowcode/modules/image-library-clone.js +4 -4
  172. package/lowcode/modules/image-library-clone.ts +4 -4
  173. package/lowcode/modules/image-library.js +2 -2
  174. package/lowcode/modules/image-library.ts +2 -2
  175. package/lowcode/official_view_component/official/component.js +1 -1
  176. package/lowcode/official_view_component/official/component.ts +1 -1
  177. package/lowcode/official_view_component/official/widget.js +1 -1
  178. package/lowcode/official_view_component/official/widget.ts +1 -1
  179. package/lowcode/public-components/banner/first-banner.js +1 -1
  180. package/lowcode/public-components/banner/first-banner.ts +1 -1
  181. package/lowcode/public-components/blogs/list.js +1 -1
  182. package/lowcode/public-components/blogs/list.ts +1 -1
  183. package/lowcode/public-components/headers/sy-02.js +4 -4
  184. package/lowcode/public-components/headers/sy-02.ts +4 -4
  185. package/lowcode/public-components/headers/sy-03.js +1 -1
  186. package/lowcode/public-components/headers/sy-03.ts +1 -1
  187. package/lowcode/public-components/headers/sy-04.js +2 -2
  188. package/lowcode/public-components/headers/sy-04.ts +2 -2
  189. package/lowcode/public-components/headers/sy-05.js +1 -1
  190. package/lowcode/public-components/headers/sy-05.ts +1 -1
  191. package/lowcode/public-components/user-manager/um-order.js +2 -2
  192. package/lowcode/public-components/user-manager/um-order.ts +2 -2
  193. package/lowcode/setting/appSetting.js +4 -4
  194. package/lowcode/setting/appSetting.ts +4 -4
  195. package/lowcode/setting/initialStyle.js +2 -2
  196. package/lowcode/setting/initialStyle.ts +2 -2
  197. package/lowcode/setting/pageManager.js +6 -6
  198. package/lowcode/setting/pageManager.ts +6 -6
  199. package/lowcode/view-model/saas-view-model.js +2 -2
  200. package/lowcode/view-model/saas-view-model.ts +2 -2
  201. package/package.json +1 -1
@@ -28,6 +28,7 @@ import { PaymentFunction } from './payment-function.js';
28
28
  import { UmClass } from '../../public-components/user-manager/um-class.js';
29
29
  import { FormCheck } from '../module/form-check.js';
30
30
  import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
31
+ import { Tool } from '../../modules/tool.js';
31
32
  const html = String.raw;
32
33
  export class PaymentPage {
33
34
  static checkout(params) {
@@ -67,6 +68,7 @@ export class PaymentPage {
67
68
  const vm = obj.vm;
68
69
  const dialog = new ShareDialog(gvc.glitter);
69
70
  PaymentPage.storeHistory(obj.ogOrderData);
71
+ PaymentPage.addStyle(gvc);
70
72
  obj.ogOrderData.pos_info = obj.ogOrderData.pos_info || {
71
73
  payment: [
72
74
  {
@@ -96,7 +98,7 @@ export class PaymentPage {
96
98
  return {
97
99
  bind: id,
98
100
  view: () => {
99
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
101
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
100
102
  var _a, _b;
101
103
  const orderDetail = yield (() => __awaiter(this, void 0, void 0, function* () {
102
104
  dialog.dataLoading({ visible: true });
@@ -150,9 +152,9 @@ export class PaymentPage {
150
152
  >
151
153
  ${PosWidget.bigTitle('訂單明細')}
152
154
  <div
153
- class="d-flex flex-column ${document.body.offsetWidth < 800 ? `` : ``}"
155
+ class="d-flex flex-column ${document.body.offsetWidth < 800 ? '' : ''}"
154
156
  style="${document.body.offsetWidth < 800
155
- ? ``
157
+ ? ''
156
158
  : `padding:24px;border-radius: 10px;background: #FFF;box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);margin-top:32px;`}"
157
159
  >
158
160
  <div
@@ -165,109 +167,124 @@ export class PaymentPage {
165
167
  <div class="col-2 text-center">數量${hasWeighing ? ' / 重量' : ''}</div>
166
168
  <div class="col-2 text-center">小計</div>
167
169
  </div>
168
- <div class="d-flex flex-column" style="${document.body.offsetWidth < 800 ? `` : ``}">
170
+ <div class="d-flex flex-column" style="${document.body.offsetWidth < 800 ? '' : ''}">
169
171
  ${(() => {
170
- if (orderDetail.lineItems.length > 0) {
171
- return orderDetail.lineItems
172
- .map((data, index) => {
173
- return html `
174
- <div class="d-flex" style="">
175
- <div class="col-12 col-sm-6 d-flex align-items-center">
176
- <div
177
- class="d-flex flex-column align-items-center justify-content-center"
178
- style="gap:5px;width:75px;"
179
- >
180
- <div style="height: 20px;"></div>
181
- <div
182
- style="width: 70px;height: 70px; min-width: 70px;min-height: 70px; border-radius: 5px;background: 50%/cover url('${data.preview_image ||
183
- 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}')"
184
- ></div>
185
- <div
186
- style="font-size: 13px;height: 20px;"
187
- class="fw-500 ${data.pre_order ? `text-danger` : ``}"
188
- >
189
- 庫存:${(() => {
190
- if (`${data.show_understocking}` === 'false') {
191
- return `不追蹤`;
172
+ if (orderDetail.lineItems.length === 0) {
173
+ return '';
174
+ }
175
+ const ogOrderMap = new Map(obj.ogOrderData.lineItems.map((ogItem, index) => {
176
+ return [`${ogItem.id}-${ogItem.spec.join('/')}`, index];
177
+ }));
178
+ const lineItemCountMap = new Map(orderDetail.lineItems.map((item) => {
179
+ return [`${item.id}-${item.spec.join('/')}`, item.count];
180
+ }));
181
+ const resetSalePriceIcon = (data, index) => {
182
+ return html `<i
183
+ class="fa-solid fa-pencil cursor_pointer"
184
+ onclick="${gvc.event(() => {
185
+ var _a, _b;
186
+ const def = ((_b = (_a = obj.ogOrderData.lineItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.custom_price) || 0;
187
+ PosFunction.setMoney(gvc, def, money => {
188
+ if (money === data.sale_price) {
189
+ delete obj.ogOrderData.lineItems[index].custom_price;
192
190
  }
193
191
  else {
194
- return ((data.stockList[POSSetting.config.where_store] &&
195
- data.stockList[POSSetting.config.where_store].count) ||
196
- 0);
192
+ obj.ogOrderData.lineItems[index].custom_price = money;
197
193
  }
198
- })()}
199
- </div>
200
- </div>
194
+ refreshOrderView();
195
+ }, '更改商品單價');
196
+ })}"
197
+ ></i>`;
198
+ };
199
+ return [...ogOrderMap.keys()]
200
+ .filter(key => {
201
+ return lineItemCountMap.get(key);
202
+ })
203
+ .map(key => {
204
+ const lineItemKeys = [...lineItemCountMap.keys()].findIndex(k => k === key);
205
+ const index = ogOrderMap.get(key);
206
+ const data = orderDetail.lineItems[lineItemKeys];
207
+ if (index === undefined) {
208
+ console.error(`ogOrderData LineItems 不存在商品規格 ${key}`);
209
+ return '';
210
+ }
211
+ return html `
212
+ <div class="d-flex">
213
+ <div class="col-12 col-sm-6 d-flex align-items-center">
214
+ <div
215
+ class="d-flex flex-column align-items-center justify-content-center"
216
+ style="gap:5px;width:75px;"
217
+ >
218
+ <div style="height: 20px;"></div>
201
219
  <div
202
- class="d-flex flex-column py-2"
203
- onclick="${gvc.event(() => {
204
- var _a, _b;
205
- const def = ((_b = (_a = obj.ogOrderData.lineItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.count) || 0;
206
- PosFunction.setMoney(gvc, def, count => {
207
- obj.ogOrderData.lineItems[index].count = count;
208
- refreshOrderView();
209
- }, '更改商品數量');
210
- })}"
211
- style="font-size: 16px;font-style: normal;font-weight: 500;letter-spacing: 0.64px;margin-left: 12px;"
220
+ style="width: 70px;height: 70px; min-width: 70px;min-height: 70px; border-radius: 5px;background: 50%/cover url('${data.preview_image ||
221
+ 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}')"
222
+ ></div>
223
+ <div
224
+ style="font-size: 13px;height: 20px;"
225
+ class="fw-500 ${data.pre_order ? `text-danger` : ''}"
212
226
  >
213
- <div class="d-flex justify-content-center flex-column" style="gap:5px;">
214
- ${(() => {
215
- if (!data.pre_order) {
216
- return ``;
217
- }
218
- else {
219
- return html ` <div>${BgWidget.dangerInsignia('需預購')}</div>`;
220
- }
221
- })()}
222
- ${data.title}
223
- </div>
224
- <span
225
- style="color: #949494; font-size: 16px; font-style: normal; font-weight: 500; line-height: normal; letter-spacing: 0.64px; text-transform: uppercase;"
226
- >
227
- ${(() => {
228
- return data.spec.length > 0
229
- ? data.spec
230
- .map((spec) => {
231
- return html ` ${spec}`;
232
- })
233
- .join(',')
234
- : html ``;
235
- })()}
236
- </span>
237
-
238
- ${document.body.clientWidth < 800
239
- ? html ` <div
240
- style="color: #393939; font-size: 16px; font-style: normal; font-weight: 400; line-height: normal; letter-spacing: 0.64px; text-transform: uppercase;"
241
- >
242
- NT.${parseInt(data.sale_price, 10).toLocaleString()}
243
- ${document.body.clientWidth < 800 ? `x` : ``} ${data.count}
244
- </div>`
245
- : ``}
227
+ ${(() => {
228
+ if (`${data.show_understocking}` === 'false') {
229
+ return '不追蹤庫存';
230
+ }
231
+ const stock = data.stockList[POSSetting.config.where_store];
232
+ return `庫存: ${(stock === null || stock === void 0 ? void 0 : stock.count) || 0}`;
233
+ })()}
246
234
  </div>
247
- <div class="flex-fill"></div>
248
- <div
249
- class="d-sm-none d-flex align-items-center justify-content-center flex-column"
250
- style="gap:0px;"
251
- onclick="${gvc.event(() => {
252
- var _a, _b;
253
- const n = ((_b = (_a = obj.ogOrderData.lineItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.custom_price) || 0;
254
- PosFunction.setMoney(gvc, n, money => {
255
- if (money === data.sale_price) {
256
- delete obj.ogOrderData.lineItems[index].custom_price;
257
- }
258
- else {
259
- obj.ogOrderData.lineItems[index].custom_price = money;
260
- }
261
- refreshOrderView();
262
- }, '更改商品單價');
263
- })}"
235
+ </div>
236
+ <div
237
+ class="d-flex flex-column mt-3 gap-1"
238
+ style="font-size: 16px;font-style: normal;font-weight: 500;letter-spacing: 0.64px;margin-left: 12px;"
239
+ >
240
+ ${data.pre_order
241
+ ? html `<div>${BgWidget.warningInsignia('需預購', { size: 'sm' })}</div>`
242
+ : ''}
243
+ <div class="d-flex justify-content-start align-items-center gap-2">
244
+ ${data.title}
245
+ </div>
246
+ <span
247
+ style="color: #949494; font-size: 16px; font-style: normal; font-weight: 500; letter-spacing: 0.64px; text-transform: uppercase;"
264
248
  >
249
+ ${data.spec.length > 0 ? data.spec.map((spec) => `${spec}`).join(',') : ''}
250
+ </span>
251
+ ${document.body.clientWidth < 800
252
+ ? html ` <div
253
+ style="color: #393939; font-size: 16px; font-style: normal; font-weight: 400; letter-spacing: 0.64px; text-transform: uppercase;"
254
+ >
255
+ ${resetSalePriceIcon(data, index)}
256
+ NT.${parseInt(data.sale_price, 10).toLocaleString()}
257
+ ${document.body.clientWidth < 800 ? `x` : ''} ${data.count}
258
+ </div>`
259
+ : ''}
260
+ </div>
261
+ <div class="flex-fill"></div>
262
+ <div
263
+ class="d-sm-none d-flex flex-column align-items-end justify-content-between h-100"
264
+ style="padding: 16px 0px 4px;"
265
+ >
266
+ <div>
267
+ <i
268
+ class="fa-sharp fa-regular fa-xmark fs-4"
269
+ onclick="${gvc.event(() => {
270
+ function callMinus(index) {
271
+ obj.ogOrderData.lineItems[index].count = 0;
272
+ refreshOrderView();
273
+ }
274
+ dialog.checkYesOrNot({
275
+ text: '確定要移除此商品嗎?',
276
+ callback: bool => bool && callMinus(index),
277
+ });
278
+ })}"
279
+ ></i>
280
+ </div>
281
+ <div class="d-flex align-items-center justify-content-center flex-column gap-0">
265
282
  ${(() => {
266
- function formatPrice(price) {
267
- return `$${parseInt(`${price}`, 10).toLocaleString()}`;
268
- }
269
- if (data.variant_sale_price && data.sale_price !== data.variant_sale_price) {
270
- return html `
283
+ function formatPrice(price) {
284
+ return `$${parseInt(`${price}`, 10).toLocaleString()}`;
285
+ }
286
+ if (data.variant_sale_price && data.sale_price !== data.variant_sale_price) {
287
+ return html `
271
288
  <span class="text-decoration-line-through"
272
289
  >${formatPrice(data.variant_sale_price * data.count)}</span
273
290
  >
@@ -275,18 +292,59 @@ export class PaymentPage {
275
292
  >${formatPrice(data.sale_price * data.count)}</span
276
293
  >
277
294
  `;
278
- }
279
- return html ` <span>${formatPrice(data.sale_price * data.count)}</span> `;
280
- })()}
295
+ }
296
+ return html ` <span>${formatPrice(data.sale_price * data.count)}</span> `;
297
+ })()}
281
298
  </div>
282
299
  </div>
283
- <div class="col-2 d-none d-sm-flex align-items-center justify-content-start">
284
- $${parseInt(data.sale_price, 10).toLocaleString()}
285
- </div>
300
+ </div>
301
+ <div class="col-2 d-none d-sm-flex align-items-center justify-content-start gap-2">
302
+ $ ${parseInt(data.sale_price, 10).toLocaleString()}
303
+ ${resetSalePriceIcon(data, index)}
304
+ </div>
305
+ <div
306
+ class="col-3 col-lg-2 d-flex align-items-center justify-content-center d-none d-sm-flex"
307
+ >
286
308
  <div
287
- class="col-3 col-lg-2 d-flex align-items-center justify-content-center d-none d-sm-flex"
288
- style="gap:10px;cursor: pointer;"
309
+ class="pos-count-button"
289
310
  onclick="${gvc.event(() => {
311
+ function callMinus(index) {
312
+ obj.ogOrderData.lineItems[index].count = Tool.floatAdd(obj.ogOrderData.lineItems[index].count, -1);
313
+ refreshOrderView();
314
+ }
315
+ if (obj.ogOrderData.lineItems[index].count - 1 > 0) {
316
+ callMinus(index);
317
+ }
318
+ else {
319
+ dialog.checkYesOrNot({
320
+ text: '確定要移除此商品嗎?',
321
+ callback: bool => bool && callMinus(index),
322
+ });
323
+ }
324
+ })}"
325
+ >
326
+ ${this.minusSVG}
327
+ </div>
328
+ ${data.product_category === 'weighing'
329
+ ? html `<input
330
+ class="border-0 pos-count-input"
331
+ value="${obj.ogOrderData.lineItems[index].count}"
332
+ onchange="${gvc.event(e => {
333
+ const originNum = obj.ogOrderData.lineItems[index].count;
334
+ const n = parseFloat(e.value);
335
+ if (CheckInput.isNumberString(`${n}`) && n > 0) {
336
+ obj.ogOrderData.lineItems[index].count = Tool.floatAdd(n, 0);
337
+ refreshOrderView();
338
+ }
339
+ else {
340
+ e.value = originNum;
341
+ }
342
+ })}"
343
+ />`
344
+ : html `<div
345
+ class="border-0 pos-count-input cursor_pointer"
346
+ style="margin-bottom: 3px;"
347
+ onclick="${gvc.event(() => {
290
348
  var _a, _b;
291
349
  const def = ((_b = (_a = obj.ogOrderData.lineItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.count) || 0;
292
350
  PosFunction.setMoney(gvc, def, count => {
@@ -294,54 +352,44 @@ export class PaymentPage {
294
352
  refreshOrderView();
295
353
  }, '更改商品數量');
296
354
  })}"
297
- >
298
- ${Number(data.count).toLocaleString()}
299
- </div>
355
+ >
356
+ ${data.count}
357
+ </div>`}
300
358
  <div
301
- class="col-3 col-lg-2 d-flex align-items-center justify-content-center d-none d-sm-flex"
302
- style="gap:10px;cursor: pointer;"
359
+ class="pos-count-button"
303
360
  onclick="${gvc.event(() => {
304
- var _a, _b;
305
- const def = ((_b = (_a = obj.ogOrderData.lineItems) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.custom_price) || 0;
306
- PosFunction.setMoney(gvc, def, money => {
307
- if (money === data.sale_price) {
308
- delete obj.ogOrderData.lineItems[index].custom_price;
309
- }
310
- else {
311
- obj.ogOrderData.lineItems[index].custom_price = money;
312
- }
313
- refreshOrderView();
314
- }, '更改商品單價');
315
- })}"
361
+ obj.ogOrderData.lineItems[index].count = Tool.floatAdd(obj.ogOrderData.lineItems[index].count, 1);
362
+ refreshOrderView();
363
+ })}"
316
364
  >
317
- ${(() => {
318
- function formatPrice(price) {
319
- return `$${parseInt(`${price}`, 10).toLocaleString()}`;
320
- }
321
- if (data.variant_sale_price && data.sale_price !== data.variant_sale_price) {
322
- return html `
323
- <span class="text-decoration-line-through"
324
- >${formatPrice(data.variant_sale_price * data.count)}</span
325
- >
326
- <span class="text-danger">${formatPrice(data.sale_price * data.count)}</span>
327
- `;
328
- }
329
- return html ` <span>${formatPrice(data.sale_price * data.count)}</span> `;
330
- })()}
365
+ ${this.plusSVG}
331
366
  </div>
332
367
  </div>
333
- `;
334
- })
335
- .join((() => {
336
- if (document.body.clientWidth < 800) {
337
- return `<div style="margin-top: 20px;background: #DDD;width: 100%;height: 1px;"></div>`;
368
+ <div
369
+ class="col-3 col-lg-2 d-flex align-items-center justify-content-center d-none d-sm-flex"
370
+ style="gap:10px;"
371
+ >
372
+ ${(() => {
373
+ function formatPrice(price) {
374
+ return `$${parseInt(`${price}`, 10).toLocaleString()}`;
338
375
  }
339
- else {
340
- return `<div style=""></div>`;
376
+ if (data.variant_sale_price && data.sale_price !== data.variant_sale_price) {
377
+ return html `
378
+ <span class="text-decoration-line-through"
379
+ >${formatPrice(data.variant_sale_price * data.count)}</span
380
+ >
381
+ <span class="text-danger">${formatPrice(data.sale_price * data.count)}</span>
382
+ `;
341
383
  }
342
- })());
343
- }
344
- return ``;
384
+ return html `<span>${formatPrice(data.sale_price * data.count)}</span> `;
385
+ })()}
386
+ </div>
387
+ </div>
388
+ `;
389
+ })
390
+ .join(document.body.clientWidth < 800
391
+ ? html `<div style="margin-top: 20px;background: #DDD;width: 100%;height: 1px;"></div>`
392
+ : '');
345
393
  })()}
346
394
  </div>
347
395
  </div>
@@ -365,7 +413,7 @@ export class PaymentPage {
365
413
  class="w-100 d-flex align-items-center justify-content-center"
366
414
  style="cursor:pointer;flex:1; height: 65px; ${vm.type === 'old'
367
415
  ? `border-radius: 0px 10px 0px 0px; background: #FFF;`
368
- : ``}"
416
+ : ''}"
369
417
  onclick="${gvc.event(() => {
370
418
  vm.type = 'old';
371
419
  gvc.notifyDataChange(vm.id);
@@ -377,7 +425,7 @@ export class PaymentPage {
377
425
  class="w-100 d-flex align-items-center justify-content-center"
378
426
  style="cursor:pointer;flex:1; height: 65px;${vm.type === 'new'
379
427
  ? `border-radius: 10px 10px 0px 0px; background: #FFF;`
380
- : ``}"
428
+ : ''}"
381
429
  onclick="${gvc.event(() => {
382
430
  vm.type = 'new';
383
431
  gvc.notifyDataChange(vm.id);
@@ -495,7 +543,6 @@ export class PaymentPage {
495
543
  </div>
496
544
  </div>
497
545
  <div
498
- class=""
499
546
  style="display: flex; width: 44px; height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid #DDD; justify-content: center; align-items: center; gap: 8px; flex-shrink: 0;"
500
547
  onclick="${gvc.event(() => {
501
548
  gvc.glitter.runJsInterFace('start_scan', {}, (res) => __awaiter(this, void 0, void 0, function* () {
@@ -722,7 +769,7 @@ export class PaymentPage {
722
769
  }
723
770
  },
724
771
  divCreate: {
725
- class: `w-100 my-3`,
772
+ class: 'w-100 my-3',
726
773
  style: `padding: 20px; border-radius: 10px; border: 1px #DDDDDD solid; flex-direction: column; justify-content: flex-start; align-items: flex-end; gap: 18px; display: inline-flex;`,
727
774
  },
728
775
  };
@@ -731,8 +778,8 @@ export class PaymentPage {
731
778
  return inView.join('');
732
779
  },
733
780
  divCreate: {
734
- class: ` p-3 bg-white`,
735
- style: `gap:14px;`,
781
+ class: 'p-3 bg-white',
782
+ style: 'gap: 14px;',
736
783
  },
737
784
  };
738
785
  }));
@@ -747,7 +794,6 @@ export class PaymentPage {
747
794
  address: '',
748
795
  managerNote: '',
749
796
  };
750
- const saasConfig = window.parent.saasConfig;
751
797
  view.push(gvc.bindView(() => {
752
798
  const id = gvc.glitter.getUUID();
753
799
  return {
@@ -762,7 +808,7 @@ export class PaymentPage {
762
808
  let h = '';
763
809
  data.map((item) => {
764
810
  if (item.hidden) {
765
- return ``;
811
+ return '';
766
812
  }
767
813
  if (item.require) {
768
814
  need_check[item.key] = true;
@@ -892,11 +938,11 @@ export class PaymentPage {
892
938
  divCreate: {
893
939
  class: `mx-sm-0`,
894
940
  style: `
895
- border-radius: 10px;
896
- overflow: hidden;
897
- background: #eaeaea;
898
- box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);
899
- `,
941
+ border-radius: 10px;
942
+ overflow: hidden;
943
+ background: #eaeaea;
944
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15);
945
+ `,
900
946
  },
901
947
  };
902
948
  })}
@@ -966,17 +1012,22 @@ export class PaymentPage {
966
1012
  `;
967
1013
  }
968
1014
  else if (obj.ogOrderData.user_info.shipment === 'normal') {
969
- return `<input class="form-control mt-2" value="${(_a = obj.ogOrderData.user_info.address) !== null && _a !== void 0 ? _a : ''}" onchange="${gvc.event((e, event) => {
1015
+ return html `<input
1016
+ class="form-control mt-2"
1017
+ value="${(_a = obj.ogOrderData.user_info.address) !== null && _a !== void 0 ? _a : ''}"
1018
+ onchange="${gvc.event(e => {
970
1019
  obj.ogOrderData.user_info.address = e.value;
971
- })}" placeholder="請輸入宅配地址">`;
1020
+ })}"
1021
+ placeholder="請輸入宅配地址"
1022
+ />`;
972
1023
  }
973
1024
  else {
974
- return ``;
1025
+ return '';
975
1026
  }
976
1027
  })()}
977
1028
  ${(() => {
978
1029
  if (obj.ogOrderData.user_info.shipment === 'now') {
979
- return ``;
1030
+ return '';
980
1031
  }
981
1032
  else {
982
1033
  return html ` ${PaymentPage.spaceView()}
@@ -1008,7 +1059,7 @@ export class PaymentPage {
1008
1059
  },
1009
1060
  ]
1010
1061
  .map(dd => {
1011
- return html ` <div class="mb-2 col-${dd.col} ps-0" style="">
1062
+ return html ` <div class="mb-2 col-${dd.col} ps-0">
1012
1063
  <div>
1013
1064
  <div
1014
1065
  class="fw-normal mb-2 fs-6"
@@ -1039,10 +1090,10 @@ export class PaymentPage {
1039
1090
  {
1040
1091
  title: '小計總額',
1041
1092
  hint: '',
1042
- value: (Number(orderDetail.total) +
1093
+ value: parseInt(`${Number(orderDetail.total) +
1043
1094
  Number(orderDetail.discount) -
1044
1095
  Number(orderDetail.shipment_fee) +
1045
- Number(orderDetail.use_rebate)).toLocaleString(),
1096
+ Number(orderDetail.use_rebate)}`, 10).toLocaleString(),
1046
1097
  },
1047
1098
  ...(() => {
1048
1099
  if (PayConfig.pos_config.pos_type === 'eat') {
@@ -1094,7 +1145,7 @@ export class PaymentPage {
1094
1145
  return `${isMinus} $${(dd.discount_total * isNegative).toLocaleString()}`;
1095
1146
  })()}
1096
1147
  <i
1097
- class="fa-solid fa-xmark ${dd.code || dd.id === 0 ? `` : `d-none`} fs-5"
1148
+ class="fa-solid fa-xmark ${dd.code || dd.id === 0 ? '' : `d-none`} fs-5"
1098
1149
  style="color:#949494;"
1099
1150
  onclick="${gvc.event(() => {
1100
1151
  const dialog = new ShareDialog(gvc.glitter);
@@ -1139,7 +1190,7 @@ export class PaymentPage {
1139
1190
  ${dd.title}
1140
1191
  </div>
1141
1192
  <div
1142
- class="${dd.hint ? `` : 'd-none'}"
1193
+ class="${dd.hint ? '' : 'd-none'}"
1143
1194
  style="align-self: stretch; color: #8D8D8D; font-size: 16px; font-family: Noto Sans; text-transform: uppercase; letter-spacing: 0.64px; word-wrap: break-word"
1144
1195
  >
1145
1196
  ${dd.hint}
@@ -1305,7 +1356,7 @@ export class PaymentPage {
1305
1356
  }
1306
1357
  else {
1307
1358
  return html ` <div class="w-100 d-flex flex-column">
1308
- <div class="d-flex align-items-center justify-content-center w-100 " style="">
1359
+ <div class="d-flex align-items-center justify-content-center w-100 ">
1309
1360
  <div class="d-flex" style="flex:68;">${PosWidget.fontLight('付款方式')}</div>
1310
1361
  <div class="d-flex" style="flex:94;">${PosWidget.fontLight('付款金額')}</div>
1311
1362
  <div class="d-flex" style="flex:68;">${PosWidget.fontLight('狀態')}</div>
@@ -1336,7 +1387,6 @@ export class PaymentPage {
1336
1387
  <div class="d-flex" style="flex:94;">
1337
1388
  <input
1338
1389
  style="display: flex;width: calc(100% - 20px);padding: 9px 18px;border-radius: 10px;border: 1px solid #DDD;text-align: right;"
1339
- class=""
1340
1390
  value="${dd.total}"
1341
1391
  onclick="${gvc.event(() => {
1342
1392
  if (dd.paied) {
@@ -1402,8 +1452,12 @@ export class PaymentPage {
1402
1452
  }
1403
1453
  },
1404
1454
  divCreate: {
1405
- class: ``,
1406
- style: `display: flex;justify-content: space-between;margin-top: 24px;gap:15px;`,
1455
+ style: `
1456
+ display: flex;
1457
+ justify-content: space-between;
1458
+ margin-top: 24px;
1459
+ gap: 15px;
1460
+ `,
1407
1461
  },
1408
1462
  })}`,
1409
1463
  html ` <div style="height:24px;"></div>`,
@@ -1417,7 +1471,7 @@ export class PaymentPage {
1417
1471
  },
1418
1472
  });
1419
1473
  })),
1420
- `<div style="height:24px;"></div>`,
1474
+ html `<div style="height:24px;"></div>`,
1421
1475
  ];
1422
1476
  if (obj.ogOrderData.pos_info.payment.length === 1 &&
1423
1477
  !obj.ogOrderData.pos_info.payment[0].paied) {
@@ -1449,9 +1503,7 @@ export class PaymentPage {
1449
1503
  }
1450
1504
  view.push(PaymentPage.spaceView());
1451
1505
  const total = obj.ogOrderData.pos_info.payment
1452
- .map((dd) => {
1453
- return dd.total;
1454
- })
1506
+ .map((dd) => dd.total)
1455
1507
  .reduce((accumulator, currentValue) => accumulator + currentValue, 0);
1456
1508
  view.push(html ` <div class="d-flex" style="gap:18px;">
1457
1509
  ${[
@@ -1579,7 +1631,6 @@ export class PaymentPage {
1579
1631
  <i class="fa-solid fa-down-to-bracket fs-4"></i>
1580
1632
  </div>
1581
1633
  <div
1582
- class=""
1583
1634
  style="flex:1;display: flex;padding: 10px;justify-content: center;align-items: center;border-radius: 10px;background: #FF6C02;color: #FFF;font-size: 18px;font-style: normal;font-weight: 500;line-height: normal;letter-spacing: 0.72px;"
1584
1635
  onclick="${gvc.event(() => {
1585
1636
  if (obj.ogOrderData.pos_info.payment.length > 1 &&
@@ -1604,7 +1655,6 @@ export class PaymentPage {
1604
1655
  建立預購單
1605
1656
  </div>
1606
1657
  <div
1607
- class=""
1608
1658
  style="flex:1;display: flex;padding: 10px;justify-content: center;align-items: center;border-radius: 10px;background: #393939;color: #FFF;font-size: 18px;font-style: normal;font-weight: 500;line-height: normal;letter-spacing: 0.72px;"
1609
1659
  onclick="${gvc.event(() => {
1610
1660
  if (total - parseInt(orderDetail.total, 10) < 0) {
@@ -1632,7 +1682,7 @@ export class PaymentPage {
1632
1682
  }
1633
1683
  PaymentPage.storeHistory(orderDetail);
1634
1684
  dialog.checkYesOrNot({
1635
- text: '是否確認前往結帳?',
1685
+ text: '是否確認前往結帳?',
1636
1686
  callback: response => {
1637
1687
  if (response) {
1638
1688
  paymentNext(false);
@@ -1701,9 +1751,7 @@ export class PaymentPage {
1701
1751
  return __awaiter(this, void 0, void 0, function* () {
1702
1752
  const dialog = new ShareDialog(gvc.glitter);
1703
1753
  orderDetail.code_array = orderDetail.code_array || [];
1704
- orderDetail.code_array = orderDetail.code_array.filter((dd) => {
1705
- return dd !== c_vm.value;
1706
- });
1754
+ orderDetail.code_array = orderDetail.code_array.filter((dd) => dd !== c_vm.value);
1707
1755
  orderDetail.code_array.push(c_vm.value);
1708
1756
  dialog.dataLoading({ visible: true });
1709
1757
  const od = (yield ApiShop.getCheckout({
@@ -1713,13 +1761,8 @@ export class PaymentPage {
1713
1761
  code_array: orderDetail.code_array,
1714
1762
  })).response.data;
1715
1763
  dialog.dataLoading({ visible: false });
1716
- if (!od ||
1717
- !od.voucherList.find((dd) => {
1718
- return dd.code === c_vm.value;
1719
- })) {
1720
- orderDetail.code_array = orderDetail.code_array.filter((dd) => {
1721
- return dd !== c_vm.value;
1722
- });
1764
+ if (!od || !od.voucherList.find((dd) => dd.code === c_vm.value)) {
1765
+ orderDetail.code_array = orderDetail.code_array.filter((dd) => dd !== c_vm.value);
1723
1766
  dialog.errorMessage({ text: '請輸入正確的優惠代碼' });
1724
1767
  }
1725
1768
  else {
@@ -1739,7 +1782,6 @@ export class PaymentPage {
1739
1782
  請掃描或輸入優惠代碼
1740
1783
  </div>
1741
1784
  <img
1742
- class=""
1743
1785
  style="max-width:70%;"
1744
1786
  src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_s5sasfscsbs7s3sf_%E6%88%AA%E5%9C%962024-08-30%E4%B8%8B%E5%8D%882.29.361.png"
1745
1787
  />
@@ -1831,7 +1873,6 @@ export class PaymentPage {
1831
1873
  請掃描或輸入會員代碼
1832
1874
  </div>
1833
1875
  <img
1834
- class=""
1835
1876
  style="max-width:70%;"
1836
1877
  src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_s5sasfscsbs7s3sf_%E6%88%AA%E5%9C%962024-08-30%E4%B8%8B%E5%8D%882.29.361.png"
1837
1878
  />
@@ -2041,34 +2082,9 @@ export class PaymentPage {
2041
2082
  <div
2042
2083
  style="position: relative;max-width:calc(100% - 20px);width: 492px;height: 223px;border-radius: 10px;background: #FFF;display: flex;flex-direction: column;align-items: center;justify-content: center;"
2043
2084
  >
2044
- <svg
2045
- xmlns="http://www.w3.org/2000/svg"
2046
- width="14"
2047
- height="14"
2048
- viewBox="0 0 14 14"
2049
- fill="none"
2050
- style="position: absolute;top: 12px;right: 12px;cursor: pointer;"
2051
- onclick="${gvc.event(() => {
2085
+ ${PaymentPage.checkSVG(gvc.event(() => {
2052
2086
  gvc.glitter.closeDiaLog();
2053
- })}"
2054
- >
2055
- <path d="M1 1L13 13" stroke="#393939" stroke-linecap="round" />
2056
- <path d="M13 1L1 13" stroke="#393939" stroke-linecap="round" />
2057
- </svg>
2058
-
2059
- <svg xmlns="http://www.w3.org/2000/svg" width="75" height="75" viewBox="0 0 75 75" fill="none">
2060
- <g clip-path="url(#clip0_9850_171427)">
2061
- <path
2062
- d="M37.5 7.03125C45.5808 7.03125 53.3307 10.2413 59.0447 15.9553C64.7587 21.6693 67.9688 29.4192 67.9688 37.5C67.9688 45.5808 64.7587 53.3307 59.0447 59.0447C53.3307 64.7587 45.5808 67.9688 37.5 67.9688C29.4192 67.9688 21.6693 64.7587 15.9553 59.0447C10.2413 53.3307 7.03125 45.5808 7.03125 37.5C7.03125 29.4192 10.2413 21.6693 15.9553 15.9553C21.6693 10.2413 29.4192 7.03125 37.5 7.03125ZM37.5 75C47.4456 75 56.9839 71.0491 64.0165 64.0165C71.0491 56.9839 75 47.4456 75 37.5C75 27.5544 71.0491 18.0161 64.0165 10.9835C56.9839 3.95088 47.4456 0 37.5 0C27.5544 0 18.0161 3.95088 10.9835 10.9835C3.95088 18.0161 0 27.5544 0 37.5C0 47.4456 3.95088 56.9839 10.9835 64.0165C18.0161 71.0491 27.5544 75 37.5 75ZM54.0527 30.6152C55.4297 29.2383 55.4297 27.0117 54.0527 25.6494C52.6758 24.2871 50.4492 24.2725 49.0869 25.6494L32.8271 41.9092L25.9424 35.0244C24.5654 33.6475 22.3389 33.6475 20.9766 35.0244C19.6143 36.4014 19.5996 38.6279 20.9766 39.9902L30.3516 49.3652C31.7285 50.7422 33.9551 50.7422 35.3174 49.3652L54.0527 30.6152Z"
2063
- fill="#393939"
2064
- />
2065
- </g>
2066
- <defs>
2067
- <clipPath id="clip0_9850_171427">
2068
- <rect width="75" height="75" fill="white" />
2069
- </clipPath>
2070
- </defs>
2071
- </svg>
2087
+ }))}
2072
2088
  <div
2073
2089
  style="text-align: center;color: #393939;font-size: 16px;font-weight: 400;line-height: 160%;margin-top: 24px;"
2074
2090
  >
@@ -2078,17 +2094,14 @@ export class PaymentPage {
2078
2094
  </div>
2079
2095
  `;
2080
2096
  }, 'orderFinish', {
2081
- dismiss: () => {
2082
- },
2097
+ dismiss: () => { },
2083
2098
  });
2084
2099
  }
2085
2100
  }));
2086
2101
  }
2087
2102
  if ((yield ApiShop.getInvoiceType()).response.method === 'nouse' ||
2088
2103
  orderDetail.pos_info.payment
2089
- .map((dd) => {
2090
- return dd.total;
2091
- })
2104
+ .map((dd) => dd.total)
2092
2105
  .reduce((accumulator, currentValue) => accumulator + currentValue, 0) < orderDetail.total ||
2093
2106
  !PayConfig.pos_config.pos_support_finction.includes('print_invoice')) {
2094
2107
  c_vm.invoice_select = 'nouse';
@@ -2118,22 +2131,22 @@ export class PaymentPage {
2118
2131
  {
2119
2132
  title: PayConfig.deviceType === 'pos' || ConnectionMode.on_connected_device ? `列印` : `寄送`,
2120
2133
  value: 'print',
2121
- icon: `<i class="fa-regular fa-print"></i>`,
2134
+ icon: html `<i class="fa-regular fa-print"></i>`,
2122
2135
  },
2123
2136
  {
2124
2137
  title: `載具`,
2125
2138
  value: 'carry',
2126
- icon: `<i class="fa-regular fa-mobile"></i>`,
2139
+ icon: html `<i class="fa-regular fa-mobile"></i>`,
2127
2140
  },
2128
2141
  {
2129
2142
  title: `統編`,
2130
2143
  value: 'company',
2131
- icon: `<i class="fa-regular fa-building"></i>`,
2144
+ icon: html `<i class="fa-regular fa-building"></i>`,
2132
2145
  },
2133
2146
  {
2134
2147
  title: `不開立`,
2135
2148
  value: 'nouse',
2136
- icon: `<i class="fa-solid fa-ban"></i>`,
2149
+ icon: html `<i class="fa-solid fa-ban"></i>`,
2137
2150
  },
2138
2151
  ];
2139
2152
  return btnArray
@@ -2152,7 +2165,7 @@ export class PaymentPage {
2152
2165
  gvc.recreateView();
2153
2166
  })}"
2154
2167
  >
2155
- <div style="" class="fs-2">${btn.icon}</div>
2168
+ <div class="fs-2">${btn.icon}</div>
2156
2169
  <div style="font-size: 16px;font-weight: 500;letter-spacing: 0.64px;">${btn.title}</div>
2157
2170
  </div>
2158
2171
  </div>
@@ -2225,7 +2238,7 @@ export class PaymentPage {
2225
2238
  </div>`;
2226
2239
  }
2227
2240
  else {
2228
- return ``;
2241
+ return '';
2229
2242
  }
2230
2243
  })()}
2231
2244
  <div
@@ -2235,9 +2248,7 @@ export class PaymentPage {
2235
2248
  <div
2236
2249
  class="flex-fill"
2237
2250
  style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
2238
- onclick="${gvc.event(() => {
2239
- next();
2240
- })}"
2251
+ onclick="${gvc.event(() => next())}"
2241
2252
  >
2242
2253
  確定
2243
2254
  </div>
@@ -2280,4 +2291,210 @@ export class PaymentPage {
2280
2291
  }
2281
2292
  });
2282
2293
  }
2294
+ static addStyle(gvc) {
2295
+ const isPhone = document.body.offsetWidth < 800;
2296
+ gvc.addStyle(`
2297
+ .pos-select {
2298
+ font-size: 18px;
2299
+ width: ${isPhone ? '100%' : '131px'};
2300
+ height: 51px;
2301
+ white-space: nowrap;
2302
+ display: flex;
2303
+ padding: 12px;
2304
+ justify-content: center;
2305
+ align-items: center;
2306
+ border-radius: 10px;
2307
+ box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.1);
2308
+ }
2309
+
2310
+ .pos-category {
2311
+ font-size: 18px;
2312
+ width: 131px;
2313
+ height: 51px;
2314
+ margin-right: 16px;
2315
+ white-space: nowrap;
2316
+ display: flex;
2317
+ padding: 12px 24px;
2318
+ justify-content: center;
2319
+ align-items: center;
2320
+ border-radius: 10px;
2321
+ box-shadow: 0px 0px 7px 0px rgba(0, 0, 0, 0.1);
2322
+ }
2323
+
2324
+ .pos-product-card {
2325
+ flex-basis: 188px;
2326
+ flex-grow: 1;
2327
+ border-radius: 10px;
2328
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);
2329
+ }
2330
+
2331
+ .pos-bgr-image {
2332
+ border-radius: 10px 10px 0 0;
2333
+ background: 50% / cover no-repeat;
2334
+ }
2335
+
2336
+ .pos-product-title {
2337
+ font-size: 18px;
2338
+ width: 100%;
2339
+ overflow: hidden;
2340
+ display: -webkit-box;
2341
+ -webkit-line-clamp: 2;
2342
+ text-overflow: ellipsis;
2343
+ word-break: break-word;
2344
+ -webkit-box-orient: vertical;
2345
+ }
2346
+
2347
+ .pos-product-container {
2348
+ overflow: scroll;
2349
+ max-height: 100%;
2350
+ padding-bottom: 100px !important;
2351
+ ${isPhone
2352
+ ? `
2353
+ padding-left: 12px;
2354
+ padding-right: 12px;
2355
+ justify-content: space-between;
2356
+ `
2357
+ : `
2358
+ gap: 26px;
2359
+ margin-left: 32px;
2360
+ margin-right: 32px;
2361
+ `}
2362
+ }
2363
+
2364
+ .pos-drawer {
2365
+ height: 100%;
2366
+ width: 352px;
2367
+ max-width: 100%;
2368
+ overflow: auto;
2369
+ background: #fff;
2370
+ box-shadow: 1px 0 10px 0 rgba(0, 0, 0, 0.1);
2371
+ }
2372
+
2373
+ .pos-check-container {
2374
+ height: 50px;
2375
+ margin-bottom: 24px;
2376
+ margin-top: ${gvc.glitter.share.top_inset}px;
2377
+ }
2378
+
2379
+ .pos-check-loading {
2380
+ background: #ffb400;
2381
+ color: #393939;
2382
+ gap: 10px;
2383
+ }
2384
+
2385
+ .pos-cart-list {
2386
+ color: #393939;
2387
+ font-size: 32px;
2388
+ font-weight: 700;
2389
+ letter-spacing: 3px;
2390
+ }
2391
+
2392
+ .pos-cart-image {
2393
+ height: 67px;
2394
+ width: 66px;
2395
+ margin-right: 12px;
2396
+ min-height: 67px;
2397
+ min-width: 66px;
2398
+ background: 50% / cover;
2399
+ }
2400
+
2401
+ .pos-spec {
2402
+ color: #949494;
2403
+ font-size: 16px;
2404
+ font-style: normal;
2405
+ font-weight: 500;
2406
+ }
2407
+
2408
+ .pos-count-button {
2409
+ display: flex;
2410
+ width: 30px;
2411
+ height: 30px;
2412
+ padding: 8px;
2413
+ justify-content: center;
2414
+ align-items: center;
2415
+ border-radius: 10px;
2416
+ background: #393939;
2417
+ }
2418
+
2419
+ .pos-count-input {
2420
+ width: 60px;
2421
+ height: 25px;
2422
+ color: #393939;
2423
+ font-size: 18px;
2424
+ font-weight: 500;
2425
+ text-align: center;
2426
+ }
2427
+
2428
+ .pos-subtotal {
2429
+ color: #393939;
2430
+ font-size: 18px;
2431
+ font-style: normal;
2432
+ font-weight: 500;
2433
+ letter-spacing: 0.72px;
2434
+ }
2435
+
2436
+ .pos-price-container {
2437
+ margin-top: 24px;
2438
+ border-radius: 10px;
2439
+ border: 1px solid #ddd;
2440
+ background: #fff;
2441
+ display: flex;
2442
+ padding: 24px;
2443
+ flex-direction: column;
2444
+ justify-content: center;
2445
+ }
2446
+
2447
+ .pos-goto-checkout {
2448
+ margin-top: 32px;
2449
+ display: flex;
2450
+ padding: 12px 24px;
2451
+ justify-content: center;
2452
+ align-items: center;
2453
+ border-radius: 10px;
2454
+ background: #393939;
2455
+ font-size: 20px;
2456
+ font-style: normal;
2457
+ font-weight: 500;
2458
+ color: #fff;
2459
+ }
2460
+ `);
2461
+ }
2283
2462
  }
2463
+ PaymentPage.minusSVG = html `<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
2464
+ <path
2465
+ d="M9.64314 5C9.64314 5.3457 9.32394 5.625 8.92885 5.625H1.07171C0.676618 5.625 0.357422 5.3457 0.357422 5C0.357422 4.6543 0.676618 4.375 1.07171 4.375H8.92885C9.32394 4.375 9.64314 4.6543 9.64314 5Z"
2466
+ fill="white"
2467
+ />
2468
+ </svg>`;
2469
+ PaymentPage.plusSVG = html `<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
2470
+ <path
2471
+ d="M5.76923 0.769231C5.76923 0.34375 5.42548 0 5 0C4.57452 0 4.23077 0.34375 4.23077 0.769231V4.23077H0.769231C0.34375 4.23077 0 4.57452 0 5C0 5.42548 0.34375 5.76923 0.769231 5.76923H4.23077V9.23077C4.23077 9.65625 4.57452 10 5 10C5.42548 10 5.76923 9.65625 5.76923 9.23077V5.76923H9.23077C9.65625 5.76923 10 5.42548 10 5C10 4.57452 9.65625 4.23077 9.23077 4.23077H5.76923V0.769231Z"
2472
+ fill="white"
2473
+ />
2474
+ </svg>`;
2475
+ PaymentPage.checkSVG = (clickEvent) => html `<svg
2476
+ xmlns="http://www.w3.org/2000/svg"
2477
+ width="14"
2478
+ height="14"
2479
+ viewBox="0 0 14 14"
2480
+ fill="none"
2481
+ style="position: absolute;top: 12px;right: 12px;cursor: pointer;"
2482
+ onclick="${clickEvent}"
2483
+ >
2484
+ <path d="M1 1L13 13" stroke="#393939" stroke-linecap="round" />
2485
+ <path d="M13 1L1 13" stroke="#393939" stroke-linecap="round" />
2486
+ </svg>
2487
+
2488
+ <svg xmlns="http://www.w3.org/2000/svg" width="75" height="75" viewBox="0 0 75 75" fill="none">
2489
+ <g clip-path="url(#clip0_9850_171427)">
2490
+ <path
2491
+ d="M37.5 7.03125C45.5808 7.03125 53.3307 10.2413 59.0447 15.9553C64.7587 21.6693 67.9688 29.4192 67.9688 37.5C67.9688 45.5808 64.7587 53.3307 59.0447 59.0447C53.3307 64.7587 45.5808 67.9688 37.5 67.9688C29.4192 67.9688 21.6693 64.7587 15.9553 59.0447C10.2413 53.3307 7.03125 45.5808 7.03125 37.5C7.03125 29.4192 10.2413 21.6693 15.9553 15.9553C21.6693 10.2413 29.4192 7.03125 37.5 7.03125ZM37.5 75C47.4456 75 56.9839 71.0491 64.0165 64.0165C71.0491 56.9839 75 47.4456 75 37.5C75 27.5544 71.0491 18.0161 64.0165 10.9835C56.9839 3.95088 47.4456 0 37.5 0C27.5544 0 18.0161 3.95088 10.9835 10.9835C3.95088 18.0161 0 27.5544 0 37.5C0 47.4456 3.95088 56.9839 10.9835 64.0165C18.0161 71.0491 27.5544 75 37.5 75ZM54.0527 30.6152C55.4297 29.2383 55.4297 27.0117 54.0527 25.6494C52.6758 24.2871 50.4492 24.2725 49.0869 25.6494L32.8271 41.9092L25.9424 35.0244C24.5654 33.6475 22.3389 33.6475 20.9766 35.0244C19.6143 36.4014 19.5996 38.6279 20.9766 39.9902L30.3516 49.3652C31.7285 50.7422 33.9551 50.7422 35.3174 49.3652L54.0527 30.6152Z"
2492
+ fill="#393939"
2493
+ />
2494
+ </g>
2495
+ <defs>
2496
+ <clipPath id="clip0_9850_171427">
2497
+ <rect width="75" height="75" fill="white" />
2498
+ </clipPath>
2499
+ </defs>
2500
+ </svg>`;