@bee-hole/server 1.84.1 → 1.84.2

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 (42) hide show
  1. package/i18n/ar-EG.toml +2 -0
  2. package/i18n/bn-BD.toml +2 -0
  3. package/i18n/de-DE.toml +2 -0
  4. package/i18n/en-US.toml +2 -0
  5. package/i18n/es-ES.toml +2 -0
  6. package/i18n/fr-FR.toml +2 -0
  7. package/i18n/hi-IN.toml +2 -0
  8. package/i18n/id-ID.toml +2 -0
  9. package/i18n/it-IT.toml +2 -0
  10. package/i18n/ja-JP.toml +2 -0
  11. package/i18n/ko-KR.toml +2 -0
  12. package/i18n/ms-MY.toml +2 -0
  13. package/i18n/pt-PT.toml +2 -0
  14. package/i18n/ru-RU.toml +2 -0
  15. package/i18n/th-TH.toml +2 -0
  16. package/i18n/vi-VN.toml +2 -0
  17. package/i18n/zh-CN.toml +2 -0
  18. package/i18n/zh-TW.toml +2 -0
  19. package/main.exe +0 -0
  20. package/mainD +0 -0
  21. package/package.json +2 -2
  22. package/resource/public/cp/index.html +1 -1
  23. package/resource/public/cp/js/{app~f075b844.b195c8e1.js → app~f075b844.a12cde98.js} +1 -1
  24. package/resource/public/cp/js/{app~f075b844.b195c8e1.js.gz → app~f075b844.a12cde98.js.gz} +0 -0
  25. package/resource/public/html/h5pay.html +123 -113
  26. package/version +1 -1
  27. /package/resource/public/cp/js/{chunk-0188754c.b13ae64f.js → chunk-0188754c.1e3aaeff.js} +0 -0
  28. /package/resource/public/cp/js/{chunk-0188754c.b13ae64f.js.gz → chunk-0188754c.1e3aaeff.js.gz} +0 -0
  29. /package/resource/public/cp/js/{chunk-0b058dc0.78050b08.js → chunk-0b058dc0.19df8b12.js} +0 -0
  30. /package/resource/public/cp/js/{chunk-0b058dc0.78050b08.js.gz → chunk-0b058dc0.19df8b12.js.gz} +0 -0
  31. /package/resource/public/cp/js/{chunk-7741a2f3.88ef31fa.js → chunk-7741a2f3.fce26825.js} +0 -0
  32. /package/resource/public/cp/js/{chunk-7741a2f3.88ef31fa.js.gz → chunk-7741a2f3.fce26825.js.gz} +0 -0
  33. /package/resource/public/cp/js/{chunk-b914b446.0a94b8b5.js → chunk-b914b446.edbf8325.js} +0 -0
  34. /package/resource/public/cp/js/{chunk-b914b446.0a94b8b5.js.gz → chunk-b914b446.edbf8325.js.gz} +0 -0
  35. /package/resource/public/cp/js/{chunk-dc1fd272.b31b5f1e.js → chunk-dc1fd272.8f41aca3.js} +0 -0
  36. /package/resource/public/cp/js/{chunk-dc1fd272.b31b5f1e.js.gz → chunk-dc1fd272.8f41aca3.js.gz} +0 -0
  37. /package/resource/public/cp/js/{chunk-e4a3fce0.20661f7d.js → chunk-e4a3fce0.45b2ada6.js} +0 -0
  38. /package/resource/public/cp/js/{chunk-e4a3fce0.20661f7d.js.gz → chunk-e4a3fce0.45b2ada6.js.gz} +0 -0
  39. /package/resource/public/cp/js/{lang-package~4e34e71e.03b61af5.js → lang-package~4e34e71e.2020f83c.js} +0 -0
  40. /package/resource/public/cp/js/{lang-package~4e34e71e.03b61af5.js.gz → lang-package~4e34e71e.2020f83c.js.gz} +0 -0
  41. /package/resource/public/cp/js/{lang-zh-TW-service~f63b1681.163bd3c2.js → lang-zh-TW-service~f63b1681.ee787844.js} +0 -0
  42. /package/resource/public/cp/js/{lang-zh-TW-service~f63b1681.163bd3c2.js.gz → lang-zh-TW-service~f63b1681.ee787844.js.gz} +0 -0
