项目初始化

master
王兵 3 years ago
parent 703e127d2c
commit 4b8f7b8cfc

@ -0,0 +1,26 @@
<script>
import pageAnimation from './components/page-animation'
export default {
//
mixins: [pageAnimation],
// globalDatauView
globalData: {
username: '白居易'
},
onLaunch() {
// 1.1.0http/common/http.interceptor.js
// /main.jsVue()
// import httpInterceptor from '@/common/http.interceptor.js'
// Vue.use(httpInterceptor, app)
// process.env.VUE_APP_PLATFORM js
/**
* h5app-plus(nvue下也为app-plus)mp-weixinmp-alipay......
*/
},
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
@import "common/global.scss";
</style>

@ -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.

@ -0,0 +1,137 @@
<p align="center">
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
</p>
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3>
<h3 align="center">多平台快速开发的UI框架</h3>
[![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)
### 官方1群1042987248已满
### 官方2群249718512已满
### 官方3群1129077272已满
### 官方4群1084514613已满
### 官方5群863820668已满
### [点击加6群交流反馈745721078](https://qm.qq.com/cgi-bin/qm/qr?k=nSvu1k6AFqHVvZhgN9FEavJPXIMyYCxY&jump_from=webapi)
## 特性
- 兼容安卓iOS微信小程序H5QQ小程序百度小程序支付宝小程序头条小程序
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
- 众多贴心的JS利器让您飞镖在手召之即来百步穿杨
- 众多的常用页面和布局,让您专注逻辑,事半功倍
- 详尽的文档支持,现代化的演示效果
- 按需引入,精简打包体积
## 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<br>
<br>
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
## 友情链接
#### **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/)
<br>
## 链接
- [官方文档](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 */
<style lang="scss">
@import "uview-ui/index.scss";
</style>
```
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
<template>
<u-button>按钮</u-button>
</template>
```
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
## 捐赠uView的研发
uView文档内容和框架源码全部开源免费如果您认为uView帮到了您的开发工作您可以捐赠uView的研发工作捐赠无门槛哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
<img src="https://uviewui.com/common/wechat.png" width="220" >
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" >
## 版权信息
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议意味着您无需支付任何费用也无需授权即可将uView应用到您的产品中。

File diff suppressed because it is too large Load Diff

@ -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 */

@ -0,0 +1,22 @@
// 如果没有通过拦截器配置域名的话可以在这里写上完整的URL(加上域名部分)
let hotSearchUrl = '/ebapi/store_api/hot_search';
let indexUrl = '/ebapi/public_api/index';
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作更多内容详见uView对拦截器的介绍部分
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
// 此处没有使用传入的params参数
let getSearch = (params = {}) => vm.$u.get(hotSearchUrl, {
id: 2
});
// 此处使用了传入的params参数一切自定义即可
let getInfo = (params = {}) => vm.$u.post(indexUrl, params);
// 将各个定义的接口名称统一放进对象挂载到vm.$u.api(因为vm就是this也即this.$u.api)下
vm.$u.api = {getSearch, getInfo};
}
export default {
install
}

@ -0,0 +1,46 @@
// 这里的vm就是我们在vue文件里面的this所以我们能在这里获取vuex的变量比如存放在里面的token
// 同时我们也可以在此使用getApp().globalData如果你把token放在getApp().globalData的话也是可以使用的
const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://api.youzixy.com',
// 如果将此值设置为true拦截回调中将会返回服务端返回的所有数据response而不是response.data
// 设置为true后就需要在this.$u.http.interceptor.response进行多一次的判断请打印查看具体值
// originalData: true,
// 设置自定义头部content-type
// header: {
// 'content-type': 'xxx'
// }
});
// 请求拦截配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => {
config.header.Token = 'xxxxxx';
// 方式一存放在vuex的token假设使用了uView封装的vuex方式https://uviewui.com/components/globalVariable.html
// config.header.token = vm.token;
// 方式二如果没有使用uView封装的vuex方法那么需要使用$store.state获取
// config.header.token = vm.$store.state.token;
// 方式三如果token放在了globalData通过getApp().globalData获取
// config.header.token = getApp().globalData.username;
// 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token');
// config.header.token = token;
return config;
}
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
// 如果把originalData设置为了true这里得到将会是服务器返回的所有的原始数据
// 判断可能变成了res.statueCode或者res.data.code之类的请打印查看结果
if(res.code == 200) {
// 如果把originalData设置为了true这里return回什么this.$u.post的then回调中就会得到什么
return res.data;
} else return false;
}
}
export default {
install
}

@ -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"
}]
}
]
}

@ -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',
},
}

@ -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',
},
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,49 @@
<template>
<view style="width: 100%;">
<u-input :value="value" type="select" @click="show = true" :placeholder="placeholder"/>
<u-action-sheet :list="dataC" v-model="show" @click="actionSheetCallback"></u-action-sheet>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
data:{
type:Array,
default:[]
},
placeholder: {
type: String,
default: '请选择'
}
},
computed:{
dataC(){
var d = [];
this.data.forEach(item => {
d.push({
text:item
})
})
return d;
}
},
data() {
return {
show: false
}
},
methods: {
actionSheetCallback(index) {
this.$emit("input", this.data[index])
}
},
}
</script>
<style>
</style>

@ -0,0 +1,51 @@
<template>
<view style="width: 100%;">
<u-input :value="value" type="select" @click="show = true" :placeholder="placeholder"/>
<u-picker mode="region" v-model="show" :area-code='areaCode' @confirm="onConfirm"></u-picker>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
areaCode: {
type: Array,
default: function() {
["11", "1101", "110101"]
}
},
valueFor: {
type: String,
default: "address"
},
placeholder: {
type: String,
default: '请选择'
}
},
data() {
return {
show: false
}
},
methods: {
onConfirm(params) {
let p = params['province'];
let c = params['city'];
let a = params['area'];
if (this.valueFor == 'address') {
this.$emit("input", p.label + "," + c.label + "," + a.label);
}else if (this.valueFor == 'code') {
this.$emit("input", p.value + "," + c.value + "," + a.value);
}
}
},
}
</script>
<style>
</style>

@ -0,0 +1,34 @@
<template>
<view>
<u-input :value="value" disabled :placeholder="placeholder" @change="selectDate" @click="showDaCalendar = true" />
<u-calendar v-model="showDaCalendar" mode="date" max-date="2050-01-01" @change="selectDate"></u-calendar>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: '请选择'
}
},
data() {
return {
showDaCalendar: false
}
},
methods: {
selectDate(date) {
this.$emit("input", date.result)
}
},
}
</script>
<style>
</style>

@ -0,0 +1,41 @@
<template>
<view style="width: 100%;">
<u-input type="select" :value="value" @click="show = true"></u-input>
<u-calendar v-model="show" :mode="'range'" @change="change"></u-calendar>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: '请选择'
},
},
data() {
return {
show: false
}
},
methods: {
change(data) {
let range = data[0].value + "-" + data[1].value + this.separator + data[2].value + "-" + data[3].value;
console.log(range)
this.$emit("input", range)
},
},
mounted() {
}
}
</script>
<style>
</style>

@ -0,0 +1,100 @@
<template>
<view style="width: 100%;">
<u-input type="select" :value="value" @click="show = true"></u-input>
<u-select v-model="show" mode="mutil-column" :default-value="defaultValueC" :list="data" @confirm="onConfirm" cancel="onCancel">
</u-select>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: '请选择'
},
defaultValue: {
type: Array,
default: null
}
},
computed: {
defaultValueC() {
let y1i = 0;
let m1i = 0;
if (this.data.length == 0) {
return [y1i, m1i];
}
if (this.defaultValue != null) {
y1i = this.getIndex(this.defaultValue[0],this.data[0]);
m1i = this.getIndex(this.defaultValue[1],this.data[1]);
} else {
y1i = this.getIndex(('' + new Date().getFullYear()),this.data[0]);
m1i = 0;
}
return [y1i, m1i];
}
},
data() {
return {
show: false,
data: []
}
},
methods: {
onConfirm(data) {
let range = data[0].value + "-" + data[1].value;
this.$emit("input", range)
},
onCancel(){
},
getIndex(s,d){
let index = 0
d.forEach((item,i) => {
if(item.value == s){
index = i;
}
})
return index;
}
},
mounted() {
var yyyy = new Date().getFullYear();
let y1 = [{
label: ('' + yyyy),
value: ('' + yyyy)
}];
for (let i = 1; i < 50; i++) {
y1.splice(0, 0, {
label: '' + (yyyy - i),
value: '' + (yyyy - i),
})
y1.push({
label: '' + (yyyy + i),
value: '' + (yyyy + i),
})
}
let m1 = [];
for (let i = 1; i < 13; i++) {
m1.push({
label: i < 10 ? ('0' + i) : i,
value: i < 10 ? ('0' + i) : i,
})
}
this.data.push(y1);
this.data.push(m1);
}
}
</script>
<style>
</style>

@ -0,0 +1,126 @@
<template>
<view style="width: 100%;">
<u-input type="select" :value="value" @click="show = true" :placeholder="placeholder"></u-input>
<u-select v-model="show" mode="mutil-column" :default-value="defaultValueC" :list="data" @confirm="onConfirm">
</u-select>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: '请选择'
},
separator: {
type: String,
default: '~'
},
defaultValue: {
type: Array,
default: null
}
},
computed: {
defaultValueC() {
let y1i = 0;
let m1i = 0;
let y2i = 0;
let m2i = 0;
if (this.data.length == 0) {
return [y1i, m1i, y2i, m2i];
}
if (this.defaultValue != null) {
y1i = this.getIndex(this.defaultValue[0],this.data[0]);
m1i = this.getIndex(this.defaultValue[1],this.data[1]);
y2i = this.getIndex(this.defaultValue[2],this.data[2]);
m2i = this.getIndex(this.defaultValue[3],this.data[3]);
} else {
y1i = this.getIndex(('' + new Date().getFullYear()),this.data[0]);
m1i = 0;
y2i = this.getIndex(('' + new Date().getFullYear()),this.data[2]);
m2i = 0;
}
return [y1i, m1i, y2i, m2i];
}
},
data() {
return {
show: false,
data: []
}
},
methods: {
onConfirm(data) {
let range = data[0].value + "-" + data[1].value + this.separator + data[2].value + "-" + data[3].value;
console.log(range)
this.$emit("input", range)
},
getIndex(s,d){
let index = 0
d.forEach((item,i) => {
if(item.value == s){
index = i;
}
})
return index;
}
},
mounted() {
var yyyy = new Date().getFullYear();
let y1 = [{
label: ('' + yyyy),
value: ('' + yyyy)
}];
let y2 = [{
label: ('' + yyyy),
value: ('' + yyyy)
}];
for (let i = 1; i < 50; i++) {
y1.splice(0, 0, {
label: '' + (yyyy - i),
value: '' + (yyyy - i),
})
y1.push({
label: '' + (yyyy + i),
value: '' + (yyyy + i),
})
y2.splice(0, 0, {
label: '' + (yyyy - i),
value: '' + (yyyy - i),
})
y2.push({
label: '' + (yyyy + i),
value: '' + (yyyy + i),
})
}
let m1 = [];
let m2 = [];
for (let i = 1; i < 13; i++) {
m1.push({
label: i < 10 ? ('0' + i) : i,
value: i < 10 ? ('0' + i) : i,
})
m2.push({
label: i < 10 ? ('0' + i) : i,
value: i < 10 ? ('0' + i) : i,
})
}
this.data.push(y1);
this.data.push(m1);
this.data.push(y2);
this.data.push(m2);
}
}
</script>
<style>
</style>

@ -0,0 +1,51 @@
<template>
<view style="width: 100%;">
<u-input :value="value" type="select" @click="show = true" :placeholder="placeholder" />
<u-select v-model="show" mode="single-column" :list="dataC" @confirm="confirm" />
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
data: {
type: Array,
default: []
},
placeholder: {
type: String,
default: '请选择'
}
},
computed: {
dataC() {
var d = [];
this.data.forEach(item => {
d.push({
label: item,
value: item
})
})
return d;
}
},
data() {
return {
show: false
}
},
methods: {
confirm(e) {
this.$emit("change", this.value, e[0].value)
this.$emit("input", e[0].value)
}
},
}
</script>
<style>
</style>

@ -0,0 +1,201 @@
<template>
<view style="padding: 10rpx 0;">
<view class="card flex v" v-if="!value" @click="sheetShow = true">
<u-icon name="plus" color="#838383" size="34"></u-icon>
<text>选择文件</text>
</view>
<view class="card flex v" v-if="value" @click="sheetShow = true">
<u-image width="100%" height="300rpx" :src="src">
<view slot="error">
<u-icon name="file-text" color="#838383" size="34"></u-icon>
</view>
</u-image>
</view>
<text v-if="!isUpload && !value && placeholder">{{placeholder}}</text>
<view v-if="isUpload">
<u-loading mode="circle"></u-loading>
<text>上传中</text>
</view>
<u-action-sheet :list="sheetData" v-model="sheetShow" @click="clickSheet"></u-action-sheet>
</view>
</template>
<script>
import config from '../../api/config.js'
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: null
}
},
data() {
return {
isUpload: false,
sheetShow: false
}
},
computed: {
src() {
console.log(config.baseURL + '/filePreview?filePath=' + this.value)
return config.baseURL + '/filePreview?filePath=' + this.value;
},
sheetData() {
if (!this.value) {
return [{
text: '照片'
}, {
text: '视频'
}, {
text: '文件'
}]
} else {
return [{
text: '照片'
}, {
text: '视频'
}, {
text: '文件'
}, {
text: '删除'
}]
}
}
},
methods: {
onUpload(file) { // File
this.isUpload = true;
let form = new FormData();
form.append("file", file)
this.$axios.post('/uploadFiles', form)
.then(response => {
this.isUpload = false;
if (response.code != 0) {
this.e("上传失败")
return;
}
this.$emit("change", response.message, this.value)
this.$emit("input", response.message)
})
.catch(error => {
this.isUpload = false;
this.e(JSON.stringify(error))
});
},
onUpload2(fileBase64, fileName) {// base64
// alert(fileBase64)
this.isUpload = true;
let form = new FormData();
form.append("fileBase64", fileBase64)
form.append("fileName", fileName)
this.$axios.post('/uploadFiles', form)
.then(response => {
// alert(JSON.stringify(response));
this.isUpload = false;
if (response.code != 0) {
this.e("上传失败")
return;
}
this.$emit("change", response.message, this.value)
this.$emit("input", response.message)
})
.catch(error => {
// alert(JSON.stringify(error));
this.isUpload = false;
this.e(JSON.stringify(error))
});
},
clickSheet(index) {
switch (index) {
case 0:
if (this.getProp('isInit')) {
sc.isExistApi({
path: 'chooseImage'
},
(res) => {
sc.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera']
},
(res) => {
if (res.code != 0) {
this.e('选择照片出错')
return;
}
this.onUpload2(res.data[0], new Date().getTime() + ".jpg");
}
);
}
);
} else {
this.defaultFileSelect();
}
break
case 1:
if (this.getProp('isInit')) {
sc.isExistApi({
path: 'chooseImage'
},
(res) => {
sc.chooseVideo({
compressed: true,
maxDuration: 30,
sourceType: ['album', 'camera'],
camera: 'back'
},
function(res) {
if (res.code != 0) {
this.e('选择视频出错')
return;
}
this.onUpload2(res.data.videoData,new Date().getTime() + ".mp4");
}
);
}
);
} else {
this.defaultFileSelect();
}
break
case 2:
this.defaultFileSelect();
break
case 3:
this.$emit("change", null, this.value)
this.$emit("input", null)
break
}
},
defaultFileSelect() {
var input = document.createElement('input');
input.style.display = 'none';
input.type = "file";
document.body.appendChild(input);
input.dispatchEvent(new MouseEvent('click'));
input.onchange = function (ev) {
this.onUpload(ev.target.files[0])
document.body.removeChild(input);
}.bind(this)
}
}
}
</script>
<style lang="less">
.card {
overflow: hidden;
background: #eee;
border-radius: 6px;
height: 200rpx;
width: 200rpx;
}
</style>

@ -0,0 +1,87 @@
<template>
<view style="width: 100%;">
<u-input type="select" :value="value" @click="show = true"></u-input>
<u-select v-model="show" mode="mutil-column" :default-value="defaultValueC" :list="data" @confirm="onConfirm" cancel="onCancel">
</u-select>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
placeholder: {
type: String,
default: '请选择'
},
defaultValue: {
type: Array,
default: null
}
},
computed: {
defaultValueC() {
let y1i = 0;
if (this.data.length == 0) {
return [y1i];
}
if (this.defaultValue != null) {
y1i = this.getIndex(this.defaultValue[0],this.data[0]);
} else {
y1i = this.getIndex(('' + new Date().getFullYear()),this.data[0]);
}
return [y1i];
}
},
data() {
return {
show: false,
data: []
}
},
methods: {
onConfirm(data) {
this.$emit("input", data[0].value)
},
onCancel(){
},
getIndex(s,d){
let index = 0
d.forEach((item,i) => {
if(item.value == s){
index = i;
}
})
return index;
}
},
mounted() {
var yyyy = new Date().getFullYear();
let y1 = [{
label: ('' + yyyy),
value: ('' + yyyy)
}];
for (let i = 1; i < 50; i++) {
y1.splice(0, 0, {
label: '' + (yyyy - i),
value: '' + (yyyy - i),
})
y1.push({
label: '' + (yyyy + i),
value: '' + (yyyy + i),
})
}
this.data.push(y1);
}
}
</script>
<style>
</style>

@ -0,0 +1,66 @@
<template>
<view style="width: 100%;">
<u-radio-group :value="cvalue" @change="onChange">
<u-radio key="1" :name="1">{{labelYes}}
</u-radio>
<u-radio key="2" :name="2">{{labelNo}}
</u-radio>
</u-radio-group>
</view>
</template>
<script>
export default {
props: {
value: {
type: Boolean | String | Number,
default: null
},
valueYes: {
type: Boolean | String | Number,
default: true
},
valueNo: {
type: Boolean | String | Number,
default: false
},
labelYes: {
type: String,
default: '是'
},
labelNo: {
type: String,
default: '否'
}
},
computed: {
cvalue() {
if (this.value == this.valueYes) {
return 1;
} else if (this.value == this.valueNo) {
return 2;
} else {
return null;
}
}
},
data() {
return {
}
},
methods: {
onChange(value) {
if (value == 1) {
this.$emit("input", this.valueYes)
} else if (value == 2) {
this.$emit("input", this.valueNo)
}
}
},
}
</script>
<style>
</style>

@ -0,0 +1,28 @@
/* #ifdef H5 */
uni-page {
opacity: 0;
}
uni-page.animation-before {
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute需要在动画完成后移除 */
transform: translateY(20px);
}
uni-page.animation-leave {
transition: all .3s ease;
}
uni-page.animation-enter {
transition: all .3s ease;
}
uni-page.animation-show {
opacity: 1;
}
uni-page.animation-after {
/* 在页面上使用 transform 会导致页面内的 fixed 定位渲染为 absolute需要在动画完成后移除 */
transform: translateY(0);
}
/* #endif */

@ -0,0 +1,37 @@
<script>
import './index.css'
export default {
// #ifdef H5
onLaunch: function() {
this.show()
this.$router.beforeEach((to, from, next) => {
this.hide(next)
})
this.$router.afterEach(() => {
setTimeout(this.show, 50)
})
},
methods: {
hide(callback) {
const classList = document.querySelector('uni-page').classList
classList.add('animation-before', 'animation-leave')
classList.remove('animation-show')
setTimeout(() => {
classList.remove('animation-before', 'animation-leave')
callback && callback()
}, 300)
},
show() {
const classList = document.querySelector('uni-page').classList
classList.add('animation-before')
setTimeout(() => {
classList.add('animation-enter', 'animation-after', 'animation-show')
setTimeout(() => {
classList.remove('animation-before', 'animation-after', 'animation-enter')
}, 300)
}, 20)
}
},
// #endif
}
</script>

@ -0,0 +1,98 @@
<template>
<view class="nav-wrap">
<view class="nav-title">
<image class="logo" src="https://cdn.uviewui.com/uview/common/logo.png" mode="widthFix"></image>
<view class="nav-info">
<view class="nav-title__text">
{{$t('common.title')}}
</view>
<view class="nav-slogan">
{{$t('common.intro')}}
</view>
</view>
</view>
<view class="nav-desc">
{{desc}}
</view>
<view class="lang" @tap="switchLang">
<u-icon size="46" color="warning" :name="lang"></u-icon>
</view>
</view>
</template>
<script>
export default {
props: {
desc: String,
title: String,
},
computed: {
lang() {
return this.$i18n.locale == 'zh' ? 'zh' : 'en';
}
},
methods: {
switchLang() {
this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
this.vuex_tabbar[0].text = this.$t('nav.components')
this.vuex_tabbar[1].text = this.$t('nav.js')
this.vuex_tabbar[2].text = this.$t('nav.template')
uni.setNavigationBarTitle({
title: this.$t(this.title)
});
}
}
}
</script>
<style lang="scss" scoped>
.nav-wrap {
padding: 15px;
position: relative;
}
.lang {
position: absolute;
top: 15px;
right: 15px;
}
.nav-title {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
}
.nav-info {
margin-left: 15px;
}
.nav-title__text {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
color: $u-main-color;
font-size: 25px;
font-weight: bold;
}
.logo {
width: 70px;
/* #ifndef APP-NVUE */
height: auto;
/* #endif */
}
.nav-slogan {
color: $u-tips-color;
font-size: 14px;
}
.nav-desc {
margin-top: 10px;
font-size: 14px;
color: $u-content-color;
}
</style>

@ -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();

@ -0,0 +1,139 @@
{
"name" : "starter-uniapp-uview",
"appid" : "__UNI__CC00285",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.8.4",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
// APP-VUEAPP2.7.12
"optimization" : {
"subPackages" : true
},
"safearea" : {
"bottom" : {
"offset" : "none"
}
},
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"compilerVersion" : 3,
"modules" : {},
"distribute" : {
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
},
"ios" : {},
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : true,
"es6" : false,
"minified" : true,
"postcss" : true
},
"optimization" : {
"subPackages" : true
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true,
"component2" : true
},
"mp-qq" : {
"optimization" : {
"subPackages" : true
},
"appid" : ""
},
"mp-baidu" : {
"usingComponents" : true,
"appid" : ""
},
"mp-toutiao" : {
"usingComponents" : true,
"appid" : ""
},
"h5" : {
"template" : "template.h5.html",
"router" : {
"mode" : "hash",
"base" : "./"
},
"optimization" : {
"treeShaking" : {
"enable" : false
}
},
"title" : "starter-uniapp-uview"
}
}

13
package-lock.json generated

@ -0,0 +1,13 @@
{
"name": "uView",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"vue-i18n": {
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.20.0.tgz",
"integrity": "sha512-ZiAOoeR4d/JtKpbjipx3I80ey7cYG1ki5gQ7HwzWm4YFio9brA15BEYHjalEoBaEfzF5OBEZP+Y2MvAaWnyXXg=="
}
}
}

@ -0,0 +1,23 @@
{
"name": "uView",
"version": "1.0.0",
"description": "<p align=\"center\">\r <img alt=\"logo\" src=\"https://uviewui.com/common/logo.png\" width=\"120\" height=\"120\" style=\"margin-bottom: 10px;\">\r </p>\r <h3 align=\"center\" style=\"margin: 30px 0 30px;font-weight: bold;font-size:40px;\">uView</h3>\r <h3 align=\"center\">多平台快速开发的UI框架</h3>",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/YanxinNet/uView.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/YanxinNet/uView/issues"
},
"homepage": "https://github.com/YanxinNet/uView#readme",
"dependencies": {
"vue-i18n": "^8.20.0"
}
}

