@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.21 → 1.0.0-beta.22
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/.versionrc +23 -23
- package/CHANGELOG.md +292 -277
- package/README.md +404 -318
- package/demo/index.vue +335 -261
- package/index.js +3 -3
- package/package.json +1 -1
- package/src/sdk/BrowserAdapter.js +63 -63
- package/src/sdk/CordovaAdapter.js +20 -20
- package/src/sdk/DingTalkAdapter.js +20 -20
- package/src/sdk/LamboJsBridge.js +98 -90
- package/src/sdk/WeComAdapter.js +367 -367
- package/src/sdk/YunTuAdapter.js +369 -224
- package/src/sdk/yuntu.js +55 -55
package/demo/index.vue
CHANGED
|
@@ -1,261 +1,335 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<demo-section>
|
|
3
|
-
<demo-block title="初始化信息">
|
|
4
|
-
<pre v-show="initInfo"><code>{{ initInfo }}</code></pre>
|
|
5
|
-
</demo-block>
|
|
6
|
-
<demo-block title="初始化地图Key">
|
|
7
|
-
<van-button @click="initKey">初始化地图Key</van-button>
|
|
8
|
-
<pre v-show="initKeyMessage"><code>{{ initKeyMessage }}</code></pre>
|
|
9
|
-
</demo-block>
|
|
10
|
-
<demo-block title="获取定位">
|
|
11
|
-
<van-button @click="getLocation">获取定位</van-button>
|
|
12
|
-
<pre v-show="location"><code>{{ location }}</code></pre>
|
|
13
|
-
</demo-block>
|
|
14
|
-
<demo-block title="扫码">
|
|
15
|
-
<van-button @click="scanCode">扫码</van-button>
|
|
16
|
-
<pre v-show="scanResult"><code>{{ scanResult }}</code></pre>
|
|
17
|
-
</demo-block>
|
|
18
|
-
<demo-block title="拍照">
|
|
19
|
-
<van-button @click="takePhoto">拍照</van-button>
|
|
20
|
-
<pre v-show="photoResult"><code>{{ photoResult }}</code></pre>
|
|
21
|
-
<div v-show="photoPreviews.length" :class="gridClass">
|
|
22
|
-
<div v-for="(preview, index) in photoPreviews" :key="index" class="photo-container">
|
|
23
|
-
<img :src="preview" alt="Photo Preview" class="photo">
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</demo-block>
|
|
27
|
-
<demo-block title="打开位置">
|
|
28
|
-
<van-button @click="openLocation">打开位置</van-button>
|
|
29
|
-
<pre v-show="openLocationResult"><code>{{ openLocationResult }}</code></pre>
|
|
30
|
-
</demo-block>
|
|
31
|
-
<demo-block title="文件预览">
|
|
32
|
-
<a href="javascript:void(0);" @click="previewFile">点击这里预览文件</a>
|
|
33
|
-
</demo-block>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const result = await this.$lamboJsBridge.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
} catch (error) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<demo-section>
|
|
3
|
+
<demo-block title="初始化信息">
|
|
4
|
+
<pre v-show="initInfo"><code>{{ initInfo }}</code></pre>
|
|
5
|
+
</demo-block>
|
|
6
|
+
<demo-block title="初始化地图Key">
|
|
7
|
+
<van-button @click="initKey">初始化地图Key</van-button>
|
|
8
|
+
<pre v-show="initKeyMessage"><code>{{ initKeyMessage }}</code></pre>
|
|
9
|
+
</demo-block>
|
|
10
|
+
<demo-block title="获取定位">
|
|
11
|
+
<van-button @click="getLocation">获取定位</van-button>
|
|
12
|
+
<pre v-show="location"><code>{{ location }}</code></pre>
|
|
13
|
+
</demo-block>
|
|
14
|
+
<demo-block title="扫码">
|
|
15
|
+
<van-button @click="scanCode">扫码</van-button>
|
|
16
|
+
<pre v-show="scanResult"><code>{{ scanResult }}</code></pre>
|
|
17
|
+
</demo-block>
|
|
18
|
+
<demo-block title="拍照">
|
|
19
|
+
<van-button @click="takePhoto">拍照</van-button>
|
|
20
|
+
<pre v-show="photoResult"><code>{{ photoResult }}</code></pre>
|
|
21
|
+
<div v-show="photoPreviews.length" :class="gridClass">
|
|
22
|
+
<div v-for="(preview, index) in photoPreviews" :key="index" class="photo-container">
|
|
23
|
+
<img :src="preview" alt="Photo Preview" class="photo">
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</demo-block>
|
|
27
|
+
<demo-block title="打开位置">
|
|
28
|
+
<van-button @click="openLocation">打开位置</van-button>
|
|
29
|
+
<pre v-show="openLocationResult"><code>{{ openLocationResult }}</code></pre>
|
|
30
|
+
</demo-block>
|
|
31
|
+
<demo-block title="文件预览">
|
|
32
|
+
<a href="javascript:void(0);" @click="previewFile">点击这里预览文件</a>
|
|
33
|
+
</demo-block>
|
|
34
|
+
<demo-block title="录音(仅在Flutter环境下可用)">
|
|
35
|
+
<van-button @click="startRecording">开始录音</van-button>
|
|
36
|
+
<van-button @click="startAutoRecording" style="margin-left: 5px">自动录音</van-button>
|
|
37
|
+
<van-button @click="stopRecording" style="margin-left: 5px">停止录音</van-button>
|
|
38
|
+
<div v-if="recordingStatus === 'recording'">
|
|
39
|
+
<p>正在录音中...</p>
|
|
40
|
+
</div>
|
|
41
|
+
<div v-else-if="recordingStatus === 'not started'">
|
|
42
|
+
<p>录音未开始</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div v-else-if="recordingStatus === 'stopped'">
|
|
45
|
+
<p>录音结束</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div v-else-if="recordingStatus === 'failed'">
|
|
48
|
+
<p>录音失败</p>
|
|
49
|
+
</div>
|
|
50
|
+
<div v-if="audioUrl">
|
|
51
|
+
<h3>录音已完成</h3>
|
|
52
|
+
<audio :src="audioUrl" controls></audio>
|
|
53
|
+
<p>录音文件: {{ fileName }}</p>
|
|
54
|
+
<p>文件大小: {{ fileSize }} 字节</p>
|
|
55
|
+
<p>文件类型: {{ fileType }}</p>
|
|
56
|
+
<p>文件地址:{{ audioUrl }}</p>
|
|
57
|
+
</div>
|
|
58
|
+
</demo-block>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</demo-section>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
import LamboJsBridge from "../src/sdk/LamboJsBridge";
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
name: 'js-bridge-demo',
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
lamboBridge: null,
|
|
73
|
+
initInfo: '',
|
|
74
|
+
location: '',
|
|
75
|
+
scanResult: '',
|
|
76
|
+
photoResult: '',
|
|
77
|
+
openLocationResult: '', // 添加用于存储打开位置的返回值
|
|
78
|
+
latitude: 117.129, // 存储纬度
|
|
79
|
+
longitude: 36.662, // 存储经度
|
|
80
|
+
ossServerContext: 'ibp-upms-server',
|
|
81
|
+
ossImgPutUrl: '/oss/file/put',
|
|
82
|
+
ossImgGetUrl: '/oss/file/get/',
|
|
83
|
+
scale: 8,
|
|
84
|
+
name:'这里是位置名称name',
|
|
85
|
+
address:'这里是详细位置address',
|
|
86
|
+
wechatId: 'wx92fab9d3885b0298',
|
|
87
|
+
weComId: 'wx0eb3ba9d89eca3cb',
|
|
88
|
+
agentId:'1000065',
|
|
89
|
+
dingTalkId: '',
|
|
90
|
+
photoPreviews: [],
|
|
91
|
+
initKeyMessage: '', // 用于存储 initKey 的返回消息
|
|
92
|
+
audioUrl: null, // 用于存储录音文件的 URL
|
|
93
|
+
fileName: '', // 录音文件名
|
|
94
|
+
fileSize: 0, // 录音文件大小
|
|
95
|
+
fileType: '', // 录音文件类型
|
|
96
|
+
recordingStatus: "not started", // 用于记录当前录音状态
|
|
97
|
+
recordingOptions: {
|
|
98
|
+
isAuto: false, // 是否自动录音
|
|
99
|
+
fftSize: 512, // FFT 大小
|
|
100
|
+
fileName: 'audio.ogg', // 默认录音文件名
|
|
101
|
+
silenceThreshold: 100, // 静音检测音量阈值
|
|
102
|
+
silenceDuration: 1000, // 静音持续时长
|
|
103
|
+
silenceDelay: 2000 // 静音检测延迟
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
computed: {
|
|
108
|
+
gridClass() {
|
|
109
|
+
const {length} = this.photoPreviews;
|
|
110
|
+
if (length === 1) {
|
|
111
|
+
return 'grid-single';
|
|
112
|
+
} if (length > 1 && length <= 4) {
|
|
113
|
+
return 'grid-two';
|
|
114
|
+
} if (length > 4) {
|
|
115
|
+
return 'grid-three';
|
|
116
|
+
}
|
|
117
|
+
return '';
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
async created() {
|
|
121
|
+
const script = document.createElement('script')
|
|
122
|
+
script.src = '//dev.sunquan.tech/inspect/target.js'
|
|
123
|
+
script.async = true
|
|
124
|
+
document.getElementsByTagName('head')[0].appendChild(script)
|
|
125
|
+
const options = {
|
|
126
|
+
// 初始化参数,根据需要填写
|
|
127
|
+
wechatId:this.wechatId,
|
|
128
|
+
weComId:this.weComId,
|
|
129
|
+
agentId:this.agentId,
|
|
130
|
+
dingTalkId:this.dingTalkId,
|
|
131
|
+
pluginConfig:["localAuthPlugin","amapPlugin","tabBarPlugin","scanCodePlugin","filePreviewPlugin"],
|
|
132
|
+
};
|
|
133
|
+
this.$lamboJsBridge = new LamboJsBridge(options);
|
|
134
|
+
await this.getPlatform();
|
|
135
|
+
// await this.$lamboJsBridge.initializePlugin(options.pluginConfig);
|
|
136
|
+
},
|
|
137
|
+
methods: {
|
|
138
|
+
async getPlatform() {
|
|
139
|
+
try {
|
|
140
|
+
const info = await this.$lamboJsBridge.getPlatform(); // 获取初始化信息
|
|
141
|
+
this.initInfo = JSON.stringify(info, null, 2); // 美化输出
|
|
142
|
+
console.log('Init Info:', info);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error('Error getting init info:', error);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
async startRecording() {
|
|
148
|
+
try {
|
|
149
|
+
this.recordingStatus = 'recording';
|
|
150
|
+
const { audioUrl, file } = await this.$lamboJsBridge.startRecording(this.recordingOptions);
|
|
151
|
+
this.audioUrl = audioUrl;
|
|
152
|
+
this.fileName = file.name;
|
|
153
|
+
this.fileSize = file.size;
|
|
154
|
+
this.fileType = file.type;
|
|
155
|
+
console.log(this.recordingOptions.isAuto ? '自动录音已开始' : '录音已开始');
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.error('录音失败:', error);
|
|
158
|
+
this.recordingStatus = 'failed';
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
// 开始自动录音
|
|
163
|
+
async startAutoRecording() {
|
|
164
|
+
// 更改 recordingOptions 中的 isAuto 值为 true
|
|
165
|
+
this.recordingOptions.isAuto = true;
|
|
166
|
+
await this.startRecording(); // 调用 startRecording
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
// 停止录音
|
|
170
|
+
async stopRecording() {
|
|
171
|
+
try {
|
|
172
|
+
await this.$lamboJsBridge.stopRecording();
|
|
173
|
+
this.recordingStatus = 'stopped';
|
|
174
|
+
console.log('录音已停止');
|
|
175
|
+
} catch (error) {
|
|
176
|
+
console.error('停止录音失败:', error);
|
|
177
|
+
this.recordingStatus = 'failed';
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
async getLocation() {
|
|
182
|
+
try {
|
|
183
|
+
const options ={
|
|
184
|
+
// 初始化参数,根据需要填写
|
|
185
|
+
};
|
|
186
|
+
const location = await this.$lamboJsBridge.getLocation(options);
|
|
187
|
+
console.log("location",location)
|
|
188
|
+
this.location += `${JSON.stringify(location)}\n`; // 追加新数据
|
|
189
|
+
this.latitude = location.latitude; // 存储纬度
|
|
190
|
+
this.longitude = location.longitude; // 存储经度
|
|
191
|
+
console.log("this.latitude:",this.latitude);
|
|
192
|
+
console.log("this.longitude:",this.longitude);
|
|
193
|
+
// console.log('Location:', location);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.error('Error getting location:', error);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
async scanCode() {
|
|
199
|
+
try {
|
|
200
|
+
const options ={
|
|
201
|
+
// 初始化参数,根据需要填写
|
|
202
|
+
};
|
|
203
|
+
const result = await this.$lamboJsBridge.scanCode(options);
|
|
204
|
+
this.scanResult += `${JSON.stringify(result)}\n`; // 追加新数据
|
|
205
|
+
// console.log('Scan result:', result);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
console.error('Error scanning code:', error);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
async takePhoto() {
|
|
211
|
+
try {
|
|
212
|
+
const options = {
|
|
213
|
+
ossServerContext: this.ossServerContext,
|
|
214
|
+
ossImgPutUrl: this.ossImgPutUrl,
|
|
215
|
+
ossImgGetUrl: this.ossImgGetUrl,
|
|
216
|
+
outputType: ['info','data','oss'],
|
|
217
|
+
method: 'file',
|
|
218
|
+
// sourceType: 'gallery'
|
|
219
|
+
};
|
|
220
|
+
const photos = await this.$lamboJsBridge.takePhoto(options);
|
|
221
|
+
this.photoResult += `${JSON.stringify(photos)}\n`;
|
|
222
|
+
console.log("Photo result:", photos); // 调试输出
|
|
223
|
+
console.log("oss:",photos.imageOss)
|
|
224
|
+
|
|
225
|
+
photos.forEach(photo => {
|
|
226
|
+
if (photo.imageOss && photo.imageOss.url) {
|
|
227
|
+
this.photoPreviews.push(photo.imageOss.url); // 将图片URL添加到数组中
|
|
228
|
+
} else if (photo.imageData) {
|
|
229
|
+
this.photoPreviews.push(photo.imageData); // 如果OSS URL不存在,使用本地数据
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
console.log("Updated photoPreviews:", this.photoPreviews); // 调试输出
|
|
234
|
+
} catch (error) {
|
|
235
|
+
console.error('Error taking photo:', error);
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
async openLocation() {
|
|
239
|
+
try {
|
|
240
|
+
if (this.latitude !== null && this.longitude !== null) {
|
|
241
|
+
const options = {
|
|
242
|
+
// 初始化参数,根据需要修改
|
|
243
|
+
latitude: this.latitude,
|
|
244
|
+
longitude: this.longitude,
|
|
245
|
+
name: this.name,
|
|
246
|
+
address: this.address,
|
|
247
|
+
scale: this.scale,
|
|
248
|
+
type:"amap"
|
|
249
|
+
};
|
|
250
|
+
await this.$lamboJsBridge.openLocation(options);
|
|
251
|
+
this.openLocationResult = '位置已成功打开'; // 成功打开位置时存储信息
|
|
252
|
+
console.log('Location opened successfully');
|
|
253
|
+
} else {
|
|
254
|
+
this.openLocationResult = '没有可用的位置信息,请先获取定位。'; // 没有位置信息时存储错误信息
|
|
255
|
+
console.error('No location data available. Please get the location first.');
|
|
256
|
+
}
|
|
257
|
+
} catch (error) {
|
|
258
|
+
this.openLocationResult = `打开位置时出错: ${error.message}`; // 存储错误信息
|
|
259
|
+
console.error('Error opening location:', error);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
async previewFile() {
|
|
263
|
+
try {
|
|
264
|
+
const options = {
|
|
265
|
+
title: '预览文件.txt', // 文件的标题
|
|
266
|
+
path: 'http://160.mall.eap.lambo.top/ecm-runtime-server/api/file/get/123456' ,// 文件的URL路径
|
|
267
|
+
tokenKey:"lambo-token-ibp"
|
|
268
|
+
};
|
|
269
|
+
const result = await this.$lamboJsBridge.filePreview(options);
|
|
270
|
+
console.log('File preview result:', result);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
console.error('Error previewing file:', error);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
async initKey() {
|
|
276
|
+
try {
|
|
277
|
+
const result = await this.$lamboJsBridge.initKey( {"androidKey":"41c4c1f35d8d14f5bf1907c173924147","iosKey":"465abf5da8c8d62e3caa63952a0957a5"});
|
|
278
|
+
console.log('initKey result:', result);
|
|
279
|
+
this.initKeyMessage = `initKey result: ${JSON.stringify(result)}`;
|
|
280
|
+
} catch (error) {
|
|
281
|
+
this.initKeyMessage = `初始化 Key 时出错: ${error.message}`;
|
|
282
|
+
console.error('Error initializing key:', error);
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
beforeRouteEnter (to, from, next) {
|
|
287
|
+
next(vm => {
|
|
288
|
+
if (from.name !== null) {
|
|
289
|
+
vm.$nextTick(() => {
|
|
290
|
+
window.location.reload();
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
</script>
|
|
297
|
+
|
|
298
|
+
<style scoped>
|
|
299
|
+
pre {
|
|
300
|
+
background-color: #f5f5f5;
|
|
301
|
+
padding: 10px;
|
|
302
|
+
border-radius: 4px;
|
|
303
|
+
overflow: auto;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
code {
|
|
307
|
+
white-space: pre-wrap;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.grid-single {
|
|
311
|
+
display: grid;
|
|
312
|
+
grid-template-columns: 1fr;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.grid-two {
|
|
316
|
+
display: grid;
|
|
317
|
+
grid-template-columns: repeat(2, 1fr);
|
|
318
|
+
gap: 10px;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.grid-three {
|
|
322
|
+
display: grid;
|
|
323
|
+
grid-template-columns: repeat(3, 1fr);
|
|
324
|
+
gap: 10px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.photo-container {
|
|
328
|
+
margin-top: 10px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.photo {
|
|
332
|
+
max-width: 100%;
|
|
333
|
+
border-radius: 4px;
|
|
334
|
+
}
|
|
335
|
+
</style>
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import LamboJsBridge from './src/sdk/LamboJsBridge'
|
|
2
|
-
|
|
3
|
-
export default LamboJsBridge
|
|
1
|
+
import LamboJsBridge from './src/sdk/LamboJsBridge'
|
|
2
|
+
|
|
3
|
+
export default LamboJsBridge
|
|
4
4
|
|