Repository: umicro/uView
Branch: master
Commit: 1c73d473e15d
Files: 287
Total size: 1.3 MB
Directory structure:
gitextract_471h43ez/
├── .editorconfig
├── .eslintignore
├── .gitee/
│ └── ISSUE_TEMPLATE.zh-CN.md
├── .github/
│ └── ISSUE_TEMPLATE/
│ └── config.yml
├── .gitignore
├── .vscode/
│ └── settings.json
├── App.vue
├── LICENSE
├── README.md
├── common/
│ ├── classify.data.js
│ ├── demo.scss
│ ├── http.api.js
│ ├── http.interceptor.js
│ ├── index.list.js
│ └── locales/
│ ├── en.js
│ └── zh.js
├── components/
│ └── page-nav/
│ └── page-nav.vue
├── main.js
├── manifest.json
├── package.json
├── pages/
│ ├── componentsA/
│ │ ├── avatar/
│ │ │ └── index.vue
│ │ ├── avatarCropper/
│ │ │ └── index.vue
│ │ ├── backTop/
│ │ │ └── index.vue
│ │ ├── calendar/
│ │ │ └── index.vue
│ │ ├── empty/
│ │ │ └── index.vue
│ │ ├── field/
│ │ │ └── index.vue
│ │ ├── form/
│ │ │ └── index.vue
│ │ ├── fullScreen/
│ │ │ └── index.vue
│ │ ├── icon/
│ │ │ └── index.vue
│ │ ├── indexList/
│ │ │ └── index.vue
│ │ ├── keyboard/
│ │ │ └── index.vue
│ │ ├── lazyLoad/
│ │ │ └── index.vue
│ │ ├── modal/
│ │ │ └── index.vue
│ │ ├── navbar/
│ │ │ └── index.vue
│ │ ├── noNetwork/
│ │ │ └── index.vue
│ │ ├── parse/
│ │ │ └── index.vue
│ │ ├── select/
│ │ │ └── index.vue
│ │ ├── slider/
│ │ │ └── index.vue
│ │ ├── tabs/
│ │ │ └── index.vue
│ │ ├── tag/
│ │ │ └── index.vue
│ │ ├── test/
│ │ │ └── index.vue
│ │ ├── timeLine/
│ │ │ └── index.vue
│ │ ├── toast/
│ │ │ └── index.vue
│ │ ├── topTips/
│ │ │ └── index.vue
│ │ └── verificationCode/
│ │ └── index.vue
│ ├── componentsB/
│ │ ├── card/
│ │ │ └── index.vue
│ │ ├── checkbox/
│ │ │ └── index.vue
│ │ ├── divider/
│ │ │ └── index.vue
│ │ ├── dropdown/
│ │ │ └── index.vue
│ │ ├── image/
│ │ │ └── index.vue
│ │ ├── line/
│ │ │ └── index.vue
│ │ ├── loading/
│ │ │ └── index.vue
│ │ ├── noticeBar/
│ │ │ └── index.vue
│ │ ├── picker/
│ │ │ └── index.vue
│ │ ├── radio/
│ │ │ └── index.vue
│ │ ├── rate/
│ │ │ └── index.vue
│ │ ├── readMore/
│ │ │ └── index.vue
│ │ ├── search/
│ │ │ └── index.vue
│ │ ├── skeleton/
│ │ │ └── index.vue
│ │ ├── steps/
│ │ │ └── index.vue
│ │ ├── sticky/
│ │ │ └── index.vue
│ │ ├── swipeAction/
│ │ │ └── index.vue
│ │ ├── swiper/
│ │ │ └── index.vue
│ │ ├── switch/
│ │ │ └── index.vue
│ │ ├── tabbar/
│ │ │ └── index.vue
│ │ ├── table/
│ │ │ └── index.vue
│ │ ├── upload/
│ │ │ └── index.vue
│ │ └── waterfall/
│ │ └── index.vue
│ ├── componentsC/
│ │ ├── actionSheet/
│ │ │ └── index.vue
│ │ ├── alertTips/
│ │ │ └── index.vue
│ │ ├── badge/
│ │ │ └── index.vue
│ │ ├── button/
│ │ │ └── index.vue
│ │ ├── cell/
│ │ │ └── index.vue
│ │ ├── circleProgress/
│ │ │ └── index.vue
│ │ ├── collapse/
│ │ │ └── index.vue
│ │ ├── color/
│ │ │ └── index.vue
│ │ ├── countDown/
│ │ │ └── index.vue
│ │ ├── countTo/
│ │ │ └── index.vue
│ │ ├── gap/
│ │ │ └── index.vue
│ │ ├── grid/
│ │ │ └── index.vue
│ │ ├── layout/
│ │ │ └── index.vue
│ │ ├── link/
│ │ │ └── index.vue
│ │ ├── loadmore/
│ │ │ └── index.vue
│ │ ├── mask/
│ │ │ └── index.vue
│ │ ├── messageInput/
│ │ │ └── index.vue
│ │ ├── numberBox/
│ │ │ └── index.vue
│ │ ├── popup/
│ │ │ └── index.vue
│ │ ├── progress/
│ │ │ └── index.vue
│ │ ├── section/
│ │ │ └── index.vue
│ │ ├── subsection/
│ │ │ └── index.vue
│ │ └── test/
│ │ └── index.vue
│ ├── example/
│ │ ├── components.config.js
│ │ ├── components.vue
│ │ ├── js.config.js
│ │ ├── js.vue
│ │ ├── template.config.js
│ │ └── template.vue
│ ├── library/
│ │ ├── color/
│ │ │ └── index.vue
│ │ ├── colorSwitch/
│ │ │ └── index.vue
│ │ ├── debounce/
│ │ │ └── index.vue
│ │ ├── deepClone/
│ │ │ └── index.vue
│ │ ├── deepMerge/
│ │ │ └── index.vue
│ │ ├── getRect/
│ │ │ └── index.vue
│ │ ├── globalVariable/
│ │ │ ├── globalData.vue
│ │ │ ├── index.vue
│ │ │ ├── prototype.vue
│ │ │ └── vuex.vue
│ │ ├── guid/
│ │ │ └── index.vue
│ │ ├── http/
│ │ │ └── index.vue
│ │ ├── md5/
│ │ │ └── index.vue
│ │ ├── mpShare/
│ │ │ └── index.vue
│ │ ├── queryParams/
│ │ │ └── index.vue
│ │ ├── random/
│ │ │ └── index.vue
│ │ ├── randomArray/
│ │ │ └── index.vue
│ │ ├── route/
│ │ │ ├── index.vue
│ │ │ └── routeTo.vue
│ │ ├── test/
│ │ │ └── index.vue
│ │ ├── timeFormat/
│ │ │ └── index.vue
│ │ ├── timeFrom/
│ │ │ └── index.vue
│ │ └── trim/
│ │ └── index.vue
│ └── template/
│ ├── address/
│ │ ├── addSite.vue
│ │ └── index.vue
│ ├── citySelect/
│ │ ├── index.vue
│ │ └── u-city-select.vue
│ ├── comment/
│ │ ├── index.vue
│ │ └── reply.vue
│ ├── coupon/
│ │ └── index.vue
│ ├── douyin/
│ │ └── index.nvue
│ ├── keyboardPay/
│ │ └── index.vue
│ ├── login/
│ │ ├── code.vue
│ │ └── index.vue
│ ├── mallMenu/
│ │ ├── index1.vue
│ │ └── index2.vue
│ ├── order/
│ │ └── index.vue
│ ├── submitBar/
│ │ └── index.vue
│ └── wxCenter/
│ └── index.vue
├── pages.json
├── static/
│ └── common/
│ └── js/
│ └── touch-emulator.js
├── store/
│ ├── $u.mixin.js
│ └── index.js
├── template.h5.html
├── uni.scss
├── uview-ui/
│ ├── LICENSE
│ ├── README.md
│ ├── components/
│ │ ├── u-action-sheet/
│ │ │ └── u-action-sheet.vue
│ │ ├── u-alert-tips/
│ │ │ └── u-alert-tips.vue
│ │ ├── u-avatar/
│ │ │ └── u-avatar.vue
│ │ ├── u-avatar-cropper/
│ │ │ ├── u-avatar-cropper.vue
│ │ │ └── weCropper.js
│ │ ├── u-back-top/
│ │ │ └── u-back-top.vue
│ │ ├── u-badge/
│ │ │ └── u-badge.vue
│ │ ├── u-button/
│ │ │ └── u-button.vue
│ │ ├── u-calendar/
│ │ │ └── u-calendar.vue
│ │ ├── u-car-keyboard/
│ │ │ └── u-car-keyboard.vue
│ │ ├── u-card/
│ │ │ └── u-card.vue
│ │ ├── u-cell-group/
│ │ │ └── u-cell-group.vue
│ │ ├── u-cell-item/
│ │ │ └── u-cell-item.vue
│ │ ├── u-checkbox/
│ │ │ └── u-checkbox.vue
│ │ ├── u-checkbox-group/
│ │ │ └── u-checkbox-group.vue
│ │ ├── u-circle-progress/
│ │ │ ├── u-circle-progress.vue
│ │ │ └── u-line-progress/
│ │ │ └── u-line-progress.vue
│ │ ├── u-col/
│ │ │ └── u-col.vue
│ │ ├── u-collapse/
│ │ │ └── u-collapse.vue
│ │ ├── u-collapse-item/
│ │ │ └── u-collapse-item.vue
│ │ ├── u-column-notice/
│ │ │ └── u-column-notice.vue
│ │ ├── u-count-down/
│ │ │ └── u-count-down.vue
│ │ ├── u-count-to/
│ │ │ └── u-count-to.vue
│ │ ├── u-divider/
│ │ │ └── u-divider.vue
│ │ ├── u-dropdown/
│ │ │ └── u-dropdown.vue
│ │ ├── u-dropdown-item/
│ │ │ └── u-dropdown-item.vue
│ │ ├── u-empty/
│ │ │ └── u-empty.vue
│ │ ├── u-field/
│ │ │ └── u-field.vue
│ │ ├── u-form/
│ │ │ └── u-form.vue
│ │ ├── u-form-item/
│ │ │ └── u-form-item.vue
│ │ ├── u-full-screen/
│ │ │ └── u-full-screen.vue
│ │ ├── u-gap/
│ │ │ └── u-gap.vue
│ │ ├── u-grid/
│ │ │ └── u-grid.vue
│ │ ├── u-grid-item/
│ │ │ └── u-grid-item.vue
│ │ ├── u-icon/
│ │ │ └── u-icon.vue
│ │ ├── u-image/
│ │ │ └── u-image.vue
│ │ ├── u-index-anchor/
│ │ │ └── u-index-anchor.vue
│ │ ├── u-index-list/
│ │ │ └── u-index-list.vue
│ │ ├── u-input/
│ │ │ └── u-input.vue
│ │ ├── u-keyboard/
│ │ │ └── u-keyboard.vue
│ │ ├── u-lazy-load/
│ │ │ └── u-lazy-load.vue
│ │ ├── u-line/
│ │ │ └── u-line.vue
│ │ ├── u-line-progress/
│ │ │ └── u-line-progress.vue
│ │ ├── u-link/
│ │ │ └── u-link.vue
│ │ ├── u-loading/
│ │ │ └── u-loading.vue
│ │ ├── u-loading-page/
│ │ │ └── u-loading-page.vue
│ │ ├── u-loadmore/
│ │ │ └── u-loadmore.vue
│ │ ├── u-mask/
│ │ │ └── u-mask.vue
│ │ ├── u-message-input/
│ │ │ └── u-message-input.vue
│ │ ├── u-modal/
│ │ │ └── u-modal.vue
│ │ ├── u-navbar/
│ │ │ └── u-navbar.vue
│ │ ├── u-no-network/
│ │ │ └── u-no-network.vue
│ │ ├── u-notice-bar/
│ │ │ └── u-notice-bar.vue
│ │ ├── u-number-box/
│ │ │ └── u-number-box.vue
│ │ ├── u-number-keyboard/
│ │ │ └── u-number-keyboard.vue
│ │ ├── u-parse/
│ │ │ ├── libs/
│ │ │ │ ├── CssHandler.js
│ │ │ │ ├── MpHtmlParser.js
│ │ │ │ ├── config.js
│ │ │ │ ├── handler.wxs
│ │ │ │ └── trees.vue
│ │ │ └── u-parse.vue
│ │ ├── u-picker/
│ │ │ └── u-picker.vue
│ │ ├── u-popup/
│ │ │ └── u-popup.vue
│ │ ├── u-radio/
│ │ │ └── u-radio.vue
│ │ ├── u-radio-group/
│ │ │ └── u-radio-group.vue
│ │ ├── u-rate/
│ │ │ └── u-rate.vue
│ │ ├── u-read-more/
│ │ │ └── u-read-more.vue
│ │ ├── u-row/
│ │ │ └── u-row.vue
│ │ ├── u-row-notice/
│ │ │ └── u-row-notice.vue
│ │ ├── u-search/
│ │ │ └── u-search.vue
│ │ ├── u-section/
│ │ │ └── u-section.vue
│ │ ├── u-select/
│ │ │ └── u-select.vue
│ │ ├── u-skeleton/
│ │ │ └── u-skeleton.vue
│ │ ├── u-slider/
│ │ │ └── u-slider.vue
│ │ ├── u-steps/
│ │ │ └── u-steps.vue
│ │ ├── u-sticky/
│ │ │ └── u-sticky.vue
│ │ ├── u-subsection/
│ │ │ └── u-subsection.vue
│ │ ├── u-swipe-action/
│ │ │ └── u-swipe-action.vue
│ │ ├── u-swiper/
│ │ │ └── u-swiper.vue
│ │ ├── u-switch/
│ │ │ └── u-switch.vue
│ │ ├── u-tabbar/
│ │ │ └── u-tabbar.vue
│ │ ├── u-table/
│ │ │ └── u-table.vue
│ │ ├── u-tabs/
│ │ │ └── u-tabs.vue
│ │ ├── u-tabs-swiper/
│ │ │ └── u-tabs-swiper.vue
│ │ ├── u-tag/
│ │ │ └── u-tag.vue
│ │ ├── u-td/
│ │ │ └── u-td.vue
│ │ ├── u-th/
│ │ │ └── u-th.vue
│ │ ├── u-time-line/
│ │ │ └── u-time-line.vue
│ │ ├── u-time-line-item/
│ │ │ └── u-time-line-item.vue
│ │ ├── u-toast/
│ │ │ └── u-toast.vue
│ │ ├── u-top-tips/
│ │ │ └── u-top-tips.vue
│ │ ├── u-tr/
│ │ │ └── u-tr.vue
│ │ ├── u-upload/
│ │ │ └── u-upload.vue
│ │ ├── u-verification-code/
│ │ │ └── u-verification-code.vue
│ │ ├── u-waterfall/
│ │ │ └── u-waterfall.vue
│ │ └── uview-v1/
│ │ └── uview-v1.vue
│ ├── iconfont.css
│ ├── index.js
│ ├── index.scss
│ ├── libs/
│ │ ├── config/
│ │ │ ├── config.js
│ │ │ └── zIndex.js
│ │ ├── css/
│ │ │ ├── color.scss
│ │ │ ├── common.scss
│ │ │ ├── style.components.scss
│ │ │ ├── style.h5.scss
│ │ │ ├── style.mp.scss
│ │ │ ├── style.nvue.scss
│ │ │ └── style.vue.scss
│ │ ├── function/
│ │ │ ├── $parent.js
│ │ │ ├── addUnit.js
│ │ │ ├── bem.js
│ │ │ ├── color.js
│ │ │ ├── colorGradient.js
│ │ │ ├── debounce.js
│ │ │ ├── deepClone.js
│ │ │ ├── deepMerge.js
│ │ │ ├── getParent.js
│ │ │ ├── guid.js
│ │ │ ├── md5.js
│ │ │ ├── queryParams.js
│ │ │ ├── random.js
│ │ │ ├── randomArray.js
│ │ │ ├── route.js
│ │ │ ├── sys.js
│ │ │ ├── test.js
│ │ │ ├── throttle.js
│ │ │ ├── timeFormat.js
│ │ │ ├── timeFrom.js
│ │ │ ├── toast.js
│ │ │ ├── trim.js
│ │ │ └── type2icon.js
│ │ ├── mixin/
│ │ │ ├── mixin.js
│ │ │ └── mpShare.js
│ │ ├── request/
│ │ │ └── index.js
│ │ ├── store/
│ │ │ └── index.js
│ │ └── util/
│ │ ├── area.js
│ │ ├── async-validator.js
│ │ ├── city.js
│ │ ├── emitter.js
│ │ └── province.js
│ ├── package.json
│ └── theme.scss
└── vue.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
[*]
#缩进风格:空格
indent_style = tab
#缩进大小2
indent_size = 4
#换行符lf
end_of_line = lf
#字符集utf-8
charset = utf-8
================================================
FILE: .eslintignore
================================================
unpackage
node_modules
uview-ui
================================================
FILE: .gitee/ISSUE_TEMPLATE.zh-CN.md
================================================
你好,请使用下面的链接创建 issue 以帮助我们更快的排查问题,不规范的 issue 会被关闭,感谢配合。
https://new-issue.uviewui.com/
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: 创建一个新issue
url: https://new-issue.uviewui.com/
about: 请使用接下来的链接创建新issue。
- name: Create new issue
url: https://new-issue.uviewui.com/?lang=en
about: Please use the following link to create a new issue.
================================================
FILE: .gitignore
================================================
/unpackage/dist/*
/node_modules/*
/.idea/*
deploy.sh
.hbuilderx/
deploy
.DS_Store
================================================
FILE: .vscode/settings.json
================================================
{
"editor.formatOnSave": false
}
================================================
FILE: App.vue
================================================
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2023 www.uviewui.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
uView
多平台快速开发的UI框架
[](https://gitee.com/umicro/uView/stargazers)
[](https://gitee.com/umicro/uView/members)
[](https://github.com/umicro/uView)
[](https://github.com/umicro/uView)
[](https://github.com/umicro/uView/issues)
[](https://uviewui.com)
[](https://gitee.com/umicro/uView/releases)
[](https://en.wikipedia.org/wiki/MIT_License)
## 说明
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
## [官方文档:https://v1.uviewui.com](https://v1.uviewui.com)
### 官方1群:1042987248(已满)
### 官方2群:249718512(已满)
### 官方3群:1129077272(已满)
### 官方4群:1084514613(已满)
### 官方5群:863820668(已满)
### 官方6群:745721078(已满)
### 官方7群:627867855(已满)
### 官方8群:496409492(已满)
### 官方9群:828504448(已满)
### [点击加10群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU)
## 特性
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
- 众多的常用页面和布局,让您专注逻辑,事半功倍
- 详尽的文档支持,现代化的演示效果
- 按需引入,精简打包体积
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
## 友情链接
#### **vue-admin-beautiful** —— [企业级、通用型中后台前端解决方案(基于vue/cli 4 最新版,同时支持电脑,手机,平板)](https://github.com/chuzhixin/vue-admin-beautiful)
#### **vue-admin-beautiful** —— [在线演示](http://beautiful.panm.cn/vue-admin-beautiful/#/index)
#### **pl-table** —— [ 完美解决 element 万级表格数据渲染卡顿问题](https://github.com/livelyPeng/pl-table)
#### **luch-request** —— [基于 Promise 开发的 uni-app 跨平台、项目级别的请求库,它有更小的体积,易用的 api,方便简单的自定义能力](https://www.quanzhan.co/luch-request/)
## 链接
- [官方文档](https://v1.uviewui.com/)
- [更新日志](https://v1.uviewui.com/components/changelog.html)
- [升级指南](https://v1.uviewui.com/components/changelog.html)
- [关于我们](https://v1.uviewui.com/cooperation/about.html)
## 交流反馈
欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html)
## 关于PR
> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uView2.0是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。
> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢!
## 安装
#### **下载地址** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593)
## 快速上手
1. `main.js`引入uView库
```js
// main.js
import uView from 'uview-ui';
Vue.use(uView);
```
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
```css
/* App.vue */
```
3. `uni.scss`引入全局scss变量文件
```css
/* uni.scss */
@import "uview-ui/theme.scss";
```
4. `pages.json`配置easycom规则(按需引入)
```js
// pages.json
{
"easycom": {
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
// 下载安装方式
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
// npm安装方式
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
// 此为本身已有的内容
"pages": [
// ......
]
}
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 使用方法
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
```html
按钮
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 捐赠uView的研发
uView文档内容和框架源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
## 版权信息
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
================================================
FILE: common/classify.data.js
================================================
export default[
{
"name": "女装",
"foods": [
{
"name": "A字裙",
"key": "A字裙",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/1.jpg",
"cat": 10
},
{
"name": "T恤",
"key": "T恤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/2.jpg",
"cat": 10
},
{
"name": "半身裙",
"key": "半身裙",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/3.jpg",
"cat": 10
},
{
"name": "衬衫",
"key": "衬衫",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/4.jpg",
"cat": 10
},
{
"name": "短裙",
"key": "短裙",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg",
"cat": 10
},
{
"name": "阔腿裤",
"key": "阔腿裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/6.jpg",
"cat": 10
},
{
"name": "连衣裙",
"key": "连衣裙",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg",
"cat": 10
},
{
"name": "妈妈装",
"key": "妈妈装",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/8.jpg",
"cat": 10
},
{
"name": "牛仔裤",
"key": "牛仔裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/9.jpg",
"cat": 10
},
{
"name": "情侣装",
"key": "情侣装",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/10.jpg",
"cat": 10
},
{
"name": "休闲裤",
"key": "休闲裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/11.jpg",
"cat": 10
},
{
"name": "雪纺衫",
"key": "雪纺衫",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/12.jpg",
"cat": 10
},
{
"name": "防晒衣",
"key": "防晒衣",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/13.jpg",
"cat": 10
},
{
"name": "礼服/婚纱",
"key": "礼服婚纱",
"icon": "https://cdn.uviewui.com/uview/common/classify/1/14.jpg",
"cat": 10
}
]
},
{
"name": "美食",
"foods": [
{
"name": "火锅",
"key": "火锅",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/1.jpg",
"cat": 6
},
{
"name": "糕点饼干",
"key": "糕点饼干",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/2.jpg",
"cat": 6
},
{
"name": "坚果果干",
"key": "坚果果干",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/3.jpg",
"cat": 6
},
{
"name": "酒类",
"key": "酒类",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/4.jpg",
"cat": 6
},
{
"name": "辣条",
"key": "辣条",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/5.jpg",
"cat": 6
},
{
"name": "大礼包",
"key": "大礼包",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/6.jpg",
"cat": 6
},
{
"name": "精品茗茶",
"key": "茶",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/7.jpg",
"cat": 6
},
{
"name": "休闲食品",
"key": "休闲食品",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/8.jpg",
"cat": 6
},
{
"name": "糖果巧克力",
"key": "糖果巧克力",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/9.jpg",
"cat": 6
},
{
"name": "方便速食",
"key": "方便速食",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/10.jpg",
"cat": 6
},
{
"name": "营养代餐",
"key": "营养代餐",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/11.jpg",
"cat": 6
},
{
"name": "粮油副食",
"key": "粮油",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/12.jpg",
"cat": 6
},
{
"name": "生鲜水果",
"key": "水果",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/13.jpg",
"cat": 6
},
{
"name": "饮品",
"key": "饮品",
"icon": "https://cdn.uviewui.com/uview/common/classify/2/14.jpg",
"cat": 6
}
]
},
{
"name": "美妆",
"foods": [
{
"name": "化妆刷",
"key": "化妆刷",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/1.jpg",
"cat": 3
},
{
"name": "粉底",
"key": "粉底",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/2.jpg",
"cat": 3
},
{
"name": "洗发护发",
"key": "洗发护发",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/3.jpg",
"cat": 3
},
{
"name": "美容工具",
"key": "美容工具",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/4.jpg",
"cat": 3
},
{
"name": "眼部护理",
"key": "眼部护理",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/5.jpg",
"cat": 3
},
{
"name": "眉妆",
"key": "眉妆",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/6.jpg",
"cat": 3
},
{
"name": "卸妆品",
"key": "卸妆品",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/7.jpg",
"cat": 3
},
{
"name": "基础护肤",
"key": "基础护肤",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/8.jpg",
"cat": 3
},
{
"name": "眼妆",
"key": "眼妆",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/9.jpg",
"cat": 3
},
{
"name": "唇妆",
"key": "唇妆",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/10.jpg",
"cat": 3
},
{
"name": "面膜",
"key": "面膜",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/11.jpg",
"cat": 3
},
{
"name": "沐浴用品",
"key": "沐浴用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/12.jpg",
"cat": 3
},
{
"name": "护肤套装",
"key": "护肤套装",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/13.jpg",
"cat": 3
},
{
"name": "防晒品",
"key": "防晒品",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/14.jpg",
"cat": 3
},
{
"name": "美甲",
"key": "美甲",
"icon": "https://cdn.uviewui.com/uview/common/classify/3/15.jpg",
"cat": 3
}
]
},
{
"name": "居家日用",
"foods": [
{
"name": "垃圾袋",
"key": "垃圾袋",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/1.jpg",
"cat": 4
},
{
"name": "纸巾",
"key": "纸巾",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/2.jpg",
"cat": 4
},
{
"name": "驱蚊用品",
"key": "驱蚊用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/3.jpg",
"cat": 4
},
{
"name": "收纳神器",
"key": "收纳神器",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/4.jpg",
"cat": 4
},
{
"name": "厨房用品",
"key": "厨房用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/5.jpg",
"cat": 4
},
{
"name": "厨房烹饪",
"key": "烹饪",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/6.jpg",
"cat": 4
},
{
"name": "衣物晾晒",
"key": "衣物晾晒",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/7.jpg",
"cat": 4
},
{
"name": "衣物护理",
"key": "衣物护理",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/8.jpg",
"cat": 4
},
{
"name": "宠物用品",
"key": "宠物用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/9.jpg",
"cat": 4
},
{
"name": "医药保健",
"key": "医药",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/10.jpg",
"cat": 4
},
{
"name": "日用百货",
"key": "百货",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/11.jpg",
"cat": 4
},
{
"name": "清洁用品",
"key": "清洁",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/12.jpg",
"cat": 4
},
{
"name": "绿植园艺",
"key": "绿植",
"icon": "https://cdn.uviewui.com/uview/common/classify/4/13.jpg",
"cat": 4
}
]
},
{
"name": "男装",
"foods": [
{
"name": "爸爸装",
"key": "爸爸装",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/1.jpg",
"cat": 12
},
{
"name": "牛仔裤",
"key": "牛仔裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/2.jpg",
"cat": 12
},
{
"name": "衬衫",
"key": "衬衫",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/3.jpg",
"cat": 12
},
{
"name": "休闲裤",
"key": "休闲裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/4.jpg",
"cat": 12
},
{
"name": "外套",
"key": "外套",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/5.jpg",
"cat": 12
},
{
"name": "T恤",
"key": "T恤",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/6.jpg",
"cat": 12
},
{
"name": "套装",
"key": "套装",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/7.jpg",
"cat": 12
},
{
"name": "运动裤",
"key": "运动裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/8.jpg",
"cat": 12
},
{
"name": "马甲/背心",
"key": "马甲背心",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/9.jpg",
"cat": 12
},
{
"name": "POLO衫",
"key": "POLO衫",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/10.jpg",
"cat": 12
},
{
"name": "商务装",
"key": "商务装",
"icon": "https://cdn.uviewui.com/uview/common/classify/5/11.jpg",
"cat": 12
}
]
},
{
"name": "鞋品",
"foods": [
{
"name": "单鞋",
"key": "单鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/1.jpg",
"cat": 5
},
{
"name": "皮鞋",
"key": "皮鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/2.jpg",
"cat": 5
},
{
"name": "帆布鞋",
"key": "帆布鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/3.jpg",
"cat": 5
},
{
"name": "北京老布鞋",
"key": "北京老布鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/4.jpg",
"cat": 5
},
{
"name": "运动鞋",
"key": "运动鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/5.jpg",
"cat": 5
},
{
"name": "拖鞋",
"key": "拖鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/6.jpg",
"cat": 5
},
{
"name": "凉鞋",
"key": "凉鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/7.jpg",
"cat": 5
},
{
"name": "休闲鞋",
"key": "休闲鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/8.jpg",
"cat": 5
},
{
"name": "高跟鞋",
"key": "高跟鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/9.jpg",
"cat": 5
},
{
"name": "老人鞋",
"key": "老人鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/10.jpg",
"cat": 5
},
{
"name": "懒人鞋",
"key": "懒人鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/6/11.jpg",
"cat": 5
}
]
},
{
"name": "数码家电",
"foods": [
{
"name": "数据线",
"key": "数据线",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/1.jpg",
"cat": 8
},
{
"name": "耳机",
"key": "耳机",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/2.jpg",
"cat": 8
},
{
"name": "生活家电",
"key": "家电",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/3.jpg",
"cat": 8
},
{
"name": "电风扇",
"key": "电风扇",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/4.jpg",
"cat": 8
},
{
"name": "电吹风",
"key": "电吹风",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/5.jpg",
"cat": 8
},
{
"name": "手机壳",
"key": "手机壳",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/6.jpg",
"cat": 8
},
{
"name": "榨汁机",
"key": "榨汁机",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/7.jpg",
"cat": 8
},
{
"name": "小家电",
"key": "小家电",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/8.jpg",
"cat": 8
},
{
"name": "数码电子",
"key": "数码",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/9.jpg",
"cat": 8
},
{
"name": "电饭锅",
"key": "电饭锅",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/10.jpg",
"cat": 8
},
{
"name": "手机支架",
"key": "手机支架",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/11.jpg",
"cat": 8
},
{
"name": "剃须刀",
"key": "剃须刀",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/12.jpg",
"cat": 8
},
{
"name": "充电宝",
"key": "充电宝",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/13.jpg",
"cat": 8
},
{
"name": "手机配件",
"key": "手机配件",
"icon": "https://cdn.uviewui.com/uview/common/classify/7/14.jpg",
"cat": 8
}
]
},
{
"name": "母婴",
"foods": [
{
"name": "婴童服饰",
"key": "衣服",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/1.jpg",
"cat": 2
},
{
"name": "玩具乐器",
"key": "玩具乐器",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/2.jpg",
"cat": 2
},
{
"name": "尿不湿",
"key": "尿不湿",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/3.jpg",
"cat": 2
},
{
"name": "安抚牙胶",
"key": "安抚牙胶",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/4.jpg",
"cat": 2
},
{
"name": "奶瓶奶嘴",
"key": "奶瓶奶嘴",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/5.jpg",
"cat": 2
},
{
"name": "孕妈用品",
"key": "孕妈用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/6.jpg",
"cat": 2
},
{
"name": "宝宝用品",
"key": "宝宝用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/7.jpg",
"cat": 2
},
{
"name": "婴童湿巾",
"key": "湿巾",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/8.jpg",
"cat": 2
},
{
"name": "喂养洗护",
"key": "洗护",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/9.jpg",
"cat": 2
},
{
"name": "婴童鞋靴",
"key": "童鞋",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/10.jpg",
"cat": 2
},
{
"name": "口水巾",
"key": "口水巾",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/11.jpg",
"cat": 2
},
{
"name": "营养辅食",
"key": "营养",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/12.jpg",
"cat": 2
},
{
"name": "婴幼书籍",
"key": "书籍",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/13.jpg",
"cat": 2
},
{
"name": "婴儿车",
"key": "婴儿车",
"icon": "https://cdn.uviewui.com/uview/common/classify/8/14.jpg",
"cat": 2
}
]
},
{
"name": "箱包",
"foods": [
{
"name": "单肩包",
"key": "单肩包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/1.jpg",
"cat": 0
},
{
"name": "斜挎包",
"key": "斜挎包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/2.jpg",
"cat": 0
},
{
"name": "女包",
"key": "女包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/3.jpg",
"cat": 0
},
{
"name": "男包",
"key": "男包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/4.jpg",
"cat": 0
},
{
"name": "双肩包",
"key": "双肩包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/5.jpg",
"cat": 0
},
{
"name": "小方包",
"key": "小方包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/6.jpg",
"cat": 0
},
{
"name": "钱包",
"key": "钱包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/7.jpg",
"cat": 0
},
{
"name": "旅行箱包",
"key": "旅行箱包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/8.jpg",
"cat": 0
},
{
"name": "零钱包",
"key": "零钱包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/9.jpg",
"cat": 0
},
{
"name": "手提包",
"key": "手提包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/10.jpg",
"cat": 0
},
{
"name": "胸包",
"key": "胸包",
"icon": "https://cdn.uviewui.com/uview/common/classify/9/11.jpg",
"cat": 0
}
]
},
{
"name": "内衣",
"foods": [
{
"name": "袜子",
"key": "袜子",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/1.jpg",
"cat": 11
},
{
"name": "吊带背心",
"key": "吊带背心",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/2.jpg",
"cat": 11
},
{
"name": "抹胸",
"key": "抹胸",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/3.jpg",
"cat": 11
},
{
"name": "内裤",
"key": "内裤",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/4.jpg",
"cat": 11
},
{
"name": "文胸",
"key": "文胸",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/5.jpg",
"cat": 11
},
{
"name": "文胸套装",
"key": "文胸套装",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/6.jpg",
"cat": 11
},
{
"name": "打底塑身",
"key": "打底塑身",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/7.jpg",
"cat": 11
},
{
"name": "家居服",
"key": "家居服",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/8.jpg",
"cat": 11
},
{
"name": "船袜",
"key": "船袜",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/9.jpg",
"cat": 11
},
{
"name": "情侣睡衣",
"key": "情侣睡衣",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/10.jpg",
"cat": 11
},
{
"name": "丝袜",
"key": "丝袜",
"icon": "https://cdn.uviewui.com/uview/common/classify/10/11.jpg",
"cat": 11
}
]
},
{
"name": "文娱车品",
"foods": [
{
"name": "车市车品",
"key": "车市车品",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/1.jpg",
"cat": 7
},
{
"name": "办公文具",
"key": "办公文具",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/2.jpg",
"cat": 7
},
{
"name": "考试必备",
"key": "考试必备",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/3.jpg",
"cat": 7
},
{
"name": "笔记本",
"key": "笔记本",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/4.jpg",
"cat": 7
},
{
"name": "艺术礼品",
"key": "礼品",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/5.jpg",
"cat": 7
},
{
"name": "书写工具",
"key": "书写工具",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/6.jpg",
"cat": 7
},
{
"name": "车载电器",
"key": "车载电器",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/7.jpg",
"cat": 7
},
{
"name": "图书音像",
"key": "图书音像",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/8.jpg",
"cat": 7
},
{
"name": "画具画材",
"key": "画具画材",
"icon": "https://cdn.uviewui.com/uview/common/classify/11/9.jpg",
"cat": 7
}
]
},
{
"name": "配饰",
"foods": [
{
"name": "太阳镜",
"key": "太阳镜",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/1.jpg",
"cat": 0
},
{
"name": "皮带",
"key": "皮带",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/2.jpg",
"cat": 0
},
{
"name": "棒球帽",
"key": "棒球帽",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/3.jpg",
"cat": 0
},
{
"name": "手表",
"key": "手表",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/4.jpg",
"cat": 0
},
{
"name": "发饰",
"key": "发饰",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/5.jpg",
"cat": 0
},
{
"name": "项链",
"key": "项链",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/6.jpg",
"cat": 0
},
{
"name": "手饰",
"key": "手饰",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/7.jpg",
"cat": 0
},
{
"name": "耳环",
"key": "耳环",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/8.jpg",
"cat": 0
},
{
"name": "帽子丝巾",
"key": "帽子丝巾",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/9.jpg",
"cat": 0
},
{
"name": "眼镜墨镜",
"key": "眼镜墨镜",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/10.jpg",
"cat": 0
},
{
"name": "发带发箍",
"key": "发带发箍",
"icon": "https://cdn.uviewui.com/uview/common/classify/12/11.jpg",
"cat": 0
}
]
},
{
"name": "家装家纺",
"foods": [
{
"name": "家居饰品",
"key": "家居饰品",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/1.jpg",
"cat": 0
},
{
"name": "凉席",
"key": "凉席",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/2.jpg",
"cat": 0
},
{
"name": "背枕靠枕",
"key": "靠枕",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/3.jpg",
"cat": 0
},
{
"name": "床上用品",
"key": "床上用品",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/4.jpg",
"cat": 0
},
{
"name": "摆件",
"key": "摆件",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/5.jpg",
"cat": 0
},
{
"name": "四件套",
"key": "四件套",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/6.jpg",
"cat": 0
},
{
"name": "装饰品",
"key": "装饰品",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/7.jpg",
"cat": 0
},
{
"name": "卫浴用品",
"key": "卫浴",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/8.jpg",
"cat": 0
},
{
"name": "家居家装",
"key": "家具",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/9.jpg",
"cat": 0
},
{
"name": "蚊帐",
"key": "蚊帐",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/10.jpg",
"cat": 0
},
{
"name": "墙纸贴纸",
"key": "墙纸",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/11.jpg",
"cat": 0
},
{
"name": "空调被",
"key": "空调被",
"icon": "https://cdn.uviewui.com/uview/common/classify/13/12.jpg",
"cat": 0
}
]
},
{
"name": "户外运动",
"foods": [
{
"name": "游泳装备",
"key": "游泳",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/1.jpg",
"cat": 0
},
{
"name": "泳镜",
"key": "泳镜",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/2.jpg",
"cat": 0
},
{
"name": "户外装备",
"key": "户外",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/3.jpg",
"cat": 0
},
{
"name": "健身服饰",
"key": "健身",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/4.jpg",
"cat": 0
},
{
"name": "泳衣",
"key": "泳衣",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/5.jpg",
"cat": 0
},
{
"name": "瑜伽垫",
"key": "瑜伽垫",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/6.jpg",
"cat": 0
},
{
"name": "瑜伽用品",
"key": "瑜伽",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/7.jpg",
"cat": 0
},
{
"name": "健身装备",
"key": "健身",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/8.jpg",
"cat": 0
},
{
"name": "球迷用品",
"key": "球迷",
"icon": "https://cdn.uviewui.com/uview/common/classify/14/9.jpg",
"cat": 0
}
]
}
]
================================================
FILE: common/demo.scss
================================================
/* #ifndef APP-NVUE */
view,
text {
box-sizing: border-box;
}
/* #endif */
/* start--演示页面使用的统一样式--start */
.u-demo {
padding: 25px 20px;
}
.u-demo-wrap {
border-width: 1px;
border-color: #ddd;
border-style: dashed;
background-color: rgb(250, 250, 250);
padding: 20px 10px;
border-radius: 3px;
}
.u-demo-area {
text-align: center;
}
.u-no-demo-here {
color: $u-tips-color;
font-size: 13px;
}
.u-demo-result-line {
border-width: 1px;
border-color: #ddd;
border-style: dashed;
padding: 5px 20px;
margin-top: 30px;
border-radius: 5px;
background-color: rgb(240, 240, 240);
color: $u-content-color;
font-size: 16px;
/* #ifndef APP-NVUE */
word-break: break-word;
display: inline-block;
/* #endif */
text-align: left;
}
.u-demo-title,
.u-config-title {
text-align: center;
font-size: 16px;
font-weight: bold;
margin-bottom: 20px;
}
.u-config-item {
margin-top: 25px;
}
.u-config-title {
margin-top: 20px;
padding-bottom: 5px;
}
.u-item-title {
position: relative;
font-size: 15px;
padding-left: 8px;
line-height: 1;
margin-bottom: 11px;
}
.u-item-title:after {
position: absolute;
width: 4px;
top: -1px;
height: 16px;
/* #ifndef APP-NVUE */
content: '';
/* #endif */
left: 0;
border-radius: 10px;
background-color: $u-content-color;
}
/* end--演示页面使用的统一样式--end */
================================================
FILE: common/http.api.js
================================================
// 如果没有通过拦截器配置域名的话,可以在这里写上完整的URL(加上域名部分)
let hotSearchUrl = '/ebapi/store_api/hot_search';
let indexUrl = '/ebapi/public_api/index';
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
// 此处没有使用传入的params参数
let getSearch = (params = {}) => vm.$u.get(hotSearchUrl, {
id: 2
});
// 此处使用了传入的params参数,一切自定义即可
let getInfo = (params = {}) => vm.$u.post(indexUrl, params);
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
vm.$u.api = {getSearch, getInfo};
}
export default {
install
}
================================================
FILE: common/http.interceptor.js
================================================
// 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token
// 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,也是可以使用的
const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://api.youzixy.com',
// 如果将此值设置为true,拦截回调中将会返回服务端返回的所有数据response,而不是response.data
// 设置为true后,就需要在this.$u.http.interceptor.response进行多一次的判断,请打印查看具体值
// originalData: true,
// 设置自定义头部content-type
// header: {
// 'content-type': 'xxx'
// }
});
// 请求拦截,配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => {
config.header.Token = 'xxxxxx';
// 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html
// config.header.token = vm.token;
// 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
// config.header.token = vm.$store.state.token;
// 方式三,如果token放在了globalData,通过getApp().globalData获取
// config.header.token = getApp().globalData.username;
// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
// const token = uni.getStorageSync('token');
// config.header.token = token;
return config;
}
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
if(res.code == 200) {
// 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
return res.data;
} else return false;
}
}
export default {
install
}
================================================
FILE: common/index.list.js
================================================
module.exports = {
list: [{
"letter": "A",
"data": [{
"name": "阿拉斯加",
"mobile": "13588889999",
"keyword": "阿拉斯加ABA13588889999"
},
{
"name": "阿克苏",
"mobile": "0551-4386721",
"keyword": "阿克苏AKESU0551-4386721"
},
{
"name": "阿拉善",
"mobile": "4008009100",
"keyword": "阿拉善ALASHAN4008009100"
},
{
"name": "阿勒泰",
"mobile": "13588889999",
"keyword": "阿勒泰ALETAI13588889999"
},
{
"name": "阿里",
"mobile": "13588889999",
"keyword": "阿里ALI13588889999"
},
{
"name": "安阳",
"mobile": "13588889999",
"keyword": "13588889999安阳ANYANG"
}
]
},
{
"letter": "B",
"data": [{
"name": "白城",
"mobile": "该主子没有留电话~",
"keyword": "白城BAICHENG"
},
{
"name": "白山",
"mobile": "13588889999",
"keyword": "白山BAISHAN13588889999"
},
{
"name": "白银",
"mobile": "13588889999",
"keyword": "白银BAIYIN13588889999"
},
{
"name": "保定",
"mobile": "13588889999",
"keyword": "保定BAODING13588889999"
}
]
},
{
"letter": "C",
"data": [{
"name": "沧州",
"mobile": "13588889999",
"keyword": "沧州CANGZHOU13588889999"
},
{
"name": "长春",
"mobile": "13588889999",
"keyword": "长春CHANGCHUN13588889999"
}
]
},
{
"letter": "D",
"data": [{
"name": "大理",
"mobile": "13588889999",
"keyword": "大理DALI13588889999"
},
{
"name": "大连",
"mobile": "13588889999",
"keyword": "大连DALIAN13588889999"
}
]
},
{
"letter": "E",
"data": [{
"name": "鄂尔多斯",
"mobile": "13588889999",
"keyword": "鄂尔多斯EERDUOSI13588889999"
},
{
"name": "恩施",
"mobile": "13588889999",
"keyword": "恩施ENSHI13588889999"
},
{
"name": "鄂州",
"mobile": "13588889999",
"keyword": "鄂州EZHOU13588889999"
}
]
},
{
"letter": "F",
"data": [{
"name": "防城港",
"mobile": "该主子没有留电话~",
"keyword": "防城港FANGCHENGGANG"
},
{
"name": "抚顺",
"mobile": "13588889999",
"keyword": "抚顺FUSHUN13588889999"
},
{
"name": "阜新",
"mobile": "13588889999",
"keyword": "阜新FUXIN13588889999"
},
{
"name": "阜阳",
"mobile": "13588889999",
"keyword": "阜阳FUYANG13588889999"
},
{
"name": "抚州",
"mobile": "13588889999",
"keyword": "抚州FUZHOU13588889999"
},
{
"name": "福州",
"mobile": "13588889999",
"keyword": "福州FUZHOU13588889999"
}
]
},
{
"letter": "G",
"data": [{
"name": "甘南",
"mobile": "13588889999",
"keyword": "甘南GANNAN13588889999"
},
{
"name": "赣州",
"mobile": "13588889999",
"keyword": "赣州GANZHOU13588889999"
},
{
"name": "甘孜",
"mobile": "13588889999",
"keyword": "甘孜GANZI13588889999"
}
]
},
{
"letter": "H",
"data": [{
"name": "哈尔滨",
"mobile": "13588889999",
"keyword": "哈尔滨HAERBIN13588889999"
},
{
"name": "海北",
"mobile": "13588889999",
"keyword": "海北HAIBEI13588889999"
},
{
"name": "海东",
"mobile": "13588889999",
"keyword": "海东HAIDONG13588889999"
},
{
"name": "海口",
"mobile": "13588889999",
"keyword": "海口HAIKOU13588889999"
}
]
},
{
"letter": "I",
"data": [{
"name": "ice",
"mobile": "13588889999",
"keyword": "佳木斯JIAMUSI13588889999"
}]
},
{
"letter": "J",
"data": [{
"name": "佳木斯",
"mobile": "13588889999",
"keyword": "佳木斯JIAMUSI13588889999"
},
{
"name": "吉安",
"mobile": "13588889999",
"keyword": "吉安JIAN13588889999"
},
{
"name": "江门",
"mobile": "13588889999",
"keyword": "江门JIANGMEN13588889999"
}
]
},
{
"letter": "K",
"data": [{
"name": "开封",
"mobile": "13588889999",
"keyword": "开封KAIFENG13588889999"
},
{
"name": "喀什",
"mobile": "13588889999",
"keyword": "喀什KASHI13588889999"
},
{
"name": "克拉玛依",
"mobile": "13588889999",
"keyword": "克拉玛依KELAMAYI13588889999"
}
]
},
{
"letter": "L",
"data": [{
"name": "来宾",
"mobile": "13588889999",
"keyword": "来宾LAIBIN13588889999"
},
{
"name": "兰州",
"mobile": "13588889999",
"keyword": "兰州LANZHOU13588889999"
},
{
"name": "拉萨",
"mobile": "13588889999",
"keyword": "拉萨LASA13588889999"
},
{
"name": "乐山",
"mobile": "13588889999",
"keyword": "乐山LESHAN13588889999"
},
{
"name": "凉山",
"mobile": "13588889999",
"keyword": "凉山LIANGSHAN13588889999"
},
{
"name": "连云港",
"mobile": "13588889999",
"keyword": "连云港LIANYUNGANG13588889999"
},
{
"name": "聊城",
"mobile": "18322223333",
"keyword": "聊城LIAOCHENG18322223333"
},
{
"name": "辽阳",
"mobile": "18322223333",
"keyword": "辽阳LIAOYANG18322223333"
},
{
"name": "辽源",
"mobile": "18322223333",
"keyword": "辽源LIAOYUAN18322223333"
},
{
"name": "丽江",
"mobile": "18322223333",
"keyword": "丽江LIJIANG18322223333"
},
{
"name": "临沧",
"mobile": "18322223333",
"keyword": "临沧LINCANG18322223333"
},
{
"name": "临汾",
"mobile": "18322223333",
"keyword": "临汾LINFEN18322223333"
},
{
"name": "临夏",
"mobile": "18322223333",
"keyword": "临夏LINXIA18322223333"
},
{
"name": "临沂",
"mobile": "18322223333",
"keyword": "临沂LINYI18322223333"
},
{
"name": "林芝",
"mobile": "18322223333",
"keyword": "林芝LINZHI18322223333"
},
{
"name": "丽水",
"mobile": "18322223333",
"keyword": "丽水LISHUI18322223333"
}
]
},
{
"letter": "M",
"data": [{
"name": "眉山",
"mobile": "15544448888",
"keyword": "眉山MEISHAN15544448888"
},
{
"name": "梅州",
"mobile": "15544448888",
"keyword": "梅州MEIZHOU15544448888"
},
{
"name": "绵阳",
"mobile": "15544448888",
"keyword": "绵阳MIANYANG15544448888"
},
{
"name": "牡丹江",
"mobile": "15544448888",
"keyword": "牡丹江MUDANJIANG15544448888"
}
]
},
{
"letter": "N",
"data": [{
"name": "南昌",
"mobile": "15544448888",
"keyword": "南昌NANCHANG15544448888"
},
{
"name": "南充",
"mobile": "15544448888",
"keyword": "南充NANCHONG15544448888"
},
{
"name": "南京",
"mobile": "15544448888",
"keyword": "南京NANJING15544448888"
},
{
"name": "南宁",
"mobile": "15544448888",
"keyword": "南宁NANNING15544448888"
},
{
"name": "南平",
"mobile": "15544448888",
"keyword": "南平NANPING15544448888"
}
]
},
{
"letter": "O",
"data": [{
"name": "欧阳",
"mobile": "15544448888",
"keyword": "欧阳ouyang15544448888"
}]
},
{
"letter": "P",
"data": [{
"name": "盘锦",
"mobile": "15544448888",
"keyword": "盘锦PANJIN15544448888"
},
{
"name": "攀枝花",
"mobile": "15544448888",
"keyword": "攀枝花PANZHIHUA15544448888"
},
{
"name": "平顶山",
"mobile": "15544448888",
"keyword": "平顶山PINGDINGSHAN15544448888"
},
{
"name": "平凉",
"mobile": "15544448888",
"keyword": "平凉PINGLIANG15544448888"
},
{
"name": "萍乡",
"mobile": "15544448888",
"keyword": "萍乡PINGXIANG15544448888"
},
{
"name": "普洱",
"mobile": "15544448888",
"keyword": "普洱PUER15544448888"
},
{
"name": "莆田",
"mobile": "15544448888",
"keyword": "莆田PUTIAN15544448888"
},
{
"name": "濮阳",
"mobile": "15544448888",
"keyword": "濮阳PUYANG15544448888"
}
]
},
{
"letter": "Q",
"data": [{
"name": "黔东南",
"mobile": "15544448888",
"keyword": "黔东南QIANDONGNAN15544448888"
},
{
"name": "黔南",
"mobile": "15544448888",
"keyword": "黔南QIANNAN15544448888"
},
{
"name": "黔西南",
"mobile": "15544448888",
"keyword": "黔西南QIANXINAN15544448888"
}
]
},
{
"letter": "R",
"data": [{
"name": "日喀则",
"mobile": "15544448888",
"keyword": "日喀则RIKAZE15544448888"
},
{
"name": "日照",
"mobile": "15544448888",
"keyword": "日照RIZHAO15544448888"
}
]
},
{
"letter": "S",
"data": [{
"name": "三门峡",
"mobile": "15544448888",
"keyword": "三门峡SANMENXIA15544448888"
},
{
"name": "三明",
"mobile": "15544448888",
"keyword": "三明SANMING15544448888"
},
{
"name": "三沙",
"mobile": "15544448888",
"keyword": "三沙SANSHA15544448888"
}
]
},
{
"letter": "T",
"data": [{
"name": "塔城",
"mobile": "15544448888",
"keyword": "塔城TACHENG15544448888"
},
{
"name": "漯河",
"mobile": "15544448888",
"keyword": "漯河TAHE15544448888"
},
{
"name": "泰安",
"mobile": "15544448888",
"keyword": "泰安TAIAN15544448888"
}
]
},
{
"letter": "W",
"data": [{
"name": "潍坊",
"mobile": "15544448888",
"keyword": "潍坊WEIFANG15544448888"
},
{
"name": "威海",
"mobile": "15544448888",
"keyword": "威海WEIHAI15544448888"
},
{
"name": "渭南",
"mobile": "15544448888",
"keyword": "渭南WEINAN15544448888"
},
{
"name": "文山",
"mobile": "15544448888",
"keyword": "文山WENSHAN15544448888"
}
]
},
{
"letter": "X",
"data": [{
"name": "厦门",
"mobile": "15544448888",
"keyword": "厦门XIAMEN15544448888"
},
{
"name": "西安",
"mobile": "15544448888",
"keyword": "西安XIAN15544448888"
},
{
"name": "湘潭",
"mobile": "15544448888",
"keyword": "湘潭XIANGTAN15544448888"
}
]
},
{
"letter": "Y",
"data": [{
"name": "雅安",
"mobile": "15544448888",
"keyword": "雅安YAAN15544448888"
},
{
"name": "延安",
"mobile": "15544448888",
"keyword": "延安YANAN15544448888"
},
{
"name": "延边",
"mobile": "15544448888",
"keyword": "延边YANBIAN15544448888"
},
{
"name": "盐城",
"mobile": "15544448888",
"keyword": "盐城YANCHENG15544448888"
}
]
},
{
"letter": "Z",
"data": [{
"name": "枣庄",
"mobile": "15544448888",
"keyword": "枣庄ZAOZHUANG15544448888"
},
{
"name": "张家界",
"mobile": "15544448888",
"keyword": "张家界ZHANGJIAJIE15544448888"
},
{
"name": "张家口",
"mobile": "15544448888",
"keyword": "张家口ZHANGJIAKOU15544448888"
}
]
},
{
"letter": "#",
"data": [{
"name": "其他.",
"mobile": "16666666666",
"keyword": "echo16666666666"
}]
}
]
}
================================================
FILE: common/locales/en.js
================================================
export default {
// 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
components: {
desc: 'Numerous components cover the various requirements of the development process, and the components are rich in functions and compatible with multiple terminals. Let you integrate quickly, out of the box'
},
js: {
desc: 'Numerous intimate gadgets are a weapon that you can call upon during the development process, allowing you to dart in your hand and pierce the Yang with a hundred steps'
},
template: {
desc: 'Collection of many commonly used pages and layouts, reducing the repetitive work of developers, allowing you to focus on logic and get twice the result with half the effort'
},
nav: {
components: 'Components',
js: 'JS',
template: 'Template'
},
common: {
intro: 'UI framework for rapid development of multiple platforms',
title: 'uView UI',
},
}
================================================
FILE: common/locales/zh.js
================================================
export default {
// 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
components: {
desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用'
},
js: {
desc: '众多的贴心小工具,是你开发过程中召之即来的利器,让你飞镖在手,百步穿杨'
},
template: {
desc: '收集众多的常用页面和布局,减少开发者的重复工作,让你专注逻辑,事半功倍'
},
nav: {
components: '组件',
js: '工具',
template: '模板'
},
common: {
intro: '多平台快速开发的UI框架',
title: 'uView UI',
},
}
================================================
FILE: components/page-nav/page-nav.vue
================================================
uView {{version}}
{{$t('common.intro')}}
{{desc}}
================================================
FILE: main.js
================================================
import Vue from 'vue';
import App from './App';
Vue.config.productionTip = false;
App.mpType = 'app';
// 此处为演示Vue.prototype使用,非uView的功能部分
Vue.prototype.vuePrototype = '枣红';
// 引入全局uView
import uView from 'uview-ui';
Vue.use(uView);
// 此处为演示vuex使用,非uView的功能部分
import store from '@/store';
// 引入uView提供的对vuex的简写法文件
let vuexStore = require('@/store/$u.mixin.js');
Vue.mixin(vuexStore);
// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare);
// i18n部分的配置
// 引入语言包,注意路径
import Chinese from '@/common/locales/zh.js';
import English from '@/common/locales/en.js';
// VueI18n
import VueI18n from '@/common/vue-i18n.min.js';
// VueI18n
Vue.use(VueI18n);
const i18n = new VueI18n({
// 默认语言
locale: 'zh',
// 引入语言文件
messages: {
'zh': Chinese,
'en': English,
}
});
// 由于微信小程序的运行机制问题,需声明如下一行,H5和APP非必填
Vue.prototype._i18n = i18n;
const app = new Vue({
i18n,
store,
...App
});
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
import httpInterceptor from '@/common/http.interceptor.js';
Vue.use(httpInterceptor, app);
// http接口API抽离,免于写url或者一些固定的参数
import httpApi from '@/common/http.api.js';
Vue.use(httpApi, app);
app.$mount();
================================================
FILE: manifest.json
================================================
{
"name" : "uView",
"appid" : "__UNI__6655525",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.8.8",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
// APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭
"optimization" : {
"subPackages" : true
},
"safearea" : {
"bottom" : {
"offset" : "none"
}
},
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"compilerVersion" : 3,
"modules" : {},
"distribute" : {
"android" : {
"permissions" : [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
"ios" : {},
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : true,
"es6" : false,
"minified" : true,
"postcss" : true
},
"optimization" : {
"subPackages" : true
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true,
"component2" : true
},
"mp-qq" : {
"optimization" : {
"subPackages" : true
},
"appid" : "15646153"
},
"mp-baidu" : {
"usingComponents" : true,
"appid" : "17597421"
},
"mp-toutiao" : {
"usingComponents" : true,
"appid" : ""
},
"h5" : {
"template" : "template.h5.html",
"router" : {
"mode" : "hash",
"base" : ""
},
"optimization" : {
"treeShaking" : {
"enable" : false
}
},
"title" : "uView UI"
}
}
================================================
FILE: package.json
================================================
{
"name": "uview1.0",
"version": "1.0.0",
"description": "\r
\r
\r uView
\r 多平台快速开发的UI框架
",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "node deploy",
"preinstall": "npx only-allow pnpm"
},
"repository": {
"type": "git",
"url": "git+https://github.com/YanxinNet/uView.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/YanxinNet/uView/issues"
},
"homepage": "https://github.com/YanxinNet/uView#readme",
"dependencies": {
"vue-i18n": "^8.20.0",
"anve-upload-upyun": "^1.0.8"
}
}
================================================
FILE: pages/componentsA/avatar/index.vue
================================================
演示效果
参数配置
模式选择
性别选择
等级
自定义内容
尺寸
================================================
FILE: pages/componentsA/avatarCropper/index.vue
================================================
演示效果
选择图片
================================================
FILE: pages/componentsA/backTop/index.vue
================================================
演示效果
滚动页面即可在右下角看到返回顶部的按钮
参数配置
模式
组件位置
显示组件的滚动条距离
自定义样式
================================================
FILE: pages/componentsA/calendar/index.vue
================================================
演示效果
{{result}}
参数配置
状态
模式
自定义样式
================================================
FILE: pages/componentsA/empty/index.vue
================================================
演示效果
slot按钮
参数配置
模式选择
购物车为空
页面不存在
没有搜索结果
没有收货地址
没有WiFi
订单为空
没有优惠券
没有收藏
无权限
无历史记录
无新闻列表
消息列表为空
列表为空
数据为空
待扩展
传入slot
================================================
FILE: pages/componentsA/field/index.vue
================================================
演示效果
发送验证码
参数配置
右侧按钮
显示错误信息
是否必填
显示左图标和右箭头
第一个输入框为textarea类型
================================================
FILE: pages/componentsA/form/index.vue
================================================
{{ item.name }}
{{ item.name }}
{{codeTips}}
勾选代表同意uView的版权协议
提交
参数配置
label对齐方式
边框
radio、checkbox样式
错误提示方式
================================================
FILE: pages/componentsA/fullScreen/index.vue
================================================
演示效果
通过压窗屏打开的模态框,可以遮盖顶部原生的导航栏和底部tabbar栏。
注意:压窗屏只对APP有效,其他端无效。
参数配置
状态
================================================
FILE: pages/componentsA/icon/index.vue
================================================
{{item.name}}
================================================
FILE: pages/componentsA/indexList/index.vue
================================================
{{item1.name}}
================================================
FILE: pages/componentsA/keyboard/index.vue
================================================
演示效果
清空
参数配置
键盘开关
键盘类型
打乱顺序
上方工具条
是否显示遮罩
================================================
FILE: pages/componentsA/lazyLoad/index.vue
================================================
================================================
FILE: pages/componentsA/modal/index.vue
================================================
演示效果
请点击弹出弹窗查看效果
参数配置
状态
是否显示标题
自定义内容
异步关闭
================================================
FILE: pages/componentsA/navbar/index.vue
================================================
轻舟已过万重山
演示效果
查看顶部导航栏效果
参数配置
标题长度
隐藏左侧返回区域
自定义左侧内容
自定义右侧内容
传入整体slot
完全自定义传入内容
背景色
================================================
FILE: pages/componentsA/noNetwork/index.vue
================================================
演示效果
请断开手机的WiFi和移动数据来查看效果
参数配置
自定义提示语
自定义图标
================================================
FILE: pages/componentsA/parse/index.vue
================================================
================================================
FILE: pages/componentsA/select/index.vue
================================================
演示效果
select值:{{ result }}
参数配置
状态
模式
================================================
FILE: pages/componentsA/slider/index.vue
================================================
演示效果
{{value}}
滑块值:{{value}}
参数配置
自定义颜色
自定义传入内容
自定义尺寸
步进值
最大最小值
================================================
FILE: pages/componentsA/tabs/index.vue
================================================
演示效果
参数配置
模式选择
标签个数(非滚动模式)
活动选项字颜色
字体加粗
================================================
FILE: pages/componentsA/tag/index.vue
================================================
演示效果
参数配置
模式选择
显示内容
主题选择
形状
尺寸
关闭图标
================================================
FILE: pages/componentsA/test/index.vue
================================================
{{ item.name }}
{{ item.name }}
================================================
FILE: pages/componentsA/timeLine/index.vue
================================================
待取件
[自提柜]您的快件已放在楼下侧门,直走前方53.6米,左拐约10步,再右拐直走,见一红灯笼停下,叩门三下,喊“芝麻开门”即可。
2019-05-08 12:12
派送中
【深圳市】快件已到达目的地,派件员为国产锦衣卫007号,电话:13833882438,请留意快递信息
2019-05-08 06:03
运输中
【深圳市】快递已到达 深圳固戍一部
2019-05-07 08:05
【深圳市】快件已从深圳运转中心发出,正在发往深圳宝安一部
2019-12-06 22:30
【深圳市】快件已到达 深圳运转中心
2019-12-04 16:42
【郑州市】快件已从郑州运转中心出发,正在发往深圳运转中心
2019-12-02 12:55
【郑州市】快件已到达 郑州运转中心
2019-12-02 08:23
您购买的商品【尚方宝剑,先斩后奏】,经由北京军区仓库发货,国内快递承运人【中南海保镖】。
2019-12-01 07:00
================================================
FILE: pages/componentsA/toast/index.vue
================================================
演示效果
见弹出toast
参数配置
主题
结束后自动跳转
位置
显示图标
================================================
FILE: pages/componentsA/topTips/index.vue
================================================
演示效果
点击参数配置查看效果
参数配置
主题选择
显示时间
================================================
FILE: pages/componentsA/verificationCode/index.vue
================================================
演示效果
{{tips}}
重置
参数配置
倒计时间
自定义提示语
================================================
FILE: pages/componentsB/card/index.vue
================================================
瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半
釉色渲染仕女图韵味被私藏,而你嫣然的一笑如含苞待放
参数配置
左上角图标
内边距
底部
外边框
================================================
FILE: pages/componentsB/checkbox/index.vue
================================================
演示效果
{{item.name}}
{{result.length ? `选中了"${getResult}"` : '请选择'}}
参数配置
形状
整体大小(单位rpx)
激活颜色
默认选中第一个
每个占一行
每个宽度50%
最大选择数量
禁用第一个
================================================
FILE: pages/componentsB/divider/index.vue
================================================
演示效果
{{text}}
参数配置
提示内容
单边线宽
横线颜色
内容样式
================================================
FILE: pages/componentsB/dropdown/index.vue
================================================
{{item.label}}
确定
参数配置
下边框
激活颜色
遮罩是否可点击
================================================
FILE: pages/componentsB/image/index.vue
================================================
演示效果
加载失败
参数配置
状态
加载中状态
加载失败状态
形状
================================================
FILE: pages/componentsB/line/index.vue
================================================
演示效果
参数配置
颜色
线条类型
细边
方向
================================================
FILE: pages/componentsB/loading/index.vue
================================================
演示效果
参数配置
模式
颜色(只对圆圈模式有效)
尺寸(单位rpx)
是否显示
================================================
FILE: pages/componentsB/noticeBar/index.vue
================================================
演示效果
参数配置
主题
滚动模式
是否衔接(水平模式有效)
状态
速度
图标
================================================
FILE: pages/componentsB/picker/index.vue
================================================
演示效果
{{ input ? input : 'Picker值' }}
参数配置
Picker开关
模式选择
默认时间
显示时分秒
默认地区
================================================
FILE: pages/componentsB/radio/index.vue
================================================
演示效果
{{item.name}}
{{value ? `选中了"${result}"` : '请选择'}}
参数配置
形状
整体大小(单位rpx)
激活颜色
每个占一行
每个宽度50%
默认选中第一个
禁用第一个
================================================
FILE: pages/componentsB/rate/index.vue
================================================
演示效果
参数配置
初始值
镂空状态
自定义样式
自定义图标
是否分层
是否禁用
星星数量
================================================
FILE: pages/componentsB/readMore/index.vue
================================================
演示效果
参数配置
超出高度隐藏
展开后可关闭
================================================
FILE: pages/componentsB/search/index.vue
================================================
演示效果
参数配置
初始值
搜索框形状
清除控件
右侧控件
水平对齐方式
================================================
FILE: pages/componentsB/skeleton/index.vue
================================================
演示效果
{{userInfo.nickName}}
{{item}}
参数配置
加载状态
骨架动画
自定义样式
================================================
FILE: pages/componentsB/steps/index.vue
================================================
演示效果
参数配置
模式
方向
自定义图标
当前步值
================================================
FILE: pages/componentsB/sticky/index.vue
================================================
演示效果
宝剑锋从磨砺出,梅花香自苦寒来
参数配置
吸顶高度
状态
================================================
FILE: pages/componentsB/swipeAction/index.vue
================================================
演示效果
{{ item.title }}
参数配置
状态(操作第一个)
禁止滑动
================================================
FILE: pages/componentsB/swiper/index.vue
================================================
演示效果
参数配置
指示器模式
标题
指示器位置
3D效果
================================================
FILE: pages/componentsB/switch/index.vue
================================================
演示效果
参数配置
状态
颜色
尺寸(单位rpx)
加载中
禁用
异步控制
================================================
FILE: pages/componentsB/tabbar/index.vue
================================================
参数配置
状态
凸起按钮
背景色
顶部边框
提示角标
================================================
FILE: pages/componentsB/table/index.vue
================================================
演示效果
姓名
年龄
籍贯
性别
吕布
22
楚河
男
项羽
28
汉界
男
木兰
24
南国
女
参数配置
边框颜色
对齐方式
================================================
FILE: pages/componentsB/upload/index.vue
================================================
演示效果
上传
清空列表
参数配置
上传方式
自定义控件(进度条和删除按钮)
最大上传数量
自定义样式(预览区域和上传按钮)
================================================
FILE: pages/componentsB/waterfall/index.vue
================================================
{{ item.title }}
{{ item.price }}元
自营
放心购
{{ item.shop }}
{{ item.title }}
{{ item.price }}元
自营
放心购
{{ item.shop }}
================================================
FILE: pages/componentsC/actionSheet/index.vue
================================================
演示效果
唤起ActionSheet
参数配置
取消按钮
点击遮罩关闭
================================================
FILE: pages/componentsC/alertTips/index.vue
================================================
演示效果
参数配置
左侧图标
关闭图标
主题
状态
================================================
FILE: pages/componentsC/badge/index.vue
================================================
演示效果
参数配置
数值显示
主题选择
显示点
尺寸
位置偏移
中心点与父右上角重合
================================================
FILE: pages/componentsC/button/index.vue
================================================
演示效果
山川异域,风月同天
参数配置
主题选择
尺寸大小
形状
镂空
水波纹(感觉哪里有问题?点击顶部的按钮试试)
细边框
加载中
================================================
FILE: pages/componentsC/cell/index.vue
================================================
演示效果
参数配置
更换图标
自定义右侧内容
描述信息
更换标题
右侧箭头
================================================
FILE: pages/componentsC/circleProgress/index.vue
================================================
查找中
查找中
================================================
FILE: pages/componentsC/collapse/index.vue
================================================
演示效果
{{item.body}}
参数配置
手风琴模式
右侧箭头
自定义样式
================================================
FILE: pages/componentsC/color/index.vue
================================================
主色调
Primary
#2979ff
Dark
#2b85e4
Disabled
#a0cfff
Light
#ecf5ff
Error
Error
#fa3534
Dark
#dd6161
Disabled
#fab6b6
Light
#fef0f0
Warning
Warning
#ff9900
Dark
#f29100
Disabled
#fcbd71
Light
#fdf6ec
Info
Info
#909399
Dark
#82848a
Disabled
#c8c9cc
Light
#f4f4f5
Success
Success
#19be6b
Dark
#18b566
Disabled
#71d5a1
Light
#dbf1e1
文字颜色
主要文字
#303133
常规文字
#606266
次要文字
#909399
占位文字
#c0c4cc
边框颜色
一级边框
#dcdfe6
二级边框
#e4e7ed
三级边框
#ebeef5
四级边框
#f2f6fc
背景颜色
背景颜色
#f3f4f6
================================================
FILE: pages/componentsC/countDown/index.vue
================================================
演示效果
参数配置
调整时间
分隔符
自定义样式
显示天
字体大小
================================================
FILE: pages/componentsC/countTo/index.vue
================================================
演示效果
如果使用text-align: center对齐,数字滚动期间可能会抖动,见文档说明
参数配置
状态
目标值
滚动时间
显示小数
字体加粗
================================================
FILE: pages/componentsC/gap/index.vue
================================================
演示效果
参数配置
背景颜色
高度
上下外边距
================================================
FILE: pages/componentsC/grid/index.vue
================================================
演示效果
图片
锁头
沙漏
首页
星星
音量
回收站
快进
购物车
{{ '宫格' + (index + 1) }}
{{ '宫格' + (index + 1) }}
{{ '宫格' + (index + 1) }}
参数配置
是否显示边框
是否可滑动
修改列数
================================================
FILE: pages/componentsC/layout/index.vue
================================================
演示效果
参数配置
每个栅格占用栏数(演示共3个栅格)
分栏偏移
水平排列方式(微信小程序无效)
================================================
FILE: pages/componentsC/link/index.vue
================================================
演示效果
点此链接,跳转uView官网
参数配置
下划线
自定义样式
================================================
FILE: pages/componentsC/loadmore/index.vue
================================================
演示效果
参数配置
模式选择
自定义提示语
加载中图标样式
没有更多时用点替代
================================================
FILE: pages/componentsC/mask/index.vue
================================================
演示效果
请点击弹出遮罩查看效果
参数配置
状态
缩放效果
内容填充
动画时长(ms)
================================================
FILE: pages/componentsC/messageInput/index.vue
================================================
演示效果
参数配置
模式选择
输入长度
初始值(为满足演示需要,微信小程序切换会有抖动,非性能问题)
初始值
呼吸灯效果
是否加粗
点替代输入值
================================================
FILE: pages/componentsC/numberBox/index.vue
================================================
演示效果
参数配置
初始值
自定义样式
是否禁用
步进值
================================================
FILE: pages/componentsC/popup/index.vue
================================================
演示效果
唤起弹窗
关闭弹窗
关闭弹窗
参数配置
状态
弹出方向
关闭按钮
关闭按钮位置
================================================
FILE: pages/componentsC/progress/index.vue
================================================
演示效果
查找中
参数配置
模式选择
增减
自定义样式(线型时有效)
动态条纹(线型时有效)
================================================
FILE: pages/componentsC/section/index.vue
================================================
演示效果
参数配置
更换主标题
竖条状态
是否显示右边部分
主标题粗体
主标题颜色
================================================
FILE: pages/componentsC/subsection/index.vue
================================================
演示效果
参数配置
模式选择(为满足演示需要,切换会有抖动,非性能问题)
Current值
活动选项字颜色
字体加粗
================================================
FILE: pages/componentsC/test/index.vue
================================================
================================================
FILE: pages/example/components.config.js
================================================
export default [{
groupName: '基础组件',
groupName_en: 'Basic components',
list: [{
path: '/pages/componentsC/color/index',
icon: 'color',
title: 'Color 色彩',
title_en: 'Color',
}, {
path: '/pages/componentsA/icon/index',
icon: 'icon',
title: 'Icon 图标',
title_en: 'Icon',
},{
path: '/pages/componentsB/image/index',
icon: 'image',
title: 'Image 图片',
title_en: 'Image',
}, {
path: '/pages/componentsC/button/index',
icon: 'button',
title: 'Button 按钮',
title_en: 'Button',
}, {
path: '/pages/componentsC/layout/index',
icon: 'layout',
title: 'Layout 布局',
title_en: 'Layout',
}, {
path: '/pages/componentsC/cell/index',
icon: 'cell',
title: 'Cell 单元格',
title_en: 'Cell',
}, {
path: '/pages/componentsC/badge/index',
icon: 'badge',
title: 'Badge 徽标数',
title_en: 'Badge',
}, {
path: '/pages/componentsA/tag/index',
icon: 'tag',
title: 'Tag 标签',
title_en: 'Tag',
}]
},
{
groupName: '表单组件',
groupName_en: 'Form components',
list: [{
path: '/pages/componentsA/form/index',
icon: 'form',
title: 'Form 表单',
title_en: 'Form',
}, {
path: '/pages/componentsA/calendar/index',
icon: 'calendar',
title: 'Calendar 日历',
title_en: 'Calendar',
}, {
path: '/pages/componentsA/select/index',
icon: 'select',
title: 'Select 列选择器',
title_en: 'Select',
}, {
path: '/pages/componentsA/keyboard/index',
icon: 'keyboard',
title: 'Keyboard 键盘',
title_en: 'Keyboard',
}, {
path: '/pages/componentsB/picker/index',
icon: 'picker',
title: 'Picker 选择器',
title_en: 'Picker',
}, {
path: '/pages/componentsB/rate/index',
icon: 'rate',
title: 'Rate 评分',
title_en: 'Rate',
}, {
path: '/pages/componentsB/search/index',
icon: 'search',
title: 'Search 搜索',
title_en: 'Search',
}, {
path: '/pages/componentsC/numberBox/index',
icon: 'numberBox',
title: 'NumberBox 步进器',
title_en: 'NumberBox',
}, {
path: '/pages/componentsB/upload/index',
icon: 'upload',
title: 'Upload 上传',
title_en: 'Upload',
}, {
path: '/pages/componentsA/verificationCode/index',
icon: 'verificationCode',
title: 'VerificationCode 验证码倒计时',
title_en: 'VerificationCode',
}, {
path: '/pages/componentsA/field/index',
icon: 'field',
title: 'Field 输入框',
title_en: 'Field',
}, {
path: '/pages/componentsB/checkbox/index',
icon: 'checkbox',
title: 'Checkbox 复选框',
title_en: 'Checkbox',
}, {
path: '/pages/componentsB/radio/index',
icon: 'radio',
title: 'Radio 单选框',
title_en: 'Radio',
}, {
path: '/pages/componentsB/switch/index',
icon: 'switch',
title: 'Switch 开关选择器',
title_en: 'Switch',
}, {
path: '/pages/componentsA/slider/index',
icon: 'slider',
title: 'Slider 滑动选择器',
title_en: 'Slider',
}]
}, {
groupName: '数据组件',
groupName_en: 'Data components',
list: [{
path: '/pages/componentsC/progress/index',
icon: 'progress',
title: 'Progress 进度条',
title_en: 'Progress',
}, {
path: '/pages/componentsB/table/index',
icon: 'table',
title: 'Table 表格',
title_en: 'Table',
}, {
path: '/pages/componentsC/countDown/index',
icon: 'countDown',
title: 'CountDown 倒计时',
title_en: 'CountDown',
}, {
path: '/pages/componentsC/countTo/index',
icon: 'countTo',
title: 'CountTo 数字滚动',
title_en: 'CountTo',
}]
}, {
groupName: '反馈组件',
groupName_en: 'Feedback components',
list: [{
path: '/pages/componentsC/actionSheet/index',
icon: 'actionSheet',
title: 'ActionSheet 操作菜单',
title_en: 'ActionSheet',
}, {
path: '/pages/componentsC/alertTips/index',
icon: 'alertTips',
title: 'AlertTips 警告提示',
title_en: 'AlertTips',
}, {
path: '/pages/componentsA/toast/index',
icon: 'toast',
title: 'Toast 消息提示',
title_en: 'Toast',
}, {
path: '/pages/componentsB/noticeBar/index',
icon: 'noticeBar',
title: 'NoticeBar 滚动通知',
title_en: 'NoticeBar',
}, {
path: '/pages/componentsA/topTips/index',
icon: 'topTips',
title: 'TopTips 顶部提示',
title_en: 'TopTips',
}, {
path: '/pages/componentsB/swipeAction/index',
icon: 'swipeAction',
title: 'SwipeAction 滑动单元格',
title_en: 'SwipeAction',
}, {
path: '/pages/componentsC/collapse/index',
icon: 'collapse',
title: 'Collapse 折叠面板',
title_en: 'Collapse',
}, {
path: '/pages/componentsC/popup/index',
icon: 'popup',
title: 'Popup 弹出层',
title_en: 'Popup',
}, {
path: '/pages/componentsA/modal/index',
icon: 'modal',
title: 'Modal 模态框',
title_en: 'Modal',
}, {
path: '/pages/componentsA/fullScreen/index',
icon: 'pressingScreen',
title: 'fullScreen 压窗屏',
title_en: 'fullScreen',
}]
}, {
groupName: '布局组件',
groupName_en: 'Layout components',
list: [{
path: '/pages/componentsB/line/index',
icon: 'line',
title: 'Line 线条',
title_en: 'Line',
}, {
path: '/pages/componentsB/card/index',
icon: 'card',
title: 'Card 卡片',
title_en: 'Card',
}, {
path: '/pages/componentsC/mask/index',
icon: 'mask',
title: 'Mask 遮罩层',
title_en: 'Mask',
},
// #ifndef MP-TOUTIAO
{
path: '/pages/componentsA/noNetwork/index',
icon: 'noNetwork',
title: 'NoNetwork 无网络提示',
title_en: 'NoNetwork',
},
// #endif
{
path: '/pages/componentsC/grid/index',
icon: 'grid',
title: 'Grid 宫格布局',
title_en: 'Grid',
}, {
path: '/pages/componentsB/swiper/index',
icon: 'swiper',
title: 'Swiper 轮播图',
title_en: 'Swiper',
}, {
path: '/pages/componentsA/timeLine/index',
icon: 'timeLine',
title: 'TimeLine 时间轴',
title_en: 'TimeLine',
}, {
path: '/pages/componentsB/skeleton/index',
icon: 'skeleton',
title: 'Skeleton 骨架屏',
title_en: 'Skeleton',
}, {
path: '/pages/componentsB/sticky/index',
icon: 'sticky',
title: 'Sticky 吸顶',
title_en: 'Sticky',
},
// #ifndef MP-TOUTIAO
{
path: '/pages/componentsB/waterfall/index',
icon: 'waterfall',
title: 'Waterfall 瀑布流',
title_en: 'Waterfall',
},
// #endif
{
path: '/pages/componentsB/divider/index',
icon: 'divider',
title: 'Divider 分割线',
title_en: 'Divider',
}]
}, {
groupName: '导航组件',
groupName_en: 'Navigation components',
list: [{
path: '/pages/componentsB/dropdown/index',
icon: 'dropdown',
title: 'Dropdown 下拉菜单',
title_en: 'Dropdown',
},{
path: '/pages/componentsB/tabbar/index',
icon: 'tabbar',
title: 'Tabbar 底部导航栏',
title_en: 'Tabbar',
},{
path: '/pages/componentsA/backTop/index',
icon: 'backTop',
title: 'BackTop 返回顶部',
title_en: 'BackTop',
},{
path: '/pages/componentsA/navbar/index',
icon: 'navbar',
title: 'Navbar 导航栏',
title_en: 'Navbar',
}, {
path: '/pages/componentsA/tabs/index',
icon: 'tabs',
title: 'Tabs 标签',
title_en: 'Tabs',
},
// #ifndef MP-ALIPAY
{
path: '/pages/template/order/index',
icon: 'tabsSwiper',
title: 'TabsSwiper 全屏选项卡',
title_en: 'TabsSwiper',
},
// #endif
{
path: '/pages/componentsC/subsection/index',
icon: 'subsection',
title: 'Subsection 分段器',
title_en: 'Subsection',
}, {
path: '/pages/componentsA/indexList/index',
icon: 'indexList',
title: 'IndexList 索引列表',
title_en: 'IndexList',
}, {
path: '/pages/componentsB/steps/index',
icon: 'steps',
title: 'Steps 步骤条',
title_en: 'Steps',
}, {
path: '/pages/componentsA/empty/index',
icon: 'empty',
title: 'Empty 内容为空',
title_en: 'Empty',
}, {
path: '/pages/componentsC/section/index',
icon: 'section',
title: 'Section 查看更多',
title_en: 'Section',
}]
}, {
groupName: '其他组件',
groupName_en: 'Other components',
list: [{
path: '/pages/componentsA/parse/index',
icon: 'parse',
title: 'Parse 富文本解析器',
title_en: 'Parse',
},{
path: '/pages/componentsC/messageInput/index',
icon: 'messageInput',
title: 'MessageInput 验证码输入',
title_en: 'MessageInput',
}, {
path: '/pages/componentsA/avatarCropper/index',
icon: 'avatarCropper',
title: 'AvatarCropper 头像裁剪',
title_en: 'AvatarCropper',
}, {
path: '/pages/componentsC/loadmore/index',
icon: 'loadmore',
title: 'Loadmore 加载更多',
title_en: 'Loadmore',
}, {
path: '/pages/componentsB/readMore/index',
icon: 'readMore',
title: 'ReadMore 展开阅读更多',
title_en: 'ReadMore',
}, {
path: '/pages/componentsA/lazyLoad/index',
icon: 'lazyLoad',
title: 'LazyLoad 懒加载',
title_en: 'LazyLoad',
}, {
path: '/pages/componentsC/gap/index',
icon: 'gap',
title: 'Gap 间隔槽',
title_en: 'Gap',
}, {
path: '/pages/componentsA/avatar/index',
icon: 'avatar',
title: 'Avatar 头像',
title_en: 'Avatar',
}, {
path: '/pages/componentsC/link/index',
icon: 'link',
title: 'Link 超链接',
title_en: 'Link',
}, {
path: '/pages/componentsB/loading/index',
icon: 'loading',
title: 'Loading 加载动画',
title_en: 'Loading',
}]
},
]
================================================
FILE: pages/example/components.vue
================================================
================================================
FILE: pages/example/js.config.js
================================================
export default [
{
groupName: '网络',
groupName_en: 'Network',
list: [
{
path: 'http',
icon: 'http',
title: 'Http 请求',
title_en: 'Http',
}
]
},
{
groupName: '全局变量',
groupName_en: 'Global variable',
list: [
{
path: 'globalVariable',
icon: 'globalVariable',
title: 'GlobalVariable 全局变量',
title_en: 'GlobalVariable',
}
]
},
{
groupName: '工具库',
groupName_en: 'Tool library',
list: [
{
path: 'debounce',
icon: 'debounce',
title: 'Throttle | Debounce 节流防抖',
title_en: 'Throttle | Debounce',
},
{
path: 'deepMerge',
icon: 'deepMerge',
title: 'DeepMerge 对象深度合并',
title_en: 'DeepMerge',
},{
path: 'deepClone',
icon: 'deepClone',
title: 'DeepClone 对象深度克隆',
title_en: 'DeepClone',
},
{
path: 'timeFormat',
icon: 'timeFormat',
title: 'TimeFormat 时间格式化',
title_en: 'TimeFormat',
},{
path: 'timeFrom',
icon: 'timeFrom',
title: 'TimeFrom 多久之前',
title_en: 'TimeFrom',
},{
path: 'guid',
icon: 'guid',
title: 'Guid 全局唯一id',
title_en: 'Guid',
},{
path: 'route',
icon: 'route',
title: 'Route 路由跳转',
title_en: 'Route',
},{
path: 'randomArray',
icon: 'randomArray',
title: 'RandomArray 数组乱序',
title_en: 'RandomArray',
},{
path: 'colorSwitch',
icon: 'colorSwitch',
title: 'ColorSwitch 颜色转换',
title_en: 'ColorSwitch',
},{
path: 'color',
icon: 'color',
title: 'Color 颜色值',
title_en: 'Color',
},{
path: 'queryParams',
icon: 'queryParams',
title: 'QueryParams 对象转URL参数',
title_en: 'QueryParams',
},{
path: 'test',
icon: 'test',
title: 'Test 规则校验',
title_en: 'Test',
},{
path: 'md5',
icon: 'md5',
title: 'Md5 md5加密',
title_en: 'Md5',
},{
path: 'random',
icon: 'random',
title: 'Random 随机数值',
title_en: 'Random',
},{
path: 'trim',
icon: 'trim',
title: 'Trim 去除空格',
title_en: 'Trim',
},{
path: 'getRect',
icon: 'getRect',
title: 'GetRect 节点信息',
title_en: 'GetRect',
},{
path: 'mpShare',
icon: 'mpShare',
title: 'MpShare 小程序分享',
title_en: 'MpShare',
}
]
}
]
================================================
FILE: pages/example/js.vue
================================================
================================================
FILE: pages/example/template.config.js
================================================
export default [
{
groupName: '部件',
groupName_en: 'Parts',
list: [
{
path: 'coupon',
icon: 'coupon',
title: 'Coupon 优惠券',
title_en: 'Coupon',
}
]
},
{
groupName: '页面',
groupName_en: 'Page',
list: [
{
path: '/pages/template/wxCenter/index',
icon: 'wxCenter',
title: 'WxCenter 仿微信个人中心',
title_en: 'WxCenter',
},
// {
// path: '/pages/template/douyin/index',
// icon: 'douyin',
// title: 'Douyin 仿抖音',
// },
{
path: '/pages/template/keyboardPay/index',
icon: 'keyboardPay',
title: 'KeyboardPay 自定义键盘支付模板',
title_en: 'KeyboardPay',
},
{
path: '/pages/template/mallMenu/index1',
icon: 'mall_menu_1',
title: 'MallMenu 垂直分类(左右独立)',
title_en: 'MallMenu 1',
},{
path: '/pages/template/mallMenu/index2',
icon: 'mall_menu_2',
title: 'MallMenu 垂直分类(左右联动)',
title_en: 'MallMenu 2',
},{
path: 'submitBar',
icon: 'submitBar',
title: 'SubmitBar 提交订单栏',
title_en: 'SubmitBar',
},{
path: 'comment',
icon: 'comment',
title: 'Comment 评论列表',
title_en: 'Comment',
},{
path: 'order',
icon: 'order',
title: 'Order 订单列表',
title_en: 'Order',
},{
path: 'login',
icon: 'login',
title: 'Login 登录界面',
title_en: 'Login',
},{
path: 'address',
icon: 'address',
title: 'Address 收货地址',
title_en: 'Address',
},{
path: 'citySelect',
icon: 'citySelect',
title: 'CitySelect 城市选择',
title_en: 'CitySelect',
}
]
}
]
================================================
FILE: pages/example/template.vue
================================================
================================================
FILE: pages/library/color/index.vue
================================================
演示效果
此处演示为通过JS调用框架内置颜色值,此外还可以通过scss变量调用。
晓镜但愁云鬓改,夜吟应觉月光寒
参数配置
主题
常用颜色
================================================
FILE: pages/library/colorSwitch/index.vue
================================================
演示效果
{{result}}
参数配置
GRB转HEX
HEX转GRB
颜色渐变(rgb(21,21,21)-rgb(56,56,56),分10份)
执行
================================================
FILE: pages/library/debounce/index.vue
================================================
演示效果
选择节流或者防抖模式,点击按钮,将会执行回调并显示在下方:
{{(index >= 1) ? '-' : ''}}回调
点击触发
参数配置
模式
时间间隔
执行时机
================================================
FILE: pages/library/deepClone/index.vue
================================================
演示效果
源对象为:"{info: {name: 'mary'}}"
{{result}}
================================================
FILE: pages/library/deepMerge/index.vue
================================================
演示效果
源对象1为:"{info: {name: 'mary'}}"
源对象2为:"{info: {age: '22'}}"
{{result}}
参数配置
模式
================================================
FILE: pages/library/getRect/index.vue
================================================
演示效果
第一个节点
第2个节点
节点信息为
{{ JSON.stringify(result) }}
点我自动滚动到顶部
参数配置
元素
指定元素置顶
================================================
FILE: pages/library/globalVariable/globalData.vue
================================================
演示效果
此处为演示globalData全局变量的使用,需手动更新
{{result}}
参数配置
修改globalData为如下值
================================================
FILE: pages/library/globalVariable/index.vue
================================================
演示效果
globalData方案的值为(曲折实现,全局动态响应)
{{globalData}}
Vue.prototype方案的值为(非动态响应,微信小程序无效)
{{vuePrototype}}
vuex方案的值为(全局动态响应,推荐)
{{vuex_demo}}
参数配置
实现方式
globalData
Vue.prototype
vuex
================================================
FILE: pages/library/globalVariable/prototype.vue
================================================
演示效果
此处为演示定义在main.js中的"Vue.prototype"全局变量的使用,它不是动态响应的,修改后本页面和上一个页面的值,都不会自动刷新
{{vuePrototype}}
参数配置
修改vuePrototype为如下值
================================================
FILE: pages/library/globalVariable/vuex.vue
================================================
演示效果
此处为演示vuex全局变量的使用
{{vuex_demo}}
参数配置
修改vuex变量为如下值
================================================
FILE: pages/library/guid/index.vue
================================================
演示效果
{{result}}
参数配置
长度
首字符为"u"
取值基数(进制)
================================================
FILE: pages/library/http/index.vue
================================================
演示效果
请求结果为:
{{JSON.stringify(result)}}
参数配置
请求方式
================================================
FILE: pages/library/md5/index.vue
================================================
演示效果
{{result}}
参数配置
源字符串
================================================
FILE: pages/library/mpShare/index.vue
================================================
演示效果
只对各家小程序有效,点击右上角的"胶囊",即可弹出分享菜单
================================================
FILE: pages/library/queryParams/index.vue
================================================
演示效果
源对象:{{JSON.stringify(params)}}
{{result}}
参数配置
是否带问号
================================================
FILE: pages/library/random/index.vue
================================================
演示效果
{{result}}
参数配置
操作
执行
================================================
FILE: pages/library/randomArray/index.vue
================================================
演示效果
源数组为:[1, 2, 3, 4, 5]
{{`[${result.join(', ')}]`}}
参数配置
操作
执行
================================================
FILE: pages/library/route/index.vue
================================================
演示效果
点击跳转
参数配置
类型
携带参数(针对type=navigateTo)
窗口动画(App且type=navigateTo||navigateBack时有效)
================================================
FILE: pages/library/route/routeTo.vue
================================================
演示效果
收到的参数为:{{paramsStr}}
返回
================================================
FILE: pages/library/test/index.vue
================================================
演示效果
这里仅对部分验证规则进行演示,目前总的验证规则有如下:
邮箱号
手机号
URL
普通日期
十进制数
身份证号
车牌号
金额
汉字
字母
字母|数字
包含值
数值范围
长度范围
参数配置
邮箱
手机号
中文
整数
================================================
FILE: pages/library/timeFormat/index.vue
================================================
演示效果
输入时间:{{timestamp}}
{{result}}
参数配置
格式
================================================
FILE: pages/library/timeFrom/index.vue
================================================
演示效果
根据当前时间,返回类似"刚刚,5分钟前,8小时前,3天前"等字样
{{result}}
参数配置
时间
================================================
FILE: pages/library/trim/index.vue
================================================
演示效果
源字符串:{{`"${string}"`}}
{{`"${result}"`}}
参数配置
模式选择
================================================
FILE: pages/template/address/addSite.vue
================================================
收货人
手机号码
所在地区
详细地址
标签
家
公司
学校
设置默认地址
提醒:每次下单会默认推荐该地址
================================================
FILE: pages/template/address/index.vue
================================================
{{ res.name }}
{{ res.phone }}
{{ item.tagText }}
广东省深圳市宝安区 自由路66号
新建收货地址
================================================
FILE: pages/template/citySelect/index.vue
================================================
演示效果
{{ input ? input : 'Picker值' }}
参数配置
状态
打开Picker
================================================
FILE: pages/template/citySelect/u-city-select.vue
================================================
================================================
FILE: pages/template/comment/index.vue
================================================
================================================
FILE: pages/template/comment/reply.vue
================================================
全部回复({{ comment.allReply }})
================================================
FILE: pages/template/coupon/index.vue
================================================
¥
8
抵用券
【洗牙】8元无门槛红包
今日到期
立即使用
满8.1元可用、限最新版本客户端使用
使用规则
¥
100
满149元可用
限品类东券
仅可购买个人护理部分商品
2020.01.01-2020.01.31
立即使用
可赠送
袜子精保护协会
进店
¥
3
满88减3
店铺优惠券
2019.11.28-2020.1.24
去使用
================================================
FILE: pages/template/douyin/index.nvue
================================================
================================================
FILE: pages/template/keyboardPay/index.vue
================================================
发送1.00元红包
1.00
元
支付键盘
================================================
FILE: pages/template/login/code.vue
================================================
输入验证码
验证码已发送至 +150****9320
验证码错误,请重新输入
收不到验证码点这里
{{ second }}秒后重新获取验证码
================================================
FILE: pages/template/login/index.vue
================================================
欢迎登录美团
未注册的手机号验证后自动创建美团账号
密码登录
遇到问题
微信
QQ
登录代表同意
美团点评用户协议、隐私政策,
并授权使用您的美团点评账号信息(如昵称、头像、收获地址)以便您统一管理
================================================
FILE: pages/template/mallMenu/index1.vue
================================================
搜索uView
================================================
FILE: pages/template/mallMenu/index2.vue
================================================
搜索
================================================
FILE: pages/template/order/index.vue
================================================
{{ res.store }}
{{ res.deal }}
{{ item.title }}
{{ item.type }}
发货时间 {{ item.deliveryTime }}
¥{{ priceInt(item.price) }}
.{{ priceDecimal(item.price) }}
x{{ item.number }}
共{{ totalNum(res.goodsList) }}件商品 合计:
¥{{ priceInt(totalPrice(res.goodsList)) }}.
{{ priceDecimal(totalPrice(res.goodsList)) }}
查看物流
卖了换钱
评价
{{ res.store }}
{{ res.deal }}
{{ item.title }}
{{ item.type }}
发货时间 {{ item.deliveryTime }}
¥{{ priceInt(item.price) }}
.{{ priceDecimal(item.price) }}
x{{ item.number }}
共{{ totalNum(res.goodsList) }}件商品 合计:
¥{{ priceInt(totalPrice(res.goodsList)) }}.
{{ priceDecimal(totalPrice(res.goodsList)) }}
查看物流
卖了换钱
评价
您还没有相关的订单
可以去看看有那些想买的
随便逛逛
{{ res.store }}
{{ res.deal }}
{{ item.title }}
{{ item.type }}
发货时间 {{ item.deliveryTime }}
¥{{ priceInt(item.price) }}
.{{ priceDecimal(item.price) }}
x{{ item.number }}
共{{ totalNum(res.goodsList) }}件商品 合计:
¥{{ priceInt(totalPrice(res.goodsList)) }}.
{{ priceDecimal(totalPrice(res.goodsList)) }}
查看物流
卖了换钱
评价
================================================
FILE: pages/template/submitBar/index.vue
================================================
客服
店铺
购物车
加入购物车
立即购买
================================================
FILE: pages/template/wxCenter/index.vue
================================================
uView ui
微信号:helang_uView
================================================
FILE: pages.json
================================================
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsC/test/index", //启动页面,必选
// "query": "uuid=c4bba940-f69e-11ea-a419-6bafda9d095e&__id__=1" //启动参数,在页面的onLoad函数里面得到
// }]
// },
"pages": [
// 演示-组件
{
"path": "pages/example/components",
"style": {
"navigationBarTitleText": "组件"
}
},
// avatarCropper-头像裁剪
{
"path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
},
// 演示-工具
{
"path": "pages/example/js",
"style": {
"navigationBarTitleText": "工具"
}
},
// 演示-模板
{
"path": "pages/example/template",
"style": {
"navigationBarTitleText": "模板"
}
},
// fullScreen-压窗屏
{
"path": "uview-ui/components/u-full-screen/u-full-screen",
"style": {
"navigationStyle": "custom",
"app-plus": {
"animationType": "fade-in",
"background": "transparent",
"backgroundColor": "rgba(0,0,0,0)",
"popGesture": "none"
}
}
}
],
"subPackages": [{
"root": "pages/componentsC",
"pages": [
// test-测试
{
"path": "test/index",
"style": {
"navigationBarTitleText": "Test"
// "navigationStyle": "custom" ,// 隐藏系统导航栏
// "navigationBarTextStyle": "white" // 状态栏字体为白色
}
},
// gap-间隔槽
{
"path": "gap/index",
"style": {
"navigationBarTitleText": "gap-间隔槽"
}
},
// subsection分段器
{
"path": "subsection/index",
"style": {
"navigationBarTitleText": "subsection-分段器"
}
},
// section 查看更多
{
"path": "section/index",
"style": {
"navigationBarTitleText": "section-查看更多"
}
},
// link链接
{
"path": "link/index",
"style": {
"navigationBarTitleText": "link-链接"
}
},
// mask遮罩层
{
"path": "mask/index",
"style": {
"navigationBarTitleText": "mask-遮罩层"
}
},
// countTo数字滚动
{
"path": "countTo/index",
"style": {
"navigationBarTitleText": "countTo-数字滚动"
}
},
// color颜色
{
"path": "color/index",
"style": {
"navigationBarTitleText": "color-颜色"
}
},
// countDown倒计时
{
"path": "countDown/index",
"style": {
"navigationBarTitleText": "countDown-倒计时"
}
},
// progress进度条
{
"path": "progress/index",
"style": {
"navigationBarTitleText": "progress-进度条"
}
},
// alertTips警告提示
{
"path": "alertTips/index",
"style": {
"navigationBarTitleText": "alertTips-警告提示"
}
},
// badge 徽标数
{
"path": "badge/index",
"style": {
"navigationBarTitleText": "badge-徽标数"
}
},
// button按钮
{
"path": "button/index",
"style": {
"navigationBarTitleText": "button-按钮"
}
},
// collapse折叠面板
{
"path": "collapse/index",
"style": {
"navigationBarTitleText": "collapse-折叠面板"
}
},
// actionSheet操作菜单
{
"path": "actionSheet/index",
"style": {
"navigationBarTitleText": "actionSheet-操作菜单"
}
},
// messageInput验证码输入
{
"path": "messageInput/index",
"style": {
"navigationBarTitleText": "messageInput-验证码输入"
}
},
// popup弹窗
{
"path": "popup/index",
"style": {
"navigationBarTitleText": "popup-弹窗"
}
},
// listCell
{
"path": "cell/index",
"style": {
"navigationBarTitleText": "listCell-列表"
}
},
// numberBox数字输入框
{
"path": "numberBox/index",
"style": {
"navigationBarTitleText": "numberBox-步进器"
}
},
// grid宫格布局
{
"path": "grid/index",
"style": {
"navigationBarTitleText": "grid-宫格布局"
}
},
// layout栅格布局
{
"path": "layout/index",
"style": {
"navigationBarTitleText": "layout-栅格布局"
}
},
// 加载更多
{
"path": "loadmore/index",
"style": {
"navigationBarTitleText": "loadmore-加载更多"
}
}
]
},
{
"root": "pages/template",
"pages": [
// wxCenter 仿微信个人中心
{
"path": "wxCenter/index",
"style": {
"navigationBarTitleText": "wxCenter 仿微信个人中心",
"navigationStyle": "custom"
}
},
// keyboardPay 自定义键盘支付
{
"path": "keyboardPay/index",
"style": {
"navigationBarTitleText": "keyboardPay 自定义键盘支付"
}
},
// douyin 仿抖音
// {
// "path": "douyin/index",
// "style": {
// "navigationBarTitleText": "douyin 仿抖音"
// }
// },
// mallMenu商城分类
{
"path": "mallMenu/index2",
"style": {
"navigationBarTitleText": "mallMenu-商城分类"
}
},
// mallMenu商城分类
{
"path": "mallMenu/index1",
"style": {
"navigationBarTitleText": "mallMenu-商城分类"
}
},
// coupon优惠券
{
"path": "coupon/index",
"style": {
"navigationBarTitleText": "coupon-优惠券"
}
},
{
"path": "login/index",
"style": {
"navigationBarTitleText": "美团登录"
}
},
// 城市选择
{
"path": "citySelect/index",
"style": {
"navigationBarTitleText": "城市选择"
}
},
// SubmitBar提交订单栏
{
"path": "submitBar/index",
"style": {
"navigationBarTitleText": "提交订单栏"
}
},
// comment评论
{
"path": "comment/index",
"style": {
"navigationBarTitleText": "评论"
}
},
// comment评论详情
{
"path": "comment/reply",
"style": {
"navigationBarTitleText": "评论详情"
}
},
// order订单
{
"path": "order/index",
"style": {
"navigationBarTitleText": "订单"
}
},
// login登录获取验证码
{
"path": "login/code",
"style": {
"navigationBarTitleText": "登录获取验证码"
}
},
// address用户地址
{
"path": "address/index",
"style": {
"navigationBarTitleText": "用户地址"
}
},
// address添加用户地址
{
"path": "address/addSite",
"style": {
"navigationBarTitleText": "添加用户地址"
}
}
]
},
{
"root": "pages/library",
"pages": [
// debounce-节流防抖
{
"path": "debounce/index",
"style": {
"navigationBarTitleText": "throttle | debounce-节流防抖"
}
},
// deepClone-对象深度克隆
{
"path": "deepClone/index",
"style": {
"navigationBarTitleText": "deepClone-对象深度克隆"
}
},
// deepMerge-对象深度合并
{
"path": "deepMerge/index",
"style": {
"navigationBarTitleText": "deepMerge-对象深度合并"
}
},
// getRect-元素节点
{
"path": "getRect/index",
"style": {
"navigationBarTitleText": "getRect-元素节点"
}
},
// timeFrom-多久之前
{
"path": "timeFrom/index",
"style": {
"navigationBarTitleText": "timeFrom-多久之前"
}
},
// globalData-全局变量
{
"path": "globalVariable/globalData",
"style": {
"navigationBarTitleText": "globalData-全局变量"
}
},
// prototype-全局变量
{
"path": "globalVariable/prototype",
"style": {
"navigationBarTitleText": "prototype-全局变量"
}
},
// vuex-全局变量
{
"path": "globalVariable/vuex",
"style": {
"navigationBarTitleText": "vuex-全局变量"
}
},
// globalVariable-全局变量
{
"path": "globalVariable/index",
"style": {
"navigationBarTitleText": "globalVariable-全局变量"
}
},
// http-请求
{
"path": "http/index",
"style": {
"navigationBarTitleText": "http-请求"
}
},
// test-规则验证
{
"path": "test/index",
"style": {
"navigationBarTitleText": "test-规则验证"
}
},
// mpShare-小程序分享
{
"path": "mpShare/index",
"style": {
"navigationBarTitleText": "mpShare-小程序分享"
}
},
// color-JS调用颜色
{
"path": "color/index",
"style": {
"navigationBarTitleText": "color-JS调用颜色"
}
},
// trim-去除空格
{
"path": "trim/index",
"style": {
"navigationBarTitleText": "trim-去除空格"
}
},
// random-随机数生成
{
"path": "random/index",
"style": {
"navigationBarTitleText": "random-随机数生成"
}
},
// md5加密
{
"path": "md5/index",
"style": {
"navigationBarTitleText": "md5-加密"
}
},
// colorSwitch颜色转换
{
"path": "colorSwitch/index",
"style": {
"navigationBarTitleText": "colorSwitch-颜色转换"
}
},
// randomArray数组乱序
{
"path": "randomArray/index",
"style": {
"navigationBarTitleText": "randomArray-数组乱序"
}
},
// guid全局唯一标识符
{
"path": "guid/index",
"style": {
"navigationBarTitleText": "guid-全局唯一标识符"
}
},
// timeFormat时间格式化
{
"path": "timeFormat/index",
"style": {
"navigationBarTitleText": "timeFormat-时间格式化"
}
}, // route-路由
{
"path": "route/index",
"style": {
"navigationBarTitleText": "route-路由"
}
},
// route-路由跳转
{
"path": "route/routeTo",
"style": {
"navigationBarTitleText": "route-路由跳转"
}
},
// queryParams-对象转URL参数
{
"path": "queryParams/index",
"style": {
"navigationBarTitleText": "queryParams-对象转URL参数"
}
}
]
},
{
"root": "pages/componentsA",
"pages": [
// parse-富文本解析器
{
"path": "parse/index",
"style": {
"navigationBarTitleText": "parse-富文本解析器"
}
},
// backTop-返回顶部
{
"path": "backTop/index",
"style": {
"navigationBarTitleText": "backTop-返回顶部"
}
},
// calendar-日历
{
"path": "calendar/index",
"style": {
"navigationBarTitleText": "calendar-日历"
}
},
// form-表单
{
"path": "form/index",
"style": {
"navigationBarTitleText": "form-表单"
}
},
// select-列选择器
{
"path": "select/index",
"style": {
"navigationBarTitleText": "select-列选择器"
}
},
// slider-滑动选择器
{
"path": "slider/index",
"style": {
"navigationBarTitleText": "slider-滑动选择器"
}
},
// fullScreen-压窗屏
{
"path": "fullScreen/index",
"style": {
"navigationBarTitleText": "fullScreen-压窗屏"
}
},
// navbar-自定义导航栏
{
"path": "navbar/index",
"style": {
// "navigationBarTitleText": "navbar-自定义导航栏",
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarTextStyle": "white" // 状态栏字体为白色
}
},
// field-输入框
{
"path": "field/index",
"style": {
"navigationBarTitleText": "field-输入框"
}
},
// modal-模态框
{
"path": "modal/index",
"style": {
"navigationBarTitleText": "modal-模态框"
}
},
// indexList索引列表
{
"path": "indexList/index",
"style": {
"navigationBarTitleText": "indexList-索引列表"
}
},
// empty内容为空
{
"path": "empty/index",
"style": {
"navigationBarTitleText": "empty-内容为空"
}
},
// avatarCropper-头像裁剪
{
"path": "avatarCropper/index",
"style": {
"navigationBarTitleText": "avatarCropper-头像裁剪"
}
}, // noNetwork没有网络
{
"path": "noNetwork/index",
"style": {
"navigationBarTitleText": "noNetwork-没有网络"
}
}, // icon字体图标
{
"path": "icon/index",
"style": {
"navigationBarTitleText": "icon-字体图标"
}
}, // avatar-用户头像展示
{
"path": "avatar/index",
"style": {
"navigationBarTitleText": "avatar-用户头像展示"
}
}, // keyboard键盘
{
"path": "keyboard/index",
"style": {
"navigationBarTitleText": "keyboard-键盘"
}
}, // 图片懒加载
{
"path": "lazyLoad/index",
"style": {
"navigationBarTitleText": "lazyLoad-懒加载"
}
},
// tabs切换
{
"path": "tabs/index",
"style": {
"navigationBarTitleText": "Tabs-切换"
}
},
// tag标签
{
"path": "tag/index",
"style": {
"navigationBarTitleText": "tag-标签"
}
},
// timeLine时间轴
{
"path": "timeLine/index",
"style": {
"navigationBarTitleText": "timeLine-时间轴"
}
},
// toast轻提示
{
"path": "toast/index",
"style": {
"navigationBarTitleText": "toast-轻提示"
}
},
// topTips消息提示
{
"path": "topTips/index",
"style": {
"navigationBarTitleText": "topTips-消息提示"
}
},
// Code-验证码倒计时
{
"path": "verificationCode/index",
"style": {
"navigationBarTitleText": "Code-验证码倒计时"
}
}
]
},
{
"root": "pages/componentsB",
"pages": [
// dropdown-下拉菜单
{
"path": "dropdown/index",
"style": {
"navigationBarTitleText": "dropdown-下拉菜单"
}
},
// tabbar-底部导航栏
{
"path": "tabbar/index",
"style": {
"navigationBarTitleText": "tabbar-底部导航栏"
}
},
// line-线条
{
"path": "line/index",
"style": {
"navigationBarTitleText": "line-线条"
}
},
// image-图片
{
"path": "image/index",
"style": {
"navigationBarTitleText": "image-图片"
}
},
// card-卡片
{
"path": "card/index",
"style": {
"navigationBarTitleText": "card-卡片"
}
},
// divider-分割线
{
"path": "divider/index",
"style": {
"navigationBarTitleText": "divider-分割线"
}
},
// picker选择器
{
"path": "picker/index",
"style": {
"navigationBarTitleText": "picker-选择器"
}
}, // noticeBar通告栏
{
"path": "noticeBar/index",
"style": {
"navigationBarTitleText": "noticeBar-通告栏"
}
},
// checkbox-复选框
{
"path": "checkbox/index",
"style": {
"navigationBarTitleText": "checkbox-复选框"
}
},
// radio-单选框
{
"path": "radio/index",
"style": {
"navigationBarTitleText": "radio-单选框"
}
},
// loading-加载动画
{
"path": "loading/index",
"style": {
"navigationBarTitleText": "loading-加载动画"
}
},
// switch-开关选择器
{
"path": "switch/index",
"style": {
"navigationBarTitleText": "switch-开关选择器"
}
},
// 骨架屏
{
"path": "skeleton/index",
"style": {
"navigationBarTitleText": "skeleton-骨架屏"
}
}, // upload上传
{
"path": "upload/index",
"style": {
"navigationBarTitleText": "upload-上传"
}
},
// waterfall瀑布流
// #ifndef MP-TOUTIAO
{
"path": "waterfall/index",
"style": {
"navigationBarTitleText": "waterfall-瀑布流"
}
},
// #endif
// table表格
{
"path": "table/index",
"style": {
"navigationBarTitleText": "table-表格"
}
},
// rate评分
{
"path": "rate/index",
"style": {
"navigationBarTitleText": "rate-评分"
}
},
// readMore显示更多
{
"path": "readMore/index",
"style": {
"navigationBarTitleText": "readMore-查看更多"
}
},
// search搜索框
{
"path": "search/index",
"style": {
"navigationBarTitleText": "search-搜索框"
}
},
// steps步骤条
{
"path": "steps/index",
"style": {
"navigationBarTitleText": "steps-步骤条"
}
},
// sticky吸顶
{
"path": "sticky/index",
"style": {
"navigationBarTitleText": "sticky-吸顶"
}
},
// swiper轮播图
{
"path": "swiper/index",
"style": {
"navigationBarTitleText": "swiper-轮播图"
}
},
// swipeAction-左滑删除
{
"path": "swipeAction/index",
"style": {
"navigationBarTitleText": "swipeAction-左滑删除"
}
}
]
}
],
"preloadRule": {
"pages/example/components": {
"network": "all",
"packages": ["pages/componentsA", "pages/componentsB", "pages/componentsC"]
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uView",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF"
},
"tabBar": {
"color": "#909399",
"selectedColor": "#303133",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [{
"pagePath": "pages/example/components",
"iconPath": "static/uview/example/component.png",
"selectedIconPath": "static/uview/example/component_select.png",
"text": "组件"
},
{
"pagePath": "pages/example/js",
"iconPath": "static/uview/example/js.png",
"selectedIconPath": "static/uview/example/js_select.png",
"text": "工具"
},
{
"pagePath": "pages/example/template",
"iconPath": "static/uview/example/template.png",
"selectedIconPath": "static/uview/example/template_select.png",
"text": "模板"
}
]
}
}
================================================
FILE: static/common/js/touch-emulator.js
================================================
(function(window, document, exportName, undefined) {
"use strict";
var isMultiTouch = false;
var multiTouchStartPos;
var eventTarget;
var touchElements = {};
// polyfills
if(!document.createTouch) {
document.createTouch = function(view, target, identifier, pageX, pageY, screenX, screenY, clientX, clientY) {
// auto set
if(clientX == undefined || clientY == undefined) {
clientX = pageX - window.pageXOffset;
clientY = pageY - window.pageYOffset;
}
return new Touch(target, identifier, {
pageX: pageX,
pageY: pageY,
screenX: screenX,
screenY: screenY,
clientX: clientX,
clientY: clientY
});
};
}
if(!document.createTouchList) {
document.createTouchList = function() {
var touchList = new TouchList();
for (var i = 0; i < arguments.length; i++) {
touchList[i] = arguments[i];
}
touchList.length = arguments.length;
return touchList;
};
}
/**
* create an touch point
* @constructor
* @param target
* @param identifier
* @param pos
* @param deltaX
* @param deltaY
* @returns {Object} touchPoint
*/
function Touch(target, identifier, pos, deltaX, deltaY) {
deltaX = deltaX || 0;
deltaY = deltaY || 0;
this.identifier = identifier;
this.target = target;
this.clientX = pos.clientX + deltaX;
this.clientY = pos.clientY + deltaY;
this.screenX = pos.screenX + deltaX;
this.screenY = pos.screenY + deltaY;
this.pageX = pos.pageX + deltaX;
this.pageY = pos.pageY + deltaY;
}
/**
* create empty touchlist with the methods
* @constructor
* @returns touchList
*/
function TouchList() {
var touchList = [];
touchList.item = function(index) {
return this[index] || null;
};
// specified by Mozilla
touchList.identifiedTouch = function(id) {
return this[id + 1] || null;
};
return touchList;
}
/**
* Simple trick to fake touch event support
* this is enough for most libraries like Modernizr and Hammer
*/
function fakeTouchSupport() {
var objs = [window, document.documentElement];
var props = ['ontouchstart', 'ontouchmove', 'ontouchcancel', 'ontouchend'];
for(var o=0; o 2; // pointer events
}
/**
* disable mouseevents on the page
* @param ev
*/
function preventMouseEvents(ev) {
// 注释启用默认事件
// ev.preventDefault();
// ev.stopPropagation();
}
/**
* only trigger touches when the left mousebutton has been pressed
* @param touchType
* @returns {Function}
*/
function onMouse(touchType) {
return function(ev) {
// prevent mouse events
preventMouseEvents(ev);
if (ev.which !== 1) {
return;
}
// The EventTarget on which the touch point started when it was first placed on the surface,
// even if the touch point has since moved outside the interactive area of that element.
// also, when the target doesnt exist anymore, we update it
if (ev.type == 'mousedown' || !eventTarget || (eventTarget && !eventTarget.dispatchEvent)) {
eventTarget = ev.target;
}
// shiftKey has been lost, so trigger a touchend
if (isMultiTouch && !ev.shiftKey) {
triggerTouch('touchend', ev);
isMultiTouch = false;
}
triggerTouch(touchType, ev);
// we're entering the multi-touch mode!
if (!isMultiTouch && ev.shiftKey) {
isMultiTouch = true;
multiTouchStartPos = {
pageX: ev.pageX,
pageY: ev.pageY,
clientX: ev.clientX,
clientY: ev.clientY,
screenX: ev.screenX,
screenY: ev.screenY
};
triggerTouch('touchstart', ev);
}
// reset
if (ev.type == 'mouseup') {
multiTouchStartPos = null;
isMultiTouch = false;
eventTarget = null;
}
}
}
/**
* trigger a touch event
* @param eventName
* @param mouseEv
*/
function triggerTouch(eventName, mouseEv) {
var touchEvent = document.createEvent('Event');
touchEvent.initEvent(eventName, true, true);
touchEvent.altKey = mouseEv.altKey;
touchEvent.ctrlKey = mouseEv.ctrlKey;
touchEvent.metaKey = mouseEv.metaKey;
touchEvent.shiftKey = mouseEv.shiftKey;
touchEvent.touches = getActiveTouches(mouseEv, eventName);
touchEvent.targetTouches = getActiveTouches(mouseEv, eventName);
touchEvent.changedTouches = getChangedTouches(mouseEv, eventName);
eventTarget.dispatchEvent(touchEvent);
}
/**
* create a touchList based on the mouse event
* @param mouseEv
* @returns {TouchList}
*/
function createTouchList(mouseEv) {
var touchList = new TouchList();
if (isMultiTouch) {
var f = TouchEmulator.multiTouchOffset;
var deltaX = multiTouchStartPos.pageX - mouseEv.pageX;
var deltaY = multiTouchStartPos.pageY - mouseEv.pageY;
touchList.push(new Touch(eventTarget, 1, multiTouchStartPos, (deltaX*-1) - f, (deltaY*-1) + f));
touchList.push(new Touch(eventTarget, 2, multiTouchStartPos, deltaX+f, deltaY-f));
} else {
touchList.push(new Touch(eventTarget, 1, mouseEv, 0, 0));
}
return touchList;
}
/**
* receive all active touches
* @param mouseEv
* @returns {TouchList}
*/
function getActiveTouches(mouseEv, eventName) {
// empty list
if (mouseEv.type == 'mouseup') {
return new TouchList();
}
var touchList = createTouchList(mouseEv);
if(isMultiTouch && mouseEv.type != 'mouseup' && eventName == 'touchend') {
touchList.splice(1, 1);
}
return touchList;
}
/**
* receive a filtered set of touches with only the changed pointers
* @param mouseEv
* @param eventName
* @returns {TouchList}
*/
function getChangedTouches(mouseEv, eventName) {
var touchList = createTouchList(mouseEv);
// we only want to return the added/removed item on multitouch
// which is the second pointer, so remove the first pointer from the touchList
//
// but when the mouseEv.type is mouseup, we want to send all touches because then
// no new input will be possible
if(isMultiTouch && mouseEv.type != 'mouseup' &&
(eventName == 'touchstart' || eventName == 'touchend')) {
touchList.splice(0, 1);
}
return touchList;
}
/**
* show the touchpoints on the screen
*/
function showTouches(ev) {
var touch, i, el, styles;
// first all visible touches
for(i = 0; i < ev.touches.length; i++) {
touch = ev.touches[i];
el = touchElements[touch.identifier];
if(!el) {
el = touchElements[touch.identifier] = document.createElement("div");
document.body.appendChild(el);
}
styles = TouchEmulator.template(touch);
for(var prop in styles) {
el.style[prop] = styles[prop];
}
}
// remove all ended touches
if(ev.type == 'touchend' || ev.type == 'touchcancel') {
for(i = 0; i < ev.changedTouches.length; i++) {
touch = ev.changedTouches[i];
el = touchElements[touch.identifier];
if(el) {
el.parentNode.removeChild(el);
delete touchElements[touch.identifier];
}
}
}
}
/**
* TouchEmulator initializer
*/
function TouchEmulator() {
if (hasTouchSupport()) {
return;
}
fakeTouchSupport();
window.addEventListener("mousedown", onMouse('touchstart'), true);
window.addEventListener("mousemove", onMouse('touchmove'), true);
window.addEventListener("mouseup", onMouse('touchend'), true);
window.addEventListener("mouseenter", preventMouseEvents, true);
window.addEventListener("mouseleave", preventMouseEvents, true);
window.addEventListener("mouseout", preventMouseEvents, true);
window.addEventListener("mouseover", preventMouseEvents, true);
// it uses itself!
window.addEventListener("touchstart", showTouches, true);
window.addEventListener("touchmove", showTouches, true);
window.addEventListener("touchend", showTouches, true);
window.addEventListener("touchcancel", showTouches, true);
}
// start distance when entering the multitouch mode
TouchEmulator.multiTouchOffset = 75;
/**
* css template for the touch rendering
* @param touch
* @returns object
*/
TouchEmulator.template = function(touch) {
var size = 0;
var transform = 'translate('+ (touch.clientX-(size/2)) +'px, '+ (touch.clientY-(size/2)) +'px)';
return {
position: 'fixed',
left: 0,
top: 0,
background: '#fff',
border: 'solid 1px #999',
opacity: .6,
borderRadius: '100%',
height: size + 'px',
width: size + 'px',
padding: 0,
margin: 0,
display: 'block',
overflow: 'hidden',
pointerEvents: 'none',
webkitUserSelect: 'none',
mozUserSelect: 'none',
userSelect: 'none',
webkitTransform: transform,
mozTransform: transform,
transform: transform,
zIndex: 100
}
};
// export
if (typeof define == "function" && define.amd) {
define(function() {
return TouchEmulator;
});
} else if (typeof module != "undefined" && module.exports) {
module.exports = TouchEmulator;
} else {
window[exportName] = TouchEmulator;
}
})(window, document, "TouchEmulator");
================================================
FILE: store/$u.mixin.js
================================================
import { mapState } from 'vuex'
import store from "@/store"
// 尝试将用户在根目录中的store/index.js的vuex的state变量,全部加载到全局变量中
let $uStoreKey = [];
try{
$uStoreKey = store.state ? Object.keys(store.state) : [];
}catch(e){
}
module.exports = {
beforeCreate() {
// 将vuex方法挂在到$u中
// 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
// 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
this.$u.vuex = (name, value) => {
this.$store.commit('$uStore', {
name,value
})
}
},
computed: {
// 将vuex的state中的所有变量,解构到全局混入的mixin中
...mapState($uStoreKey)
}
}
================================================
FILE: store/index.js
================================================
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let lifeData = {};
try{
// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
lifeData = uni.getStorageSync('lifeData');
}catch(e){
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let saveStateKeys = ['vuex_user', 'vuex_token'];
// 保存变量到本地存储中
const saveLifeData = function(key, value){
// 判断变量名是否在需要存储的数组中
if(saveStateKeys.indexOf(key) != -1) {
// 获取本地存储的lifeData对象,将变量添加到对象中
let tmp = uni.getStorageSync('lifeData');
// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
tmp = tmp ? tmp : {};
tmp[key] = value;
// 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
uni.setStorageSync('lifeData', tmp);
}
}
const store = new Vuex.Store({
state: {
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {name: '明月'},
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.1',
vuex_demo: '绛紫',
// 自定义tabbar数据
vuex_tabbar: [{
iconPath: "/static/uview/example/component.png",
selectedIconPath: "/static/uview/example/component_select.png",
text: '组件',
pagePath: '/pages/example/components'
},
{
iconPath: "/static/uview/example/js.png",
selectedIconPath: "/static/uview/example/js_select.png",
text: '工具',
midButton: true,
pagePath: '/pages/example/js'
},
{
iconPath: "/static/uview/example/template.png",
selectedIconPath: "/static/uview/example/template_select.png",
text: '模板',
pagePath: '/pages/example/template'
}
]
},
mutations: {
$uStore(state, payload) {
// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
let nameArr = payload.name.split('.');
let saveKey = '';
let len = nameArr.length;
if(len >= 2) {
let obj = state[nameArr[0]];
for(let i = 1; i < len - 1; i ++) {
obj = obj[nameArr[i]];
}
obj[nameArr[len - 1]] = payload.value;
saveKey = nameArr[0];
} else {
// 单层级变量,在state就是一个普通变量的情况
state[payload.name] = payload.value;
saveKey = payload.name;
}
// 保存变量到本地,见顶部函数定义
saveLifeData(saveKey, state[saveKey])
}
}
})
export default store
================================================
FILE: template.h5.html
================================================
<%= htmlWebpackPlugin.options.title %>
================================================
FILE: uni.scss
================================================
/**
* 下方引入的为uView UI的集成样式文件,为scss预处理器,其中包含了一些"u-"开头的自定义变量
* 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可
* uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用
*/
@import 'uview-ui/theme.scss';
================================================
FILE: uview-ui/LICENSE
================================================
MIT License
Copyright (c) 2023 www.uviewui.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: uview-ui/README.md
================================================
uView
多平台快速开发的UI框架
## 说明
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
## 特性
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
- 众多的常用页面和布局,让您专注逻辑,事半功倍
- 详尽的文档支持,现代化的演示效果
- 按需引入,精简打包体积
## 安装
```bash
# npm方式安装
npm i uview-ui
```
## 快速上手
1. `main.js`引入uView库
```js
// main.js
import uView from 'uview-ui';
Vue.use(uView);
```
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
```css
/* App.vue */
```
3. `uni.scss`引入全局scss变量文件
```css
/* uni.scss */
@import "uview-ui/theme.scss";
```
4. `pages.json`配置easycom规则(按需引入)
```js
// pages.json
{
"easycom": {
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
// npm安装方式
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// 下载安装方式
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// 此为本身已有的内容
"pages": [
// ......
]
}
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 使用方法
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
```html
按钮
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 链接
- [官方文档](https://uviewui.com/)
- [更新日志](https://uviewui.com/components/changelog.html)
- [升级指南](https://uviewui.com/components/changelog.html)
- [关于我们](https://uviewui.com/cooperation/about.html)
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
## 版权信息
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。
================================================
FILE: uview-ui/components/u-action-sheet/u-action-sheet.vue
================================================
{{tips.text}}
{{item.text}}
{{item.subText}}
{{cancelText}}
================================================
FILE: uview-ui/components/u-alert-tips/u-alert-tips.vue
================================================
{{title}}
{{description}}
{{closeText}}
================================================
FILE: uview-ui/components/u-avatar/u-avatar.vue
================================================
{{uText}}
================================================
FILE: uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue
================================================
选择图片
重新选择
确定
================================================
FILE: uview-ui/components/u-avatar-cropper/weCropper.js
================================================
/**
* we-cropper v1.3.9
* (c) 2020 dlhandsome
* @license MIT
*/
(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.WeCropper = factory());
}(this, (function() {
'use strict';
var device = void 0;
var TOUCH_STATE = ['touchstarted', 'touchmoved', 'touchended'];
function firstLetterUpper(str) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
function setTouchState(instance) {
var arg = [],
len = arguments.length - 1;
while (len-- > 0) arg[len] = arguments[len + 1];
TOUCH_STATE.forEach(function(key, i) {
if (arg[i] !== undefined) {
instance[key] = arg[i];
}
});
}
function validator(instance, o) {
Object.defineProperties(instance, o);
}
function getDevice() {
if (!device) {
device = uni.getSystemInfoSync();
}
return device
}
var tmp = {};
var ref = getDevice();
var pixelRatio = ref.pixelRatio;
var DEFAULT = {
id: {
default: 'cropper',
get: function get() {
return tmp.id
},
set: function set(value) {
if (typeof(value) !== 'string') {
console.error(("id:" + value + " is invalid"));
}
tmp.id = value;
}
},
width: {
default: 750,
get: function get() {
return tmp.width
},
set: function set(value) {
if (typeof(value) !== 'number') {
console.error(("width:" + value + " is invalid"));
}
tmp.width = value;
}
},
height: {
default: 750,
get: function get() {
return tmp.height
},
set: function set(value) {
if (typeof(value) !== 'number') {
console.error(("height:" + value + " is invalid"));
}
tmp.height = value;
}
},
pixelRatio: {
default: pixelRatio,
get: function get() {
return tmp.pixelRatio
},
set: function set(value) {
if (typeof(value) !== 'number') {
console.error(("pixelRatio:" + value + " is invalid"));
}
tmp.pixelRatio = value;
}
},
scale: {
default: 2.5,
get: function get() {
return tmp.scale
},
set: function set(value) {
if (typeof(value) !== 'number') {
console.error(("scale:" + value + " is invalid"));
}
tmp.scale = value;
}
},
zoom: {
default: 5,
get: function get() {
return tmp.zoom
},
set: function set(value) {
if (typeof(value) !== 'number') {
console.error(("zoom:" + value + " is invalid"));
} else if (value < 0 || value > 10) {
console.error("zoom should be ranged in 0 ~ 10");
}
tmp.zoom = value;
}
},
src: {
default: '',
get: function get() {
return tmp.src
},
set: function set(value) {
if (typeof(value) !== 'string') {
console.error(("src:" + value + " is invalid"));
}
tmp.src = value;
}
},
cut: {
default: {},
get: function get() {
return tmp.cut
},
set: function set(value) {
if (typeof(value) !== 'object') {
console.error(("cut:" + value + " is invalid"));
}
tmp.cut = value;
}
},
boundStyle: {
default: {},
get: function get() {
return tmp.boundStyle
},
set: function set(value) {
if (typeof(value) !== 'object') {
console.error(("boundStyle:" + value + " is invalid"));
}
tmp.boundStyle = value;
}
},
onReady: {
default: null,
get: function get() {
return tmp.ready
},
set: function set(value) {
tmp.ready = value;
}
},
onBeforeImageLoad: {
default: null,
get: function get() {
return tmp.beforeImageLoad
},
set: function set(value) {
tmp.beforeImageLoad = value;
}
},
onImageLoad: {
default: null,
get: function get() {
return tmp.imageLoad
},
set: function set(value) {
tmp.imageLoad = value;
}
},
onBeforeDraw: {
default: null,
get: function get() {
return tmp.beforeDraw
},
set: function set(value) {
tmp.beforeDraw = value;
}
}
};
var ref$1 = getDevice();
var windowWidth = ref$1.windowWidth;
function prepare() {
var self = this;
// v1.4.0 版本中将不再自动绑定we-cropper实例
self.attachPage = function() {
var pages = getCurrentPages();
// 获取到当前page上下文
var pageContext = pages[pages.length - 1];
// 把this依附在Page上下文的wecropper属性上,便于在page钩子函数中访问
Object.defineProperty(pageContext, 'wecropper', {
get: function get() {
console.warn(
'Instance will not be automatically bound to the page after v1.4.0\n\n' +
'Please use a custom instance name instead\n\n' +
'Example: \n' +
'this.mycropper = new WeCropper(options)\n\n' +
'// ...\n' +
'this.mycropper.getCropperImage()'
);
return self
},
configurable: true
});
};
self.createCtx = function() {
var id = self.id;
var targetId = self.targetId;
if (id) {
self.ctx = self.ctx || uni.createCanvasContext(id);
self.targetCtx = self.targetCtx || uni.createCanvasContext(targetId);
} else {
console.error("constructor: create canvas context failed, 'id' must be valuable");
}
};
self.deviceRadio = windowWidth / 750;
}
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !==
'undefined' ? self : {};
function createCommonjsModule(fn, module) {
return module = {
exports: {}
}, fn(module, module.exports), module.exports;
}
var tools = createCommonjsModule(function(module, exports) {
/**
* String type check
*/
exports.isStr = function(v) {
return typeof v === 'string';
};
/**
* Number type check
*/
exports.isNum = function(v) {
return typeof v === 'number';
};
/**
* Array type check
*/
exports.isArr = Array.isArray;
/**
* undefined type check
*/
exports.isUndef = function(v) {
return v === undefined;
};
exports.isTrue = function(v) {
return v === true;
};
exports.isFalse = function(v) {
return v === false;
};
/**
* Function type check
*/
exports.isFunc = function(v) {
return typeof v === 'function';
};
/**
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
*/
exports.isObj = exports.isObject = function(obj) {
return obj !== null && typeof obj === 'object'
};
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*/
var _toString = Object.prototype.toString;
exports.isPlainObject = function(obj) {
return _toString.call(obj) === '[object Object]'
};
/**
* Check whether the object has the property.
*/
var hasOwnProperty = Object.prototype.hasOwnProperty;
exports.hasOwn = function(obj, key) {
return hasOwnProperty.call(obj, key)
};
/**
* Perform no operation.
* Stubbing args to make Flow happy without leaving useless transpiled code
* with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
*/
exports.noop = function(a, b, c) {};
/**
* Check if val is a valid array index.
*/
exports.isValidArrayIndex = function(val) {
var n = parseFloat(String(val));
return n >= 0 && Math.floor(n) === n && isFinite(val)
};
});
var tools_7 = tools.isFunc;
var tools_10 = tools.isPlainObject;
var EVENT_TYPE = ['ready', 'beforeImageLoad', 'beforeDraw', 'imageLoad'];
function observer() {
var self = this;
self.on = function(event, fn) {
if (EVENT_TYPE.indexOf(event) > -1) {
if (tools_7(fn)) {
event === 'ready' ?
fn(self) :
self[("on" + (firstLetterUpper(event)))] = fn;
}
} else {
console.error(("event: " + event + " is invalid"));
}
return self
};
}
function wxPromise(fn) {
return function(obj) {
var args = [],
len = arguments.length - 1;
while (len-- > 0) args[len] = arguments[len + 1];
if (obj === void 0) obj = {};
return new Promise(function(resolve, reject) {
obj.success = function(res) {
resolve(res);
};
obj.fail = function(err) {
reject(err);
};
fn.apply(void 0, [obj].concat(args));
})
}
}
function draw(ctx, reserve) {
if (reserve === void 0) reserve = false;
return new Promise(function(resolve) {
ctx.draw(reserve, resolve);
})
}
var getImageInfo = wxPromise(uni.getImageInfo);
var canvasToTempFilePath = wxPromise(uni.canvasToTempFilePath);
var base64 = createCommonjsModule(function(module, exports) {
/*! http://mths.be/base64 v0.1.0 by @mathias | MIT license */
(function(root) {
// Detect free variables `exports`.
var freeExports = 'object' == 'object' && exports;
// Detect free variable `module`.
var freeModule = 'object' == 'object' && module &&
module.exports == freeExports && module;
// Detect free variable `global`, from Node.js or Browserified code, and use
// it as `root`.
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
root = freeGlobal;
}
/*--------------------------------------------------------------------------*/
var InvalidCharacterError = function(message) {
this.message = message;
};
InvalidCharacterError.prototype = new Error;
InvalidCharacterError.prototype.name = 'InvalidCharacterError';
var error = function(message) {
// Note: the error messages used throughout this file match those used by
// the native `atob`/`btoa` implementation in Chromium.
throw new InvalidCharacterError(message);
};
var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// http://whatwg.org/html/common-microsyntaxes.html#space-character
var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
// `decode` is designed to be fully compatible with `atob` as described in the
// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
// The optimized base64-decoding algorithm used is based on @atk’s excellent
// implementation. https://gist.github.com/atk/1020396
var decode = function(input) {
input = String(input)
.replace(REGEX_SPACE_CHARACTERS, '');
var length = input.length;
if (length % 4 == 0) {
input = input.replace(/==?$/, '');
length = input.length;
}
if (
length % 4 == 1 ||
// http://whatwg.org/C#alphanumeric-ascii-characters
/[^+a-zA-Z0-9/]/.test(input)
) {
error(
'Invalid character: the string to be decoded is not correctly encoded.'
);
}
var bitCounter = 0;
var bitStorage;
var buffer;
var output = '';
var position = -1;
while (++position < length) {
buffer = TABLE.indexOf(input.charAt(position));
bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
// Unless this is the first of a group of 4 characters…
if (bitCounter++ % 4) {
// …convert the first 8 bits to a single ASCII character.
output += String.fromCharCode(
0xFF & bitStorage >> (-2 * bitCounter & 6)
);
}
}
return output;
};
// `encode` is designed to be fully compatible with `btoa` as described in the
// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
var encode = function(input) {
input = String(input);
if (/[^\0-\xFF]/.test(input)) {
// Note: no need to special-case astral symbols here, as surrogates are
// matched, and the input is supposed to only contain ASCII anyway.
error(
'The string to be encoded contains characters outside of the ' +
'Latin1 range.'
);
}
var padding = input.length % 3;
var output = '';
var position = -1;
var a;
var b;
var c;
var buffer;
// Make sure any padding is handled outside of the loop.
var length = input.length - padding;
while (++position < length) {
// Read three bytes, i.e. 24 bits.
a = input.charCodeAt(position) << 16;
b = input.charCodeAt(++position) << 8;
c = input.charCodeAt(++position);
buffer = a + b + c;
// Turn the 24 bits into four chunks of 6 bits each, and append the
// matching character for each of them to the output.
output += (
TABLE.charAt(buffer >> 18 & 0x3F) +
TABLE.charAt(buffer >> 12 & 0x3F) +
TABLE.charAt(buffer >> 6 & 0x3F) +
TABLE.charAt(buffer & 0x3F)
);
}
if (padding == 2) {
a = input.charCodeAt(position) << 8;
b = input.charCodeAt(++position);
buffer = a + b;
output += (
TABLE.charAt(buffer >> 10) +
TABLE.charAt((buffer >> 4) & 0x3F) +
TABLE.charAt((buffer << 2) & 0x3F) +
'='
);
} else if (padding == 1) {
buffer = input.charCodeAt(position);
output += (
TABLE.charAt(buffer >> 2) +
TABLE.charAt((buffer << 4) & 0x3F) +
'=='
);
}
return output;
};
var base64 = {
'encode': encode,
'decode': decode,
'version': '0.1.0'
};
// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
typeof undefined == 'function' &&
typeof undefined.amd == 'object' &&
undefined.amd
) {
undefined(function() {
return base64;
});
} else if (freeExports && !freeExports.nodeType) {
if (freeModule) { // in Node.js or RingoJS v0.8.0+
freeModule.exports = base64;
} else { // in Narwhal or RingoJS v0.7.0-
for (var key in base64) {
base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
}
}
} else { // in Rhino or a web browser
root.base64 = base64;
}
}(commonjsGlobal));
});
function makeURI(strData, type) {
return 'data:' + type + ';base64,' + strData
}
function fixType(type) {
type = type.toLowerCase().replace(/jpg/i, 'jpeg');
var r = type.match(/png|jpeg|bmp|gif/)[0];
return 'image/' + r
}
function encodeData(data) {
var str = '';
if (typeof data === 'string') {
str = data;
} else {
for (var i = 0; i < data.length; i++) {
str += String.fromCharCode(data[i]);
}
}
return base64.encode(str)
}
/**
* 获取图像区域隐含的像素数据
* @param canvasId canvas标识
* @param x 将要被提取的图像数据矩形区域的左上角 x 坐标
* @param y 将要被提取的图像数据矩形区域的左上角 y 坐标
* @param width 将要被提取的图像数据矩形区域的宽度
* @param height 将要被提取的图像数据矩形区域的高度
* @param done 完成回调
*/
function getImageData(canvasId, x, y, width, height, done) {
uni.canvasGetImageData({
canvasId: canvasId,
x: x,
y: y,
width: width,
height: height,
success: function success(res) {
done(res, null);
},
fail: function fail(res) {
done(null, res);
}
});
}
/**
* 生成bmp格式图片
* 按照规则生成图片响应头和响应体
* @param oData 用来描述 canvas 区域隐含的像素数据 { data, width, height } = oData
* @returns {*} base64字符串
*/
function genBitmapImage(oData) {
//
// BITMAPFILEHEADER: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx
// BITMAPINFOHEADER: http://msdn.microsoft.com/en-us/library/dd183376.aspx
//
var biWidth = oData.width;
var biHeight = oData.height;
var biSizeImage = biWidth * biHeight * 3;
var bfSize = biSizeImage + 54; // total header size = 54 bytes
//
// typedef struct tagBITMAPFILEHEADER {
// WORD bfType;
// DWORD bfSize;
// WORD bfReserved1;
// WORD bfReserved2;
// DWORD bfOffBits;
// } BITMAPFILEHEADER;
//
var BITMAPFILEHEADER = [
// WORD bfType -- The file type signature; must be "BM"
0x42, 0x4D,
// DWORD bfSize -- The size, in bytes, of the bitmap file
bfSize & 0xff, bfSize >> 8 & 0xff, bfSize >> 16 & 0xff, bfSize >> 24 & 0xff,
// WORD bfReserved1 -- Reserved; must be zero
0, 0,
// WORD bfReserved2 -- Reserved; must be zero
0, 0,
// DWORD bfOffBits -- The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
54, 0, 0, 0
];
//
// typedef struct tagBITMAPINFOHEADER {
// DWORD biSize;
// LONG biWidth;
// LONG biHeight;
// WORD biPlanes;
// WORD biBitCount;
// DWORD biCompression;
// DWORD biSizeImage;
// LONG biXPelsPerMeter;
// LONG biYPelsPerMeter;
// DWORD biClrUsed;
// DWORD biClrImportant;
// } BITMAPINFOHEADER, *PBITMAPINFOHEADER;
//
var BITMAPINFOHEADER = [
// DWORD biSize -- The number of bytes required by the structure
40, 0, 0, 0,
// LONG biWidth -- The width of the bitmap, in pixels
biWidth & 0xff, biWidth >> 8 & 0xff, biWidth >> 16 & 0xff, biWidth >> 24 & 0xff,
// LONG biHeight -- The height of the bitmap, in pixels
biHeight & 0xff, biHeight >> 8 & 0xff, biHeight >> 16 & 0xff, biHeight >> 24 & 0xff,
// WORD biPlanes -- The number of planes for the target device. This value must be set to 1
1, 0,
// WORD biBitCount -- The number of bits-per-pixel, 24 bits-per-pixel -- the bitmap
// has a maximum of 2^24 colors (16777216, Truecolor)
24, 0,
// DWORD biCompression -- The type of compression, BI_RGB (code 0) -- uncompressed
0, 0, 0, 0,
// DWORD biSizeImage -- The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps
biSizeImage & 0xff, biSizeImage >> 8 & 0xff, biSizeImage >> 16 & 0xff, biSizeImage >> 24 & 0xff,
// LONG biXPelsPerMeter, unused
0, 0, 0, 0,
// LONG biYPelsPerMeter, unused
0, 0, 0, 0,
// DWORD biClrUsed, the number of color indexes of palette, unused
0, 0, 0, 0,
// DWORD biClrImportant, unused
0, 0, 0, 0
];
var iPadding = (4 - ((biWidth * 3) % 4)) % 4;
var aImgData = oData.data;
var strPixelData = '';
var biWidth4 = biWidth << 2;
var y = biHeight;
var fromCharCode = String.fromCharCode;
do {
var iOffsetY = biWidth4 * (y - 1);
var strPixelRow = '';
for (var x = 0; x < biWidth; x++) {
var iOffsetX = x << 2;
strPixelRow += fromCharCode(aImgData[iOffsetY + iOffsetX + 2]) +
fromCharCode(aImgData[iOffsetY + iOffsetX + 1]) +
fromCharCode(aImgData[iOffsetY + iOffsetX]);
}
for (var c = 0; c < iPadding; c++) {
strPixelRow += String.fromCharCode(0);
}
strPixelData += strPixelRow;
} while (--y)
var strEncoded = encodeData(BITMAPFILEHEADER.concat(BITMAPINFOHEADER)) + encodeData(strPixelData);
return strEncoded
}
/**
* 转换为图片base64
* @param canvasId canvas标识
* @param x 将要被提取的图像数据矩形区域的左上角 x 坐标
* @param y 将要被提取的图像数据矩形区域的左上角 y 坐标
* @param width 将要被提取的图像数据矩形区域的宽度
* @param height 将要被提取的图像数据矩形区域的高度
* @param type 转换图片类型
* @param done 完成回调
*/
function convertToImage(canvasId, x, y, width, height, type, done) {
if (done === void 0) done = function() {};
if (type === undefined) {
type = 'png';
}
type = fixType(type);
if (/bmp/.test(type)) {
getImageData(canvasId, x, y, width, height, function(data, err) {
var strData = genBitmapImage(data);
tools_7(done) && done(makeURI(strData, 'image/' + type), err);
});
} else {
console.error('暂不支持生成\'' + type + '\'类型的base64图片');
}
}
var CanvasToBase64 = {
convertToImage: convertToImage,
// convertToPNG: function (width, height, done) {
// return convertToImage(width, height, 'png', done)
// },
// convertToJPEG: function (width, height, done) {
// return convertToImage(width, height, 'jpeg', done)
// },
// convertToGIF: function (width, height, done) {
// return convertToImage(width, height, 'gif', done)
// },
convertToBMP: function(ref, done) {
if (ref === void 0) ref = {};
var canvasId = ref.canvasId;
var x = ref.x;
var y = ref.y;
var width = ref.width;
var height = ref.height;
if (done === void 0) done = function() {};
return convertToImage(canvasId, x, y, width, height, 'bmp', done)
}
};
function methods() {
var self = this;
var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度
var boundHeight = self.height; // 裁剪框默认高度,即整个画布高度
var id = self.id;
var targetId = self.targetId;
var pixelRatio = self.pixelRatio;
var ref = self.cut;
var x = ref.x;
if (x === void 0) x = 0;
var y = ref.y;
if (y === void 0) y = 0;
var width = ref.width;
if (width === void 0) width = boundWidth;
var height = ref.height;
if (height === void 0) height = boundHeight;
self.updateCanvas = function(done) {
if (self.croperTarget) {
// 画布绘制图片
self.ctx.drawImage(
self.croperTarget,
self.imgLeft,
self.imgTop,
self.scaleWidth,
self.scaleHeight
);
}
tools_7(self.onBeforeDraw) && self.onBeforeDraw(self.ctx, self);
self.setBoundStyle(self.boundStyle); // 设置边界样式
self.ctx.draw(false, done);
return self
};
self.pushOrigin = self.pushOrign = function(src) {
self.src = src;
tools_7(self.onBeforeImageLoad) && self.onBeforeImageLoad(self.ctx, self);
return getImageInfo({
src: src
})
.then(function(res) {
var innerAspectRadio = res.width / res.height;
var customAspectRadio = width / height;
self.croperTarget = res.path;
if (innerAspectRadio < customAspectRadio) {
self.rectX = x;
self.baseWidth = width;
self.baseHeight = width / innerAspectRadio;
self.rectY = y - Math.abs((height - self.baseHeight) / 2);
} else {
self.rectY = y;
self.baseWidth = height * innerAspectRadio;
self.baseHeight = height;
self.rectX = x - Math.abs((width - self.baseWidth) / 2);
}
self.imgLeft = self.rectX;
self.imgTop = self.rectY;
self.scaleWidth = self.baseWidth;
self.scaleHeight = self.baseHeight;
self.update();
return new Promise(function(resolve) {
self.updateCanvas(resolve);
})
})
.then(function() {
tools_7(self.onImageLoad) && self.onImageLoad(self.ctx, self);
})
};
self.removeImage = function() {
self.src = '';
self.croperTarget = '';
return draw(self.ctx)
};
self.getCropperBase64 = function(done) {
if (done === void 0) done = function() {};
CanvasToBase64.convertToBMP({
canvasId: id,
x: x,
y: y,
width: width,
height: height
}, done);
};
self.getCropperImage = function(opt, fn) {
var customOptions = opt;
var canvasOptions = {
canvasId: id,
x: x,
y: y,
width: width,
height: height
};
var task = function() {
return Promise.resolve();
};
if (
tools_10(customOptions) &&
customOptions.original
) {
// original mode
task = function() {
self.targetCtx.drawImage(
self.croperTarget,
self.imgLeft * pixelRatio,
self.imgTop * pixelRatio,
self.scaleWidth * pixelRatio,
self.scaleHeight * pixelRatio
);
canvasOptions = {
canvasId: targetId,
x: x * pixelRatio,
y: y * pixelRatio,
width: width * pixelRatio,
height: height * pixelRatio
};
return draw(self.targetCtx)
};
}
return task()
.then(function() {
if (tools_10(customOptions)) {
canvasOptions = Object.assign({}, canvasOptions, customOptions);
}
if (tools_7(customOptions)) {
fn = customOptions;
}
var arg = canvasOptions.componentContext ?
[canvasOptions, canvasOptions.componentContext] :
[canvasOptions];
return canvasToTempFilePath.apply(null, arg)
})
.then(function(res) {
var tempFilePath = res.tempFilePath;
return tools_7(fn) ?
fn.call(self, tempFilePath, null) :
tempFilePath
})
.catch(function(err) {
if (tools_7(fn)) {
fn.call(self, null, err);
} else {
throw err
}
})
};
}
/**
* 获取最新缩放值
* @param oldScale 上一次触摸结束后的缩放值
* @param oldDistance 上一次触摸结束后的双指距离
* @param zoom 缩放系数
* @param touch0 第一指touch对象
* @param touch1 第二指touch对象
* @returns {*}
*/
var getNewScale = function(oldScale, oldDistance, zoom, touch0, touch1) {
var xMove, yMove, newDistance;
// 计算二指最新距离
xMove = Math.round(touch1.x - touch0.x);
yMove = Math.round(touch1.y - touch0.y);
newDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove));
return oldScale + 0.001 * zoom * (newDistance - oldDistance)
};
function update() {
var self = this;
if (!self.src) {
return
}
self.__oneTouchStart = function(touch) {
self.touchX0 = Math.round(touch.x);
self.touchY0 = Math.round(touch.y);
};
self.__oneTouchMove = function(touch) {
var xMove, yMove;
// 计算单指移动的距离
if (self.touchended) {
return self.updateCanvas()
}
xMove = Math.round(touch.x - self.touchX0);
yMove = Math.round(touch.y - self.touchY0);
var imgLeft = Math.round(self.rectX + xMove);
var imgTop = Math.round(self.rectY + yMove);
self.outsideBound(imgLeft, imgTop);
self.updateCanvas();
};
self.__twoTouchStart = function(touch0, touch1) {
var xMove, yMove, oldDistance;
self.touchX1 = Math.round(self.rectX + self.scaleWidth / 2);
self.touchY1 = Math.round(self.rectY + self.scaleHeight / 2);
// 计算两指距离
xMove = Math.round(touch1.x - touch0.x);
yMove = Math.round(touch1.y - touch0.y);
oldDistance = Math.round(Math.sqrt(xMove * xMove + yMove * yMove));
self.oldDistance = oldDistance;
};
self.__twoTouchMove = function(touch0, touch1) {
var oldScale = self.oldScale;
var oldDistance = self.oldDistance;
var scale = self.scale;
var zoom = self.zoom;
self.newScale = getNewScale(oldScale, oldDistance, zoom, touch0, touch1);
// 设定缩放范围
self.newScale <= 1 && (self.newScale = 1);
self.newScale >= scale && (self.newScale = scale);
self.scaleWidth = Math.round(self.newScale * self.baseWidth);
self.scaleHeight = Math.round(self.newScale * self.baseHeight);
var imgLeft = Math.round(self.touchX1 - self.scaleWidth / 2);
var imgTop = Math.round(self.touchY1 - self.scaleHeight / 2);
self.outsideBound(imgLeft, imgTop);
self.updateCanvas();
};
self.__xtouchEnd = function() {
self.oldScale = self.newScale;
self.rectX = self.imgLeft;
self.rectY = self.imgTop;
};
}
var handle = {
// 图片手势初始监测
touchStart: function touchStart(e) {
var self = this;
var ref = e.touches;
var touch0 = ref[0];
var touch1 = ref[1];
if (!self.src) {
return
}
setTouchState(self, true, null, null);
// 计算第一个触摸点的位置,并参照改点进行缩放
self.__oneTouchStart(touch0);
// 两指手势触发
if (e.touches.length >= 2) {
self.__twoTouchStart(touch0, touch1);
}
},
// 图片手势动态缩放
touchMove: function touchMove(e) {
var self = this;
var ref = e.touches;
var touch0 = ref[0];
var touch1 = ref[1];
if (!self.src) {
return
}
setTouchState(self, null, true);
// 单指手势时触发
if (e.touches.length === 1) {
self.__oneTouchMove(touch0);
}
// 两指手势触发
if (e.touches.length >= 2) {
self.__twoTouchMove(touch0, touch1);
}
},
touchEnd: function touchEnd(e) {
var self = this;
if (!self.src) {
return
}
setTouchState(self, false, false, true);
self.__xtouchEnd();
}
};
function cut() {
var self = this;
var boundWidth = self.width; // 裁剪框默认宽度,即整个画布宽度
var boundHeight = self.height;
// 裁剪框默认高度,即整个画布高度
var ref = self.cut;
var x = ref.x;
if (x === void 0) x = 0;
var y = ref.y;
if (y === void 0) y = 0;
var width = ref.width;
if (width === void 0) width = boundWidth;
var height = ref.height;
if (height === void 0) height = boundHeight;
/**
* 设置边界
* @param imgLeft 图片左上角横坐标值
* @param imgTop 图片左上角纵坐标值
*/
self.outsideBound = function(imgLeft, imgTop) {
self.imgLeft = imgLeft >= x ?
x :
self.scaleWidth + imgLeft - x <= width ?
x + width - self.scaleWidth :
imgLeft;
self.imgTop = imgTop >= y ?
y :
self.scaleHeight + imgTop - y <= height ?
y + height - self.scaleHeight :
imgTop;
};
/**
* 设置边界样式
* @param color 边界颜色
*/
self.setBoundStyle = function(ref) {
if (ref === void 0) ref = {};
var color = ref.color;
if (color === void 0) color = '#04b00f';
var mask = ref.mask;
if (mask === void 0) mask = 'rgba(0, 0, 0, 0.3)';
var lineWidth = ref.lineWidth;
if (lineWidth === void 0) lineWidth = 1;
var half = lineWidth / 2;
var boundOption = [{
start: {
x: x - half,
y: y + 10 - half
},
step1: {
x: x - half,
y: y - half
},
step2: {
x: x + 10 - half,
y: y - half
}
},
{
start: {
x: x - half,
y: y + height - 10 + half
},
step1: {
x: x - half,
y: y + height + half
},
step2: {
x: x + 10 - half,
y: y + height + half
}
},
{
start: {
x: x + width - 10 + half,
y: y - half
},
step1: {
x: x + width + half,
y: y - half
},
step2: {
x: x + width + half,
y: y + 10 - half
}
},
{
start: {
x: x + width + half,
y: y + height - 10 + half
},
step1: {
x: x + width + half,
y: y + height + half
},
step2: {
x: x + width - 10 + half,
y: y + height + half
}
}
];
// 绘制半透明层
self.ctx.beginPath();
self.ctx.setFillStyle(mask);
self.ctx.fillRect(0, 0, x, boundHeight);
self.ctx.fillRect(x, 0, width, y);
self.ctx.fillRect(x, y + height, width, boundHeight - y - height);
self.ctx.fillRect(x + width, 0, boundWidth - x - width, boundHeight);
self.ctx.fill();
boundOption.forEach(function(op) {
self.ctx.beginPath();
self.ctx.setStrokeStyle(color);
self.ctx.setLineWidth(lineWidth);
self.ctx.moveTo(op.start.x, op.start.y);
self.ctx.lineTo(op.step1.x, op.step1.y);
self.ctx.lineTo(op.step2.x, op.step2.y);
self.ctx.stroke();
});
};
}
var version = "1.3.9";
var WeCropper = function WeCropper(params) {
var self = this;
var _default = {};
validator(self, DEFAULT);
Object.keys(DEFAULT).forEach(function(key) {
_default[key] = DEFAULT[key].default;
});
Object.assign(self, _default, params);
self.prepare();
self.attachPage();
self.createCtx();
self.observer();
self.cutt();
self.methods();
self.init();
self.update();
return self
};
WeCropper.prototype.init = function init() {
var self = this;
var src = self.src;
self.version = version;
typeof self.onReady === 'function' && self.onReady(self.ctx, self);
if (src) {
self.pushOrign(src);
} else {
self.updateCanvas();
}
setTouchState(self, false, false, false);
self.oldScale = 1;
self.newScale = 1;
return self
};
Object.assign(WeCropper.prototype, handle);
WeCropper.prototype.prepare = prepare;
WeCropper.prototype.observer = observer;
WeCropper.prototype.methods = methods;
WeCropper.prototype.cutt = cut;
WeCropper.prototype.update = update;
return WeCropper;
})));
================================================
FILE: uview-ui/components/u-back-top/u-back-top.vue
================================================
{{tips}}
================================================
FILE: uview-ui/components/u-badge/u-badge.vue
================================================
{{showText}}
================================================
FILE: uview-ui/components/u-button/u-button.vue
================================================
================================================
FILE: uview-ui/components/u-calendar/u-calendar.vue
================================================
{{ showTitle }}
{{item}}
{{ index + 1 }}
{{startText}}
{{endText}}
{{month}}
{{mode == 'date' ? activeDate : startDate}}
至{{endDate}}
确定
================================================
FILE: uview-ui/components/u-car-keyboard/u-car-keyboard.vue
================================================
{}">
{{ item }}
中
/
英
================================================
FILE: uview-ui/components/u-card/u-card.vue
================================================
{{ title }}
{{ subTitle }}
================================================
FILE: uview-ui/components/u-cell-group/u-cell-group.vue
================================================
{{title}}
================================================
FILE: uview-ui/components/u-cell-item/u-cell-item.vue
================================================
{{ title }}
{{ label }}
{{ value }}
================================================
FILE: uview-ui/components/u-checkbox/u-checkbox.vue
================================================
================================================
FILE: uview-ui/components/u-checkbox-group/u-checkbox-group.vue
================================================
================================================
FILE: uview-ui/components/u-circle-progress/u-circle-progress.vue
================================================
================================================
FILE: uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue
================================================
{{percent + '%'}}
================================================
FILE: uview-ui/components/u-col/u-col.vue
================================================
================================================
FILE: uview-ui/components/u-collapse/u-collapse.vue
================================================
================================================
FILE: uview-ui/components/u-collapse-item/u-collapse-item.vue
================================================
{{ title }}
================================================
FILE: uview-ui/components/u-column-notice/u-column-notice.vue
================================================
{{ item }}
================================================
FILE: uview-ui/components/u-count-down/u-count-down.vue
================================================
{{ d }}
{{ separator == 'colon' ? ':' : '天' }}
{{ h }}
{{ separator == 'colon' ? ':' : '时' }}
{{ i }}
{{ separator == 'colon' ? ':' : '分' }}
{{ s }}
秒
================================================
FILE: uview-ui/components/u-count-to/u-count-to.vue
================================================
{{ displayValue }}
================================================
FILE: uview-ui/components/u-divider/u-divider.vue
================================================
================================================
FILE: uview-ui/components/u-dropdown/u-dropdown.vue
================================================
================================================
FILE: uview-ui/components/u-dropdown-item/u-dropdown-item.vue
================================================
{}" @tap.stop.prevent="() => {}">
================================================
FILE: uview-ui/components/u-empty/u-empty.vue
================================================
================================================
FILE: uview-ui/components/u-field/u-field.vue
================================================
{{ label }}
{{ errorMessage }}
================================================
FILE: uview-ui/components/u-form/u-form.vue
================================================
================================================
FILE: uview-ui/components/u-form-item/u-form-item.vue
================================================
*
{{label}}
{{validateMessage}}
================================================
FILE: uview-ui/components/u-full-screen/u-full-screen.vue
================================================
================================================
FILE: uview-ui/components/u-gap/u-gap.vue
================================================
================================================
FILE: uview-ui/components/u-grid/u-grid.vue
================================================
================================================
FILE: uview-ui/components/u-grid-item/u-grid-item.vue
================================================
================================================
FILE: uview-ui/components/u-icon/u-icon.vue
================================================
{{ label }}
================================================
FILE: uview-ui/components/u-image/u-image.vue
================================================
================================================
FILE: uview-ui/components/u-index-anchor/u-index-anchor.vue
================================================
{{ index }}
================================================
FILE: uview-ui/components/u-index-list/u-index-list.vue
================================================
{{indexList[touchmoveIndex]}}
================================================
FILE: uview-ui/components/u-input/u-input.vue
================================================
================================================
FILE: uview-ui/components/u-keyboard/u-keyboard.vue
================================================
{{cancelBtn ? cancelText : ''}}
{{tips ? tips : mode == 'number' ? '数字键盘' : mode == 'card' ? '身份证键盘' : '车牌号键盘'}}
{{confirmBtn ? confirmText : ''}}
================================================
FILE: uview-ui/components/u-lazy-load/u-lazy-load.vue
================================================
================================================
FILE: uview-ui/components/u-line/u-line.vue
================================================
================================================
FILE: uview-ui/components/u-line-progress/u-line-progress.vue
================================================
{{percent + '%'}}
================================================
FILE: uview-ui/components/u-link/u-link.vue
================================================
================================================
FILE: uview-ui/components/u-loading/u-loading.vue
================================================
================================================
FILE: uview-ui/components/u-loading-page/u-loading-page.vue
================================================
================================================
FILE: uview-ui/components/u-loadmore/u-loadmore.vue
================================================
{{ showText }}
================================================
FILE: uview-ui/components/u-mask/u-mask.vue
================================================
{}" :class="{
'u-mask-zoom': zoom,
'u-mask-show': show
}">
================================================
FILE: uview-ui/components/u-message-input/u-message-input.vue
================================================
{{ charArr[index] ? charArr[index] : ''}}
{{ charArr[index] ? '●' : ''}}
================================================
FILE: uview-ui/components/u-modal/u-modal.vue
================================================
{{ title }}
{{ content }}
================================================
FILE: uview-ui/components/u-navbar/u-navbar.vue
================================================
{{ backText }}
{{ title }}
================================================
FILE: uview-ui/components/u-no-network/u-no-network.vue
================================================
{}">
{{tips}}
请检查网络,或前往设置
重试
================================================
FILE: uview-ui/components/u-notice-bar/u-notice-bar.vue
================================================
================================================
FILE: uview-ui/components/u-number-box/u-number-box.vue
================================================
================================================
FILE: uview-ui/components/u-number-keyboard/u-number-keyboard.vue
================================================
{}">
{{ item }}
================================================
FILE: uview-ui/components/u-parse/libs/CssHandler.js
================================================
const cfg = require('./config.js'),
isLetter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
function CssHandler(tagStyle) {
var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
for (var item in tagStyle)
styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
this.styles = styles;
}
CssHandler.prototype.getStyle = function(data) {
this.styles = new parser(data, this.styles).parse();
}
CssHandler.prototype.match = function(name, attrs) {
var tmp, matched = (tmp = this.styles[name]) ? tmp + ';' : '';
if (attrs.class) {
var items = attrs.class.split(' ');
for (var i = 0, item; item = items[i]; i++)
if (tmp = this.styles['.' + item])
matched += tmp + ';';
}
if (tmp = this.styles['#' + attrs.id])
matched += tmp + ';';
return matched;
}
module.exports = CssHandler;
function parser(data, init) {
this.data = data;
this.floor = 0;
this.i = 0;
this.list = [];
this.res = init;
this.state = this.Space;
}
parser.prototype.parse = function() {
for (var c; c = this.data[this.i]; this.i++)
this.state(c);
return this.res;
}
parser.prototype.section = function() {
return this.data.substring(this.start, this.i);
}
// 状态机
parser.prototype.Space = function(c) {
if (c == '.' || c == '#' || isLetter(c)) {
this.start = this.i;
this.state = this.Name;
} else if (c == '/' && this.data[this.i + 1] == '*')
this.Comment();
else if (!cfg.blankChar[c] && c != ';')
this.state = this.Ignore;
}
parser.prototype.Comment = function() {
this.i = this.data.indexOf('*/', this.i) + 1;
if (!this.i) this.i = this.data.length;
this.state = this.Space;
}
parser.prototype.Ignore = function(c) {
if (c == '{') this.floor++;
else if (c == '}' && !--this.floor) {
this.list = [];
this.state = this.Space;
}
}
parser.prototype.Name = function(c) {
if (cfg.blankChar[c]) {
this.list.push(this.section());
this.state = this.NameSpace;
} else if (c == '{') {
this.list.push(this.section());
this.Content();
} else if (c == ',') {
this.list.push(this.section());
this.Comma();
} else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
this.state = this.Ignore;
}
parser.prototype.NameSpace = function(c) {
if (c == '{') this.Content();
else if (c == ',') this.Comma();
else if (!cfg.blankChar[c]) this.state = this.Ignore;
}
parser.prototype.Comma = function() {
while (cfg.blankChar[this.data[++this.i]]);
if (this.data[this.i] == '{') this.Content();
else {
this.start = this.i--;
this.state = this.Name;
}
}
parser.prototype.Content = function() {
this.start = ++this.i;
if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
var content = this.section();
for (var i = 0, item; item = this.list[i++];)
if (this.res[item]) this.res[item] += ';' + content;
else this.res[item] = content;
this.list = [];
this.state = this.Space;
}
================================================
FILE: uview-ui/components/u-parse/libs/MpHtmlParser.js
================================================
/**
* html 解析器
* @tutorial https://github.com/jin-yufeng/Parser
* @version 20201029
* @author JinYufeng
* @listens MIT
*/
const cfg = require('./config.js'),
blankChar = cfg.blankChar,
CssHandler = require('./CssHandler.js'),
windowWidth = uni.getSystemInfoSync().windowWidth;
var emoji;
function MpHtmlParser(data, options = {}) {
this.attrs = {};
this.CssHandler = new CssHandler(options.tagStyle, windowWidth);
this.data = data;
this.domain = options.domain;
this.DOM = [];
this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
this.options = options;
this.state = this.Text;
this.STACK = [];
// 工具函数
this.bubble = () => {
for (var i = this.STACK.length, item; item = this.STACK[--i];) {
if (cfg.richOnlyTags[item.name]) return false;
item.c = 1;
}
return true;
}
this.decode = (val, amp) => {
var i = -1,
j, en;
while (1) {
if ((i = val.indexOf('&', i + 1)) == -1) break;
if ((j = val.indexOf(';', i + 2)) == -1) break;
if (val[i + 1] == '#') {
en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
} else {
en = val.substring(i + 1, j);
if (cfg.entities[en] || en == amp)
val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
}
}
return val;
}
this.getUrl = url => {
if (url[0] == '/') {
if (url[1] == '/') url = this.options.prot + ':' + url;
else if (this.domain) url = this.domain + url;
} else if (this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
url = this.domain + '/' + url;
return url;
}
this.isClose = () => this.data[this.i] == '>' || (this.data[this.i] == '/' && this.data[this.i + 1] == '>');
this.section = () => this.data.substring(this.start, this.i);
this.parent = () => this.STACK[this.STACK.length - 1];
this.siblings = () => this.STACK.length ? this.parent().children : this.DOM;
}
MpHtmlParser.prototype.parse = function() {
if (emoji) this.data = emoji.parseEmoji(this.data);
for (var c; c = this.data[this.i]; this.i++)
this.state(c);
if (this.state == this.Text) this.setText();
while (this.STACK.length) this.popNode(this.STACK.pop());
return this.DOM;
}
// 设置属性
MpHtmlParser.prototype.setAttr = function() {
var name = this.attrName.toLowerCase(),
val = this.attrVal;
if (cfg.boolAttrs[name]) this.attrs[name] = 'T';
else if (val) {
if (name == 'src' || (name == 'data-src' && !this.attrs.src)) this.attrs.src = this.getUrl(this.decode(val, 'amp'));
else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');
else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
}
this.attrVal = '';
while (blankChar[this.data[this.i]]) this.i++;
if (this.isClose()) this.setNode();
else {
this.start = this.i;
this.state = this.AttrName;
}
}
// 设置文本节点
MpHtmlParser.prototype.setText = function() {
var back, text = this.section();
if (!text) return;
text = (cfg.onText && cfg.onText(text, () => back = true)) || text;
if (back) {
this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
let j = this.start + text.length;
for (this.i = this.start; this.i < j; this.i++) this.state(this.data[this.i]);
return;
}
if (!this.pre) {
// 合并空白符
var flag, tmp = [];
for (let i = text.length, c; c = text[--i];)
if (!blankChar[c]) {
tmp.unshift(c);
if (!flag) flag = 1;
} else {
if (tmp[0] != ' ') tmp.unshift(' ');
if (c == '\n' && flag == void 0) flag = 0;
}
if (flag == 0) return;
text = tmp.join('');
}
this.siblings().push({
type: 'text',
text: this.decode(text)
});
}
// 设置元素节点
MpHtmlParser.prototype.setNode = function() {
var node = {
name: this.tagName.toLowerCase(),
attrs: this.attrs
},
close = cfg.selfClosingTags[node.name];
if (this.options.nodes.length) node.type = 'node';
this.attrs = {};
if (!cfg.ignoreTags[node.name]) {
// 处理属性
var attrs = node.attrs,
style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
styleObj = {};
if (attrs.id) {
if (this.options.compress & 1) attrs.id = void 0;
else if (this.options.useAnchor) this.bubble();
}
if ((this.options.compress & 2) && attrs.class) attrs.class = void 0;
switch (node.name) {
case 'a':
case 'ad': // #ifdef APP-PLUS
case 'iframe':
// #endif
this.bubble();
break;
case 'font':
if (attrs.color) {
styleObj['color'] = attrs.color;
attrs.color = void 0;
}
if (attrs.face) {
styleObj['font-family'] = attrs.face;
attrs.face = void 0;
}
if (attrs.size) {
var size = parseInt(attrs.size);
if (size < 1) size = 1;
else if (size > 7) size = 7;
var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
styleObj['font-size'] = map[size - 1];
attrs.size = void 0;
}
break;
case 'embed':
// #ifndef APP-PLUS
var src = node.attrs.src || '',
type = node.attrs.type || '';
if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
node.name = 'video';
else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
'.aac'))
node.name = 'audio';
else break;
if (node.attrs.autostart)
node.attrs.autoplay = 'T';
node.attrs.controls = 'T';
// #endif
// #ifdef APP-PLUS
this.bubble();
break;
// #endif
case 'video':
case 'audio':
if (!attrs.id) attrs.id = node.name + (++this[`${node.name}Num`]);
else this[`${node.name}Num`]++;
if (node.name == 'video') {
if (this.videoNum > 3)
node.lazyLoad = 1;
if (attrs.width) {
styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
attrs.width = void 0;
}
if (attrs.height) {
styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
attrs.height = void 0;
}
}
if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
attrs.source = [];
if (attrs.src) {
attrs.source.push(attrs.src);
attrs.src = void 0;
}
this.bubble();
break;
case 'td':
case 'th':
if (attrs.colspan || attrs.rowspan)
for (var k = this.STACK.length, item; item = this.STACK[--k];)
if (item.name == 'table') {
item.flag = 1;
break;
}
}
if (attrs.align) {
if (node.name == 'table') {
if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';
else styleObj['float'] = attrs.align;
} else styleObj['text-align'] = attrs.align;
attrs.align = void 0;
}
// 压缩 style
var styles = style.split(';');
style = '';
for (var i = 0, len = styles.length; i < len; i++) {
var info = styles[i].split(':');
if (info.length < 2) continue;
let key = info[0].trim().toLowerCase(),
value = info.slice(1).join(':').trim();
if (value[0] == '-' || value.includes('safe'))
style += `;${key}:${value}`;
else if (!styleObj[key] || value.includes('import') || !styleObj[key].includes('import'))
styleObj[key] = value;
}
if (node.name == 'img') {
if (attrs.src && !attrs.ignore) {
if (this.bubble())
attrs.i = (this.imgNum++).toString();
else attrs.ignore = 'T';
}
if (attrs.ignore) {
style += ';-webkit-touch-callout:none';
styleObj['max-width'] = '100%';
}
var width;
if (styleObj.width) width = styleObj.width;
else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
if (width) {
styleObj.width = width;
attrs.width = '100%';
if (parseInt(width) > windowWidth) {
styleObj.height = '';
if (attrs.height) attrs.height = void 0;
}
}
if (styleObj.height) {
attrs.height = styleObj.height;
styleObj.height = '';
} else if (attrs.height && !attrs.height.includes('%'))
attrs.height = parseFloat(attrs.height) + 'px';
}
for (var key in styleObj) {
var value = styleObj[key];
if (!value) continue;
if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
// 填充链接
if (value.includes('url')) {
var j = value.indexOf('(');
if (j++ != -1) {
while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) j++;
value = value.substr(0, j) + this.getUrl(value.substr(j));
}
}
// 转换 rpx
else if (value.includes('rpx'))
value = value.replace(/[0-9.]+\s*rpx/g, $ => parseFloat($) * windowWidth / 750 + 'px');
else if (key == 'white-space' && value.includes('pre') && !close)
this.pre = node.pre = true;
style += `;${key}:${value}`;
}
style = style.substr(1);
if (style) attrs.style = style;
if (!close) {
node.children = [];
if (node.name == 'pre' && cfg.highlight) {
this.remove(node);
this.pre = node.pre = true;
}
this.siblings().push(node);
this.STACK.push(node);
} else if (!cfg.filter || cfg.filter(node, this) != false)
this.siblings().push(node);
} else {
if (!close) this.remove(node);
else if (node.name == 'source') {
var parent = this.parent();
if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
parent.attrs.source.push(node.attrs.src);
} else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
}
if (this.data[this.i] == '/') this.i++;
this.start = this.i + 1;
this.state = this.Text;
}
// 移除标签
MpHtmlParser.prototype.remove = function(node) {
var name = node.name,
j = this.i;
// 处理 svg
var handleSvg = () => {
var src = this.data.substring(j, this.i + 1);
node.attrs.xmlns = 'http://www.w3.org/2000/svg';
for (var key in node.attrs) {
if (key == 'viewbox') src = ` viewBox="${node.attrs.viewbox}"` + src;
else if (key != 'style') src = ` ${key}="${node.attrs[key]}"` + src;
}
src = '