@ -0,0 +1,867 @@
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// "condition": { //
// "current": 0, //(list )
// "list": [{
// "name": "test", //
// "path": "pages/componentsC/test/index", //
// "query": "uuid=c4bba940-f69e-11ea-a419-6bafda9d095e&__id__=1" //onLoad
// }]
// },
"pages": [
// -
{
"path": "pages/example/components",
"style": {
"navigationBarTitleText": "组件"
}
},
// avatarCropper-
{
"path": "uview-ui/components/u-avatar-cropper/u-avatar-cropper",
"style": {
"navigationBarTitleText": "头像裁剪",
"navigationBarBackgroundColor": "#000000"
}
},
// -
{
"path": "pages/example/js",
"style": {
"navigationBarTitleText": "工具"
}
},
// -
{
"path": "pages/example/template",
"style": {
"navigationBarTitleText": "模板"
}
},
// fullScreen-
{
"path": "uview-ui/components/u-full-screen/u-full-screen",
"style": {
"navigationStyle": "custom",
"app-plus": {
"animationType": "fade-in",
"background": "transparent",
"backgroundColor": "rgba(0,0,0,0)",
"popGesture": "none"
}
}
}
],
"subPackages": [{
"root": "pages/componentsC",
"pages": [
// test-
{
"path": "test/index",
"style": {
"navigationBarTitleText": "Test"
// "navigationStyle": "custom" ,//
// "navigationBarTextStyle": "white" //
}
},
// gap-
{
"path": "gap/index",
"style": {
"navigationBarTitleText": "gap-间隔槽"
}
},
// subsection
{
"path": "subsection/index",
"style": {
"navigationBarTitleText": "subsection-分段器"
}
},
// section
{
"path": "section/index",
"style": {
"navigationBarTitleText": "section-查看更多"
}
},
// link
{
"path": "link/index",
"style": {
"navigationBarTitleText": "link-链接"
}
},
// mask
{
"path": "mask/index",
"style": {
"navigationBarTitleText": "mask-遮罩层"
}
},
// countTo
{
"path": "countTo/index",
"style": {
"navigationBarTitleText": "countTo-数字滚动"
}
},
// color
{
"path": "color/index",
"style": {
"navigationBarTitleText": "color-颜色"
}
},
// countDown
{
"path": "countDown/index",
"style": {
"navigationBarTitleText": "countDown-倒计时"
}
},
// progress
{
"path": "progress/index",
"style": {
"navigationBarTitleText": "progress-进度条"
}
},
// alertTips
{
"path": "alertTips/index",
"style": {
"navigationBarTitleText": "alertTips-警告提示"
}
},
// badge
{
"path": "badge/index",
"style": {
"navigationBarTitleText": "badge-徽标数"
}
},
// button
{
"path": "button/index",
"style": {
"navigationBarTitleText": "button-按钮"
}
},
// collapse
{
"path": "collapse/index",
"style": {
"navigationBarTitleText": "collapse-折叠面板"
}
},
// actionSheet
{
"path": "actionSheet/index",
"style": {
"navigationBarTitleText": "actionSheet-操作菜单"
}
},
// messageInput
{
"path": "messageInput/index",
"style": {
"navigationBarTitleText": "messageInput-验证码输入"
}
},
// popup
{
"path": "popup/index",
"style": {
"navigationBarTitleText": "popup-弹窗"
}
},
// listCell
{
"path": "cell/index",
"style": {
"navigationBarTitleText": "listCell-列表"
}
},
// numberBox
{
"path": "numberBox/index",
"style": {
"navigationBarTitleText": "numberBox-步进器"
}
},
// grid
{
"path": "grid/index",
"style": {
"navigationBarTitleText": "grid-宫格布局"
}
},
// layout
{
"path": "layout/index",
"style": {
"navigationBarTitleText": "layout-栅格布局"
}
},
//
{
"path": "loadmore/index",
"style": {
"navigationBarTitleText": "loadmore-加载更多"
}
}
]
},
{
"root": "pages/template",
"pages": [
// wxCenter 仿
{
"path": "wxCenter/index",
"style": {
"navigationBarTitleText": "wxCenter 仿微信个人中心",
"navigationStyle": "custom"
}
},
// keyboardPay
{
"path": "keyboardPay/index",
"style": {
"navigationBarTitleText": "keyboardPay 自定义键盘支付"
}
},
// douyin 仿
// {
// "path": "douyin/index",
// "style": {
// "navigationBarTitleText": "douyin 仿抖音"
// }
// },
// mallMenu
{
"path": "mallMenu/index2",
"style": {
"navigationBarTitleText": "mallMenu-商城分类"
}
},
// mallMenu
{
"path": "mallMenu/index1",
"style": {
"navigationBarTitleText": "mallMenu-商城分类"
}
},
// coupon
{
"path": "coupon/index",
"style": {
"navigationBarTitleText": "coupon-优惠券"
}
},
{
"path": "login/index",
"style": {
"navigationBarTitleText": "美团登录"
}
},
//
{
"path": "citySelect/index",
"style": {
"navigationBarTitleText": "城市选择"
}
},
// SubmitBar
{
"path": "submitBar/index",
"style": {
"navigationBarTitleText": "提交订单栏"
}
},
// comment
{
"path": "comment/index",
"style": {
"navigationBarTitleText": "评论"
}
},
// comment
{
"path": "comment/reply",
"style": {
"navigationBarTitleText": "评论详情"
}
},
// order
{
"path": "order/index",
"style": {
"navigationBarTitleText": "订单"
}
},
// login
{
"path": "login/code",
"style": {
"navigationBarTitleText": "登录获取验证码"
}
},
// address
{
"path": "address/index",
"style": {
"navigationBarTitleText": "用户地址"
}
},
// address
{
"path": "address/addSite",
"style": {
"navigationBarTitleText": "添加用户地址"
}
}
]
},
{
"root": "pages/library",
"pages": [
// debounce-
{
"path": "debounce/index",
"style": {
"navigationBarTitleText": "throttle | debounce-节流防抖"
}
},
// deepClone-
{
"path": "deepClone/index",
"style": {
"navigationBarTitleText": "deepClone-对象深度克隆"
}
},
// deepMerge-
{
"path": "deepMerge/index",
"style": {
"navigationBarTitleText": "deepMerge-对象深度合并"
}
},
// getRect-
{
"path": "getRect/index",
"style": {
"navigationBarTitleText": "getRect-元素节点"
}
},
// timeFrom-
{
"path": "timeFrom/index",
"style": {
"navigationBarTitleText": "timeFrom-多久之前"
}
},
// globalData-
{
"path": "globalVariable/globalData",
"style": {
"navigationBarTitleText": "globalData-全局变量"
}
},
// prototype-
{
"path": "globalVariable/prototype",
"style": {
"navigationBarTitleText": "prototype-全局变量"
}
},
// vuex-
{
"path": "globalVariable/vuex",
"style": {
"navigationBarTitleText": "vuex-全局变量"
}
},
// globalVariable-
{
"path": "globalVariable/index",
"style": {
"navigationBarTitleText": "globalVariable-全局变量"
}
},
// http-
{
"path": "http/index",
"style": {
"navigationBarTitleText": "http-请求"
}
},
// test-
{
"path": "test/index",
"style": {
"navigationBarTitleText": "test-规则验证"
}
},
// mpShare-
{
"path": "mpShare/index",
"style": {
"navigationBarTitleText": "mpShare-小程序分享"
}
},
// color-JS
{
"path": "color/index",
"style": {
"navigationBarTitleText": "color-JS调用颜色"
}
},
// trim-
{
"path": "trim/index",
"style": {
"navigationBarTitleText": "trim-去除空格"
}
},
// random-
{
"path": "random/index",
"style": {
"navigationBarTitleText": "random-随机数生成"
}
},
// md5
{
"path": "md5/index",
"style": {
"navigationBarTitleText": "md5-加密"
}
},
// colorSwitch
{
"path": "colorSwitch/index",
"style": {
"navigationBarTitleText": "colorSwitch-颜色转换"
}
},
// randomArray
{
"path": "randomArray/index",
"style": {
"navigationBarTitleText": "randomArray-数组乱序"
}
},
// guid
{
"path": "guid/index",
"style": {
"navigationBarTitleText": "guid-全局唯一标识符"
}
},
// timeFormat
{
"path": "timeFormat/index",
"style": {
"navigationBarTitleText": "timeFormat-时间格式化"
}
}, // route-
{
"path": "route/index",
"style": {
"navigationBarTitleText": "route-路由"
}
},
// route-
{
"path": "route/routeTo",
"style": {
"navigationBarTitleText": "route-路由跳转"
}
},
// queryParams-URL
{
"path": "queryParams/index",
"style": {
"navigationBarTitleText": "queryParams-对象转URL参数"
}
}
]
},
{
"root": "pages/componentsA",
"pages": [
// parse-
{
"path": "parse/index",
"style": {
"navigationBarTitleText": "parse-富文本解析器"
}
},
// backTop-
{
"path": "backTop/index",
"style": {
"navigationBarTitleText": "backTop-返回顶部"
}
},
// calendar-
{
"path": "calendar/index",
"style": {
"navigationBarTitleText": "calendar-日历"
}
},
// form-
{
"path": "form/index",
"style": {
"navigationBarTitleText": "form-表单"
}
},
// select-
{
"path": "select/index",
"style": {
"navigationBarTitleText": "select-列选择器"
}
},
// slider-
{
"path": "slider/index",
"style": {
"navigationBarTitleText": "slider-滑动选择器"
}
},
// fullScreen-
{
"path": "fullScreen/index",
"style": {
"navigationBarTitleText": "fullScreen-压窗屏"
}
},
// navbar-
{
"path": "navbar/index",
"style": {
// "navigationBarTitleText": "navbar-自定义导航栏",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" //
}
},
// field-
{
"path": "field/index",
"style": {
"navigationBarTitleText": "field-输入框"
}
},
// modal-
{
"path": "modal/index",
"style": {
"navigationBarTitleText": "modal-模态框"
}
},
// indexList
{
"path": "indexList/index",
"style": {
"navigationBarTitleText": "indexList-索引列表"
}
},
// empty
{
"path": "empty/index",
"style": {
"navigationBarTitleText": "empty-内容为空"
}
},
// avatarCropper-
{
"path": "avatarCropper/index",
"style": {
"navigationBarTitleText": "avatarCropper-头像裁剪"
}
}, // noNetwork
{
"path": "noNetwork/index",
"style": {
"navigationBarTitleText": "noNetwork-没有网络"
}
}, // icon
{
"path": "icon/index",
"style": {
"navigationBarTitleText": "icon-字体图标"
}
}, // avatar-
{
"path": "avatar/index",
"style": {
"navigationBarTitleText": "avatar-用户头像展示"
}
}, // keyboard
{
"path": "keyboard/index",
"style": {
"navigationBarTitleText": "keyboard-键盘"
}
}, //
{
"path": "lazyLoad/index",
"style": {
"navigationBarTitleText": "lazyLoad-懒加载"
}
},
// tabs
{
"path": "tabs/index",
"style": {
"navigationBarTitleText": "Tabs-切换"
}
},
// tag
{
"path": "tag/index",
"style": {
"navigationBarTitleText": "tag-标签"
}
},
// timeLine
{
"path": "timeLine/index",
"style": {
"navigationBarTitleText": "timeLine-时间轴"
}
},
// toast
{
"path": "toast/index",
"style": {
"navigationBarTitleText": "toast-轻提示"
}
},
// topTips
{
"path": "topTips/index",
"style": {
"navigationBarTitleText": "topTips-消息提示"
}
},
// Code-
{
"path": "verificationCode/index",
"style": {
"navigationBarTitleText": "Code-验证码倒计时"
}
}
]
},
{
"root": "pages/componentsB",
"pages": [
// dropdown-
{
"path": "dropdown/index",
"style": {
"navigationBarTitleText": "dropdown-下拉菜单"
}
},
// tabbar-
{
"path": "tabbar/index",
"style": {
"navigationBarTitleText": "tabbar-底部导航栏"
}
},
// line-线
{
"path": "line/index",
"style": {
"navigationBarTitleText": "line-线条"
}
},
// image-
{
"path": "image/index",
"style": {
"navigationBarTitleText": "image-图片"
}
},
// card-
{
"path": "card/index",
"style": {
"navigationBarTitleText": "card-卡片"
}
},
// divider-线
{
"path": "divider/index",
"style": {
"navigationBarTitleText": "divider-分割线"
}
},
// picker
{
"path": "picker/index",
"style": {
"navigationBarTitleText": "picker-选择器"
}
}, // noticeBar
{
"path": "noticeBar/index",
"style": {
"navigationBarTitleText": "noticeBar-通告栏"
}
},
// checkbox-
{
"path": "checkbox/index",
"style": {
"navigationBarTitleText": "checkbox-复选框"
}
},
// radio-
{
"path": "radio/index",
"style": {
"navigationBarTitleText": "radio-单选框"
}
},
// loading-
{
"path": "loading/index",
"style": {
"navigationBarTitleText": "loading-加载动画"
}
},
// switch-
{
"path": "switch/index",
"style": {
"navigationBarTitleText": "switch-开关选择器"
}
},
//
{
"path": "skeleton/index",
"style": {
"navigationBarTitleText": "skeleton-骨架屏"
}
}, // upload
{
"path": "upload/index",
"style": {
"navigationBarTitleText": "upload-上传"
}
},
// waterfall
// #ifndef MP-TOUTIAO
{
"path": "waterfall/index",
"style": {
"navigationBarTitleText": "waterfall-瀑布流"
}
},
// #endif
// table
{
"path": "table/index",
"style": {
"navigationBarTitleText": "table-表格"
}
},
// rate
{
"path": "rate/index",
"style": {
"navigationBarTitleText": "rate-评分"
}
},
// readMore
{
"path": "readMore/index",
"style": {
"navigationBarTitleText": "readMore-查看更多"
}
},
// search
{
"path": "search/index",
"style": {
"navigationBarTitleText": "search-搜索框"
}
},
// steps
{
"path": "steps/index",
"style": {
"navigationBarTitleText": "steps-步骤条"
}
},
// sticky
{
"path": "sticky/index",
"style": {
"navigationBarTitleText": "sticky-吸顶"
}
},
// swiper
{
"path": "swiper/index",
"style": {
"navigationBarTitleText": "swiper-轮播图"
}
},
// swipeAction-
{
"path": "swipeAction/index",
"style": {
"navigationBarTitleText": "swipeAction-左滑删除"
}
}
]
}
],
"preloadRule": {
"pages/example/components": {
"network": "all",
"packages": ["pages/componentsA", "pages/componentsB", "pages/componentsC"]
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uView",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF"
},
"tabBar": {
"color": "#909399",
"selectedColor": "#303133",
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [{
"pagePath": "pages/example/components",
"iconPath": "static/uview/example/component.png",
"selectedIconPath": "static/uview/example/component_select.png",
"text": "组件"
},
{
"pagePath": "pages/example/js",
"iconPath": "static/uview/example/js.png",
"selectedIconPath": "static/uview/example/js_select.png",
"text": "工具"
},
{
"pagePath": "pages/example/template",
"iconPath": "static/uview/example/template.png",
"selectedIconPath": "static/uview/example/template_select.png",
"text": "模板"
}
]
}
}

@ -0,0 +1,90 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-avatar
:mode="mode"
:size="size"
:src="src"
:text="text"
:showLevel="showLevel"
:showSex="showSex"
:sexIcon="sexIcon"
:bgColor='bgColor'
></u-avatar>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :list="['圆形', '圆角方形']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">性别选择</view>
<u-subsection :list="['男', '女', '不显示']" @change="sexChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">等级</view>
<u-subsection :list="['显示', '不显示']" @change="levelChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义内容</view>
<u-subsection current="0" :list="['图片', '文字']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸</view>
<u-subsection current="1" :list="['large', 'default', 'mini', 160]" @change="sizeChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: 'circle',
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
text: '', // src
size: '90',
showLevel: true,
showSex: true,
sexIcon: 'man',
bgColor: '#fcbd71'
}
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'circle' : 'square';
},
styleChange(index) {
if(index == 0) {
this.text = '';
this.src = 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg';
} else {
this.text = '无头像';
}
},
sizeChange(index) {
this.size = index == 0 ? 'large' : index == 1 ? 'default' : index == 2 ? 'mini' : 160;
},
sexChange(index) {
this.showSex = true;
if(index == 0) this.sexIcon = 'man';
if(index == 1) this.sexIcon = 'woman';
if(index == 2) this.showSex = false;
},
levelChange(index) {
this.showLevel = !index;
}
}
}
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,110 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="u-avatar-wrap">
<image @tap="preAvatar" class="u-avatar-demo" v-if="avatar" :src="avatar" mode="aspectFill"></image>
</view>
<u-button @click="chooseAvatar"></u-button>
</view>
</view>
<!-- <view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">生成图片质量</view>
<u-subsection :current="1" :list="['0.3', '0.7', '1']" @change="qualityChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义参数</view>
<u-subsection :current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
avatar: 'https://cdn.uviewui.com/uview/common/logo.png',
}
},
created() {
uni.$on('uAvatarCropper', path => {
this.avatar = path;
//
// uni.uploadFile({
// url: 'http://192.168.100.17/index.php/index/index/upload',
// filePath: path,
// name: 'file',
// complete: (res) => {
// console.log(res);
// }
// });
})
},
methods: {
chooseAvatar() {
this.$u.route({
url: '/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
params: {
// px
destWidth: 300,
// px
rectWidth: 200,
// 'png'"jpg"
fileType: 'jpg',
}
})
},
qualityChange(index) {
this.quality = index == 0 ? 0.3 : index == 1 ? 0.7 : 1;
},
styleChange(index) {
if (index == 0) {
this.rectHeight = this.rectWidth = this.destHeight = this.destWidth = 200;
this.boundStyle = {
lineWidth: 8,
borderColor: this.$u.color['error'],
mask: 'rgba(0, 0, 0, 0.8)'
}
} else {
this.rectHeight = this.rectWidth = this.destHeight = this.destWidth = 400;
this.boundStyle = {
lineWidth: 4,
borderColor: 'rgb(245, 245, 245)',
mask: 'rgba(0, 0, 0, 0.35)'
}
}
},
//
preAvatar() {
wx.previewImage({
current: '', // http
urls: [this.avatar] // http
})
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
.u-avatar-wrap {
overflow: hidden;
margin-bottom: 20rpx;
}
.u-avatar-demo {
width: 150rpx;
height: 150rpx;
border-radius: 100rpx;
}
</style>

@ -0,0 +1,105 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="u-no-demo-here">滚动页面即可在右下角看到返回顶部的按钮</view>
</view>
<u-back-top :scrollTop="scrollTop" :mode="mode"
:bottom="bottom" :right="right" :top="top" :icon="icon" :custom-style="customStyle"
:icon-style="iconStyle" :tips="tips"
>
</u-back-top>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection :list="['圆形', '方形']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">组件位置</view>
<u-subsection :list="['默认', '自定义']" @change="positionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示组件的滚动条距离</view>
<u-subsection current="1" :list="['200', '400', '600']" @change="scrollTopChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
scrollTop: 0,
mode: 'circle',
bottom: 200,
right: 40,
top: 400,
icon: 'arrow-upward',
iconStyle: {
color: '#909399',
fontSize: '38rpx'
},
customStyle: {},
tips: ''
}
},
methods: {
modeChange(index) {
this.mode = !index ? 'circle' : 'square';
},
positionChange(index) {
if(index == 0) {
this.bottom = 200;
this.right = 40;
} else {
this.bottom = 400;
this.right = 80;
}
},
scrollTopChange(index) {
this.top = [200, 400, 600][index];
},
styleChange(index) {
if(index == 0) {
this.icon = 'arrow-up';
this.iconStyle = {
color: '#2979ff',
fontSize: '34rpx'
};
this.customStyle = {
backgroundColor: '#a0cfff',
color: '#2979ff'
};
this.tips = '顶部';
} else {
this.icon = 'arrow-upward';
this.iconStyle = {
color: '#909399',
fontSize: '38rpx'
};
this.customStyle = {};
this.tips = '';
}
}
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
}
}
</script>
<style lang="scss" scoped>
.u-demo {
height: 200vh;
}
</style>

@ -0,0 +1,111 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap" style="background-color: #FFFFFF;">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-calendar v-model="show" ref="calendar" @change="change" :mode="mode"
:start-text="startText" :end-text="endText" :range-color="rangeColor"
:range-bg-color="rangeBgColor" :active-bg-color="activeBgColor" :btn-type="btnType"
>
</u-calendar>
<view class="u-demo-result-line">
{{result}}
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="showBtnStatus" :list="['显示', '隐藏']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection current="1" :list="['单个日期', '日期范围']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
mode: 'range',
result: "请选择日期",
startText: '开始',
endText: '结束',
rangeColor: '#2979ff',
rangeBgColor: 'rgba(41,121,255,0.13)',
activeBgColor: '#2979ff',
btnType: 'primary',
}
},
computed: {
showBtnStatus() {
return this.show ? 0 : 1;
}
},
methods: {
showChange(index) {
this.show = !index;
},
modeChange(index) {
this.mode = index == 0 ? 'date' : 'range';
this.show = true;
},
styleChange(index) {
if(index == 0) {
this.startText = '住店';
this.endText = '离店';
this.activeBgColor = '#19be6b';
this.rangeColor = '#19be6b';
this.rangeBgColor = 'rgba(25,190,107, 0.13)';
this.btnType = 'success';
} else {
this.startText = '开始';
this.endText = '结束';
this.activeBgColor = '#2979ff';
this.rangeColor = '#2979ff';
this.rangeBgColor = 'rgba(41,121,255,0.13)';
this.btnType = 'primary';
}
this.show = true;
},
customChange(index) {
if(index == 0) {
this.icon1 = 'map';
this.icon2 = 'photo';
this.arrow = true;
} else {
this.icon1 = '';
this.icon2 = '';
this.arrow = false;
}
},
textareaChange(index) {
this.type = index == 0 ? 'textarea' : 'text';
},
change(e) {
if (this.mode == 'range') {
this.result = e.startDate + " - " + e.endDate;
} else {
this.result = e.result;
}
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {
}
</style>

@ -0,0 +1,115 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-empty :mode="mode">
<u-button v-if="slot" slot="bottom" size="medium">
slot按钮
</u-button>
</u-empty>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-table>
<u-tr class="u-tr">
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('car')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('page')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('search')"></u-button>
</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('address')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('wifi')">WiFi</u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('order')"></u-button>
</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('coupon')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('favor')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('permission')"></u-button>
</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('history')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('news')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('message')"></u-button>
</u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('list')"></u-button>
</u-td>
<u-td class="u-td">
<u-button :hair-line="false" size="mini" @click="modeChange('data')"></u-button>
</u-td>
<u-td class="u-td">
待扩展
</u-td>
</u-tr>
</u-table>
</view>
<view class="u-config-item">
<view class="u-item-title">传入slot</view>
<u-subsection current="1" :list="['是', '否']" @change="slotChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: 'data',
slot: false
}
},
methods: {
modeChange(mode = 'data') {
this.mode = mode;
},
slotChange(index) {
this.slot = !index;
}
}
}
</script>
<style lang="scss" scoped>
.u-demo-area {
height: 160px;
display: flex;
align-items: center;
justify-content: center;
}
.u-demo-area .u-empty {
padding-top: 0;
}
</style>

