commit a4a1f356578d92085698dd33544bd635d9b787b3 Author: 曹前明 <909355014@qq.com> Date: Sun Jul 24 23:04:27 2022 +0800 初始化提交 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..92fa10e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/* +deploy.sh +package-lock.json +unpackage/* \ No newline at end of file diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..9cba30d --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "remote" + }, + "mp-weixin" : + { + "launchtype" : "remote" + }, + "type" : "uniCloud" + } + ] +} diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..2093d48 --- /dev/null +++ b/App.vue @@ -0,0 +1,65 @@ + + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8e39ead --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2a9f00e --- /dev/null +++ b/README.md @@ -0,0 +1,133 @@ +

+ logo +

+

uView

+

多平台快速开发的UI框架

+ +[![star](https://gitee.com/xuqu/uView/badge/star.svg?theme=gvp)](https://gitee.com/xuqu/uView/stargazers) +[![fork](https://gitee.com/xuqu/uView/badge/fork.svg?theme=gvp)](https://gitee.com/xuqu/uView/members) +[![stars](https://img.shields.io/github/stars/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView) +[![forks](https://img.shields.io/github/forks/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView) +[![issues](https://img.shields.io/github/issues/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView/issues) +[![Website](https://img.shields.io/badge/uView-up-blue?style=flat-square)](https://uviewui.com) +[![release](https://img.shields.io/github/v/release/YanxinNet/uView?style=flat-square)](https://gitee.com/xuqu/uView/releases) +[![license](https://img.shields.io/github/license/YanxinNet/uView?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License) + +## 说明 + +uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 + +## [官方文档:https://www.uviewui.com](https://www.uviewui.com) + +### [点击加群交流反馈:1084514613](https://jq.qq.com/?_wv=1027&k=uyZUkSlo) + +## 特性 + +- 兼容安卓,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://uviewui.com/) +- [更新日志](https://uviewui.com/components/changelog.html) +- [升级指南](https://uviewui.com/components/changelog.html) +- [关于我们](https://uviewui.com/cooperation/about.html) + +## 交流反馈 + +欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html) + +## 安装 + +#### **下载地址** —— [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应用到您的产品中。 diff --git a/common/classify.data.js b/common/classify.data.js new file mode 100644 index 0000000..cb4f75a --- /dev/null +++ b/common/classify.data.js @@ -0,0 +1,1087 @@ +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 + } + ] + } +] \ No newline at end of file diff --git a/common/demo.scss b/common/demo.scss new file mode 100644 index 0000000..547d5d9 --- /dev/null +++ b/common/demo.scss @@ -0,0 +1,86 @@ +/* #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 */ diff --git a/common/http.api.js b/common/http.api.js new file mode 100644 index 0000000..8c47a49 --- /dev/null +++ b/common/http.api.js @@ -0,0 +1,41 @@ +// 如果没有通过拦截器配置域名的话,可以在这里写上完整的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 getUserInfo = (params = {}) => vm.$u.get('/system/user/info/', params);//获取用户信息 + + let getCode = (data = {}) => vm.$u.post('/auth/sms_code/', data); //获取短信验证码 + + let codeLogin = (data = {}) => vm.$u.post('/auth/login_sms_code/', data); //短信验证码登录 + + let login = (data = {}) => vm.$u.post('auth/token/', data); //账户密码登录 + // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 + + let wxmplogin = (data = {}) => vm.$u.post('auth/login_wxmp/', data); //微信登录 + + let bindmp = (data = {}) => vm.$u.post('/system/user/bind_wxmp/', data); //微信小程序绑定 + + let unbindmp = (data = {}) => vm.$u.post('/system/user/unbind_wxmp/', data); //微信小程序解绑 + let getDickey = (params={})=>vm.$u.get('/system/dict/', params);//查询字典 + vm.$u.api = {getUserInfo, + getCode, + codeLogin, + login, + wxmplogin, + bindmp, + unbindmp, + getDickey, + }; +} + +export default { + install +} \ No newline at end of file diff --git a/common/http.interceptor.js b/common/http.interceptor.js new file mode 100644 index 0000000..5521dca --- /dev/null +++ b/common/http.interceptor.js @@ -0,0 +1,71 @@ +// 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token +// 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,也是可以使用的 +const install = (Vue, vm) => { + Vue.prototype.$u.http.setConfig({ + // baseUrl: 'https://api.youzixy.com', + baseUrl: vm.vuex_api, + // 如果将此值设置为true,拦截回调中将会返回服务端返回的所有数据response,而不是response.data + // 设置为true后,就需要在this.$u.http.interceptor.response进行多一次的判断,请打印查看具体值 + // originalData: true, + // 设置自定义头部content-type + // header: { + // 'content-type': 'xxx' + // } + showLoading: true, + loadingText: '请求中..', + originalData: true, + loadingTime: 800, + loadingMask: true + }); + // 请求拦截,配置Token等参数 + Vue.prototype.$u.http.interceptor.request = (config) => { + config.header.Authorization = 'Bearer ' + vm.vuex_token; + // 方式一,存放在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.statusCode < 400) { + return res.data + } + else if (res.statusCode == 401){ + if(res.data.err_code == 'no_active_account'){ + uni.showToast({ + title: '账户密码错误或已禁用', + icon: 'none' + }) + }else{ + uni.reLaunch({ + url:'/pages/login/login' + }) + } + } + else{ + if(res.data.err_msg){ + uni.showToast({ + title: res.data.err_msg, + icon: "none" + }) + } + return Promise.reject(res); + } + } +} + +export default { + install +} \ No newline at end of file diff --git a/common/index.list.js b/common/index.list.js new file mode 100644 index 0000000..7e0f5ed --- /dev/null +++ b/common/index.list.js @@ -0,0 +1,585 @@ +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" + }] + } + ] +} diff --git a/common/locales/en.js b/common/locales/en.js new file mode 100644 index 0000000..5bd6f7a --- /dev/null +++ b/common/locales/en.js @@ -0,0 +1,21 @@ +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', + }, +} \ No newline at end of file diff --git a/common/locales/zh.js b/common/locales/zh.js new file mode 100644 index 0000000..1c6b15c --- /dev/null +++ b/common/locales/zh.js @@ -0,0 +1,21 @@ +export default { + // 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分 + components: { + desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用' + }, + js: { + desc: '众多的贴心小工具,是你开发过程中召之即来的利器,让你飞镖在手,百步穿杨' + }, + template: { + desc: '收集众多的常用页面和布局,减少开发者的重复工作,让你专注逻辑,事半功倍' + }, + nav: { + components: '组件', + js: '工具', + template: '模板' + }, + common: { + intro: '多平台快速开发的UI框架', + title: 'uView UI', + }, +} \ No newline at end of file diff --git a/common/vue-i18n.min.js b/common/vue-i18n.min.js new file mode 100644 index 0000000..8d0a5c0 --- /dev/null +++ b/common/vue-i18n.min.js @@ -0,0 +1,6 @@ +/*! + * vue-i18n v8.20.0 + * (c) 2020 kazuya kawaguchi + * Released under the MIT License. + */ +var t,e;t=this,e=function(){"use strict";var t=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher","unit"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}var n=Array.isArray;function r(t){return null!==t&&"object"==typeof t}function a(t){return"string"==typeof t}var i=Object.prototype.toString,o="[object Object]";function s(t){return i.call(t)===o}function l(t){return null==t}function c(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=null,a=null;return 1===t.length?r(t[0])||Array.isArray(t[0])?a=t[0]:"string"==typeof t[0]&&(n=t[0]):2===t.length&&("string"==typeof t[0]&&(n=t[0]),(r(t[1])||Array.isArray(t[1]))&&(a=t[1])),{locale:n,params:a}}function u(t){return JSON.parse(JSON.stringify(t))}function h(t,e){return!!~t.indexOf(e)}var f=Object.prototype.hasOwnProperty;function p(t,e){return f.call(t,e)}function m(t){for(var e=arguments,n=Object(t),a=1;a0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var a=this.$i18n;return a._tc.apply(a,[t,a.locale,a._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}}(F),F.mixin(g),F.directive("t",{bind:w,update:$,unbind:M}),F.component(v.name,v),F.component(k.name,k),F.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var D=function(){this._caches=Object.create(null)};D.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,r="";for(;n0)h--,u=R,f[W]();else{if(h=0,void 0===n)return!1;if(!1===(n=J(n)))return!1;f[j]()}};null!==u;)if("\\"!==(e=t[++c])||!p()){if(a=U(e),(i=(s=z[u])[a]||s.else||E)===E)return;if(u=i[0],(o=f[i[1]])&&(r=void 0===(r=i[2])?e:r,!1===o()))return;if(u===V)return l}}(t))&&(this._cache[t]=e),e||[]},q.prototype.getPathValue=function(t,e){if(!r(t))return null;var n=this.parsePath(e);if(0===n.length)return null;for(var a=n.length,i=t,o=0;o/,Z=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,K=/^@(?:\.([a-z]+))?:/,Q=/[()]/g,Y={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},tt=new D,et=function(t){var e=this;void 0===t&&(t={}),!F&&"undefined"!=typeof window&&window.Vue&&I(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),a=t.messages||{},i=t.dateTimeFormats||{},o=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||tt,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new q,this._dataListeners=[],this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var a,i;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(a=t,i=n,a=Math.abs(a),2===i?a?a>1?1:0:1:a?Math.min(a,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!l(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(a).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,a[t])}),this._initVM({locale:n,fallbackLocale:r,messages:a,dateTimeFormats:i,numberFormats:o})},nt={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0}};return et.prototype._checkLocaleMessage=function(t,n,r){var i=function(t,n,r,o){if(s(r))Object.keys(r).forEach(function(e){var a=r[e];s(a)?(o.push(e),o.push("."),i(t,n,a,o),o.pop(),o.pop()):(o.push(e),i(t,n,a,o),o.pop())});else if(Array.isArray(r))r.forEach(function(e,r){s(e)?(o.push("["+r+"]"),o.push("."),i(t,n,e,o),o.pop(),o.pop()):(o.push("["+r+"]"),i(t,n,e,o),o.pop())});else if(a(r)){if(X.test(r)){var l="Detected HTML in message '"+r+"' of keypath '"+o.join("")+"' at '"+n+"'. Consider component interpolation with '' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?e(l):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(l)}}};i(n,t,r,[])},et.prototype._initVM=function(t){var e=F.config.silent;F.config.silent=!0,this._vm=new F({data:t}),F.config.silent=e},et.prototype.destroyVM=function(){this._vm.$destroy()},et.prototype.subscribeDataChanging=function(t){this._dataListeners.push(t)},et.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)t.splice(n,1)}}(this._dataListeners,t)},et.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e=t._dataListeners.length;e--;)F.nextTick(function(){t._dataListeners[e]&&t._dataListeners[e].$forceUpdate()})},{deep:!0})},et.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var t=this._vm;return this._root.$i18n.vm.$watch("locale",function(e){t.$set(t,"locale",e),t.$forceUpdate()},{immediate:!0})},et.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},nt.vm.get=function(){return this._vm},nt.messages.get=function(){return u(this._getMessages())},nt.dateTimeFormats.get=function(){return u(this._getDateTimeFormats())},nt.numberFormats.get=function(){return u(this._getNumberFormats())},nt.availableLocales.get=function(){return Object.keys(this.messages).sort()},nt.locale.get=function(){return this._vm.locale},nt.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},nt.fallbackLocale.get=function(){return this._vm.fallbackLocale},nt.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},nt.formatFallbackMessages.get=function(){return this._formatFallbackMessages},nt.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},nt.missing.get=function(){return this._missing},nt.missing.set=function(t){this._missing=t},nt.formatter.get=function(){return this._formatter},nt.formatter.set=function(t){this._formatter=t},nt.silentTranslationWarn.get=function(){return this._silentTranslationWarn},nt.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},nt.silentFallbackWarn.get=function(){return this._silentFallbackWarn},nt.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},nt.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},nt.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},nt.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},nt.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},nt.postTranslation.get=function(){return this._postTranslation},nt.postTranslation.set=function(t){this._postTranslation=t},et.prototype._getMessages=function(){return this._vm.messages},et.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},et.prototype._getNumberFormats=function(){return this._vm.numberFormats},et.prototype._warnDefault=function(t,e,n,r,i,o){if(!l(n))return n;if(this._missing){var s=this._missing.apply(null,[t,e,r,i]);if(a(s))return s}if(this._formatFallbackMessages){var u=c.apply(void 0,i);return this._render(e,o,u.params,e)}return e},et.prototype._isFallbackRoot=function(t){return!t&&!l(this._root)&&this._fallbackRoot},et.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},et.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},et.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},et.prototype._interpolate=function(t,e,n,r,i,o,c){if(!e)return null;var u,h=this._path.getPathValue(e,n);if(Array.isArray(h)||s(h))return h;if(l(h)){if(!s(e))return null;if(!a(u=e[n]))return null}else{if(!a(h))return null;u=h}return(u.indexOf("@:")>=0||u.indexOf("@.")>=0)&&(u=this._link(t,e,u,r,"raw",o,c)),this._render(u,i,o,n)},et.prototype._link=function(t,e,n,r,a,i,o){var s=n,l=s.match(Z);for(var c in l)if(l.hasOwnProperty(c)){var u=l[c],f=u.match(K),p=f[0],m=f[1],_=u.replace(p,"").replace(Q,"");if(h(o,_))return s;o.push(_);var g=this._interpolate(t,e,_,r,"raw"===a?"string":a,"raw"===a?void 0:i,o);if(this._isFallbackRoot(g)){if(!this._root)throw Error("unexpected error");var v=this._root.$i18n;g=v._translate(v._getMessages(),v.locale,v.fallbackLocale,_,r,a,i)}g=this._warnDefault(t,_,g,r,Array.isArray(i)?i:[i],a),this._modifiers.hasOwnProperty(m)?g=this._modifiers[m](g):Y.hasOwnProperty(m)&&(g=Y[m](g)),o.pop(),s=g?s.replace(u,g):s}return s},et.prototype._render=function(t,e,n,r){var i=this._formatter.interpolate(t,n,r);return i||(i=tt.interpolate(t,n,r)),"string"!==e||a(i)?i:i.join("")},et.prototype._appendItemToChain=function(t,e,n){var r=!1;return h(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},et.prototype._appendLocaleToChain=function(t,e,n){var r,a=e.split("-");do{var i=a.join("-");r=this._appendItemToChain(t,i,n),a.splice(-1,1)}while(a.length&&!0===r);return r},et.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,i=0;i0;)i[o]=arguments[o+4];if(!t)return"";var s=c.apply(void 0,i),l=s.locale||e,u=this._translate(n,l,this.fallbackLocale,t,r,"string",s.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(a=this._root).$t.apply(a,[t].concat(i))}return u=this._warnDefault(l,t,u,r,i,"string"),this._postTranslation&&null!=u&&(u=this._postTranslation(u,t)),u},et.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},et.prototype._i=function(t,e,n,r,a){var i=this._translate(n,e,this.fallbackLocale,t,r,"raw",a);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,a)}return this._warnDefault(e,t,i,r,[a],"raw")},et.prototype.i=function(t,e,n){return t?(a(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},et.prototype._tc=function(t,e,n,r,a){for(var i,o=[],s=arguments.length-5;s-- >0;)o[s]=arguments[s+5];if(!t)return"";void 0===a&&(a=1);var l={count:a,n:a},u=c.apply(void 0,o);return u.params=Object.assign(l,u.params),o=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((i=this)._t.apply(i,[t,e,n,r].concat(o)),a)},et.prototype.fetchChoice=function(t,e){if(!t&&!a(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},et.prototype.tc=function(t,e){for(var n,r=[],a=arguments.length-2;a-- >0;)r[a]=arguments[a+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},et.prototype._te=function(t,e,n){for(var r=[],a=arguments.length-3;a-- >0;)r[a]=arguments[a+3];var i=c.apply(void 0,r).locale||e;return this._exist(n[i],t)},et.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},et.prototype.getLocaleMessage=function(t){return u(this._vm.messages[t]||{})},et.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},et.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,m({},this._vm.messages[t]||{},e))},et.prototype.getDateTimeFormat=function(t){return u(this._vm.dateTimeFormats[t]||{})},et.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},et.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,m(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},et.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},et.prototype._localizeDateTime=function(t,e,n,r,a){for(var i=e,o=r[i],s=this._getLocaleChain(e,n),c=0;c0;)e[n]=arguments[n+1];var i=this.locale,o=null;return 1===e.length?a(e[0])?o=e[0]:r(e[0])&&(e[0].locale&&(i=e[0].locale),e[0].key&&(o=e[0].key)):2===e.length&&(a(e[0])&&(o=e[0]),a(e[1])&&(i=e[1])),this._d(t,i,o)},et.prototype.getNumberFormat=function(t){return u(this._vm.numberFormats[t]||{})},et.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},et.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,m(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},et.prototype._clearNumberFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},et.prototype._getNumberFormatter=function(t,e,n,r,a,i){for(var o=e,s=r[o],c=this._getLocaleChain(e,n),u=0;u0;)n[i]=arguments[i+1];var o=this.locale,s=null,l=null;return 1===n.length?a(n[0])?s=n[0]:r(n[0])&&(n[0].locale&&(o=n[0].locale),n[0].key&&(s=n[0].key),l=Object.keys(n[0]).reduce(function(e,r){var a;return h(t,r)?Object.assign({},e,((a={})[r]=n[0][r],a)):e},null)):2===n.length&&(a(n[0])&&(s=n[0]),a(n[1])&&(o=n[1])),this._n(e,o,s,l)},et.prototype._ntp=function(t,e,n,r){if(!et.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var a=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=a&&a.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return i||[]},Object.defineProperties(et.prototype,nt),Object.defineProperty(et,"availabilities",{get:function(){if(!G){var t="undefined"!=typeof Intl;G={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return G}}),et.install=I,et.version="8.20.0",et},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueI18n=e(); \ No newline at end of file diff --git a/components/.DS_Store b/components/.DS_Store new file mode 100644 index 0000000..5f98ef7 Binary files /dev/null and b/components/.DS_Store differ diff --git a/components/linzq-imgUpload/.DS_Store b/components/linzq-imgUpload/.DS_Store new file mode 100644 index 0000000..511f62b Binary files /dev/null and b/components/linzq-imgUpload/.DS_Store differ diff --git a/components/linzq-imgUpload/linzq-imgUpload.vue b/components/linzq-imgUpload/linzq-imgUpload.vue new file mode 100644 index 0000000..a8604a8 --- /dev/null +++ b/components/linzq-imgUpload/linzq-imgUpload.vue @@ -0,0 +1,183 @@ + + + + + diff --git a/components/linzq-imgUpload/shanchus2.png b/components/linzq-imgUpload/shanchus2.png new file mode 100644 index 0000000..c2cb8e3 Binary files /dev/null and b/components/linzq-imgUpload/shanchus2.png differ diff --git a/components/linzq-imgUpload/tupianadd.png b/components/linzq-imgUpload/tupianadd.png new file mode 100644 index 0000000..3d032af Binary files /dev/null and b/components/linzq-imgUpload/tupianadd.png differ diff --git a/components/page-nav/page-nav.vue b/components/page-nav/page-nav.vue new file mode 100644 index 0000000..3f3c0f2 --- /dev/null +++ b/components/page-nav/page-nav.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/components/uni-segmented-control/uni-segmented-control.vue b/components/uni-segmented-control/uni-segmented-control.vue new file mode 100644 index 0000000..19f1328 --- /dev/null +++ b/components/uni-segmented-control/uni-segmented-control.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..2416414 --- /dev/null +++ b/main.js @@ -0,0 +1,64 @@ +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(); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..29b1ae7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,97 @@ +{ + "name" : "共享平台", + "appid" : "__UNI__B00D419", + "description" : "共享平台", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + "modules" : { + "OAuth" : {}, + "Payment" : {}, + "Push" : {}, + "Share" : {}, + "Speech" : {}, + "VideoPlayer" : {} + }, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "autoSdkPermissions" : true + }, + /* ios打包配置 */ + "ios" : { + "UIBackgroundModes" : [ "audio" ] + }, + /* SDK配置 */ + "sdkConfigs" : { + "speech" : { + "ifly" : {} + }, + "ad" : {} + }, + "orientation" : [ "portrait-primary" ] + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wx0605643660b9b2ec", + "setting" : { + "urlCheck" : false, + "minified" : true + }, + "usingComponents" : true + }, + "h5" : { + "template" : "template.h5.html", + "router" : { + "mode" : "history", + "base" : "/h5/" + }, + "title" : "共享平台" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7929b77 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "id": "uView-UI", + "name": "uView UI已发布Sketch和Axure设计资源", + "version": "1.8.4", + "description": "uView正在研发2.0版本,将会全面兼容Nvue,并引入大量激动人心的创新功能", + "keywords": [ + "uView", + "uViewUI", + "UI", + "UI框架", + "uni-app" + ] +} \ No newline at end of file diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..a5c2c2e --- /dev/null +++ b/pages.json @@ -0,0 +1,82 @@ +{ + "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/login/login_password", + "style" : + { + "navigationBarTitleText": "密码登录", + "enablePullDownRefresh": false + } + + }, + { + "path" : "pages/login/login", + "style" : + { + "navigationBarTitleText": "验证码登录", + "enablePullDownRefresh": false + } + + }, + { + "path" : "pages/home/home", + "style" : + { + "navigationBarTitleText": "曲阳金隅智慧安全", + "enablePullDownRefresh": false + } + + }, + { + "path" : "pages/my/my", + "style" : + { + "navigationBarTitleText": "个人中心", + "enablePullDownRefresh": false + } + + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "曲阳金隅智慧安全", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + }, + "tabBar": { + "color": "#909399", + "selectedColor": "#909399", + "backgroundColor": "#FFFFFF", + "borderStyle": "black", + "list": [{ + "pagePath": "pages/home/home", + "iconPath": "static/common/home.png", + "selectedIconPath": "static/common/homec.png", + "text": "主页" + }, + /* { + "pagePath": "pages/vod/video", + "iconPath": "static/common/play.png", + "selectedIconPath": "static/common/playc.png", + "text": "点播" + }, */ + { + "pagePath": "pages/my/my", + "iconPath": "static/common/me.png", + "selectedIconPath": "static/common/mec.png", + "text": "个人中心" + } + ] + } +} diff --git a/pages/home/home.vue b/pages/home/home.vue new file mode 100644 index 0000000..85a8093 --- /dev/null +++ b/pages/home/home.vue @@ -0,0 +1,190 @@ + + + + + + + diff --git a/pages/home/home_.vue b/pages/home/home_.vue new file mode 100644 index 0000000..c12d14e --- /dev/null +++ b/pages/home/home_.vue @@ -0,0 +1,112 @@ + + + + + + + diff --git a/pages/login/code.vue b/pages/login/code.vue new file mode 100644 index 0000000..d8a81f4 --- /dev/null +++ b/pages/login/code.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 0000000..f5c816d --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/pages/login/login_.vue b/pages/login/login_.vue new file mode 100644 index 0000000..d73cfea --- /dev/null +++ b/pages/login/login_.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/pages/login/login_password.vue b/pages/login/login_password.vue new file mode 100644 index 0000000..f96b4b7 --- /dev/null +++ b/pages/login/login_password.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/pages/my/my.vue b/pages/my/my.vue new file mode 100644 index 0000000..3c70e9e --- /dev/null +++ b/pages/my/my.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/static/banner3.jpg b/static/banner3.jpg new file mode 100644 index 0000000..dd3b84f Binary files /dev/null and b/static/banner3.jpg differ diff --git a/static/common/excel.svg b/static/common/excel.svg new file mode 100644 index 0000000..5d76766 --- /dev/null +++ b/static/common/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/common/file.svg b/static/common/file.svg new file mode 100644 index 0000000..478dc37 --- /dev/null +++ b/static/common/file.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/common/home.png b/static/common/home.png new file mode 100644 index 0000000..47ac732 Binary files /dev/null and b/static/common/home.png differ diff --git a/static/common/homec.png b/static/common/homec.png new file mode 100644 index 0000000..51669e3 Binary files /dev/null and b/static/common/homec.png differ diff --git a/static/common/js/touch-emulator.js b/static/common/js/touch-emulator.js new file mode 100644 index 0000000..9632413 --- /dev/null +++ b/static/common/js/touch-emulator.js @@ -0,0 +1,363 @@ +(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"); \ No newline at end of file diff --git a/static/common/me.png b/static/common/me.png new file mode 100644 index 0000000..aa8f6af Binary files /dev/null and b/static/common/me.png differ diff --git a/static/common/mec.png b/static/common/mec.png new file mode 100644 index 0000000..2c52ba9 Binary files /dev/null and b/static/common/mec.png differ diff --git a/static/common/pdf.svg b/static/common/pdf.svg new file mode 100644 index 0000000..3afe69f --- /dev/null +++ b/static/common/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/common/play.png b/static/common/play.png new file mode 100644 index 0000000..0b1f8dc Binary files /dev/null and b/static/common/play.png differ diff --git a/static/common/playc.png b/static/common/playc.png new file mode 100644 index 0000000..2dc5f1d Binary files /dev/null and b/static/common/playc.png differ diff --git a/static/common/ppt.svg b/static/common/ppt.svg new file mode 100644 index 0000000..ea6c816 --- /dev/null +++ b/static/common/ppt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/common/word.svg b/static/common/word.svg new file mode 100644 index 0000000..64fbba3 --- /dev/null +++ b/static/common/word.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/uview/common/favicon.ico b/static/uview/common/favicon.ico new file mode 100644 index 0000000..e0af368 Binary files /dev/null and b/static/uview/common/favicon.ico differ diff --git a/static/uview/common/logo.png b/static/uview/common/logo.png new file mode 100644 index 0000000..05b3aed Binary files /dev/null and b/static/uview/common/logo.png differ diff --git a/static/uview/example/component.png b/static/uview/example/component.png new file mode 100644 index 0000000..09bd020 Binary files /dev/null and b/static/uview/example/component.png differ diff --git a/static/uview/example/component_select.png b/static/uview/example/component_select.png new file mode 100644 index 0000000..3d704a8 Binary files /dev/null and b/static/uview/example/component_select.png differ diff --git a/static/uview/example/js.png b/static/uview/example/js.png new file mode 100644 index 0000000..b904664 Binary files /dev/null and b/static/uview/example/js.png differ diff --git a/static/uview/example/js_bak.png b/static/uview/example/js_bak.png new file mode 100644 index 0000000..d280e3d Binary files /dev/null and b/static/uview/example/js_bak.png differ diff --git a/static/uview/example/js_select.png b/static/uview/example/js_select.png new file mode 100644 index 0000000..9411c91 Binary files /dev/null and b/static/uview/example/js_select.png differ diff --git a/static/uview/example/js_select_bak.png b/static/uview/example/js_select_bak.png new file mode 100644 index 0000000..2ea6122 Binary files /dev/null and b/static/uview/example/js_select_bak.png differ diff --git a/static/uview/example/min_button.png b/static/uview/example/min_button.png new file mode 100644 index 0000000..077eb43 Binary files /dev/null and b/static/uview/example/min_button.png differ diff --git a/static/uview/example/min_button_select.png b/static/uview/example/min_button_select.png new file mode 100644 index 0000000..703a8bd Binary files /dev/null and b/static/uview/example/min_button_select.png differ diff --git a/static/uview/example/template.png b/static/uview/example/template.png new file mode 100644 index 0000000..5d27f97 Binary files /dev/null and b/static/uview/example/template.png differ diff --git a/static/uview/example/template_select.png b/static/uview/example/template_select.png new file mode 100644 index 0000000..be4b338 Binary files /dev/null and b/static/uview/example/template_select.png differ diff --git a/store/$u.mixin.js b/store/$u.mixin.js new file mode 100644 index 0000000..61ae187 --- /dev/null +++ b/store/$u.mixin.js @@ -0,0 +1,27 @@ +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) + } +} \ No newline at end of file diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..673b1e5 --- /dev/null +++ b/store/index.js @@ -0,0 +1,94 @@ +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 : {}, + vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '', + vuex_host: 'http://127.0.0.1:8000', + //vuex_api: 'http://47.95.0.242:9101/api', + vuex_api: 'http://127.0.0.1:8000/api', + // vuex_apifile: 'http://127.0.0.1:8000/api/file/', + + // vuex_host: 'https://testsearch.ctc.ac.cn', + // vuex_api: 'https://testsearch.ctc.ac.cn/api', + vuex_apifile: 'https://testsearch.ctc.ac.cn/api/file/', + + // 如果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 diff --git a/template.h5.html b/template.h5.html new file mode 100644 index 0000000..2656b09 --- /dev/null +++ b/template.h5.html @@ -0,0 +1,42 @@ + + + + + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + + + + +
+ + + + diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..8c223a7 --- /dev/null +++ b/uni.scss @@ -0,0 +1,7 @@ +/** + * 下方引入的为uView UI的集成样式文件,为scss预处理器,其中包含了一些"u-"开头的自定义变量 + * 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可 + * uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用 + */ +@import 'uview-ui/theme.scss'; + diff --git a/uni_modules/uni-badge/changelog.md b/uni_modules/uni-badge/changelog.md new file mode 100644 index 0000000..47a930a --- /dev/null +++ b/uni_modules/uni-badge/changelog.md @@ -0,0 +1,16 @@ +## 1.1.3(2021-06-24) +- 优化 示例项目 +## 1.1.1(2021-05-12) +- 新增 组件示例地址 +## 1.1.0(2021-05-12) +- 新增 uni-badge 的 absolute 属性,支持定位 +- 新增 uni-badge 的 offset 属性,支持定位偏移 +- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点 +- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+ +- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式 +## 1.0.7(2021-05-07) +- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug +- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug +- 新增 uni-badge 属性 custom-style, 支持自定义样式 +## 1.0.6(2021-02-04) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue new file mode 100644 index 0000000..efe2812 --- /dev/null +++ b/uni_modules/uni-badge/components/uni-badge/uni-badge.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/uni_modules/uni-badge/package.json b/uni_modules/uni-badge/package.json new file mode 100644 index 0000000..c68bcc3 --- /dev/null +++ b/uni_modules/uni-badge/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-badge", + "displayName": "uni-badge 数字角标", + "version": "1.1.3", + "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", + "keywords": [ + "", + "badge", + "uni-ui", + "uniui", + "数字角标", + "徽章" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "y", + "联盟": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-badge/readme.md b/uni_modules/uni-badge/readme.md new file mode 100644 index 0000000..e035449 --- /dev/null +++ b/uni_modules/uni-badge/readme.md @@ -0,0 +1,58 @@ + + +## Badge 数字角标 +> **组件名:uni-badge** +> 代码块: `uBadge` + + +数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, + +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +### 基本用法 + +在 ``template`` 中使用组件 + +```html + + + + + + + +``` + + +## API + +### Badge Props + +|属性名 |类型 |默认值 |说明 | +|:-: |:-: |:-: |:-: | +|text |String |- |角标内容 | +|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)| +|size |String |normal |Badge 大小,可取值:normal、small | +|is-dot |Boolean|false |不展示数字,只有一个小点 | +|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ | +|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 | +|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 | +|absolute |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) | +|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])| + +### Badge Events + +|事件名 |事件说明 |返回参数 | +|:-: |:-: |:-: | +|@click |点击 Badge 触发事件| - | + + + + +## 组件示例 + +点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge) \ No newline at end of file diff --git a/uni_modules/uni-icons/changelog.md b/uni_modules/uni-icons/changelog.md new file mode 100644 index 0000000..204f31b --- /dev/null +++ b/uni_modules/uni-icons/changelog.md @@ -0,0 +1,4 @@ +## 1.1.5(2021-05-12) +- 新增 组件示例地址 +## 1.1.4(2021-02-05) +- 调整为uni_modules目录规范 diff --git a/uni_modules/uni-icons/components/uni-icons/icons.js b/uni_modules/uni-icons/components/uni-icons/icons.js new file mode 100644 index 0000000..60b7332 --- /dev/null +++ b/uni_modules/uni-icons/components/uni-icons/icons.js @@ -0,0 +1,132 @@ +export default { + "pulldown": "\ue588", + "refreshempty": "\ue461", + "back": "\ue471", + "forward": "\ue470", + "more": "\ue507", + "more-filled": "\ue537", + "scan": "\ue612", + "qq": "\ue264", + "weibo": "\ue260", + "weixin": "\ue261", + "pengyouquan": "\ue262", + "loop": "\ue565", + "refresh": "\ue407", + "refresh-filled": "\ue437", + "arrowthindown": "\ue585", + "arrowthinleft": "\ue586", + "arrowthinright": "\ue587", + "arrowthinup": "\ue584", + "undo-filled": "\ue7d6", + "undo": "\ue406", + "redo": "\ue405", + "redo-filled": "\ue7d9", + "bars": "\ue563", + "chatboxes": "\ue203", + "camera": "\ue301", + "chatboxes-filled": "\ue233", + "camera-filled": "\ue7ef", + "cart-filled": "\ue7f4", + "cart": "\ue7f5", + "checkbox-filled": "\ue442", + "checkbox": "\ue7fa", + "arrowleft": "\ue582", + "arrowdown": "\ue581", + "arrowright": "\ue583", + "smallcircle-filled": "\ue801", + "arrowup": "\ue580", + "circle": "\ue411", + "eye-filled": "\ue568", + "eye-slash-filled": "\ue822", + "eye-slash": "\ue823", + "eye": "\ue824", + "flag-filled": "\ue825", + "flag": "\ue508", + "gear-filled": "\ue532", + "reload": "\ue462", + "gear": "\ue502", + "hand-thumbsdown-filled": "\ue83b", + "hand-thumbsdown": "\ue83c", + "hand-thumbsup-filled": "\ue83d", + "heart-filled": "\ue83e", + "hand-thumbsup": "\ue83f", + "heart": "\ue840", + "home": "\ue500", + "info": "\ue504", + "home-filled": "\ue530", + "info-filled": "\ue534", + "circle-filled": "\ue441", + "chat-filled": "\ue847", + "chat": "\ue263", + "mail-open-filled": "\ue84d", + "email-filled": "\ue231", + "mail-open": "\ue84e", + "email": "\ue201", + "checkmarkempty": "\ue472", + "list": "\ue562", + "locked-filled": "\ue856", + "locked": "\ue506", + "map-filled": "\ue85c", + "map-pin": "\ue85e", + "map-pin-ellipse": "\ue864", + "map": "\ue364", + "minus-filled": "\ue440", + "mic-filled": "\ue332", + "minus": "\ue410", + "micoff": "\ue360", + "mic": "\ue302", + "clear": "\ue434", + "smallcircle": "\ue868", + "close": "\ue404", + "closeempty": "\ue460", + "paperclip": "\ue567", + "paperplane": "\ue503", + "paperplane-filled": "\ue86e", + "person-filled": "\ue131", + "contact-filled": "\ue130", + "person": "\ue101", + "contact": "\ue100", + "images-filled": "\ue87a", + "phone": "\ue200", + "images": "\ue87b", + "image": "\ue363", + "image-filled": "\ue877", + "location-filled": "\ue333", + "location": "\ue303", + "plus-filled": "\ue439", + "plus": "\ue409", + "plusempty": "\ue468", + "help-filled": "\ue535", + "help": "\ue505", + "navigate-filled": "\ue884", + "navigate": "\ue501", + "mic-slash-filled": "\ue892", + "search": "\ue466", + "settings": "\ue560", + "sound": "\ue590", + "sound-filled": "\ue8a1", + "spinner-cycle": "\ue465", + "download-filled": "\ue8a4", + "personadd-filled": "\ue132", + "videocam-filled": "\ue8af", + "personadd": "\ue102", + "upload": "\ue402", + "upload-filled": "\ue8b1", + "starhalf": "\ue463", + "star-filled": "\ue438", + "star": "\ue408", + "trash": "\ue401", + "phone-filled": "\ue230", + "compose": "\ue400", + "videocam": "\ue300", + "trash-filled": "\ue8dc", + "download": "\ue403", + "chatbubble-filled": "\ue232", + "chatbubble": "\ue202", + "cloud-download": "\ue8e4", + "cloud-upload-filled": "\ue8e5", + "cloud-upload": "\ue8e6", + "cloud-download-filled": "\ue8e9", + "headphones":"\ue8bf", + "shop":"\ue609" +} diff --git a/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue new file mode 100644 index 0000000..6319565 --- /dev/null +++ b/uni_modules/uni-icons/components/uni-icons/uni-icons.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/uni_modules/uni-icons/components/uni-icons/uni.ttf b/uni_modules/uni-icons/components/uni-icons/uni.ttf new file mode 100644 index 0000000..60a1968 Binary files /dev/null and b/uni_modules/uni-icons/components/uni-icons/uni.ttf differ diff --git a/uni_modules/uni-icons/package.json b/uni_modules/uni-icons/package.json new file mode 100644 index 0000000..c8e1224 --- /dev/null +++ b/uni_modules/uni-icons/package.json @@ -0,0 +1,82 @@ +{ + "id": "uni-icons", + "displayName": "uni-icons 图标", + "version": "1.1.5", + "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。", + "keywords": [ + "uni-ui", + "uniui", + "icon", + "图标" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-icons/readme.md b/uni_modules/uni-icons/readme.md new file mode 100644 index 0000000..8d56f42 --- /dev/null +++ b/uni_modules/uni-icons/readme.md @@ -0,0 +1,46 @@ + + +## Icons 图标 +> **组件名:uni-icons** +> 代码块: `uIcons` + + +用于展示 icons 图标 。 + +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +### 基本用法 + +在 ``template`` 中使用组件 + +```html + +``` + + + +## API + +### Icons Props + +|属性名 |类型 |默认值 |说明 | +|:-: |:-: |:-: |:-: | +|size |Number |24 |图标大小 | +|type |String |- |图标图案,参考示例 | +|color |String |- |图标颜色 | + + +### Icons Events +|事件名 |说明 |返回值| +|:-: |:-: |:-: | +|@click|点击 Icon 触发事件|- | + + + +## 组件示例 + +点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/icons/icons](https://hellouniapp.dcloud.net.cn/pages/extUI/icons/icons) \ No newline at end of file diff --git a/uni_modules/uni-list/changelog.md b/uni_modules/uni-list/changelog.md new file mode 100644 index 0000000..e3338a9 --- /dev/null +++ b/uni_modules/uni-list/changelog.md @@ -0,0 +1,7 @@ +## 1.0.17(2021-05-12) +- 新增 组件示例地址 +## 1.0.16(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.0.15(2021-02-05) +- 调整为uni_modules目录规范 +- 修复 uni-list-chat 角标显示不正常的问题 diff --git a/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue new file mode 100644 index 0000000..e256e4c --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss new file mode 100644 index 0000000..311f8d9 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss @@ -0,0 +1,58 @@ +/** + * 这里是 uni-list 组件内置的常用样式变量 + * 如果需要覆盖样式,这里提供了基本的组件样式变量,您可以尝试修改这里的变量,去完成样式替换,而不用去修改源码 + * + */ + +// 背景色 +$background-color : #fff; +// 分割线颜色 +$divide-line-color : #e5e5e5; + +// 默认头像大小,如需要修改此值,注意同步修改 js 中的值 const avatarWidth = xx ,目前只支持方形头像 +// nvue 页面不支持修改头像大小 +$avatar-width : 45px ; + +// 头像边框 +$avatar-border-radius: 5px; +$avatar-border-color: #eee; +$avatar-border-width: 1px; + +// 标题文字样式 +$title-size : 16px; +$title-color : #3b4144; +$title-weight : normal; + +// 描述文字样式 +$note-size : 12px; +$note-color : #999; +$note-weight : normal; + +// 右侧额外内容默认样式 +$right-text-size : 12px; +$right-text-color : #999; +$right-text-weight : normal; + +// 角标样式 +// nvue 页面不支持修改圆点位置以及大小 +// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动 +$badge-left: 0px; +$badge-top: 0px; + +// 显示圆点时,圆点大小 +$dot-width: 10px; +$dot-height: 10px; + +// 显示角标时,角标大小和字体大小 +$badge-size : 18px; +$badge-font : 12px; +// 显示角标时,角标前景色 +$badge-color : #fff; +// 显示角标时,角标背景色 +$badge-background-color : #ff5a5f; +// 显示角标时,角标左右间距 +$badge-space : 6px; + +// 状态样式 +// 选中颜色 +$hover : #f5f5f5; diff --git a/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue new file mode 100644 index 0000000..a2de186 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue @@ -0,0 +1,533 @@ + + + + + diff --git a/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue new file mode 100644 index 0000000..c0ba12e --- /dev/null +++ b/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue @@ -0,0 +1,438 @@ + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-list.vue b/uni_modules/uni-list/components/uni-list/uni-list.vue new file mode 100644 index 0000000..d478729 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-list.vue @@ -0,0 +1,106 @@ + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.vue b/uni_modules/uni-list/components/uni-list/uni-refresh.vue new file mode 100644 index 0000000..3b4c5a2 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/uni_modules/uni-list/components/uni-list/uni-refresh.wxs b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs new file mode 100644 index 0000000..818a6b7 --- /dev/null +++ b/uni_modules/uni-list/components/uni-list/uni-refresh.wxs @@ -0,0 +1,87 @@ +var pullDown = { + threshold: 95, + maxHeight: 200, + callRefresh: 'onrefresh', + callPullingDown: 'onpullingdown', + refreshSelector: '.uni-refresh' +}; + +function ready(newValue, oldValue, ownerInstance, instance) { + var state = instance.getState() + state.canPullDown = newValue; + // console.log(newValue); +} + +function touchStart(e, instance) { + var state = instance.getState(); + state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); + state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); + if (!state.canPullDown) { + return + } + + // console.log("touchStart"); + + state.height = 0; + state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; + state.refreshInstance.setStyle({ + 'height': 0 + }); + state.refreshInstance.callMethod("onchange", true); +} + +function touchMove(e, ownerInstance) { + var instance = e.instance; + var state = instance.getState(); + if (!state.canPullDown) { + return + } + + var oldHeight = state.height; + var endY = e.touches[0].pageY || e.changedTouches[0].pageY; + var height = endY - state.touchStartY; + if (height > pullDown.maxHeight) { + return; + } + + var refreshInstance = state.refreshInstance; + refreshInstance.setStyle({ + 'height': height + 'px' + }); + + height = height < pullDown.maxHeight ? height : pullDown.maxHeight; + state.height = height; + refreshInstance.callMethod(pullDown.callPullingDown, { + height: height + }); +} + +function touchEnd(e, ownerInstance) { + var state = e.instance.getState(); + if (!state.canPullDown) { + return + } + + state.refreshInstance.callMethod("onchange", false); + + var refreshInstance = state.refreshInstance; + if (state.height > pullDown.threshold) { + refreshInstance.callMethod(pullDown.callRefresh); + return; + } + + refreshInstance.setStyle({ + 'height': 0 + }); +} + +function propObserver(newValue, oldValue, instance) { + pullDown = newValue; +} + +module.exports = { + touchmove: touchMove, + touchstart: touchStart, + touchend: touchEnd, + propObserver: propObserver +} diff --git a/uni_modules/uni-list/package.json b/uni_modules/uni-list/package.json new file mode 100644 index 0000000..3437e9e --- /dev/null +++ b/uni_modules/uni-list/package.json @@ -0,0 +1,87 @@ +{ + "id": "uni-list", + "displayName": "uni-list 列表", + "version": "1.0.17", + "description": "List 组件 ,帮助使用者快速构建列表。", + "keywords": [ + "", + "uni-ui", + "uniui", + "列表", + "", + "list" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-badge", + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-list/readme.md b/uni_modules/uni-list/readme.md new file mode 100644 index 0000000..e4a5d73 --- /dev/null +++ b/uni_modules/uni-list/readme.md @@ -0,0 +1,347 @@ + + +## List 列表 +> **组件名:uni-list** +> 代码块: `uList`、`uListItem` +> 关联组件:`uni-list-item`、`uni-badge`、`uni-icons`、`uni-list-chat`、`uni-list-ad` + + +List 列表组件,包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容。 + +在vue页面里,它默认使用页面级滚动。在app-nvue页面里,它默认使用原生list组件滚动。这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。 + +uni-list组件是父容器,里面的核心是uni-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。 + +uni-list-item有很多风格,uni-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容。 + +内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表。 + +涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现。 + +下文均有样例给出。 + +uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-load-more](https://ext.dcloud.net.cn/plugin?id=29) + + +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +> **注意事项** +> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 +> - 组件需要依赖 `sass` 插件 ,请自行手动安装 +> - 组件内部依赖 `'uni-icons'` 、`uni-badge` 组件 +> - `uni-list` 和 `uni-list-item` 需要配套使用,暂不支持单独使用 `uni-list-item` +> - 只有开启点击反馈后,会有点击选中效果 +> - 使用插槽时,可以完全自定义内容 +> - note 、rightText 属性暂时没做限制,不支持文字溢出隐藏,使用时应该控制长度显示或通过默认插槽自行扩展 +> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: 详情 --> 项目配置 --> 启用 component2 编译 +> - 如果需要修改 `switch`、`badge` 样式,请使用插槽自定义 +> - 在 `HBuilderX` 低版本中,可能会出现组件显示 `undefined` 的问题,请升级最新的 `HBuilderX` 或者 `cli` +> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + +### 基本用法 + +- 设置 `title` 属性,可以显示列表标题 +- 设置 `disabled` 属性,可以禁用当前项 + +```html + + + + + +``` + +### 多行内容显示 + +- 设置 `note` 属性 ,可以在第二行显示描述文本信息 + +```html + + + + + +``` + +### 右侧显示角标、switch + +- 设置 `show-badge` 属性 ,可以显示角标内容 +- 设置 `show-switch` 属性,可以显示 switch 开关 + +```html + + + + + +``` + +### 左侧显示略缩图、图标 + +- 设置 `thumb` 属性 ,可以在列表左侧显示略缩图 +- 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标 + +```html + + + + +``` + +### 开启点击反馈和右侧箭头 +- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 +- 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头 +- 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` + +```html + + + + + + + +``` + + +### 聊天列表示例 +- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 +- 设置 `link` 属性,会自动开启点击反馈,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` +- 设置 `to` 属性,可以跳转页面 +- `time` 属性,通常会设置成时间显示,但是这个属性不仅仅可以设置时间,你可以传入任何文本,注意文本长度可能会影响显示 +- `avatar` 和 `avatarList` 属性同时只会有一个生效,同时设置的话,`avatarList` 属性的长度大于1 ,`avatar` 属性将失效 +- 可以通过默认插槽自定义列表右侧内容 + +```html + + + + + + + + + + + + + + + + + 刚刚 + + + + + + + +``` + +```javascript + +export default { + components: {}, + data() { + return { + avatarList: [{ + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }, { + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }, { + url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' + }] + } + } +} + +``` + + +```css + +.chat-custom-right { + flex: 1; + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: column; + justify-content: space-between; + align-items: flex-end; +} + +.chat-custom-text { + font-size: 12px; + color: #999; +} + +``` + +## API + +### List Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +border |Boolean |true | 是否显示边框 + + +### ListItem Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +title |String |- | 标题 +note |String |- | 描述 +ellipsis |Number |0 | title 是否溢出隐藏,可选值,0:默认; 1:显示一行; 2:显示两行;【nvue 暂不支持】 +thumb |String |- | 左侧缩略图,若thumb有值,则不会显示扩展图标 +thumbSize |String |medium | 略缩图尺寸,可选值,lg:大图; medium:一般; sm:小图; +showBadge |Boolean |false | 是否显示数字角标 +badgeText |String |- | 数字角标内容 +badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21) +rightText |String |- | 右侧文字内容 +disabled |Boolean |false | 是否禁用 +showArrow |Boolean |true | 是否显示箭头图标 +link |String |navigateTo | 新页面跳转方式,可选值见下表 +to |String |- | 新页面跳转地址,如填写此属性,click 会返回页面是否跳转成功 +clickable |Boolean |false | 是否开启点击反馈 +showSwitch |Boolean |false | 是否显示Switch +switchChecked |Boolean |false | Switch是否被选中 +showExtraIcon |Boolean |false | 左侧是否显示扩展图标 +extraIcon |Object |- | 扩展图标参数,格式为 ``{color: '#4cd964',size: '22',type: 'spinner'}``,参考 [uni-icons](https://ext.dcloud.net.cn/plugin?id=28) +direction | String |row | 排版方向,可选值,row:水平排列; column:垂直排列; 3个插槽是水平排还是垂直排,也受此属性控制 + + +#### Link Options + +属性名 | 说明 +:-: | :-: +navigateTo | 同 uni.navigateTo() +redirectTo | 同 uni.reLaunch() +reLaunch | 同 uni.reLaunch() +switchTab | 同 uni.switchTab() + +### ListItem Events + +事件称名 |说明 |返回参数 +:-: |:-: |:-: +click |点击 uniListItem 触发事件,需开启点击反馈 |- +switchChange |点击切换 Switch 时触发,需显示 switch |e={value:checked} + + + +### ListItem Slots + +名称 | 说明 +:-: | :-: +header | 左/上内容插槽,可完全自定义默认显示 +body | 中间内容插槽,可完全自定义中间内容 +footer | 右/下内容插槽,可完全自定义右侧内容 + + +> **通过插槽扩展** +> 需要注意的是当使用插槽时,内置样式将会失效,只保留排版样式,此时的样式需要开发者自己实现 +> 如果 `uni-list-item` 组件内置属性样式无法满足需求,可以使用插槽来自定义uni-list-item里的内容。 +> uni-list-item提供了3个可扩展的插槽:`header`、`body`、`footer` +> - 当 `direction` 属性为 `row` 时表示水平排列,此时 `header` 表示列表的左边部分,`body` 表示列表的中间部分,`footer` 表示列表的右边部分 +> - 当 `direction` 属性为 `column` 时表示垂直排列,此时 `header` 表示列表的上边部分,`body` 表示列表的中间部分,`footer` 表示列表的下边部分 +> 开发者可以只用1个插槽,也可以3个一起使用。在插槽中可自主编写view标签,实现自己所需的效果。 + + +**示例** + +```html + + + + + + + + + 自定义插槽 + + + + +``` + + + + + +### ListItemChat Props + +属性名 |类型 |默认值 | 说明 +:-: |:-: |:-: | :-: +title |String |- | 标题 +note |String |- | 描述 +clickable |Boolean |false | 是否开启点击反馈 +badgeText |String |- | 数字角标内容,设置为 `dot` 将显示圆点 +badgePositon |String |right | 角标位置 +link |String |navigateTo | 是否展示右侧箭头并开启点击反馈,可选值见下表 +clickable |Boolean |false | 是否开启点击反馈 +to |String |- | 跳转页面地址,如填写此属性,click 会返回页面是否跳转成功 +time |String |- | 右侧时间显示 +avatarCircle |Boolean |false | 是否显示圆形头像 +avatar |String |- | 头像地址,avatarCircle 不填时生效 +avatarList |Array |- | 头像组,格式为 [{url:''}] + +#### Link Options + +属性名 | 说明 +:-: | :-: +navigateTo | 同 uni.navigateTo() +redirectTo | 同 uni.reLaunch() +reLaunch | 同 uni.reLaunch() +switchTab | 同 uni.switchTab() + +### ListItemChat Slots + +名称 | 说明 +:- | :- +default | 自定义列表右侧内容(包括时间和角标显示) + +### ListItemChat Events +事件称名 | 说明 | 返回参数 +:-: | :-: | :-: +@click | 点击 uniListChat 触发事件 | {data:{}} ,如有 to 属性,会返回页面跳转信息 + + + + + + +## 基于uni-list扩展的页面模板 + +通过扩展插槽,可实现多种常见样式的列表 + +**新闻列表类** + +1. 云端一体混合布局:[https://ext.dcloud.net.cn/plugin?id=2546](https://ext.dcloud.net.cn/plugin?id=2546) +2. 云端一体垂直布局,大图模式:[https://ext.dcloud.net.cn/plugin?id=2583](https://ext.dcloud.net.cn/plugin?id=2583) +3. 云端一体垂直布局,多行图文混排:[https://ext.dcloud.net.cn/plugin?id=2584](https://ext.dcloud.net.cn/plugin?id=2584) +4. 云端一体垂直布局,多图模式:[https://ext.dcloud.net.cn/plugin?id=2585](https://ext.dcloud.net.cn/plugin?id=2585) +5. 云端一体水平布局,左图右文:[https://ext.dcloud.net.cn/plugin?id=2586](https://ext.dcloud.net.cn/plugin?id=2586) +6. 云端一体水平布局,左文右图:[https://ext.dcloud.net.cn/plugin?id=2587](https://ext.dcloud.net.cn/plugin?id=2587) +7. 云端一体垂直布局,无图模式,主标题+副标题:[https://ext.dcloud.net.cn/plugin?id=2588](https://ext.dcloud.net.cn/plugin?id=2588) + +**商品列表类** + +1. 云端一体列表/宫格视图互切:[https://ext.dcloud.net.cn/plugin?id=2651](https://ext.dcloud.net.cn/plugin?id=2651) +2. 云端一体列表(宫格模式):[https://ext.dcloud.net.cn/plugin?id=2671](https://ext.dcloud.net.cn/plugin?id=2671) +3. 云端一体列表(列表模式):[https://ext.dcloud.net.cn/plugin?id=2672](https://ext.dcloud.net.cn/plugin?id=2672) + +## 组件示例 + +点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/list/list](https://hellouniapp.dcloud.net.cn/pages/extUI/list/list) \ No newline at end of file diff --git a/uni_modules/uni-search-bar/changelog.md b/uni_modules/uni-search-bar/changelog.md new file mode 100644 index 0000000..1ab3128 --- /dev/null +++ b/uni_modules/uni-search-bar/changelog.md @@ -0,0 +1,18 @@ +## 1.0.9(2021-05-12) +- 新增 项目示例地址 +## 1.0.8(2021-04-21) +- 优化 添加依赖 uni-icons, 导入后自动下载依赖 +## 1.0.7(2021-04-15) +- uni-ui 新增 uni-search-bar 的 focus 事件 + +## 1.0.6(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 + +## 1.0.5(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持双向绑定 +- 更改 input 事件的返回值,e={value:Number} --> e=value +- 新增 支持图标插槽 +- 新增 支持 clear、blur 事件 +- 新增 支持 focus 属性 +- 去掉组件背景色 diff --git a/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue b/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue new file mode 100644 index 0000000..a0b0e53 --- /dev/null +++ b/uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/uni_modules/uni-search-bar/package.json b/uni_modules/uni-search-bar/package.json new file mode 100644 index 0000000..98f64a2 --- /dev/null +++ b/uni_modules/uni-search-bar/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-search-bar", + "displayName": "uni-search-bar 搜索栏", + "version": "1.0.9", + "description": "搜索栏组件,通常用于搜索商品、文章等", + "keywords": [ + "uni-ui", + "uniui", + "搜索框", + "搜索栏" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": [ + "uni-icons" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-search-bar/readme.md b/uni_modules/uni-search-bar/readme.md new file mode 100644 index 0000000..b39d6cf --- /dev/null +++ b/uni_modules/uni-search-bar/readme.md @@ -0,0 +1,86 @@ + + +## SearchBar 搜索栏 + +> **组件名:uni-search-bar** +> 代码块: `uSearchBar` + + +评分组件 + +### 安装方式 + +本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 + +如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +### 基本用法 + +在 ``template`` 中使用组件 + +```html + + + + + + + + + + + +``` + + +## API +### SearchBar Props + +|属性名 |类型 |默认值 |说明 | +|:-: |:-: |:-: |:-: | +|value/v-model |StringNumber | |搜索栏绑定值 | +|placeholder |String |搜索 |搜索栏Placeholder | +|radius |Number |10 |搜索栏圆角,单位px | +|clearButton |String |auto |是否显示清除按钮,可选值`always`-一直显示、`auto`-输入框不为空时显示、`none`-一直不显示 | +|cancelButton |String |auto |是否显示取消按钮,可选值`always`-一直显示、`auto`-输入框不为空时显示、`none`-一直不显示 | +|cancelText |String |取消 |取消按钮的文字 | +|bgColor |String |#F8F8F8|输入框背景颜色 | +|maxlength |Number |100 |输入最大长度 | +|focus |Boolean |false | | + + +### SearchBar Events + +|事件称名 |说明 |返回参数 | +|:-: |:-: |:-: | +|@confirm |uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value |e={value:Number} | +|@input |uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的value|e=value | +|@cancel |点击取消按钮时触发事件,返回参数为uniSearchBar的value |e={value:Number} | +|@clear |点击清除按钮时触发事件,返回参数为uniSearchBar的value |e={value:Number} | +|@focus |input 获取焦点时触发事件,返回参数为uniSearchBar的value |e={value:Number} | +|@blur |input 失去焦点时触发事件,返回参数为uniSearchBar的value |e={value:Number} | + +### 替换 icon 的 slot 插槽 + +|插槽称名 |说明 | +|:-: |:-: | +|searchIcon |替换组件的搜索图标| +|clearIcon |替换组件的清除图标| + +```html + + + + + + + + X + + +``` + + +## 组件示例 + +点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/search-bar/search-bar](https://hellouniapp.dcloud.net.cn/pages/extUI/search-bar/search-bar) \ No newline at end of file diff --git a/uview-ui/LICENSE b/uview-ui/LICENSE new file mode 100644 index 0000000..8e39ead --- /dev/null +++ b/uview-ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 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. \ No newline at end of file diff --git a/uview-ui/README.md b/uview-ui/README.md new file mode 100644 index 0000000..06d5676 --- /dev/null +++ b/uview-ui/README.md @@ -0,0 +1,106 @@ +

