Commit 095dc532 authored by Damon's avatar Damon

Merge branch 'dev-1.5.0' into test

parents 01d7cc6c 249473cc
......@@ -192,7 +192,16 @@
this.$emit('action', this.info)
},
handleOperate() {
uni.showModal({
title: '提示',
content: '确定' + this.buttonText + '?',
success: function (res) {
if (res.confirm) {
this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
} else if (res.cancel) {
}
}
})
},
handleClickExpress() {
this.$emit('express', this.info)
......
......@@ -153,8 +153,8 @@ export default {
onEachUpdate(res){
// 多文件上传每个文件上传成功触发
if(imgList.length>res.fileIndex){
imgList[res.fileIndex].key = res.url
imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url
imgList[res.fileIndex].key = res.key
imgList[res.fileIndex].src = res.key // uploader.qiniuTokenObj.visitPrefix + res.key
}
self.imgList = imgList
},
......
......@@ -208,6 +208,18 @@
},
methods: {
handleClick() {
uni.showModal({
title: '提示',
content: '确定' + this.buttonText + '?',
success: function (res) {
if (res.confirm) {
this.handleClickSure()
} else if (res.cancel) {
}
}
})
},
handleClickSure() {
this.$u.api[this.buttonOperateType](this.info.id).then(res => {
var type = 'error'
var message = res.message
......
......@@ -3,7 +3,8 @@ const {
chooseImage,
chooseVideo,
qiniuUpload,
urlUpload
urlUpload,
randomChar
} = require("./utils");
import {
mergeConfig
......@@ -16,9 +17,17 @@ export default class fileUpload extends request {
}
//七牛云上传图片
async qnImgUpload(options = {}) {
let files;
let files
try {
files = await chooseImage(options);
const lists = await chooseImage(options);
files = lists.map(v => {
const key = randomChar(10)
return {
...v,
key: key,
src: key
}
})
// 选择完成回调
options.onSelectComplete && options.onSelectComplete(files);
} catch (err) {
......
......@@ -9,7 +9,7 @@ export const randomChar = function(l, url = "") {
tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
}
return (
"file/" +
"scn/file/" +
url +
time.getTime() +
tmp
......
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