ts-glitter 14.7.4 → 14.7.6

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
@@ -80,7 +80,7 @@ export class Entry {
80
80
  }
81
81
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
82
82
  console.log(`Entry-time:`, window.renderClock.stop());
83
- glitter.share.editerVersion = 'V_14.7.4';
83
+ glitter.share.editerVersion = 'V_14.7.6';
84
84
  glitter.share.start = new Date();
85
85
  const vm = {
86
86
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -82,7 +82,7 @@ export class Entry {
82
82
 
83
83
  (window as any).renderClock = (window as any).renderClock ?? clockF();
84
84
  console.log(`Entry-time:`, (window as any).renderClock.stop());
85
- glitter.share.editerVersion = 'V_14.7.4';
85
+ glitter.share.editerVersion = 'V_14.7.6';
86
86
  glitter.share.start = new Date();
87
87
  const vm: {
88
88
  appConfig: any;
@@ -383,8 +383,8 @@ export class UMOrder {
383
383
  <h3 class="mb-3">${Language.text('order_details')}</h3>
384
384
  ${gvc.map(orderData.lineItems.map((item) => {
385
385
  return html `
386
- <div class="o-line-item">
387
- <div class="d-flex gap-3">
386
+ <div class="o-line-item ${(document.body.clientWidth < 800) ? `p-2` : ``}">
387
+ <div class="d-flex gap-3 align-items-center">
388
388
  <div>
389
389
  ${UmClass.validImageBox({
390
390
  gvc,
@@ -393,7 +393,7 @@ export class UMOrder {
393
393
  style: 'border-radius: 10px;',
394
394
  })}
395
395
  </div>
396
- <div>
396
+ <div class="">
397
397
  <p
398
398
  class="o-item-title"
399
399
  onclick="${gvc.event(() => {
@@ -420,10 +420,11 @@ export class UMOrder {
420
420
  <p class="o-item-spec">
421
421
  ${item.spec.length > 0 ? `${Language.text('specification')}:${item.spec.join(' / ')}` : Language.text('single_specification')}
422
422
  </p>
423
+ <span class="me-3 d-sm-none">NT ${item.sale_price.toLocaleString()} × ${item.count}</span>
423
424
  </div>
424
425
  </div>
425
- <div class="d-flex">
426
- <span class="me-3">$ ${item.sale_price.toLocaleString()} × ${item.count}</span>
426
+ <div class="d-none d-sm-flex">
427
+ <span class="me-3 d-none d-sm-block">$ ${item.sale_price.toLocaleString()} × ${item.count}</span>
427
428
  <span class="o-subtotal">NT$ ${(item.sale_price * item.count).toLocaleString()}</span>
428
429
  </div>
429
430
  </div>
@@ -855,8 +855,8 @@ export class UMOrder {
855
855
  ${gvc.map(
856
856
  orderData.lineItems.map((item) => {
857
857
  return html`
858
- <div class="o-line-item">
859
- <div class="d-flex gap-3">
858
+ <div class="o-line-item ${(document.body.clientWidth<800) ? `p-2`:``}">
859
+ <div class="d-flex gap-3 align-items-center">
860
860
  <div>
861
861
  ${UmClass.validImageBox({
862
862
  gvc,
@@ -865,7 +865,7 @@ export class UMOrder {
865
865
  style: 'border-radius: 10px;',
866
866
  })}
867
867
  </div>
868
- <div>
868
+ <div class="">
869
869
  <p
870
870
  class="o-item-title"
871
871
  onclick="${gvc.event(() => {
@@ -891,10 +891,11 @@ export class UMOrder {
891
891
  <p class="o-item-spec">
892
892
  ${item.spec.length > 0 ? `${Language.text('specification')}:${item.spec.join(' / ')}` : Language.text('single_specification')}
893
893
  </p>
894
+ <span class="me-3 d-sm-none">NT ${item.sale_price.toLocaleString()} × ${item.count}</span>
894
895
  </div>
895
896
  </div>
896
- <div class="d-flex">
897
- <span class="me-3">$ ${item.sale_price.toLocaleString()} × ${item.count}</span>
897
+ <div class="d-none d-sm-flex">
898
+ <span class="me-3 d-none d-sm-block">$ ${item.sale_price.toLocaleString()} × ${item.count}</span>
898
899
  <span class="o-subtotal">NT$ ${(item.sale_price * item.count).toLocaleString()}</span>
899
900
  </div>
900
901
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "14.7.4",
3
+ "version": "14.7.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -143,7 +143,7 @@ export declare class Shopping {
143
143
  type: string;
144
144
  divisor: number;
145
145
  executionTime: string;
146
- queryStatus: "error" | "success";
146
+ queryStatus: "success" | "error";
147
147
  queryData: any;
148
148
  } | {
149
149
  type: string;
@@ -439,8 +439,8 @@ class Shopping {
439
439
  async querySqlByVariants(querySql, query) {
440
440
  let sql = `SELECT v.id,
441
441
  v.product_id,
442
- v.content as variant_content,
443
- p.content as product_content,
442
+ v.content as variant_content,
443
+ p.content as product_content,
444
444
  CAST(JSON_EXTRACT(v.content, '$.stock') AS UNSIGNED) as stock
445
445
  FROM \`${this.app}\`.t_variants AS v
446
446
  JOIN
@@ -825,7 +825,8 @@ class Shopping {
825
825
  }
826
826
  }
827
827
  }
828
- catch (e) { }
828
+ catch (e) {
829
+ }
829
830
  }
830
831
  carData.shipment_fee = (() => {
831
832
  let total_volume = 0;
@@ -885,7 +886,8 @@ class Shopping {
885
886
  carData.lineItems.push(dd);
886
887
  }
887
888
  }
888
- catch (e) { }
889
+ catch (e) {
890
+ }
889
891
  });
890
892
  await this.checkVoucher(carData);
891
893
  let can_add_gift = [];
@@ -2795,17 +2797,17 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
2795
2797
  await new Promise((resolve, reject) => {
2796
2798
  for (let index = 0; index < 14; index++) {
2797
2799
  const monthCheckoutSQL = `
2798
- SELECT orderData
2799
- FROM \`${this.app}\`.t_checkout
2800
- WHERE
2801
- DAY (created_time) = DAY (DATE_SUB(NOW()
2802
- , INTERVAL ${index} DAY))
2803
- AND MONTH (created_time) = MONTH (DATE_SUB(NOW()
2804
- , INTERVAL ${index} DAY))
2805
- AND YEAR (created_time) = YEAR (DATE_SUB(NOW()
2806
- , INTERVAL ${index} DAY))
2807
- AND status = 1;
2808
- `;
2800
+ SELECT orderData
2801
+ FROM \`${this.app}\`.t_checkout
2802
+ WHERE
2803
+ DAY (created_time) = DAY (DATE_SUB(NOW()
2804
+ , INTERVAL ${index} DAY))
2805
+ AND MONTH (created_time) = MONTH (DATE_SUB(NOW()
2806
+ , INTERVAL ${index} DAY))
2807
+ AND YEAR (created_time) = YEAR (DATE_SUB(NOW()
2808
+ , INTERVAL ${index} DAY))
2809
+ AND status = 1;
2810
+ `;
2809
2811
  database_js_1.default.query(monthCheckoutSQL, []).then((data) => {
2810
2812
  pass++;
2811
2813
  let total = 0;
@@ -3102,14 +3104,18 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
3102
3104
  var _a, _b;
3103
3105
  content.seo = (_a = content.seo) !== null && _a !== void 0 ? _a : {};
3104
3106
  content.seo.domain = content.seo.domain || content.title;
3105
- const find_conflict = await database_js_1.default.query(`select count(1)
3106
- from \`${this.app}\`.\`t_manager_post\`
3107
- where (content ->>'$.seo.domain'='${decodeURIComponent(content.seo.domain)}')`, []);
3108
- if (find_conflict[0]['count(1)'] > 0) {
3109
- throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
3110
- message: '網域已被使用',
3111
- code: '733',
3112
- });
3107
+ const language = await app_js_1.App.getSupportLanguage(this.app);
3108
+ for (const b of language) {
3109
+ const find_conflict = await database_js_1.default.query(`select count(1)
3110
+ from \`${this.app}\`.\`t_manager_post\`
3111
+ where content->>'$.language_data."${b}".seo.domain'='${decodeURIComponent(content.language_data[b].seo.domain)}'
3112
+ `, []);
3113
+ if (find_conflict[0]['count(1)'] > 0) {
3114
+ throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
3115
+ message: '網域已被使用',
3116
+ code: '733',
3117
+ });
3118
+ }
3113
3119
  }
3114
3120
  try {
3115
3121
  content.type = 'product';
@@ -3225,15 +3231,18 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
3225
3231
  await Promise.all(promises);
3226
3232
  }
3227
3233
  async putProduct(content) {
3228
- const find_conflict = await database_js_1.default.query(`select count(1)
3229
- from \`${this.app}\`.\`t_manager_post\`
3230
- where (content ->>'$.seo.domain'='${decodeURIComponent(content.seo.domain)}')
3231
- and id != ${content.id}`, []);
3232
- if (find_conflict[0]['count(1)'] > 0) {
3233
- throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
3234
- message: '網域已被使用',
3235
- code: '733',
3236
- });
3234
+ const language = await app_js_1.App.getSupportLanguage(this.app);
3235
+ for (const b of language) {
3236
+ const find_conflict = await database_js_1.default.query(`select count(1)
3237
+ from \`${this.app}\`.\`t_manager_post\`
3238
+ where content->>'$.language_data."${b}".seo.domain'='${decodeURIComponent(content.language_data[b].seo.domain)}'
3239
+ and id != ${content.id}`, []);
3240
+ if (find_conflict[0]['count(1)'] > 0) {
3241
+ throw exception_js_1.default.BadRequestError('BAD_REQUEST', 'DOMAIN ALREADY EXISTS:', {
3242
+ message: '網域已被使用',
3243
+ code: '733',
3244
+ });
3245
+ }
3237
3246
  }
3238
3247
  try {
3239
3248
  content.type = 'product';