Browse Source

Merge branch 'dongyuan'

Rorschach 6 years ago
parent
commit
fb9615652f
6 changed files with 210 additions and 113 deletions
  1. 136 70
      .idea/workspace.xml
  2. 21 14
      component/my/my.js
  3. 0 9
      pages/index/index.js
  4. 30 5
      pages/user/myEdit/myEdit.js
  5. 10 6
      pages/user/myEdit/myEdit.wxml
  6. 13 9
      utils/APIClient.js

+ 136 - 70
.idea/workspace.xml

@@ -4,7 +4,6 @@
     <list default="true" id="2ecf3c01-ae46-4667-8997-db10a46d1157" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/component/my/my.js" beforeDir="false" afterPath="$PROJECT_DIR$/component/my/my.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/component/my/my.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/component/my/my.wxml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/pages/index/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/pages/user/myEdit/myEdit.js" beforeDir="false" afterPath="$PROJECT_DIR$/pages/user/myEdit/myEdit.js" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml" afterDir="false" />
@@ -23,19 +22,20 @@
     <session id="-1384404472">
       <usages-collector id="statistics.lifecycle.project">
         <counts>
-          <entry key="project.closed" value="4" />
+          <entry key="project.closed" value="6" />
           <entry key="project.open.time.15" value="1" />
+          <entry key="project.open.time.26" value="1" />
           <entry key="project.open.time.30" value="1" />
           <entry key="project.open.time.32" value="1" />
           <entry key="project.open.time.4" value="1" />
           <entry key="project.open.time.5" value="1" />
-          <entry key="project.opened" value="5" />
+          <entry key="project.opened" value="6" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.file.extensions.open">
         <counts>
           <entry key="jpg" value="1" />
-          <entry key="js" value="27" />
+          <entry key="js" value="29" />
           <entry key="json" value="5" />
           <entry key="wxml" value="17" />
           <entry key="wxss" value="9" />
@@ -45,23 +45,23 @@
         <counts>
           <entry key="Image" value="1" />
           <entry key="JSON" value="5" />
-          <entry key="JavaScript" value="27" />
+          <entry key="JavaScript" value="29" />
           <entry key="PLAIN_TEXT" value="26" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.file.extensions.edit">
         <counts>
-          <entry key="js" value="572" />
+          <entry key="js" value="1245" />
           <entry key="json" value="5" />
-          <entry key="wxml" value="90" />
+          <entry key="wxml" value="160" />
           <entry key="wxss" value="87" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.file.types.edit">
         <counts>
           <entry key="JSON" value="5" />
-          <entry key="JavaScript" value="572" />
-          <entry key="PLAIN_TEXT" value="177" />
+          <entry key="JavaScript" value="1245" />
+          <entry key="PLAIN_TEXT" value="247" />
         </counts>
       </usages-collector>
       <usages-collector id="statistics.js.language.service.starts" />
@@ -73,17 +73,17 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="234">
-              <caret line="31" column="88" lean-forward="true" selection-start-line="31" selection-start-column="88" selection-end-line="31" selection-end-column="88" />
+            <state relative-caret-position="180">
+              <caret line="6" column="136" lean-forward="true" selection-start-line="6" selection-start-column="136" selection-end-line="6" selection-end-column="136" />
             </state>
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
+      <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="270">
-              <caret line="27" column="23" lean-forward="true" selection-start-line="27" selection-start-column="23" selection-end-line="27" selection-end-column="23" />
+            <state relative-caret-position="390">
+              <caret line="49" column="24" lean-forward="true" selection-start-line="49" selection-start-column="24" selection-end-line="49" selection-end-column="24" />
             </state>
           </provider>
         </entry>
@@ -91,17 +91,20 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/pages/main/class/class.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="2970">
-              <caret line="99" column="4" lean-forward="true" selection-start-line="99" selection-start-column="4" selection-end-line="99" selection-end-column="4" />
+            <state relative-caret-position="2460">
+              <caret line="82" column="23" selection-start-line="82" selection-start-column="15" selection-end-line="82" selection-end-column="23" />
+              <folding>
+                <element signature="e#0#54#0" expanded="true" />
+              </folding>
             </state>
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="false">
+      <file pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/utils/APIClient.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="422">
-              <caret line="172" column="20" lean-forward="true" selection-start-line="172" selection-start-column="20" selection-end-line="172" selection-end-column="20" />
+            <state relative-caret-position="360">
+              <caret line="225" column="38" lean-forward="true" selection-start-line="225" selection-start-column="38" selection-end-line="225" selection-end-column="38" />
             </state>
           </provider>
         </entry>
