@uxda/appkit 1.0.60 → 1.0.64
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 +5 -1
- package/dist/index.js +208 -188
- package/package.json +1 -1
- package/src/Appkit.ts +7 -0
- package/src/balance/components/AccountView.vue +14 -1
- package/src/balance/components/DateFilter.vue +1 -1
- package/src/index.ts +4 -0
- package/src/payment/api/index.ts +4 -2
- package/src/shared/http/Http.ts +7 -5
package/dist/appkit.css
CHANGED
|
@@ -422,7 +422,7 @@ page {
|
|
|
422
422
|
}
|
|
423
423
|
.consumption-date-filter .time {
|
|
424
424
|
display: flex;
|
|
425
|
-
justify-content: start;
|
|
425
|
+
justify-content: flex-start;
|
|
426
426
|
align-items: center;
|
|
427
427
|
margin: 10px 0 30px 0;
|
|
428
428
|
}
|
|
@@ -477,6 +477,10 @@ page {
|
|
|
477
477
|
margin: 0 auto;
|
|
478
478
|
text-align: center;
|
|
479
479
|
}
|
|
480
|
+
.consumption-view.popupOpen {
|
|
481
|
+
height: 100vh;
|
|
482
|
+
overflow: hidden;
|
|
483
|
+
}
|
|
480
484
|
.consumption-view .spa-between {
|
|
481
485
|
padding: 0 0 0 10px;
|
|
482
486
|
display: flex;
|
package/dist/index.js
CHANGED
|
@@ -234,13 +234,13 @@ const request = (config) => {
|
|
|
234
234
|
method: config.method,
|
|
235
235
|
success(res) {
|
|
236
236
|
if (!isSuccess(res)) {
|
|
237
|
-
|
|
237
|
+
reject(`==\u63A5\u53E3\u62A5\u9519==${res.statusCode}`);
|
|
238
238
|
reject({});
|
|
239
239
|
}
|
|
240
240
|
const { data: raw } = res;
|
|
241
241
|
if (clientConfig.interceptors?.auth(raw)) {
|
|
242
242
|
clientConfig.onAuthError?.();
|
|
243
|
-
reject("
|
|
243
|
+
reject("===401===");
|
|
244
244
|
}
|
|
245
245
|
if (clientConfig.interceptors?.server(raw)) {
|
|
246
246
|
clientConfig.onServerError?.();
|
|
@@ -250,7 +250,7 @@ const request = (config) => {
|
|
|
250
250
|
if (response) {
|
|
251
251
|
resolve(clientConfig.transforms && clientConfig.transforms[config.url] ? clientConfig.transforms[config.url](response) : response);
|
|
252
252
|
} else {
|
|
253
|
-
reject({});
|
|
253
|
+
reject(`==\u63A5\u53E3\u62A5\u9519==${raw.msg}`);
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
256
|
fail(res) {
|
|
@@ -360,6 +360,7 @@ const appKitOptions = {
|
|
|
360
360
|
app: () => "",
|
|
361
361
|
tenant: () => "",
|
|
362
362
|
token: () => "",
|
|
363
|
+
tempToken: () => "",
|
|
363
364
|
baseUrl: () => "",
|
|
364
365
|
401() {
|
|
365
366
|
}
|
|
@@ -373,9 +374,10 @@ const useAppKitOptions = () => {
|
|
|
373
374
|
|
|
374
375
|
const makeHttp$1 = () => {
|
|
375
376
|
const appkitOptions = useAppKitOptions();
|
|
376
|
-
console.log("===makeHTTP===
|
|
377
|
+
console.log("===makeHTTP===tempToken:", appkitOptions.tempToken());
|
|
378
|
+
const token = appkitOptions.tempToken() || appkitOptions.token();
|
|
377
379
|
const header = {
|
|
378
|
-
Token:
|
|
380
|
+
Token: token,
|
|
379
381
|
Appcode: appkitOptions.app()
|
|
380
382
|
};
|
|
381
383
|
const $http = useHttp({
|
|
@@ -1213,12 +1215,11 @@ var script$2 = /* @__PURE__ */ defineComponent({
|
|
|
1213
1215
|
|
|
1214
1216
|
script$2.__file = "src/balance/components/ConsumptionRules.vue";
|
|
1215
1217
|
|
|
1216
|
-
const _hoisted_1$1 = { class: "
|
|
1217
|
-
const _hoisted_2$1 = { class: "
|
|
1218
|
-
const _hoisted_3$1 = { class: "
|
|
1219
|
-
const _hoisted_4$1 = { class: "
|
|
1220
|
-
const _hoisted_5$1 =
|
|
1221
|
-
const _hoisted_6 = /* @__PURE__ */ createElementVNode(
|
|
1218
|
+
const _hoisted_1$1 = { class: "header" };
|
|
1219
|
+
const _hoisted_2$1 = { class: "header_card" };
|
|
1220
|
+
const _hoisted_3$1 = { class: "clound-bean" };
|
|
1221
|
+
const _hoisted_4$1 = { class: "bean-box spa-between" };
|
|
1222
|
+
const _hoisted_5$1 = /* @__PURE__ */ createElementVNode(
|
|
1222
1223
|
"div",
|
|
1223
1224
|
{ class: "bean-img" },
|
|
1224
1225
|
[
|
|
@@ -1231,20 +1232,20 @@ const _hoisted_6 = /* @__PURE__ */ createElementVNode(
|
|
|
1231
1232
|
-1
|
|
1232
1233
|
/* HOISTED */
|
|
1233
1234
|
);
|
|
1234
|
-
const
|
|
1235
|
-
const
|
|
1236
|
-
const
|
|
1235
|
+
const _hoisted_6 = { class: "bean-counts spa-between" };
|
|
1236
|
+
const _hoisted_7 = { class: "counts number" };
|
|
1237
|
+
const _hoisted_8 = /* @__PURE__ */ createElementVNode(
|
|
1237
1238
|
"div",
|
|
1238
1239
|
{ class: "line" },
|
|
1239
1240
|
null,
|
|
1240
1241
|
-1
|
|
1241
1242
|
/* HOISTED */
|
|
1242
1243
|
);
|
|
1243
|
-
const
|
|
1244
|
+
const _hoisted_9 = {
|
|
1244
1245
|
key: 0,
|
|
1245
1246
|
class: "small-clound-bean clound-bean"
|
|
1246
1247
|
};
|
|
1247
|
-
const
|
|
1248
|
+
const _hoisted_10 = /* @__PURE__ */ createElementVNode(
|
|
1248
1249
|
"div",
|
|
1249
1250
|
{ class: "bean-box spa-between" },
|
|
1250
1251
|
[
|
|
@@ -1255,20 +1256,20 @@ const _hoisted_11 = /* @__PURE__ */ createElementVNode(
|
|
|
1255
1256
|
-1
|
|
1256
1257
|
/* HOISTED */
|
|
1257
1258
|
);
|
|
1258
|
-
const
|
|
1259
|
-
const
|
|
1260
|
-
const
|
|
1261
|
-
const
|
|
1262
|
-
const
|
|
1263
|
-
const
|
|
1259
|
+
const _hoisted_11 = { class: "bean-list" };
|
|
1260
|
+
const _hoisted_12 = { class: "counts number" };
|
|
1261
|
+
const _hoisted_13 = { class: "title" };
|
|
1262
|
+
const _hoisted_14 = { class: "operation-title spa-between" };
|
|
1263
|
+
const _hoisted_15 = { class: "search-time" };
|
|
1264
|
+
const _hoisted_16 = /* @__PURE__ */ createElementVNode(
|
|
1264
1265
|
"div",
|
|
1265
1266
|
{ class: "title" },
|
|
1266
1267
|
"\u6536\u652F\u660E\u7EC6",
|
|
1267
1268
|
-1
|
|
1268
1269
|
/* HOISTED */
|
|
1269
1270
|
);
|
|
1270
|
-
const
|
|
1271
|
-
const
|
|
1271
|
+
const _hoisted_17 = { class: "text" };
|
|
1272
|
+
const _hoisted_18 = /* @__PURE__ */ createElementVNode(
|
|
1272
1273
|
"img",
|
|
1273
1274
|
{
|
|
1274
1275
|
class: "time-icon",
|
|
@@ -1278,14 +1279,14 @@ const _hoisted_19 = /* @__PURE__ */ createElementVNode(
|
|
|
1278
1279
|
-1
|
|
1279
1280
|
/* HOISTED */
|
|
1280
1281
|
);
|
|
1281
|
-
const
|
|
1282
|
+
const _hoisted_19 = /* @__PURE__ */ createElementVNode(
|
|
1282
1283
|
"span",
|
|
1283
1284
|
{ class: "text" },
|
|
1284
1285
|
"\u7B5B\u9009",
|
|
1285
1286
|
-1
|
|
1286
1287
|
/* HOISTED */
|
|
1287
1288
|
);
|
|
1288
|
-
const
|
|
1289
|
+
const _hoisted_20 = /* @__PURE__ */ createElementVNode(
|
|
1289
1290
|
"img",
|
|
1290
1291
|
{
|
|
1291
1292
|
class: "time-icon",
|
|
@@ -1295,35 +1296,35 @@ const _hoisted_21 = /* @__PURE__ */ createElementVNode(
|
|
|
1295
1296
|
-1
|
|
1296
1297
|
/* HOISTED */
|
|
1297
1298
|
);
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
|
|
1299
|
+
const _hoisted_21 = [
|
|
1300
|
+
_hoisted_19,
|
|
1301
|
+
_hoisted_20
|
|
1301
1302
|
];
|
|
1302
|
-
const
|
|
1303
|
-
const
|
|
1303
|
+
const _hoisted_22 = { class: "operation-list" };
|
|
1304
|
+
const _hoisted_23 = {
|
|
1304
1305
|
key: 0,
|
|
1305
1306
|
class: "box"
|
|
1306
1307
|
};
|
|
1307
|
-
const
|
|
1308
|
-
const
|
|
1309
|
-
const
|
|
1310
|
-
const
|
|
1311
|
-
const
|
|
1312
|
-
const
|
|
1313
|
-
const
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1308
|
+
const _hoisted_24 = { class: "title" };
|
|
1309
|
+
const _hoisted_25 = { class: "item-type" };
|
|
1310
|
+
const _hoisted_26 = { class: "item-detail" };
|
|
1311
|
+
const _hoisted_27 = { class: "item-info spa-between" };
|
|
1312
|
+
const _hoisted_28 = { class: "item-info-type" };
|
|
1313
|
+
const _hoisted_29 = { class: "item-info-title" };
|
|
1314
|
+
const _hoisted_30 = { class: "item-info-amount number" };
|
|
1315
|
+
const _hoisted_31 = { class: "item-detail-remark" };
|
|
1316
|
+
const _hoisted_32 = /* @__PURE__ */ createElementVNode(
|
|
1316
1317
|
"div",
|
|
1317
1318
|
{ class: "box-not-text" },
|
|
1318
1319
|
"\u6CA1\u6709\u66F4\u591A\u4E86",
|
|
1319
1320
|
-1
|
|
1320
1321
|
/* HOISTED */
|
|
1321
1322
|
);
|
|
1322
|
-
const
|
|
1323
|
+
const _hoisted_33 = {
|
|
1323
1324
|
key: 1,
|
|
1324
1325
|
class: "operations-empty"
|
|
1325
1326
|
};
|
|
1326
|
-
const
|
|
1327
|
+
const _hoisted_34 = /* @__PURE__ */ createElementVNode(
|
|
1327
1328
|
"img",
|
|
1328
1329
|
{
|
|
1329
1330
|
class: "operations-empty-img",
|
|
@@ -1333,16 +1334,16 @@ const _hoisted_35 = /* @__PURE__ */ createElementVNode(
|
|
|
1333
1334
|
-1
|
|
1334
1335
|
/* HOISTED */
|
|
1335
1336
|
);
|
|
1336
|
-
const
|
|
1337
|
+
const _hoisted_35 = /* @__PURE__ */ createElementVNode(
|
|
1337
1338
|
"div",
|
|
1338
1339
|
{ class: "operations-empty-text" },
|
|
1339
1340
|
"\u6682\u65E0\u6570\u636E",
|
|
1340
1341
|
-1
|
|
1341
1342
|
/* HOISTED */
|
|
1342
1343
|
);
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
|
|
1344
|
+
const _hoisted_36 = [
|
|
1345
|
+
_hoisted_34,
|
|
1346
|
+
_hoisted_35
|
|
1346
1347
|
];
|
|
1347
1348
|
var script$1 = /* @__PURE__ */ defineComponent({
|
|
1348
1349
|
__name: "AccountView",
|
|
@@ -1426,153 +1427,173 @@ var script$1 = /* @__PURE__ */ defineComponent({
|
|
|
1426
1427
|
scrollY.value = scrollTop;
|
|
1427
1428
|
});
|
|
1428
1429
|
usePullDownRefresh(() => {
|
|
1430
|
+
if (popupOpen.value) {
|
|
1431
|
+
Taro.stopPullDownRefresh();
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1429
1434
|
loadBalance();
|
|
1430
1435
|
setTimeout(() => {
|
|
1431
1436
|
Taro.stopPullDownRefresh();
|
|
1432
1437
|
}, 500);
|
|
1433
1438
|
});
|
|
1439
|
+
const popupOpen = computed(() => {
|
|
1440
|
+
return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value;
|
|
1441
|
+
});
|
|
1434
1442
|
return (_ctx, _cache) => {
|
|
1435
1443
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
1436
1444
|
return openBlock(), createElementBlock(
|
|
1437
1445
|
Fragment,
|
|
1438
1446
|
null,
|
|
1439
1447
|
[
|
|
1440
|
-
createElementVNode(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
/* TEXT */
|
|
1458
|
-
),
|
|
1459
|
-
createElementVNode("div", {
|
|
1460
|
-
class: "pay",
|
|
1461
|
-
onClick: gotoRecharge
|
|
1462
|
-
}, "\u4E91\u8C46\u5145\u503C")
|
|
1463
|
-
])
|
|
1464
|
-
]),
|
|
1465
|
-
_hoisted_9,
|
|
1466
|
-
balance.value.privileges.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
1467
|
-
_hoisted_11,
|
|
1468
|
-
createElementVNode("div", _hoisted_12, [
|
|
1469
|
-
(openBlock(true), createElementBlock(
|
|
1470
|
-
Fragment,
|
|
1471
|
-
null,
|
|
1472
|
-
renderList(balance.value.privileges, (item) => {
|
|
1473
|
-
return openBlock(), createElementBlock("div", {
|
|
1474
|
-
key: item,
|
|
1475
|
-
class: "bean-list-item"
|
|
1476
|
-
}, [
|
|
1477
|
-
createElementVNode(
|
|
1478
|
-
"div",
|
|
1479
|
-
_hoisted_13,
|
|
1480
|
-
toDisplayString(item.amount),
|
|
1481
|
-
1
|
|
1482
|
-
/* TEXT */
|
|
1483
|
-
),
|
|
1484
|
-
createElementVNode(
|
|
1485
|
-
"div",
|
|
1486
|
-
_hoisted_14,
|
|
1487
|
-
toDisplayString(item.title),
|
|
1488
|
-
1
|
|
1489
|
-
/* TEXT */
|
|
1490
|
-
)
|
|
1491
|
-
]);
|
|
1492
|
-
}),
|
|
1493
|
-
128
|
|
1494
|
-
/* KEYED_FRAGMENT */
|
|
1495
|
-
))
|
|
1496
|
-
])
|
|
1497
|
-
])) : createCommentVNode("v-if", true)
|
|
1498
|
-
])
|
|
1499
|
-
]),
|
|
1500
|
-
createElementVNode("div", _hoisted_15, [
|
|
1501
|
-
createElementVNode("div", _hoisted_16, [
|
|
1502
|
-
_hoisted_17,
|
|
1503
|
-
withDirectives(createElementVNode(
|
|
1504
|
-
"div",
|
|
1505
|
-
{
|
|
1506
|
-
class: "time",
|
|
1507
|
-
onClick: openDateFilter
|
|
1508
|
-
},
|
|
1509
|
-
[
|
|
1510
|
-
createElementVNode(
|
|
1511
|
-
"div",
|
|
1512
|
-
_hoisted_18,
|
|
1513
|
-
toDisplayString(dataRangeDisplay.value),
|
|
1514
|
-
1
|
|
1515
|
-
/* TEXT */
|
|
1516
|
-
),
|
|
1517
|
-
_hoisted_19
|
|
1518
|
-
],
|
|
1519
|
-
512
|
|
1520
|
-
/* NEED_PATCH */
|
|
1521
|
-
), [
|
|
1522
|
-
[vShow, filtering.dateFrom]
|
|
1523
|
-
])
|
|
1524
|
-
]),
|
|
1525
|
-
createElementVNode("div", {
|
|
1526
|
-
class: "search",
|
|
1527
|
-
onClick: _cache[1] || (_cache[1] = ($event) => filterOpen.value = true)
|
|
1528
|
-
}, [..._hoisted_22])
|
|
1529
|
-
]),
|
|
1530
|
-
createElementVNode("div", _hoisted_23, [
|
|
1531
|
-
consumptionGroups.value.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
1532
|
-
(openBlock(true), createElementBlock(
|
|
1533
|
-
Fragment,
|
|
1534
|
-
null,
|
|
1535
|
-
renderList(consumptionGroups.value.list, (item, index) => {
|
|
1536
|
-
return openBlock(), createElementBlock("div", {
|
|
1537
|
-
class: "box-detail",
|
|
1538
|
-
key: index
|
|
1539
|
-
}, [
|
|
1448
|
+
createElementVNode(
|
|
1449
|
+
"div",
|
|
1450
|
+
{
|
|
1451
|
+
class: normalizeClass(["consumption-view", { popupOpen: popupOpen.value }])
|
|
1452
|
+
},
|
|
1453
|
+
[
|
|
1454
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
1455
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
1456
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
1457
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
1458
|
+
_hoisted_5$1,
|
|
1459
|
+
createElementVNode("div", {
|
|
1460
|
+
class: "rule",
|
|
1461
|
+
onClick: _cache[0] || (_cache[0] = ($event) => rulesPopupOpen.value = true)
|
|
1462
|
+
}, "\u89C4\u5219\u8BF4\u660E")
|
|
1463
|
+
]),
|
|
1464
|
+
createElementVNode("div", _hoisted_6, [
|
|
1540
1465
|
createElementVNode(
|
|
1541
1466
|
"div",
|
|
1542
|
-
|
|
1543
|
-
toDisplayString(
|
|
1467
|
+
_hoisted_7,
|
|
1468
|
+
toDisplayString(balance.value.total || 0),
|
|
1544
1469
|
1
|
|
1545
1470
|
/* TEXT */
|
|
1546
1471
|
),
|
|
1472
|
+
createElementVNode("div", {
|
|
1473
|
+
class: "pay",
|
|
1474
|
+
onClick: gotoRecharge
|
|
1475
|
+
}, "\u4E91\u8C46\u5145\u503C")
|
|
1476
|
+
])
|
|
1477
|
+
]),
|
|
1478
|
+
_hoisted_8,
|
|
1479
|
+
balance.value.privileges.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
1480
|
+
_hoisted_10,
|
|
1481
|
+
createElementVNode("div", _hoisted_11, [
|
|
1547
1482
|
(openBlock(true), createElementBlock(
|
|
1548
1483
|
Fragment,
|
|
1549
1484
|
null,
|
|
1550
|
-
renderList(
|
|
1485
|
+
renderList(balance.value.privileges, (item) => {
|
|
1551
1486
|
return openBlock(), createElementBlock("div", {
|
|
1552
|
-
|
|
1553
|
-
|
|
1487
|
+
key: item,
|
|
1488
|
+
class: "bean-list-item"
|
|
1554
1489
|
}, [
|
|
1555
1490
|
createElementVNode(
|
|
1556
1491
|
"div",
|
|
1557
|
-
|
|
1558
|
-
toDisplayString(
|
|
1492
|
+
_hoisted_12,
|
|
1493
|
+
toDisplayString(item.amount),
|
|
1559
1494
|
1
|
|
1560
1495
|
/* TEXT */
|
|
1561
1496
|
),
|
|
1562
|
-
createElementVNode(
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1497
|
+
createElementVNode(
|
|
1498
|
+
"div",
|
|
1499
|
+
_hoisted_13,
|
|
1500
|
+
toDisplayString(item.title),
|
|
1501
|
+
1
|
|
1502
|
+
/* TEXT */
|
|
1503
|
+
)
|
|
1504
|
+
]);
|
|
1505
|
+
}),
|
|
1506
|
+
128
|
|
1507
|
+
/* KEYED_FRAGMENT */
|
|
1508
|
+
))
|
|
1509
|
+
])
|
|
1510
|
+
])) : createCommentVNode("v-if", true)
|
|
1511
|
+
])
|
|
1512
|
+
]),
|
|
1513
|
+
createElementVNode("div", _hoisted_14, [
|
|
1514
|
+
createElementVNode("div", _hoisted_15, [
|
|
1515
|
+
_hoisted_16,
|
|
1516
|
+
withDirectives(createElementVNode(
|
|
1517
|
+
"div",
|
|
1518
|
+
{
|
|
1519
|
+
class: "time",
|
|
1520
|
+
onClick: openDateFilter
|
|
1521
|
+
},
|
|
1522
|
+
[
|
|
1523
|
+
createElementVNode(
|
|
1524
|
+
"div",
|
|
1525
|
+
_hoisted_17,
|
|
1526
|
+
toDisplayString(dataRangeDisplay.value),
|
|
1527
|
+
1
|
|
1528
|
+
/* TEXT */
|
|
1529
|
+
),
|
|
1530
|
+
_hoisted_18
|
|
1531
|
+
],
|
|
1532
|
+
512
|
|
1533
|
+
/* NEED_PATCH */
|
|
1534
|
+
), [
|
|
1535
|
+
[vShow, filtering.dateFrom]
|
|
1536
|
+
])
|
|
1537
|
+
]),
|
|
1538
|
+
createElementVNode("div", {
|
|
1539
|
+
class: "search",
|
|
1540
|
+
onClick: _cache[1] || (_cache[1] = ($event) => filterOpen.value = true)
|
|
1541
|
+
}, [..._hoisted_21])
|
|
1542
|
+
]),
|
|
1543
|
+
createElementVNode("div", _hoisted_22, [
|
|
1544
|
+
consumptionGroups.value.list.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
1545
|
+
(openBlock(true), createElementBlock(
|
|
1546
|
+
Fragment,
|
|
1547
|
+
null,
|
|
1548
|
+
renderList(consumptionGroups.value.list, (item, index) => {
|
|
1549
|
+
return openBlock(), createElementBlock("div", {
|
|
1550
|
+
class: "box-detail",
|
|
1551
|
+
key: index
|
|
1552
|
+
}, [
|
|
1553
|
+
createElementVNode(
|
|
1554
|
+
"div",
|
|
1555
|
+
_hoisted_24,
|
|
1556
|
+
toDisplayString(item.date),
|
|
1557
|
+
1
|
|
1558
|
+
/* TEXT */
|
|
1559
|
+
),
|
|
1560
|
+
(openBlock(true), createElementBlock(
|
|
1561
|
+
Fragment,
|
|
1562
|
+
null,
|
|
1563
|
+
renderList(item.consumptions, (it, i) => {
|
|
1564
|
+
return openBlock(), createElementBlock("div", {
|
|
1565
|
+
class: "item",
|
|
1566
|
+
key: i
|
|
1567
|
+
}, [
|
|
1568
|
+
createElementVNode(
|
|
1569
|
+
"div",
|
|
1570
|
+
_hoisted_25,
|
|
1571
|
+
toDisplayString(it.type),
|
|
1572
|
+
1
|
|
1573
|
+
/* TEXT */
|
|
1574
|
+
),
|
|
1575
|
+
createElementVNode("div", _hoisted_26, [
|
|
1576
|
+
createElementVNode("div", _hoisted_27, [
|
|
1577
|
+
createElementVNode("div", null, [
|
|
1578
|
+
createElementVNode(
|
|
1579
|
+
"div",
|
|
1580
|
+
_hoisted_28,
|
|
1581
|
+
toDisplayString(it.position),
|
|
1582
|
+
1
|
|
1583
|
+
/* TEXT */
|
|
1584
|
+
),
|
|
1585
|
+
createElementVNode(
|
|
1586
|
+
"div",
|
|
1587
|
+
_hoisted_29,
|
|
1588
|
+
toDisplayString(it.title),
|
|
1589
|
+
1
|
|
1590
|
+
/* TEXT */
|
|
1591
|
+
)
|
|
1592
|
+
]),
|
|
1572
1593
|
createElementVNode(
|
|
1573
1594
|
"div",
|
|
1574
1595
|
_hoisted_30,
|
|
1575
|
-
toDisplayString(it.
|
|
1596
|
+
toDisplayString(it.direction == "\u652F\u51FA" ? "-" : "+") + toDisplayString(it.amount),
|
|
1576
1597
|
1
|
|
1577
1598
|
/* TEXT */
|
|
1578
1599
|
)
|
|
@@ -1580,33 +1601,28 @@ var script$1 = /* @__PURE__ */ defineComponent({
|
|
|
1580
1601
|
createElementVNode(
|
|
1581
1602
|
"div",
|
|
1582
1603
|
_hoisted_31,
|
|
1583
|
-
toDisplayString(it.
|
|
1604
|
+
toDisplayString(it.description),
|
|
1584
1605
|
1
|
|
1585
1606
|
/* TEXT */
|
|
1586
1607
|
)
|
|
1587
|
-
])
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
)),
|
|
1606
|
-
_hoisted_33
|
|
1607
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_34, [..._hoisted_37]))
|
|
1608
|
-
])
|
|
1609
|
-
]),
|
|
1608
|
+
])
|
|
1609
|
+
]);
|
|
1610
|
+
}),
|
|
1611
|
+
128
|
|
1612
|
+
/* KEYED_FRAGMENT */
|
|
1613
|
+
))
|
|
1614
|
+
]);
|
|
1615
|
+
}),
|
|
1616
|
+
128
|
|
1617
|
+
/* KEYED_FRAGMENT */
|
|
1618
|
+
)),
|
|
1619
|
+
_hoisted_32
|
|
1620
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_33, [..._hoisted_36]))
|
|
1621
|
+
])
|
|
1622
|
+
],
|
|
1623
|
+
2
|
|
1624
|
+
/* CLASS */
|
|
1625
|
+
),
|
|
1610
1626
|
createVNode(_component_nut_popup, {
|
|
1611
1627
|
"pop-class": "consumption-rules-popup",
|
|
1612
1628
|
visible: rulesPopupOpen.value,
|
|
@@ -1767,6 +1783,10 @@ const $app = {
|
|
|
1767
1783
|
const appKitOptions = useAppKitOptions();
|
|
1768
1784
|
appKitOptions.token = token;
|
|
1769
1785
|
},
|
|
1786
|
+
setTempToken: (token) => {
|
|
1787
|
+
const appKitOptions = useAppKitOptions();
|
|
1788
|
+
appKitOptions.tempToken = token;
|
|
1789
|
+
},
|
|
1770
1790
|
requestPayment: (options) => {
|
|
1771
1791
|
},
|
|
1772
1792
|
invokeRecharge: (options) => {
|
package/package.json
CHANGED
package/src/Appkit.ts
CHANGED
|
@@ -18,6 +18,11 @@ export type AppKitOptions = {
|
|
|
18
18
|
* 由使用场景提供
|
|
19
19
|
*/
|
|
20
20
|
token (): string,
|
|
21
|
+
/**
|
|
22
|
+
* 临时 token 获取方法
|
|
23
|
+
* 由使用场景提供
|
|
24
|
+
*/
|
|
25
|
+
tempToken: () => string,
|
|
21
26
|
/**
|
|
22
27
|
* 调用 API 时使用的 base url
|
|
23
28
|
*/
|
|
@@ -28,6 +33,7 @@ export type AppKitOptions = {
|
|
|
28
33
|
|
|
29
34
|
export type DollarApp = {
|
|
30
35
|
setToken: (token: () => string) => void,
|
|
36
|
+
setTempToken: (token: () => string) => void,
|
|
31
37
|
requestPayment: (options: PaymentParams) => void,
|
|
32
38
|
invokeRecharge: (options: RechargeParams) => void,
|
|
33
39
|
}
|
|
@@ -39,6 +45,7 @@ const appKitOptions: AppKitOptions = {
|
|
|
39
45
|
app: () => '',
|
|
40
46
|
tenant: () => '',
|
|
41
47
|
token: () => '',
|
|
48
|
+
tempToken: () => '',
|
|
42
49
|
baseUrl: () => '',
|
|
43
50
|
401 () {}
|
|
44
51
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="consumption-view">
|
|
2
|
+
<div class="consumption-view" :class="{ popupOpen }">
|
|
3
3
|
<div class="header">
|
|
4
4
|
<div class="header_card">
|
|
5
5
|
<div class="clound-bean">
|
|
@@ -234,16 +234,29 @@ usePageScroll((e) => {
|
|
|
234
234
|
})
|
|
235
235
|
|
|
236
236
|
usePullDownRefresh(() => {
|
|
237
|
+
if (popupOpen.value) {
|
|
238
|
+
Taro.stopPullDownRefresh()
|
|
239
|
+
return
|
|
240
|
+
}
|
|
241
|
+
|
|
237
242
|
// 页面下拉刷新
|
|
238
243
|
loadBalance()
|
|
239
244
|
setTimeout(() => {
|
|
240
245
|
Taro.stopPullDownRefresh()
|
|
241
246
|
}, 500);
|
|
242
247
|
})
|
|
248
|
+
|
|
249
|
+
const popupOpen = computed(() => {
|
|
250
|
+
return rulesPopupOpen.value || datePickerOpen.value || filterOpen.value
|
|
251
|
+
})
|
|
243
252
|
</script>
|
|
244
253
|
|
|
245
254
|
<style lang="scss">
|
|
246
255
|
.consumption-view {
|
|
256
|
+
&.popupOpen {
|
|
257
|
+
height: 100vh;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
}
|
|
247
260
|
.spa-between {
|
|
248
261
|
padding: 0 0 0 10px;
|
|
249
262
|
display: flex;
|
package/src/index.ts
CHANGED
|
@@ -41,6 +41,10 @@ const $app: DollarApp = {
|
|
|
41
41
|
const appKitOptions = useAppKitOptions()
|
|
42
42
|
appKitOptions.token = token
|
|
43
43
|
},
|
|
44
|
+
setTempToken: (token: () => string) => {
|
|
45
|
+
const appKitOptions = useAppKitOptions()
|
|
46
|
+
appKitOptions.tempToken = token
|
|
47
|
+
},
|
|
44
48
|
requestPayment: (options: PaymentParams) => {},
|
|
45
49
|
invokeRecharge: (options: RechargeParams) => {}
|
|
46
50
|
}
|
package/src/payment/api/index.ts
CHANGED
|
@@ -4,9 +4,11 @@ import { useAppKitOptions } from '../../Appkit'
|
|
|
4
4
|
|
|
5
5
|
const makeHttp = () => {
|
|
6
6
|
const appkitOptions = useAppKitOptions()
|
|
7
|
-
console.log('===makeHTTP===
|
|
7
|
+
console.log('===makeHTTP===tempToken:', appkitOptions.tempToken())
|
|
8
|
+
|
|
9
|
+
const token = appkitOptions.tempToken() || appkitOptions.token()
|
|
8
10
|
const header = {
|
|
9
|
-
Token:
|
|
11
|
+
Token: token,
|
|
10
12
|
Appcode: appkitOptions.app(),
|
|
11
13
|
}
|
|
12
14
|
|
package/src/shared/http/Http.ts
CHANGED
|
@@ -59,15 +59,18 @@ const request: Http['request'] = <T>(config: HttpRequestConfig) => {
|
|
|
59
59
|
method: config.method,
|
|
60
60
|
success (res: Taro.request.SuccessCallbackResult<ResponseRaw>) {
|
|
61
61
|
if (!isSuccess(res)) {
|
|
62
|
-
|
|
62
|
+
// 拦截 statusCode
|
|
63
|
+
reject(`==接口报错==${res.statusCode}`)
|
|
63
64
|
reject({})
|
|
64
65
|
}
|
|
65
66
|
const { data: raw } = res
|
|
66
67
|
if (clientConfig.interceptors?.auth(raw)) {
|
|
68
|
+
//拦截 401
|
|
67
69
|
clientConfig.onAuthError?.()
|
|
68
|
-
reject('
|
|
70
|
+
reject('===401===')
|
|
69
71
|
}
|
|
70
72
|
if (clientConfig.interceptors?.server(raw)) {
|
|
73
|
+
// 拦截后端错误
|
|
71
74
|
clientConfig.onServerError?.()
|
|
72
75
|
reject('server error')
|
|
73
76
|
}
|
|
@@ -79,9 +82,8 @@ const request: Http['request'] = <T>(config: HttpRequestConfig) => {
|
|
|
79
82
|
? clientConfig.transforms[config.url](response) as T
|
|
80
83
|
: response as T)
|
|
81
84
|
} else {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
})
|
|
85
|
+
// 拦截业务异常
|
|
86
|
+
reject(`==接口报错==${raw.msg}`)
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
89
|
fail (res) {
|