Skip to content

Commit

Permalink
Merge branch 'yiruiwen' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wlxuqu committed Aug 4, 2020
2 parents 36bc753 + c1c3e00 commit a9758b9
Show file tree
Hide file tree
Showing 44 changed files with 648 additions and 261 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水

### **欢迎加群交流反馈:249718512**
### **欢迎加群交流反馈:1129077272**

## 特性

Expand Down
7 changes: 4 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name" : "uView",
"appid" : "__UNI__60F4B81",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.5.6",
"versionName" : "1.5.8",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
Expand Down Expand Up @@ -107,7 +107,7 @@
},
"mp-alipay" : {
"usingComponents" : true,
"component2": true
"component2" : true
},
"mp-baidu" : {
"usingComponents" : true,
Expand All @@ -126,6 +126,7 @@
"treeShaking" : {
"enable" : true
}
}
},
"title" : "uView UI"
}
}
23 changes: 15 additions & 8 deletions pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "test", //模式名称
"path": "pages/componentsA/avatar/index", //启动页面,必选
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
}]
},
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsC/test/index", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }]
// },
"pages": [
// 演示-组件
{
Expand Down Expand Up @@ -328,6 +328,13 @@
{
"root": "pages/library",
"pages": [
// debounce-节流防抖
{
"path": "debounce/index",
"style": {
"navigationBarTitleText": "throttle | debounce-节流防抖"
}
},
// deepClone-对象深度克隆
{
"path": "deepClone/index",
Expand Down
9 changes: 9 additions & 0 deletions pages/componentsA/icon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
data() {
return {
iconList: [
{
name: 'level'
},
{
name: 'woman'
},
{
name: 'man'
},
{
name: 'arrow-left-double'
},
Expand Down
7 changes: 6 additions & 1 deletion pages/componentsA/navbar/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<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">
<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绑定一个变量 -->
Expand Down
8 changes: 7 additions & 1 deletion pages/componentsB/readMore/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-read-more :toggle="toggle" :show-height="showHeight" ref="uReadMore">
<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>
Expand Down Expand Up @@ -48,6 +48,12 @@
},
toggleChange(index) {
this.toggle = index == 0 ? true : false;
},
open() {
// console.log('open');
},
close() {
// console.log('close');
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions pages/componentsC/section/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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"></u-section>
<u-section :title="title" :right="right" :bold="bold" :color="color" :show-line="showLine"></u-section>
</view>
</view>
<view class="u-config-wrap">
Expand All @@ -14,6 +14,10 @@
<view class="u-item-title">更换主标题</view>
<u-subsection vibrateShort :current="1" :list="['', '']" @change="titleChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">竖条状态</view>
<u-subsection vibrateShort :list="['显示', '隐藏']" @change="showLineChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否显示右边部分</view>
<u-subsection vibrateShort :list="['', '']" @change="rightChange"></u-subsection>
Expand All @@ -37,7 +41,8 @@
title: '红豆生南国',
bold: true,
right: true,
color: this.$u.color['mainColor']
color: this.$u.color['mainColor'],
showLine: true
}
},
methods: {
Expand All @@ -53,6 +58,9 @@
},
colorChange(index) {
this.color = index == 0 ? this.$u.color['mainColor'] : this.$u.color['primary'];
},
showLineChange(index) {
this.showLine = !index;
}
}
}
Expand Down
32 changes: 24 additions & 8 deletions pages/componentsC/test/index.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
<template>
<view>
<u-popup v-model="show" @close="close">
<view>出淤泥而不染,濯清涟而不妖</view>
</u-popup>
<u-button @click="show = true">打开</u-button>
<view style="padding-top: 200px;">
<u-button @click="show = true" :custom-style="{
color: 'red',
borderColor: 'blue'
}">打开</u-button>
</view>
</template>

<script>
export default {
data() {
return {
show: false
show: true,
list: [{
name: '待收货'
}, {
name: '待付款'
}, {
name: '待评价'
}],
current: 0
}
},
onLoad() {
// setTimeout(() => {
// this.show = false;
// }, 2000)
},
methods: {
close() {
console.log('close');
//console.log('close');
},
change(index) {
this.current = index;
}
}
}
</script>
</script>
5 changes: 5 additions & 0 deletions pages/example/js.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default [
{
groupName: '工具库',
list: [
{
path: 'debounce',
icon: 'debounce',
title: 'throttle | debounce 节流防抖',
},
{
path: 'deepMerge',
icon: 'deepMerge',
Expand Down
94 changes: 94 additions & 0 deletions pages/library/debounce/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<template>
<view class="u-demo">
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="no-mode-here">
选择节流或者防抖模式,点击按钮,将会执行回调并显示在下方:
</view>
<view class="u-demo-result-line" v-if="result.length">
<view v-for="(item, index) in result" :key="index">{{(index >= 1) ? '-' : ''}}回调</view>
</view>
</view>
</view>
<view class="u-config-wrap">
<view class="u-button" hover-class="u-button--hover" hover-stay-time="150" @tap="btnClick">
点击触发
</view>
<view class="u-config-title u-border-bottom">
参数配置
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection vibrateShort :list="['节流', '防抖']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">时间间隔</view>
<u-subsection vibrateShort current="1" :list="['500ms', '1000ms', '2000ms']" @change="timeoutChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">执行时机</view>
<u-subsection vibrateShort :list="['开始处', '结束处']" @change="immediateChange"></u-subsection>
</view>
</view>
</view>
</template>

<script>
export default {
data() {
return {
result: [],
timeout: 1000,
immediate: true,
mode: 'throttle'
}
},
methods: {
modeChange(index) {
this.mode = index ? 'debouncd' : 'throttle';
},
timeoutChange(index) {
this.timeout = [500, 1000, 2000][index];
},
immediateChange(index) {
this.immediate = !index;
},
getResult() {
if(this.result.length >= 6) this.result = [];
this.result.push(0);
},
btnClick() {
if(this.mode == 'throttle') {
this.$u.throttle(this.getResult, this.timeout, this.immediate);
} else {
this.$u.debounce(this.getResult, this.timeout, this.immediate);
}
}
}
}
</script>

<style lang="scss" scoped>
.u-button {
margin-top: 50rpx;
margin-bottom: 50rpx;
display: flex;
justify-content: center;
align-items: center;
height: 80rpx;
border-radius: 6rpx;
border: 1px solid $u-type-primary;
color: $u-type-primary;
}
.u-button--hover {
color: #fff;
background-color: $u-type-primary;
}
.u-demo-result-line {
display: flex;
justify-content: center;
}
</style>
Loading

0 comments on commit a9758b9

Please sign in to comment.