@@ -109,8 +112,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/utils/WXHttpRequest.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="960">
-              <caret line="32" column="32" lean-forward="true" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
+            <state relative-caret-position="30">
+              <caret line="1" column="29" selection-start-line="1" selection-start-column="29" selection-end-line="1" selection-end-column="29" />
             </state>
           </provider>
         </entry>
@@ -118,11 +121,12 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/pages/index/index.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="272">
-              <caret line="89" column="35" lean-forward="true" selection-start-line="89" selection-start-column="35" selection-end-line="89" selection-end-column="35" />
+            <state relative-caret-position="2070">
+              <caret line="69" column="32" selection-start-line="69" selection-start-column="32" selection-end-line="69" selection-end-column="32" />
               <folding>
                 <element signature="n#!!doc" expanded="true" />
                 <element signature="e#20#81#0" expanded="true" />
+                <element signature="e#104#156#0" expanded="true" />
               </folding>
             </state>
           </provider>
@@ -131,8 +135,17 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/component/my/my.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="1170">
-              <caret line="39" column="11" lean-forward="true" selection-start-line="39" selection-start-column="11" selection-end-line="39" selection-end-column="11" />
+            <state relative-caret-position="630">
+              <caret line="43" column="40" selection-start-line="43" selection-start-column="40" selection-end-line="43" selection-end-column="40" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/component/hot/hot.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="3630">
+              <caret line="121" column="11" selection-start-line="121" selection-start-column="11" selection-end-line="121" selection-end-column="11" />
             </state>
           </provider>
         </entry>
@@ -140,8 +153,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/utils/httpUtil.js">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="810">
-              <caret line="29" column="6" lean-forward="true" selection-start-line="29" selection-start-column="6" selection-end-line="29" selection-end-column="6" />
+            <state relative-caret-position="870">
+              <caret line="29" column="6" selection-start-line="29" selection-start-column="6" selection-end-line="29" selection-end-column="6" />
             </state>
           </provider>
         </entry>
@@ -149,8 +162,8 @@
       <file pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/component/my/my.wxml">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-270">
-              <caret line="18" column="68" lean-forward="true" selection-start-line="18" selection-start-column="68" selection-end-line="18" selection-end-column="68" />
+            <state relative-caret-position="480">
+              <caret line="19" column="39" selection-start-line="19" selection-start-column="39" selection-end-line="19" selection-end-column="39" />
             </state>
           </provider>
         </entry>
@@ -181,14 +194,14 @@
         <option value="$PROJECT_DIR$/pages/user/myconcern/myconcern.js" />
         <option value="$PROJECT_DIR$/pages/user/myconcern/myconcern.wxss" />
         <option value="$PROJECT_DIR$/pages/user/myEdit/myEdit.wxss" />
-        <option value="$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml" />
         <option value="$PROJECT_DIR$/app.json" />
-        <option value="$PROJECT_DIR$/utils/APIClient.js" />
-        <option value="$PROJECT_DIR$/component/my/my.wxml" />
-        <option value="$PROJECT_DIR$/pages/index/index.js" />
         <option value="$PROJECT_DIR$/utils/httpUtil.js" />
-        <option value="$PROJECT_DIR$/component/my/my.js" />
+        <option value="$PROJECT_DIR$/pages/index/index.js" />
+        <option value="$PROJECT_DIR$/component/my/my.wxml" />
         <option value="$PROJECT_DIR$/pages/user/myEdit/myEdit.js" />
+        <option value="$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml" />
+        <option value="$PROJECT_DIR$/utils/APIClient.js" />
+        <option value="$PROJECT_DIR$/component/my/my.js" />
       </list>
     </option>
   </component>
@@ -198,18 +211,61 @@
     <detection-done>true</detection-done>
     <sorting>DEFINITION_ORDER</sorting>
   </component>
-  <component name="ProjectFrameBounds" extendedState="7">
+  <component name="ProjectFrameBounds" extendedState="6">
     <option name="x" value="260" />
     <option name="y" value="20" />
     <option name="width" value="1400" />
     <option name="height" value="1000" />
   </component>
