common.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. "use strict";
  2. (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["common"],{
  3. /***/ "./src/components/Buttons.tsx":
  4. /*!************************************!*\
  5. !*** ./src/components/Buttons.tsx ***!
  6. \************************************/
  7. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  8. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9. /* harmony export */ "default": function() { return /* binding */ Buttons; }
  10. /* harmony export */ });
  11. /* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
  12. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  13. /* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/types */ "./src/utils/types.ts");
  14. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  15. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
  16. function Buttons(props) {
  17. var myStyle = props.status == _utils_types__WEBPACK_IMPORTED_MODULE_0__.ComponentStatus.disable ? {
  18. opacity: 0.4
  19. } : {};
  20. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
  21. style: (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_3__["default"])({}, myStyle), props.style),
  22. children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
  23. className: props.type == _utils_types__WEBPACK_IMPORTED_MODULE_0__.ButtonType.outline ? 'outline_btn' : 'btn',
  24. onClick: props.onClick,
  25. children: props.title
  26. })
  27. });
  28. }
  29. /***/ }),
  30. /***/ "./src/components/Rings.weapp.tsx":
  31. /*!****************************************!*\
  32. !*** ./src/components/Rings.weapp.tsx ***!
  33. \****************************************/
  34. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  35. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  36. /* harmony export */ "default": function() { return /* binding */ Rings; }
  37. /* harmony export */ });
  38. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  39. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  40. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
  41. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  42. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  43. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  44. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  45. function Rings(props) {
  46. var progress = 0.5;
  47. var r = props.radius || 80;
  48. var strokeWidth = props.strokeWidth || 10;
  49. var color = props.color || 'orange';
  50. var canvasRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  51. var canvasId = props.canvasId ? 'canvas_' + props.canvasId : 'progress-canvas';
  52. var dpr = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().getSystemInfoSync().pixelRatio; // 获取设备的像素比
  53. var radius = r * dpr; // 圆形进度条的半径
  54. var lineWidth = strokeWidth * dpr; // 圆形进度条的线宽
  55. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useDidShow)(function () {
  56. // drawCircle()
  57. });
  58. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__.useReady)(function () {
  59. setTimeout(function () {
  60. drawCircle();
  61. }, 500);
  62. });
  63. function drawCircle() {
  64. var query = _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().createSelectorQuery();
  65. query.select(".".concat(canvasId)).fields({
  66. node: true,
  67. size: true
  68. });
  69. query.exec(function (res) {
  70. var ctx = res[0].node.getContext('2d');
  71. // const ctx = Taro.createCanvasContext(canvasId);
  72. var center = radius + lineWidth / 2; // 圆心坐标
  73. // 设置画布尺寸
  74. ctx.scale(1 / dpr, 1 / dpr);
  75. // 绘制背景圆
  76. ctx.beginPath();
  77. ctx.arc(center, center, radius, 0, 2 * Math.PI);
  78. ctx.lineWith = lineWidth;
  79. ctx.strokeStyle = 'lightgray';
  80. ctx.lineCap = 'round'; // 设置为圆角
  81. ctx.stroke();
  82. // 绘制进度圆
  83. ctx.beginPath();
  84. ctx.arc(center, center, radius, -Math.PI / 2 + 1, 2 * Math.PI * progress - Math.PI / 2);
  85. ctx.lineWith = lineWidth;
  86. ctx.strokeStyle = color;
  87. ctx.lineCap = 'round'; // 设置为圆角
  88. ctx.stroke();
  89. // ctx.draw();
  90. });
  91. }
  92. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  93. // setTimeout(()=>{
  94. // drawCircle()
  95. // },500)
  96. // const ctx = Taro.createCanvasContext(canvasId);
  97. // const center = radius + lineWidth / 2; // 圆心坐标
  98. // // 设置画布尺寸
  99. // ctx.scale(1 / dpr, 1 / dpr);
  100. // // 绘制背景圆
  101. // ctx.beginPath();
  102. // ctx.arc(center, center, radius, 0, 2 * Math.PI);
  103. // ctx.setLineWidth(lineWidth);
  104. // ctx.setStrokeStyle('lightgray');
  105. // ctx.setLineCap('round'); // 设置为圆角
  106. // ctx.stroke();
  107. // // 绘制进度圆
  108. // ctx.beginPath();
  109. // ctx.arc(center, center, radius, -Math.PI / 2 + 1, (2 * Math.PI * progress) - Math.PI / 2);
  110. // ctx.setLineWidth(lineWidth);
  111. // ctx.setStrokeStyle(color);
  112. // ctx.setLineCap('round'); // 设置为圆角
  113. // ctx.stroke();
  114. // ctx.draw();
  115. }, [progress]);
  116. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Canvas, {
  117. canvasId: canvasId,
  118. id: canvasId,
  119. className: canvasId,
  120. type: "2d",
  121. style: {
  122. width: (radius * 2 + lineWidth) / dpr,
  123. height: (radius * 2 + lineWidth) / dpr,
  124. zIndex: 0
  125. },
  126. ref: canvasRef
  127. });
  128. }
  129. /***/ }),
  130. /***/ "./src/components/SingleSelect.tsx":
  131. /*!*****************************************!*\
  132. !*** ./src/components/SingleSelect.tsx ***!
  133. \*****************************************/
  134. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  135. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  136. /* harmony export */ "default": function() { return /* binding */ Component; }
  137. /* harmony export */ });
  138. /* harmony import */ var _Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  139. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  140. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  141. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  142. /* harmony import */ var _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../assets/svg/check.svg */ "./src/assets/svg/check.svg");
  143. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  144. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  145. function Component(props) {
  146. var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(-1),
  147. _useState2 = (0,_Users_Work_taro_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_useState, 2),
  148. selIndex = _useState2[0],
  149. setSelIndex = _useState2[1];
  150. function isString(variable) {
  151. return typeof variable === 'string';
  152. }
  153. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
  154. children: props.items.map(function (item, index) {
  155. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
  156. className: selIndex == index ? 'item item_select' : 'item',
  157. onClick: function onClick() {
  158. return setSelIndex(index);
  159. },
  160. children: [isString(item) ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
  161. style: {
  162. color: '#fff'
  163. },
  164. children: item
  165. }) : item, selIndex == index ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Image, {
  166. style: "width:12px;height:12px;",
  167. src: _assets_svg_check_svg__WEBPACK_IMPORTED_MODULE_1__
  168. }) : null]
  169. }, index);
  170. })
  171. });
  172. }
  173. /***/ }),
  174. /***/ "./src/components/Texts.tsx":
  175. /*!**********************************!*\
  176. !*** ./src/components/Texts.tsx ***!
  177. \**********************************/
  178. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  179. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  180. /* harmony export */ "default": function() { return /* binding */ Component; }
  181. /* harmony export */ });
  182. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  183. /* harmony import */ var _utils_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/types */ "./src/utils/types.ts");
  184. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  185. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
  186. function Component(props) {
  187. function render() {
  188. switch (props.type) {
  189. case _utils_types__WEBPACK_IMPORTED_MODULE_0__.TextType.primary:
  190. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  191. className: "primary",
  192. children: props.text
  193. });
  194. case _utils_types__WEBPACK_IMPORTED_MODULE_0__.TextType.secondary:
  195. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  196. className: "secondary",
  197. children: props.text
  198. });
  199. case _utils_types__WEBPACK_IMPORTED_MODULE_0__.TextType.big:
  200. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  201. className: "big",
  202. children: props.text
  203. });
  204. default:
  205. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  206. children: props.text
  207. });
  208. }
  209. }
  210. return render();
  211. }
  212. /***/ }),
  213. /***/ "./src/utils/types.ts":
  214. /*!****************************!*\
  215. !*** ./src/utils/types.ts ***!
  216. \****************************/
  217. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  218. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  219. /* harmony export */ ButtonType: function() { return /* binding */ ButtonType; },
  220. /* harmony export */ ComponentStatus: function() { return /* binding */ ComponentStatus; },
  221. /* harmony export */ TextType: function() { return /* binding */ TextType; }
  222. /* harmony export */ });
  223. var ButtonType = /*#__PURE__*/function (ButtonType) {
  224. ButtonType["primary"] = "primary";
  225. ButtonType["outline"] = "outline";
  226. return ButtonType;
  227. }({});
  228. var TextType = /*#__PURE__*/function (TextType) {
  229. TextType["primary"] = "primary";
  230. TextType["secondary"] = "secondary";
  231. TextType["big"] = "big";
  232. return TextType;
  233. }({});
  234. var ComponentStatus = /*#__PURE__*/function (ComponentStatus) {
  235. ComponentStatus["enable"] = "enable";
  236. ComponentStatus["disable"] = "disable";
  237. return ComponentStatus;
  238. }({});
  239. /***/ }),
  240. /***/ "./src/assets/svg/check.svg":
  241. /*!**********************************!*\
  242. !*** ./src/assets/svg/check.svg ***!
  243. \**********************************/
  244. /***/ (function(module) {
  245. module.exports = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBmaWxsPSJub25lIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxMyIgdmlld0JveD0iMCAwIDE4IDEzIj48Zz48cGF0aCBkPSJNMTcuNzA3MSwwLjI5Mjg5M0MxOC4wOTc2LDAuNjgzNDE3LDE4LjA5NzYsMS4zMTY1OCwxNy43MDcxLDEuNzA3MTFDMTcuNzA3MSwxLjcwNzExLDYuNzA3MTEsMTIuNzA3MSw2LjcwNzExLDEyLjcwNzFDNi4zMTY1OCwxMy4wOTc2LDUuNjgzNDIsMTMuMDk3Niw1LjI5Mjg5LDEyLjcwNzFDNS4yOTI4OSwxMi43MDcxLDAuMjkyODkzLDcuNzA3MTEsMC4yOTI4OTMsNy43MDcxMUMtMC4wOTc2MzExLDcuMzE2NTgsLTAuMDk3NjMxMSw2LjY4MzQyLDAuMjkyODkzLDYuMjkyODlDMC42ODM0MTcsNS45MDIzNywxLjMxNjU4LDUuOTAyMzcsMS43MDcxMSw2LjI5Mjg5QzEuNzA3MTEsNi4yOTI4OSw2LDEwLjU4NTgsNiwxMC41ODU4QzYsMTAuNTg1OCwxNi4yOTI5LDAuMjkyODkzLDE2LjI5MjksMC4yOTI4OTNDMTYuNjgzNCwtMC4wOTc2MzExLDE3LjMxNjYsLTAuMDk3NjMxMSwxNy43MDcxLDAuMjkyODkzQzE3LjcwNzEsMC4yOTI4OTMsMTcuNzA3MSwwLjI5Mjg5MywxNy43MDcxLDAuMjkyODkzWiIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSIjQUFGRjAwIiBmaWxsLW9wYWNpdHk9IjEiLz48L2c+PC9zdmc+";
  246. /***/ })
  247. }]);
  248. //# sourceMappingURL=common.js.map