Browse Source

feature-hub-1.0:初步构建页面

feature-1.0
chengkun 4 years ago
parent
commit
cea40871e3
  1. 8
      .idea/.gitignore
  2. 27
      api/index.js
  3. 51
      pages.json
  4. 325
      pages/index/index.vue
  5. 107
      pages/profit/profit.vue
  6. 316
      pages/userInfo/userInfo.vue
  7. 2
      uni_modules/uni-badge/components/uni-badge/uni-badge.vue
  8. 2
      uni_modules/uni-badge/package.json
  9. 6
      uni_modules/uni-breadcrumb/changelog.md
  10. 121
      uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue
  11. 41
      uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue
  12. 88
      uni_modules/uni-breadcrumb/package.json
  13. 66
      uni_modules/uni-breadcrumb/readme.md
  14. 7
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue
  15. 8
      uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue
  16. 6
      uni_modules/uni-calendar/components/uni-calendar/util.js
  17. 2
      uni_modules/uni-combox/components/uni-combox/uni-combox.vue
  18. 2
      uni_modules/uni-data-checkbox/changelog.md
  19. 48
      uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue
  20. 2
      uni_modules/uni-data-checkbox/package.json
  21. 6
      uni_modules/uni-data-picker/changelog.md
  22. 29
      uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
  23. 5
      uni_modules/uni-data-picker/package.json
  24. 10
      uni_modules/uni-data-select/changelog.md
  25. 402
      uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue
  26. 88
      uni_modules/uni-data-select/package.json
  27. 8
      uni_modules/uni-data-select/readme.md
  28. 2
      uni_modules/uni-datetime-picker/changelog.md
  29. 89
      uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue
  30. 2
      uni_modules/uni-datetime-picker/package.json
  31. 2
      uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue
  32. 6
      uni_modules/uni-easyinput/changelog.md
  33. 322
      uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
  34. 2
      uni_modules/uni-easyinput/package.json
  35. 2
      uni_modules/uni-file-picker/changelog.md
  36. 5
      uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue
  37. 2
      uni_modules/uni-file-picker/package.json
  38. 22
      uni_modules/uni-forms/changelog.md
  39. 1023
      uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
  40. 470
      uni_modules/uni-forms/components/uni-forms/uni-forms.vue
  41. 293
      uni_modules/uni-forms/components/uni-forms/utils.js
  42. 2
      uni_modules/uni-forms/package.json
  43. 2
      uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue
  44. 2
      uni_modules/uni-grid/components/uni-grid/uni-grid.vue
  45. 2
      uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue
  46. 4
      uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue
  47. 2
      uni_modules/uni-nav-bar/changelog.md
  48. 2
      uni_modules/uni-nav-bar/package.json
  49. 2
      uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue
  50. 7
      uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
  51. 2
      uni_modules/uni-pagination/changelog.md
  52. 3
      uni_modules/uni-pagination/components/uni-pagination/i18n/en.json
  53. 3
      uni_modules/uni-pagination/components/uni-pagination/i18n/es.json
  54. 3
      uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json
  55. 3
      uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json
  56. 3
      uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json
  57. 62
      uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue
  58. 2
      uni_modules/uni-pagination/package.json
  59. 2
      uni_modules/uni-pagination/readme.md
  60. 2
      uni_modules/uni-row/components/uni-col/uni-col.vue
  61. 2
      uni_modules/uni-row/components/uni-row/uni-row.vue
  62. 2
      uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue
  63. 2
      uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue
  64. 2
      uni_modules/uni-tag/components/uni-tag/uni-tag.vue
  65. 39
      uni_modules/uni-test/changelog.md
  66. 26
      uni_modules/uni-test/components/uni-test/uni-test.vue
  67. 83
      uni_modules/uni-test/package.json
  68. 10
      uni_modules/uni-test/readme.md
  69. 10
      uni_modules/uni-tooltip/changelog.md
  70. 68
      uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue
  71. 88
      uni_modules/uni-tooltip/package.json
  72. 8
      uni_modules/uni-tooltip/readme.md
  73. 36
      uni_modules/uni-ui/changelog.md
  74. 6
      uni_modules/uni-ui/package.json

8
.idea/.gitignore

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../:\workspace\bnyer-cloud-hub\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

27
api/index.js

@ -30,15 +30,6 @@ export function listType() {
})
}
// 小程序艺术家登录
export function login(data) {
return request({
url: `${serviceTitle}${prefix}/login`,
method: 'post',
data
})
}
// 新增艺术家图片
export function insertTiktokImg(data) {
return request({
@ -46,7 +37,7 @@ export function insertTiktokImg(data) {
method: 'post',
data
})
}
}
// 修改艺术家图片
export function updateTiktokImg(data) {
@ -74,3 +65,19 @@ export function listTiktokImgIn(data) {
})
}
// 查询公告详情
export function getNoticeDetails(id) {
return request({
url: `${serviceTitle}${prefix}/listType/${id}`,
method: 'get'
})
}
// 查询公告列表
export function getNoticeList() {
return request({
url: `${serviceTitle}${prefix}/getNoticeList`,
method: 'get'
})
}

51
pages.json

@ -4,7 +4,7 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
},
{
@ -20,8 +20,49 @@
"navigationBarTitleText": "我的",
"enablePullDownRefresh": false
}
}
],
},{
"path": "pages/userInfo/about/about",
"style": {
"navigationBarTitleText": "关于",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/contact/contact",
"style": {
"navigationBarTitleText": "联系我们",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/extends/extends",
"style": {
"navigationBarTitleText": "邀请更多",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/inviteLog/inviteLog",
"style": {
"navigationBarTitleText": "邀请记录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/notice/notice",
"style": {
"navigationBarTitleText": "系统公告",
"enablePullDownRefresh": false
}
},
{
"path": "pages/userInfo/withdraw/withdraw",
"style": {
"navigationBarTitleText": "提现记录",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "bnyer",
@ -41,13 +82,13 @@
"text": "首页"
},
{
"pagePath": "pages/profit/index",
"pagePath": "pages/profit/profit",
"iconPath": "static/theme-default.png",
"selectedIconPath": "static/theme-select.png",
"text": "收益"
},
{
"pagePath": "pages/userInfo/index",
"pagePath": "pages/userInfo/userInfo",
"iconPath": "static/mine-default.png",
"selectedIconPath": "static/mine-select.png",
"text": "我的"

325
pages/index/index.vue

@ -1,79 +1,54 @@
<template>
<view class="container">
<!-- <view v-if="!showChoiceness">
<view class="top">
<image class="back-img" src="../../static/img/start.gif" mode=""></image>
<view class="top-bottom">
</view>
<uni-search-bar class="uni-mt-10" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none"
@confirm="search" />
<text>热门艺术家</text>
<view class="user-list">
<view class="user-list-box" v-for="(item,index) in hotCreatorList" :key='item.id'
@click="goCreatorDetail(item.scanCode)">
<image :src="item.img" mode=""></image>
<text>{{item.scanCode}}</text>
</view>
</view>
</view>
<view class="middle">
<text>近期精选</text>
<image src="../../static/img/slide-top.svg" mode=""></image>
</view>
<view class="top">
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem=clickItem :info="info" :current="current" :mode="mode"
field="content">
<swiper class="swiper-box" @change="change" :current="swiperDotIndex" :autoplay="autoplay"
:interval="interval" :duration="duration">
<swiper-item v-for="(item, index) in 3" :key="index">
<view class="swiper-item" :class="'swiper-item' + index">
<text style="color: #fff; font-size: 32px;">{{index+1}}</text>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
<view class="middle">
素材管理上传图片
</view>
<view class="foot">
表格展示艺术家上传的图片数据
</view>
<Choiceness v-else></Choiceness> -->
</view>
</template>
<script>
import {
loginWx
} from '@/api/index.js'
export default {
data() {
return {
hotCreatorList: [],
isTarget: true,
showChoiceness:false
}
},
//
onPullDownRefresh() {
this.showChoiceness = false
uni.stopPullDownRefresh()
},
created() {
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
console.log('havent userInfo')
this.getUserInfo()
} else {
console.log('have userInfo')
}
info: [{
content: '内容 A'
}, {
content: '内容 B'
}, {
content: '内容 C'
}],
current: 0,
mode: 'nav',
swiperDotIndex: 0,
autoplay: true,
interval: 5000,
duration: 500
};
},
onPageScroll(e) {
// scrollTopeasy-loadimage
if (e.scrollTop > 160) {
this.showChoiceness = true
// uni.redirectTo({
// url: '../index/choiceness'
// })
}
},
methods: {
//
search(res) {
if (res.value) {
console.log('search', res.value)
this.goCreatorDetail(res.value)
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'none'
})
}
methods:{
change(e) {
this.current = e.detail.current;
//console.log('this.current',this.current)
},
clickItem(e) {
this.swiperDotIndex = e
console.log('this.swiperDotIndex',this.swiperDotIndex)
},
//
getUserInfo() {
@ -114,91 +89,155 @@
console.log(`login 调用失败`);
},
});
},
//
handleScroll() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
console.log(scrollTop)
},
},
}
}
</script>
<style lang="less">
.container {
.top {
width: 100vw;
image {
width: 100vw;
height: 400rpx;
}
.uni-searchbar {
border: 1px solid #11A8FD;
margin: 0 40rpx;
border-radius: 16rpx;
padding: 0;
.uni-searchbar__box {
padding: 0;
border-radius: 16rpx !important;
}
}
>text {
font-weight: bold;
font-size: 14px;
display: block;
text-align: center;
padding-top: 40rpx;
padding-bottom: 20rpx;
}
.user-list {
display: flex;
justify-content: flex-start;
align-items: center;
overflow-x: auto;
.user-list-box {
width: 140rpx;
padding: 20rpx;
text-align: center;
image {
width: 100rpx;
height: 100rpx;
border-radius: 100rpx;
}
text {
font-size: 24rpx;
color: #1E1E1E;
text-align: center;
}
}
}
<style lang="scss">
// .container {
// .top {
// width: 100vw;
// image {
// width: 100vw;
// height: 400rpx;
// }
// .uni-searchbar {
// border: 1px solid #11A8FD;
// margin: 0 40rpx;
// border-radius: 16rpx;
// padding: 0;
// .uni-searchbar__box {
// padding: 0;
// border-radius: 16rpx !important;
// }
// }
// >text {
// font-weight: bold;
// font-size: 14px;
// display: block;
// text-align: center;
// padding-top: 40rpx;
// padding-bottom: 20rpx;
// }
// .user-list {
// display: flex;
// justify-content: flex-start;
// align-items: center;
// overflow-x: auto;
// .user-list-box {
// width: 140rpx;
// padding: 20rpx;
// text-align: center;
// image {
// width: 100rpx;
// height: 100rpx;
// border-radius: 100rpx;
// }
// text {
// font-size: 24rpx;
// color: #1E1E1E;
// text-align: center;
// }
// }
// }
// }
// .middle {
// text-align: center;
// height: calc(100vh - 248rpx);
// padding-top: 40rpx;
// text {
// font-weight: bold;
// font-size: 14px;
// display: block;
// }
// image {
// width: 40rpx;
// height: 40rpx;
// }
// }
// }
.middle{
margin-top: 100px;
}
.foot{
margin-top: 100px;
}
.swiper-box {
height: 180px;
}
.swiper-item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
height: 200px;
color: #fff;
}
.swiper-item0 {
background-color: #cee1fd;
}
.swiper-item1 {
background-color: #b2cef7;
}
.swiper-item2 {
background-color: #cee1fd;
}
.image {
width: 750rpx;
}
/* #ifndef APP-NVUE */
::v-deep .image img {
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
}
/* #endif */
@media screen and (min-width: 500px) {
.uni-swiper-dot-box {
width: 400px;
margin: 0 auto;
margin-top: 8px;
}
.middle {
text-align: center;
height: calc(100vh - 248rpx);
padding-top: 40rpx;
text {
font-weight: bold;
font-size: 14px;
display: block;
}
image {
width: 40rpx;
height: 40rpx;
}
.image {
width: 100%;
}
}
.uni-bg-blue {
background-color: #007aff;
}
.active {
border-style: solid;
border-color: #007aff;
border-width: 1px;
}
</style>

107
pages/profit/profit.vue

@ -1,27 +1,14 @@
<template>
<view class="container">
<!-- <view v-if="!showChoiceness">
<view class="top">
<image class="back-img" src="../../static/img/start.gif" mode=""></image>
<view class="top-bottom">
</view>
<uni-search-bar class="uni-mt-10" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none"
@confirm="search" />
<text>热门艺术家</text>
<view class="user-list">
<view class="user-list-box" v-for="(item,index) in hotCreatorList" :key='item.id'
@click="goCreatorDetail(item.scanCode)">
<image :src="item.img" mode=""></image>
<text>{{item.scanCode}}</text>
</view>
</view>
</view>
<view class="middle">
<text>近期精选</text>
<image src="../../static/img/slide-top.svg" mode=""></image>
</view>
<view class="top">
</view>
<view class="middle">
</view>
<view class="foot">
</view>
<Choiceness v-else></Choiceness> -->
</view>
</template>
@ -39,90 +26,14 @@
},
//
onPullDownRefresh() {
this.showChoiceness = false
uni.stopPullDownRefresh()
},
created() {
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
console.log('havent userInfo')
this.getUserInfo()
} else {
console.log('have userInfo')
}
},
onPageScroll(e) {
// scrollTopeasy-loadimage
if (e.scrollTop > 160) {
this.showChoiceness = true
// uni.redirectTo({
// url: '../index/choiceness'
// })
}
},
methods: {
//
search(res) {
if (res.value) {
console.log('search', res.value)
this.goCreatorDetail(res.value)
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'none'
})
}
},
//
getUserInfo() {
wx.login({
force: true,
success: res => {
wx.getUserInfo({
withCredentials: true,
success: userInfo => {
const params = {
code: res.code,
encryptedData: userInfo.encryptedData,
iv: userInfo.iv
}
//
console.log('params',params);
loginWx(params).then(res => {
if (res.data.code === 200) {
uni.setStorage({
key: 'userInfo',
data: res.data.data.userInfo,
})
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}).catch(res => {})
console.log(`getUserInfo 调用成功`, userInfo);
},
fail(userInfo) {
console.log(`getUserInfo 调用失败`);
},
});
},
fail(res) {
console.log(`login 调用失败`);
},
});
},
//
handleScroll() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
console.log(scrollTop)
},
},
}
</script>

