chenlei 2 anni fa
commit
477153d1cd
100 ha cambiato i file con 2977 aggiunte e 0 eliminazioni
  1. 10 0
      apis/createPhoto.js
  2. 79 0
      apis/fetcher/request.js
  3. 19 0
      app.js
  4. 11 0
      app.json
  5. 17 0
      app.wxss
  6. BIN
      assets/fonts/download (1).zip
  7. 539 0
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/demo.css
  8. 465 0
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/demo_index.html
  9. 64 0
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.css
  10. 1 0
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.js
  11. 93 0
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.json
  12. BIN
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.ttf
  13. BIN
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.woff
  14. BIN
      assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.woff2
  15. BIN
      assets/fonts/iconfont.eot
  16. 1 0
      assets/fonts/iconfont.js
  17. 93 0
      assets/fonts/iconfont.json
  18. 85 0
      assets/fonts/iconfont.svg
  19. BIN
      assets/fonts/iconfont.ttf
  20. BIN
      assets/fonts/iconfont.woff
  21. BIN
      assets/fonts/iconfont.woff2
  22. 64 0
      assets/fonts/iconfont.wxss
  23. 37 0
      components/frame-animation/frame-animation.js
  24. 4 0
      components/frame-animation/frame-animation.json
  25. 1 0
      components/frame-animation/frame-animation.wxml
  26. 17 0
      components/frame-animation/frame-animation.wxss
  27. 24 0
      components/frame-animation/readme.md
  28. 36 0
      components/toast/index.js
  29. 4 0
      components/toast/index.json
  30. 17 0
      components/toast/index.wxml
  31. 41 0
      components/toast/index.wxss
  32. 68 0
      components/toast/toast.js
  33. 1 0
      components/vant-ui/cell-group/index.d.ts
  34. 10 0
      components/vant-ui/cell-group/index.js
  35. 3 0
      components/vant-ui/cell-group/index.json
  36. 9 0
      components/vant-ui/cell-group/index.wxml
  37. 1 0
      components/vant-ui/cell-group/index.wxss
  38. 1 0
      components/vant-ui/cell/index.d.ts
  39. 37 0
      components/vant-ui/cell/index.js
  40. 6 0
      components/vant-ui/cell/index.json
  41. 45 0
      components/vant-ui/cell/index.wxml
  42. 1 0
      components/vant-ui/cell/index.wxss
  43. 7 0
      components/vant-ui/common/color.d.ts
  44. 7 0
      components/vant-ui/common/color.js
  45. 3 0
      components/vant-ui/common/component.d.ts
  46. 101 0
      components/vant-ui/common/component.js
  47. 1 0
      components/vant-ui/common/index.wxss
  48. 1 0
      components/vant-ui/common/style/clearfix.wxss
  49. 1 0
      components/vant-ui/common/style/ellipsis.wxss
  50. 1 0
      components/vant-ui/common/style/hairline.wxss
  51. 0 0
      components/vant-ui/common/style/mixins/clearfix.wxss
  52. 0 0
      components/vant-ui/common/style/mixins/ellipsis.wxss
  53. 0 0
      components/vant-ui/common/style/mixins/hairline.wxss
  54. 0 0
      components/vant-ui/common/style/theme.wxss
  55. 0 0
      components/vant-ui/common/style/var.wxss
  56. 8 0
      components/vant-ui/common/utils.d.ts
  57. 32 0
      components/vant-ui/common/utils.js
  58. 1 0
      components/vant-ui/icon/index.d.ts
  59. 27 0
      components/vant-ui/icon/index.js
  60. 6 0
      components/vant-ui/icon/index.json
  61. 20 0
      components/vant-ui/icon/index.wxml
  62. 1 0
      components/vant-ui/icon/index.wxss
  63. 1 0
      components/vant-ui/info/index.d.ts
  64. 8 0
      components/vant-ui/info/index.js
  65. 3 0
      components/vant-ui/info/index.json
  66. 7 0
      components/vant-ui/info/index.wxml
  67. 1 0
      components/vant-ui/info/index.wxss
  68. 1 0
      components/vant-ui/loading/index.d.ts
  69. 16 0
      components/vant-ui/loading/index.js
  70. 3 0
      components/vant-ui/loading/index.json
  71. 18 0
      components/vant-ui/loading/index.wxml
  72. 1 0
      components/vant-ui/loading/index.wxss
  73. 26 0
      components/vant-ui/mixins/basic
  74. 26 0
      components/vant-ui/mixins/basic.js
  75. 17 0
      components/vant-ui/mixins/link.js
  76. 28 0
      components/vant-ui/mixins/page-scroll.js
  77. 35 0
      components/vant-ui/mixins/touch.js
  78. 118 0
      components/vant-ui/mixins/transition.js
  79. 1 0
      components/vant-ui/overlay/index.d.ts
  80. 22 0
      components/vant-ui/overlay/index.js
  81. 6 0
      components/vant-ui/overlay/index.json
  82. 10 0
      components/vant-ui/overlay/index.wxml
  83. 1 0
      components/vant-ui/overlay/index.wxss
  84. 1 0
      components/vant-ui/picker-column/index.d.ts
  85. 117 0
      components/vant-ui/picker-column/index.js
  86. 3 0
      components/vant-ui/picker-column/index.json
  87. 22 0
      components/vant-ui/picker-column/index.wxml
  88. 8 0
      components/vant-ui/picker-column/index.wxs
  89. 1 0
      components/vant-ui/picker-column/index.wxss
  90. 1 0
      components/vant-ui/picker/index.d.ts
  91. 135 0
      components/vant-ui/picker/index.js
  92. 7 0
      components/vant-ui/picker/index.json
  93. 41 0
      components/vant-ui/picker/index.wxml
  94. 1 0
      components/vant-ui/picker/index.wxss
  95. 21 0
      components/vant-ui/picker/shared.d.ts
  96. 21 0
      components/vant-ui/picker/shared.js
  97. 28 0
      components/vant-ui/picker/toolbar.wxml
  98. 1 0
      components/vant-ui/sticky/index.d.ts
  99. 99 0
      components/vant-ui/sticky/index.js
  100. 0 0
      components/vant-ui/sticky/index.json

+ 10 - 0
apis/createPhoto.js

@@ -0,0 +1,10 @@
+import request from './fetcher/request'
+
+export default {
+  /*
+  ** 上传图片
+  */ 
+  uploadToCreate (data) {
+    return request.get(`api/uploadFaceSwap/${type}`, data)
+  }
+}

+ 79 - 0
apis/fetcher/request.js

@@ -0,0 +1,79 @@
+import { API_BASE_URL } from './../../config/config'
+const BASE_URL = `${API_BASE_URL}/app/`
+// 需要登录的错误码
+const needLoginErrorCode = [3018, 3019]
+
+Promise.prototype.finally = function (callback) {
+  var Promise = this.constructor;
+  return this.then(
+      function (value) {
+          Promise.resolve(callback()).then(
+              function () {
+                  return value;
+              }
+          );
+      },
+      function (reason) {
+          Promise.resolve(callback()).then(
+              function () {
+                  throw reason;
+              }
+          );
+      }
+  );
+}
+
+function request (url, options) {
+  return new Promise((resolve, reject) => {
+    wx.request(Object.assign({
+      url: url.indexOf('://') == -1 ? BASE_URL + url : url,
+      method: options.method,
+      data: options.data,
+      header: options.header || {},
+      // header: {
+      //   token: app.globalData.token
+      // },
+      success (res) {
+        console.log(res.data, '请求成功')
+        if (res.data.code == 0 || res.data.code == 200 || res.data.errno === 0) {
+          resolve(res.data)
+        } else if (needLoginErrorCode.indexOf(Number(res.data.code)) !== -1) {
+          wx.navigateTo({
+            url: `/pages/login/login`
+          })
+        } else {
+          
+          reject(res)
+        }
+      },
+      fail (err) {
+        console.log(err, '请求失败')
+        reject(err)
+      }
+    }, options))
+    setTimeout(() => reject('time out'), 5000)
+  })
+}
+
+function get (url, data, options = {}) {
+  options.method = 'GET'
+  options.data = data
+  return request(url, options)
+}
+
+function post (url, data = {}, options = {}) {
+  options.method = 'POST'
+  // token和user_ID放在url上, 后续后端再做优化
+  const app = getApp();
+  url += `?token=${getApp().globalData.token || ''}&viewerId=${getApp().globalData.userinfo.viewerId}`
+  options.data = Object.assign({
+    user_id: app.globalData.userinfo.user_id
+  }, data)
+  return request(url, options)
+}
+
+export default {
+  request,
+  get,
+  post
+}

+ 19 - 0
app.js

@@ -0,0 +1,19 @@
+// app.js
+import { app } from "./config/index";
+
+App({
+  onLaunch() {
+    let info = wx.getSystemInfoSync()
+    this.globalData.deviceInfo = info
+    this.globalData.top = wx.getMenuButtonBoundingClientRect()
+  },
+  globalData: {
+    userInfo: null,
+    m_file: null,
+    scenes:[]
+  },
+
+  onHide(){
+    app.websocket && app.send('close')
+  }
+})

+ 11 - 0
app.json

