Mike 7 năm trước cách đây
mục cha
commit
cf8741e296

+ 1 - 0
miaomiao/config.xml

xqd
@@ -22,6 +22,7 @@
   <preference name="SuppressesIncrementalRendering" value="True"/>
   <preference name="windows-target-version" value="10.0"/>
   <preference name="SplashScreen" value="screen"/>
+  <preference name="KeyboardDisplayRequiresUserAction" value="false"/>
   <preference name="SplashScreenDelay" value="3000"/>
   <feature name="StatusBar">
     <param name="ios-package" onload="true" value="CDVStatusBar"/>

+ 15 - 11
miaomiao/www/js/controllers/home.js

xqd xqd
@@ -475,17 +475,19 @@
                 $scope.dream.interactions[index].showmore = true;
             }
         }
-            $scope.replay = function ($event, name, index) {
-                $event.stopPropagation();
-                    $scope.input.focus = true;
-                    $scope.input.show = true;
-                    angular.forEach($scope.dream.interactions, function (item) {
-                        item.show = false;
-                    })
-                    $scope.dream.interactions[index].show = true;
-                    $scope.input.placeholder = "评论" + name+":";
-                    $scope.vm.title='';
-                }
+        $scope.replay = function ($event, name, index) {
+            $event.stopPropagation();
+            $scope.input.focus = true;
+            $scope.input.show = true;
+            angular.forEach($scope.dream.interactions, function (item) {
+                item.show = false;
+            })
+            $scope.dream.interactions[index].show = true;
+            $scope.dream.interactions[index].focus = true;
+            $scope.input.placeholder = "评论" + name+":";
+            $scope.vm.title='';
+            $scope.vm.comment='';
+        }
         $scope.replayOther = function ($event, name, index,currentindex) {
             $event.stopPropagation();
             if($scope.dream.interactions[index].comments[currentindex].user_id!=$scope.user.id){
@@ -495,8 +497,10 @@
                     item.show = false;
                 })
                 $scope.dream.interactions[index].show = true;
+                $scope.dream.interactions[index].focus = true;
                 $scope.input.placeholder = "评论" + name+":";
                 $scope.vm.title='';
+                $scope.vm.comment='';
             }
             else {
                 msg.confirm("评论","是否删除评论").then(function(result){

+ 15 - 2
miaomiao/www/js/directives/directive.js

xqd
@@ -2,18 +2,31 @@
     module.directive('focusMe', function ($timeout) {
         return {
             scope: { trigger: '=focusMe' },
-            link: function (scope, element) {
+            link: function (scope, element, $attr) {
+                console.log("focusMe:"+JSON.stringify(element))
                 scope.$watch('trigger', function (value) {
+                    console.log(value);
                     if (value === true) {
                         $timeout(function() {
                             element[0].focus();
+                            cordova.plugins.Keyboard.show();
                             scope.trigger = false;
-                        });
+                        },1000);
                     }
                 });
             }
         };
     });
+    module.directive('showFocus', function($timeout) {
+      return function(scope, element, attrs) {
+        scope.$watch(attrs.showFocus, 
+          function (newValue) { 
+            $timeout(function() {
+                newValue && element.focus();
+            });
+          },true);
+      };    
+    });
     module.factory('WechatService', [ function () {
         function share(params) {
             if (typeof Wechat === "undefined") {

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

xqd
@@ -19,7 +19,7 @@
             <div ng-if="timer!='已结束'&& 100*dream.get_coin/dream.coin<100" class="col dreamButton">
                 <button class="button button-calm" ng-click="support($event)">支持</button>
             </div>
-            <div ng-if="codeBtn && user.id==dream.top3user[0].id" class="col dreamButton">
+            <div ng-if="timer=='已结束'|| 100*dream.get_coin/dream.coin>=100" class="col dreamButton">
                 <button ng-click="openCode()" class="button button-calm" style="border: 1px solid #00C3DA">
                     二维码
                 </button>