Mike пре 7 година
родитељ
комит
a2cbee75b7
2 измењених фајлова са 49 додато и 43 уклоњено
  1. 42 42
      miaomiao/www/templates/home/dream-detail.html
  2. 7 1
      server/app/Helper/AttachmentHelper.php

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

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,10 +1,10 @@
 <ion-view view-title="梦想">
     <ion-nav-buttons side="right">
         <button class="button button-clear homeIcon" ng-click="toMessage()">
-            <img src="img/icon_message_h.svg" style="height: 100%; width: 100%">
+            <img ng-src="img/icon_message_h.svg" style="height: 100%; width: 100%">
         </button>
         <button ng-click="share($event)" class="button button-clear button-small" style="padding-top: 3px;">
-            <img src="img/icon_share.svg" style="height: 16px; width: 20px;">
+            <img ng-src="img/icon_share.svg" style="height: 16px; width: 20px;">
         </button>
     </ion-nav-buttons>
     <div ng-if="type==1 && user.id != dream.user_id" style="position: fixed; bottom: -8px; width: 100%; z-index: 5;background: #fff;border-top: 1px solid #ECF2F7;height: 68px">
@@ -46,7 +46,7 @@
                     <ion-slides slider="data.slider">
                         <ion-slide-page ng-if="dream.video">
                             <div class="box banner">
-                                <video src="{{dream.video | trustUrl}}" poster="{{dream.vpic}}" width="100%" style="max-height: 400px" class="centerme" controls="controls" ></video>
+                                <video ng-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" >
@@ -94,28 +94,28 @@
                 <div class="detail-head" style="height: 130px" ng-if="dream.top3user.length>0">
                     <div class="row" ng-if="dream.top3user.length<2">
                         <div class="col top1" ng-if="dream.top3user.length>0" style="background: url('img/img_No1.svg') no-repeat; background-size: 100% 100%;">
-                            <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[0].avatar }}" /><br>
+                            <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[0].avatar }}" /><br>
                         </div>
                         <div class="col top2" ng-if="dream.top3user.length>1" style="margin-top: 10px; background: url('img/img_No2.svg') no-repeat; background-size: 100% 100%;">
-                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[1].avatar }}" /><br>
+                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[1].avatar }}" /><br>
                         </div>
                     </div>
                     <div class="row" ng-if="dream.top3user.length>2">
                         <div class="col top2" ng-if="dream.top3user.length>1" style="margin-top: 10px; background: url('img/img_No2.svg') no-repeat; background-size: 100% 100%;">
-                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[1].avatar }}" /><br>
+                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[1].avatar }}" /><br>
                         </div>
                         <div class="col top1" ng-if="dream.top3user.length>0" style="background: url('img/img_No1.svg') no-repeat; background-size: 100% 100%;">
-                            <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[0].avatar }}" /><br>
+                            <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[0].avatar }}" /><br>
                         </div>
                         <div class="col top2" ng-if="dream.top3user.length>2" style="margin-top: 10px; background: url('img/img_No3.svg') no-repeat; background-size: 100% 100%;">
-                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[2].avatar }}" /><br>
+                            <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[2].avatar }}" /><br>
                         </div>
                     </div>
                 </div>
                 <div ng-if="dream.top3user.length==0" style="background: #f6f6f6;">
                     <div class="row" >
                         <div class="col" align="center">
-                            <img src="img/pic_leaves.png">
+                            <img ng-src="img/pic_leaves.png">
                         </div>
                     </div>
                 </div>
@@ -171,35 +171,35 @@
             <div class="detail-head" style="height: 180px" ng-if="dream.top3user.length>0">
                 <div class="row" ng-if="dream.top3user.length<2">
                     <div class="col top1" ng-if="dream.top3user.length>0" style="background: url('img/img_No1.svg') no-repeat; background-size: 100% 100%;">
-                        <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[0].avatar }}" /><br>
+                        <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[0].avatar }}" /><br>
                         {{ dream.top3user[0].nickname }}<br>
-                        <img src="img/icon_gongxian.svg" style="height: 18px; width: 18px; margin-top: 5px" />
+                        <img ng-src="img/icon_gongxian.svg" style="height: 18px; width: 18px; margin-top: 5px" />
                         <em style="font-size: 16px">{{ dream.top3user[0].score }}</em>
                     </div>
                     <div class="col top2" ng-if="dream.top3user.length>1" style="background: url('img/img_No2.svg') no-repeat; background-size: 100% 100%;">
-                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[1].avatar }}" /><br>
+                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[1].avatar }}" /><br>
                         {{ dream.top3user[1].nickname }}<br>
