@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.21 → 1.0.0-beta.23
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 +294 -272
- package/README.md +411 -318
- package/demo/index.vue +360 -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 +102 -90
- package/src/sdk/WeComAdapter.js +367 -367
- package/src/sdk/YunTuAdapter.js +309 -224
- package/src/sdk/yuntu.js +55 -55
package/demo/index.vue
CHANGED
|
@@ -1,261 +1,360 @@
|
|
|
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="
|
|
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
|
-
console.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
console.
|
|
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
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
.photo
|
|
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="filePreview">点击这里预览文件</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>文件地址:{{ audioUrl }}</p>
|
|
54
|
+
</div>
|
|
55
|
+
</demo-block>
|
|
56
|
+
<demo-block title="下载">
|
|
57
|
+
<van-button @click="downloadFile">下载文件</van-button>
|
|
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
|
+
recordingStatus: "not started", // 用于记录当前录音状态
|
|
94
|
+
downloadLink : null,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
computed: {
|
|
98
|
+
gridClass() {
|
|
99
|
+
const {length} = this.photoPreviews;
|
|
100
|
+
if (length === 1) {
|
|
101
|
+
return 'grid-single';
|
|
102
|
+
} if (length > 1 && length <= 4) {
|
|
103
|
+
return 'grid-two';
|
|
104
|
+
} if (length > 4) {
|
|
105
|
+
return 'grid-three';
|
|
106
|
+
}
|
|
107
|
+
return '';
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
async created() {
|
|
111
|
+
const script = document.createElement('script')
|
|
112
|
+
script.src = '//dev.sunquan.tech/inspect/target.js'
|
|
113
|
+
script.async = true
|
|
114
|
+
document.getElementsByTagName('head')[0].appendChild(script)
|
|
115
|
+
const options = {
|
|
116
|
+
// 初始化参数,根据需要填写
|
|
117
|
+
wechatId:this.wechatId,
|
|
118
|
+
weComId:this.weComId,
|
|
119
|
+
agentId:this.agentId,
|
|
120
|
+
dingTalkId:this.dingTalkId,
|
|
121
|
+
pluginConfig:["localAuthPlugin","amapPlugin","tabBarPlugin","scanCodePlugin","filePreviewPlugin","autoRecordPlugin"],
|
|
122
|
+
};
|
|
123
|
+
this.$lamboJsBridge = new LamboJsBridge(options);
|
|
124
|
+
await this.getPlatform();
|
|
125
|
+
// await this.$lamboJsBridge.initializePlugin(options.pluginConfig);
|
|
126
|
+
},
|
|
127
|
+
methods: {
|
|
128
|
+
async getPlatform() {
|
|
129
|
+
try {
|
|
130
|
+
const info = await this.$lamboJsBridge.getPlatform(); // 获取初始化信息
|
|
131
|
+
this.initInfo = JSON.stringify(info, null, 2); // 美化输出
|
|
132
|
+
console.log('Init Info:', info);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error('Error getting init info:', error);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
// 开始手动录音
|
|
139
|
+
async startRecording() {
|
|
140
|
+
// 清空之前的录音数据
|
|
141
|
+
this.audioUrl = null;
|
|
142
|
+
this.recordingStatus = 'recording';
|
|
143
|
+
try {
|
|
144
|
+
// 传入 { auto: false } 表示手动录音
|
|
145
|
+
const result = await this.$lamboJsBridge.startRecording({ auto: false });
|
|
146
|
+
console.log("录音开始成功:", result);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
console.error("录音开始失败:", error);
|
|
149
|
+
this.recordingStatus = 'failed';
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
// 开始自动录音
|
|
154
|
+
async startAutoRecording() {
|
|
155
|
+
// 清空之前的录音数据
|
|
156
|
+
this.audioUrl = null;
|
|
157
|
+
this.recordingStatus = 'recording';
|
|
158
|
+
try {
|
|
159
|
+
// 传入 { auto: true } 表示启用自动录音
|
|
160
|
+
const result = await this.$lamboJsBridge.startRecording({ auto: true });
|
|
161
|
+
console.log("自动录音开始成功:", result);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
console.error("自动录音开始失败:", error);
|
|
164
|
+
this.recordingStatus = 'failed';
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
// 停止录音
|
|
169
|
+
async stopRecording() {
|
|
170
|
+
try {
|
|
171
|
+
const result = await this.$lamboJsBridge.stopRecording();
|
|
172
|
+
console.log("录音停止成功:", result);
|
|
173
|
+
this.recordingStatus = 'stopped';
|
|
174
|
+
// 更新录音文件信息
|
|
175
|
+
this.audioUrl = result.fileUrl || result.msg;
|
|
176
|
+
// 如果你非要用全局函数更新,也可以调用它
|
|
177
|
+
this.updateAudioDisplay(result);
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.error("录音停止失败:", error);
|
|
180
|
+
this.recordingStatus = 'failed';
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
// 如果你希望借助类似全局函数的形式更新页面,可以这样定义:
|
|
185
|
+
updateAudioDisplay(data) {
|
|
186
|
+
// 更新组件中的数据,页面会自动响应
|
|
187
|
+
this.recordingStatus = 'stopped';
|
|
188
|
+
this.audioUrl = data.fileUrl;
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async downloadFile(){
|
|
193
|
+
try {
|
|
194
|
+
const fileUrl = 'http://10.110.34.27/yc_scrm.apk'; // 你要下载的文件 URL
|
|
195
|
+
const fileName = '下载文件'; // 文件名
|
|
196
|
+
await this.$lamboJsBridge.downloadFile({ fileUrl, fileName });
|
|
197
|
+
console.log('Download initiated');
|
|
198
|
+
} catch (error){
|
|
199
|
+
console.error('Download failed:', error);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
async getLocation() {
|
|
204
|
+
try {
|
|
205
|
+
const options ={
|
|
206
|
+
// 初始化参数,根据需要填写
|
|
207
|
+
};
|
|
208
|
+
const location = await this.$lamboJsBridge.getLocation(options);
|
|
209
|
+
console.log("location",location)
|
|
210
|
+
this.location += `${JSON.stringify(location)}\n`; // 追加新数据
|
|
211
|
+
this.latitude = location.latitude; // 存储纬度
|
|
212
|
+
this.longitude = location.longitude; // 存储经度
|
|
213
|
+
console.log("this.latitude:",this.latitude);
|
|
214
|
+
console.log("this.longitude:",this.longitude);
|
|
215
|
+
// console.log('Location:', location);
|
|
216
|
+
} catch (error) {
|
|
217
|
+
console.error('Error getting location:', error);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
async scanCode() {
|
|
221
|
+
try {
|
|
222
|
+
const options ={
|
|
223
|
+
// 初始化参数,根据需要填写
|
|
224
|
+
};
|
|
225
|
+
const result = await this.$lamboJsBridge.scanCode(options);
|
|
226
|
+
this.scanResult += `${JSON.stringify(result)}\n`; // 追加新数据
|
|
227
|
+
// console.log('Scan result:', result);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
console.error('Error scanning code:', error);
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
async takePhoto() {
|
|
233
|
+
try {
|
|
234
|
+
const options = {
|
|
235
|
+
ossServerContext: this.ossServerContext,
|
|
236
|
+
ossImgPutUrl: this.ossImgPutUrl,
|
|
237
|
+
ossImgGetUrl: this.ossImgGetUrl,
|
|
238
|
+
outputType: ['info','data','oss'],
|
|
239
|
+
method: 'file',
|
|
240
|
+
// sourceType: 'gallery'
|
|
241
|
+
};
|
|
242
|
+
const photos = await this.$lamboJsBridge.takePhoto(options);
|
|
243
|
+
this.photoResult += `${JSON.stringify(photos)}\n`;
|
|
244
|
+
console.log("Photo result:", photos); // 调试输出
|
|
245
|
+
console.log("oss:",photos.imageOss)
|
|
246
|
+
|
|
247
|
+
photos.forEach(photo => {
|
|
248
|
+
if (photo.imageOss && photo.imageOss.url) {
|
|
249
|
+
this.photoPreviews.push(photo.imageOss.url); // 将图片URL添加到数组中
|
|
250
|
+
} else if (photo.imageData) {
|
|
251
|
+
this.photoPreviews.push(photo.imageData); // 如果OSS URL不存在,使用本地数据
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
console.log("Updated photoPreviews:", this.photoPreviews); // 调试输出
|
|
256
|
+
} catch (error) {
|
|
257
|
+
console.error('Error taking photo:', error);
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
async openLocation() {
|
|
261
|
+
try {
|
|
262
|
+
if (this.latitude !== null && this.longitude !== null) {
|
|
263
|
+
const options = {
|
|
264
|
+
// 初始化参数,根据需要修改
|
|
265
|
+
latitude: this.latitude,
|
|
266
|
+
longitude: this.longitude,
|
|
267
|
+
name: this.name,
|
|
268
|
+
address: this.address,
|
|
269
|
+
scale: this.scale,
|
|
270
|
+
type:"amap"
|
|
271
|
+
};
|
|
272
|
+
await this.$lamboJsBridge.openLocation(options);
|
|
273
|
+
this.openLocationResult = '位置已成功打开'; // 成功打开位置时存储信息
|
|
274
|
+
console.log('Location opened successfully');
|
|
275
|
+
} else {
|
|
276
|
+
this.openLocationResult = '没有可用的位置信息,请先获取定位。'; // 没有位置信息时存储错误信息
|
|
277
|
+
console.error('No location data available. Please get the location first.');
|
|
278
|
+
}
|
|
279
|
+
} catch (error) {
|
|
280
|
+
this.openLocationResult = `打开位置时出错: ${error.message}`; // 存储错误信息
|
|
281
|
+
console.error('Error opening location:', error);
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
async filePreview() {
|
|
285
|
+
try {
|
|
286
|
+
const options = {
|
|
287
|
+
title: '预览文件.txt', // 文件的标题
|
|
288
|
+
path: 'http://160.mall.eap.lambo.top/ecm-runtime-server/api/file/get/123456' ,// 文件的URL路径
|
|
289
|
+
tokenKey:"lambo-token-ibp"
|
|
290
|
+
};
|
|
291
|
+
const result = await this.$lamboJsBridge.filePreview(options);
|
|
292
|
+
console.log('File preview result:', result);
|
|
293
|
+
} catch (error) {
|
|
294
|
+
console.error('Error previewing file:', error);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
async initKey() {
|
|
298
|
+
try {
|
|
299
|
+
const result = await this.$lamboJsBridge.initKey( {"androidKey":"41c4c1f35d8d14f5bf1907c173924147","iosKey":"465abf5da8c8d62e3caa63952a0957a5"});
|
|
300
|
+
console.log('initKey result:', result);
|
|
301
|
+
this.initKeyMessage = `initKey result: ${JSON.stringify(result)}`;
|
|
302
|
+
} catch (error) {
|
|
303
|
+
this.initKeyMessage = `初始化 Key 时出错: ${error.message}`;
|
|
304
|
+
console.error('Error initializing key:', error);
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
mounted() {
|
|
309
|
+
window.updateAudioDisplay = this.updateAudioDisplay;
|
|
310
|
+
},
|
|
311
|
+
beforeRouteEnter (to, from, next) {
|
|
312
|
+
next(vm => {
|
|
313
|
+
if (from.name !== null) {
|
|
314
|
+
vm.$nextTick(() => {
|
|
315
|
+
window.location.reload();
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
</script>
|
|
322
|
+
|
|
323
|
+
<style scoped>
|
|
324
|
+
pre {
|
|
325
|
+
background-color: #f5f5f5;
|
|
326
|
+
padding: 10px;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
overflow: auto;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
code {
|
|
332
|
+
white-space: pre-wrap;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.grid-single {
|
|
336
|
+
display: grid;
|
|
337
|
+
grid-template-columns: 1fr;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.grid-two {
|
|
341
|
+
display: grid;
|
|
342
|
+
grid-template-columns: repeat(2, 1fr);
|
|
343
|
+
gap: 10px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.grid-three {
|
|
347
|
+
display: grid;
|
|
348
|
+
grid-template-columns: repeat(3, 1fr);
|
|
349
|
+
gap: 10px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.photo-container {
|
|
353
|
+
margin-top: 10px;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.photo {
|
|
357
|
+
max-width: 100%;
|
|
358
|
+
border-radius: 4px;
|
|
359
|
+
}
|
|
360
|
+
</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
|
|