316
pages/userInfo/userInfo.vue

@ -1,204 +1,158 @@
<template>
<view class="container">
<!-- <view v-if="!showChoiceness">
<view class="top">
<image class="back-img" src="../../static/img/start.gif" mode=""></image>
<view class="top-bottom">
</view>
<uni-search-bar class="uni-mt-10" placeholder="请输入喜欢的艺术家代号吧~" clearButton="auto" cancelButton="none"
@confirm="search" />
<text>热门艺术家</text>
<view class="user-list">
<view class="user-list-box" v-for="(item,index) in hotCreatorList" :key='item.id'
@click="goCreatorDetail(item.scanCode)">
<image :src="item.img" mode=""></image>
<text>{{item.scanCode}}</text>
</view>
</view>
</view>
<view class="middle">
<text>近期精选</text>
<image src="../../static/img/slide-top.svg" mode=""></image>
</view>
<view class="top">
<uni-notice-bar show-get-more show-icon more-text="查看更多" text="年末大礼:uni-app1.4 新增百度、支付宝小程序。插件市场重磅上线!"
@getmore="getMore" />
<uni-notice-bar show-icon scrollable
text="uni-app 版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" />
</view>
<view class="middle">
<uni-section title="我的資金" type="line" padding>
<text>錢包餘額</text>
</uni-section>
</view>
<view class="foot">
<uni-section title="更多服務" type="line" padding>
<uni-grid :column="4" :highlight="true" @change="change">
<uni-grid-item v-for="(item, index) in list" :index="index" :key="index">
<view class="grid-item-box" style="background-color: #fff;" >
<uni-icons type="image" :size="30" color="#777" />
<text class="text">{{item}}</text>
</view>
</uni-grid-item>
</uni-grid>
</uni-section>
</view>
<Choiceness v-else></Choiceness> -->
</view>
</template>
<script>
import {
loginWx
} from '@/api/index.js'
export default {
data() {
return {
hotCreatorList: [],
isTarget: true,
showChoiceness:false
}
},
//
onPullDownRefresh() {
this.showChoiceness = false
uni.stopPullDownRefresh()
},
created() {
const userInfo = uni.getStorageSync('userInfo')
if (!userInfo) {
console.log('havent userInfo')
this.getUserInfo()
} else {
console.log('have userInfo')
}
},
onPageScroll(e) {
// scrollTopeasy-loadimage
if (e.scrollTop > 160) {
this.showChoiceness = true
// uni.redirectTo({
// url: '../index/choiceness'
// })
list:['美團外賣','支付助手','廣告助手','上傳圖片','消息通知','我的信息','我的短信','我的頭像']
}
},
methods: {
//
search(res) {
if (res.value) {
console.log('search', res.value)
this.goCreatorDetail(res.value)
} else {
uni.showToast({
title: '请输入艺术家代号',
icon: 'none'
})
}
},
//
getUserInfo() {
wx.login({
force: true,
success: res => {
wx.getUserInfo({
withCredentials: true,
success: userInfo => {
const params = {
code: res.code,
encryptedData: userInfo.encryptedData,
iv: userInfo.iv
}
//
console.log('params',params);
loginWx(params).then(res => {
if (res.data.code === 200) {
uni.setStorage({
key: 'userInfo',
data: res.data.data.userInfo,
})
} else {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
}
}).catch(res => {})
console.log(`getUserInfo 调用成功`, userInfo);
},
fail(userInfo) {
console.log(`getUserInfo 调用失败`);
},
});
},
fail(res) {
console.log(`login 调用失败`);
},
});
},
//
handleScroll() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
console.log(scrollTop)
change(e) {
// this.index = e.detail.index
let {
index
} = e.detail
this.list[index].badge && this.list[index].badge++
uni.showToast({
title: `点击第${index+1}个宫格`,
icon: 'none'
})
},
},
}
</script>
<style lang="less">
.container {
.top {
width: 100vw;
image {
width: 100vw;
height: 400rpx;
}
.uni-searchbar {
border: 1px solid #11A8FD;
margin: 0 40rpx;
border-radius: 16rpx;
padding: 0;
.uni-searchbar__box {
padding: 0;
border-radius: 16rpx !important;
}
}
>text {
font-weight: bold;
font-size: 14px;
display: block;
text-align: center;
padding-top: 40rpx;
padding-bottom: 20rpx;
}
.user-list {
display: flex;
justify-content: flex-start;
align-items: center;
overflow-x: auto;
.user-list-box {
width: 140rpx;
padding: 20rpx;
text-align: center;
image {
width: 100rpx;
height: 100rpx;
border-radius: 100rpx;
}
text {
font-size: 24rpx;
color: #1E1E1E;
text-align: center;
}
}
}
}
<style lang="scss">
.middle {
margin-top: 80px;
}
.middle {
text-align: center;
height: calc(100vh - 248rpx);
padding-top: 40rpx;
.foot {
margin-top: 80px;
}
text {
font-weight: bold;
font-size: 14px;
display: block;
}
// .container {
// .top {
// width: 100vw;
// image {
// width: 100vw;
// height: 400rpx;
// }
// .uni-searchbar {
// border: 1px solid #11A8FD;
// margin: 0 40rpx;
// border-radius: 16rpx;
// padding: 0;
// .uni-searchbar__box {
// padding: 0;
// border-radius: 16rpx !important;
// }
// }
// >text {
// font-weight: bold;
// font-size: 14px;
// display: block;
// text-align: center;
// padding-top: 40rpx;
// padding-bottom: 20rpx;
// }
// .user-list {
// display: flex;
// justify-content: flex-start;
// align-items: center;
// overflow-x: auto;
// .user-list-box {
// width: 140rpx;
// padding: 20rpx;
// text-align: center;
// image {
// width: 100rpx;
// height: 100rpx;
// border-radius: 100rpx;
// }
// text {
// font-size: 24rpx;
// color: #1E1E1E;
// text-align: center;
// }
// }
// }
// }
// .middle {
// text-align: center;
// height: calc(100vh - 248rpx);
// padding-top: 40rpx;
// text {
// font-weight: bold;
// font-size: 14px;
// display: block;
// }
// image {
// width: 40rpx;
// height: 40rpx;
// }
// }
// }
.grid-item-box {
flex: 1;
// position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
justify-content: center;
padding: 15px 0;
}
image {
width: 40rpx;
height: 40rpx;
}
}
.grid-item-box-row {
flex: 1;
// position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
padding: 15px 0;
}
</style>

2
uni_modules/uni-badge/components/uni-badge/uni-badge.vue

@ -160,7 +160,7 @@
};
</script>
<style lang="scss" >
<style lang="scss" scoped>
$uni-primary: #2979ff !default;
$uni-success: #4cd964 !default;
$uni-warning: #f0ad4e !default;

2
uni_modules/uni-badge/package.json

@ -42,7 +42,7 @@
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {

6
uni_modules/uni-breadcrumb/changelog.md

@ -1,6 +0,0 @@
## 0.1.2(2022-06-08)
- 修复 微信小程序 separator 不显示问题
## 0.1.1(2022-06-02)
- 新增 支持 uni.scss 修改颜色
## 0.1.0(2022-04-21)
- 初始化

121
uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue

@ -1,121 +0,0 @@
<template>
<view class="uni-breadcrumb-item">
<view :class="{
'uni-breadcrumb-item--slot': true,
'uni-breadcrumb-item--slot-link': to && currentPage !== to
}" @click="navTo">
<slot />
</view>
<i v-if="separatorClass" class="uni-breadcrumb-item--separator" :class="separatorClass" />
<text v-else class="uni-breadcrumb-item--separator">{{ separator }}</text>
</view>
</template>
<script>
/**
* BreadcrumbItem 面包屑导航子组件
* @property {String/Object} to 路由跳转页面路径/对象
* @property {Boolean} replace 在使用 to 进行路由跳转时启用 replace 将不会向 history 添加新记录( h5 支持
*/
export default {
data() {
return {
currentPage: ""
}
},
options: {
virtualHost: true
},
props: {
to: {
type: String,
default: ''
},
replace:{
type: Boolean,
default: false
}
},
inject: {
uniBreadcrumb: {
from: "uniBreadcrumb",
default: null
}
},
created(){
const pages = getCurrentPages()
const page = pages[pages.length-1]
if(page){
this.currentPage = `/${page.route}`
}
},
computed: {
separator() {
return this.uniBreadcrumb.separator
},
separatorClass() {
return this.uniBreadcrumb.separatorClass
}
},
methods: {
navTo() {
const { to } = this
if (!to || this.currentPage === to){
return
}
if(this.replace){
uni.redirectTo({
url:to
})
}else{
uni.navigateTo({
url:to
})
}
}
}
}
</script>
<style lang="scss">
$uni-primary: #2979ff !default;
$uni-base-color: #6a6a6a !default;
$uni-main-color: #3a3a3a !default;
.uni-breadcrumb-item {
display: flex;
align-items: center;
white-space: nowrap;
font-size: 14px;
&--slot {
color: $uni-base-color;
padding: 0 10px;
&-link {
color: $uni-main-color;
font-weight: bold;
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
&:hover {
color: $uni-primary;
}
}
}
&--separator {
font-size: 12px;
color: $uni-base-color;
}
&:first-child &--slot {
padding-left: 0;
}
&:last-child &--separator {
display: none;
}
}
</style>

