Browse Source

Merge branch 'weapp-demo' of https://github.com/jdf2e/nutui into weapp-demo

yangxiaolu3 3 years ago
parent
commit
dbaa20c8db
89 changed files with 70361 additions and 0 deletions
  1. 31 0
      src/sites/miniapp/.eslintrc.js
  2. 19 0
      src/sites/miniapp/app.js
  3. 14 0
      src/sites/miniapp/app.json
  4. 10 0
      src/sites/miniapp/app.wxss
  5. 847 0
      src/sites/miniapp/nutui/base.wxml
  6. 1712 0
      src/sites/miniapp/nutui/common.js
  7. 1 0
      src/sites/miniapp/nutui/common.js.map
  8. 980 0
      src/sites/miniapp/nutui/common.wxss
  9. 10 0
      src/sites/miniapp/nutui/comp.js
  10. 1 0
      src/sites/miniapp/nutui/comp.js.map
  11. 1 0
      src/sites/miniapp/nutui/comp.json
  12. 2 0
      src/sites/miniapp/nutui/comp.wxml
  13. 428 0
      src/sites/miniapp/nutui/components/button/index.js
  14. 1 0
      src/sites/miniapp/nutui/components/button/index.js.map
  15. 1 0
      src/sites/miniapp/nutui/components/button/index.json
  16. 2 0
      src/sites/miniapp/nutui/components/button/index.wxml
  17. 663 0
      src/sites/miniapp/nutui/components/button/index.wxss
  18. 11 0
      src/sites/miniapp/nutui/components/nutIcon/index.js
  19. 1 0
      src/sites/miniapp/nutui/components/nutIcon/index.js.map
  20. 1 0
      src/sites/miniapp/nutui/components/nutIcon/index.json
  21. 2 0
      src/sites/miniapp/nutui/components/nutIcon/index.wxml
  22. 1 0
      src/sites/miniapp/nutui/custom-wrapper.js.map
  23. 196 0
      src/sites/miniapp/nutui/runtime.js
  24. 1 0
      src/sites/miniapp/nutui/runtime.js.map
  25. 8074 0
      src/sites/miniapp/nutui/taro.js
  26. 1 0
      src/sites/miniapp/nutui/taro.js.map
  27. 39 0
      src/sites/miniapp/nutui/utils.wxs
  28. 21566 0
      src/sites/miniapp/nutui/vendors.js
  29. 1 0
      src/sites/miniapp/nutui/vendors.js.map
  30. 99 0
      src/sites/miniapp/pages/index/index.js
  31. 5 0
      src/sites/miniapp/pages/index/index.json
  32. 69 0
      src/sites/miniapp/pages/index/index.wxml
  33. 0 0
      src/sites/miniapp/pages/index/index.wxss
  34. 18 0
      src/sites/miniapp/pages/logs/logs.js
  35. 4 0
      src/sites/miniapp/pages/logs/logs.json
  36. 6 0
      src/sites/miniapp/pages/logs/logs.wxml
  37. 8 0
      src/sites/miniapp/pages/logs/logs.wxss
  38. 51 0
      src/sites/miniapp/project.config.json
  39. 7 0
      src/sites/miniapp/project.private.config.json
  40. 7 0
      src/sites/miniapp/sitemap.json
  41. 19 0
      src/sites/miniapp/utils/util.js
  42. 14 0
      src/sites/weapp-project/babel.config.js
  43. 8 0
      src/sites/weapp-project/config/dev.js
  44. 83 0
      src/sites/weapp-project/config/index.js
  45. 35 0
      src/sites/weapp-project/config/prod.js
  46. 847 0
      src/sites/weapp-project/dist/base.wxml
  47. 1712 0
      src/sites/weapp-project/dist/common.js
  48. 1 0
      src/sites/weapp-project/dist/common.js.map
  49. 980 0
      src/sites/weapp-project/dist/common.wxss
  50. 10 0
      src/sites/weapp-project/dist/comp.js
  51. 1 0
      src/sites/weapp-project/dist/comp.js.map
  52. 1 0
      src/sites/weapp-project/dist/comp.json
  53. 2 0
      src/sites/weapp-project/dist/comp.wxml
  54. 428 0
      src/sites/weapp-project/dist/components/button/index.js
  55. 1 0
      src/sites/weapp-project/dist/components/button/index.js.map
  56. 1 0
      src/sites/weapp-project/dist/components/button/index.json
  57. 2 0
      src/sites/weapp-project/dist/components/button/index.wxml
  58. 663 0
      src/sites/weapp-project/dist/components/button/index.wxss
  59. 11 0
      src/sites/weapp-project/dist/components/nutIcon/index.js
  60. 1 0
      src/sites/weapp-project/dist/components/nutIcon/index.js.map
  61. 1 0
      src/sites/weapp-project/dist/components/nutIcon/index.json
  62. 2 0
      src/sites/weapp-project/dist/components/nutIcon/index.wxml
  63. 1 0
      src/sites/weapp-project/dist/custom-wrapper.js.map
  64. 196 0
      src/sites/weapp-project/dist/runtime.js
  65. 1 0
      src/sites/weapp-project/dist/runtime.js.map
  66. 8074 0
      src/sites/weapp-project/dist/taro.js
  67. 1 0
      src/sites/weapp-project/dist/taro.js.map
  68. 39 0
      src/sites/weapp-project/dist/utils.wxs
  69. 21566 0
      src/sites/weapp-project/dist/vendors.js
  70. 1 0
      src/sites/weapp-project/dist/vendors.js.map
  71. 62 0
      src/sites/weapp-project/package.json
  72. 24 0
      src/sites/weapp-project/plugin-mv/index.js
  73. 15 0
      src/sites/weapp-project/project.config.json
  74. 9 0
      src/sites/weapp-project/project.tt.json
  75. 9 0
      src/sites/weapp-project/src/app.config.ts
  76. 0 0
      src/sites/weapp-project/src/app.scss
  77. 9 0
      src/sites/weapp-project/src/app.ts
  78. 4 0
      src/sites/weapp-project/src/components/article/index.config.ts
  79. 54 0
      src/sites/weapp-project/src/components/article/index.vue
  80. 4 0
      src/sites/weapp-project/src/components/button/index.config.ts
  81. 175 0
      src/sites/weapp-project/src/components/button/index.scss
  82. 103 0
      src/sites/weapp-project/src/components/button/index.vue
  83. 51 0
      src/sites/weapp-project/src/components/nutIcon/index copy.vue
  84. 4 0
      src/sites/weapp-project/src/components/nutIcon/index.config.ts
  85. 131 0
      src/sites/weapp-project/src/components/nutIcon/index.scss
  86. 50 0
      src/sites/weapp-project/src/components/nutIcon/index.vue
  87. 17 0
      src/sites/weapp-project/src/index.html
  88. 25 0
      src/sites/weapp-project/tsconfig.json
  89. 22 0
      src/sites/weapp-project/types/global.d.ts

+ 31 - 0
src/sites/miniapp/.eslintrc.js

@@ -0,0 +1,31 @@
+/*
+ * Eslint config file
+ * Documentation: https://eslint.org/docs/user-guide/configuring/
+ * Install the Eslint extension before using this feature.
+ */
+module.exports = {
+  env: {
+    es6: true,
+    browser: true,
+    node: true
+  },
+  ecmaFeatures: {
+    modules: true
+  },
+  parserOptions: {
+    ecmaVersion: 2018,
+    sourceType: 'module'
+  },
+  globals: {
+    wx: true,
+    App: true,
+    Page: true,
+    getCurrentPages: true,
+    getApp: true,
+    Component: true,
+    requirePlugin: true,
+    requireMiniProgram: true
+  },
+  // extends: 'eslint:recommended',
+  rules: {}
+};

+ 19 - 0
src/sites/miniapp/app.js

@@ -0,0 +1,19 @@
+// app.js
+App({
+  onLaunch() {
+    // 展示本地存储能力
+    const logs = wx.getStorageSync('logs') || [];
+    logs.unshift(Date.now());
+    wx.setStorageSync('logs', logs);
+
+    // 登录
+    wx.login({
+      success: (res) => {
+        // 发送 res.code 到后台换取 openId, sessionKey, unionId
+      }
+    });
+  },
+  globalData: {
+    userInfo: null
+  }
+});

+ 14 - 0
src/sites/miniapp/app.json

@@ -0,0 +1,14 @@
+{
+  "pages":[
+    "pages/index/index",
+    "pages/logs/logs"
+  ],
+  "window":{
+    "backgroundTextStyle":"light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "Weixin",
+    "navigationBarTextStyle":"black"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json"
+}

+ 10 - 0
src/sites/miniapp/app.wxss

@@ -0,0 +1,10 @@
+/**app.wxss**/
+.container {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx 0;
+  box-sizing: border-box;
+} 

File diff suppressed because it is too large
+ 847 - 0
src/sites/miniapp/nutui/base.wxml


File diff suppressed because it is too large
+ 1712 - 0
src/sites/miniapp/nutui/common.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/miniapp/nutui/common.js.map


File diff suppressed because it is too large
+ 980 - 0
src/sites/miniapp/nutui/common.wxss


+ 10 - 0
src/sites/miniapp/nutui/comp.js

@@ -0,0 +1,10 @@
+require('./runtime');
+require('./taro');
+require('./vendors');
+
+(wx['webpackJsonp'] = wx['webpackJsonp'] || []).push([
+  ['comp'],
+  [],
+  [['./node_modules/@tarojs/mini-runner/dist/template/comp.js', 'runtime', 'taro', 'vendors']]
+]);
+//# sourceMappingURL=comp.js.map

+ 1 - 0
src/sites/miniapp/nutui/comp.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"comp.js","sources":[],"mappings":";;;;A","sourceRoot":""}

+ 1 - 0
src/sites/miniapp/nutui/comp.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{"comp":"./comp"}}

+ 2 - 0
src/sites/miniapp/nutui/comp.wxml

@@ -0,0 +1,2 @@
+<import src="./base.wxml" />
+<template is="tmpl_0_container" data="{{i:i,l:l}}" />

File diff suppressed because it is too large
+ 428 - 0
src/sites/miniapp/nutui/components/button/index.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/miniapp/nutui/components/button/index.js.map


+ 1 - 0
src/sites/miniapp/nutui/components/button/index.json

@@ -0,0 +1 @@
+{"navigationBarTitleText":"Button","multipleSlots":true,"usingComponents":{"comp":"../../comp"}}

+ 2 - 0
src/sites/miniapp/nutui/components/button/index.wxml

@@ -0,0 +1,2 @@
+<import src="../../base.wxml"/>
+<template is="taro_tmpl" data="{{root:root}}" />

+ 663 - 0
src/sites/miniapp/nutui/components/button/index.wxss

