jufubao-base 1.0.319-beta1 → 1.0.319-beta3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.319-beta1",
3
+ "version": "1.0.319-beta3",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -225,8 +225,13 @@
225
225
  sourceType: ['camera','album'],
226
226
  success: async (res) => {
227
227
  console.log('chooseImage',res);
228
- // let filePath = res.tempFilePaths[0];
229
- let file = res.tempFiles[0];
228
+ let file
229
+ // #ifdef MP-WEIXIN
230
+ file = res.tempFilePaths[0];
231
+ // #endif
232
+ // #ifdef H5
233
+ file = res.tempFiles[0];
234
+ // #endif
230
235
  this.$xdShowLoading({});
231
236
  try{
232
237
  let image = await this.uploadImage(file);
@@ -239,7 +244,7 @@
239
244
  })
240
245
  },
241
246
  uploadImage(file){
242
- let fileName = file.name;
247
+ let fileName = file.name||'image.png';
243
248
  return new Promise((resolve, reject) => {
244
249
  jfbRootExec("getConOssSign", {
245
250
  vm: this,
@@ -251,7 +256,12 @@
251
256
  delete res['cdn_url']
252
257
  uni.uploadFile({
253
258
  url: res.action,
259
+ // #ifdef H5
254
260
  file: file,
261
+ // #endif
262
+ // #ifdef MP-WEIXIN
263
+ filePath: file, // 小程序图片临时路径
264
+ // #endif
255
265
  name: 'file',
256
266
  formData: {
257
267
  ...res,