41
uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue

@ -1,41 +0,0 @@
<template>
<view class="uni-breadcrumb">
<slot />
</view>
</template>
<script>
/**
* Breadcrumb 面包屑导航父组件
* @description 显示当前页面的路径快速返回之前的任意页面
* @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
* @property {String} separator 分隔符默认为斜杠'/'
* @property {String} separatorClass 图标分隔符 class
*/
export default {
options: {
virtualHost: true
},
props: {
separator: {
type: String,
default: '/'
},
separatorClass: {
type: String,
default: ''
}
},
provide() {
return {
uniBreadcrumb: this
}
}
}
</script>
<style lang="scss">
.uni-breadcrumb {
display: flex;
}
</style>

88
uni_modules/uni-breadcrumb/package.json

@ -1,88 +0,0 @@
{
"id": "uni-breadcrumb",
"displayName": "uni-breadcrumb 面包屑",
"version": "0.1.2",
"description": "Breadcrumb 面包屑",
"keywords": [
"uni-breadcrumb",
"breadcrumb",
"uni-ui",
"面包屑导航",
"面包屑"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

66
uni_modules/uni-breadcrumb/readme.md

@ -1,66 +0,0 @@
## breadcrumb 面包屑导航
> **组件名:uni-breadcrumb**
> 代码块: `ubreadcrumb`
显示当前页面的路径,快速返回之前的任意页面。
### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
### 基本用法
在 ``template`` 中使用组件
```html
<uni-breadcrumb separator="/">
<uni-breadcrumb-item v-for="(route,index) in routes" :key="index" :to="route.to">{{route.name}}</uni-breadcrumb-item>
</uni-breadcrumb>
```
```js
export default {
name: "uni-stat-breadcrumb",
data() {
return {
routes: [{
to: '/A',
name: 'A页面'
}, {
to: '/B',
name: 'B页面'
}, {
to: '/C',
name: 'C页面'
}]
};
}
}
```
## API
### Breadcrumb Props
|属性名 |类型 |默认值 |说明 |
|:-: |:-: |:-: |:-: |
|separator |String |斜杠'/' |分隔符 |
|separatorClass |String | |图标分隔符 class |
### Breadcrumb Item Props
|属性名 |类型 |默认值 |说明 |
|:-: |:-: |:-: |:-: |
|to |String | |路由跳转页面路径 |
|replace|Boolean | |在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录(仅 h5 支持) |
## 组件示例
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb](https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb)

7
uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue

@ -96,13 +96,6 @@
</script>
<style lang="scss" scoped>
$uni-font-size-base:14px;
$uni-text-color:#333;
$uni-font-size-sm:12px;
$uni-color-error: #e43d33;
$uni-opacity-disabled: 0.3;
$uni-text-color-disable:#c0c0c0;
$uni-color-primary: #2979ff;
.uni-calendar-item__weeks-box {
flex: 1;
/* #ifndef APP-NVUE */

8
uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue

@ -361,14 +361,6 @@
</script>
<style lang="scss" scoped>
$uni-bg-color-mask: rgba($color: #000000, $alpha: 0.4);
$uni-border-color: #EDEDED;
$uni-text-color: #333;
$uni-bg-color-hover:#f1f1f1;
$uni-font-size-base:14px;
$uni-text-color-placeholder: #808080;
$uni-color-subtitle: #555555;
$uni-text-color-grey:#999;
.uni-calendar {
/* #ifndef APP-NVUE */
display: flex;

6
uni_modules/uni-calendar/components/uni-calendar/util.js

@ -122,6 +122,7 @@ class Calendar {
let dateArr = []
let fullDate = this.date.fullDate
for (let i = 1; i <= dateData; i++) {
let isinfo = false
let nowDate = full.year + '-' + (full.month < 10 ?
full.month : full.month) + '-' + (i < 10 ?
'0' + i : i)
@ -310,8 +311,11 @@ class Calendar {
*/
_getWeek(dateData) {
const {
fullDate,
year,
month
month,
date,
day
} = this.getDate(dateData)
let firstDay = new Date(year, month - 1, 1).getDay()
let currentDay = new Date(year, month, 0).getDate()

2
uni_modules/uni-combox/components/uni-combox/uni-combox.vue

@ -148,7 +148,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-combox {
font-size: 14px;
border: 1px solid #DCDFE6;

2
uni_modules/uni-data-checkbox/changelog.md

@ -1,3 +1,5 @@
## 1.0.2(2022-06-30)
- 优化 在 uni-forms 中的依赖注入方式
## 1.0.1(2022-02-07)
- 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug
## 1.0.0(2021-11-19)

48
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@ -155,17 +155,17 @@
value(newVal) {
this.dataList = this.getDataList(newVal)
// fix by mehaotian is_reset uni-forms
if(!this.is_reset){
this.is_reset = false
this.formItem && this.formItem.setValue(newVal)
}
// if(!this.is_reset){
// this.is_reset = false
// this.formItem && this.formItem.setValue(newVal)
// }
},
modelValue(newVal) {
this.dataList = this.getDataList(newVal);
if(!this.is_reset){
this.is_reset = false
this.formItem && this.formItem.setValue(newVal)
}
// if(!this.is_reset){
// this.is_reset = false
// this.formItem && this.formItem.setValue(newVal)
// }
}
},
data() {
@ -193,22 +193,22 @@
}
},
created() {
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
// this.form = this.getForm('uniForms')
// this.formItem = this.getForm('uniFormsItem')
// this.formItem && this.formItem.setValue(this.value)
if (this.formItem) {
this.isTop = 6
if (this.formItem.name) {
// name,formData
if(!this.is_reset){
this.is_reset = false
this.formItem.setValue(this.dataValue)
}
this.rename = this.formItem.name
this.form.inputChildrens.push(this)
}
}
// if (this.formItem) {
// this.isTop = 6
// if (this.formItem.name) {
// // name,formData
// if(!this.is_reset){
// this.is_reset = false
// this.formItem.setValue(this.dataValue)
// }
// this.rename = this.formItem.name
// this.form.inputChildrens.push(this)
// }
// }
if (this.localdata && this.localdata.length !== 0) {
this.isLocal = true
@ -273,7 +273,7 @@
}
}
}
this.formItem && this.formItem.setValue(detail.value)
// this.formItem && this.formItem.setValue(detail.value)
// TODO vue2
this.$emit('input', detail.value);
// // TOTO vue3
@ -375,7 +375,7 @@
selectedArr.push(item[this.map.value])
}
})
return this.dataValue && this.dataValue.length > 0 ? this.dataValue : selectedArr
return this.dataValue.length > 0 ? this.dataValue : selectedArr
},
/**

2
uni_modules/uni-data-checkbox/package.json

@ -1,7 +1,7 @@
{
"id": "uni-data-checkbox",
"displayName": "uni-data-checkbox 数据选择器",
"version": "1.0.1",
"version": "1.0.2",
"description": "通过数据驱动的单选框和复选框",
"keywords": [
"uni-ui",

6
uni_modules/uni-data-picker/changelog.md

@ -1,3 +1,9 @@
## 1.0.7(2022-07-06)
- 优化 pc端图标位置不正确的问题
## 1.0.6(2022-07-05)
- 优化 显示样式
## 1.0.5(2022-07-04)
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
## 1.0.4(2022-04-19)
- 修复 字节小程序 本地数据无法选择下一级的Bug
## 1.0.3(2022-02-25)

29
uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue

@ -10,7 +10,7 @@
<scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true">
<view class="selected-list">
<view class="selected-item" v-for="(item,index) in inputSelected" :key="index">
<text>{{item.text}}</text><text v-if="index<inputSelected.length-1"
<text class="text-color">{{item.text}}</text><text v-if="index<inputSelected.length-1"
class="input-split-line">{{split}}</text>
</view>
</view>
@ -18,7 +18,7 @@
<text v-else class="selected-area placeholder">{{placeholder}}</text>
<view v-if="clearIcon && !readonly && inputSelected.length" class="icon-clear"
@click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="14"></uni-icons>
<uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
</view>
<view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly ">
<view class="input-arrow"></view>
@ -296,6 +296,7 @@
<style >
.uni-data-tree {
flex: 1;
position: relative;
font-size: 14px;
}
@ -312,12 +313,14 @@
align-items: center;
flex-wrap: nowrap;
font-size: 14px;
line-height: 38px;
padding: 0 5px;
/* line-height: 35px; */
padding: 0 10px;
padding-right: 5px;
overflow: hidden;
height: 35px;
/* #ifdef APP-NVUE */
height: 40px;
/* #endif */
box-sizing: border-box;
}
.input-value-border {
@ -349,19 +352,24 @@
/* #endif */
flex-direction: row;
flex-wrap: nowrap;
padding: 0 5px;
/* padding: 0 5px; */
}
.selected-item {
flex-direction: row;
padding: 0 1px;
/* padding: 0 1px; */
/* #ifndef APP-NVUE */
white-space: nowrap;
/* #endif */
}
.text-color {
color: #333;
}
.placeholder {
color: grey;
font-size: 12px;
}
.input-split-line {
@ -477,6 +485,11 @@
flex: 1;
overflow: hidden;
}
.icon-clear {
display: flex;
align-items: center;
}
/* #ifdef H5 */
@media all and (min-width: 768px) {
@ -502,7 +515,7 @@
}
.icon-clear {
margin-right: 5px;
/* margin-right: 5px; */
}
}

5
uni_modules/uni-data-picker/package.json

