{"id":28595,"date":"2024-11-25T08:00:39","date_gmt":"2024-11-25T00:00:39","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28595\/"},"modified":"2024-11-25T08:00:39","modified_gmt":"2024-11-25T00:00:39","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e4%b8%8b%e6%8b%89%e6%a1%86%e6%95%88%e6%9e%9c%ef%bc%9f%ef%bc%88%e4%bb%a3%e7%a0%81%e7%a4%ba%e4%be%8b%ef%bc%89","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28595\/","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09"},"content":{"rendered":"<p>\u672c\u7bc7\u6587\u7ae0\u7ed9\u5927\u5bb6\u5e26\u6765\u7684\u5185\u5bb9\u662f\u4ecb\u7ecd\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09\u3002\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\u4eec\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7ec4\u4ef6\u91cc\u6ca1\u6709\u4e0b\u62c9\u6846\uff0c\u6b63\u597d\u8981\u7528\u5230\uff0c\u8bb0\u4e0b\u6765\u4ee5\u540e\u53c2\u8003<\/p>\n<p>wxml\u4ee3\u7801\uff1a<\/p>\n<p><\/p>\n<pre>&lt;view class='top'&gt;\n    &lt;view class='top-text'&gt; \u9009\u62e9\u63a5\u6536\u73ed\u7ea7&lt;\/view&gt;\n    &lt;!-- \u4e0b\u62c9\u6846 --&gt;\n    &lt;view class='top-selected' bindtap='bindShowMsg'&gt;\n      &lt;text&gt;{{grade_name}}&lt;\/text&gt;\n      &lt;image src='\/images\/icon\/down.png'&gt;&lt;\/image&gt;\n    &lt;\/view&gt;\n    &lt;!-- \u4e0b\u62c9\u9700\u8981\u663e\u793a\u7684\u5217\u8868 --&gt;\n    &lt;view class=\"select_box\" wx:if=\"{{select}}\"&gt;\n      &lt;view wx:for=\"{{grades}}\" wx:key=\"unique\"&gt;\n        &lt;view class=\"select_one\" bindtap=\"mySelect\" data-name=\"{{item}}\"&gt;{{item}}&lt;\/view&gt;\n      &lt;\/view&gt;\n    &lt;\/view&gt;\n  &lt;\/view&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>wxss\u4ee3\u7801\uff1a<\/p>\n<p><\/p>\n<pre>\/* \u9876\u90e8 *\/.top{\n  width: 100vw;\n  height: 80rpx;\n  padding: 0 20rpx;\n  line-height: 80rpx;\n  font-size: 34rpx;\n  border-bottom: 1px solid #000;\n}.top-text{\n  float: left}\/* \u4e0b\u62c9\u6846 *\/.top-selected{\n    width: 50%;\n    display: flex;\n    float: right;\n    align-items: center;\n    justify-content: space-between;\n    border: 1px solid #ccc;\n    padding: 0 10rpx;\n    font-size: 30rpx;\n}\/* \u4e0b\u62c9\u5185\u5bb9 *\/.select_box {\n    background-color: #fff;\n    padding: 0 20rpx;\n    width: 50%;\n    float: right;\n    position: relative;\n    right: 0;\n    z-index: 1;\n    overflow: hidden;\n    text-align: left;\n    animation: myfirst 0.5s;\n    font-size: 30rpx;\n}.select_one {\n    padding-left: 20rpx;\n    width: 100%;\n    height: 60rpx;\n    position: relative;\n    line-height: 60rpx;\n    border-bottom: 1px solid #ccc;\n}\/* \u4e0b\u62c9\u8fc7\u5ea6\u6548\u679c *\/@keyframes myfirst {\n    from {\n        height: 0rpx;\n    }\n \n    to {\n        height: 210rpx;\n    }}\/* \u4e0b\u62c9\u56fe\u6807 *\/.top-selected image{\n  height:50rpx;\n  width:50rpx;\n  position: absolute;\n  right: 0rpx;\n  top: 20rpx;\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>js\u4ee3\u7801\uff1a<\/p>\n<p><\/p>\n<pre> \/**\n   * \u9875\u9762\u7684\u521d\u59cb\u6570\u636e   *\/\n  data: {\n    select:false,\n    grade_name:'--\u8bf7\u9009\u62e9--',\n    grades: [        '\u731b\u72b8\u673a\u5668\u4eba1\u73ed',        '\u731b\u72b8\u673a\u5668\u4eba2\u73ed',        '\u53e3\u624d1\u73ed',\n      ]\n  },\/**\n *  \u70b9\u51fb\u4e0b\u62c9\u6846 *\/\n  bindShowMsg() {    this.setData({\n      select: !this.data.select\n    })\n  },\/**\n * \u5df2\u9009\u4e0b\u62c9\u6846 *\/\n  mySelect(e) {\n    console.log(e)    var name = e.currentTarget.dataset.name    this.setData({\n      grade_name: name,\n      select: false\n    })\n  },<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6548\u679c\u5c55\u793a\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/\/upload\/image\/128\/511\/700\/1542093030133932.jpg\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09\u63d2\u56fe\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09\u63d2\u56fe\" \/><\/p>\n<p>\u603b\u7ed3\uff1a\u4ee5\u4e0a\u5c31\u662f\u672c\u7bc7\u6587\u7ae0\u7684\u5168\u90e8\u5185\u5bb9\uff0c\u5e0c\u671b\u80fd\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09\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\u4ecb\u7ecd\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5982\u4f55\u5b9e\u73b0\u4e0b\u62c9\u6846\u6548\u679c\uff1f\uff08\u4ee3\u7801\u793a\u4f8b\uff09\u3002\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\u4eec\u6709\u6240\u5e2e\u52a9\u3002 \u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7ec4\u4ef6\u91cc\u6ca1\u6709\u4e0b\u62c9\u6846\uff0c\u6b63\u597d\u8981\u7528\u5230\uff0c\u8bb0\u4e0b\u6765\u4ee5\u540e\u53c2\u8003 wxml\u4ee3\u7801\uff1a &lt;view class=&#8217;top&#8217;&gt; &lt;view class=&#8217;top-text&#8217;&gt; \u9009\u62e9\u63a5\u6536\u73ed\u7ea7&lt;\/view&gt; &lt;!&#8211; \u4e0b\u62c9\u6846 &#8211;&gt; &lt;view class=&#8217;top-selected&#8217; bindtap=&#8217;bindShowMsg&#8217;&gt; &lt;text&gt;{{grade_name}}&lt;\/text&gt; &lt;image src=&#8217;\/images\/icon\/down.png&#8217;&gt;&lt;\/image&gt; &lt;\/view&gt; &lt;!&#8211; \u4e0b\u62c9\u9700\u8981\u663e\u793a\u7684\u5217\u8868 &#8211;&gt; &lt;view class=&#8221;select_box&#8221; wx:if=&#8221;{{select}}&#8221;&gt; &lt;view wx:for=&#8221;{{grades}}&#8221; wx:key=&#8221;unique&#8221;&gt; &lt;view class=&#8221;select_one&#8221; bindtap=&#8221;mySelect&#8221; data-name=&#8221;{{item}}&#8221;&gt;{{item}}&lt;\/view&gt; &lt;\/view&gt; &lt;\/view&gt; &lt;\/view&gt; \u767b\u5f55\u540e\u590d\u5236 wxss\u4ee3\u7801\uff1a \/* \u9876\u90e8 *\/.top{ width: 100vw; height: 80rpx; padding: 0 20rpx; line-height: 80rpx; font-size: 34rpx; border-bottom: 1px solid #000; }.top-text{ [&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-28595","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28595","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=28595"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28595\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}