Mike %!s(int64=7) %!d(string=hai) anos
pai
achega
64618e7db5

+ 5 - 3
miaomiao/www/js/controllers/add.js

xqd xqd
@@ -17,13 +17,15 @@
             };
             $scope.addvideo = function () {
                 common.chooseVideo().then(function (file) {
-                    $scope.video.path = file;
                     common.uploadFiles(file, 2).then(function (result) {
                         var response = JSON.parse(result.response);
+                        $scope.video.server = response.data.file;
                         var file = config.imgServer+response.data.file;
                         console.log("file:"+file);
                         $scope.video.isOK = true;
-                        $scope.video.server = file;
+                        $scope.video.file = file;
+                        $scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
+                        console.log("vpic:"+$scope.video.vpic);
                     }, function (error) {
                         msg.error('视频上传失败');
                     });
@@ -56,7 +58,7 @@
                 });
             };
             $scope.$on('$ionicView.beforeEnter', function () {
-                $scope.imgs=['http://miao.beiyuesi.com/attachment/85aff9f4c92890104b34c2a878312009'];
+                $scope.imgs=[];
                 $scope.video = {};
                 $scope.vm={
                     name:'',

+ 4 - 0
miaomiao/www/js/controllers/home.js

xqd xqd
@@ -225,6 +225,8 @@
                 msg.hide();
                 console.log(result);
                 $scope.dream = result.data.data;
+                $scope.dream.video = config.imgServer+$scope.dream.video;
+                $scope.dream.vpic = config.server+'upload/vpic/'+$scope.dream.video+'.jpg';
                 var reg = new RegExp("\n", "g");
                 $scope.dream.about = $scope.dream.about.replace(reg, "<br/>");
                 var end_time = new Date($scope.dream.end_time.replace(/-/g, "/"));
@@ -585,6 +587,8 @@
                     msg.hide();
                     console.log(result);
                     $scope.dream = result.data.data;
+                    $scope.dream.video = config.imgServer+$scope.dream.video;
+                    $scope.dream.vpic = config.server+'upload/vpic/'+$scope.dream.video+'.jpg';
                     var reg = new RegExp("\n", "g");
                     $scope.dream.about = $scope.dream.about.replace(reg, "<br/>");
                     var end_time = new Date($scope.dream.end_time.replace(/-/g, "/"));

+ 2 - 2
miaomiao/www/js/controllers/my.js

xqd
@@ -494,9 +494,9 @@
             $scope.addQrcode = function(){
                 var data = {
                     data:{
-                        type:$scope.vm.bank_name,
+                        bank_name:$scope.vm.bank_name,
                         //bank_number:$scope.imgs
-                        url:$scope.vm.file
+                        qrcode:$scope.vm.file
                     }
                 };
                 myService.addQrcode(data).then(function(result){

+ 1 - 1
miaomiao/www/templates/add/index.html

xqd
@@ -27,7 +27,7 @@
                     <img src="img/icon_photo.svg" style="height: 40px; width: 40px; text-align: center; line-height: 40px" /><br>
                     <em style="font-size: 16px">添加图片</em>
                 </a>
-                <video src="{{video.path}}" ng-show="video.isOK"  height="72px" width="72px" controls="controls">
+                <video ng-src="{{video.file | trustUrl}}" ng-show="video.isOK" poster="{{video.vpic}}" height="72px" width="72px" controls="controls">
                 </video>
                 <a class="btn-file-up" ng-click="addvideo()" ng-show="!video.isOK">
                     <img src="img/icon_video.svg" style="height: 40px; width: 40px; text-align: center; line-height: 40px" /><br>

+ 1 - 1
miaomiao/www/templates/home/dream-detail.html

xqd
@@ -46,7 +46,7 @@
                     <ion-slides slider="data.slider">
                         <ion-slide-page ng-if="dream.video">
                             <div class="box banner">
-                                <video ng-src="{{dream.video | trustUrl}}" poster="{{dream.video}}" width="100%" style="max-height: 400px" class="centerme" controls="controls" ></video>
+                                <video src="{{dream.video | trustUrl}}" poster="{{dream.vpic}}" width="100%" style="max-height: 400px" class="centerme" controls="controls" ></video>
                             </div>
                         </ion-slide-page>
                         <ion-slide-page ng-repeat="img in dream.imgs" >

+ 1 - 1
miaomiao/www/templates/my/my-account-add.html

xqd
@@ -68,7 +68,7 @@
                                 <a ng-repeat="item in imgs" ng-click="showImages(item)" class="img-file-up">
                                     <b style="background-image:url({{item}});"><em ng-click="deletefile(item)" class="ion-ios-close-outline"></em></b>
                                 </a>
-                                <!--<a class="btn-file-up" ng-click="addpict()"><i class="ion-image"></i>添加图片</a>-->
+                                
                                 <a class="btn-file-up" ng-click="addpict()">
                                     <img src="img/icon_photo.svg" style="height: 40px; width: 40px; text-align: center; line-height: 40px" /><br>
                                     <em style="font-size: 16px">上传二维码</em>

+ 4 - 3
server/app/Helper/AttachmentHelper.php

xqd xqd
@@ -1,6 +1,7 @@
 <?php
 namespace App\Helper;
 
+use FFMpeg;
 use Illuminate\Http\Request;
 use Illuminate\Http\UploadedFile;
 use Symfony\Component\HttpFoundation\File\Exception\FileException;
@@ -67,16 +68,16 @@ trait AttachmentHelper
                     $url_path = $rel_path . '/' . $md5_filename;
 
                     if ($fileMimeType == "video/mp4" || $fileMimeType == "video/quicktime") {
-                        $ffmpeg = \FFMpeg\FFMpeg::create(array(
+                        $ffmpeg = FFMpeg\FFMpeg::create(array(
                             'ffmpeg.binaries'  => '/usr/bin/ffmpeg',
                             'ffprobe.binaries' => '/usr/bin/ffprobe'
                         ));
                         \Log::info($real_path);
                         $video = $ffmpeg->open($real_path);
-                        $pic = public_path() . '/upload/vpic/'.$md5_filename.'.jpg';
+                        $pic = public_path() . '/upload/vpic/'.$md5.'.jpg';
                         \Log::info($pic);
                         $video
-                            ->frame(\FFMpeg\Coordinate\TimeCode::fromSeconds(10))
+                            ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(1))
                             ->save( $pic );
                     }
                     $attachment = new BaseAttachmentModel();