@uxda/appkit 1.0.76 → 1.1.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.
package/dist/appkit.css CHANGED
@@ -536,6 +536,9 @@ page {
536
536
  font-weight: 700;
537
537
  }
538
538
  .account-view {
539
+ height: 100vh;
540
+ }
541
+ .account-view .scroll-content {
539
542
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzUwIiBoZWlnaHQ9IjQwNiIgdmlld0JveD0iMCAwIDc1MCA0MDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0zODIuNSA0MDcuNUM1NzcuMzU3IDQwNy41IDc1My43ODggMzgxLjI0OCA4ODEuNTIxIDMzOC43OTFDOTQ1LjM4NiAzMTcuNTYzIDk5Ny4xMDQgMjkyLjI3NiAxMDMyLjg3IDI2NC4xNzFDMTA2OC42MiAyMzYuMDcxIDEwODguNSAyMDUuMDk3IDEwODguNSAxNzIuNUMxMDg4LjUgMTM5LjkwMyAxMDY4LjYyIDEwOC45MjkgMTAzMi44NyA4MC44Mjg5Qzk5Ny4xMDQgNTIuNzI0NSA5NDUuMzg2IDI3LjQzNjcgODgxLjUyMSA2LjIwODk4Qzc1My43ODggLTM2LjI0ODIgNTc3LjM1NyAtNjIuNSAzODIuNSAtNjIuNUMxODcuNjQzIC02Mi41IDExLjIxMjIgLTM2LjI0ODIgLTExNi41MjIgNi4yMDg5OEMtMTgwLjM4NiAyNy40MzY3IC0yMzIuMTA0IDUyLjcyNDUgLTI2Ny44NjcgODAuODI4OUMtMzAzLjYyNCAxMDguOTI5IC0zMjMuNSAxMzkuOTAzIC0zMjMuNSAxNzIuNUMtMzIzLjUgMjA1LjA5NyAtMzAzLjYyNCAyMzYuMDcxIC0yNjcuODY3IDI2NC4xNzFDLTIzMi4xMDQgMjkyLjI3NiAtMTgwLjM4NiAzMTcuNTYzIC0xMTYuNTIyIDMzOC43OTFDMTEuMjEyMiAzODEuMjQ4IDE4Ny42NDMgNDA3LjUgMzgyLjUgNDA3LjVaIiBmaWxsPSIjM0IzOTNDIiBzdHJva2U9ImJsYWNrIi8+Cjwvc3ZnPgo=");
540
543
  background-position: center -200px;
541
544
  background-repeat: no-repeat;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, reactive, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, createStaticVNode, createCommentVNode, renderSlot, createVNode, ref, onMounted, unref, watch, computed, normalizeStyle, withDirectives, vShow } from 'vue';
2
- import Taro, { useDidShow, usePageScroll, usePullDownRefresh, useReachBottom } from '@tarojs/taro';
2
+ import Taro, { useDidShow } from '@tarojs/taro';
3
3
  import { Grid, GridItem, Button, Checkbox, Popup, OverLay, DatePicker } from '@nutui/nutui-taro';
4
4
  import dayjs from 'dayjs';
5
5
 