@@ -0,0 +1,11 @@
+{
+  "pages": ["pages/index/index", "pages/work/index"],
+  "window": {
+    "backgroundTextStyle": "light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "四维随心播",
+    "navigationBarTextStyle": "black"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json"
+}

+ 17 - 0
app.wxss

@@ -0,0 +1,17 @@
+/**app.wxss**/
+page{
+  min-height: 100%;
+  height: 100%;
+  background: #ffffff;
+  -webkit-overflow-scrolling : touch;
+}
+.container {
+  padding: 0;
+  width: 100%;
+  height: 100%;
+} 
+
+.hidden{
+  pointer-events: none;
+  opacity: 0;
+}

BIN
assets/fonts/download (1).zip


+ 539 - 0
assets/fonts/download (1)/font_2532543_pbwla2drc6s/demo.css

@@ -0,0 +1,539 @@
+/* Logo 字体 */
+@font-face {
+  font-family: "iconfont logo";
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
+}
+
+.logo {
+  font-family: "iconfont logo";
+  font-size: 160px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+/* tabs */
+.nav-tabs {
+  position: relative;
+}
+
+.nav-tabs .nav-more {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  height: 42px;
+  line-height: 42px;
+  color: #666;
+}
+
+#tabs {
+  border-bottom: 1px solid #eee;
+}
+
+#tabs li {
+  cursor: pointer;
+  width: 100px;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  font-size: 16px;
+  border-bottom: 2px solid transparent;
+  position: relative;
+  z-index: 1;
+  margin-bottom: -1px;
+  color: #666;
+}
+
+
+#tabs .active {
+  border-bottom-color: #f00;
+  color: #222;
+}
+
+.tab-container .content {
+  display: none;
+}
+
+/* 页面布局 */
+.main {
+  padding: 30px 100px;
+  width: 960px;
+  margin: 0 auto;
+}
+
+.main .logo {
+  color: #333;
+  text-align: left;
+  margin-bottom: 30px;
+  line-height: 1;
+  height: 110px;
+  margin-top: -50px;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.main .logo a {
+  font-size: 160px;
+  color: #333;
+}
+
+.helps {
+  margin-top: 40px;
+}
+
+.helps pre {
+  padding: 20px;
+  margin: 10px 0;
+  border: solid 1px #e7e1cd;
+  background-color: #fffdef;
+  overflow: auto;
+}
+
+.icon_lists {
+  width: 100% !important;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.icon_lists li {
+  width: 100px;
+  margin-bottom: 10px;
+  margin-right: 20px;
+  text-align: center;
+  list-style: none !important;
+  cursor: default;
+}
+
+.icon_lists li .code-name {
+  line-height: 1.2;
+}
+
+.icon_lists .icon {
+  display: block;
+  height: 100px;
+  line-height: 100px;
+  font-size: 42px;
+  margin: 10px auto;
+  color: #333;
+  -webkit-transition: font-size 0.25s linear, width 0.25s linear;
+  -moz-transition: font-size 0.25s linear, width 0.25s linear;
+  transition: font-size 0.25s linear, width 0.25s linear;
+}
+
+.icon_lists .icon:hover {
+  font-size: 100px;
+}
+
+.icon_lists .svg-icon {
+  /* 通过设置 font-size 来改变图标大小 */
+  width: 1em;
+  /* 图标和文字相邻时,垂直对齐 */
+  vertical-align: -0.15em;
+  /* 通过设置 color 来改变 SVG 的颜色/fill */
+  fill: currentColor;
+  /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
+      normalize.css 中也包含这行 */
+  overflow: hidden;
+}
+
+.icon_lists li .name,
+.icon_lists li .code-name {
+  color: #666;
+}
+
+/* markdown 样式 */
+.markdown {
+  color: #666;
+  font-size: 14px;
+  line-height: 1.8;
+}
+
+.highlight {
+  line-height: 1.5;
+}
+
+.markdown img {
+  vertical-align: middle;
+  max-width: 100%;
+}
+
+.markdown h1 {
+  color: #404040;
+  font-weight: 500;
+  line-height: 40px;
+  margin-bottom: 24px;
+}
+
+.markdown h2,
+.markdown h3,
+.markdown h4,
+.markdown h5,
+.markdown h6 {
+  color: #404040;
+  margin: 1.6em 0 0.6em 0;
+  font-weight: 500;
+  clear: both;
+}
+
+.markdown h1 {
+  font-size: 28px;
+}
+
+.markdown h2 {
+  font-size: 22px;
+}
+
+.markdown h3 {
+  font-size: 16px;
+}
+
+.markdown h4 {
+  font-size: 14px;
+}
+
+.markdown h5 {
+  font-size: 12px;
+}
+
+.markdown h6 {
+  font-size: 12px;
+}
+
+.markdown hr {
+  height: 1px;
+  border: 0;
+  background: #e9e9e9;
+  margin: 16px 0;
+  clear: both;
+}
+
+.markdown p {
+  margin: 1em 0;
+}
+
+.markdown>p,
+.markdown>blockquote,
+.markdown>.highlight,
+.markdown>ol,
+.markdown>ul {
+  width: 80%;
+}
+
+.markdown ul>li {
+  list-style: circle;
+}
+
+.markdown>ul li,
+.markdown blockquote ul>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown>ul li p,
+.markdown>ol li p {
+  margin: 0.6em 0;
+}
+
+.markdown ol>li {
+  list-style: decimal;
+}
+
+.markdown>ol li,
+.markdown blockquote ol>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown code {
+  margin: 0 3px;
+  padding: 0 5px;
+  background: #eee;
+  border-radius: 3px;
+}
+
+.markdown strong,
+.markdown b {
+  font-weight: 600;
+}
+
+.markdown>table {
+  border-collapse: collapse;
+  border-spacing: 0px;
+  empty-cells: show;
+  border: 1px solid #e9e9e9;
+  width: 95%;
+  margin-bottom: 24px;
+}
+
+.markdown>table th {
+  white-space: nowrap;
+  color: #333;
+  font-weight: 600;
+}
+
+.markdown>table th,
+.markdown>table td {
+  border: 1px solid #e9e9e9;
+  padding: 8px 16px;
+  text-align: left;
+}
+
+.markdown>table th {
+  background: #F7F7F7;
+}
+
+.markdown blockquote {
+  font-size: 90%;
+  color: #999;
+  border-left: 4px solid #e9e9e9;
+  padding-left: 0.8em;
+  margin: 1em 0;
+}
+
+.markdown blockquote p {
+  margin: 0;
+}
+
+.markdown .anchor {
+  opacity: 0;
+  transition: opacity 0.3s ease;
+  margin-left: 8px;
+}
+
+.markdown .waiting {
+  color: #ccc;
+}
+
+.markdown h1:hover .anchor,
+.markdown h2:hover .anchor,
+.markdown h3:hover .anchor,
+.markdown h4:hover .anchor,
+.markdown h5:hover .anchor,
+.markdown h6:hover .anchor {
+  opacity: 1;
+  display: inline-block;
+}
+
+.markdown>br,
+.markdown>p>br {
+  clear: both;
+}
+
+
+.hljs {
+  display: block;
+  background: white;
+  padding: 0.5em;
+  color: #333333;
+  overflow-x: auto;
+}
+
+.hljs-comment,
+.hljs-meta {
+  color: #969896;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-strong,
+.hljs-emphasis,
+.hljs-quote {
+  color: #df5000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+  color: #a71d5d;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute {
+  color: #0086b3;
+}
+
+.hljs-section,
+.hljs-name {
+  color: #63a35c;
+}
+
+.hljs-tag {
+  color: #333333;
+}
+
+.hljs-title,
+.hljs-attr,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+  color: #795da3;
+}
+
+.hljs-addition {
+  color: #55a532;
+  background-color: #eaffea;
+}
+
+.hljs-deletion {
+  color: #bd2c00;
+  background-color: #ffecec;
+}
+
+.hljs-link {
+  text-decoration: underline;
+}
+
+/* 代码高亮 */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+code[class*="language-"],
+pre[class*="language-"] {
+  color: black;
+  background: none;
+  text-shadow: 0 1px white;
+  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+  text-align: left;
+  white-space: pre;
+  word-spacing: normal;
+  word-break: normal;
+  word-wrap: normal;
+  line-height: 1.5;
+
+  -moz-tab-size: 4;
+  -o-tab-size: 4;
+  tab-size: 4;
+
+  -webkit-hyphens: none;
+  -moz-hyphens: none;
+  -ms-hyphens: none;
+  hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection,
+pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection,
+code[class*="language-"] ::-moz-selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection,
+pre[class*="language-"] ::selection,
+code[class*="language-"]::selection,
+code[class*="language-"] ::selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+@media print {
+
+  code[class*="language-"],
+  pre[class*="language-"] {
+    text-shadow: none;
+  }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+  padding: 1em;
+  margin: .5em 0;
+  overflow: auto;
+}
+
+:not(pre)>code[class*="language-"],
+pre[class*="language-"] {
+  background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre)>code[class*="language-"] {
+  padding: .1em;
+  border-radius: .3em;
+  white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+  color: slategray;
+}
+
+.token.punctuation {
+  color: #999;
+}
+
+.namespace {
+  opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+  color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+  color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+  color: #9a6e3a;
+  background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+  color: #07a;
+}
+
+.token.function,
+.token.class-name {
+  color: #DD4A68;
+}
+
+.token.regex,
+.token.important,
+.token.variable {
+  color: #e90;
+}
+
+.token.important,
+.token.bold {
+  font-weight: bold;
+}
+
+.token.italic {
+  font-style: italic;
+}
+
+.token.entity {
+  cursor: help;
+}

File diff suppressed because it is too large
+ 465 - 0
assets/fonts/download (1)/font_2532543_pbwla2drc6s/demo_index.html


File diff suppressed because it is too large
+ 64 - 0
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.css


File diff suppressed because it is too large
+ 1 - 0
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.js


+ 93 - 0
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.json

@@ -0,0 +1,93 @@
+{
+  "id": "2532543",
+  "name": "AI换装系统",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "22360983",
+      "name": "返 回",
+      "font_class": "fanhui",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "21889412",
+      "name": "重新拍照",
+      "font_class": "zhongxinpaizhao",
+      "unicode": "e616",
+      "unicode_decimal": 58902
+    },
+    {
+      "icon_id": "6282761",
+      "name": "拍照",
+      "font_class": "paizhao",
+      "unicode": "e6b4",
+      "unicode_decimal": 59060
+    },
+    {
+      "icon_id": "21465986",
+      "name": "反转相机 (1)",
+      "font_class": "fanzhuanxiangji1",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "21465993",
+      "name": "相机",
+      "font_class": "xiangji",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "21465994",
+      "name": "重新拍照(圆)",
+      "font_class": "zhongxinpaizhaoyuan",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "21465997",
+      "name": "反转相机",
+      "font_class": "fanzhuanxiangji",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "21439773",
+      "name": "返 回",
+      "font_class": "fanhui1",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "21439775",
+      "name": "取消",
+      "font_class": "quxiao",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "21439776",
+      "name": "朋友圈",
+      "font_class": "pengyouquan",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "21439777",
+      "name": "下载 ",
+      "font_class": "xiazai",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "21439779",
+      "name": "照片 ",
+      "font_class": "zhaopian",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    }
+  ]
+}

BIN
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.ttf


BIN
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.woff


BIN
assets/fonts/download (1)/font_2532543_pbwla2drc6s/iconfont.woff2


BIN
assets/fonts/iconfont.eot


File diff suppressed because it is too large
+ 1 - 0
assets/fonts/iconfont.js


+ 93 - 0
assets/fonts/iconfont.json

@@ -0,0 +1,93 @@
+{
+  "id": "2532543",
+  "name": "AI换装系统",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "22360983",
+      "name": "返 回",
+      "font_class": "fanhui",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "21889412",
+      "name": "重新拍照",
+      "font_class": "zhongxinpaizhao",
+      "unicode": "e616",
+      "unicode_decimal": 58902
+    },
+    {
+      "icon_id": "6282761",
+      "name": "拍照",
+      "font_class": "paizhao",
+      "unicode": "e6b4",
+      "unicode_decimal": 59060
+    },
+    {
+      "icon_id": "21465986",
+      "name": "反转相机 (1)",
+      "font_class": "fanzhuanxiangji1",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "21465993",
+      "name": "相机",
+      "font_class": "xiangji",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "21465994",
+      "name": "重新拍照(圆)",
+      "font_class": "zhongxinpaizhaoyuan",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "21465997",
+      "name": "反转相机",
+      "font_class": "fanzhuanxiangji",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "21439773",
+      "name": "返 回",
+      "font_class": "fanhui1",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "21439775",
+      "name": "取消",
+      "font_class": "quxiao",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "21439776",
+      "name": "朋友圈",
+      "font_class": "pengyouquan",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "21439777",
+      "name": "下载 ",
+      "font_class": "xiazai",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "21439779",
+      "name": "照片 ",
+      "font_class": "zhaopian",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    }
+  ]
+}