-                        <img src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
+                        <img ng-src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
                         <em style="font-size: 18px">{{ dream.top3user[1].score }}</em>
                     </div>
                 </div>
                 <div class="row" ng-if="dream.top3user.length>2">
                     <div class="col top2" ng-if="dream.top3user.length>1" style="background: url('img/img_No2.svg') no-repeat; background-size: 100% 100%;">
-                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[1].avatar }}" /><br>
+                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[1].avatar }}" /><br>
                         {{ dream.top3user[1].nickname }}<br>
-                        <img src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
+                        <img ng-src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
                         <em style="font-size: 18px">{{ dream.top3user[1].score }}</em>
                     </div>
                     <div class="col top1" ng-if="dream.top3user.length>0" style="background: url('img/img_No1.svg') no-repeat; background-size: 100% 100%;">
-                        <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[0].avatar }}" /><br>
+                        <img style="width: 75px; height: 75px; margin: 25px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[0].avatar }}" /><br>
                         {{ dream.top3user[0].nickname }}<br>
-                        <img src="img/icon_gongxian.svg" style="height: 18px; width: 18px; margin-top: 5px" />
+                        <img ng-src="img/icon_gongxian.svg" style="height: 18px; width: 18px; margin-top: 5px" />
                         <em style="font-size: 16px">{{ dream.top3user[0].score }}</em>
                     </div>
                     <div class="col top2" ng-if="dream.top3user.length>2" style="background: url('img/img_No3.svg') no-repeat; background-size: 100% 100%;">
-                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" src="{{ dream.top3user[2].avatar }}" /><br>
+                        <img style="width: 67px; margin: 22px 0 8px 0; border-radius: 100%;" ng-src="{{ dream.top3user[2].avatar }}" /><br>
                         {{ dream.top3user[2].nickname }}<br>
-                        <img src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
+                        <img ng-src="img/icon_gongxian.svg" style="height: 20px; width: 20px; margin-top: 5px" />
                         <em style="font-size: 18px">{{ dream.top3user[2].score }}</em>
                     </div>
                 </div>
@@ -207,7 +207,7 @@
             <div ng-if="dream.top3user.length==0" style="background: #f6f6f6;">
                 <div class="row" >
                     <div class="col" align="center">
-                        <img src="img/pic_leaves.png">
+                        <img ng-src="img/pic_leaves.png">
                     </div>
                 </div>
             </div>
@@ -218,7 +218,7 @@
                     </div>
                     <div style="padding-left:20px; float:left;">
                         <div style="float:left;">
-                            <img style="width:40px;border-radius:100%" src="{{user.avatar}}" />
+                            <img style="width:40px;border-radius:100%" ng-src="{{user.avatar}}" />
                         </div>
                         <div style="float:left; margin-left: 10px">
                             <div style="font-size: 16px">{{user.nickname}}</div>
@@ -236,7 +236,7 @@
                     </div>
                     <div style="padding-left:20px; float:left;">
                         <div style="float:left;">
-                            <img style="width:40px;border-radius:100%" src="{{user.avatar}}" />
+                            <img style="width:40px;border-radius:100%" ng-src="{{user.avatar}}" />
                         </div>
                         <div style="float:left; margin-left: 10px">
                             <div style="font-size: 16px">{{user.nickname}}</div>
@@ -253,7 +253,7 @@
         </div>
         <!--点击看大图-->
         <div ng-if="bigImage && type==2" ng-click="hideBigImage()" class="popover-backdrop">
-            <img src="{{url}}">
+            <img ng-src="{{url}}">
         </div>
      <script id="interaction-modal.html" type="text/ng-template">
       <div class="modal">
@@ -274,7 +274,7 @@
                 </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>
+                    <img ng-src="img/icon_photo.svg" style="height: 40px; width: 40px; text-align: center; line-height: 40px" /><br>
                     <em style="font-size: 16px">添加图片</em>
                 </a>
             </div>
@@ -300,7 +300,7 @@
                 <div class="item" style="padding:20px">
                     <div class="row">
                         <div class="col col-20">
-                            <img src="img/icon_gold.svg" style="height: 100%; width: 100%">
+                            <img ng-src="img/icon_gold.svg" style="height: 100%; width: 100%">
                         </div>
                         <div class="col">
                             <div>剩余梦想币</div>
@@ -340,17 +340,17 @@
     </ion-content>
         <div class="detail-like" ng-if="tosupport">
             <div style="text-align: center; border-bottom: 3px solid #8D8D8E">
