xydata-tools 1.1.27 → 1.1.28

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.
@@ -344,7 +344,7 @@ export default {
344
344
  // #ifdef H5
345
345
  uploadTask = uni.uploadFile({
346
346
  url: this.finalUploadUrl,
347
- file: file,
347
+ filePath: file.path,
348
348
  name: 'file',
349
349
  success: (uploadFileRes) => {
350
350
  this.handleUploadSuccess(uploadFileRes, file)
@@ -245,11 +245,11 @@
245
245
  </view>
246
246
  </template>
247
247
 
248
- <script>
248
+ <script>
249
249
  import shmilyDragMedia from './shmily-drag-media.vue';
250
- import defaultAddPicBg from '../../../assets/defaultAddPicBg.png'
251
- import uploadVideoBg from '../../../assets/uploadVideoBg.png'
252
- import videoPlay from '../../../assets/videoPlay.png'
250
+ import defaultAddPicBg from '../../../assets/defaultAddPicBg.png';
251
+ import uploadVideoBg from '../../../assets/uploadVideoBg.png';
252
+ import videoPlay from '../../../assets/videoPlay.png';
253
253
 
254
254
  export default {
255
255
  name: 'MediaPicker',
@@ -520,36 +520,25 @@ export default {
520
520
  },
521
521
  // 拖拽模式下的图标和文字样式(预计算好,避免模板中使用方法调用报错)
522
522
  dragIconStyle() {
523
- return {
524
- width: this.uploadIconSize + 'rpx',
525
- height: this.uploadIconSize + 'rpx'
526
- };
523
+ return `width: ${this.uploadIconSize}rpx; height: ${this.uploadIconSize}rpx;`;
527
524
  },
528
525
  dragTextStyle() {
529
- return {
530
- fontSize: this.uploadTextSize + 'rpx'
531
- };
526
+ return `fontSize:${this.uploadTextSize}rpx`;
532
527
  },
533
-
534
528
  // ==================== 只读模式网格样式 ====================
535
529
  readonlyGridStyle() {
536
530
  // 如果指定了 itemWidth,使用固定宽度;否则使用 1fr 自动分配
537
531
  const columnWidth = this.itemWidth ? `${this.itemWidth}rpx` : '1fr';
538
-
539
- return {
540
- gridTemplateColumns: `repeat(${this.cols}, ${columnWidth})`,
541
- gap: '10rpx'
542
- };
532
+ return `display: grid; grid-template-columns: repeat(${this.cols}, ${columnWidth}); gap: 10rpx;`;
543
533
  },
544
-
545
534
  // ==================== 弹窗模式网格样式 ====================
546
535
  popupGridStyle() {
547
- return {
548
- gridTemplateColumns: `repeat(${this.cols}, 1fr)`,
549
- gap: '10rpx'
550
- };
536
+ return `display: grid; grid-template-columns: repeat(${this.cols}, 1fr); gap: 10rpx;`;
551
537
  }
552
538
  },
539
+ options: {
540
+ styleIsolation: 'shared'
541
+ },
553
542
  watch: {
554
543
  imageFiles: {
555
544
  handler(val) {
@@ -710,8 +699,8 @@ export default {
710
699
  mask: true
711
700
  });
712
701
 
713
- chooseImageRes.tempFiles.forEach((fileItem) => {
714
- this.uploadImageFile(this.finalUploadUrl, fileItem);
702
+ chooseImageRes.tempFilePaths.forEach((path) => {
703
+ this.uploadImageFile(this.finalUploadUrl, path);
715
704
  });
716
705
  },
717
706
  // #endif
@@ -792,10 +781,10 @@ export default {
792
781
  /**
793
782
  * 上传图片文件(非微信小程序,使用 File 对象)
794
783
  */
795
- uploadImageFile(url, file) {
784
+ uploadImageFile(url, filePath) {
796
785
  uni.uploadFile({
797
786
  url,
798
- file,
787
+ filePath,
799
788
  name: 'file',
800
789
  success: (uploadFileRes) => {
801
790
  if (uploadFileRes.statusCode !== 200) {
@@ -855,7 +844,7 @@ export default {
855
844
  /**
856
845
  * 上传图片文件(微信小程序,使用文件路径)
857
846
  */
858
- uploadImageFileByPath(url, filePath, previewPath) {
847
+ uploadImageFileByPath(url, filePath) {
859
848
  uni.uploadFile({
860
849
  url,
861
850
  filePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xydata-tools",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "xydata tools",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",