+ 85 - 0
assets/fonts/iconfont.svg

@@ -0,0 +1,85 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
+<metadata>
+Created by FontForge 20170731 at Mon Jun 21 10:36:30 2021
+ By Aleksey,,,
+
+Created by iconfont
+
+</metadata>
+<defs>
+<font id="iconfont" horiz-adv-x="1024" >
+  <font-face 
+    font-family="iconfont"
+    font-weight="500"
+    font-stretch="normal"
+    units-per-em="1024"
+    panose-1="2 0 5 3 0 0 0 0 0 0"
+    ascent="896"
+    descent="-128"
+    bbox="0 -128 1200 896"
+    underline-thickness="0"
+    underline-position="10"
+    unicode-range="U+E605-E6B4"
+  />
+<missing-glyph 
+ />
+    <glyph glyph-name=".notdef" 
+ />
+    <glyph glyph-name=".null" horiz-adv-x="0" 
+ />
+    <glyph glyph-name="nonmarkingreturn" horiz-adv-x="341" 
+ />
+    <glyph glyph-name="fanhui" unicode="&#xe605;" 
+d="M512 384zM0 384q0 -104 40 -199q39 -92 110 -163t163 -110q95 -40 199 -40t199 40q92 39 163 110t110 163q40 95 40 199t-40 199q-39 92 -110 163t-163 110q-95 40 -199 40t-199 -40q-92 -39 -163 -110t-110 -163q-40 -95 -40 -199zM613 66q-9 0 -18 6l-318 296
+q-8 7 -8 16.5t8 16.5l319 295q8 7 18 7t17.5 -7t7.5 -16.5t-8 -16.5l-301 -279l301 -279q8 -6 8 -16t-8 -16.5t-18 -6.5zM613 40q-18 0 -34 12l-319 297q-16 14 -16 35.5t16 34.5l318 296q15 13 35.5 13t35.5 -14t15 -35t-16 -35l-280 -260l280 -260q16 -14 16 -35.5
+t-15 -35t-36 -13.5zM614 87zM294 382zM294 387zM613 681z" />
+    <glyph glyph-name="quxiao" unicode="&#xe607;" 
+d="M512 768q104 0 193 -53q87 -51 138 -138q53 -89 53 -193t-53 -193q-51 -87 -138 -138q-89 -53 -193 -53t-193 53q-87 51 -138 138q-53 89 -53 193t53 193q51 87 138 138q89 53 193 53zM512 832q-123 0 -227 -61q-101 -59 -160 -160q-61 -104 -61 -227t61 -227
+q59 -101 160 -160q104 -61 227 -61t227 61q101 59 160 160q61 104 61 227t-61 227q-59 101 -160 160q-104 61 -227 61zM646 563l-134 -134l-134 134q-10 10 -23 10t-22.5 -9.5t-9.5 -22.5t10 -23l134 -134l-134 -134q-10 -10 -10 -23t9.5 -22.5t22.5 -9.5t23 10l134 134
+l134 -134q10 -10 23 -10t22.5 9.5t9.5 22.5t-10 23l-134 134l134 134q10 10 10 23t-9.5 22.5t-22.5 9.5t-23 -10z" />
+    <glyph glyph-name="pengyouquan" unicode="&#xe608;" 
+d="M683 868l-22 8q-27 8 -59 13q-44 7 -90 7t-90 -8q-31 -6 -59 -15l-22 -9l342 -347v351zM876 743q-34 32 -72 57q-27 18 -55 31l-21 9l-3 -476l256 242v1q-11 21 -28 46q-33 48 -77 90zM992 559l-352 -336h356l7 21q9 27 14 59q7 43 7 88t-9 89q-6 31 -15 58zM736 -72
+q11 5 21 10q26 13 53 32q37 25 70 56t59 67q19 26 32 51q11 20 10 20l-498 3zM341 -100l22 -8q28 -8 59 -13q44 -7 90 -7t90 8q32 6 59 15l22 9l-342 347v-351zM162 25q34 -32 72 -57q28 -18 55 -31l22 -9l2 477l-256 -242l11 -20q14 -25 34 -50q27 -36 60 -68zM28 559
+q-4 -10 -7 -21q-9 -27 -14 -58q-7 -44 -7 -89q0 -63 16 -122q8 -29 16 -46v0l352 336h-356zM301 840l-20 -10q-26 -13 -53 -32q-37 -25 -70 -56t-59 -67q-19 -26 -32 -51l-10 -20l498 -3z" />
+    <glyph glyph-name="xiazai" unicode="&#xe609;" 
+d="M512 896q-104 0 -199 -40q-92 -39 -163 -110t-110 -163q-40 -95 -40 -199t40 -199q39 -92 110 -163t163 -110q95 -40 199 -40t199 40q92 39 163 110t110 163q40 95 40 199t-40 199q-39 92 -110 163t-163 110q-95 40 -199 40zM303 494q11 10 26 10t26 -10l120 -121v314
+q0 15 11 26t26 11t26 -11t11 -26v-314l120 120q11 11 26 11t26 -10.5t11 -26t-11 -25.5l-183 -183q-11 -11 -26 -11t-26 11l-183 183q-11 10 -11 25.5t11 25.5v1zM748 143h-472q-16 0 -27.5 11.5t-11.5 27.5t11.5 27.5t27.5 11.5h472q16 0 27.5 -11.5t11 -27.5t-11.5 -27.5
+t-27 -11.5z" />
+    <glyph glyph-name="zhaopian" unicode="&#xe60b;" 
+d="M681 703q-28 0 -52 -14t-38 -38t-14 -52.5t14 -52.5t38 -38t52 -14t52 14t38 38t14 52.5t-14 52.5t-38 38t-52 14zM681 535q-26 0 -45 18.5t-19 45t19 45t45 18.5t44.5 -18.5t18.5 -45t-18.5 -45t-44.5 -18.5zM513 893q-104 0 -199 -40q-91 -39 -161.5 -109.5
+t-109.5 -161.5q-40 -95 -40 -198.5t40 -198.5q39 -91 109.5 -161.5t161.5 -109.5q95 -40 198.5 -40t198.5 40q91 39 161.5 109.5t109.5 161.5q40 95 40 198.5t-40 198.5q-39 91 -109.5 161.5t-162.5 109.5q-94 40 -197 40zM513 -85q-99 0 -188 39q-87 38 -152.5 107
+t-98.5 158l296 295l356 -356q6 -6 14.5 -6t14.5 6t6 14.5t-6 14.5l-74 74l155 154l133 -133q-23 -104 -89 -188t-160 -130q-98 -49 -207 -49zM850 459q-6 6 -14.5 6t-13.5 -6l-169 -169l-269 268q-6 6 -14.5 6t-14.5 -6l-295 -296q-16 60 -16 121q0 127 64 236
+q62 106 168 168q109 64 236.5 64t236.5 -64q106 -62 168 -168q64 -109 64 -236q0 -26 -3 -52z" />
+    <glyph glyph-name="fanzhuanxiangji1" unicode="&#xe60c;" 
+d="M701 554h-43l-12 35q-7 21 -24.5 34t-39.5 13h-142q-22 0 -39.5 -13t-23.5 -34l-12 -35h-42q-30 0 -54.5 -15t-39 -39.5t-14.5 -54.5v-204q0 -29 14.5 -54t39 -40t54.5 -15h378q29 0 54 15t39.5 40t14.5 54v204q0 30 -14.5 55t-39.5 39.5t-54 14.5zM769 241
+q0 -28 -19.5 -48t-47.5 -20h-379q-28 0 -48 19.5t-20 47.5v205q0 28 19 48t47 20h73l22 64q3 8 10 13.5t16 5.5h142q8 0 15.5 -5t9.5 -14l22 -64h70q28 0 48 -19.5t20 -47.5v-205v0zM642 298q-16 -35 -46 -57t-67.5 -26.5t-71.5 10.5q-41 18 -64 55l-22 -7l19 83l62 -59
+l-18 -5q14 -18 34.5 -28t43.5 -10q30 0 55.5 17t37.5 45q3 8 11 11t15.5 -1t10.5 -12t0 -16zM634 431l20 5l-20 -79l-59 56l18 5q-16 22 -41 32.5t-51.5 7.5t-47.5 -19q-19 -13 -30 -35q-4 -7 -12 -9.5t-15 1.5t-9.5 12t1.5 15q18 36 52 56.5t74 20.5q36 0 68.5 -19
+t51.5 -50zM512 -127q-104 0 -199 40q-92 39 -162.5 110t-109.5 163q-40 95 -40 198.5t40 198.5q39 92 109.5 163t162.5 110q95 40 199 40t199 -40q92 -39 162.5 -110t109.5 -163q40 -95 40 -198.5t-40 -198.5q-39 -92 -109.5 -163t-162.5 -110q-95 -40 -199 -40zM512 860
+q-129 0 -240 -65q-108 -63 -171 -171q-65 -111 -65 -240q0 -97 37 -185q37 -85 103 -151t151 -103q88 -37 185 -37t185 37q85 37 151 103t103 151q37 88 37 185q0 129 -65 240q-63 108 -171 171q-111 65 -240 65z" />
+    <glyph glyph-name="xiangji" unicode="&#xe60f;" 
+d="M651 464h-279q-24 0 -38 15t-7 33l17 49q6 13 18.5 20.5t27.5 6.5h245q15 1 27.5 -6.5t17.5 -20.5l18 -49q6 -18 -8.5 -33t-38.5 -15zM398 299q0 -29 15.5 -55t41.5 -40.5t56.5 -14.5t56.5 14.5t41.5 40.5t15.5 55.5t-15.5 55t-41.5 40t-56.5 14.5t-56.5 -14.5t-41.5 -40
+t-15.5 -55.5zM771 504h-519q-30 0 -51 -21.5t-21 -51.5v-264q0 -30 21 -51.5t51 -21.5h519q30 0 51.5 21.5t21.5 51.5v264q0 30 -21.5 51.5t-51.5 21.5zM511 159q-37 1 -68.5 20t-49.5 51t-17.5 69.5t19.5 69t51 49.5t69.5 17.5t68.5 -19t49.5 -50t18.5 -69t-19 -69.5
+t-51.5 -50.5t-70.5 -18.5v0zM699 415q-4 -3 -8 -9l-6 -14l-9 12q-3 5 -9 9l-14 6l13 9q4 2 8 9l6 14l9 -13q3 -5 9 -8l14 -7z" />
+    <glyph glyph-name="zhongxinpaizhaoyuan" unicode="&#xe610;" 
+d="M512 892q-104 0 -198 -39q-91 -39 -161.5 -109.5t-109.5 -161.5q-39 -94 -39 -198t39 -198q39 -91 109.5 -161.5t161.5 -109.5q94 -39 198 -39t198 39q91 39 161.5 109.5t109.5 161.5q39 94 39 198t-39 198q-39 91 -109.5 161.5t-161.5 109.5q-94 39 -198 39zM752 164
+q-32 -32 -74 -49q-42 -18 -90 -18h-301q-15 0 -25.5 11t-10.5 25.5t10.5 25t25.5 10.5h302q44 0 81 21.5t58.5 58.5t21.5 81t-21.5 81t-59 59t-80.5 22h-227l109 -110h-123l-144 145l144 145h123l-110 -109h227q46 0 90 -18q64 -28 102.5 -86.5t38.5 -128.5
+q1 -47 -16.5 -89.5t-50.5 -76.5z" />
+    <glyph glyph-name="fanzhuanxiangji" unicode="&#xe611;" 
+d="M805 648h-67l-19 55q-10 32 -37.5 51.5t-60.5 20.5h-220q-34 0 -61 -20t-37 -52l-19 -55h-65q-46 0 -84.5 -23t-61 -61.5t-22.5 -84.5v-317q0 -45 22.5 -84t61 -61.5t84.5 -22.5h586q46 0 84.5 22.5t61 61.5t22.5 84v317q0 46 -22.5 84.5t-61 61.5t-84.5 23zM910 162
+q0 -20 -7.5 -39.5t-22.5 -34.5t-34.5 -23t-40.5 -8h-586q-21 0 -40.5 8t-34.5 23t-22.5 34.5t-7.5 39.5v317q0 21 7.5 40.5t22.5 34.5t34.5 23t40.5 8h111l33 99q5 13 15.5 21t24.5 9h220q14 -1 25 -9t15 -21l33 -99h109q21 0 40.5 -8t34.5 -23t22.5 -34.5t7.5 -40.5v-317z
+M713 251q-24 -56 -74 -91t-110.5 -39.5t-114.5 23.5t-86 80l-34 -11l29 129l97 -91l-29 -8q22 -28 54 -43.5t67 -15.5q47 -1 86.5 25t58.5 70q4 12 16.5 16.5t24.5 0.5q12 -7 16 -20t-1 -25zM701 456l31 8l-31 -122l-91 87l28 8q-24 33 -61 49.5t-77 13.5t-74 -25.5
+t-52 -58.5q-6 -11 -18.5 -15t-23.5 2t-15 18.5t2 23.5q29 55 81.5 86.5t113.5 32.5q56 0 106 -29.5t81 -78.5zM701 456z" />
+    <glyph glyph-name="zhongxinpaizhao" unicode="&#xe616;" horiz-adv-x="1199" 
+d="M951 794h102q6 0 10.5 4t4.5 10v30q0 6 -4.5 10t-10.5 4h-102q-6 0 -10.5 -4t-4.5 -10v-30q0 -6 4.5 -10t10.5 -4zM1053 764h-249v44q0 37 -25.5 62.5t-61.5 25.5h-234q-37 0 -62.5 -25.5t-25.5 -62.5v-44h-249q-39 0 -73 -19.5t-53.5 -53t-19.5 -73.5v-600
+q0 -39 19.5 -73t53.5 -53.5t73 -19.5h907q40 0 73.5 19.5t53.5 53.5t20 73v600q0 40 -20 73.5t-53.5 53t-73.5 19.5zM614 516q-53 0 -95 -22t-66.5 -61.5t-28.5 -92.5h36q5 0 7.5 -2.5t-0.5 -5.5q-46 -54 -65 -77q-3 -2 -7 -2t-6 2l-65 77q-3 3 -0.5 5.5t7.5 2.5h36
+q4 69 42.5 124.5t98.5 84.5q62 30 131 23q62 -5 113.5 -40t81.5 -89t30 -117q0 -68 -33.5 -125.5t-91 -91t-124.5 -33.5q-60 0 -113 27t-88 76h84q28 -27 51.5 -35.5t65.5 -8.5q49 0 92 23.5t69.5 64t28.5 89.5q2 60 -21 106t-67.5 72t-102.5 26z" />
+    <glyph glyph-name="fanhui1" unicode="&#xe61e;" 
+d="M767 -126q-17 0 -29 11l-509 473q-12 11 -12 26t12 26l509 473q12 11 29 11t28.5 -11t11.5 -26.5t-12 -26.5l-481 -446l481 -446q12 -11 12 -26.5t-11.5 -26.5t-28.5 -11z" />
+    <glyph glyph-name="paizhao" unicode="&#xe6b4;" horiz-adv-x="1032" 
+d="M512 -128q-104 0 -199 40q-92 39 -163 110t-110 163q-40 95 -40 199t40 199q39 92 110 163t163 110q95 40 199 40t199 -40q92 -39 163 -110t110 -163q40 -95 40 -199t-40 -199q-39 -92 -110 -163t-163 -110q-95 -40 -199 -40zM512 -60q121 0 224 61q100 59 159 159
+q61 103 61 224t-61 224q-59 100 -159 159q-103 61 -224 61t-224 -61q-100 -59 -159 -159q-61 -103 -61 -224t61 -224q59 -100 159 -159q103 -61 224 -61zM512 -12q-108 0 -200 54q-89 53 -142 142q-54 92 -54 200t54 200q53 89 142 142q92 54 200 54t200 -54
+q89 -53 142 -142q54 -92 54 -200t-54 -200q-53 -89 -142 -142q-92 -54 -200 -54z" />
+  </font>
+</defs></svg>