-                <img src="img/img_miao.png" style="width: 25%; height: 55px;margin-bottom: -13px">
+                <img ng-src="img/img_miao.png" style="width: 25%; height: 55px;margin-bottom: -13px">
             </div>
             <div style="background: #fff;">
                 <div class="coin">
                     <div class="row">
                         <div class="col box {{index==2?'selected':''}}" ng-click="changeIndex(2)" ng-model="coin">
                             <div style="float:left; width: 35%;  margin-top: 2%; margin-left: 5%">
-                                <img src="img/icon_kiss.png" style="width: 100%;">
+                                <img ng-src="img/icon_kiss.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 20
@@ -358,10 +358,10 @@
                         </div>
                         <div class="col box {{index==5?'selected':''}}" ng-click="changeIndex(5)" ng-model="coin">
                             <div style="float:left; width: 35%;  margin-top: 2%; margin-left: 5%">
-                                <img src="img/icon_candy.png" style="width: 100%;">
+                                <img ng-src="img/icon_candy.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 50
@@ -369,10 +369,10 @@
                         </div>
                         <div class="col box {{index==10?'selected':''}}" ng-click="changeIndex(10)" ng-model="coin">
                             <div style="float:left; width: 35%;  margin-top: 2%; margin-left: 5%">
-                                <img src="img/icon_balloon.png" style="width: 100%;">
+                                <img ng-src="img/icon_balloon.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 100
@@ -382,10 +382,10 @@
                     <div class="row">
                         <div class="col box {{index==20?'selected':''}}" ng-click="changeIndex(20)" ng-model="coin">
                             <div style="float:left; width: 35%; margin-top: 2%; margin-left: 5%">
-                                <img src="img/icon_rose.png" style="width: 100%;">
+                                <img ng-src="img/icon_rose.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 200
@@ -393,10 +393,10 @@
                         </div>
                         <div class="col box {{index==30?'selected':''}}" ng-click="changeIndex(30)" ng-model="coin">
                             <div style="float:left; width: 35%; margin-top: 3%; margin-left: 5%">
-                                <img src="img/icon_haert.png" style="width: 100%;">
+                                <img ng-src="img/icon_haert.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 300
@@ -404,10 +404,10 @@
                         </div>
                         <div class="col box {{index==50?'selected':''}}" ng-click="changeIndex(50)" ng-model="coin">
                             <div style="float:left; width: 35%; margin-top: 2%; margin-left: 5%">
-                                <img src="img/icon_diamond.png" style="width: 100%;">
+                                <img ng-src="img/icon_diamond.png" style="width: 100%;">
                             </div>
                             <div style="float:right; width: 20%; margin-top: 5%; margin-right: 5px">
-                                <img src="img/icon_gold.svg" style="width: 100%">
+                                <img ng-src="img/icon_gold.svg" style="width: 100%">
                             </div>
                             <div style="float:right; color: #000;font-size: 16px; margin-top: 12%; margin-right: 3%">
                                 500
@@ -420,13 +420,13 @@
                     </div>
                     <div style="float: left;width: 90px;">
                         <div style="float:left; padding-top: 4px;height: 45px;">
-                            <img src="img/icon_gold.svg"/>
+                            <img ng-src="img/icon_gold.svg"/>
                         </div>
                         <em>{{user.coin}}&nbsp;</em>
                     </div>
                     <div class="calm" ng-click="toRecharge()" style="float: left;">
                         <div style="float:left; padding-top: 4px;height: 45px;">
-                            <img src="img/icon_ recharge.png">
+                            <img ng-src="img/icon_ recharge.png">
                         </div>
                         <em>&nbsp;充值</em>
                     </div>
@@ -439,11 +439,11 @@
     <div class="detail-like" ng-if="toshare">
         <div class="row" style="background: #CCCCCC;">
             <div class="col" ng-click="shareDream(1)">
-                <img src="img/weixin.png" ><br>
+                <img ng-src="img/weixin.png" ><br>
                 微信
             </div>
             <div class="col" ng-click="shareDream(2)">
-                <img src="img/weibo.png" ><br>
+                <img ng-src="img/weibo.png" ><br>
                 微博
             </div>
         </div>

+ 7 - 1
server/app/Helper/AttachmentHelper.php

xqd
@@ -74,7 +74,13 @@ trait AttachmentHelper
                         ));
                         \Log::info($real_path);
                         $video = $ffmpeg->open($real_path);
-                        $pic = public_path() . '/upload/vpic/'.$md5.'.jpg';
+                        $vpath = public_path() . '/upload/vpic/';
+                        if (!file_exists($vpath)) {
+                            if (!@mkdir($vpath, 0755, true)) {
+                                return ErrorCode::ATTACHMENT_MKDIR_FAILED;
+                            }
+                        }
+                        $pic = $vpath.$md5.'.jpg';
                         \Log::info($pic);
                         $video
                             ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(1))