wl-design-mobile 0.4.8 → 0.4.9
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/package.json +1 -1
- package/util/jssdk.js +16 -3
package/package.json
CHANGED
package/util/jssdk.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as ww from '@wecom/jssdk'
|
|
|
3
3
|
import * as dd from 'dingtalk-jsapi';
|
|
4
4
|
import config from '../config/config'
|
|
5
5
|
import {axios} from '../util/axios'
|
|
6
|
+
import {Toast } from 'vant'
|
|
6
7
|
|
|
7
8
|
let appId,agentId,corpId,appKey
|
|
8
9
|
|
|
@@ -233,11 +234,17 @@ let JsSDK = (function () {
|
|
|
233
234
|
success: function (res) {
|
|
234
235
|
let localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
235
236
|
let localId = localIds[0];
|
|
237
|
+
Toast.loading({
|
|
238
|
+
duration: 0, // 持续展示 toast
|
|
239
|
+
forbidClick: false,
|
|
240
|
+
message: '正在上传,请稍候',
|
|
241
|
+
});
|
|
236
242
|
setTimeout(() => {
|
|
237
243
|
wx.uploadImage({
|
|
238
244
|
localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
239
|
-
isShowProgressTips:
|
|
245
|
+
isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
240
246
|
success: function (res) {
|
|
247
|
+
Toast.clear()
|
|
241
248
|
let serverId = res.serverId; // 返回图片的服务器端ID
|
|
242
249
|
resolve({
|
|
243
250
|
appId:sessionStorage.getItem(APP_ID),
|
|
@@ -270,12 +277,16 @@ let JsSDK = (function () {
|
|
|
270
277
|
sourceType: ['album'], // 可以指定来源是相册还是相机,默认二者都有
|
|
271
278
|
success: async function (res) {
|
|
272
279
|
let localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
|
|
273
|
-
|
|
280
|
+
Toast.loading({
|
|
281
|
+
duration: 0, // 持续展示 toast
|
|
282
|
+
forbidClick: false,
|
|
283
|
+
message: '正在上传,请稍候',
|
|
284
|
+
});
|
|
274
285
|
let uploadPromises = localIds.map(localId => {
|
|
275
286
|
return new Promise((resolve, reject) => {
|
|
276
287
|
wx.uploadImage({
|
|
277
288
|
localId: localId, // 需要上传的图片的本地ID,由chooseImage接口获得
|
|
278
|
-
isShowProgressTips:
|
|
289
|
+
isShowProgressTips: 0, // 默认为1,显示进度提示
|
|
279
290
|
success: function (res) {
|
|
280
291
|
let serverId = res.serverId; // 返回图片的服务器端ID
|
|
281
292
|
resolve(serverId);
|
|
@@ -290,6 +301,7 @@ let JsSDK = (function () {
|
|
|
290
301
|
try {
|
|
291
302
|
let serverIds = await Promise.all(uploadPromises);
|
|
292
303
|
console.log('choosePhoto',serverIds)
|
|
304
|
+
Toast.clear()
|
|
293
305
|
resolve({
|
|
294
306
|
appId: sessionStorage.getItem(APP_ID),
|
|
295
307
|
agentId: sessionStorage.getItem(AGENT_ID),
|
|
@@ -297,6 +309,7 @@ let JsSDK = (function () {
|
|
|
297
309
|
serverIds: serverIds
|
|
298
310
|
});
|
|
299
311
|
} catch (error) {
|
|
312
|
+
Toast.clear()
|
|
300
313
|
reject('上传图片失败:' + error);
|
|
301
314
|
}
|
|
302
315
|
},
|