@ -0,0 +1,103 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap" style="background-color: #FFFFFF;">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-field
v-model="mobile"
label="手机号"
:error-message="errorMessage"
placeholder="请填写手机号"
:required="required"
:icon="icon1"
:type="type"
>
</u-field>
<u-field
v-model="code"
label="验证码"
placeholder="请填写验证码"
:required="required"
:icon="icon2"
>
<u-button v-if="showBtn" slot="right" size="mini" type="success"></u-button>
</u-field>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">右侧按钮</view>
<u-subsection current="1" :list="['是', '否']" @change="showBtnChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示错误信息</view>
<u-subsection current="1" :list="['是', '否']" @change="errorMessageChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否必填</view>
<u-subsection current="1" :list="['是', '否']" @change="requiredChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示左图标和右箭头</view>
<u-subsection current="1" :list="['是', '否']" @change="customChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">第一个输入框为textarea类型</view>
<u-subsection current="1" :list="['是', '否']" @change="textareaChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mobile: '',
code: '',
errorMessage: '',
required: false,
placeholderColor: this.$u.color['tipsColor'],
arrow: false,
showBtn: false,
icon1: '',
icon2: '',
type: 'text',
}
},
methods: {
showBtnChange(index) {
this.showBtn = index == 0 ? true : false;
},
errorMessageChange(index) {
this.errorMessage = index == 0 ? '手机号有误' : false
},
requiredChange(index) {
this.required = index == 0 ? true : false;
},
customChange(index) {
if(index == 0) {
this.icon1 = 'map';
this.icon2 = 'photo';
this.arrow = true;
} else {
this.icon1 = '';
this.icon2 = '';
this.arrow = false;
}
},
textareaChange(index) {
this.type = index == 0 ? 'textarea' : 'text';
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {
}
</style>

@ -0,0 +1,454 @@
<template>
<view class="wrap">
<u-form :model="model" :rules="rules" ref="uForm" :errorType="errorType">
<u-form-item :leftIconStyle="{color: '#888', fontSize: '32rpx'}" left-icon="account" label-width="120" :label-position="labelPosition" label="姓名" prop="name">
<u-input :border="border" placeholder="请输入姓名" v-model="model.name" type="text"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="性别" prop="sex">
<u-input :border="border" type="select" :select-open="actionSheetShow" v-model="model.sex" placeholder="请选择性别" @click="actionSheetShow = true"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="简介" prop="intro">
<u-input type="textarea" :border="border" placeholder="请填写简介" v-model="model.intro" />
</u-form-item>
<u-form-item :label-position="labelPosition" label="密码" prop="password">
<u-input :password-icon="true" :border="border" type="password" v-model="model.password" placeholder="请输入密码"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="确认密码" label-width="150" prop="rePassword">
<u-input :border="border" type="password" v-model="model.rePassword" placeholder="请确认密码"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="水果品种" label-width="150" prop="likeFruit">
<u-checkbox-group @change="checkboxGroupChange" :width="radioCheckWidth" :wrap="radioCheckWrap">
<u-checkbox v-model="item.checked" v-for="(item, index) in checkboxList" :key="index" :name="item.name">{{ item.name }}</u-checkbox>
</u-checkbox-group>
</u-form-item>
<u-form-item :label-position="labelPosition" label="结算方式" prop="payType" label-width="150">
<u-radio-group v-model="radio" @change="radioGroupChange" :width="radioCheckWidth" :wrap="radioCheckWrap">
<u-radio shape="circle" v-for="(item, index) in radioList" :key="index" :name="item.name">{{ item.name }}</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item :label-position="labelPosition" label="所在地区" prop="region" label-width="150">
<u-input :border="border" type="select" :select-open="pickerShow" v-model="model.region" placeholder="请选择地区" @click="pickerShow = true"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="商品类型" prop="goodsType" label-width="150">
<u-input :border="border" type="select" :select-open="selectShow" v-model="model.goodsType" placeholder="请选择商品类型" @click="selectShow = true"></u-input>
</u-form-item>
<u-form-item :rightIconStyle="{color: '#888', fontSize: '32rpx'}" right-icon="kefu-ermai" :label-position="labelPosition" label="手机号码" prop="phone" label-width="150">
<u-input :border="border" placeholder="请输入手机号" v-model="model.phone" type="number"></u-input>
</u-form-item>
<u-form-item :label-position="labelPosition" label="验证码" prop="code" label-width="150">
<u-input :border="border" placeholder="请输入验证码" v-model="model.code" type="text"></u-input>
<u-button slot="right" type="success" size="mini" @click="getCode">{{codeTips}}</u-button>
</u-form-item>
<!-- 此处switch的slot为right如果不填写slot名也即<u-switch v-model="model.remember"></u-switch>将会左对齐 -->
<u-form-item :label-position="labelPosition" label="记住密码" prop="remember" label-width="150">
<u-switch v-model="model.remember" slot="right"></u-switch>
</u-form-item>
<u-form-item :label-position="labelPosition" label="上传图片" prop="photo" label-width="150">
<u-upload width="160" height="160"></u-upload>
</u-form-item>
</u-form>
<view class="agreement">
<u-checkbox v-model="check" @change="checkboxChange"></u-checkbox>
<view class="agreement-text">
勾选代表同意uView的版权协议
</view>
</view>
<u-button @click="submit"></u-button>
<u-action-sheet :list="actionSheetList" v-model="actionSheetShow" @click="actionSheetCallback"></u-action-sheet>
<u-select mode="single-column" :list="selectList" v-model="selectShow" @confirm="selectConfirm"></u-select>
<u-picker mode="region" v-model="pickerShow" @confirm="regionConfirm"></u-picker>
<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">label对齐方式</view>
<u-subsection :list="['左边', '上方']" @change="labelPositionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">边框</view>
<u-subsection :current="borderCurrent" :list="['显示', '隐藏']" @change="borderChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">radiocheckbox样式</view>
<u-subsection :list="['自适应', '换行', '50%宽度']" @change="radioCheckboxChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">错误提示方式</view>
<u-subsection :list="['message', 'toast', '下划线', '输入框']" @change="errorChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
let that = this;
return {
model: {
name: '',
sex: '',
likeFruit: '',
intro: '',
payType: '支付宝',
agreement: false,
region: '',
goodsType: '',
phone: '',
code: '',
password: '',
rePassword: '',
remember: false,
photo: ''
},
selectList: [
{
value: '电子产品',
label: '电子产品'
},
{
value: '服装',
label: '服装'
},
{
value: '工艺品',
label: '工艺品'
}
],
rules: {
name: [
{
required: true,
message: '请输入姓名',
trigger: 'blur' ,
},
{
min: 3,
max: 5,
message: '姓名长度在3到5个字符',
trigger: ['change','blur'],
},
{
// truefalse
validator: (rule, value, callback) => {
// uViewjshttps://www.uviewui.com/js/test.html
return this.$u.test.chinese(value);
},
message: '姓名必须为中文',
// blurchange
trigger: ['change','blur'],
},
//
// {
// trigger: ['blur'],
// // callback()new Error()
// // message
// asyncValidator: (rule, value, callback) => {
// this.$u.post('/ebapi/public_api/index').then(res => {
// // callback()new Error('')
// if(res.error) {
// callback(new Error(''));
// } else {
// // callback()
// callback();
// }
// })
// },
// }
],
sex: [
{
required: true,
message: '请选择性别',
trigger: 'change'
},
],
intro: [
{
required: true,
message: '请填写简介'
},
{
min: 5,
message: '简介不能少于5个字',
trigger: 'change' ,
},
// uViewthis.$u.test.chinese
{
pattern: /^[\u4e00-\u9fa5]+$/gi,
message: '简介只能为中文',
trigger: 'change',
},
],
likeFruit: [
{
required: true,
message: '请选择您喜欢的水果',
trigger: 'change',
type: 'array',
}
],
payType: [
{
required: true,
message: '请选择任意一种支付方式',
trigger: 'change',
}
],
region: [
{
required: true,
message: '请选择地区',
trigger: 'change',
}
],
goodsType: [
{
required: true,
message: '请选择商品类型',
trigger: 'change',
}
],
phone: [
{
required: true,
message: '请输入手机号',
trigger: ['change','blur'],
},
{
validator: (rule, value, callback) => {
// uViewjshttps://www.uviewui.com/js/test.html
return this.$u.test.mobile(value);
},
message: '手机号码不正确',
// blurchange
trigger: ['change','blur'],
}
],
code: [
{
required: true,
message: '请输入验证码',
trigger: ['change','blur'],
},
{
type: 'number',
message: '验证码只能为数字',
trigger: ['change','blur'],
}
],
password: [
{
required: true,
message: '请输入密码',
trigger: ['change','blur'],
},
{
//
pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+\S{5,12}$/,
message: '需同时含有字母和数字长度在6-12之间',
trigger: ['change','blur'],
}
],
rePassword: [
{
required: true,
message: '请重新输入密码',
trigger: ['change','blur'],
},
{
validator: (rule, value, callback) => {
return value === this.model.password;
},
message: '两次输入的密码不相等',
trigger: ['change','blur'],
}
],
},
border: false,
check: false,
selectStatus: 'close',
checkboxList: [
{
name: '荔枝',
checked: false,
disabled: false
},
{
name: '香蕉',
checked: false,
disabled: false
},
{
name: '橙子',
checked: false,
disabled: false
},
{
name: '草莓',
checked: false,
disabled: false
}
],
radioList: [
{
name: '支付宝',
checked: true,
disabled: false
},
{
name: '微信',
checked: false,
disabled: false
},
{
name: '银联',
checked: false,
disabled: false
},
{
name: '现金',
checked: false,
disabled: false
}
],
radio: '支付宝',
actionSheetList: [
{
text: '男'
},
{
text: '女'
},
{
text: '保密'
}
],
actionSheetShow: false,
pickerShow: false,
selectShow: false,
radioCheckWidth: 'auto',
radioCheckWrap: false,
labelPosition: 'left',
codeTips: '',
errorType: ['message'],
};
},
onLoad() {
},
computed: {
borderCurrent() {
return this.border ? 0 : 1;
}
},
onReady() {
this.$refs.uForm.setRules(this.rules);
},
methods: {
submit() {
this.$refs.uForm.validate(valid => {
if (valid) {
if(!this.model.agreement) return this.$u.toast('请勾选协议');
console.log('验证通过');
} else {
console.log('验证失败');
}
});
},
// actionSheet
actionSheetCallback(index) {
uni.hideKeyboard();
this.model.sex = this.actionSheetList[index].text;
},
// checkbox
checkboxGroupChange(e) {
this.model.likeFruit = e;
},
// radio
radioGroupChange(e) {
this.model.payType = e;
},
//
checkboxChange(e) {
this.model.agreement = e.value;
},
//
regionConfirm(e) {
this.model.region = e.province.label + '-' + e.city.label + '-' + e.area.label;
},
//
selectConfirm(e) {
this.model.goodsType = '';
e.map((val, index) => {
this.model.goodsType += this.model.goodsType == '' ? val.label : '-' + val.label;
})
},
borderChange(index) {
this.border = !index;
},
radioCheckboxChange(index) {
if(index == 0) {
this.radioCheckWrap = false;
this.radioCheckWidth = 'auto';
} else if(index == 1) {
this.radioCheckWrap = true;
this.radioCheckWidth = 'auto';
} else if(index == 2) {
this.radioCheckWrap = false;
this.radioCheckWidth = '50%';
}
},
labelPositionChange(index) {
this.labelPosition = index == 0 ? 'left' : 'top';
},
codeChange(text) {
this.codeTips = text;
},
//
getCode() {
if(this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码',
mask: true
})
setTimeout(() => {
uni.hideLoading();
// this.start()
this.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
} else {
this.$u.toast('倒计时结束后再发送');
}
},
errorChange(index) {
if(index == 0) this.errorType = ['message'];
if(index == 1) this.errorType = ['toast'];
if(index == 2) this.errorType = ['border-bottom'];
if(index == 3) this.errorType = ['border'];
}
}
};
</script>
<style scoped lang="scss">
.wrap {
padding: 30rpx;
}
.agreement {
display: flex;
align-items: center;
margin: 40rpx 0;
.agreement-text {
padding-left: 8rpx;
color: $u-tips-color;
}
}
</style>

@ -0,0 +1,49 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="u-no-demo-here">
通过压窗屏打开的模态框可以遮盖顶部原生的导航栏和底部tabbar栏
注意压窗屏只对APP有效其他端无效
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['打开', '关闭']" @change="openModal"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
current: 1
}
},
onShow() {
this.$nextTick(() => {
this.current = 1;
})
},
methods: {
openModal(index) {
//
if(index == 0) {
this.$u.route("/uview-ui/components/u-full-screen/u-full-screen?id=1");
}
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,652 @@
<template>
<view class="wrap">
<view class="u-border-left u-border-top inner-wrap">
<view @tap="selectIcon(item.name)" class="u-icon-item u-border-bottom u-border-right" v-for="(item, index) in iconList" :key="index">
<u-icon :name="item.name" size="40" color="#909399"></u-icon>
<text class="u-icon-name">{{item.name}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
iconList: [
{
name: 'level'
},
{
name: 'woman'
},
{
name: 'man'
},
{
name: 'arrow-left-double'
},
{
name: 'arrow-right-double'
},
{
name: 'chat'
},
{
name: 'chat-fill'
},
{
name: 'red-packet'
},
{
name: 'red-packet-fill'
},
{
name: 'order'
},
{
name: 'checkbox-mark'
},
{
name: 'arrow-up-fill'
},
{
name: 'arrow-down-fill'
},
{
name: 'backspace'
},
{
name: 'photo'
},
{
name: 'photo-fill'
},
{
name: 'lock'
},
{
name: 'lock-fill'
},
{
name: 'lock-open'
},
{
name: 'lock-opened-fill'
},
{
name: 'hourglass'
},
{
name: 'hourglass-half-fill'
},
{
name: 'home'
},
{
name: 'home-fill'
},
{
name: 'fingerprint'
},
{
name: 'cut'
},
{
name: 'star'
},
{
name: 'star-fill'
},
{
name: 'share'
},
{
name: 'share-fill'
},
{
name: 'volume-up'
},
{
name: 'volume-up-fill'
},
{
name: 'volume-off'
},
{
name: 'volume-off-fill'
},
{
name: 'trash'
},
{
name: 'trash-fill'
},
{
name: 'rewind-right'
},
{
name: 'rewind-right-fill'
},
{
name: 'rewind-left'
},
{
name: 'rewind-left-fill'
},
{
name: 'shopping-cart'
},
{
name: 'shopping-cart-fill'
},
{
name: 'question'
},
{
name: 'question-circle'
},
{
name: 'question-circle-fill'
},
{
name: 'plus'
},
{
name: 'plus-circle'
},
{
name: 'plus-circle-fill'
},
{
name: 'tags'
},
{
name: 'tags-fill'
},
{
name: 'pause'
},
{
name: 'pause-circle'
},
{
name: 'pause-circle-fill'
},
{
name: 'play-circle'
},
{
name: 'play-circle-fill'
},
{
name: 'map'
},
{
name: 'map-fill'
},
{
name: 'phone'
},
{
name: 'phone-fill'
},
{
name: 'list'
},
{
name: 'list-dot'
},
{
name: 'man-delete'
},
{
name: 'man-add'
},
{
name: 'man-add-fill'
},
{
name: 'person-delete-fill'
},
{
name: 'info'
},
{
name: 'info-circle'
},
{
name: 'info-circle-fill'
},
{
name: 'minus'
},
{
name: 'minus-circle'
},
{
name: 'minus-circle-fill'
},
{
name: 'mic'
},
{
name: 'mic-off'
},
{
name: 'grid'
},
{
name: 'grid-fill'
},
{
name: 'eye'
},
{
name: 'eye-fill'
},
{
name: 'eye-off'
},
{
name: 'file-text'
},
{
name: 'file-text-fill'
},
{
name: 'edit-pen'
},
{
name: 'edit-pen-fill'
},
{
name: 'email'
},
{
name: 'email-fill'
},
{
name: 'download'
},
{
name: 'checkmark'
},
{
name: 'checkmark-circle'
},
{
name: 'checkmark-circle-fill'
},
{
name: 'clock'
},
{
name: 'clock-fill'
},
{
name: 'close'
},
{
name: 'close-circle'
},
{
name: 'close-circle-fill'
},
{
name: 'calendar'
},
{
name: 'calendar-fill'
},
{
name: 'car'
},
{
name: 'car-fill'
},
{
name: 'bell'
},
{
name: 'bell-fill'
},
{
name: 'bookmark'
},
{
name: 'bookmark-fill'
},
{
name: 'attach'
},
{
name: 'play-right'
},
{
name: 'play-right-fill'
},
{
name: 'play-left'
},
{
name: 'play-left-fill'
},
{
name: 'error'
},
{
name: 'error-circle'
},
{
name: 'error-circle-fill'
},
{
name: 'wifi'
},
{
name: 'wifi-off'
},
{
name: 'skip-back-left'
},
{
name: 'skip-forward-right'
},
{
name: 'search'
},
{
name: 'setting'
},
{
name: 'setting-fill'
},
{
name: 'volume'
},
{
name: 'volume-fill'
},
{
name: 'more-dot-fill'
},
{
name: 'more-circle'
},
{
name: 'more-circle-fill'
},
{
name: 'bag'
},
{
name: 'bag-fill'
},
{
name: 'arrow-upward'
},
{
name: 'arrow-downward'
},
{
name: 'arrow-leftward'
},
{
name: 'arrow-rightward'
},
{
name: 'arrow-up'
},
{
name: 'arrow-down'
},
{
name: 'arrow-left'
},
{
name: 'arrow-right'
},
{
name: 'rmb'
},
{
name: 'rmb-circle'
},
{
name: 'rmb-circle-fill'
},
{
name: 'thumb-up'
},
{
name: 'thumb-up-fill'
},
{
name: 'thumb-down'
},
{
name: 'thumb-down-fill'
},
{
name: 'coupon'
},
{
name: 'coupon-fill'
},
{
name: 'kefu-ermai'
},
{
name: 'server-fill'
},
{
name: 'server-man'
},
{
name: 'scan'
},
{
name: 'warning'
},
{
name: 'warning-fill'
},
{
name: 'google'
},
{
name: 'google-circle-fill'
},
{
name: 'chrome-circle-fill'
},
{
name: 'ie'
},
{
name: 'IE-circle-fill'
},
{
name: 'github-circle-fill'
},
{
name: 'android-fill'
},
{
name: 'android-circle-fill'
},
{
name: 'apple-fill'
},
{
name: 'camera'
},
{
name: 'camera-fill'
},
{
name: 'pushpin'
},
{
name: 'pushpin-fill'
},
{
name: 'minus-square-fill'
},
{
name: 'plus-square-fill'
},
{
name: 'heart'
},
{
name: 'heart-fill'
},
{
name: 'reload'
},
{
name: 'account'
},
{
name: 'account-fill'
},
{
name: 'minus-people-fill'
},
{
name: 'plus-people-fill'
},
{
name: 'integral'
},
{
name: 'integral-fill'
},
{
name: 'zhihu'
},
{
name: 'zhihu-circle-fill'
},
{
name: 'gift'
},
{
name: 'gift-fill'
},
{
name: 'zhifubao'
},
{
name: 'zhifubao-circle-fill'
},
{
name: 'weixin-fill'
},
{
name: 'weixin-circle-fill'
},
{
name: 'twitter'
},
{
name: 'twitter-circle-fill'
},
{
name: 'taobao'
},
{
name: 'taobao-circle-fill'
},
{
name: 'weibo'
},
{
name: 'weibo-circle-fill'
},
{
name: 'qq-fill'
},
{
name: 'qq-circle-fill'
},
{
name: 'moments'
},
{
name: 'moments-circel-fill'
},
{
name: 'qzone'
},
{
name: 'qzone-circle-fill'
},
{
name: 'facebook'
},
{
name: 'facebook-circle-fill'
},
{
name: 'baidu'
},
{
name: 'baidu-circle-fill'
},
{
name: 'zhuanfa'
},
]
};
},
methods: {
selectIcon(name) {
// #ifdef H5
return this.$u.toast('H5暂不支持复制');
// #endif
uni.setClipboardData({
data: name,
success: () => {
}
});
uni.hideToast()
this.$u.toast('图标名称已复制');
}
}
}
</script>
<style scoped lang="scss">
.wrap {
padding: 24rpx;
}
.inner-wrap {
display: flex;
flex-wrap: wrap;
}
.u-icon-item {
display: flex;
flex-direction: column;
align-items: center;
height: 190rpx;
flex: 0 0 33.33333333%;
justify-content: center;
overflow: hidden;
}
.u-icon-name {
color: $u-tips-color;
word-wrap: break-word;
word-break:break-all;
margin-top: 16rpx;
font-size: 26rpx;
padding: 0 14rpx;
//
height: 26rpx;
}
</style>

@ -0,0 +1,43 @@
<template>
<u-index-list :scrollTop="scrollTop" :index-list="indexList">
<view v-for="(item, index) in list" :key="index">
<u-index-anchor :index="item.letter" />
<view class="list-cell u-border-bottom" v-for="(item1, index) in item.data" :key="index">
{{item1.name}}
</view>
</view>
</u-index-list>
</template>
<script>
import indexList from "@/common/index.list.js";
const letterArr = indexList.list.map(val => {
return val.letter;
})
export default {
data() {
return {
scrollTop: 0,
indexList: letterArr,
list: indexList.list
}
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
}
}
</script>
<style lang="scss" scoped>
.list-cell {
display: flex;
box-sizing: border-box;
width: 100%;
padding: 10px 24rpx;
overflow: hidden;
color: $u-content-color;
font-size: 14px;
line-height: 24px;
background-color: #fff;
}
</style>

@ -0,0 +1,113 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="input-wrap">
<input class="input" disabled type="text" :value="input" placeholder="来自键盘的输入内容" />
<u-button :custom-style="{height: '32px'}" :hairLine="false" class="clear-btn" @tap="input = ''">清空</u-button>
</view>
<u-keyboard :mask="mask" ref="uKeyboard" safe-area-inset-bottom @confirm="confirm"
:random="random" :dotEnable="false" :mode="mode"
:confirmBtn="true" :cancelBtn="true" :tooltip="tooltip" v-model="show"
@change="change" @backspace="backspace"></u-keyboard>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">键盘开关</view>
<u-subsection :current="show == true ? 0 : 1" :list="['开', '关']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">键盘类型</view>
<u-subsection :list="['数字键盘', '身份证键盘', '车牌号键盘']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">打乱顺序</view>
<u-subsection :current="1" :list="['是', '否']" @change="randomChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">上方工具条</view>
<u-subsection :list="['显示', '隐藏']" @change="tooltipChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示遮罩</view>
<u-subsection :list="['显示', '隐藏']" @change="maskChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
input: '',
mode: 'number',
random: false,
tooltip: true,
mask: true,
}
},
methods: {
statusChange(index) {
this.show = index == 0 ? true : false;
},
modeChange(index) {
if(index == 0) this.mode = 'number';
if(index == 1) this.mode = 'card';
if(index == 2) this.mode = 'car';
this.show = true;
},
randomChange(index) {
this.random = index == 0 ? true : false;
this.show = true;
},
tooltipChange(index) {
this.tooltip = index == 0 ? true : false;
this.show = true;
},
maskChange(index) {
this.show = true;
this.mask = !index;
},
// 退
backspace() {
if(this.input.length) this.input = this.input.substr(0, this.input.length - 1);
},
//
change(detail) {
this.input += detail;
},
confirm(e) {
}
}
}
</script>
<style lang="scss" scoped>
.input {
border: 1px solid $u-light-color;
border-radius: 4px;
margin-bottom: 20px;
height: 32px;
font-size: 26rpx;
flex: 1;
box-sizing: border-box;
}
.input-wrap {
display: flex;
}
.clear-btn {
margin-left: 10px;
font-size: 28rpx;
}
</style>

@ -0,0 +1,253 @@
<template>
<view class="wrap">
<view class="item-warp">
<view class="item" v-for="(item, index) in list" :key="index">
<u-lazy-load threshold="-450" height="400" img-mode="aspectFill" border-radius="10" :image="item.src" :index="index" @statusChange="statusChange" @clickImg="clickImg"></u-lazy-load>
</view>
</view>
<u-loadmore :status="status" @loadmore="getData"></u-loadmore>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
status: 'loadmore',
data: [{
src: "https://gtd.alicdn.com/sns_logo/i1/TB124_3NXXXXXasXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1IWtgQFXXXXcmXFXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1_f_PLXXXXXbVXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
//
src: "error.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1SIYrLXXXXXaAXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB11yxeNVXXXXbwXFXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i3/TB1ndJiQFXXXXctaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1BYGDLpXXXXbuXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB1_9GoMVXXXXXmaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB1cSZZNFXXXXaKaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
//
src: "error.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1RVS_QpXXXXXBXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i5/TB1xEJiLXXXXXcxaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1DSuHJVXXXXXmXXXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i5/TB1aMNyLpXXXXa2XXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1JRHEQpXXXXXwXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1qKEuQpXXXXXYXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1TlOfQFXXXXX2XXXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1SKu.QpXXXXbDXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
//
src: "error.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1um5GQpXXXXbiaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1pxCTQpXXXXa2apXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1zksMNVXXXXaRapXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1nbrcOXXXXXXEXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1CI_NQpXXXXXaXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB18vTdQFXXXXXlXpXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1doDVQpXXXXcRaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB17LgBNFXXXXaSXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1fVJJQFXXXXcyXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i3/TB1wnBTKFXXXXcQXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB124_3NXXXXXasXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1IWtgQFXXXXcmXFXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1_f_PLXXXXXbVXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1DX3hIpXXXXXIaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1SIYrLXXXXXaAXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB11yxeNVXXXXbwXFXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i3/TB1ndJiQFXXXXctaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1BYGDLpXXXXbuXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB1_9GoMVXXXXXmaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB1cSZZNFXXXXaKaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
//
src: "error.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1RVS_QpXXXXXBXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i5/TB1xEJiLXXXXXcxaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1DSuHJVXXXXXmXXXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i5/TB1aMNyLpXXXXa2XXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1JRHEQpXXXXXwXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1qKEuQpXXXXXYXXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1TlOfQFXXXXX2XXXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1SKu.QpXXXXbDXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB17gJ3OXXXXXcrXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i8/TB1um5GQpXXXXbiaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB1pxCTQpXXXXa2apXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i6/TB1zksMNVXXXXaRapXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1nbrcOXXXXXXEXpXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i4/TB1CI_NQpXXXXXaXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i2/TB18vTdQFXXXXXlXpXXwu0bFXXX.png_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i7/TB1doDVQpXXXXcRaXXXSutbFXXX.jpg_240x240xz.jpg",
},
{
src: "https://gtd.alicdn.com/sns_logo/i1/TB17LgBNFXXXXaSXVXXSutbFXXX.jpg_240x240xz.jpg",
},
{
//
src: "error.jpg",
}
]
}
},
onLoad() {
this.getData();
},
onReachBottom() {
this.getData();
},
methods: {
statusChange(status) {
//console.log(status);
},
clickImg(img) {
//console.log(img);
},
getData() {
let index = 0;
this.status = 'loading';
setTimeout(() => {
for(let i = 0; i < 10; i++) {
index = this.$u.random(0, this.data.length - 1);
this.list.push({
src: this.data[index].src
})
}
this.status = 'loadmore';
}, 1500);
}
},
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 30rpx;
display: block;
}
.item-warp {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.item-warp .item {
flex: 0 0 335rpx;
height: 400rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
overflow: hidden;
}
</style>

@ -0,0 +1,91 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="u-no-demo-here">请点击弹出弹窗查看效果</view>
<u-modal ref="uModal" v-model="show" :show-cancel-button="true"
:show-title="showTitle" :async-close="asyncClose"
@confirm="confirm" :content="content"
>
<!-- #ifndef MP-WEIXIN || MP-TOUTIAO -->
<view class="warp" style="margin: 30rpx;" v-if="contentSlot">
<image class="logo" src="https://uviewui.com/common/logo.png" style="width: 220rpx;" mode="widthFix"></image>
</view>
<!-- #endif -->
</u-modal>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['显示', '隐藏']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示标题</view>
<u-subsection current="0" :list="['是', '否']" @change="titleChange"></u-subsection>
</view>
<!-- #ifndef MP-WEIXIN -->
<view class="u-config-item">
<view class="u-item-title">自定义内容</view>
<u-subsection current="1" :list="['是', '否']" @change="contentChange"></u-subsection>
</view>
<!-- #endif -->
<view class="u-config-item">
<view class="u-item-title">异步关闭</view>
<u-subsection current="1" :list="['是', '否']" @change="asyncChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
zoom: false,
content: '慈母手中线,游子身上衣',
contentSlot: false,
showTitle: true,
asyncClose: false,
};
},
computed: {
current() {
return this.show ? 0 : 1;
}
},
methods: {
showChange(index) {
this.show = !index;
},
titleChange(index) {
this.showTitle = !index;
this.show = true;
},
contentChange(index) {
this.contentSlot = !index;
this.show = true;
},
asyncChange(index) {
this.show = true;
this.asyncClose = !index;
},
confirm() {
setTimeout(() => {
this.show = false;
}, 2000)
}
}
};
</script>
<style scoped lang="scss">
.logo {
height: auto;
will-change: transform;
}
</style>

