{"id":31507,"date":"2024-11-25T12:51:33","date_gmt":"2024-11-25T04:51:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31507\/"},"modified":"2024-11-25T12:51:33","modified_gmt":"2024-11-25T04:51:33","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%86%85%e5%bc%80%e5%8f%91%e9%aa%8c%e8%af%81%e7%a0%81%e5%af%86%e7%a0%81%e8%be%93%e5%85%a5%e6%a1%86%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31507\/","title":{"rendered":"\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd"},"content":{"rendered":"<p style=\"text-align: left\">\u8fd9\u6b21\u7ed9\u5927\u5bb6\u5e26\u6765\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\uff0c\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u7684\u6709\u54ea\u4e9b\uff0c\u4e0b\u9762\u5c31\u662f\u5b9e\u6218\u6848\u4f8b\uff0c\u4e00\u8d77\u6765\u770b\u4e00\u4e0b\u3002<\/p>\n<p style=\"text-align: left\">\u5728\u505a\u5c0f\u7a0b\u5e8f\u8fc7\u7a0b\u4e2d\u505a\u4e00\u4e2a6\u4f4d\u9a8c\u8bc1\u7801\u8f93\u5165\u6846\uff0c\u672c\u4ee5\u4e3a\u5f88\u7b80\u5355\uff0c\u4f46\u662f\u5728\u5199\u7684\u65f6\u5019\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u963b\u529b\uff0c\u5728\u7f51\u4e0a\u67e5\u9605\u8d44\u6599\u4e5f\u5be5\u5be5\u65e0\u51e0\uff0c\u540e\u6765\u7ecf\u8fc7\u4e00\u756a\u601d\u8003\uff0c\u7ec8\u4e8e\u6572\u5b9a\u4e0b\u6765\u672c\u4eba\u6700\u6ee1\u610f\u7684\u65b9\u6848\uff0c\u7279\u610f\u53d1\u51fa\u6765\u8ba9\u5927\u5bb6\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u5927\u5bb6\uff01<\/p>\n<p style=\"text-align: left\"><span style=\"color: #ff0000\"><strong>\u4e00\u3001\u6548\u679c\u56fe\u5982\u4e0b\uff1a<\/strong><\/span><\/p>\n<p style=\"text-align: left\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/061\/021\/1bb2c7418b61b0fe85a8d5789f3d6c6b-0.gif\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u63d2\u56fe\" alt=\"\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u63d2\u56fe\" \/><\/p>\n<p style=\"text-align: left\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/061\/021\/1bb2c7418b61b0fe85a8d5789f3d6c6b-1.gif\" class=\"aligncenter\" title=\"\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u63d2\u56fe1\" alt=\"\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u63d2\u56fe1\" \/><\/p>\n<p style=\"text-align: left\"><span style=\"color: #ff0000\"><strong>\u4e8c\u3001\u4ee3\u7801\u90e8\u5206<\/strong><\/span><\/p>\n<p style=\"text-align: left\">wxml\uff1a<\/p>\n<pre>&lt;form bindsubmit=\"formSubmit\"&gt; \r\n &lt;view class='content'&gt; \r\n  &lt;block wx:for=\"{{Length}}\" wx:key=\"item\"&gt; \r\n   &lt;input class='iptbox' value=\"{{Value.length&gt;=index+1?Value[index]:''}}\" disabled password='{{ispassword}}' catchtap='Tap'&gt;&lt;\/input&gt; \r\n  &lt;\/block&gt; \r\n &lt;\/view&gt; \r\n &lt;input name=\"password\" password=\"{{true}}\" class='ipt' maxlength=\"{{Length}}\" focus=\"{{isFocus}}\" bindinput=\"Focus\"&gt;&lt;\/input&gt; \r\n &lt;view&gt; \r\n  &lt;button class=\"btn-area\" formType=\"submit\"&gt;Submit&lt;\/button&gt; \r\n &lt;\/view&gt; \r\n&lt;\/form&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"text-align: left\">js:<\/p>\n<pre>Page({ \r\n \/** \r\n  * \u9875\u9762\u7684\u521d\u59cb\u6570\u636e \r\n  *\/ \r\n data: { \r\n  Length:6,    \/\/\u8f93\u5165\u6846\u4e2a\u6570 \r\n  isFocus:true,  \/\/\u805a\u7126 \r\n  Value:\"\",    \/\/\u8f93\u5165\u7684\u5185\u5bb9 \r\n  ispassword:true, \/\/\u662f\u5426\u5bc6\u6587\u663e\u793a true\u4e3a\u5bc6\u6587\uff0c false\u4e3a\u660e\u6587\u3002 \r\n }, \r\n Focus(e){ \r\n  var that = this; \r\n  console.log(e.detail.value); \r\n  var inputValue = e.detail.value; \r\n  that.setData({ \r\n   Value:inputValue, \r\n  }) \r\n }, \r\n Tap(){ \r\n  var that = this; \r\n  that.setData({ \r\n   isFocus:true, \r\n  }) \r\n }, \r\n formSubmit(e){ \r\n  console.log(e.detail.value.password); \r\n }, \r\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"text-align: left\">wxss:<\/p>\n<pre>content{ \r\n display: flex; \r\n justify-content: space-around; \r\n align-items: center; \r\n margin-top: 200rpx; \r\n} \r\niptbox{ \r\n width: 80rpx; \r\n height: 80rpx; \r\n border:1rpx solid #ddd; \r\n border-radius: 20rpx; \r\n display: flex; \r\n justify-content: center; \r\n align-items: center; \r\n text-align: center; \r\n} \r\nipt{ \r\n width: 0; \r\n height: 0; \r\n} \r\nbtn-area{ \r\n width: 80%; \r\n background-color: orange; \r\n color:white; \r\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p style=\"text-align: left\"><span style=\"color: #ff0000\"><strong>\u4e09\u3001\u601d\u8def\uff1a<\/strong><\/span><\/p>\n<p style=\"text-align: left\">1\u3001\u653e\u7f6e\u4e00\u4e2a\u8f93\u5165\u6846\uff0c\u9690\u85cf\u5176\u6587\u5b57\u548c\u4f4d\u7f6e\uff0c\u540c\u65f6\u8bbe\u7f6e\u652f\u4ed8\u8f93\u5165\u6846\uff08\u8868\u683c\uff09\u6837\u5f0f<br \/>2\u3001\u5f53\u70b9\u51fb\u8f93\u5165\u6846\u65f6\u8bbe\u7f6e\u8f93\u5165\u6846\u4e3a\u805a\u7126\u72b6\u6001\uff0c\u5524\u8d77\u952e\u76d8\uff0c\u70b9\u51fb\u7a7a\u767d\u5904\uff0c\u5931\u53bb\u7126\u70b9\uff0c\u8bbe\u4e3a\u5931\u53bb\u7126\u70b9\u6837\u5f0f\uff0c\u56e0\u4e3a\u8f93\u5165\u6846\u5bbd\u9ad8\u4e3a0\uff0c\u6240\u4ee5\u4e0d\u4f1a\u663e\u793a\u8f93\u5165\u6846\u548c\u5149\u6807\uff0c\u5b9e\u73b0\u9690\u85cf\u3002<br \/>3\u3001\u9650\u5236\u8f93\u5165\u6846\u6700\u5927\u5b57\u6570\u5e76\u4e14\u76d1\u542c\u8f93\u5165\u6846\u72b6\u6001\uff0c\u4ee5\u8f93\u5165\u6846\u503c\u7684\u957f\u5ea6\u4f5c\u4e3a\u8f93\u5165\u6846\uff08\u8868\u683c\uff09\u5185\u5bb9\u7684\u6e32\u67d3\u6761\u4ef6<br \/>4\u3001\u70b9\u51fb\u63d0\u4ea4\u6309\u94ae\u65f6\uff0c\u83b7\u53d6\u8f93\u5165\u6846\u5185\u5bb9\u3002<\/p>\n<p>\u76f8\u4fe1\u770b\u4e86\u672c\u6587\u6848\u4f8b\u4f60\u5df2\u7ecf\u638c\u63e1\u4e86\u65b9\u6cd5\uff0c\u66f4\u591a\u7cbe\u5f69\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n<p>\u63a8\u8350\u9605\u8bfb\uff1a<\/p>\n<p><\/p>\n<p><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\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>\u8fd9\u6b21\u7ed9\u5927\u5bb6\u5e26\u6765\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\uff0c\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5185\u5f00\u53d1\u9a8c\u8bc1\u7801\u5bc6\u7801\u8f93\u5165\u6846\u529f\u80fd\u7684\u6709\u54ea\u4e9b\uff0c\u4e0b\u9762\u5c31\u662f\u5b9e\u6218\u6848\u4f8b\uff0c\u4e00\u8d77\u6765\u770b\u4e00\u4e0b\u3002 \u5728\u505a\u5c0f\u7a0b\u5e8f\u8fc7\u7a0b\u4e2d\u505a\u4e00\u4e2a6\u4f4d\u9a8c\u8bc1\u7801\u8f93\u5165\u6846\uff0c\u672c\u4ee5\u4e3a\u5f88\u7b80\u5355\uff0c\u4f46\u662f\u5728\u5199\u7684\u65f6\u5019\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u963b\u529b\uff0c\u5728\u7f51\u4e0a\u67e5\u9605\u8d44\u6599\u4e5f\u5be5\u5be5\u65e0\u51e0\uff0c\u540e\u6765\u7ecf\u8fc7\u4e00\u756a\u601d\u8003\uff0c\u7ec8\u4e8e\u6572\u5b9a\u4e0b\u6765\u672c\u4eba\u6700\u6ee1\u610f\u7684\u65b9\u6848\uff0c\u7279\u610f\u53d1\u51fa\u6765\u8ba9\u5927\u5bb6\u53c2\u8003\u4e00\u4e0b\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u5927\u5bb6\uff01 \u4e00\u3001\u6548\u679c\u56fe\u5982\u4e0b\uff1a \u4e8c\u3001\u4ee3\u7801\u90e8\u5206 wxml\uff1a &lt;form bindsubmit=&#8221;formSubmit&#8221;&gt; &lt;view class=&#8217;content&#8217;&gt; &lt;block wx:for=&#8221;{{Length}}&#8221; wx:key=&#8221;item&#8221;&gt; &lt;input class=&#8217;iptbox&#8217; value=&#8221;{{Value.length&gt;=index+1?Value[index]:&#8221;}}&#8221; disabled password='{{ispassword}}&#8217; catchtap=&#8217;Tap&#8217;&gt;&lt;\/input&gt; &lt;\/block&gt; &lt;\/view&gt; &lt;input name=&#8221;password&#8221; password=&#8221;{{true}}&#8221; class=&#8217;ipt&#8217; maxlength=&#8221;{{Length}}&#8221; focus=&#8221;{{isFocus}}&#8221; bindinput=&#8221;Focus&#8221;&gt;&lt;\/input&gt; &lt;view&gt; &lt;button class=&#8221;btn-area&#8221; formType=&#8221;submit&#8221;&gt;Submit&lt;\/button&gt; &lt;\/view&gt; &lt;\/form&gt; \u767b\u5f55\u540e\u590d\u5236 js: Page({ \/** * \u9875\u9762\u7684\u521d\u59cb\u6570\u636e *\/ data: { Length:6, \/\/\u8f93\u5165\u6846\u4e2a\u6570 isFocus:true, \/\/\u805a\u7126 Value:&#8221;&#8221;, \/\/\u8f93\u5165\u7684\u5185\u5bb9 ispassword:true, \/\/\u662f\u5426\u5bc6\u6587\u663e\u793a true\u4e3a\u5bc6\u6587\uff0c false\u4e3a\u660e\u6587\u3002 }, Focus(e){ var [&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-31507","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31507","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=31507"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31507\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}