{"id":33704,"date":"2024-11-25T17:37:41","date_gmt":"2024-11-25T09:37:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33704\/"},"modified":"2024-11-25T17:37:41","modified_gmt":"2024-11-25T09:37:41","slug":"%e5%ae%9e%e7%8e%b0%e5%9c%a8%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e7%9a%84%e4%b8%80%e4%b8%aa%e5%b9%b8%e8%bf%90%e8%bd%ac%e7%9b%98%e5%b0%8f%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33704\/","title":{"rendered":"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f"},"content":{"rendered":"<h2> \u680f\u76ee\u4ecb\u7ecd\u5b9e\u73b0\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u3002<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/5fabaf7d1b9e4175.jpg\" class=\"aligncenter\" title=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe\" alt=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe\" \/><\/p>\n<p>\u672c\u4eba\u4e3b\u8981\u4ecb\u7ecd\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u91cc\u9762\u5f00\u53d1\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u7684\u5c0f\u6e38\u620f\uff0c\u91cc\u9762\u4e3b\u8981\u7528\u5230javascript\u548c css \u8bed\u6cd5\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u5e78\u8fd0\u8f6c\u76d8\uff08\u4ee56\u4e2a\u5956\u54c1\u533a\u4e3a\u4f8b\uff09\u3002\u5f53\u7136\uff0c\u5982\u679c\u4f60\u6709\u66f4\u597d\u5b9e\u73b0\u65b9\u6848\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002<\/p>\n<h1>\u524d\u8a00<\/h1>\n<p>\u672c\u6b21\u6559\u7a0b\u9700\u8981\u4f60\u638c\u63e1\u4e00\u5b9a\u91cf javascript \u548c css \u57fa\u7840\u77e5\u8bc6\uff0c\u5e76\u4e14\u4f60\u9700\u8981\u6709\u5c0f\u7a0b\u5e8f\u4e00\u5b9a\u7684\u5f00\u53d1\u7ecf\u9a8c,\u5177\u4f53\u9700\u8981\u638c\u63e1\u77e5\u8bc6\u70b9\u6709\uff1a<\/p>\n<ul>\n<li>css \u7684 position\u3001transform\u3001transition\u3001overflow<\/li>\n<li>javascript\u57fa\u672c\u968f\u673a\u7b97\u6cd5<\/li>\n<li>wxs\u8bed\u6cd5<\/li>\n<li>\u5c0f\u7a0b\u5e8f\u5185\u7f6e\u52a8\u753bapi<\/li>\n<\/ul>\n<h1>\u6548\u679c\u56fe<\/h1>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/31ab984b55aa3182140d16829afb65e2-0.png\" style=\"max-width:90%\" title=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe1\" alt=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe1\" \/><\/p>\n<h1>\u5c0f\u7a0b\u5e8f<\/h1>\n<h1>\u5f00\u53d1\u601d\u8def<\/h1>\n<p>\u5f00\u53d1\u601d\u8def\u6709\u4e09\u90e8\u5206\uff0c\u7b2c\u4e00\u90e8\u5206\u662f\u7528css\u7ed8\u5236\u8f6c\u76d8\u80cc\u666f\uff0c\u7b2c\u4e8c\u90e8\u5206\u662f\u5229\u7528 wxs \u8bed\u6cd5\u5b9e\u73b0\u54cd\u5e94\u5f0f\u6837\u5f0f \uff0c\u7b2c\u4e09\u90e8\u5206\u662f\u5c0f\u7a0b\u5e8f\u5185\u7f6e\u52a8\u753bapi\u5b9e\u73b0\u8f6c\u76d8\u7684\u8f6c\u52a8\u4ee5\u53ca\u901a\u8fc7js\u8f6c\u52a8\u968f\u673a\u6027\u7684\u5b9e\u73b0\u3002<\/p>\n<p>\u672c\u4eba\u4e3b\u8981\u4ecb\u7ecd\u7f16\u5199\u601d\u8def\uff0c\u4e0b\u9762\u5c31\u5f00\u59cb\u6211\u7684\u8bb2\u89e3\u3002<\/p>\n<h2>\u5982\u4f55\u753b\u4e00\u4e2a\u4e09\u89d2\u5f62<\/h2>\n<p>\u4e00\u5f00\u59cb\uff0c\u8981\u5199\u4e00\u4e2a\u57fa\u7840\u7684 wxml \u6846\u67b6\u3002<\/p>\n<pre>&lt;view class=\"turntable\"&gt;\n  &lt;view class=\"wrapper\"&gt;\n    &lt;view class=\"item\" &gt;\n\t  &lt;view class=\"item-inner\"&gt;\n\t\t&lt;text&gt;10\u5206&lt;\/text&gt;\n\t  &lt;\/view&gt;\n\t&lt;\/view&gt;\n  &lt;\/view&gt;\n&lt;\/view&gt;\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6211\u753b\u4e86\u4e24\u4e2a\u5927\u5c0f\u76f8\u540c\u7684\u957f\u65b9\u5f62\uff0c\u957f\u548c\u5bbd\u5206\u522b\u662f300rpx\u548c600rpx,\u5229\u7528 position css\u5c5e\u6027\uff0c\u8ba9\u4e24\u4e2a\u957f\u65b9\u5f62\u5408\u5e76\u5728\u4e00\u8d77\u3002<\/p>\n<pre>.turntable {\n  display: block;\n  width: 100%;\n  height: 600rpx;\n}\n.turntable .wrapper{\n  position: relative;\n  transform-origin: center;\n  width: 100%;\n  height: 600rpx;\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/1840a98a186ad01b19dfda9ddbe18157-1.png\" style=\"max-width:90%\" title=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe2\" alt=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe2\" \/><\/p>\n<p>\u5408\u5e76\u4e4b\u540e\u6211\u9700\u8981\u5c06\u4e24\u4e2a\u957f\u65b9\u4f53\u5206\u79bb\u51fa\u6765\uff0c\u628a\u7ea2\u8272\u957f\u65b9\u4f53\u53d8\u6210\u534a\u5706\u5f62\uff0c\u84dd\u8272\u957f\u65b9\u4f53\u987a\u65f6\u6446\u52a860\u5ea6\uff0c\u7ea2\u8272\u957f\u65b9\u4f53\u9006\u65f6\u6446\u52a830\u5ea6\uff0c\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u8f6c\uff0c\u56e0\u4e3a\u84dd\u8272\u672c\u6765\u968f\u7ea2\u8272\u9006\u65f6\u6446\u52a830\u5ea6\uff0c\u800c\u4e00\u4e2a\u4e09\u89d2\u5f62\u5185\u89d2\u4e3a60\u5ea6\uff0c\u4e3a\u4e86\u5f62\u6210\u8fd960\u5ea6\u7684\u5939\u89d2\uff0c\u6211\u9700\u8981\u7ea2\u8272\u6446\u5b8c\u4e4b\u540e\u518d\u5c06\u84dd\u8272\u987a\u65f6\u79fb\u52a860\u5ea6\uff0c\u4e5f\u5c31\u8fd9\u6837\u5f62\u621060\u5ea6\u5939\u89d2\u3002<\/p>\n<pre>.turntable .wrapper .item {\n  position: absolute;\n  left: 50%;\n  width: 300rpx;\n  height: 600rpx;\n  border-radius: 0px 300rpx 300rpx 0;\n  transform-origin: left center;\n  transform: rotate(-30deg);\n}\n.turntable .wrapper .item .item-inner {\n  text-align: center;\n  width: 300rpx;\n  height: 600rpx;\n  transform: translateX(-300rpx) rotate(60deg); \n  transform-origin: right center;\n  border-radius: 300rpx 0 0 300rpx;\n  font-size: 32rpx;\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/1840a98a186ad01b19dfda9ddbe18157-2.png\" style=\"max-width:90%\" title=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe3\" alt=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe3\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u5173\u952e\u4e00\u6b65\u5728 item \u5904\u589e\u52a0 &nbsp;overflow: hidden \u5c5e\u6027\uff0c\u4e00\u4e2a\u4e09\u89d2\u5f62\u5c31\u51fa\u6765\u4e86\uff0c\u5e76\u8c03\u6574\u5b57\u4f53\u7684\u4f4d\u7f6e\u3002<\/p>\n<pre>.turntable .wrapper .item {\n  position: absolute;\n  left: 50%;\n  width: 300rpx;\n  height: 600rpx;\n  border-radius: 0px 300rpx 300rpx 0;\n  overflow: hidden;\n  transform-origin: left center;\n}\n.turntable .wrapper .item .item-inner text {\n  display: block;\n  transform-origin: center;\n  transform: translateY(100rpx) translateX(43rpx) rotate(-30deg);\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/052\/9346c556cbfabddae91fb327c47164db-3.png\" style=\"max-width:90%\" title=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe4\" alt=\"\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u63d2\u56fe4\" \/><\/p>\n<p>\u4e00\u4e2a\u4e09\u89d2\u5f62\u753b\u51fa\u6765\u540e\uff0c\u5c066\u4e2a\u540c\u7b49\u5927\u5c0f\u7684\u4e09\u89d2\u5f62\u5e76\u8ba9\u4ed6\u4eec\u53ef\u4ee5\u62fc\u63a5\u5728\u4e00\u8d77\u7ec4\u5408\u6210\u4e00\u4e2a\u5706\u76d8\uff0c\u53ea\u9700\u5404\u81ea\u4fee\u6539\u4e09\u89d2\u7684\u65cb\u8f6c\u89d2\u5ea6\u5373\u53ef\u3002<\/p>\n<pre>.turntable .wrapper .item:nth-child(1) {\n  transform: rotate(-30deg);\n}\n\n.turntable .wrapper .item:nth-child(2) {\n  transform: rotate(-90deg);\n}\n\n.turntable .wrapper .item:nth-child(3) {\n  transform: rotate(-150deg);\n}\n\n.turntable .wrapper .item:nth-child(4) {\n  transform: rotate(-210deg);\n}\n\n.turntable .wrapper .item:nth-child(5) {\n  transform: rotate(-270deg);\n}\n\n.turntable .wrapper .item:nth-child(6) {\n  transform: rotate(-330deg);\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2>\u5b9e\u73b0\u54cd\u5e94\u5f0f\u6837\u5f0f<\/h2>\n<p>\u4e3a\u4e86\u66f4\u597d\u7684\u9002\u5e94\u4e0d\u540c\u4e1a\u52a1\u9700\u6c42\uff0c\u6211\u628a\u8f6c\u76d8\u7684\u6837\u5f0f\u53d8\u6210\u54cd\u5e94\u5f0f\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u6839\u636e\u7528\u5916\u90e8\u4f20\u5165\u7684 prize \u6570\u636e\u7684\u957f\u5ea6\u6765\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f\uff0c\u6211\u628a\u8fd9\u4e00\u6b65\u7684\u5224\u65ad\uff0c\u653e\u5728 wxs \u6a21\u5757\u90a3\u91cc\u3002<\/p>\n<pre>&lt;wxs module=\"computed\"&gt;\n\tvar rotate = function (index, length) {\n\t\tvar inital = - (360 \/ length \/ 2)\n\t\tvar averageRotate = 360 \/ length\n\t\tvar deg = inital - averageRotate * index\n\t\treturn 'transform: rotate(' + deg + 'deg);'\n\t}\n\tvar inner = function (length) {\n\t\tvar averageRotate = 360 \/ length\n\t\treturn 'transform: translateX(-300rpx) rotate(' + averageRotate + 'deg);'\n\t}\n\tvar text = function (length) {\n\t\tvar distance = 0\n\t\tvar rotate = 0\n\t\tswitch (length) {\n\t\t\tcase 6:\n\t\t\t\tdistance = 43\n\t\t\t\trotate = 30\n\t\t\t\tbreak\n\t\t\tcase 8:\n\t\t\t\tdistance = 72\n\t\t\t\trotate = 30\n\t\t\t\tbreak\n\t\t\tcase 4:\n\t\t\t\tdistance = -20\n\t\t\t\trotate = 40\n\t\t\t\tbreak\n\t\t}\n\t\treturn 'transform: translateY(100rpx) translateX(' + distance + 'rpx) rotate(-45deg);'\n\t}\n\tmodule.exports = {\n\t\trotate: rotate,\n\t\tinner: inner,\n\t\ttext: text\n\t}\n&lt;\/wxs&gt;\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h2>\u52a8\u753b\u7cfb\u7edf\u548c\u4e2d\u5956\u7cfb\u7edf<\/h2>\n<p>\u901a\u8fc7\u8bbe\u5b9a\u597d\u7684\u4e2d\u5956\u7387\uff0c\u4ee5\u4e00\u4e2a\u5706\u4e3a360\u5ea6\u6765\u8ba1\u7b97\uff0c\u5f97\u51fa\u4e00\u4e2a0-360\u7684\u4e2d\u5956\u8303\u56f4\uff0c\u5c06\u968f\u673a\u5f97\u6765\u7684\u6570\u5224\u65ad\u5c5e\u4e8e\u54ea\u4e2a\u533a\u95f4\u503c\uff0c\u7528\u533a\u95f4\u503c reward \u6765\u51b3\u5b9a\u5706\u76d8\u6240\u9700\u8f6c\u52a8\u7684\u89d2\u5ea6\u3002\u601d\u8def\u5927\u6982\u5c31\u662f\u8fd9\u6837\uff0c\u4e0b\u9762\u5f00\u59cb\u8bb2\u89e3\u4e3b\u8981\u7684\u601d\u8def\u3002<\/p>\n<pre>\u5706\u76d8\u8981\u8f6c\u7684\u89d2\u5ea6 = reward * \u4e00\u4e2a\u5706\u5206\u62106\u5757\u7684\u5e73\u5747\u503c  + 3 * 360\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9996\u5148\u8981\u8bbe\u7f6e\u597d6\u4e2a\u5956\u54c1\u533a\u7684\u4e2d\u5956\u7387winning\uff0c\u8be5\u4e2d\u5956\u7387\u8981\u76f8\u52a0\u8d77\u6765\u4e3a1\uff0c\u628a\u521d\u59cb\u5316\u7684\u6570\u636e\u7ec4\u5408\u6210\u4e00\u4e2a6\u4f4d\u6570\u7684\u6570\u7ec4\u4ece\u7ec4\u4ef6\u5916\u4f20\u5165\u8fdb\u7ec4\u4ef6\u5185\u3002<\/p>\n<pre>prize: [{\n        'name': '1\u5206',\n        'winnning': 0.2,\n        'count': 1\n      },\n      {\n        'name': '\u8c22\u8c22\u53c2\u4e0e',\n        'winnning': 0.5,\n        'count': 0\n      }, {\n        'name': '5\u5206',\n        'winnning': 0.05,\n        'count': 5\n      }, {\n        'name': '7\u5206',\n        'winnning': 0.05,\n        'count': 7\n      }, \n      {\n        'name': '3\u5206',\n        'winnning': 0.1,\n        'count': 3\n      }, \n      {\n        'name': '4\u5206',\n        'winnning': 0.1,\n        'count': 4\n      }\n    ],\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e00\u4e2a\u5706\u4e3a360\u5ea6\u6765\u8ba1\u7b97\u51fa0-360\u7684\u4e2d\u5956\u53d6\u503c\u8303\u56f4\u3002<\/p>\n<pre>getRange(winning) {\n   let temp = []\n     winning.forEach((item, index) =&gt; {\n       if (index === 0) {\n         temp.push(item['winnning'] * 360)\n       } else {\n         temp.push(parseInt(temp.slice(-1)) + item['winnning'] * 360)\n       }\n      })\n      return temp\n    },\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u751f\u6210\u4e00\u4e2a\u968f\u673a\u6574\u6570\uff0c\u5f53\u7136\u8fd9\u6570\u8981\u57280-360\uff0c\u4e0d\u7136\u8d85\u51fa360\u6216\u5c0f\u4e8e0\u662f\u6ca1\u6709\u610f\u4e49\u7684\u3002<\/p>\n<pre>let random = Math.round(Math.random() * 360)\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u83b7\u5f97\u968f\u673a\u6570\u4e4b\u540e\uff0c\u5224\u65ad\u5728\u54ea\u4e2a\u5956\u54c1\u8303\u56f4\u5185\u5e76\u628a\u5728\u5bf9\u5e94\u7684\u533a\u95f4\u503c\u8d4b\u4e88\u54cd\u5e94\u6570reward \u5185\u3002<\/p>\n<pre>for (let i in winningRange) {\n    let currentwinning = winningRange[i] \/\/ \u5f53\u524d\u53d6\u503c\n       if (random &lt; currentwinning) {\n          this.setData({\n            reward: i\n          })\n          break\n      } else {\n        if (i == 0) {\n           continue\n        }\n        if (random &gt;= winningRange[i - 1] &amp;&amp; random &lt;= currentwinning) {\n           this.setData({\n              reward: i\n           })\n           break\n       }\n     }\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u628a\u70b9\u51fb\u5f00\u59cb\u7684\u4e3b\u51fd\u6570\u653e\u5728onPoint()\u5185\uff0c\u51fd\u6570\u5f00\u59cb\u65f6\u9700\u5224\u65ad\u662f\u5426\u4ecd\u6709\u62bd\u5956\u673a\u4f1a\u4ee5\u53ca\u9632\u6b62\u5728\u6267\u884c\u52a8\u753b\u53c8\u70b9\u51fb\u51fd\u6570\u6267\u884c\u52a8\u753b\uff0c\u7ecf\u8fc7\u8ba1\u7b97\u5f97\u6765\u6240\u9700\u7684\u89d2\u5ea6\u901a\u8fc7\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u52a8\u753bapi animation \u6765\u8ba9\u5706\u76d8\u5b9e\u73b0\u8f6c\u52a8\uff0c\u52a8\u753b\u7ed3\u675f\u540e\u628a\u4e2d\u5956\u4fe1\u606f\u901a\u8fc7\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u89e6\u53d1\u4e8b\u4ef6\u6765\u8ba9\u7ec4\u4ef6\u5916\u76d1\u542c\u5230\u3002<\/p>\n<pre>onPoint() {\n      \/\/ \u5e73\u5747\u503c\n      const averageRotate = 360 \/ this.properties.prize.length\n      \/\/ \u662f\u5426\u6709\u62bd\u5956\u673a\u4f1a\n      if (this.properties.chance === 0) {\n        this.triggerEvent('none')\n        return\n      }\n      \/\/ \u9632\u6b62\u8f6c\u52a8\u65f6\u70b9\u51fb\u5f00\u59cb\u6309\u94ae\n      if (!this.data.onRotation) {\n        this.setData({\n          onRotation: true\n        })\n        this.getReward()\n        let deg = this.data.reward * averageRotate + 3 * 360  \/\/ \u81f3\u5c113\u5708\u4ee5\u4e0a\n        this.animate('.wrapper', [{\n            rotate: 0,\n            ease: 'ease-in-out'\n          },\n          {\n            rotate: deg,\n            ease: 'ease-in-out'\n          }\n        ], 5000, function () {\n          this.setData({\n            onRotation: false\n          })\n          \/\/ \u53d1\u9001\u81ea\u5df1\u7684\u62bd\u5956\u4fe1\u606f\n          this.triggerEvent('onResult', this.properties.prize[this.data.reward])\n        }.bind(this))\n      }\n    },\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6700\u540e\u522b\u5fd8\u4e86\u5728\u6bcf\u6b21\u6267\u884c\u52a8\u753b\u524d\uff0c\u90fd\u8981\u5148\u6267\u884c\u52a8\u753b\u91cd\u7f6e\u52a8\u4f5c\uff0c\u624d\u80fd\u4fdd\u8bc1\u52a8\u753b\u4e0b\u6b21\u8f6c\u5230\u6b63\u786e\u7684\u89d2\u5ea6\u3002\u5f53\u7136\u6211\u628a\u5176\u653e\u5728\u4e00\u4e2a\u51fd\u6570\u91cc\u9762\uff0c\u4ee5\u4fbf\u7ec4\u4ef6\u5916\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8be5\u51fd\u6570\u3002<\/p>\n<pre>onClear(){\n   this.clearAnimation('.wrapper')\n}\u590d\u5236\u4ee3\u7801<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>\u6700\u540e<\/h1>\n<p>\u6574\u4e2a\u601d\u8def\u5c31\u8fd9\u4e9b\uff0c\u600e\u4e48\u6837\uff0c\u662f\u4e0d\u662f\u5f88\u7b80\u5355\u5462\uff1f\u5b9e\u73b0\u5173\u952e\u4e00\u6b65\u662f\u7ed8\u5236\u5706\u76d8\uff0c\u53ea\u8981\u8fd9\u4e00\u6b65\u641e\u597d\u4e86\uff0c\u5176\u4ed6\u5c31\u4f1a\u7b80\u5355\u5f88\u591a\uff0c\u56e0\u4e3a\u52a8\u753b\u5b9e\u73b0\u90a3\u90e8\u5206\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5df2\u7ecf\u5e2e\u6211\u4eec\u5168\u90e8\u5f04\u597d\u4e86\u3002\u6700\u540e\uff0c\u5982\u679c\u6709\u66f4\u597d\u7684\u65b9\u6cd5\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u8ba8\u8bba\u4e00\u4e0b\u3002<\/p>\n<blockquote><p>\n  \u76f8\u5173\u514d\u8d39\u5b66\u4e60\u63a8\u8350\uff1a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u6559\u7a0b\n<\/p><\/blockquote>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b9e\u73b0\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\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>\u680f\u76ee\u4ecb\u7ecd\u5b9e\u73b0\u5e78\u8fd0\u8f6c\u76d8\u5c0f\u6e38\u620f\u3002 \u672c\u4eba\u4e3b\u8981\u4ecb\u7ecd\u5982\u4f55\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u91cc\u9762\u5f00\u53d1\u4e00\u4e2a\u5e78\u8fd0\u8f6c\u76d8\u7684\u5c0f\u6e38\u620f\uff0c\u91cc\u9762\u4e3b\u8981\u7528\u5230javascript\u548c css \u8bed\u6cd5\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u5e78\u8fd0\u8f6c\u76d8\uff08\u4ee56\u4e2a\u5956\u54c1\u533a\u4e3a\u4f8b\uff09\u3002\u5f53\u7136\uff0c\u5982\u679c\u4f60\u6709\u66f4\u597d\u5b9e\u73b0\u65b9\u6848\uff0c\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00\u3002 \u524d\u8a00 \u672c\u6b21\u6559\u7a0b\u9700\u8981\u4f60\u638c\u63e1\u4e00\u5b9a\u91cf javascript \u548c css \u57fa\u7840\u77e5\u8bc6\uff0c\u5e76\u4e14\u4f60\u9700\u8981\u6709\u5c0f\u7a0b\u5e8f\u4e00\u5b9a\u7684\u5f00\u53d1\u7ecf\u9a8c,\u5177\u4f53\u9700\u8981\u638c\u63e1\u77e5\u8bc6\u70b9\u6709\uff1a css \u7684 position\u3001transform\u3001transition\u3001overflow javascript\u57fa\u672c\u968f\u673a\u7b97\u6cd5 wxs\u8bed\u6cd5 \u5c0f\u7a0b\u5e8f\u5185\u7f6e\u52a8\u753bapi \u6548\u679c\u56fe \u5c0f\u7a0b\u5e8f \u5f00\u53d1\u601d\u8def \u5f00\u53d1\u601d\u8def\u6709\u4e09\u90e8\u5206\uff0c\u7b2c\u4e00\u90e8\u5206\u662f\u7528css\u7ed8\u5236\u8f6c\u76d8\u80cc\u666f\uff0c\u7b2c\u4e8c\u90e8\u5206\u662f\u5229\u7528 wxs \u8bed\u6cd5\u5b9e\u73b0\u54cd\u5e94\u5f0f\u6837\u5f0f \uff0c\u7b2c\u4e09\u90e8\u5206\u662f\u5c0f\u7a0b\u5e8f\u5185\u7f6e\u52a8\u753bapi\u5b9e\u73b0\u8f6c\u76d8\u7684\u8f6c\u52a8\u4ee5\u53ca\u901a\u8fc7js\u8f6c\u52a8\u968f\u673a\u6027\u7684\u5b9e\u73b0\u3002 \u672c\u4eba\u4e3b\u8981\u4ecb\u7ecd\u7f16\u5199\u601d\u8def\uff0c\u4e0b\u9762\u5c31\u5f00\u59cb\u6211\u7684\u8bb2\u89e3\u3002 \u5982\u4f55\u753b\u4e00\u4e2a\u4e09\u89d2\u5f62 \u4e00\u5f00\u59cb\uff0c\u8981\u5199\u4e00\u4e2a\u57fa\u7840\u7684 wxml \u6846\u67b6\u3002 &lt;view class=&#8221;turntable&#8221;&gt; &lt;view class=&#8221;wrapper&#8221;&gt; &lt;view class=&#8221;item&#8221; &gt; &lt;view class=&#8221;item-inner&#8221;&gt; &lt;text&gt;10\u5206&lt;\/text&gt; &lt;\/view&gt; &lt;\/view&gt; &lt;\/view&gt; &lt;\/view&gt;\u590d\u5236\u4ee3\u7801 \u767b\u5f55\u540e\u590d\u5236 \u6211\u753b\u4e86\u4e24\u4e2a\u5927\u5c0f\u76f8\u540c\u7684\u957f\u65b9\u5f62\uff0c\u957f\u548c\u5bbd\u5206\u522b\u662f300rpx\u548c600rpx,\u5229\u7528 position css\u5c5e\u6027\uff0c\u8ba9\u4e24\u4e2a\u957f\u65b9\u5f62\u5408\u5e76\u5728\u4e00\u8d77\u3002 .turntable { display: block; width: 100%; height: 600rpx; } [&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-33704","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33704","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=33704"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33704\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}