├── .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 | 4 | 5 | -------------------------------------------------------------------------------- /src/components/wrap.vue: -------------------------------------------------------------------------------- 1 | 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 | 15 | 16 | 37 | 38 | 50 | -------------------------------------------------------------------------------- /src/pages/dashboard/tml.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /src/pages/loading/loading.vue: -------------------------------------------------------------------------------- 1 | 21 | 29 | 30 | 35 | -------------------------------------------------------------------------------- /src/pages/navbar/navbar.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 40 | 41 | 46 | -------------------------------------------------------------------------------- /src/pages/panel/panel.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 32 | 33 | 43 | -------------------------------------------------------------------------------- /src/pages/progress/progress.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | 27 | 32 | -------------------------------------------------------------------------------- /src/pages/submit-bar/submit-bar.vue: -------------------------------------------------------------------------------- 1 | 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 | 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 |