+  <component name="ProjectInspectionProfilesVisibleTreeState">
+    <entry key="Project Default">
+      <profile-state>
+        <expanded-state>
+          <State />
+          <State>
+            <id>CSS</id>
+          </State>
+          <State>
+            <id>Code style issuesCSS</id>
+          </State>
+          <State>
+            <id>Control flow issuesJavaScript</id>
+          </State>
+          <State>
+            <id>DOM issuesJavaScript</id>
+          </State>
+          <State>
+            <id>General</id>
+          </State>
+          <State>
+            <id>GeneralJavaScript</id>
+          </State>
+          <State>
+            <id>Invalid elementsCSS</id>
+          </State>
+          <State>
+            <id>JavaScript</id>
+          </State>
+          <State>
+            <id>Probable bugsCSS</id>
+          </State>
+          <State>
+            <id>Pug/Jade</id>
+          </State>
+          <State>
+            <id>YAML</id>
+          </State>
+        </expanded-state>
+      </profile-state>
+    </entry>
+  </component>
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
   <component name="ProjectView">
     <navigator proportions="" version="1">
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+      <pane id="Scope" />
       <pane id="ProjectPane">
         <subPane>
           <expand>
@@ -237,7 +293,6 @@
           <select />
         </subPane>
       </pane>
-      <pane id="Scope" />
     </panes>
   </component>
   <component name="PropertiesComponent">
@@ -273,18 +328,18 @@
       <workItem from="1541157092216" duration="2211000" />
       <workItem from="1541402122086" duration="6360000" />
       <workItem from="1541554466111" duration="5820000" />
-      <workItem from="1541581837551" duration="8734000" />
+      <workItem from="1541581837551" duration="14978000" />
+      <workItem from="1541640549483" duration="10184000" />
     </task>
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="23887000" />
+    <option name="totallyTimeSpent" value="40315000" />
   </component>
   <component name="ToolWindowManager">
     <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
-    <editor active="true" />
     <layout>
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.14278187" />
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.13119073" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
       <window_info id="Favorites" order="2" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
@@ -445,70 +500,81 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/component/my/my.wxml">
+    <entry file="file://$PROJECT_DIR$/pages/index/index.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-270">
-          <caret line="18" column="68" lean-forward="true" selection-start-line="18" selection-start-column="68" selection-end-line="18" selection-end-column="68" />
+        <state relative-caret-position="2070">
+          <caret line="69" column="32" selection-start-line="69" selection-start-column="32" selection-end-line="69" selection-end-column="32" />
+          <folding>
+            <element signature="n#!!doc" expanded="true" />
+            <element signature="e#20#81#0" expanded="true" />
+            <element signature="e#104#156#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/utils/APIClient.js">
+    <entry file="file://$PROJECT_DIR$/utils/WXHttpRequest.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="422">
-          <caret line="172" column="20" lean-forward="true" selection-start-line="172" selection-start-column="20" selection-end-line="172" selection-end-column="20" />
+        <state relative-caret-position="30">
+          <caret line="1" column="29" selection-start-line="1" selection-start-column="29" selection-end-line="1" selection-end-column="29" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/utils/WXHttpRequest.js">
+    <entry file="file://$PROJECT_DIR$/component/my/my.wxml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="960">
-          <caret line="32" column="32" lean-forward="true" selection-start-line="32" selection-start-column="32" selection-end-line="32" selection-end-column="32" />
+        <state relative-caret-position="480">
+          <caret line="19" column="39" selection-start-line="19" selection-start-column="39" selection-end-line="19" selection-end-column="39" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/utils/httpUtil.js">
+    <entry file="file://$PROJECT_DIR$/component/hot/hot.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="810">
-          <caret line="29" column="6" lean-forward="true" selection-start-line="29" selection-start-column="6" selection-end-line="29" selection-end-column="6" />
+        <state relative-caret-position="3630">
+          <caret line="121" column="11" selection-start-line="121" selection-start-column="11" selection-end-line="121" selection-end-column="11" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml">
+    <entry file="file://$PROJECT_DIR$/pages/main/class/class.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="234">
-          <caret line="31" column="88" lean-forward="true" selection-start-line="31" selection-start-column="88" selection-end-line="31" selection-end-column="88" />
+        <state relative-caret-position="2460">
+          <caret line="82" column="23" selection-start-line="82" selection-start-column="15" selection-end-line="82" selection-end-column="23" />
+          <folding>
+            <element signature="e#0#54#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pages/main/class/class.js">
+    <entry file="file://$PROJECT_DIR$/utils/httpUtil.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="2970">
-          <caret line="99" column="4" lean-forward="true" selection-start-line="99" selection-start-column="4" selection-end-line="99" selection-end-column="4" />
+        <state relative-caret-position="870">
+          <caret line="29" column="6" selection-start-line="29" selection-start-column="6" selection-end-line="29" selection-end-column="6" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pages/index/index.js">
+    <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.wxml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="272">
-          <caret line="89" column="35" lean-forward="true" selection-start-line="89" selection-start-column="35" selection-end-line="89" selection-end-column="35" />
-          <folding>
-            <element signature="n#!!doc" expanded="true" />
-            <element signature="e#20#81#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="180">
+          <caret line="6" column="136" lean-forward="true" selection-start-line="6" selection-start-column="136" selection-end-line="6" selection-end-column="136" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="390">
+          <caret line="49" column="24" lean-forward="true" selection-start-line="49" selection-start-column="24" selection-end-line="49" selection-end-column="24" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/component/my/my.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1170">
-          <caret line="39" column="11" lean-forward="true" selection-start-line="39" selection-start-column="11" selection-end-line="39" selection-end-column="11" />
+        <state relative-caret-position="630">
+          <caret line="43" column="40" selection-start-line="43" selection-start-column="40" selection-end-line="43" selection-end-column="40" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pages/user/myEdit/myEdit.js">
+    <entry file="file://$PROJECT_DIR$/utils/APIClient.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="270">
-          <caret line="27" column="23" lean-forward="true" selection-start-line="27" selection-start-column="23" selection-end-line="27" selection-end-column="23" />
+        <state relative-caret-position="360">
+          <caret line="225" column="38" lean-forward="true" selection-start-line="225" selection-start-column="38" selection-end-line="225" selection-end-column="38" />
         </state>
       </provider>
     </entry>

