{"id":28541,"date":"2024-11-25T08:54:22","date_gmt":"2024-11-25T00:54:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28541\/"},"modified":"2024-11-25T08:54:22","modified_gmt":"2024-11-25T00:54:22","slug":"%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%b8%ad%e5%8a%a8%e6%80%81%e8%8e%b7%e5%8f%96%e5%88%97%e8%a1%a8%e5%af%b9%e8%b1%a1%e4%bf%a1%e6%81%af%e7%9a%84%e4%bb%a3%e7%a0%81%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28541\/","title":{"rendered":"\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b"},"content":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5e26\u6765\u7684\u5185\u5bb9\u662f\u5173\u4e8e\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u6709\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<p><strong>\u5148\u4e0a\u6548\u679c\u56fe\u5c55\u793a<\/strong>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/009\/8f799fc6ccbbeb1b529d625cd6bb7d83-0.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\u63d2\u56fe\" alt=\"\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\u63d2\u56fe\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/009\/b88dd5eeb01d99f98d372898338207c7-1.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\u63d2\u56fe1\" alt=\"\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\u63d2\u56fe1\" \/><\/p>\n<p><strong>\u672c\u5185\u5bb9\u4e3b\u8981\u4ecb\u7ecd\u5982\u4f55\u5728\u5217\u8868\u4e2d\u53bb\u52a8\u6001\u83b7\u53d6\u5bf9\u8c61\u8be6\u60c5\uff1a<\/strong><br \/>1.\u5148\u5c55\u793a\u5217\u8868\u5185\u5bb9\uff1a<br \/>\u5217\u8868\u5185\u5bb9\u4ecd\u7136\u662f\u901a\u8fc7\u6570\u636e\u7ed1\u5b9a\u548c\u804a\u8868\u6e32\u67d3\u6765\u5b9e\u73b0\uff0cwx:for\u7684\u4e00\u7cfb\u5217\u53c2\u6570\u8bbe\u7f6e\u3002<\/p>\n<pre>&lt;block wx:for=\"{{personList}}\" wx:key=\"\" wx:for-item=\"item\"&gt;\n  &lt;view class=\"nav_right_items\" bindtap='goDetail' data-index=\"{{index}}\" data-id=\"{{item.pf_id}}\"&gt;\n    &lt;!--\u754c\u9762\u8df3\u8f6c --&gt;\n    &lt;image src=\"{{personImg}}\"&gt;&lt;\/image&gt;\n    &lt;text&gt;{{item.pf_name}}&lt;\/text&gt;\n    &lt;!-- &lt;text&gt;{{item.pf_id}}&lt;\/text&gt; --&gt;\n  &lt;\/view&gt;\n&lt;\/block&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8df3\u8f6c\u51fd\u6570\u65b9\u6cd5<em>goDetail<\/em>\uff0c\u8df3\u8f6c\u8fc7\u53bb\u7684\u5bf9\u8c61ID\u5c31\u662f<em>item.pf_id<\/em>\uff0c\u70b9\u51fb\u5bf9\u8c61\u5c31\u662f<em>index<\/em>\u3002<br \/>\u5f53\u7136\u8fd9\u4e2a\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3anavigator\u8df3\u8f6c\uff0c\u533a\u522b\u662fnavigator\u662f\u5728\u94fe\u63a5\u5185\u52a0\u4e0a\u53c2\u6570\u7ec4\u5408\u4f20\u9012\u7ed9\u9875\u9762\uff0c\u8fd9\u6837\u9002\u7528\u4e8e\u5199\u6b7b\u7684\u5185\u5bb9\u3002<br \/>2.\u9274\u4e8e\u662f\u52a8\u6001\u83b7\u53d6\uff0c\u81ea\u7136\u8981\u8bf7\u6c42\u540e\u53f0\u6570\u636e\uff1a<\/p>\n<pre>goDetail: function(ev) {\n   var that = this;\n   var e = ev.currentTarget.dataset.id;\n   console.log(\"++++++\",ev,that)\n   wx.setStorageSync(\"people_id\", e), wx.navigateTo({\n     url: \"..\/detail\/detail\"\n   })\n },<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8fd9\u91cc\u8fb9\u5c06\u5217\u8868\u5bf9\u8c61<strong>id<\/strong>\u5b58\u50a8\u4e3a\u7f13\u5b58\u6570\u636e\uff0c\u53d1\u9001\u7ed9\u4e0b\u4e00\u4e2a\u9875\u9762\u6765\u83b7\u53d6\u3002\u4e00\u5b9a\u8981\u901a\u8fc7\u6253\u5370 console.log(&#8220;++++++&#8221;,ev,that)\u3002\u6765\u6d4b\u8bd5\u6570\u636e\u662f\u5426\u83b7\u53d6\u5230\u662f\u5426\u5b58\u50a8\u5230\u3002<br \/>\u5728\u5bf9\u8c61\u8be6\u60c5\u9875\u53ef\u4ee5\u8fd9\u6837\u5c55\u793a\uff1a<\/p>\n<pre>require(\"..\/..\/utils\/util.js\"), getApp();\nPage({\ndata: {\n  name: \"\",\n  sex: \"\",\n  birthday: \"\",\n  post: \"\",\n  address: \"\",\n  addtime: \"\",\n  phone: \"\",\n  identityCard: \"\",\n  schools: \"\",\n  pspecialty: \"\",\n  diploma: \"\",\n  workingState: \"\",\n  entrytime: \"\",\n  worktime: \"\"\n},\nonLoad: function(e) {\n  var t = this,\n    a = wx.getStorageSync(\"session_uid\"),\n    i = wx.getStorageSync(\"people_id\");\n  console.log(\"--------\",i,e,a)\n  wx.request({\n    url: \"https:\/\/xxxxxxxxxxxxx.com\/wx\/userinfo\/\",\n    data: {\n      pf_id: i,\n      Cookie: a\n    },\n    method: \"POST\",\n    header: {\n      \"Content-Type\": \"application\/x-www-form-urlencoded\"\n    },\n    success: function(e) {\n      console.log(\"\u5458\u5de5\u6570\u636e\", e.data.data);\n      var a = e.data.data;\n      t.setData({\n        name: a.pf_name,\n        sex: a.pf_sex,\n        birthday: a.pf_birthday,\n        post: a.m_id_post,\n        address: a.pf_address,\n        addtime: a.pf_addtime,\n        phone: a.pf_phone,\n        identityCard: a.pf_identityCard,\n        schools: a.pf_schools,\n        diploma: a.m_id_diploma,\n        pspecialty: a.pf_specialty,\n        workingState: a.pf_workingState.state_name,\n        entrytime: a.pf_entrytime,\n        worktime: a.worktime\n      })\n    },\n    fail: function(e) {}\n  })\n},\nonReady: function() {},\nonShareAppMessage: function() {}\n});<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u901a\u8fc7\u70b9\u51fb\u65f6\u4f20\u9012\u7684\u53c2\u6570ID\u6765\u53d1\u9001\u8bf7\u6c42\u4fe1\u606f\uff0c\u5230\u670d\u52a1\u5668\u83b7\u53d6\u5230\u5bf9\u8c61\u7684\u6240\u6709\u4fe1\u606f\u540e\u5b58\u50a8\u4e0b\u6765\u62ff\u5230\u524d\u7aef\u9875\u9762\uff0c\u5c55\u793a\u5bf9\u5e94\u7684\u3002\u6839\u636e\u540e\u53f0\u4eba\u5458\u8bbe\u7f6e\u7684\u5b57\u6bb5\u6765\u4f20\u9012\u5bf9\u5e94\u5b57\u6bb5\u53c2\u6570\u3002<br \/>\u6700\u7ec8\u5c31\u80fd\u62ff\u5230\u5bf9\u8c61\u7684\u52a8\u6001\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5e26\u6765\u7684\u5185\u5bb9\u662f\u5173\u4e8e\u5c0f\u7a0b\u5e8f\u4e2d\u52a8\u6001\u83b7\u53d6\u5217\u8868\u5bf9\u8c61\u4fe1\u606f\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u4ef7\u503c\uff0c\u6709\u9700\u8981\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002 \u5148\u4e0a\u6548\u679c\u56fe\u5c55\u793a\uff1a \u672c\u5185\u5bb9\u4e3b\u8981\u4ecb\u7ecd\u5982\u4f55\u5728\u5217\u8868\u4e2d\u53bb\u52a8\u6001\u83b7\u53d6\u5bf9\u8c61\u8be6\u60c5\uff1a1.\u5148\u5c55\u793a\u5217\u8868\u5185\u5bb9\uff1a\u5217\u8868\u5185\u5bb9\u4ecd\u7136\u662f\u901a\u8fc7\u6570\u636e\u7ed1\u5b9a\u548c\u804a\u8868\u6e32\u67d3\u6765\u5b9e\u73b0\uff0cwx:for\u7684\u4e00\u7cfb\u5217\u53c2\u6570\u8bbe\u7f6e\u3002 &lt;block wx:for=&#8221;{{personList}}&#8221; wx:key=&#8221;&#8221; wx:for-item=&#8221;item&#8221;&gt; &lt;view class=&#8221;nav_right_items&#8221; bindtap=&#8217;goDetail&#8217; data-index=&#8221;{{index}}&#8221; data-id=&#8221;{{item.pf_id}}&#8221;&gt; &lt;!&#8211;\u754c\u9762\u8df3\u8f6c &#8211;&gt; &lt;image src=&#8221;{{personImg}}&#8221;&gt;&lt;\/image&gt; &lt;text&gt;{{item.pf_name}}&lt;\/text&gt; &lt;!&#8211; &lt;text&gt;{{item.pf_id}}&lt;\/text&gt; &#8211;&gt; &lt;\/view&gt; &lt;\/block&gt; \u767b\u5f55\u540e\u590d\u5236 \u8df3\u8f6c\u51fd\u6570\u65b9\u6cd5goDetail\uff0c\u8df3\u8f6c\u8fc7\u53bb\u7684\u5bf9\u8c61ID\u5c31\u662fitem.pf_id\uff0c\u70b9\u51fb\u5bf9\u8c61\u5c31\u662findex\u3002\u5f53\u7136\u8fd9\u4e2a\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3anavigator\u8df3\u8f6c\uff0c\u533a\u522b\u662fnavigator\u662f\u5728\u94fe\u63a5\u5185\u52a0\u4e0a\u53c2\u6570\u7ec4\u5408\u4f20\u9012\u7ed9\u9875\u9762\uff0c\u8fd9\u6837\u9002\u7528\u4e8e\u5199\u6b7b\u7684\u5185\u5bb9\u30022.\u9274\u4e8e\u662f\u52a8\u6001\u83b7\u53d6\uff0c\u81ea\u7136\u8981\u8bf7\u6c42\u540e\u53f0\u6570\u636e\uff1a goDetail: function(ev) { var that = this; var e = ev.currentTarget.dataset.id; console.log(&#8220;++++++&#8221;,ev,that) wx.setStorageSync(&#8220;people_id&#8221;, e), wx.navigateTo({ url: &#8220;..\/detail\/detail&#8221; }) }, \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u8fb9\u5c06\u5217\u8868\u5bf9\u8c61id\u5b58\u50a8\u4e3a\u7f13\u5b58\u6570\u636e\uff0c\u53d1\u9001\u7ed9\u4e0b\u4e00\u4e2a\u9875\u9762\u6765\u83b7\u53d6\u3002\u4e00\u5b9a\u8981\u901a\u8fc7\u6253\u5370 console.log(&#8220;++++++&#8221;,ev,that)\u3002\u6765\u6d4b\u8bd5\u6570\u636e\u662f\u5426\u83b7\u53d6\u5230\u662f\u5426\u5b58\u50a8\u5230\u3002\u5728\u5bf9\u8c61\u8be6\u60c5\u9875\u53ef\u4ee5\u8fd9\u6837\u5c55\u793a\uff1a require(&#8220;..\/..\/utils\/util.js&#8221;), getApp(); Page({ data: { name: &#8220;&#8221;, sex: &#8220;&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-28541","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28541"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28541\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}