@uxda/appkit 4.1.20 → 4.1.24
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 +21 -18
- package/dist/index.js +33 -12
- package/package.json +5 -3
- package/src/Appkit.ts +7 -0
- package/src/balance/components/DateFilter.vue +31 -9
- package/src/balance/components/DateRange.vue +5 -2
- package/src/index.ts +4 -0
- package/src/notice/components/NoticeEntry.vue +1 -1
- package/src/payment/api/index.ts +1 -1
- package/src/styles/fonts.scss +1 -1
package/dist/appkit.css
CHANGED
|
@@ -440,7 +440,7 @@ page {
|
|
|
440
440
|
--text-color-dark-mode: #eee;
|
|
441
441
|
}
|
|
442
442
|
.number {
|
|
443
|
-
font-family: 'DIN alternate', 'Roboto', sans-serif-condensed-light;
|
|
443
|
+
font-family: 'DIN alternate', 'Barlow Condensed', 'Roboto Condensed', sans-serif-condensed-light;
|
|
444
444
|
}
|
|
445
445
|
.account-card .card {
|
|
446
446
|
background: #2f2f2f;
|
|
@@ -623,14 +623,14 @@ page {
|
|
|
623
623
|
top: 11px;
|
|
624
624
|
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDIiIGhlaWdodD0iNDIiIHZpZXdCb3g9IjAgMCA0MiA0MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggb3BhY2l0eT0iMC4wMSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MSA0MUgxVjFINDFWNDFaIiBmaWxsPSIjRDhEOEQ4IiBzdHJva2U9ImJsYWNrIiBzdHJva2Utb3BhY2l0eT0iMC4wMSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIzLjM1NjEgMjAuOTk5OUwzMy45NjM3IDMxLjYwNzJDMzQuNjE0NiAzMi4yNTgxIDM0LjYxNDYgMzMuMzEzNCAzMy45NjM3IDMzLjk2NDJDMzMuMzQyNSAzNC41ODU1IDMyLjM1MjcgMzQuNjEzOCAzMS42OTc5IDM0LjA0ODlMMjAuOTk5NCAyMy4zNTY2TDEwLjM5MzUgMzMuOTY0MkM5Ljc0MjY1IDM0LjYxNTEgOC42ODczOCAzNC42MTUxIDguMDM2NSAzMy45NjQyQzcuNDE1MTkgMzMuMzQyOSA3LjM4Njk3IDMyLjM1MzIgNy45NTE3OSAzMS42OTg0TDE4LjY0MjggMjAuOTk5OUw4LjAzNjUgMTAuMzk0QzcuMzg1NjMgOS43NDMxNCA3LjM4NTYzIDguNjg3ODcgOC4wMzY1IDguMDM2OTlDOC42NTc3OSA3LjQxNTY4IDkuNjQ3NTQgNy4zODc0NiAxMC4zMDIzIDcuOTUyMjdMMjAuOTk5NCAxOC42NDMzTDMxLjYwNjcgOC4wMzY5OUMzMi4yNTc2IDcuMzg2MTIgMzMuMzEyOSA3LjM4NjEyIDMzLjk2MzcgOC4wMzY5OUMzNC41ODUgOC42NTgyOCAzNC42MTMzIDkuNjQ4MDMgMzQuMDQ4NSAxMC4zMDI4TDIzLjM1NjEgMjAuOTk5OVoiIGZpbGw9IiMxNzFBMUQiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS1vcGFjaXR5PSIwLjAxIi8+Cjwvc3ZnPgo=");
|
|
625
625
|
}
|
|
626
|
-
.
|
|
626
|
+
.appkit-date-filter {
|
|
627
627
|
height: 100%;
|
|
628
628
|
display: flex;
|
|
629
629
|
flex-direction: column;
|
|
630
630
|
width: 100%;
|
|
631
631
|
position: relative;
|
|
632
632
|
}
|
|
633
|
-
.
|
|
633
|
+
.appkit-date-filter .date-filter-header {
|
|
634
634
|
text-align: center;
|
|
635
635
|
height: 44px;
|
|
636
636
|
line-height: 44px;
|
|
@@ -638,42 +638,42 @@ page {
|
|
|
638
638
|
font-size: 17px;
|
|
639
639
|
background-color: #f5f5f5;
|
|
640
640
|
}
|
|
641
|
-
.
|
|
641
|
+
.appkit-date-filter .content {
|
|
642
642
|
flex: 1;
|
|
643
643
|
margin: 15px;
|
|
644
644
|
overflow-y: scroll;
|
|
645
645
|
color: #353535;
|
|
646
646
|
font-size: 13px;
|
|
647
647
|
}
|
|
648
|
-
.
|
|
648
|
+
.appkit-date-filter .content .title {
|
|
649
649
|
opacity: 0.6;
|
|
650
650
|
line-height: 18px;
|
|
651
651
|
}
|
|
652
|
-
.
|
|
652
|
+
.appkit-date-filter .content .info {
|
|
653
653
|
display: grid;
|
|
654
654
|
grid-template-columns: 1fr 1fr 1fr;
|
|
655
655
|
grid-gap: 10px;
|
|
656
656
|
margin: 10px 0;
|
|
657
657
|
}
|
|
658
|
-
.
|
|
658
|
+
.appkit-date-filter .content .info .item {
|
|
659
659
|
height: 30px;
|
|
660
660
|
line-height: 30px;
|
|
661
661
|
border: 1px solid #ccc;
|
|
662
662
|
border-radius: 6px;
|
|
663
663
|
text-align: center;
|
|
664
664
|
}
|
|
665
|
-
.
|
|
665
|
+
.appkit-date-filter .content .info .current {
|
|
666
666
|
border: 1px solid;
|
|
667
667
|
border-image-source: linear-gradient(180deg, rgba(239, 208, 130, 0.8) 0%, rgba(255, 185, 120, 0.8) 100%);
|
|
668
668
|
background: linear-gradient(180deg, rgba(239, 208, 130, 0.8) 0%, rgba(255, 185, 120, 0.8) 100%), linear-gradient(180deg, #fff7e3 0%, #fefde6 100%);
|
|
669
669
|
}
|
|
670
|
-
.
|
|
671
|
-
margin: 0 15px;
|
|
670
|
+
.appkit-date-filter .buttons {
|
|
671
|
+
margin: 32px 15px 0 15px;
|
|
672
672
|
display: flex;
|
|
673
673
|
justify-content: space-between;
|
|
674
674
|
align-items: center;
|
|
675
675
|
}
|
|
676
|
-
.
|
|
676
|
+
.appkit-date-filter .buttons .btn {
|
|
677
677
|
flex: 1;
|
|
678
678
|
height: 40px;
|
|
679
679
|
line-height: 40px;
|
|
@@ -684,22 +684,22 @@ page {
|
|
|
684
684
|
font-size: 16px;
|
|
685
685
|
border-radius: 6px;
|
|
686
686
|
}
|
|
687
|
-
.
|
|
687
|
+
.appkit-date-filter .buttons .confirm {
|
|
688
688
|
margin-left: 11px;
|
|
689
689
|
color: #000;
|
|
690
690
|
border: none;
|
|
691
691
|
background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
|
|
692
692
|
}
|
|
693
|
-
.
|
|
693
|
+
.appkit-date-filter .time {
|
|
694
694
|
display: flex;
|
|
695
695
|
justify-content: flex-start;
|
|
696
696
|
align-items: center;
|
|
697
697
|
margin: 10px 0 30px 0;
|
|
698
698
|
}
|
|
699
|
-
.
|
|
699
|
+
.appkit-date-filter .time .line {
|
|
700
700
|
margin: 0 8px;
|
|
701
701
|
}
|
|
702
|
-
.
|
|
702
|
+
.appkit-date-filter .time .item {
|
|
703
703
|
height: 30px;
|
|
704
704
|
line-height: 30px;
|
|
705
705
|
padding: 0 15px;
|
|
@@ -710,13 +710,16 @@ page {
|
|
|
710
710
|
background: rgba(245, 245, 245, 0.8);
|
|
711
711
|
border-radius: 6px;
|
|
712
712
|
}
|
|
713
|
-
.
|
|
713
|
+
.appkit-date-filter .time .current {
|
|
714
714
|
border: 1px solid #353535;
|
|
715
715
|
}
|
|
716
|
-
.
|
|
716
|
+
.appkit-date-filter .bottom {
|
|
717
717
|
height: 32px;
|
|
718
718
|
background: #fff;
|
|
719
719
|
}
|
|
720
|
+
.nut-overlay.date-filter-picker-overlay {
|
|
721
|
+
height: 100vh;
|
|
722
|
+
}
|
|
720
723
|
.consumption-rules .title {
|
|
721
724
|
line-height: 16px;
|
|
722
725
|
font-weight: 500;
|
|
@@ -1462,7 +1465,7 @@ page {
|
|
|
1462
1465
|
padding-left: 6px;
|
|
1463
1466
|
}
|
|
1464
1467
|
.notice-entry {
|
|
1465
|
-
position:
|
|
1468
|
+
position: absolute;
|
|
1466
1469
|
right: 0;
|
|
1467
1470
|
top: 120px;
|
|
1468
1471
|
min-width: 66px;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import '@nutui/nutui-taro/dist/packages/griditem/style/css';
|
|
|
7
7
|
import Taro, { useDidShow, useRouter } from '@tarojs/taro';
|
|
8
8
|
import '@nutui/nutui-taro/dist/packages/popup/style/css';
|
|
9
9
|
import { isIdentityCard, isMobilePhone } from 'validator';
|
|
10
|
-
import { NsForm, NsInput, NsButton, NsIcon, useNutshell } from '@uxda/nutshell/taro';
|
|
10
|
+
import { NsForm, NsInput, NsButton, NsIcon, usePopup, useNutshell } from '@uxda/nutshell/taro';
|
|
11
11
|
import debounce from 'lodash/debounce';
|
|
12
12
|
import '@nutui/nutui-taro/dist/packages/dialog/style/css';
|
|
13
13
|
import '@nutui/nutui-taro/dist/packages/datepicker/style/css';
|
|
@@ -721,6 +721,7 @@ const appKitOptions = {
|
|
|
721
721
|
tenant: () => "",
|
|
722
722
|
token: () => "",
|
|
723
723
|
tempToken: () => "",
|
|
724
|
+
tempAppcode: () => "",
|
|
724
725
|
baseUrl: () => "",
|
|
725
726
|
401() {
|
|
726
727
|
},
|
|
@@ -1268,7 +1269,7 @@ function useHttp$2() {
|
|
|
1268
1269
|
const appkitOptions = useAppKitOptions();
|
|
1269
1270
|
const headers = {
|
|
1270
1271
|
Token: appkitOptions.tempToken() || appkitOptions.token(),
|
|
1271
|
-
Appcode: appkitOptions.app(),
|
|
1272
|
+
Appcode: appkitOptions.tempAppcode() || appkitOptions.app(),
|
|
1272
1273
|
cookie: `tid=${appkitOptions.tenant()}`,
|
|
1273
1274
|
gray: appkitOptions.gray ? appkitOptions.gray() : "0"
|
|
1274
1275
|
};
|
|
@@ -2217,7 +2218,7 @@ var script$u = /* @__PURE__ */ defineComponent({
|
|
|
2217
2218
|
|
|
2218
2219
|
script$u.__file = "src/balance/components/ConsumptionFilter.vue";
|
|
2219
2220
|
|
|
2220
|
-
const _hoisted_1$p = { class: "
|
|
2221
|
+
const _hoisted_1$p = { class: "appkit-date-filter" };
|
|
2221
2222
|
const _hoisted_2$g = { class: "content" };
|
|
2222
2223
|
const _hoisted_3$b = { class: "time" };
|
|
2223
2224
|
var script$t = /* @__PURE__ */ defineComponent({
|
|
@@ -2229,7 +2230,7 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2229
2230
|
emits: ["complete", "reset"],
|
|
2230
2231
|
setup(__props, { emit: __emit }) {
|
|
2231
2232
|
const props = __props;
|
|
2232
|
-
const emit = __emit;
|
|
2233
|
+
const emit = __emit, state = usePopup();
|
|
2233
2234
|
watch(
|
|
2234
2235
|
() => `${props.from}${props.to}`,
|
|
2235
2236
|
() => {
|
|
@@ -2243,6 +2244,10 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2243
2244
|
const minDate = ref();
|
|
2244
2245
|
const maxDate = ref(/* @__PURE__ */ new Date());
|
|
2245
2246
|
const datePickerOpen = ref(false);
|
|
2247
|
+
state.beforeClose = () => {
|
|
2248
|
+
datePickerOpen.value = false;
|
|
2249
|
+
return true;
|
|
2250
|
+
};
|
|
2246
2251
|
function reset() {
|
|
2247
2252
|
emit("reset");
|
|
2248
2253
|
}
|
|
@@ -2261,6 +2266,11 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2261
2266
|
result.to = time;
|
|
2262
2267
|
}
|
|
2263
2268
|
datePickerOpen.value = false;
|
|
2269
|
+
state.couldClose = true;
|
|
2270
|
+
}
|
|
2271
|
+
function onDatePickerCancel() {
|
|
2272
|
+
datePickerOpen.value = false;
|
|
2273
|
+
state.couldClose = true;
|
|
2264
2274
|
}
|
|
2265
2275
|
function switchDateInput(shift) {
|
|
2266
2276
|
if (shift === "from") {
|
|
@@ -2273,12 +2283,13 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2273
2283
|
focusedDate.value = new Date(result[shift]);
|
|
2274
2284
|
focused.value = shift;
|
|
2275
2285
|
datePickerOpen.value = true;
|
|
2286
|
+
state.couldClose = false;
|
|
2276
2287
|
}
|
|
2277
2288
|
return (_ctx, _cache) => {
|
|
2278
2289
|
const _component_nut_date_picker = DatePicker;
|
|
2279
2290
|
const _component_nut_popup = Popup;
|
|
2280
2291
|
return openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
2281
|
-
_cache[
|
|
2292
|
+
_cache[6] || (_cache[6] = createElementVNode(
|
|
2282
2293
|
"div",
|
|
2283
2294
|
{ class: "date-filter-header" },
|
|
2284
2295
|
"\u65E5\u671F\u9009\u62E9",
|
|
@@ -2286,7 +2297,7 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2286
2297
|
/* HOISTED */
|
|
2287
2298
|
)),
|
|
2288
2299
|
createElementVNode("div", _hoisted_2$g, [
|
|
2289
|
-
_cache[
|
|
2300
|
+
_cache[5] || (_cache[5] = createElementVNode(
|
|
2290
2301
|
"div",
|
|
2291
2302
|
{ class: "title" },
|
|
2292
2303
|
"\u81EA\u5B9A\u4E49",
|
|
@@ -2304,7 +2315,7 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2304
2315
|
3
|
|
2305
2316
|
/* TEXT, CLASS */
|
|
2306
2317
|
),
|
|
2307
|
-
_cache[
|
|
2318
|
+
_cache[4] || (_cache[4] = createElementVNode(
|
|
2308
2319
|
"div",
|
|
2309
2320
|
{ class: "line" },
|
|
2310
2321
|
"-",
|
|
@@ -2333,7 +2344,7 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2333
2344
|
onClick: onOkClick
|
|
2334
2345
|
}, "\u786E\u5B9A")
|
|
2335
2346
|
]),
|
|
2336
|
-
_cache[
|
|
2347
|
+
_cache[7] || (_cache[7] = createElementVNode(
|
|
2337
2348
|
"div",
|
|
2338
2349
|
{ class: "bottom" },
|
|
2339
2350
|
null,
|
|
@@ -2342,8 +2353,10 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2342
2353
|
)),
|
|
2343
2354
|
createVNode(_component_nut_popup, {
|
|
2344
2355
|
visible: datePickerOpen.value,
|
|
2345
|
-
"onUpdate:visible": _cache[
|
|
2346
|
-
|
|
2356
|
+
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => datePickerOpen.value = $event),
|
|
2357
|
+
class: "appkit-date-filter-picker-popup",
|
|
2358
|
+
position: "bottom",
|
|
2359
|
+
"overlay-class": "appkit-date-filter-picker-overlay"
|
|
2347
2360
|
}, {
|
|
2348
2361
|
default: withCtx(() => [
|
|
2349
2362
|
createVNode(_component_nut_date_picker, {
|
|
@@ -2353,7 +2366,7 @@ var script$t = /* @__PURE__ */ defineComponent({
|
|
|
2353
2366
|
"max-date": maxDate.value,
|
|
2354
2367
|
"is-show-chinese": false,
|
|
2355
2368
|
"three-dimensional": false,
|
|
2356
|
-
onCancel:
|
|
2369
|
+
onCancel: onDatePickerCancel,
|
|
2357
2370
|
onConfirm: onDatePickerComplete
|
|
2358
2371
|
}, null, 8, ["modelValue", "min-date", "max-date"])
|
|
2359
2372
|
]),
|
|
@@ -3198,14 +3211,18 @@ var script$n = /* @__PURE__ */ defineComponent({
|
|
|
3198
3211
|
const $n = useNutshell();
|
|
3199
3212
|
const model = useModel(__props, "modelValue");
|
|
3200
3213
|
const openDateRangePicker = () => {
|
|
3214
|
+
const child = ref();
|
|
3201
3215
|
$n.sheet({
|
|
3202
3216
|
component: script$t,
|
|
3217
|
+
ref: child,
|
|
3203
3218
|
props: {
|
|
3204
3219
|
from: model.value.from,
|
|
3205
3220
|
to: model.value.to
|
|
3206
3221
|
},
|
|
3222
|
+
modal: true,
|
|
3223
|
+
// 不允许点击 overlay 关闭弹窗
|
|
3224
|
+
mask: true,
|
|
3207
3225
|
onComplete(result) {
|
|
3208
|
-
console.log("===openDateFilter complete", result);
|
|
3209
3226
|
model.value = {
|
|
3210
3227
|
from: result.from,
|
|
3211
3228
|
to: result.to
|
|
@@ -7723,6 +7740,10 @@ const $app = {
|
|
|
7723
7740
|
const appKitOptions = useAppKitOptions();
|
|
7724
7741
|
appKitOptions.tempToken = token;
|
|
7725
7742
|
},
|
|
7743
|
+
setTempAppcode: (appcode) => {
|
|
7744
|
+
const appKitOptions = useAppKitOptions();
|
|
7745
|
+
appKitOptions.tempAppcode = appcode;
|
|
7746
|
+
},
|
|
7726
7747
|
requestPayment: (options) => {
|
|
7727
7748
|
},
|
|
7728
7749
|
invokeRecharge: (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxda/appkit",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.24",
|
|
4
4
|
"description": "小程序应用开发包",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"author": "",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@babel/runtime": "^7.
|
|
23
|
+
"@babel/runtime": "^7.25.6",
|
|
24
24
|
"@nutui/auto-import-resolver": "^1.0.0",
|
|
25
25
|
"@nutui/icons-vue-taro": "^0.0.9",
|
|
26
26
|
"@nutui/nutui-taro": "^4.3.11",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@tarojs/shared": "^4.0.0",
|
|
35
35
|
"@tarojs/taro": "^4.0.0",
|
|
36
36
|
"@types/wechat-miniprogram": "^3.4.7",
|
|
37
|
-
"@uxda/nutshell": "^1.0.0",
|
|
38
37
|
"dayjs": "^1.11.10",
|
|
39
38
|
"validator": "^13.12.0",
|
|
40
39
|
"vue": "^3.5.0"
|
|
@@ -71,5 +70,8 @@
|
|
|
71
70
|
"unplugin-auto-import": "^0.18.2",
|
|
72
71
|
"unplugin-vue-components": "^0.27.3",
|
|
73
72
|
"webpack": "^5.78.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@uxda/nutshell": "^1.0.0"
|
|
74
76
|
}
|
|
75
77
|
}
|
package/src/Appkit.ts
CHANGED
|
@@ -23,6 +23,11 @@ export type AppKitOptions = {
|
|
|
23
23
|
* 由使用场景提供
|
|
24
24
|
*/
|
|
25
25
|
tempToken: () => string
|
|
26
|
+
/**
|
|
27
|
+
* 临时 appcode 获取方法
|
|
28
|
+
* 由使用场景提供
|
|
29
|
+
*/
|
|
30
|
+
tempAppcode: () => string
|
|
26
31
|
/**
|
|
27
32
|
* 调用 API 时使用的 base url
|
|
28
33
|
*/
|
|
@@ -38,6 +43,7 @@ export type AppKitOptions = {
|
|
|
38
43
|
export type DollarApp = {
|
|
39
44
|
setToken: (token: () => string) => void
|
|
40
45
|
setTempToken: (token: () => string) => void
|
|
46
|
+
setTempAppcode: (appcode: () => string) => void
|
|
41
47
|
requestPayment: (options: PaymentParams) => void
|
|
42
48
|
invokeRecharge: (options: RechargeParams) => void
|
|
43
49
|
}
|
|
@@ -50,6 +56,7 @@ const appKitOptions: AppKitOptions = {
|
|
|
50
56
|
tenant: () => '',
|
|
51
57
|
token: () => '',
|
|
52
58
|
tempToken: () => '',
|
|
59
|
+
tempAppcode: () => '',
|
|
53
60
|
baseUrl: () => '',
|
|
54
61
|
401() {},
|
|
55
62
|
gray: () => '',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="appkit-date-filter">
|
|
3
3
|
<div class="date-filter-header">日期选择</div>
|
|
4
4
|
<div class="content">
|
|
5
5
|
<div class="title">自定义</div>
|
|
@@ -22,22 +22,25 @@
|
|
|
22
22
|
<div class="btn confirm" @click="onOkClick">确定</div>
|
|
23
23
|
</div>
|
|
24
24
|
<div class="bottom"></div>
|
|
25
|
-
<nut-popup v-model:visible="datePickerOpen"
|
|
25
|
+
<nut-popup v-model:visible="datePickerOpen"
|
|
26
|
+
class="appkit-date-filter-picker-popup"
|
|
27
|
+
position="bottom"
|
|
28
|
+
overlay-class="appkit-date-filter-picker-overlay">
|
|
26
29
|
<nut-date-picker
|
|
27
30
|
v-model="focusedDate"
|
|
28
31
|
:min-date="minDate"
|
|
29
32
|
:max-date="maxDate"
|
|
30
33
|
:is-show-chinese="false"
|
|
31
34
|
:three-dimensional="false"
|
|
32
|
-
@cancel="
|
|
33
|
-
@confirm="onDatePickerComplete"
|
|
34
|
-
></nut-date-picker>
|
|
35
|
+
@cancel="onDatePickerCancel"
|
|
36
|
+
@confirm="onDatePickerComplete" />
|
|
35
37
|
</nut-popup>
|
|
36
38
|
</div>
|
|
37
39
|
</template>
|
|
38
40
|
|
|
39
41
|
<script lang="ts" setup>
|
|
40
42
|
import { reactive, ref, watch } from 'vue'
|
|
43
|
+
import { usePopup } from '@uxda/nutshell/taro'
|
|
41
44
|
|
|
42
45
|
type DateFilterProps = {
|
|
43
46
|
from: string
|
|
@@ -46,7 +49,8 @@ type DateFilterProps = {
|
|
|
46
49
|
|
|
47
50
|
const props = defineProps<DateFilterProps>()
|
|
48
51
|
|
|
49
|
-
const emit = defineEmits(['complete', 'reset'])
|
|
52
|
+
const emit = defineEmits(['complete', 'reset']),
|
|
53
|
+
state = usePopup()
|
|
50
54
|
|
|
51
55
|
watch(
|
|
52
56
|
() => `${props.from}${props.to}`,
|
|
@@ -71,6 +75,11 @@ const minDate = ref<any>()
|
|
|
71
75
|
const maxDate = ref<Date>(new Date())
|
|
72
76
|
const datePickerOpen = ref<boolean>(false)
|
|
73
77
|
|
|
78
|
+
state.beforeClose = () => {
|
|
79
|
+
datePickerOpen.value = false
|
|
80
|
+
return true
|
|
81
|
+
}
|
|
82
|
+
|
|
74
83
|
/**
|
|
75
84
|
* 日期重置
|
|
76
85
|
*/
|
|
@@ -99,6 +108,12 @@ function onDatePickerComplete({ selectedValue, selectedOptions }) {
|
|
|
99
108
|
result.to = time
|
|
100
109
|
}
|
|
101
110
|
datePickerOpen.value = false
|
|
111
|
+
state.couldClose = true
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function onDatePickerCancel () {
|
|
115
|
+
datePickerOpen.value = false
|
|
116
|
+
state.couldClose = true
|
|
102
117
|
}
|
|
103
118
|
|
|
104
119
|
/**
|
|
@@ -106,7 +121,7 @@ function onDatePickerComplete({ selectedValue, selectedOptions }) {
|
|
|
106
121
|
* 当选择开始时间大于结束时间,结束时间改为开始时间
|
|
107
122
|
* 时间选择器都要小于当前时间,结束时间的时间选择器要以开始时间为最小值,
|
|
108
123
|
*/
|
|
109
|
-
function switchDateInput(shift: string) {
|
|
124
|
+
function switchDateInput (shift: string) {
|
|
110
125
|
// 要设置一下结束时间的起始值 开始时间往前倒5年
|
|
111
126
|
if (shift === 'from') {
|
|
112
127
|
let time = result.from.split('-').map(Number)
|
|
@@ -118,10 +133,12 @@ function switchDateInput(shift: string) {
|
|
|
118
133
|
focusedDate.value = new Date(result[shift])
|
|
119
134
|
focused.value = shift
|
|
120
135
|
datePickerOpen.value = true
|
|
136
|
+
// 不允许浮窗关闭
|
|
137
|
+
state.couldClose = false
|
|
121
138
|
}
|
|
122
139
|
</script>
|
|
123
140
|
<style lang="scss">
|
|
124
|
-
.
|
|
141
|
+
.appkit-date-filter {
|
|
125
142
|
height: 100%;
|
|
126
143
|
display: flex;
|
|
127
144
|
flex-direction: column;
|
|
@@ -174,7 +191,7 @@ function switchDateInput(shift: string) {
|
|
|
174
191
|
}
|
|
175
192
|
}
|
|
176
193
|
.buttons {
|
|
177
|
-
margin: 0 15px;
|
|
194
|
+
margin: 32px 15px 0 15px;
|
|
178
195
|
display: flex;
|
|
179
196
|
justify-content: space-between;
|
|
180
197
|
align-items: center;
|
|
@@ -224,4 +241,9 @@ function switchDateInput(shift: string) {
|
|
|
224
241
|
background: #fff;
|
|
225
242
|
}
|
|
226
243
|
}
|
|
244
|
+
.nut-overlay {
|
|
245
|
+
&.date-filter-picker-overlay {
|
|
246
|
+
height: 100vh;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
227
249
|
</style>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script lang="ts" setup>
|
|
13
|
-
import { computed, PropType,
|
|
13
|
+
import { computed, PropType, ref } from 'vue'
|
|
14
14
|
import { useNutshell } from '@uxda/nutshell/taro'
|
|
15
15
|
import DateFilter from './DateFilter.vue'
|
|
16
16
|
import dayjs from 'dayjs'
|
|
@@ -32,14 +32,17 @@ const model = defineModel({
|
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
const openDateRangePicker = () => {
|
|
35
|
+
const child = ref()
|
|
35
36
|
$n.sheet({
|
|
36
37
|
component: DateFilter,
|
|
38
|
+
ref: child,
|
|
37
39
|
props: {
|
|
38
40
|
from: model.value.from,
|
|
39
41
|
to: model.value.to,
|
|
40
42
|
},
|
|
43
|
+
modal: true, // 不允许点击 overlay 关闭弹窗
|
|
44
|
+
mask: true,
|
|
41
45
|
onComplete (result: any) {
|
|
42
|
-
console.log('===openDateFilter complete', result)
|
|
43
46
|
model.value = {
|
|
44
47
|
from: result.from,
|
|
45
48
|
to: result.to
|
package/src/index.ts
CHANGED
|
@@ -48,6 +48,10 @@ const $app: DollarApp = {
|
|
|
48
48
|
const appKitOptions = useAppKitOptions()
|
|
49
49
|
appKitOptions.tempToken = token
|
|
50
50
|
},
|
|
51
|
+
setTempAppcode: (appcode: () => string) => {
|
|
52
|
+
const appKitOptions = useAppKitOptions()
|
|
53
|
+
appKitOptions.tempAppcode = appcode
|
|
54
|
+
},
|
|
51
55
|
requestPayment: (options: PaymentParams) => {},
|
|
52
56
|
invokeRecharge: (options: RechargeParams) => {},
|
|
53
57
|
}
|
package/src/payment/api/index.ts
CHANGED
|
@@ -34,7 +34,7 @@ function useHttp() {
|
|
|
34
34
|
const appkitOptions = useAppKitOptions()
|
|
35
35
|
const headers = {
|
|
36
36
|
Token: appkitOptions.tempToken() || appkitOptions.token(),
|
|
37
|
-
Appcode: appkitOptions.app(),
|
|
37
|
+
Appcode: appkitOptions.tempAppcode() || appkitOptions.app(),
|
|
38
38
|
cookie: `tid=${appkitOptions.tenant()}`,
|
|
39
39
|
gray: appkitOptions.gray ? appkitOptions.gray() : '0',
|
|
40
40
|
}
|
package/src/styles/fonts.scss
CHANGED