+ logo +

+

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应用到您的产品中。 diff --git a/uview-ui/components/u-action-sheet/u-action-sheet.vue b/uview-ui/components/u-action-sheet/u-action-sheet.vue new file mode 100644 index 0000000..722b668 --- /dev/null +++ b/uview-ui/components/u-action-sheet/u-action-sheet.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/uview-ui/components/u-alert-tips/u-alert-tips.vue b/uview-ui/components/u-alert-tips/u-alert-tips.vue new file mode 100644 index 0000000..e81fc37 --- /dev/null +++ b/uview-ui/components/u-alert-tips/u-alert-tips.vue @@ -0,0 +1,256 @@ + + + + + diff --git a/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue new file mode 100644 index 0000000..a48dd54 --- /dev/null +++ b/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue @@ -0,0 +1,290 @@ + + + + + diff --git a/uview-ui/components/u-avatar-cropper/weCropper.js b/uview-ui/components/u-avatar-cropper/weCropper.js new file mode 100644 index 0000000..df02483 --- /dev/null +++ b/uview-ui/components/u-avatar-cropper/weCropper.js @@ -0,0 +1,1265 @@ +/** + * 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; + +}))); diff --git a/uview-ui/components/u-avatar/u-avatar.vue b/uview-ui/components/u-avatar/u-avatar.vue new file mode 100644 index 0000000..289b9b0 --- /dev/null +++ b/uview-ui/components/u-avatar/u-avatar.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/uview-ui/components/u-back-top/u-back-top.vue b/uview-ui/components/u-back-top/u-back-top.vue new file mode 100644 index 0000000..7970fc7 --- /dev/null +++ b/uview-ui/components/u-back-top/u-back-top.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/uview-ui/components/u-badge/u-badge.vue b/uview-ui/components/u-badge/u-badge.vue new file mode 100644 index 0000000..e85b133 --- /dev/null +++ b/uview-ui/components/u-badge/u-badge.vue @@ -0,0 +1,216 @@ + + + + + \ No newline at end of file diff --git a/uview-ui/components/u-button/u-button.vue b/uview-ui/components/u-button/u-button.vue new file mode 100644 index 0000000..82c3a6f --- /dev/null +++ b/uview-ui/components/u-button/u-button.vue @@ -0,0 +1,596 @@ + + + + + diff --git a/uview-ui/components/u-calendar/u-calendar.vue b/uview-ui/components/u-calendar/u-calendar.vue new file mode 100644 index 0000000..2b30184 --- /dev/null +++ b/uview-ui/components/u-calendar/u-calendar.vue @@ -0,0 +1,639 @@ + + + + \ No newline at end of file diff --git a/uview-ui/components/u-car-keyboard/u-car-keyboard.vue b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue new file mode 100644 index 0000000..84b1467 --- /dev/null +++ b/uview-ui/components/u-car-keyboard/u-car-keyboard.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/uview-ui/components/u-card/u-card.vue b/uview-ui/components/u-card/u-card.vue new file mode 100644 index 0000000..a3cb2aa --- /dev/null +++ b/uview-ui/components/u-card/u-card.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/uview-ui/components/u-cell-group/u-cell-group.vue b/uview-ui/components/u-cell-group/u-cell-group.vue new file mode 100644 index 0000000..3fbca72 --- /dev/null +++ b/uview-ui/components/u-cell-group/u-cell-group.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/uview-ui/components/u-cell-item/u-cell-item.vue b/uview-ui/components/u-cell-item/u-cell-item.vue new file mode 100644 index 0000000..055af3a --- /dev/null +++ b/uview-ui/components/u-cell-item/u-cell-item.vue @@ -0,0 +1,316 @@ + + + + + diff --git a/uview-ui/components/u-checkbox-group/u-checkbox-group.vue b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue new file mode 100644 index 0000000..6a149b3 --- /dev/null +++ b/uview-ui/components/u-checkbox-group/u-checkbox-group.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/uview-ui/components/u-checkbox/u-checkbox.vue b/uview-ui/components/u-checkbox/u-checkbox.vue new file mode 100644 index 0000000..9414461 --- /dev/null +++ b/uview-ui/components/u-checkbox/u-checkbox.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/uview-ui/components/u-circle-progress/u-circle-progress.vue b/uview-ui/components/u-circle-progress/u-circle-progress.vue new file mode 100644 index 0000000..46e7c18 --- /dev/null +++ b/uview-ui/components/u-circle-progress/u-circle-progress.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue b/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue new file mode 100644 index 0000000..77e2da2 --- /dev/null +++ b/uview-ui/components/u-circle-progress/u-line-progress/u-line-progress.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/uview-ui/components/u-col/u-col.vue b/uview-ui/components/u-col/u-col.vue new file mode 100644 index 0000000..3b6cc64 --- /dev/null +++ b/uview-ui/components/u-col/u-col.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/uview-ui/components/u-collapse-item/u-collapse-item.vue b/uview-ui/components/u-collapse-item/u-collapse-item.vue new file mode 100644 index 0000000..3b66bfa --- /dev/null +++ b/uview-ui/components/u-collapse-item/u-collapse-item.vue @@ -0,0 +1,204 @@ + + + + + diff --git a/uview-ui/components/u-collapse/u-collapse.vue b/uview-ui/components/u-collapse/u-collapse.vue new file mode 100644 index 0000000..8572957 --- /dev/null +++ b/uview-ui/components/u-collapse/u-collapse.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/uview-ui/components/u-column-notice/u-column-notice.vue b/uview-ui/components/u-column-notice/u-column-notice.vue new file mode 100644 index 0000000..dd8bd31 --- /dev/null +++ b/uview-ui/components/u-column-notice/u-column-notice.vue @@ -0,0 +1,237 @@ + + + + + diff --git a/uview-ui/components/u-count-down/u-count-down.vue b/uview-ui/components/u-count-down/u-count-down.vue new file mode 100644 index 0000000..7285d67 --- /dev/null +++ b/uview-ui/components/u-count-down/u-count-down.vue @@ -0,0 +1,318 @@ + + + + + diff --git a/uview-ui/components/u-count-to/u-count-to.vue b/uview-ui/components/u-count-to/u-count-to.vue new file mode 100644 index 0000000..053dc5f --- /dev/null +++ b/uview-ui/components/u-count-to/u-count-to.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/uview-ui/components/u-divider/u-divider.vue b/uview-ui/components/u-divider/u-divider.vue new file mode 100644 index 0000000..6f8d7e6 --- /dev/null +++ b/uview-ui/components/u-divider/u-divider.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/uview-ui/components/u-dropdown-item/u-dropdown-item.vue b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue new file mode 100644 index 0000000..ba60d8f --- /dev/null +++ b/uview-ui/components/u-dropdown-item/u-dropdown-item.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/uview-ui/components/u-dropdown/u-dropdown.vue b/uview-ui/components/u-dropdown/u-dropdown.vue new file mode 100644 index 0000000..a62e469 --- /dev/null +++ b/uview-ui/components/u-dropdown/u-dropdown.vue @@ -0,0 +1,298 @@ + + + + + diff --git a/uview-ui/components/u-empty/u-empty.vue b/uview-ui/components/u-empty/u-empty.vue new file mode 100644 index 0000000..2c77b24 --- /dev/null +++ b/uview-ui/components/u-empty/u-empty.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/uview-ui/components/u-field/u-field.vue b/uview-ui/components/u-field/u-field.vue new file mode 100644 index 0000000..b562798 --- /dev/null +++ b/uview-ui/components/u-field/u-field.vue @@ -0,0 +1,384 @@ +