BIN
assets/fonts/iconfont.ttf


BIN
assets/fonts/iconfont.woff


BIN
assets/fonts/iconfont.woff2


File diff suppressed because it is too large
+ 64 - 0
assets/fonts/iconfont.wxss


+ 37 - 0
components/frame-animation/frame-animation.js

@@ -0,0 +1,37 @@
+Component({
+  properties: {
+    url: {
+      type: String,
+      value: "https://img.bazhuay.com/1585887536024_12",
+    },
+    count: {
+      type: String,
+      value: 3,
+    },
+    width: {
+      type: String,
+      value: 360,
+    },
+    height: {
+      type: String,
+      value: 300,
+    },
+    duration: {
+      type: String,
+      value: 0.3,
+    },
+    playNumber: {
+      type: String,
+      value: "infinite",
+    },
+  },
+  data: {},
+  attached() {
+    if (this.data.playNumber > 0) {
+      setTimeout(() => {
+        this.triggerEvent("end");
+      }, this.data.playNumber * this.data.duration * 1000);
+    }
+  },
+  methods: {},
+});

+ 4 - 0
components/frame-animation/frame-animation.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 1 - 0
components/frame-animation/frame-animation.wxml

@@ -0,0 +1 @@
+<view class="frame_wrap" style="background-image: url({{url}});--width:{{width}}rpx;--height:{{height}}rpx;--count:{{count}};--duration:{{duration}};--playNumber:{{playNumber}};"></view>

+ 17 - 0
components/frame-animation/frame-animation.wxss

@@ -0,0 +1,17 @@
+.frame_wrap {
+  width: var(--width);
+  height: var(--height);
+  animation: frames calc(var(--duration) * 1s) steps(var(--count)) var(--playNumber);
+  background-position: 0 0;
+  background-size: calc(var(--width) * var(--count)) var(--height);
+}
+
+@keyframes frames {
+  from {
+    background-position-x: 0;
+  }
+
+  to {
+    background-position-x: calc(var(--width) * var(--count));
+  }
+}

+ 24 - 0
components/frame-animation/readme.md

@@ -0,0 +1,24 @@
+帧组件使用文档:
+1. 把多张图片帧合成一张
+使用https://www.toptal.com/developers/css/sprite-generator合成,注意帧与帧之间边距改为0,从做左到右排列。
+2. 把合成后图片放在云端(可以放在云开发云存储),得到合成后的网络地址。
+3. 引用组件,并使用组件
+
+
+组件属性:
+url:合成后的外链
+width:单张图片帧的宽度
+height:单张图片帧的高度
+count: 图片帧数量
+duration:播放一次完整动画所需时间;单位(秒)
+playNumber: 播放次数(默认无限次)
+bindend:播放结束回调
+
+
+注意事项:
+1. 制作时,帧与帧编辑为0,从左到右排列
+2. url必须为网络外链
+
+
+联系我:
+1010493573@qq.com

+ 36 - 0
components/toast/index.js

@@ -0,0 +1,36 @@
+// components/toast/index.js
+import { CDN_URL,API_BASE_URL,TYPE } from '../../config/index'
+import { VantComponent } from '../vant-ui/common/component';
+
+VantComponent({
+    props: {
+        show: Boolean,
+        mask: Boolean,
+        message: String,
+        forbidClick: Boolean,
+        zIndex: {
+            type: Number,
+            value: 1000
+        },
+        type: {
+            type: String,
+            value: 'text'
+        },
+        loadingType: {
+            type: String,
+            value: 'circular'
+        },
+        position: {
+            type: String,
+            value: 'middle'
+        }
+    },
+    data:{
+      cdn_url:CDN_URL,
+    },
+    methods: {
+        // for prevent touchmove
+        noop() { }
+    }
+});
+

+ 4 - 0
components/toast/index.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 17 - 0
components/toast/index.wxml