@ -0,0 +1,258 @@
<template>
<view class="">
<u-navbar title-color="#fff" back-icon-color="#ffffff"
:is-fixed="isFixed" :is-back="isBack"
:background="background"
:back-text-style="{color: '#fff'}" :title="title"
:back-icon-name="backIconName" :back-text="backText"
>
<view class="slot-wrap" v-if="useSlot">
<view class="search-wrap" v-if="search">
<!-- 如果使用u-search组件必须要给v-model绑定一个变量 -->
<u-search v-model="keyword" :show-action="showAction" height="56" :action-style="{color: '#fff'}"></u-search>
</view>
<view class="navbar-right" v-if="rightSlot">
<view class="message-box right-item">
<u-icon name="chat" size="38"></u-icon>
<u-badge count="18" size="mini" :offset="[-15, -15]"></u-badge>
</view>
<view class="dot-box right-item">
<u-icon name="calendar-fill" size="38"></u-icon>
<u-badge size="mini" :is-dot="true" :offset="[-6, -6]"></u-badge>
</view>
</view>
<view class="map-wrap" v-if="custom">
<u-icon name="map" color="#ffffff" size="24"></u-icon>
<text class="map-wrap-text">轻舟已过万重山</text>
<u-icon name="arrow-down-fill" color="#ffffff" size="22"></u-icon>
</view>
</view>
<view class="navbar-right" slot="right" v-if="slotRight">
<view class="message-box right-item">
<u-icon name="chat" size="38"></u-icon>
<u-badge count="18" size="mini" :offset="[-15, -15]"></u-badge>
</view>
<view class="dot-box right-item">
<u-icon name="calendar-fill" size="38"></u-icon>
<u-badge size="mini" :is-dot="true" :offset="[-6, -6]"></u-badge>
</view>
</view>
</u-navbar>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="u-no-demo-here">查看顶部导航栏效果</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">标题长度</view>
<u-subsection :list="['短', '中', '长']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">隐藏左侧返回区域</view>
<u-subsection current="1" :list="['是', '否']" @change="backChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义左侧内容</view>
<u-subsection current="1" :list="['是', '否']" @change="leftChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义右侧内容</view>
<u-subsection :current="slotRightCurrent" :list="['是', '否']" @change="rightChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">传入整体slot</view>
<u-subsection :list="['无', '搜索框', '搜索+按钮', '搜索+图标']" @change="searchChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">完全自定义传入内容</view>
<u-subsection current="1" :list="['是', '否']" @change="customChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">背景色</view>
<u-subsection :list="['渐变', '#39CCCC', '#B471CC', '#001f3f']" @change="bgColorChange"></u-subsection>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '新闻',
backText: '返回',
backIconName: 'nav-back',
right: false,
showAction: false,
rightSlot: false,
useSlot: false,
background: {
'background-image': 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
},
isBack: true,
search: false,
custom: false,
isFixed: true,
keyword: '',
// #ifdef MP
slotRight: false,
// #endif
// #ifndef MP
slotRight: true
// #endif
}
},
computed: {
slotRightCurrent() {
return this.slotRight ? 0 : 1;
}
},
methods: {
titleChange(index) {
this.useSlot = false;
this.title = index == 0 ? '新闻' : index == 1 ? '新闻列表' : '雨打梨花深闭门,忘了青春,误了青春';
},
leftChange(index) {
if(index == 0) {
this.backText = '';
this.backIconName = 'arrow-leftward';
} else {
this.backText = '返回';
this.backIconName = 'arrow-left';
}
},
searchChange(index) {
this.title = null;
this.useSlot = true;
this.search = false;
this.custom = false;
if(index == 0) {
this.title = '新闻';
this.useSlot = false;
this.rightSlot = false;
} else if(index == 1) {
this.showAction = false;
this.useSlot = true;
this.rightSlot = false;
this.search = true;
this.slotRight = false;
} else if(index == 2) {
this.useSlot = true;
this.showAction = true;
this.rightSlot = false;
this.search = true;
this.slotRight = false;
} else {
this.useSlot = true;
this.search = true;
this.showAction = false;
this.rightSlot = true;
this.slotRight = false;
}
},
backChange(index) {
this.isBack = !!index;
},
bgColorChange(index) {
this.background = {};
if(index == 0) {
this.background = {
'background-image': 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
}
} else {
let color = index == 1 ? '#39CCCC' : index == 2 ? '#B471CC' : '#001f3f';
this.background = {
background: color
}
}
},
rightChange(index) {
if(index == 0) {
this.slotRight = true;
this.useSlot = false;
} else {
this.slotRight = false;
}
},
customChange(index) {
this.search = false;
this.rightSlot = false;
if(index == 0) {
this.custom = true;
this.title = null;
this.isBack = false;
this.useSlot = true;
} else {
this.useSlot = false;
this.title = '新闻';
this.isBack = true;
}
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {
//height: 200vh;
height: calc(100% - 44px);
height: calc(100% - 44px - constant(safe-area-inset-top));
height: calc(100% - 44px - env(safe-area-inset-top));
}
.wrap {
padding: 24rpx;
}
.navbar-right {
margin-right: 24rpx;
display: flex;
}
.search-wrap {
margin: 0 20rpx;
flex: 1;
}
.right-item {
margin: 0 12rpx;
position: relative;
color: #ffffff;
display: flex;
}
.message-box {
}
.slot-wrap {
display: flex;
align-items: center;
flex: 1;
}
.map-wrap {
display: flex;
align-items: center;
padding: 4px 6px;
background-color: rgba(240,240, 240, 0.35);
color: #fff;
font-size: 22rpx;
border-radius: 100rpx;
margin-left: 30rpx;
}
.map-wrap-text {
padding: 0 6rpx;
}
</style>

File diff suppressed because one or more lines are too long

@ -0,0 +1,70 @@
<template>
<view class="u-content">
<u-parse :html="detail.content"></u-parse>
</view>
</template>
<script>
export default {
data() {
return {
detail: {
content: `
<div class="content_area" id="content_area" style="display: block;">
<!--repaste.body.begin--><p>  巴尼小镇是云南省怒江傈僳族自治州首个易地扶贫搬迁集中安置点从山上的金满村搬迁到巴尼小镇近3年的时间里搬迁户们的生活发生了可喜的变化</p>
<p class="photo_img_20190808" style="text-align: center;"><img src="//p2.img.cctvpic.com/photoworkspace/contentimg/2020/07/16/2020071613380766481.jpg" alt="泸水市巴尼小镇易地扶贫搬迁安置点全景 李韩金摄(人民视觉)" isflag="1"></p>
<p class="photo_alt_20190808" style="text-align: center;"><em></em>泸水市巴尼小镇易地扶贫搬迁安置点全景 李韩金摄人民视觉</p>
<p>  搬出四面透风容易漏雨的千脚落地房住进如今宽敞明亮的楼房当地居民的生活不断改善另一边留在山上的村民在企业帮助下改种经济林果家庭收入节节攀升</p>
<p class="photo_img_20190808" style="text-align: center;"><img src="//p3.img.cctvpic.com/photoworkspace/contentimg/2020/07/16/2020071613382671669.jpg" alt="金满村搬迁户在巴尼小镇的扶贫车间里上班 余秀英摄(人民视觉)" isflag="1"></p>
<p class="photo_alt_20190808" style="text-align: center;"><em></em>金满村搬迁户在巴尼小镇的扶贫车间里上班 余秀英摄人民视觉</p>
<p>  这阵子52岁的米四东心里老惦记个事吃两碗包谷稀饭包谷稀饭是把包谷和蚕豆混在一起有时加点腊肉搁在三脚架上生火煮制而成在高黎贡山上包谷稀饭曾是金满村人的主食大多数人连个菜都不舍得炒就配一碗蘸水吃从山上搬下来快3年了米四东说在山上盼着吃大米饭如今天天吃米饭又想念包谷稀饭了</p>
<p>  米四东的家在巴尼小镇地处云南省怒江傈僳族自治州泸水市洛本卓白族乡紧邻着怒江这里是怒江州首个易地扶贫搬迁集中安置点2017年国庆节金满村首批40户村民入住2018年最后11户村民入住新居如今已有搬迁户168户744人都属于白族支系勒墨人</p>
<p>  3年时间这里的人和生活发生了哪些变化这个夏天记者走进了巴尼小镇</p>
<p>  曾经</p>
<p>  8公里的距离20年的差距</p>
<p>  村民叁益光的家里干净亮堂客厅的墙上挂着一家三口在老房子前的合影由于山地太陡找不到平地打地基老房子都是篱笆为墙木板为顶木头为柱的千脚落地房的样子四面透风的房子里面黑黢黢的下面养牲畜中间住人上面放粮食一入雨季屋里就怕漏雨潮乎乎有虱子2017年搬迁前金满村九成村民就住在这种房子里</p>
<p>  从巴尼小镇往背后的高黎贡山深处走沿着一条水泥路走上8公里就回到了金满村村委会金满村11个村民小组其中5个不通公路1个是地质灾害隐患点这6个组如今已整体搬迁最远的马社王底小组有16户人家到村委会要过悬崖涉小河爬陡坡走上三四个小时说起过往村委会主任沈光干嘘唏不已</p>
<p>  站在村委会的院子里只见大山围绕白云悠悠山外面还是山2014年底金满村人均收入仅有1400多元全村1310人有建档立卡贫困户1250人沈光干说在山上一年到头辛辛苦苦还是穷成这个样</p>
<p>  听老人们说起以前的生活就像听穿越故事一样去邻近的县背洋芋回来种前后得一星期头疼脑热不舍得花钱去卫生院过去从金满村到巴尼小镇的8公里距离也是发展相差20年的距离巴尼小镇社区副主任和碧武介绍群众刚搬出大山时不会用电器连起床叠被子的习惯都没有</p>
<p>  不过在宽敞明亮的楼房里住上一段时间大家都知道了现代生活的好处乡中心完小五年级的学生花燕梅一家去年搬到小镇上每天早上走几分钟就能到学校搬下来好在这里衣服不容易脏老师也讲得好孩子的话总是简单明了</p>
<p>  如今按照一户一宅基地的政策米四东在山上的老房子拆了一家人踏踏实实住在了小镇上米四东感慨还是在山下容易赚钱</p>
<p>  山下</p>
<p>  干活更方便管理更规范</p>
<p>  在巴尼小镇最常见的交通工具就是摩托车还有不少人家门口停着机动三轮车小货车和轿车米四东说有了钱大家都愿意买辆摩托车干活方便了许多</p>
<p>  记者了解到巴尼小镇目前外出务工118户282人以本地打零工为主在小镇上就有家扶贫车间生产民族服装平时有20多个女工车间的管理人员告诉记者一个熟练女工一个月挣三四千元没问题</p>
<p>  赚得多了还要看花得多不多对于搬出大山的人来说上楼后的生活成本增加了多少</p>
<p>  米四东算了算账小镇的水费一户每年20元电费也不贵过日子主要就是买些吃的这个就丰俭由己了青菜要买土豆南瓜山上就有</p>
<p>  和碧武介绍随着巴尼小镇社区建设越来越规范一些以前难以想象的方法都有了实打实的用处比如我们这里实行积分制管理积极参加升国旗仪式搞好卫生都有加分居民可以到超市用积分兑换商品社区超市经营者玉花梅说去年超市里兑换了2万多元的积分</p>
<p>  当然搬下来的时间并不长对大部分人来说还是处在适应阶段在和碧武看来村子里的人与外界的交流还是偏少视野和观念转变得还不够快</p>
<p>  米四东就有这种体会洛本卓白族乡是中国民间文化艺术之乡金满村被列入云南省第四批旅游特色村作为州级非物质文化遗产传人米四东如今在巴尼小镇教授勒墨人的传统歌舞等哪天怒江大峡谷的旅游火起来了这门技艺一定会是旅游的招牌产品米四东心里寻思着</p>
<p>  山上</p>
<p>  既抓生态账又算经济账</p>
<p>  一边是米四东感慨山下容易赚钱另一边却是仍然留在山上的5个村民小组80户人家如今的8公里还有20年的发展差距吗</p>
<p>  两不愁三保障早就实现了现在村里的生活跟过去相比简直是天壤之别眼下村里惦记的是怎样既抓生态账又算经济账洛本卓乡宣传委员麻继成兼任金满村党总支书记搬迁启动前就驻村工作到现在还扎在村里忙活调整种养殖业结构</p>
<p>  靠山吃山金满村过去是在四五十度的山坡地上开荒种包谷如今要进行山体生态修复除了改种经济林果别无他法</p>
<p>  麻继成说乡里组织搬迁群众将原住地的土地林地出租流转或退耕还林采取合作社+村党总支+农户+基地模式种植花椒核桃草果香橼等经济作物现在1000多亩花椒1000多亩核桃600多亩草果和300多亩香橼已经成了山上的绿色银行村里今年准备再发展250亩香橼香橼两年就能挂果收益前景非常可观</p>
<p>  农产品升了级收入也开了源麻继成说农民在企业承包的果园里务工每天的工资有100元如今每天都有二三十人在果园里干活</p>
<p>  搬出去有盼头留下来有干劲如今乡里还在加紧研究制定金满村乡村旅游规划等客栈农家乐步行街都建好了幸福一定来敲门洛本卓乡党委书记郝春荣说巩固脱贫成果走向乡村振兴好日子还在后头</p><!--repaste.body.end-->
</div>
`
}
}
},
onLoad() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.u-content {
padding: 24rpx;
font-size: 32rpx;
color: $u-content-color;
line-height: 1.6;
}
</style>

@ -0,0 +1,211 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-select @click="show = true" :default-value="defaultValue" :mode="mode" v-model="show" :list="list" @confirm="confirm" @cancel="cancel"></u-select>
<view class="u-demo-result-line">select值{{ result }}</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['打开', '收起']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection :list="['单列', '多列独立', '多列联动']" @change="modeChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
result: '尚未选择',
defaultValue: [3],
mode: 'single-column', // single-column, mutil-column, mutil-column-auto
list: [],
list1: [
{
value: '江',
label: '江'
},
{
value: '湖',
label: '湖'
},
{
value: '夜',
label: '夜'
},
{
value: '雨',
label: '雨'
},
{
value: '十',
label: '十'
},
{
value: '年',
label: '年'
},
{
value: '灯',
label: '灯'
}
],
list2: [
[
{
value: '昔',
label: '昔'
},
{
value: '去',
label: '去'
},
{
value: '雪',
label: '雪'
},
{
value: '如',
label: '如'
},
{
value: '花',
label: '花'
}
],
[
{
value: '今',
label: '今'
},
{
value: '来',
label: '来'
},
{
value: '花',
label: '花'
},
{
value: '似',
label: '似'
},
{
value: '雪',
label: '雪'
}
]
],
list3: [
{
label: '中国',
value: '1',
children: [
{
label: '广西',
value: '2',
children: [
{
label: '南宁',
value: '3'
},
{
label: '梧州',
value: '3'
},
{
label: '柳州',
value: '3'
}
]
},
{
label: '广东',
value: '2',
children: [
{
label: '深圳',
value: '3'
},
{
label: '惠州',
value: '3'
},
{
label: '清远',
value: '3'
}
]
}
]
},
{
label: '美国',
value: '1',
children: [
{
label: '纽约',
value: '2',
children: [
{
label: '皇后街道',
value: '3'
}
]
}
]
}
]
};
},
onLoad() {
this.list = this.list1;
},
computed: {
current() {
return this.show ? 0 : 1;
}
},
methods: {
statusChange(index) {
this.show = !index;
},
modeChange(index) {
let type = ['single-column', 'mutil-column', 'mutil-column-auto'];
this.mode = type[index];
this.list = index == 0 ? this.list1 : index == 1 ? this.list2 : this.list3;
this.show = true;
},
confirm(e) {
this.result = '';
e.map((val, index) => {
this.result += this.result == '' ? val.label : '-' + val.label;
})
},
cancel(e) {
console.log(e);
}
}
};
</script>
<style scoped lang="scss">
.badge-button {
padding: 4rpx 6rpx;
background-color: $u-type-error;
color: #fff;
border-radius: 10rpx;
font-size: 22rpx;
line-height: 1;
}
</style>

@ -0,0 +1,127 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-slider :step="step" :height="height" :block-width="blockWidth"
:active-color="activeColor" :value="30"
:use-slot="useSlot" v-model="value"
:min="min" :max="max"
@end="end"
@moving="moving"
>
<!-- #ifndef MP-WEIXIN || MP-TOUTIAO -->
<view class="" v-if="useSlot">
<view class="badge-button">
{{value}}
</view>
</view>
<!-- #endif -->
</u-slider>
<view class="u-demo-result-line">
滑块值{{value}}
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">自定义颜色</view>
<u-subsection :list="['primary', 'warning', 'error', 'success']" @change="typeChange"></u-subsection>
</view>
<!-- #ifndef MP-WEIXIN -->
<view class="u-config-item">
<view class="u-item-title">自定义传入内容</view>
<u-subsection current="1" :list="['是', '否']" @change="slotChange"></u-subsection>
</view>
<!-- #endif -->
<view class="u-config-item">
<view class="u-item-title">自定义尺寸</view>
<u-subsection current="1" :list="['是', '否']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">步进值</view>
<u-subsection :list="['1', '10', '20']" @change="stepChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">最大最小值</view>
<u-subsection :list="['0-100', '40-80']" @change="minMaxchange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: 30,
useSlot: false,
setp: 1,
activeColor: '#2979ff',
height: 6,
blockWidth: 30,
step: 1,
min: 0,
max: 100
};
},
onLoad() {
},
computed: {
current() {
return this.show ? 0 : 1;
}
},
methods: {
typeChange(index) {
let type = ['primary', 'warning', 'error', 'success'];
this.activeColor = this.$u.color[type[index]];
},
sizeChange(index) {
if(index == 0) {
this.height = 4;
this.blockWidth = 30;
} else {
this.height = 6;
this.blockWidth = 20;
}
},
stepChange(index) {
let arr = ['1', '10', '20'];
this.step = arr[index];
},
slotChange(index) {
this.useSlot = !index;
},
minMaxchange(index) {
if(index == 0) {
this.min = 0;
this.max = 100;
} else {
this.min = 40;
this.max = 80;
}
},
end() {
// console.log('end');
},
moving() {
// console.log('moving');
}
}
};
</script>
<style scoped lang="scss">
.badge-button {
padding: 4rpx 6rpx;
background-color: $u-type-error;
color: #fff;
border-radius: 10rpx;
font-size: 22rpx;
line-height: 1;
}
</style>

@ -0,0 +1,147 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-tabs v-if="control" bg-color="#fafafa" :bold="bold" :active-color="activeColor" :list="list"
@change="change" :current="current" :is-scroll="isScroll" :offset="offset"></u-tabs>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :current="sectionCurrent" :list="['滚动', '非滚动']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">标签个数(非滚动模式)</view>
<u-subsection :list="['2', '3', '4']" @change="countChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">活动选项字颜色</view>
<u-subsection mode="button" :list="['primary', 'success', 'error', 'warning']" @change="colorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">字体加粗</view>
<u-subsection mode="button" :list="['是', '否']" @change="boldChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
data: [{
name: '关注',
count: 100
}, {
name: '推荐',
count: 7
}, {
name: '电影'
},{
name: '电视剧'
},{
name: '小视频'
}, {
name: '游戏'
}, {
name: '校园'
},{
name: '影视'
},{
name: '音乐'
}],
current: 0,
sectionCurrent: 0,
isScroll: true,
tabCountIndex: 0,
activeColor: this.$u.color['primary'],
bold: true,
control: true,
offset: [5, -5]
}
},
onLoad() {
this.list = this.data;
},
methods: {
countChange(index) {
this.sectionCurrent = 1;
if(index == 0) {
this.list = [];
this.list.push(this.data[0]);
this.list.push(this.data[1]);
this.offset = [5, 60]
} else if(index == 1) {
this.list = [];
this.list.push(this.data[0]);
this.list.push(this.data[1]);
this.list.push(this.data[2]);
this.offset = [5, 20]
} else {
this.list = [];
this.list.push(this.data[0]);
this.list.push(this.data[1]);
this.list.push(this.data[2]);
this.list.push(this.data[3]);
this.offset = [5, 5]
}
this.tabCountIndex = index;
this.isScroll = false;
},
change(index) {
this.current = index;
},
modeChange(index) {
this.control = false;
this.current = 0;
if(index == 0) {
this.isScroll = true;
this.list = this.data;
this.offset = [5, -5]
} else {
this.isScroll = false;
this.countChange(this.tabCountIndex);
}
this.$nextTick(() => {
this.control = true;
})
},
colorChange(e) {
let color = 'primary';
switch(e) {
case 0:
color = 'primary';break;
case 1:
color = 'success';break;
case 2:
color = 'error';break;
case 3:
color = 'warning';break;
}
this.activeColor = this.$u.color[color];
},
boldChange(e) {
switch(e) {
case 0:
this.bold = true;break;
case 1:
this.bold = false;break;
}
}
}
}
</script>
<style lang="scss" scoped>
.u-config-wrap {
}
</style>

@ -0,0 +1,91 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-tag :text="text" :type="type" :shape="shape" :closeable="closeable" :mode="mode" @close="close" @click="click" :show="show" :size="size" />
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :list="['light', 'dark', 'plain']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示内容</view>
<u-subsection :list="['蒹葭苍苍', '白露为霜', '在水一方']" @change="textChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">主题选择</view>
<u-subsection current="2" :list="['primary', 'success', 'error', 'warning', 'info']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">形状</view>
<u-subsection :list="['square', 'circle', 'circleLeft', 'circleRight']" @change="shapeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸</view>
<u-subsection :list="['default', 'mini']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">关闭图标</view>
<u-subsection :list="['是', '否']" @change="closeableChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
text: '蒹葭苍苍',
mode: 'light',
type: 'error',
size: 'default',
shape: 'square',
closeable: true,
show: true
};
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'light' : index == 1 ? 'dark' : 'plain';
},
textChange(index) {
this.text = index == 0 ? '蒹葭苍苍' : index == 1 ? '白露为霜' : '在水一方';
},
typeChange(index) {
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'info';
},
shapeChange(index) {
this.shape = index == 0 ? 'square' : index == 1 ? 'circle' : index == 2 ? 'circleLeft' : 'circleRight';
},
sizeChange(index) {
this.size = index == 0 ? 'default' : 'mini';
},
closeableChange(index) {
this.closeable = index == 0 ? true : false;
},
click(index) {
this.$refs.uToast.show({
title: `${index + 1}个标签被点击`,
type: 'success'
});
},
close(index) {
this.$refs.uToast.show({
title: `关闭图标被点击`,
type: 'success'
});
}
}
};
</script>
<style lang="scss" scoped>
.u-demo {
}
</style>

@ -0,0 +1,90 @@
<template>
<u-form
:model="form"
ref="uForm"
>
<u-form-item label="姓名">
<u-input v-model="form.name" />
</u-form-item>
<u-form-item label="简介">
<u-input v-model="form.intro" />
</u-form-item>
<u-form-item label="性别">
<u-input
v-model="form.sex"
type="select"
/>
</u-form-item>
<u-form-item label="水果">
<u-checkbox-group>
<u-checkbox
v-model="item.checked"
v-for="(item, index) in checkboxList"
:key="index"
:name="item.name"
>
{{ item.name }}
</u-checkbox>
</u-checkbox-group>
</u-form-item>
<u-form-item label="味道">
<u-radio-group v-model="radio">
<u-radio
v-for="(item, index) in radioList"
:key="index"
:name="item.name"
:disabled="item.disabled"
>
{{ item.name }}
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="开关">
<u-switch
slot="right"
v-model="switchVal"
></u-switch>
</u-form-item>
</u-form>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
intro: '',
sex: ''
},
checkboxList: [{
name: '苹果',
checked: false,
disabled: false
},
{
name: '雪梨',
checked: false,
disabled: false
},
{
name: '柠檬',
checked: false,
disabled: false
}
],
radioList: [{
name: '鲜甜',
disabled: false
},
{
name: '麻辣',
disabled: false
}
],
radio: '',
switchVal: false
};
}
};
</script>

@ -0,0 +1,144 @@
<template>
<view class="wrap">
<u-time-line>
<u-time-line-item nodeTop="2">
<template v-slot:node>
<view class="u-node" style="background: #19be6b;">
<u-icon name="pushpin-fill" color="#fff" :size="24"></u-icon>
</view>
</template>
<template v-slot:content>
<view>
<view class="u-order-title">待取件</view>
<view class="u-order-desc">[自提柜]您的快件已放在楼下侧门直走前方53.6左拐约10步再右拐直走见一红灯笼停下叩门三下芝麻开门即可</view>
<view class="u-order-time">2019-05-08 12:12</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item nodeTop="2">
<template v-slot:node>
<view class="u-node">
<u-icon name="account-fill" color="#fff" :size="24"></u-icon>
</view>
</template>
<template v-slot:content>
<view>
<view class="u-order-title unacive">派送中</view>
<view class="u-order-desc">深圳市快件已到达目的地派件员为国产锦衣卫007号电话<text class="tel">13833882438</text>请留意快递信息</view>
<view class="u-order-time">2019-05-08 06:03</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item nodeTop="2">
<template v-slot:node>
<view class="u-node">
<u-icon name="car-fill" color="#fff" :size="24"></u-icon>
</view>
</template>
<template v-slot:content>
<view>
<view class="u-order-title unacive">运输中</view>
<view class="u-order-desc">深圳市快递已到达 深圳固戍一部</view>
<view class="u-order-time">2019-05-07 08:05</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item>
<template v-slot:content>
<view>
<view class="u-order-desc">深圳市快件已从深圳运转中心发出正在发往深圳宝安一部</view>
<view class="u-order-time">2019-12-06 22:30</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item>
<template v-slot:content>
<view>
<view class="u-order-desc">深圳市快件已到达 深圳运转中心</view>
<view class="u-order-time">2019-12-04 16:42</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item>
<template v-slot:content>
<view>
<view class="u-order-desc">郑州市快件已从郑州运转中心出发正在发往深圳运转中心</view>
<view class="u-order-time">2019-12-02 12:55</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item>
<template v-slot:content>
<view>
<view class="u-order-desc">郑州市快件已到达 郑州运转中心</view>
<view class="u-order-time">2019-12-02 08:23</view>
</view>
</template>
</u-time-line-item>
<u-time-line-item nodeTop="0">
<template v-slot:node>
<view class="u-node">
<u-icon name="file-text-fill" color="#fff" :size="24"></u-icon>
</view>
</template>
<template v-slot:content>
<view>
<view class="u-order-desc">您购买的商品尚方宝剑先斩后奏经由北京军区仓库发货国内快递承运人中南海保镖</view>
<view class="u-order-time">2019-12-01 07:00</view>
</view>
</template>
</u-time-line-item>
</u-time-line>
</view>
</template>
<script>
export default {
data() {
return {
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx 24rpx 24rpx 40rpx;
}
.u-node {
width: 44rpx;
height: 44rpx;
border-radius: 100rpx;
display: flex;
justify-content: center;
align-items: center;
background: #d0d0d0;
}
.u-order-title {
color: #333333;
font-weight: bold;
font-size: 32rpx;
}
.u-order-title.unacive {
color: rgb(150, 150, 150);
}
.u-order-desc {
color: rgb(150, 150, 150);
font-size: 28rpx;
margin-bottom: 6rpx;
}
.u-order-time {
color: rgb(200, 200, 200);
font-size: 26rpx;
}
.tel {
color: $u-type-primary;
}
</style>

@ -0,0 +1,83 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast :type="type" ref="uToast"></u-toast>
<text class="no-mode-here">见弹出toast</text>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">主题</view>
<u-subsection :current="4" :list="['primary', 'success', 'error', 'warning', 'default']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">结束后自动跳转</view>
<u-subsection current="1" :list="['是', '否']" @change="urlChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">位置</view>
<u-subsection current="1" :list="['顶部', '中部', '底部']" @change="positionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示图标</view>
<u-subsection :list="['是', '否']" @change="iconChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
type: 'success',
title: '桃花潭水深千尺',
icon: true,
position: 'center',
url: '',
}
},
methods: {
typeChange(index) {
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'default';
this.show();
},
positionChange(index) {
this.position = index == 0 ? 'top' : index == 1 ? 'center' : 'bottom';
this.show();
},
iconChange(index) {
this.icon = index == 0 ? true : false;
this.show();
},
urlChange(index) {
this.url = index == 0 ? '/pages/components/button/index' : '';
this.show();
},
show() {
this.$refs.uToast.show({
title: this.title,
position: this.position,
type: this.type,
icon: this.icon,
url: this.url,
});
},
hide() {
this.$refs.uToast.hide();
}
}
}
</script>
<style lang="scss" scoped>
.no-mode-here {
color: $u-tips-color;
font-size: 28rpx;
}
</style>

