{"id":1988,"date":"2023-10-31T18:25:41","date_gmt":"2023-10-31T10:25:41","guid":{"rendered":"https:\/\/qishiya.com\/?p=1988"},"modified":"2023-10-31T18:27:01","modified_gmt":"2023-10-31T10:27:01","slug":"%e7%94%a8-chatgpt-%e7%94%9f%e6%88%90%e5%b0%ba%e7%a0%81%e5%93%a5%e7%9a%84%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/qishiya.com\/?p=1988","title":{"rendered":"\u7528 ChatGPT \u751f\u6210\u5c3a\u7801\u54e5\u7684\u4ee3\u7801"},"content":{"rendered":"\n<p>\u5c3a\u7801\u54e5\u6700\u8fd1\u66f4\u65b0\u4e86\u4e00\u4e0b\u524d\u7aef\u4ee3\u7801\uff0c\u5c31\u662f\u5728\u81ea\u52a8\u586b\u5145\u652f\u6301\u5c0f\u6570\u586b\u5145\u548c\u978b\u7801\u586b\u5145\uff0c\u8fd9\u4e2a\u529f\u80fd\u70b9\u5176\u5b9e\u5f88\u5c0f\uff0c\u6211\u5c31\u8ba9 ChatGPT \u6765\u5e2e\u6211\u5b8c\u6210\uff0c\u6211\u540c\u65f6\u4e5f\u6d4b\u8bd5\u4e86 Claude.ai ,\u4ed6\u4eec\u4e24\u4e2a\u90fd\u80fd\u51fa\u8272\u7684\u5b8c\u6210\u8fd9\u4e2a\u5c0f\u529f\u80fd\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_61 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ff6200;color:#ff6200\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ff6200;color:#ff6200\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/qishiya.com\/?p=1988\/#%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E6%94%AF%E6%8C%81%E9%9E%8B%E7%A0%81%E5%A1%AB%E5%85%85\" title=\"\u4e3a\u4ec0\u4e48\u8981\u652f\u6301\u978b\u7801\u586b\u5145\">\u4e3a\u4ec0\u4e48\u8981\u652f\u6301\u978b\u7801\u586b\u5145<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/qishiya.com\/?p=1988\/#%E7%94%A8_ChatGPT_%E4%BF%AE%E6%94%B9%E4%BB%A3%E7%A0%81\" title=\"\u7528 ChatGPT \u4fee\u6539\u4ee3\u7801\">\u7528 ChatGPT \u4fee\u6539\u4ee3\u7801<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/qishiya.com\/?p=1988\/#%E6%94%AF%E6%8C%81%E5%B0%8F%E6%95%B0%E5%A1%AB%E5%85%85\" title=\"\u652f\u6301\u5c0f\u6570\u586b\u5145\">\u652f\u6301\u5c0f\u6570\u586b\u5145<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E6%94%AF%E6%8C%81%E9%9E%8B%E7%A0%81%E5%A1%AB%E5%85%85\"><\/span>\u4e3a\u4ec0\u4e48\u8981\u652f\u6301\u978b\u7801\u586b\u5145<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5c3a\u7801\u54e5\u6700\u8fd1\u652f\u6301\u978b\u7801\u751f\u6210\u4e86\uff0c\u978b\u7801\u5f88\u5c0f\u6709\u4eba\u53eb\u4ed6 S\uff0cL\uff0cM \u4e4b\u7c7b\u7684\uff0c\u4e00\u822c\u90fd\u4f1a\u53eb 36\uff0c37\uff0c42 \u4e4b\u7c7b\u7684\u7801\uff0c\u5c3a\u7801\u54e5\u6709\u4e00\u4e2a\u975e\u5e38\u9ad8\u6548\u7684\u5730\u65b9\uff0c\u5c31\u662f\u81ea\u52a8\u586b\u5145\uff0c\u6bd4\u5982\u4f60\u6709 S\uff0cM\uff0cL\uff0cXL \u4e4b\u7c7b\u7684\u5c3a\u7801\uff0c\u4f60\u53ea\u8981\u5728\u7b2c\u4e00\u4e2a\u5355\u5143\u8f93\u5165 =S+4\uff0c\u540e\u9762\u5c31\u4f1a\u81ea\u52a8\u8f93\u5165 M\uff0cL\uff0cXL \u4e4b\u7c7b\u7684\uff0c\u5f88\u591a\u7528\u6237\u53cd\u9988\u8fd9\u4e00\u70b9\u5f88\u597d\u7528\uff0c\u4f46\u662f\u5f53\u65f6\u4ee3\u7801\u5199\u6b7b\u4e86\uff0c\u4e0d\u652f\u6301\u978b\u5b50\u4e4b\u7c7b\u7684\u7eaf\u6570\u5b57\u586b\u5145\uff0c\u4ee5\u6240\u978b\u7801\u5356\u5bb6\u5c31\u8981\u4e00\u4e2a\u4e00\u4e2a\u8f93\u5165\uff0c\u975e\u5e38\u96be\u53d7\uff0c\u4ed6\u4eec\u7ed9\u6211\u53cd\u9988\u4e86\u51e0\u6b21\u540e\uff0c\u6211\u51b3\u5b9a\u5347\u7ea7\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u4ee3\u7801\u5199\u6b7b\u4e86\uff0c\u53ea\u652f\u6301 S\uff0cM \u4e4b\u7c7b\u7684\u7801\u586b\u5145\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  const input = dInput.trim().toUpperCase();\n\t\t\t    const match = input.match(\/^=(\\w)(&#91;+-]\\d+)$\/);\n\t\t\t    if (!match) {\n\t\t\t\t    return;\n\t\t\t    }\n\t\t\t    const baseSize = match&#91;1];\n\t\t\t    let offset = parseInt(match&#91;2]);\n\t\t\t    const sizes = &#91;\"S\", \"M\", \"L\", \"XL\", \"XXL\", \"3XXL\", \"4XXL\", \"5XXL\"];\n\t\t\t    const baseIndex = sizes.indexOf(baseSize);\n\t\t\t    if (baseIndex === -1) {\n\t\t\t\t    return;\n\t\t\t    }\n\n\t\t\t    const targetSizes = &#91;];\n\t\t\t    let index = baseIndex;\n\t\t\t    while (offset > 0 &amp;&amp; index &lt; sizes.length - 1) {\n\t\t\t\t    index++;\n\t\t\t\t    offset--;\n\t\t\t    }\n\t\t\t    while (offset &lt; 0 &amp;&amp; index > 0) {\n\t\t\t\t    index--;\n\t\t\t\t    offset++;\n\t\t\t    }\n\t\t\t    for (let i = baseIndex; i &lt; index; i++) {\n\t\t\t\t    targetSizes.push(sizes&#91;i]);\n\t\t\t    }\n\t\t\t    $(\"input&#91;name='Size&#91;]']\").each(function (index, value) {\n\t\t\t\t    $(this).val(targetSizes&#91;index])\n\t\t\t    })<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%94%A8_ChatGPT_%E4%BF%AE%E6%94%B9%E4%BB%A3%E7%A0%81\"><\/span>\u7528 ChatGPT \u4fee\u6539\u4ee3\u7801<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>ChatGPT \u7ed9\u51fa\u4e86\u975e\u5e38\u8be6\u7ec6\u7684\u4fee\u6539\u5efa\u8bae\uff0c\u4ed6\u7684\u5efa\u8bae\u5982\u4e0b\uff0c\u5c31\u662f\u52a0\u4e86\u4e00\u4e2a\u6761\u4ef6\u5224\u65ad\uff0c\u628a\u6570\u5b57\u586b\u5145\u52a0\u8fdb\u8fd0\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (this.name === 'Size&#91;]') {\n  const input = dInput.trim().toUpperCase();\n  \n  \/\/ \u65b0\u589e\uff1a\u5339\u914d\u6570\u5b57\u8f93\u5165\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\n  const numMatch = input.match(\/^=(\\d+)(&#91;+-]\\d+)$\/);\n  if (numMatch) {\n    const baseNumber = parseInt(numMatch&#91;1]);\n    const stepNumber = parseInt(numMatch&#91;2]);\n    \n    const targetNumbers = Array.from({ length: maxSize }, (_, index) => baseNumber + stepNumber * index);\n    $(\"input&#91;name='Size&#91;]']\").each(function (index, value) {\n      $(this).val(targetNumbers&#91;index])\n    });\n  } else {\n    \/\/ \u539f\u6709\u7684\u5b57\u6bcd\u5339\u914d\u903b\u8f91\n    const match = input.match(\/^=(\\w)(&#91;+-]\\d+)$\/);\n    if (!match) {\n      return;\n    }\n    const baseSize = match&#91;1];\n    let offset = parseInt(match&#91;2]);\n    const sizes = &#91;\"S\", \"M\", \"L\", \"XL\", \"XXL\", \"3XXL\", \"4XXL\", \"5XXL\"];\n    const baseIndex = sizes.indexOf(baseSize);\n    if (baseIndex === -1) {\n      return;\n    }\n\n    const targetSizes = &#91;];\n    let index = baseIndex;\n    while (offset > 0 &amp;&amp; index &lt; sizes.length - 1) {\n      index++;\n      offset--;\n    }\n    while (offset &lt; 0 &amp;&amp; index > 0) {\n      index--;\n      offset++;\n    }\n    for (let i = baseIndex; i &lt; index; i++) {\n      targetSizes.push(sizes&#91;i]);\n    }\n    $(\"input&#91;name='Size&#91;]']\").each(function (index, value) {\n      $(this).val(targetSizes&#91;index])\n    });\n  }\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%94%AF%E6%8C%81%E5%B0%8F%E6%95%B0%E5%A1%AB%E5%85%85\"><\/span>\u652f\u6301\u5c0f\u6570\u586b\u5145<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u56e0\u4e3a\u4ee5\u524d\u8ba4\u4e3a\u5c3a\u7801\u4e0d\u53ef\u80fd\u5b58\u5728\u5c0f\u6570\u7684\u5c3a\u7801\uff0c\u7ed3\u679c\u540e\u9762\u7528\u6237\u53cd\u9988\u8fd8\u771f\u6709\uff0c\u6240\u4ee5\u8fd9\u6b21\u5347\u7ea7\u4e86\u652f\u6301\u5c0f\u6570\u586b\u5145\uff0c\u4e0b\u9762\u7684\u4ee3\u7801\u53ea\u652f\u6301\u6574\u6570\u586b\u5145.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (dInput.match(re)) {\n        if (this.name !== 'Size&#91;]') {\n          var first = new Big(Number(dInput.match(re)&#91;1]));\n          var step = new Big(Number(dInput.match(re)&#91;3]));\n\n          this.value = first + step;\n\n          var arrSize = $(\"input&#91;name='\" + this.name + \"']\");\n\n          arrSize.each(function (index, value) {\n            if (index &lt; maxSize) {\n\n              $(this).val(first.times(1).plus(step.times(index).times(1)));\n            }\n          })\n        }\n\n\n\n      }\n\n<\/code><\/pre>\n\n\n\n<p>ChatGTP \u7ed9\u7684\u5efa\u8bae<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (dInput.match(re)) {\n  if (this.name !== 'Size&#91;]') {\n    \/\/ \u4fee\u6539\u4e3a parseFloat \u4ee5\u652f\u6301\u5c0f\u6570\n    var first = new Big(parseFloat(dInput.match(re)&#91;1]));\n    var step = new Big(parseFloat(dInput.match(re)&#91;3]));\n\n    \/\/ \u4f7f\u7528 toFixed() \u8bbe\u7f6e\u4fdd\u7559\u7684\u5c0f\u6570\u4f4d\u6570\u5e76\u5c06\u7ed3\u679c\u8f6c\u4e3a\u6570\u5b57\n    this.value = Number(first.plus(step).toFixed(2));\n\n    var arrSize = $(\"input&#91;name='\" + this.name + \"']\");\n\n    arrSize.each(function (index, value) {\n      if (index &lt; maxSize) {\n        \/\/ \u4f7f\u7528 toFixed() \u8bbe\u7f6e\u4fdd\u7559\u7684\u5c0f\u6570\u4f4d\u6570\u5e76\u5c06\u7ed3\u679c\u8f6c\u4e3a\u6570\u5b57\n        $(this).val(Number(first.plus(step.times(index)).toFixed(2)));\n      }\n    });\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>\u73b0\u5728\u5c3a\u7801\u54e5\u5b8c\u6574\u7684\u652f\u6301\u4e86\u978b\u7801\u548c\u6570\u5b57\u586b\u5145\u8fd9\u4e24\u4e2a\u5c0f\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c3a\u7801\u54e5\u6700\u8fd1\u66f4\u65b0\u4e86\u4e00\u4e0b\u524d\u7aef\u4ee3\u7801\uff0c\u5c31\u662f\u5728\u81ea\u52a8\u586b\u5145\u652f\u6301\u5c0f\u6570\u586b\u5145\u548c\u978b\u7801\u586b\u5145\uff0c\u8fd9\u4e2a\u529f\u80fd\u70b9\u5176\u5b9e\u5f88\u5c0f\uff0c\u6211\u5c31\u8ba9 ChatGPT \u6765\u5e2e\u6211\u5b8c\u6210\uff0c\u6211\u540c\u65f6\u4e5f\u6d4b\u8bd5\u4e86 Claude.ai ,\u4ed6\u4eec\u4e24\u4e2a\u90fd\u80fd\u51fa\u8272\u7684\u5b8c\u6210\u8fd9\u4e2a\u5c0f\u529f\u80fd\u3002 \u4e3a\u4ec0\u4e48\u8981\u652f\u6301\u978b\u7801\u586b\u5145 \u5c3a\u7801\u54e5\u6700\u8fd1\u652f\u6301\u978b\u7801\u751f &#8230; <a title=\"\u7528 ChatGPT \u751f\u6210\u5c3a\u7801\u54e5\u7684\u4ee3\u7801\" class=\"read-more\" href=\"https:\/\/qishiya.com\/?p=1988\" aria-label=\"\u66f4\u591a \u7528 ChatGPT \u751f\u6210\u5c3a\u7801\u54e5\u7684\u4ee3\u7801\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1990,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[589],"tags":[588,624],"class_list":["post-1988","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chatgpt","tag-chatgpt","tag-624","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/1988","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1988"}],"version-history":[{"count":2,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/1988\/revisions"}],"predecessor-version":[{"id":1992,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/1988\/revisions\/1992"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/media\/1990"}],"wp:attachment":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}