@@ -0,0 +1,17 @@
+<view class="overlay" wx:if='{{show}}' style="'z-index':{{zIndex}}">
+  <view class="toast">
+    <image class="icon" mode="widthFix" src="{{cdn_url}}/images/icon/{{type=='loading'? 'loading.gif':(type + '.png')}}" />
+    <view class='toast-con'>
+        <text>
+          {{message}}
+        </text>
+    </view>
+
+    <view class="toast-footer" wx:if="{{ type !== 'loading' }}">
+      <button bindtap="clear">
+        确定
+      </button>
+    </view>
+  </view>
+</view>
+  

+ 41 - 0
components/toast/index.wxss

@@ -0,0 +1,41 @@
+/* components/toast/index.wxss */
+.overlay{
+  position: fixed;
+  top:0;
+  left:0;
+  width:100%;
+  height:100%;
+  background-color: rgba(0, 0, 0, 0.7);
+  z-index: 1000;
+}
+
+.toast{
+  background: #ebeae8;
+  width: 80%;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%,-50%);
+  border-radius: 20rpx;
+  text-align: center;
+  padding: 8% 0;
+}
+
+.toast .icon{
+  width: 45%;
+}
+
+.toast-con text{
+  display: inline-block;    
+  width: 90%;
+  margin: 0 auto;
+}
+
+.toast-footer button{
+  background: #38948f;
+  margin-top: 40rpx;
+  color: #fff;
+  border-radius: 50rpx;
+  font-size: 32rpx;
+  font-weight: normal;
+}

+ 68 - 0
components/toast/toast.js

@@ -0,0 +1,68 @@
+import { isObj } from '../../config/utils';
+
+const defaultOptions = {
+    type: 'text',
+    mask: false,
+    message: '',
+    show: true,
+    zIndex: 1000,
+    duration: 2000,
+    position: 'middle',
+    forbidClick: false,
+    loadingType: 'circular',
+    selector: '#van-toast'
+};
+let queue = [];
+let currentOptions = Object.assign({}, defaultOptions);
+function parseOptions(message) {
+    return isObj(message) ? message : { message };
+}
+function getContext() {
+    const pages = getCurrentPages();
+    return pages[pages.length - 1];
+}
+function Toast(toastOptions) {
+    const options = Object.assign(Object.assign({}, currentOptions), parseOptions(toastOptions));
+    const context = options.context || getContext();
+    const toast = context.selectComponent(options.selector);
+    if (!toast) {
+        console.warn('未找到 van-toast 节点,请确认 selector 及 context 是否正确');
+        return;
+    }
+    delete options.context;
+    delete options.selector;
+    toast.clear = () => {
+        toast.setData({ show: false });
+        if (options.callBack) {
+            options.callBack();
+        }
+    };
+    queue.push(toast);
+    toast.setData(options);
+    clearTimeout(toast.timer);
+    if (options.duration > 0&&options.type==='loading') {
+        toast.hideLoading = () => {
+            toast.clear();
+            queue = queue.filter(item => item !== toast);
+        };
+    }
+    return toast;
+}
+const createMethod = (type) => (options) => Toast(Object.assign({ type }, parseOptions(options)));
+Toast.loading = createMethod('loading');
+Toast.success = createMethod('success');
+Toast.fail = createMethod('fail');
+Toast.message = createMethod('message');
+Toast.clear = () => {
+    queue.forEach(toast => {
+        toast.clear();
+    });
+    queue = [];
+};
+Toast.setDefaultOptions = (options) => {
+    Object.assign(currentOptions, options);
+};
+Toast.resetDefaultOptions = () => {
+    currentOptions = Object.assign({}, defaultOptions);
+};
+export default Toast;

+ 1 - 0
components/vant-ui/cell-group/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 10 - 0
components/vant-ui/cell-group/index.js

@@ -0,0 +1,10 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        title: String,
+        border: {
+            type: Boolean,
+            value: true
+        }
+    }
+});

+ 3 - 0
components/vant-ui/cell-group/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 9 - 0
components/vant-ui/cell-group/index.wxml

@@ -0,0 +1,9 @@
+<view
+  wx:if="{{ title }}"
+  class="van-cell-group__title"
+>
+  {{ title }}
+</view>
+<view class="custom-class van-cell-group {{ border ? 'van-hairline--top-bottom' : '' }}">
+  <slot />
+</view>

+ 1 - 0
components/vant-ui/cell-group/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-cell-group__title{padding:16px 16px 8px;padding:var(--cell-group-title-padding,16px 16px 8px);font-size:14px;font-size:var(--cell-group-title-font-size,14px);line-height:16px;line-height:var(--cell-group-title-line-height,16px);color:#969799;color:var(--cell-group-title-color,#969799)}

+ 1 - 0
components/vant-ui/cell/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 37 - 0
components/vant-ui/cell/index.js

@@ -0,0 +1,37 @@
+import { link } from '../mixins/link';
+import { VantComponent } from '../common/component';
+VantComponent({
+    classes: [
+        'title-class',
+        'label-class',
+        'value-class',
+        'right-icon-class',
+        'hover-class'
+    ],
+    mixins: [link],
+    props: {
+        title: null,
+        value: null,
+        icon: String,
+        size: String,
+        label: String,
+        center: Boolean,
+        isLink: Boolean,
+        required: Boolean,
+        clickable: Boolean,
+        titleWidth: String,
+        customStyle: String,
+        arrowDirection: String,
+        useLabelSlot: Boolean,
+        border: {
+            type: Boolean,
+            value: true
+        }
+    },
+    methods: {
+        onClick(event) {
+            this.$emit('click', event.detail);
+            this.jumpLink();
+        }
+    }
+});

+ 6 - 0
components/vant-ui/cell/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-icon": "../icon/index"
+  }
+}

+ 45 - 0
components/vant-ui/cell/index.wxml

@@ -0,0 +1,45 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  class="custom-class {{ utils.bem('cell', [size, { center, required, borderless: !border, clickable: isLink || clickable }]) }}"
+  hover-class="van-cell--hover hover-class"
+  hover-stay-time="70"
+  style="{{ customStyle }}"
+  bind:tap="onClick"
+>
+  <van-icon
+    wx:if="{{ icon }}"
+    name="{{ icon }}"
+    class="van-cell__left-icon-wrap"
+    custom-class="van-cell__left-icon"
+  />
+  <slot wx:else name="icon" />
+
+  <view
+    style="{{ titleWidth ? 'max-width:' + titleWidth + ';min-width:' + titleWidth : '' }}"
+    class="van-cell__title title-class"
+  >
+    <block wx:if="{{ title }}">{{ title }}</block>
+    <slot wx:else name="title" />
+
+    <view wx:if="{{ label || useLabelSlot }}" class="van-cell__label label-class">
+      <slot wx:if="{{ useLabelSlot }}" name="label" />
+      <block wx:elif="{{ label }}">{{ label }}</block>
+    </view>
+  </view>
+
+  <view class="van-cell__value value-class">
+    <block wx:if="{{ value || value === 0 }}">{{ value }}</block>
+    <slot wx:else />
+  </view>
+
+  <van-icon
+    wx:if="{{ isLink }}"
+    name="{{ arrowDirection ? 'arrow' + '-' + arrowDirection : 'arrow' }}"
+    class="van-cell__right-icon-wrap right-icon-class"
+    custom-class="van-cell__right-icon"
+  />
+  <slot wx:else name="right-icon" />
+
+  <slot name="extra" />
+</view>

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/cell/index.wxss


+ 7 - 0
components/vant-ui/common/color.d.ts

@@ -0,0 +1,7 @@
+export declare const RED = "#ee0a24";
+export declare const BLUE = "#1989fa";
+export declare const WHITE = "#fff";
+export declare const GREEN = "#07c160";
+export declare const ORANGE = "#ff976a";
+export declare const GRAY = "#323233";
+export declare const GRAY_DARK = "#969799";

+ 7 - 0
components/vant-ui/common/color.js

@@ -0,0 +1,7 @@
+export const RED = '#ee0a24';
+export const BLUE = '#1989fa';
+export const WHITE = '#fff';
+export const GREEN = '#07c160';
+export const ORANGE = '#ff976a';
+export const GRAY = '#323233';
+export const GRAY_DARK = '#969799';

+ 3 - 0
components/vant-ui/common/component.d.ts

@@ -0,0 +1,3 @@
+import { VantComponentOptions, CombinedComponentInstance } from '../definitions/index';
+declare function VantComponent<Data, Props, Methods>(vantOptions?: VantComponentOptions<Data, Props, Methods, CombinedComponentInstance<Data, Props, Methods>>): void;
+export { VantComponent };

+ 101 - 0
components/vant-ui/common/component.js

@@ -0,0 +1,101 @@
+import { basic } from '../mixins/basic';
+const relationFunctions = {
+    ancestor: {
+        linked(parent) {
+            this.parent = parent;
+        },
+        unlinked() {
+            this.parent = null;
+        },
+    },
+    descendant: {
+        linked(child) {
+            this.children = this.children || [];
+            this.children.push(child);
+        },
+        unlinked(child) {
+            this.children = (this.children || []).filter(it => it !== child);
+        },
+    },
+};
+function mapKeys(source, target, map) {
+    Object.keys(map).forEach(key => {
+        if (source[key]) {
+            target[map[key]] = source[key];
+        }
+    });
+}
+function makeRelation(options, vantOptions, relation) {
+    const { type, name, linked, unlinked, linkChanged } = relation;
+    const { beforeCreate, destroyed } = vantOptions;
+    if (type === 'descendant') {
+        options.created = function () {
+            beforeCreate && beforeCreate.bind(this)();
+            this.children = this.children || [];
+        };
+        options.detached = function () {
+            this.children = [];
+            destroyed && destroyed.bind(this)();
+        };
+    }
+    options.relations = Object.assign(options.relations || {}, {
+        [`../${name}/index`]: {
+            type,
+            linked(node) {
+                relationFunctions[type].linked.bind(this)(node);
+                linked && linked.bind(this)(node);
+            },
+            linkChanged(node) {
+                linkChanged && linkChanged.bind(this)(node);
+            },
+            unlinked(node) {
+                relationFunctions[type].unlinked.bind(this)(node);
+                unlinked && unlinked.bind(this)(node);
+            },
+        }
+    });
+}
+function VantComponent(vantOptions = {}) {
+    const options = {};
+    mapKeys(vantOptions, options, {
+        data: 'data',
+        props: 'properties',
+        mixins: 'behaviors',
+        methods: 'methods',
+        beforeCreate: 'created',
+        created: 'attached',
+        mounted: 'ready',
+        relations: 'relations',
+        destroyed: 'detached',
+        classes: 'externalClasses'
+    });
+    const { relation } = vantOptions;
+    if (relation) {
+        makeRelation(options, vantOptions, relation);
+    }
+    // add default externalClasses
+    options.externalClasses = options.externalClasses || [];
+    options.externalClasses.push('custom-class');
+    // add default behaviors
+    options.behaviors = options.behaviors || [];
+    options.behaviors.push(basic);
+    // map field to form-field behavior
+    if (vantOptions.field) {
+        options.behaviors.push('wx://form-field');
+    }
+    if (options.properties) {
+        Object.keys(options.properties).forEach(name => {
+            if (Array.isArray(options.properties[name])) {
+                // miniprogram do not allow multi type
+                options.properties[name] = null;
+            }
+        });
+    }
+    // add default options
+    options.options = {
+        multipleSlots: true,
+        addGlobalClass: true
+    };
+    Component(options);
+}
+export { VantComponent };

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/common/index.wxss


