From 1e71dd86f6d0c4fc7e5143600d4bc4b50992a2a7 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 04 Jul 2024 14:51:28 +0800 Subject: [PATCH] fix: 高德密钥修改 --- uni_modules/cl-upload/readme.md | 253 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 253 insertions(+), 0 deletions(-) diff --git a/uni_modules/cl-upload/readme.md b/uni_modules/cl-upload/readme.md new file mode 100644 index 0000000..528b5f2 --- /dev/null +++ b/uni_modules/cl-upload/readme.md @@ -0,0 +1,253 @@ +### cl-upload ������������ + +> ��������������������������������������������������������������������������������� + + +> `���������������������������������������������������������������������������������������������������������������������,���������������������������������������������������������������������������������������������promise������ ������������` + +### ������������ +1. ratio ���������������������������������������������������height������������ +2. ������������������������������������������������������������������������ +3. ������������������������������������������������������������api������������������������������������������������������������������������������ +4. **������������������`https`, http���������������������������������** +5. ������������������`https`������������`cloudType: other` + +### H5������������ + + +#### list������������ + +1. ������������ +``` +['������1','������2'] +``` +2. JSON������ +``` +[ + { + path: '������1.png', + // ������������ + }, + { + path: '������2.mp4', + poster: '���������������.png' + // ������������ + }, + { + path: '������3.mp4', + poster: require('../../static/c1.png'), // ������������������������������ + // ������������ + }, +] +``` + +#### ������������ + +``` +<cl-upload v-model="list" action="������������" @onSuccess="onSuccess"></cl-upload> + +methods: { + /** + * ������������������������������������������ + * ��������������������������������������������������������������� + * */ + onSuccess(reslut) { + // ������������������������������������������list������������������������ + this.list.push(reslut.url) + }, +} +``` +### uniCloud������ +> ������������������������,������������������ + +``` +<cl-upload v-model="list" action="uniCloud"></cl-upload> +``` + +### ��������������� +> ������ listStyle ������������������������������������������������������������������ + +``` +<cl-upload v-model="list" :listStyle="{ + columns: 2, + columnGap: '20rpx', + rowGap:'20rpx', + padding:'10rpx', + height:'300rpx', + radius:'20rpx' +}"> + <template v-slot:addImg> + <view class="newAddImg"> + <view>���</view> + <text >������</text> + </view> + </template> +</cl-upload> +``` + +### ������������ +> ��������������������������������������� +``` +<cl-upload v-model="list" :add="false" :remove="false"></cl-upload> +``` + +### ������������ + +> ������ autoUpload ��������������������������������������������� refs ������������������������������������������������������������������������������ + +``` +<cl-upload + ref="upload2" + v-model="list2" + :autoUpload="false"></cl-upload> + +<button @tap="submit">������������</button> + +methods: { + submit() { + /** + * ������������������������������ + * */ + this.$refs.upload2.submit().then(reslut=>{ + console.log(reslut); // ��������������������������������������� + + // ������������������������������������������������ + // ������uniCloud������������ + const imgUrls = reslut.list.map(imgInfo=> imgInfo.url); + this.list2 = [...this.list2, ...imgUrls] + }) + }, +} +``` + +### ��������������������������������� +``` +/ ** +* ��������������������� useBeforeDelete +* ��������������������� useBeforeUpload +*/ +<cl-upload v-model="list" + useBeforeDelete + useBeforeUpload + @beforeDelete="beforeDelete" + @beforeUpload="beforeUpload"></cl-upload> + + +methods: { + /** + * ��������������� + * @param {Object} item ��������������������������������������� + * @param {Number} index ������������������������������������ + * @param {Function} next ��������������������������������������������� + * */ + beforeDelete(item, index, next) { + uni.showModal({ + title: '������������', + content: '���������������������������������', + success: res => { + if (res.confirm) { + // ��������������������� + setTimeout(() => { + next(); + }, 1000); + } + } + }); + }, + /** + * ��������������� + * @param {Object} tempFile ������������������������ + * @param {Function} next ��������������������������������������������� + * */ + beforeUpload(tempFile, next) { + // ��������������������� + // ������������������������������������������������������next(), ���������������������������list + } +} +``` + +## API + +| ������ | ������ | ������ | ��������� | ��������� | +| --- | --- | --- | --- | --- | +| action | ������������ | String |-| uniCloud | +| cloudPathAsRealPath | ������������, ���unicloud���������������`1.4.0` `HBuilderX 3.8.5` | Boolean |false| true | +| cloudType | ���������������(������������������������������������������ other���������video������������,������������������������������) | String |oss| ���������:oss ���������:vframe ���������:process ������:other | +| headers | ��������������������������� | Object | - |- | +| data | ������������������������������ | Object | - | - | +| fileName| ���������,������������������������ | String | file | - | +| fileType | ������������ | String | all | 'image', 'video', 'all' | +| imageFormData | ������������������ | Object | - | - | +| videoFromData | ������������������ | Object | - | - | +| listStyle | ������������ |Object | - | - | +| isPreviewImage | ������������������������ | Boolean | true |false | +| remove | ������������������������ | Boolean | true |false | +| add | ������������������ | Boolean | true |false | +| max | ������������������ | Number | 9 | - | +| maxVideo | ������������������������ | Number | ��������� | - | +| deleteTitle| ������������������������ | String | ������ | - | +| deleteText| ������������������������ | String | ������������������������ | - | +| loadingText| ������������ | String | ���������������... | - | +| useBeforeDelete| ��������������������������� | Boolean | false | true | +| useBeforeUpload | ��������������������������� | Boolean | false | true | +| addImg| ������������������ | String | - | - | +| playImg| ������������������ | String | - | - | +| deleteImg| ������������������ | String | - | - | +| closeImg| ������������������������ | String | - | - | + +#### imageFormData + +| ������ | ������ | ������ | ��������� | ��������� | +| --- | --- | --- | --- | --- | +| count | ��������������������������������� | number |9| - | +| sizeType | original ���������compressed ��������� | array | ������������������ |- | +| sourceType | ������������������ | array | ['camera ', 'album'] | ['camera ', 'album'] | +| compress | ������������������������ | Boolean | false | true | +| quality | ������������ | number | 80 | - | +| size | ������������ | number | - | ������MB | + +#### videoFromData + +| ������ | ������ | ������ | ��������� | ��������� | +| --- | --- | --- | --- | --- | +| maxDuration | ������������������������������ | number |60| ������60��� | +| camera | ������������������������ | array | - |- | +| compressed | ��������������������������������������� | Boolean | true |- | +| sourceType | ������������������ | array | ['camera ', 'album'] | ['camera ', 'album'] | +| size | ������������ | number | - | ������MB | + +#### listStyle + +| ������ | ������ | ������ | ��������� | ��������� | +| --- | --- | --- | --- | --- | +| columns | ������������ | number |4| - | +| columnGap | ��������� | string | '40rpx' |- | +| rowGap | ��������� | string | '40rpx' |- | +| padding | ��������������� | string | '0 0rpx' |- | +| ratio | ������������ | string | '1/1' | ������������������������,������������height������ | +| height | ������������ | string | '140rpx' |- | +| radius | ������������ | string | '6rpx' |- | + +#### Events + +| ��������� | ������ | ������������ | +| --- | --- | --- | +| onSuccess | ������������ | data: ��������������������� | +| onError | ������������ | error:������������ | +| onImage | ������������ | item: ������������ index: ������������ | +| onVideo | ������������ | item: ������������ index: ������������ | +| onProgress | ������������ | onProgress������������| +| onVideoMax | ������������������������������ | maxVideo, fileLength| +| onImageSize | ������������������������������ | ������������ | +| beforeDelete | ��������������� | item: ������������ index:������������ next:������������������������ | +| beforeUpload | ��������������� | tempFile: ������������ next:������������������������ | + +#### onProgress������������ +| ��������� | ������ | +| --- | --- | +| progress | ��������������������� | +| totalBytesSent | ��������������������������� | +| totalBytesExpectedToSend | ������������������������������������ | + + +### [������������������������ uniapp ������QQ��� 553291781](https://jq.qq.com/?_wv=1027&k=5UkMN1QX) \ No newline at end of file -- Gitblit v1.8.0