+ 21 - 14
component/my/my.js

@@ -1,10 +1,11 @@
-import APIClient from '../../utils/APIClient'
+import APIClient from '../../utils/httpUtil.js'
 export const myInit =  (that) => {
   that.setData({
     myData: {
         title: '修改资料',
         concern: '我的关注',
-        address:['北京海淀','中关村','三小'],
+        schoolCity: '青岛市',
+        schoolName: '黄岛区志贤中学',
         playNum: 31549,
         attentionCount: 10254,
         point: 6317,
@@ -32,17 +33,23 @@ export const myInit =  (that) => {
   }
 
   that.userInfo = function () {
-      // APIClient.getUserInfo()
-      const userInfo = wx.getStorageSync('user');
-      console.log(userInfo);
-      // getOpenidSessionKey((res) => {
-      //     console.log('个人',res);
-      //     that.data.myData.user = res.data.data.data;
-      //     that.setData({
-      //         myData: that.data.myData
-      //     })
-      // },(error) => {
-      //
-      // })
+      // const userInfo = wx.getStorageSync('user');
+      // console.log(userInfo.data.data.data);
+      // that.data.myData.user = userInfo.data.data.data;//直接赋值 给 myData的user对象。
+      // that.setData({
+      //     myData: that.data.myData,
+      // },()=>{
+      //     console.log('myData的user对象,赋值成功')
+      //     console.log(that.data.myData);
+      // });
+    APIClient.getOpenidSessionKey(res => {
+      console.log(res.data.data.data);
+      that.data.myData.user = res.data.data.data;//挂载user对象。
+      that.setData({
+        myData: that.data.myData
+      },() => {
+        console.log(that.data.myData)
+      });
+    });
   }()
 }

+ 0 - 9
pages/index/index.js

@@ -81,19 +81,10 @@ Page({
       hotInit(this);
     }
     if (myIndex == 2) {
-      console.log('follow')
       followInit(this);
     }
     if (myIndex == 3) {
       myInit(this);
-      getOpenidSessionKey((res) => {
-          console.log('个人',res);
-      }, (error) => {
-          // console.log(error)
-          this.setData({
-              hide: !this.data.hide
-          })
-      });
     }
   },
   onLoad: function (options) {

+ 30 - 5
pages/user/myEdit/myEdit.js

@@ -12,7 +12,32 @@ Page({
       { value: '家长', checked: false },
       { value: '老师', checked: false },
       { value: '学生', checked: true }
-    ]
+    ],
+    date: '2001年12月12日',
+    msg: '',
+    nickname: ''
+  },
+  saveNickName: function(e){
+    let nickname = e.detail.value;
+    this.setData({
+      nicename: nickname
+    }, () => {
+      console.log(nickname);
+    });
+  },
+  saveAddress: function(e){
+    let msg = e.detail.value;
+    this.setData({
+      msg: msg
+    },() => {
+      console.log(msg);
+    });
+  },
+  bindDateChange: function(e) {
+    console.log(e.detail.value)
+    this.setData({
+        date: e.detail.value
+    });
   },
   optionAction:function(e){
     console.log(e.detail.value);
@@ -21,13 +46,13 @@ Page({
     console.log(e.detail.value);
   },
   formSubmit: function(e){
-    console.log(3);
-    let  wechatName = '宋珂', birthday = '1996-07-13', gender = 3, eyeshield = 7;
-    httpRequestApi.settingUserInfo( wechatName, birthday, gender, eyeshield).success(res => {
+    let { nickname, picker, radioGroup1, radioGroup2, address } = e.detail.value;
+    let wechatName = nickname, mobile = '13994969642', gender = 3, schoolProvince = 11, schoolCity = '运城市', schoolName = '康杰中学', profession = radioGroup2, birthday = picker;
+    httpRequestApi.settingUserInfo(wechatName, mobile, gender, schoolProvince, schoolCity, schoolName, profession, birthday).success(res => {
       console.log(res.data.data);
         wx.redirectTo({
             url: '/pages/index/index?index=3'
-        })
+        });
       // wx.navigateBack({
       //
       //  });

+ 10 - 6
pages/user/myEdit/myEdit.wxml

@@ -4,7 +4,7 @@
       <view class='nickname-box'>
         <text class='setting-title'>昵称</text>
         <view class='user-action'>
-          <input class='nickname' type='text' placeholder='喔喔' placeholder-class='placeholderStyle' focus='{{ true }}'>
+          <input name='nickname' class='nickname' type='text' placeholder='喔喔' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{ nickname }}' bindblur='saveNickName'>
           </input>
         </view>
         <view class='edit-img'>
@@ -13,7 +13,7 @@
       </view>
       <view class='sex-box'>
         <view class='setting-title'>性别</view>
-        <radio-group class="radio-group" bindchange="optionAction">
+        <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
           <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
             <text class='sex-title'>{{ item.value }}</text>
             <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
@@ -21,12 +21,16 @@
         </radio-group>
       </view>
       <view class='birthday-box'>
-        <text class='setting-title'>生日</text>
-        <input type='text' placeholder='2001年12月12日'></input>        
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2018-09-01" bindchange="bindDateChange">
+            <view class="picker">
+              <text class='setting-title'>生日</text>
+              <text>{{ date }}</text>
+            </view>
+        </picker>
       </view>
       <view class='occupation-box'>
         <text class='setting-title'>职业</text>
-        <radio-group class="radio-group" bindchange="optionSetting">
+        <radio-group name='radioGroup2' class="radio-group" bindchange="optionSetting">
           <label class="radio" wx:for="{{ occupations }}" wx:key="{{ index }}">
             <text class='sex-title'>{{ item.value }}</text>
             <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
@@ -35,7 +39,7 @@
       </view>
       <view class='school-box'>
         <text class='setting-title'>学校</text>
-        <input class='address' type='text' placeholder='北京市海淀区万泉胜景远小学'></input>
+        <input name='address' class='address' type='text' placeholder='北京市海淀区万泉胜景远小学' value='{{ msg }}' bindblur='saveAddress'></input>
         <view class='edit-image'>
           <image src='../../../static/image/edit.png' class='icon'></image>
         </view>

+ 13 - 9
utils/APIClient.js

@@ -253,24 +253,28 @@ module.exports = {
 		}).url(url).data(data).method('POST').send();
 	},
   // 修改资料
-  settingUserInfo( wechatName, birthday, gender, eyeshield){
+  settingUserInfo(wechatName, mobile, gender, schoolProvince, schoolCity, schoolName, profession, birthday){
     let url = getBaseUrl(`wx/user`);
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).data({
       wechatName: wechatName,
-      birthday: birthday,
+      mobile: mobile,
       gender: gender,
-      eyeshield: eyeshield
+      schoolProvince: schoolProvince,
+      schoolCity: schoolCity,
+      schoolName: schoolName,
+      profession: profession,
+      birthday: birthday
       }).url(url).method('PUT').send();
   },
   //获取个人信息
 	getUserInfo () {
-        let url = getBaseUrl(`wx/user`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).data({
-            uid: wx.getStorageSync('uid')
-        }).url(url).send();
+    let url = getBaseUrl(`wx/user`);
+    return request.getInstance().header({
+        uid: wx.getStorageSync('uid')
+    }).data({
+        uid: wx.getStorageSync('uid')
+    }).url(url).send();
 	}
 }