@ -0,0 +1,57 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-top-tips ref="uTips"></u-top-tips>
<text class="u-no-demo-here">点击参数配置查看效果</text>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">主题选择</view>
<u-subsection :list="['primary', 'success', 'error', 'warning', 'info']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示时间</view>
<u-subsection current="1" :list="['长', '正常', '短']" @change="durationChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
duration: 2000,
title: '忽如一夜春风来,千树万树梨花开',
type: 'primary'
}
},
methods: {
showTips() {
this.$refs.uTips.show({
duration: this.duration,
title: this.title,
type: this.type
});
},
typeChange(index) {
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'info';
this.showTips();
},
durationChange(index) {
this.duration = index == 0 ? 4000 : index == 1 ? 2000 : 500;
this.showTips();
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,98 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-verification-code :keep-running="true" :seconds="seconds" @end="end" @start="start" ref="uCode"
@change="codeChange" :startText="startText" :changeText="changeText"
:endText="endText"></u-verification-code>
<u-button @click="getCode">{{tips}}</u-button>
<u-button :custom-style="{marginTop: '30rpx'}" @tap="reset" style="margin-top: 30rpx;">重置</u-button>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">倒计时间</view>
<u-subsection :current="0" :list="['60s', '10s', '5s']" @change="secondsChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义提示语</view>
<u-subsection :current="1" :list="['是', '否']" @change="textChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
tips: '',
seconds: 60,
refCode: null,
startText: '获取验证码',
changeText: 'X秒重新获取',
endText: '重新获取'
}
},
onReady() {
//
//
// this.refCode = this.$refs.uCode;
},
methods: {
codeChange(text) {
// console.log(text);
this.tips = text;
},
getCode() {
if(this.$refs.uCode.canGetCode) {
//
uni.showLoading({
title: '正在获取验证码'
})
setTimeout(() => {
uni.hideLoading();
// this.start()
this.$u.toast('验证码已发送');
//
this.$refs.uCode.start();
}, 2000);
} else {
this.$u.toast('倒计时结束后再发送');
}
},
secondsChange(index) {
this.seconds = index == 0 ? 60 : index == 1 ? 10 : 5;
},
textChange(index) {
if(index == 0) {
this.startText = '点一下获取',
this.changeText = '重新获取Xs',
this.endText = '再次获取'
} else {
this.startText = '获取验证码',
this.changeText = 'X秒重新获取',
this.endText = '重新获取'
}
},
end() {
this.$u.toast('倒计时结束');
},
start() {
this.$u.toast('倒计时开始');
},
reset() {
this.$refs.uCode.reset();
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,106 @@
<template>
<view class="">
<view class="u-card-wrap">
<u-card @click="click" @head-click="headClick" :title="title" :sub-title="subTitle" :thumb="thumb" :padding="padding" :border="border">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
<view class="u-body-item-title u-line-2">
瓶身描绘的牡丹一如你初妆冉冉檀香透过窗心事我了然宣纸上走笔至此搁一半
</view>
<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg" mode="aspectFill"></image>
</view>
<view class="u-body-item u-flex u-row-between u-p-b-0">
<view class="u-body-item-title u-line-2">
釉色渲染仕女图韵味被私藏而你嫣然的一笑如含苞待放
</view>
<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg" mode="aspectFill"></image>
</view>
</view>
<view class="" slot="foot">
<u-icon v-if="bottomSlot" name="chat-fill" size="34" label="30评论"></u-icon>
</view>
</u-card>
</view>
<view class="u-config-wrap u-demo">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">左上角图标</view>
<u-subsection :list="['显示', '隐藏']" @change="thumbChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">内边距</view>
<u-subsection current="1" :list="['20', '30', '40']" @change="paddingChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">底部</view>
<u-subsection :list="['显示', '隐藏']" @change="bottomChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">外边框</view>
<u-subsection :list="['显示', '隐藏']" @change="borderChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '素胚勾勒出青花,笔锋浓转淡',
subTitle: '2020-05-15',
thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
padding: 20,
bottomSlot: true,
border: true
}
},
methods: {
thumbChange(index) {
this.thumb = index == 0 ? 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg' : '';
},
paddingChange(index) {
this.padding = [20, 30, 40][index];
},
bottomChange(index) {
this.bottomSlot = !index;
},
borderChange(index) {
this.border = !index;
},
click(index) {
console.log(index);
},
headClick(index) {
console.log(index);
}
}
}
</script>
<style scoped lang="scss">
.u-demo {
padding-top: 0;
}
.u-card-wrap {
background-color: $u-bg-color;
padding: 1px;
}
.u-body-item {
font-size: 32rpx;
color: #333;
padding: 20rpx 10rpx;
}
.u-body-item image {
width: 120rpx;
flex: 0 0 120rpx;
height: 120rpx;
border-radius: 8rpx;
margin-left: 12rpx;
}
</style>

@ -0,0 +1,161 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="">
<u-checkbox-group :size="size" :width="width"
:wrap="wrap" :max="max"
@change="checkboxGroupChange"
:activeColor="activeColor"
>
<u-checkbox @change="checkboxChange"
v-model="item.checked" v-for="(item, index) in list"
:key="index" :name="item.name"
:shape="shape"
:disabled="item.disabled"
>{{item.name}}</u-checkbox>
</u-checkbox-group>
</view>
<view class="u-demo-result-line">
{{result.length ? `选中了"${getResult}"` : '请选择'}}
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">形状</view>
<u-subsection :list="['方形', '圆形']" @change="shapeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">整体大小(单位rpx)</view>
<u-subsection current="1" :list="['30', '40', '50']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">激活颜色</view>
<u-subsection :list="['primary', 'error', 'warning', 'success', 'info']" @change="activeColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">默认选中第一个</view>
<u-subsection current="1" :list="['是', '否']" @change="defaultChooseChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">每个占一行</view>
<u-subsection current="1" :list="['是', '否']" @change="wrapChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">每个宽度50%</view>
<u-subsection current="1" :list="['是', '否']" @change="widthChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">最大选择数量</view>
<u-subsection current="2" :list="['1', '2', '3']" @change="maxChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">禁用第一个</view>
<u-subsection current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{
name: '荔枝',
checked: false,
disabled: false
},
{
name: '香蕉',
checked: false,
disabled: false
},
{
name: '橙子',
checked: false,
disabled: false
},
{
name: '草莓',
checked: false,
disabled: false
}
],
disabled: false,
checked: true,
result: [],
shape: 'square',
max: 3,
activeColor: '#2979ff',
size: 34,
wrap: false,
width: 'auto'
}
},
computed: {
getResult() {
return this.result.join(",");
}
},
methods: {
shapeChange(index) {
this.shape = index == 0 ? 'square' : 'circle';
},
sizeChange(index) {
this.size = index == 0 ? 30 : index == 1 ? 40 : 50;
},
defaultChooseChange(index) {
//
//
if(index == 0) {
this.list[0].checked = true;
this.result = [this.list[0].name];
} else {
this.list[0].checked = false;
this.result.splice(this.result.indexOf(this.list[0].name), 1);
}
},
maxChange(index) {
this.max = index + 1;
},
disabledChange(index) {
if(index == 0) {
this.list[0].disabled = true;
} else {
this.list[0].disabled = false;
}
},
activeColorChange(index) {
// checkbox
if(!this.result.length) this.list[0].checked = true;
let theme = index == 0 ? 'primary' : index == 1 ? 'error' : index == 2 ? 'warning' : index == 3 ? 'success' : 'info';
this.activeColor = this.$u.color[theme];
},
// checkbox
checkboxChange(e) {
// console.log(e);
},
// checkboxcheckbox-group
checkboxGroupChange(e) {
this.result = e;
},
widthChange(index) {
this.width = index == 0 ? '50%' : '';
},
wrapChange(index) {
this.wrap = !index;
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,81 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-divider :type="type" :borderColor="borderColor" :bg-color="bgColor" @click="click"
:half-width="halfWidth" :color="color" :font-size="fontSize">{{text}}</u-divider>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">提示内容</view>
<u-subsection :list="['没有更多了', '到底了']" @change="textChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">单边线宽</view>
<u-subsection current="1" :list="['50', '150', '250']" @change="halfWidthChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">横线颜色</view>
<u-subsection :list="['#dcdfe6', 'primary', 'error', 'warning', 'success']" @change="borderColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">内容样式</view>
<u-subsection :list="['默认', '自定义']" @change="contentChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
text: '没有更多了',
bgColor: '#fafafa',
halfWidth: 150,
borderColor: '#dcdfe6',
type: 'primary',
color: '#909399',
fontSize: '26'
}
},
methods: {
textChange(index) {
this.text = index == 0 ? '没有更多了' : '到底了';
},
halfWidthChange(index) {
this.halfWidth = index == 0 ? 50 : index == 1 ? 150 : 250;
},
borderColorChange(index) {
if(index == 0) {
this.borderColor = '#dcdfe6';
} else {
// border-colortypetypeborder-color
this.borderColor = '';
this.type = index == 1 ? 'primary' : index == 2 ? 'error' : index == 3 ? 'warning' : 'success';
}
},
contentChange(index) {
if(index == 0) {
this.color = '#909399';
this.fontSize = 26;
} else {
this.color = this.$u.color['primary'];
this.fontSize = 30;
}
},
click() {
console.log('click');
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,167 @@
<template>
<view class="">
<view class="u-m-p-50">
<view class="u-demo-area u-flex u-row-center">
<u-dropdown :close-on-click-mask="mask" ref="uDropdown" :activeColor="activeColor" :borderBottom="borderBottom">
<u-dropdown-item @change="change" v-model="value1" title="距离" :options="options1"></u-dropdown-item>
<u-dropdown-item @change="change" v-model="value2" title="温度" :options="options2"></u-dropdown-item>
<u-dropdown-item title="属性">
<view class="slot-content">
<view class="item-box">
<view class="item" :class="[item.active ? 'active' : '']" @tap="tagClick(index)" v-for="(item, index) in list" :key="index">
{{item.label}}
</view>
</view>
<u-button type="primary" @click="closeDropdown"></u-button>
</view>
</u-dropdown-item>
</u-dropdown>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">下边框</view>
<u-subsection current="1" :list="['有', '无']" @change="borderChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">激活颜色</view>
<u-subsection :list="['#2979ff', '#ff9900', '#19be6b']" @change="activeColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">遮罩是否可点击</view>
<u-subsection :list="['是', '否']" @change="maskChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value1: '',
value2: '2',
mask: true,
options1: [{
label: '默认排序',
value: 1,
},
{
label: '距离优先',
value: 2,
},
{
label: '价格优先',
value: 3,
}
],
options2: [{
label: '去冰',
value: 1,
},
{
label: '加冰',
value: 2,
},
{
label: '正常温',
value: 3,
},
{
label: '加热',
value: 4,
},
{
label: '极寒风暴',
value: 5,
}
],
list: [{
label: '琪花瑶草',
active: true,
},
{
label: '清词丽句',
active: false,
},
{
label: '宛转蛾眉',
active: false,
},
{
label: '煦色韶光',
active: false,
},
{
label: '鱼沉雁落',
active: false,
},
{
label: '章台杨柳',
active: false,
},
{
label: '霞光万道',
active: false,
}
],
borderBottom: false,
activeColor: '#2979ff'
}
},
methods: {
borderChange(index) {
this.borderBottom = !index;
},
activeColorChange(index) {
this.activeColor = ['#2979ff', '#ff9900', '#19be6b'][index];
},
change(index) {
this.$u.toast(`点击了第${index}`);
},
closeDropdown() {
this.$refs.uDropdown.close();
},
tagClick(index) {
this.list[index].active = !this.list[index].active;
},
maskChange(index) {
this.mask = !index;
}
}
}
</script>
<style scoped lang="scss">
.u-config-wrap {
padding: 40rpx;
}
.slot-content {
background-color: #FFFFFF;
padding: 24rpx;
.item-box {
margin-bottom: 50rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item {
border: 1px solid $u-type-primary;
color: $u-type-primary;
padding: 8rpx 40rpx;
border-radius: 100rpx;
margin-top: 30rpx;
}
.active {
color: #FFFFFF;
background-color: $u-type-primary;
}
}
}
</style>

@ -0,0 +1,96 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area u-flex u-row-center">
<u-image :shape="shape" ref="uImage" :width="width" :height="height" :src="src" mode="aspectFill">
<u-loading size="44" mode="flower" slot="loading" v-if="loadingSlot"></u-loading>
<view v-if="errorSlot" slot="error" style="font-size: 24rpx;"></view>
</u-image>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="statusCurrent" :list="['加载成功', '加载中', '加载失败']" @change="statusChange"></u-subsection>
</view>
<!-- 微信小程序中无法动态切换slot所以隐藏此部分的演示 -->
<!-- #ifndef MP-WEIXIN -->
<view class="u-config-item">
<view class="u-item-title">加载中状态</view>
<u-subsection :list="['默认', '自定义']" @change="loadingChange"></u-subsection>
</view>
<!-- #endif -->
<view class="u-config-item">
<view class="u-item-title">加载失败状态</view>
<u-subsection :list="['默认', '自定义']" @change="errorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">形状</view>
<u-subsection :list="['方形', '圆形']" @change="shapeChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
src: 'https://cdn.uviewui.com/uview/example/fade.jpg',
width: '200',
height: '200',
loadingSlot: false,
statusCurrent: 0,
errorSlot: false,
shape: 'square'
};
},
computed: {
// statusCurrent() {
// }
},
methods: {
statusChange(index) {
// ref使
if (index == 0) {
this.src = 'http://img5.imgtn.bdimg.com/it/u=2438062088,2808868405&fm=26&gp=0.jpg';
this.$refs.uImage.loading = false;
this.$refs.uImage.isError = false;
} else if (index == 1) {
this.$refs.uImage.loading = true;
} else {
this.$refs.uImage.loading = false;
this.$refs.uImage.isError = true;
}
},
loadingChange(index) {
this.statusCurrent = 1;
this.statusChange(1);
if (index == 0) {
this.loadingSlot = false;
} else {
this.loadingSlot = true;
}
},
errorChange(index) {
this.statusCurrent = 2;
this.statusChange(2);
if (index == 0) {
this.errorSlot = false;
} else {
this.errorSlot = true;
}
},
shapeChange(index) {
this.shape = index == 0 ? 'square' : 'circle';
}
}
};
</script>
<style scoped lang="scss">
.u-demo-area {
}
</style>

@ -0,0 +1,68 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area u-flex u-row-center">
<!-- 头条小程序因为兼容性必须要给组件写上u-line类 -->
<u-line class="u-line" :border-style="borderStyle" color="red" :color="color" :length="length" :direction="direction" :hair-line="hairLine"></u-line>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">颜色</view>
<u-subsection :list="['primary', 'success', 'warning', 'error', 'info']" @change="colorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">线条类型</view>
<u-subsection :list="['实线', '方形虚线', '圆点虚线']" @change="borderStyleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">细边</view>
<u-subsection :list="['是', '否']" @change="hairLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">方向</view>
<u-subsection :list="['水平', '垂直']" @change="directionChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
direction: 'row',
hairLine: true,
length: '100%',
color: this.$u.color['primary'],
borderStyle: 'solid'
}
},
methods: {
colorChange(index) {
this.color = this.$u.color[['primary', 'success', 'warning', 'error', 'info'][index]];
},
hairLineChange(index) {
this.hairLine = !index;
},
directionChange(index) {
this.direction = index == 0 ? 'row' : 'col';
if(index == 0) this.length = '100%';
else this.length = '50rpx';
},
borderStyleChange(index) {
this.borderStyle = ['solid', 'dashed', 'dotted'][index];
}
}
}
</script>
<style scoped lang="scss">
.u-demo-area {
}
</style>

@ -0,0 +1,77 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-loading :mode="mode" :show="show" :color="color" :size="size"></u-loading>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection :list="['圆圈', '花朵']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">颜色(只对圆圈模式有效)</view>
<u-subsection :list="['default', 'primary', 'error', 'warning', 'success']" @change="colorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸(单位rpx)</view>
<u-subsection current="1" :list="['28', '34', '40']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示</view>
<u-subsection current="1" :list="['否', '是']" @change="showChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: 'circle',
color: '#c7c7c7',
size: '34',
show: true
}
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'circle' : 'flower';
},
colorChange(index) {
if(index == 0) {
this.color = '#c7c7c7';
} else {
let color = index == 1 ? 'primary' : index == 2 ? 'error' : index == 3 ? 'warning' : 'success';
this.color = this.$u.color[color];
}
},
sizeChange(index) {
this.size = index == 0 ? '28' : index == 1 ? '34' : '40';
},
showChange(index) {
// !!0false1true
this.show = !!index;
},
// checkbox
checkboxChange(e) {
//console.log(e);
},
// checkboxcheckbox-group
checkboxGroupChange(e) {
this.result = e;
// console.log(this.result);
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,144 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast :type="type" ref="uToast"></u-toast>
<u-notice-bar :autoplay="autoplay" :playState="playState" :speed="speed" @getMore="getMore"
:mode="mode" @end="end" @close="close" @click="click" :show="show" :type="type" :list="list"
:moreIcon="moreIcon" :volumeIcon="volumeIcon" :duration="duration" :isCircular="isCircular"></u-notice-bar>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">主题</view>
<u-subsection :current="3" :list="['primary', 'success', 'error', 'warning', 'none']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">滚动模式</view>
<u-subsection :current="current" :list="['水平', '垂直']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否衔接(水平模式有效)</view>
<u-subsection :list="['是', '否']" @change="isCircularChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :list="['播放', '暂停']" @change="playStateChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">速度</view>
<u-subsection :current="1" :list="['慢', '正常', '快']" @change="speedChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">图标</view>
<u-subsection :list="['显示', '隐藏']" @change="iconChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: true,
autoplay: false,
type: 'warning',
list: [
'锦瑟无端五十弦,一弦一柱思华年',
'庄生晓梦迷蝴蝶,望帝春心托杜鹃',
'沧海月明珠有泪,蓝田日暖玉生烟'
],
mode: 'horizontal',
playState: 'play',
speed: 160,
duration: 2000,
moreIcon: true,
volumeIcon: true,
isCircular: true,
current: 0
}
},
onLoad() {
},
methods: {
typeChange(index) {
let type = ['primary', 'success', 'error', 'warning', 'none'];
this.type = type[index];
},
modeChange(index) {
this.current = index;
this.mode = index == 0 ? 'horizontal' : 'vertical';
},
playStateChange(index) {
this.playState = index == 0 ? 'play' : 'paused';
},
speedChange(index) {
if(index == 0) {
this.$nextTick(() => {
this.speed = 50;
this.duration = 6000;
})
} else if(index == 1) {
this.$nextTick(() => {
this.speed = 160;
this.duration = 2000;
})
} else {
this.$nextTick(() => {
this.speed = 350;
this.duration = 400;
})
}
},
iconChange(index) {
if(index == 0) {
this.moreIcon = true;
this.volumeIcon = true;
} else {
this.moreIcon = false;
this.volumeIcon = false;
}
},
isCircularChange(index) {
this.isCircular = index == 0 ? true : false;
this.current = 0;
this.mode = 'horizontal';
},
close() {
this.toast(`点击了关闭图标`);
},
click(index) {
if(this.mode == 'horizontal' && this.isCircular) {
this.toast('此模式无法获取Index值');
} else {
this.toast(`点击了第${index + 1}条消息`);
}
},
getMore() {
this.toast(`点击了更多图标`);
},
toast(title) {
this.$refs.uToast.show({
title: title,
type: 'warning'
})
},
end() {
// console.log('end');
}
}
}
</script>
<style lang="scss" scoped>
.item {
margin-top: 30px;
}
</style>

@ -0,0 +1,199 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="u-demo-result-line">{{ input ? input : 'Picker值' }}</view>
<u-picker
:mode="mode"
:defaultTime="defaultTime"
v-model="show"
:defaultRegion="defaultRegion"
:params="params"
end-year="2030"
@confirm="confirm"
:defaultSelector="defaultSelector"
:range="range"
:range-key="rangKey"
@columnchange="columnchange"
></u-picker>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">Picker开关</view>
<u-subsection :current="status" :list="['显示', '隐藏']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :list="['单列', '多列', '时间', '地区']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">默认时间</view>
<u-subsection :list="['2019-12-11 20:15:35', '2020-02-05 13:09:42']" @change="defaultTimeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示时分秒</view>
<u-subsection :list="['显示', '隐藏']" @change="minSecChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">默认地区</view>
<u-subsection :list="['广东-深圳-宝安', '海南-三亚-海棠']" @change="defaultRegionChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
input: '',
rangKey: 'name',
mode: 'selector',
range: ['一', '片', '冰', '心', '在', '玉', '壶'],
defaultTime: '2019-12-11 20:15:35',
defaultSelector: [0],
defaultRegion: ['广东省', '深圳市', '宝安区'],
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
province: true,
city: true,
area: true,
timestamp: true
}
};
},
computed: {
status() {
return this.show == true ? 0 : 1;
}
},
methods: {
statusChange(index) {
this.show = index == 0 ? true : false;
},
modeChange(index) {
this.mode = ['selector', 'multiSelector', 'time', 'region'][index];
if (this.mode == 'selector') {
this.range = ['一', '片', '冰', '心', '在', '玉', '壶'];
this.defaultSelector = [0];
}
if (this.mode == 'multiSelector') {
this.range = [['亚洲', '欧洲'], ['中国', '日本'], ['北京', '上海', '广州']];
this.defaultSelector = [0, 0, 0];
}
this.show = true;
},
defaultTimeChange(index) {
this.defaultTime = index == 0 ? '2019-12-11 20:15:35' : '2020-02-05 13:09:42';
this.mode = 'time';
this.show = true;
},
defaultRegionChange(index) {
this.defaultRegion = index == 0 ? ['广东省', '深圳市', '宝安区'] : ['海南省', '三亚市', '海棠区'];
this.mode = 'region';
this.show = true;
},
minSecChange(index) {
if (index == 0) {
this.params.hour = true;
this.params.minute = true;
this.params.second = true;
}
if (index == 1) {
this.params.hour = false;
this.params.minute = false;
this.params.second = false;
}
this.mode = 'time';
this.show = true;
},
confirm(e) {
// console.log(e);
this.input = '';
if (this.mode == 'time') {
if (this.params.year) this.input += e.year;
if (this.params.month) this.input += '-' + e.month;
if (this.params.day) this.input += '-' + e.day;
if (this.params.hour) this.input += ' ' + e.hour;
if (this.params.minute) this.input += ':' + e.minute;
if (this.params.second) this.input += ':' + e.second;
} else if (this.mode == 'region') {
this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
} else if (this.mode == 'selector') {
this.input = this.range[e[0]];
} else if (this.mode == 'multiSelector') {
this.input = this.range[0][e[0]] + '-' + this.range[1][e[1]] + '-' + this.range[2][e[2]];
}
},
columnchange(e) {
let column = e.column, index = e.index;
this.defaultSelector[column] = index;
switch (column) {
case 0:
switch (index) {
case 0:
this.range[1] = ['中国', '日本']
this.range[2] = ['北京', '上海', '广州']
break
case 1:
this.range[1] = ['英国', '法国']
this.range[2] = ['伦敦', '曼彻斯特']
break
}
this.defaultSelector.splice(1, 1, 0)
this.defaultSelector.splice(2, 1, 0)
break
case 1: //2
switch (this.defaultSelector[0]) { //
case 0:
switch (this.defaultSelector[1]) {
case 0:
this.range[2] = ['北京', '上海', '广州']
break
case 1:
this.range[2] = ['东京','北海道']
break
}
break
case 1:
switch (this.defaultSelector[1]) {
case 0:
this.range[2] = ['伦敦', '曼彻斯特']
break
case 1:
this.range[2] = ['巴黎', '马赛']
break
}
break
}
this.defaultSelector.splice(2, 1, 0)
break
}
}
}
};
</script>
<style lang="scss" scoped>
.input {
border: 1px solid $u-light-color;
border-radius: 4px;
margin-bottom: 20px;
height: 30px;
font-size: 26rpx;
flex: 1;
}
.input-wrap {
display: flex;
}
</style>

