@xtdev/xt-miniprogram-ui 1.2.77 → 1.2.79

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.
@@ -1,20 +1,20 @@
1
1
  // src/xt-uploader/index.js
2
- const utils = require("./utils");
2
+ const utils = require('./utils');
3
3
  // 节流函数
4
- function _throttle(fn, wait = 500, isImmediate = false){
4
+ function _throttle(fn, wait = 500, isImmediate = false) {
5
5
  var flag = true;
6
- return function(){
7
- if(flag == true){
8
- var context = this
9
- var args = arguments
10
- flag = false
11
- isImmediate && fn.apply(context,args)
6
+ return function () {
7
+ if (flag == true) {
8
+ var context = this;
9
+ var args = arguments;
10
+ flag = false;
11
+ isImmediate && fn.apply(context, args);
12
12
  setTimeout(() => {
13
- !isImmediate && fn.apply(context,args)
14
- flag = true
15
- },wait)
13
+ !isImmediate && fn.apply(context, args);
14
+ flag = true;
15
+ }, wait);
16
16
  }
17
- }
17
+ };
18
18
  }
19
19
 
20
20
  Component({
@@ -24,11 +24,11 @@ Component({
24
24
  properties: {
25
25
  title: {
26
26
  type: String,
27
- value: "",
27
+ value: '',
28
28
  },
29
29
  icon: {
30
30
  type: String,
31
- value: "https://img.tanjiu.cn/home/DDDsrH7PpNhneQsXGFmGGPcSM3QYXG8N.png",
31
+ value: 'https://img.tanjiu.cn/home/DDDsrH7PpNhneQsXGFmGGPcSM3QYXG8N.png',
32
32
  },
33
33
  fileList: {
34
34
  type: Array,
@@ -40,16 +40,16 @@ Component({
40
40
  },
41
41
  uploadDesc: {
42
42
  type: String,
43
- value: "",
43
+ value: '',
44
44
  },
45
45
  // ["album", "camera"]
46
46
  sourceType: {
47
47
  type: Array,
48
- value: ["album", "camera"],
48
+ value: ['album', 'camera'],
49
49
  },
50
50
  fileType: {
51
51
  type: String,
52
- value: "image",
52
+ value: 'image',
53
53
  },
54
54
  customUpload: {
55
55
  type: Boolean,
@@ -72,14 +72,45 @@ Component({
72
72
  */
73
73
  waterData: {
74
74
  type: Object | null,
75
- value: null
75
+ value: null,
76
76
  },
77
77
  },
78
78
 
79
79
  /**
80
80
  * 组件的初始数据
81
81
  */
82
- data: {},
82
+ data: {
83
+ tempFileList: [], // 临时文件列表
84
+ },
85
+ /**
86
+ * 初始化本地数据
87
+ */
88
+ observers: {
89
+ fileList: function (newVal, oldVal) {
90
+ const { tempFileList } = this.data;
91
+ newVal.forEach(url => {
92
+ const urlIndex = tempFileList.findIndex(item => {
93
+ // 获取文件后缀
94
+ const suffix = url.split('.').pop();
95
+ // 根据文件后缀判断视频还是照片
96
+ if (['mp4', 'mkv', 'avi', 'mov', 'flv'].includes(suffix)) {
97
+ item.fileType = 'video';
98
+ } else {
99
+ item.fileType = 'image';
100
+ }
101
+ // 取图片文件名对比
102
+ const fileName = item.url.split('/').pop();
103
+ return fileName.includes(url.split('/').pop());
104
+ });
105
+ if (urlIndex === -1) {
106
+ tempFileList.push({ url, updateStatus: 'success' });
107
+ }
108
+ });
109
+ this.setData({
110
+ tempFileList,
111
+ });
112
+ },
113
+ },
83
114
 
84
115
  /**
85
116
  * 组件的方法列表
@@ -98,137 +129,204 @@ Component({
98
129
  onDelete(e) {
99
130
  const url = e.currentTarget.dataset.url;
100
131
  const index = e.currentTarget.dataset.index;
101
- this.properties.fileList.splice(index, 1);
102
- this.triggerEvent("delete", {
103
- fileList: this.properties.fileList,
104
- url,
105
- index,
132
+ let { tempFileList } = this.properties;
133
+ // 判断删除的本地临时文件还是后台图片
134
+ tempFileList.splice(index, 1);
135
+ this.setData({
136
+ tempFileList,
106
137
  });
138
+ if (!url.startsWith('http://tmp')) {
139
+ const fileList = tempFileList.map(item => item.url);
140
+ this.triggerEvent('delete', {
141
+ fileList,
142
+ url,
143
+ index,
144
+ });
145
+ }
107
146
  },
108
147
  // 上传成功
109
148
  onUploadSuccess(files, url) {
110
- this.triggerEvent("upload", { fileList: files, url });
149
+ this.triggerEvent('upload', { fileList: files, url });
111
150
  },
112
151
  // 上传失败
113
152
  onUploadError(errMsg) {
114
- this.triggerEvent("error", { errMsg });
153
+ this.triggerEvent('error', { errMsg });
154
+ },
155
+ /**
156
+ * 重新上传
157
+ * @param {*} e
158
+ */
159
+ reUpload(e) {
160
+ const reloadItem = e.currentTarget.dataset.item;
161
+ const url = reloadItem.url;
162
+ const { tempFileList } = this.data;
163
+ tempFileList.forEach(item => {
164
+ if (item.url === url) {
165
+ item.updateStatus = 'uploading';
166
+ }
167
+ });
168
+ this.setData({
169
+ tempFileList,
170
+ });
171
+ this.startUpload(reloadItem);
115
172
  },
116
173
  // 点击上传
117
- startTakePhoto: _throttle(function (e) {
118
- console.log("onStartTakePhoto", e);
119
- const _this = this;
120
- const {
121
- customUpload,
122
- uploadApi,
123
- max,
124
- sourceType,
125
- fileList,
126
- fileType,
127
- waterData,
128
- } = this.properties;
129
- if (customUpload) {
130
- this.triggerEvent("upload", {});
131
- return;
132
- }
133
- if (!uploadApi || !uploadApi.url) {
134
- wx.showToast({
135
- title: "请传入上传接口",
136
- icon: "error",
137
- });
138
- return;
139
- }
140
- // ios企微环境下不支持该API
141
- const { platform, environment } = this.getSystemInfo();
142
- console.log(platform, environment);
143
- let chooseImgApi = (environment !== "wxwork" || platform !== "ios") ? wx.chooseMedia : fileType == 'video' ? wx.chooseVideo : wx.chooseImage;
144
- chooseImgApi({
145
- count: max - fileList.length,
146
- mediaType: ["image"],
147
- mediaType: fileType == "video" ? ["video"] : ["image"],
148
- sizeType: ["compressed"],
149
- sourceType,
150
- success(res) {
151
- console.log(res, "0000");
152
- if (fileType == "video" && res.tempFiles[0].size / 1024 / 1024 > 100) {
153
- // 视频上传不允许超过100M
154
- wx.showToast({title: '视频大小不可超过100M', icon: "none"});
155
- return;
156
- }
157
- // tempFilePath可以作为img标签的src属性显示图片
158
- const tempFilePaths = res.tempFiles;
159
- if (Array.isArray(tempFilePaths) && tempFilePaths.length) {
160
- Promise.allSettled(
161
- tempFilePaths.map((temp) =>
162
- _this[waterData?'uploadWaterFile' : 'uploadImage_v'](temp.tempFilePath || temp.path, waterData)
163
- )
164
- ).then((uploadRes) => {
165
- wx.hideLoading();
166
- console.log("----uploadRes", uploadRes);
167
- // 上传成功
168
- const successUrls = uploadRes
169
- .filter((result) => result.status == "fulfilled")
170
- .map((result) => result.value);
171
- if (successUrls.length) {
172
- const files = fileList.concat(successUrls);
173
- _this.onUploadSuccess(files, successUrls);
174
- }
175
- // 上传失败
176
- const errorList = uploadRes.filter(
177
- (result) => result.status == "rejected"
178
- );
179
- if (errorList.length) {
180
- _this.onUploadError(errorList[0].value);
181
- }
174
+ startTakePhoto: _throttle(
175
+ function (e) {
176
+ console.log('onStartTakePhoto', e);
177
+ const _this = this;
178
+ const { customUpload, uploadApi, max, sourceType, fileList, fileType, tempFileList } = this.properties;
179
+ if (customUpload) {
180
+ this.triggerEvent('upload', {});
181
+ return;
182
+ }
183
+ if (!uploadApi || !uploadApi.url) {
184
+ wx.showToast({
185
+ title: '请传入上传接口',
186
+ icon: 'error',
187
+ });
188
+ return;
189
+ }
190
+ // ios企微环境下不支持该API
191
+ const { platform, environment } = this.getSystemInfo();
192
+ console.log(platform, environment);
193
+ let chooseImgApi =
194
+ environment !== 'wxwork' || platform !== 'ios'
195
+ ? wx.chooseMedia
196
+ : fileType == 'video'
197
+ ? wx.chooseVideo
198
+ : wx.chooseImage;
199
+ chooseImgApi({
200
+ count: max - fileList.length,
201
+ mediaType: ['image'],
202
+ mediaType: fileType == 'video' ? ['video'] : ['image'],
203
+ sizeType: ['compressed'],
204
+ sourceType,
205
+ maxDuration: 60,
206
+ success(res) {
207
+ console.log(res, '0000');
208
+ let { tempFiles, tempFilePath } = res;
209
+ if (!tempFiles && !tempFilePath) {
210
+ return wx.showToast({ title: '文件读取失败', icon: 'none' });
211
+ }
212
+ // 兼容旧版本 wx.chooseVideo 返回的不是数组
213
+ if (!tempFiles) {
214
+ tempFiles = [res];
215
+ }
216
+ if (fileType == 'video' && res.tempFiles[0].size / 1024 / 1024 > 100) {
217
+ // 视频上传不允许超过100M
218
+ wx.showToast({ title: '视频大小不可超过100M', icon: 'none' });
219
+ return;
220
+ }
221
+ const newFileList = tempFiles.map((temp, index) => ({
222
+ url: temp.tempFilePath || temp.path,
223
+ name: temp.fileName || temp.name,
224
+ size: temp.size,
225
+ fileType: temp.fileType || temp.type,
226
+ updateStatus: 'uploading',
227
+ processText: '视频上传中',
228
+ id: temp.id || Date.now() + index,
229
+ }));
230
+ let showTempFiles = tempFileList.concat(newFileList);
231
+ _this.setData({
232
+ tempFileList: showTempFiles,
182
233
  });
183
- }
184
- },
185
- fail(error) {
186
- _this.onUploadError(error && error.errMsg);
187
- console.log("-----选取失败", error && error.errMsg);
188
- },
189
- });
190
- }, 1500, true),
234
+ // 校验是否需要打水印
235
+ newFileList.forEach(temp => {
236
+ _this.startUpload(temp);
237
+ });
238
+ },
239
+ fail(error) {
240
+ _this.onUploadError(error && error.errMsg);
241
+ console.log('-----选取失败', error && error.errMsg);
242
+ },
243
+ });
244
+ },
245
+ 1500,
246
+ true
247
+ ),
191
248
  getSystemInfo() {
192
- const environment = wx.getSystemInfoSync().environment || "wechat";
249
+ const environment = wx.getSystemInfoSync().environment || 'wechat';
193
250
  const platform = wx.getSystemInfoSync().platform;
194
251
  return {
195
252
  environment,
196
253
  platform,
197
254
  };
198
255
  },
256
+ /**
257
+ * 开始上传
258
+ */
259
+ async startUpload(temp) {
260
+ const _this = this;
261
+ const { waterData } = this.properties;
262
+ const { tempFileList = [] } = this.data;
263
+ _this[waterData ? 'uploadWaterFile' : 'uploadImage_v'](temp.url, waterData)
264
+ .then(({ url, tempFilePath }) => {
265
+ console.log('----uploadRes', url, temp);
266
+ url = url.replace('http://', 'https://');
267
+ url = url.replace('stsapp.oss-cn-hangzhou.aliyuncs.com', 'img.tanjiu.cn');
268
+
269
+ tempFileList.forEach(temp => {
270
+ if (temp.url == tempFilePath) {
271
+ temp.url = url;
272
+ temp.processText = '上传成功';
273
+ temp.updateStatus = 'success';
274
+ }
275
+ });
276
+ _this.setData({
277
+ tempFileList,
278
+ });
279
+ const files = tempFileList.map(temp => temp.url);
280
+ _this.onUploadSuccess(files, url);
281
+ })
282
+ .catch(({ url, tempFilePath }) => {
283
+ tempFileList.forEach(temp => {
284
+ if (temp.url == tempFilePath) {
285
+ temp.processText = '上传失败';
286
+ temp.updateStatus = 'failed';
287
+ }
288
+ });
289
+ _this.setData({
290
+ tempFileList,
291
+ });
292
+ });
293
+ },
199
294
  /** 上传水印照片 */
200
- async uploadWaterFile(
201
- path,
202
- data = {},
203
- url = "core/file/upload/multiV2",
204
- baseUrl = "https://gateway.tanjiu.cn/",
205
- ) {
295
+ async uploadWaterFile(path, data = {}, url = 'core/file/upload/multiV2', baseUrl = 'https://gateway.tanjiu.cn/') {
206
296
  return new Promise((reslove, reject) => {
207
297
  let fullUrl = baseUrl + url;
208
- wx.showLoading("上传中");
209
298
  wx.uploadFile({
210
299
  url: fullUrl,
211
300
  filePath: path,
212
- name: "file",
301
+ name: 'file',
213
302
  formData: data,
214
303
  header: {
215
- "Content-Type": "multipart/form-data",
216
- "wow-token": "c9fbecb5fdeecb78e8745db9225d88e1",
304
+ 'Content-Type': 'multipart/form-data',
305
+ 'wow-token': 'c9fbecb5fdeecb78e8745db9225d88e1',
217
306
  },
218
- success: (res) => {
307
+ success: res => {
219
308
  let result = JSON.parse(res.data);
220
- if (result.code == "0000") {
221
- reslove(result.data[0]);
309
+ if (result.code == '0000') {
310
+ reslove({
311
+ url: result.data[0],
312
+ tempFilePath: path, // 原始文件路径
313
+ });
222
314
  } else {
223
- reject(result.msg)
315
+ reject({
316
+ errMsg: result.msg,
317
+ tempFilePath: path,
318
+ });
224
319
  }
225
320
  },
226
- fail: (err) => {
321
+ fail: err => {
227
322
  wx.showToast({
228
323
  title: '上传失败',
229
- icon: "error",
230
- })
231
- reject(err);
324
+ icon: 'error',
325
+ });
326
+ reject({
327
+ errMsg: err.errMsg,
328
+ tempFilePath: path,
329
+ });
232
330
  },
233
331
  });
234
332
  });
@@ -237,15 +335,14 @@ Component({
237
335
  uploadImage_v(filePaths) {
238
336
  return new Promise((resolve, reject) => {
239
337
  const { url, fileDir, ...header } = this.properties.uploadApi;
240
- wx.showLoading({title: "上传中", mask: true});
241
338
  utils.newHttp(
242
339
  url,
243
- "GET",
340
+ 'GET',
244
341
  {
245
- dir: fileDir || "microComponents",
342
+ dir: fileDir || 'microComponents',
246
343
  },
247
344
  header,
248
- (res) => {
345
+ res => {
249
346
  const { host, signature, accessKeyId, policy, dir } = res.data;
250
347
  if (host) {
251
348
  let path = filePaths;
@@ -253,40 +350,38 @@ Component({
253
350
  wx.uploadFile({
254
351
  url: host,
255
352
  filePath: filePaths,
256
- name: "file",
353
+ name: 'file',
257
354
  formData: {
258
- key: dir + "/" + name,
355
+ key: dir + '/' + name,
259
356
  policy,
260
- success_action_status: "200",
357
+ success_action_status: '200',
261
358
  OSSAccessKeyId: accessKeyId,
262
359
  signature,
263
360
  },
264
361
  header: {
265
362
  // "Content-Type": "multipart/form-data",
266
363
  },
267
- success: (res) => {
364
+ success: res => {
268
365
  if (res.statusCode == 200) {
269
- let url = host + dir + "/" + name;
270
- resolve(url);
271
- // fileList.push(url);
272
- // _this.onUploadSuccess(url);
273
- // wx.showToast({
274
- // icon: "success",
275
- // title: "上传成功",
276
- // });
366
+ let url = host + dir + '/' + name;
367
+ resolve({
368
+ url: url,
369
+ tempFilePath: path, // 原始文件路径
370
+ });
277
371
  }
278
372
  },
279
- fail: (err) => {
280
- reject(err.errMsg || "网络错误,请重试");
281
- // _this.onUploadError(err.errMsg || "网络错误,请重试");
282
- // wx.showToast({
283
- // icon: "error",
284
- // title: err.errMsg || "网络错误,请重试",
285
- // });
373
+ fail: err => {
374
+ reject({
375
+ errMsg: err.errMsg || '网络错误,请重试',
376
+ tempFilePath: path,
377
+ });
286
378
  },
287
379
  });
288
380
  } else {
289
- reject(res.message);
381
+ reject({
382
+ errMsg: res.message || '网络错误,请重试',
383
+ tempFilePath: filePaths,
384
+ });
290
385
  // _this.onUploadError(res.message);
291
386
  }
292
387
  }
@@ -1,7 +1,5 @@
1
1
  {
2
2
  "component": true,
3
3
  "styleIsolation": "apply-shared",
4
- "usingComponents": {
5
- "xt-icon": "../xt-icon/index"
6
- }
4
+ "usingComponents": {}
7
5
  }
@@ -2,21 +2,52 @@
2
2
  <view class="xt-uploader">
3
3
  <view class="title_text" wx:if="{{title}}">{{title}}</view>
4
4
  <view class="file_box">
5
- <view wx:for="{{fileList}}" wx:key="index" class="file_item">
6
- <block wx:if="{{fileType == 'video'}}">
7
- <video class="file_img" src="{{item}}" mode="aspectFill" data-url="{{item}}" data-index="{{index}}" />
8
- <!-- 删除 -->
9
- <image src="https://img.tanjiu.cn/home/idzQXfttSiQryeX3jYEfc5xjWhZPdwY4.png" class="close_box" mode="aspectFill" bindtap="onDelete" data-url="{{item}}" data-index="{{index}}" wx:if="{{!disabled}}"></image>
10
- </block>
11
- <block wx:else>
12
- <image class="file_img" src="{{item}}" mode="aspectFit" bindtap="onPreviewImage" data-url="{{item}}" data-index="{{index}}" />
13
- <!-- 删除 -->
14
- <xt-icon icon="shanchu" size="48" class="close_box" bindtap="onDelete" data-url="{{item}}" data-index="{{index}}" wx:if="{{!disabled}}"></xt-icon>
15
- </block>
5
+ <view wx:for="{{tempFileList}}" wx:key="index" class="file_wrap">
6
+ <view class="file_item">
7
+ <block wx:if="{{fileType == 'video'}}">
8
+ <video class="file_img" src="{{item.url}}" mode="aspectFill" data-url="{{item.url}}" data-index="{{index}}" />
9
+ <!-- 删除 -->
10
+ <image
11
+ src="https://img.tanjiu.cn/home/idzQXfttSiQryeX3jYEfc5xjWhZPdwY4.png"
12
+ class="close_box"
13
+ mode="aspectFill"
14
+ bindtap="onDelete"
15
+ data-url="{{item.url}}"
16
+ data-index="{{index}}"
17
+ wx:if="{{!disabled}}"
18
+ ></image>
19
+ </block>
20
+ <block wx:else>
21
+ <image class="file_img" src="{{item.url}}" mode="aspectFit" bindtap="onPreviewImage" data-url="{{item.url}}" data-index="{{index}}" />
22
+ <!-- 删除 -->
23
+ <image
24
+ src="https://img.tanjiu.cn/home/idzQXfttSiQryeX3jYEfc5xjWhZPdwY4.png"
25
+ class="close_box"
26
+ mode="aspectFill"
27
+ bindtap="onDelete"
28
+ data-url="{{item.url}}"
29
+ data-index="{{index}}"
30
+ wx:if="{{!disabled}}"
31
+ ></image>
32
+ </block>
33
+ </view>
34
+ <!-- 上传状态 -->
35
+ <view class="loading-progress" wx:if="{{item.updateStatus == 'uploading'}}">
36
+ <view class="progress-inner"></view>
37
+ </view>
38
+ <view class="upload-progress" wx:if="{{item.updateStatus == 'uploading'}}">{{item.fileType == 'video'? '视频':'照片'}}上传中</view>
39
+
40
+ <view class="upload-success" wx:elif="{{item.updateStatus == 'success'}}">
41
+ <image class="icon" src="https://img.tanjiu.cn/home/DziAN8B4eaB6r2h4WX7b55Zj6F4WW4Kn.png"></image> {{item.fileType == 'video'? '视频':'照片'}}上传成功
42
+ </view>
43
+ <view class="upload-failed" wx:elif="{{item.updateStatus == 'failed'}}">
44
+ <image class="icon" src="https://img.tanjiu.cn/home/dtBtxsJYcQbhnbcZN5hKCyiFkS3TFiHy.png"></image>
45
+ <view bind:tap="reUpload" data-item="{{item}}"> 上传失败,<text class="reupload">重新上传</text> </view>
46
+ </view>
16
47
  </view>
17
48
  <view class="file_item" wx:if="{{!disabled && fileList.length<max}}" bindtap="startTakePhoto">
18
49
  <image src="{{icon}}" class="camera_icon" />
19
50
  <view wx:if="{{uploadDesc}}" class="upload_desc">{{uploadDesc}}</view>
20
51
  </view>
21
52
  </view>
22
- </view>
53
+ </view>
@@ -1,37 +1,38 @@
1
1
  /* src/xt-uploader/index.wxss */
2
2
  .xt-uploader {
3
- background-color : #fff;
3
+ background-color: #fff;
4
4
  /* padding : 32rpx;
5
5
  padding-bottom : 0; */
6
6
  }
7
7
 
8
8
  .title_text {
9
9
  line-height: 48rpx;
10
- font-size : 34rpx;
11
- font-family: PingFang SC-Semibold,
10
+ font-size: 34rpx;
11
+ font-family:
12
+ PingFang SC-Semibold,
12
13
  PingFang SC;
13
- font-weight : 800;
14
- color : #000000;
14
+ font-weight: 800;
15
+ color: #000000;
15
16
  margin-bottom: 16rpx;
16
17
  }
17
18
 
18
19
  .file_box {
19
- display : flex;
20
+ display: flex;
20
21
  flex-wrap: wrap;
21
22
  }
22
23
 
23
24
  .file_item {
24
- width : 196rpx;
25
- height : 196rpx;
26
- border-radius : 8rpx;
27
- overflow : hidden;
28
- position : relative;
29
- display : flex;
30
- flex-direction : column;
31
- justify-content : center;
32
- align-items : center;
33
- background-color: #F5F5F5;
34
- margin-bottom : 16rpx;
25
+ width: 196rpx;
26
+ height: 196rpx;
27
+ border-radius: 8rpx;
28
+ overflow: hidden;
29
+ position: relative;
30
+ display: flex;
31
+ flex-direction: column;
32
+ justify-content: center;
33
+ align-items: center;
34
+ background-color: #f5f5f5;
35
+ margin-bottom: 16rpx;
35
36
  flex-shrink: 0;
36
37
  }
37
38
 
@@ -40,31 +41,98 @@
40
41
  }
41
42
 
42
43
  .camera_icon {
43
- width : 80rpx;
44
+ width: 80rpx;
44
45
  height: 80rpx;
45
46
  }
46
47
 
47
48
  .file_img {
48
- width : 196rpx;
49
+ width: 196rpx;
49
50
  height: 196rpx;
50
51
  }
51
52
 
52
53
  .close_box {
53
- position : absolute;
54
+ position: absolute;
54
55
  line-height: 48rpx;
55
- width : 48rpx;
56
- height : 48rpx;
57
- top : 0;
58
- right : 0;
59
- color : rgba(0, 0, 0, 0.5);
56
+ width: 48rpx;
57
+ height: 48rpx;
58
+ top: 0;
59
+ right: 0;
60
+ color: rgba(0, 0, 0, 0.5);
60
61
  }
61
62
 
62
63
  .upload_desc {
63
64
  line-height: 40rpx;
64
- font-size : 28rpx;
65
- font-family: PingFang SC-Regular,
65
+ font-size: 28rpx;
66
+ font-family:
67
+ PingFang SC-Regular,
66
68
  PingFang SC;
67
69
  font-weight: 400;
68
- color : #727272;
69
- margin-top : 8rpx;
70
- }
70
+ color: #727272;
71
+ margin-top: 8rpx;
72
+ }
73
+
74
+ .loading-progress {
75
+ width: 100%;
76
+ height: 20rpx;
77
+ background-color: #eee;
78
+ border-radius: 10rpx;
79
+ overflow: hidden;
80
+ position: relative;
81
+ }
82
+ .progress-inner {
83
+ height: 100%;
84
+ background-color: #6722ab;
85
+ width: 0;
86
+ border-radius: 10rpx 0 0 10rpx;
87
+ animation: loadProgress 20s forwards ease-in-out;
88
+ }
89
+
90
+ .upload-progress {
91
+ opacity: 0.8;
92
+ font-size: 28rpx;
93
+ }
94
+
95
+ .upload-success {
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ gap: 2rpx;
100
+ font-family:
101
+ PingFang SC,
102
+ PingFang SC;
103
+ font-weight: 600;
104
+ font-size: 18rpx;
105
+ color: #30bf67;
106
+ line-height: 26rpx;
107
+ }
108
+
109
+ .upload-success .icon {
110
+ width: 24rpx;
111
+ height: 24rpx;
112
+ }
113
+
114
+ .upload-failed {
115
+ font-family:
116
+ PingFang SC,
117
+ PingFang SC;
118
+ font-weight: 600;
119
+ font-size: 18rpx;
120
+ color: #ff4d4d;
121
+ line-height: 26rpx;
122
+ text-align: center;
123
+ }
124
+ .upload-failed .icon {
125
+ width: 24rpx;
126
+ height: 24rpx;
127
+ }
128
+ .reupload {
129
+ text-decoration: underline;
130
+ }
131
+ @keyframes loadProgress {
132
+ from {
133
+ width: 0;
134
+ }
135
+ to {
136
+ width: 100%;
137
+ }
138
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtdev/xt-miniprogram-ui",
3
- "version": "1.2.77",
3
+ "version": "1.2.79",
4
4
  "description": "",
5
5
  "miniprogram": "libs",
6
6
  "publishConfig": {