+ 1 - 0
components/vant-ui/common/style/clearfix.wxss

@@ -0,0 +1 @@
+.van-clearfix:after{display:table;clear:both;content:""}

+ 1 - 0
components/vant-ui/common/style/ellipsis.wxss

@@ -0,0 +1 @@
+.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/common/style/hairline.wxss


+ 0 - 0
components/vant-ui/common/style/mixins/clearfix.wxss


+ 0 - 0
components/vant-ui/common/style/mixins/ellipsis.wxss


+ 0 - 0
components/vant-ui/common/style/mixins/hairline.wxss


+ 0 - 0
components/vant-ui/common/style/theme.wxss


+ 0 - 0
components/vant-ui/common/style/var.wxss


+ 8 - 0
components/vant-ui/common/utils.d.ts

@@ -0,0 +1,8 @@
+/// <reference types="miniprogram-api-typings" />
+export declare function isDef(value: any): boolean;
+export declare function isObj(x: any): boolean;
+export declare function isNumber(value: any): boolean;
+export declare function range(num: number, min: number, max: number): number;
+export declare function nextTick(fn: Function): void;
+export declare function getSystemInfoSync(): WechatMiniprogram.GetSystemInfoSuccessCallbackResult;
+export declare function addUnit(value?: string | number): string | undefined;

+ 32 - 0
components/vant-ui/common/utils.js

@@ -0,0 +1,32 @@
+export function isDef(value) {
+    return value !== undefined && value !== null;
+}
+export function isObj(x) {
+    const type = typeof x;
+    return x !== null && (type === 'object' || type === 'function');
+}
+export function isNumber(value) {
+    return /^\d+(\.\d+)?$/.test(value);
+}
+export function range(num, min, max) {
+    return Math.min(Math.max(num, min), max);
+}
+export function nextTick(fn) {
+    setTimeout(() => {
+        fn();
+    }, 1000 / 30);
+}
+let systemInfo = null;
+export function getSystemInfoSync() {
+    if (systemInfo == null) {
+        systemInfo = wx.getSystemInfoSync();
+    }
+    return systemInfo;
+}
+export function addUnit(value) {
+    if (!isDef(value)) {
+        return undefined;
+    }
+    value = String(value);
+    return isNumber(value) ? `${value}px` : value;
+}

+ 1 - 0
components/vant-ui/icon/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 27 - 0
components/vant-ui/icon/index.js

@@ -0,0 +1,27 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        dot: Boolean,
+        info: null,
+        size: null,
+        color: String,
+        customStyle: String,
+        classPrefix: {
+            type: String,
+            value: 'van-icon'
+        },
+        name: {
+            type: String,
+            observer(val) {
+                this.setData({
+                    isImageName: val.indexOf('/') !== -1
+                });
+            }
+        }
+    },
+    methods: {
+        onClick() {
+            this.$emit('click');
+        }
+    }
+});

+ 6 - 0
components/vant-ui/icon/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-info": "../info/index"
+  }
+}

+ 20 - 0
components/vant-ui/icon/index.wxml

@@ -0,0 +1,20 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  class="custom-class {{ classPrefix }} {{ isImageName ? 'van-icon--image' : classPrefix + '-' + name }}"
+  style="color: {{ color }};font-size: {{ utils.addUnit(size) }};{{ customStyle }}"
+  bind:tap="onClick"
+>
+  <van-info
+    wx:if="{{ info !== null || dot }}"
+    dot="{{ dot }}"
+    info="{{ info }}"
+    custom-class="van-icon__info"
+  />
+  <image
+    wx:if="{{ isImageName }}"
+    src="{{ name }}"
+    mode="aspectFit"
+    class="van-icon__image"
+  />
+</view>

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/icon/index.wxss


+ 1 - 0
components/vant-ui/info/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 8 - 0
components/vant-ui/info/index.js

@@ -0,0 +1,8 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        dot: Boolean,
+        info: null,
+        customStyle: String
+    }
+});

+ 3 - 0
components/vant-ui/info/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 7 - 0
components/vant-ui/info/index.wxml

@@ -0,0 +1,7 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view
+  wx:if="{{ info !== null && info !== '' || dot }}"
+  class="custom-class van-info {{ utils.bem('info', { dot }) }}"
+  style="{{ customStyle }}"
+>{{ dot ? '' : info }}</view>

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/info/index.wxss


+ 1 - 0
components/vant-ui/loading/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 16 - 0
components/vant-ui/loading/index.js

@@ -0,0 +1,16 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        color: String,
+        vertical: Boolean,
+        type: {
+            type: String,
+            value: 'circular'
+        },
+        size: String,
+        textSize: String
+    },
+    data: {
+        array12: Array.from({ length: 12 }),
+    },
+});

+ 3 - 0
components/vant-ui/loading/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 18 - 0
components/vant-ui/loading/index.wxml

@@ -0,0 +1,18 @@
+<wxs src="../wxs/utils.wxs" module="utils" />
+
+<view class="custom-class van-loading {{ vertical ? 'van-loading--vertical' : '' }}">
+  <view
+    class="van-loading__spinner van-loading__spinner--{{ type }}"
+    style="color: {{ color }}; width: {{ utils.addUnit(size) }}; height: {{ utils.addUnit(size) }}"
+  >
+    <view
+      wx:if="{{ type === 'spinner' }}"
+      wx:for="{{ array12 }}"
+      wx:key="index"
+      class="van-loading__dot"
+    />
+  </view>
+  <view class="van-loading__text" style="font-size: {{ utils.addUnit(textSize) }};">
+    <slot />
+  </view>
+</view>

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/loading/index.wxss


+ 26 - 0
components/vant-ui/mixins/basic

@@ -0,0 +1,26 @@
+export const basic = Behavior({
+    methods: {
+        $emit(...args) {
+            this.triggerEvent(...args);
+        },
+        set(data, callback) {
+            this.setData(data, callback);
+            return new Promise(resolve => wx.nextTick(resolve));
+        },
+        getRect(selector, all) {
+            return new Promise(resolve => {
+                wx.createSelectorQuery()
+                    .in(this)[all ? 'selectAll' : 'select'](selector)
+                    .boundingClientRect(rect => {
+                    if (all && Array.isArray(rect) && rect.length) {
+                        resolve(rect);
+                    }
+                    if (!all && rect) {
+                        resolve(rect);
+                    }
+                })
+                    .exec();
+            });
+        }
+    }
+});

+ 26 - 0
components/vant-ui/mixins/basic.js

@@ -0,0 +1,26 @@
+export const basic = Behavior({
+    methods: {
+        $emit(...args) {
+            this.triggerEvent(...args);
+        },
+        set(data, callback) {
+            this.setData(data, callback);
+            return new Promise(resolve => wx.nextTick(resolve));
+        },
+        getRect(selector, all) {
+            return new Promise(resolve => {
+                wx.createSelectorQuery()
+                    .in(this)[all ? 'selectAll' : 'select'](selector)
+                    .boundingClientRect(rect => {
+                    if (all && Array.isArray(rect) && rect.length) {
+                        resolve(rect);
+                    }
+                    if (!all && rect) {
+                        resolve(rect);
+                    }
+                })
+                    .exec();
+            });
+        }
+    }
+});

+ 17 - 0
components/vant-ui/mixins/link.js

@@ -0,0 +1,17 @@
+export const link = Behavior({
+    properties: {
+        url: String,
+        linkType: {
+            type: String,
+            value: 'navigateTo'
+        }
+    },
+    methods: {
+        jumpLink(urlKey = 'url') {
+            const url = this.data[urlKey];
+            if (url) {
+                wx[this.data.linkType]({ url });
+            }
+        }
+    }
+});

+ 28 - 0
components/vant-ui/mixins/page-scroll.js

@@ -0,0 +1,28 @@
+function getCurrentPage() {
+    const pages = getCurrentPages();
+    return pages[pages.length - 1] || {};
+}
+function onPageScroll(event) {
+    const { vanPageScroller = [] } = getCurrentPage();
+    vanPageScroller.forEach((scroller) => {
+        if (typeof scroller === 'function') {
+            scroller(event);
+        }
+    });
+}
+export const pageScrollMixin = (scroller) => Behavior({
+    attached() {
+        const page = getCurrentPage();
+        if (Array.isArray(page.vanPageScroller)) {
+            page.vanPageScroller.push(scroller.bind(this));
+        }
+        else {
+            page.vanPageScroller = [page.onPageScroll, scroller.bind(this)];
+        }
+        page.onPageScroll = onPageScroll;
+    },
+    detached() {
+        const page = getCurrentPage();
+        page.vanPageScroller = (page.vanPageScroller || []).filter(item => item !== scroller);
+    }
+});

+ 35 - 0
components/vant-ui/mixins/touch.js

@@ -0,0 +1,35 @@
+const MIN_DISTANCE = 10;
+function getDirection(x, y) {
+    if (x > y && x > MIN_DISTANCE) {
+        return 'horizontal';
+    }
+    if (y > x && y > MIN_DISTANCE) {
+        return 'vertical';
+    }
+    return '';
+}
+export const touch = Behavior({
+    methods: {
+        resetTouchStatus() {
+            this.direction = '';
+            this.deltaX = 0;
+            this.deltaY = 0;
+            this.offsetX = 0;
+            this.offsetY = 0;
+        },
+        touchStart(event) {
+            this.resetTouchStatus();
+            const touch = event.touches[0];
+            this.startX = touch.clientX;
+            this.startY = touch.clientY;
+        },
+        touchMove(event) {
+            const touch = event.touches[0];
+            this.deltaX = touch.clientX - this.startX;
+            this.deltaY = touch.clientY - this.startY;
+            this.offsetX = Math.abs(this.deltaX);
+            this.offsetY = Math.abs(this.deltaY);
+            this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
+        }
+    }
+});

