YanaDH 7 年之前
父节点
当前提交
7d5f397f1f
共有 3 个文件被更改,包括 90 次插入77 次删除
  1. 63 50
      miaomiao/www/.idea/workspace.xml
  2. 26 26
      miaomiao/www/js/controllers/account.js
  3. 1 1
      miaomiao/www/templates/home/dream-detail.html

+ 63 - 50
miaomiao/www/.idea/workspace.xml

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -20,7 +20,38 @@
     <favorites_list name="www" />
   </component>
   <component name="FileEditorManager">
-    <leaf />
+    <leaf>
+      <file leaf-file-name="dream-detail.html" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="0.25333333">
+              <caret line="13" column="32" selection-start-line="13" selection-start-column="32" selection-end-line="13" selection-end-column="32" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="home.js" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="-6.133333">
+              <caret line="229" column="42" selection-start-line="229" selection-start-column="42" selection-end-line="229" selection-end-column="42" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="account.js" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="0.0">
+              <caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
   </component>
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
@@ -78,13 +109,13 @@
         <option value="$PROJECT_DIR$/../../../51zhupai/css/detail.css" />
         <option value="$PROJECT_DIR$/../../../51zhupai/templates/detail.html" />
         <option value="$PROJECT_DIR$/../../../51zhupai/index.html" />
-        <option value="$PROJECT_DIR$/js/controllers/account.js" />
-        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
         <option value="$PROJECT_DIR$/css/style.css" />
         <option value="$PROJECT_DIR$/templates/home/index.html" />
         <option value="$PROJECT_DIR$/js/controllers/my.js" />
         <option value="$PROJECT_DIR$/js/controllers/home.js" />
         <option value="$PROJECT_DIR$/templates/home/userDetail.html" />
+        <option value="$PROJECT_DIR$/js/controllers/account.js" />
+        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
       </list>
     </option>
   </component>
@@ -94,8 +125,8 @@
     <detection-done>true</detection-done>
   </component>
   <component name="ProjectFrameBounds">
-    <option name="x" value="-8" />
-    <option name="y" value="-8" />
+    <option name="x" value="364" />
+    <option name="y" value="20" />
     <option name="width" value="1382" />
     <option name="height" value="744" />
   </component>
@@ -148,7 +179,7 @@
     <panes />
   </component>
   <component name="PropertiesComponent">
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../../51zhupai" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="HbShouldOpenHtmlAsHb" value="" />
     <property name="js-jscs-nodeInterpreter" value="D:\HPE\Note.js\Install\node.exe" />
@@ -239,25 +270,25 @@
     <servers />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
-    <editor active="false" />
+    <frame x="364" y="20" width="1382" height="744" extended-state="0" />
+    <editor active="true" />
     <layout>
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16648169" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32843137" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24916202" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3296131" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
     </layout>
   </component>
   <component name="Vcs.Log.UiProperties">
@@ -313,27 +344,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/package.json">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-0.6785714">
-          <caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/gulpfile.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.35849056">
-          <caret line="11" column="0" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/index.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.44504505">
-          <caret line="13" column="23" selection-start-line="13" selection-start-column="23" selection-end-line="13" selection-end-column="23" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://E:/Work/HPE/homework/Bootstrap/项目实战5/index.html">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="0.34234235">
@@ -579,13 +589,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="55" column="53" selection-start-line="55" selection-start-column="53" selection-end-line="55" selection-end-column="53" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/../../../51zhupai/index.html">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-14.535714">
@@ -607,31 +610,41 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
+    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.2983725">
-          <caret line="1109" column="17" selection-start-line="1109" selection-start-column="17" selection-end-line="1109" selection-end-column="17" />
+        <state vertical-scroll-proportion="0.4108108">
+          <caret line="12" column="17" selection-start-line="12" selection-start-column="17" selection-end-line="12" selection-end-column="17" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
+    <entry file="file://$PROJECT_DIR$/templates/home/userDetail.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.4108108">
-          <caret line="12" column="17" selection-start-line="12" selection-start-column="17" selection-end-line="12" selection-end-column="17" />
+        <state vertical-scroll-proportion="0.7676191">
+          <caret line="100" column="47" selection-start-line="100" selection-start-column="47" selection-end-line="100" selection-end-column="47" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+    <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-4.6551723">
-          <caret line="465" column="18" selection-start-line="457" selection-start-column="25" selection-end-line="465" selection-end-column="18" />
+        <state vertical-scroll-proportion="0.0">
+          <caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/userDetail.html">
+    <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.7676191">
-          <caret line="100" column="47" selection-start-line="100" selection-start-column="47" selection-end-line="100" selection-end-column="47" />
+        <state vertical-scroll-proportion="-6.133333">
+          <caret line="229" column="42" selection-start-line="229" selection-start-column="42" selection-end-line="229" selection-end-column="42" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.25333333">
+          <caret line="13" column="32" selection-start-line="13" selection-start-column="32" selection-end-line="13" selection-end-column="32" />
+          <folding />
         </state>
       </provider>
     </entry>

+ 26 - 26
miaomiao/www/js/controllers/account.js

xqd
@@ -4,32 +4,32 @@
              //$ionicNavBarDelegate.showBackButton(false);
             $scope.wechat_login = function(){
                 var scope = "snsapi_userinfo", state = "_" + (+new Date());
-                // Wechat.auth(scope, state, function (response) {
-                //     // alert("response:"+JSON.stringify(response));
-                //     // var response={code:1231};
-                //    if(response.code){
-                //        msg.loading('登录中...');
-                //        userService.wechat_login(response.code).then(function(result){
-                //            msg.hide();
-                //             // alert("wechat_login success: " + JSON.stringify(result));
-                //            if(result.data.data){
-                //                storage.setObject('user', result.data.data.user);
-                //                storage.set('token', result.data.data.token);
-                //                $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
-                //                $scope.user=storage.getObject('user');
-                //                $state.go('app.home');
-                //            }else{
-                //                $state.go("loginAccount",{wechat:response.code})
-                //            }
-                //        },function(error){
-                //             console.log("loginbywx Failed: " + JSON.stringify(error));
-                //            $state.go("loginAccount",{wechat:$scope.wecaht});
-                //        });
-                //    }
-                // }, function (error) {
-                //    console.log("Failed: " + JSON.stringify(error));
-                // })  
-                $state.go("loginAccount",{wechat:1231});
+                 Wechat.auth(scope, state, function (response) {
+                     // alert("response:"+JSON.stringify(response));
+                     // var response={code:1231};
+                    if(response.code){
+                        msg.loading('登录中...');
+                        userService.wechat_login(response.code).then(function(result){
+                            msg.hide();
+                             // alert("wechat_login success: " + JSON.stringify(result));
+                            if(result.data.data){
+                                storage.setObject('user', result.data.data.user);
+                                storage.set('token', result.data.data.token);
+                                $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
+                                $scope.user=storage.getObject('user');
+                                $state.go('app.home');
+                            }else{
+                                $state.go("loginAccount",{wechat:response.code})
+                            }
+                        },function(error){
+                             console.log("loginbywx Failed: " + JSON.stringify(error));
+                            $state.go("loginAccount",{wechat:$scope.wecaht});
+                        });
+                    }
+                 }, function (error) {
+                    console.log("Failed: " + JSON.stringify(error));
+                 })
+                //$state.go("loginAccount",{wechat:1231});
             }
     }]);
     app.controller('loginCtrl', ["$scope", "userService","$stateParams","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",

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