@@ -113,45 +113,46 @@
113
113
  text-align: right;
114
114
  margin-bottom: 10px;
115
115
  }
116
+
116
117
  .notification {
117
- position: fixed;
118
- top: -100px;
119
- left: 0;
120
- right: 0;
121
- background-color: #4CAF50;
122
- color: white;
123
- text-align: center;
124
- padding: 16px;
125
- transition: top 0.5s ease;
126
- z-index: 1000;
127
- }
118
+ position: fixed;
119
+ top: -100px;
120
+ left: 0;
121
+ right: 0;
122
+ background-color: #4CAF50;
123
+ color: white;
124
+ text-align: center;
125
+ padding: 16px;
126
+ transition: top 0.5s ease;
127
+ z-index: 1000;
128
+ }
128
129
 
129
- .notification.show {
130
- top: 0;
131
- }
130
+ .notification.show {
131
+ top: 0;
132
+ }
132
133
 
133
- .notification.error {
134
- background-color: #f44336;
135
- }
134
+ .notification.error {
135
+ background-color: #f44336;
136
+ }
136
137
 
137
- .notification.warning {
138
- background-color: #ff9800;
139
- }
138
+ .notification.warning {
139
+ background-color: #ff9800;
140
+ }
140
141
 
141
- .close-btn {
142
- margin-left: 15px;
143
- color: white;
144
- font-weight: bold;
145
- float: right;
146
- font-size: 22px;
147
- line-height: 20px;
148
- cursor: pointer;
149
- transition: 0.3s;
150
- }
142
+ .close-btn {
143
+ margin-left: 15px;
144
+ color: white;
145
+ font-weight: bold;
146
+ float: right;
147
+ font-size: 22px;
148
+ line-height: 20px;
149
+ cursor: pointer;
150
+ transition: 0.3s;
151
+ }
151
152
 
152
- .close-btn:hover {
153
- color: black;
154
- }
153
+ .close-btn:hover {
154
+ color: black;
155
+ }
155
156
  </style>
156
157
  </head>
157
158
 
@@ -182,7 +183,7 @@
182
183
 
183
184
  <script>
184
185
  var debug = false;
