Commit 5ab4055d authored by Mac's avatar Mac

图片视频的判断

parent 7c320df1
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<u-upload ref="uUpload" :action="action" :show-tips="false" @on-remove="onRemove" <u-upload ref="uUpload" :action="action" :show-tips="false" @on-remove="onRemove"
@on-oversize="onversize" @on-oversize="onversize"
@on-exceed="onexceed" @on-exceed="onexceed"
:max-size="CompData.FileSizeLimit * 1024 * 1024" :max-size="CompData.FileSizeLimit==0?99999* 1024 * 1024:CompData.FileSizeLimit * 1024 * 1024"
:max-count="CompData.FileCount" :max-count="CompData.FileCount==0?'999999':CompData.FileCount"
:file-list="fileList" :file-list="fileList"
@on-success="uploadSuccessHandler" @on-success="uploadSuccessHandler"
></u-upload> ></u-upload>
......
...@@ -24,12 +24,20 @@ ...@@ -24,12 +24,20 @@
<u-icon class="u-icon" name="cross" size="30" color="#ffffff"></u-icon> <u-icon class="u-icon" name="cross" size="30" color="#ffffff"></u-icon>
</view> </view>
</view> </view>
<view style="border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;"> <view style="border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;" v-if="CompData.FileCount>0">
<view slot="addBtn" class="slot-btn" @click="upvideo()" v-if="FileList.length<CompData.FileCount"> <view slot="addBtn" class="slot-btn" @click="upvideo()" v-if=" FileList.length<CompData.FileCount">
<image class="image" <image class="image"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1616573063000_398.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1616573063000_398.png"
mode="widthFix"></image> mode="widthFix"></image>
</view> </view>
</view>
<view style="border-bottom: 1px solid #e2e2e2;padding-bottom: 10px;" v-if="CompData.FileCount==0">
<view slot="addBtn" class="slot-btn" @click="upvideo()" >
1
<image class="image"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/1616573063000_398.png"
mode="widthFix"></image>
</view>
</view> </view>
<view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view> <view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view>
...@@ -76,7 +84,18 @@ ...@@ -76,7 +84,18 @@
count: 1, count: 1,
sourceType: ['camera', 'album'], sourceType: ['camera', 'album'],
success: function(res) { success: function(res) {
console.log(res) console.log(res)
if(that.CompData.FileSizeLimit>0){//大于0 进入判断
let size = res.size
if(res.size>(that.CompData.FileSizeLimit*1024*1024)){
uni.showToast({
title:'视频超出设定的大小请重新上传',
icon:'none'
})
return
}
}
that.upFile(res.tempFilePath, 1) that.upFile(res.tempFilePath, 1)
uni.showLoading({ uni.showLoading({
title: '上传中...' title: '上传中...'
...@@ -92,9 +111,9 @@ ...@@ -92,9 +111,9 @@
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo") let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo")
.MallBaseId : .MallBaseId :
1; 1;
// let action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId let action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
var newPath = "/EduSystem/Test/Upload/" ; var newPath = "/EduSystem/Test/Upload/" ;
let action = "http://192.168.20.214:8120/Upload/UploadBase64?filePath="+newPath // let action = "http://192.168.20.214:8120/Upload/UploadBase64?filePath="+newPath
let that = this let that = this
uni.uploadFile({ uni.uploadFile({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment