Explorar el Código

Merge branch 'master' of http://git.9026.com/roobe/miao.git

Ben hace 7 años
padre
commit
35b0505ad0

+ 1 - 2
miaomiao/config.xml

xqd xqd
@@ -6,7 +6,7 @@
     </description>
   <author email="you@example.com" href="http://example.com.com/">
       Mike
-    </author>
+  </author>
   <content src="index.html"/>
   <access origin="*"/>
   <allow-intent href="*"/>
@@ -99,7 +99,6 @@
   <plugin name="ionic-plugin-keyboard" spec="~1.0.9"/>
   <plugin name="jpush-phonegap-plugin" spec="^3.2.3">
     <variable name="APP_KEY" value="041b70b4c7eee686870a32cd"/>
-    <variable name="API_KEY" value="041b70b4c7eee686870a32cd"/>
   </plugin>
   <plugin name="phonegap-plugin-barcodescanner" spec="https://github.com/phonegap/phonegap-plugin-barcodescanner.git">
     <variable name="CAMERA_USAGE_DESCRIPTION" value="请摄像头对准条码"/>

+ 1 - 1
miaomiao/cordova-hcp.json

xqd
@@ -1,4 +1,4 @@
 {
   "update": "now",
-  "content_url": "http://i.9026.com/miaomiao/www"
+  "content_url": "http://i.9026.com/miaomiao"
 }

+ 1 - 1
miaomiao/package.json

xqd
@@ -90,4 +90,4 @@
       }
     }
   }
-}
+}

+ 2 - 0
miaomiao/plugins/phonegap-plugin-barcodescanner/src/blackberry10/native/device/.npmignore

xqd
@@ -0,0 +1,2 @@
+/src
+/public

+ 2 - 0
miaomiao/plugins/phonegap-plugin-barcodescanner/src/blackberry10/native/simulator/.npmignore

xqd
@@ -0,0 +1,2 @@
+/public
+/src

+ 140 - 170
miaomiao/www/.idea/workspace.xml

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -24,58 +24,51 @@
       <file leaf-file-name="login.html" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/templates/account/login.html">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-4.071429">
-              <caret line="6" column="40" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="40" />
+            <state vertical-scroll-proportion="-1.3571428">
+              <caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
               <folding>
+                <element signature="n#style#0;n#img#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
                 <element signature="n#style#0;n#span#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
               </folding>
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="loginAccount.html" pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/templates/account/loginAccount.html">
+      <file leaf-file-name="index.html" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/templates/home/index.html">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="-13.142858">
-              <caret line="28" column="17" selection-start-line="28" selection-start-column="17" selection-end-line="28" selection-end-column="17" />
-              <folding>
-                <element signature="n#style#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#img#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#i#0;n#span#2;n#div#0;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#div#1;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#span#1;n#div#2;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-                <element signature="n#style#0;n#button#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-              </folding>
+            <state vertical-scroll-proportion="-7.172414">
+              <caret line="76" column="88" selection-start-line="76" selection-start-column="80" selection-end-line="76" selection-end-column="88" />
+              <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="account.js" pinned="false" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
+      <file leaf-file-name="filter.js" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/js/filters/filter.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state vertical-scroll-proportion="0.141527">
-              <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
+            <state vertical-scroll-proportion="0.5102421">
+              <caret line="73" column="30" selection-start-line="73" selection-start-column="30" selection-end-line="73" selection-end-column="30" />
               <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">
+      <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="-5.9666667">
-              <caret line="1133" column="34" selection-start-line="1133" selection-start-column="0" selection-end-line="1134" selection-end-column="0" />
+            <state vertical-scroll-proportion="0.0">
+              <caret line="20" column="63" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" />
               <folding />
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="router.js" pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/js/config/router.js">
+      <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="-5.7">
-              <caret line="9" column="30" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="30" />
+            <state vertical-scroll-proportion="0.0">
+              <caret line="541" column="34" selection-start-line="541" selection-start-column="34" selection-end-line="541" selection-end-column="34" />
               <folding />
             </state>
           </provider>
@@ -86,15 +79,14 @@
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
       <list>
-        <option value="JavaScript File" />
         <option value="HTML File" />
+        <option value="JavaScript File" />
       </list>
     </option>
   </component>
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/js/services/userservice.js" />
         <option value="$PROJECT_DIR$/templates/my/my-message.html" />
         <option value="$PROJECT_DIR$/templates/my/my-message-reply.html" />
         <option value="$PROJECT_DIR$/templates/home/user-detail.html" />
@@ -113,7 +105,6 @@
         <option value="$PROJECT_DIR$/templates/my/my-account.html" />
         <option value="$PROJECT_DIR$/templates/my/attention.html" />
         <option value="$PROJECT_DIR$/templates/home/oldDream.html" />
-        <option value="$PROJECT_DIR$/js/filters/filter.js" />
         <option value="$PROJECT_DIR$/templates/my/my-collect.html" />
         <option value="E:/Graduation design/huiwei/js/index.js" />
         <option value="$PROJECT_DIR$/templates/home/index.html" />
@@ -122,16 +113,22 @@
         <option value="$PROJECT_DIR$/templates/my/my-profile.html" />
         <option value="E:/Graduation design/huiwei/css/index.css" />
         <option value="$PROJECT_DIR$/js/controllers/add.js" />
-        <option value="$PROJECT_DIR$/js/controllers/home.js" />
-        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
-        <option value="E:/Graduation design/huiwei/gulpfile.js" />
         <option value="E:/Graduation design/huiwei/index.html" />
-        <option value="E:/Graduation design/huiwei/package.json" />
-        <option value="$PROJECT_DIR$/templates/account/login.html" />
         <option value="$PROJECT_DIR$/templates/account/loginAccount.html" />
+        <option value="E:/Graduation design/huiwei/package.json" />
+        <option value="E:/Graduation design/huiwei/gulpfile.js" />
+        <option value="E:/Graduation design/lala/package.json" />
+        <option value="E:/Graduation design/lala/a.js" />
+        <option value="E:/Graduation design/lala/index.html" />
+        <option value="E:/Graduation design/lala/gulpfile.js" />
+        <option value="$PROJECT_DIR$/js/controllers/home.js" />
+        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
         <option value="$PROJECT_DIR$/css/style.css" />
+        <option value="$PROJECT_DIR$/templates/account/login.html" />
         <option value="$PROJECT_DIR$/js/config/router.js" />
+        <option value="$PROJECT_DIR$/js/services/userservice.js" />
         <option value="$PROJECT_DIR$/js/controllers/account.js" />
+        <option value="$PROJECT_DIR$/js/filters/filter.js" />
       </list>
     </option>
   </component>
@@ -292,45 +289,6 @@
     <watches-manager />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/templates/home/userDetail.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/css/style.css">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="604" column="16" selection-start-line="604" selection-start-column="16" selection-end-line="604" selection-end-column="16" />
-        </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.0">
-          <caret line="227" column="14" selection-start-line="224" selection-start-column="8" selection-end-line="227" selection-end-column="14" />
-          <folding>
-            <element signature="n#style#0;n#button#0;n#ion-nav-buttons#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#0;n#div#0;n#div#0;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#img#1;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#1;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#0;n#div#2;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#a#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="898" column="21" selection-start-line="898" selection-start-column="21" selection-end-line="898" selection-end-column="21" />
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/js/app.js">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-1.1183534">
@@ -373,13 +331,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/services/userservice.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.6843911">
-          <caret line="21" column="10" selection-start-line="21" selection-start-column="10" selection-end-line="21" selection-end-column="10" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/js/services/msgservice.js">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="0.0">
@@ -464,13 +415,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/add/index.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.10575139">
-          <caret line="3" column="42" selection-start-line="3" selection-start-column="42" selection-end-line="3" selection-end-column="42" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/templates/my/attention.html">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-1.3571428">
@@ -531,7 +475,6 @@
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-4.7">
           <caret line="65" column="18" selection-start-line="65" selection-start-column="12" selection-end-line="65" selection-end-column="18" />
-          <folding />
         </state>
       </provider>
     </entry>
@@ -539,7 +482,6 @@
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="14.566667">
           <caret line="12" column="48" selection-start-line="12" selection-start-column="48" selection-end-line="12" selection-end-column="48" />
-          <folding />
         </state>
       </provider>
     </entry>
@@ -550,161 +492,189 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/filters/filter.js">
+    <entry file="file://$PROJECT_DIR$/js/services/homeservice.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.15083799">
-          <caret line="117" column="35" selection-start-line="117" selection-start-column="35" selection-end-line="117" selection-end-column="35" />
+        <state vertical-scroll-proportion="-4.7">
+          <caret line="79" column="24" selection-start-line="79" selection-start-column="12" selection-end-line="79" selection-end-column="24" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
+    <entry file="file://$PROJECT_DIR$/../package.json">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.035250463">
-          <caret line="18" column="20" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
+        <state vertical-scroll-proportion="0.0">
+          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../gulpfile.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.4691358">
+          <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="27" selection-end-column="5" />
           <folding>
-            <element signature="n#style#0;n#button#0;n#ion-nav-buttons#1;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#img#0;n#button#0;n#ion-nav-buttons#1;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#button#1;n#ion-nav-buttons#1;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#img#0;n#button#1;n#ion-nav-buttons#1;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#img#1;n#button#1;n#ion-nav-buttons#1;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#div#0;n#div#0;n#div#1;n#ion-content#0;n#ion-side-menu-content#0;n#ion-side-menus#0;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#i#0;n#div#0;n#div#0;n#div#1;n#ion-content#0;n#ion-side-menu-content#0;n#ion-side-menus#0;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#div#1;n#div#0;n#div#1;n#ion-content#0;n#ion-side-menu-content#0;n#ion-side-menus#0;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#div#1;n#div#1;n#ion-content#0;n#ion-side-menu-content#0;n#ion-side-menus#0;n#ion-view#0;n#!!top" expanded="false" />
-            <element signature="n#style#0;n#p#0;n#div#0;n#div#1;n#div#0;n#div#2;n#div#1;n#ion-content#0;n#ion-side-menu-content#0;n#ion-side-menus#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#!!doc" expanded="false" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/services/homeservice.js">
+    <entry file="file://E:/Graduation design/huiwei/index.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-4.7">
-          <caret line="79" column="24" selection-start-line="79" selection-start-column="12" selection-end-line="79" selection-end-column="24" />
-          <folding />
+        <state vertical-scroll-proportion="0.10575139">
+          <caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/add.js">
+    <entry file="file://$PROJECT_DIR$/templates/account/loginAccount.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-5.9666667">
-          <caret line="50" column="22" selection-start-line="50" selection-start-column="20" selection-end-line="50" selection-end-column="22" />
-          <folding />
+        <state vertical-scroll-proportion="-2.7142856">
+          <caret line="4" column="14" selection-start-line="1" selection-start-column="38" selection-end-line="4" selection-end-column="14" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+    <entry file="file://E:/Graduation design/huiwei/package.json">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.7465619">
-          <caret line="191" column="26" selection-start-line="191" selection-start-column="26" selection-end-line="191" selection-end-column="26" />
-          <folding>
-            <element signature="n#style#0;n#button#0;n#ion-nav-buttons#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#0;n#div#0;n#div#0;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#img#1;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#1;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#0;n#div#2;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#a#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="true" />
-          </folding>
+        <state vertical-scroll-proportion="0.7050093">
+          <caret line="20" column="0" selection-start-line="20" selection-start-column="0" selection-end-line="20" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../package.json">
+    <entry file="file://E:/Graduation design/huiwei/gulpfile.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
-          <folding />
+        <state vertical-scroll-proportion="0.16754851">
+          <caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../gulpfile.js">
+    <entry file="file://E:/Graduation design/lala/package.json">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.4691358">
-          <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="27" selection-end-column="5" />
-          <folding>
-            <element signature="n#!!doc" expanded="true" />
-          </folding>
+        <state vertical-scroll-proportion="0.0">
+          <caret line="5" column="14" selection-start-line="5" selection-start-column="14" selection-end-line="5" selection-end-column="14" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://E:/Graduation design/huiwei/package.json">
+    <entry file="file://E:/Graduation design/lala/gulpfile.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-1.3571428">
-          <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
+        <state vertical-scroll-proportion="0.2680776">
+          <caret line="8" column="36" selection-start-line="8" selection-start-column="36" selection-end-line="8" selection-end-column="36" />
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://E:/Graduation design/huiwei/index.html">
+    <entry file="file://E:/Graduation design/lala/a.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.10575139">
-          <caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
+        <state vertical-scroll-proportion="0.0">
+          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://E:/Graduation design/huiwei/gulpfile.js">
+    <entry file="file://E:/Graduation design/lala/index.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.2680776">
-          <caret line="8" column="23" selection-start-line="8" selection-start-column="23" selection-end-line="8" selection-end-column="23" />
+        <state vertical-scroll-proportion="-5.428571">
+          <caret line="8" column="8" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/account/login.html">
+    <entry file="file://$PROJECT_DIR$/templates/add/index.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-4.071429">
-          <caret line="6" column="40" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="40" />
+        <state vertical-scroll-proportion="0.17625232">
+          <caret line="14" column="37" selection-start-line="14" selection-start-column="37" selection-end-line="14" selection-end-column="37" />
           <folding>
-            <element signature="n#style#0;n#span#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
+            <element signature="n#style#0;n#div#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="false" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/account/loginAccount.html">
+    <entry file="file://$PROJECT_DIR$/js/controllers/add.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-13.142858">
-          <caret line="28" column="17" selection-start-line="28" selection-start-column="17" selection-end-line="28" selection-end-column="17" />
+        <state vertical-scroll-proportion="0.5102421">
+          <caret line="40" column="14" selection-start-line="34" selection-start-column="14" selection-end-line="40" selection-end-column="14" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/css/style.css">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.6306483">
+          <caret line="523" column="22" selection-start-line="523" selection-start-column="22" selection-end-line="523" selection-end-column="22" />
+          <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.29469547">
+          <caret line="428" column="14" selection-start-line="428" selection-start-column="14" selection-end-line="428" selection-end-column="14" />
           <folding>
-            <element signature="n#style#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#img#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#i#0;n#span#2;n#div#0;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#div#1;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#span#1;n#div#2;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
-            <element signature="n#style#0;n#button#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
+            <element signature="n#style#0;n#button#0;n#ion-nav-buttons#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#div#0;n#div#0;n#div#0;n#div#1;n#ion-content#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#img#0;n#div#0;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#img#1;n#div#2;n#div#1;n#div#0;n#div#2;n#ion-content#0;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#div#1;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#div#0;n#div#2;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="false" />
+            <element signature="n#style#0;n#a#0;n#span#0;n#div#1;n#div#1;n#div#2;n#ion-view#0;n#!!top" expanded="false" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/css/style.css">
+    <entry file="file://$PROJECT_DIR$/js/services/userservice.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-8.189655">
-          <caret line="52" column="1" selection-start-line="52" selection-start-column="1" selection-end-line="52" selection-end-column="1" />
+        <state vertical-scroll-proportion="0.33509701">
+          <caret line="10" column="54" selection-start-line="10" selection-start-column="48" selection-end-line="10" selection-end-column="54" />
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/js/config/router.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-5.7">
-          <caret line="9" column="30" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="30" />
+        <state vertical-scroll-proportion="0.38919926">
+          <caret line="11" column="37" selection-start-line="11" selection-start-column="37" selection-end-line="11" selection-end-column="37" />
+          <folding />
+        </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="20" column="63" selection-start-line="20" selection-start-column="63" selection-end-line="20" selection-end-column="63" />
           <folding />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-5.9666667">
-          <caret line="1133" column="34" selection-start-line="1133" selection-start-column="0" selection-end-line="1134" selection-end-column="0" />
+        <state vertical-scroll-proportion="0.0">
+          <caret line="541" column="34" selection-start-line="541" selection-start-column="34" selection-end-line="541" selection-end-column="34" />
           <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
+    <entry file="file://$PROJECT_DIR$/templates/account/login.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.141527">
-          <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
+        <state vertical-scroll-proportion="-1.3571428">
+          <caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
+          <folding>
+            <element signature="n#style#0;n#img#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
+            <element signature="n#style#0;n#span#0;n#div#0;n#ion-content#0;n#ion-view#0;n#!!top" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="-7.172414">
+          <caret line="76" column="88" selection-start-line="76" selection-start-column="80" selection-end-line="76" selection-end-column="88" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/js/filters/filter.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.5102421">
+          <caret line="73" column="30" selection-start-line="73" selection-start-column="30" selection-end-line="73" selection-end-column="30" />
           <folding />
         </state>
       </provider>

+ 2 - 2
miaomiao/www/chcp.json

xqd
@@ -1,5 +1,5 @@
 {
   "update": "now",
-  "content_url": "http://i.9026.com/miaomiao/www",
-  "release": "2017.08.23-09.55.35"
+  "content_url": "http://i.9026.com/miaomiao",
+  "release": "2017.08.23-18.23.45"
 }

+ 13 - 9
miaomiao/www/chcp.manifest

xqd xqd xqd xqd xqd xqd
@@ -13,7 +13,7 @@
   },
   {
     "file": ".idea/workspace.xml",
-    "hash": "4171b3999655f1262098329ca055a80f"
+    "hash": "0ca83fcf6e1f13fc63df3fbf698ca565"
   },
   {
     "file": ".idea/www.iml",
@@ -29,7 +29,7 @@
   },
   {
     "file": "css/style.css",
-    "hash": "2ece1df08e758cb5a6fd1448a611f927"
+    "hash": "a756d7e02ed8e14f4b56de9ea23412ce"
   },
   {
     "file": "img/alipay.png",
@@ -369,11 +369,11 @@
   },
   {
     "file": "js/config/router.js",
-    "hash": "3e72be424ee66203c122c2fefe33a151"
+    "hash": "e5fae9284235efb500d94ace6ec81f86"
   },
   {
     "file": "js/controllers/account.js",
-    "hash": "4991794aac4d09176ea22253e945b93c"
+    "hash": "fe3ef2c90e4b2caa1208b2c672dc54b9"
   },
   {
     "file": "js/controllers/add.js",
@@ -381,11 +381,11 @@
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "2ed102ad7af44e4947f9dca76153aa24"
+    "hash": "3f2f9d1aec9286050dbb523a76e40eb0"
   },
   {
     "file": "js/controllers/my.js",
-    "hash": "ff5d39a366893ac3a0eed80e03f970cd"
+    "hash": "aa1f6f5f801802075c3af039588eac13"
   },
   {
     "file": "js/controllers/tabs.js",
@@ -713,7 +713,11 @@
   },
   {
     "file": "templates/account/login.html",
-    "hash": "61b13bece0aae2d92f55f8f21c13081b"
+    "hash": "d7ec097c6b4560a23ce5c5b19d953406"
+  },
+  {
+    "file": "templates/account/loginAccount.html",
+    "hash": "77c0e041f70b3c9bb3954f5973bcf991"
   },
   {
     "file": "templates/add/addExplain.html",
@@ -725,11 +729,11 @@
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "7d9debbf1ade697a2f74fdb7e9f9b4ed"
+    "hash": "d620451043f133f2bb98b3ed84f637a1"
   },
   {
     "file": "templates/home/index.html",
-    "hash": "457c77c56b4de63bb16662bb2cc7de6d"
+    "hash": "935146196b3ff3dceb761e5db0618d33"
   },
   {
     "file": "templates/home/oldDream.html",

+ 5 - 2
miaomiao/www/css/style.css

xqd xqd
@@ -43,7 +43,7 @@
     
 .lglogin {
     left: 50%;
-    margin-top: 60%;
+    margin-top: 40%;
 }
 .lglogin span {
     text-align: center;
@@ -513,10 +513,13 @@ a:visited,a:link{
 }
  .detail-like .row{
      padding: 0;
+     height: 70px;
+     color: #898989;
+     background: #E6E6E6;
  }
  .detail-like .col{
      text-align: center;
-     padding: 0;
+     padding: 5px 0 0 0;
  }
 .detail-like .col img{
     height: 35px;

+ 61 - 0
miaomiao/www/img/Moments.svg

xqd
@@ -0,0 +1,61 @@
+<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="44.92" height="44.92" viewBox="0 0 44.92 44.92">
+  <defs>
+    <style>
+      .cls-1 {
+        fill: none;
+      }
+
+      .cls-2 {
+        fill: #e67258;
+      }
+
+      .cls-3 {
+        clip-path: url(#clip-path);
+      }
+
+      .cls-4 {
+        fill: #e7ad5a;
+      }
+
+      .cls-5 {
+        fill: #e7d55c;
+      }
+
+      .cls-6 {
+        fill: #b2d361;
+      }
+
+      .cls-7 {
+        fill: #78be59;
+      }
+
+      .cls-8 {
+        fill: #71c6d5;
+      }
+
+      .cls-9 {
+        fill: #5e93ce;
+      }
+
+      .cls-10 {
+        fill: #5758a4;
+      }
+    </style>
+    <clipPath id="clip-path" transform="translate(-8.09 -7.06)">
+      <rect class="cls-1" x="8.09" y="7.03" width="44.95" height="45"/>
+    </clipPath>
+  </defs>
+  <title>Moments</title>
+  <g>
+    <path class="cls-2" d="M24.29,7.94,39,26.07l.4-17.16a22.69,22.69,0,0,0-8.9-1.84,23.12,23.12,0,0,0-6.26.88Zm0,0" transform="translate(-8.09 -7.06)"/>
+    <g class="cls-3">
+      <path class="cls-4" d="M10.89,18.69,34.15,21.1,22.28,8.66a22,22,0,0,0-7.62,5,23.06,23.06,0,0,0-3.77,5.05Zm0,0" transform="translate(-8.09 -7.06)"/>
+      <path class="cls-5" d="M9,35.77,27.1,21l-17.16-.4a22.69,22.69,0,0,0-1.84,8.9A23.12,23.12,0,0,0,9,35.77Zm0,0" transform="translate(-8.09 -7.06)"/>
+    </g>
+    <path class="cls-6" d="M19.72,49.17l2.41-23.26L9.69,37.78a22,22,0,0,0,5,7.62,23.05,23.05,0,0,0,5.05,3.77Zm0,0" transform="translate(-8.09 -7.06)"/>
+    <path class="cls-7" d="M36.8,51.09,22,33l-.4,17.16A22.69,22.69,0,0,0,30.55,52a23.11,23.11,0,0,0,6.26-.88Zm0,0" transform="translate(-8.09 -7.06)"/>
+    <path class="cls-8" d="M50.2,40.35,26.94,37.94,38.81,50.37a22,22,0,0,0,7.62-5,23,23,0,0,0,3.77-5.05Zm0,0" transform="translate(-8.09 -7.06)"/>
+    <path class="cls-9" d="M52.12,23.26,34,38l17.16.4A22.69,22.69,0,0,0,53,29.52a23.12,23.12,0,0,0-.88-6.26Zm0,0" transform="translate(-8.09 -7.06)"/>
+    <path class="cls-10" d="M41.37,9.87,39,33.13,51.4,21.26a22.44,22.44,0,0,0-10-11.39Zm0,0" transform="translate(-8.09 -7.06)"/>
+  </g>
+</svg>

+ 24 - 0
miaomiao/www/img/friends.svg

xqd
@@ -0,0 +1,24 @@
+<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="49.96" height="42.31" viewBox="0 0 49.96 42.31">
+  <defs>
+    <style>
+      .cls-1 {
+        fill: none;
+      }
+
+      .cls-2 {
+        clip-path: url(#clip-path);
+      }
+
+      .cls-3 {
+        fill: #00c3da;
+      }
+    </style>
+    <clipPath id="clip-path" transform="translate(-6.56 -7.37)">
+      <rect class="cls-1" x="6.57" y="7.32" width="50" height="42.41"/>
+    </clipPath>
+  </defs>
+  <title>friends</title>
+  <g class="cls-2">
+    <path class="cls-3" d="M46.72,43.77c0,5.71-7.79,5.9-18.61,5.9s-21.55-.2-21.55-5.9c0-4.34,5.08-10.54,12.26-13.32a12.64,12.64,0,0,1-5.4-10.3A13,13,0,0,1,26.64,7.37,13,13,0,0,1,39.86,20.16a12.63,12.63,0,0,1-5.41,10.3c7.51,2.79,12.27,9,12.27,13.31Zm9.8-2c0,4.1.12,4.8-6.91,4.92a4.3,4.3,0,0,0,1-2.93c0-4.28-3.77-10.52-11.29-13.31,3.28-2.33,4.43-6.07,4.43-10.3a12.48,12.48,0,0,0-3-8.12c1.24-.47.62-.74,2-.74,6.06,0,8,4.79,8,10.71,0,3.54-.79,6.68-3.51,8.63,6.23,2.34,9.2,7.56,9.2,11.14Zm0,0" transform="translate(-6.56 -7.37)"/>
+  </g>
+</svg>

+ 3 - 1
miaomiao/www/js/config/router.js

xqd
@@ -3,11 +3,13 @@
         $stateProvider
           .state('login', {
               url: '/account/login',
+              cache:"false",
               templateUrl: 'templates/account/login.html',
-              controller: 'loginCtrl'
+              controller: 'wechatLoginCtrl'
           })
             .state('loginAccount', {
                 url: '/account/loginAccount',
+                params:{wechat:null},
                 templateUrl: 'templates/account/loginAccount.html',
                 controller: 'loginCtrl'
             })

+ 86 - 64
miaomiao/www/js/controllers/account.js

xqd
@@ -1,74 +1,96 @@
 (function (app) {
-    app.controller('loginCtrl', ["$scope", "userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",
+    app.controller('wechatLoginCtrl', ["$scope", "userService","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",
         function ($scope, userService,$ionicNavBarDelegate, storage, $state, msg, $http, util, $timeout) {
              //$ionicNavBarDelegate.showBackButton(false);
-
-            $scope.vm = {
-            mobile: '',
-            verify_code: '',
-            waitSeconds: "获取验证码"
-        };
-        $scope.login = function () {
-            msg.loading('登录中...');
-            userService.login($scope.vm.mobile, $scope.vm.verify_code).then(function (result) {
-                msg.hide();
-                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');
-            }, function (error) {
-               // msg.hide();
-                // msg.error(error.data.message);
-            });
-        };
-        //$scope.loginbywx = function () {
-        //    var scope = "snsapi_userinfo", state = "_" + (+new Date());
-        //    Wechat.auth(scope, state, function (response) {
-        //
-        //        alert(JSON.stringify(response));
-        //    }, function (reason) {
-        //        alert("Failed: " + reason);
-        //    });
-        //};
             $scope.loginbywx = function(){
-              $state.go("loginAccount")
+                var scope = "snsapi_userinfo", state = "_" + (+new Date());
+                Wechat.auth(scope, state, function (response) {
+                    alert(JSON.stringify(response));
+                    $scope.wecaht = response;
+                }, function (reason) {
+                    alert("Failed: " + reason);
+                });
+                userService.loginbywx($scope.wechat).then(function(result){
+                    msg.hide();
+                    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');
+                },function(error){
+                    $state.go("loginAccount",{wechat:$scope.wecaht})
+                });
+            };
+    }]);
+    app.controller('loginCtrl', ["$scope", "userService","$stateParams","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",
+        function ($scope, userService,$stateParams,$ionicNavBarDelegate, storage, $state, msg, $http, util, $timeout) {
+            //$ionicNavBarDelegate.showBackButton(false);
+            $scope.wecaht = $stateParams.wechat;
+            debugger;
+            $scope.vm = {
+                mobile: '',
+                verify_code: '',
+                waitSeconds: "获取验证码"
+            };
+            $scope.login = function () {
+                msg.loading('登录中...');
+                userService.login($scope.vm.mobile, $scope.vm.verify_code,$scope.wechat).then(function (result) {
+                    msg.hide();
+                    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');
+                }, function (error) {
+                    // msg.hide();
+                    // msg.error(error.data.message);
+                });
+            };
+            /*     $scope.loginbywx = function () {
+             var scope = "snsapi_userinfo", state = "_" + (+new Date());
+             Wechat.auth(scope, state, function (response) {
+
+             alert(JSON.stringify(response));
+             }, function (reason) {
+             alert("Failed: " + reason);
+             });
+             };*/
+
+            //获取验证码
+            $scope.getVerifyCode = function () {
+                // if (!util.isMobile($scope.vm.mobile)) {
+                //     msg.text('请输入正确的手机号');
+                //     return;
+                // }
+                if ($scope.vm.waitSeconds!="获取验证码") {
+                    msg.text('请稍后再试', true);
+                    return;
+                }
+                $scope.vm.waitSeconds = "正在发送";
+                userService.getVerifyCode($scope.vm.mobile).then(function (result) {
+                    wait(50);
+                    // $scope.returncode = result.data;
+                    if(result.data.data.verify_code)msg.success(result.data.data.verify_code);
+                }, function (error) {
+                    $scope.vm.waitSeconds = "获取验证码";
+                    wait(0);
+                    // msg.error(error.data.message);
+                });
+            };
+            var wait = function (seconds) {
+                if (seconds > 0) {
+                    $scope.vm.waitSeconds = "" + seconds + "秒";
+                } else {
+                    $scope.vm.waitSeconds = "获取验证码";
+                }
+                $timeout(function () {
+                    if (seconds >= 1)
+                        wait(seconds - 1);
+                }, 1000);
             };
-        //获取验证码
-        $scope.getVerifyCode = function () {
-            // if (!util.isMobile($scope.vm.mobile)) {
-            //     msg.text('请输入正确的手机号');
-            //     return;
-            // }
-            if ($scope.vm.waitSeconds!="获取验证码") {
-               msg.text('请稍后再试', true);
-               return;
-            }
-            $scope.vm.waitSeconds = "正在发送";
-            userService.getVerifyCode($scope.vm.mobile).then(function (result) {
-                wait(50);
-                // $scope.returncode = result.data;
-                if(result.data.data.verify_code)msg.success(result.data.data.verify_code);
-            }, function (error) {
-                $scope.vm.waitSeconds = "获取验证码";
-                wait(0);
-                // msg.error(error.data.message);
-            });
-        };
-        var wait = function (seconds) {
-            if (seconds > 0) {
-                $scope.vm.waitSeconds = "" + seconds + "秒";
-            } else {
-                $scope.vm.waitSeconds = "获取验证码";
-            }
-            $timeout(function () {
-                if (seconds >= 1)
-                    wait(seconds - 1);
-            }, 1000);
-        };
             $scope.clear = function(){
                 document.getElementById("tel").value = "";
             }
-    }]);
+        }]);
   
 })(angular.module('app.controllers'));

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

xqd
@@ -534,19 +534,42 @@
                 $scope.bigImage = false;
             };
             $scope.addpict = function () {
-            common.chooseImage().then(function (img) {
-                common.uploadFiles(img,1).then(function (result) {
-                    var response = JSON.parse(result.response);
-                    var file = response.data.file;
-                    $scope.imgs.push(config.imgServer+file);
-                    console.log(JSON.stringify(config.imgServer+file));
+                common.chooseImage().then(function (img) {
+                    common.uploadFiles(img,1).then(function (result) {
+                        var response = JSON.parse(result.response);
+                        var file = response.data.file;
+                        $scope.imgs.push(config.imgServer+file);
+                        console.log(JSON.stringify(config.imgServer+file));
+                    }, function (error) {
+                        msg.error('图片上传失败');
+                    });
                 }, function (error) {
-                    msg.error('图片上传失败');
+                    console.log('图片选择失败');
                 });
-            }, function (error) {
-                console.log('图片选择失败');
-            });
-        };
+            };
+            $scope.deletefile = function (file) {
+                var index = $scope.imgs.indexOf(file);
+                $scope.imgs.splice(index, 1);
+                common.deletefile(file).then(function () {
+                })
+            };
+
+            $scope.addvideo = function () {
+                common.chooseVideo().then(function (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;
+                        $scope.video.isOK = true;
+                        $scope.video.file = file;
+                        $scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
+                    }, function (error) {
+                        msg.error('视频上传失败');
+                    });
+                }, function (erro) {
+                    console.log('选择视频失败');
+                });
+            };
 
           $ionicModal.fromTemplateUrl('recharge-modal.html', {
             scope: $scope,

+ 3 - 0
miaomiao/www/js/filters/filter.js

xqd
@@ -70,6 +70,9 @@
             if(number<=0){
                 number="结束";
             }
+            else if(number<1 && number>0){
+                number="剩余<1天"
+            }
             else {
                 number="剩余"+number+"天"
             }

+ 9 - 2
miaomiao/www/js/services/userservice.js

xqd
@@ -1,11 +1,18 @@
 (function (app) {
     app.factory('userService', ['$http', 'config', "util", 'storage', function ($http, config, util, storage) {
         return {
-            login: function (phone, verify_code) {
+            loginbywx:function(wechat){
+                return $http({
+                    url: config.server + 'api/auth/wechat_login',
+                    method: "post",
+                    data: { wechat: wechat}
+                })
+            },
+            login: function (phone, verify_code,wechat) {
                 return $http({
                     url: config.server + 'api/auth/login',
                     method: "post",
-                    data: { phone: phone, verify_code: verify_code}
+                    data: { phone: phone, verify_code: verify_code, wechat:wechat}
                 })
             },
             getVerifyCode:function (mobile) {

+ 3 - 2
miaomiao/www/templates/account/login.html

xqd
@@ -1,7 +1,8 @@
 <ion-view view-title="瞄喵">
     <ion-content>
-        <div  class="lglogin">
-            <span style="font-size: 15px; color: #E1E1E1">- 微信登录 -</span>
+        <div class="lglogin">
+            <img ng-src="img/icon_login.svg"  style="margin:0 auto;display:block;width:100px;border-radius:50px"/>
+            <span style="font-size: 15px; color: #E1E1E1; margin-top: 30px">- 微信登录 -</span>
             <div class="lgsocial">
                 <!--<img  ng-src="img/icon_weibo.svg"/>-->
                 <img ng-click="loginbywx()" ng-src="img/icon_wechat.svg"/>

+ 11 - 6
miaomiao/www/templates/home/dream-detail.html

xqd xqd
@@ -262,11 +262,16 @@
                 <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 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>
+                <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>
+                    <em style="font-size: 16px">添加视频</em>
+                </a>
             </div>
 
         </div>
@@ -427,14 +432,14 @@
             </div>
         </div>
     <div class="detail-like" ng-if="toshare">
-        <div class="row" style="background: #CCCCCC;">
+        <div class="row">
             <div class="col" ng-click="shareDream(1)">
-                <img ng-src="img/weixin.png" ><br>
-                微信
+                <img ng-src="img/friends.svg" ><br>
+                分享给朋友
             </div>
             <div class="col" ng-click="shareDream(2)">
-                <img ng-src="img/weibo.png" ><br>
-                微博
+                <img ng-src="img/Moments.svg" ><br>
+                分享到朋友圈
             </div>
         </div>
     </div>

+ 117 - 3
server/app/Http/Controllers/Api/V1/AuthController.php

xqd xqd xqd xqd
@@ -66,7 +66,7 @@ class AuthController extends Controller
      *    1610    SERVICE_CODE_FAILED          验证码错误
      *
      */
-    public function login(Request $request) {
+    public function login(Request $request,$openid_webo=null,$type=null) {
         $validator = Validator::make($request->all(),
             [
                 'phone'         => 'required|regex:/^1[34578]\d{9}$/',
@@ -86,8 +86,7 @@ class AuthController extends Controller
         $key = $this->keySmsCode . $phone;
         $code = Cache::store('file')->get($key);
         $password = 123456;
-        if ($request->verify_code != $code)
-            return $this->error(ErrorCode::SERVICE_CODE_FAILED);
+        if ($request->verify_code != $code) return $this->error(ErrorCode::SERVICE_CODE_FAILED);
         $user = UserInfoModel::where('phone',$phone)->first();
         if (empty($user)) {
             $user = UserInfoModel::create(['phone'=>$phone,'password'=>bcrypt(123456)]);
@@ -97,6 +96,15 @@ class AuthController extends Controller
         if ($status == 0) return $this->error(ErrorCode::LOCK_USER);
         if (Auth::attempt(['phone'=>$phone,'password'=>$password])) {
             $user = Auth::user();
+            if (!empty($openid_webo)) {
+                if ($type == 'wechat') {
+                    $user->wechat =$openid_webo;
+                }
+                if ($type == 'webo') {
+                    $user->webo =$openid_webo;
+                }
+                $user->save();
+            }
             \Log::info($user);
             $token = $user->createToken($user->phone)->accessToken;
             return $this->api(compact( 'user', 'code','token'));
@@ -105,6 +113,112 @@ class AuthController extends Controller
         }
     }
 
+
+//    第三方登录  微信、微博
+    /**
+     * @api {post} /api/auth/wechat_login 微信登陆(login)
+     * @apiDescription 微信登陆(login)
+     * @apiGroup Auth
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {string}  wechat   微信id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "state": true,
+     *     "code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjdjYWUyYzFmYTUwMTIyZDI0ZTRiYTZhZGZhNmQxYmZlOWNiMzIxMTBmYWJlZjNjYzIyNmViZjRmNGExNWM3NjllNmU2ZTNiYWE5OGNhOWUzIn0.eyJhdWQiOiIxIiwianRpIjoiN2NhZTJjMWZhNTAxMjJkMjRlNGJhNmFkZmE2ZDFiZmU5Y2IzMjExMGZhYmVmM2NjMjI2ZWJmNGY0YTE1Yzc2OWU2ZTZlM2JhYTk4Y2E5ZTMiLCJpYXQiOjE0NzU0MTE1NTgsIm5iZiI6MTQ3NTQxMTU1OCwiZXhwIjo0NjMxMDg1MTU4LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.E9YGEzuRUOk02aV1EiWLJ_pD0hKoCyW0k_sGy63hM3u5X8K_HI1kVhaU6JNLqLZeszIAroTEDB8XMgZKAqTLlwtL8PLCJcuDoxfk1BRHbfjhDheTsahBysKGalvNEpzRCrGlao0mS0Cg9qDpEsndtypPFS8sfaflToOzbJjiSK2DvQiHSH8xZI3zHJTezgZMz-pB_hPTxp8ajdv0ve1gWtWjs3vERr0Y91X4hngO8X7LuXtAYtfxGZRIye12YE7TuLBMYzj8CCfiRt7Smhyf4palNW5mzKlZpa2l87n6NQ14Iy4oMzQ2PON1j_swrosuE2yZohGOn6fDdSCBRdJ6dLD_emjBdQCQOoB63R7BbhFZgvFX25TjzFJ7r9AdVMiGmebuRKEVSZV_JCGu1C71OIbQk-UK35s00gSr2fmJGBbN2cZTXBRTJpfuMZ_ihFYEZrvVq_Ih2X0xkd36JUuxaUld1BXRgPZvH-9jBuhe0YW2OOlgwpdm6ZB8BMcuS4ftLoi6FipgzFqfIuy-0ZqPMDnJaG7Gycrdpxza00mgOFxYxJtqwZNsUWFRZEVU881l6VC_cy294YXSPQxUwEoyKg-G5Pm8AEB9bqv5z4EU4B8-XTd3zKNqtNba_snHbc711i4EytCiZfYSjNB1hwenq45YYOAhPTwOpFI0kxyRazc",
+     *         "user": {
+     *             "id": 1,
+     *             "name": "15888888888",
+     *             "email": "abcdefg@gmail.com",
+     *             "type": 2,
+     *             "phone": "15888888888",
+     *             "avatar": null,
+     *             "last_ip": null,
+     *             "created_at": "2016-09-30 00:45:13",
+     *             "updated_at": "2016-09-29 16:43:36"
+     *         }
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     */
+    public function wechatLogin(Request $request) {
+        $validator = Validator::make($request->all(),
+            [
+                'wechat'      => 'required',
+            ],
+            [
+                'wechat.required'      => '微信id不存在',
+            ]
+        );
+
+        if ($validator->fails())
+            return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
+        $user = UserInfoModel::where('wechat',$request->wechat)->first();
+        if (empty($user)) {
+           $this->login($request,$request->wechat,'wechat');
+        }else{
+            $token = $user->createToken($user->phone)->accessToken;
+            return $this->api(compact( 'user', 'code','token'));
+        }
+    }
+
+    /**
+     * @api {post} /api/auth/webo_login 微博登录
+     * @apiDescription 微博登录
+     * @apiGroup Auth
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {string}  webo   微博id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "state": true,
+     *     "code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjdjYWUyYzFmYTUwMTIyZDI0ZTRiYTZhZGZhNmQxYmZlOWNiMzIxMTBmYWJlZjNjYzIyNmViZjRmNGExNWM3NjllNmU2ZTNiYWE5OGNhOWUzIn0.eyJhdWQiOiIxIiwianRpIjoiN2NhZTJjMWZhNTAxMjJkMjRlNGJhNmFkZmE2ZDFiZmU5Y2IzMjExMGZhYmVmM2NjMjI2ZWJmNGY0YTE1Yzc2OWU2ZTZlM2JhYTk4Y2E5ZTMiLCJpYXQiOjE0NzU0MTE1NTgsIm5iZiI6MTQ3NTQxMTU1OCwiZXhwIjo0NjMxMDg1MTU4LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.E9YGEzuRUOk02aV1EiWLJ_pD0hKoCyW0k_sGy63hM3u5X8K_HI1kVhaU6JNLqLZeszIAroTEDB8XMgZKAqTLlwtL8PLCJcuDoxfk1BRHbfjhDheTsahBysKGalvNEpzRCrGlao0mS0Cg9qDpEsndtypPFS8sfaflToOzbJjiSK2DvQiHSH8xZI3zHJTezgZMz-pB_hPTxp8ajdv0ve1gWtWjs3vERr0Y91X4hngO8X7LuXtAYtfxGZRIye12YE7TuLBMYzj8CCfiRt7Smhyf4palNW5mzKlZpa2l87n6NQ14Iy4oMzQ2PON1j_swrosuE2yZohGOn6fDdSCBRdJ6dLD_emjBdQCQOoB63R7BbhFZgvFX25TjzFJ7r9AdVMiGmebuRKEVSZV_JCGu1C71OIbQk-UK35s00gSr2fmJGBbN2cZTXBRTJpfuMZ_ihFYEZrvVq_Ih2X0xkd36JUuxaUld1BXRgPZvH-9jBuhe0YW2OOlgwpdm6ZB8BMcuS4ftLoi6FipgzFqfIuy-0ZqPMDnJaG7Gycrdpxza00mgOFxYxJtqwZNsUWFRZEVU881l6VC_cy294YXSPQxUwEoyKg-G5Pm8AEB9bqv5z4EU4B8-XTd3zKNqtNba_snHbc711i4EytCiZfYSjNB1hwenq45YYOAhPTwOpFI0kxyRazc",
+     *         "user": {
+     *             "id": 1,
+     *             "name": "15888888888",
+     *             "email": "abcdefg@gmail.com",
+     *             "type": 2,
+     *             "phone": "15888888888",
+     *             "avatar": null,
+     *             "last_ip": null,
+     *             "created_at": "2016-09-30 00:45:13",
+     *             "updated_at": "2016-09-29 16:43:36"
+     *         }
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     */
+    public function weboLogin(Request $request) {
+        $validator = Validator::make($request->all(),
+            [
+                'webo'      => 'required',
+            ],
+            [
+                'webo.required'      => '微博id不存在',
+            ]
+        );
+
+        if ($validator->fails())
+            return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
+        $user = UserInfoModel::where('webo',$request->webo)->first();
+        if (empty($user)) {
+            $this->login($request,$request->webo,'webo');
+        }else{
+            $token = $user->createToken($user->phone)->accessToken;
+            return $this->api(compact( 'user', 'code','token'));
+        }
+    }
+
     /**
      * @api {get} /api/auth/logout 退出(logout)
      * @apiDescription 退出(logout)

+ 0 - 1
server/app/Http/Controllers/Api/V1/IndexController.php

xqd
@@ -119,7 +119,6 @@ class IndexController extends Controller
         $id_arr2 = array_column($arr2,'id');
         $dtusers =UserCareUser::where('user_id',$id)->with('other_user')->
         where('dream_number','>',0)->orderBy('created_at')->get()->toArray();
-
         $hdusers = CommentInfoModel::where(function ($query) use ($id) {
             $query->where('user_id',$id)->orWhere('to_user_id',$id);
         })->where('is_read',0)->with('to_user')->orderBy('created_at')->get()->toArray();

+ 387 - 0
server/app/Http/Controllers/Api/V1/PayController.php

xqd
@@ -0,0 +1,387 @@
+<?php
+
+namespace App\Http\Controllers\Api\V1;
+
+use App\Http\HelperTraits\LogHelper;
+use App\Http\HelperTraits\PayHelper;
+use App\Http\HelperTraits\JpushHelper;
+use Omnipay\Omnipay;
+use App\User;
+use App\Models\MerchantMemberService;
+use App\Models\Order;
+use App\Models\AccountLog;
+use Request, Config, DB;
+
+class PayController extends Controller
+{
+    use PayHelper, LogHelper,JpushHelper;
+
+    /**
+     * p++ webhooks通知
+     */
+//    public function pppNotify() {
+//        $sig = Request::header('x-pingplusplus-signature');
+//        $request = Request::instance();
+//        $data = $request->getContent();
+//
+//        if (!$this->checkPppSignature($data, $sig)) {//验签失败
+//            header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+//            exit("fail");
+//        }
+//
+//        $event = json_decode($data);
+//        if (!isset($event->type)) {
+////            return Response::make('fail', 400);
+//            header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+//            exit("fail");
+//        }
+//        switch ($event->type) {
+//            case "charge.succeeded":
+//                // 开发者在此处加入对支付异步通知的处理代码
+//                header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
+//                break;
+//            case "refund.succeeded":
+//                // 开发者在此处加入对退款异步通知的处理代码
+//                header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
+//                break;
+//            default:
+//                header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+//                break;
+//        }
+//    }
+
+    public function alipayNotify() {
+        $rawInfo = Request::all();
+        \Log::info('aliplay callback');
+        \Log::info($rawInfo);
+
+        $config = Config::get('laravel-omnipay.gateways.alipay');
+
+        $gateway = Omnipay::create($config['driver']);
+        $gateway->setEnvironment($config['options']['environment']);
+        $gateway->setAppId($config['options']['appid']);
+        $gateway->setEncryptKey($config['options']['encrypt_key']);
+        $gateway->setPrivateKey($config['options']['prikey']);
+        $gateway->setAlipayPublicKey($config['options']['ali_pubkey']);
+        $gateway->setNotifyUrl($config['options']['notify_url']);
+
+        $request = $gateway->completePurchase();
+        $request->setParams($rawInfo);//Optional
+
+        try {
+            $response = $request->send();
+
+            if($response->isPaid()){
+                \Log::info('支付成功');
+
+                $out_trade_no = $rawInfo['out_trade_no'];
+                $order = Order::where('transaction_id', '=', $out_trade_no)->first();
+                if (!$order) {
+                    \Log::error('找不到订单' . $out_trade_no);
+                    return 'fail';
+                }
+                $master_amount =  $order->number;
+                $slave_amount = 0;
+                if (!empty($order->ext_info)) {
+                    $extInfo = json_decode($order->ext_info, true);
+                    if ($extInfo !== null) {
+                        $cc = $extInfo['cc_bonus'];
+                        $master_amount = round(($cc / 100) * $order->number);
+                        $slave_amount = $order->number - $master_amount;
+                    }
+                }
+                $tp = '';
+//                $u = null;
+                if ($order->user_type == Order::USER_TYPE_MERCHANT) {
+                    $tp = 'Merchant';
+//                    $u = Merchant::find($order->user_id);
+                } elseif ($order->user_type == Order::USER_TYPE_MEMBER) {
+                    $tp = 'Member';
+                    //Not handled here
+                }
+                $u = User::find($order->user_id);
+                if (!$u) {
+                    \Log::error('用户不存在' . $order->user_type . ', ' . $order->user_id);
+                    return 'success';
+                }
+
+                DB::beginTransaction();
+
+                if ($order->goods_type == Order::GOODS_TYPE_BALANCE||$order->goods_type == Order::GOODS_TYPE_COSUME) {
+                    $cType = AccountLog::TYPE_BALANCE;
+//                    $u->account_balance += $order->number;
+                    $u->balance += $master_amount;
+                } elseif ($order->goods_type == Order::GOODS_TYPE_CREDIT) {
+                    $cType = AccountLog::TYPE_CREDIT;
+//                    $u->credit_balance += $order->number;
+                    $u->credit += $master_amount;
+                } else {
+                    \Log::error('商品不存在' . $order->goods_type);
+                    return 'success';
+                }
+                \Log::info('支付金额 '.$master_amount);
+                if ($u->save()) {
+
+                    //更新订单状态
+                    $order->status = Order::STATUS_FINISHED;
+                    $order->save();
+
+                    //记日志
+                    $amount = $rawInfo['total_amount'] * 100;
+                    if (empty($extInfo)) {
+                        $this->logAccount($tp, $u->id, $u->name,
+                            AccountLog::OP_CHARGE, $cType, $master_amount,
+                            AccountLog::DIRECTION_INC, $cType == AccountLog::TYPE_BALANCE ? $u->balance : $u->credit, AccountLog::CHANNEL_ALIPAY);
+                    } else {
+                        //续消费
+                        $this->continue_consume($order);
+
+                        $this->logAccount($tp, $u->id, $u->name,
+                            AccountLog::OP_CC, $cType, $master_amount,
+                            AccountLog::DIRECTION_INC, $cType == AccountLog::TYPE_BALANCE ? $u->balance : $u->credit, AccountLog::CHANNEL_ALIPAY);
+                    }
+                    \Log::info('支付完成');
+
+                } else {
+                    DB::rollBack();
+                    \Log::error('保存数据失败');
+                }
+
+
+                DB::commit();
+
+                return 'success';
+            }else{
+                \Log::error('支付失败');
+
+                return 'fail';
+            }
+        } catch (\Exception $e) {
+            \Log::error('支付异常' . $e->getMessage());
+
+            return 'fail';
+        }
+
+    }
+
+    public function wechatpayNotify() {
+        \Log::debug('wechatpay callback');
+//        \Log::debug(Request::all());
+
+        $config = Config::get('laravel-omnipay.gateways.wechatpay');
+
+        $gateway = Omnipay::create("WechatPay");
+//        $gateway->setEnvironment('sandbox');
+        $gateway->setAppId($config['options']['appid']);
+        $gateway->setMchId($config['options']['merchant_id']);
+        $gateway->setApiKey($config['options']['apikey']);
+
+        $response = $gateway->completePurchase([
+            'request_params' => file_get_contents('php://input')
+        ])->send();
+        try {
+            if ($response->isPaid()) {
+                //pay success
+                $rawInfo = $response->getRequestData();
+                \Log::debug($rawInfo);
+                \Log::info('支付成功');
+
+                $out_trade_no = $rawInfo['out_trade_no'];
+                $order = Order::where('transaction_id', '=', $out_trade_no)->first();
+                if (!$order) {
+                    \Log::error('找不到订单' . $out_trade_no);
+                    return 'fail';
+                }
+                $master_amount =  $order->number;
+                $slave_amount = 0;
+                if (!empty($order->ext_info)) {
+                    $extInfo = json_decode($order->ext_info, true);
+                    if ($extInfo !== null) {
+                        $cc = $extInfo['cc_bonus'];
+                        $master_amount = round(($cc / 100) * $order->number);
+                        $slave_amount = $order->number - $master_amount;
+                    }
+                }
+                $tp = '';
+//                $u = null;
+                if ($order->user_type == Order::USER_TYPE_MERCHANT) {
+                    $tp = 'Merchant';
+//                    $u = Merchant::find($order->user_id);
+                } elseif ($order->user_type == Order::USER_TYPE_MEMBER) {
+                    $tp = 'Member';
+                    //Not handled here
+                }
+                $u = User::find($order->user_id);
+                if (!$u) {
+                    \Log::error('用户不存在' . $order->user_type . ', ' . $order->user_id);
+                    return 'success';
+                }
+
+                DB::beginTransaction();
+
+                if ($order->goods_type == Order::GOODS_TYPE_BALANCE||$order->goods_type == Order::GOODS_TYPE_COSUME) {
+                    $cType = AccountLog::TYPE_BALANCE;
+//                    $u->account_balance += $order->number;
+                    $u->balance += $master_amount;
+                } elseif ($order->goods_type == Order::GOODS_TYPE_CREDIT) {
+                    $cType = AccountLog::TYPE_CREDIT;
+//                    $u->credit_balance += $order->number;
+                    $u->credit += $master_amount;
+                } else {
+                    \Log::error('商品不存在' . $order->goods_type);
+                    return 'success';
+                }
+                //测试
+                \Log::info('支付金额 '.$master_amount);
+                if ($u->save()) {
+
+                    //更新订单状态
+                    $order->status = Order::STATUS_FINISHED;
+                    $order->save();
+
+                    //记日志
+                    $amount = $rawInfo['total_fee'] * 100;
+                    if (empty($extInfo)) {
+                        $this->logAccount($tp, $u->id, $u->name,
+                            AccountLog::OP_CHARGE, $cType, $master_amount,
+                            AccountLog::DIRECTION_INC, $cType == AccountLog::TYPE_BALANCE ? $u->balance : $u->credit, AccountLog::CHANNEL_WECHATPAY);
+                    } else {
+
+                        $this->logAccount($tp, $u->id, $u->name,
+                            AccountLog::OP_CC, $cType, $master_amount,
+                            AccountLog::DIRECTION_INC, $cType == AccountLog::TYPE_BALANCE ? $u->balance : $u->credit, AccountLog::CHANNEL_WECHATPAY);
+                    }
+
+                    \Log::info('支付完成');
+
+                } else {
+                    DB::rollBack();
+                    \Log::error('保存数据失败');
+                }
+
+                DB::commit();
+
+                return 'success';
+            }else{
+                //pay fail
+                \Log::error($response->getData());
+                return 'fail';
+            }
+
+        } catch (\Exception $e) {
+            \Log::error('支付异常' . $e->getMessage());
+
+            return 'fail';
+        }
+    }
+
+
+    function continue_consume($order){
+
+    }
+
+
+
+
+    /**
+     * @api {post} /api/pay/charge 充值
+     * @apiDescription 充值(向平台充值)
+     * @apiGroup Merchant
+     * @apiPermission Passport
+     * @apiVersion 0.1.0
+     * @apiParam {int}  [goods=1]   充值商品(1:余额,2:卡金)
+     * @apiParam {int}  number      充值数量,人民币,以分表示
+     * @apiParam {int}  type        支付类型(1:支付宝,2:微信支付)
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "state": true,
+     *     "code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "id": 2,
+     *         "code": "ALIPAY_201610231314145719",
+     *         "transaction_id": "201610231314145719",
+     *         "user_type": 2,
+     *         "user_id": 1,
+     *         "goods_type": 1,
+     *         "price": 1,
+     *         "number": 1,
+     *         "amount": 1,
+     *         "pay_type": 1,
+     *         "status": 0,
+     *         "created_at": "2016-10-23 13:14:14",
+     *         "updated_at": "2016-10-23 13:14:14",
+     *         "orderString": "alipay_sdk=lokielse%2Fomnipay-alipay&app_id=2016091201894867&biz_content=%7B%22subject%22%3A%22%5Cu7532%5Cu8c61%5Cu8054%5Cu5408-%5Cu4f59%5Cu989d%5Cu5145%5Cu503c%22%2C%22out_trade_no%22%3A%22201610231314145719%22%2C%22total_amount%22%3A0.01%2C%22product_code%22%3A1%7D&charset=UTF-8&format=JSON&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Fweb%2Fapi%2Fpay%2Falipay%2Fnotify&sign_type=RSA&timestamp=2016-10-23+13%3A14%3A14&version=1.0&sign=oxKM0qGMHLWDlMrXHIiy9%2Fk2BXJq3rC3RKdmcfFwkBJVRXvtG6cBoAYPll6VxJYOMQWeu78Ibfov%2FxIVCuN9yUfzEiokfQrzBoptc94bCQ5k0pNyJcSdgezOUKHB12P5Zmm3Hd6AAbGRDV9UCaLVz0wYkFJPrCyUv1ZfhrM%2BBqc%3D"
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     * 1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     * 1300    MERCHANT_NOT_EXIST              商户不存在
+     */
+    public function charge(Request $request)
+    {
+        $goodsTypes = Order::getAllGoodsTypes();
+        $gTypes = array_keys($goodsTypes);
+        $payTypes = Order::getAllPayTypes();
+        $pTypes = array_keys($payTypes);
+        $validator = Validator::make($data = $request->input(),
+            [
+                'number' => 'required|integer|min:1',
+                'type' => 'required|in:' . join(',', $pTypes),
+                'goods' => 'in:' . join(',', $gTypes),
+            ],
+            [
+                'number.required' => '充值金额必填',
+                'number.integer' => '金额必须为整数',
+                'number.min' => '充值金额至少为1',
+                'type.required' => '支付类型必填',
+                'type.in' => '支付类型非法',
+                'goods.in' => '充值商品非法',
+            ]
+        );
+
+        if ($validator->fails()) {
+            return $this->validatorError($validator->messages()->all(), ErrorCode::CLIENT_WRONG_PARAMS);
+        }
+
+        $user = Auth::user();
+        $merchant = Merchant::where('user_id', '=', $user->id)->first();//模型支持单用户多商户,业务只设计单商户
+        if (!$merchant) {
+            return $this->error(ErrorCode::MERCHANT_NOT_EXIST);
+        }
+
+        $data['goods_id'] = 0;
+        if (!isset($data['goods'])) {//默认充余额
+            $data['goods'] = Order::GOODS_TYPE_BALANCE;
+        }
+
+        $data['user_type'] = Order::USER_TYPE_MERCHANT;
+        $data['user_id'] = $user->id;//$merchant->id;
+        if ($data['type'] == Order::PAY_TYPE_ALIPAY) {
+            $result = $this->createAlipayCharge($data);
+        } else {
+            $result = $this->createWechatpayCharge($data);
+        }
+
+        if ($result === false) {
+            return $this->error(ErrorCode::ORDER_GENERATE_FAILED);
+        }
+        //log
+//        $data['amount'] = $data['number'];
+//        $this->chargeLog('Merchant', $merchant->id, $merchant->name,
+//            'balance', $data['amount'], 'balance', $data['amount'],
+//            'Merchant', $user->id, $merchant->name);
+
+        return $this->api($result);
+    }
+
+}

+ 1 - 0
server/app/Models/UserInfoModel.php

xqd
@@ -52,6 +52,7 @@ class UserInfoModel extends Authenticatable
                            'detail_address',
                            'status',
                            'remember_token',
+                           'birthday',
                           ];
 
     protected $hidden = ['password'];

+ 26 - 0
server/routes/api.php

xqd xqd
@@ -56,6 +56,14 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'auth.login',
         'uses' => 'AuthController@login',
     ]);
+    $api->post('auth/wechat_login', [
+        'as' => 'auth.wechat_login',
+        'uses' => 'AuthController@wechatLogin',
+    ]);
+    $api->post('auth/webo_login', [
+        'as' => 'auth.webo_login',
+        'uses' => 'AuthController@weboLogin',
+    ]);
     $api->get('auth/logout', [
         'as' => 'auth.logout',
         'uses' => 'AuthController@logout',
@@ -250,4 +258,22 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'interaction.reply',
         'uses' => 'InteractionController@reply',
     ]);
+
+    //支付宝支付回调
+    $api->post('pay/alipay/notify', [
+        'as' => 'pay.alipay.notify',
+        'uses' => 'PayController@alipayNotify',
+    ]);
+    //微信支付回调
+    $api->post('pay/wechatpay/notify', [
+        'as' => 'pay.wechatpay.notify',
+        'uses' => 'PayController@wechatpayNotify',
+    ]);
+
+    //商户充值
+    $api->post('pay/charge', [
+        'as' => 'pay.charge',
+        'uses' => 'PayController@charge',
+    ]);
+
 });