@uxda/appkit 1.0.70 → 1.0.72

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
@@ -476,6 +476,26 @@ page {
476
476
  margin: 0 auto;
477
477
  text-align: center;
478
478
  }
479
+ .empty-view {
480
+ display: flex;
481
+ flex-direction: column;
482
+ justify-content: center;
483
+ align-items: center;
484
+ margin-top: 80px;
485
+ }
486
+ .empty-view-image {
487
+ display: block;
488
+ font-size: 0;
489
+ width: 144px;
490
+ height: 80px;
491
+ filter: grayscale(1);
492
+ }
493
+ .empty-view-text {
494
+ opacity: 0.4;
495
+ color: #353535;
496
+ font-size: 12px;
497
+ line-height: 28px;
498
+ }
479
499
  .second-balance {
480
500
  width: 100vw;
481
501
  }
@@ -515,26 +535,6 @@ page {
515
535
  font-size: 14px;
516
536
  font-weight: 700;
517
537
  }
518
- .empty-view {
519
- display: flex;
520
- flex-direction: column;
521
- justify-content: center;
522
- align-items: center;
523
- margin-top: 80px;
524
- }
525
- .empty-view-image {
526
- display: block;
527
- font-size: 0;
528
- width: 144px;
529
- height: 80px;
530
- filter: grayscale(1);
531
- }
532
- .empty-view-text {
533
- opacity: 0.4;
534
- color: #353535;
535
- font-size: 12px;
536
- line-height: 28px;
537
- }
538
538
  .account-view {
539
539
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzUwIiBoZWlnaHQ9IjQwNiIgdmlld0JveD0iMCAwIDc1MCA0MDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0zODIuNSA0MDcuNUM1NzcuMzU3IDQwNy41IDc1My43ODggMzgxLjI0OCA4ODEuNTIxIDMzOC43OTFDOTQ1LjM4NiAzMTcuNTYzIDk5Ny4xMDQgMjkyLjI3NiAxMDMyLjg3IDI2NC4xNzFDMTA2OC42MiAyMzYuMDcxIDEwODguNSAyMDUuMDk3IDEwODguNSAxNzIuNUMxMDg4LjUgMTM5LjkwMyAxMDY4LjYyIDEwOC45MjkgMTAzMi44NyA4MC44Mjg5Qzk5Ny4xMDQgNTIuNzI0NSA5NDUuMzg2IDI3LjQzNjcgODgxLjUyMSA2LjIwODk4Qzc1My43ODggLTM2LjI0ODIgNTc3LjM1NyAtNjIuNSAzODIuNSAtNjIuNUMxODcuNjQzIC02Mi41IDExLjIxMjIgLTM2LjI0ODIgLTExNi41MjIgNi4yMDg5OEMtMTgwLjM4NiAyNy40MzY3IC0yMzIuMTA0IDUyLjcyNDUgLTI2Ny44NjcgODAuODI4OUMtMzAzLjYyNCAxMDguOTI5IC0zMjMuNSAxMzkuOTAzIC0zMjMuNSAxNzIuNUMtMzIzLjUgMjA1LjA5NyAtMzAzLjYyNCAyMzYuMDcxIC0yNjcuODY3IDI2NC4xNzFDLTIzMi4xMDQgMjkyLjI3NiAtMTgwLjM4NiAzMTcuNTYzIC0xMTYuNTIyIDMzOC43OTFDMTEuMjEyMiAzODEuMjQ4IDE4Ny42NDMgNDA3LjUgMzgyLjUgNDA3LjVaIiBmaWxsPSIjM0IzOTNDIiBzdHJva2U9ImJsYWNrIi8+Cjwvc3ZnPgo=");
540
540
  background-position: center -200px;
package/dist/index.js CHANGED
@@ -697,6 +697,9 @@ const endpointsList = {
697
697
  \u83B7\u53D6\u4F59\u989D\u660E\u7EC6: {
698
698
  path: "/ac-app/account/info/detail/app",
699
699
  // /app
700
+ translate: (data) => ({
701
+ appCode: data.app
702
+ }),
700
703
  transform(result) {
701
704
  return {
702
705
  total: result.commonAccount,
@@ -711,6 +714,7 @@ const endpointsList = {
711
714
  path: "/ac-app/account/record/detail/mobile",
712
715
  translate: (data) => {
713
716
  return {
717
+ appCode: data.app,
714
718
  accountType: positionMappingsReversed[data.\u8D26\u6237\u7C7B\u578B] || "",
715
719
  inOrOut: directionMappingsReversed[data.\u6536\u5165\u8FD8\u662F\u652F\u51FA] || "",
716
720
  changeType: typeMappingsReversed[data.\u4EA4\u6613\u7C7B\u578B] || "",
@@ -737,6 +741,9 @@ const endpointsList = {
737
741
  },
738
742
  \u83B7\u53D6\u6743\u76CA\u7C7B\u76EE: {
739
743
  path: "/ac-app/rights/item/list",
744
+ translate: (data) => ({
745
+ appCode: data.app
746
+ }),
740
747
  // translate (data: ConsumptionFiltering) {
741
748
  // // return { appCode: data.appCode }
742
749
  // },
@@ -1317,18 +1324,52 @@ var script$4 = /* @__PURE__ */ defineComponent({
1317
1324
 
1318
1325
  script$4.__file = "src/balance/components/ConsumptionRules.vue";
1319
1326
 
1320
- const _hoisted_1$3 = { class: "second-balance" };
1321
- const _hoisted_2$3 = { class: "positions" };
1327
+ const _hoisted_1$3 = { class: "empty-view" };
1328
+ const _hoisted_2$3 = /* @__PURE__ */ createElementVNode(
1329
+ "img",
1330
+ {
1331
+ class: "empty-view-image",
1332
+ src: "https://cdn.ddjf.com/static/images/nutshell/empty-data.png"
1333
+ },
1334
+ null,
1335
+ -1
1336
+ /* HOISTED */
1337
+ );
1322
1338
  const _hoisted_3$3 = /* @__PURE__ */ createElementVNode(
1339
+ "div",
1340
+ { class: "empty-view-text" },
1341
+ "\u6682\u65E0\u6570\u636E",
1342
+ -1
1343
+ /* HOISTED */
1344
+ );
1345
+ const _hoisted_4$3 = [
1346
+ _hoisted_2$3,
1347
+ _hoisted_3$3
1348
+ ];
1349
+ function render(_ctx, _cache) {
1350
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [..._hoisted_4$3]);
1351
+ }
1352
+
1353
+ const script$3 = {};
1354
+
1355
+ script$3.render = render;
1356
+ script$3.__file = "src/shared/components/EmptyView.vue";
1357
+
1358
+ const _hoisted_1$2 = { class: "second-balance" };
1359
+ const _hoisted_2$2 = {
1360
+ key: 0,
1361
+ class: "positions"
1362
+ };
1363
+ const _hoisted_3$2 = /* @__PURE__ */ createElementVNode(
1323
1364
  "div",
1324
1365
  { class: "icon" },
1325
1366
  null,
1326
1367
  -1
1327
1368
  /* HOISTED */
1328
1369
  );
1329
- const _hoisted_4$3 = { class: "title" };
1370
+ const _hoisted_4$2 = { class: "title" };
1330
1371
  const _hoisted_5$2 = { class: "number amount" };
1331
- var script$3 = /* @__PURE__ */ defineComponent({
1372
+ var script$2 = /* @__PURE__ */ defineComponent({
1332
1373
  __name: "SecondBalance",
1333
1374
  props: {
1334
1375
  data: { type: Array, required: true, default: () => [] }
@@ -1336,9 +1377,9 @@ var script$3 = /* @__PURE__ */ defineComponent({
1336
1377
  setup(__props) {
1337
1378
  return (_ctx, _cache) => {
1338
1379
  const _component_page_header = resolveComponent("page-header");
1339
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
1380
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
1340
1381
  createVNode(_component_page_header, { title: "\u5C0F\u4E91\u8C46\u4F59\u989D" }),
1341
- createElementVNode("div", _hoisted_2$3, [
1382
+ _ctx.data.length ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
1342
1383
  (openBlock(true), createElementBlock(
1343
1384
  Fragment,
1344
1385
  null,
@@ -1347,10 +1388,10 @@ var script$3 = /* @__PURE__ */ defineComponent({
1347
1388
  class: "position",
1348
1389
  key: index
1349
1390
  }, [
1350
- _hoisted_3$3,
1391
+ _hoisted_3$2,
1351
1392
  createElementVNode(
1352
1393
  "label",
1353
- _hoisted_4$3,
1394
+ _hoisted_4$2,
1354
1395
  toDisplayString(item.title),
1355
1396
  1
1356
1397
  /* TEXT */
@@ -1367,44 +1408,13 @@ var script$3 = /* @__PURE__ */ defineComponent({
1367
1408
  128
1368
1409
  /* KEYED_FRAGMENT */
1369
1410
  ))
1370
- ])
1411
+ ])) : (openBlock(), createBlock(script$3, { key: 1 }))
1371
1412
  ]);
1372
1413
  };
1373
1414
  }
1374
1415
  });
1375
1416
 
1376
- script$3.__file = "src/balance/components/SecondBalance.vue";
1377
-
1378
- const _hoisted_1$2 = { class: "empty-view" };
1379
- const _hoisted_2$2 = /* @__PURE__ */ createElementVNode(
1380
- "img",
1381
- {
1382
- class: "empty-view-image",
1383
- src: "https://cdn.ddjf.com/static/images/nutshell/empty-data.png"
1384
- },
1385
- null,
1386
- -1
1387
- /* HOISTED */
1388
- );
1389
- const _hoisted_3$2 = /* @__PURE__ */ createElementVNode(
1390
- "div",
1391
- { class: "empty-view-text" },
1392
- "\u6682\u65E0\u6570\u636E",
1393
- -1
1394
- /* HOISTED */
1395
- );
1396
- const _hoisted_4$2 = [
1397
- _hoisted_2$2,
1398
- _hoisted_3$2
1399
- ];
1400
- function render(_ctx, _cache) {
1401
- return openBlock(), createElementBlock("div", _hoisted_1$2, [..._hoisted_4$2]);
1402
- }
1403
-
1404
- const script$2 = {};
1405
-
1406
- script$2.render = render;
1407
- script$2.__file = "src/shared/components/EmptyView.vue";
1417
+ script$2.__file = "src/balance/components/SecondBalance.vue";
1408
1418
 
1409
1419
  const _hoisted_1$1 = /* @__PURE__ */ createElementVNode(
1410
1420
  "label",
@@ -1493,9 +1503,13 @@ const _hoisted_25 = {
1493
1503
  };
1494
1504
  var script$1 = /* @__PURE__ */ defineComponent({
1495
1505
  __name: "AccountView",
1506
+ props: {
1507
+ app: { type: String, required: true }
1508
+ },
1496
1509
  emits: ["recharge"],
1497
1510
  setup(__props, { emit: __emit }) {
1498
1511
  const safeArea = useSafeArea();
1512
+ const props = __props;
1499
1513
  const emit = __emit;
1500
1514
  const filterOpen = ref(false);
1501
1515
  const rulesPopupOpen = ref(false);
@@ -1562,7 +1576,10 @@ var script$1 = /* @__PURE__ */ defineComponent({
1562
1576
  title: `\u52A0\u8F7D\u4E2D...`,
1563
1577
  mask: true
1564
1578
  });
1565
- $http.get(endpoints.\u83B7\u53D6\u8D26\u6237\u6D41\u6C34, filtering).then((response) => {
1579
+ $http.get(endpoints.\u83B7\u53D6\u8D26\u6237\u6D41\u6C34, {
1580
+ app: props.app,
1581
+ ...filtering
1582
+ }).then((response) => {
1566
1583
  consumptionGroups.value = groupDataByDate(response.data);
1567
1584
  if (filtering.page >= response.totalPages) {
1568
1585
  filtering.page = response.totalPages;
@@ -1575,7 +1592,9 @@ var script$1 = /* @__PURE__ */ defineComponent({
1575
1592
  }
1576
1593
  async function loadBalance() {
1577
1594
  const $http = useHttp();
1578
- $http.get(endpoints.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {}).then((data) => {
1595
+ $http.get(endpoints.\u83B7\u53D6\u4F59\u989D\u660E\u7EC6, {
1596
+ app: props.app
1597
+ }).then((data) => {
1579
1598
  balance.value = data;
1580
1599
  });
1581
1600
  }
@@ -1628,6 +1647,16 @@ var script$1 = /* @__PURE__ */ defineComponent({
1628
1647
  function onSecondBalanceButtonClick() {
1629
1648
  secondBalanceOpen.value = true;
1630
1649
  }
1650
+ watch(secondBalanceOpen, () => {
1651
+ Taro.setNavigationBarColor({
1652
+ frontColor: secondBalanceOpen.value ? "#000000" : "#ffffff",
1653
+ backgroundColor: "#ffffff",
1654
+ animation: {
1655
+ duration: 400,
1656
+ timingFunc: "easeIn"
1657
+ }
1658
+ });
1659
+ });
1631
1660
  function onDateReset() {
1632
1661
  resetDateRange();
1633
1662
  }
@@ -1799,7 +1828,7 @@ var script$1 = /* @__PURE__ */ defineComponent({
1799
1828
  /* KEYED_FRAGMENT */
1800
1829
  )),
1801
1830
  reachedLastPage.value ? (openBlock(), createElementBlock("div", _hoisted_25, "\u6CA1\u6709\u66F4\u591A\u4E86")) : createCommentVNode("v-if", true)
1802
- ])) : (openBlock(), createBlock(script$2, { key: 1 }))
1831
+ ])) : (openBlock(), createBlock(script$3, { key: 1 }))
1803
1832
  ])
1804
1833
  ],
1805
1834
  2
@@ -1867,7 +1896,7 @@ var script$1 = /* @__PURE__ */ defineComponent({
1867
1896
  title: "\u5C0F\u4E91\u8C46\u4F59\u989D"
1868
1897
  }, {
1869
1898
  default: withCtx(() => [
1870
- createVNode(script$3, {
1899
+ createVNode(script$2, {
1871
1900
  data: balance.value.privileges
1872
1901
  }, null, 8, ["data"])
1873
1902
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -1,6 +1,12 @@
1
1
  import { HttpEndpoints } from '../../shared/http'
2
2
  import { 账户流水筛选项, ConsumptionType } from '../types'
3
3
 
4
+ type OnlyApp = {
5
+ app: string
6
+ }
7
+
8
+ type AndApp<T> = OnlyApp & T
9
+
4
10
  /**
5
11
  * 流水交易类型映射
6
12
  */
@@ -42,6 +48,9 @@ const directionMappingsReversed = Object.fromEntries(
42
48
  const endpointsList: HttpEndpoints = {
43
49
  获取余额明细: {
44
50
  path: '/ac-app/account/info/detail/app', // /app
51
+ translate: (data: OnlyApp) => ({
52
+ appCode: data.app
53
+ }),
45
54
  transform (result: any) {
46
55
  return {
47
56
  total: result.commonAccount,
@@ -54,8 +63,9 @@ const endpointsList: HttpEndpoints = {
54
63
  },
55
64
  获取账户流水: {
56
65
  path: '/ac-app/account/record/detail/mobile',
57
- translate: (data: 账户流水筛选项) => {
66
+ translate: (data: AndApp<账户流水筛选项>) => {
58
67
  return {
68
+ appCode: data.app,
59
69
  accountType: positionMappingsReversed[data.账户类型] || '',
60
70
  inOrOut: directionMappingsReversed[data.收入还是支出] || '',
61
71
  changeType: typeMappingsReversed[data.交易类型] || '',
@@ -81,6 +91,9 @@ const endpointsList: HttpEndpoints = {
81
91
  },
82
92
  获取权益类目: {
83
93
  path: '/ac-app/rights/item/list',
94
+ translate: (data: OnlyApp) => ({
95
+ appCode: data.app
96
+ }),
84
97
  // translate (data: ConsumptionFiltering) {
85
98
  // // return { appCode: data.appCode }
86
99
  // },
@@ -115,7 +115,7 @@
115
115
 
116
116
  <script lang="ts" setup>
117
117
  import Taro, { useDidShow, usePageScroll, usePullDownRefresh, useReachBottom } from '@tarojs/taro'
118
- import { computed, onMounted, reactive, ref } from 'vue'
118
+ import { computed, onMounted, reactive, ref, watch } from 'vue'
119
119
  import { endpoints, useHttp } from '../api'
120
120
  import { 账户流水筛选项, Balance, ConsumptionGroup, 账户流水 } from '../types'
121
121
  import ConsumptionFilter from './ConsumptionFilter.vue'
@@ -128,6 +128,12 @@ import EmptyView from '../../shared/components/EmptyView.vue'
128
128
  import { useSafeArea } from '../../shared'
129
129
 
130
130
  const safeArea = useSafeArea()
131
+
132
+ type AccountViewProps = {
133
+ app: string
134
+ }
135
+ const props = defineProps<AccountViewProps>()
136
+
131
137
  const emit = defineEmits(['recharge'])
132
138
 
133
139
  const filterOpen = ref<boolean>(false)
@@ -227,7 +233,10 @@ async function loadConsumptions (append: boolean = false) {
227
233
  title: `加载中...`,
228
234
  mask: true,
229
235
  })
230
- $http.get<WithPaging<账户流水[]>>(endpoints.获取账户流水, filtering).then(response => {
236
+ $http.get<WithPaging<账户流水[]>>(endpoints.获取账户流水, {
237
+ app: props.app,
238
+ ...filtering
239
+ }).then(response => {
231
240
  consumptionGroups.value = groupDataByDate(response.data)
232
241
  if (filtering.page >= response.totalPages) {
233
242
  filtering.page = response.totalPages
@@ -245,6 +254,7 @@ async function loadConsumptions (append: boolean = false) {
245
254
  async function loadBalance() {
246
255
  const $http = useHttp()
247
256
  $http.get<Balance>(endpoints.获取余额明细, {
257
+ app: props.app,
248
258
  }).then(data => {
249
259
  balance.value = data
250
260
  })
@@ -315,6 +325,17 @@ function onSecondBalanceButtonClick () {
315
325
  secondBalanceOpen.value = true
316
326
  }
317
327
 
328
+ watch(secondBalanceOpen, () => {
329
+ Taro.setNavigationBarColor({
330
+ frontColor: secondBalanceOpen.value ? '#000000' : '#ffffff',
331
+ backgroundColor: '#ffffff',
332
+ animation: {
333
+ duration: 400,
334
+ timingFunc: 'easeIn'
335
+ }
336
+ })
337
+ })
338
+
318
339
  function onDateReset () {
319
340
  resetDateRange()
320
341
  }
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="second-balance">
3
3
  <page-header title="小云豆余额" />
4
- <div class="positions">
5
- <div class="position"
4
+ <div class="positions" v-if="data.length">
5
+ <div class="position"
6
6
  v-for="(item, index) in data"
7
7
  :key="index">
8
8
  <div class="icon"></div>
@@ -10,11 +10,13 @@
10
10
  <label class="number amount">{{ item.count }}</label>
11
11
  </div>
12
12
  </div>
13
+ <empty-view v-else />
13
14
  </div>
14
15
  </template>
15
16
 
16
17
  <script lang="ts" setup>
17
18
  import { Privilege } from '../types'
19
+ import EmptyView from '../../shared/components/EmptyView.vue'
18
20
 
19
21
  // 小云豆余额
20
22
  // 由账户页 AccountView 使用 AppDrawer 弹出