+ 118 - 0
components/vant-ui/mixins/transition.js

@@ -0,0 +1,118 @@
+import { isObj } from '../common/utils';
+const getClassNames = (name) => ({
+    enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`,
+    'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`,
+    leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`,
+    'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`
+});
+const nextTick = () => new Promise(resolve => setTimeout(resolve, 1000 / 30));
+export const transition = function (showDefaultValue) {
+    return Behavior({
+        properties: {
+            customStyle: String,
+            // @ts-ignore
+            show: {
+                type: Boolean,
+                value: showDefaultValue,
+                observer: 'observeShow'
+            },
+            // @ts-ignore
+            duration: {
+                type: null,
+                value: 300,
+                observer: 'observeDuration'
+            },
+            name: {
+                type: String,
+                value: 'fade'
+            }
+        },
+        data: {
+            type: '',
+            inited: false,
+            display: false
+        },
+        methods: {
+            observeShow(value, old) {
+                if (value === old) {
+                    return;
+                }
+                value ? this.enter() : this.leave();
+            },
+            enter() {
+                const { duration, name } = this.data;
+                const classNames = getClassNames(name);
+                const currentDuration = isObj(duration) ? duration.enter : duration;
+                this.status = 'enter';
+                this.$emit('before-enter');
+                Promise.resolve()
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('enter');
+                    this.$emit('enter');
+                    this.setData({
+                        inited: true,
+                        display: true,
+                        classes: classNames.enter,
+                        currentDuration
+                    });
+                })
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('enter');
+                    this.transitionEnded = false;
+                    this.setData({
+                        classes: classNames['enter-to']
+                    });
+                })
+                    .catch(() => { });
+            },
+            leave() {
+                if (!this.data.display) {
+                    return;
+                }
+                const { duration, name } = this.data;
+                const classNames = getClassNames(name);
+                const currentDuration = isObj(duration) ? duration.leave : duration;
+                this.status = 'leave';
+                this.$emit('before-leave');
+                Promise.resolve()
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('leave');
+                    this.$emit('leave');
+                    this.setData({
+                        classes: classNames.leave,
+                        currentDuration
+                    });
+                })
+                    .then(nextTick)
+                    .then(() => {
+                    this.checkStatus('leave');
+                    this.transitionEnded = false;
+                    setTimeout(() => this.onTransitionEnd(), currentDuration);
+                    this.setData({
+                        classes: classNames['leave-to']
+                    });
+                })
+                    .catch(() => { });
+            },
+            checkStatus(status) {
+                if (status !== this.status) {
+                    throw new Error(`incongruent status: ${status}`);
+                }
+            },
+            onTransitionEnd() {
+                if (this.transitionEnded) {
+                    return;
+                }
+                this.transitionEnded = true;
+                this.$emit(`after-${this.status}`);
+                const { show, display } = this.data;
+                if (!show && display) {
+                    this.setData({ display: false });
+                }
+            }
+        }
+    });
+};

+ 1 - 0
components/vant-ui/overlay/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 22 - 0
components/vant-ui/overlay/index.js

@@ -0,0 +1,22 @@
+import { VantComponent } from '../common/component';
+VantComponent({
+    props: {
+        show: Boolean,
+        customStyle: String,
+        duration: {
+            type: null,
+            value: 300
+        },
+        zIndex: {
+            type: Number,
+            value: 1
+        }
+    },
+    methods: {
+        onClick() {
+            this.$emit('click');
+        },
+        // for prevent touchmove
+        noop() { }
+    }
+});

+ 6 - 0
components/vant-ui/overlay/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-transition": "../transition/index"
+  }
+}

+ 10 - 0
components/vant-ui/overlay/index.wxml

@@ -0,0 +1,10 @@
+<van-transition
+  show="{{ show }}"
+  custom-class="van-overlay"
+  custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
+  duration="{{ duration }}"
+  bind:tap="onClick"
+  catch:touchmove="noop"
+>
+  <slot></slot>
+</van-transition>

+ 1 - 0
components/vant-ui/overlay/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);background-color:var(--overlay-background-color,rgba(0,0,0,.7))}

+ 1 - 0
components/vant-ui/picker-column/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 117 - 0
components/vant-ui/picker-column/index.js

@@ -0,0 +1,117 @@
+import { VantComponent } from '../common/component';
+import { isObj, range } from '../common/utils';
+const DEFAULT_DURATION = 200;
+VantComponent({
+    classes: ['active-class'],
+    props: {
+        valueKey: String,
+        className: String,
+        itemHeight: Number,
+        visibleItemCount: Number,
+        initialOptions: {
+            type: Array,
+            value: []
+        },
+        defaultIndex: {
+            type: Number,
+            value: 0,
+            observer(value) {
+                this.setIndex(value);
+            }
+        }
+    },
+    data: {
+        startY: 0,
+        offset: 0,
+        duration: 0,
+        startOffset: 0,
+        options: [],
+        currentIndex: 0
+    },
+    created() {
+        const { defaultIndex, initialOptions } = this.data;
+        this.set({
+            currentIndex: defaultIndex,
+            options: initialOptions
+        }).then(() => {
+            this.setIndex(defaultIndex);
+        });
+    },
+    methods: {
+        getCount() {
+            return this.data.options.length;
+        },
+        onTouchStart(event) {
+            this.setData({
+                startY: event.touches[0].clientY,
+                startOffset: this.data.offset,
+                duration: 0
+            });
+        },
+        onTouchMove(event) {
+            const { data } = this;
+            const deltaY = event.touches[0].clientY - data.startY;
+            this.setData({
+                offset: range(data.startOffset + deltaY, -(this.getCount() * data.itemHeight), data.itemHeight)
+            });
+        },
+        onTouchEnd() {
+            const { data } = this;
+            if (data.offset !== data.startOffset) {
+                this.setData({ duration: DEFAULT_DURATION });
+                const index = range(Math.round(-data.offset / data.itemHeight), 0, this.getCount() - 1);
+                this.setIndex(index, true);
+            }
+        },
+        onClickItem(event) {
+            const { index } = event.currentTarget.dataset;
+            this.setIndex(index, true);
+        },
+        adjustIndex(index) {
+            const { data } = this;
+            const count = this.getCount();
+            index = range(index, 0, count);
+            for (let i = index; i < count; i++) {
+                if (!this.isDisabled(data.options[i]))
+                    return i;
+            }
+            for (let i = index - 1; i >= 0; i--) {
+                if (!this.isDisabled(data.options[i]))
+                    return i;
+            }
+        },
+        isDisabled(option) {
+            return isObj(option) && option.disabled;
+        },
+        getOptionText(option) {
+            const { data } = this;
+            return isObj(option) && data.valueKey in option
+                ? option[data.valueKey]
+                : option;
+        },
+        setIndex(index, userAction) {
+            const { data } = this;
+            index = this.adjustIndex(index) || 0;
+            const offset = -index * data.itemHeight;
+            if (index !== data.currentIndex) {
+                return this.set({ offset, currentIndex: index }).then(() => {
+                    userAction && this.$emit('change', index);
+                });
+            }
+            return this.set({ offset });
+        },
+        setValue(value) {
+            const { options } = this.data;
+            for (let i = 0; i < options.length; i++) {
+                if (this.getOptionText(options[i]) === value) {
+                    return this.setIndex(i);
+                }
+            }
+            return Promise.resolve();
+        },
+        getValue() {
+            const { data } = this;
+            return data.options[data.currentIndex];
+        }
+    }
+});

+ 3 - 0
components/vant-ui/picker-column/index.json

@@ -0,0 +1,3 @@
+{
+  "component": true
+}

+ 22 - 0
components/vant-ui/picker-column/index.wxml

@@ -0,0 +1,22 @@
+<wxs src="./index.wxs" module="getOptionText" />
+
+<view
+  class="van-picker-column custom-class"
+  style="height: {{ itemHeight * visibleItemCount }}px"
+  bind:touchstart="onTouchStart"
+  catch:touchmove="onTouchMove"
+  bind:touchend="onTouchEnd"
+  bind:touchcancel="onTouchEnd"
+>
+  <view style="transition: transform {{ duration }}ms; line-height: {{ itemHeight }}px; transform: translate3d(0, {{ offset + (itemHeight * (visibleItemCount - 1)) / 2 }}px, 0)">
+    <view
+      wx:for="{{ options }}"
+      wx:for-item="option"
+      wx:key="index"
+      data-index="{{ index }}"
+      style="height: {{ itemHeight }}px"
+      class="van-ellipsis van-picker-column__item {{ option && option.disabled ? 'van-picker-column__item--disabled' : '' }} {{ index === currentIndex ? 'van-picker-column__item--selected active-class' : '' }}"
+      bindtap="onClickItem"
+    >{{ getOptionText(option, valueKey) }}</view>
+  </view>
+</view>

+ 8 - 0
components/vant-ui/picker-column/index.wxs

@@ -0,0 +1,8 @@
+function isObj(x) {
+  var type = typeof x;
+  return x !== null && (type === 'object' || type === 'function');
+}
+
+module.exports = function (option, valueKey) {
+  return isObj(option) && option[valueKey] != null ? option[valueKey] : option;
+}

+ 1 - 0
components/vant-ui/picker-column/index.wxss