@ -1,7 +1,7 @@
{
"id": "uni-data-picker",
"displayName": "uni-data-picker 数据驱动的picker选择器",
"version": "1.0.4",
"version": "1.0.7",
"description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
"keywords": [
"uni-ui",
@ -76,7 +76,8 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
"QQ": "y",
"京东": "u"
},
"快应用": {
"华为": "u",

10
uni_modules/uni-data-select/changelog.md

@ -1,10 +0,0 @@
## 0.1.3(2022-06-02)
- 修复 localdata 赋值不生效的 bug
- 新增 支持 uni.scss 修改颜色
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
## 0.1.2(2022-05-08)
- 修复 当 value 为 0 时选择不生效的 bug
## 0.1.1(2022-05-07)
- 新增 记住上次的选项(仅 collection 存在时有效)
## 0.1.0(2022-04-22)
- 初始化

402
uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue

@ -1,402 +0,0 @@
<template>
<view class="uni-stat__select">
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
<view :class="{'uni-stat__actived': current}">
<view class="uni-select">
<view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{current}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<uni-icons v-if="current && clear" type="clear" color="#e1e1e1" size="18" @click="clearVal" />
<uni-icons v-else :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
:key="index" @click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-stat-select",
mixins: [uniCloud.mixinDatacom || {}],
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: []
};
},
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
}
},
created() {
this.last = `${this.collection}_last_selected_option_value`
if (this.collection && !this.localdata.length) {
this.mixinDatacomEasyGet()
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = this.placeholder
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val) && old!==val) {
this.mixinDatacomResData = val
}
}
},
// #ifndef VUE3
value() {
this.initDefVal()
},
// #endif
// #ifdef VUE3
modelValue() {
this.initDefVal()
},
// #endif
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
}
},
methods: {
initDefVal() {
let defValue = ''
if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
defValue = this.value
} else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
defValue = this.modelValue
} else {
let strogeValue
if (this.collection) {
strogeValue = uni.getStorageSync(this.last)
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
this.emit(defValue)
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
uni.removeStorageSync(this.last)
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('change', val)
this.$emit('input', val)
this.$emit('update:modelValue', val)
if (this.collection) {
uni.setStorageSync(this.last, val)
}
},
toggleSelector() {
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
}
}
</script>
<style>
/* #ifndef APP-NVUE */
@media screen and (max-width: 500px) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
padding: 15px;
cursor: pointer;
}
.uni-stat__actived {
outline: 1px solid #2979ff;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: #555;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
border: 1px solid #DCDFE6;
box-sizing: border-box;
border-radius: 4px;
padding: 0 5px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
border-bottom: solid 1px #DDDDDD;
}
.uni-select__label {
font-size: 16px;
line-height: 22px;
padding-right: 10px;
color: #999999;
}
.uni-select__input-box {
min-height: 36px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: #999;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 2;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 36px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px #DDDDDD; */
padding: 0px 10px;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
left: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-select__input-text {
width: 280px;
color: #333;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
}
.uni-select__input-placeholder {
color: #666;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
</style>

88
uni_modules/uni-data-select/package.json

@ -1,88 +0,0 @@
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
"version": "0.1.3",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
"select",
"uni-data-select",
"下拉框",
"下拉选"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.1"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-load-more"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

8
uni_modules/uni-data-select/readme.md

@ -1,8 +0,0 @@
## DataSelect 下拉框选择器
> **组件名:uni-data-select**
> 代码块: `uDataSelect`
当选项过多时,使用下拉菜单展示并选择内容
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

2
uni_modules/uni-datetime-picker/changelog.md

@ -1,3 +1,5 @@
## 2.2.6(2022-06-30)
- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
## 2.2.5(2022-06-24)
- 修复 日历顶部年月及底部确认未国际化 bug
## 2.2.4(2022-03-31)

89
uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue

@ -5,12 +5,12 @@
<view class="uni-date-editor--x" :class="{'uni-date-editor--x__disabled': disabled,
'uni-date-x--border': border}">
<view v-if="!isRange" class="uni-date-x uni-date-single">
<uni-icons type="calendar" color="#e1e1e1" size="22"></uni-icons>
<uni-icons type="calendar" color="#c0c4cc" size="22"></uni-icons>
<input class="uni-date__x-input" type="text" v-model="singleVal"
:placeholder="singlePlaceholderText" :disabled="true" />
</view>
<view v-else class="uni-date-x uni-date-range">
<uni-icons type="calendar" color="#e1e1e1" size="22"></uni-icons>
<uni-icons type="calendar" color="#c0c4cc" size="22"></uni-icons>
<input class="uni-date__x-input t-c" type="text" v-model="range.startDate"
:placeholder="startPlaceholderText" :disabled="true" />
<slot>
@ -20,7 +20,7 @@
:placeholder="endPlaceholderText" :disabled="true" />
</view>
<view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="18"></uni-icons>
<uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
</view>
</view>
</slot>
@ -127,10 +127,23 @@
export default {
name: 'UniDatetimePicker',
options: {
virtualHost: true
},
components: {
calendar,
timePicker
},
inject: {
form: {
from: 'uniForm',
default: null
},
formItem: {
from: 'uniFormItem',
default: null
},
},
data() {
return {
isRange: false,
@ -386,33 +399,16 @@
}
},
created() {
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
// if (this.formItem) {
// if (this.formItem.name) {
// this.rename = this.formItem.name
// this.form.inputChildrens.push(this)
// }
// if (this.form && this.formItem) {
// this.$watch('formItem.errMsg', (newVal) => {
// this.localMsg = newVal
// })
// }
},
mounted() {
this.platform()
},
methods: {
/**
* 获取父元素实例
*/
getForm(name = 'uniForms') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
initPicker(newVal) {
if (!newVal || Array.isArray(newVal) && !newVal.length) {
this.$nextTick(() => {
@ -545,7 +541,8 @@
}
}
}
this.formItem && this.formItem.setValue(value)
this.$emit('change', value)
this.$emit('input', value)
this.$emit('update:modelValue', value)
@ -710,7 +707,15 @@
this.$refs.pcSingle && this.$refs.pcSingle.clearCalender()
}
if (needEmit) {
this.formItem && this.formItem.setValue('')
//
// if(this.form && this.formItem){
// const {
// validateTrigger
// } = this.form
// if (validateTrigger === 'blur') {
// this.formItem.onFieldChange()
// }
// }
this.$emit('change', '')
this.$emit('input', '')
this.$emit('update:modelValue', '')
@ -730,7 +735,6 @@
this.$refs.right && this.$refs.right.next()
}
if (needEmit) {
this.formItem && this.formItem.setValue([])
this.$emit('change', [])
this.$emit('input', [])
this.$emit('update:modelValue', [])
@ -779,6 +783,12 @@
</script>
<style>
.uni-date {
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
flex: 1;
}
.uni-date-x {
display: flex;
flex-direction: row;
@ -789,25 +799,25 @@
background-color: #fff;
color: #666;
font-size: 14px;
flex: 1;
}
.uni-date-x--border {
box-sizing: border-box;
border-radius: 4px;
border: 1px solid #dcdfe6;
border: 1px solid #e5e5e5;
}
.uni-date-editor--x {
display: flex;
align-items: center;
position: relative;
}
.uni-date-editor--x .uni-date__icon-clear {
position: absolute;
top: 0;
right: 0;
display: inline-block;
box-sizing: border-box;
border: 9px solid transparent;
padding: 0 5px;
display: flex;
align-items: center;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
@ -815,10 +825,15 @@
.uni-date__x-input {
padding: 0 8px;
height: 40px;
width: 100%;
line-height: 40px;
/* #ifndef APP-NVUE */
width: auto;
/* #endif */
position: relative;
overflow: hidden;
flex: 1;
line-height: 1;
font-size: 14px;
height: 35px;
}
.t-c {

2
uni_modules/uni-datetime-picker/package.json

@ -1,7 +1,7 @@
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.5",
"version": "2.2.6",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",

2
uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue

@ -105,7 +105,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
$uni-mask: rgba($color: #000000, $alpha: 0.4) ;
//
$drawer-width: 220px;

6
uni_modules/uni-easyinput/changelog.md

@ -1,3 +1,9 @@
## 1.1.0(2022-06-30)
- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- 新增 clear 事件,点击右侧叉号图标触发
- 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
- 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
-
## 1.0.5(2022-06-07)
- 优化 clearable 显示策略
## 1.0.4(2022-06-07)

322
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

@ -1,29 +1,34 @@
<template>
<view class="uni-easyinput" :class="{'uni-easyinput-error':msg}" :style="{color:inputBorder && msg?'#e43d33':styles.color}">
<view class="uni-easyinput__content" :class="{'is-input-border':inputBorder ,'is-input-error-border':inputBorder && msg,'is-textarea':type==='textarea','is-disabled':disabled}"
:style="{'border-color':inputBorder && msg?'#dd524d':styles.borderColor,'background-color':disabled?styles.disableColor:''}">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')"></uni-icons>
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{'input-padding':inputBorder}"
:name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled" placeholder-class="uni-easyinput__placeholder-class"
:maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus"
@confirm="onConfirm"></textarea>
<input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input" :style="{
'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px',
'padding-left':prefixIcon?'':'10px'
}"
:name="name" :value="val" :password="!showPassword && type === 'password'" :placeholder="placeholder"
:placeholderStyle="placeholderStyle" placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :maxlength="inputMaxlength" :focus="focused" :confirmType="confirmType" @focus="onFocus"
@blur="onBlur" @input="onInput" @confirm="onConfirm" />
<template v-if="type === 'password' && passwordIcon" >
<uni-icons v-if="val" class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" :type="showPassword?'eye-slash-filled':'eye-filled'"
:size="18" color="#c0c4cc" @click="onEyes"></uni-icons>
<view class="uni-easyinput" :class="{'uni-easyinput-error':msg}" :style="boxStyle">
<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc"
@click="onClickIcon('prefix')" size="22"></uni-icons>
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea"
:class="{'input-padding':inputBorder}" :name="name" :value="val" :placeholder="placeholder"
:placeholderStyle="placeholderStyle" :disabled="disabled"
placeholder-class="uni-easyinput__placeholder-class" :maxlength="inputMaxlength" :focus="focused"
:autoHeight="autoHeight" @input="onInput" @blur="_Blur" @focus="_Focus" @confirm="onConfirm"></textarea>
<input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input"
:style="inputStyle" :name="name" :value="val" :password="!showPassword && type === 'password'"
:placeholder="placeholder" :placeholderStyle="placeholderStyle"
placeholder-class="uni-easyinput__placeholder-class" :disabled="disabled" :maxlength="inputMaxlength"
:focus="focused" :confirmType="confirmType" @focus="_Focus" @blur="_Blur" @input="onInput"
@confirm="onConfirm" />
<template v-if="type === 'password' && passwordIcon">
<!-- 开启密码时显示小眼睛 -->
<uni-icons v-if="isVal" class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}"
:type="showPassword?'eye-slash-filled':'eye-filled'" :size="22"
:color="focusShow?'#2979ff':'#c0c4cc'" @click="onEyes">
</uni-icons>
</template>
<template v-else-if="suffixIcon">
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc" @click="onClickIcon('suffix')"></uni-icons>
<uni-icons v-if="suffixIcon" class="content-clear-icon" :type="suffixIcon" color="#c0c4cc"
@click="onClickIcon('suffix')" size="22"></uni-icons>
</template>
<template v-else>
<uni-icons class="content-clear-icon" :class="{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize"
v-if="clearable && val && !disabled" color="#c0c4cc" @click="onClear"></uni-icons>
<uni-icons v-if="clearable && isVal && !disabled && type !== 'textarea'" class="content-clear-icon"
:class="{'is-textarea-icon':type==='textarea'}" type="clear" :size="clearSize"
:color="msg?'#dd524d':(focusShow?'#2979ff':'#c0c4cc')" @click="onClear"></uni-icons>
</template>
<slot name="right"></slot>
</view>
@ -31,10 +36,6 @@
</template>
<script>
// import {
// debounce,
// throttle
// } from './common.js'
/**
* Easyinput 输入框
* @description 此组件可以实现表单的输入与校验包括 "text" "textarea" 类型
@ -48,7 +49,7 @@
* @value idcard 身份证输入键盘支付宝百度QQ小程序
* @value digit 带小数点的数字键盘 App的nvue页面微信支付宝百度头条QQ小程序支持
* @property {Boolean} clearable 是否显示右侧清空内容的图标控件点击可清空输入框内容默认true
* @property {Boolean} autoHeight 是否自动增高输入区域type为textarea时有效默认false
* @property {Boolean} autoHeight 是否自动增高输入区域type为textarea时有效默认true
* @property {String } placeholder 输入框的提示文字
* @property {String } placeholderStyle placeholder的样式(内联样式字符串)"color: #ddd"
* @property {Boolean} focus 是否自动获得焦点默认false
@ -76,13 +77,44 @@
* @event {Function} iconClick 点击图标时触发
* @example <uni-easyinput v-model="mobile"></uni-easyinput>
*/
function obj2strClass(obj) {
let classess = ''
for (let key in obj) {
const val = obj[key]
if (val) {
classess += `${key} `
}
}
return classess
}
export default {
function obj2strStyle(obj) {
let style = ''
for (let key in obj) {
const val = obj[key]
style += `${key}:${val};`
}
return style
}
export default {
name: 'uni-easyinput',
emits:['click','iconClick','update:modelValue','input','focus','blur','confirm'],
model:{
prop:'modelValue',
event:'update:modelValue'
emits: ['click', 'iconClick', 'update:modelValue', 'input', 'focus', 'blur', 'confirm', 'clear', 'eyes', 'change'],
model: {
prop: 'modelValue',
event: 'update:modelValue'
},
options: {
virtualHost: true
},
inject: {
form: {
from: 'uniForm',
default: null
},
formItem: {
from: 'uniFormItem',
default: null
},
},
props: {
name: String,
@ -100,7 +132,10 @@
type: Boolean,
default: false
},
placeholder: String,
placeholder: {
type: String,
default: ' '
},
placeholderStyle: String,
focus: {
type: Boolean,
@ -120,7 +155,7 @@
},
clearSize: {
type: [Number, String],
default: 15
default: 24
},
inputBorder: {
type: Boolean,
@ -138,7 +173,7 @@
type: [Boolean, String],
default: true
},
passwordIcon:{
passwordIcon: {
type: Boolean,
default: true
},
@ -152,79 +187,105 @@
}
}
},
errorMessage:{
type:[String,Boolean],
default:''
errorMessage: {
type: [String, Boolean],
default: ''
}
},
data() {
return {
focused: false,
errMsg: '',
val: '',
showMsg: '',
border: false,
isFirstBorder: false,
showClearIcon: false,
showPassword: false
showPassword: false,
focusShow: false,
localMsg: ''
};
},
computed: {
//
isVal() {
const val = this.val
// fixed by mehaotian 00
if (val || val === 0) {
return true
}
return false
},
msg() {
return this.errorMessage || this.errMsg;
// console.log('computed', this.form, this.formItem);
// if (this.form) {
// return this.errorMessage || this.formItem.errMsg;
// }
// TODO formItem errMsg
return this.localMsg || this.errorMessage
},
// uniappinputmaxlength
inputMaxlength() {
return Number(this.maxlength);
},
// style
boxStyle() {
return `color:${this.inputBorder && this.msg?'#e43d33':this.styles.color};`
},
// input
inputContentClass() {
return obj2strClass({
'is-input-border': this.inputBorder,
'is-input-error-border': this.inputBorder && this.msg,
'is-textarea': this.type === 'textarea',
'is-disabled': this.disabled
})
},
inputContentStyle() {
const focusColor = this.focusShow ? '#2979ff' : this.styles.borderColor
const borderColor = this.inputBorder && this.msg ? '#dd524d' : focusColor
return obj2strStyle({
'border-color': borderColor || '#e5e5e5',
'background-color': this.disabled ? this.styles.disableColor : '#fff'
})
},
// input
inputStyle() {
const paddingRight = this.type === 'password' || this.clearable || this.prefixIcon ? '' : '10px'
return obj2strStyle({
'padding-right': paddingRight,
'padding-left': this.prefixIcon ? '' : '10px'
})
}
},
watch: {
value(newVal) {
if (this.errMsg) this.errMsg = ''
this.val = newVal
// fix by mehaotian is_reset uni-forms
if (this.form && this.formItem &&!this.is_reset) {
this.is_reset = false
this.formItem.setValue(newVal)
}
},
modelValue(newVal) {
if (this.errMsg) this.errMsg = ''
this.val = newVal
if (this.form && this.formItem &&!this.is_reset) {
this.is_reset = false
this.formItem.setValue(newVal)
}
},
focus(newVal) {
this.$nextTick(() => {
this.focused = this.focus
this.focusShow = this.focus
})
}
},
created() {
if(!this.value && this.value !== 0){
this.val = this.modelValue
}
if(!this.modelValue && this.modelValue !== 0){
this.val = this.value
}
this.form = this.getForm('uniForms')
this.formItem = this.getForm('uniFormsItem')
this.init()
// TODO vue3 computed inject formItem.errMsg
if (this.form && this.formItem) {
if (this.formItem.name) {
if(!this.is_reset){
this.is_reset = false
this.formItem.setValue(this.val)
}
this.rename = this.formItem.name
this.form.inputChildrens.push(this)
}
this.$watch('formItem.errMsg', (newVal) => {
this.localMsg = newVal
})
}
},
mounted() {
this.$nextTick(() => {
this.focused = this.focus
this.focusShow = this.focus
})
},
methods: {
@ -232,28 +293,35 @@
* 初始化变量值
*/
init() {
if (this.value || this.value === 0) {
this.val = this.value
} else if (this.modelValue || this.modelValue === 0) {
this.val = this.modelValue
} else {
this.val = null
}
},
/**
* 点击图标时触发
* @param {Object} type
*/
onClickIcon(type) {
this.$emit('iconClick', type)
},
/**
* 获取父元素实例
* 显示隐藏内容密码框时生效
*/
getForm(name = 'uniForms') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false;
parentName = parent.$options.name;
}
return parent;
},
onEyes() {
this.showPassword = !this.showPassword
this.$emit('eyes', this.showPassword)
},
/**
* 输入时触发
* @param {Object} event
*/
onInput(event) {
let value = event.detail.value;
//
@ -270,30 +338,79 @@
// TODO vue2
this.$emit('input', value);
// TODO  vue3
this.$emit('update:modelValue',value)
this.$emit('update:modelValue', value)
},
onFocus(event) {
/**
* 外部调用方法
* 获取焦点时触发
* @param {Object} event
*/
onFocus() {
this.$nextTick(() => {
this.focused = true
})
this.$emit('focus', null);
},
_Focus(event) {
this.focusShow = true
this.$emit('focus', event);
},
onBlur(event) {
/**
* 外部调用方法
* 失去焦点时触发
* @param {Object} event
*/
onBlur() {
this.focused = false
this.$emit('focus', null);
},
_Blur(event) {
let value = event.detail.value;
this.focusShow = false
this.$emit('blur', event);
// eventstring
this.$emit('change', this.val)
//
if (this.form && this.formItem) {
const {
validateTrigger
} = this.form
if (validateTrigger === 'blur') {
this.formItem.onFieldChange()
}
}
},
/**
* 按下键盘的发送键
* @param {Object} e
*/
onConfirm(e) {
this.$emit('confirm', e.detail.value);
this.$emit('confirm', this.val);
this.$emit('change', this.val)
},
/**
* 清理内容
* @param {Object} event
*/
onClear(event) {
this.val = '';
// TODO vue2
this.$emit('input', '');
// TODO vue2
// TODO  vue3
this.$emit('update:modelValue','')
},
fieldClick() {
this.$emit('click');
this.$emit('update:modelValue', '')
//
this.$emit('clear')
},
/**
* 去除空格
*/
trimStr(str, pos = 'both') {
if (pos === 'both') {
return str.trim();
@ -316,9 +433,10 @@
};
</script>
<style lang="scss" >
<style lang="scss">
$uni-error: #e43d33;
$uni-border-1: #DCDFE6 !default;
.uni-easyinput {
/* #ifndef APP-NVUE */
width: 100%;
@ -336,10 +454,14 @@
width: 100%;
display: flex;
box-sizing: border-box;
min-height: 36px;
// min-height: 36px;
/* #endif */
flex-direction: row;
align-items: center;
// border
border-color: #fff;
transition-property: border-color;
transition-duration: 0.3s;
}
.uni-easyinput__content-input {
@ -351,12 +473,16 @@
flex: 1;
line-height: 1;
font-size: 14px;
height: 35px;
// min-height: 36px;
}
.uni-easyinput__placeholder-class {
color: #999;
font-size: 12px;
font-weight: 200;
// font-weight: 200;
}
.is-textarea {
align-items: flex-start;
}
@ -371,9 +497,10 @@
flex: 1;
line-height: 1.5;
font-size: 14px;
padding-top: 6px;
padding-bottom: 10px;
margin: 6px;
margin-left: 0;
height: 80px;
min-height: 80px;
/* #ifndef APP-NVUE */
min-height: 80px;
width: auto;
@ -403,6 +530,9 @@
align-items: center;
border: 1px solid $uni-border-1;
border-radius: 4px;
/* #ifdef MP-ALIPAY */
overflow: hidden;
/* #endif */
}
.uni-error-message {
@ -423,8 +553,10 @@
.is-input-error-border {
border-color: $uni-error;
.uni-easyinput__placeholder-class {
color: mix(#fff, $uni-error, 50%);;
color: mix(#fff, $uni-error, 50%);
;
}
}
@ -450,9 +582,9 @@
}
.is-disabled {
border-color: red;
background-color: #F7F6F6;
color: #D5D5D5;
.uni-easyinput__placeholder-class {
color: #D5D5D5;
font-size: 12px;

2
uni_modules/uni-easyinput/package.json

@ -1,7 +1,7 @@
{
"id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框",
"version": "1.0.5",
"version": "1.1.0",
"description": "Easyinput 组件是对原生input组件的增强",
"keywords": [
"uni-ui",

2
uni_modules/uni-file-picker/changelog.md

@ -1,3 +1,5 @@
## 1.0.2(2022-07-04)
- 修复 在uni-forms下样式不生效的bug
## 1.0.1(2021-11-23)
- 修复 参数为对象的情况下,url在某些情况显示错误的bug
## 1.0.0(2021-11-19)

5
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue

@ -84,6 +84,9 @@
uploadImage,
uploadFile
},
options: {
virtualHost: true
},
emits: ['select', 'success', 'fail', 'progress', 'delete', 'update:modelValue', 'input'],
props: {
// #ifdef VUE3
@ -607,7 +610,9 @@
/* #ifndef APP-NVUE */
box-sizing: border-box;
overflow: hidden;
width: 100%;
/* #endif */
flex: 1;
}
.uni-file-picker__header {

2
uni_modules/uni-file-picker/package.json

@ -1,7 +1,7 @@
{
"id": "uni-file-picker",
"displayName": "uni-file-picker 文件选择上传",
"version": "1.0.1",
"version": "1.0.2",
"description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
"keywords": [
"uni-ui",

22
uni_modules/uni-forms/changelog.md

@ -1,3 +1,25 @@
## 1.4.5(2022-07-05)
- 新增 更多表单示例
- 优化 子表单组件过期提示的问题
- 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式
## 1.4.4(2022-07-04)
- 更新 删除组件日志
## 1.4.3(2022-07-04)
- 修复 由 1.4.0 引发的 label 插槽不生效的bug
## 1.4.2(2022-07-04)
- 修复 子组件找不到 setValue 报错的bug
## 1.4.1(2022-07-04)
- 修复 uni-data-picker 在 uni-forms-item 中报错的bug
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
## 1.4.0(2022-06-30)
- 【重要】组件逻辑重构,部分用法用旧版本不兼容,请注意兼容问题
- 【重要】组件使用 Provide/Inject 方式注入依赖,提供了自定义表单组件调用 uni-forms 校验表单的能力
- 新增 model 属性,等同于原 value/modelValue 属性,旧属性即将废弃
- 新增 validateTrigger 属性的 blur 值,仅 uni-easyinput 生效
- 新增 onFieldChange 方法,可以对子表单进行校验,可替代binddata方法
- 新增 子表单的 setRules 方法,配合自定义校验函数使用
- 新增 uni-forms-item 的 setRules 方法,配置动态表单使用可动态更新校验规则
- 优化 动态表单校验方式,废弃拼接name的方式
## 1.3.3(2022-06-22)
- 修复 表单校验顺序无序问题
## 1.3.2(2021-12-09)

1023
uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue

File diff suppressed because it is too large

470
uni_modules/uni-forms/components/uni-forms/uni-forms.vue

@ -1,13 +1,27 @@
<template>
<view class="uni-forms" :class="{ 'uni-forms--top': !border }">
<form @submit.stop="submitForm" @reset="resetForm">
<view class="uni-forms">
<form>
<slot></slot>
</form>
</view>
</template>
<script>
import Validator from './validate.js';
import {
deepCopy,
getValue,
isRequiredField,
setDataValue,
getDataValue,
realName,
isRealName,
rawData,
isEqual
} from './utils.js'
// #ifndef VUE3
//
import Vue from 'vue';
Vue.prototype.binddata = function(name, value, formName) {
if (formName) {
@ -26,18 +40,15 @@
}
};
// #endif
import Validator from './validate.js';
/**
* Forms 表单
* @description 由输入框选择器单选框多选框等控件组成用以收集校验提交数据
* @tutorial https://ext.dcloud.net.cn/plugin?id=2773
* @property {Object} rules 表单校验规则
* @property {String} validateTrigger = [bind|submit] 校验触发器方式 默认 submit
* @property {String} validateTrigger = [bind|submit|blur] 校验触发器方式 默认 submit
* @value bind 发生变化时触发
* @value submit 提交时触发
* @value blur 失去焦点时触发
* @property {String} labelPosition = [top|left] label 位置 默认 left
* @value top 顶部显示 label
* @value left 左侧显示 label
@ -51,25 +62,34 @@
* @value toast 错误信息toast显示
* @value modal 错误信息modal显示
* @event {Function} submit 提交时触发
* @event {Function} validate 校验结果发生变化触发
*/
export default {
name: 'uniForms',
components: {},
emits:['input','reset','validate','submit'],
emits: ['validate', 'submit'],
options: {
virtualHost: true
},
props: {
//
value: {
type: Object,
default () {
return {};
return null;
}
},
// value
// vue3 value
modelValue: {
type: Object,
default () {
return {};
return null;
}
},
// 1.4.0 v-model value modelValue
model: {
type: Object,
default () {
return null;
}
},
//
@ -79,58 +99,68 @@
return {};
}
},
//
// undertext [undertext|toast|modal]
errShowType: {
type: String,
default: 'undertext'
},
// bind [bind|submit]
validateTrigger: {
type: String,
default: ''
default: 'submit'
},
// label top/left
// label left top/left
labelPosition: {
type: String,
default: 'left'
},
// label px
// label
labelWidth: {
type: [String, Number],
default: ''
},
// label left/center/right
// label left left/center/right
labelAlign: {
type: String,
default: 'left'
},
errShowType: {
type: String,
default: 'undertext'
},
border: {
type: Boolean,
default: false
}
},
provide() {
return {
uniForm: this
}
},
data() {
return {
formData: {}
//
formData: {},
formRules: {}
};
},
computed: {
dataValue() {
if (JSON.stringify(this.modelValue) === '{}') {
return this.value
} else {
return this.modelValue
//
localData() {
const localVal = this.model || this.modelValue || this.value
if (localVal) {
return deepCopy(localVal)
}
return {}
}
},
watch: {
rules(newVal) {
//
this.init(newVal);
},
labelPosition() {
this.childrens.forEach(vm => {
vm.init()
})
// ,使
// localData: {},
//
rules: {
handler: function(val, oldVal) {
this.setRules(val)
},
deep: true,
immediate: true
}
},
created() {
@ -156,146 +186,132 @@
}
// #endif
// watch
this.unwatchs = [];
//
this.childrens = [];
// easyInput
this.inputChildrens = [];
// dataCheckbox
this.checkboxChildrens = [];
//
this.formRules = [];
this.init(this.rules);
//
this.childrens = []
// TODO uni-data-picker ,
this.inputChildrens = []
this.setRules(this.rules)
},
// mounted() {
// this.init(this.rules)
// },
methods: {
init(formRules) {
//
if (Object.keys(formRules).length === 0) {
try{
// TODO
this.formData = JSON.parse(JSON.stringify(this.dataValue))
}catch(e){
//TODO handle the exception
this.formData = {}
}
return
};
this.formRules = formRules;
this.validator = new Validator(formRules);
this.registerWatch();
},
// watch
registerWatch() {
// , init $watch
this.unwatchs.forEach(v => v());
this.childrens.forEach((v) => {
v.init()
})
// watch
Object.keys(this.dataValue).forEach(key => {
let watch = this.$watch(
'dataValue.' + key,
value => {
if (!value){
this.formData[key] = this._getValue(key,value);
return
}
//
if (value.toString() === '[object Object]') {
for (let i in value) {
let name = `${key}[${i}]`;
this.formData[name] = this._getValue(name, value[i]);
}
} else {
this.formData[key] = this._getValue(key, value);
}
},
{
deep: true,
immediate: true
}
);
this.unwatchs.push(watch);
});
},
/**
* 公开给用户使用
* 设置验规则
* @param {Object} formRules
* 外部调用方法
* 设置规则 主要用于小程序自定义检验规则
* @param {Array} rules 规则源数据
*/
setRules(formRules) {
this.init(formRules);
setRules(rules) {
// TODO
this.formRules = Object.assign({}, this.formRules, rules)
//
this.validator = new Validator(rules);
},
/**
* 公开给用户使用
* 设置自定义表单组件 value
* @param {String} name 字段名称
* @param {String} value 字段值
* 外部调用方法
* 设置数据用于设置表单数据公开给用户使用 不支持在动态表单中使用
* @param {Object} key
* @param {Object} value
*/
setValue(name, value, callback) {
let example = this.childrens.find(child => child.name === name);
setValue(key, value) {
let example = this.childrens.find(child => child.name === key);
if (!example) return null;
value = this._getValue(example.name, value);
this.formData[name] = value;
example.val = value;
return example.triggerCheck(value, callback);
this.formData[key] = getValue(key, value, (this.formRules[key] && this.formRules[key].rules) || [])
return example.onFieldChange(this.formData[key]);
},
/**
* 外部调用方法
* 手动提交校验表单
* 对整个表单进行校验的方法参数为一个回调函数
* @param {Array} keepitem 保留不参与校验的字段
* @param {type} callback 方法回调
*/
validate(keepitem, callback) {
return this.checkAll(this.formData, keepitem, callback);
},
/**
* 表单重置
* @param {Object} event
* 外部调用方法
* 部分表单校验
* @param {Array|String} props 需要校验的字段
* @param {Function} 回调函数
*/
resetForm(event) {
validateField(props = [], callback) {
props = [].concat(props);
let invalidFields = {};
this.childrens.forEach(item => {
item.errMsg = '';
const inputComp = this.inputChildrens.find(child => child.rename === item.name);
if (inputComp) {
inputComp.errMsg = '';
// fix by mehaotian setValue
inputComp.is_reset = true
inputComp.$emit('input', inputComp.multiple ? [] : '');
inputComp.$emit('update:modelValue', inputComp.multiple ? [] : '');
const name = realName(item.name)
if (props.indexOf(name) !== -1) {
invalidFields = Object.assign({}, invalidFields, {
[name]: this.formData[name]
});
}
});
return this.checkAll(invalidFields, [], callback);
},
/**
* 外部调用方法
* 移除表单项的校验结果传入待移除的表单项的 prop 属性或者 prop 组成的数组如不传则移除整个表单的校验结果
* @param {Array|String} props 需要移除校验的字段 不填为所有
*/
clearValidate(props = []) {
props = [].concat(props);
this.childrens.forEach(item => {
if (item.name) {
this.formData[item.name] = this._getValue(item.name, '');
if (props.length === 0) {
item.errMsg = '';
} else {
const name = realName(item.name)
if (props.indexOf(name) !== -1) {
item.errMsg = '';
}
}
});
this.$emit('reset', event);
},
/**
* 触发表单校验通过 @validate 获取
* @param {Object} validate
* 外部调用方法 即将废弃
* 手动提交校验表单
* 对整个表单进行校验的方法参数为一个回调函数
* @param {Array} keepitem 保留不参与校验的字段
* @param {type} callback 方法回调
*/
validateCheck(validate) {
if (validate === null) validate = null;
this.$emit('validate', validate);
submit(keepitem, callback, type) {
for (let i in this.dataValue) {
const itemData = this.childrens.find(v => v.name === i);
if (itemData) {
if (this.formData[i] === undefined) {
this.formData[i] = this._getValue(i, this.dataValue[i]);
}
}
}
if (!type) {
console.warn('submit 方法即将废弃,请使用validate方法代替!');
}
return this.checkAll(this.formData, keepitem, callback, 'submit');
},
/**
* 校验所有或者部分表单
*/
async validateAll(invalidFields, type, keepitem, callback) {
//
async checkAll(invalidFields, keepitem, callback, type) {
//
if (!this.validator) return
let childrens = []
// item
for (let i in invalidFields) {
const item = this.childrens.find(v => v.name === i)
const item = this.childrens.find(v => realName(v.name) === i)
if (item) {
childrens.push(item)
}
}
// validatefunciont ,
if (!callback && typeof keepitem === 'function') {
callback = keepitem;
}
let promise;
// 使 Promise
if (!callback && typeof callback !== 'function' && Promise) {
promise = new Promise((resolve, reject) => {
callback = function(valid, invalidFields) {
@ -305,47 +321,39 @@
}
let results = [];
let newFormData = {};
if (this.validator) {
for (let key in childrens) {
const child = childrens[key];
let name = child.isArray ? child.arrayField : child.name;
if (child.isArray) {
if (child.name.indexOf('[') !== -1 && child.name.indexOf(']') !== -1) {
const fieldData = child.name.split('[');
const fieldName = fieldData[0];
const fieldValue = fieldData[1].replace(']', '');
if (!newFormData[fieldName]) {
newFormData[fieldName] = {};
}
newFormData[fieldName][fieldValue] = this._getValue(name, invalidFields[name]);
}
} else {
newFormData[name] = this._getValue(name, invalidFields[name]);
}
const result = await child.triggerCheck(invalidFields[name], true);
if (result) {
results.push(result);
if (this.errShowType === 'toast' || this.errShowType === 'modal') break;
}
//
let tempFormData = JSON.parse(JSON.stringify(invalidFields))
// ,使 for 使 awiat
for (let i in childrens) {
const child = childrens[i]
let name = realName(child.name);
const result = await child.onFieldChange(tempFormData[name]);
if (result) {
results.push(result);
// toast ,modal
if (this.errShowType === 'toast' || this.errShowType === 'modal') break;
}
} else {
newFormData = invalidFields
}
if (Array.isArray(results)) {
if (results.length === 0) results = null;
}
if (Array.isArray(keepitem)) {
keepitem.forEach(v => {
newFormData[v] = this.dataValue[v];
let vName = realName(v);
let value = getDataValue(v, this.localData)
if (value !== undefined) {
tempFormData[vName] = value
}
});
}
// TODO submit
if (type === 'submit') {
this.$emit('submit', {
detail: {
value: newFormData,
value: tempFormData,
errors: results
}
});
@ -353,129 +361,37 @@
this.$emit('validate', results);
}
callback && typeof callback === 'function' && callback(results, newFormData);
// const resetFormData = rawData(tempFormData, this.localData, this.name)
let resetFormData = {}
resetFormData = rawData(tempFormData, this.name)
callback && typeof callback === 'function' && callback(results, resetFormData);
if (promise && callback) {
return promise;
} else {
return null;
}
},
submitForm() {},
/**
* 外部调用方法
* 手动提交校验表单
* 对整个表单进行校验的方法参数为一个回调函数
*/
submit(keepitem, callback, type) {
for (let i in this.dataValue) {
const itemData = this.childrens.find(v => v.name === i);
if (itemData) {
if (this.formData[i] === undefined) {
this.formData[i] = this._getValue(i, this.dataValue[i]);
}
}
}
if (!type) {
console.warn('submit 方法即将废弃,请使用validate方法代替!');
}
return this.validateAll(this.formData, 'submit', keepitem, callback);
},
/**
* 外部调用方法
* 校验表单
* 对整个表单进行校验的方法参数为一个回调函数
*/
validate(keepitem, callback) {
return this.submit(keepitem, callback, true);
},
/**
* 部分表单校验
* @param {Object} props
* @param {Object} cb
*/
validateField(props, callback) {
props = [].concat(props);
let invalidFields = {};
this.childrens.forEach(item => {
if (props.indexOf(item.name) !== -1) {
invalidFields = Object.assign({}, invalidFields, {
[item.name]: this.formData[item.name]
});
}
});
return this.validateAll(invalidFields, 'submit', [], callback);
},
/**
* 对整个表单进行重置将所有字段值重置为初始值并移除校验结果
* 返回validate事件
* @param {Object} result
*/
resetFields() {
this.resetForm();
validateCheck(result) {
this.$emit('validate', result);
},
/**
* 移除表单项的校验结果传入待移除的表单项的 prop 属性或者 prop 组成的数组如不传则移除整个表单的校验结果
*/
clearValidate(props) {
props = [].concat(props);
this.childrens.forEach(item => {
const inputComp = this.inputChildrens.find(child => child.rename === item.name);
if (props.length === 0) {
item.errMsg = '';
if (inputComp) {
inputComp.errMsg = '';
}
} else {
if (props.indexOf(item.name) !== -1) {
item.errMsg = '';
if (inputComp) {
inputComp.errMsg = '';
}
}
}
});
},
/**
* value 转换成指定的类型
* @param {Object} key
* @param {Object} value
*/
_getValue(key, value) {
const rules = (this.formRules[key] && this.formRules[key].rules) || [];
const isRuleNum = rules.find(val => val.format && this.type_filter(val.format));
const isRuleBool = rules.find(val => (val.format && val.format === 'boolean') || val.format === 'bool');
// number
if (isRuleNum) {
value = isNaN(value) ? value : value === '' || value === null ? null : Number(value);
}
//
if (isRuleBool) {
value = !value ? false : true;
}
return value;
},
/**
* 过滤数字类型
* @param {Object} format
*/
type_filter(format) {
return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
}
_getValue: getValue,
_isRequiredField: isRequiredField,
_setDataValue: setDataValue,
_getDataValue: getDataValue,
_realName: realName,
_isRealName: isRealName,
_isEqual: isEqual
}
};
</script>
<style lang="scss" >
.uni-forms {
// overflow: hidden;
// padding: 10px 15px;
}
.uni-forms--top {
// padding: 10px 15px;
// padding-top: 22px;
}
<style lang="scss">
.uni-forms {}
</style>

293
uni_modules/uni-forms/components/uni-forms/utils.js

@ -0,0 +1,293 @@
/**
* 简单处理对象拷贝
* @param {Obejct} 被拷贝对象
* @@return {Object} 拷贝对象
*/
export const deepCopy = (val) => {
return JSON.parse(JSON.stringify(val))
}
/**
* 过滤数字类型
* @param {String} format 数字类型
* @@return {Boolean} 返回是否为数字类型
*/
export const typeFilter = (format) => {
return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
}
/**
* value 转换成指定的类型用于处理初始值原因是初始值需要入库不能为 undefined
* @param {String} key 字段名
* @param {any} value 字段值
* @param {Object} rules 表单校验规则
*/
export const getValue = (key, value, rules) => {
const isRuleNumType = rules.find(val => val.format && typeFilter(val.format));
const isRuleBoolType = rules.find(val => (val.format && val.format === 'boolean') || val.format === 'bool');
// 输入类型为 number
if (!!isRuleNumType) {
if (!value && value !== 0) {
value = null
} else {
value = isNumber(Number(value)) ? Number(value) : value
}
}
// 输入类型为 boolean
if (!!isRuleBoolType) {
value = isBoolean(value) ? value : false
}
return value;
}
/**
* 获取表单数据
* @param {String|Array} name 真实名称需要使用 realName 获取
* @param {Object} data 原始数据
* @param {any} value 需要设置的值
*/
export const setDataValue = (field, formdata, value) => {
formdata[field] = value
return value || ''
}
/**
* 获取表单数据
* @param {String|Array} field 真实名称需要使用 realName 获取
* @param {Object} data 原始数据
*/
export const getDataValue = (field, data) => {
return objGet(data, field)
}
/**
* 获取表单类型
* @param {String|Array} field 真实名称需要使用 realName 获取
*/
export const getDataValueType = (field, data) => {
const value = getDataValue(field, data)
return {
type: type(value),
value
}
}
/**
* 获取表单可用的真实name
* @param {String|Array} name 表单name
* @@return {String} 表单可用的真实name
*/
export const realName = (name, data = {}) => {
const base_name = _basePath(name)
if (typeof base_name === 'object' && Array.isArray(base_name) && base_name.length > 1) {
const realname = base_name.reduce((a, b) => a += `#${b}`, '_formdata_')
return realname
}
return base_name[0] || name
}
/**
* 判断是否表单可用的真实name
* @param {String|Array} name 表单name
* @@return {String} 表单可用的真实name
*/
export const isRealName = (name) => {
const reg = /^_formdata_#*/
return reg.test(name)
}
/**
* 获取表单数据的原始格式
* @@return {Object|Array} object 需要解析的数据
*/
export const rawData = (object = {}, name) => {
let newData = JSON.parse(JSON.stringify(object))
let formData = {}
for(let i in newData){
let path = name2arr(i)
objSet(formData,path,newData[i])
}
return formData
}
/**
* 真实name还原为 array
* @param {*} name
*/
export const name2arr = (name) => {
let field = name.replace('_formdata_#', '')
field = field.split('#').map(v => (isNumber(v) ? Number(v) : v))
return field
}
/**
* 对象中设置值
* @param {Object|Array} object 源数据
* @param {String| Array} path 'a.b.c' ['a',0,'b','c']
* @param {String} value 需要设置的值
*/
export const objSet = (object, path, value) => {
if (typeof object !== 'object') return object;
_basePath(path).reduce((o, k, i, _) => {
if (i === _.length - 1) {
// 若遍历结束直接赋值
o[k] = value
return null
} else if (k in o) {
// 若存在对应路径,则返回找到的对象,进行下一次遍历
return o[k]
} else {
// 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {}
return o[k]
}
}, object)
// 返回object
return object;
}
// 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
function _basePath(path) {
// 若是数组,则直接返回
if (Array.isArray(path)) return path
// 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
return path.replace(/\[/g, '.').replace(/\]/g, '').split('.')
}
/**
* 从对象中获取值
* @param {Object|Array} object 源数据
* @param {String| Array} path 'a.b.c' ['a',0,'b','c']
* @param {String} defaultVal 如果无法从调用链中获取值的默认值
*/
export const objGet = (object, path, defaultVal = 'undefined') => {
// 先将path处理成统一格式
let newPath = _basePath(path)
// 递归处理,返回最后结果
let val = newPath.reduce((o, k) => {
return (o || {})[k]
}, object);
return !val || val !== undefined ? val : defaultVal
}
/**
* 是否为 number 类型
* @param {any} num 需要判断的值
* @return {Boolean} 是否为 number
*/
export const isNumber = (num) => {
return !isNaN(Number(num))
}
/**
* 是否为 boolean 类型
* @param {any} bool 需要判断的值
* @return {Boolean} 是否为 boolean
*/
export const isBoolean = (bool) => {
return (typeof bool === 'boolean')
}
/**
* 是否有必填字段
* @param {Object} rules 规则
* @return {Boolean} 是否有必填字段
*/
export const isRequiredField = (rules) => {
let isNoField = false;
for (let i = 0; i < rules.length; i++) {
const ruleData = rules[i];
if (ruleData.required) {
isNoField = true;
break;
}
}
return isNoField;
}
/**
* 获取数据类型
* @param {Any} obj 需要获取数据类型的值
*/
export const type = (obj) => {
var class2type = {};
// 生成class2type映射
"Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function(item, index) {
class2type["[object " + item + "]"] = item.toLowerCase();
})
if (obj == null) {
return obj + "";
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[Object.prototype.toString.call(obj)] || "object" :
typeof obj;
}
/**
* 判断两个值是否相等
* @param {any} a
* @param {any} b
* @return {Boolean} 是否相等
*/
export const isEqual = (a, b) => {
//如果a和b本来就全等
if (a === b) {
//判断是否为0和-0
return a !== 0 || 1 / a === 1 / b;
}
//判断是否为null和undefined
if (a == null || b == null) {
return a === b;
}
//接下来判断a和b的数据类型
var classNameA = toString.call(a),
classNameB = toString.call(b);
//如果数据类型不相等,则返回false
if (classNameA !== classNameB) {
return false;
}
//如果数据类型相等,再根据不同数据类型分别判断
switch (classNameA) {
case '[object RegExp]':
case '[object String]':
//进行字符串转换比较
return '' + a === '' + b;
case '[object Number]':
//进行数字转换比较,判断是否为NaN
if (+a !== +a) {
return +b !== +b;
}
//判断是否为0或-0
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case '[object Date]':
case '[object Boolean]':
return +a === +b;
}
//如果是对象类型
if (classNameA == '[object Object]') {
//获取a和b的属性长度
var propsA = Object.getOwnPropertyNames(a),
propsB = Object.getOwnPropertyNames(b);
if (propsA.length != propsB.length) {
return false;
}
for (var i = 0; i < propsA.length; i++) {
var propName = propsA[i];
//如果对应属性对应值不相等,则返回false
if (a[propName] !== b[propName]) {
return false;
}
}
return true;
}
//如果是数组类型
if (classNameA == '[object Array]') {
if (a.toString() == b.toString()) {
return true;
}
return false;
}
}

2
uni_modules/uni-forms/package.json

@ -1,7 +1,7 @@
{
"id": "uni-forms",
"displayName": "uni-forms 表单",
"version": "1.3.3",
"version": "1.4.5",
"description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
"keywords": [
"uni-ui",

2
uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.vue

@ -68,7 +68,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-grid-item {
/* #ifndef APP-NVUE */
height: 100%;

2
uni_modules/uni-grid/components/uni-grid/uni-grid.vue

@ -106,7 +106,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-grid-wrap {
/* #ifndef APP-NVUE */
display: flex;

2
uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list-item.vue

@ -53,7 +53,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-indexed-list__list {
background-color: $uni-bg-color;
/* #ifndef APP-NVUE */

4
uni_modules/uni-indexed-list/components/uni-indexed-list/uni-indexed-list.vue

@ -140,7 +140,7 @@
setList() {
let index = 0;
this.lists = []
this.options.forEach((value) => {
this.options.forEach((value, index) => {
if (value.data.length === 0) {
return
}
@ -282,7 +282,7 @@
}
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-indexed-list {
position: absolute;
left: 0;

2
uni_modules/uni-nav-bar/changelog.md

@ -1,3 +1,5 @@
## 1.3.6(2022-06-30)
- 修复 组件示例中插槽用法无法显示内容的bug
## 1.3.5(2022-05-24)
- 新增 stat 属性 ,可开启统计title 上报 ,仅使用了title 属性且项目开启了uni统计生效
## 1.3.4(2022-01-24)

2
uni_modules/uni-nav-bar/package.json

@ -1,7 +1,7 @@
{
"id": "uni-nav-bar",
"displayName": "uni-nav-bar 自定义导航栏",
"version": "1.3.5",
"version": "1.3.6",
"description": "自定义导航栏组件,主要用于头部导航。",
"keywords": [
"uni-ui",

2
uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue

@ -262,7 +262,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.uni-noticebar {
/* #ifndef APP-NVUE */
display: flex;

7
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@ -132,8 +132,8 @@
_onBlur(event) {
this.$emit('blur', event)
let value = event.detail.value;
if (isNaN(value)) {
this.inputValue = this.min;
if (!value) {
// this.inputValue = 0;
return;
}
value = +value;
@ -146,7 +146,6 @@
this.inputValue = value.toFixed(String(scale).length - 1);
this.$emit("change", +this.inputValue);
this.$emit("input", +this.inputValue);
this.$emit("update:modelValue", +this.inputValue);
},
_onFocus(event) {
this.$emit('focus', event)
@ -154,7 +153,7 @@
}
};
</script>
<style lang="scss" >
<style lang="scss" scoped>
$box-height: 26px;
$bg: #f5f5f5;
$br: 2px;

2
uni_modules/uni-pagination/changelog.md

@ -1,3 +1,5 @@
## 1.2.2(2022-07-06)
- 修复 es 语言 i18n 错误
## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题
## 1.2.0(2021-11-19)

3
uni_modules/uni-pagination/components/uni-pagination/i18n/en.json

@ -1,4 +1,5 @@
{
"uni-pagination.prevText": "prev",
"uni-pagination.nextText": "next"
"uni-pagination.nextText": "next",
"uni-pagination.piecePerPage": "piece/page"
}

3
uni_modules/uni-pagination/components/uni-pagination/i18n/es.json

@ -1,4 +1,5 @@
{
"uni-pagination.prevText": "anterior",
"uni-pagination.nextText": "próxima"
"uni-pagination.nextText": "prxima",
"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
}

3
uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json

@ -1,4 +1,5 @@
{
"uni-pagination.prevText": "précédente",
"uni-pagination.nextText": "suivante"
"uni-pagination.nextText": "suivante",
"uni-pagination.piecePerPage": "Articles/Pages"
}

3
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json

@ -1,4 +1,5 @@
{
"uni-pagination.prevText": "上一页",
"uni-pagination.nextText": "下一页"
"uni-pagination.nextText": "下一页",
"uni-pagination.piecePerPage": "条/页"
}

3
uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json

@ -1,4 +1,5 @@
{
"uni-pagination.prevText": "上一頁",
"uni-pagination.nextText": "下一頁"
"uni-pagination.nextText": "下一頁",
"uni-pagination.piecePerPage": "條/頁"
}

62
uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

@ -1,5 +1,15 @@
<template>
<view class="uni-pagination">
<!-- #ifndef MP -->
<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
@click.native="pickerClick">
<button type="default" size="mini" :plain="true">
<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
</button>
</picker>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide"> {{ total }} </view>
<!-- #endif -->
@ -49,11 +59,15 @@
* @tutorial https://ext.dcloud.net.cn/plugin?id=32
* @property {String} prevText 左侧按钮文字
* @property {String} nextText 右侧按钮文字
* @property {String} piecePerPageText /页文字
* @property {Number} current 当前页
* @property {Number} total 数据总量
* @property {Number} pageSize 每页数据量
* @property {Number} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showPageSize = [true|false] 是否展示每页条数
* @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
* @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页type值为next/prev表示点击的是上一页还是下一个
* * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
*/
import {
@ -65,7 +79,7 @@
} = initVueI18n(messages)
export default {
name: 'UniPagination',
emits: ['update:modelValue', 'input', 'change'],
emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
props: {
value: {
type: [Number, String],
@ -81,6 +95,9 @@
nextText: {
type: String,
},
piecePerPageText: {
type: String
},
current: {
type: [Number, String],
default: 1
@ -100,18 +117,32 @@
type: [Boolean, String],
default: false
},
showPageSize: {
// icon
type: [Boolean, String],
default: false
},
pagerCount: {
type: Number,
default: 7
},
pageSizeRange: {
type: Array,
default: () => [20, 50, 100, 500]
}
},
data() {
return {
pageSizeIndex: 0,
currentIndex: 1,
paperData: []
paperData: [],
pickerShow: false
}
},
computed: {
piecePerPage() {
return this.piecePerPageText || t('uni-pagination.piecePerPage')
},
prevPageText() {
return this.prevText || t('uni-pagination.prevText')
},
@ -199,9 +230,31 @@
this.currentIndex = val
}
}
},
pageSizeIndex(val) {
this.$emit('pageSizeChange', this.pageSizeRange[val])
}
},
methods: {
pickerChange(e) {
this.pageSizeIndex = e.detail.value
this.pickerClick()
},
pickerClick() {
// #ifdef H5
const body = document.querySelector('body')
if (!body) return
const className = 'uni-pagination-picker-show'
this.pickerShow = !this.pickerShow
if (this.pickerShow) {
body.classList.add(className)
} else {
setTimeout(() => body.classList.remove(className), 300)
}
// #endif
},
//
selectPage(e, index) {
if (parseInt(e)) {
@ -256,8 +309,9 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
$uni-primary: #2979ff;
.uni-pagination {
/* #ifndef APP-NVUE */
display: flex;

2
uni_modules/uni-pagination/package.json

@ -1,7 +1,7 @@
{
"id": "uni-pagination",
"displayName": "uni-pagination 分页器",
"version": "1.2.1",
"version": "1.2.2",
"description": "Pagination 分页器组件,用于展示页码、请求数据等。",
"keywords": [
"uni-ui",

2
uni_modules/uni-pagination/readme.md

@ -9,5 +9,3 @@
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

2
uni_modules/uni-row/components/uni-col/uni-col.vue

@ -212,7 +212,7 @@
}
</script>
<style lang='scss' >
<style lang='scss' scoped>
/* breakpoints */
$--sm: 768px !default;
$--md: 992px !default;

2
uni_modules/uni-row/components/uni-row/uni-row.vue

@ -180,7 +180,7 @@
}
// QQ
// 使
// 使scoped
/* #ifdef MP-WEIXIN || MP-TOUTIAO || MP-QQ */
:host {
display: block;

2
uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue

@ -87,7 +87,7 @@
}
</script>
<style lang="scss" >
<style lang="scss" scoped>
.segmented-control {
/* #ifndef APP-NVUE */
display: flex;

2
uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue

@ -120,7 +120,7 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.uni-swiper__warp {
/* #ifndef APP-NVUE */
display: flex;

2
uni_modules/uni-tag/components/uni-tag/uni-tag.vue

@ -106,7 +106,7 @@
};
</script>
<style lang="scss">
<style lang="scss" scoped>
$uni-primary: #2979ff !default;
$uni-success: #18bc37 !default;
$uni-warning: #f3a73f !default;

39
uni_modules/uni-test/changelog.md

@ -1,39 +0,0 @@
## 2.0.13(2021-11-18)
## 2.0.12(2021-11-18)
123123
## 2.0.11(2021-11-18)
0000
## 2.0.10(2021-11-18)
111234
## 2.0.9(2021-11-18)
3333
## 2.0.8(2021-11-18)
===
## 2.0.7(2021-11-18)
111
## 2.0.6(2021-05-26)
- test
## 0.0.37(2021-03-23)
- uni-forms 更新 校验器
- uni-forms 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
## 0.0.36(2021-03-23)
- uni-forms 更新 校验器
- uni-forms 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
## 0.0.35(2021-03-23)
- uni-forms 更新 校验器
- uni-forms 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug
## 0.0.34(2021-03-23)
- 测试新同步插件
## 0.0.33(2021-03-09)
- test
## 0.0.32(2021-02-24)
- 更新 read 2
## 0.0.31(2021-02-24)
- 同步 readme.md

26
uni_modules/uni-test/components/uni-test/uni-test.vue

@ -1,26 +0,0 @@
<template>
<view>
测试插件
</view>
</template>
<script>
export default {
data() {
return {
};
},
onLoad() {
let fonts = []
let obj = {}
fonts.forEach(v=>{
obj[v.name] = '\\u'+v.unicode
})
}
}
</script>
<style>
</style>

83
uni_modules/uni-test/package.json

@ -1,83 +0,0 @@
{
"id": "uni-test",
"displayName": "Test 测试插件",
"version": "2.0.13",
"description": "测试插件 ",
"keywords": [
"test"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.3"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

10
uni_modules/uni-test/readme.md

@ -1,10 +0,0 @@
## DataCheckbox 数据驱动的单选复选框
> **组件名:uni-data-checkbox**
> 代码块: `uDataCheckbox`
本组件是基于uni-app基础组件checkbox的封装。本组件要解决问题包括:
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-card)

10
uni_modules/uni-tooltip/changelog.md

@ -1,10 +0,0 @@
## 0.2.1(2022-05-09)
- 修复 content 为空时仍然弹出的bug
## 0.2.0(2022-05-07)
**注意:破坏性更新**
- 更新 text 属性变更为 content
- 更新 移除 width 属性
## 0.1.1(2022-04-27)
- 修复 组件根 text 嵌套组件 warning
## 0.1.0(2022-04-21)
- 初始化

68
uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue

@ -1,68 +0,0 @@
<template>
<view class="uni-tooltip">
<slot></slot>
<view v-if="content || $slots.content" class="uni-tooltip-popup">
<slot name="content">
{{content}}
</slot>
</view>
</view>
</template>
<script>
/**
* Tooltip 提示文字
* @description 常用于展示鼠标 hover 时的提示信息
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-tooltip
* @property {String} content 弹出层显示的内容
* @property {String} placement出现位置, 目前只支持 left
*/
export default {
name: "uni-tooltip",
data() {
return {
};
},
props: {
content: {
type: String,
default: ''
},
placement: {
type: String,
default: 'bottom'
},
}
}
</script>
<style>
.uni-tooltip {
position: relative;
cursor: pointer;
}
.uni-tooltip-popup {
z-index: 1;
display: none;
position: absolute;
left: 0;
background-color: #333;
border-radius: 8px;
color: #fff;
font-size: 12px;
text-align: left;
line-height: 16px;
padding: 12px;
}
.uni-tooltip:hover .uni-tooltip-popup {
display: block;
}
</style>

88
uni_modules/uni-tooltip/package.json

@ -1,88 +0,0 @@
{
"id": "uni-tooltip",
"displayName": "uni-tooltip 提示文字",
"version": "0.2.1",
"description": "Tooltip 提示文字",
"keywords": [
"uni-tooltip",
"uni-ui",
"tooltip",
"tip",
"文字提示"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无 ",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

8
uni_modules/uni-tooltip/readme.md

@ -1,8 +0,0 @@
## Badge 数字角标
> **组件名:uni-tooltip**
> 代码块: `uTooltip`
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tooltip)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839

36
uni_modules/uni-ui/changelog.md

@ -1,3 +1,39 @@
## 1.4.19(2022-07-07)
- uni-data-picker 优化 pc端图标位置不正确的问题
- uni-data-select 修复 pc端宽度异常的bug
## 1.4.18(2022-07-06)
- uni-forms 【重要】组件逻辑重构,部分用法旧版本不兼容,请注意兼容问题
- uni-forms 【重要】组件使用 Provide/Inject 方式注入依赖,提供了自定义表单组件调用 uni-forms 校验表单的能力
- uni-forms 新增 更多表单示例
- uni-forms 新增 model 属性,等同于原 value/modelValue 属性,旧属性即将废弃
- uni-forms 新增 validateTrigger 属性的 blur 值,仅 uni-easyinput 生效
- uni-forms 新增 onFieldChange 方法,可以对子表单进行校验,可替代binddata方法
- uni-forms 新增 子表单的 setRules 方法,配合自定义校验函数使用
- uni-forms 新增 uni-forms-item 的 setRules 方法,配置动态表单使用可动态更新校验规则
- uni-forms 修复 由 1.4.0 引发的 label 插槽不生效的bug
- uni-forms 修复 子组件找不到 setValue 报错的bug
- uni-forms 修复 uni-data-picker 在 uni-forms-item 中报错的bug
- uni-forms 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
- uni-forms 修复 表单校验顺序无序问题
- uni-forms 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式
- uni-forms 优化 动态表单校验方式,废弃拼接name的方式
- uni-breadcrumb 修复 微信小程序 separator 不显示问题
- uni-data-checkbox 优化 在 uni-forms 中的依赖注入方式
- uni-data-picker 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
- uni-data-picker 优化 显示样式
- uni-data-select 优化 显示样式
- uni-datetime-picker 修复 日历顶部年月及底部确认未国际化 bug
- uni-datetime-picker 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
- uni-easyinput 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- uni-easyinput 新增 clear 事件,点击右侧叉号图标触发
- uni-easyinput 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发
- uni-easyinput 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等
- uni-easyinput 优化 clearable 显示策略
- uni-file-picker 修复 在uni-forms下样式不生效的bug
- uni-nav-bar 修复 组件示例中插槽用法无法显示内容的bug
- uni-swipe-action 修复 vue3 下使用组件不能正常运行的Bug
- uni-swipe-action 修复 h5端点击click触发两次的Bug
- uni-table 修复 微信小程序存在无使用组件的问题
## 1.4.17(2022-06-30)
- 支持 ios 安全区
## 1.4.16(2022-06-06)

6
uni_modules/uni-ui/package.json

@ -1,7 +1,7 @@
{
"id": "uni-ui",
"displayName": "uni-ui",
"version": "1.4.17",
"version": "1.4.19",
"description": "uni-ui 是基于uni-app的、全端兼容的、高性能UI框架",
"keywords": [
"uni-ui",
@ -112,8 +112,8 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"京东": "u"
"QQ": "y",
"京东": "u"
},
"快应用": {
"华为": "u",

Loading…
Cancel
Save