|
@@ -4,11 +4,14 @@
|
|
|
|
|
|
$scope.addpict = function () {
|
|
$scope.addpict = function () {
|
|
common.chooseImage().then(function (img) {
|
|
common.chooseImage().then(function (img) {
|
|
|
|
+ msg.loading();
|
|
common.uploadFiles(img,1).then(function (result) {
|
|
common.uploadFiles(img,1).then(function (result) {
|
|
|
|
+ msg.hide();
|
|
var response = JSON.parse(result.response);
|
|
var response = JSON.parse(result.response);
|
|
var file = config.imgServer + response.data.file;
|
|
var file = config.imgServer + response.data.file;
|
|
$scope.imgs.push(file);
|
|
$scope.imgs.push(file);
|
|
}, function (error) {
|
|
}, function (error) {
|
|
|
|
+ msg.hide();
|
|
msg.error('图片上传失败');
|
|
msg.error('图片上传失败');
|
|
});
|
|
});
|
|
}, function (error) {
|
|
}, function (error) {
|
|
@@ -17,7 +20,9 @@
|
|
};
|
|
};
|
|
$scope.addvideo = function () {
|
|
$scope.addvideo = function () {
|
|
common.chooseVideo().then(function (file) {
|
|
common.chooseVideo().then(function (file) {
|
|
|
|
+ msg.loading();
|
|
common.uploadFiles(file, 2).then(function (result) {
|
|
common.uploadFiles(file, 2).then(function (result) {
|
|
|
|
+ msg.hide();
|
|
var response = JSON.parse(result.response);
|
|
var response = JSON.parse(result.response);
|
|
$scope.video.server = response.data.file;
|
|
$scope.video.server = response.data.file;
|
|
var file = config.imgServer+response.data.file;
|
|
var file = config.imgServer+response.data.file;
|
|
@@ -27,6 +32,7 @@
|
|
$scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
|
|
$scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
|
|
console.log("vpic:"+$scope.video.vpic);
|
|
console.log("vpic:"+$scope.video.vpic);
|
|
}, function (error) {
|
|
}, function (error) {
|
|
|
|
+ msg.hide();
|
|
msg.error('视频上传失败');
|
|
msg.error('视频上传失败');
|
|
});
|
|
});
|
|
}, function (erro) {
|
|
}, function (erro) {
|