@ -0,0 +1,142 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="">
<u-radio-group :shape="shape" :size="size" :width="width" :wrap="wrap" v-model="value" @change="radioGroupChange" :activeColor="activeColor">
<u-radio @change="radioChange" v-for="(item, index) in list" :disabled="item.disabled"
:key="index" :name="item.name"
>{{item.name}}</u-radio>
</u-radio-group>
</view>
<view class="u-demo-result-line">
{{value ? `选中了"${result}"` : '请选择'}}
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">形状</view>
<u-subsection current="1" :list="['方形', '圆形']" @change="shapeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">整体大小(单位rpx)</view>
<u-subsection current="1" :list="['30', '40', '50']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">激活颜色</view>
<u-subsection :list="['primary', 'error', 'warning', 'success', 'info']" @change="activeColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">每个占一行</view>
<u-subsection current="1" :list="['是', '否']" @change="wrapChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">每个宽度50%</view>
<u-subsection current="1" :list="['是', '否']" @change="widthChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">默认选中第一个</view>
<u-subsection current="1" :list="['是', '否']" @change="defaultChooseChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">禁用第一个</view>
<u-subsection current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{
name: '荔枝',
checked: true,
disabled: false
},
{
name: '香蕉',
checked: false,
disabled: false
},
{
name: '橙子',
checked: false,
disabled: false
},
{
name: '草莓',
checked: false,
disabled: false
}
],
disabled: false,
result: '荔枝',
shape: 'circle',
value: '荔枝',
activeColor: '#2979ff',
size: 34,
wrap: false,
width: 'auto'
}
},
methods: {
shapeChange(index) {
this.shape = index == 0 ? 'square' : 'circle';
},
sizeChange(index) {
this.size = index == 0 ? 30 : index == 1 ? 40 : 50;
},
defaultChooseChange(index) {
//
//
if(index == 0) {
this.result = this.value = this.list[0].name;
} else {
if(this.value == this.list[0].name) {
this.result = this.value = '';
}
}
},
activeColorChange(index) {
// radio
if(!this.result) this.result = this.value = this.list[0].name;
let theme = index == 0 ? 'primary' : index == 1 ? 'error' : index == 2 ? 'warning' : index == 3 ? 'success' : 'info';
this.activeColor = this.$u.color[theme];
},
disabledChange(index) {
if(index == 0) {
this.list[0].disabled = true;
} else {
this.list[0].disabled = false;
}
},
// radio
radioChange(e) {
//console.log(e);
},
// radioradio-group
radioGroupChange(e) {
this.result = e;
//console.log(e);
},
widthChange(index) {
this.width = index == 0 ? '50%' : '';
},
wrapChange(index) {
this.wrap = !index;
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,123 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-rate v-model="value" :count="count" @change="change"
:active-color="activeColor" :inaction-color="inactiveColor"
:active-icon="activeIcon" :inactive-icon="inactiveIcon"
:disabled="disabled" :colors="colors" :icons="icons"></u-rate>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">初始值</view>
<u-subsection :list="[1, 2, 3, 4]" @change="currentChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">镂空状态</view>
<u-subsection current="1" :list="['是', '否']" @change="plainChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义图标</view>
<u-subsection current="1" :list="['是', '否']" @change="iconChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否分层</view>
<u-subsection current="1" :list="['是', '否']" @change="decimalChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否禁用</view>
<u-subsection current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">星星数量</view>
<u-subsection current="1" :list="[4, 5, 6]" @change="countChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 1.4.5使v-modelcurrent
// current: 1,
activeColor: '#FA3534',
inactiveColor: '#b2b2b2',
disabled: false,
count: 5,
customIcon: false,
plain: false,
value: 0,
colors: [],
icons: []
}
},
watch: {
value(n) {
// console.log(n);
}
},
computed: {
activeIcon() {
let icon = this.customIcon ? 'heart' : 'star';
return this.plain ? icon : icon + '-fill'
},
inactiveIcon() {
let icon = this.customIcon ? 'heart' : 'star';
return this.plain ? icon : icon + '-fill'
}
},
methods: {
currentChange(index) {
this.value = index == 0 ? 1 : index == 1 ? 2 : index == 2 ? 3 : 4;
},
plainChange(index) {
this.plain = !index;
},
disabledChange(index) {
this.disabled = index == 0 ? true : false;
},
countChange(index) {
this.count = index == 0 ? 4 : index == 1 ? 5 : 6;
},
styleChange(index) {
if(index == 0) {
this.activeColor = this.$u.color['primary'];
this.inactiveColor = this.$u.color['info'];
} else {
this.activeColor = '#FA3534';
this.inactiveColor = '#b2b2b2';
}
},
decimalChange(index) {
if(index == 0) {
this.colors = ['#ffc454', '#ffb409', '#ff9500'];
this.icons = ['thumb-down-fill', 'thumb-down-fill', 'thumb-up-fill', 'thumb-up-fill'];
} else {
this.colors = [];
this.icons = [];
}
},
iconChange(index) {
this.customIcon = !index;
},
change(val) {
// console.log(val);
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,67 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-read-more @open="open" @close="close" :toggle="toggle" :show-height="showHeight" ref="uReadMore">
<!-- u-parse组件在微信小程序渲染慢支付宝小程序rich-text不支持nodes属性 -->
<!-- #ifdef MP-ALIPAY -->
<u-parse :html="content"></u-parse>
<!-- #endif -->
<!-- #ifndef MP-ALIPAY -->
<rich-text :nodes="content"></rich-text>
<!-- #endif -->
</u-read-more>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">超出高度隐藏</view>
<u-subsection current="1" :list="['100', '200', '400']" @change="showHeightChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">展开后可关闭</view>
<u-subsection current="1" :list="['是', '否']" @change="toggleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
content: `浔阳江头夜送客,枫叶荻花秋瑟瑟。主人下马客在船,举酒欲饮无管弦。醉不成欢惨将别,别时茫茫江浸月。
忽闻水上琵琶声主人忘归客不发寻声暗问弹者谁琵琶声停欲语迟移船相近邀相见添酒回灯重开宴千呼万唤始出来犹抱琵琶半遮面转轴拨弦三两声未成曲调先有情弦弦掩抑声声思似诉平生不得志低眉信手续续弹说尽心中无限事轻拢慢捻抹复挑初为霓裳六幺大弦嘈嘈如急雨小弦切切如私语嘈嘈切切错杂弹大珠小珠落玉盘间关莺语花底滑幽咽泉流冰下难冰泉冷涩弦凝绝凝绝不通声暂歇别有幽愁暗恨生此时无声胜有声银瓶乍破水浆迸铁骑突出刀枪鸣曲终收拨当心画四弦一声如裂帛东船西舫悄无言唯见江心秋月白
沉吟放拨插弦中整顿衣裳起敛容自言本是京城女家在虾蟆陵下住十三学得琵琶成名属教坊第一部曲罢曾教善才服妆成每被秋娘妒五陵年少争缠头一曲红绡不知数钿头银篦击节碎血色罗裙翻酒污今年欢笑复明年秋月春风等闲度弟走从军阿姨死暮去朝来颜色故门前冷落鞍马稀老大嫁作商人妇商人重利轻别离前月浮梁买茶去去来江口守空船绕船月明江水寒夜深忽梦少年事梦啼妆泪红阑干
我闻琵琶已叹息又闻此语重唧唧同是天涯沦落人相逢何必曾相识我从去年辞帝京谪居卧病浔阳城浔阳地僻无音乐终岁不闻丝竹声住近湓江地低湿黄芦苦竹绕宅生其间旦暮闻何物杜鹃啼血猿哀鸣春江花朝秋月夜往往取酒还独倾岂无山歌与村笛呕哑嘲哳难为听今夜闻君琵琶语如听仙乐耳暂明莫辞更坐弹一曲为君翻作琵琶行感我此言良久立却坐促弦弦转急凄凄不似向前声满座重闻皆掩泣座中泣下谁最多江州司马青衫湿`,
showHeight: 200,
toggle: false,
}
},
methods: {
showHeightChange(index) {
this.showHeight = index == 0 ? 100 : index == 1 ? 200 : 400;
},
toggleChange(index) {
this.toggle = index == 0 ? true : false;
},
open() {
// console.log('open');
},
close() {
// console.log('close');
}
}
}
</script>
<style lang="scss" scoped>
// /deep/穿
.wrap /deep/ .u-content {
color: #666!important;
}
</style>

@ -0,0 +1,96 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-search v-model="value" @change="change" @custom="custom" @search="search" :shape="shape" :clearabled="clearabled"
:show-action="showAction" :input-align="inputAlign" @clear="clear"></u-search>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">初始值</view>
<u-subsection :list="['空', '天山雪莲']" @change="valueChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">搜索框形状</view>
<u-subsection :list="['圆形', '方形']" @change="shapeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">清除控件</view>
<u-subsection :list="['启用', '关闭']" @change="clearabledChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">右侧控件</view>
<u-subsection :list="['启用', '关闭']" @change="showActionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">水平对齐方式</view>
<u-subsection :list="['左', '中', '右']" @change="inputAlignChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: '',
shape: 'round',
clearabled: true,
showAction: true,
inputAlign: 'left'
}
},
watch: {
// v-modelchange
// value
value(val) {
// console.log(val);
}
},
methods: {
valueChange(index) {
this.value = index == 0 ? '' : '天山雪莲';
},
shapeChange(index) {
this.shape = index == 0 ? 'round' : 'square';
},
clearabledChange(index) {
this.clearabled = index == 0 ? true : false;
},
showActionChange(index) {
this.showAction = index == 0 ? true : false;
},
inputAlignChange(index) {
this.inputAlign = index == 0 ? 'left' : index == 1 ? 'center' : 'right';
},
change(value) {
// value
//console.log(value);
},
custom(value) {
//console.log(value);
this.$u.toast('输入值为:' + value)
},
search(value) {
this.$refs.uToast.show({
title: '搜索内容为:' + value,
type: 'success'
})
},
clear() {
// console.log(this.value);
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,128 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="container u-skeleton">
<view class="userinfo">
<block>
<!--u-skeleton-circle 绘制圆形-->
<image class="userinfo-avatar u-skeleton-circle" :src="userInfo.avatarUrl"></image>
<!--u-skeleton-fillet 绘制圆角矩形-->
<text class="u-skeleton-fillet">{{userInfo.nickName}}</text>
</block>
</view>
<view style="margin: 20px 0">
<!--u-skeleton-rect 绘制矩形-->
<view class="u-skeleton-rect lists" v-for="(item,index) in lists" :key="index">
<text>{{item}}</text>
</view>
</view>
</view>
<!--引用组件-->
<u-skeleton bg-color="rgb(250, 250, 250)" :loading="loading" :animation="animation"
:el-color="elColor" :border-radius="borderRadius"></u-skeleton>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">加载状态</view>
<u-subsection :current="current" :list="['请求中', '请求结束']" @change="loadingChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">骨架动画</view>
<u-subsection current="1" :list="['是', '否']" @change="animationChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: {
avatarUrl: 'https://cdn.uviewui.com/uview/common/logo.png',
nickName: 'uView'
},
lists: [
'君不见,黄河之水天上来,奔流到海不复回。君不见,高堂明镜悲白发,朝如青丝暮成雪。',
'人生得意须尽欢,莫使金樽空对月',
'天生我材必有用,千金散尽还复来',
],
loading: true, //
animation: false,
elColor: '#e5e5e5',
borderRadius: 10,
}
},
computed: {
current() {
return this.loading ? 0 : 1;
},
},
onLoad() {
this.getData();
},
methods: {
animationChange(index) {
this.animation = index == 0 ? true : false;
this.getData();
},
loadingChange(index) {
this.loading = index == 0 ? true : false;
if(index == 0) this.getData();
},
styleChange(index) {
if(index == 0) {
this.elColor = this.$u.color['primary'];
this.borderRadius = 14;
} else {
this.elColor = '#e5e5e5';
this.borderRadius = 10;
}
this.getData();
},
getData() {
this.loading = true;
//
setTimeout(() => {
this.loading = false;
}, 3000)
}
}
}
</script>
<style lang="scss" scoped>
.container {
text-align: left;
font-size: 28rpx;
color: $u-content-color;
}
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.lists {
margin: 10px 0;
}
</style>

@ -0,0 +1,77 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-steps :direction="direction" :current="current" :list="steps" :mode="mode" :icon="icon"></u-steps>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection :list="['number', 'dot']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">方向</view>
<u-subsection :list="['横向', '竖向']" @change="directionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义图标</view>
<u-subsection :list="['否', '是']" @change="iconChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">当前步值</view>
<u-subsection :list="['1', '2', '3', '4']" @change="stepChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
steps: [{
name: '下单'
}, {
name: '出库'
}, {
name: '运输'
}, {
name: '签收'
}, ],
current: 0,
icon: 'checkmark',
mode: 'number',
direction: 'row'
}
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'number' : 'dot';
},
stepChange(index) {
this.current = [0, 1, 2, 3][index];
},
iconChange(index) {
this.icon = index == 0 ? 'checkmark' : 'map-fill';
},
directionChange(index) {
this.direction = index == 0 ? 'row' : 'column';
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
.box {
margin: 50rpx 0;
}
</style>

@ -0,0 +1,87 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-sticky :offset-top="offsetTop" :enable="enable" @fixed="fixed" @unfixed="unfixed">
<view class="sticky">
宝剑锋从磨砺出,梅花香自苦寒来
</view>
</u-sticky>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">吸顶高度</view>
<u-subsection :list="[0, 120, 200]" @change="offsetTopChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :list="['允许吸顶', '禁止吸顶']" @change="enableChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
offsetTop: 0,
enable: true,
}
},
methods: {
offsetTopChange(index) {
this.offsetTop = index == 0 ? 0 : index == 1 ? 120 : 200;
uni.pageScrollTo({
scrollTop: 0,
duration: 0
})
},
enableChange(index) {
this.enable = index == 0 ? true : false;
},
fixed() {
this.$refs.uToast.show({
type: 'warning',
title: '触发吸顶'
})
},
unfixed() {
this.$refs.uToast.show({
type: 'success',
title: '取消吸顶'
})
}
}
}
</script>
<style lang="scss" scoped>
.u-demo-area {
overflow: hidden;
}
.u-config-wrap {
height: 200vh;
}
.u-demo-title {
margin-bottom: 140rpx;
}
.sticky {
background-color: $u-type-primary;
color: #fff;
padding: 24rpx;
margin: auto;
font-size: 28rpx;
line-height: 1;
border-radius: 5px;
}
</style>

@ -0,0 +1,153 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-swipe-action
bg-color="rgb(250, 250, 250)"
@open="open"
:disabled="disabled"
:index="index"
v-for="(item, index) in list"
:key="item.id"
:show="item.show"
@click="click"
:btn-width="btnWidth"
@close="close"
:options="options"
@content-click="contentClick"
>
<view class="item u-border-bottom">
<image mode="aspectFill" :src="item.images" />
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
<text class="title u-line-2">{{ item.title }}</text>
</view>
</view>
</u-swipe-action>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态(操作第一个)</view>
<u-subsection :current="1" :list="['打开', '关闭']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">禁止滑动</view>
<u-subsection :current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list1: [
{
id: 1,
title: '长安回望绣成堆,山顶千门次第开,一骑红尘妃子笑,无人知是荔枝来',
images: 'https://cdn.uviewui.com/uview/common/logo.png',
show: false
},
{
id: 2,
title: '新丰绿树起黄埃,数骑渔阳探使回,霓裳一曲千峰上,舞破中原始下来',
images: 'https://cdn.uviewui.com/uview/common/logo.png',
show: false
},
{
id: 3,
title: '登临送目,正故国晚秋,天气初肃。千里澄江似练,翠峰如簇',
images: 'https://cdn.uviewui.com/uview/common/logo.png',
show: false,
}
],
list: [],
disabled: false,
btnWidth: 180,
show: false,
options: [
{
text: '收藏',
style: {
backgroundColor: '#007aff'
}
},
{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}
]
};
},
onLoad() {
setTimeout(() => {
this.list = this.list1;
}, 0)
},
methods: {
disabledChange(index) {
this.disabled = index == 0 ? true : false;
},
showChange(index) {
if (index == 0) {
this.list.map((val, ids) => {
if (ids != 0) val.show = false;
else val.show = true;
});
} else {
this.list[0].show = false;
}
},
click(index, index1) {
if(index1 == 1) {
this.list.splice(index, 1);
this.$u.toast(`删除了第${index}个cell`);
} else {
this.list[index].show = false;
this.$u.toast(`收藏成功`);
}
},
open(index) {
this.list[index].show = true;
this.list.map((val, idx) => {
if (index != idx) this.list[idx].show = false;
});
},
close(index) {
this.list[index].show = false;
},
contentClick(index) {
// console.log(index);
}
}
};
</script>
<style lang="scss" scoped>
.item {
display: flex;
padding: 20rpx;
}
image {
width: 120rpx;
flex: 0 0 120rpx;
height: 120rpx;
margin-right: 20rpx;
border-radius: 12rpx;
}
.title {
text-align: left;
font-size: 28rpx;
color: $u-content-color;
margin-top: 20rpx;
}
</style>

@ -0,0 +1,89 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-swiper @change="change" :height="250" :list="list" :title="title" :effect3d="effect3d"
:indicator-pos="indicatorPos" :mode="mode" :interval="3000" @click="click"></u-swiper>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">指示器模式</view>
<u-subsection :list="['round', 'rect', 'number', 'none']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">标题</view>
<u-subsection current="1" :list="['显示', '隐藏']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">指示器位置</view>
<u-subsection current="3" :list="['上左', '上右', '下左', '下中', '下右']" @change="indicatorPosChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">3D效果</view>
<u-subsection current="1" :list="['开启', '关闭']" @change="effect3dChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
title: false,
mode: 'round',
indicatorPos: 'bottomCenter',
effect3d: false,
}
},
methods: {
titleChange(index) {
this.title = index == 0 ? true : false;
},
modeChange(index) {
this.mode = index == 0 ? 'round' : index == 1 ? 'rect' : index == 2 ? 'number' : 'none';
},
indicatorPosChange(index) {
this.indicatorPos = index == 0 ? 'topLeft' : index == 1 ? 'topRight' : index == 2 ? 'bottomLeft' : index == 3 ? 'bottomCenter' : 'bottomRight';
},
effect3dChange(index) {
this.effect3d = index == 0 ? true : false;
},
click(index) {
this.$refs.uToast.show({
title: `点击了第${index + 1}张图片`,
type: 'success'
})
},
change(index) {
// console.log(index);
}
}
}
</script>
<style lang="scss" scoped>
.item {
margin: 30rpx 0;
}
</style>

@ -0,0 +1,113 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-switch v-model="checked" :loading="loading"
:size="size" @change="change"
:active-color="activeColor"
:disabled="disabled"
:activeValue="100"
:inactiveValue="1"
></u-switch>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :list="['关闭', '打开']" @change="modelChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">颜色</view>
<u-subsection :list="['primary', 'error', 'warning', 'success']" @change="colorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸(单位rpx)</view>
<u-subsection current="1" :list="['40', '60', '80']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">加载中</view>
<u-subsection :list="['否', '是']" @change="loadingChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">禁用</view>
<u-subsection current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">异步控制</view>
<u-subsection :list="['关闭', '打开']" @change="asyncChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
checked: false,
activeColor: '#2979ff',
size: 50,
loading: false,
disabled: false
}
},
methods: {
modelChange(index) {
// !!0false1true
this.checked = !!index;
},
colorChange(index) {
let color = index == 0 ? 'primary' : index == 1 ? 'error' : index == 2 ? 'warning' : 'success';
this.activeColor = this.$u.color[color];
},
sizeChange(index) {
this.size = index == 0 ? '40' : index == 1 ? '60' : '80';
},
loadingChange(index) {
this.loading = !!index;
},
disabledChange(index) {
this.disabled = index == 0 ? true : false;
},
asyncChange(index) {
if(this.checked && index == 1) {
this.$u.toast('请先关闭选择器');
return;
}
if(!this.checked && index == 0) {
this.$u.toast('请先打开选择器');
return;
}
let str = index == 0 ? '是否要关闭?' : '是否要打开?';
this.loading = true;
let oldStatus = this.checked;
this.checked = true;
uni.showModal({
title: '提示',
content: str,
complete: (res) => {
this.loading = false;
if(res.confirm) {
if(oldStatus) this.checked = false;
else this.checked = true;
} else {
if(!oldStatus) this.checked = false;
else this.checked = true;
}
}
})
},
change(value) {
// console.log(value);
}
}
}
</script>
<style scoped lang="scss">
.u-demo {}
</style>

@ -0,0 +1,133 @@
<template>
<view class="">
<view class="u-demo">
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :list="['显示', '隐藏']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">凸起按钮</view>
<u-subsection :list="['显示', '隐藏']" @change="minButtonChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">背景色</view>
<u-subsection :list="['#ffffff', '#1f1f1d']" @change="bgColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">顶部边框</view>
<u-subsection :list="['显示', '隐藏']" @change="borderTopChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">提示角标</view>
<u-subsection :list="['显示', '隐藏']" @change="badgeChange"></u-subsection>
</view>
</view>
</view>
<u-tabbar
v-model="current"
:show="show"
:bg-color="bgColor"
:border-top="borderTop"
:list="list"
:mid-button="midButton"
:inactive-color="inactiveColor"
:activeColor="activeColor"
></u-tabbar>
</view>
</template>
<script>
export default {
data() {
return {
current: 0,
show: true,
bgColor: '#ffffff',
borderTop: true,
list: [{
iconPath: "home",
selectedIconPath: "home-fill",
text: '首页',
count: 2,
isDot: true,
customIcon: false,
},
{
iconPath: "photo",
selectedIconPath: "photo-fill",
text: '放映厅',
customIcon: false,
},
{
iconPath: "/static/uview/example/min_button.png",
selectedIconPath: "/static/uview/example/min_button_select.png",
text: '发布',
midButton: true,
customIcon: false,
},
{
iconPath: "play-right",
selectedIconPath: "play-right-fill",
text: '直播',
customIcon: false,
},
{
iconPath: "account",
selectedIconPath: "account-fill",
text: '我的',
count: 23,
isDot: false,
customIcon: false,
},
],
midButton: true,
inactiveColor: '#909399',
activeColor: '#5098FF'
}
},
methods: {
beforeSwitch(index) {
return true;
},
showChange(index) {
this.show = !index;
},
bgColorChange(index) {
if(index == 0) {
this.activeColor = '#5098FF';
this.inactiveColor = '#909399';
}
if(index == 1) {
this.activeColor = '#D0D0D0';
this.inactiveColor = '#5A5A5A';
}
this.bgColor = ['#ffffff', '#1f1f1d'][index];
},
borderTopChange(index) {
this.borderTop = !index;
},
badgeChange(index) {
if (index == 1) {
this.list[0].count = 0;
this.list[4].count = 0;
} else {
this.list[0].count = 2;
this.list[4].count = 23;
}
},
minButtonChange(index) {
this.midButton = !index;
}
}
}
</script>
<style scoped lang="scss">
.u-demo-area {
margin: 0 -40rpx;
}
</style>

