ts-glitter 16.6.4 → 16.6.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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/models.ts +3 -1
- package/lowcode/cms-plugin/pos-pages/payment-function.js +7 -7
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +31 -30
- package/lowcode/cms-plugin/pos-pages/payment-page.js +70 -15
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +70 -21
- package/lowcode/cms-plugin/pos-pages/pos-function.js +12 -4
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +12 -4
- package/lowcode/cms-plugin/pos-pages/products-page.js +60 -71
- package/lowcode/cms-plugin/pos-pages/products-page.ts +110 -96
- package/lowcode/cms-plugin/shopping-invoice-manager.js +1 -1
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +1 -1
- package/lowcode/cms-plugin/shopping-order-manager.js +130 -78
- package/lowcode/cms-plugin/shopping-order-manager.ts +220 -166
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +2 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +2 -1
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/shopee.d.ts +1 -0
- package/src/api-public/services/shopee.js +31 -18
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +128 -102
- package/src/api-public/services/shopping.d.ts +2 -1
- package/src/api-public/services/shopping.js +61 -25
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +88 -56
- package/src/index.js.map +1 -5
package/lowcode/Entry.js
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
92
92
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_16.6.
|
|
93
|
+
glitter.share.editerVersion = 'V_16.6.6';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm = {
|
|
96
96
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Entry {
|
|
|
90
90
|
}
|
|
91
91
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
92
92
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
93
|
-
glitter.share.editerVersion = 'V_16.6.
|
|
93
|
+
glitter.share.editerVersion = 'V_16.6.6';
|
|
94
94
|
glitter.share.start = new Date();
|
|
95
95
|
const vm: {
|
|
96
96
|
appConfig: any;
|
|
@@ -5,6 +5,7 @@ export class OrderDetail {
|
|
|
5
5
|
rebate: number;
|
|
6
6
|
orderID?:string;
|
|
7
7
|
cart_token: string;
|
|
8
|
+
line_prefix?:number;
|
|
8
9
|
code_array?:string[]
|
|
9
10
|
voucher?: VoucherData;
|
|
10
11
|
lineItems: {
|
|
@@ -124,7 +125,8 @@ export type ViewModel = {
|
|
|
124
125
|
categories: any[];
|
|
125
126
|
paySelect: {
|
|
126
127
|
method:'cash'|'creditCard'|'line',
|
|
127
|
-
total:number
|
|
128
|
+
total:number,
|
|
129
|
+
paied?:boolean
|
|
128
130
|
}[];
|
|
129
131
|
loading:boolean
|
|
130
132
|
};
|
|
@@ -100,7 +100,7 @@ export class PaymentFunction {
|
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
static creditFinish(gvc, orderDetail, callback) {
|
|
103
|
+
static creditFinish(gvc, total, orderDetail, callback) {
|
|
104
104
|
const dialog = new ShareDialog(gvc.glitter);
|
|
105
105
|
const pwd = orderDetail.payment_setting.find((dd) => {
|
|
106
106
|
return dd.key === 'ut_credit_card';
|
|
@@ -108,7 +108,7 @@ export class PaymentFunction {
|
|
|
108
108
|
gvc.glitter.innerDialog((gvc) => {
|
|
109
109
|
if (PayConfig.deviceType === 'pos') {
|
|
110
110
|
gvc.glitter.runJsInterFace('credit_card', {
|
|
111
|
-
amount: `${
|
|
111
|
+
amount: `${total}`,
|
|
112
112
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
113
113
|
pwd: pwd
|
|
114
114
|
}, (res) => {
|
|
@@ -137,7 +137,7 @@ export class PaymentFunction {
|
|
|
137
137
|
};
|
|
138
138
|
ConnectionMode.sendCommand({
|
|
139
139
|
cmd: 'credit_card',
|
|
140
|
-
amount: `${
|
|
140
|
+
amount: `${total}`,
|
|
141
141
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
142
142
|
pwd: pwd
|
|
143
143
|
});
|
|
@@ -145,7 +145,7 @@ export class PaymentFunction {
|
|
|
145
145
|
else {
|
|
146
146
|
setTimeout(() => {
|
|
147
147
|
gvc.closeDialog();
|
|
148
|
-
dialog.errorMessage({ text: '
|
|
148
|
+
dialog.errorMessage({ text: '尚未連線至刷卡機' });
|
|
149
149
|
}, 100);
|
|
150
150
|
}
|
|
151
151
|
return html `
|
|
@@ -175,7 +175,7 @@ export class PaymentFunction {
|
|
|
175
175
|
},
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
static lineFinish(gvc, orderDetail, callback) {
|
|
178
|
+
static lineFinish(gvc, total, orderDetail, callback) {
|
|
179
179
|
const dialog = new ShareDialog(gvc.glitter);
|
|
180
180
|
gvc.glitter.innerDialog((gvc) => {
|
|
181
181
|
let block = false;
|
|
@@ -185,9 +185,9 @@ export class PaymentFunction {
|
|
|
185
185
|
}
|
|
186
186
|
dialog.dataLoading({ visible: true });
|
|
187
187
|
ApiShop.toPOSLinePay({
|
|
188
|
-
amount:
|
|
188
|
+
amount: total,
|
|
189
189
|
currency: 'TWD',
|
|
190
|
-
orderId: orderDetail.orderID
|
|
190
|
+
orderId: `${orderDetail.orderID}-${(orderDetail.line_prefix || 0)}`,
|
|
191
191
|
productName: orderDetail.lineItems
|
|
192
192
|
.map((data) => {
|
|
193
193
|
return `${data.title} * ${data.count}`;
|
|
@@ -4,6 +4,7 @@ import {PayConfig} from "./pay-config.js";
|
|
|
4
4
|
import {ConnectionMode} from "./connection-mode.js";
|
|
5
5
|
import {PaymentPage} from "./payment-page.js";
|
|
6
6
|
import {ApiShop} from "../../glitter-base/route/shopping.js";
|
|
7
|
+
import {OrderDetail} from "./models.js";
|
|
7
8
|
|
|
8
9
|
const html = String.raw
|
|
9
10
|
|
|
@@ -102,7 +103,7 @@ export class PaymentFunction {
|
|
|
102
103
|
);
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
public static creditFinish(gvc: GVC, orderDetail: any, callback: (result: boolean) => void) {
|
|
106
|
+
public static creditFinish(gvc: GVC, total:number,orderDetail: any, callback: (result: boolean) => void) {
|
|
106
107
|
const dialog = new ShareDialog(gvc.glitter);
|
|
107
108
|
|
|
108
109
|
|
|
@@ -115,7 +116,7 @@ export class PaymentFunction {
|
|
|
115
116
|
gvc.glitter.runJsInterFace(
|
|
116
117
|
'credit_card',
|
|
117
118
|
{
|
|
118
|
-
amount: `${
|
|
119
|
+
amount: `${total}`,
|
|
119
120
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
120
121
|
pwd: pwd
|
|
121
122
|
},
|
|
@@ -143,14 +144,14 @@ export class PaymentFunction {
|
|
|
143
144
|
}
|
|
144
145
|
ConnectionMode.sendCommand({
|
|
145
146
|
cmd: 'credit_card',
|
|
146
|
-
amount: `${
|
|
147
|
+
amount: `${total}`,
|
|
147
148
|
memo: `訂單ID:${orderDetail.orderID}`,
|
|
148
149
|
pwd: pwd
|
|
149
150
|
})
|
|
150
151
|
} else {
|
|
151
152
|
setTimeout(() => {
|
|
152
153
|
gvc.closeDialog();
|
|
153
|
-
dialog.errorMessage({text: '
|
|
154
|
+
dialog.errorMessage({text: '尚未連線至刷卡機'});
|
|
154
155
|
}, 100)
|
|
155
156
|
}
|
|
156
157
|
|
|
@@ -171,9 +172,9 @@ export class PaymentFunction {
|
|
|
171
172
|
<div class="fw-500 w-100 mt-3"
|
|
172
173
|
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
|
|
173
174
|
onclick="${gvc.event(() => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
// clearTimeout(timer)
|
|
176
|
+
gvc.glitter.closeDiaLog();
|
|
177
|
+
})}">取消付款
|
|
177
178
|
</div>
|
|
178
179
|
</div>
|
|
179
180
|
</div>
|
|
@@ -188,7 +189,7 @@ export class PaymentFunction {
|
|
|
188
189
|
);
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
public static lineFinish(gvc: GVC, orderDetail:
|
|
192
|
+
public static lineFinish(gvc: GVC, total:number,orderDetail: OrderDetail, callback: (result: boolean) => void) {
|
|
192
193
|
const dialog = new ShareDialog(gvc.glitter);
|
|
193
194
|
|
|
194
195
|
|
|
@@ -202,9 +203,9 @@ export class PaymentFunction {
|
|
|
202
203
|
}
|
|
203
204
|
dialog.dataLoading({visible: true});
|
|
204
205
|
ApiShop.toPOSLinePay({
|
|
205
|
-
amount:
|
|
206
|
+
amount: total,
|
|
206
207
|
currency: 'TWD',
|
|
207
|
-
orderId: orderDetail.orderID
|
|
208
|
+
orderId: `${orderDetail.orderID}-${(orderDetail.line_prefix || 0)}`,
|
|
208
209
|
productName: orderDetail.lineItems
|
|
209
210
|
.map((data: any) => {
|
|
210
211
|
return `${data.title} * ${data.count}`;
|
|
@@ -241,25 +242,25 @@ export class PaymentFunction {
|
|
|
241
242
|
style="border: none;"
|
|
242
243
|
placeholder="請輸入或掃描付款代碼"
|
|
243
244
|
onchange="${gvc.event((e, event) => {
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
m_text = e.value
|
|
246
|
+
})}"
|
|
246
247
|
value="${m_text || ''}"
|
|
247
248
|
onfocus="${gvc.event(() => {
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
block = true
|
|
250
|
+
})}"
|
|
250
251
|
onblur="${gvc.event(() => {
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
block = false
|
|
253
|
+
})}"
|
|
253
254
|
/>
|
|
254
255
|
<div class="flex-fill"></div>
|
|
255
256
|
<div
|
|
256
257
|
style="background: grey;width: 50px;"
|
|
257
258
|
class="d-flex align-items-center justify-content-center text-white h-100"
|
|
258
259
|
onclick="${gvc.event(() => {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
260
|
+
gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
|
|
261
|
+
PayConfig.onPayment!(res.text);
|
|
262
|
+
});
|
|
263
|
+
})}"
|
|
263
264
|
>
|
|
264
265
|
<i class="fa-regular fa-barcode-read"></i>
|
|
265
266
|
</div>
|
|
@@ -270,9 +271,9 @@ export class PaymentFunction {
|
|
|
270
271
|
class="flex-fill"
|
|
271
272
|
style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
|
|
272
273
|
onclick="${gvc.event(() => {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
PayConfig.onPayment = undefined
|
|
275
|
+
gvc.glitter.closeDiaLog();
|
|
276
|
+
})}"
|
|
276
277
|
>
|
|
277
278
|
取消
|
|
278
279
|
</div>
|
|
@@ -281,13 +282,13 @@ export class PaymentFunction {
|
|
|
281
282
|
class="flex-fill"
|
|
282
283
|
style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
|
|
283
284
|
onclick="${gvc.event(async () => {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
285
|
+
if (!m_text) {
|
|
286
|
+
dialog.errorMessage({text: '請輸入交易條碼'})
|
|
287
|
+
return
|
|
288
|
+
}
|
|
289
|
+
block = false
|
|
290
|
+
PayConfig.onPayment!(m_text)
|
|
291
|
+
})}"
|
|
291
292
|
>
|
|
292
293
|
確定
|
|
293
294
|
</div>
|
|
@@ -140,7 +140,7 @@ export class PaymentPage {
|
|
|
140
140
|
<div
|
|
141
141
|
class="d-flex flex-column ${document.body.offsetWidth < 800 ? `` : ``}"
|
|
142
142
|
style="${document.body.offsetWidth < 800
|
|
143
|
-
?
|
|
143
|
+
? ``
|
|
144
144
|
: `padding:24px;border-radius: 10px;background: #FFF;box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.08);margin-top:32px;`}"
|
|
145
145
|
>
|
|
146
146
|
<div class="d-none d-sm-flex"
|
|
@@ -152,7 +152,7 @@ export class PaymentPage {
|
|
|
152
152
|
<div class="col-2 text-center">小計</div>
|
|
153
153
|
</div>
|
|
154
154
|
<div class="d-flex flex-column"
|
|
155
|
-
style="${document.body.offsetWidth < 800 ? `` :
|
|
155
|
+
style="${document.body.offsetWidth < 800 ? `` : ``}">
|
|
156
156
|
${(() => {
|
|
157
157
|
if (orderDetail.lineItems.length > 0) {
|
|
158
158
|
return orderDetail.lineItems
|
|
@@ -160,10 +160,28 @@ export class PaymentPage {
|
|
|
160
160
|
return html `
|
|
161
161
|
<div class="d-flex" style="">
|
|
162
162
|
<div class="col-8 col-sm-6 d-flex align-items-center">
|
|
163
|
-
<div
|
|
163
|
+
<div class="d-flex flex-column align-items-center justify-content-center" style="gap:5px;width:75px;">
|
|
164
|
+
<div style="height: 20px;"></div>
|
|
165
|
+
<div style="width: 54px;height: 54px;border-radius: 5px;background: 50%/cover url('${data.preview_image || 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}')"></div>
|
|
166
|
+
<div style="font-size: 14px;height: 20px;" class="fw-500 ${(data.pre_order) ? `text-danger` : ``}">庫存:${(() => {
|
|
167
|
+
if (`${data.show_understocking}` === 'false') {
|
|
168
|
+
return `不追蹤`;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
return (data.stockList[POSSetting.config.where_store] && data.stockList[POSSetting.config.where_store].count) || 0;
|
|
172
|
+
}
|
|
173
|
+
})()}</div>
|
|
174
|
+
</div>
|
|
164
175
|
<div class="d-flex flex-column"
|
|
165
176
|
style="font-size: 16px;font-style: normal;font-weight: 500;letter-spacing: 0.64px;margin-left: 12px;">
|
|
166
|
-
|
|
177
|
+
<div class="d-flex align-items-center" style="gap:10px;">${data.title}${(() => {
|
|
178
|
+
if (!data.pre_order) {
|
|
179
|
+
return ``;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
return BgWidget.dangerInsignia('需預購');
|
|
183
|
+
}
|
|
184
|
+
})()}</div>
|
|
167
185
|
<span
|
|
168
186
|
style="color: #949494;
|
|
169
187
|
font-size: 16px;
|
|
@@ -208,10 +226,10 @@ text-transform: uppercase;">NT.${parseInt(data.sale_price, 10).toLocaleString()}
|
|
|
208
226
|
})
|
|
209
227
|
.join((() => {
|
|
210
228
|
if (document.body.clientWidth < 800) {
|
|
211
|
-
return `<div style="margin-top:
|
|
229
|
+
return `<div style="margin-top: 20px;background: #DDD;width: 100%;height: 1px;"></div>`;
|
|
212
230
|
}
|
|
213
231
|
else {
|
|
214
|
-
return `<div style="
|
|
232
|
+
return `<div style=""></div>`;
|
|
215
233
|
}
|
|
216
234
|
})());
|
|
217
235
|
}
|
|
@@ -1089,6 +1107,10 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1089
1107
|
<input style="display: flex;width: calc(100% - 20px);padding: 9px 18px;border-radius: 10px;border: 1px solid #DDD;text-align: right;"
|
|
1090
1108
|
class="" value="${dd.total}"
|
|
1091
1109
|
onclick="${gvc.event(() => {
|
|
1110
|
+
if (dd.paied) {
|
|
1111
|
+
dialog.errorMessage({ text: '此付款金額已結清,無法進行調整' });
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1092
1114
|
PosFunction.setMoney(gvc, (money) => {
|
|
1093
1115
|
dd.total = (money || 0);
|
|
1094
1116
|
refreshOrderView();
|
|
@@ -1110,7 +1132,7 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1110
1132
|
});
|
|
1111
1133
|
break;
|
|
1112
1134
|
case 'creditCard':
|
|
1113
|
-
PaymentFunction.creditFinish(gvc, dd.total, (result) => {
|
|
1135
|
+
PaymentFunction.creditFinish(gvc, dd.total, orderDetail, (result) => {
|
|
1114
1136
|
if (result) {
|
|
1115
1137
|
dd.paied = true;
|
|
1116
1138
|
refreshOrderView();
|
|
@@ -1118,9 +1140,11 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1118
1140
|
});
|
|
1119
1141
|
break;
|
|
1120
1142
|
case 'line':
|
|
1121
|
-
|
|
1143
|
+
obj.ogOrderData.line_prefix = obj.ogOrderData.line_prefix || 0;
|
|
1144
|
+
PaymentFunction.lineFinish(gvc, dd.total, obj.ogOrderData, (result) => {
|
|
1122
1145
|
if (result) {
|
|
1123
1146
|
dd.paied = true;
|
|
1147
|
+
obj.ogOrderData.line_prefix++;
|
|
1124
1148
|
refreshOrderView();
|
|
1125
1149
|
}
|
|
1126
1150
|
});
|
|
@@ -1190,12 +1214,12 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1190
1214
|
${([
|
|
1191
1215
|
{
|
|
1192
1216
|
title: '實際收款金額',
|
|
1193
|
-
value: total,
|
|
1217
|
+
value: total.toLocaleString(),
|
|
1194
1218
|
color: `#393939`
|
|
1195
1219
|
},
|
|
1196
1220
|
{
|
|
1197
1221
|
title: (total - parseInt(orderDetail.total, 10)) < 0 ? `不足` : `找零`,
|
|
1198
|
-
value: total - parseInt(orderDetail.total, 10),
|
|
1222
|
+
value: (total - parseInt(orderDetail.total, 10)).toLocaleString(),
|
|
1199
1223
|
color: (total - parseInt(orderDetail.total, 10)) >= 0 ? `#4D86DB` : `#E85757`,
|
|
1200
1224
|
}
|
|
1201
1225
|
]).map((dd) => {
|
|
@@ -1210,7 +1234,7 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1210
1234
|
</div>`;
|
|
1211
1235
|
}).join('')}
|
|
1212
1236
|
</div>`);
|
|
1213
|
-
function paymentNext() {
|
|
1237
|
+
function paymentNext(pre_order) {
|
|
1214
1238
|
TempOrder.removeTempOrders(orderDetail.orderID);
|
|
1215
1239
|
if (orderDetail.lineItems.length <= 0) {
|
|
1216
1240
|
dialog.errorMessage({ text: '請先選擇商品!' });
|
|
@@ -1234,6 +1258,10 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1234
1258
|
passData.total = orderDetail.total;
|
|
1235
1259
|
passData.orderStatus = 1;
|
|
1236
1260
|
passData.pay_status = 1;
|
|
1261
|
+
passData.pre_order = pre_order;
|
|
1262
|
+
vm.paySelect.map((dd) => {
|
|
1263
|
+
dd.paied = true;
|
|
1264
|
+
});
|
|
1237
1265
|
if (vm.paySelect.length === 1) {
|
|
1238
1266
|
if (vm.paySelect.find((dd) => {
|
|
1239
1267
|
return dd.method === 'cash';
|
|
@@ -1247,7 +1275,7 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1247
1275
|
else if (vm.paySelect.find((dd) => {
|
|
1248
1276
|
return dd.method === 'creditCard';
|
|
1249
1277
|
})) {
|
|
1250
|
-
PaymentFunction.creditFinish(gvc, orderDetail, (result) => {
|
|
1278
|
+
PaymentFunction.creditFinish(gvc, orderDetail.total, orderDetail, (result) => {
|
|
1251
1279
|
if (result) {
|
|
1252
1280
|
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1253
1281
|
}
|
|
@@ -1256,7 +1284,7 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1256
1284
|
else if (vm.paySelect.find((dd) => {
|
|
1257
1285
|
return dd.method === 'line';
|
|
1258
1286
|
})) {
|
|
1259
|
-
PaymentFunction.lineFinish(gvc, orderDetail, (result) => {
|
|
1287
|
+
PaymentFunction.lineFinish(gvc, orderDetail.total, orderDetail, (result) => {
|
|
1260
1288
|
if (result) {
|
|
1261
1289
|
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1262
1290
|
}
|
|
@@ -1266,6 +1294,9 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1266
1294
|
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1267
1295
|
}
|
|
1268
1296
|
}
|
|
1297
|
+
else {
|
|
1298
|
+
PaymentPage.selectInvoice(gvc, orderDetail, vm, passData);
|
|
1299
|
+
}
|
|
1269
1300
|
}
|
|
1270
1301
|
view.push(html `
|
|
1271
1302
|
<div style="margin-top: 32px;gap:15px;"
|
|
@@ -1286,11 +1317,19 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1286
1317
|
class=""
|
|
1287
1318
|
style="flex:1;display: flex;padding: 12px 24px;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;"
|
|
1288
1319
|
onclick="${gvc.event(() => {
|
|
1320
|
+
if ((vm.paySelect.length > 1) && (vm.paySelect.find((dd) => {
|
|
1321
|
+
return !dd.paied;
|
|
1322
|
+
}))) {
|
|
1323
|
+
dialog.errorMessage({
|
|
1324
|
+
text: `請結清所有款項`
|
|
1325
|
+
});
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1289
1328
|
dialog.checkYesOrNot({
|
|
1290
1329
|
text: '是否確認建立預購單?',
|
|
1291
1330
|
callback: (response) => {
|
|
1292
1331
|
if (response) {
|
|
1293
|
-
paymentNext();
|
|
1332
|
+
paymentNext(true);
|
|
1294
1333
|
}
|
|
1295
1334
|
}
|
|
1296
1335
|
});
|
|
@@ -1306,11 +1345,27 @@ ${vm.paySelect.map((dd, index) => {
|
|
|
1306
1345
|
dialog.errorMessage({ text: `收款金額尚需要『 ${((total - parseInt(orderDetail.total, 10)) * -1).toLocaleString()} 』` });
|
|
1307
1346
|
return;
|
|
1308
1347
|
}
|
|
1348
|
+
else if ((vm.paySelect.length > 1) && (vm.paySelect.find((dd) => {
|
|
1349
|
+
return !dd.paied;
|
|
1350
|
+
}))) {
|
|
1351
|
+
dialog.errorMessage({
|
|
1352
|
+
text: `請結清所有款項`
|
|
1353
|
+
});
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
else if (orderDetail.lineItems.find((dd) => {
|
|
1357
|
+
return dd.pre_order;
|
|
1358
|
+
})) {
|
|
1359
|
+
dialog.errorMessage({
|
|
1360
|
+
text: `庫存不足,請建立預購單`
|
|
1361
|
+
});
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1309
1364
|
PaymentPage.storeHistory(orderDetail);
|
|
1310
1365
|
dialog.checkYesOrNot({
|
|
1311
1366
|
text: '是否確認前往結帳?', callback: (response) => {
|
|
1312
1367
|
if (response) {
|
|
1313
|
-
paymentNext();
|
|
1368
|
+
paymentNext(false);
|
|
1314
1369
|
}
|
|
1315
1370
|
}
|
|
1316
1371
|
});
|