@solar-taro/ui-vant 4.0.1 → 4.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/CHANGELOG.md +4 -0
- package/index15.js +1 -1
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +1 -1
- package/index20.js +1 -1
- package/index21.js +1 -1
- package/index6.js +40 -38
- package/index7.js +194 -179
- package/modal/index.scss +14 -0
- package/opper-controller/index.vue.d.ts +8 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index15.js
CHANGED
package/index17.js
CHANGED
package/index18.js
CHANGED
package/index19.js
CHANGED
package/index20.js
CHANGED
package/index21.js
CHANGED
package/index6.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SunButton as
|
|
3
|
-
import { onKeyboardHeightChange as
|
|
4
|
-
const
|
|
5
|
-
class: "sun-modal-extra",
|
|
6
|
-
style: { position: "absolute", top: "0", left: "16px", display: "flex", alignItems: "center", height: "48px" }
|
|
7
|
-
}, F = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "van-button-container van-button-group"
|
|
10
|
-
}, M = /* @__PURE__ */ f({
|
|
1
|
+
import { defineComponent as h, ref as p, computed as b, watch as k, onUnmounted as w, openBlock as B, createElementBlock as y, mergeProps as g, createElementVNode as v, renderSlot as x, createBlock as C, unref as N, withCtx as V, createVNode as S, createTextVNode as _, toDisplayString as $, createCommentVNode as D } from "vue";
|
|
2
|
+
import { SunButtonGroup as E, SunButton as T } from "@solar-taro/ui-sun";
|
|
3
|
+
import { onKeyboardHeightChange as H, offKeyboardHeightChange as K } from "@tarojs/taro";
|
|
4
|
+
const l = x, P = v, G = $, U = _, r = N, c = V, j = S, i = B, q = C, z = D, A = g, F = y, I = ["show", "title", "close-on-click-overlay"], J = { class: "sun-modal-extra" }, Q = /* @__PURE__ */ h({
|
|
11
5
|
__name: "index",
|
|
12
6
|
props: {
|
|
13
7
|
show: { type: Boolean },
|
|
@@ -17,42 +11,50 @@ const s = k, T = x, H = _, K = V, P = C, I = N, U = B, i = g, r = y, j = $, q =
|
|
|
17
11
|
confirmDisabled: { type: Boolean }
|
|
18
12
|
},
|
|
19
13
|
emits: ["update:show", "close", "confirm"],
|
|
20
|
-
setup(t, { emit:
|
|
21
|
-
const n =
|
|
14
|
+
setup(t, { emit: d }) {
|
|
15
|
+
const n = d, m = t, s = p(0), u = b(() => s.value === 0);
|
|
22
16
|
function a(e) {
|
|
23
|
-
|
|
17
|
+
s.value = e.height;
|
|
24
18
|
}
|
|
25
|
-
return
|
|
19
|
+
return k(() => m.show, (e) => {
|
|
26
20
|
e || n("close");
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
}), (e, o) => (i(),
|
|
21
|
+
}), H(a), w(() => {
|
|
22
|
+
K(a);
|
|
23
|
+
}), (e, o) => (i(), F("van-action-sheet", A(e.$attrs, {
|
|
24
|
+
class: "sun-modal",
|
|
30
25
|
show: t.show,
|
|
31
26
|
title: t.title,
|
|
32
|
-
"close-on-click-overlay":
|
|
33
|
-
onClose: o[1] || (o[1] = (
|
|
27
|
+
"close-on-click-overlay": u.value,
|
|
28
|
+
onClose: o[1] || (o[1] = (f) => n("update:show", !1))
|
|
34
29
|
}), [
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
P("view", J, [
|
|
31
|
+
l(e.$slots, "extra")
|
|
37
32
|
]),
|
|
38
|
-
|
|
39
|
-
t.showButtons ? (i(), r(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
l(e.$slots, "default"),
|
|
34
|
+
t.showButtons ? (i(), q(r(E), {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "sun-modal-buttons",
|
|
37
|
+
expand: "block"
|
|
38
|
+
}, {
|
|
39
|
+
default: c(() => [
|
|
40
|
+
l(e.$slots, "buttons", {}, () => [
|
|
41
|
+
j(r(T), {
|
|
42
|
+
expand: "block",
|
|
43
|
+
disabled: t.confirmDisabled,
|
|
44
|
+
onClick: o[0] || (o[0] = (f) => n("confirm"))
|
|
45
|
+
}, {
|
|
46
|
+
default: c(() => [
|
|
47
|
+
U(G(t.confirmText), 1)
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["disabled"])
|
|
51
|
+
])
|
|
52
|
+
]),
|
|
53
|
+
_: 3
|
|
54
|
+
})) : z("", !0)
|
|
55
|
+
], 16, I));
|
|
54
56
|
}
|
|
55
57
|
});
|
|
56
58
|
export {
|
|
57
|
-
|
|
59
|
+
Q as default
|
|
58
60
|
};
|
package/index7.js
CHANGED
|
@@ -1,148 +1,156 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isOpperDevice as
|
|
3
|
-
import { BluetoothLowEnergeyDevice as
|
|
4
|
-
import { checkBluetooth as
|
|
5
|
-
import { SunIcon as
|
|
6
|
-
import { useDestroyed as
|
|
7
|
-
import { getSystemInfo as
|
|
8
|
-
import { filter as
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { defineComponent as ee, useModel as te, ref as E, computed as oe, watch as ne, onUnmounted as se, vShow as ie, Fragment as le, mergeModels as F, openBlock as re, createElementBlock as ce, createVNode as ae, unref as ue, withCtx as de, createElementVNode as pe, createTextVNode as ve, toDisplayString as me, normalizeClass as fe, withDirectives as we, createBlock as he, renderList as be, normalizeStyle as ge } from "vue";
|
|
2
|
+
import { isOpperDevice as ye } from "@opper/core";
|
|
3
|
+
import { BluetoothLowEnergeyDevice as _e } from "@opper/wx";
|
|
4
|
+
import { checkBluetooth as q, bluetoothService as b, vibrator as Se, overlay as r, withLoading as De } from "@solar-taro/core";
|
|
5
|
+
import { SunIcon as ke, SunList as xe, SunItem as Ce, SunLabel as Ie, SunButton as K } from "@solar-taro/ui-sun";
|
|
6
|
+
import { useDestroyed as W, useObservable as G } from "@solar-vue/core";
|
|
7
|
+
import { getSystemInfo as Be, openSetting as Ee } from "@tarojs/taro";
|
|
8
|
+
import { filter as H, switchMap as f, combineLatest as Me, map as M, of as N, catchError as D, tap as $, timer as Ne, takeUntil as L, finalize as O, from as $e } from "rxjs";
|
|
9
|
+
import Le from "./index6.js";
|
|
10
|
+
import { dialog as Oe } from "./index10.js";
|
|
11
|
+
const s = ue, n = pe, c = me, T = ae, Te = ie, Pe = we, Re = fe, P = ve, m = re, R = ce, ze = be, Ve = le, v = de, Ae = ge, k = he, je = { class: "sun-opper-controller" }, Ue = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "sun-opper-controller-device"
|
|
14
|
+
}, Fe = { class: "sun-opper-controller-device-header" }, qe = { class: "sun-opper-controller-device-name" }, Ke = { class: "sun-opper-controller-device-infos" }, We = { class: "sun-opper-controller-device-info" }, Ge = { class: "sun-opper-controller-device-info" }, He = { class: "sun-opper-controller-device-info" }, Je = { class: "sun-opper-controller-device-info" }, Qe = { style: { marginBottom: "1px" } }, Xe = {
|
|
15
|
+
class: "small",
|
|
16
|
+
style: { color: "var(--color-secondary)" }
|
|
17
|
+
}, Ye = ["show"], at = /* @__PURE__ */ ee({
|
|
11
18
|
__name: "index",
|
|
12
|
-
props: {
|
|
13
|
-
show: { type: Boolean, default: !1 },
|
|
19
|
+
props: /* @__PURE__ */ F({
|
|
14
20
|
mac: {},
|
|
15
21
|
deviceId: {},
|
|
16
22
|
opper: {}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
}, {
|
|
24
|
+
show: { type: Boolean, default: !1 },
|
|
25
|
+
showModifiers: {}
|
|
26
|
+
}),
|
|
27
|
+
emits: /* @__PURE__ */ F(["connect", "disconnect"], ["update:show"]),
|
|
28
|
+
setup(z, { emit: J }) {
|
|
29
|
+
const w = z, g = te(z, "show"), V = J, l = w.opper, A = W(), x = W(), u = E({}), d = E(!1), C = G(() => l.connected), y = E(!1), j = oe(() => Object.values(u.value)), p = G(() => l.connected.pipe(
|
|
30
|
+
H(Boolean),
|
|
22
31
|
f(() => {
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
id:
|
|
26
|
-
name:
|
|
27
|
-
version:
|
|
32
|
+
const o = l.device;
|
|
33
|
+
return Me({
|
|
34
|
+
id: N(o.id),
|
|
35
|
+
name: o.name,
|
|
36
|
+
version: o.firmwareRevision,
|
|
28
37
|
accuracy: l.accuracyChange,
|
|
29
38
|
volt: l.batteryChange.pipe(
|
|
30
|
-
|
|
39
|
+
M(([e]) => e)
|
|
31
40
|
),
|
|
32
41
|
charging: l.batteryChange.pipe(
|
|
33
|
-
|
|
42
|
+
M(([, e]) => !!e)
|
|
34
43
|
),
|
|
35
|
-
serialNumber:
|
|
44
|
+
serialNumber: o.serialNumber
|
|
36
45
|
});
|
|
37
46
|
})
|
|
38
|
-
), {}),
|
|
47
|
+
), {}), Q = [
|
|
39
48
|
{ id: 1, name: "断开连接" },
|
|
40
49
|
{ id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
|
|
41
50
|
];
|
|
42
|
-
let
|
|
43
|
-
function
|
|
44
|
-
if (!
|
|
45
|
-
let
|
|
46
|
-
|
|
51
|
+
let I = !1;
|
|
52
|
+
function B() {
|
|
53
|
+
if (!q()) return;
|
|
54
|
+
let o = null;
|
|
55
|
+
d.value = !0, b.openAdapter().pipe(
|
|
47
56
|
D((e) => {
|
|
48
|
-
var t,
|
|
49
|
-
if ((
|
|
50
|
-
return
|
|
57
|
+
var t, a;
|
|
58
|
+
if ((a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "already"))
|
|
59
|
+
return N(null);
|
|
51
60
|
throw e;
|
|
52
61
|
}),
|
|
53
62
|
f(
|
|
54
|
-
() =>
|
|
63
|
+
() => b.startDevicesDiscovery({
|
|
55
64
|
allowDuplicatesKey: !0,
|
|
56
65
|
powerLevel: "high"
|
|
57
66
|
})
|
|
58
67
|
),
|
|
59
|
-
|
|
60
|
-
() =>
|
|
61
|
-
|
|
62
|
-
).subscribe(() =>
|
|
68
|
+
$(
|
|
69
|
+
() => Ne(0, 1250).pipe(
|
|
70
|
+
L(x)
|
|
71
|
+
).subscribe(() => Se.short())
|
|
63
72
|
),
|
|
64
|
-
f(() =>
|
|
65
|
-
|
|
66
|
-
id: t.deviceId,
|
|
73
|
+
f(() => b.devicesChange),
|
|
74
|
+
M((e) => e.filter((t) => ye({
|
|
67
75
|
name: t.name
|
|
68
76
|
}))),
|
|
69
|
-
|
|
77
|
+
L(x),
|
|
70
78
|
D((e) => {
|
|
71
|
-
var t,
|
|
79
|
+
var t, a, i;
|
|
72
80
|
throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
|
|
73
|
-
|
|
74
|
-
}) : (
|
|
81
|
+
Ee();
|
|
82
|
+
}) : (a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (i = e.errMsg) != null && i.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), h(), e;
|
|
75
83
|
}),
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
O(() => {
|
|
85
|
+
d.value = !1, u.value = {}, b.stopDevicesDiscovery().subscribe();
|
|
78
86
|
})
|
|
79
87
|
).subscribe((e) => {
|
|
80
|
-
const t =
|
|
88
|
+
const t = w.mac || w.deviceId;
|
|
81
89
|
if (t) {
|
|
82
|
-
const
|
|
83
|
-
(
|
|
84
|
-
|
|
90
|
+
const i = t.slice(-5).replace(":", ""), S = e.find(
|
|
91
|
+
(U) => U.deviceId === t || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
|
|
92
|
+
U.name.endsWith(i)
|
|
85
93
|
);
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
94
|
+
if (S)
|
|
95
|
+
return _(S.deviceId);
|
|
88
96
|
}
|
|
89
97
|
if (e.length === 1) {
|
|
90
|
-
if (
|
|
91
|
-
return
|
|
92
|
-
} else e.length > 1 && (
|
|
93
|
-
Object.keys(
|
|
94
|
-
|
|
95
|
-
}), e.forEach((
|
|
96
|
-
|
|
98
|
+
if (o != null || (o = Date.now()), Date.now() - o > 5e3)
|
|
99
|
+
return _(e[0].deviceId);
|
|
100
|
+
} else e.length > 1 && (o = null);
|
|
101
|
+
Object.keys(u.value).forEach((i) => {
|
|
102
|
+
u.value[i].recommended = !1, Date.now() - u.value[i].discoveryTime > 5e3 && delete u.value[i];
|
|
103
|
+
}), e.forEach((i) => {
|
|
104
|
+
u.value[i.deviceId] = i, i.discoveryTime = Date.now();
|
|
97
105
|
});
|
|
98
|
-
const
|
|
99
|
-
|
|
106
|
+
const a = [...Object.values(u.value)].sort((i, S) => S.RSSI - i.RSSI)[0];
|
|
107
|
+
a && (a.recommended = !0);
|
|
100
108
|
});
|
|
101
109
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
110
|
+
function h() {
|
|
111
|
+
x.next();
|
|
104
112
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
function _(o) {
|
|
114
|
+
I || (r.loading("正在连接"), I = !0, A.next(), l.connect(new _e(o)).pipe(
|
|
115
|
+
$(() => {
|
|
116
|
+
h(), V("connect", o), r.success("连接成功"), setTimeout(() => g.value = !1, 600);
|
|
109
117
|
}),
|
|
110
118
|
D((e) => {
|
|
111
119
|
throw e.errCode === 10003 ? r.tips("连接超时,请重试") : r.tips(`连接失败:${e.errCode}:${e.errMsg}`), e;
|
|
112
120
|
}),
|
|
113
|
-
|
|
114
|
-
f(() => l.connected.pipe(
|
|
121
|
+
O(() => I = !1),
|
|
122
|
+
f(() => l.connected.pipe(H((e) => !e))),
|
|
115
123
|
// 监听断开
|
|
116
|
-
|
|
124
|
+
L(A)
|
|
117
125
|
).subscribe(() => {
|
|
118
|
-
|
|
126
|
+
V("disconnect", o), r.error("连接断开");
|
|
119
127
|
}));
|
|
120
128
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
function X(o) {
|
|
130
|
+
q() && (d.value = !0, b.openAdapter().pipe(
|
|
131
|
+
O(() => {
|
|
132
|
+
d.value = !1;
|
|
125
133
|
})
|
|
126
134
|
).subscribe(() => {
|
|
127
|
-
|
|
135
|
+
_(o);
|
|
128
136
|
}));
|
|
129
137
|
}
|
|
130
|
-
function
|
|
131
|
-
var
|
|
132
|
-
(
|
|
133
|
-
|
|
138
|
+
function Y() {
|
|
139
|
+
var o;
|
|
140
|
+
(o = l.disconnect()) == null || o.pipe(
|
|
141
|
+
De("正在断开")
|
|
134
142
|
).subscribe();
|
|
135
143
|
}
|
|
136
|
-
function
|
|
137
|
-
switch (
|
|
144
|
+
function Z({ detail: o }) {
|
|
145
|
+
switch (o.id) {
|
|
138
146
|
case 1:
|
|
139
|
-
|
|
147
|
+
Y();
|
|
140
148
|
break;
|
|
141
149
|
case 2:
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
$e(Oe.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
|
|
151
|
+
$(() => r.loading("正在关机")),
|
|
144
152
|
f(() => l.shutdown()),
|
|
145
|
-
D(() =>
|
|
153
|
+
D(() => N(null)),
|
|
146
154
|
// 关机后距离信号丢失还有一段时间,这里主动断开连接,改进用户体验
|
|
147
155
|
f(() => l.disconnect())
|
|
148
156
|
).subscribe(() => {
|
|
@@ -151,123 +159,130 @@ const i = ce, o = re, p = ue, S = pe, Be = se, $e = ve, Ne = de, L = ae, M = fe,
|
|
|
151
159
|
break;
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (v.mac) {
|
|
161
|
-
const { platform: e } = await Se();
|
|
162
|
-
e === "ios" ? I() : Q(v.mac);
|
|
162
|
+
return ne(() => g.value, async (o) => {
|
|
163
|
+
if (o) {
|
|
164
|
+
if (!C.value)
|
|
165
|
+
if (w.mac) {
|
|
166
|
+
const { platform: e } = await Be();
|
|
167
|
+
e === "ios" ? B() : X(w.mac);
|
|
163
168
|
} else
|
|
164
|
-
|
|
169
|
+
B();
|
|
165
170
|
} else
|
|
166
|
-
|
|
167
|
-
}),
|
|
168
|
-
|
|
169
|
-
}), (
|
|
170
|
-
|
|
171
|
-
show:
|
|
172
|
-
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
d.value && h();
|
|
172
|
+
}), se(() => {
|
|
173
|
+
h();
|
|
174
|
+
}), (o, e) => (m(), R("view", je, [
|
|
175
|
+
T(s(Le), {
|
|
176
|
+
show: g.value,
|
|
177
|
+
"onUpdate:show": e[2] || (e[2] = (t) => g.value = t),
|
|
178
|
+
title: "OPPER"
|
|
179
|
+
}, {
|
|
180
|
+
buttons: v(() => [
|
|
181
|
+
s(C) ? (m(), k(s(K), {
|
|
182
|
+
key: 0,
|
|
183
|
+
color: "danger",
|
|
184
|
+
expand: "block",
|
|
185
|
+
onTap: e[0] || (e[0] = (t) => y.value = !0)
|
|
186
|
+
}, {
|
|
187
|
+
default: v(() => [...e[11] || (e[11] = [
|
|
188
|
+
P("断开连接", -1)
|
|
189
|
+
])]),
|
|
190
|
+
_: 1
|
|
191
|
+
})) : (m(), k(s(K), {
|
|
192
|
+
key: 1,
|
|
193
|
+
expand: "block",
|
|
194
|
+
onTap: e[1] || (e[1] = (t) => d.value ? h() : B())
|
|
195
|
+
}, {
|
|
196
|
+
default: v(() => [
|
|
197
|
+
P(c(d.value ? "停止扫描" : "扫描 OPPER 设备"), 1)
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}))
|
|
201
|
+
]),
|
|
202
|
+
default: v(() => [
|
|
203
|
+
s(C) ? (m(), R("view", Ue, [
|
|
204
|
+
n("view", Fe, [
|
|
205
|
+
e[6] || (e[6] = n("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
|
|
206
|
+
n("view", qe, [
|
|
207
|
+
P(c(s(p).name || "OPPER") + " ", 1),
|
|
208
|
+
n("view", {
|
|
209
|
+
class: Re(["sun-opper-controller-device-battery", { "sun-opper-controller-device-battery-active": s(p).charging }])
|
|
184
210
|
}, [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
[
|
|
211
|
+
T(s(ke), { name: "flash" }),
|
|
212
|
+
Pe(n("text", null, c(s(p).volt) + "%", 513), [
|
|
213
|
+
[Te, s(p).volt]
|
|
188
214
|
])
|
|
189
215
|
], 2)
|
|
190
216
|
])
|
|
191
217
|
]),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
e[7] || (e[7] =
|
|
195
|
-
|
|
218
|
+
n("view", Ke, [
|
|
219
|
+
n("view", We, [
|
|
220
|
+
e[7] || (e[7] = n("view", null, "设备号", -1)),
|
|
221
|
+
n("view", null, c(s(p).id), 1)
|
|
196
222
|
]),
|
|
197
|
-
|
|
198
|
-
e[8] || (e[8] =
|
|
199
|
-
|
|
223
|
+
n("view", Ge, [
|
|
224
|
+
e[8] || (e[8] = n("view", null, "秤台精度", -1)),
|
|
225
|
+
n("view", null, c(s(p).accuracy || 1) + "克", 1)
|
|
200
226
|
]),
|
|
201
|
-
|
|
202
|
-
e[9] || (e[9] =
|
|
203
|
-
|
|
227
|
+
n("view", He, [
|
|
228
|
+
e[9] || (e[9] = n("view", null, "固件版本", -1)),
|
|
229
|
+
n("view", null, c(s(p).version), 1)
|
|
204
230
|
]),
|
|
205
|
-
|
|
206
|
-
e[10] || (e[10] =
|
|
207
|
-
|
|
231
|
+
n("view", Je, [
|
|
232
|
+
e[10] || (e[10] = n("view", null, "序列号", -1)),
|
|
233
|
+
n("view", null, c(s(p).serialNumber), 1)
|
|
208
234
|
])
|
|
209
235
|
])
|
|
210
|
-
]),
|
|
211
|
-
|
|
212
|
-
S(i(q), {
|
|
213
|
-
color: "danger",
|
|
214
|
-
expand: "block",
|
|
215
|
-
onTap: e[0] || (e[0] = (t) => g.value = !0)
|
|
216
|
-
}, {
|
|
217
|
-
default: M(() => [...e[11] || (e[11] = [
|
|
218
|
-
L("断开连接", -1)
|
|
219
|
-
])]),
|
|
220
|
-
_: 1
|
|
221
|
-
})
|
|
222
|
-
])
|
|
223
|
-
], 64)) : (h(), b(P, { key: 1 }, [
|
|
224
|
-
S(i(De), {
|
|
236
|
+
])) : (m(), k(s(xe), {
|
|
237
|
+
key: 1,
|
|
225
238
|
class: "sun-opper-controller-device-list",
|
|
226
239
|
refresher: !1,
|
|
227
|
-
data:
|
|
228
|
-
loading:
|
|
240
|
+
data: j.value,
|
|
241
|
+
loading: d.value,
|
|
229
242
|
"loading-text": "正在扫描"
|
|
230
243
|
}, {
|
|
231
|
-
default:
|
|
232
|
-
(
|
|
244
|
+
default: v(() => [
|
|
245
|
+
(m(!0), R(Ve, null, ze(j.value, (t) => (m(), k(s(Ce), {
|
|
233
246
|
key: t.deviceId,
|
|
234
247
|
title: t.name,
|
|
235
248
|
label: t.deviceId,
|
|
236
249
|
size: "large",
|
|
237
250
|
clickable: !0,
|
|
238
|
-
onTap: (
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
onTap: (a) => _(t.deviceId)
|
|
252
|
+
}, {
|
|
253
|
+
end: v(() => [
|
|
254
|
+
n("text", {
|
|
255
|
+
style: Ae({ color: t.recommended ? "var(--color-success)" : "inherit" })
|
|
256
|
+
}, c(t.RSSI) + "dBm", 5)
|
|
257
|
+
]),
|
|
258
|
+
default: v(() => [
|
|
259
|
+
T(s(Ie), null, {
|
|
260
|
+
default: v(() => [
|
|
261
|
+
n("view", Qe, c(t.localName || t.name), 1),
|
|
262
|
+
n("view", Xe, c(t.deviceId), 1)
|
|
263
|
+
]),
|
|
264
|
+
_: 2
|
|
265
|
+
}, 1024)
|
|
266
|
+
]),
|
|
267
|
+
_: 2
|
|
268
|
+
}, 1032, ["title", "label", "onTap"]))), 128))
|
|
244
269
|
]),
|
|
245
270
|
_: 1
|
|
246
|
-
}, 8, ["data", "loading"])
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
L(p(u.value ? "停止扫描" : "扫描 OPPER 设备"), 1)
|
|
254
|
-
]),
|
|
255
|
-
_: 1
|
|
256
|
-
})
|
|
257
|
-
])
|
|
258
|
-
], 64))
|
|
259
|
-
], 40, Me),
|
|
260
|
-
o("van-action-sheet", {
|
|
261
|
-
show: g.value,
|
|
262
|
-
actions: J,
|
|
271
|
+
}, 8, ["data", "loading"]))
|
|
272
|
+
]),
|
|
273
|
+
_: 1
|
|
274
|
+
}, 8, ["show"]),
|
|
275
|
+
n("van-action-sheet", {
|
|
276
|
+
show: y.value,
|
|
277
|
+
actions: Q,
|
|
263
278
|
"cancel-text": "取消",
|
|
264
|
-
onSelect: e[3] || (e[3] = (t) =>
|
|
265
|
-
onCancel: e[4] || (e[4] = (t) =>
|
|
266
|
-
onClose: e[5] || (e[5] = (t) =>
|
|
267
|
-
}, null, 40,
|
|
279
|
+
onSelect: e[3] || (e[3] = (t) => Z(t)),
|
|
280
|
+
onCancel: e[4] || (e[4] = (t) => y.value = !1),
|
|
281
|
+
onClose: e[5] || (e[5] = (t) => y.value = !1)
|
|
282
|
+
}, null, 40, Ye)
|
|
268
283
|
]));
|
|
269
284
|
}
|
|
270
285
|
});
|
|
271
286
|
export {
|
|
272
|
-
|
|
287
|
+
at as default
|
|
273
288
|
};
|
package/modal/index.scss
ADDED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Opper } from '@opper/core';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
show?: boolean;
|
|
4
3
|
/** NFC 直连 */
|
|
5
4
|
mac?: string;
|
|
6
5
|
/** 自动连 */
|
|
7
6
|
deviceId?: string;
|
|
8
7
|
opper: Opper;
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type __VLS_PublicProps = {
|
|
10
|
+
'show'?: boolean;
|
|
11
|
+
} & __VLS_Props;
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
"update:show": (value: boolean) => any;
|
|
12
14
|
connect: (deviceId: string) => any;
|
|
13
15
|
disconnect: (deviceId: string) => any;
|
|
14
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
15
|
-
"onUpdate:show"?: ((
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
16
18
|
onConnect?: ((deviceId: string) => any) | undefined;
|
|
17
19
|
onDisconnect?: ((deviceId: string) => any) | undefined;
|
|
18
|
-
}>, {
|
|
19
|
-
show: boolean;
|
|
20
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
|
|
21
21
|
export default _default;
|