@ -0,0 +1,83 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-table :align="align" :borderColor="borderColor">
<u-tr class="u-tr">
<u-th class="u-th">姓名</u-th>
<u-th class="u-th">年龄</u-th>
<u-th class="u-th">籍贯</u-th>
<u-th class="u-th">性别</u-th>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">吕布</u-td>
<u-td class="u-td">22</u-td>
<u-td class="u-td">楚河</u-td>
<u-td class="u-td"></u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">项羽</u-td>
<u-td class="u-td">28</u-td>
<u-td class="u-td">汉界</u-td>
<u-td class="u-td"></u-td>
</u-tr>
<u-tr class="u-tr">
<u-td class="u-td">木兰</u-td>
<u-td class="u-td">24</u-td>
<u-td class="u-td">南国</u-td>
<u-td class="u-td"></u-td>
</u-tr>
</u-table>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">边框颜色</view>
<u-subsection :list="['gray', 'primary', 'warning']" @change="borderColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">对齐方式</view>
<u-subsection current="1" :list="['左', '中', '右']" @change="alignChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: false,
borderColor: '#e4e7ed',
align: 'center',
index: 0,
}
},
methods: {
modeChange(index) {
// #ifdef MP-WEIXIN
return this.$u.toast('微信小程序暂不支持单元格合并')
// #endif
this.mode = index == 0 ? true : false;
this.key ++;
},
borderColorChange(index) {
this.borderColor = index == 0 ? '#e4e7ed' : index == 1 ? '#2979ff' : '#ff9900';
},
alignChange(index) {
this.align = index == 0 ? 'left' : index == 1 ? 'center' : 'right';
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
</style>

@ -0,0 +1,224 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="pre-box" v-if="!showUploadList">
<view class="pre-item" v-for="(item, index) in lists" :key="index">
<image class="pre-item-image" :src="item.url" mode="aspectFill"></image>
<view class="u-delete-icon" @tap.stop="deleteItem(index)">
<u-icon name="close" size="20" color="#ffffff"></u-icon>
</view>
<u-line-progress v-if="item.progress > 0 && !item.error" :show-percent="false" height="16" class="u-progress"
:percent="item.progress"></u-line-progress>
</view>
</view>
<u-upload @on-choose-fail="onChooseFail" :before-remove="beforeRemove" ref="uUpload" :custom-btn="customBtn" :show-upload-list="showUploadList" :action="action" :auto-upload="autoUpload" :file-list="fileList"
:show-progress="showProgress" :deletable="deletable" :max-count="maxCount" @on-list-change="onListChange">
<view v-if="customBtn" slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<u-icon name="photo" size="60" :color="$u.color['lightColor']"></u-icon>
</view>
</u-upload>
<u-button :custom-style="{marginTop: '20rpx'}" @click="upload"></u-button>
<u-button :custom-style="{marginTop: '40rpx'}" @click="clear"></u-button>
<!-- <u-button :custom-style="{marginTop: '40rpx'}" @click="reUpload"></u-button> -->
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">上传方式</view>
<u-subsection current="1" :list="['自动上传', '手动上传']" @change="autoUploadChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义控件(进度条和删除按钮)</view>
<u-subsection :list="['显示', '隐藏']" @change="controlChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">最大上传数量</view>
<u-subsection current="1" :list="['1', '2', '4']" @change="maxCountChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式(预览区域和上传按钮)</view>
<u-subsection current="1" :list="['是', '否']" @change="customStyleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
action: 'http://127.0.0.1:7001/upload',
//
fileList: [],
// fileList: [{
// url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
// error: false,
// progress: 100
// }],
showUploadList: true,
customBtn: false,
autoUpload: false,
showProgress: true,
deletable: true,
customStyle: false,
maxCount: 2,
lists: [], //
}
},
onLoad() {
},
methods: {
reUpload() {
this.$refs.uUpload.reUpload();
},
clear() {
this.$refs.uUpload.clear();
},
autoUploadChange(index) {
this.autoUpload = index == 0 ? true : false;
},
controlChange(index) {
if(index == 0) {
this.showProgress = true;
this.deletable = true;
} else {
this.showProgress = false;
this.deletable = false;
}
},
maxCountChange(index) {
this.maxCount = index == 0 ? 1 : index == 1 ? 2 : 4;
},
customStyleChange(index) {
if (index == 0) {
this.showUploadList = false;
this.customBtn = true;
} else {
this.showUploadList = true;
this.customBtn = false;
}
},
upload() {
this.$refs.uUpload.upload();
},
deleteItem(index) {
this.$refs.uUpload.remove(index);
},
onOversize(file, lists) {
// console.log('onOversize', file, lists);
},
onPreview(url, lists) {
// console.log('onPreview', url, lists);
},
onRemove(index, lists) {
// console.log('onRemove', index, lists);
},
onSuccess(data, index, lists) {
// console.log('onSuccess', data, index, lists);
},
onChange(res, index, lists) {
// console.log('onChange', res, index, lists);
},
error(res, index, lists) {
// console.log('onError', res, index, lists);
},
onProgress(res, index, lists) {
// console.log('onProgress', res, index, lists);
},
onUploaded(lists) {
// console.log('onUploaded', lists);
},
onListChange(lists) {
// console.log('onListChange', lists);
this.lists = lists;
},
beforeRemove(index, lists) {
return true;
},
onChooseFail(e) {
// console.log(e);
}
}
}
</script>
<style lang="scss">
.u-demo-wrap {
background-color: #FFFFFF;
padding: 40rpx 8rpx;
margin-left: -14rpx;
margin-right: -14rpx;
}
.u-add-wrap {
flex-direction: column;
color: $u-content-color;
font-size: 28rpx;
}
/deep/ .slot-btn {
width: 329rpx;
height: 140rpx;
display: flex;
justify-content: center;
align-items: center;
background: rgb(244, 245, 246);
border-radius: 10rpx;
}
.slot-btn__hover {
background-color: rgb(235, 236, 238);
}
.pre-box {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
.pre-item {
flex: 0 0 48.5%;
border-radius: 10rpx;
height: 140rpx;
overflow: hidden;
position: relative;
margin-bottom: 20rpx;
}
.u-progress {
position: absolute;
bottom: 10rpx;
left: 8rpx;
right: 8rpx;
z-index: 9;
width: auto;
}
.pre-item-image {
width: 100%;
height: 140rpx;
}
.u-delete-icon {
position: absolute;
top: 10rpx;
right: 10rpx;
z-index: 10;
background-color: $u-type-error;
border-radius: 100rpx;
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

@ -0,0 +1,224 @@
<template>
<view class="wrap">
<u-waterfall v-model="flowList" ref="uWaterfall">
<template v-slot:left="{ leftList }">
<view class="demo-warter" v-for="(item, index) in leftList" :key="index">
<!-- 微信小程序需要hx2.8.11版本才支持在template中引入其他组件比如下方的u-lazy-load组件 -->
<u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load>
<view class="demo-title">{{ item.title }}</view>
<view class="demo-price">{{ item.price }}</view>
<view class="demo-tag">
<view class="demo-tag-owner">自营</view>
<view class="demo-tag-text">放心购</view>
</view>
<view class="demo-shop">{{ item.shop }}</view>
<view class="u-close">
<u-icon name="close-circle-fill" color="#fa3534" size="34" @click="remove(item.id)"></u-icon>
</view>
</view>
</template>
<template v-slot:right="{ rightList }">
<view class="demo-warter" v-for="(item, index) in rightList" :key="index">
<u-lazy-load threshold="-450" border-radius="10" :image="item.image" :index="index"></u-lazy-load>
<view class="demo-title">{{ item.title }}</view>
<view class="demo-price">{{ item.price }}</view>
<view class="demo-tag">
<view class="demo-tag-owner">自营</view>
<view class="demo-tag-text">放心购</view>
</view>
<view class="demo-shop">{{ item.shop }}</view>
<view class="u-close">
<u-icon name="close-circle-fill" color="#fa3534" size="34" @click="remove(item.id)"></u-icon>
</view>
</view>
</template>
</u-waterfall>
<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="addRandomData"></u-loadmore>
</view>
</template>
<script>
export default {
data() {
return {
loadStatus: 'loadmore',
flowList: [],
list: [
{
price: 35,
title: '北国风光,千里冰封,万里雪飘',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg'
},
{
price: 75,
title: '望长城内外,惟余莽莽',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg'
},
{
price: 385,
title: '大河上下,顿失滔滔',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'
},
{
price: 784,
title: '欲与天公试比高',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg'
},
{
price: 7891,
title: '须晴日,看红装素裹,分外妖娆',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg'
},
{
price: 2341,
shop: '李白杜甫白居易旗舰店',
title: '江山如此多娇,引无数英雄竞折腰',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg'
},
{
price: 661,
shop: '李白杜甫白居易旗舰店',
title: '惜秦皇汉武,略输文采',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23344_s.jpg'
},
{
price: 1654,
title: '唐宗宋祖,稍逊风骚',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg'
},
{
price: 1678,
title: '一代天骄,成吉思汗',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg'
},
{
price: 924,
title: '只识弯弓射大雕',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg'
},
{
price: 8243,
title: '俱往矣,数风流人物,还看今朝',
shop: '李白杜甫白居易旗舰店',
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23343_s.jpg'
}
]
};
},
onLoad() {
this.addRandomData();
},
onReachBottom() {
this.loadStatus = 'loading';
//
setTimeout(() => {
this.addRandomData();
this.loadStatus = 'loadmore';
}, 1000);
},
methods: {
addRandomData() {
for (let i = 0; i < 10; i++) {
let index = this.$u.random(0, this.list.length - 1);
//
let item = JSON.parse(JSON.stringify(this.list[index]));
item.id = this.$u.guid();
this.flowList.push(item);
}
},
remove(id) {
this.$refs.uWaterfall.remove(id);
},
clear() {
this.$refs.uWaterfall.clear();
}
}
};
</script>
<style>
/* page不能写带scope的style标签中否则无效 */
page {
background-color: rgb(240, 240, 240);
}
</style>
<style lang="scss" scoped>
.demo-warter {
border-radius: 8px;
margin: 5px;
background-color: #ffffff;
padding: 8px;
position: relative;
}
.u-close {
position: absolute;
top: 32rpx;
right: 32rpx;
}
.demo-img-wrap {
}
.demo-image {
width: 100%;
border-radius: 4px;
}
.demo-title {
font-size: 30rpx;
margin-top: 5px;
color: $u-main-color;
word-break: break-all;
}
.demo-tag {
display: flex;
margin-top: 5px;
}
.demo-tag-owner {
background-color: $u-type-error;
color: #ffffff;
display: flex;
align-items: center;
padding: 4rpx 14rpx;
border-radius: 50rpx;
font-size: 20rpx;
line-height: 1;
}
.demo-tag-text {
border: 1px solid $u-type-primary;
color: $u-type-primary;
margin-left: 10px;
border-radius: 50rpx;
line-height: 1;
padding: 4rpx 14rpx;
display: flex;
align-items: center;
border-radius: 50rpx;
font-size: 20rpx;
}
.demo-price {
font-size: 30rpx;
color: $u-type-error;
margin-top: 5px;
}
.demo-shop {
font-size: 22rpx;
color: $u-tips-color;
margin-top: 5px;
}
</style>

@ -0,0 +1,82 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-button @click="showAction">ActionSheet</u-button>
<u-action-sheet :cancel-btn="cancel" :mask-close-able="maskClick" :tips="tips"
@click="click" :list="list" v-model="show" :safe-area-inset-bottom="true"></u-action-sheet>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">取消按钮</view>
<u-subsection :list="['是', '否']" @change="cancelChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">点击遮罩关闭</view>
<u-subsection :list="['是', '否']" @change="maskClickChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
text: '最是人间留不住',
}, {
text: '朱颜辞镜花辞树',
disabled: true
}, {
text: '正是江南好风景',
subText: '春江水暖鸭先知'
}, {
text: '落花时节又逢君'
}],
tips: {
text: ''
},
show: false,
cancel: true,
maskClick: true
}
},
methods: {
showAction() {
this.show = true;
},
click(index) {
this.$refs.uToast.show({
type: 'success',
title: '点击了第' + (index + 1) + '项'
})
},
tipsChange(index) {
if(index == 0) this.show = true;
this.tips.text = index == 0 ? '请谨慎执行您的操作' : ''
},
cancelChange(index) {
this.show = true;
this.cancel = index == 0 ? true : false
},
maskClickChange(index) {
if(index == 1) this.cancel = true;
this.show = true;
this.maskClick = index == 0 ? true : false
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
</style>

@ -0,0 +1,90 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-alert-tips @close="close" :closeAble="closeAble" :show="show" @click="click"
:type="type" :title="title" :description="description" :showIcon="showIcon"></u-alert-tips>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">左侧图标</view>
<u-subsection current="1" :list="['是', '否']" @change="showIconChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">关闭图标</view>
<u-subsection current="1" :list="['显示', '隐藏']" @change="closeAbleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">主题</view>
<u-subsection current="3" :list="['primary', 'success', 'error', 'warning', 'info']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['开启', '关闭']" @change="showChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '大漠孤烟直,长河落日圆',
description: "月落乌啼霜满天,江枫渔火对愁眠。姑苏城外寒山寺,夜半钟声到客船。飞流直下三千尺,疑是银河落九天!",
show: true,
closeAble: false,
showIcon: false,
type: 'warning',
}
},
computed: {
current() {
return this.show ? 0 : 1;
}
},
methods: {
showIconChange(index) {
this.showIcon = index == 0 ? true : false;
},
showChange(index) {
this.show = index == 0 ? true : false;
},
closeAbleChange(index) {
this.closeAble = index == 0 ? true : false;
},
typeChange(index) {
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'info';
},
close() {
this.show = false;
this.$refs.uToast.show({
type: 'warning',
title: '点击关闭按钮'
})
},
click() {
this.$refs.uToast.show({
type: 'warning',
title: '点击内容'
})
},
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
.item {
margin: 30rpx 0;
}
</style>

@ -0,0 +1,83 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="u-badge-wrap"><u-badge :is-center="isCenter" :type="type" :count="count" :is-dot="isDot" :offset="offset" :size="size"></u-badge></view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">数值显示</view>
<u-subsection current="1" :list="[0, 8, 15, 106, 209]" @change="countChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">主题选择</view>
<u-subsection current="2" :list="['primary', 'success', 'error', 'warning', 'info']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示点</view>
<u-subsection current="1" :list="['是', '否']" @change="isDotChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸</view>
<u-subsection :list="['default', 'mini']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">位置偏移</view>
<u-subsection current="1" :list="['[20, 20]', '[-8, -8]', '[-20, -20]']" @change="offsetChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">中心点与父右上角重合</view>
<u-subsection current="1" :list="['是', '否']" @change="isCenterChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
count: 8,
type: 'error',
isDot: false,
offset: [-8, -8],
size: 'default',
isCenter: false
};
},
methods: {
countChange(index) {
this.count = index == 0 ? 0 : index == 1 ? 8 : index == 2 ? 15 : index == 3 ? 106 : 209;
},
typeChange(index) {
this.type = index == 0 ? 'primary' : index == 1 ? 'success' : index == 2 ? 'error' : index == 3 ? 'warning' : 'info';
},
sizeChange(index) {
this.size = index == 0 ? 'default' : 'mini';
},
isDotChange(index) {
this.isDot = index == 0 ? true : false;
},
offsetChange(index) {
this.offset = index == 0 ? [20, 20] : index == 1 ? [-8, -8] : [-20, -20];
},
isCenterChange(index) {
this.isCenter = index == 0 ? true : false;
}
}
};
</script>
<style lang="scss" scoped>
.u-badge-wrap {
width: 60px;
height: 60px;
border-radius: 6px;
background-color: $u-light-color;
position: relative;
margin: auto;
}
</style>

@ -0,0 +1,121 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-button @click="btnClick" data-name="3333" :loading="loading" :plain="plain" :shape="shape" :size="size" :ripple="ripple" :hairLine="hairLine" :type="type">山川异域风月同天</u-button>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">主题选择</view>
<u-subsection :list="['default', 'primary', 'error', 'warning', 'success']" @change="typeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">尺寸大小</view>
<u-subsection :list="['默认', '中等', '迷你']" @change="sizeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">形状</view>
<u-subsection :list="['直角', '圆角']" @change="shapeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">镂空</view>
<u-subsection :current="1" :list="['是', '否']" @change="plainChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">水波纹(感觉哪里有问题点击顶部的按钮试试)</view>
<u-subsection :current="1" :list="['是', '否']" @change="rippleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">细边框</view>
<u-subsection :list="['是', '否']" @change="hairLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">加载中</view>
<u-subsection :current="1" :list="['是', '否']" @change="loadingChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
hairLine: true,
type: 'default',
size: 'default',
shape: 'square',
plain: false,
ripple: false,
loading: false,
}
},
methods: {
typeChange(e) {
switch (e) {
case 0:
this.type = 'default';
break;
case 1:
this.type = 'primary';
break;
case 2:
this.type = 'error';
break;
case 3:
this.type = 'warning';
break;
case 4:
this.type = 'success';
break;s
}
},
sizeChange(e) {
switch (e) {
case 0:
this.size = 'default';
break;
case 1:
this.size = 'medium';
break;
case 2:
this.size = 'mini';
break;
}
},
shapeChange(e) {
this.shape = e == 0 ? 'square' : 'circle';
},
plainChange(e) {
this.plain = e == 0 ? true : false;
},
rippleChange(e) {
this.ripple = e == 0 ? true : false;
},
hairLineChange(e) {
this.hairLine = e == 0 ? true : false;
},
loadingChange(index) {
this.loading = index == 0 ? true : false;
},
btnClick() {
this.$u.toast('按钮被点击')
},
}
}
</script>
<style lang="scss" scoped>
.box {
padding: 30rpx;
}
.box /deep/ button {
margin-bottom: 40rpx;
}
</style>

@ -0,0 +1,113 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap" style="padding-left:0;padding-right:0;margin-left: -40rpx;margin-right: -40rpx;">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-cell-group title="读万卷书">
<u-cell-item center :is-link="true" :label="label" value="铁马冰河入梦来" i ndex="index" @click="click" :hover-class="hoverClass"
:arrow="arrow" :title="title" :icon="icon">
<u-badge :absolute="false" v-if="rightSlot == 'badge'" count="105" slot="right-icon"></u-badge>
<u-switch v-if="rightSlot == 'switch'" slot="right-icon" v-model="checked"></u-switch>
</u-cell-item>
<u-cell-item :border-bottom="false" value="" title="铁马冰河入梦来" value="行万里路" :arrow="false">
<u-icon slot="icon" size="34" name="calendar" style="margin-right: 5px;"></u-icon>
<u-icon slot="right-icon" size="34" name="calendar"></u-icon>
<u-field slot="value"></u-field>
</u-cell-item>
</u-cell-group>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">更换图标</view>
<u-subsection :list="['是', '否']" @change="iconChange"></u-subsection>
</view>
<!-- 小程序无法动态切换slot -->
<!-- #ifndef MP -->
<view class="u-config-item">
<view class="u-item-title">自定义右侧内容</view>
<u-subsection :list="['文字', 'Switch组件', 'Badge组件']" @change="rightSlotChange"></u-subsection>
</view>
<!-- #endif -->
<view class="u-config-item">
<view class="u-item-title">描述信息</view>
<u-subsection current="1" :list="['是', '否']" @change="lableChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">更换标题</view>
<u-subsection :list="['是', '否']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">右侧箭头</view>
<u-subsection :list="['是', '否']" @change="arrowChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
icon: 'setting',
arrow: true,
label: '',
title: '青山一道同云雨',
rightSlot: true,
checked: false,
}
},
computed: {
hoverClass() {
// switchcellswitch
return this.rightSlot == 'switch' ? 'none' : 'u-cell-hover';
}
},
methods: {
iconChange(index) {
this.icon = index == 0 ? 'setting' : 'file-text'
},
arrowChange(index) {
this.arrow = index == 0 ? true : false
},
lableChange(index) {
this.label = index == 0 ? '岂曰无衣,与子同裳' : ''
},
titleChange(index) {
this.title = index == 0 ? '青山一道同云雨' : '明月何曾是两乡'
},
rightSlotChange(index) {
this.rightSlot = index == 0 ? 'text' : index == 1 ? 'switch' : 'badge'
if (index == 0) this.arrow = true;
else this.arrow = false;
},
click(index) {
// console.log(index);
}
}
};
</script>
<style lang="scss" scoped>
.gab {
background-color: rgb(245, 245, 245);
height: 20rpx;
}
.wrap {
height: 100vh;
background-color: rgb(241, 241, 241);
}
.box {
padding: 30rpx 00rpx;
font-size: 28rpx;
color: $u-type-info;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>

@ -0,0 +1,65 @@
<template>
<view class="wrap">
<view class="item">
<u-circle-progress type="warning" :percent="percent">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<text class='u-progress-info'>查找中</text>
</view>
</u-circle-progress>
<u-circle-progress type="warning" :width="150" :percent="percent">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<text class='u-progress-info'>查找中</text>
</view>
</u-circle-progress>
</view>
<view class="item">
<u-line-progress></u-line-progress>
</view>
</view>
</template>
<script>
export default {
data() {
return {
percent: 33
}
},
onLoad() {
setTimeout(() => {
this.percent = 50;
}, 1500);
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
.u-progress-content {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
}
.u-progress-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #fb9126;
}
.u-progress-info {
font-size: 28rpx;
padding-left: 16rpx;
letter-spacing: 2rpx
}
</style>

@ -0,0 +1,142 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap" style="background-color: #ffffff;">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-collapse v-if="key" :item-style="itemStyle" event-type="close" :arrow="arrow" :accordion="accordion" @change="change">
<u-collapse-item :index="index" @change="itemChange" :title="item.head" v-for="(item, index) in itemList" :key="index">
{{item.body}}
</u-collapse-item>
</u-collapse>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">手风琴模式</view>
<u-subsection :list="['是', '否']" @change="accordionChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">右侧箭头</view>
<u-subsection :list="['显示', '隐藏']" @change="arrowChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
itemList: [{
head: "赏识在于角度的转换",
body: "只要我们正确择取一个合适的参照物乃至稍降一格去看待他人,值得赏识的东西便会扑面而来:闪光的道德、妙异的智慧、优美的人情…… 赏识不是单向的施舍,是智慧与智慧的主动碰撞",
show: false,
}, {
head: "生活中不是缺少美,而是缺少发现美的眼睛",
body: "学会欣赏,实际是一种积极生活的态度,是生活的调味品,会在欣赏中发现生活的美",
show: false,
}, {
head: "周围一些不起眼的人、事、物,或许都隐藏着不同凡响的智慧",
body: "但是据说雕刻大卫像所用的这块大理石,曾被多位雕刻家批评得一无是处,有些人认为这块大理石采凿得不好,有些人嫌它的纹路不够美,用它绝对雕不出好的艺术品,总之它被批评为一块不受人赏识的普通石头",
show: false,
}, {
head: "点燃心中的火焰,找回了自信和人生的价值",
body: "他随手翻了几页,竟被一篇题名为《童年》的小说所吸引,作者是一个初出茅庐的无名小辈,但屠格涅夫却十分欣赏,钟爱有加",
show: false,
}, {
head: "因为赏识,那块被人不耻的石头变成了雕塑",
body: "这个材料反应的就是赏识的问题,赏识是一种理解和信任,包含了肯定与欣赏,也是一种激励和引导,可以使人悔过自新,扬长避短,更健康地成长和进步",
show: false,
}],
accordion: true,
arrow: true,
hoverClass: 'hover2',
itemStyle: {},
key: true
}
},
methods: {
accordionChange(index) {
this.accordion = index == 0 ? true : false;
},
arrowChange(index) {
this.arrow = index == 0 ? true : false;
this.changeStatus();
},
styleChange(index) {
if(index == 0) {
this.itemStyle = {
border: '1px solid rgb(230, 230, 230)',
marginTop: '20px',
padding: '0 8rpx'
}
} else {
this.itemStyle = {}
}
this.changeStatus();
},
change(index) {
let str = '';
if(Array.isArray(index)) {
let arr = index.map(val => {
return Number(val) + 1;
})
index = arr.join(',');
} else {
index = Number(index) + 1;
}
this.$refs.uToast.show({
title: `点击了第${index}`,
type: 'warning'
})
},
itemChange(e) {
console.log(e);
},
changeStatus() {
this.key = false;
this.$nextTick(function(){
this.key = true;
})
}
}
}
</script>
<style>
.hover1 {
background-color: red;
}
</style>
<style lang="scss" scoped>
.wrap {
// padding: 24rpx;
}
.item {
//padding: 0 24rpx;
}
.head {
font-size: 30rpx;
color: $u-main-color;
line-height: 1;
padding: 24rpx 24rpx;
}
.body {
font-size: 28rpx;
color: $u-tips-color;
line-height: 1.4;
padding: 24rpx;
}
</style>

@ -0,0 +1,364 @@
<template>
<view class="wrap">
<view class="item">
<view class="title">
主色调
</view>
<view class="color-box">
<view class="color-item" style="background: #2979ff;">
<view class="color-title">
Primary
</view>
<view class="color-value">
#2979ff
</view>
</view>
<view class="color-item" style="background: #2b85e4;">
<view class="color-title">
Dark
</view>
<view class="color-value">
#2b85e4
</view>
</view>
<view class="color-item" style="background: #a0cfff;">
<view class="color-title">
Disabled
</view>
<view class="color-value">
#a0cfff
</view>
</view>
<view class="color-item" style="background: #ecf5ff;color: #909399;">
<view class="color-title">
Light
</view>
<view class="color-value">
#ecf5ff
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
Error
</view>
<view class="color-box">
<view class="color-item" style="background: #fa3534;">
<view class="color-title">
Error
</view>
<view class="color-value">
#fa3534
</view>
</view>
<view class="color-item" style="background: #dd6161;">
<view class="color-title">
Dark
</view>
<view class="color-value">
#dd6161
</view>
</view>
<view class="color-item" style="background: #fab6b6;">
<view class="color-title">
Disabled
</view>
<view class="color-value">
#fab6b6
</view>
</view>
<view class="color-item" style="background: #fef0f0;color: #909399;">
<view class="color-title">
Light
</view>
<view class="color-value">
#fef0f0
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
Warning
</view>
<view class="color-box">
<view class="color-item" style="background: #ff9900;">
<view class="color-title">
Warning
</view>
<view class="color-value">
#ff9900
</view>
</view>
<view class="color-item" style="background: #f29100;">
<view class="color-title">
Dark
</view>
<view class="color-value">
#f29100
</view>
</view>
<view class="color-item" style="background: #fcbd71;">
<view class="color-title">
Disabled
</view>
<view class="color-value">
#fcbd71
</view>
</view>
<view class="color-item" style="background: #fdf6ec;color: #909399;">
<view class="color-title">
Light
</view>
<view class="color-value">
#fdf6ec
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
Info
</view>
<view class="color-box">
<view class="color-item" style="background: #909399;">
<view class="color-title">
Info
</view>
<view class="color-value">
#909399
</view>
</view>
<view class="color-item" style="background: #82848a;">
<view class="color-title">
Dark
</view>
<view class="color-value">
#82848a
</view>
</view>
<view class="color-item" style="background: #c8c9cc;">
<view class="color-title">
Disabled
</view>
<view class="color-value">
#c8c9cc
</view>
</view>
<view class="color-item" style="background: #f4f4f5;color: #909399;">
<view class="color-title">
Light
</view>
<view class="color-value">
#f4f4f5
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
Success
</view>
<view class="color-box">
<view class="color-item" style="background: #19be6b;">
<view class="color-title">
Success
</view>
<view class="color-value">
#19be6b
</view>
</view>
<view class="color-item" style="background: #18b566;">
<view class="color-title">
Dark
</view>
<view class="color-value">
#18b566
</view>
</view>
<view class="color-item" style="background: #71d5a1;">
<view class="color-title">
Disabled
</view>
<view class="color-value">
#71d5a1
</view>
</view>
<view class="color-item" style="background: #dbf1e1;color: #909399;">
<view class="color-title">
Light
</view>
<view class="color-value">
#dbf1e1
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
文字颜色
</view>
<view class="color-box">
<view class="color-item" style="background: #303133;">
<view class="color-title">
主要文字
</view>
<view class="color-value">
#303133
</view>
</view>
<view class="color-item" style="background: #606266;">
<view class="color-title">
常规文字
</view>
<view class="color-value">
#606266
</view>
</view>
<view class="color-item" style="background: #909399;">
<view class="color-title">
次要文字
</view>
<view class="color-value">
#909399
</view>
</view>
<view class="color-item" style="background: #c0c4cc;">
<view class="color-title">
占位文字
</view>
<view class="color-value">
#c0c4cc
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
边框颜色
</view>
<view class="color-box">
<view class="color-item" style="background: #dcdfe6;color: #909399;">
<view class="color-title">
一级边框
</view>
<view class="color-value">
#dcdfe6
</view>
</view>
<view class="color-item" style="background: #e4e7ed;color: #909399;">
<view class="color-title">
二级边框
</view>
<view class="color-value">
#e4e7ed
</view>
</view>
<view class="color-item" style="background: #ebeef5;color: #909399;">
<view class="color-title">
三级边框
</view>
<view class="color-value">
#ebeef5
</view>
</view>
<view class="color-item" style="background: #f2f6fc;color: #909399;">
<view class="color-title">
四级边框
</view>
<view class="color-value">
#f2f6fc
</view>
</view>
</view>
</view>
<view class="item">
<view class="title">
背景颜色
</view>
<view class="color-box">
<view class="color-item" style="background: #f3f4f6;color: #909399;">
<view class="color-title">
背景颜色
</view>
<view class="color-value">
#f3f4f6
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
onLoad() {
getApp().globalData.username = 'test12';
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 18rpx;
}
.item {
margin: 30rpx 0;
margin-top: 44rpx;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
.title {
font-size: 30rpx;
position: relative;
line-height: 1;
padding-left: 22rpx;
&:before {
width: 4px;
height: 15px;
border-radius: 100rpx;
background-color: $u-content-color;
content: '';
position: absolute;
left: 6rpx;
top: -1px;
}
}
.color-box {
display: flex;
align-items: center;
justify-content: space-between;
color: #fff;
text-align: center;
margin-top: 20rpx;
.color-item {
display: flex;
flex: 1;
margin: 0 8rpx;
flex-direction: column;
border-radius: 6rpx;
padding: 12rpx 0;
}
.color-title {
font-size: 28rpx;
}
.color-value {
font-size: 24rpx;
}
}
}
</style>