185
- const httpurl = 'http://beehole.tlyoupin.com';
186
+ const httpurl = 'http://192.168.3.50:8299';
186
187
  const translations = {
187
188
  'zh-CN': {
188
189
  paymentDetails: '支付详情',
@@ -226,6 +227,7 @@
226
227
 
227
228
  let currentLanguage = 'zh-CN';
228
229
  let payRes = null;
230
+ let yueAmount = 0;
229
231
  function translate(key, params = {}) {
230
232
  let text = translations[currentLanguage][key] || key;
231
233
  for (const [param, value] of Object.entries(params)) {
@@ -278,8 +280,8 @@
278
280
  });
279
281
  document.title = translate('paymentDetails');
280
282
  }
281
- function getRouterParams(){
282
- let url = decodeURI(window.location.href);
283
+ function getRouterParams() {
284
+ let url = decodeURI(window.location.href);
283
285
  // 获取地址栏参数
284
286
  let params = url.split('?')[1];
285
287
  // 获取参数数组
@@ -305,59 +307,60 @@
305
307
  if (debug) {
306
308
  api = httpurl + api;
307
309
  }
308
- fetch(api, {
309
- method: 'POST',
310
- headers: {
311
- 'Content-Type': 'application/json' // 如果需要 token 认证
312
- },
313
- body: JSON.stringify({
314
- // 参数
315
- credential_id: credential_id
316
- })
317
- }).then(response => response.json())
318
- .then(result => {
319
- if (result && result.data) {
320
- // this.paymentList = result.data.list
321
- // this.initPaymenthods();
322
-
323
- if(result.data && result.data.balance){
324
- if(!result.data.list){
325
- // 向第一个追加余额支付
326
- result.data.list = [];
327
- }
328
- result.data.list.unshift({
329
- "pay_way_id": 0,
330
- "description": translate('balance'),
331
- "logo": "",
332
- "balance": result.data.balance_currency + result.data.balance
333
- });
310
+ fetch(api, {
311
+ method: 'POST',
312
+ headers: {
313
+ 'Content-Type': 'application/json' // 如果需要 token 认证
314
+ },
315
+ body: JSON.stringify({
316
+ // 参数
317
+ credential_id: credential_id
318
+ })
319
+ }).then(response => response.json())
320
+ .then(result => {
321
+ if (result && result.data) {
322
+ // this.paymentList = result.data.list
323
+ // this.initPaymenthods();
324
+
325
+ if (result.data && result.data.balance) {
326
+ if (!result.data.list) {
327
+ // 向第一个追加余额支付
328
+ result.data.list = [];
334
329
  }
330
+ result.data.list.unshift({
331
+ "pay_way_id": 0,
332
+ "description": translate('balance'),
333
+ "logo": "",
334
+ "balance": result.data.balance_currency + result.data.balance
335
+ });
336
+ yueAmount = result.data.balance_currency + '' + result.data.amount;
337
+ }
335
338
 
336
- if (!result.data.list || result.data.list.length == 0) {
337
- showNotification(translate('noPayMethod'), 'error');
338
- return;
339
- }
340
- resolve(result.data.list);
341
- } else {
342
- if (result && result.code != 0) {
343
- // this.ErrMsg = result.message;
344
- // showErrText(result.message);
345
- showNotification(result.message, 'error');
346
- }
339
+ if (!result.data.list || result.data.list.length == 0) {
340
+ showNotification(translate('noPayMethod'), 'error');
341
+ return;
347
342
  }
348
- })
349
- .catch(error => {
350
- console.error('Error:', error);
351
- // showErrText(error);
352
- showNotification(error, 'error');
353
- });
343
+ resolve(result.data.list);
344
+ } else {
345
+ if (result && result.code != 0) {
346
+ // this.ErrMsg = result.message;
347
+ // showErrText(result.message);
348
+ showNotification(result.message, 'error');
349
+ }
350
+ }
351
+ })
352
+ .catch(error => {
353
+ console.error('Error:', error);
354
+ // showErrText(error);
355
+ showNotification(error, 'error');
356
+ });
354
357
  });
355
358
  }
356
359
 
357
360
  function renderPaymentMethods(methods) {
358
361
  const container = document.getElementById('payment-methods');
359
- container.innerHTML = methods.map(method =>{
360
- return `
362
+ container.innerHTML = methods.map(method => {
363
+ return `
361
364
  <div class="payment-method" data-id="${method.pay_way_id}">
362
365
  ${method.logo ? `<img src="${method.logo}" alt="${translate(method.description)}">` : `<div style="height: 22px;"></div>`}
363
366
  <h3 data-i18n="${method.description}" data-id="${method.pay_way_id}">${translate(method.description)}</h3>
@@ -374,7 +377,7 @@
374
377
  });
375
378
 
376
379
  container.querySelectorAll('.currency-select').forEach(select => {
377
- select.addEventListener('change', (event)=>{
380
+ select.addEventListener('change', (event) => {
378
381
  selectPaymentMethodAndCurrency(event);
379
382
  });
380
383
  });
@@ -396,7 +399,7 @@
396
399
  updatePayButton();
397
400
  }
398
401
  async function selectPaymentMethodAndCurrency(event) {
399
- if(event){
402
+ if (event) {
400
403
  event.stopPropagation(); // 阻止事件冒泡
401
404
  }
402
405
 
@@ -421,24 +424,31 @@
421
424
  const payWayId = selectedMethod?.getAttribute('data-id')
422
425
  const selectedCurrency = selectedMethod ? selectedMethod.querySelector('.currency-select')?.value : '';
423
426
  const payButton = document.getElementById('pay-button');
424
- if (payWayId+'' === '0') {
427
+ if (payWayId + '' === '0') {
425
428
  // payButton.textContent = '余额支付';
426
429
  payButton.disabled = false
427
- }else{
430
+ } else {
428
431
  payButton.disabled = !selectedMethod || !selectedCurrency;
429
432
  }
430
433
  const methodName = selectedMethod.querySelector('[data-i18n]').getAttribute('data-i18n');
431
- if (!payButton.disabled && payWayId+'' !== '0') {
434
+ console.log('methodName-------', methodName)
435
+ if (!payButton.disabled && payWayId + '' !== '0') {
432
436
  // alert(translate('paymentProcessing', { method: translate(methodName), currency: selectedCurrency }));
433
437
  payRes = await Pay(selectedCurrency, payWayId, methodName);
434
438
  }
439
+ if(payWayId + '' === '0'){
440
+ setPayAmount(yueAmount);
441
+ }
435
442
  }
436
443
 
437
444
  function setPayAmount(amount, payAmount) {
438
- const payAmountText = ', ' + translate('translatePrice') + ': ' + payAmount;
445
+ let payAmountText ='';
446
+ if (payAmount) {
447
+ payAmountText = ', ' + translate('translatePrice') + ': ' + payAmount;
448
+ }
439
449
  document.querySelector('.payment-amount').textContent = amount + payAmountText;
440
450
  }
441
- function backUrl () {
451
+ function backUrl() {
442
452
  return window.location.href;
443
453
  };
444
454
  function Pay(currency, payWayId, name) {
@@ -453,8 +463,8 @@
453
463
  pay_way_id: payWayId
454
464
  }
455
465
  var api = '/admin/payment'
456
- if(debug){
457
- api = httpurl+api;
466
+ if (debug) {
467
+ api = httpurl + api;
458
468
  }
459
469
  fetch(api, {
460
470
  method: 'POST',
@@ -469,7 +479,7 @@
469
479
  if (res) {
470
480
  // that.prepayAmountCurrency = (res.currency)
471
481
  // that.prepayAmount = res.amount;
472
- setPayAmount((res.price_currency)+''+ res.price_amount, res.trade_currency + '' + res.trade_amount);
482
+ setPayAmount((res.price_currency) + '' + res.price_amount, res.trade_currency + '' + res.trade_amount);
473
483
  const url64 = res?.jsapi?.auth_link;
474
484
  const h5Url = res?.h5?.h5_url;
475
485
  const authLink = res?.jsapi?.auth_link;
@@ -479,7 +489,7 @@
479
489
  // 对url进行base64解码
480
490
  const url = Buffer.from(url64, 'base64').toString('binary');
481
491
  // that.payUrl = url;
482
- resolve({url, type: 'url'});
492
+ resolve({ url, type: 'url' });
483
493
  }
484
494
  if (h5Url) {
485
495
  // that.payUrl = h5Url;
@@ -494,7 +504,7 @@
494
504
  resolve({ url: qrCode, type: 'qrCode' });
495
505
  // this.lunxunOrder();
496
506
  }
497
- if (payWayId === '' && result.code === 0){
507
+ if (payWayId === '' && result.code === 0) {
498
508
  resolve(result);
499
509
  }
500
510
  } else {
@@ -514,8 +524,8 @@
514
524
  });
515
525
  });
516
526
  }
517
-
518
- let payTime =null;
527
+
528
+ let payTime = null;
519
529
  function getOrderStatus() {
520
530
  return new Promise((resolve) => {
521
531
  var api = '/admin/payment/query'
@@ -541,8 +551,8 @@
541
551
  }, 1000);
542
552
  } else if (res.status === 'PAID') {
543
553
  window.close();
544
- }else{
545
- if(res && res.code != 0){
554
+ } else {
555
+ if (res && res.code != 0) {
546
556
  // showErrText(res.message);
547
557
  showNotification(result.message, 'error');
548
558
  }
@@ -553,10 +563,10 @@
553
563
  // showErrText(error);
554
564
  showNotification(error, 'error');
555
565
  });
556
- });
557
- }
558
-
559
- function initPay (){
566
+ });
567
+ }
568
+
569
+ function initPay() {
560
570
  // // 默认选中第一个支付方式
561
571
  // const payMentd = document.querySelector('.payment-method')
562
572
  // payMentd.click();
@@ -597,12 +607,12 @@
597
607
  // 获取所有
598
608
  let isInit = false;
599
609
  document.querySelectorAll('.payment-method').forEach((method) => {
600
- if(!isInit){
610
+ if (!isInit) {
601
611
  method.click();
602
612
  isInit = true;
603
613
  }
604
614
  const currencySelect = method.querySelector('.currency-select');
605
- if(currencySelect){
615
+ if (currencySelect) {
606
616
  for (let i = 1; i < currencySelect.options.length; i++) {
607
617
  if (currencySelect.options[i].value) {
608
618
  currencySelect.selectedIndex = i;
@@ -617,15 +627,15 @@
617
627
  selectPaymentMethodAndCurrency(mockEvent);
618
628
  }
619
629
  });
620
-
630
+
621
631
  }
622
-
632
+
623
633
  async function initPage() {
624
634
  try {
625
635
  const params = getRouterParams();
626
- if(params.debug === 'true'){
636
+ if (params.debug === 'true') {
627
637
  debug = true;
628
- if(params.httpurl){
638
+ if (params.httpurl) {
629
639
  httpurl = params.httpurl;
630
640
  }
631
641
  }
@@ -646,7 +656,7 @@
646
656
 
647
657
  window.addEventListener('load', initPage);
648
658
 
649
- document.getElementById('pay-button').addEventListener('click',async () => {
659
+ document.getElementById('pay-button').addEventListener('click', async () => {
650
660
  const selectedMethod = document.querySelector('.payment-method[style*="border-color: rgb(49, 130, 206)"]');
651
661
  const selectedCurrency = selectedMethod ? selectedMethod.querySelector('.currency-select')?.value : '';
652
662
  // 我想通过selectedCurrency获取他标签上的data-id
@@ -664,14 +674,14 @@
664
674
  document.getElementById('payCode').innerHTML = `<img src="data:image/jpeg;base64, ${payRes.url}" alt="支付二维码">`;
665
675
  showNotification(translate('sanbarcodePay'), 'success');
666
676
  }
667
- }else{
677
+ } else {
668
678
  // showErrText('支付失败');
669
679
  }
670
-
671
- }else{
680
+
681
+ } else {
672
682
  const selectedMethod = document.querySelector('.payment-method[style*="border-color: rgb(49, 130, 206)"]');
673
683
  const payWayId = selectedMethod?.getAttribute('data-id')
674
- if(payWayId+'' === '0'){
684
+ if (payWayId + '' === '0') {
675
685
  // 余额支付
676
686
  const res = await Pay(selectedCurrency, '', '余额');
677
687
  if (res.code === 0) {
@@ -679,7 +689,7 @@
679
689
  setTimeout(() => {
680
690
  window.close();
681
691
  }, 2000);
682
- }else{
692
+ } else {
683
693
  // showErrText('支付失败');
684
694
  }
685
695
  }
package/version CHANGED
@@ -1 +1 @@
1
- v1.84.1
1
+ v1.84.2