├── .gitignore ├── CHANGELOG.zh-CN.md ├── LICENSE ├── README.md ├── build ├── compoents.png ├── node-upload-server │ ├── .gitignore │ ├── README.md │ ├── app.js │ └── package.json ├── pic │ ├── postman-upload-image.png │ └── postman-view-image.png └── repo │ ├── dist1.4.0.zip │ ├── dist1.4.4.zip │ ├── dist1.5.2.zip │ ├── dist1.6.6.zip │ └── dist1.8.5.zip └── src ├── .gitignore ├── App.vue ├── common ├── components.js ├── mpShare.js ├── page.js ├── style.scss └── tools.js ├── components ├── gap.vue └── wrap.vue ├── main.js ├── manifest.json ├── package.json ├── pages.json ├── pages ├── action-sheet │ └── action-sheet.vue ├── area │ ├── area.js │ └── area.vue ├── badge │ └── badge.vue ├── button │ └── button.vue ├── calendar │ └── calendar.vue ├── card │ └── card.vue ├── cell │ └── cell.vue ├── checkbox │ └── checkbox.vue ├── circle │ └── circle.vue ├── col │ └── col.vue ├── collapse │ └── collapse.vue ├── config-provider │ └── config-provider.vue ├── count-down │ └── count-down.vue ├── dashboard │ ├── dashboard.vue │ ├── tml.vue │ └── tool.vue ├── datetime-picker │ └── datetime-picker.vue ├── dialog │ └── dialog.vue ├── divider │ └── divider.vue ├── dropdown │ └── dropdown.vue ├── empty │ └── empty.vue ├── field │ └── field.vue ├── goods-action │ └── goods-action.vue ├── grid │ └── grid.vue ├── icon │ └── icon.vue ├── image │ └── image.vue ├── indexbar │ └── indexbar.vue ├── loading │ └── loading.vue ├── navbar │ └── navbar.vue ├── notice-bar │ └── notice-bar.vue ├── notify │ └── notify.vue ├── overlay │ └── overlay.vue ├── panel │ └── panel.vue ├── picker │ └── picker.vue ├── popup │ └── popup.vue ├── progress │ └── progress.vue ├── radio │ └── radio.vue ├── rate │ └── rate.vue ├── search │ └── search.vue ├── share-sheet │ └── share-sheet.vue ├── sidebar │ └── sidebar.vue ├── skeleton │ └── skeleton.vue ├── slider │ └── slider.vue ├── stepper │ └── stepper.vue ├── steps │ └── steps.vue ├── sticky │ └── sticky.vue ├── submit-bar │ └── submit-bar.vue ├── swipe-cell │ └── swipe-cell.vue ├── switch │ └── switch.vue ├── tab │ └── tab.vue ├── tabbar │ └── tabbar.vue ├── tag │ └── tag.vue ├── toast │ └── toast.vue ├── transition │ └── transition.vue ├── tree-select │ ├── config.js │ └── tree-select.vue └── uploader │ └── uploader.vue ├── pagesA └── sytle │ └── sytle.vue ├── pagesB └── index │ └── index.vue ├── static ├── img │ ├── qa.png │ ├── release.png │ ├── tabbar │ │ ├── clue.png │ │ ├── clueactive.png │ │ ├── tmpl.png │ │ ├── tmplactive.png │ │ ├── tool.png │ │ └── toolactive.png │ └── video.png ├── logo.png └── sample1.png ├── uni.scss ├── utils └── vantRegister.js └── wxcomponents └── vant ├── action-sheet ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── area ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── button ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── calendar ├── calendar.wxml ├── components │ ├── header │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── month │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxs │ │ └── index.wxss ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── utils.d.ts ├── utils.js └── utils.wxs ├── card ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── cell-group ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── cell ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── checkbox-group ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── checkbox ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── circle ├── canvas.d.ts ├── canvas.js ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── col ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── collapse-item ├── animate.d.ts ├── animate.js ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── collapse ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── common ├── color.d.ts ├── color.js ├── component.d.ts ├── component.js ├── index.wxss ├── relation.d.ts ├── relation.js ├── style │ ├── clearfix.wxss │ ├── ellipsis.wxss │ ├── hairline.wxss │ ├── mixins │ │ ├── clearfix.wxss │ │ ├── ellipsis.wxss │ │ └── hairline.wxss │ ├── theme.wxss │ └── var.wxss ├── utils.d.ts ├── utils.js ├── validator.d.ts ├── validator.js ├── version.d.ts └── version.js ├── config-provider ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxs ├── count-down ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxss ├── utils.d.ts └── utils.js ├── datetime-picker ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── definitions ├── index.d.ts └── index.js ├── dialog ├── dialog.d.ts ├── dialog.js ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── divider ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── dropdown-item ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxss ├── shared.d.ts └── shared.js ├── dropdown-menu ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── empty ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── field ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── input.wxml ├── props.d.ts ├── props.js └── textarea.wxml ├── goods-action-button ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── goods-action-icon ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── goods-action ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── grid-item ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── grid ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── icon ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── image ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── index-anchor ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── index-bar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── info ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── loading ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── mixins ├── basic.d.ts ├── basic.js ├── button.d.ts ├── button.js ├── link.d.ts ├── link.js ├── page-scroll.d.ts ├── page-scroll.js ├── touch.d.ts ├── touch.js ├── transition.d.ts └── transition.js ├── nav-bar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── notice-bar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── notify ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── notify.d.ts └── notify.js ├── overlay ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── panel ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── picker-column ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── picker ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── shared.d.ts ├── shared.js └── toolbar.wxml ├── popup ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── progress ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── radio-group ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── radio ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── rate ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── row ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── search ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── share-sheet ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── options.d.ts ├── options.js ├── options.json ├── options.wxml ├── options.wxs └── options.wxss ├── sidebar-item ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── sidebar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── skeleton ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── slider ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── stepper ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── steps ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── sticky ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── submit-bar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── swipe-cell ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── switch ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── tab ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── tabbar-item ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── tabbar ├── index.d.ts ├── index.js ├── index.json ├── index.wxml └── index.wxss ├── tabs ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── tag ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── toast ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxss ├── toast.d.ts └── toast.js ├── transition ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── tree-select ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs └── index.wxss ├── uploader ├── index.d.ts ├── index.js ├── index.json ├── index.wxml ├── index.wxs ├── index.wxss ├── shared.d.ts ├── shared.js ├── utils.d.ts └── utils.js └── wxs ├── add-unit.wxs ├── array.wxs ├── bem.wxs ├── memoize.wxs ├── object.wxs ├── style.wxs └── utils.wxs /CHANGELOG.zh-CN.md: -------------------------------------------------------------------------------- 1 | # 更新日志 2 | 3 | 🐞 🤖 🛠 🔥 🌐 🎉 📦 🗑 💄 🆕 4 | 5 | ## 1.3.1 6 | 7 | `2021-0x-xx` 8 | 9 | - 🌟 `优化` 🎉 优化原有全部组件演示示例。 10 | - 🆕 `新增` 新增组件`ConfigProvider`、内置样式演示示例。 11 | 12 | ## 1.3.0 13 | 14 | `2021-08-30` 15 | 16 | - 💄 `优化` 小程序分享功能,通过 mixin 的形式简单引入。 17 | - 💄 `优化` 示例展示容器组件 `wrap` 优化 CSS。 18 | - 🆕 `新增` 创建间隔槽组件 `gap`。 19 | - 🌟 `优化` 组件`button`示例优化。 20 | 21 | ## 1.2.2 22 | 23 | `2021-01-30` 24 | 25 | - 🎉 升级 `vant-weapp` 版本至 `1.6.7`,增加新功能示例,优化原有功能。 26 | 27 | ## 1.1.0 28 | 29 | `2020-04-30` 30 | 31 | - 🎉 升级 `vant-weapp` 版本至 `1.2.1`,增加新功能示例,优化原有功能。 32 | 33 | ## 1.0.0 34 | 35 | `2020-02-19` 36 | 37 | - 🎉 发布演示示例。 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Anduril 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VantUI Uniapp 示例 2 | 3 | 本示例原本是从 vant 官方发布的微信演示示例转换而来,支持微信小程序(H5 不支持!!)。 vant-weapp 版本为 1.6.7. 4 | 5 | vant weapp 的组件库,都在工程的 wxcomponents 目录下。pages 目录下是各个示例页面。 6 | 7 | ## 图片上传服务 8 | 9 | 提供了图片 Nodejs 服务 ,代码路径为\src\node-image-upload-server 10 | 11 | 安装 npm 包 12 | 13 | ``` 14 | npm install 15 | ``` 16 | 17 | 运行服务 18 | 19 | ``` 20 | node app 21 | ``` 22 | 23 | ## 感谢 24 | 25 | 本示例参考了依据官网增加了新控件的使用示例。 🔥 Vant 文档网站 26 | 27 | ## 更新日志 28 | -------------------------------------------------------------------------------- /build/compoents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/compoents.png -------------------------------------------------------------------------------- /build/node-upload-server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode 3 | 4 | # Ignore Mac OS desktop services store 5 | .DS_Store 6 | 7 | # Ignore Windows desktop setting file 8 | desktop.ini 9 | 10 | 11 | 12 | *.log 13 | .idea 14 | 15 | images/* 16 | uploads/* 17 | 18 | package-lock.json -------------------------------------------------------------------------------- /build/node-upload-server/README.md: -------------------------------------------------------------------------------- 1 | # Node.js server to upload Images 2 | 3 | ## To run the project 4 | 5 | 1.Switch to __node-image-upload-server__ directory, 6 | ``` 7 | cd node-image-upload-server 8 | ``` 9 | 2.Create __images__ directory 10 | ``` 11 | mkdir images 12 | ``` 13 | 3.Download dependencies 14 | ``` 15 | npm install 16 | ``` 17 | 4.Run the project 18 | ``` 19 | node app 20 | ``` 21 | ## Postman config to Test 22 | 23 | ## API 24 | /uploads 上传服务 25 | /downloads/filename 下载服务 26 | 27 | ## Tutorial 28 | https://www.learn2crack.com/2017/08/node-js-server-upload-images.html -------------------------------------------------------------------------------- /build/node-upload-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-image-upload-server", 3 | "version": "1.0.0", 4 | "description": "Upload images from mobile client to node js server", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "dev": "node app.js" 9 | }, 10 | "author": "Anduril", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.16.2", 14 | "file-type": "^7.4.0", 15 | "multer": "^1.3.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /build/pic/postman-upload-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/pic/postman-upload-image.png -------------------------------------------------------------------------------- /build/pic/postman-view-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/pic/postman-view-image.png -------------------------------------------------------------------------------- /build/repo/dist1.4.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/repo/dist1.4.0.zip -------------------------------------------------------------------------------- /build/repo/dist1.4.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/repo/dist1.4.4.zip -------------------------------------------------------------------------------- /build/repo/dist1.5.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/repo/dist1.5.2.zip -------------------------------------------------------------------------------- /build/repo/dist1.6.6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/repo/dist1.6.6.zip -------------------------------------------------------------------------------- /build/repo/dist1.8.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/build/repo/dist1.8.5.zip -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | unpackage 29 | 30 | # uniapp idea hbuilder 31 | .hbuilderx 32 | 33 | package-lock.json 34 | yarn.lock -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 45 | -------------------------------------------------------------------------------- /src/common/mpShare.js: -------------------------------------------------------------------------------- 1 | // Vant Weapp 页面配置 2 | export default{ 3 | data(){ 4 | return { 5 | //设置默认的分享参数 6 | share:{ 7 | title: 'vant-weapp uniapp demo', // 默认为小程序名称 8 | path: '', // 默认为当前页面路径 9 | imageUrl: '', // 默认为当前页面的截图 10 | } 11 | } 12 | }, 13 | 14 | onShareAppMessage() { 15 | return { 16 | title:this.share.title, 17 | path:this.share.path, 18 | imageUrl:this.share.imageUrl 19 | } 20 | }, 21 | // 分享到朋友圈 22 | // #ifdef MP-WEIXIN 23 | onShareTimeline() { 24 | return { 25 | title:this.share.title, 26 | path:this.share.path, 27 | imageUrl:this.share.imageUrl 28 | } 29 | } 30 | // #endif 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/common/page.js: -------------------------------------------------------------------------------- 1 | // Vant Weapp 页面配置 2 | export default{ 3 | data(){ 4 | return { 5 | //设置默认的分享参数 6 | share:{ 7 | title: 'vant-weapp ui', // 默认为小程序名称 8 | path: '', // 默认为当前页面路径 9 | imageUrl: '', // 默认为当前页面的截图 10 | desc:'', 11 | content:'' 12 | } 13 | } 14 | }, 15 | 16 | onShareAppMessage() { 17 | return { 18 | title:this.share.title, 19 | path:this.share.path, 20 | imageUrl:this.share.imageUrl, 21 | desc:this.share.desc, 22 | content:this.share.content, 23 | success(res){ 24 | uni.showToast({ 25 | title:'分享成功' 26 | }) 27 | }, 28 | fail(res){ 29 | uni.showToast({ 30 | title:'分享失败', 31 | icon:'none' 32 | }) 33 | } 34 | } 35 | }, 36 | // 朋友圈分享 37 | // #ifdef MP-WEIXIN 38 | onShareTimeline() { 39 | return { 40 | title:this.share.title, 41 | path:this.share.path, 42 | imageUrl:this.share.imageUrl 43 | } 44 | } 45 | // #endif 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/common/tools.js: -------------------------------------------------------------------------------- 1 | /* vant 组件功能菜单 */ 2 | export default [{ 3 | groupName: '组件配置', 4 | list: [{ 5 | path: '/sytle', 6 | title: '内置样式' 7 | }, 8 | 9 | ] 10 | }]; 11 | -------------------------------------------------------------------------------- /src/components/gap.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/wrap.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ title }} 4 | 5 | 6 | 7 | 8 | 9 | 19 | 32 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import share from '@/common/mpShare.js' 4 | 5 | import wrap from '@/components/wrap.vue'; 6 | import gap from '@/components/gap.vue'; 7 | 8 | import Dialog from '@/wxcomponents/vant/dialog/dialog'; 9 | import Toast from '@/wxcomponents/vant/toast/toast'; 10 | import Notify from '@/wxcomponents/vant/notify/notify'; 11 | 12 | import dayJs from "dayjs"; 13 | import "dayjs/locale/zh-cn"; 14 | dayJs.locale("zh-cn"); 15 | import relativeTime from "dayjs/plugin/relativeTime"; 16 | dayJs.extend(relativeTime); 17 | 18 | 19 | 20 | 21 | // 阻止产生生产消息 22 | Vue.config.productionTip = false; 23 | App.mpType = 'app'; 24 | 25 | //注册组件 用于demo展示 26 | Vue.component('wrap', wrap) 27 | Vue.component('gap', gap) 28 | 29 | // 引入对小程序分享的mixin封装 30 | Vue.mixin(share) 31 | // 注册实例 全局方法 32 | Vue.prototype.$dialog = Dialog; 33 | Vue.prototype.$toast = Toast; 34 | Vue.prototype.$notify = Notify; 35 | Vue.prototype.$dayjs = dayJs; 36 | // 时间过滤器 37 | Vue.filter("filterTime", (value) => { 38 | return dayJs().to(value); 39 | }); 40 | 41 | const app = new Vue({ 42 | ...App 43 | }) 44 | app.$mount() 45 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mp-vant-weapp-uniapp", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "main.js", 6 | "dependencies": { 7 | "@vant/icons": "^1.4.0", 8 | "dayjs": "^1.10.6", 9 | "prettier": "^2.1.0" 10 | }, 11 | "devDependencies": {}, 12 | "scripts": { 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "author": "", 16 | "license": "MIT" 17 | } 18 | -------------------------------------------------------------------------------- /src/pages/badge/badge.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 37 | 38 | 50 | -------------------------------------------------------------------------------- /src/pages/dashboard/tml.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 模板页面 4 | 5 | 6 | 7 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /src/pages/loading/loading.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 努力哦加载中... 17 | 18 | 加载中... 19 | 20 | 21 | 29 | 30 | 35 | -------------------------------------------------------------------------------- /src/pages/navbar/navbar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /src/pages/panel/panel.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 内容 7 | 8 | 9 | 10 | 11 | 12 | 13 | 内容 14 | 15 | 按钮 16 | 按钮 17 | 18 | 19 | 20 | 21 | 22 | 23 | 32 | 33 | 43 | -------------------------------------------------------------------------------- /src/pages/progress/progress.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 26 | 27 | 32 | -------------------------------------------------------------------------------- /src/pages/submit-bar/submit-bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 标签 16 | 17 | 您的收货地址不支持同城送, 18 | 修改地址 19 | 20 | 21 | 22 | 23 | 24 | 25 | 40 | 45 | -------------------------------------------------------------------------------- /src/pages/tree-select/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | pro1Name: '浙江', 3 | pro1: [{ 4 | text: '杭州', 5 | id: 1 6 | }, { 7 | text: '温州', 8 | id: 2 9 | }, { 10 | text: '宁波', 11 | id: 3, 12 | disabled: true 13 | }, { 14 | text: '义乌', 15 | id: 4 16 | }], 17 | pro2Name: '江苏', 18 | pro2: [{ 19 | text: '南京', 20 | id: 5 21 | }, { 22 | text: '无锡', 23 | id: 6 24 | }, { 25 | text: '徐州', 26 | id: 7 27 | }, { 28 | text: '苏州', 29 | id: 8 30 | }], 31 | pro3Name: '福建', 32 | pro3: [{ 33 | text: '泉州', 34 | id: 9 35 | }, { 36 | text: '厦门', 37 | id: 10 38 | }] 39 | }; 40 | -------------------------------------------------------------------------------- /src/pagesB/index/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | PGBBBBBBBBBBBBBBB 文字省略 当文本内容长度超过容器最大宽度时,自动省略多余的文本。 4 | 5 | 6 | 这是一段宽度限制 250px 的文字,后面的内容会省略这是一段宽度限制 250px 的文字,后面的内容会省略这是一段宽度限制 250px 的文字,后面的内容会省略 7 | 8 | 9 | 10 | 11 | 这是一段最多显示两行的文字,后面的内容会省略这是一段最多显示两行的文字,后面的内容会省略这是一段最多显示两行的文字,后面的内容会省略这是一段最多显示两行的文字,后面的内容会省略这是一段最多显示两行的文字,后面的内容会省略 12 | 13 | 14 | 15 | 16 | 这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略这是一段最多显示三行的文字,后面的内容会省略 17 | 18 | 19 | 1px 边框 为元素添加 Retina 屏幕下的 1px 边框(即 hairline),基于伪类 transform 实现。 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/static/img/qa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/qa.png -------------------------------------------------------------------------------- /src/static/img/release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/release.png -------------------------------------------------------------------------------- /src/static/img/tabbar/clue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/clue.png -------------------------------------------------------------------------------- /src/static/img/tabbar/clueactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/clueactive.png -------------------------------------------------------------------------------- /src/static/img/tabbar/tmpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/tmpl.png -------------------------------------------------------------------------------- /src/static/img/tabbar/tmplactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/tmplactive.png -------------------------------------------------------------------------------- /src/static/img/tabbar/tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/tool.png -------------------------------------------------------------------------------- /src/static/img/tabbar/toolactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/tabbar/toolactive.png -------------------------------------------------------------------------------- /src/static/img/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/img/video.png -------------------------------------------------------------------------------- /src/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/logo.png -------------------------------------------------------------------------------- /src/static/sample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/static/sample1.png -------------------------------------------------------------------------------- /src/utils/vantRegister.js: -------------------------------------------------------------------------------- 1 | /* —————————————— Vant 组件注册 (需使用this方法的特殊组件): uniapp版 ———————————————— */ 2 | 3 | import Vue from 'vue' 4 | 5 | // import Dialog from '../wxcomponents/vant/dialog/dialog'; 6 | // import Toast from '../wxcomponents/vant/toast/toast'; 7 | // import Notify from '../wxcomponents/vant/notify/notify'; 8 | 9 | // Vue.prototype.$dialog = Dialog; 10 | // Vue.prototype.$toast = Toast; 11 | // Vue.prototype.$notify = Notify; 12 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/action-sheet/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/action-sheet/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-popup": "../popup/index", 6 | "van-loading": "../loading/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/area/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/area/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-picker": "../picker/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/area/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/area/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | function displayColumns(columns, columnsNum) { 3 | return columns.slice(0, +columnsNum); 4 | } 5 | 6 | module.exports = { 7 | displayColumns: displayColumns, 8 | }; 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/area/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/wxcomponents/vant/button/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/button/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | 4 | function rootStyle(data) { 5 | if (!data.color) { 6 | return data.customStyle; 7 | } 8 | 9 | var properties = { 10 | color: data.plain ? data.color : '#fff', 11 | background: data.plain ? null : data.color, 12 | }; 13 | 14 | // hide border when color is linear-gradient 15 | if (data.color.indexOf('gradient') !== -1) { 16 | properties.border = 0; 17 | } else { 18 | properties['border-color'] = data.color; 19 | } 20 | 21 | return style([properties, data.customStyle]); 22 | } 23 | 24 | function loadingColor(data) { 25 | if (data.plain) { 26 | return data.color ? data.color : '#c9c9c9'; 27 | } 28 | 29 | if (data.type === 'default') { 30 | return '#c9c9c9'; 31 | } 32 | 33 | return '#fff'; 34 | } 35 | 36 | module.exports = { 37 | rootStyle: rootStyle, 38 | loadingColor: loadingColor, 39 | }; 40 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/header/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/header/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../../../common/component'; 2 | VantComponent({ 3 | props: { 4 | title: { 5 | type: String, 6 | value: '日期选择', 7 | }, 8 | subtitle: String, 9 | showTitle: Boolean, 10 | showSubtitle: Boolean, 11 | firstDayOfWeek: { 12 | type: Number, 13 | observer: 'initWeekDay', 14 | }, 15 | }, 16 | data: { 17 | weekdays: [], 18 | }, 19 | created() { 20 | this.initWeekDay(); 21 | }, 22 | methods: { 23 | initWeekDay() { 24 | const defaultWeeks = ['日', '一', '二', '三', '四', '五', '六']; 25 | const firstDayOfWeek = this.data.firstDayOfWeek || 0; 26 | this.setData({ 27 | weekdays: [ 28 | ...defaultWeeks.slice(firstDayOfWeek, 7), 29 | ...defaultWeeks.slice(0, firstDayOfWeek), 30 | ], 31 | }); 32 | }, 33 | onClickSubtitle(event) { 34 | this.$emit('click-subtitle', event); 35 | }, 36 | }, 37 | }); 38 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/header/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/header/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | 6 | 7 | 8 | {{ subtitle }} 9 | 10 | 11 | 12 | 13 | {{ item }} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/header/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../../../common/index.wxss';.van-calendar__header{flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/month/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/components/month/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "header": "./components/header/index", 5 | "month": "./components/month/index", 6 | "van-button": "../button/index", 7 | "van-popup": "../popup/index", 8 | "van-toast": "../toast/index" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var utils = require('./utils.wxs'); 3 | 4 | function getMonths(minDate, maxDate) { 5 | var months = []; 6 | var cursor = getDate(minDate); 7 | 8 | cursor.setDate(1); 9 | 10 | do { 11 | months.push(cursor.getTime()); 12 | cursor.setMonth(cursor.getMonth() + 1); 13 | } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1); 14 | 15 | return months; 16 | } 17 | 18 | function getButtonDisabled(type, currentDate) { 19 | if (currentDate == null) { 20 | return true; 21 | } 22 | 23 | if (type === 'range') { 24 | return !currentDate[0] || !currentDate[1]; 25 | } 26 | 27 | if (type === 'multiple') { 28 | return !currentDate.length; 29 | } 30 | 31 | return !currentDate; 32 | } 33 | 34 | module.exports = { 35 | getMonths: getMonths, 36 | getButtonDisabled: getButtonDisabled 37 | }; 38 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-calendar{display:flex;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important} -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ROW_HEIGHT = 64; 2 | export declare function formatMonthTitle(date: Date): string; 3 | export declare function compareMonth( 4 | date1: Date | number, 5 | date2: Date | number 6 | ): 1 | -1 | 0; 7 | export declare function compareDay( 8 | day1: Date | number, 9 | day2: Date | number 10 | ): 1 | -1 | 0; 11 | export declare function getDayByOffset(date: Date, offset: number): Date; 12 | export declare function getPrevDay(date: Date): Date; 13 | export declare function getNextDay(date: Date): Date; 14 | export declare function getToday(): Date; 15 | export declare function calcDateNum(date: [Date, Date]): number; 16 | export declare function copyDates(dates: Date | Date[]): Date | Date[]; 17 | export declare function getMonthEndDay(year: number, month: number): number; 18 | export declare function getMonths(minDate: number, maxDate: number): number[]; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/calendar/utils.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | function getMonthEndDay(year, month) { 3 | return 32 - getDate(year, month - 1, 32).getDate(); 4 | } 5 | 6 | function compareMonth(date1, date2) { 7 | date1 = getDate(date1); 8 | date2 = getDate(date2); 9 | 10 | var year1 = date1.getFullYear(); 11 | var year2 = date2.getFullYear(); 12 | var month1 = date1.getMonth(); 13 | var month2 = date2.getMonth(); 14 | 15 | if (year1 === year2) { 16 | return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; 17 | } 18 | 19 | return year1 > year2 ? 1 : -1; 20 | } 21 | 22 | module.exports = { 23 | getMonthEndDay: getMonthEndDay, 24 | compareMonth: compareMonth 25 | }; 26 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/card/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/card/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: [ 5 | 'num-class', 6 | 'desc-class', 7 | 'thumb-class', 8 | 'title-class', 9 | 'price-class', 10 | 'origin-price-class', 11 | ], 12 | mixins: [link], 13 | props: { 14 | tag: String, 15 | num: String, 16 | desc: String, 17 | thumb: String, 18 | title: String, 19 | price: { 20 | type: String, 21 | observer: 'updatePrice', 22 | }, 23 | centered: Boolean, 24 | lazyLoad: Boolean, 25 | thumbLink: String, 26 | originPrice: String, 27 | thumbMode: { 28 | type: String, 29 | value: 'aspectFit', 30 | }, 31 | currency: { 32 | type: String, 33 | value: '¥', 34 | }, 35 | }, 36 | methods: { 37 | updatePrice() { 38 | const { price } = this.data; 39 | const priceArr = price.toString().split('.'); 40 | this.setData({ 41 | integerStr: priceArr[0], 42 | decimalStr: priceArr[1] ? `.${priceArr[1]}` : '', 43 | }); 44 | }, 45 | onClickThumb() { 46 | this.jumpLink('thumbLink'); 47 | }, 48 | }, 49 | }); 50 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/card/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-tag": "../tag/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | title: String, 5 | border: { 6 | type: Boolean, 7 | value: true, 8 | }, 9 | inset: Boolean, 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | {{ title }} 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-cell-group--inset{margin:0 16px;margin:var(--cell-group-inset-padding,0 16px);border-radius:8px;border-radius:var(--cell-group-inset-border-radius,8px);overflow:hidden}.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)}.van-cell-group__title--inset{padding:16px 16px 8px 32px;padding:var(--cell-group-inset-title-padding,16px 16px 8px 32px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: [ 5 | 'title-class', 6 | 'label-class', 7 | 'value-class', 8 | 'right-icon-class', 9 | 'hover-class', 10 | ], 11 | mixins: [link], 12 | props: { 13 | title: null, 14 | value: null, 15 | icon: String, 16 | size: String, 17 | label: String, 18 | center: Boolean, 19 | isLink: Boolean, 20 | required: Boolean, 21 | clickable: Boolean, 22 | titleWidth: String, 23 | customStyle: String, 24 | arrowDirection: String, 25 | useLabelSlot: Boolean, 26 | border: { 27 | type: Boolean, 28 | value: true, 29 | }, 30 | titleStyle: String, 31 | }, 32 | methods: { 33 | onClick(event) { 34 | this.$emit('click', event.detail); 35 | this.jumpLink(); 36 | }, 37 | }, 38 | }); 39 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/cell/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function titleStyle(data) { 6 | return style([ 7 | { 8 | 'max-width': addUnit(data.titleWidth), 9 | 'min-width': addUnit(data.titleWidth), 10 | }, 11 | data.titleStyle, 12 | ]); 13 | } 14 | 15 | module.exports = { 16 | titleStyle: titleStyle, 17 | }; 18 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | import { useChildren } from '../common/relation'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | field: true, 5 | relation: useChildren('checkbox', function (target) { 6 | this.updateChild(target); 7 | }), 8 | props: { 9 | max: Number, 10 | value: { 11 | type: Array, 12 | observer: 'updateChildren', 13 | }, 14 | disabled: { 15 | type: Boolean, 16 | observer: 'updateChildren', 17 | }, 18 | direction: { 19 | type: String, 20 | value: 'vertical', 21 | }, 22 | }, 23 | methods: { 24 | updateChildren() { 25 | this.children.forEach((child) => this.updateChild(child)); 26 | }, 27 | updateChild(child) { 28 | const { value, disabled, direction } = this.data; 29 | child.setData({ 30 | value: value.indexOf(child.data.name) !== -1, 31 | parentDisabled: disabled, 32 | direction, 33 | }); 34 | }, 35 | }, 36 | }); 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-checkbox-group--horizontal{display:flex;flex-wrap:wrap} -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/checkbox/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) { 6 | var styles = { 7 | 'font-size': addUnit(iconSize), 8 | }; 9 | 10 | if (checkedColor && value && !disabled && !parentDisabled) { 11 | styles['border-color'] = checkedColor; 12 | styles['background-color'] = checkedColor; 13 | } 14 | 15 | return style(styles); 16 | } 17 | 18 | module.exports = { 19 | iconStyle: iconStyle, 20 | }; 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/canvas.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare type CanvasContext = WechatMiniprogram.CanvasContext; 3 | export declare function adaptor( 4 | ctx: CanvasContext & Record 5 | ): CanvasContext; 6 | export {}; 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/canvas.js: -------------------------------------------------------------------------------- 1 | export function adaptor(ctx) { 2 | // @ts-ignore 3 | return Object.assign(ctx, { 4 | setStrokeStyle(val) { 5 | ctx.strokeStyle = val; 6 | }, 7 | setLineWidth(val) { 8 | ctx.lineWidth = val; 9 | }, 10 | setLineCap(val) { 11 | ctx.lineCap = val; 12 | }, 13 | setFillStyle(val) { 14 | ctx.fillStyle = val; 15 | }, 16 | setFontSize(val) { 17 | ctx.font = String(val); 18 | }, 19 | setGlobalAlpha(val) { 20 | ctx.globalAlpha = val; 21 | }, 22 | setLineJoin(val) { 23 | ctx.lineJoin = val; 24 | }, 25 | setTextAlign(val) { 26 | ctx.textAlign = val; 27 | }, 28 | setMiterLimit(val) { 29 | ctx.miterLimit = val; 30 | }, 31 | setShadow(offsetX, offsetY, blur, color) { 32 | ctx.shadowOffsetX = offsetX; 33 | ctx.shadowOffsetY = offsetY; 34 | ctx.shadowBlur = blur; 35 | ctx.shadowColor = color; 36 | }, 37 | setTextBaseline(val) { 38 | ctx.textBaseline = val; 39 | }, 40 | createCircularGradient() {}, 41 | draw() {}, 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ text }} 9 | 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/circle/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-circle{position:relative;display:inline-block;text-align:center}.van-circle__text{position:absolute;top:50%;left:0;width:100%;transform:translateY(-50%);color:#323233;color:var(--circle-text-color,#323233)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/col/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/col/index.js: -------------------------------------------------------------------------------- 1 | import { useParent } from '../common/relation'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | relation: useParent('row'), 5 | props: { 6 | span: Number, 7 | offset: Number, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/col/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/col/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/col/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | if (!data.gutter) { 7 | return ''; 8 | } 9 | 10 | return style({ 11 | 'padding-right': addUnit(data.gutter / 2), 12 | 'padding-left': addUnit(data.gutter / 2), 13 | }); 14 | } 15 | 16 | module.exports = { 17 | rootStyle: rootStyle, 18 | }; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse-item/animate.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare function setContentAnimate( 3 | context: WechatMiniprogram.Component.TrivialInstance, 4 | expanded: boolean, 5 | mounted: boolean 6 | ): void; 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 23 | 27 | 28 | 32 | 33 | 38 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{transform:rotate(90deg);transition:transform .3s;transition:transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useChildren } from '../common/relation'; 3 | VantComponent({ 4 | relation: useChildren('collapse-item'), 5 | props: { 6 | value: { 7 | type: null, 8 | observer: 'updateExpanded', 9 | }, 10 | accordion: { 11 | type: Boolean, 12 | observer: 'updateExpanded', 13 | }, 14 | border: { 15 | type: Boolean, 16 | value: true, 17 | }, 18 | }, 19 | methods: { 20 | updateExpanded() { 21 | this.children.forEach((child) => { 22 | child.updateExpanded(); 23 | }); 24 | }, 25 | switch(name, expanded) { 26 | const { accordion, value } = this.data; 27 | const changeItem = name; 28 | if (!accordion) { 29 | name = expanded 30 | ? (value || []).concat(name) 31 | : (value || []).filter((activeName) => activeName !== name); 32 | } else { 33 | name = expanded ? name : ''; 34 | } 35 | if (expanded) { 36 | this.$emit('open', changeItem); 37 | } else { 38 | this.$emit('close', changeItem); 39 | } 40 | this.$emit('change', name); 41 | this.$emit('input', name); 42 | }, 43 | }, 44 | }); 45 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/collapse/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/color.d.ts: -------------------------------------------------------------------------------- 1 | export declare const RED = "#ee0a24"; 2 | export declare const BLUE = "#1989fa"; 3 | export declare const WHITE = "#fff"; 4 | export declare const GREEN = "#07c160"; 5 | export declare const ORANGE = "#ff976a"; 6 | export declare const GRAY = "#323233"; 7 | export declare const GRAY_DARK = "#969799"; 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/color.js: -------------------------------------------------------------------------------- 1 | export const RED = '#ee0a24'; 2 | export const BLUE = '#1989fa'; 3 | export const WHITE = '#fff'; 4 | export const GREEN = '#07c160'; 5 | export const ORANGE = '#ff976a'; 6 | export const GRAY = '#323233'; 7 | export const GRAY_DARK = '#969799'; 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/component.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { VantComponentOptions } from '../definitions/index'; 3 | declare function VantComponent< 4 | Data extends WechatMiniprogram.Component.DataOption, 5 | Props extends WechatMiniprogram.Component.PropertyOption, 6 | Methods extends WechatMiniprogram.Component.MethodOption 7 | >(vantOptions: VantComponentOptions): void; 8 | export { VantComponent }; 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/index.wxss: -------------------------------------------------------------------------------- 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}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/relation.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; 3 | export declare function useParent( 4 | name: string, 5 | onEffect?: (this: TrivialInstance) => void 6 | ): { 7 | relations: { 8 | [x: string]: WechatMiniprogram.Component.RelationOption; 9 | }; 10 | mixin: string; 11 | }; 12 | export declare function useChildren( 13 | name: string, 14 | onEffect?: (this: TrivialInstance, target: TrivialInstance) => void 15 | ): { 16 | relations: { 17 | [x: string]: WechatMiniprogram.Component.RelationOption; 18 | }; 19 | mixin: string; 20 | }; 21 | export {}; 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/clearfix.wxss: -------------------------------------------------------------------------------- 1 | .van-clearfix:after{display:table;clear:both;content:""} -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/ellipsis.wxss: -------------------------------------------------------------------------------- 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} -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/hairline.wxss: -------------------------------------------------------------------------------- 1 | .van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/mixins/clearfix.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/wxcomponents/vant/common/style/mixins/clearfix.wxss -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/mixins/ellipsis.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/wxcomponents/vant/common/style/mixins/ellipsis.wxss -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/mixins/hairline.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/wxcomponents/vant/common/style/mixins/hairline.wxss -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/theme.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/wxcomponents/vant/common/style/theme.wxss -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/style/var.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andurils/vant-weapp-uniapp/772ce4e17dd0ea924012a4123ccdd6ec9b91ad72/src/wxcomponents/vant/common/style/var.wxss -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/validator.d.ts: -------------------------------------------------------------------------------- 1 | export declare function isFunction(val: unknown): val is Function; 2 | export declare function isPlainObject( 3 | val: unknown 4 | ): val is Record; 5 | export declare function isPromise(val: unknown): val is Promise; 6 | export declare function isDef(value: unknown): boolean; 7 | export declare function isObj(x: unknown): x is Record; 8 | export declare function isNumber(value: string): boolean; 9 | export declare function isBoolean(value: unknown): value is boolean; 10 | export declare function isImageUrl(url: string): boolean; 11 | export declare function isVideoUrl(url: string): boolean; 12 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/validator.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/ban-types 2 | export function isFunction(val) { 3 | return typeof val === 'function'; 4 | } 5 | export function isPlainObject(val) { 6 | return val !== null && typeof val === 'object' && !Array.isArray(val); 7 | } 8 | export function isPromise(val) { 9 | return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch); 10 | } 11 | export function isDef(value) { 12 | return value !== undefined && value !== null; 13 | } 14 | export function isObj(x) { 15 | const type = typeof x; 16 | return x !== null && (type === 'object' || type === 'function'); 17 | } 18 | export function isNumber(value) { 19 | return /^\d+(\.\d+)?$/.test(value); 20 | } 21 | export function isBoolean(value) { 22 | return typeof value === 'boolean'; 23 | } 24 | const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i; 25 | const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i; 26 | export function isImageUrl(url) { 27 | return IMAGE_REGEXP.test(url); 28 | } 29 | export function isVideoUrl(url) { 30 | return VIDEO_REGEXP.test(url); 31 | } 32 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/version.d.ts: -------------------------------------------------------------------------------- 1 | export declare function canIUseModel(): boolean; 2 | export declare function canIUseFormFieldButton(): boolean; 3 | export declare function canIUseAnimate(): boolean; 4 | export declare function canIUseGroupSetData(): boolean; 5 | export declare function canIUseNextTick(): boolean; 6 | export declare function canIUseCanvas2d(): boolean; 7 | export declare function canIUseGetUserProfile(): boolean; 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/common/version.js: -------------------------------------------------------------------------------- 1 | import { getSystemInfoSync } from './utils'; 2 | function compareVersion(v1, v2) { 3 | v1 = v1.split('.'); 4 | v2 = v2.split('.'); 5 | const len = Math.max(v1.length, v2.length); 6 | while (v1.length < len) { 7 | v1.push('0'); 8 | } 9 | while (v2.length < len) { 10 | v2.push('0'); 11 | } 12 | for (let i = 0; i < len; i++) { 13 | const num1 = parseInt(v1[i], 10); 14 | const num2 = parseInt(v2[i], 10); 15 | if (num1 > num2) { 16 | return 1; 17 | } 18 | if (num1 < num2) { 19 | return -1; 20 | } 21 | } 22 | return 0; 23 | } 24 | function gte(version) { 25 | const system = getSystemInfoSync(); 26 | return compareVersion(system.SDKVersion, version) >= 0; 27 | } 28 | export function canIUseModel() { 29 | return gte('2.9.3'); 30 | } 31 | export function canIUseFormFieldButton() { 32 | return gte('2.10.3'); 33 | } 34 | export function canIUseAnimate() { 35 | return gte('2.9.0'); 36 | } 37 | export function canIUseGroupSetData() { 38 | return gte('2.4.0'); 39 | } 40 | export function canIUseNextTick() { 41 | return wx.canIUse('nextTick'); 42 | } 43 | export function canIUseCanvas2d() { 44 | return gte('2.9.0'); 45 | } 46 | export function canIUseGetUserProfile() { 47 | return !!wx.getUserProfile; 48 | } 49 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/config-provider/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/config-provider/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | themeVars: { 5 | type: Object, 6 | value: {}, 7 | }, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/config-provider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/config-provider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/config-provider/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var object = require('../wxs/object.wxs'); 3 | var style = require('../wxs/style.wxs'); 4 | 5 | function kebabCase(word) { 6 | var newWord = word 7 | .replace(getRegExp("[A-Z]", 'g'), function (i) { 8 | return '-' + i; 9 | }) 10 | .toLowerCase() 11 | .replace(getRegExp("^-"), ''); 12 | 13 | return newWord; 14 | } 15 | 16 | function mapThemeVarsToCSSVars(themeVars) { 17 | var cssVars = {}; 18 | object.keys(themeVars).forEach(function (key) { 19 | var cssVarsKey = '--' + kebabCase(key); 20 | cssVars[cssVarsKey] = themeVars[key]; 21 | }); 22 | 23 | return style(cssVars); 24 | } 25 | 26 | module.exports = { 27 | kebabCase: kebabCase, 28 | mapThemeVarsToCSSVars: mapThemeVarsToCSSVars, 29 | }; 30 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/count-down/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/count-down/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/count-down/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ formattedTime }} 4 | 5 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/count-down/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-count-down{color:#323233;color:var(--count-down-text-color,#323233);font-size:14px;font-size:var(--count-down-font-size,14px);line-height:20px;line-height:var(--count-down-line-height,20px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/count-down/utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare type TimeData = { 2 | days: number; 3 | hours: number; 4 | minutes: number; 5 | seconds: number; 6 | milliseconds: number; 7 | }; 8 | export declare function parseTimeData(time: number): TimeData; 9 | export declare function parseFormat(format: string, timeData: TimeData): string; 10 | export declare function isSameSecond(time1: number, time2: number): boolean; 11 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/datetime-picker/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/datetime-picker/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-picker": "../picker/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/datetime-picker/index.wxml: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/datetime-picker/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/wxcomponents/vant/definitions/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | interface VantComponentInstance { 3 | parent: WechatMiniprogram.Component.TrivialInstance; 4 | children: WechatMiniprogram.Component.TrivialInstance[]; 5 | index: number; 6 | $emit: ( 7 | name: string, 8 | detail?: unknown, 9 | options?: WechatMiniprogram.Component.TriggerEventOption 10 | ) => void; 11 | } 12 | export declare type VantComponentOptions< 13 | Data extends WechatMiniprogram.Component.DataOption, 14 | Props extends WechatMiniprogram.Component.PropertyOption, 15 | Methods extends WechatMiniprogram.Component.MethodOption 16 | > = { 17 | data?: Data; 18 | field?: boolean; 19 | classes?: string[]; 20 | mixins?: string[]; 21 | props?: Props; 22 | relation?: { 23 | relations: Record; 24 | mixin: string; 25 | }; 26 | methods?: Methods; 27 | beforeCreate?: () => void; 28 | created?: () => void; 29 | mounted?: () => void; 30 | destroyed?: () => void; 31 | } & ThisType< 32 | VantComponentInstance & 33 | WechatMiniprogram.Component.Instance< 34 | Data & { 35 | name: string; 36 | value: any; 37 | } & Record, 38 | Props, 39 | Methods 40 | > & 41 | Record 42 | >; 43 | export {}; 44 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/definitions/index.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dialog/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dialog/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "van-button": "../button/index", 6 | "van-goods-action": "../goods-action/index", 7 | "van-goods-action-button": "../goods-action-button/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | dashed: Boolean, 5 | hairline: Boolean, 6 | contentPosition: String, 7 | fontSize: String, 8 | borderColor: String, 9 | textColor: String, 10 | customStyle: String, 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } 5 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | return style([ 7 | { 8 | 'border-color': data.borderColor, 9 | color: data.textColor, 10 | 'font-size': addUnit(data.fontSize), 11 | }, 12 | data.customStyle, 13 | ]); 14 | } 15 | 16 | module.exports = { 17 | rootStyle: rootStyle, 18 | }; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/divider/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-divider{display:flex;align-items:center;margin:16px 0;margin:var(--divider-margin,16px 0);color:#969799;color:var(--divider-text-color,#969799);font-size:14px;font-size:var(--divider-font-size,14px);line-height:24px;line-height:var(--divider-line-height,24px);border:0 solid #ebedf0;border-color:var(--divider-border-color,#ebedf0)}.van-divider:after,.van-divider:before{display:block;flex:1;box-sizing:border-box;height:1px;border-color:inherit;border-style:inherit;border-width:1px 0 0}.van-divider:before{content:""}.van-divider--hairline:after,.van-divider--hairline:before{transform:scaleY(.5)}.van-divider--dashed{border-style:dashed}.van-divider--center:before,.van-divider--left:before,.van-divider--right:before{margin-right:16px;margin-right:var(--divider-content-padding,16px)}.van-divider--center:after,.van-divider--left:after,.van-divider--right:after{content:"";margin-left:16px;margin-left:var(--divider-content-padding,16px)}.van-divider--left:before{max-width:10%;max-width:var(--divider-content-left-width,10%)}.van-divider--right:after{max-width:10%;max-width:var(--divider-content-right-width,10%)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "van-cell": "../cell/index", 6 | "van-icon": "../icon/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit} -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-item/shared.d.ts: -------------------------------------------------------------------------------- 1 | export interface Option { 2 | text: string; 3 | value: string | number; 4 | icon: string; 5 | } 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-item/shared.js: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-menu/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-menu/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-menu/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 16 | 17 | {{ computed.displayTitle(item) }} 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-menu/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | function displayTitle(item) { 3 | if (item.title) { 4 | return item.title; 5 | } 6 | 7 | var match = item.options.filter(function(option) { 8 | return option.value === item.value; 9 | }); 10 | var displayTitle = match.length ? match[0].text : ''; 11 | return displayTitle; 12 | } 13 | 14 | module.exports = { 15 | displayTitle: displayTitle 16 | }; 17 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/dropdown-menu/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-dropdown-menu{display:flex;box-shadow:0 2px 12px rgba(100,101,102,.12);-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#ee0a24;color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | description: String, 5 | image: { 6 | type: String, 7 | value: 'default', 8 | }, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {{ description }} 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var PRESETS = ['error', 'search', 'default', 'network']; 3 | 4 | function imageUrl(image) { 5 | if (PRESETS.indexOf(image) !== -1) { 6 | return 'https://img.yzcdn.cn/vant/empty-image-' + image + '.png'; 7 | } 8 | 9 | return image; 10 | } 11 | 12 | module.exports = { 13 | imageUrl: imageUrl, 14 | }; 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/empty/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px} -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function inputStyle(autosize) { 6 | if (autosize && autosize.constructor === 'Object') { 7 | return style({ 8 | 'min-height': addUnit(autosize.minHeight), 9 | 'max-height': addUnit(autosize.maxHeight), 10 | }); 11 | } 12 | 13 | return ''; 14 | } 15 | 16 | module.exports = { 17 | inputStyle: inputStyle, 18 | }; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/input.wxml: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/props.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const commonProps: WechatMiniprogram.Component.PropertyOption; 3 | export declare const inputProps: WechatMiniprogram.Component.PropertyOption; 4 | export declare const textareaProps: WechatMiniprogram.Component.PropertyOption; 5 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/props.js: -------------------------------------------------------------------------------- 1 | export const commonProps = { 2 | value: { 3 | type: String, 4 | observer(value) { 5 | if (value !== this.value) { 6 | this.setData({ innerValue: value }); 7 | this.value = value; 8 | } 9 | }, 10 | }, 11 | placeholder: String, 12 | placeholderStyle: String, 13 | placeholderClass: String, 14 | disabled: Boolean, 15 | maxlength: { 16 | type: Number, 17 | value: -1, 18 | }, 19 | cursorSpacing: { 20 | type: Number, 21 | value: 50, 22 | }, 23 | autoFocus: Boolean, 24 | focus: Boolean, 25 | cursor: { 26 | type: Number, 27 | value: -1, 28 | }, 29 | selectionStart: { 30 | type: Number, 31 | value: -1, 32 | }, 33 | selectionEnd: { 34 | type: Number, 35 | value: -1, 36 | }, 37 | adjustPosition: { 38 | type: Boolean, 39 | value: true, 40 | }, 41 | holdKeyboard: Boolean, 42 | }; 43 | export const inputProps = { 44 | type: { 45 | type: String, 46 | value: 'text', 47 | }, 48 | password: Boolean, 49 | confirmType: String, 50 | confirmHold: Boolean, 51 | }; 52 | export const textareaProps = { 53 | autoHeight: Boolean, 54 | fixed: Boolean, 55 | showConfirmBar: { 56 | type: Boolean, 57 | value: true, 58 | }, 59 | disableDefaultPadding: { 60 | type: Boolean, 61 | value: true, 62 | }, 63 | }; 64 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/field/textarea.wxml: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-button/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-button/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useParent } from '../common/relation'; 3 | import { button } from '../mixins/button'; 4 | import { link } from '../mixins/link'; 5 | VantComponent({ 6 | mixins: [link, button], 7 | relation: useParent('goods-action'), 8 | props: { 9 | text: String, 10 | color: String, 11 | loading: Boolean, 12 | disabled: Boolean, 13 | plain: Boolean, 14 | type: { 15 | type: String, 16 | value: 'danger', 17 | }, 18 | }, 19 | methods: { 20 | onClick(event) { 21 | this.$emit('click', event.detail); 22 | this.jumpLink(); 23 | }, 24 | updateStyle() { 25 | if (this.parent == null) { 26 | return; 27 | } 28 | const { index } = this; 29 | const { children = [] } = this.parent; 30 | this.setData({ 31 | isFirst: index === 0, 32 | isLast: index === children.length - 1, 33 | }); 34 | }, 35 | }, 36 | }); 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-button/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 28 | {{ text }} 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-icon/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { button } from '../mixins/button'; 3 | import { link } from '../mixins/link'; 4 | VantComponent({ 5 | classes: ['icon-class', 'text-class'], 6 | mixins: [link, button], 7 | props: { 8 | text: String, 9 | dot: Boolean, 10 | info: String, 11 | icon: String, 12 | disabled: Boolean, 13 | loading: Boolean, 14 | }, 15 | methods: { 16 | onClick(event) { 17 | this.$emit('click', event.detail); 18 | this.jumpLink(); 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-icon/index.wxml: -------------------------------------------------------------------------------- 1 | 25 | 33 | 34 | {{ text }} 35 | 36 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action-icon/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action-icon{display:flex!important;flex-direction:column;justify-content:center!important;line-height:1!important;border:none!important;font-size:10px!important;font-size:var(--goods-action-icon-font-size,10px)!important;color:#646566!important;color:var(--goods-action-icon-text-color,#646566)!important;min-width:48px;min-width:var(--goods-action-icon-width,48px);height:50px!important;height:var(--goods-action-icon-height,50px)!important}.van-goods-action-icon__icon{display:flex;margin:0 auto 5px;color:#323233;color:var(--goods-action-icon-color,#323233);font-size:18px;font-size:var(--goods-action-icon-size,18px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useChildren } from '../common/relation'; 3 | VantComponent({ 4 | relation: useChildren('goods-action-button', function () { 5 | this.children.forEach((item) => { 6 | item.updateStyle(); 7 | }); 8 | }), 9 | props: { 10 | safeAreaInsetBottom: { 11 | type: Boolean, 12 | value: true, 13 | }, 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/goods-action/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action{position:fixed;right:0;bottom:0;left:0;display:flex;align-items:center;box-sizing:initial;height:50px;height:var(--goods-action-height,50px);background-color:#fff;background-color:var(--goods-action-background-color,#fff)}.van-goods-action--safe{padding-bottom:env(safe-area-inset-bottom)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {{ text }} 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid-item/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function wrapperStyle(data) { 6 | var width = 100 / data.columnNum + '%'; 7 | 8 | return style({ 9 | width: width, 10 | 'padding-top': data.square ? width : null, 11 | 'padding-right': addUnit(data.gutter), 12 | 'margin-top': 13 | data.index >= data.columnNum && !data.square 14 | ? addUnit(data.gutter) 15 | : null, 16 | }); 17 | } 18 | 19 | function contentStyle(data) { 20 | return data.square 21 | ? style({ 22 | right: addUnit(data.gutter), 23 | bottom: addUnit(data.gutter), 24 | height: 'auto', 25 | }) 26 | : ''; 27 | } 28 | 29 | module.exports = { 30 | wrapperStyle: wrapperStyle, 31 | contentStyle: contentStyle, 32 | }; 33 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | return style({ 7 | 'padding-left': addUnit(data.gutter), 8 | }); 9 | } 10 | 11 | module.exports = { 12 | rootStyle: rootStyle, 13 | }; 14 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/grid/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-grid{position:relative;box-sizing:border-box;overflow:hidden} -------------------------------------------------------------------------------- /src/wxcomponents/vant/icon/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | dot: Boolean, 5 | info: null, 6 | size: null, 7 | color: String, 8 | customStyle: String, 9 | classPrefix: { 10 | type: String, 11 | value: 'van-icon', 12 | }, 13 | name: String, 14 | }, 15 | methods: { 16 | onClick() { 17 | this.$emit('click'); 18 | }, 19 | }, 20 | }); 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/icon/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 14 | 20 | 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/icon/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function isImage(name) { 6 | return name.indexOf('/') !== -1; 7 | } 8 | 9 | function rootClass(data) { 10 | var classes = ['custom-class']; 11 | 12 | if (data.classPrefix != null) { 13 | classes.push(data.classPrefix); 14 | } 15 | 16 | if (isImage(data.name)) { 17 | classes.push('van-icon--image'); 18 | } else if (data.classPrefix != null) { 19 | classes.push(data.classPrefix + '-' + data.name); 20 | } 21 | 22 | return classes.join(' '); 23 | } 24 | 25 | function rootStyle(data) { 26 | return style([ 27 | { 28 | color: data.color, 29 | 'font-size': addUnit(data.size), 30 | }, 31 | data.customStyle, 32 | ]); 33 | } 34 | 35 | module.exports = { 36 | isImage: isImage, 37 | rootClass: rootClass, 38 | rootStyle: rootStyle, 39 | }; 40 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/image/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/image/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/image/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 19 | 20 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/image/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | return style([ 7 | { 8 | width: addUnit(data.width), 9 | height: addUnit(data.height), 10 | 'border-radius': addUnit(data.radius), 11 | }, 12 | data.radius ? 'overflow: hidden' : null, 13 | ]); 14 | } 15 | 16 | var FIT_MODE_MAP = { 17 | none: 'center', 18 | fill: 'scaleToFill', 19 | cover: 'aspectFill', 20 | contain: 'aspectFit', 21 | widthFix: 'widthFix', 22 | heightFix: 'heightFix', 23 | }; 24 | 25 | function mode(fit) { 26 | return FIT_MODE_MAP[fit]; 27 | } 28 | 29 | module.exports = { 30 | rootStyle: rootStyle, 31 | mode: mode, 32 | }; 33 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/image/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-image{position:relative;display:inline-block}.van-image--round{overflow:hidden;border-radius:50%}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;width:100%;height:100%}.van-image__error,.van-image__loading{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#969799;color:var(--image-placeholder-text-color,#969799);font-size:14px;font-size:var(--image-placeholder-font-size,14px);background-color:#f7f8fa;background-color:var(--image-placeholder-background-color,#f7f8fa)}.van-image__loading-icon{color:#dcdee0;color:var(--image-loading-icon-color,#dcdee0);font-size:32px!important;font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:#dcdee0;color:var(--image-error-icon-color,#dcdee0);font-size:32px!important;font-size:var(--image-error-icon-size,32px)!important} -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-anchor/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-anchor/index.js: -------------------------------------------------------------------------------- 1 | import { getRect } from '../common/utils'; 2 | import { VantComponent } from '../common/component'; 3 | import { useParent } from '../common/relation'; 4 | VantComponent({ 5 | relation: useParent('index-bar'), 6 | props: { 7 | useSlot: Boolean, 8 | index: null, 9 | }, 10 | data: { 11 | active: false, 12 | wrapperStyle: '', 13 | anchorStyle: '', 14 | }, 15 | methods: { 16 | scrollIntoView(scrollTop) { 17 | getRect(this, '.van-index-anchor-wrapper').then((rect) => { 18 | wx.pageScrollTo({ 19 | duration: 0, 20 | scrollTop: scrollTop + rect.top - this.parent.data.stickyOffsetTop, 21 | }); 22 | }); 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-anchor/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-anchor/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | 11 | {{ index }} 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-anchor/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-index-anchor{padding:0 16px;padding:var(--index-anchor-padding,0 16px);color:#323233;color:var(--index-anchor-text-color,#323233);font-weight:500;font-weight:var(--index-anchor-font-weight,500);font-size:14px;font-size:var(--index-anchor-font-size,14px);line-height:32px;line-height:var(--index-anchor-line-height,32px);background-color:initial;background-color:var(--index-anchor-background-color,transparent)}.van-index-anchor--active{right:0;left:0;color:#07c160;color:var(--index-anchor-active-text-color,#07c160);background-color:#fff;background-color:var(--index-anchor-active-background-color,#fff)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 19 | {{ item }} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/index-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-index-bar{position:relative}.van-index-bar__sidebar{position:fixed;top:50%;right:0;display:flex;flex-direction:column;text-align:center;transform:translateY(-50%);-webkit-user-select:none;user-select:none}.van-index-bar__index{font-weight:500;padding:0 4px 0 16px;padding:0 var(--padding-base,4px) 0 var(--padding-md,16px);font-size:10px;font-size:var(--index-bar-index-font-size,10px);line-height:14px;line-height:var(--index-bar-index-line-height,14px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/info/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/info/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | dot: Boolean, 5 | info: null, 6 | customStyle: String, 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/info/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/info/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ dot ? '' : info }} 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/info/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-info{position:absolute;top:0;right:0;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;white-space:nowrap;transform:translate(50%,-50%);transform-origin:100%;height:16px;height:var(--info-size,16px);min-width:16px;min-width:var(--info-size,16px);padding:0 3px;padding:var(--info-padding,0 3px);color:#fff;color:var(--info-color,#fff);font-weight:500;font-weight:var(--info-font-weight,500);font-size:12px;font-size:var(--info-font-size,12px);font-family:-apple-system-font,Helvetica Neue,Arial,sans-serif;font-family:var(--info-font-family,-apple-system-font,Helvetica Neue,Arial,sans-serif);background-color:#ee0a24;background-color:var(--info-background-color,#ee0a24);border:1px solid #fff;border:var(--info-border-width,1px) solid var(--white,#fff);border-radius:16px;border-radius:var(--info-size,16px)}.van-info--dot{min-width:0;border-radius:100%;width:8px;width:var(--info-dot-size,8px);height:8px;height:var(--info-dot-size,8px);background-color:#ee0a24;background-color:var(--info-dot-color,#ee0a24)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/loading/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/loading/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | color: String, 5 | vertical: Boolean, 6 | type: { 7 | type: String, 8 | value: 'circular', 9 | }, 10 | size: String, 11 | textSize: String, 12 | }, 13 | data: { 14 | array12: Array.from({ length: 12 }), 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/loading/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/loading/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/loading/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function spinnerStyle(data) { 6 | return style({ 7 | color: data.color, 8 | width: addUnit(data.size), 9 | height: addUnit(data.size), 10 | }); 11 | } 12 | 13 | function textStyle(data) { 14 | return style({ 15 | 'font-size': addUnit(data.textSize), 16 | }); 17 | } 18 | 19 | module.exports = { 20 | spinnerStyle: spinnerStyle, 21 | textStyle: textStyle, 22 | }; 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/basic.d.ts: -------------------------------------------------------------------------------- 1 | export declare const basic: string; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/basic.js: -------------------------------------------------------------------------------- 1 | export const basic = Behavior({ 2 | methods: { 3 | $emit(name, detail, options) { 4 | this.triggerEvent(name, detail, options); 5 | }, 6 | set(data) { 7 | this.setData(data); 8 | return new Promise((resolve) => wx.nextTick(resolve)); 9 | }, 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/button.d.ts: -------------------------------------------------------------------------------- 1 | export declare const button: string; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/button.js: -------------------------------------------------------------------------------- 1 | import { canIUseGetUserProfile } from '../common/version'; 2 | export const button = Behavior({ 3 | externalClasses: ['hover-class'], 4 | properties: { 5 | id: String, 6 | lang: String, 7 | businessId: Number, 8 | sessionFrom: String, 9 | sendMessageTitle: String, 10 | sendMessagePath: String, 11 | sendMessageImg: String, 12 | showMessageCard: Boolean, 13 | appParameter: String, 14 | ariaLabel: String, 15 | openType: String, 16 | getUserProfileDesc: String, 17 | }, 18 | data: { 19 | canIUseGetUserProfile: canIUseGetUserProfile(), 20 | }, 21 | methods: { 22 | onGetUserInfo(event) { 23 | this.triggerEvent('getuserinfo', event.detail); 24 | }, 25 | onContact(event) { 26 | this.triggerEvent('contact', event.detail); 27 | }, 28 | onGetPhoneNumber(event) { 29 | this.triggerEvent('getphonenumber', event.detail); 30 | }, 31 | onError(event) { 32 | this.triggerEvent('error', event.detail); 33 | }, 34 | onLaunchApp(event) { 35 | this.triggerEvent('launchapp', event.detail); 36 | }, 37 | onOpenSetting(event) { 38 | this.triggerEvent('opensetting', event.detail); 39 | }, 40 | }, 41 | }); 42 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/link.d.ts: -------------------------------------------------------------------------------- 1 | export declare const link: string; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/link.js: -------------------------------------------------------------------------------- 1 | export const link = Behavior({ 2 | properties: { 3 | url: String, 4 | linkType: { 5 | type: String, 6 | value: 'navigateTo', 7 | }, 8 | }, 9 | methods: { 10 | jumpLink(urlKey = 'url') { 11 | const url = this.data[urlKey]; 12 | if (url) { 13 | if ( 14 | this.data.linkType === 'navigateTo' && 15 | getCurrentPages().length > 9 16 | ) { 17 | wx.redirectTo({ url }); 18 | } else { 19 | wx[this.data.linkType]({ url }); 20 | } 21 | } 22 | }, 23 | }, 24 | }); 25 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/page-scroll.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; 3 | declare type Scroller = ( 4 | this: WechatMiniprogram.Component.TrivialInstance, 5 | event?: IPageScrollOption 6 | ) => void; 7 | export declare const pageScrollMixin: (scroller: Scroller) => string; 8 | export {}; 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/page-scroll.js: -------------------------------------------------------------------------------- 1 | import { getCurrentPage, isDef } from '../common/utils'; 2 | function onPageScroll(event) { 3 | const { vanPageScroller = [] } = getCurrentPage(); 4 | vanPageScroller.forEach((scroller) => { 5 | if (typeof scroller === 'function') { 6 | // @ts-ignore 7 | scroller(event); 8 | } 9 | }); 10 | } 11 | export const pageScrollMixin = (scroller) => 12 | Behavior({ 13 | attached() { 14 | const page = getCurrentPage(); 15 | if (Array.isArray(page.vanPageScroller)) { 16 | page.vanPageScroller.push(scroller.bind(this)); 17 | } else { 18 | page.vanPageScroller = 19 | typeof page.onPageScroll === 'function' 20 | ? [page.onPageScroll.bind(page), scroller.bind(this)] 21 | : [scroller.bind(this)]; 22 | } 23 | page.onPageScroll = onPageScroll; 24 | }, 25 | detached() { 26 | var _a; 27 | const page = getCurrentPage(); 28 | if (isDef(page)) { 29 | page.vanPageScroller = 30 | ((_a = page.vanPageScroller) === null || _a === void 0 31 | ? void 0 32 | : _a.filter((item) => item !== scroller)) || []; 33 | } 34 | }, 35 | }); 36 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/touch.d.ts: -------------------------------------------------------------------------------- 1 | export declare const touch: string; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/touch.js: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | const MIN_DISTANCE = 10; 3 | function getDirection(x, y) { 4 | if (x > y && x > MIN_DISTANCE) { 5 | return 'horizontal'; 6 | } 7 | if (y > x && y > MIN_DISTANCE) { 8 | return 'vertical'; 9 | } 10 | return ''; 11 | } 12 | export const touch = Behavior({ 13 | methods: { 14 | resetTouchStatus() { 15 | this.direction = ''; 16 | this.deltaX = 0; 17 | this.deltaY = 0; 18 | this.offsetX = 0; 19 | this.offsetY = 0; 20 | }, 21 | touchStart(event) { 22 | this.resetTouchStatus(); 23 | const touch = event.touches[0]; 24 | this.startX = touch.clientX; 25 | this.startY = touch.clientY; 26 | }, 27 | touchMove(event) { 28 | const touch = event.touches[0]; 29 | this.deltaX = touch.clientX - this.startX; 30 | this.deltaY = touch.clientY - this.startY; 31 | this.offsetX = Math.abs(this.deltaX); 32 | this.offsetY = Math.abs(this.deltaY); 33 | this.direction = 34 | this.direction || getDirection(this.offsetX, this.offsetY); 35 | }, 36 | }, 37 | }); 38 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/mixins/transition.d.ts: -------------------------------------------------------------------------------- 1 | export declare function transition(showDefaultValue: boolean): string; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/nav-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/nav-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/nav-bar/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | 4 | function barStyle(data) { 5 | return style({ 6 | 'z-index': data.zIndex, 7 | 'padding-top': data.safeAreaInsetTop ? data.statusBarHeight + 'px' : 0, 8 | }); 9 | } 10 | 11 | module.exports = { 12 | barStyle: barStyle, 13 | }; 14 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notice-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notice-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notice-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 17 | 18 | 19 | 20 | {{ text }} 21 | 22 | 23 | 24 | 25 | 31 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notice-bar/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | return style({ 7 | color: data.color, 8 | 'background-color': data.backgroundColor, 9 | background: data.background, 10 | }); 11 | } 12 | 13 | module.exports = { 14 | rootStyle: rootStyle, 15 | }; 16 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notice-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notice-bar{display:flex;align-items:center;height:40px;height:var(--notice-bar-height,40px);padding:0 16px;padding:var(--notice-bar-padding,0 16px);font-size:14px;font-size:var(--notice-bar-font-size,14px);color:#ed6a0c;color:var(--notice-bar-text-color,#ed6a0c);line-height:24px;line-height:var(--notice-bar-line-height,24px);background-color:#fffbe8;background-color:var(--notice-bar-background-color,#fffbe8)}.van-notice-bar--withicon{position:relative;padding-right:40px}.van-notice-bar--wrapable{height:auto;padding:8px 16px;padding:var(--notice-bar-wrapable-padding,8px 16px)}.van-notice-bar--wrapable .van-notice-bar__wrap{height:auto}.van-notice-bar--wrapable .van-notice-bar__content{position:relative;white-space:normal}.van-notice-bar__left-icon{display:flex;align-items:center;margin-right:4px;vertical-align:middle}.van-notice-bar__left-icon,.van-notice-bar__right-icon{font-size:16px;font-size:var(--notice-bar-icon-size,16px);min-width:22px;min-width:var(--notice-bar-icon-min-width,22px)}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px}.van-notice-bar__wrap{position:relative;flex:1;overflow:hidden;height:24px;height:var(--notice-bar-line-height,24px)}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%} -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 15 | 19 | {{ message }} 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | return style({ 7 | 'z-index': data.zIndex, 8 | top: addUnit(data.top), 9 | }); 10 | } 11 | 12 | function notifyStyle(data) { 13 | return style({ 14 | background: data.background, 15 | color: data.color, 16 | }); 17 | } 18 | 19 | module.exports = { 20 | rootStyle: rootStyle, 21 | notifyStyle: notifyStyle, 22 | }; 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notify{text-align:center;word-wrap:break-word;padding:6px 15px;padding:var(--notify-padding,6px 15px);font-size:14px;font-size:var(--notify-font-size,14px);line-height:20px;line-height:var(--notify-line-height,20px)}.van-notify__container{position:fixed;top:0;left:0;box-sizing:border-box;width:100%}.van-notify--primary{background-color:#1989fa;background-color:var(--notify-primary-background-color,#1989fa)}.van-notify--success{background-color:#07c160;background-color:var(--notify-success-background-color,#07c160)}.van-notify--danger{background-color:#ee0a24;background-color:var(--notify-danger-background-color,#ee0a24)}.van-notify--warning{background-color:#ff976a;background-color:var(--notify-warning-background-color,#ff976a)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/notify/notify.d.ts: -------------------------------------------------------------------------------- 1 | interface NotifyOptions { 2 | type?: 'primary' | 'success' | 'danger' | 'warning'; 3 | color?: string; 4 | zIndex?: number; 5 | top?: number; 6 | message: string; 7 | context?: any; 8 | duration?: number; 9 | selector?: string; 10 | background?: string; 11 | safeAreaInsetTop?: boolean; 12 | onClick?: () => void; 13 | onOpened?: () => void; 14 | onClose?: () => void; 15 | } 16 | declare function Notify(options: NotifyOptions | string): any; 17 | declare namespace Notify { 18 | var clear: (options?: NotifyOptions | undefined) => void; 19 | } 20 | export default Notify; 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/overlay/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/overlay/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | customStyle: String, 6 | duration: { 7 | type: Number, 8 | optionalTypes: [String], 9 | value: 300, 10 | }, 11 | zIndex: { 12 | type: Number, 13 | value: 1, 14 | }, 15 | lockScroll: { 16 | type: Boolean, 17 | value: true, 18 | }, 19 | }, 20 | methods: { 21 | onClick() { 22 | this.$emit('click'); 23 | }, 24 | // for prevent touchmove 25 | noop() {}, 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/overlay/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/overlay/index.wxml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/overlay/index.wxss: -------------------------------------------------------------------------------- 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))} -------------------------------------------------------------------------------- /src/wxcomponents/vant/panel/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/panel/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['header-class', 'footer-class'], 4 | props: { 5 | desc: String, 6 | title: String, 7 | status: String, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/panel/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-panel{background:#fff;background:var(--panel-background-color,#fff)}.van-panel__header-value{color:#ee0a24;color:var(--panel-header-value-color,#ee0a24)}.van-panel__footer{padding:8px 16px;padding:var(--panel-footer-padding,8px 16px)}.van-panel__footer:empty{display:none} -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker-column/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker-column/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker-column/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | {{ computed.optionText(option, valueKey) }} 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker-column/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function isObj(x) { 6 | var type = typeof x; 7 | return x !== null && (type === 'object' || type === 'function'); 8 | } 9 | 10 | function optionText(option, valueKey) { 11 | return isObj(option) && option[valueKey] != null ? option[valueKey] : option; 12 | } 13 | 14 | function rootStyle(data) { 15 | return style({ 16 | height: addUnit(data.itemHeight * data.visibleItemCount), 17 | }); 18 | } 19 | 20 | function wrapperStyle(data) { 21 | var offset = addUnit( 22 | data.offset + (data.itemHeight * (data.visibleItemCount - 1)) / 2 23 | ); 24 | 25 | return style({ 26 | transition: 'transform ' + data.duration + 'ms', 27 | 'line-height': addUnit(data.itemHeight), 28 | transform: 'translate3d(0, ' + offset + ', 0)', 29 | }); 30 | } 31 | 32 | module.exports = { 33 | optionText: optionText, 34 | rootStyle: rootStyle, 35 | wrapperStyle: wrapperStyle, 36 | }; 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker-column/index.wxss: -------------------------------------------------------------------------------- 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)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "picker-column": "../picker-column/index", 5 | "loading": "../loading/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | var array = require('../wxs/array.wxs'); 5 | 6 | function columnsStyle(data) { 7 | return style({ 8 | height: addUnit(data.itemHeight * data.visibleItemCount), 9 | }); 10 | } 11 | 12 | function maskStyle(data) { 13 | return style({ 14 | 'background-size': 15 | '100% ' + addUnit((data.itemHeight * (data.visibleItemCount - 1)) / 2), 16 | }); 17 | } 18 | 19 | function frameStyle(data) { 20 | return style({ 21 | height: addUnit(data.itemHeight), 22 | }); 23 | } 24 | 25 | function columns(columns) { 26 | if (!array.isArray(columns)) { 27 | return []; 28 | } 29 | 30 | if (columns.length && !columns[0].values) { 31 | return [{ values: columns }]; 32 | } 33 | 34 | return columns; 35 | } 36 | 37 | module.exports = { 38 | columnsStyle: columnsStyle, 39 | frameStyle: frameStyle, 40 | maskStyle: maskStyle, 41 | columns: columns, 42 | }; 43 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/shared.d.ts: -------------------------------------------------------------------------------- 1 | export declare const pickerProps: { 2 | title: StringConstructor; 3 | loading: BooleanConstructor; 4 | showToolbar: BooleanConstructor; 5 | cancelButtonText: { 6 | type: StringConstructor; 7 | value: string; 8 | }; 9 | confirmButtonText: { 10 | type: StringConstructor; 11 | value: string; 12 | }; 13 | visibleItemCount: { 14 | type: NumberConstructor; 15 | value: number; 16 | }; 17 | itemHeight: { 18 | type: NumberConstructor; 19 | value: number; 20 | }; 21 | }; 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/shared.js: -------------------------------------------------------------------------------- 1 | export const pickerProps = { 2 | title: String, 3 | loading: Boolean, 4 | showToolbar: Boolean, 5 | cancelButtonText: { 6 | type: String, 7 | value: '取消', 8 | }, 9 | confirmButtonText: { 10 | type: String, 11 | value: '确认', 12 | }, 13 | visibleItemCount: { 14 | type: Number, 15 | value: 6, 16 | }, 17 | itemHeight: { 18 | type: Number, 19 | value: 44, 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/picker/toolbar.wxml: -------------------------------------------------------------------------------- 1 | 2 | 9 | {{ cancelButtonText }} 10 | 11 | {{ 12 | title 13 | }} 14 | 21 | {{ confirmButtonText }} 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/popup/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-overlay": "../overlay/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 20 | 26 | 27 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/popup/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | 4 | function popupStyle(data) { 5 | return style([ 6 | { 7 | 'z-index': data.zIndex, 8 | '-webkit-transition-duration': data.currentDuration + 'ms', 9 | 'transition-duration': data.currentDuration + 'ms', 10 | }, 11 | data.display ? null : 'display: none', 12 | data.customStyle, 13 | ]); 14 | } 15 | 16 | module.exports = { 17 | popupStyle: popupStyle, 18 | }; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { BLUE } from '../common/color'; 3 | import { getRect } from '../common/utils'; 4 | VantComponent({ 5 | props: { 6 | inactive: Boolean, 7 | percentage: { 8 | type: Number, 9 | observer: 'setLeft', 10 | }, 11 | pivotText: String, 12 | pivotColor: String, 13 | trackColor: String, 14 | showPivot: { 15 | type: Boolean, 16 | value: true, 17 | }, 18 | color: { 19 | type: String, 20 | value: BLUE, 21 | }, 22 | textColor: { 23 | type: String, 24 | value: '#fff', 25 | }, 26 | strokeWidth: { 27 | type: Number, 28 | value: 4, 29 | optionalTypes: [String], 30 | }, 31 | }, 32 | data: { 33 | right: 0, 34 | }, 35 | mounted() { 36 | this.setLeft(); 37 | }, 38 | methods: { 39 | setLeft() { 40 | Promise.all([ 41 | getRect(this, '.van-progress'), 42 | getRect(this, '.van-progress__pivot'), 43 | ]).then(([portion, pivot]) => { 44 | if (portion && pivot) { 45 | this.setData({ 46 | right: (pivot.width * (this.data.percentage - 100)) / 100, 47 | }); 48 | } 49 | }); 50 | }, 51 | }, 52 | }); 53 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 17 | {{ computed.pivotText(pivotText, percentage) }} 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var utils = require('../wxs/utils.wxs'); 3 | var style = require('../wxs/style.wxs'); 4 | 5 | function pivotText(pivotText, percentage) { 6 | return pivotText || percentage + '%'; 7 | } 8 | 9 | function rootStyle(data) { 10 | return style({ 11 | 'height': data.strokeWidth ? utils.addUnit(data.strokeWidth) : '', 12 | 'background': data.trackColor, 13 | }); 14 | } 15 | 16 | function portionStyle(data) { 17 | return style({ 18 | background: data.inactive ? '#cacaca' : data.color, 19 | width: data.percentage ? data.percentage + '%' : '', 20 | }); 21 | } 22 | 23 | function pivotStyle(data) { 24 | return style({ 25 | color: data.textColor, 26 | right: data.right + 'px', 27 | background: data.pivotColor ? data.pivotColor : data.inactive ? '#cacaca' : data.color, 28 | }); 29 | } 30 | 31 | module.exports = { 32 | pivotText: pivotText, 33 | rootStyle: rootStyle, 34 | portionStyle: portionStyle, 35 | pivotStyle: pivotStyle, 36 | }; 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/progress/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-progress{position:relative;height:4px;height:var(--progress-height,4px);border-radius:4px;border-radius:var(--progress-height,4px);background:#ebedf0;background:var(--progress-background-color,#ebedf0)}.van-progress__portion{position:absolute;left:0;height:100%;border-radius:inherit;background:#1989fa;background:var(--progress-color,#1989fa)}.van-progress__pivot{position:absolute;top:50%;box-sizing:border-box;min-width:3.6em;text-align:center;word-break:keep-all;border-radius:1em;transform:translateY(-50%);color:#fff;color:var(--progress-pivot-text-color,#fff);padding:0 5px;padding:var(--progress-pivot-padding,0 5px);font-size:10px;font-size:var(--progress-pivot-font-size,10px);line-height:1.6;line-height:var(--progress-pivot-line-height,1.6);background-color:#1989fa;background-color:var(--progress-pivot-background-color,#1989fa)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio-group/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useChildren } from '../common/relation'; 3 | VantComponent({ 4 | field: true, 5 | relation: useChildren('radio'), 6 | props: { 7 | value: { 8 | type: null, 9 | observer: 'updateChildren', 10 | }, 11 | direction: String, 12 | disabled: { 13 | type: Boolean, 14 | observer: 'updateChildren', 15 | }, 16 | }, 17 | methods: { 18 | updateChildren() { 19 | this.children.forEach((child) => child.updateFromParent()); 20 | }, 21 | }, 22 | }); 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-radio-group--horizontal{display:flex;flex-wrap:wrap} -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/radio/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function iconStyle(data) { 6 | var styles = { 7 | 'font-size': addUnit(data.iconSize), 8 | }; 9 | 10 | if ( 11 | data.checkedColor && 12 | !(data.disabled || data.parentDisabled) && 13 | data.value === data.name 14 | ) { 15 | styles['border-color'] = data.checkedColor; 16 | styles['background-color'] = data.checkedColor; 17 | } 18 | 19 | return style(styles); 20 | } 21 | 22 | function iconCustomStyle(data) { 23 | return style({ 24 | 'line-height': addUnit(data.iconSize), 25 | 'font-size': '.8em', 26 | display: 'block', 27 | }); 28 | } 29 | 30 | module.exports = { 31 | iconStyle: iconStyle, 32 | iconCustomStyle: iconCustomStyle, 33 | }; 34 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/rate/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/rate/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__item:not(:last-child){padding-right:4px;padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{display:block;height:1em;color:#c8c9cc;color:var(--rate-icon-void-color,#c8c9cc);font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}.van-rate__icon--full,.van-rate__icon--half{color:#ee0a24;color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:#c8c9cc;color:var(--rate-icon-disabled-color,#c8c9cc)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useChildren } from '../common/relation'; 3 | VantComponent({ 4 | relation: useChildren('col', function (target) { 5 | const { gutter } = this.data; 6 | if (gutter) { 7 | target.setData({ gutter }); 8 | } 9 | }), 10 | props: { 11 | gutter: { 12 | type: Number, 13 | observer: 'setGutter', 14 | }, 15 | }, 16 | methods: { 17 | setGutter() { 18 | this.children.forEach((col) => { 19 | col.setData(this.data); 20 | }); 21 | }, 22 | }, 23 | }); 24 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | if (!data.gutter) { 7 | return ''; 8 | } 9 | 10 | return style({ 11 | 'margin-right': addUnit(-data.gutter / 2), 12 | 'margin-left': addUnit(-data.gutter / 2), 13 | }); 14 | } 15 | 16 | module.exports = { 17 | rootStyle: rootStyle, 18 | }; 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/row/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-row:after{display:table;clear:both;content:""} -------------------------------------------------------------------------------- /src/wxcomponents/vant/search/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/search/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-field": "../field/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/search/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-search{display:flex;align-items:center;box-sizing:border-box;padding:10px 12px;padding:var(--search-padding,10px 12px)}.van-search__content{display:flex;flex:1;padding-left:12px;padding-left:var(--padding-sm,12px);border-radius:2px;border-radius:var(--border-radius-sm,2px);background-color:#f7f8fa;background-color:var(--search-background-color,#f7f8fa)}.van-search__content--round{border-radius:999px;border-radius:var(--border-radius-max,999px)}.van-search__label{padding:0 5px;padding:var(--search-label-padding,0 5px);font-size:14px;font-size:var(--search-label-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-label-color,#323233)}.van-search__field{flex:1}.van-search__field__left-icon{color:#969799;color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{padding:0 8px;padding:var(--search-action-padding,0 8px);font-size:14px;font-size:var(--search-action-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-action-text-color,#323233)}.van-search__action--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | // whether to show popup 5 | show: Boolean, 6 | // overlay custom style 7 | overlayStyle: String, 8 | // z-index 9 | zIndex: { 10 | type: Number, 11 | value: 100, 12 | }, 13 | title: String, 14 | cancelText: { 15 | type: String, 16 | value: '取消', 17 | }, 18 | description: String, 19 | options: { 20 | type: Array, 21 | value: [], 22 | }, 23 | overlay: { 24 | type: Boolean, 25 | value: true, 26 | }, 27 | safeAreaInsetBottom: { 28 | type: Boolean, 29 | value: true, 30 | }, 31 | closeOnClickOverlay: { 32 | type: Boolean, 33 | value: true, 34 | }, 35 | duration: { 36 | type: Number, 37 | optionalTypes: [String], 38 | value: 300, 39 | }, 40 | }, 41 | methods: { 42 | onClickOverlay() { 43 | this.$emit('click-overlay'); 44 | }, 45 | onCancel() { 46 | this.onClose(); 47 | this.$emit('cancel'); 48 | }, 49 | onSelect(event) { 50 | this.$emit('select', event.detail); 51 | }, 52 | onClose() { 53 | this.$emit('close'); 54 | }, 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "options": "./options" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | function isMulti(options) { 3 | if (options == null || options[0] == null) { 4 | return false; 5 | } 6 | 7 | return "Array" === options.constructor && "Array" === options[0].constructor; 8 | } 9 | 10 | module.exports = { 11 | isMulti: isMulti 12 | }; 13 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-share-sheet__header{padding:12px 16px 4px;text-align:center}.van-share-sheet__title{margin-top:8px;color:#323233;font-weight:400;font-size:14px;line-height:20px}.van-share-sheet__title:empty,.van-share-sheet__title:not(:empty)+.van-share-sheet__title{display:none}.van-share-sheet__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__description:empty,.van-share-sheet__description:not(:empty)+.van-share-sheet__description{display:none}.van-share-sheet__cancel{display:block;box-sizing:initial;width:100%;height:auto;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none}.van-share-sheet__cancel:before{display:block;height:8px;background-color:#f7f8fa;content:" "}.van-share-sheet__cancel:after{display:none}.van-share-sheet__cancel:active{background-color:#f2f3f5} -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | options: Array, 5 | showBorder: Boolean, 6 | }, 7 | methods: { 8 | onSelect(event) { 9 | const { index } = event.currentTarget.dataset; 10 | const option = this.data.options[index]; 11 | this.$emit('select', Object.assign(Object.assign({}, option), { index })); 12 | }, 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | {{ item.name }} 16 | 17 | {{ item.description }} 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments']; 3 | 4 | function getIconURL(icon) { 5 | if (PRESET_ICONS.indexOf(icon) !== -1) { 6 | return 'https://img.yzcdn.cn/vant/share-sheet-' + icon + '.png'; 7 | } 8 | 9 | return icon; 10 | } 11 | 12 | module.exports = { 13 | getIconURL: getIconURL, 14 | }; 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/share-sheet/options.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-share-sheet__options{position:relative;display:flex;padding:16px 0 16px 8px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.van-share-sheet__options--border:before{position:absolute;box-sizing:border-box;transform-origin:center;content:" ";pointer-events:none;top:0;right:0;left:16px;border-top:1px solid #ebedf0;transform:scaleY(.5)}.van-share-sheet__options::-webkit-scrollbar{height:0}.van-share-sheet__option{display:flex;flex-direction:column;align-items:center;-webkit-user-select:none;user-select:none}.van-share-sheet__option:active{opacity:.7}.van-share-sheet__button{height:auto;padding:0;line-height:inherit;background-color:initial;border:0}.van-share-sheet__button:after{border:0}.van-share-sheet__icon{width:48px;height:48px;margin:0 16px}.van-share-sheet__name{margin-top:8px;padding:0 4px;color:#646566;font-size:12px}.van-share-sheet__option-description{padding:0 4px;color:#c8c9cc;font-size:12px} -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar-item/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useParent } from '../common/relation'; 3 | VantComponent({ 4 | classes: ['active-class', 'disabled-class'], 5 | relation: useParent('sidebar'), 6 | props: { 7 | dot: Boolean, 8 | badge: null, 9 | info: null, 10 | title: String, 11 | disabled: Boolean, 12 | }, 13 | methods: { 14 | onClick() { 15 | const { parent } = this; 16 | if (!parent || this.data.disabled) { 17 | return; 18 | } 19 | const index = parent.children.indexOf(this); 20 | parent.setActive(index).then(() => { 21 | this.$emit('click', index); 22 | parent.$emit('change', index); 23 | }); 24 | }, 25 | setActive(selected) { 26 | return this.setData({ selected }); 27 | }, 28 | }, 29 | }); 30 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 15 | {{ title }} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:20px 12px 20px 8px;padding:var(--sidebar-padding,20px 12px 20px 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:20px;line-height:var(--sidebar-line-height,20px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block;word-break:break-all}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#ee0a24;border-color:var(--sidebar-selected-border-color,#ee0a24)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { useChildren } from '../common/relation'; 3 | VantComponent({ 4 | relation: useChildren('sidebar-item', function () { 5 | this.setActive(this.data.activeKey); 6 | }), 7 | props: { 8 | activeKey: { 9 | type: Number, 10 | value: 0, 11 | observer: 'setActive', 12 | }, 13 | }, 14 | beforeCreate() { 15 | this.currentActive = -1; 16 | }, 17 | methods: { 18 | setActive(activeKey) { 19 | const { children, currentActive } = this; 20 | if (!children.length) { 21 | return Promise.resolve(); 22 | } 23 | this.currentActive = activeKey; 24 | const stack = []; 25 | if (currentActive !== activeKey && children[currentActive]) { 26 | stack.push(children[currentActive].setActive(false)); 27 | } 28 | if (children[activeKey]) { 29 | stack.push(children[activeKey].setActive(true)); 30 | } 31 | return Promise.all(stack); 32 | }, 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sidebar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-sidebar{width:80px;width:var(--sidebar-width,80px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/skeleton/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/skeleton/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['avatar-class', 'title-class', 'row-class'], 4 | props: { 5 | row: { 6 | type: Number, 7 | value: 0, 8 | observer(value) { 9 | this.setData({ rowArray: Array.from({ length: value }) }); 10 | }, 11 | }, 12 | title: Boolean, 13 | avatar: Boolean, 14 | loading: { 15 | type: Boolean, 16 | value: true, 17 | }, 18 | animate: { 19 | type: Boolean, 20 | value: true, 21 | }, 22 | avatarSize: { 23 | type: String, 24 | value: '32px', 25 | }, 26 | avatarShape: { 27 | type: String, 28 | value: 'round', 29 | }, 30 | titleWidth: { 31 | type: String, 32 | value: '40%', 33 | }, 34 | rowWidth: { 35 | type: String, 36 | optionalTypes: [Array], 37 | value: '100%', 38 | observer(val) { 39 | this.setData({ isArray: val instanceof Array }); 40 | }, 41 | }, 42 | }, 43 | data: { 44 | isArray: false, 45 | rowArray: [], 46 | }, 47 | }); 48 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/skeleton/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } 5 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/skeleton/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 12 | 13 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/skeleton/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-skeleton{display:flex;box-sizing:border-box;width:100%;padding:0 16px;padding:var(--skeleton-padding,0 16px)}.van-skeleton__avatar{flex-shrink:0;margin-right:16px;margin-right:var(--padding-md,16px);background-color:#f2f3f5;background-color:var(--skeleton-avatar-background-color,#f2f3f5)}.van-skeleton__avatar--round{border-radius:100%}.van-skeleton__content{flex:1}.van-skeleton__avatar+.van-skeleton__content{padding-top:8px;padding-top:var(--padding-xs,8px)}.van-skeleton__row,.van-skeleton__title{height:16px;height:var(--skeleton-row-height,16px);background-color:#f2f3f5;background-color:var(--skeleton-row-background-color,#f2f3f5)}.van-skeleton__title{margin:0}.van-skeleton__row:not(:first-child){margin-top:12px;margin-top:var(--skeleton-row-margin-top,12px)}.van-skeleton__title+.van-skeleton__row{margin-top:20px}.van-skeleton--animate{animation:van-skeleton-blink 1.2s ease-in-out infinite}@keyframes van-skeleton-blink{50%{opacity:.6}} -------------------------------------------------------------------------------- /src/wxcomponents/vant/slider/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/slider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/slider/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function barStyle(barHeight, activeColor) { 6 | return style({ 7 | height: addUnit(barHeight), 8 | background: activeColor, 9 | }); 10 | } 11 | 12 | module.exports = { 13 | barStyle: barStyle, 14 | }; 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/slider/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-slider{position:relative;height:2px;height:var(--slider-bar-height,2px);border-radius:999px;border-radius:var(--border-radius-max,999px);background-color:#ebedf0;background-color:var(--slider-inactive-background-color,#ebedf0)}.van-slider:before{position:absolute;right:0;left:0;content:"";top:-8px;top:-var(--padding-xs,8px);bottom:-8px;bottom:-var(--padding-xs,8px)}.van-slider__bar{position:relative;width:100%;height:100%;background-color:#1989fa;background-color:var(--slider-active-background-color,#1989fa);border-radius:inherit;transition:all .2s;transition:all var(--animation-duration-fast,.2s)}.van-slider__button{width:24px;width:var(--slider-button-width,24px);height:24px;height:var(--slider-button-height,24px);border-radius:50%;border-radius:var(--slider-button-border-radius,50%);box-shadow:0 1px 2px rgba(0,0,0,.5);box-shadow:var(--slider-button-box-shadow,0 1px 2px rgba(0,0,0,.5));background-color:#fff;background-color:var(--slider-button-background-color,#fff)}.van-slider__button-wrapper,.van-slider__button-wrapper-right{position:absolute;top:50%;right:0;transform:translate3d(50%,-50%,0)}.van-slider__button-wrapper-left{position:absolute;top:50%;left:0;transform:translate3d(-50%,-50%,0)}.van-slider--disabled{opacity:.5;opacity:var(--slider-disabled-opacity,.5)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/stepper/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/stepper/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/stepper/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function buttonStyle(data) { 6 | return style({ 7 | width: addUnit(data.buttonSize), 8 | height: addUnit(data.buttonSize), 9 | }); 10 | } 11 | 12 | function inputStyle(data) { 13 | return style({ 14 | width: addUnit(data.inputWidth), 15 | height: addUnit(data.buttonSize), 16 | }); 17 | } 18 | 19 | module.exports = { 20 | buttonStyle: buttonStyle, 21 | inputStyle: inputStyle, 22 | }; 23 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/steps/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/steps/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { GREEN, GRAY_DARK } from '../common/color'; 3 | VantComponent({ 4 | classes: ['desc-class'], 5 | props: { 6 | icon: String, 7 | steps: Array, 8 | active: Number, 9 | direction: { 10 | type: String, 11 | value: 'horizontal', 12 | }, 13 | activeColor: { 14 | type: String, 15 | value: GREEN, 16 | }, 17 | inactiveColor: { 18 | type: String, 19 | value: GRAY_DARK, 20 | }, 21 | activeIcon: { 22 | type: String, 23 | value: 'checked', 24 | }, 25 | inactiveIcon: String, 26 | }, 27 | methods: { 28 | onClick(event) { 29 | const { index } = event.currentTarget.dataset; 30 | this.$emit('click-step', index); 31 | }, 32 | }, 33 | }); 34 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/steps/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sticky/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sticky/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sticky/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sticky/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function wrapStyle(data) { 6 | return style({ 7 | transform: data.transform 8 | ? 'translate3d(0, ' + data.transform + 'px, 0)' 9 | : '', 10 | top: data.fixed ? addUnit(data.offsetTop) : '', 11 | 'z-index': data.zIndex, 12 | }); 13 | } 14 | 15 | function containerStyle(data) { 16 | return style({ 17 | height: data.fixed ? addUnit(data.height) : '', 18 | 'z-index': data.zIndex, 19 | }); 20 | } 21 | 22 | module.exports = { 23 | wrapStyle: wrapStyle, 24 | containerStyle: containerStyle, 25 | }; 26 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/sticky/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-sticky{position:relative}.van-sticky-wrap--fixed{position:fixed;right:0;left:0} -------------------------------------------------------------------------------- /src/wxcomponents/vant/submit-bar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/submit-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/swipe-cell/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/swipe-cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/swipe-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/swipe-cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-swipe-cell{position:relative;overflow:hidden}.van-swipe-cell__left,.van-swipe-cell__right{position:absolute;top:0;height:100%}.van-swipe-cell__left{left:0;transform:translate3d(-100%,0,0)}.van-swipe-cell__right{right:0;transform:translate3d(100%,0,0)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/switch/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/switch/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | classes: ['node-class'], 5 | props: { 6 | checked: null, 7 | loading: Boolean, 8 | disabled: Boolean, 9 | activeColor: String, 10 | inactiveColor: String, 11 | size: { 12 | type: String, 13 | value: '30', 14 | }, 15 | activeValue: { 16 | type: null, 17 | value: true, 18 | }, 19 | inactiveValue: { 20 | type: null, 21 | value: false, 22 | }, 23 | }, 24 | methods: { 25 | onClick() { 26 | const { activeValue, inactiveValue, disabled, loading } = this.data; 27 | if (disabled || loading) { 28 | return; 29 | } 30 | const checked = this.data.checked === activeValue; 31 | const value = checked ? inactiveValue : activeValue; 32 | this.$emit('input', value); 33 | this.$emit('change', value); 34 | }, 35 | }, 36 | }); 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/switch/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function rootStyle(data) { 6 | var currentColor = data.checked ? data.activeColor : data.inactiveColor; 7 | 8 | return style({ 9 | 'font-size': addUnit(data.size), 10 | 'background-color': currentColor, 11 | }); 12 | } 13 | 14 | var BLUE = '#1989fa'; 15 | var GRAY_DARK = '#969799'; 16 | 17 | function loadingColor(data) { 18 | return data.checked 19 | ? data.activeColor || BLUE 20 | : data.inactiveColor || GRAY_DARK; 21 | } 22 | 23 | module.exports = { 24 | rootStyle: rootStyle, 25 | loadingColor: loadingColor, 26 | }; 27 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tab/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tab/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{flex-shrink:0;width:100%}.van-tab__pane,:host{box-sizing:border-box}.van-tab__pane{overflow-y:auto;-webkit-overflow-scrolling:touch}.van-tab__pane--active{height:auto}.van-tab__pane--inactive{height:0;overflow:visible} -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar-item/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-info": "../info/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{flex:1}.van-tabbar-item{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#646566;color:var(--tabbar-item-text-color,#646566);font-size:12px;font-size:var(--tabbar-item-font-size,12px);line-height:1;line-height:var(--tabbar-item-line-height,1)}.van-tabbar-item__icon{position:relative;margin-bottom:4px;margin-bottom:var(--tabbar-item-margin-bottom,4px);font-size:22px;font-size:var(--tabbar-item-icon-size,22px)}.van-tabbar-item__icon__inner{display:block;min-width:1em}.van-tabbar-item--active{color:#1989fa;color:var(--tabbar-item-active-color,#1989fa)}.van-tabbar-item__info{margin-top:2px} -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabbar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tabbar{display:flex;box-sizing:initial;width:100%;height:50px;height:var(--tabbar-height,50px);background-color:#fff;background-color:var(--tabbar-background-color,#fff)}.van-tabbar--fixed{position:fixed;bottom:0;left:0}.van-tabbar--safe{padding-bottom:env(safe-area-inset-bottom)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabs/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tabs/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-info": "../info/index", 5 | "van-sticky": "../sticky/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tag/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tag/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | size: String, 5 | mark: Boolean, 6 | color: String, 7 | plain: Boolean, 8 | round: Boolean, 9 | textColor: String, 10 | type: { 11 | type: String, 12 | value: 'default', 13 | }, 14 | closeable: Boolean, 15 | }, 16 | methods: { 17 | onClose() { 18 | this.$emit('close'); 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tag/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tag/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 15 | 16 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tag/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | 4 | function rootStyle(data) { 5 | return style({ 6 | 'background-color': data.plain ? '' : data.color, 7 | color: data.textColor || data.plain ? data.textColor || data.color : '', 8 | }); 9 | } 10 | 11 | module.exports = { 12 | rootStyle: rootStyle, 13 | }; 14 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | mask: Boolean, 6 | message: String, 7 | forbidClick: Boolean, 8 | zIndex: { 9 | type: Number, 10 | value: 1000, 11 | }, 12 | type: { 13 | type: String, 14 | value: 'text', 15 | }, 16 | loadingType: { 17 | type: String, 18 | value: 'circular', 19 | }, 20 | position: { 21 | type: String, 22 | value: 'middle', 23 | }, 24 | }, 25 | methods: { 26 | // for prevent touchmove 27 | noop() {}, 28 | }, 29 | }); 30 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index", 6 | "van-overlay": "../overlay/index", 7 | "van-transition": "../transition/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 16 | 17 | {{ message }} 18 | 19 | 20 | 21 | 27 | 28 | {{ message }} 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-toast{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:initial;color:#fff;color:var(--toast-text-color,#fff);font-size:14px;font-size:var(--toast-font-size,14px);line-height:20px;line-height:var(--toast-line-height,20px);white-space:pre-wrap;word-wrap:break-word;background-color:rgba(0,0,0,.7);background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:8px;border-radius:var(--toast-border-radius,8px)}.van-toast__container{position:fixed;top:50%;left:50%;width:-webkit-fit-content;width:fit-content;transform:translate(-50%,-50%);max-width:70%;max-width:var(--toast-max-width,70%)}.van-toast--text{min-width:96px;min-width:var(--toast-text-min-width,96px);padding:8px 12px;padding:var(--toast-text-padding,8px 12px)}.van-toast--icon{width:88px;width:var(--toast-default-width,88px);min-height:88px;min-height:var(--toast-default-min-height,88px);padding:16px;padding:var(--toast-default-padding,16px)}.van-toast--icon .van-toast__icon{font-size:36px;font-size:var(--toast-icon-size,36px)}.van-toast--icon .van-toast__text{padding-top:8px}.van-toast__loading{margin:10px 0}.van-toast--top{transform:translateY(-30vh)}.van-toast--bottom{transform:translateY(30vh)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/toast/toast.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare type ToastMessage = string | number; 3 | interface ToastOptions { 4 | show?: boolean; 5 | type?: string; 6 | mask?: boolean; 7 | zIndex?: number; 8 | context?: 9 | | WechatMiniprogram.Component.TrivialInstance 10 | | WechatMiniprogram.Page.TrivialInstance; 11 | position?: string; 12 | duration?: number; 13 | selector?: string; 14 | forbidClick?: boolean; 15 | loadingType?: string; 16 | message?: ToastMessage; 17 | onClose?: () => void; 18 | } 19 | declare function Toast( 20 | toastOptions: ToastOptions | ToastMessage 21 | ): WechatMiniprogram.Component.TrivialInstance | undefined; 22 | declare namespace Toast { 23 | var loading: ( 24 | options: ToastMessage | ToastOptions 25 | ) => WechatMiniprogram.Component.TrivialInstance | undefined; 26 | var success: ( 27 | options: ToastMessage | ToastOptions 28 | ) => WechatMiniprogram.Component.TrivialInstance | undefined; 29 | var fail: ( 30 | options: ToastMessage | ToastOptions 31 | ) => WechatMiniprogram.Component.TrivialInstance | undefined; 32 | var clear: () => void; 33 | var setDefaultOptions: (options: ToastOptions) => void; 34 | var resetDefaultOptions: () => void; 35 | } 36 | export default Toast; 37 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/transition/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/transition/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { transition } from '../mixins/transition'; 3 | VantComponent({ 4 | classes: [ 5 | 'enter-class', 6 | 'enter-active-class', 7 | 'enter-to-class', 8 | 'leave-class', 9 | 'leave-active-class', 10 | 'leave-to-class', 11 | ], 12 | mixins: [transition(true)], 13 | }); 14 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/transition/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/transition/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/transition/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | 4 | function rootStyle(data) { 5 | return style([ 6 | { 7 | '-webkit-transition-duration': data.currentDuration + 'ms', 8 | 'transition-duration': data.currentDuration + 'ms', 9 | }, 10 | data.display ? null : 'display: none', 11 | data.customStyle, 12 | ]); 13 | } 14 | 15 | module.exports = { 16 | rootStyle: rootStyle, 17 | }; 18 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tree-select/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tree-select/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-sidebar": "../sidebar/index", 6 | "van-sidebar-item": "../sidebar-item/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tree-select/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var array = require('../wxs/array.wxs'); 3 | 4 | function isActive (activeList, itemId) { 5 | if (array.isArray(activeList)) { 6 | return activeList.indexOf(itemId) > -1; 7 | } 8 | 9 | return activeList === itemId; 10 | } 11 | 12 | module.exports.isActive = isActive; 13 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/tree-select/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tree-select{position:relative;display:flex;-webkit-user-select:none;user-select:none;font-size:14px;font-size:var(--tree-select-font-size,14px)}.van-tree-select__nav{flex:1;background-color:#f7f8fa;background-color:var(--tree-select-nav-background-color,#f7f8fa);--sidebar-padding:12px 8px 12px 12px}.van-tree-select__nav__inner{width:100%!important;height:100%}.van-tree-select__content{flex:2;background-color:#fff;background-color:var(--tree-select-content-background-color,#fff)}.van-tree-select__item{position:relative;font-weight:700;padding:0 32px 0 16px;padding:0 32px 0 var(--padding-md,16px);line-height:44px;line-height:var(--tree-select-item-height,44px)}.van-tree-select__item--active{color:#ee0a24;color:var(--tree-select-item-active-color,#ee0a24)}.van-tree-select__item--disabled{color:#c8c9cc;color:var(--tree-select-item-disabled-color,#c8c9cc)}.van-tree-select__selected{position:absolute;top:50%;transform:translateY(-50%);right:16px;right:var(--padding-md,16px)} -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/index.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/index.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var style = require('../wxs/style.wxs'); 3 | var addUnit = require('../wxs/add-unit.wxs'); 4 | 5 | function sizeStyle(data) { 6 | return style({ 7 | width: addUnit(data.previewSize), 8 | height: addUnit(data.previewSize), 9 | }); 10 | } 11 | 12 | module.exports = { 13 | sizeStyle: sizeStyle, 14 | }; 15 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/shared.d.ts: -------------------------------------------------------------------------------- 1 | export declare const chooseImageProps: { 2 | sizeType: { 3 | type: ArrayConstructor; 4 | value: string[]; 5 | }; 6 | capture: { 7 | type: ArrayConstructor; 8 | value: string[]; 9 | }; 10 | }; 11 | export declare const chooseVideoProps: { 12 | capture: { 13 | type: ArrayConstructor; 14 | value: string[]; 15 | }; 16 | compressed: { 17 | type: BooleanConstructor; 18 | value: boolean; 19 | }; 20 | maxDuration: { 21 | type: NumberConstructor; 22 | value: number; 23 | }; 24 | camera: { 25 | type: StringConstructor; 26 | value: string; 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/shared.js: -------------------------------------------------------------------------------- 1 | // props for choose image 2 | export const chooseImageProps = { 3 | sizeType: { 4 | type: Array, 5 | value: ['original', 'compressed'], 6 | }, 7 | capture: { 8 | type: Array, 9 | value: ['album', 'camera'], 10 | }, 11 | }; 12 | // props for choose video 13 | export const chooseVideoProps = { 14 | capture: { 15 | type: Array, 16 | value: ['album', 'camera'], 17 | }, 18 | compressed: { 19 | type: Boolean, 20 | value: true, 21 | }, 22 | maxDuration: { 23 | type: Number, 24 | value: 60, 25 | }, 26 | camera: { 27 | type: String, 28 | value: 'back', 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/uploader/utils.d.ts: -------------------------------------------------------------------------------- 1 | export interface File { 2 | url: string; 3 | size?: number; 4 | name?: string; 5 | type: string; 6 | duration?: number; 7 | time?: number; 8 | isImage?: boolean; 9 | isVideo?: boolean; 10 | } 11 | export declare function isImageFile(item: File): boolean; 12 | export declare function isVideoFile(item: File): boolean; 13 | export declare function chooseFile({ 14 | accept, 15 | multiple, 16 | capture, 17 | compressed, 18 | maxDuration, 19 | sizeType, 20 | camera, 21 | maxCount, 22 | }: { 23 | accept: any; 24 | multiple: any; 25 | capture: any; 26 | compressed: any; 27 | maxDuration: any; 28 | sizeType: any; 29 | camera: any; 30 | maxCount: any; 31 | }): Promise; 32 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/add-unit.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var REGEXP = getRegExp('^-?\d+(\.\d+)?$'); 3 | 4 | function addUnit(value) { 5 | if (value == null) { 6 | return undefined; 7 | } 8 | 9 | return REGEXP.test('' + value) ? value + 'px' : value; 10 | } 11 | 12 | module.exports = addUnit; 13 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/array.wxs: -------------------------------------------------------------------------------- 1 | function isArray(array) { 2 | return array && array.constructor === 'Array'; 3 | } 4 | 5 | module.exports.isArray = isArray; 6 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/bem.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var array = require('./array.wxs'); 3 | var object = require('./object.wxs'); 4 | var PREFIX = 'van-'; 5 | 6 | function join(name, mods) { 7 | name = PREFIX + name; 8 | mods = mods.map(function(mod) { 9 | return name + '--' + mod; 10 | }); 11 | mods.unshift(name); 12 | return mods.join(' '); 13 | } 14 | 15 | function traversing(mods, conf) { 16 | if (!conf) { 17 | return; 18 | } 19 | 20 | if (typeof conf === 'string' || typeof conf === 'number') { 21 | mods.push(conf); 22 | } else if (array.isArray(conf)) { 23 | conf.forEach(function(item) { 24 | traversing(mods, item); 25 | }); 26 | } else if (typeof conf === 'object') { 27 | object.keys(conf).forEach(function(key) { 28 | conf[key] && mods.push(key); 29 | }); 30 | } 31 | } 32 | 33 | function bem(name, conf) { 34 | var mods = []; 35 | traversing(mods, conf); 36 | return join(name, mods); 37 | } 38 | 39 | module.exports = bem; 40 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/memoize.wxs: -------------------------------------------------------------------------------- 1 | /** 2 | * Simple memoize 3 | * wxs doesn't support fn.apply, so this memoize only support up to 2 args 4 | */ 5 | /* eslint-disable */ 6 | 7 | function isPrimitive(value) { 8 | var type = typeof value; 9 | return ( 10 | type === 'boolean' || 11 | type === 'number' || 12 | type === 'string' || 13 | type === 'undefined' || 14 | value === null 15 | ); 16 | } 17 | 18 | // mock simple fn.call in wxs 19 | function call(fn, args) { 20 | if (args.length === 2) { 21 | return fn(args[0], args[1]); 22 | } 23 | 24 | if (args.length === 1) { 25 | return fn(args[0]); 26 | } 27 | 28 | return fn(); 29 | } 30 | 31 | function serializer(args) { 32 | if (args.length === 1 && isPrimitive(args[0])) { 33 | return args[0]; 34 | } 35 | var obj = {}; 36 | for (var i = 0; i < args.length; i++) { 37 | obj['key' + i] = args[i]; 38 | } 39 | return JSON.stringify(obj); 40 | } 41 | 42 | function memoize(fn) { 43 | var cache = {}; 44 | 45 | return function() { 46 | var key = serializer(arguments); 47 | if (cache[key] === undefined) { 48 | cache[key] = call(fn, arguments); 49 | } 50 | 51 | return cache[key]; 52 | }; 53 | } 54 | 55 | module.exports = memoize; 56 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/object.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var REGEXP = getRegExp('{|}|"', 'g'); 3 | 4 | function keys(obj) { 5 | return JSON.stringify(obj) 6 | .replace(REGEXP, '') 7 | .split(',') 8 | .map(function(item) { 9 | return item.split(':')[0]; 10 | }); 11 | } 12 | 13 | module.exports.keys = keys; 14 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/style.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var object = require('./object.wxs'); 3 | var array = require('./array.wxs'); 4 | 5 | function kebabCase(word) { 6 | var newWord = word 7 | .replace(getRegExp("[A-Z]", 'g'), function (i) { 8 | return '-' + i; 9 | }) 10 | .toLowerCase() 11 | 12 | return newWord; 13 | } 14 | 15 | function style(styles) { 16 | if (array.isArray(styles)) { 17 | return styles 18 | .filter(function (item) { 19 | return item != null && item !== ''; 20 | }) 21 | .map(function (item) { 22 | return style(item); 23 | }) 24 | .join(';'); 25 | } 26 | 27 | if ('Object' === styles.constructor) { 28 | return object 29 | .keys(styles) 30 | .filter(function (key) { 31 | return styles[key] != null && styles[key] !== ''; 32 | }) 33 | .map(function (key) { 34 | return [kebabCase(key), [styles[key]]].join(':'); 35 | }) 36 | .join(';'); 37 | } 38 | 39 | return styles; 40 | } 41 | 42 | module.exports = style; 43 | -------------------------------------------------------------------------------- /src/wxcomponents/vant/wxs/utils.wxs: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var bem = require('./bem.wxs'); 3 | var memoize = require('./memoize.wxs'); 4 | var addUnit = require('./add-unit.wxs'); 5 | 6 | module.exports = { 7 | bem: memoize(bem), 8 | memoize: memoize, 9 | addUnit: addUnit 10 | }; 11 | --------------------------------------------------------------------------------