@ -0,0 +1,100 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-count-down class="count-down-demo" :timestamp="timestamp" :separator="separator" :showBorder="showBorder"
:separator-color="separatorColor" :showDays="showDays" :fontSize="fontSize" @change="change" ref="uCountDown"
:border-color="borderColor" :color="color" @end="end" bg-color="rgb(250, 250, 250)"></u-count-down>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">调整时间</view>
<u-subsection :list="['60', '86400', '983272']" @change="timestampChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">分隔符</view>
<u-subsection :list="['英文冒号', '中文名称']" @change="separatorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示天</view>
<u-subsection current="1" :list="['是', '否']" @change="showDaysChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">字体大小</view>
<u-subsection current="1" :list="['26', '30', '34']" @change="fontSizeChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
timestamp: 60,
separator: 'colon',
showBorder: false,
borderColor: '#303133',
color: '#303133',
showDays: false,
fontSize: 30,
separatorColor: '#303133',
};
},
methods: {
timestampChange(index) {
this.timestamp = index == 0 ? 60 : index == 1 ? 86400 : 983272;
},
separatorChange(index) {
this.separator = index == 0 ? 'colon' : 'zh';
},
styleChange(index) {
if(index == 0) {
this.showBorder = true;
this.borderColor = this.$u.color['primary'];
this.color = this.$u.color['primary'];
this.separatorColor = this.$u.color['primary'];
} else {
this.showBorder = false;
this.borderColor = '#303133';
this.color = '#303133';
this.separatorColor = '#303133';
}
},
showDaysChange(index) {
this.showDays = index == 0 ? true : false;
},
fontSizeChange(index) {
this.fontSize = index == 0 ? 26 : index == 1 ? 30 : 34;
},
end() {
this.$refs.uToast.show({
title: '倒计时结束',
type: 'warning'
})
},
change(timestamp) {
// console.log(timestamp);
},
getSeconds() {
// console.log(this.$refs.uCountDown.seconds);
}
}
};
</script>
<style scoped lang="scss">
.count-down-demo {
justify-content: center;
}
</style>

@ -0,0 +1,132 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="u-no-demo-here">如果使用text-align: center对齐数字滚动期间可能会抖动见文档说明</view>
<view class="count-to-demo">
<u-count-to
class="count-to"
:useEasing="useEasing"
ref="uCountTo"
:autoplay="autoplay"
:startVal="startVal"
:endVal="endVal"
:duration="duration"
:decimals="decimals"
:bold="bold"
@end="end"
></u-count-to>
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['启动', '暂停', '继续', '重置']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">目标值</view>
<u-subsection :list="[608, 5604, 45617]" @change="endValChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">滚动时间</view>
<u-subsection current="1" :list="[1000, 2000, 3000]" @change="durationChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示小数</view>
<u-subsection current="1" :list="['是', '否']" @change="decimalsChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">字体加粗</view>
<u-subsection current="1" :list="['是', '否']" @change="boldChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
startVal: 0,
endVal: 608,
separator: ',',
decimals: 0,
duration: 2000,
autoplay: false,
useEasing: true,
current: 3,
isStop: false, // ""NaN
bold: false
};
},
methods: {
endValChange(index) {
this.endVal = index == 0 ? 608 : index == 1 ? 5604 : 45617;
this.reset();
this.start();
},
durationChange(index) {
this.duration = index == 0 ? 1000 : index == 1 ? 2000 : 3000;
},
boldChange(index) {
this.bold = !!!index;
},
decimalsChange(index) {
this.decimals = index == 0 ? 2 : 0;
},
statusChange(index) {
this.current = index;
if (index == 0) {
this.start();
} else if (index == 1) {
this.stop();
} else if (index == 2) {
this.resume();
} else {
this.reset();
}
},
end() {
this.current = 3;
this.$refs.uToast.show({
type: 'warning',
title: '滚动结束'
});
},
start() {
this.current = 0;
this.isStop = true;
this.$refs.uCountTo.start();
},
stop() {
this.$refs.uCountTo.stop();
},
resume() {
if (!this.isStop) {
this.$refs.uToast.show({
type: 'error',
title: '请开始并暂停后才能继续'
});
this.$nextTick(() => {
this.current = 3;
});
return;
}
this.$refs.uCountTo.resume();
},
reset() {
this.$refs.uCountTo.reset();
}
}
};
</script>
<style lang="scss" scoped>
.count-to-demo {
text-align: center;
}
</style>

@ -0,0 +1,63 @@
<!--
* @Desc: --- ----
* @Date: 2020-04-22 12:29:21
* @LastEditors:
* @LastEditTime: 2020-04-22 18:33:28
-->
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-gap :bg-color="bgColor" :height="height" :margin-top="marginTop" :margin-bottom="marginBottom"></u-gap>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">背景颜色</view>
<u-subsection :list="['default', 'primary', 'error', 'warning', 'success']" @change="bgColorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">高度</view>
<u-subsection :list="['30', '50', '70']" @change="heightChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">上下外边距</view>
<u-subsection :list="['30', '50', '70']" @change="marginChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
height: 30,
bgColor: this.$u.color.bgColor,
marginTop: 30,
marginBottom: 30
};
},
methods: {
bgColorChange(index) {
let color = index == 0 ? 'default' : index == 1 ? 'primary' : index == 2 ? 'error' : index == 3 ? 'warning' : 'success';
this.bgColor = color == 'default' ? this.$u.color['bgColor'] : this.$u.color[color];
},
heightChange(index) {
this.height = index == 0 ? 30 : index == 1 ? 50 : 70;
},
marginChange(index) {
this.marginTop = ['30', '50', '70'][index];
this.marginBottom = this.marginTop;
}
}
};
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
</style>

@ -0,0 +1,180 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-grid :col="col" @click="click" v-if="!isSwiper" :border="border">
<u-grid-item name="item1" :index="0" @click="itemClick">
<u-badge count="9" :offset="[col == 3 ? 20 : 14, col == 3 ? 30 : 20]"></u-badge>
<u-icon name="photo" :size="46"></u-icon>
<view class="grid-text">图片</view>
</u-grid-item>
<u-grid-item :index="1">
<u-icon name="lock" :size="46"></u-icon>
<view class="grid-text">锁头</view>
</u-grid-item>
<u-grid-item :index="2">
<image src="https://cdn.uviewui.com/uview/grid/hot5.png" :style="{
top: col == 3 ? '14rpx' : '8rpx',
right: col == 3 ? '40rpx' : '28rpx'
}" style="width: 34rpx;height: 34rpx;" class="badge-icon" mode="widthFix"></image>
<u-icon name="hourglass" :size="46"></u-icon>
<view class="grid-text">沙漏</view>
</u-grid-item>
<u-grid-item :index="3">
<u-icon name="home" :size="46"></u-icon>
<view class="grid-text">首页</view>
</u-grid-item>
<u-grid-item :index="4">
<u-icon name="star" :size="46"></u-icon>
<view class="grid-text">星星</view>
</u-grid-item>
<u-grid-item :index="5">
<u-icon name="volume-up" :size="46"></u-icon>
<view class="grid-text">音量</view>
</u-grid-item>
<u-grid-item :index="6">
<image src="https://cdn.uviewui.com/uview/grid/hot6.png" style="width: 44rpx;height: 44rpx;top:0;right:0;" class="badge-icon"></image>
<u-icon name="trash" :size="46"></u-icon>
<view class="grid-text">回收站</view>
</u-grid-item>
<u-grid-item :index="7">
<u-icon name="rewind-right" :size="46"></u-icon>
<view class="grid-text">快进</view>
</u-grid-item>
<u-grid-item :index="8">
<u-icon name="shopping-cart" :size="46"></u-icon>
<view class="grid-text">购物车</view>
</u-grid-item>
</u-grid>
<swiper class="swiper" v-else @change="change">
<swiper-item>
<u-grid :border="border" :col="col" @click="click" hover-class="hover-class">
<u-grid-item v-for="(item, index) in list" :index="index" :key="index">
<u-icon :name="item" :size="46"></u-icon>
<text class="grid-text">{{ '宫格' + (index + 1) }}</text>
</u-grid-item>
</u-grid>
</swiper-item>
<swiper-item>
<u-grid :border="border" :col="col" @click="click">
<u-grid-item v-for="(item, index) in list" :index="index + 9" :key="index">
<u-icon :name="item" :size="46"></u-icon>
<text class="grid-text">{{ '宫格' + (index + 1) }}</text>
</u-grid-item>
</u-grid>
</swiper-item>
<swiper-item>
<u-grid :border="border" :col="col" @click="click">
<u-grid-item v-for="(item, index) in list" :index="index + 18" :key="index">
<u-icon :name="item" :size="46"></u-icon>
<text class="grid-text">{{ '宫格' + (index + 1) }}</text>
</u-grid-item>
</u-grid>
</swiper-item>
</swiper>
<view class="indicator-dots" v-if="isSwiper">
<view class="indicator-dots-item" :class="[current == 0 ? 'indicator-dots-active' : '']">
</view>
<view class="indicator-dots-item" :class="[current == 1 ? 'indicator-dots-active' : '']">
</view>
<view class="indicator-dots-item" :class="[current == 2 ? 'indicator-dots-active' : '']">
</view>
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示边框</view>
<u-subsection :list="['是', '否']" @change="borderChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否可滑动</view>
<u-subsection current="1" :list="['是', '否']" @change="isSwiperChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">修改列数</view>
<u-subsection :list="['3', '4']" @change="colChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: ['integral', 'kefu-ermai', 'coupon', 'gift', 'scan', 'pause-circle', 'wifi', 'email', 'list'],
isSwiper: false,
current: 0,
border: true,
col: 3
};
},
methods: {
isSwiperChange(index) {
this.isSwiper = index == 0 ? true : false;
},
borderChange(index) {
this.border = index == 0 ? true : false;
},
colChange(index) {
this.col = index == 0 ? 3 : 4;
},
click(index) {
this.$refs.uToast.show({
title: `点击了第${index + 1}宫格`,
type: 'warning'
})
},
change(e) {
this.current = e.detail.current;
},
// grid-item
itemClick(index) {
// console.log(index);
}
}
};
</script>
<style scoped lang="scss">
.grid-text {
font-size: 28rpx;
margin-top: 4rpx;
color: $u-type-info;
}
.badge-icon {
position: absolute;
width: 40rpx;
height: 40rpx;
}
.swiper {
height: 480rpx;
}
.indicator-dots {
margin-top: 40rpx;
display: flex;
justify-content: center;
align-items: center;
}
.indicator-dots-item {
background-color: $u-tips-color;
height: 6px;
width: 6px;
border-radius: 10px;
margin: 0 3px;
}
.indicator-dots-active {
background-color: $u-type-primary;
}
</style>

@ -0,0 +1,145 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-row :justify="justify" @click="rowClick">
<u-col :span="span" :offset="offset" @click="click" stop>
<view class="demo-layout bg-purple-dark">
</view>
</u-col>
<u-col :span="span" :offset="offset">
<view class="demo-layout bg-purple-dark">
</view>
</u-col>
<u-col :span="span" :offset="offset">
<view class="demo-layout bg-purple-dark">
</view>
</u-col>
</u-row>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">每个栅格占用栏数(演示共3个栅格)</view>
<u-subsection :current="2" :list="[1, 2, 3, 4]" @change="spanChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">分栏偏移</view>
<u-subsection :list="[0, 1, 2, 3]" @change="offsetChange"></u-subsection>
</view>
<!-- #ifndef MP -->
<view class="u-config-item">
<view class="u-item-title">水平排列方式(微信小程序无效)</view>
<u-subsection :list="['start', 'end', 'around', 'between']" @change="justifyChange"></u-subsection>
</view>
<!-- #endif -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
span: 3,
offset: 0,
justify: 'start'
}
},
methods: {
click() {
console.log('col click');
},
rowClick() {
console.log('row click');
},
spanChange(e) {
switch (e) {
case 0:
this.span = 1;
break;
case 1:
this.span = 2;
break;
case 2:
this.span = 3;
break;
case 3:
this.span = 4;
break;
case 4:
this.span = 5;
break;
}
},
offsetChange(e) {
switch (e) {
case 0:
this.offset = 0;
break;
case 1:
this.offset = 1;
break;
case 2:
this.offset = 2;
break;
case 3:
this.offset = 3;
break;
}
},
justifyChange(e) {
switch (e) {
case 0:
this.justify = 'start';
break;
case 1:
this.justify = 'end';
break;
case 2:
this.justify = 'around';
break;
case 3:
this.justify = 'between';
break;
}
},
}
}
</script>
<style scoped lang="scss">
.demo-layout {
height: 70rpx;
border-radius: 8rpx;
margin: 20rpx 0;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5e9f2;
}
.bg-purple-dark {
background: #99a9bf;
}
// H5
// 使
/* #ifdef H5 */
.u-demo-area /deep/ .u-row {
display: flex;
flex-wrap: wrap;
}
/* #endif */
</style>

@ -0,0 +1,54 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-link :color="color" :font-size="fontSize" :under-line="underLine" :href="href">点此链接跳转uView官网</u-link>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">下划线</view>
<u-subsection :list="['显示', '隐藏']" @change="underLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
href: 'https://www.uviewui.com',
underLine: true,
fontSize: 28,
color: '#2979ff'
}
},
methods: {
underLineChange(index) {
this.underLine = index == 0 ? true : false;
},
styleChange(index) {
if(index == 0) {
this.color = this.$u.color['tipsColor'];
this.fontSize = 34;
} else {
this.color = this.$u.color['primary'];
this.fontSize = 28;
}
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,96 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast" />
<u-loadmore :status="status" :loadText="loadText"
:icon-type="iconType" :is-dot="isDot" @loadmore="loadmore"/>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :current="current" :list="['加载前', '加载中', '加载后', '没有更多']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义提示语</view>
<u-subsection current="1" :list="['是', '否']" @change="loadTextChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">加载中图标样式</view>
<u-subsection :list="['circle', 'flower']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">没有更多时用点替代</view>
<u-subsection current="1" :list="['是', '否']" @change="isDotChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
status: 'loadmore',
iconType: 'circle',
isDot: false,
loadText: {
loadmore: '点击或上拉加载更多',
loading: '正在加载...',
nomore: '没有更多了'
},
current: 0
}
},
onReachBottom() {
//
},
methods: {
statusChange(index) {
this.current = index;
this.status = index == 0 ? 'loadmore' : index == 1 ? 'loading' : index == 2 ? 'loadmore' : 'nomore';
},
loadTextChange(index) {
if(index == 0) {
this.loadText = {
loadmore: '用力往上拉',
loading: '正在加载,请喝杯茶...',
nomore: '我也是有底线的'
}
} else {
this.loadText = {
loadmore: '点击或上拉加载更多',
loading: '正在加载...',
nomore: '没有更多了'
}
}
},
styleChange(index) {
this.current = 1;
this.statusChange(1);
this.iconType = index == 0 ? 'circle' : 'flower';
},
isDotChange(index) {
this.current = 3;
this.statusChange(3);
this.isDot = index == 0 ? true : false;
},
// (status'loadmore')
loadmore() {
this.$refs.uToast.show({
title: '点击触发加载更多',
type: 'success'
})
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,89 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<view class="u-no-demo-here">
请点击弹出遮罩查看效果
</view>
<u-mask :show="show" @click="show = false" :zoom="zoom" :duration="duration">
<view class="warp" v-if="content">
<view class="rect" @tap.stop></view>
</view>
</u-mask>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="current" :list="['显示', '隐藏']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">缩放效果</view>
<u-subsection :list="['是', '否']" @change="zoomChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">内容填充</view>
<u-subsection current="1" :list="['是', '否']" @change="contentChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">动画时长(ms)</view>
<u-subsection current="1" :list="['100', '300', '800']" @change="durationChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
zoom: true,
duration: 300,
content: false,
}
},
computed: {
current() {
return this.show ? 0 : 1;
}
},
methods: {
showChange(index) {
this.show = index == 0 ? true : false;
},
zoomChange(index) {
this.zoom = index == 0 ? true : false;
this.show = true;
},
durationChange(index) {
this.duration = index == 0 ? 100 : index == 1 ? 300 : 800;
this.show = true;
},
contentChange(index) {
this.content = index == 0 ? true : false;
this.show = true;
}
}
}
</script>
<style scoped lang="scss">
.warp {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.rect {
width: 120px;
height: 120px;
background-color: #fff;
}
</style>

@ -0,0 +1,97 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-message-input :mode="mode" :maxlength="maxlength" :value="value"
:breathe="breathe" :bold="bold" @finish="finish" :dot-fill="dotFill"></u-message-input>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :list="['方框', '下划线', '中划线']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">输入长度</view>
<u-subsection :list="[4, 5, 6]" @change="maxLengthChange"></u-subsection>
</view>
<view class="u-config-item">
<!-- #ifdef MP-WEIXIN -->
<view class="u-item-title">初始值(为满足演示需要微信小程序切换会有抖动非性能问题)</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="u-item-title">初始值</view>
<!-- #endif -->
<u-subsection :list="['空', '23', '678']" @change="valueChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">呼吸灯效果</view>
<u-subsection :list="['是', '否']" @change="breatheChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否加粗</view>
<u-subsection :list="['是', '否']" @change="boldChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">点替代输入值</view>
<u-subsection current="1" :list="['是', '否']" @change="dotFillChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: 'box',
maxlength: 4,
value: '',
bold: true,
breathe: true,
dotFill: false,
}
},
computed: {
},
onLoad() {
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'box' : index == 1 ? 'bottomLine' : 'middleLine';
},
maxLengthChange(index) {
this.maxlength = index == 0 ? 4 : index == 1 ? 5 : 6;
},
valueChange(index) {
this.value = index == 0 ? '' : index == 1 ? '23' : '678';
},
breatheChange(index) {
this.breathe = index == 0 ? true : false;
},
boldChange(index) {
this.bold = index == 0 ? true : false;
},
dotFillChange(index) {
this.dotFill = index == 0 ? true : false;
},
finish(value) {
this.$refs.uToast.show({
title: '输入完成,值为:' + value,
type: 'success'
})
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,77 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-number-box v-model="value" :bg-color="bgColor" :color="color" :min="0"
:step="step" :disabled="disabled" @change="change" @focus="focus"></u-number-box>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">初始值</view>
<u-subsection :list="[1, 5, 18]" @change="valueChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否禁用</view>
<u-subsection current="1" :list="['是', '否']" @change="disabledChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">步进值</view>
<u-subsection :list="[1, 3, 5, 8]" @change="stepChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
value: 1,
bgColor: "#F2F3F5",
color: '#323233',
disabled: false,
step: 1,
};
},
methods: {
valueChange(index) {
this.value = index == 0 ? 1 : index == 1 ? 5 : 18;
},
styleChange(index) {
if(index == 0) {
this.bgColor = '#ff6d00';
this.color = '#fff';
} else {
this.bgColor = "#F2F3F5";
this.color = '#323233';
}
},
disabledChange(index) {
this.disabled = index == 0 ? true : false;
},
stepChange(index) {
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
},
change(e) {
//console.log(e.value);
},
focus() {
console.log('focus');
}
}
};
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,103 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-button @click="btnClick"></u-button>
<u-popup border-radius="10" v-model="show"
@close="close" @open="open" :mode="mode"
length="50%" :mask="mask"
:closeable="closeable"
:close-icon-pos="closeIconPos"
>
<view v-if="mode == 'center'" style="height: 400rpx">
<view class="close-btn">
<u-button @click="show = false;" size="medium">关闭弹窗</u-button>
</view>
</view>
<view class="close-btn" v-if="mode != 'center'">
<u-button size="medium" @click="show = false;">关闭弹窗</u-button>
</view>
</u-popup>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection :current="show == false ? 1 : 0" :list="['打开', '关闭']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">弹出方向</view>
<u-subsection :current="2" :list="['上', '下', '左', '右', '中']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">关闭按钮</view>
<u-subsection :list="['显示', '隐藏']" @change="closeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">关闭按钮位置</view>
<u-subsection :current="1" :list="['左上角', '右上角', '左下角', '右下角']" @change="closePosChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
mode: 'left',
mask: true, //
closeable: true,
closeIconPos: 'top-right'
}
},
watch: {
show(n) {
// console.log(n);
}
},
methods: {
modeChange(index) {
this.mode = index == 0 ? 'top' : index == 1 ? 'bottom' : index == 2 ? 'left' : index == 3 ? 'right' : 'center';
this.show = true;
},
showChange(index) {
this.show = index == 0 ? true : false;
},
closeChange(index) {
this.closeable = !index;
},
closePosChange(index) {
this.closeIconPos = ['top-left', 'top-right', 'bottom-left', 'bottom-right'][index];
},
close() {
// console.log('close');
},
open() {
// console.log('open');
},
btnClick() {
this.show = true;
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
padding: 24rpx;
}
.close-btn {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
</style>

@ -0,0 +1,102 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-line-progress v-if="mode == 'line'" :percent="percent" :active-color="activeColor"
:striped="striped" :stripedActive="stripedActive"></u-line-progress>
<u-circle-progress v-else :percent="percent" :active-color="activeColor"
bg-color="rgb(250, 250, 250)">
<view class="u-progress-content">
<view class="u-progress-dot"></view>
<text class='u-progress-info'>查找中</text>
</view>
</u-circle-progress>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择</view>
<u-subsection :current="current" :list="['线型', '圆型']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">增减</view>
<u-subsection :list="['减少30%', '增加30%']" @change="calcChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">自定义样式(线型时有效)</view>
<u-subsection current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">动态条纹(线型时有效)</view>
<u-subsection current="1" :list="['是', '否']" @change="stripedChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
percent: 50,
mode: 'line',
activeColor: '#19be6b',
striped: false,
stripedActive: false,
current: 0,
}
},
methods: {
modeChange(index) {
this.current = index;
this.mode = index == 0 ? 'line' : 'circle';
},
calcChange(index) {
this.percent = index == 0 ? (this.percent - 30) : (this.percent + 30);
if(this.percent > 100) this.percent = 100;
if(this.percent < 0) this.percent = 0;
},
styleChange(index) {
this.activeColor = index == 0 ? this.$u.color['error'] : '#19be6b';
if(index == 0) {
this.mode = 'line';
this.current = 0;
}
},
stripedChange(index) {
this.striped = index == 0 ? true : false;
this.stripedActive = this.striped;
if(index == 0) {
this.mode = 'line';
this.current = 0;
}
},
}
}
</script>
<style lang="scss" scoped>
.u-progress-content {
display: flex;
align-items: center;
justify-content: center;
}
.u-progress-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #fb9126;
}
.u-progress-info {
font-size: 28rpx;
padding-left: 16rpx;
letter-spacing: 2rpx
}
</style>

@ -0,0 +1,71 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-section :title="title" :right="right" :bold="bold" :color="color" :show-line="showLine"></u-section>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">更换主标题</view>
<u-subsection :current="1" :list="['是', '否']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">竖条状态</view>
<u-subsection :list="['显示', '隐藏']" @change="showLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示右边部分</view>
<u-subsection :list="['是', '否']" @change="rightChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">主标题粗体</view>
<u-subsection :list="['是', '否']" @change="boldChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">主标题颜色</view>
<u-subsection :list="['默认', '自定义']" @change="colorChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '红豆生南国',
bold: true,
right: true,
color: this.$u.color['mainColor'],
showLine: true
}
},
methods: {
titleChange(index) {
if(index == 0) this.title = '春来发几枝';
else this.title = '红豆生南国';
},
rightChange(index) {
this.right = index == 0 ? true : false;
},
boldChange(index) {
this.bold = index == 0 ? true : false;
},
colorChange(index) {
this.color = index == 0 ? this.$u.color['mainColor'] : this.$u.color['primary'];
},
showLineChange(index) {
this.showLine = !index;
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,88 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-subsection v-if="change" :bold="bold" :active-color="activeColor" :current="current" :mode="mode" :list="['代付款', '待收货', '待评价']"></u-subsection>
</view>
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式选择(为满足演示需要切换会有抖动非性能问题)</view>
<u-subsection mode="button" :list="['button', 'subsection']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">Current值</view>
<u-subsection mode="button" :list="[0, 1, 2]" @change="currentChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">活动选项字颜色</view>
<u-subsection mode="button" :list="['primary', 'success', 'error', 'warning']" @change="colorChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">字体加粗</view>
<u-subsection mode="button" :list="['是', '否']" @change="boldChange"></u-subsection>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
mode: 'button',
current: 0,
activeColor: this.$u.color['warning'],
bold: true,
change: true,
}
},
methods: {
modeChange(e) {
switch(e) {
case 0:
this.mode = 'button';break;
case 1:
this.mode = 'subsection';break;
}
this.change = false;
this.$nextTick(() => {
this.change = true;
})
},
currentChange(e) {
this.current = e;
},
colorChange(e) {
let color = 'primary';
switch(e) {
case 0:
color = 'primary';break;
case 1:
color = 'success';break;
case 2:
color = 'error';break;
case 3:
color = 'warning';break;
}
this.activeColor = this.$u.color[color];
},
boldChange(e) {
switch(e) {
case 0:
this.bold = true;break;
case 1:
this.bold = false;break;
}
}
}
}
</script>
<style lang="scss" scoped>
.u-demo {}
</style>

@ -0,0 +1,3 @@
<template>
<view></view>
</template>

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

Loading…
Cancel
Save

Powered by TurnKey Linux.