@@ -109,11 +109,11 @@ function requestPayment$2(json) {
109
109
 
110
110
  function useSafeArea() {
111
111
  const systemInfo = Taro.getSystemInfoSync(), capsule = Taro.getMenuButtonBoundingClientRect();
112
- const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2;
112
+ const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2, safeAreaBottom = systemInfo.safeArea?.bottom || 0, bottom = systemInfo.screenHeight - safeAreaBottom;
113
113
  return {
114
114
  status,
115
115
  nav,
116
- bottom: systemInfo.safeArea?.bottom || 0
116
+ bottom
117
117
  };
118
118
  }
119
119
 
@@ -906,6 +906,9 @@ const _hoisted_14$1 = [
906
906
  ];
907
907
  var script$7 = /* @__PURE__ */ defineComponent({
908
908
  __name: "BalanceCard",
909
+ props: {
910
+ app: { type: String, required: true, default: "" }
911
+ },
909
912
  emits: [
910
913
  /**
911
914
  * 跳账户详情
@@ -917,6 +920,7 @@ var script$7 = /* @__PURE__ */ defineComponent({
917
920
  "recharge"
918
921
  ],
919
922
  setup(__props, { emit: __emit }) {
923
+ const props = __props;
920
924
  const balance = ref({
921
925
  total: 0,
922
926
  privileges: []
@@ -926,7 +930,9 @@ var script$7 = /* @__PURE__ */ defineComponent({
926
930
  };
927
931
  async function loadBalance() {
928
932
  const $http = useHttp();
929
- $http.get(endpoints.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {}).then((data) => {
933
+ $http.get(endpoints.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {
934
+ app: props.app
935
+ }).then((data) => {
930
936
  balance.value = data;
931
937
  });
932
938
  }
@@ -1416,19 +1422,20 @@ var script$2 = /* @__PURE__ */ defineComponent({
1416
1422
 
1417
1423
  script$2.__file = "src/balance/components/SecondBalance.vue";
1418
1424
 
1419
- const _hoisted_1$1 = /* @__PURE__ */ createElementVNode(
1425
+ const _hoisted_1$1 = { class: "scroll-content" };
1426
+ const _hoisted_2$1 = /* @__PURE__ */ createElementVNode(
1420
1427
  "label",
1421
1428
  null,
1422
1429
  "\u5C0F\u4E91\u8C46\u4F59\u989D",
1423
1430
  -1
1424
1431
  /* HOISTED */
1425
1432
  );
1426
- const _hoisted_2$1 = [
1427
- _hoisted_1$1
1433
+ const _hoisted_3$1 = [
1434
+ _hoisted_2$1
1428
1435
  ];
1429
- const _hoisted_3$1 = { class: "balance" };
1430
- const _hoisted_4$1 = { class: "bean-box spa-between" };
1431
- const _hoisted_5$1 = /* @__PURE__ */ createElementVNode(
1436
+ const _hoisted_4$1 = { class: "balance" };
1437
+ const _hoisted_5$1 = { class: "bean-box spa-between" };
1438
+ const _hoisted_6 = /* @__PURE__ */ createElementVNode(
1432
1439
  "div",
1433
1440
  { class: "bean-img" },
1434
1441
  [
@@ -1441,18 +1448,18 @@ const _hoisted_5$1 = /* @__PURE__ */ createElementVNode(
1441
1448
  -1
1442
1449
  /* HOISTED */
1443
1450
  );
1444
- const _hoisted_6 = { class: "bean-counts spa-between" };
1445
- const _hoisted_7 = { class: "counts number" };
1446
- const _hoisted_8 = { class: "search-time" };
1447
- const _hoisted_9 = /* @__PURE__ */ createElementVNode(
1451
+ const _hoisted_7 = { class: "bean-counts spa-between" };
1452
+ const _hoisted_8 = { class: "counts number" };
1453
+ const _hoisted_9 = { class: "search-time" };
1454
+ const _hoisted_10 = /* @__PURE__ */ createElementVNode(
1448
1455
  "div",
1449
1456
  { class: "title" },
1450
1457
  "\u6536\u652F\u660E\u7EC6",
1451
1458
  -1
1452
1459
  /* HOISTED */
1453
1460
  );
1454
- const _hoisted_10 = { class: "text number" };
1455
- const _hoisted_11 = /* @__PURE__ */ createElementVNode(
1461
+ const _hoisted_11 = { class: "text number" };
1462
+ const _hoisted_12 = /* @__PURE__ */ createElementVNode(
1456
1463
  "img",
1457
1464
  {
1458
1465
  style: { "margin-top": "-2px" },
@@ -1463,14 +1470,14 @@ const _hoisted_11 = /* @__PURE__ */ createElementVNode(
1463
1470
  -1
1464
1471
  /* HOISTED */
1465
1472
  );
1466
- const _hoisted_12 = /* @__PURE__ */ createElementVNode(
1473
+ const _hoisted_13 = /* @__PURE__ */ createElementVNode(
1467
1474
  "span",
1468
1475
  { class: "text" },
1469
1476
  "\u7B5B\u9009",
1470
1477
  -1
1471
1478
  /* HOISTED */
1472
1479
  );
1473
- const _hoisted_13 = /* @__PURE__ */ createElementVNode(
1480
+ const _hoisted_14 = /* @__PURE__ */ createElementVNode(
1474
1481
  "img",
1475
1482
  {
1476
1483
  class: "time-icon",
@@ -1480,24 +1487,24 @@ const _hoisted_13 = /* @__PURE__ */ createElementVNode(
1480
1487
  -1
1481
1488
  /* HOISTED */
1482
1489
  );
1483
- const _hoisted_14 = [
1484
- _hoisted_12,
1485
- _hoisted_13
1490
+ const _hoisted_15 = [
1491
+ _hoisted_13,
1492
+ _hoisted_14
1486
1493
  ];
1487
- const _hoisted_15 = { class: "operation-list" };
1488
- const _hoisted_16 = {
1494
+ const _hoisted_16 = { class: "operation-list" };
1495
+ const _hoisted_17 = {
1489
1496
  key: 0,
1490
1497
  class: "box"
1491
1498
  };
1492
- const _hoisted_17 = { class: "title number" };
1493
- const _hoisted_18 = { class: "item-type" };
1494
- const _hoisted_19 = { class: "item-detail" };
1495
- const _hoisted_20 = { class: "item-info spa-between" };
1496
- const _hoisted_21 = { class: "item-info-type" };
1497
- const _hoisted_22 = { class: "item-info-title" };
1498
- const _hoisted_23 = { class: "item-info-amount number" };
1499
- const _hoisted_24 = { class: "item-detail-remark" };
1500
- const _hoisted_25 = {
1499
+ const _hoisted_18 = { class: "title number" };
1500
+ const _hoisted_19 = { class: "item-type" };
1501
+ const _hoisted_20 = { class: "item-detail" };
1502
+ const _hoisted_21 = { class: "item-info spa-between" };
1503
+ const _hoisted_22 = { class: "item-info-type" };
1504
+ const _hoisted_23 = { class: "item-info-title" };
1505
+ const _hoisted_24 = { class: "item-info-amount number" };
1506
+ const _hoisted_25 = { class: "item-detail-remark" };
1507
+ const _hoisted_26 = {
1501
1508
  key: 0,
1502
1509
  class: "box-not-text"
1503
1510
  };
@@ -1509,6 +1516,7 @@ var script$1 = /* @__PURE__ */ defineComponent({
1509
1516
  emits: ["recharge"],
1510
1517
  setup(__props, { emit: __emit }) {
1511
1518
  const safeArea = useSafeArea();
1519
+ const refreshing = ref(false);
1512
1520
  const props = __props;
1513
1521
  const emit = __emit;
1514
1522
  const filterOpen = ref(false);
@@ -1619,29 +1627,26 @@ var script$1 = /* @__PURE__ */ defineComponent({
1619
1627
  filtering.page++;
1620
1628
  loadConsumptions(true);
1621
1629
  }
1622
- const scrollY = ref(0);
1623
- usePageScroll((e) => {
1630
+ const scrolled = ref(0);
1631
+ const onScroll = (e) => {
1624
1632
  const { scrollTop } = e;
1625
- scrollY.value = scrollTop;
1626
- });
1627
- usePullDownRefresh(() => {
1628
- if (popupOpen.value) {
1629
- Taro.stopPullDownRefresh();
1630
- return;
1631
- }
1633
+ scrolled.value = scrollTop;
1634
+ };
1635
+ const onPullDownRefresh = () => {
1636
+ refreshing.value = true;
1632
1637
  loadBalance();
1633
1638
  setTimeout(() => {
1634
- Taro.stopPullDownRefresh();
1639
+ refreshing.value = false;
1635
1640
  }, 500);
1636
- });
1637
- useReachBottom(() => {
1641
+ };
1642
+ const onReachBottom = () => {
1638
1643
  if (reachedLastPage.value) {
1639
1644
  return false;
1640
1645
  }
1641
1646
  loadNextPage();
1642
- });
1643
- const popupOpen = computed(() => {
1644
- return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value;
1647
+ };
1648
+ const isAnyPopupOpen = computed(() => {
1649
+ return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value || secondBalanceOpen.value;
1645
1650
  });
1646
1651
  const secondBalanceOpen = ref(false);
1647
1652
  function onSecondBalanceButtonClick() {
@@ -1673,173 +1678,181 @@ var script$1 = /* @__PURE__ */ defineComponent({
1673
1678
  resetDateRange();
1674
1679
  });
1675
1680
  return (_ctx, _cache) => {
1681
+ const _component_scroll_view = resolveComponent("scroll-view");
1676
1682
  const _component_nut_popup = resolveComponent("nut-popup");
1677
1683
  return openBlock(), createElementBlock(
1678
1684
  Fragment,
1679
1685
  null,
1680
1686
  [
1681
- createElementVNode(
1682
- "div",
1683
- {
1684
- class: normalizeClass(["account-view", { popupOpen: popupOpen.value }])
1685
- },
1686
- [
1687
- createVNode(unref(script$b), {
1688
- "color-mode": "dark",
1689
- title: "\u6211\u7684\u8D26\u6237",
1690
- class: normalizeClass({ "with-background": scrollY.value > 0 }),
1691
- onClose: onPageHeaderClose
1692
- }, null, 8, ["class"]),
1693
- createElementVNode("div", { class: "row jusify-right" }, [
1694
- createElementVNode("div", {
1695
- class: "small-bean-button",
1696
- onClick: onSecondBalanceButtonClick
1697
- }, [..._hoisted_2$1])
1698
- ]),
1699
- createElementVNode("div", _hoisted_3$1, [
1700
- createElementVNode("div", _hoisted_4$1, [
1701
- _hoisted_5$1,
1687
+ createVNode(_component_scroll_view, {
1688
+ class: normalizeClass(["account-view", { popupOpen: isAnyPopupOpen.value }]),
1689
+ "scroll-y": !isAnyPopupOpen.value,
1690
+ "refresher-enabled": !isAnyPopupOpen.value,
1691
+ "refresher-triggered": refreshing.value,
1692
+ onScroll,
1693
+ onRefresherrefresh: onPullDownRefresh,
1694
+ "lower-threshold": 50,
1695
+ onScrolltolower: onReachBottom
1696
+ }, {
1697
+ default: withCtx(() => [
1698
+ createElementVNode("div", _hoisted_1$1, [
1699
+ createVNode(unref(script$b), {
1700
+ "color-mode": "dark",
1701
+ title: "\u6211\u7684\u8D26\u6237",
1702
+ class: normalizeClass({ "with-background": scrolled.value > 0 }),
1703
+ onClose: onPageHeaderClose
1704
+ }, null, 8, ["class"]),
1705
+ createElementVNode("div", { class: "row jusify-right" }, [
1702
1706
  createElementVNode("div", {
1703
- class: "rule",
1704
- onClick: _cache[0] || (_cache[0] = ($event) => rulesPopupOpen.value = true)
1705
- }, "\u89C4\u5219\u8BF4\u660E")
1707
+ class: "small-bean-button",
1708
+ onClick: onSecondBalanceButtonClick
1709
+ }, [..._hoisted_3$1])
1706
1710
  ]),
1707
- createElementVNode("div", _hoisted_6, [
1708
- createElementVNode(
1709
- "div",
1710
- _hoisted_7,
1711
- toDisplayString(balance.value.total || 0),
1712
- 1
1713
- /* TEXT */
1714
- ),
1715
- createElementVNode("div", {
1716
- class: "pay",
1717
- onClick: gotoRecharge
1718
- }, "\u4E91\u8C46\u5145\u503C")
1719
- ])
1720
- ]),
1721
- createElementVNode(
1722
- "div",
1723
- {
1724
- class: normalizeClass(["operation-title spa-between", { "with-shadow": scrollY.value > 0 }]),
1725
- style: normalizeStyle({ top: `${unref(safeArea).status + unref(safeArea).nav}px` })
1726
- },
1727
- [
1728
- createElementVNode("div", _hoisted_8, [
1729
- _hoisted_9,
1730
- withDirectives(createElementVNode(
1731
- "div",
1732
- {
1733
- class: "time",
1734
- onClick: openDateFilter
1735
- },
1736
- [
1737
- createElementVNode(
1738
- "div",
1739
- _hoisted_10,
1740
- toDisplayString(dateRangeDisplay.value),
1741
- 1
1742
- /* TEXT */
1743
- ),
1744
- _hoisted_11
1745
- ],
1746
- 512
1747
- /* NEED_PATCH */
1748
- ), [
1749
- [vShow, filtering.dateFrom]
1750
- ])
1711
+ createElementVNode("div", _hoisted_4$1, [
1712
+ createElementVNode("div", _hoisted_5$1, [
1713
+ _hoisted_6,
1714
+ createElementVNode("div", {
1715
+ class: "rule",
1716
+ onClick: _cache[0] || (_cache[0] = ($event) => rulesPopupOpen.value = true)
1717
+ }, "\u89C4\u5219\u8BF4\u660E")
1751
1718
  ]),
1752
- createElementVNode("div", {
1753
- class: "search",
1754
- onClick: _cache[1] || (_cache[1] = ($event) => filterOpen.value = true)
1755
- }, [..._hoisted_14])
1756
- ],
1757
- 6
1758
- /* CLASS, STYLE */
1759
- ),
1760
- createElementVNode("div", _hoisted_15, [
1761
- consumptionGroups.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_16, [
1762
- (openBlock(true), createElementBlock(
1763
- Fragment,
1764
- null,
1765
- renderList(consumptionGroups.value, (item, index) => {
1766
- return openBlock(), createElementBlock("div", {
1767
- class: "box-detail",
1768
- key: index
1769
- }, [
1770
- createElementVNode(
1771
- "div",
1772
- _hoisted_17,
1773
- toDisplayString(item.date),
1774
- 1
1775
- /* TEXT */
1776
- ),
1777
- (openBlock(true), createElementBlock(
1778
- Fragment,
1779
- null,
1780
- renderList(item.consumptions, (it, i) => {
1781
- return openBlock(), createElementBlock("div", {
1782
- class: "item",
1783
- key: i
1784
- }, [
1785
- createElementVNode(
1786
- "div",
1787
- _hoisted_18,
1788
- toDisplayString(it.\u4EA4\u6613\u7C7B\u578B),
1789
- 1
1790
- /* TEXT */
1791
- ),
1792
- createElementVNode("div", _hoisted_19, [
1719
+ createElementVNode("div", _hoisted_7, [
1720
+ createElementVNode(
1721
+ "div",
1722
+ _hoisted_8,
1723
+ toDisplayString(balance.value.total || 0),
1724
+ 1
1725
+ /* TEXT */
1726
+ ),
1727
+ createElementVNode("div", {
1728
+ class: "pay",
1729
+ onClick: gotoRecharge
1730
+ }, "\u4E91\u8C46\u5145\u503C")
1731
+ ])
1732
+ ]),
1733
+ createElementVNode(
1734
+ "div",
1735
+ {
1736
+ class: normalizeClass(["operation-title spa-between", { "with-shadow": scrolled.value > 0 }]),
1737
+ style: normalizeStyle({ top: `${unref(safeArea).status + unref(safeArea).nav}px` })
1738
+ },
1739
+ [
1740
+ createElementVNode("div", _hoisted_9, [
1741
+ _hoisted_10,
1742
+ withDirectives(createElementVNode(
1743
+ "div",
1744
+ {
1745
+ class: "time",
1746
+ onClick: openDateFilter
1747
+ },
1748
+ [
1749
+ createElementVNode(
1750
+ "div",
1751
+ _hoisted_11,
1752
+ toDisplayString(dateRangeDisplay.value),
1753
+ 1
1754
+ /* TEXT */
1755
+ ),
1756
+ _hoisted_12
1757
+ ],
1758
+ 512
1759
+ /* NEED_PATCH */
1760
+ ), [
1761
+ [vShow, filtering.dateFrom]
1762
+ ])
1763
+ ]),
1764
+ createElementVNode("div", {
1765
+ class: "search",
1766
+ onClick: _cache[1] || (_cache[1] = ($event) => filterOpen.value = true)
1767
+ }, [..._hoisted_15])
1768
+ ],
1769
+ 6
1770
+ /* CLASS, STYLE */
1771
+ ),
1772
+ createElementVNode("div", _hoisted_16, [
1773
+ consumptionGroups.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_17, [
1774
+ (openBlock(true), createElementBlock(
1775
+ Fragment,
1776
+ null,
1777
+ renderList(consumptionGroups.value, (item, index) => {
1778
+ return openBlock(), createElementBlock("div", {
1779
+ class: "box-detail",
1780
+ key: index
1781
+ }, [
1782
+ createElementVNode(
1783
+ "div",
1784
+ _hoisted_18,
1785
+ toDisplayString(item.date),
1786
+ 1
1787
+ /* TEXT */
1788
+ ),
1789
+ (openBlock(true), createElementBlock(
1790
+ Fragment,
1791
+ null,
1792
+ renderList(item.consumptions, (it, i) => {
1793
+ return openBlock(), createElementBlock("div", {
1794
+ class: "item",
1795
+ key: i
1796
+ }, [
1797
+ createElementVNode(
1798
+ "div",
1799
+ _hoisted_19,
1800
+ toDisplayString(it.\u4EA4\u6613\u7C7B\u578B),
1801
+ 1
1802
+ /* TEXT */
1803
+ ),
1793
1804
  createElementVNode("div", _hoisted_20, [
1794
- createElementVNode("div", null, [
1805
+ createElementVNode("div", _hoisted_21, [
1806
+ createElementVNode("div", null, [
1807
+ createElementVNode(
1808
+ "div",
1809
+ _hoisted_22,
1810
+ toDisplayString(it.\u8D26\u6237\u7C7B\u578B),
1811
+ 1
1812
+ /* TEXT */
1813
+ ),
1814
+ createElementVNode(
1815
+ "div",
1816
+ _hoisted_23,
1817
+ toDisplayString(it.title),
1818
+ 1
1819
+ /* TEXT */
1820
+ )
1821
+ ]),
1795
1822
  createElementVNode(
1796
1823
  "div",
1797
- _hoisted_21,
1798
- toDisplayString(it.\u8D26\u6237\u7C7B\u578B),
1799
- 1
1800
- /* TEXT */
1801
- ),
1802
- createElementVNode(
1803
- "div",
1804
- _hoisted_22,
1805
- toDisplayString(it.title),
1824
+ _hoisted_24,
1825
+ toDisplayString(it.\u6536\u5165\u8FD8\u662F\u652F\u51FA == "\u652F\u51FA" ? "-" : "+") + toDisplayString(it.amount),
1806
1826
  1
1807
1827
  /* TEXT */
1808
1828
  )
1809
1829
  ]),
1810
1830
  createElementVNode(
1811
1831
  "div",
1812
- _hoisted_23,
1813
- toDisplayString(it.\u6536\u5165\u8FD8\u662F\u652F\u51FA == "\u652F\u51FA" ? "-" : "+") + toDisplayString(it.amount),
1832
+ _hoisted_25,
1833
+ toDisplayString(it.description),
1814
1834
  1
1815
1835
  /* TEXT */
1816
1836
  )
1817
- ]),
1818
- createElementVNode(
1819
- "div",
1820
- _hoisted_24,
1821
- toDisplayString(it.description),
1822
- 1
1823
- /* TEXT */
1824
- )
1825
- ])
1826
- ]);
1827
- }),
1828
- 128
1829
- /* KEYED_FRAGMENT */
1830
- ))
1831
- ]);
1832
- }),
1833
- 128
1834
- /* KEYED_FRAGMENT */
1835
- )),
1836
- reachedLastPage.value ? (openBlock(), createElementBlock("div", _hoisted_25, "\u6CA1\u6709\u66F4\u591A\u4E86")) : createCommentVNode("v-if", true)
1837
- ])) : (openBlock(), createBlock(script$3, { key: 1 }))
1837
+ ])
1838
+ ]);
1839
+ }),
1840
+ 128
1841
+ /* KEYED_FRAGMENT */
1842
+ ))
1843
+ ]);
1844
+ }),
1845
+ 128
1846
+ /* KEYED_FRAGMENT */
1847
+ )),
1848
+ reachedLastPage.value ? (openBlock(), createElementBlock("div", _hoisted_26, "\u6CA1\u6709\u66F4\u591A\u4E86")) : createCommentVNode("v-if", true)
1849
+ ])) : (openBlock(), createBlock(script$3, { key: 1 }))
1850
+ ])
1838
1851
  ])
1839
- ],
1840
- 2
1841
- /* CLASS */
1842
- ),
1852
+ ]),
1853
+ _: 1
1854
+ /* STABLE */
1855
+ }, 8, ["class", "scroll-y", "refresher-enabled", "refresher-triggered"]),
1843
1856
  createVNode(_component_nut_popup, {
1844
1857
  "pop-class": "consumption-rules-popup",
1845
1858
  visible: rulesPopupOpen.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.0.76",
3
+ "version": "1.1.0",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -1,80 +1,90 @@
1
1
  <template>
2
- <div class="account-view" :class="{ popupOpen }">
3
- <page-header color-mode="dark" title="我的账户"
4
- :class="{'with-background': scrollY > 0}"
5
- @close="onPageHeaderClose" />
6
- <div class="row jusify-right">
7
- <div class="small-bean-button" @click="onSecondBalanceButtonClick">
8
- <label>小云豆余额</label>
9
- </div>
10
- </div>
11
- <div class="balance">
12
- <div class="bean-box spa-between">
13
- <div class="bean-img">
14
- <img
15
- class="bean-icon"
16
- src="https://cdn.ddjf.com/static/images/bpms-workBench/gold-bean.png" />
17
- <div class="bean-tag tag">云豆</div>
2
+ <scroll-view class="account-view"
3
+ :class="{ popupOpen: isAnyPopupOpen }"
4
+ :scroll-y="!isAnyPopupOpen"
5
+ :refresher-enabled="!isAnyPopupOpen"
6
+ :refresher-triggered="refreshing"
7
+ @scroll="onScroll"
8
+ @refresherrefresh="onPullDownRefresh"
9
+ :lower-threshold="50"
10
+ @scrolltolower="onReachBottom">
11
+ <div class="scroll-content">
12
+ <page-header color-mode="dark" title="我的账户"
13
+ :class="{'with-background': scrolled > 0}"
14
+ @close="onPageHeaderClose" />
15
+ <div class="row jusify-right">
16
+ <div class="small-bean-button" @click="onSecondBalanceButtonClick">
17
+ <label>小云豆余额</label>
18
18
  </div>
19
- <div class="rule" @click="rulesPopupOpen = true">规则说明</div>
20
19
  </div>
21
- <div class="bean-counts spa-between">
22
- <div class="counts number">{{ balance.total || 0 }}</div>
23
- <div class="pay" @click="gotoRecharge">云豆充值</div>
20
+ <div class="balance">
21
+ <div class="bean-box spa-between">
22
+ <div class="bean-img">
23
+ <img
24
+ class="bean-icon"
25
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/gold-bean.png" />
26
+ <div class="bean-tag tag">云豆</div>
27
+ </div>
28
+ <div class="rule" @click="rulesPopupOpen = true">规则说明</div>
29
+ </div>
30
+ <div class="bean-counts spa-between">
31
+ <div class="counts number">{{ balance.total || 0 }}</div>
32
+ <div class="pay" @click="gotoRecharge">云豆充值</div>
33
+ </div>
24
34
  </div>
25
- </div>
26
- <div class="operation-title spa-between"
27
- :class="{'with-shadow': scrollY > 0}"
28
- :style="{top: `${safeArea.status + safeArea.nav}px`}">
29
- <div class="search-time">
30
- <div class="title">收支明细</div>
31
- <div class="time" @click="openDateFilter" v-show="filtering.dateFrom">
32
- <div class="text number">{{ dateRangeDisplay }}</div>
35
+ <div class="operation-title spa-between"
36
+ :class="{'with-shadow': scrolled > 0}"
37
+ :style="{top: `${safeArea.status + safeArea.nav}px`}">
38
+ <div class="search-time">
39
+ <div class="title">收支明细</div>
40
+ <div class="time" @click="openDateFilter" v-show="filtering.dateFrom">
41
+ <div class="text number">{{ dateRangeDisplay }}</div>
42
+ <img
43
+ style="margin-top: -2px"
44
+ class="time-icon"
45
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-down.png" />
46
+ </div>
47
+ </div>
48
+ <div class="search" @click="filterOpen = true">
49
+ <span class="text">筛选</span>
33
50
  <img
34
- style="margin-top: -2px"
35
51
  class="time-icon"
36
- src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-down.png" />
52
+ src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-select-icon.png" />
37
53
  </div>
38
54
  </div>
39
- <div class="search" @click="filterOpen = true">
40
- <span class="text">筛选</span>
41
- <img
42
- class="time-icon"
43
- src="https://cdn.ddjf.com/static/images/bpms-workBench/clound-bean-select-icon.png" />
44
- </div>
45
- </div>
46
- <div class="operation-list">
47
- <div class="box" v-if="consumptionGroups.length > 0">
48
- <div class="box-detail" v-for="(item, index) in consumptionGroups" :key="index">
49
- <div class="title number">{{ item.date }}</div>
50
- <div
51
- class="item"
52
- v-for="(it, i) in item.consumptions"
53
- :key="i">
54
- <div class="item-type">
55
- {{ it.交易类型 }}
56
- </div>
57
- <div class="item-detail">
58
- <div class="item-info spa-between">
59
- <div>
60
- <div class="item-info-type">
61
- {{ it.账户类型 }}
55
+ <div class="operation-list">
56
+ <div class="box" v-if="consumptionGroups.length > 0">
57
+ <div class="box-detail" v-for="(item, index) in consumptionGroups" :key="index">
58
+ <div class="title number">{{ item.date }}</div>
59
+ <div
60
+ class="item"
61
+ v-for="(it, i) in item.consumptions"
62
+ :key="i">
63
+ <div class="item-type">
64
+ {{ it.交易类型 }}
65
+ </div>
66
+ <div class="item-detail">
67
+ <div class="item-info spa-between">
68
+ <div>
69
+ <div class="item-info-type">
70
+ {{ it.账户类型 }}
71
+ </div>
72
+ <div class="item-info-title">{{ it.title }}</div>
73
+ </div>
74
+ <div class="item-info-amount number">
75
+ {{ it.收入还是支出 == '支出' ? '-' : '+' }}{{ it.amount }}
62
76
  </div>
63
- <div class="item-info-title">{{ it.title }}</div>
64
- </div>
65
- <div class="item-info-amount number">
66
- {{ it.收入还是支出 == '支出' ? '-' : '+' }}{{ it.amount }}
67
77
  </div>
78
+ <div class="item-detail-remark">{{ it.description }}</div>
68
79
  </div>
69
- <div class="item-detail-remark">{{ it.description }}</div>
70
80
  </div>
71
81
  </div>
82
+ <div class="box-not-text" v-if="reachedLastPage">没有更多了</div>
72
83
  </div>
73
- <div class="box-not-text" v-if="reachedLastPage">没有更多了</div>
84
+ <empty-view v-else></empty-view>
74
85
  </div>
75
- <empty-view v-else></empty-view>
76
86
  </div>
77
- </div>
87
+ </scroll-view>
78
88
  <nut-popup
79
89
  pop-class="consumption-rules-popup"
80
90
  v-model:visible="rulesPopupOpen"
@@ -115,7 +125,7 @@
115
125
  </template>
116
126
 
117
127
  <script lang="ts" setup>
118
- import Taro, { useDidShow, usePageScroll, usePullDownRefresh, useReachBottom } from '@tarojs/taro'
128
+ import Taro, { useDidShow } from '@tarojs/taro'
119
129
  import { computed, onMounted, reactive, ref, watch } from 'vue'
120
130
  import { endpoints, useHttp } from '../api'
121
131
  import { 账户流水筛选项, Balance, ConsumptionGroup, 账户流水 } from '../types'
@@ -130,6 +140,8 @@ import { useSafeArea } from '../../shared'
130
140
 
131
141
  const safeArea = useSafeArea()
132
142
 
143
+ const refreshing = ref(false)
144
+
133
145
  type AccountViewProps = {
134
146
  app: string
135
147
  }
@@ -242,15 +254,15 @@ async function loadConsumptions (append: boolean = false) {
242
254
  app: props.app,
243
255
  ...filtering
244
256
  }).then(response => {
245
- consumptionGroups.value = groupDataByDate(response.data)
246
- if (filtering.page >= response.totalPages) {
247
- filtering.page = response.totalPages
248
- reachedLastPage.value = true
249
- } else {
250
- reachedLastPage.value = false
251
- }
252
- Taro.hideLoading()
253
- })
257
+ consumptionGroups.value = groupDataByDate(response.data)
258
+ if (filtering.page >= response.totalPages) {
259
+ filtering.page = response.totalPages
260
+ reachedLastPage.value = true
261
+ } else {
262
+ reachedLastPage.value = false
263
+ }
264
+ Taro.hideLoading()
265
+ })
254
266
  }
255
267
 
256
268
  /**
@@ -290,38 +302,49 @@ function loadNextPage () {
290
302
  loadConsumptions(true)
291
303
  }
292
304
 
305
+ // 以下这一大段处理下拉刷新、上滑分页以及弹窗与页面滑动的逻辑
306
+ const scrolled = ref<number>(0)
293
307
 
294
- const scrollY = ref<number>(0)
295
- usePageScroll((e) => {
308
+ /**
309
+ * 记录 scroll-view 滚动的位置
310
+ */
311
+ const onScroll = (e) => {
296
312
  const { scrollTop } = e
297
- scrollY.value = scrollTop
298
- })
299
-
300
- usePullDownRefresh(() => {
301
- if (popupOpen.value) {
302
- Taro.stopPullDownRefresh()
303
- return
304
- }
313
+ scrolled.value = scrollTop
314
+ }
305
315
 
306
- // 页面下拉刷新
316
+ /**
317
+ * 下拉刷新 pull down refresh
318
+ */
319
+ const onPullDownRefresh = () => {
320
+ refreshing.value = true
321
+ // 重新请求余额数据
307
322
  loadBalance()
308
323
  setTimeout(() => {
309
- Taro.stopPullDownRefresh()
324
+ refreshing.value = false
310
325
  }, 500);
311
- })
326
+ }
312
327
 
313
328
  /**
314
329
  * 滑动到底部请求下一页并合并查询结果
315
330
  */
316
- useReachBottom(() => {
331
+ const onReachBottom = () => {
317
332
  if (reachedLastPage.value) {
318
333
  return false
319
334
  }
320
335
  loadNextPage()
321
- })
336
+ }
322
337
 
323
- const popupOpen = computed(() => {
324
- return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value
338
+ /**
339
+ * 浮窗弹出时不允许
340
+ * 1. 下拉刷新
341
+ * 2. 上滑分页
342
+ */
343
+ const isAnyPopupOpen = computed(() => {
344
+ return rulesPopupOpen.value ||
345
+ datePickerOpen.value ||
346
+ filterOpen.value ||
347
+ secondBalanceOpen.value
325
348
  })
326
349
 
327
350
  const secondBalanceOpen = ref<boolean>(false)
@@ -367,9 +390,12 @@ onMounted(() => {
367
390
 
368
391
  <style lang="scss">
369
392
  .account-view {
370
- background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzUwIiBoZWlnaHQ9IjQwNiIgdmlld0JveD0iMCAwIDc1MCA0MDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0zODIuNSA0MDcuNUM1NzcuMzU3IDQwNy41IDc1My43ODggMzgxLjI0OCA4ODEuNTIxIDMzOC43OTFDOTQ1LjM4NiAzMTcuNTYzIDk5Ny4xMDQgMjkyLjI3NiAxMDMyLjg3IDI2NC4xNzFDMTA2OC42MiAyMzYuMDcxIDEwODguNSAyMDUuMDk3IDEwODguNSAxNzIuNUMxMDg4LjUgMTM5LjkwMyAxMDY4LjYyIDEwOC45MjkgMTAzMi44NyA4MC44Mjg5Qzk5Ny4xMDQgNTIuNzI0NSA5NDUuMzg2IDI3LjQzNjcgODgxLjUyMSA2LjIwODk4Qzc1My43ODggLTM2LjI0ODIgNTc3LjM1NyAtNjIuNSAzODIuNSAtNjIuNUMxODcuNjQzIC02Mi41IDExLjIxMjIgLTM2LjI0ODIgLTExNi41MjIgNi4yMDg5OEMtMTgwLjM4NiAyNy40MzY3IC0yMzIuMTA0IDUyLjcyNDUgLTI2Ny44NjcgODAuODI4OUMtMzAzLjYyNCAxMDguOTI5IC0zMjMuNSAxMzkuOTAzIC0zMjMuNSAxNzIuNUMtMzIzLjUgMjA1LjA5NyAtMzAzLjYyNCAyMzYuMDcxIC0yNjcuODY3IDI2NC4xNzFDLTIzMi4xMDQgMjkyLjI3NiAtMTgwLjM4NiAzMTcuNTYzIC0xMTYuNTIyIDMzOC43OTFDMTEuMjEyMiAzODEuMjQ4IDE4Ny42NDMgNDA3LjUgMzgyLjUgNDA3LjVaIiBmaWxsPSIjM0IzOTNDIiBzdHJva2U9ImJsYWNrIi8+Cjwvc3ZnPgo=");
371
- background-position: center -200px;
372
- background-repeat: no-repeat;
393
+ height: 100vh;
394
+ .scroll-content {
395
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzUwIiBoZWlnaHQ9IjQwNiIgdmlld0JveD0iMCAwIDc1MCA0MDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0zODIuNSA0MDcuNUM1NzcuMzU3IDQwNy41IDc1My43ODggMzgxLjI0OCA4ODEuNTIxIDMzOC43OTFDOTQ1LjM4NiAzMTcuNTYzIDk5Ny4xMDQgMjkyLjI3NiAxMDMyLjg3IDI2NC4xNzFDMTA2OC42MiAyMzYuMDcxIDEwODguNSAyMDUuMDk3IDEwODguNSAxNzIuNUMxMDg4LjUgMTM5LjkwMyAxMDY4LjYyIDEwOC45MjkgMTAzMi44NyA4MC44Mjg5Qzk5Ny4xMDQgNTIuNzI0NSA5NDUuMzg2IDI3LjQzNjcgODgxLjUyMSA2LjIwODk4Qzc1My43ODggLTM2LjI0ODIgNTc3LjM1NyAtNjIuNSAzODIuNSAtNjIuNUMxODcuNjQzIC02Mi41IDExLjIxMjIgLTM2LjI0ODIgLTExNi41MjIgNi4yMDg5OEMtMTgwLjM4NiAyNy40MzY3IC0yMzIuMTA0IDUyLjcyNDUgLTI2Ny44NjcgODAuODI4OUMtMzAzLjYyNCAxMDguOTI5IC0zMjMuNSAxMzkuOTAzIC0zMjMuNSAxNzIuNUMtMzIzLjUgMjA1LjA5NyAtMzAzLjYyNCAyMzYuMDcxIC0yNjcuODY3IDI2NC4xNzFDLTIzMi4xMDQgMjkyLjI3NiAtMTgwLjM4NiAzMTcuNTYzIC0xMTYuNTIyIDMzOC43OTFDMTEuMjEyMiAzODEuMjQ4IDE4Ny42NDMgNDA3LjUgMzgyLjUgNDA3LjVaIiBmaWxsPSIjM0IzOTNDIiBzdHJva2U9ImJsYWNrIi8+Cjwvc3ZnPgo=");
396
+ background-position: center -200px;
397
+ background-repeat: no-repeat;
398
+ }
373
399
  .page-header {
374
400
  background-color: #3B393C;
375
401
  position: sticky;
@@ -40,6 +40,15 @@ import { endpoints, useHttp } from '../api'
40
40
  import { Balance } from '../types'
41
41
  import { useDidShow } from '@tarojs/taro'
42
42
 
43
+ type BalanceCardProps = {
44
+ app: string
45
+ }
46
+ const props = withDefaults(
47
+ defineProps<BalanceCardProps>(), {
48
+ app: ''
49
+ }
50
+ )
51
+
43
52
  const balance = ref<Balance>({
44
53
  total: 0,
45
54
  privileges: []
@@ -52,6 +61,7 @@ const gotoRecharge = () => {
52
61
  async function loadBalance () {
53
62
  const $http = useHttp()
54
63
  $http.get<Balance>(endpoints.获取余额明细, {
64
+ app: props.app
55
65
  }).then(data => {
56
66
  balance.value = data
57
67
  })
@@ -33,10 +33,12 @@ export function useSafeArea (): SafeArea {
33
33
  * 据说是胶囊上下间距
34
34
  */
35
35
  gap = capsule.top - status,
36
- nav = capsule.height + gap * 2
36
+ nav = capsule.height + gap * 2,
37
+ safeAreaBottom = systemInfo.safeArea?.bottom || 0,
38
+ bottom = systemInfo.screenHeight - safeAreaBottom
37
39
  return {
38
40
  status,
39
41
  nav,
40
- bottom: systemInfo.safeArea?.bottom || 0
42
+ bottom
41
43
  }
42
44
  }