|
@@ -359,6 +359,9 @@ let _self;
|
|
import Header from '../components/header.vue';
|
|
import Header from '../components/header.vue';
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue';
|
|
import moment from '@/common/moment';
|
|
import moment from '@/common/moment';
|
|
|
|
+import indexConfig from '@/config/index.config';
|
|
|
|
+console.log(indexConfig.uploadUrl)
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
Header,
|
|
Header,
|
|
@@ -928,7 +931,7 @@ export default {
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
_self.iconurl = res.tempFilePaths[0];
|
|
myCloud.uploadFile({
|
|
myCloud.uploadFile({
|
|
- url: 'http://tyou.xiudo.cn/merch/common/upload/oss',
|
|
|
|
|
|
+ url: indexConfig.uploadUrl,
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
filePath: _self.iconurl, // 要上传的文件对象
|
|
cloudPath: _self.iconurl, // 要上传的文件对象
|
|
cloudPath: _self.iconurl, // 要上传的文件对象
|
|
name: 'file',
|
|
name: 'file',
|
|
@@ -962,29 +965,28 @@ export default {
|
|
sourceType: ['album'], // camera 使用相机 album 从相册中选
|
|
sourceType: ['album'], // camera 使用相机 album 从相册中选
|
|
success: function (res) {
|
|
success: function (res) {
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
// 成功则返回图片的本地文件路径列表 tempFilePaths
|
|
- let img = [];
|
|
|
|
- img.push(res.tempFilePaths);
|
|
|
|
if (_self.pickList.length >= 6) {
|
|
if (_self.pickList.length >= 6) {
|
|
_self.$mHelper.toast('最多只可上传6张图片');
|
|
_self.$mHelper.toast('最多只可上传6张图片');
|
|
} else {
|
|
} else {
|
|
- _self.pickList = _self.pickList.concat(img);
|
|
|
|
- // for (let i = 0; i < _self.pickList.length; i++) {
|
|
|
|
- // let element = _self.pickList[i];
|
|
|
|
- // myCloud.uploadFile({
|
|
|
|
- // url: 'http://192.168.100.135:83/merch/common/upload/oss',
|
|
|
|
- // filePath: element, // 要上传的文件对象
|
|
|
|
- // cloudPath: element,
|
|
|
|
- // name: 'file',
|
|
|
|
- // onUploadProgress: function (progressEvent) {
|
|
|
|
- // // 上传进度回调
|
|
|
|
- // let percentCompleted = Math.round(
|
|
|
|
- // (progressEvent.loaded * 100) / progressEvent.total
|
|
|
|
- // );
|
|
|
|
- // },
|
|
|
|
- // success: (res) => {
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
|
|
+ _self.pickList = _self.pickList.concat(res.tempFilePaths).slice(0,6);
|
|
|
|
+ for (let i = 0; i < _self.pickList.length; i++) {
|
|
|
|
+ let element = _self.pickList[i];
|
|
|
|
+ myCloud.uploadFile({
|
|
|
|
+ url: indexConfig.uploadUrl,
|
|
|
|
+ filePath: element, // 要上传的文件对象
|
|
|
|
+ cloudPath: element,
|
|
|
|
+ name: 'file',
|
|
|
|
+ onUploadProgress: function (progressEvent) {
|
|
|
|
+ // 上传进度回调
|
|
|
|
+ let percentCompleted = Math.round(
|
|
|
|
+ (progressEvent.loaded * 100) / progressEvent.total
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|