@@ -0,0 +1 @@
+@import '../common/index.wxss';.van-picker-column{overflow:hidden;text-align:center;color:#000;color:var(--picker-option-text-color,#000);font-size:16px;font-size:var(--picker-option-font-size,16px)}.van-picker-column__item{padding:0 5px}.van-picker-column__item--selected{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--picker-option-selected-text-color,#323233)}.van-picker-column__item--disabled{opacity:.3;opacity:var(--picker-option-disabled-opacity,.3)}

+ 1 - 0
components/vant-ui/picker/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 135 - 0
components/vant-ui/picker/index.js

@@ -0,0 +1,135 @@
+import { VantComponent } from '../common/component';
+import { pickerProps } from './shared';
+VantComponent({
+    classes: ['active-class', 'toolbar-class', 'column-class'],
+    props: Object.assign(Object.assign({}, pickerProps), { valueKey: {
+            type: String,
+            value: 'text'
+        }, toolbarPosition: {
+            type: String,
+            value: 'top'
+        }, defaultIndex: {
+            type: Number,
+            value: 0
+        }, columns: {
+            type: Array,
+            value: [],
+            observer(columns = []) {
+                this.simple = columns.length && !columns[0].values;
+                this.children = this.selectAllComponents('.van-picker__column');
+                if (Array.isArray(this.children) && this.children.length) {
+                    this.setColumns().catch(() => { });
+                }
+            }
+        } }),
+    beforeCreate() {
+        this.children = [];
+    },
+    methods: {
+        noop() { },
+        setColumns() {
+            const { data } = this;
+            const columns = this.simple ? [{ values: data.columns }] : data.columns;
+            const stack = columns.map((column, index) => this.setColumnValues(index, column.values));
+            return Promise.all(stack);
+        },
+        emit(event) {
+            const { type } = event.currentTarget.dataset;
+            if (this.simple) {
+                this.$emit(type, {
+                    value: this.getColumnValue(0),
+                    index: this.getColumnIndex(0)
+                });
+            }
+            else {
+                this.$emit(type, {
+                    value: this.getValues(),
+                    index: this.getIndexes()
+                });
+            }
+        },
+        onChange(event) {
+            if (this.simple) {
+                this.$emit('change', {
+                    picker: this,
+                    value: this.getColumnValue(0),
+                    index: this.getColumnIndex(0)
+                });
+            }
+            else {
+                this.$emit('change', {
+                    picker: this,
+                    value: this.getValues(),
+                    index: event.currentTarget.dataset.index
+                });
+            }
+        },
+        // get column instance by index
+        getColumn(index) {
+            return this.children[index];
+        },
+        // get column value by index
+        getColumnValue(index) {
+            const column = this.getColumn(index);
+            return column && column.getValue();
+        },
+        // set column value by index
+        setColumnValue(index, value) {
+            const column = this.getColumn(index);
+            if (column == null) {
+                return Promise.reject(new Error('setColumnValue: 对应列不存在'));
+            }
+            return column.setValue(value);
+        },
+        // get column option index by column index
+        getColumnIndex(columnIndex) {
+            return (this.getColumn(columnIndex) || {}).data.currentIndex;
+        },
+        // set column option index by column index
+        setColumnIndex(columnIndex, optionIndex) {
+            const column = this.getColumn(columnIndex);
+            if (column == null) {
+                return Promise.reject(new Error('setColumnIndex: 对应列不存在'));
+            }
+            return column.setIndex(optionIndex);
+        },
+        // get options of column by index
+        getColumnValues(index) {
+            return (this.children[index] || {}).data.options;
+        },
+        // set options of column by index
+        setColumnValues(index, options, needReset = true) {
+            const column = this.children[index];
+            if (column == null) {
+                return Promise.reject(new Error('setColumnValues: 对应列不存在'));
+            }
+            const isSame = JSON.stringify(column.data.options) === JSON.stringify(options);
+            if (isSame) {
+                return Promise.resolve();
+            }
+            return column.set({ options }).then(() => {
+                if (needReset) {
+                    column.setIndex(0);
+                }
+            });
+        },
+        // get values of all columns
+        getValues() {
+            return this.children.map((child) => child.getValue());
+        },
+        // set values of all columns
+        setValues(values) {
+            const stack = values.map((value, index) => this.setColumnValue(index, value));
+            return Promise.all(stack);
+        },
+        // get indexes of all columns
+        getIndexes() {
+            return this.children.map((child) => child.data.currentIndex);
+        },
+        // set indexes of all columns
+        setIndexes(indexes) {
+            const stack = indexes.map((optionIndex, columnIndex) => this.setColumnIndex(columnIndex, optionIndex));
+            return Promise.all(stack);
+        }
+    }
+});

+ 7 - 0
components/vant-ui/picker/index.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "picker-column": "../picker-column/index",
+    "loading": "../loading/index"
+  }
+}

+ 41 - 0
components/vant-ui/picker/index.wxml

@@ -0,0 +1,41 @@
+<import src="./toolbar.wxml" />
+
+<view class="van-picker custom-class">
+  <template is="toolbar" wx:if="{{ toolbarPosition === 'top' }}" data="{{ showToolbar, cancelButtonText, title, confirmButtonText }}"></template>
+  <view wx:if="{{ loading }}" class="van-picker__loading">
+    <loading color="#1989fa"/>
+  </view>
+  <view
+    class="van-picker__columns"
+    style="height: {{ itemHeight * visibleItemCount }}px"
+    catch:touchmove="noop"
+  >
+    <picker-column
+      class="van-picker__column"
+      wx:for="{{ isSimple(columns) ? [columns] : columns }}"
+      wx:key="index"
+      data-index="{{ index }}"
+      custom-class="column-class"
+      value-key="{{ valueKey }}"
+      initial-options="{{ isSimple(columns) ? item : item.values }}"
+      default-index="{{ item.defaultIndex || defaultIndex }}"
+      item-height="{{ itemHeight }}"
+      visible-item-count="{{ visibleItemCount }}"
+      active-class="active-class"
+      bind:change="onChange"
+    />
+    <view class="van-picker__mask" style="background-size: 100% {{ (itemHeight * visibleItemCount - itemHeight) / 2 }}px" />
+    <view
+      class="van-picker__frame van-hairline--top-bottom"
+      style="height: {{ itemHeight }}px"
+    />
+  </view>
+  <template is="toolbar" wx:if="{{ toolbarPosition === 'bottom' }}" data="{{ showToolbar, cancelButtonText, title, confirmButtonText }}"></template>
+</view>
+
+<wxs module="isSimple">
+  function isSimple(columns) {
+    return columns.length && !columns[0].values;
+  }
+  module.exports = isSimple;
+</wxs>

File diff suppressed because it is too large
+ 1 - 0
components/vant-ui/picker/index.wxss


+ 21 - 0
components/vant-ui/picker/shared.d.ts

@@ -0,0 +1,21 @@
+export declare const pickerProps: {
+    title: StringConstructor;
+    loading: BooleanConstructor;
+    showToolbar: BooleanConstructor;
+    cancelButtonText: {
+        type: StringConstructor;
+        value: string;
+    };
+    confirmButtonText: {
+        type: StringConstructor;
+        value: string;
+    };
+    visibleItemCount: {
+        type: NumberConstructor;
+        value: number;
+    };
+    itemHeight: {
+        type: NumberConstructor;
+        value: number;
+    };
+};

+ 21 - 0
components/vant-ui/picker/shared.js

@@ -0,0 +1,21 @@
+export const pickerProps = {
+    title: String,
+    loading: Boolean,
+    showToolbar: Boolean,
+    cancelButtonText: {
+        type: String,
+        value: '取消'
+    },
+    confirmButtonText: {
+        type: String,
+        value: '确认'
+    },
+    visibleItemCount: {
+        type: Number,
+        value: 5
+    },
+    itemHeight: {
+        type: Number,
+        value: 44
+    }
+};

+ 28 - 0
components/vant-ui/picker/toolbar.wxml

@@ -0,0 +1,28 @@
+<template name="toolbar">
+  <view
+    wx:if="{{ showToolbar }}"
+    class="van-picker__toolbar van-hairline--top-bottom toolbar-class"
+  >
+    <view
+      class="van-picker__cancel"
+      hover-class="van-picker__cancel--hover"
+      hover-stay-time="70"
+      data-type="cancel"
+      bindtap="emit"
+    >
+      {{ cancelButtonText }}
+    </view>
+    <view wx:if="{{ title }}" class="van-picker__title van-ellipsis">{{
+      title
+    }}</view>
+    <view
+      class="van-picker__confirm"
+      hover-class="van-picker__confirm--hover"
+      hover-stay-time="70"
+      data-type="confirm"
+      bindtap="emit"
+    >
+      {{ confirmButtonText }}
+    </view>
+  </view>
+</template>

+ 1 - 0
components/vant-ui/sticky/index.d.ts

@@ -0,0 +1 @@
+export {};

+ 99 - 0
components/vant-ui/sticky/index.js

@@ -0,0 +1,99 @@
+import { VantComponent } from '../common/component';
+import { pageScrollMixin } from '../mixins/page-scroll';
+const ROOT_ELEMENT = '.van-sticky';
+VantComponent({
+    props: {
+        zIndex: {
+            type: Number,
+            value: 99
+        },
+        offsetTop: {
+            type: Number,
+            value: 0,
+            observer: 'onScroll'
+        },
+        disabled: {
+            type: Boolean,
+            observer: 'onScroll'
+        },
+        container: {
+            type: null,
+            observer: 'onScroll'
+        }
+    },
+    mixins: [
+        pageScrollMixin(function (event) {
+            this.onScroll(event);
+        })
+    ],
+    data: {
+        height: 0,
+        fixed: false,
+        transform: 0
+    },
+    mounted() {
+        this.onScroll();
+    },
+    methods: {
+        onScroll({ scrollTop } = {}) {
+            const { container, offsetTop, disabled } = this.data;
+            if (disabled) {
+                this.setDataAfterDiff({
+                    fixed: false,
+                    transform: 0
+                });
+                return;
+            }
+            this.scrollTop = scrollTop || this.scrollTop;
+            if (typeof container === 'function') {
+                Promise.all([this.getRect(ROOT_ELEMENT), this.getContainerRect()]).then(([root, container]) => {
+                    if (offsetTop + root.height > container.height + container.top) {
+                        this.setDataAfterDiff({
+                            fixed: false,
+                            transform: container.height - root.height
+                        });
+                    }
+                    else if (offsetTop >= root.top) {
+                        this.setDataAfterDiff({
+                            fixed: true,
+                            height: root.height,
+                            transform: 0
+                        });
+                    }
+                    else {
+                        this.setDataAfterDiff({ fixed: false, transform: 0 });
+                    }
+                });
+                return;
+            }
+            this.getRect(ROOT_ELEMENT).then((root) => {
+                if (offsetTop >= root.top) {
+                    this.setDataAfterDiff({ fixed: true, height: root.height });
+                    this.transform = 0;
+                }
+                else {
+                    this.setDataAfterDiff({ fixed: false });
+                }
+            });
+        },
+        setDataAfterDiff(data) {
+            wx.nextTick(() => {
+                const diff = Object.keys(data).reduce((prev, key) => {
+                    if (data[key] !== this.data[key]) {
+                        prev[key] = data[key];
+                    }
+                    return prev;
+                }, {});
+                this.setData(diff);
+                this.$emit('scroll', {
+                    scrollTop: this.scrollTop,
+                    isFixed: data.fixed || this.data.fixed
+                });
+            });
+        },
+        getContainerRect() {
+            const nodesRef = this.data.container();
+            return new Promise(resolve => nodesRef.boundingClientRect(resolve).exec());
+        }
+    }
+});

+ 0 - 0
components/vant-ui/sticky/index.json


Some files were not shown because too many files changed in this diff