Commit 095dc532 authored by Damon's avatar Damon

Merge branch 'dev-1.5.0' into test

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