@@ -0,0 +1,663 @@
+@-webkit-keyframes nutFadeIn {
+from {
+    opacity: 0;
+}
+to {
+    opacity: 1;
+}
+}
+@keyframes nutFadeIn {
+from {
+    opacity: 0;
+}
+to {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutFadeOut {
+from {
+    opacity: 1;
+}
+to {
+    opacity: 0;
+}
+}
+@keyframes nutFadeOut {
+from {
+    opacity: 1;
+}
+to {
+    opacity: 0;
+}
+}
+.nutFade-enter-active,
+.nutFadeIn,
+.nutFade-leave-active,
+.nutFadeOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutFade-enter-active,
+.nutFadeIn {
+  -webkit-animation-name: nutFadeIn;
+          animation-name: nutFadeIn;
+}
+.nutFade-leave-active,
+.nutFadeOut {
+  -webkit-animation-name: nutFadeOut;
+          animation-name: nutFadeOut;
+}
+@-webkit-keyframes nutZoomIn {
+from {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+50% {
+    opacity: 1;
+}
+}
+@keyframes nutZoomIn {
+from {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+50% {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutZoomOut {
+from {
+    opacity: 1;
+}
+50% {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+to {
+    opacity: 0;
+}
+}
+@keyframes nutZoomOut {
+from {
+    opacity: 1;
+}
+50% {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+to {
+    opacity: 0;
+}
+}
+.nutZoom-enter-active,
+.nutZoomIn,
+.nutZoom-leave-active,
+.nutZoomOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutZoom-enter-active,
+.nutZoomIn {
+  -webkit-animation-name: nutZoomIn;
+          animation-name: nutZoomIn;
+}
+.nutZoom-leave-active,
+.nutZoomOut {
+  -webkit-animation-name: nutZoomOut;
+          animation-name: nutZoomOut;
+}
+@-webkit-keyframes nutEaseIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+}
+@keyframes nutEaseIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+}
+@-webkit-keyframes nutEaseOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+}
+@keyframes nutEaseOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+}
+.nutEase-enter-active,
+.nutEaseIn,
+.nutEase-leave-active,
+.nutEaseOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutEase-enter-active,
+.nutEaseIn {
+  -webkit-animation-name: nutEaseIn;
+          animation-name: nutEaseIn;
+}
+.nutEase-leave-active,
+.nutEaseOut {
+  -webkit-animation-name: nutEaseOut;
+          animation-name: nutEaseOut;
+}
+@-webkit-keyframes nutDropIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+}
+@keyframes nutDropIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+}
+@-webkit-keyframes nutDropOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+}
+@keyframes nutDropOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+}
+.nutDrop-enter-active,
+.nutDropIn,
+.nutDrop-leave-active,
+.nutDropOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutDrop-enter-active,
+.nutDropIn {
+  -webkit-animation-name: nutDropIn;
+          animation-name: nutDropIn;
+}
+.nutDrop-leave-active,
+.nutDropOut {
+  -webkit-animation-name: nutDropOut;
+          animation-name: nutDropOut;
+}
+@-webkit-keyframes rotation {
+0% {
+    -webkit-transform: rotate(0deg);
+}
+100% {
+    -webkit-transform: rotate(360deg);
+}
+}
+@keyframes rotation {
+0% {
+    -webkit-transform: rotate(0deg);
+}
+100% {
+    -webkit-transform: rotate(360deg);
+}
+}
+.nutRotate-enter-active,
+.nutRotateIn,
+.nutRotate-leave-active,
+.nutRotateOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutRotate-enter-active,
+.nutRotateIn {
+  -webkit-animation-name: nutRotateIn;
+          animation-name: nutRotateIn;
+}
+.nutRotate-leave-active,
+.nutRotateOut {
+  -webkit-animation-name: nutRotateOut;
+          animation-name: nutRotateOut;
+}
+@-webkit-keyframes nutJump {
+to {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+}
+@keyframes nutJump {
+to {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+}
+@-webkit-keyframes nutJumpOne {
+50% {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+100% {
+    -webkit-transform: scale3d(1, 1, 1) translateY(0);
+            transform: scale3d(1, 1, 1) translateY(0);
+}
+}
+@keyframes nutJumpOne {
+50% {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+100% {
+    -webkit-transform: scale3d(1, 1, 1) translateY(0);
+            transform: scale3d(1, 1, 1) translateY(0);
+}
+}
+@-webkit-keyframes nutBlink {
+0% {
+    opacity: 0;
+}
+100% {
+    opacity: 1;
+}
+}
+@keyframes nutBlink {
+0% {
+    opacity: 0;
+}
+100% {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutBreathe {
+from, to {
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+50% {
+    -webkit-transform: scale(1.2);
+            transform: scale(1.2);
+}
+}
+@keyframes nutBreathe {
+from, to {
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+50% {
+    -webkit-transform: scale(1.2);
+            transform: scale(1.2);
+}
+}
+@-webkit-keyframes nutFlash {
+from, 50%, to {
+    opacity: 1;
+}
+25%, 75% {
+    opacity: 0;
+}
+}
+@keyframes nutFlash {
+from, 50%, to {
+    opacity: 1;
+}
+25%, 75% {
+    opacity: 0;
+}
+}
+@-webkit-keyframes nutBounce {
+from, 20%, 53%, to {
+    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0);
+    transform: translate3d(0, 0, 0);
+}
+40%, 43% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+    transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+}
+70% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+    transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+}
+80% {
+    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
+    transform: translate3d(0, 0, 0) scaleY(0.95);
+}
+90% {
+    -webkit-transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+    transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+}
+}
+@keyframes nutBounce {
+from, 20%, 53%, to {
+    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0);
+    transform: translate3d(0, 0, 0);
+}
+40%, 43% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+    transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+}
+70% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+    transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+}
+80% {
+    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -o-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+       transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
+    transform: translate3d(0, 0, 0) scaleY(0.95);
+}
+90% {
+    -webkit-transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+    transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+}
+}
+@-webkit-keyframes nutShake {
+0% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+6.5% {
+    -webkit-transform: translateX(-12rpx) rotateY(-9deg);
+    transform: translateX(-12rpx) rotateY(-9deg);
+}
+18.5% {
+    -webkit-transform: translateX(10rpx) rotateY(7deg);
+    transform: translateX(10rpx) rotateY(7deg);
+}
+31.5% {
+    -webkit-transform: translateX(-6rpx) rotateY(-5deg);
+    transform: translateX(-6rpx) rotateY(-5deg);
+}
+43.5% {
+    -webkit-transform: translateX(4rpx) rotateY(3deg);
+    transform: translateX(4rpx) rotateY(3deg);
+}
+50% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+}
+@keyframes nutShake {
+0% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+6.5% {
+    -webkit-transform: translateX(-12rpx) rotateY(-9deg);
+    transform: translateX(-12rpx) rotateY(-9deg);
+}
+18.5% {
+    -webkit-transform: translateX(10rpx) rotateY(7deg);
+    transform: translateX(10rpx) rotateY(7deg);
+}
+31.5% {
+    -webkit-transform: translateX(-6rpx) rotateY(-5deg);
+    transform: translateX(-6rpx) rotateY(-5deg);
+}
+43.5% {
+    -webkit-transform: translateX(4rpx) rotateY(3deg);
+    transform: translateX(4rpx) rotateY(3deg);
+}
+50% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+}
+.nut-button {
+  position: relative;
+  display: inline-block;
+  width: auto;
+  -webkit-flex-shrink: 0;
+      -ms-flex-negative: 0;
+          flex-shrink: 0;
+  height: 76rpx;
+  -webkit-box-sizing: border-box;
+          box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+  line-height: 72rpx;
+  font-size: 28rpx;
+  text-align: center;
+  -webkit-transition: opacity 0.2s;
+  -o-transition: opacity 0.2s;
+  transition: opacity 0.2s;
+  -webkit-appearance: none;
+     -moz-appearance: none;
+          appearance: none;
+  -webkit-user-select: none;
+     -moz-user-select: none;
+      -ms-user-select: none;
+          user-select: none;
+  -ms-touch-action: manipulation;
+      touch-action: manipulation;
+  vertical-align: bottom;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  -webkit-tap-highlight-color: transparent;
+}
+.nut-button .text {
+  margin-left: 10rpx;
+}
+.nut-button::before {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  width: 100%;
+  height: 100%;
+  background-color: #000;
+  border: inherit;
+  border-color: #000;
+  border-radius: inherit;
+  -webkit-transform: translate(-50%, -50%);
+      -ms-transform: translate(-50%, -50%);
+          transform: translate(-50%, -50%);
+  opacity: 0;
+  content: " ";
+}
+.nut-button::after {
+  border: none;
+}
+.nut-button:active::before {
+  opacity: 0.1;
+}
+.nut-button__warp {
+  height: 100%;
+  width: 100%;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-align-items: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-justify-content: center;
+      -ms-flex-pack: center;
+          justify-content: center;
+}
+.nut-button--loading::before, .nut-button--disabled::before {
+  display: none;
+}
+.nut-button--default {
+  color: rgb(102, 102, 102);
+  background: #fff;
+  border: 2rpx solid rgb(204, 204, 204);
+}
+.nut-button--primary {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, #fa2c19 0%, #fa6419 100%);
+  background: -o-linear-gradient(315deg, #fa2c19 0%, #fa6419 100%);
+  background: linear-gradient(135deg, #fa2c19 0%, #fa6419 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--info {
+  color: #fff;
+  background: -webkit-linear-gradient(135deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  background: -o-linear-gradient(135deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  background: linear-gradient(315deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--success {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  background: -o-linear-gradient(315deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  background: linear-gradient(135deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--danger {
+  color: #fff;
+  background: rgb(250, 44, 25);
+  border: 2rpx solid transparent;
+}
+.nut-button--warning {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  background: -o-linear-gradient(315deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  background: linear-gradient(135deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--plain {
+  background: #fff;
+}
+.nut-button--plain.nut-button--primary {
+  color: #fa2c19;
+  border-color: #fa2c19;
+}
+.nut-button--plain.nut-button--info {
+  color: rgb(73, 106, 242);
+  border-color: rgb(73, 106, 242);
+}
+.nut-button--plain.nut-button--success {
+  color: rgb(38, 191, 38);
+  border-color: rgb(38, 191, 38);
+}
+.nut-button--plain.nut-button--danger {
+  color: rgb(250, 44, 25);
+  border-color: rgb(250, 44, 25);
+}
+.nut-button--plain.nut-button--warning {
+  color: rgb(255, 158, 13);
+  border-color: rgb(255, 158, 13);
+}
+.nut-button--large {
+  width: 100%;
+  height: 96rpx;
+  line-height: 92rpx;
+  font-size: 28rpx;
+}
+.nut-button--normal {
+  padding: 0 36rpx;
+  font-size: 28rpx;
+}
+.nut-button--small {
+  height: 56rpx;
+  line-height: 52rpx;
+  padding: 0 24rpx;
+  font-size: 24rpx;
+}
+.nut-button--mini {
+  height: 48rpx;
+  line-height: 1.2;
+  padding: 0 24rpx;
+  font-size: 24rpx;
+}
+.nut-button--block {
+  display: block;
+  width: 100%;
+}
+.nut-button--disabled {
+  opacity: 0.68;
+}
+.nut-button--loading {
+  opacity: 0.9;
+}
+.nut-button--round {
+  border-radius: 50rpx;
+}
+.nut-button--square {
+  border-radius: 0;
+}

+ 11 - 0
src/sites/miniapp/nutui/components/nutIcon/index.js

@@ -0,0 +1,11 @@
+require('../../runtime');
+require('../../taro');
+require('../../vendors');
+require('../../common');
+
+(wx['webpackJsonp'] = wx['webpackJsonp'] || []).push([
+  ['components/nutIcon/index'],
+  [],
+  [['./src/components/nutIcon/index.vue', 'runtime', 'taro', 'vendors', 'common']]
+]);
+//# sourceMappingURL=index.js.map

+ 1 - 0
src/sites/miniapp/nutui/components/nutIcon/index.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"components/nutIcon/index.js","sources":[],"mappings":";;;;;A","sourceRoot":""}

+ 1 - 0
src/sites/miniapp/nutui/components/nutIcon/index.json

@@ -0,0 +1 @@
+{"navigationBarTitleText":"Icon","multipleSlots":true,"usingComponents":{"comp":"../../comp"}}

+ 2 - 0
src/sites/miniapp/nutui/components/nutIcon/index.wxml

@@ -0,0 +1,2 @@
+<import src="../../base.wxml"/>
+<template is="taro_tmpl" data="{{root:root}}" />

+ 1 - 0
src/sites/miniapp/nutui/custom-wrapper.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"custom-wrapper.js","sources":[],"mappings":";;;;A","sourceRoot":""}

+ 196 - 0
src/sites/miniapp/nutui/runtime.js

@@ -0,0 +1,196 @@
+/******/ (function (modules) {
+  // webpackBootstrap
+  /******/ // install a JSONP callback for chunk loading
+  /******/ function webpackJsonpCallback(data) {
+    /******/ var chunkIds = data[0];
+    /******/ var moreModules = data[1];
+    /******/ var executeModules = data[2];
+    /******/
+    /******/ // add "moreModules" to the modules object,
+    /******/ // then flag all "chunkIds" as loaded and fire callback
+    /******/ var moduleId,
+      chunkId,
+      i = 0,
+      resolves = [];
+    /******/ for (; i < chunkIds.length; i++) {
+      /******/ chunkId = chunkIds[i];
+      /******/ if (Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
+        /******/ resolves.push(installedChunks[chunkId][0]);
+        /******/
+      }
+      /******/ installedChunks[chunkId] = 0;
+      /******/
+    }
+    /******/ for (moduleId in moreModules) {
+      /******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
+        /******/ modules[moduleId] = moreModules[moduleId];
+        /******/
+      }
+      /******/
+    }
+    /******/ if (parentJsonpFunction) parentJsonpFunction(data);
+    /******/
+    /******/ while (resolves.length) {
+      /******/ resolves.shift()();
+      /******/
+    }
+    /******/
+    /******/ // add entry modules from loaded chunk to deferred list
+    /******/ deferredModules.push.apply(deferredModules, executeModules || []);
+    /******/
+    /******/ // run deferred modules when all chunks ready
+    /******/ return checkDeferredModules();
+    /******/
+  }
+  /******/ function checkDeferredModules() {
+    /******/ var result;
+    /******/ for (var i = 0; i < deferredModules.length; i++) {
+      /******/ var deferredModule = deferredModules[i];
+      /******/ var fulfilled = true;
+      /******/ for (var j = 1; j < deferredModule.length; j++) {
+        /******/ var depId = deferredModule[j];
+        /******/ if (installedChunks[depId] !== 0) fulfilled = false;
+        /******/
+      }
+      /******/ if (fulfilled) {
+        /******/ deferredModules.splice(i--, 1);
+        /******/ result = __webpack_require__((__webpack_require__.s = deferredModule[0]));
+        /******/
+      }
+      /******/
+    }
+    /******/
+    /******/ return result;
+    /******/
+  }
+  /******/
+  /******/ // The module cache
+  /******/ var installedModules = {};
+  /******/
+  /******/ // object to store loaded and loading chunks
+  /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+  /******/ // Promise = chunk loading, 0 = chunk loaded
+  /******/ var installedChunks = {
+    /******/ runtime: 0
+    /******/
+  };
+  /******/
+  /******/ var deferredModules = [];
+  /******/
+  /******/ // The require function
+  /******/ function __webpack_require__(moduleId) {
+    /******/
+    /******/ // Check if module is in cache
+    /******/ if (installedModules[moduleId]) {
+      /******/ return installedModules[moduleId].exports;
+      /******/
+    }
+    /******/ // Create a new module (and put it into the cache)
+    /******/ var module = (installedModules[moduleId] = {
+      /******/ i: moduleId,
+      /******/ l: false,
+      /******/ exports: {}
+      /******/
+    });
+    /******/
+    /******/ // Execute the module function
+    /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+    /******/
+    /******/ // Flag the module as loaded
+    /******/ module.l = true;
+    /******/
+    /******/ // Return the exports of the module
+    /******/ return module.exports;
+    /******/
+  }
+  /******/
+  /******/
+  /******/ // expose the modules object (__webpack_modules__)
+  /******/ __webpack_require__.m = modules;
+  /******/
+  /******/ // expose the module cache
+  /******/ __webpack_require__.c = installedModules;
+  /******/
+  /******/ // define getter function for harmony exports
+  /******/ __webpack_require__.d = function (exports, name, getter) {
+    /******/ if (!__webpack_require__.o(exports, name)) {
+      /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+      /******/
+    }
+    /******/
+  };
+  /******/
+  /******/ // define __esModule on exports
+  /******/ __webpack_require__.r = function (exports) {
+    /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+      /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+      /******/
+    }
+    /******/ Object.defineProperty(exports, '__esModule', { value: true });
+    /******/
+  };
+  /******/
+  /******/ // create a fake namespace object
+  /******/ // mode & 1: value is a module id, require it
+  /******/ // mode & 2: merge all properties of value into the ns
+  /******/ // mode & 4: return value when already ns object
+  /******/ // mode & 8|1: behave like require
+  /******/ __webpack_require__.t = function (value, mode) {
+    /******/ if (mode & 1) value = __webpack_require__(value);
+    /******/ if (mode & 8) return value;
+    /******/ if (mode & 4 && typeof value === 'object' && value && value.__esModule) return value;
+    /******/ var ns = Object.create(null);
+    /******/ __webpack_require__.r(ns);
+    /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+    /******/ if (mode & 2 && typeof value != 'string')
+      for (var key in value)
+        __webpack_require__.d(
+          ns,
+          key,
+          function (key) {
+            return value[key];
+          }.bind(null, key)
+        );
+    /******/ return ns;
+    /******/
+  };
+  /******/
+  /******/ // getDefaultExport function for compatibility with non-harmony modules
+  /******/ __webpack_require__.n = function (module) {
+    /******/ var getter =
+      module && module.__esModule
+        ? /******/ function getDefault() {
+            return module['default'];
+          }
+        : /******/ function getModuleExports() {
+            return module;
+          };
+    /******/ __webpack_require__.d(getter, 'a', getter);
+    /******/ return getter;
+    /******/
+  };
+  /******/
+  /******/ // Object.prototype.hasOwnProperty.call
+  /******/ __webpack_require__.o = function (object, property) {
+    return Object.prototype.hasOwnProperty.call(object, property);
+  };
+  /******/
+  /******/ // __webpack_public_path__
+  /******/ __webpack_require__.p = '/';
+  /******/
+  /******/ var jsonpArray = (wx['webpackJsonp'] = wx['webpackJsonp'] || []);
+  /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
+  /******/ jsonpArray.push = webpackJsonpCallback;
+  /******/ jsonpArray = jsonpArray.slice();
+  /******/ for (var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
+  /******/ var parentJsonpFunction = oldJsonpFunction;
+  /******/
+  /******/
+  /******/ // run deferred modules from other chunks
+  /******/ checkDeferredModules();
+  /******/
+})(
+  /************************************************************************/
+  /******/ []
+);
+//# sourceMappingURL=runtime.js.map

File diff suppressed because it is too large
+ 1 - 0
src/sites/miniapp/nutui/runtime.js.map


File diff suppressed because it is too large
+ 8074 - 0
src/sites/miniapp/nutui/taro.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/miniapp/nutui/taro.js.map


+ 39 - 0
src/sites/miniapp/nutui/utils.wxs

@@ -0,0 +1,39 @@
+module.exports = {
+  a: function (l, n, s) {
+    var a = ["7","0","19","5","2","12","6","4","51","52","26","21","48","53","54"]
+    var b = ["4","51","52","26","21","48","53","54"]
+    if (a.indexOf(n) === -1) {
+      l = 0
+    }
+    if (b.indexOf(n) > -1) {
+      var u = s.split(',')
+      var depth = 0
+      for (var i = 0; i < u.length; i++) {
+        if (u[i] === n) depth++
+      }
+      l = depth
+    }
+    return 'tmpl_' + l + '_' + n
+  },
+  b: function (a, b) {
+    return a === undefined ? b : a
+  },
+  c: function(i, prefix) {
+    var s = i.focus !== undefined ? 'focus' : 'blur'
+    return prefix + i.nn + '_' + s
+  },
+  d: function (i, v) {
+    return i === undefined ? v : i
+  },
+  e: function (n) {
+    return 'tmpl_' + n + '_container'
+  },
+  f: function (l, n) {
+    var b = ["4","51","52","26","21","48","53","54"]
+    if (b.indexOf(n) > -1) {
+      if (l) l += ','
+      l += n
+    }
+    return l
+  }
+}

File diff suppressed because it is too large
+ 21566 - 0
src/sites/miniapp/nutui/vendors.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/miniapp/nutui/vendors.js.map


+ 99 - 0
src/sites/miniapp/pages/index/index.js

@@ -0,0 +1,99 @@
+// index.js
+// 获取应用实例
+const app = getApp();
+
+Page({
+  data: {
+    motto: 'Hello World',
+    userInfo: {},
+    hasUserInfo: false,
+    canIUse: wx.canIUse('button.open-type.getUserInfo'),
+    pickerProps: {
+      title: 'test',
+      list: ['A', 'B', 'C'],
+      onButtonClick() {
+        console.log('on button click');
+      }
+    },
+
+    iconname1: {
+      name: 'loading'
+    },
+    iconname2: {
+      name: 'JD'
+    },
+
+    buttonPrimary: {
+      type: 'primary'
+    },
+
+    buttoninfo: {
+      type: 'info'
+    },
+    buttondefault: {
+      type: 'default'
+    },
+    buttondanger: {
+      type: 'danger'
+    },
+    buttonwarning: {
+      type: 'warning'
+    },
+    buttonsuccess: {
+      type: 'success'
+    },
+
+    buttonshape: {
+      shape: 'square',
+      type: 'primary'
+    },
+
+    btnplain: {
+      plain: true,
+      type: 'primary'
+    },
+
+    btnLoading: {
+      loading: true,
+      type: 'info'
+    }
+  },
+  // 事件处理函数
+  bindViewTap() {},
+  onLoad() {
+    if (app.globalData.userInfo) {
+      this.setData({
+        userInfo: app.globalData.userInfo,
+        hasUserInfo: true
+      });
+    } else if (this.data.canIUse) {
+      // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+      // 所以此处加入 callback 以防止这种情况
+      app.userInfoReadyCallback = (res) => {
+        this.setData({
+          userInfo: res.userInfo,
+          hasUserInfo: true
+        });
+      };
+    } else {
+      // 在没有 open-type=getUserInfo 版本的兼容处理
+      wx.getUserInfo({
+        success: (res) => {
+          app.globalData.userInfo = res.userInfo;
+          this.setData({
+            userInfo: res.userInfo,
+            hasUserInfo: true
+          });
+        }
+      });
+    }
+  },
+  getUserInfo(e) {
+    console.log(e);
+    app.globalData.userInfo = e.detail.userInfo;
+    this.setData({
+      userInfo: e.detail.userInfo,
+      hasUserInfo: true
+    });
+  }
+});

+ 5 - 0
src/sites/miniapp/pages/index/index.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "nut-button": "../../nutui/components/button/index"
+  }
+}

+ 69 - 0
src/sites/miniapp/pages/index/index.wxml

@@ -0,0 +1,69 @@
+<!--index.wxml-->
+<view class="container">
+  <view>demo</view>
+
+  <!-- <nut-icon props="{{iconname1}}"></nut-icon>
+  <nut-icon props="{{iconname2}}"></nut-icon> -->
+
+  <view>
+      <h2>按钮类型</h2>
+    <view class="demo-button-row">
+      <nut-button props='{{buttonPrimary}}'>主要按钮</nut-button>
+    </view>
+    <view class="demo-button-row">
+      <nut-button props='{{buttonPrimary}}'>主要按钮</nut-button>
+      <nut-button props="{{buttoninfo}}">信息按钮</nut-button>
+      <nut-button props="{{buttondefault}}">默认按钮</nut-button>
+    </view>
+    <view class="demo-button-row2">
+      <nut-button props="{{buttondanger}}">危险按钮</nut-button>
+      <nut-button props="{{buttonwarning}}" type="warning">警告按钮</nut-button>
+      <nut-button props="{{buttonsuccess}}" type="success">成功按钮</nut-button>
+    </view>
+    <h2>朴素按钮</h2>
+    <view class="demo-button-row2">
+      <nut-button props="{{btnplain}}">朴素按钮</nut-button>
+      <nut-button plain type="info">朴素按钮</nut-button>
+    </view>
+    <h2>禁用状态</h2>
+    <view class="demo-button-row2">
+      <nut-button disabled type="primary">禁用状态</nut-button>
+      <nut-button plain disabled type="info">禁用状态</nut-button>
+      <nut-button plain disabled type="primary">禁用状态</nut-button>
+    </view>
+    <h2>按钮形状</h2>
+    <view class="demo-button-row2">
+      <nut-button props='{{buttonshape}}'>方形按钮</nut-button>
+      <nut-button type="info">圆形按钮</nut-button>
+    </view>
+    <h2>加载状态</h2>
+    <view class="demo-button-row2">
+      <nut-button props="{{btnLoading}}"></nut-button>
+      <nut-button loading type="warning">加载中...</nut-button>
+      <nut-button :loading="isLoading" type="success" bindtap="bindViewTap">Click me!</nut-button>
+    </view>
+    <h2>图标按钮</h2>
+    <view class="demo-button-row2">
+      <nut-button shape="square" plain type="primary" icon="star-fill"></nut-button>
+      <nut-button shape="square" type="primary" icon="star">收藏</nut-button>
+    </view>
+
+    <h2>按钮尺寸</h2>
+    <view class="demo-button-row2">
+      <nut-button size="large" type="primary" style="margin-bottom: 10px">大号按钮</nut-button>
+      <nut-button type="primary">普通按钮</nut-button>
+      <nut-button size="small" type="primary">小型按钮</nut-button>
+      <nut-button size="mini" type="primary">迷你按钮</nut-button>
+    </view>
+    <h2>块级元素</h2>
+    <view class="demo-button-row2">
+      <nut-button block type="primary">块级元素</nut-button>
+    </view>
+    <h2>自定义颜色</h2>
+    <view class="demo-button-row2">
+      <nut-button color="#7232dd">单色按钮</nut-button>
+      <nut-button color="#7232dd" plain>单色按钮</nut-button>
+      <nut-button color="linear-gradient(to right, #ff6034, #ee0a24)"> 渐变按钮 </nut-button>
+    </view>
+  </view>
+</view>

+ 0 - 0
src/sites/miniapp/pages/index/index.wxss


+ 18 - 0
src/sites/miniapp/pages/logs/logs.js

@@ -0,0 +1,18 @@
+// logs.js
+const util = require('../../utils/util.js');
+
+Page({
+  data: {
+    logs: []
+  },
+  onLoad() {
+    this.setData({
+      logs: (wx.getStorageSync('logs') || []).map((log) => {
+        return {
+          date: util.formatTime(new Date(log)),
+          timeStamp: log
+        };
+      })
+    });
+  }
+});

+ 4 - 0
src/sites/miniapp/pages/logs/logs.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "查看启动日志",
+  "usingComponents": {}
+}

+ 6 - 0
src/sites/miniapp/pages/logs/logs.wxml

@@ -0,0 +1,6 @@
+<!--logs.wxml-->
+<view class="container log-list">
+  <block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
+    <text class="log-item">{{index + 1}}. {{log.date}}</text>
+  </block>
+</view>

+ 8 - 0
src/sites/miniapp/pages/logs/logs.wxss

@@ -0,0 +1,8 @@
+.log-list {
+  display: flex;
+  flex-direction: column;
+  padding: 40rpx;
+}
+.log-item {
+  margin: 10rpx;
+}

+ 51 - 0
src/sites/miniapp/project.config.json

@@ -0,0 +1,51 @@
+{
+  "description": "项目配置文件",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "bundle": false,
+    "userConfirmedBundleSwitch": false,
+    "urlCheck": true,
+    "scopeDataCheck": false,
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "compileHotReLoad": false,
+    "lazyloadPlaceholderEnable": false,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "autoAudits": false,
+    "newFeature": false,
+    "uglifyFileName": false,
+    "uploadWithSourceMap": true,
+    "useIsolateContext": true,
+    "nodeModules": false,
+    "enhance": true,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmManually": false,
+    "enableEngineNative": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "showES6CompileOption": false,
+    "minifyWXML": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    }
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.19.4",
+  "appid": "wxf2b976b67dab3882",
+  "projectname": "miniprogram-92",
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
+}

+ 7 - 0
src/sites/miniapp/project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "miniapp",
+  "setting": {
+    "compileHotReLoad": true
+  }
+}

+ 7 - 0
src/sites/miniapp/sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}

+ 19 - 0
src/sites/miniapp/utils/util.js

@@ -0,0 +1,19 @@
+const formatTime = (date) => {
+  const year = date.getFullYear();
+  const month = date.getMonth() + 1;
+  const day = date.getDate();
+  const hour = date.getHours();
+  const minute = date.getMinutes();
+  const second = date.getSeconds();
+
+  return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`;
+};
+
+const formatNumber = (n) => {
+  n = n.toString();
+  return n[1] ? n : `0${n}`;
+};
+
+module.exports = {
+  formatTime
+};

+ 14 - 0
src/sites/weapp-project/babel.config.js

@@ -0,0 +1,14 @@
+// babel-preset-taro 更多选项和默认值:
+// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
+module.exports = {
+  presets: [
+    [
+      'taro',
+      {
+        framework: 'vue3',
+        ts: true
+      }
+    ]
+  ],
+  plugins: []
+};

+ 8 - 0
src/sites/weapp-project/config/dev.js

@@ -0,0 +1,8 @@
+module.exports = {
+  env: {
+    NODE_ENV: '"development"'
+  },
+  defineConstants: {},
+  mini: {},
+  h5: {}
+};

+ 83 - 0
src/sites/weapp-project/config/index.js

@@ -0,0 +1,83 @@
+const path = require('path');
+
+const config = {
+  projectName: 'weapp-project',
+  date: '2022-9-2',
+  designWidth: 375,
+  deviceRatio: {
+    640: 2.34 / 2,
+    750: 1,
+    828: 1.81 / 2,
+    375: 2 / 1
+  },
+  sourceRoot: 'src',
+  outputRoot: 'dist',
+  plugins: [path.join(process.cwd(), '/plugin-mv/index.js'), '@tarojs/plugin-html'],
+  alias: {
+    '@vue': path.resolve(__dirname, '../../../../node_modules/@vue'),
+    '@/packages': path.resolve(__dirname, '../../../../src/packages')
+  },
+  sass: {
+    resource: path.resolve(__dirname, '../../../', 'packages/styles/variables.scss')
+  },
+  defineConstants: {},
+  copy: {
+    patterns: [],
+    options: {}
+  },
+  framework: 'vue3',
+  compiler: 'webpack4',
+  mini: {
+    postcss: {
+      pxtransform: {
+        enable: true,
+        config: {}
+      },
+      url: {
+        enable: true,
+        config: {
+          limit: 1024 // 设定转换尺寸上限
+        }
+      },
+      cssModules: {
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
+        config: {
+          namingPattern: 'module', // 转换模式,取值为 global/module
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
+        }
+      }
+    }
+  },
+  h5: {
+    publicPath: '/',
+    staticDirectory: 'static',
+    postcss: {
+      autoprefixer: {
+        enable: true,
+        config: {}
+      },
+      cssModules: {
+        enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
+        config: {
+          namingPattern: 'module', // 转换模式,取值为 global/module
+          generateScopedName: '[name]__[local]___[hash:base64:5]'
+        }
+      }
+    }
+  },
+  rn: {
+    appName: 'taroDemo',
+    postcss: {
+      cssModules: {
+        enable: false // 默认为 false,如需使用 css modules 功能,则设为 true
+      }
+    }
+  }
+};
+
+module.exports = function (merge) {
+  if (process.env.NODE_ENV === 'development') {
+    return merge({}, config, require('./dev'));
+  }
+  return merge({}, config, require('./prod'));
+};

+ 35 - 0
src/sites/weapp-project/config/prod.js

@@ -0,0 +1,35 @@
+module.exports = {
+  env: {
+    NODE_ENV: '"production"'
+  },
+  defineConstants: {},
+  mini: {},
+  h5: {
+    /**
+     * WebpackChain 插件配置
+     * @docs https://github.com/neutrinojs/webpack-chain
+     */
+    // webpackChain (chain) {
+    //   /**
+    //    * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
+    //    * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
+    //    */
+    //   chain.plugin('analyzer')
+    //     .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
+    //   /**
+    //    * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
+    //    * @docs https://github.com/chrisvfritz/prerender-spa-plugin
+    //    */
+    //   const path = require('path')
+    //   const Prerender = require('prerender-spa-plugin')
+    //   const staticDir = path.join(__dirname, '..', 'dist')
+    //   chain
+    //     .plugin('prerender')
+    //     .use(new Prerender({
+    //       staticDir,
+    //       routes: [ '/pages/index/index' ],
+    //       postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
+    //     }))
+    // }
+  }
+};

File diff suppressed because it is too large
+ 847 - 0
src/sites/weapp-project/dist/base.wxml


File diff suppressed because it is too large
+ 1712 - 0
src/sites/weapp-project/dist/common.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/weapp-project/dist/common.js.map


File diff suppressed because it is too large
+ 980 - 0
src/sites/weapp-project/dist/common.wxss


+ 10 - 0
src/sites/weapp-project/dist/comp.js

@@ -0,0 +1,10 @@
+require('./runtime');
+require('./taro');
+require('./vendors');
+
+(wx['webpackJsonp'] = wx['webpackJsonp'] || []).push([
+  ['comp'],
+  [],
+  [['./node_modules/@tarojs/mini-runner/dist/template/comp.js', 'runtime', 'taro', 'vendors']]
+]);
+//# sourceMappingURL=comp.js.map

+ 1 - 0
src/sites/weapp-project/dist/comp.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"comp.js","sources":[],"mappings":";;;;A","sourceRoot":""}

+ 1 - 0
src/sites/weapp-project/dist/comp.json

@@ -0,0 +1 @@
+{"component":true,"usingComponents":{"comp":"./comp"}}

+ 2 - 0
src/sites/weapp-project/dist/comp.wxml

@@ -0,0 +1,2 @@
+<import src="./base.wxml" />
+<template is="tmpl_0_container" data="{{i:i,l:l}}" />

File diff suppressed because it is too large
+ 428 - 0
src/sites/weapp-project/dist/components/button/index.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/weapp-project/dist/components/button/index.js.map


+ 1 - 0
src/sites/weapp-project/dist/components/button/index.json

@@ -0,0 +1 @@
+{"navigationBarTitleText":"Button","multipleSlots":true,"usingComponents":{"comp":"../../comp"}}

+ 2 - 0
src/sites/weapp-project/dist/components/button/index.wxml

@@ -0,0 +1,2 @@
+<import src="../../base.wxml"/>
+<template is="taro_tmpl" data="{{root:root}}" />

+ 663 - 0
src/sites/weapp-project/dist/components/button/index.wxss

@@ -0,0 +1,663 @@
+@-webkit-keyframes nutFadeIn {
+from {
+    opacity: 0;
+}
+to {
+    opacity: 1;
+}
+}
+@keyframes nutFadeIn {
+from {
+    opacity: 0;
+}
+to {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutFadeOut {
+from {
+    opacity: 1;
+}
+to {
+    opacity: 0;
+}
+}
+@keyframes nutFadeOut {
+from {
+    opacity: 1;
+}
+to {
+    opacity: 0;
+}
+}
+.nutFade-enter-active,
+.nutFadeIn,
+.nutFade-leave-active,
+.nutFadeOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutFade-enter-active,
+.nutFadeIn {
+  -webkit-animation-name: nutFadeIn;
+          animation-name: nutFadeIn;
+}
+.nutFade-leave-active,
+.nutFadeOut {
+  -webkit-animation-name: nutFadeOut;
+          animation-name: nutFadeOut;
+}
+@-webkit-keyframes nutZoomIn {
+from {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+50% {
+    opacity: 1;
+}
+}
+@keyframes nutZoomIn {
+from {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+50% {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutZoomOut {
+from {
+    opacity: 1;
+}
+50% {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+to {
+    opacity: 0;
+}
+}
+@keyframes nutZoomOut {
+from {
+    opacity: 1;
+}
+50% {
+    opacity: 0;
+    -webkit-transform: scale3d(0.3, 0.3, 0.3);
+            transform: scale3d(0.3, 0.3, 0.3);
+}
+to {
+    opacity: 0;
+}
+}
+.nutZoom-enter-active,
+.nutZoomIn,
+.nutZoom-leave-active,
+.nutZoomOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutZoom-enter-active,
+.nutZoomIn {
+  -webkit-animation-name: nutZoomIn;
+          animation-name: nutZoomIn;
+}
+.nutZoom-leave-active,
+.nutZoomOut {
+  -webkit-animation-name: nutZoomOut;
+          animation-name: nutZoomOut;
+}
+@-webkit-keyframes nutEaseIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+}
+@keyframes nutEaseIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+}
+@-webkit-keyframes nutEaseOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+}
+@keyframes nutEaseOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scale(0.9);
+            transform: scale(0.9);
+}
+}
+.nutEase-enter-active,
+.nutEaseIn,
+.nutEase-leave-active,
+.nutEaseOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutEase-enter-active,
+.nutEaseIn {
+  -webkit-animation-name: nutEaseIn;
+          animation-name: nutEaseIn;
+}
+.nutEase-leave-active,
+.nutEaseOut {
+  -webkit-animation-name: nutEaseOut;
+          animation-name: nutEaseOut;
+}
+@-webkit-keyframes nutDropIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+}
+@keyframes nutDropIn {
+0% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+100% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+}
+@-webkit-keyframes nutDropOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+}
+@keyframes nutDropOut {
+0% {
+    opacity: 1;
+    -webkit-transform: scaleY(1);
+            transform: scaleY(1);
+}
+100% {
+    opacity: 0;
+    -webkit-transform: scaleY(0.8);
+            transform: scaleY(0.8);
+}
+}
+.nutDrop-enter-active,
+.nutDropIn,
+.nutDrop-leave-active,
+.nutDropOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutDrop-enter-active,
+.nutDropIn {
+  -webkit-animation-name: nutDropIn;
+          animation-name: nutDropIn;
+}
+.nutDrop-leave-active,
+.nutDropOut {
+  -webkit-animation-name: nutDropOut;
+          animation-name: nutDropOut;
+}
+@-webkit-keyframes rotation {
+0% {
+    -webkit-transform: rotate(0deg);
+}
+100% {
+    -webkit-transform: rotate(360deg);
+}
+}
+@keyframes rotation {
+0% {
+    -webkit-transform: rotate(0deg);
+}
+100% {
+    -webkit-transform: rotate(360deg);
+}
+}
+.nutRotate-enter-active,
+.nutRotateIn,
+.nutRotate-leave-active,
+.nutRotateOut {
+  -webkit-animation-duration: 0.25s;
+          animation-duration: 0.25s;
+  -webkit-animation-fill-mode: both;
+          animation-fill-mode: both;
+  -webkit-animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+          animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
+}
+.nutRotate-enter-active,
+.nutRotateIn {
+  -webkit-animation-name: nutRotateIn;
+          animation-name: nutRotateIn;
+}
+.nutRotate-leave-active,
+.nutRotateOut {
+  -webkit-animation-name: nutRotateOut;
+          animation-name: nutRotateOut;
+}
+@-webkit-keyframes nutJump {
+to {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+}
+@keyframes nutJump {
+to {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+}
+@-webkit-keyframes nutJumpOne {
+50% {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+100% {
+    -webkit-transform: scale3d(1, 1, 1) translateY(0);
+            transform: scale3d(1, 1, 1) translateY(0);
+}
+}
+@keyframes nutJumpOne {
+50% {
+    -webkit-transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+            transform: scale3d(0.8, 1, 0.9) translateY(-20rpx);
+}
+100% {
+    -webkit-transform: scale3d(1, 1, 1) translateY(0);
+            transform: scale3d(1, 1, 1) translateY(0);
+}
+}
+@-webkit-keyframes nutBlink {
+0% {
+    opacity: 0;
+}
+100% {
+    opacity: 1;
+}
+}
+@keyframes nutBlink {
+0% {
+    opacity: 0;
+}
+100% {
+    opacity: 1;
+}
+}
+@-webkit-keyframes nutBreathe {
+from, to {
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+50% {
+    -webkit-transform: scale(1.2);
+            transform: scale(1.2);
+}
+}
+@keyframes nutBreathe {
+from, to {
+    -webkit-transform: scale(1);
+            transform: scale(1);
+}
+50% {
+    -webkit-transform: scale(1.2);
+            transform: scale(1.2);
+}
+}
+@-webkit-keyframes nutFlash {
+from, 50%, to {
+    opacity: 1;
+}
+25%, 75% {
+    opacity: 0;
+}
+}
+@keyframes nutFlash {
+from, 50%, to {
+    opacity: 1;
+}
+25%, 75% {
+    opacity: 0;
+}
+}
+@-webkit-keyframes nutBounce {
+from, 20%, 53%, to {
+    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0);
+    transform: translate3d(0, 0, 0);
+}
+40%, 43% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+    transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+}
+70% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+    transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+}
+80% {
+    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
+    transform: translate3d(0, 0, 0) scaleY(0.95);
+}
+90% {
+    -webkit-transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+    transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+}
+}
+@keyframes nutBounce {
+from, 20%, 53%, to {
+    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0);
+    transform: translate3d(0, 0, 0);
+}
+40%, 43% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+    transform: translate3d(0, -60rpx, 0) scaleY(1.1);
+}
+70% {
+    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
+    -webkit-transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+    transform: translate3d(0, -30rpx, 0) scaleY(1.05);
+}
+80% {
+    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -o-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+       transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
+    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
+    transform: translate3d(0, 0, 0) scaleY(0.95);
+}
+90% {
+    -webkit-transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+    transform: translate3d(0, -8rpx, 0) scaleY(1.02);
+}
+}
+@-webkit-keyframes nutShake {
+0% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+6.5% {
+    -webkit-transform: translateX(-12rpx) rotateY(-9deg);
+    transform: translateX(-12rpx) rotateY(-9deg);
+}
+18.5% {
+    -webkit-transform: translateX(10rpx) rotateY(7deg);
+    transform: translateX(10rpx) rotateY(7deg);
+}
+31.5% {
+    -webkit-transform: translateX(-6rpx) rotateY(-5deg);
+    transform: translateX(-6rpx) rotateY(-5deg);
+}
+43.5% {
+    -webkit-transform: translateX(4rpx) rotateY(3deg);
+    transform: translateX(4rpx) rotateY(3deg);
+}
+50% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+}
+@keyframes nutShake {
+0% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+6.5% {
+    -webkit-transform: translateX(-12rpx) rotateY(-9deg);
+    transform: translateX(-12rpx) rotateY(-9deg);
+}
+18.5% {
+    -webkit-transform: translateX(10rpx) rotateY(7deg);
+    transform: translateX(10rpx) rotateY(7deg);
+}
+31.5% {
+    -webkit-transform: translateX(-6rpx) rotateY(-5deg);
+    transform: translateX(-6rpx) rotateY(-5deg);
+}
+43.5% {
+    -webkit-transform: translateX(4rpx) rotateY(3deg);
+    transform: translateX(4rpx) rotateY(3deg);
+}
+50% {
+    -webkit-transform: translateX(0);
+    transform: translateX(0);
+}
+}
+.nut-button {
+  position: relative;
+  display: inline-block;
+  width: auto;
+  -webkit-flex-shrink: 0;
+      -ms-flex-negative: 0;
+          flex-shrink: 0;
+  height: 76rpx;
+  -webkit-box-sizing: border-box;
+          box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+  line-height: 72rpx;
+  font-size: 28rpx;
+  text-align: center;
+  -webkit-transition: opacity 0.2s;
+  -o-transition: opacity 0.2s;
+  transition: opacity 0.2s;
+  -webkit-appearance: none;
+     -moz-appearance: none;
+          appearance: none;
+  -webkit-user-select: none;
+     -moz-user-select: none;
+      -ms-user-select: none;
+          user-select: none;
+  -ms-touch-action: manipulation;
+      touch-action: manipulation;
+  vertical-align: bottom;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  -webkit-tap-highlight-color: transparent;
+}
+.nut-button .text {
+  margin-left: 10rpx;
+}
+.nut-button::before {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  width: 100%;
+  height: 100%;
+  background-color: #000;
+  border: inherit;
+  border-color: #000;
+  border-radius: inherit;
+  -webkit-transform: translate(-50%, -50%);
+      -ms-transform: translate(-50%, -50%);
+          transform: translate(-50%, -50%);
+  opacity: 0;
+  content: " ";
+}
+.nut-button::after {
+  border: none;
+}
+.nut-button:active::before {
+  opacity: 0.1;
+}
+.nut-button__warp {
+  height: 100%;
+  width: 100%;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-align-items: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-justify-content: center;
+      -ms-flex-pack: center;
+          justify-content: center;
+}
+.nut-button--loading::before, .nut-button--disabled::before {
+  display: none;
+}
+.nut-button--default {
+  color: rgb(102, 102, 102);
+  background: #fff;
+  border: 2rpx solid rgb(204, 204, 204);
+}
+.nut-button--primary {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, #fa2c19 0%, #fa6419 100%);
+  background: -o-linear-gradient(315deg, #fa2c19 0%, #fa6419 100%);
+  background: linear-gradient(135deg, #fa2c19 0%, #fa6419 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--info {
+  color: #fff;
+  background: -webkit-linear-gradient(135deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  background: -o-linear-gradient(135deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  background: linear-gradient(315deg, rgb(73, 143, 242) 0%, rgb(73, 101, 242) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--success {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  background: -o-linear-gradient(315deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  background: linear-gradient(135deg, rgb(38, 191, 38) 0%, rgb(39, 197, 48) 45%, rgb(40, 207, 63) 83%, rgb(41, 212, 70) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--danger {
+  color: #fff;
+  background: rgb(250, 44, 25);
+  border: 2rpx solid transparent;
+}
+.nut-button--warning {
+  color: #fff;
+  background: -webkit-linear-gradient(315deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  background: -o-linear-gradient(315deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  background: linear-gradient(135deg, rgb(255, 158, 13) 0%, rgb(255, 167, 13) 45%, rgb(255, 182, 13) 83%, rgb(255, 190, 13) 100%);
+  border: 2rpx solid transparent;
+}
+.nut-button--plain {
+  background: #fff;
+}
+.nut-button--plain.nut-button--primary {
+  color: #fa2c19;
+  border-color: #fa2c19;
+}
+.nut-button--plain.nut-button--info {
+  color: rgb(73, 106, 242);
+  border-color: rgb(73, 106, 242);
+}
+.nut-button--plain.nut-button--success {
+  color: rgb(38, 191, 38);
+  border-color: rgb(38, 191, 38);
+}
+.nut-button--plain.nut-button--danger {
+  color: rgb(250, 44, 25);
+  border-color: rgb(250, 44, 25);
+}
+.nut-button--plain.nut-button--warning {
+  color: rgb(255, 158, 13);
+  border-color: rgb(255, 158, 13);
+}
+.nut-button--large {
+  width: 100%;
+  height: 96rpx;
+  line-height: 92rpx;
+  font-size: 28rpx;
+}
+.nut-button--normal {
+  padding: 0 36rpx;
+  font-size: 28rpx;
+}
+.nut-button--small {
+  height: 56rpx;
+  line-height: 52rpx;
+  padding: 0 24rpx;
+  font-size: 24rpx;
+}
+.nut-button--mini {
+  height: 48rpx;
+  line-height: 1.2;
+  padding: 0 24rpx;
+  font-size: 24rpx;
+}
+.nut-button--block {
+  display: block;
+  width: 100%;
+}
+.nut-button--disabled {
+  opacity: 0.68;
+}
+.nut-button--loading {
+  opacity: 0.9;
+}
+.nut-button--round {
+  border-radius: 50rpx;
+}
+.nut-button--square {
+  border-radius: 0;
+}

+ 11 - 0
src/sites/weapp-project/dist/components/nutIcon/index.js

@@ -0,0 +1,11 @@
+require('../../runtime');
+require('../../taro');
+require('../../vendors');
+require('../../common');
+
+(wx['webpackJsonp'] = wx['webpackJsonp'] || []).push([
+  ['components/nutIcon/index'],
+  [],
+  [['./src/components/nutIcon/index.vue', 'runtime', 'taro', 'vendors', 'common']]
+]);
+//# sourceMappingURL=index.js.map

+ 1 - 0
src/sites/weapp-project/dist/components/nutIcon/index.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"components/nutIcon/index.js","sources":[],"mappings":";;;;;A","sourceRoot":""}

+ 1 - 0
src/sites/weapp-project/dist/components/nutIcon/index.json

@@ -0,0 +1 @@
+{"navigationBarTitleText":"Icon","multipleSlots":true,"usingComponents":{"comp":"../../comp"}}

+ 2 - 0
src/sites/weapp-project/dist/components/nutIcon/index.wxml

@@ -0,0 +1,2 @@
+<import src="../../base.wxml"/>
+<template is="taro_tmpl" data="{{root:root}}" />

+ 1 - 0
src/sites/weapp-project/dist/custom-wrapper.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"custom-wrapper.js","sources":[],"mappings":";;;;A","sourceRoot":""}

+ 196 - 0
src/sites/weapp-project/dist/runtime.js

@@ -0,0 +1,196 @@
+/******/ (function (modules) {
+  // webpackBootstrap
+  /******/ // install a JSONP callback for chunk loading
+  /******/ function webpackJsonpCallback(data) {
+    /******/ var chunkIds = data[0];
+    /******/ var moreModules = data[1];
+    /******/ var executeModules = data[2];
+    /******/
+    /******/ // add "moreModules" to the modules object,
+    /******/ // then flag all "chunkIds" as loaded and fire callback
+    /******/ var moduleId,
+      chunkId,
+      i = 0,
+      resolves = [];
+    /******/ for (; i < chunkIds.length; i++) {
+      /******/ chunkId = chunkIds[i];
+      /******/ if (Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
+        /******/ resolves.push(installedChunks[chunkId][0]);
+        /******/
+      }
+      /******/ installedChunks[chunkId] = 0;
+      /******/
+    }
+    /******/ for (moduleId in moreModules) {
+      /******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
+        /******/ modules[moduleId] = moreModules[moduleId];
+        /******/
+      }
+      /******/
+    }
+    /******/ if (parentJsonpFunction) parentJsonpFunction(data);
+    /******/
+    /******/ while (resolves.length) {
+      /******/ resolves.shift()();
+      /******/
+    }
+    /******/
+    /******/ // add entry modules from loaded chunk to deferred list
+    /******/ deferredModules.push.apply(deferredModules, executeModules || []);
+    /******/
+    /******/ // run deferred modules when all chunks ready
+    /******/ return checkDeferredModules();
+    /******/
+  }
+  /******/ function checkDeferredModules() {
+    /******/ var result;
+    /******/ for (var i = 0; i < deferredModules.length; i++) {
+      /******/ var deferredModule = deferredModules[i];
+      /******/ var fulfilled = true;
+      /******/ for (var j = 1; j < deferredModule.length; j++) {
+        /******/ var depId = deferredModule[j];
+        /******/ if (installedChunks[depId] !== 0) fulfilled = false;
+        /******/
+      }
+      /******/ if (fulfilled) {
+        /******/ deferredModules.splice(i--, 1);
+        /******/ result = __webpack_require__((__webpack_require__.s = deferredModule[0]));
+        /******/
+      }
+      /******/
+    }
+    /******/
+    /******/ return result;
+    /******/
+  }
+  /******/
+  /******/ // The module cache
+  /******/ var installedModules = {};
+  /******/
+  /******/ // object to store loaded and loading chunks
+  /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
+  /******/ // Promise = chunk loading, 0 = chunk loaded
+  /******/ var installedChunks = {
+    /******/ runtime: 0
+    /******/
+  };
+  /******/
+  /******/ var deferredModules = [];
+  /******/
+  /******/ // The require function
+  /******/ function __webpack_require__(moduleId) {
+    /******/
+    /******/ // Check if module is in cache
+    /******/ if (installedModules[moduleId]) {
+      /******/ return installedModules[moduleId].exports;
+      /******/
+    }
+    /******/ // Create a new module (and put it into the cache)
+    /******/ var module = (installedModules[moduleId] = {
+      /******/ i: moduleId,
+      /******/ l: false,
+      /******/ exports: {}
+      /******/
+    });
+    /******/
+    /******/ // Execute the module function
+    /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+    /******/
+    /******/ // Flag the module as loaded
+    /******/ module.l = true;
+    /******/
+    /******/ // Return the exports of the module
+    /******/ return module.exports;
+    /******/
+  }
+  /******/
+  /******/
+  /******/ // expose the modules object (__webpack_modules__)
+  /******/ __webpack_require__.m = modules;
+  /******/
+  /******/ // expose the module cache
+  /******/ __webpack_require__.c = installedModules;
+  /******/
+  /******/ // define getter function for harmony exports
+  /******/ __webpack_require__.d = function (exports, name, getter) {
+    /******/ if (!__webpack_require__.o(exports, name)) {
+      /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
+      /******/
+    }
+    /******/
+  };
+  /******/
+  /******/ // define __esModule on exports
+  /******/ __webpack_require__.r = function (exports) {
+    /******/ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
+      /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
+      /******/
+    }
+    /******/ Object.defineProperty(exports, '__esModule', { value: true });
+    /******/
+  };
+  /******/
+  /******/ // create a fake namespace object
+  /******/ // mode & 1: value is a module id, require it
+  /******/ // mode & 2: merge all properties of value into the ns
+  /******/ // mode & 4: return value when already ns object
+  /******/ // mode & 8|1: behave like require
+  /******/ __webpack_require__.t = function (value, mode) {
+    /******/ if (mode & 1) value = __webpack_require__(value);
+    /******/ if (mode & 8) return value;
+    /******/ if (mode & 4 && typeof value === 'object' && value && value.__esModule) return value;
+    /******/ var ns = Object.create(null);
+    /******/ __webpack_require__.r(ns);
+    /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
+    /******/ if (mode & 2 && typeof value != 'string')
+      for (var key in value)
+        __webpack_require__.d(
+          ns,
+          key,
+          function (key) {
+            return value[key];
+          }.bind(null, key)
+        );
+    /******/ return ns;
+    /******/
+  };
+  /******/
+  /******/ // getDefaultExport function for compatibility with non-harmony modules
+  /******/ __webpack_require__.n = function (module) {
+    /******/ var getter =
+      module && module.__esModule
+        ? /******/ function getDefault() {
+            return module['default'];
+          }
+        : /******/ function getModuleExports() {
+            return module;
+          };
+    /******/ __webpack_require__.d(getter, 'a', getter);
+    /******/ return getter;
+    /******/
+  };
+  /******/
+  /******/ // Object.prototype.hasOwnProperty.call
+  /******/ __webpack_require__.o = function (object, property) {
+    return Object.prototype.hasOwnProperty.call(object, property);
+  };
+  /******/
+  /******/ // __webpack_public_path__
+  /******/ __webpack_require__.p = '/';
+  /******/
+  /******/ var jsonpArray = (wx['webpackJsonp'] = wx['webpackJsonp'] || []);
+  /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
+  /******/ jsonpArray.push = webpackJsonpCallback;
+  /******/ jsonpArray = jsonpArray.slice();
+  /******/ for (var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
+  /******/ var parentJsonpFunction = oldJsonpFunction;
+  /******/
+  /******/
+  /******/ // run deferred modules from other chunks
+  /******/ checkDeferredModules();
+  /******/
+})(
+  /************************************************************************/
+  /******/ []
+);
+//# sourceMappingURL=runtime.js.map

File diff suppressed because it is too large
+ 1 - 0
src/sites/weapp-project/dist/runtime.js.map


File diff suppressed because it is too large
+ 8074 - 0
src/sites/weapp-project/dist/taro.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/weapp-project/dist/taro.js.map


+ 39 - 0
src/sites/weapp-project/dist/utils.wxs

@@ -0,0 +1,39 @@
+module.exports = {
+  a: function (l, n, s) {
+    var a = ["7","0","19","5","2","12","6","4","51","52","26","21","48","53","54"]
+    var b = ["4","51","52","26","21","48","53","54"]
+    if (a.indexOf(n) === -1) {
+      l = 0
+    }
+    if (b.indexOf(n) > -1) {
+      var u = s.split(',')
+      var depth = 0
+      for (var i = 0; i < u.length; i++) {
+        if (u[i] === n) depth++
+      }
+      l = depth
+    }
+    return 'tmpl_' + l + '_' + n
+  },
+  b: function (a, b) {
+    return a === undefined ? b : a
+  },
+  c: function(i, prefix) {
+    var s = i.focus !== undefined ? 'focus' : 'blur'
+    return prefix + i.nn + '_' + s
+  },
+  d: function (i, v) {
+    return i === undefined ? v : i
+  },
+  e: function (n) {
+    return 'tmpl_' + n + '_container'
+  },
+  f: function (l, n) {
+    var b = ["4","51","52","26","21","48","53","54"]
+    if (b.indexOf(n) > -1) {
+      if (l) l += ','
+      l += n
+    }
+    return l
+  }
+}

File diff suppressed because it is too large
+ 21566 - 0
src/sites/weapp-project/dist/vendors.js


File diff suppressed because it is too large
+ 1 - 0
src/sites/weapp-project/dist/vendors.js.map


+ 62 - 0
src/sites/weapp-project/package.json

@@ -0,0 +1,62 @@
+{
+  "name": "weapp-project",
+  "version": "1.0.0",
+  "private": true,
+  "description": "",
+  "templateInfo": {
+    "name": "default",
+    "typescript": true,
+    "css": "sass"
+  },
+  "scripts": {
+    "build": "taro build native-components --type weapp --watch",
+    "dev": "taro build --type weapp --watch"
+  },
+  "browserslist": [
+    "last 3 versions",
+    "Android >= 4.1",
+    "ios >= 8"
+  ],
+  "author": "",
+  "dependencies": {
+    "@babel/runtime": "7.7.7",
+    "@tarojs/components": "3.5.7",
+    "@tarojs/helper": "3.5.7",
+    "@tarojs/plugin-framework-vue3": "3.5.7",
+    "@tarojs/plugin-platform-alipay": "3.5.7",
+    "@tarojs/plugin-platform-jd": "3.5.7",
+    "@tarojs/plugin-platform-qq": "3.5.7",
+    "@tarojs/plugin-platform-swan": "3.5.7",
+    "@tarojs/plugin-platform-tt": "3.5.7",
+    "@tarojs/plugin-platform-weapp": "3.5.7",
+    "@tarojs/router": "3.5.7",
+    "@tarojs/runtime": "3.5.7",
+    "@tarojs/shared": "3.5.7",
+    "@tarojs/taro": "3.5.7",
+    "@tarojs/taro-h5": "3.5.7",
+    "vue": "^3.0.0"
+  },
+  "devDependencies": {
+    "@babel/core": "^7.8.0",
+    "@tarojs/cli": "3.5.7",
+    "@tarojs/mini-runner": "3.5.7",
+    "@tarojs/plugin-html": "^3.5.7",
+    "@tarojs/webpack-runner": "3.5.7",
+    "@types/webpack-env": "^1.13.6",
+    "@typescript-eslint/eslint-plugin": "^5.20.0",
+    "@typescript-eslint/parser": "^5.20.0",
+    "@vue/babel-plugin-jsx": "^1.0.6",
+    "@vue/compiler-sfc": "^3.0.0",
+    "babel-plugin-import": "^1.13.5",
+    "babel-preset-taro": "3.5.7",
+    "css-loader": "3.4.2",
+    "eslint": "^8.12.0",
+    "eslint-config-taro": "3.5.7",
+    "eslint-plugin-vue": "^8.0.0",
+    "style-loader": "1.3.0",
+    "stylelint": "^14.4.0",
+    "typescript": "^4.1.0",
+    "vue-loader": "^16.0.0-beta.8",
+    "webpack": "4.46.0"
+  }
+}

+ 24 - 0
src/sites/weapp-project/plugin-mv/index.js

@@ -0,0 +1,24 @@
+const fs = require('fs-extra');
+const path = require('path');
+
+export default (ctx, options) => {
+  ctx.onBuildFinish(() => {
+    const isBuildComponent = ctx.runOpts._[1];
+
+    if (!isBuildComponent) return;
+
+    console.log('编译结束!');
+
+    const rootPath = path.resolve(__dirname, '../..');
+    const miniappPath = path.join(rootPath, 'miniapp');
+    const outputPath = path.resolve(__dirname, '../dist');
+    const destPath = path.join(miniappPath, 'nutui');
+
+    if (fs.existsSync(destPath)) {
+      fs.removeSync(destPath);
+    }
+    fs.copySync(outputPath, destPath);
+
+    console.log('拷贝结束!');
+  });
+};

+ 15 - 0
src/sites/weapp-project/project.config.json

@@ -0,0 +1,15 @@
+{
+  "miniprogramRoot": "./dist",
+  "projectname": "weapp-project",
+  "description": "",
+  "appid": "touristappid",
+  "setting": {
+    "urlCheck": true,
+    "es6": false,
+    "enhance": false,
+    "compileHotReLoad": false,
+    "postcss": false,
+    "minified": false
+  },
+  "compileType": "miniprogram"
+}

+ 9 - 0
src/sites/weapp-project/project.tt.json

@@ -0,0 +1,9 @@
+{
+  "miniprogramRoot": "./",
+  "projectname": "weapp-project",
+  "appid": "testAppId",
+  "setting": {
+    "es6": false,
+    "minified": false
+  }
+}

+ 9 - 0
src/sites/weapp-project/src/app.config.ts

@@ -0,0 +1,9 @@
+export default defineAppConfig({
+  components: ['components/button/index', 'components/nutIcon/index'],
+  window: {
+    backgroundTextStyle: 'light',
+    navigationBarBackgroundColor: '#fff',
+    navigationBarTitleText: 'WeChat',
+    navigationBarTextStyle: 'black'
+  }
+});

+ 0 - 0
src/sites/weapp-project/src/app.scss


+ 9 - 0
src/sites/weapp-project/src/app.ts

@@ -0,0 +1,9 @@
+import { createApp } from 'vue';
+import './app.scss';
+
+const App = createApp({
+  onShow(options) {}
+  // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
+});
+
+export default App;

+ 4 - 0
src/sites/weapp-project/src/components/article/index.config.ts

@@ -0,0 +1,4 @@
+export default {
+  navigationBarTitleText: 'Article',
+  multipleSlots: true
+};

+ 54 - 0
src/sites/weapp-project/src/components/article/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <view>
+    <i :class="classes" :style="styled"></i>
+
+    <!-- <nut-button type="danger">危险按钮</nut-button>
+    <nut-button type="warning">警告按钮</nut-button>
+    <nut-button type="success">成功按钮</nut-button> -->
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { PropType, defineEmits, defineProps, computed } from 'vue';
+import { pxCheck } from '@/packages/utils/pxCheck';
+const props = defineProps({
+  name: { type: String, default: 'loading' },
+  size: { type: [String, Number], default: '' },
+  classPrefix: { type: String, default: 'nut-icon' },
+  fontClassName: { type: String, default: 'nutui-iconfont' },
+  color: { type: String, default: '' },
+  tag: { type: String as PropType<keyof HTMLElementTagNameMap>, default: 'i' }
+});
+
+const emit = defineEmits(['click']);
+const componentName = 'nut-icon';
+
+const isImage = () => {
+  return props.name ? props.name.indexOf('/') !== -1 : false;
+};
+
+const classes = computed(() => {
+  const _isImage = isImage();
+  return _isImage
+    ? `${componentName}__img`
+    : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`;
+});
+
+const styled = computed(() => {
+  return {
+    color: props.color,
+    fontSize: pxCheck(props.size),
+    width: pxCheck(props.size),
+    height: pxCheck(props.size)
+  };
+});
+
+const srcUrl = computed(() => {
+  const _isImage = isImage();
+  return _isImage ? props.name : '';
+});
+</script>
+
+<style lang="scss">
+@import '../nutIcon/index.scss';
+</style>

+ 4 - 0
src/sites/weapp-project/src/components/button/index.config.ts

@@ -0,0 +1,4 @@
+export default {
+  navigationBarTitleText: 'Button',
+  multipleSlots: true
+};

+ 175 - 0
src/sites/weapp-project/src/components/button/index.scss

@@ -0,0 +1,175 @@
+.nut-button {
+  position: relative;
+  display: inline-block;
+  width: auto;
+  flex-shrink: 0;
+  height: $button-default-height;
+  box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+  line-height: $button-default-line-height;
+  font-size: $button-default-font-size;
+  text-align: center;
+  cursor: pointer;
+  transition: opacity 0.2s;
+  appearance: none;
+  user-select: none;
+  touch-action: manipulation;
+  vertical-align: bottom;
+
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+  -webkit-tap-highlight-color: transparent;
+  .text {
+    margin-left: 5px;
+  }
+  &::before {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 100%;
+    height: 100%;
+    background-color: $black;
+    border: inherit;
+    border-color: $black;
+    border-radius: inherit;
+    transform: translate(-50%, -50%);
+    opacity: 0;
+    content: ' ';
+  }
+  &::after {
+    border: none;
+  }
+  &:active::before {
+    opacity: 0.1;
+  }
+  &__warp {
+    height: 100%;
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  &--loading,
+  &--disabled {
+    &::before {
+      display: none;
+    }
+  }
+  &--default {
+    color: $button-default-color;
+    background: $button-default-bg-color;
+    border: $button-border-width solid $button-default-border-color;
+  }
+
+  &--primary {
+    color: $button-primary-color;
+    background: $button-primary-background-color;
+    border: $button-border-width solid transparent;
+  }
+
+  &--info {
+    color: $button-info-color;
+    background: $button-info-background-color;
+    border: $button-border-width solid transparent;
+  }
+
+  &--success {
+    color: $button-success-color;
+    background: $button-success-background-color;
+    border: $button-border-width solid transparent;
+  }
+
+  &--danger {
+    color: $button-danger-color;
+    background: $button-danger-background-color;
+    border: $button-border-width solid transparent;
+  }
+
+  &--warning {
+    color: $button-warning-color;
+    background: $button-warning-background-color;
+    border: $button-border-width solid transparent;
+  }
+
+  &--plain {
+    background: $button-plain-background-color;
+
+    &.nut-button--primary {
+      color: $button-primary-border-color;
+      border-color: $button-primary-border-color;
+    }
+
+    &.nut-button--info {
+      color: $button-info-border-color;
+      border-color: $button-info-border-color;
+    }
+
+    &.nut-button--success {
+      color: $button-success-border-color;
+      border-color: $button-success-border-color;
+    }
+
+    &.nut-button--danger {
+      color: $button-danger-border-color;
+      border-color: $button-danger-border-color;
+    }
+
+    &.nut-button--warning {
+      color: $button-warning-border-color;
+      border-color: $button-warning-border-color;
+    }
+  }
+
+  &--large {
+    width: 100%;
+    height: $button-large-height;
+    line-height: $button-large-line-height;
+    font-size: $button-large-font-size;
+  }
+
+  &--normal {
+    padding: $button-default-padding;
+    font-size: $button-default-font-size;
+  }
+
+  &--small {
+    height: $button-small-height;
+    line-height: $button-small-line-height;
+    padding: $button-small-padding;
+    font-size: $button-small-font-size;
+
+    &.nut-button--round {
+      // border-radius: $button-small-round-border-radius;
+    }
+  }
+  &--mini {
+    height: $button-mini-height;
+    line-height: $button-mini-line-height;
+    padding: $button-mini-padding;
+    font-size: $button-mini-font-size;
+  }
+
+  &--block {
+    display: block;
+    width: 100%;
+  }
+
+  &--disabled {
+    cursor: not-allowed;
+    opacity: $button-disabled-opacity;
+  }
+
+  &--loading {
+    cursor: default;
+    opacity: 0.9;
+  }
+
+  &--round {
+    border-radius: $button-border-radius;
+  }
+
+  &--square {
+    border-radius: 0;
+  }
+}

+ 103 - 0
src/sites/weapp-project/src/components/button/index.vue

@@ -0,0 +1,103 @@
+<template>
+  <view :class="classes" :style="getStyle" @click="handleClick">
+    <view class="nut-button__warp">
+      <nutIcon class="nut-icon-loading" v-if="loading"></nutIcon>
+      <!-- <Article v-if="loading" name="loading"></Article> -->
+      <view :class="{ text: icon || loading }">
+        <native-slot />
+      </view>
+    </view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { CSSProperties, computed, toRefs, defineProps } from 'vue';
+import Article from '../article/index.vue';
+import nutIcon from '../nutIcon/index.vue';
+const props = defineProps({
+  color: String,
+  shape: {
+    type: String,
+    default: 'round'
+  },
+  plain: {
+    type: Boolean,
+    default: false
+  },
+  loading: {
+    type: Boolean,
+    default: false
+  },
+  disabled: {
+    type: Boolean,
+    default: false
+  },
+  type: {
+    type: String,
+    default: 'default'
+  },
+  size: {
+    type: String,
+    default: 'normal'
+  },
+  block: {
+    type: Boolean,
+    default: false
+  },
+  icon: {
+    type: String,
+    default: ''
+  },
+  iconClassPrefix: {
+    type: String,
+    default: 'nut-icon'
+  },
+  iconFontClassName: {
+    type: String,
+    default: 'nutui-iconfont'
+  }
+});
+
+const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
+
+const handleClick = () => {
+  if (!loading.value && !disabled.value) {
+  }
+};
+
+const classes = computed(() => {
+  const prefixCls = 'nut-button';
+  return {
+    [prefixCls]: true,
+    [`${prefixCls}--${type.value}`]: type.value,
+    [`${prefixCls}--${size.value}`]: size.value,
+    [`${prefixCls}--${shape.value}`]: shape.value,
+    [`${prefixCls}--plain`]: plain.value,
+    [`${prefixCls}--block`]: block.value,
+    [`${prefixCls}--disabled`]: disabled.value,
+    [`${prefixCls}--loading`]: loading.value
+  };
+});
+
+const getStyle = computed(() => {
+  const style: CSSProperties = {};
+  if (color?.value) {
+    if (plain.value) {
+      style.color = color.value;
+      style.background = '#fff';
+      if (!color.value?.includes('gradient')) {
+        style.borderColor = color.value;
+      }
+    } else {
+      style.color = '#fff';
+      style.background = color.value;
+    }
+  }
+
+  return style;
+});
+</script>
+
+<style lang="scss">
+@import './index.scss';
+</style>

+ 51 - 0
src/sites/weapp-project/src/components/nutIcon/index copy.vue

@@ -0,0 +1,51 @@
+<template>
+  <i :class="classes" :style="styled" :src="srcUrl"></i>
+</template>
+
+<script lang="ts" setup>
+import { PropType, defineEmits, defineProps, computed } from 'vue';
+import { pxCheck } from '@/packages/utils/pxCheck';
+const props = defineProps({
+  name: { type: String, default: '' },
+  size: { type: [String, Number], default: '' },
+  classPrefix: { type: String, default: 'nut-icon' },
+  fontClassName: { type: String, default: 'nutui-iconfont' },
+  color: { type: String, default: '' },
+  tag: { type: String as PropType<keyof HTMLElementTagNameMap>, default: 'i' }
+});
+
+const emit = defineEmits(['click']);
+const componentName = 'nut-icon';
+const handleClick = (event: Event) => {
+  emit('click', event);
+};
+
+const isImage = () => {
+  return props.name ? props.name.indexOf('/') !== -1 : false;
+};
+
+const classes = computed(() => {
+  const _isImage = isImage();
+  return _isImage
+    ? `${componentName}__img`
+    : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`;
+});
+
+const styled = computed(() => {
+  return {
+    color: props.color,
+    fontSize: pxCheck(props.size),
+    width: pxCheck(props.size),
+    height: pxCheck(props.size)
+  };
+});
+
+const srcUrl = computed(() => {
+  const _isImage = isImage();
+  return _isImage ? props.name : '';
+});
+</script>
+
+<style lang="scss">
+@import './index.scss';
+</style>

+ 4 - 0
src/sites/weapp-project/src/components/nutIcon/index.config.ts

@@ -0,0 +1,4 @@
+export default {
+  navigationBarTitleText: 'Icon',
+  multipleSlots: true
+};

+ 131 - 0
src/sites/weapp-project/src/components/nutIcon/index.scss

@@ -0,0 +1,131 @@
+@import '../../../../../packages/styles/font/iconfont.css';
+
+.nut-icon {
+  display: inline-block;
+  position: relative;
+  width: $icon-width;
+  height: $icon-height;
+  line-height: $icon-line-height;
+  text-align: right;
+
+  &::before {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+  }
+
+  &__img {
+    width: $icon-width;
+    height: $icon-height;
+    object-fit: contain;
+  }
+  &-loading,
+  &-loading1 {
+    display: inline-block;
+    animation: rotation 1s infinite linear;
+  }
+
+  --animate-duration: 1s;
+  --animate-delay: 0s;
+
+  &-am-infinite {
+    -webkit-animation-iteration-count: infinite;
+    -webkit-animation-direction: alternate;
+    animation-iteration-count: infinite;
+    animation-direction: alternate;
+  }
+  &-am-jump {
+    -webkit-animation-name: nutJumpOne;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: nutJumpOne;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: ease;
+    animation-delay: var(--animate-delay);
+
+    &.nut-icon-am-infinite {
+      -webkit-animation-name: nutJump;
+      animation-name: nutJump;
+    }
+  }
+
+  &-am-rotate {
+    -webkit-animation-name: rotation;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: linear;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: rotation;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: linear;
+    animation-delay: var(--animate-delay);
+
+    &.nut-icon-am-infinite {
+      -webkit-animation-direction: normal;
+      animation-direction: normal;
+    }
+  }
+  &-am-blink {
+    -webkit-animation-name: nutBlink;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease-in-out;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: nutBlink;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: linear;
+    animation-delay: var(--animate-delay);
+  }
+  &-am-breathe {
+    -webkit-animation-name: nutBreathe;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease-in-out;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: nutBreathe;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: ease-in-out;
+    animation-delay: var(--animate-delay);
+  }
+  &-am-flash {
+    -webkit-animation-name: nutFlash;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease-in-out;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: nutFlash;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: ease-in-out;
+    animation-delay: var(--animate-delay);
+  }
+  &-am-bounce {
+    -webkit-animation-name: nutBounce;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease-in-out;
+    -webkit-animation-delay: var(--animate-delay);
+    animation-name: nutBounce;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: ease-in-out;
+    animation-delay: var(--animate-delay);
+
+    &.nut-icon-am-infinite {
+      -webkit-animation-direction: normal;
+      animation-direction: normal;
+    }
+  }
+
+  &-am-shake {
+    -webkit-animation-name: nutShake;
+    -webkit-animation-duration: var(--animate-duration);
+    -webkit-animation-timing-function: ease-in-out;
+    -webkit-animation-delay: var(--animate-delay);
+
+    animation-name: nutShake;
+    animation-duration: var(--animate-duration);
+    animation-timing-function: ease-in-out;
+    animation-delay: var(--animate-delay);
+  }
+}

+ 50 - 0
src/sites/weapp-project/src/components/nutIcon/index.vue

@@ -0,0 +1,50 @@
+<template>
+  <view>
+    <i :class="classes" :style="styled"></i>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { PropType, defineEmits, defineProps, computed } from 'vue';
+import { pxCheck } from '@/packages/utils/pxCheck';
+const props = defineProps({
+  name: { type: String, default: 'loading' },
+  size: { type: [String, Number], default: '' },
+  classPrefix: { type: String, default: 'nut-icon' },
+  fontClassName: { type: String, default: 'nutui-iconfont' },
+  color: { type: String, default: '' },
+  tag: { type: String as PropType<keyof HTMLElementTagNameMap>, default: 'i' }
+});
+
+const emit = defineEmits(['click']);
+const componentName = 'nut-icon';
+
+const isImage = () => {
+  return props.name ? props.name.indexOf('/') !== -1 : false;
+};
+
+const classes = computed(() => {
+  const _isImage = isImage();
+  return _isImage
+    ? `${componentName}__img`
+    : `${props.fontClassName} ${componentName} ${props.classPrefix}-${props.name}`;
+});
+
+const styled = computed(() => {
+  return {
+    color: props.color,
+    fontSize: pxCheck(props.size),
+    width: pxCheck(props.size),
+    height: pxCheck(props.size)
+  };
+});
+
+const srcUrl = computed(() => {
+  const _isImage = isImage();
+  return _isImage ? props.name : '';
+});
+</script>
+
+<style lang="scss">
+@import '../icon/index.scss';
+</style>

+ 17 - 0
src/sites/weapp-project/src/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+  <meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
+  <meta name="apple-mobile-web-app-capable" content="yes">
+  <meta name="apple-touch-fullscreen" content="yes">
+  <meta name="format-detection" content="telephone=no,address=no">
+  <meta name="apple-mobile-web-app-status-bar-style" content="white">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
+  <title>weapp-project</title>
+  <script><%= htmlWebpackPlugin.options.script %></script>
+</head>
+<body>
+  <div id="app"></div>
+</body>
+</html>

+ 25 - 0
src/sites/weapp-project/tsconfig.json

@@ -0,0 +1,25 @@
+{
+  "compilerOptions": {
+    "target": "es2017",
+    "module": "commonjs",
+    "removeComments": false,
+    "preserveConstEnums": true,
+    "moduleResolution": "node",
+    "experimentalDecorators": true,
+    "noImplicitAny": false,
+    "allowSyntheticDefaultImports": true,
+    "outDir": "lib",
+    "noUnusedLocals": true,
+    "noUnusedParameters": true,
+    "strictNullChecks": true,
+    "sourceMap": true,
+    "baseUrl": ".",
+    "rootDir": ".",
+    "jsx": "preserve",
+    "allowJs": true,
+    "resolveJsonModule": true,
+    "typeRoots": ["node_modules/@types"]
+  },
+  "include": ["./src", "./types"],
+  "compileOnSave": false
+}

+ 22 - 0
src/sites/weapp-project/types/global.d.ts

@@ -0,0 +1,22 @@
+/// <reference types="@tarojs/taro" />
+
+declare module '*.png';
+declare module '*.gif';
+declare module '*.jpg';
+declare module '*.jpeg';
+declare module '*.svg';
+declare module '*.css';
+declare module '*.less';
+declare module '*.scss';
+declare module '*.sass';
+declare module '*.styl';
+
+declare namespace NodeJS {
+  interface ProcessEnv {
+    TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd';
+  }
+}
+
+declare module '@tarojs/components' {
+  export * from '@tarojs/components/types/index.vue3';
+}