Browse Source

新增商品支付页面

master
JC96821 4 years ago
parent
commit
75b177881d
  1. 1
      App.vue
  2. 4
      node_modules/uview-ui/README.md
  3. 24
      node_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
  4. 67
      node_modules/uview-ui/components/u-alert-tips/u-alert-tips.vue
  5. 9
      node_modules/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue
  6. 138
      node_modules/uview-ui/components/u-avatar/u-avatar.vue
  7. 20
      node_modules/uview-ui/components/u-back-top/u-back-top.vue
  8. 4
      node_modules/uview-ui/components/u-badge/u-badge.vue
  9. 67
      node_modules/uview-ui/components/u-button/u-button.vue
  10. 14
      node_modules/uview-ui/components/u-calendar/u-calendar.vue
  11. 12
      node_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue
  12. 9
      node_modules/uview-ui/components/u-card/u-card.vue
  13. 1
      node_modules/uview-ui/components/u-cell-group/u-cell-group.vue
  14. 32
      node_modules/uview-ui/components/u-cell-item/u-cell-item.vue
  15. 7
      node_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue
  16. 38
      node_modules/uview-ui/components/u-checkbox/u-checkbox.vue
  17. 7
      node_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue
  18. 31
      node_modules/uview-ui/components/u-col/u-col.vue
  19. 46
      node_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue
  20. 5
      node_modules/uview-ui/components/u-collapse/u-collapse.vue
  21. 14
      node_modules/uview-ui/components/u-column-notice/u-column-notice.vue
  22. 24
      node_modules/uview-ui/components/u-count-down/u-count-down.vue
  23. 4
      node_modules/uview-ui/components/u-count-to/u-count-to.vue
  24. 6
      node_modules/uview-ui/components/u-divider/u-divider.vue
  25. 242
      node_modules/uview-ui/components/u-dropdown-list/u-dropdown-list.vue
  26. 4
      node_modules/uview-ui/components/u-empty/u-empty.vue
  27. 34
      node_modules/uview-ui/components/u-field/u-field.vue
  28. 77
      node_modules/uview-ui/components/u-form-item/u-form-item.vue
  29. 15
      node_modules/uview-ui/components/u-form/u-form.vue
  30. 37
      node_modules/uview-ui/components/u-grid-item/u-grid-item.vue
  31. 7
      node_modules/uview-ui/components/u-grid/u-grid.vue
  32. 42
      node_modules/uview-ui/components/u-icon/u-icon.vue
  33. 89
      node_modules/uview-ui/components/u-image/u-image.vue
  34. 26
      node_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue
  35. 39
      node_modules/uview-ui/components/u-index-list/u-index-list.vue
  36. 151
      node_modules/uview-ui/components/u-input/u-input.vue
  37. 20
      node_modules/uview-ui/components/u-keyboard/u-keyboard.vue
  38. 19
      node_modules/uview-ui/components/u-lazy-load/u-lazy-load.vue
  39. 10
      node_modules/uview-ui/components/u-line-progress/u-line-progress.vue
  40. 8
      node_modules/uview-ui/components/u-link/u-link.vue
  41. 4
      node_modules/uview-ui/components/u-loading/u-loading.vue
  42. 11
      node_modules/uview-ui/components/u-loadmore/u-loadmore.vue
  43. 5
      node_modules/uview-ui/components/u-mask/u-mask.vue
  44. 31
      node_modules/uview-ui/components/u-message-input/u-message-input.vue
  45. 492
      node_modules/uview-ui/components/u-modal/u-modal.vue
  46. 514
      node_modules/uview-ui/components/u-navbar/u-navbar.vue
  47. 4
      node_modules/uview-ui/components/u-no-network/u-no-network.vue
  48. 8
      node_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue
  49. 59
      node_modules/uview-ui/components/u-number-box/u-number-box.vue
  50. 8
      node_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue
  51. 53
      node_modules/uview-ui/components/u-picker/u-picker.vue
  52. 39
      node_modules/uview-ui/components/u-popup/u-popup.vue
  53. 45
      node_modules/uview-ui/components/u-radio-group/u-radio-group.vue
  54. 270
      node_modules/uview-ui/components/u-radio/u-radio.vue
  55. 12
      node_modules/uview-ui/components/u-rate/u-rate.vue
  56. 86
      node_modules/uview-ui/components/u-read-more/u-read-more.vue
  57. 10
      node_modules/uview-ui/components/u-row-notice/u-row-notice.vue
  58. 11
      node_modules/uview-ui/components/u-row/u-row.vue
  59. 24
      node_modules/uview-ui/components/u-search/u-search.vue
  60. 105
      node_modules/uview-ui/components/u-section/u-section.vue
  61. 29
      node_modules/uview-ui/components/u-select/u-select.vue
  62. 42
      node_modules/uview-ui/components/u-skeleton/u-skeleton.vue
  63. 5
      node_modules/uview-ui/components/u-slider/u-slider.vue
  64. 14
      node_modules/uview-ui/components/u-steps/u-steps.vue
  65. 7
      node_modules/uview-ui/components/u-sticky/u-sticky.vue
  66. 7
      node_modules/uview-ui/components/u-subsection/u-subsection.vue
  67. 50
      node_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue
  68. 61
      node_modules/uview-ui/components/u-swiper/u-swiper.vue
  69. 15
      node_modules/uview-ui/components/u-switch/u-switch.vue
  70. 126
      node_modules/uview-ui/components/u-tabbar/u-tabbar.vue
  71. 12
      node_modules/uview-ui/components/u-table/u-table.vue
  72. 24
      node_modules/uview-ui/components/u-tabs-swiper/u-tabs-swiper.vue
  73. 42
      node_modules/uview-ui/components/u-tabs/u-tabs.vue
  74. 6
      node_modules/uview-ui/components/u-tag/u-tag.vue
  75. 85
      node_modules/uview-ui/components/u-td/u-td.vue
  76. 30
      node_modules/uview-ui/components/u-th/u-th.vue
  77. 4
      node_modules/uview-ui/components/u-time-line-item/u-time-line-item.vue
  78. 48
      node_modules/uview-ui/components/u-toast/u-toast.vue
  79. 2
      node_modules/uview-ui/components/u-top-tips/u-top-tips.vue
  80. 13
      node_modules/uview-ui/components/u-tr/u-tr.vue
  81. 128
      node_modules/uview-ui/components/u-upload/u-upload.vue
  82. 14
      node_modules/uview-ui/components/u-waterfall/u-waterfall.vue
  83. 65
      node_modules/uview-ui/iconfont.css
  84. 16
      node_modules/uview-ui/index.js
  85. 4
      node_modules/uview-ui/libs/config/config.js
  86. 1
      node_modules/uview-ui/libs/config/zIndex.js
  87. 9
      node_modules/uview-ui/libs/css/common.scss
  88. 8
      node_modules/uview-ui/libs/css/style.components.scss
  89. 43
      node_modules/uview-ui/libs/css/style.mp.scss
  90. 26
      node_modules/uview-ui/libs/css/style.vue.scss
  91. 6
      node_modules/uview-ui/libs/function/$parent.js
  92. 35
      node_modules/uview-ui/libs/function/bem.js
  93. 70
      node_modules/uview-ui/libs/function/test.js
  94. 23
      node_modules/uview-ui/libs/function/timeFormat.js
  95. 2
      node_modules/uview-ui/libs/mixin/mixin.js
  96. 27
      node_modules/uview-ui/libs/request/index.js
  97. 12543
      node_modules/uview-ui/libs/util/area.js
  98. 3
      node_modules/uview-ui/libs/util/async-validator.js
  99. 1504
      node_modules/uview-ui/libs/util/city.js
  100. 140
      node_modules/uview-ui/libs/util/province.js

1
App.vue

@ -34,4 +34,5 @@ export default {
</script>
<style lang="scss">
@import "uview-ui/index.scss";
</style>

4
node_modules/uview-ui/README.md

@ -55,7 +55,11 @@ Vue.use(uView);
// pages.json
{
"easycom": {
// npm安装的方式不需要前面的"@/",下载安装的方式需要"@/"
// npm安装方式
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
// 下载安装方式
// "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
// 此为本身已有的内容
"pages": [

24
node_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue

@ -1,19 +1,25 @@
<template>
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
{{tips.text}}
</view>
<block v-for="(item, index) in list" :key="index">
<view @touchmove.stop.prevent @tap="itemClick(index)" :style="[itemStyle(index)]" class="u-action-sheet-item" :class="[index < list.length - 1 ? 'u-border-bottom' : '']"
hover-class="u-hover-class" :hover-stay-time="150">
<view
@touchmove.stop.prevent
@tap="itemClick(index)"
:style="[itemStyle(index)]"
class="u-action-sheet-item"
:class="[index < list.length - 1 ? 'u-border-bottom' : '']"
:hover-stay-time="150"
>
{{item.text}}
</view>
</block>
<view class="u-gab" v-if="cancelBtn">
</view>
<view @touchmove.stop.prevent class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
:hover-stay-time="150" v-if="cancelBtn" @tap="close">{{cancelText}}</view>
</u-popup>
</template>
@ -112,6 +118,8 @@
let style = {};
if (this.list[index].color) style.color = this.list[index].color;
if (this.list[index].fontSize) style.fontSize = this.list[index].fontSize + 'rpx';
//
if (this.list[index].disabled) style.color = '#c0c4cc';
return style;
}
},
@ -132,8 +140,10 @@
popupClose() {
this.$emit('input', false);
},
// itemif (!this.show) return;
// item
itemClick(index) {
// disabled
if(this.list[index].disabled) return;
this.$emit('click', index);
this.$emit('input', false);
}
@ -143,7 +153,7 @@
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-tips {
font-size: 26rpx;
text-align: center;
@ -153,7 +163,7 @@
}
.u-action-sheet-item {
display: flex;
@include vue-flex;;
line-height: 1;
justify-content: center;
align-items: center;

67
node_modules/uview-ui/components/u-alert-tips/u-alert-tips.vue

@ -8,13 +8,13 @@
borderColor: borderColor
}">
<view class="u-icon-wrap">
<u-icon v-if="showIcon" :name="$u.type2icon(type)" :size="description ? 40 : 32" class="u-icon" :color="type"></u-icon>
<u-icon v-if="showIcon" :name="uIcon" :size="description ? 40 : 32" class="u-icon" :color="uIconType" :custom-style="iconStyle"></u-icon>
</view>
<view class="u-alert-content" @tap.stop="click">
<view class="u-alert-title" :style="{fontWeight: description ? 500 : 'normal'}">
<view class="u-alert-title" :style="[uTitleStyle]">
{{title}}
</view>
<view v-if="description" class="u-alert-desc">
<view v-if="description" class="u-alert-desc" :style="[descStyle]">
{{description}}
</view>
</view>
@ -38,6 +38,10 @@
* @property {String} title 显示的标题文字
* @property {String} description 辅助性文字颜色比title浅一点字号也小一点可选
* @property {String} type 关闭按钮(默认为叉号icon图标)
* @property {String} icon 图标名称
* @property {Object} icon-style 图标的样式对象形式
* @property {Object} title-style 标题的样式对象形式
* @property {Object} desc-style 描述的样式对象形式
* @property {String} close-able 用文字替代关闭图标close-able为true时有效
* @property {Boolean} show-icon 是否显示左边的辅助图标
* @property {Boolean} show 显示或隐藏组件
@ -96,12 +100,55 @@
show: {
type: Boolean,
default: true
}
},
// icon
icon: {
type: String,
default: ''
},
// icon
iconStyle: {
type: Object,
default() {
return {}
}
},
//
titleStyle: {
type: Object,
default() {
return {}
}
},
//
descStyle: {
type: Object,
default() {
return {}
}
},
},
data() {
return {
}
},
computed: {
uTitleStyle() {
let style = {};
//
style.fontWeight = this.description ? 500 : 'normal';
// stylestyle
return this.$u.deepMerge(style, this.titleStyle);
},
uIcon() {
// icon使type
return this.icon ? this.icon : this.$u.type2icon(this.type);
},
uIconType() {
// 使type
return Object.keys(this.iconStyle).length ? '' : this.type;
}
},
methods: {
//
click() {
@ -119,7 +166,7 @@
@import "../../libs/css/style.components.scss";
.u-alert-tips {
display: flex;
@include vue-flex;
align-items: center;
padding: 16rpx 30rpx;
border-radius: 8rpx;
@ -173,16 +220,6 @@
visibility: hidden;
}
@keyframes myfirst {
from {
height: 100%;
}
to {
height: 0
}
}
.u-icon {
margin-right: 16rpx;
}

9
node_modules/uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue

@ -9,6 +9,7 @@
@touchend="touchEnd"
:style="{ width: cropperOpt.width, height: cropperOpt.height, backgroundColor: 'rgba(0, 0, 0, 0.8)' }"
canvas-id="cropper"
id="cropper"
></canvas>
<canvas
class="cropper"
@ -21,6 +22,7 @@
height: `${cropperOpt.height * cropperOpt.pixelRatio}`
}"
canvas-id="targetId"
id="targetId"
></canvas>
</view>
<view class="cropper-buttons safe-area-padding" :style="{ height: bottomNavHeight + 'px' }">
@ -181,7 +183,6 @@ export default {
this.cropper.touchEnd(e);
},
getCropperImage(isPre = false) {
console.log(this.src);
if(!this.src) return this.$u.toast('请先选择图片再裁剪');
let cropper_opt = {
@ -228,7 +229,7 @@ export default {
};
</script>
<style scoped>
<style scoped lang="scss">
@import '../../libs/css/style.components.scss';
.content {
@ -251,7 +252,7 @@ export default {
.cropper-wrapper {
position: relative;
display: flex;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
@ -261,7 +262,7 @@ export default {
.cropper-buttons {
width: 100vw;
display: flex;
@include vue-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;

138
node_modules/uview-ui/components/u-avatar/u-avatar.vue

@ -3,13 +3,21 @@
<image
@error="loadError"
:style="[imgStyle]"
class="u-avatar-img"
v-if="!text && avatar"
:src="avatar"
:mode="mode"
class="u-avatar__img"
v-if="!uText && avatar"
:src="avatar"
:mode="imgMode"
></image>
<text class="u-line-1" v-else-if="text">{{text}}</text>
<text class="u-line-1" v-else-if="uText" :style="{
fontSize: '38rpx'
}">{{uText}}</text>
<slot v-else></slot>
<view class="u-avatar__sex" v-if="showSex" :class="['u-avatar__sex--' + sexIcon]" :style="[uSexStyle]">
<u-icon :name="sexIcon" size="20"></u-icon>
</view>
<view class="u-avatar__level" v-if="showLevel" :style="[uLevelStyle]">
<u-icon :name="levelIcon" size="20"></u-icon>
</view>
</view>
</template>
@ -23,7 +31,12 @@
* @property {String} src 头像路径如加载失败将会显示默认头像
* @property {String Number} size 头像尺寸可以为指定字符串(large, default, mini)或者数值单位rpx默认default
* @property {String} mode 显示类型见上方说明默认circle
* @property {String} text 用文字替代图片级别优先于src
* @property {String} sex-icon 性别图标man-woman-默认man
* @property {String} level-icon 等级图标默认level
* @property {String} sex-bg-color 性别图标背景颜色
* @property {String} level-bg-color 等级图标背景颜色
* @property {String} show-sex 是否显示性别图标默认false
* @property {String} show-level 是否显示等级图标默认false
* @property {String} img-mode 头像图片的裁剪类型与uni的image组件的mode参数一致如效果达不到需求可尝试传widthFix值默认aspectFill
* @property {String} index 用户传递的标识符值如果是列表循环可穿v-for的index值
* @event {Function} click 头像被点击
@ -67,6 +80,36 @@
index: {
type: [String, Number],
default: ''
},
// man-woman-
sexIcon: {
type: String,
default: 'man'
},
//
levelIcon: {
type: String,
default: 'level'
},
//
levelBgColor: {
type: String,
default: ''
},
//
sexBgColor: {
type: String,
default: ''
},
//
showSex: {
type: Boolean,
default: false
},
//
showLevel: {
type: Boolean,
default: false
}
},
data() {
@ -79,7 +122,13 @@
watch: {
src(n) {
//
this.avatar = n;
if(!n) {
// null''undefined
this.error = true;
} else {
this.avatar = n;
this.error = false;
}
}
},
computed: {
@ -99,6 +148,22 @@
style.borderRadius = this.mode == 'circle' ? '500px' : '5px';
return style;
},
//
uText() {
return String(this.text)[0];
},
//
uSexStyle() {
let style = {};
if(this.sexBgColor) style.backgroundColor = this.sexBgColor;
return style;
},
//
uLevelStyle() {
let style = {};
if(this.levelBgColor) style.backgroundColor = this.levelBgColor;
return style;
}
},
methods: {
//
@ -117,17 +182,62 @@
@import "../../libs/css/style.components.scss";
.u-avatar {
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
justify-content: center;
font-size: 28rpx;
color: $u-content-color;
border-radius: 10px;
overflow: hidden;
}
.u-avatar-img {
width: 100%;
height: 100%;
position: relative;
&__img {
width: 100%;
height: 100%;
}
&__sex {
position: absolute;
width: 32rpx;
color: #ffffff;
height: 32rpx;
@include vue-flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
top: 5%;
z-index: 1;
right: -7%;
border: 1px #ffffff solid;
&--man {
background-color: $u-type-primary;
}
&--woman {
background-color: $u-type-error;
}
&--none {
background-color: $u-type-warning;
}
}
&__level {
position: absolute;
width: 32rpx;
color: #ffffff;
height: 32rpx;
@include vue-flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
bottom: 5%;
z-index: 1;
right: -7%;
border: 1px #ffffff solid;
background-color: $u-type-warning;
}
}
</style>

20
node_modules/uview-ui/components/u-back-top/u-back-top.vue

@ -6,9 +6,9 @@
zIndex: uZIndex,
opacity: opacity
}, customStyle]">
<view class="" v-if="!$slots.default">
<view class="u-back-top__content" v-if="!$slots.default">
<u-icon @click="backToTop" :name="icon" :custom-style="iconStyle"></u-icon>
<view class="u-back-top__tips">
<view class="u-back-top__content__tips">
{{tips}}
</view>
</view>
@ -130,7 +130,7 @@
height: 80rpx;
position: fixed;
z-index: 9;
display: flex;
@include vue-flex;
flex-direction: column;
justify-content: center;
background-color: #E1E1E1;
@ -138,10 +138,16 @@
align-items: center;
transition: opacity 0.4s;
&__tips {
font-size: 24rpx;
transform: scale(0.8);
line-height: 1;
&__content {
@include vue-flex;
flex-direction: column;
align-items: center;
&__tips {
font-size: 24rpx;
transform: scale(0.8);
line-height: 1;
}
}
}
</style>

4
node_modules/uview-ui/components/u-badge/u-badge.vue

@ -141,7 +141,9 @@
@import "../../libs/css/style.components.scss";
.u-badge {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
justify-content: center;
align-items: center;
line-height: 24rpx;
@ -207,7 +209,7 @@
// }
.u-info {
background: $u-type-info;
background-color: $u-type-info;
color: #fff;
}
</style>

67
node_modules/uview-ui/components/u-button/u-button.vue

@ -10,8 +10,9 @@
hairLine ? showHairLineBorder : 'u-btn--bold-border',
'u-btn--' + type,
disabled ? `u-btn--${type}--disabled` : '',
]"
:hover-start-time="Number(hoverStartTime)"
:hover-stay-time="Number(hoverStayTime)"
:disabled="disabled"
:form-type="formType"
:open-type="openType"
@ -29,7 +30,9 @@
@error="error"
@opensetting="opensetting"
@launchapp="launchapp"
:style="[customStyle]"
:style="[customStyle, {
overflow: ripple ? 'hidden' : 'visible'
}]"
@tap.stop="click($event)"
:hover-class="getHoverClass"
:loading="loading"
@ -66,6 +69,7 @@
* @property {Boolean} loading 按钮名称前是否带 loading 图标(App-nvue 平台 ios 上为雪花Android上为圆圈)
* @property {String} form-type 用于 <form> 组件点击分别会触发 <form> 组件的 submit/reset 事件
* @property {String} open-type 开放能力
* @property {String} data-name 额外传参参数用于小程序的data-xxx属性通过target.dataset.name获取
* @property {String} hover-class 指定按钮按下去的样式类 hover-class="none" 没有点击态效果(App-nvue 平台暂不支持)
* @property {Number} hover-start-time 按住后多久出现点击态单位毫秒
* @property {Number} hover-stay-time 手指松开后点击态保留时间单位毫秒
@ -204,7 +208,22 @@ export default {
dataName: {
type: String,
default: ''
}
},
//
throttleTime: {
type: [String, Number],
default: 1000
},
//
hoverStartTime: {
type: [String, Number],
default: 20
},
//
hoverStayTime: {
type: [String, Number],
default: 150
},
},
computed: {
// bgColor
@ -235,17 +254,20 @@ export default {
methods: {
//
click(e) {
// disabledloading
if (this.loading === true || this.disabled === true) return;
//
if (this.ripple) {
//
this.waveActive = false;
this.$nextTick(function() {
this.getWaveQuery(e);
});
}
this.$emit('click');
// this.throttle
this.$u.throttle(() => {
// disabledloading
if (this.loading === true || this.disabled === true) return;
//
if (this.ripple) {
//
this.waveActive = false;
this.$nextTick(function() {
this.getWaveQuery(e);
});
}
this.$emit('click', e);
}, this.throttleTime);
},
//
getWaveQuery(e) {
@ -329,10 +351,13 @@ export default {
position: relative;
border: 0;
//border-radius: 10rpx;
display: inline-block;
overflow: hidden;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
// hidden
overflow: visible;
line-height: 1;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
cursor: pointer;
@ -486,7 +511,9 @@ export default {
}
.u-size-medium {
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
width: auto;
font-size: 26rpx;
height: 70rpx;
@ -495,7 +522,9 @@ export default {
}
.u-size-mini {
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
width: auto;
font-size: 22rpx;
padding-top: 1px;

14
node_modules/uview-ui/components/u-calendar/u-calendar.vue

@ -502,7 +502,7 @@
&__text {
margin-top: 30rpx;
padding: 0 60rpx;
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
}
@ -525,7 +525,7 @@
}
&__week-day {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
padding: 6px 0;
@ -539,7 +539,7 @@
&__content {
width: 100%;
display: flex;
@include vue-flex;
flex-wrap: wrap;
padding: 6px 0;
box-sizing: border-box;
@ -558,7 +558,7 @@
&__item {
width: 14.2857%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
padding: 6px 0;
@ -568,9 +568,7 @@
&__inner {
height: 84rpx;
display: -webkit-box;
display: -webkit-flex;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
flex-direction: column;
@ -619,7 +617,7 @@
&__bottom {
width: 100%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
flex-direction: column;

12
node_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue

@ -1,5 +1,5 @@
<template>
<view class="u-keyboard" @touchmove.stop.prevent>
<view class="u-keyboard" @touchmove.stop.prevent="() => {}">
<view class="u-keyboard-grids">
<block>
<view class="u-keyboard-grids-item" v-for="(group, i) in abc ? EngKeyBoardList : areaList" :key="i">
@ -176,7 +176,7 @@
}
.u-keyboard-grids-item {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}
@ -186,7 +186,9 @@
width: 62rpx;
flex: 0 0 64rpx;
height: 80rpx;
display: inline-block;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
font-size: 36rpx;
text-align: center;
line-height: 80rpx;
@ -208,7 +210,7 @@
bottom: 32rpx;
height: 80rpx;
background-color: rgb(185, 188, 195);
display: flex;
@include vue-flex;
align-items: center;
border-radius: 8rpx;
justify-content: center;
@ -225,7 +227,7 @@
bottom: 32rpx;
height: 80rpx;
background-color: #ffffff;
display: flex;
@include vue-flex;
align-items: center;
border-radius: 8rpx;
justify-content: center;

9
node_modules/uview-ui/components/u-card/u-card.vue

@ -5,7 +5,8 @@
:class="{ 'u-border': border, 'u-card-full': full, 'u-card--border': borderRadius > 0 }"
:style="{
borderRadius: borderRadius + 'rpx',
margin: margin
margin: margin,
boxShadow: boxShadow
}"
>
<view
@ -83,6 +84,7 @@
* @property {String | Number} sub-title-size 副标题字体大小默认26
* @property {Boolean} border 是否显示边框默认true
* @property {String | Number} index 用于标识点击了第几个卡片
* @property {String} box-shadow 卡片外围阴影字符串形式默认none
* @property {String} margin 卡片与屏幕两边和上下元素的间距需带单位"30rpx 20rpx"默认30rpx
* @property {String | Number} border-radius 卡片整体的圆角值单位rpx默认16
* @property {Object} head-style 头部自定义样式对象形式
@ -219,6 +221,11 @@ export default {
showFoot: {
type: Boolean,
default: true
},
//
boxShadow: {
type: String,
default: 'none'
}
},
data() {

1
node_modules/uview-ui/components/u-cell-group/u-cell-group.vue

@ -65,5 +65,6 @@
.u-cell-item-box {
background-color: #FFFFFF;
flex-direction: row;
}
</style>

32
node_modules/uview-ui/components/u-cell-item/u-cell-item.vue

@ -35,10 +35,10 @@
<block class="u-cell__value" v-if="value">{{ value }}</block>
<slot v-else></slot>
</view>
<u-icon v-if="arrow" name="arrow-right" :style="[arrowStyle]" class="u-icon-wrap u-cell__right-icon-wrap"></u-icon>
<view class="u-flex" v-if="$slots['right-icon']">
<view class="u-flex u-cell_right" v-if="$slots['right-icon']">
<slot name="right-icon"></slot>
</view>
<u-icon v-if="arrow" name="arrow-right" :style="[arrowStyle]" class="u-icon-wrap u-cell__right-icon-wrap"></u-icon>
</view>
</template>
@ -211,9 +211,12 @@ export default {
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-cell {
@include vue-flex;
align-items: center;
position: relative;
display: flex;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
width: 100%;
padding: 26rpx 32rpx;
font-size: 28rpx;
@ -240,21 +243,22 @@ export default {
.u-cell__left-icon-wrap,
.u-cell__right-icon-wrap {
display: flex;
@include vue-flex;
align-items: center;
height: 48rpx;
}
.u-cell-border:after {
position: absolute;
position: absolute;
/* #ifndef APP-NVUE */
box-sizing: border-box;
content: ' ';
pointer-events: none;
border-bottom: 1px solid $u-border-color;
/* #endif */
right: 0;
left: 0;
top: 0;
border-bottom: 1px solid $u-border-color;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
@ -267,13 +271,17 @@ export default {
font-size: 26rpx;
line-height: 36rpx;
color: $u-tips-color;
/* #ifndef APP-NVUE */
word-wrap: break-word;
/* #endif */
}
.u-cell__value {
overflow: hidden;
text-align: right;
/* #ifndef APP-NVUE */
vertical-align: middle;
/* #endif */
color: $u-tips-color;
font-size: 26rpx;
}
@ -284,17 +292,25 @@ export default {
}
.u-cell--required {
/* #ifndef APP-NVUE */
overflow: visible;
display: flex;
/* #endif */
@include vue-flex;
align-items: center;
}
.u-cell--required:before {
position: absolute;
/* #ifndef APP-NVUE */
content: '*';
/* #endif */
left: 8px;
margin-top: 4rpx;
font-size: 14px;
color: $u-type-error;
}
.u-cell_right {
line-height: 1;
}
</style>

7
node_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue

@ -101,10 +101,11 @@
})
this.$emit('change', values);
// checkbox
this.$nextTick(() => {
//
setTimeout(() => {
// u-form-item
this.dispatch('u-form-item', 'on-form-change', values);
});
}, 60)
}
}
}
@ -114,7 +115,7 @@
@import "../../libs/css/style.components.scss";
.u-checkbox-group {
/* #ifndef MP */
/* #ifndef MP || APP-NVUE */
display: inline-flex;
flex-wrap: wrap;
/* #endif */

38
node_modules/uview-ui/components/u-checkbox/u-checkbox.vue

@ -1,10 +1,10 @@
<template>
<view class="u-checkbox" :style="[checkboxStyle]">
<view class="u-checkbox__icon-wrap" @tap="toggle" :class="[iconClass]" :style="[iconStyle]">
<u-icon name="checkbox-mark" :size="checkboxIconSize" :color="iconColor"/>
<u-icon class="u-checkbox__icon-wrap__icon" name="checkbox-mark" :size="checkboxIconSize" :color="iconColor"/>
</view>
<view class="u-label-class u-checkbox__label" @tap="onClickLabel" :style="{
fontSize: labelSize + 'rpx'
<view class="u-checkbox__label" @tap="onClickLabel" :style="{
fontSize: $u.addUnit(labelSize)
}">
<slot />
</view>
@ -46,12 +46,12 @@
},
//
disabled: {
type: [Boolean, String],
type: [String, Boolean],
default: ''
},
//
labelDisabled: {
type: [Boolean, String],
type: [String, Boolean],
default: ''
},
// checkboxGroupactiveColor
@ -161,7 +161,7 @@
},
methods: {
onClickLabel() {
if (!this.isLabelDisabled) {
if (!this.isLabelDisabled && !this.isDisabled) {
this.setValue();
}
},
@ -176,7 +176,10 @@
name: this.name
})
// u-checkbox-group
if(this.parent && this.parent.emitEvent) this.parent.emitEvent();
// this.$emit('input')
setTimeout(() => {
if(this.parent && this.parent.emitEvent) this.parent.emitEvent();
}, 80);
},
// inputinputv-model
setValue() {
@ -191,17 +194,11 @@
//
if (this.value == true) {
this.$emit('input', !this.value);
// this.$emit('input')
this.$nextTick(function() {
this.emitEvent();
})
this.emitEvent();
} else if ((this.parent && checkedNum < this.parent.max) || !this.parent) {
// max
this.$emit('input', !this.value);
// this.$emit('input')
this.$nextTick(function() {
this.emitEvent();
})
this.emitEvent();
}
}
@ -213,7 +210,9 @@
@import "../../libs/css/style.components.scss";
.u-checkbox {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
overflow: hidden;
user-select: none;
@ -223,7 +222,7 @@
color: $u-content-color;
flex: none;
display: -webkit-flex;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
@ -236,6 +235,13 @@
border: 1px solid #c8c9cc;
transition-duration: 0.2s;
/* #ifdef MP-TOUTIAO */
// 0
&__icon {
line-height: 0;
}
/* #endif */
&--circle {
border-radius: 100%;
}

7
node_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue

@ -7,9 +7,11 @@
backgroundColor: bgColor
}"
>
<!-- 支付宝小程序不支持canvas-id属性必须用id属性 -->
<canvas
class="u-canvas-bg"
:canvas-id="elBgId"
:id="elBgId"
:style="{
width: widthPx + 'px',
height: widthPx + 'px'
@ -18,6 +20,7 @@
<canvas
class="u-canvas"
:canvas-id="elId"
:id="elId"
:style="{
width: widthPx + 'px',
height: widthPx + 'px'
@ -200,7 +203,9 @@ export default {
@import "../../libs/css/style.components.scss";
.u-circle-progress {
position: relative;
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
justify-content: center;
}

31
node_modules/uview-ui/components/u-col/u-col.vue

@ -6,8 +6,10 @@
marginLeft: 100 / 12 * offset + '%',
flex: `0 0 ${100 / 12 * span}%`,
alignItems: uAlignItem,
justifyContent: uJustify
}" @tap.stop.prevent="click">
justifyContent: uJustify,
textAlign: textAlign
}"
@tap.stop.prevent="click">
<slot></slot>
</view>
</template>
@ -18,6 +20,7 @@
* @description 通过基础的 12 分栏迅速简便地创建布局搭配<u-row>使用
* @tutorial https://www.uviewui.com/components/layout.html
* @property {String Number} span 栅格占据的列数总12等分默认0
* @property {String} text-align 文字水平对齐方式默认left
* @property {String Number} offset 分栏左边偏移计算方式与span相同默认0
* @example <u-col span="3"><view class="demo-layout bg-purple"></view></u-col>
*/
@ -43,9 +46,28 @@
align: {
type: String,
default: 'center'
},
//
textAlign: {
type: String,
default: 'left'
}
},
data() {
return {
gutter: 20, // colu-row
}
},
created() {
this.parent = false;
},
mounted() {
//
this.parent = this.$u.$parent.call(this, 'u-row');
if (this.parent) {
this.gutter = this.parent.gutter;
}
},
inject: ['gutter'],
computed: {
uJustify() {
if (this.justify == 'end' || this.justify == 'start') return 'flex-' + this.justify;
@ -68,8 +90,9 @@
<style lang="scss">
@import "../../libs/css/style.components.scss";
.u-col {
/* #ifdef MP-WEIXIN */
/* #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO */
float: left;
/* #endif */
}

46
node_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue

@ -80,7 +80,6 @@
default: ''
}
},
inject: ['uCollapse'],
data() {
return {
isShow: false,
@ -88,41 +87,37 @@
height: 0, // body
headStyle: {}, //
bodyStyle: {}, //
//itemStyle: {}, // item
itemStyle: {}, // item
arrowColor: '', //
hoverClass: '', //
arrow: true, //
};
},
mounted() {
this.init();
},
watch: {
open(val) {
this.isShow = val;
}
},
computed: {
arrow() {
return this.uCollapse.arrow;
},
itemStyle() {
return this.uCollapse.itemStyle;
}
},
created() {
this.parent = false;
// u-collapseu-collapse便u-collapse-item
this.isShow = this.open;
this.nameSync = this.name ? this.name : this.uCollapse.childrens.length;
this.uCollapse.childrens.push(this);
//this.itemStyle = this.uCollapse.itemStyle;
this.headStyle = this.uCollapse.headStyle;
this.bodyStyle = this.uCollapse.bodyStyle;
this.arrowColor = this.uCollapse.arrowColor;
this.hoverClass = this.uCollapse.hoverClass;
},
methods: {
//
init() {
this.parent = this.$u.$parent.call(this, 'u-collapse');
if(this.parent) {
this.nameSync = this.name ? this.name : this.parent.childrens.length;
this.parent.childrens.push(this);
this.headStyle = this.parent.headStyle;
this.bodyStyle = this.parent.bodyStyle;
this.arrowColor = this.parent.arrowColor;
this.hoverClass = this.parent.hoverClass;
this.arrow = this.parent.arrow;
this.itemStyle = this.parent.itemStyle;
}
this.$nextTick(() => {
this.queryRect();
});
@ -130,8 +125,8 @@
// collapsehead
headClick() {
if (this.disabled) return;
if (this.uCollapse.accordion == true) {
this.uCollapse.childrens.map(val => {
if (this.parent && this.parent.accordion == true) {
this.parent.childrens.map(val => {
// falsethis.isShow = !this.isShow;
if (this != val) {
val.isShow = false;
@ -146,7 +141,7 @@
show: this.isShow
})
//
if (this.isShow) this.uCollapse.onChange();
if (this.isShow) this.parent && this.parent.onChange();
this.$forceUpdate();
},
//
@ -157,6 +152,9 @@
this.height = res.height;
})
}
},
mounted() {
this.init();
}
};
</script>
@ -166,7 +164,7 @@
.u-collapse-head {
position: relative;
display: flex;
@include vue-flex;
justify-content: space-between;
align-items: center;
color: $u-main-color;

5
node_modules/uview-ui/components/u-collapse/u-collapse.vue

@ -63,11 +63,6 @@
default: 'u-hover-class'
}
},
provide() {
return {
uCollapse: this
}
},
created() {
this.childrens = []
},

14
node_modules/uview-ui/components/u-column-notice/u-column-notice.vue

@ -193,7 +193,7 @@ export default {
.u-notice-bar {
width: 100%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
@ -204,14 +204,14 @@ export default {
.u-swiper {
font-size: 26rpx;
height: 32rpx;
display: flex;
@include vue-flex;
align-items: center;
flex: 1;
margin-left: 12rpx;
}
.u-swiper-item {
display: flex;
@include vue-flex;
align-items: center;
overflow: hidden;
}
@ -222,12 +222,16 @@ export default {
.u-right-icon {
margin-left: 12rpx;
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
}
.u-left-icon {
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
}
</style>

24
node_modules/uview-ui/components/u-count-down/u-count-down.vue

@ -164,7 +164,7 @@ export default {
//
timestamp(newVal, oldVal) {
//
clearInterval(this.timer);
this.clearTimer();
this.start();
}
},
@ -211,6 +211,8 @@ export default {
methods: {
//
start() {
//
this.clearTimer();
if (this.timestamp <= 0) return;
this.seconds = Number(this.timestamp);
this.formatTime(this.seconds);
@ -254,10 +256,16 @@ export default {
},
//
end() {
//
clearInterval(this.timer);
this.timer = null;
this.clearTimer();
this.$emit('end', {});
},
//
clearTimer() {
if(this.timer) {
//
clearInterval(this.timer);
this.timer = null;
}
}
},
beforeDestroy() {
@ -271,12 +279,14 @@ export default {
@import "../../libs/css/style.components.scss";
.u-countdown {
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
}
.u-countdown-item {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
padding: 2rpx;
@ -292,7 +302,7 @@ export default {
}
.u-countdown-colon {
display: flex;
@include vue-flex;
justify-content: center;
padding: 0 5rpx;
line-height: 1;

4
node_modules/uview-ui/components/u-count-to/u-count-to.vue

@ -233,7 +233,9 @@ export default {
@import "../../libs/css/style.components.scss";
.u-count-num {
display: inline-block;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
text-align: center;
}
</style>

6
node_modules/uview-ui/components/u-divider/u-divider.vue

@ -110,7 +110,7 @@ export default {
width: 100%;
position: relative;
text-align: center;
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
overflow: hidden;
@ -146,6 +146,8 @@ export default {
.u-divider-text {
white-space: nowrap;
padding: 0 16rpx;
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
}
</style>

242
node_modules/uview-ui/components/u-dropdown-list/u-dropdown-list.vue

@ -1,242 +0,0 @@
<template>
<view class="dropdown-list-wapper u-flex u-flex-1">
<view
v-for="(drop, index) in dropdownListFromFather"
:key="drop.name"
:show="drop.show"
class="u-selected-class u-dropdown-list"
:style="{ zIndex: zIndex + 1 }"
>
<slot name="selectionbox">
<view
:style="{ height: top + 'rpx' }"
class="drop-item u-flex u-justify-center"
@click="handleDropClick(drop)"
>
<text :style="{ color: drop.show ? activeColor : '#999' }">
{{ getTitle(drop.options) }}
</text>
<view
class="u-animation"
:class="[drop.show ? 'u-animation-show' : '']"
>
<u-icon
v-if="drop.show"
name="arrow-up-fill"
:size="18"
:color="activeColor"
></u-icon>
<u-icon v-else name="arrow-down-fill" :size="18"></u-icon>
</view>
</view>
</slot>
<view
class="u-dropdown-view"
:class="[drop.show ? 'u-dropdownlist-show' : '']"
:style="{
background: bgcolor,
height: drop.show ? 'auto' : 0,
top: top + 'rpx'
}"
>
<slot name="dropdownbox">
<view class="u-selected-list">
<view
class="select-item u-flex u-align-center u-border-bottom u-align-between"
:style="{ color: select.select ? activeColor : '#666666' }"
@tap="handleSelected(select, drop.options)"
v-for="(select, n) in drop.options"
:key="n"
>
<text>{{ select.text }}</text>
<u-icon
v-if="select.select"
class="select-icon"
:color="activeColor"
size="35"
name="checkmark"
></u-icon>
</view>
</view>
</slot>
</view>
</view>
<u-mask
duration="100"
:show="dropdownShow"
@click="closeMask"
:z-index="zIndex"
></u-mask>
</view>
</template>
<script>
const dropdownOption1 = [
{ id: 0, text: '类型', value: '', select: false },
{ id: 1, text: '全场券', value: 1, select: false },
{ id: 2, text: '品类券', value: 2, select: false },
{ id: 3, text: '单品券', value: 3, select: false },
{ id: 4, text: '业务券', value: 4, select: false }
]
const dropdownOption2 = [
{ id: 5, text: '状态', value: '', select: false },
{ id: 6, text: '可使用', value: 1, select: false },
{ id: 7, text: '已过期', value: 2, select: false }
]
const dropdownOption3 = [
{ id: 8, text: '优惠力度', value: '', select: false },
{ id: 9, text: '满100-20', value: 1, select: false },
{ id: 10, text: '满100-50', value: 2, select: false }
]
export default {
props: {
//
dropdownList: {
type: Array,
default: () => [
{ show: false, options: dropdownOption1 },
{ show: false, options: dropdownOption2 },
{ show: false, options: dropdownOption3 }
],
required: true,
validator: value =>
value.every(item => Array.isArray(item.options) && item.options.length)
},
//
bgcolor: {
type: String,
default: 'none'
},
//top rpx
top: {
type: Number,
default: 90
},
//
activeColor: {
type: String,
default: '#e7141a'
},
// maskz-index
zIndex: {
type: [String, Number],
default: 21
}
},
data() {
return {
dropdownShow: false,
dropdownListFromFather: this.dropdownList
}
},
computed: {},
methods: {
getTitle(item = []) {
const obj = item.find(v => v.select) || {}
if (obj.select) {
return obj.text
} else {
if (item[0]) {
item[0].select = true
return item[0].text
}
}
return ''
},
handleDropClick(item) {
if (item.show) {
item.show = false
this.dropdownShow = false
return
}
this.dropdownListFromFather.map(item => {
item.show = false
})
const t = setTimeout(() => {
item.show = true
this.dropdownShow = true
clearTimeout(t)
}, 100)
},
closeMask() {
this.dropdownShow = false
this.dropdownListFromFather.map(item => {
item.show = false
})
},
handleSelected(select, options) {
options.map(item => {
item.select = false
})
select.select = true
this.closeMask()
//
this.$emit('change', select, options)
}
},
watch: {
dropdownList: {
handler(v) {
this.dropdownListFromFather = v
},
deep: true
}
}
}
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.dropdown-list-wapper {
position: relative;
}
.u-dropdown-view {
width: 100%;
overflow: hidden;
position: absolute;
z-index: 9999;
left: 0;
right: 0;
/* opacity: 0; */
visibility: hidden;
transition: height 0.5s ease-in-out;
.u-selected-list {
background-color: #fff;
.select-item {
color: #666666;
font-size: 28rpx;
padding: 30rpx 54rpx 30rpx 30rpx;
margin-left: 30rpx;
}
.select-item.selectActive {
color: #e7141a;
}
}
}
.u-dropdownlist-show {
/* opacity: 1; */
visibility: visible;
}
.u-dropdown-list {
flex: 1;
// z-index: 22;
background: #fff;
position: static;
}
.drop-item {
justify-content: center;
color: #999999;
font-size: 30rpx;
> text {
margin-right: 10rpx;
}
/deep/ {
.uicon {
position: relative;
top: -2rpx;
}
}
}
</style>

4
node_modules/uview-ui/components/u-empty/u-empty.vue

@ -173,7 +173,7 @@
@import "../../libs/css/style.components.scss";
.u-empty {
display: flex;
@include vue-flex;
flex-direction: column;
justify-content: center;
align-items: center;
@ -185,7 +185,7 @@
}
.u-slot-wrap {
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
margin-top: 20rpx;

34
node_modules/uview-ui/components/u-field/u-field.vue

@ -37,7 +37,7 @@
@tap="fieldClick"
/>
</view>
<u-icon :size="clearSize" v-if="clearable && value != '' && focused" name="close-circle-fill" color="#c0c4cc" class="u-clear-icon" @touchstart="onClear"/>
<u-icon :size="clearSize" v-if="clearable && value != '' && focused" name="close-circle-fill" color="#c0c4cc" class="u-clear-icon" @click="onClear"/>
<view class="u-button-wrap"><slot name="right" /></view>
<u-icon v-if="rightIcon" @click="rightIconClick" :name="rightIcon" color="#c0c4cc" :style="[rightIconStyle]" size="26" class="u-arror-right" />
</view>
@ -183,6 +183,11 @@ export default {
type: Boolean,
default: true
},
//
trim: {
type: Boolean,
default: true
}
},
data() {
return {
@ -241,14 +246,21 @@ export default {
},
methods: {
onInput(event) {
this.$emit('input', event.target.value);
let value = event.detail.value;
//
if(this.trim) value = this.$u.trim(value);
this.$emit('input', value);
},
onFocus(event) {
this.focused = true;
this.$emit('focus', event);
},
onBlur(event) {
this.focused = false;
// 使@touchstarthx2.8.4
// @blur
setTimeout(() => {
this.focused = false;
}, 100)
this.$emit('blur', event);
},
onConfirm(e) {
@ -280,7 +292,7 @@ export default {
}
.u-field-inner {
display: flex;
@include vue-flex;
align-items: center;
}
@ -295,7 +307,7 @@ export default {
}
.fild-body {
display: flex;
@include vue-flex;
flex: 1;
align-items: center;
}
@ -305,7 +317,9 @@ export default {
}
.u-label-text {
display: inline-block;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
}
.u-label-left-gap {
@ -322,7 +336,7 @@ export default {
flex: 1 1 130rpx;
text-align: left;
position: relative;
display: flex;
@include vue-flex;
align-items: center;
}
@ -346,7 +360,7 @@ export default {
}
.u-clear-icon {
display: flex;
@include vue-flex;
align-items: center;
}
@ -363,4 +377,8 @@ export default {
.u-input-class {
font-size: 28rpx;
}
.u-button-wrap {
margin-left: 8rpx;
}
</style>

77
node_modules/uview-ui/components/u-form-item/u-form-item.vue

@ -3,11 +3,11 @@
<view class="u-form-item__body" :style="{
flexDirection: elLabelPosition == 'left' ? 'row' : 'column'
}">
<!-- 微信小程序中将一个参数设置空字符串结果会变成字符串"true" -->
<view class="u-form-item--left" :style="{
width: elLabelPosition == 'left' ? $u.addUnit(elLabelWidth) : '100%',
flex: `0 0 ${elLabelPosition == 'left' ? $u.addUnit(elLabelWidth) : '100%'}`,
width: uLabelWidth,
flex: `0 0 ${uLabelWidth}`,
marginBottom: elLabelPosition == 'left' ? 0 : '10rpx',
}">
<!-- 为了块对齐 -->
<view class="u-form-item--left__content">
@ -89,7 +89,7 @@ export default {
},
// 线
borderBottom: {
type: [Boolean, String],
type: [String, Boolean],
default: ''
},
// labelleft-top-
@ -152,12 +152,9 @@ export default {
validateMessage: '' ,//
// message-border-input
errorType: ['message'],
fieldValue: '', // input
};
},
created() {
// provide/inject使created
this.parent = this.$u.$parent.call(this, 'u-form');
},
watch: {
validateState(val) {
this.broadcastInputError();
@ -169,8 +166,10 @@ export default {
},
},
computed: {
fieldValue() {
return this.uForm.model[this.prop];
// labelcomputed
uLabelWidth() {
// label('true')labelauto
return this.elLabelPosition == 'left' ? (this.label === 'true' || this.label === '' ? 'auto' : this.$u.addUnit(this.elLabelWidth)) : '100%';
},
showError() {
return type => {
@ -182,8 +181,8 @@ export default {
},
// label
elLabelWidth() {
// label90使u-form
return this.labelWidth ? this.labelWidth : (this.parent ? this.parent.labelWidth : 90);
// label90使(0)u-form
return (this.labelWidth != 0 || this.labelWidth != '') ? this.labelWidth : (this.parent ? this.parent.labelWidth : 90);
},
// label
elLabelStyle() {
@ -230,7 +229,7 @@ export default {
// u-formrulesu-form-item
getRules() {
//
let rules = this.uForm.rules;
let rules = this.parent.rules;
rules = rules ? rules[this.prop] : [];
//
return [].concat(rules || []);
@ -259,6 +258,8 @@ export default {
//
validation(trigger, callback = () => {}) {
//
this.fieldValue = this.parent.model[this.prop];
// blurchange
let rules = this.getFilteredRule(trigger);
// u-form
@ -281,7 +282,7 @@ export default {
// u-form-item
resetField() {
this.uForm.model[this.prop] = this.initialValue;
this.parent.model[this.prop] = this.initialValue;
// `success`
this.validateState = 'success';
}
@ -289,23 +290,31 @@ export default {
// u-form
mounted() {
// provide/inject使created
this.parent = this.$u.$parent.call(this, 'u-form');
// propuForm(u-form-input使uForm)
if (!this.prop || this.uForm === null) return;
//
this.dispatch('u-form', 'on-form-item-add', this);
this.errorType = this.uForm.errorType;
//
this.initialValue = this.fieldValue;
// $nextTicku-formrulesref
// $nextTickrefu-form
this.$nextTick(() =>{
this.setRules();
})
if (this.prop || this.parent) {
//
this.parent.fields.push(this);
this.errorType = this.parent.errorType;
//
this.initialValue = this.fieldValue;
// $nextTicku-formrulesref
// $nextTickrefu-form
this.$nextTick(() =>{
this.setRules();
})
}
},
// Form
// u-form
beforeDestroy() {
this.dispatch('u-form', 'on-form-item-remove', this);
// prop
if(this.parent && this.prop) {
this.parent.fields.map((item, index) => {
if(item === this) this.parent.fields.splice(index, 1);
})
}
},
};
</script>
@ -314,7 +323,7 @@ export default {
@import "../../libs/css/style.components.scss";
.u-form-item {
display: flex;
@include vue-flex;
// align-items: flex-start;
padding: 20rpx 0;
font-size: 28rpx;
@ -328,16 +337,16 @@ export default {
}
&__body {
display: flex;
@include vue-flex;
}
&--left {
display: flex;
@include vue-flex;
align-items: center;
&__content {
position: relative;
display: flex;
@include vue-flex;
align-items: center;
padding-right: 10rpx;
flex: 1;
@ -355,7 +364,7 @@ export default {
}
&__label {
display: flex;
@include vue-flex;
align-items: center;
flex: 1;
}
@ -366,14 +375,14 @@ export default {
flex: 1;
&__content {
display: flex;
@include vue-flex;
align-items: center;
flex: 1;
&__slot {
flex: 1;
/* #ifndef MP */
display: flex;
@include vue-flex;
align-items: center;
/* #endif */
}

15
node_modules/uview-ui/components/u-form/u-form.vue

@ -85,21 +85,6 @@ export default {
// formu-form-item
// data
this.fields = [];
//
let that = this;
// on-form-item-addfields
this.$on('on-form-item-add', item => {
if (item) {
that.fields.push(item);
}
});
//
this.$on('on-form-item-remove', item => {
// prop
if (item.prop) {
that.fields.splice(that.fields.indexOf(item), 1);
}
});
},
methods: {
setRules(rules) {

37
node_modules/uview-ui/components/u-grid-item/u-grid-item.vue

@ -34,37 +34,38 @@
default: ''
},
},
// providethis
inject: ['uGrid'],
data() {
return {
hoverClass: '', //
col: 1, //
showBorder: false, //
};
},
created() {
this.hoverClass = this.uGrid.hoverClass;
//
this.parent = false;
},
computed: {
// 221212
colNum() {
return this.col < 2 ? 2 : this.col > 12 ? 12 : this.col;
},
// grid-item
width() {
return 100 / Number(this.uGrid.col) + '%';
return 100 / Number(this.col) + '%';
},
//
// created
showBorder() {
return this.uGrid.border;
}
},
methods: {
click() {
this.$emit('click', this.index);
this.uGrid.click(this.index);
this.parent && this.parent.click(this.index);
}
},
mounted() {
// u-grid
this.parent = this.$u.$parent.call(this, 'u-grid');
if(this.parent) {
this.col = this.parent.col;
this.showBorder = this.parent.border;
this.hoverClass = this.parent.hoverClass;
}
}
};
</script>
@ -74,7 +75,7 @@
.u-grid-item {
box-sizing: border-box;
background: #fff;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
position: relative;
@ -92,7 +93,9 @@
.u-grid-marker-box {
position: absolute;
display: inline-block;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
line-height: 0;
}
@ -102,7 +105,7 @@
.u-grid-item-box {
padding: 30rpx 0;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
flex-direction: column;

7
node_modules/uview-ui/components/u-grid/u-grid.vue

@ -42,11 +42,6 @@ export default {
index: 0,
}
},
provide() {
return {
uGrid: this
}
},
computed: {
//
gridStyle() {
@ -87,7 +82,7 @@ export default {
/* #endif */
/* #ifndef MP */
display: flex;
@include vue-flex;
flex-wrap: wrap;
align-items: center;
/* #endif */

42
node_modules/uview-ui/components/u-icon/u-icon.vue

@ -2,7 +2,8 @@
<view :style="[customStyle]" class="u-icon" @tap="click" :class="['u-icon--' + labelPos]">
<image class="u-icon__img" v-if="isImg" :src="name" :mode="imgMode" :style="[imgStyle]"></image>
<text v-else class="u-icon__icon" :class="customClass" :style="[iconStyle]" :hover-class="hoverClass" @touchstart="touchstart"></text>
<text v-if="label" class="u-icon__label" :style="{
<!-- 这里进行空字符串判断如果仅仅是v-if="label"可能会出现传递0的时候结果也无法显示 -->
<text v-if="label !== ''" class="u-icon__label" :style="{
color: labelColor,
fontSize: $u.addUnit(labelSize),
marginLeft: labelPos == 'right' ? $u.addUnit(marginLeft) : 0,
@ -34,6 +35,9 @@
* @property {String} label-pos label相对于图标的位置只能right或bottom默认right
* @property {String} index 一个用于区分多个图标的值点击图标时通过click事件传出
* @property {String} hover-class 图标按下去的样式类用法同uni的view组件的hover-class参数详情见官网
* @property {String} width 显示图片小图标时的宽度
* @property {String} height 显示图片小图标时的高度
* @property {String} top 图标在垂直方向上的定位
* @event {Function} click 点击图标时触发
* @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
*/
@ -77,7 +81,7 @@ export default {
},
//
label: {
type: String,
type: [String, Number],
default: ''
},
// label
@ -127,6 +131,21 @@ export default {
return {}
}
},
//
width: {
type: [String, Number],
default: ''
},
//
height: {
type: [String, Number],
default: ''
},
//
top: {
type: [String, Number],
default: 0
}
},
computed: {
customClass() {
@ -148,7 +167,9 @@ export default {
let style = {};
style = {
fontSize: this.size == 'inherit' ? 'inherit' : this.$u.addUnit(this.size),
fontWeight: this.bold ? 'bold' : 'normal'
fontWeight: this.bold ? 'bold' : 'normal',
//
top: this.$u.addUnit(this.top)
};
//
if (this.color && !this.$u.config.type.includes(this.color)) style.color = this.color;
@ -160,8 +181,9 @@ export default {
},
imgStyle() {
let style = {};
style.width = this.$u.addUnit(this.size);
style.height = this.$u.addUnit(this.size);
// widthheight使使size
style.width = this.width ? this.$u.addUnit(this.width) : this.$u.addUnit(this.size);
style.height = this.height ? this.$u.addUnit(this.height) : this.$u.addUnit(this.size);
return style;
}
},
@ -178,10 +200,16 @@ export default {
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
/* #ifndef APP-NVUE */
// nvuecontentnvue
@import '../../iconfont.css';
/* #endif */
.u-icon {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
flex-direction: row;
align-items: center;
&--left {
@ -205,6 +233,8 @@ export default {
}
&__icon {
position: relative;
&--primary {
color: $u-type-primary;
}
@ -227,8 +257,10 @@ export default {
}
&__img {
/* #ifndef APP-PLUS */
height: auto;
will-change: transform;
/* #endif */
}
&__label {

89
node_modules/uview-ui/components/u-image/u-image.vue

@ -1,9 +1,5 @@
<template>
<view
class="u-image"
@tap="onClick"
:style="[wrapStyle, backgroundStyle]"
>
<view class="u-image" @tap="onClick" :style="[wrapStyle, backgroundStyle]">
<image
v-if="!isError"
:src="src"
@ -13,26 +9,62 @@
:lazy-load="lazyLoad"
class="u-image__image"
:style="{
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius),
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius)
}"
></image>
<view v-if="showLoading && loading" class="u-image__loading" :style="{
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius),
}">
<view
v-if="showLoading && loading"
class="u-image__loading"
:style="{
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius),
backgroundColor: this.bgColor
}"
>
<slot v-if="$slots.loading" name="loading" />
<u-icon v-else :name="loadingIcon"></u-icon>
<u-icon v-else :name="loadingIcon" :width="width" :height="height"></u-icon>
</view>
<view v-if="showError && isError && !loading" class="u-image__error" :style="{
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius),
}">
<view
v-if="showError && isError && !loading"
class="u-image__error"
:style="{
borderRadius: shape == 'circle' ? '50%' : $u.addUnit(borderRadius)
}"
>
<slot v-if="$slots.error" name="error" />
<u-icon v-else :name="errorIcon"></u-icon>
<u-icon v-else :name="errorIcon" :width="width" :height="height"></u-icon>
</view>
</view>
</template>
<script>
/**
* Image 图片
* @description 此组件为uni-app的image组件的加强版在继承了原有功能外还支持淡入动画加载中加载失败提示圆角值和形状等
* @tutorial https://uviewui.com/components/image.html
* @property {String} src 图片地址
* @property {String} mode 裁剪模式见官网说明
* @property {String | Number} width 宽度单位任意如果为数值则为rpx单位默认100%
* @property {String | Number} height 高度单位任意如果为数值则为rpx单位默认 auto
* @property {String} shape 图片形状circle-圆形square-方形默认square
* @property {String | Number} border-radius 圆角值单位任意如果为数值则为rpx单位默认 0
* @property {Boolean} lazy-load 是否懒加载仅微信小程序App百度小程序字节跳动小程序有效默认 true
* @property {Boolean} show-menu-by-longpress 是否开启长按图片显示识别小程序码菜单仅微信小程序有效默认 false
* @property {String} loading-icon 加载中的图标或者小图片默认 photo
* @property {String} error-icon 加载失败的图标或者小图片默认 error-circle
* @property {Boolean} show-loading 是否显示加载中的图标或者自定义的slot默认 true
* @property {Boolean} show-error 是否显示加载错误的图标或者自定义的slot默认 true
* @property {Boolean} fade 是否需要淡入效果默认 true
* @property {String Number} width 传入图片路径时图片的宽度
* @property {String Number} height 传入图片路径时图片的高度
* @property {Boolean} webp 只支持网络资源只对微信小程序有效默认 false
* @property {String | Number} duration 搭配fade参数的过渡时间单位ms默认 500
* @event {Function} click 点击图片时触发
* @event {Function} error 图片加载失败时触发
* @event {Function} load 图片加载成功时触发
* @example <u-image width="100%" height="300rpx" :src="src"></u-image>
*/
export default {
name: 'u-image',
props: {
//
src: {
@ -108,6 +140,11 @@ export default {
duration: {
type: [String, Number],
default: 500
},
//
bgColor: {
type: String,
default: '#f3f4f6'
}
},
data() {
@ -124,6 +161,16 @@ export default {
backgroundStyle: {}
};
},
watch: {
src(n) {
if(!n) {
// null''falseundefined
this.isError = true;
} else {
this.isError = false;
}
}
},
computed: {
wrapStyle() {
let style = {};
@ -134,7 +181,7 @@ export default {
style.borderRadius = this.shape == 'circle' ? '50%' : this.$u.addUnit(this.borderRadius);
// hidden
style.overflow = this.borderRadius > 0 ? 'hidden' : 'visible';
if(this.fade) {
if (this.fade) {
style.opacity = this.opacity;
style.transition = `opacity ${Number(this.durationTime) / 1000}s ease-in-out`;
}
@ -159,7 +206,7 @@ export default {
this.$emit('load');
//
// fadepng
if(!this.fade) return this.removeBgColor();
if (!this.fade) return this.removeBgColor();
// opacity1()0()1
this.opacity = 0;
// 00duration()
@ -171,8 +218,8 @@ export default {
this.opacity = 1;
setTimeout(() => {
this.removeBgColor();
}, this.durationTime)
}, 50)
}, this.durationTime);
}, 50);
},
//
removeBgColor() {
@ -189,7 +236,6 @@ export default {
@import '../../libs/css/style.components.scss';
.u-image {
background-color: $u-bg-color;
position: relative;
transition: opacity 0.5s ease-in-out;
@ -198,13 +244,14 @@ export default {
height: 100%;
}
&__loading, &__error {
&__loading,
&__error {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
background-color: $u-bg-color;

26
node_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue

@ -1,10 +1,13 @@
<template>
<view class="u-index-anchor-wrapper" :id="$u.guid()" :style="[wrapperStyle]">
<view class="u-index-anchor " :class="[active ? 'u-index-anchor--active' : '']" :style="[customAnchorStyle]">
<slot v-if="useSlot" />
<block v-else>
<text>{{ index }}</text>
</block>
<!-- 支付宝小程序使用$u.getRect()获取组件的根元素尺寸所以在外面套一个"壳" -->
<view>
<view class="u-index-anchor-wrapper" :id="$u.guid()" :style="[wrapperStyle]">
<view class="u-index-anchor " :class="[active ? 'u-index-anchor--active' : '']" :style="[customAnchorStyle]">
<slot v-if="useSlot" />
<block v-else>
<text>{{ index }}</text>
</block>
</view>
</view>
</view>
</template>
@ -45,10 +48,15 @@
anchorStyle: {}
}
},
inject: ['UIndexList'],
created() {
this.parent = false;
},
mounted() {
this.UIndexList.children.push(this);
this.UIndexList.updateData();
this.parent = this.$u.$parent.call(this, 'u-index-list');
if(this.parent) {
this.parent.children.push(this);
this.parent.updateData();
}
},
computed: {
customAnchorStyle() {

39
node_modules/uview-ui/components/u-index-list/u-index-list.vue

@ -1,17 +1,20 @@
<template>
<view class="u-index-bar">
<slot />
<view v-if="showSidebar" class="u-index-bar__sidebar" @touchstart.stop.prevent="onTouchMove" @touchmove.stop.prevent="onTouchMove"
@touchend.stop.prevent="onTouchStop" @touchcancel.stop.prevent="onTouchStop">
<view v-for="(item, index) in indexList" :key="index" class="u-index-bar__index" :style="{zIndex: zIndex + 1, color: activeAnchorIndex === index ? activeColor : ''}"
:data-index="index">
{{ item }}
<!-- 支付宝小程序使用$u.getRect()获取组件的根元素尺寸所以在外面套一个"壳" -->
<view>
<view class="u-index-bar">
<slot />
<view v-if="showSidebar" class="u-index-bar__sidebar" @touchstart.stop.prevent="onTouchMove" @touchmove.stop.prevent="onTouchMove"
@touchend.stop.prevent="onTouchStop" @touchcancel.stop.prevent="onTouchStop">
<view v-for="(item, index) in indexList" :key="index" class="u-index-bar__index" :style="{zIndex: zIndex + 1, color: activeAnchorIndex === index ? activeColor : ''}"
:data-index="index">
{{ item }}
</view>
</view>
<view class="u-indexed-list-alert" v-if="touchmove && indexList[touchmoveIndex]" :style="{
zIndex: alertZIndex
}">
<text>{{indexList[touchmoveIndex]}}</text>
</view>
</view>
<view class="u-indexed-list-alert" v-if="touchmove && indexList[touchmoveIndex]" :style="{
zIndex: alertZIndex
}">
<text>{{indexList[touchmoveIndex]}}</text>
</view>
</view>
</template>
@ -76,15 +79,9 @@
// #ifndef H5
this.stickyOffsetTop = this.offsetTop ? uni.upx2px(this.offsetTop) : 0;
// #endif
// createdchildrendataprovide/inject
// push
// createdchildrendata
this.children = [];
},
provide() {
return {
UIndexList: this
}
},
data() {
return {
activeAnchorIndex: 0,
@ -279,7 +276,7 @@
position: fixed;
top: 50%;
right: 0;
display: flex;
@include vue-flex;
flex-direction: column;
text-align: center;
transform: translateY(-50%);
@ -305,7 +302,7 @@
font-size: 50rpx;
color: #fff;
background-color: rgba(0, 0, 0, 0.65);
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
padding: 0;

151
node_modules/uview-ui/components/u-input/u-input.vue

@ -16,7 +16,7 @@
v-if="type == 'textarea'"
class="u-input__input u-input__textarea"
:style="[getStyle]"
:value="value"
:value="defaultValue"
:placeholder="placeholder"
:placeholderStyle="placeholderStyle"
:disabled="disabled"
@ -24,6 +24,9 @@
:fixed="fixed"
:focus="focus"
:autoHeight="autoHeight"
:selection-end="uSelectionEnd"
:selection-start="uSelectionStart"
:cursor-spacing="getCursorSpacing"
@input="handleInput"
@blur="handleBlur"
@focus="onFocus"
@ -43,14 +46,16 @@
:focus="focus"
:confirmType="confirmType"
:cursor-spacing="getCursorSpacing"
:selection-end="uSelectionEnd"
:selection-start="uSelectionStart"
@focus="onFocus"
@blur="handleBlur"
@input="handleInput"
@confirm="onConfirm"
/>
<view class="u-input__right-icon u-flex">
<view class="u-input__right-icon__clear u-input__right-icon__item" v-if="clearable && value != '' && focused">
<u-icon size="32" name="close-circle-fill" color="#c0c4cc" @touchstart="onClear"/>
<view class="u-input__right-icon__clear u-input__right-icon__item" @tap="onClear" v-if="clearable && value != '' && focused">
<u-icon size="32" name="close-circle-fill" color="#c0c4cc"/>
</view>
<view class="u-input__right-icon__clear u-input__right-icon__item" v-if="passwordIcon && type == 'password'">
<u-icon size="32" :name="!showPassword ? 'eye' : 'eye-fill'" color="#c0c4cc" @click="showPassword = !showPassword"/>
@ -67,30 +72,32 @@
<script>
import Emitter from '../../libs/util/emitter.js';
/**
* input 输入框
* @description 此组件为一个输入框默认没有边框和样式是专门为配合表单组件u-form而设计的利用它可以快速实现表单验证输入内容下拉选择等功能
* @tutorial http://uviewui.com/components/input.html
* @property {String} type 模式选择见官网说明
* @property {Boolean} clearable 是否显示右侧的清除图标(默认true)
* @property {} v-model 用于双向绑定输入框的值
* @property {String} input-align 输入框文字的对齐方式(默认left)
* @property {String} placeholder placeholder显示值(默认 '请输入内容')
* @property {Boolean} disabled 是否禁用输入框(默认false)
* @property {String Number} maxlength 输入框的最大可输入长度(默认140)
* @property {String Number} cursor-spacing 指定光标与键盘的距离单位px(默认0)
* @property {String} placeholderStyle placeholder的样式字符串形式"color: red;"(默认 "color: #c0c4cc;")
* @property {String} confirm-type 设置键盘右下角按钮的文字仅在type为text时生效(默认done)
* @property {Object} custom-style 自定义输入框的样式对象形式
* @property {Boolean} focus 是否自动获得焦点(默认false)
* @property {Boolean} fixed 如果type为textarea且在一个"position:fixed"的区域需要指明为true(默认false)
* @property {Boolean} password-icon type为password时是否显示右侧的密码查看图标(默认true)
* @property {Boolean} border 是否显示边框(默认false)
* @property {String} border-color 输入框的边框颜色(默认#dcdfe6)
* @property {Boolean} auto-height 是否自动增高输入区域type为textarea时有效(默认true)
* @property {String Number} height 高度单位rpx(text类型时为70textarea时为100)
* @example <u-input v-model="value" :type="type" :border="border" />
*/
/**
* input 输入框
* @description 此组件为一个输入框默认没有边框和样式是专门为配合表单组件u-form而设计的利用它可以快速实现表单验证输入内容下拉选择等功能
* @tutorial http://uviewui.com/components/input.html
* @property {String} type 模式选择见官网说明
* @property {Boolean} clearable 是否显示右侧的清除图标(默认true)
* @property {} v-model 用于双向绑定输入框的值
* @property {String} input-align 输入框文字的对齐方式(默认left)
* @property {String} placeholder placeholder显示值(默认 '请输入内容')
* @property {Boolean} disabled 是否禁用输入框(默认false)
* @property {String Number} maxlength 输入框的最大可输入长度(默认140)
* @property {String Number} selection-start 光标起始位置自动聚焦时有效需与selection-end搭配使用默认-1
* @property {String Number} maxlength 光标结束位置自动聚焦时有效需与selection-start搭配使用默认-1
* @property {String Number} cursor-spacing 指定光标与键盘的距离单位px(默认0)
* @property {String} placeholderStyle placeholder的样式字符串形式"color: red;"(默认 "color: #c0c4cc;")
* @property {String} confirm-type 设置键盘右下角按钮的文字仅在type为text时生效(默认done)
* @property {Object} custom-style 自定义输入框的样式对象形式
* @property {Boolean} focus 是否自动获得焦点(默认false)
* @property {Boolean} fixed 如果type为textarea且在一个"position:fixed"的区域需要指明为true(默认false)
* @property {Boolean} password-icon type为password时是否显示右侧的密码查看图标(默认true)
* @property {Boolean} border 是否显示边框(默认false)
* @property {String} border-color 输入框的边框颜色(默认#dcdfe6)
* @property {Boolean} auto-height 是否自动增高输入区域type为textarea时有效(默认true)
* @property {String Number} height 高度单位rpx(text类型时为70textarea时为100)
* @example <u-input v-model="value" :type="type" :border="border" />
*/
export default {
name: 'u-input',
mixins: [Emitter],
@ -184,6 +191,21 @@ export default {
cursorSpacing: {
type: [Number, String],
default: 0
},
// selection-end使
selectionStart: {
type: [Number, String],
default: -1
},
// selection-start使
selectionEnd: {
type: [Number, String],
default: -1
},
//
trim: {
type: Boolean,
default: true
}
},
data() {
@ -194,7 +216,7 @@ export default {
validateState: false, // input
focused: false, //
showPassword: false, //
marginRight: 0, //
lastValue: '', // @input@input
};
},
watch: {
@ -206,14 +228,7 @@ export default {
value: nVal
}
})
// input-align=right
if(oVal == '' && this.inputAlign == 'right') this.getMarginRight();
},
focused(nVal) {
if(this.clearable && this.value) {
this.getMarginRight();
}
}
},
computed: {
// uniappinputmaxlength
@ -225,59 +240,73 @@ export default {
// typeinputtextare
style.minHeight = this.height ? this.height + 'rpx' : this.type == 'textarea' ?
this.textareaHeight + 'rpx' : this.inputHeight + 'rpx';
style.marginRight = this.marginRight + 'px';
style = Object.assign(style, this.customStyle);
return style;
},
//
getCursorSpacing() {
return Number(this.cursorSpacing);
},
//
uSelectionStart() {
return String(this.selectionStart);
},
//
uSelectionEnd() {
return String(this.selectionEnd);
}
},
created() {
// u-form-item
this.$on('on-form-item-error', this.onFormItemError);
},
mounted() {
this.getMarginRight();
},
methods: {
//
getMarginRight() {
this.$nextTick(() => {
this.$uGetRect('.u-input__right-icon').then(res => {
this.marginRight = res.width;
})
})
},
/**
* change 事件
* @param event
*/
handleInput(event) {
// model
this.defaultValue = event.detail.value;
let value = event.detail.value;
//
if(this.trim) value = this.$u.trim(value);
// vue return
this.$emit('input', event.detail.value);
this.$emit('input', value);
// model
this.defaultValue = value;
// u-form-itemthis.$emit('input')
// u-form-item
this.$nextTick(() => {
// 使this.$nextTick
setTimeout(() => {
// bug()@input
// #ifdef MP-TOUTIAO
if(this.$u.trim(value) == this.lastValue) return ;
this.lastValue = value;
// #endif
// u-form-item
this.dispatch('u-form-item', 'on-form-change', event.detail.value);
});
this.dispatch('u-form-item', 'on-form-change', value);
}, 40)
},
/**
* blur 事件
* @param event
*/
handleBlur(event) {
this.focused = false;
// 使@touchstarthx2.8.4
// @blur
setTimeout(() => {
this.focused = false;
}, 100)
// vue return
this.$emit('blur', event.detail.value);
this.$nextTick(() => {
setTimeout(() => {
// bug()@input
// #ifdef MP-TOUTIAO
if(this.$u.trim(value) == this.lastValue) return ;
this.lastValue = value;
// #endif
// u-form-item
this.dispatch('u-form-item', 'on-form-blur', event.detail.value);
});
}, 40)
},
onFormItemError(status) {
this.validateState = status;
@ -300,14 +329,18 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-input {
position: relative;
flex: 1;
@include vue-flex;
&__input {
//height: $u-form-item-height;
font-size: 28rpx;
color: $u-main-color;
flex: 1;
}
&__textarea {
@ -316,6 +349,7 @@ export default {
color: $u-main-color;
padding: 10rpx 0;
line-height: normal;
flex: 1;
}
&--border {
@ -329,11 +363,6 @@ export default {
}
&__right-icon {
position: absolute;
right: 0;
top: 50%;
z-index: 3;
transform: translateY(-50%);
&__item {
margin-left: 10rpx;

20
node_modules/uview-ui/components/u-keyboard/u-keyboard.vue

@ -1,16 +1,16 @@
<template>
<u-popup class="" :mask="mask" :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose">
:safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :zIndex="uZIndex">
<slot />
<view class="u-tooltip" v-if="tooltip">
<view class="u-tooltip-item u-tooltip-cancel" hover-class="u-tooltip-cancel-hover" @tap="onCancel">
{{cancelBtn ? '取消' : ''}}
{{cancelBtn ? cancelText : ''}}
</view>
<view v-if="showTips" class="u-tooltip-item u-tooltip-tips">
{{tips ? tips : mode == 'number' ? '数字键盘' : mode == 'card' ? '身份证键盘' : '车牌号键盘'}}
</view>
<view v-if="confirmBtn" @tap="onConfirm" class="u-tooltip-item u-tooltips-submit" hover-class="u-tooltips-submit-hover">
{{confirmBtn ? '完成' : ''}}
{{confirmBtn ? confirmText : ''}}
</view>
</view>
<block v-if="mode == 'number' || mode == 'card'">
@ -34,6 +34,8 @@
* @property {Boolean} cancel-btn 是否显示工具条左边的"取消"按钮默认true
* @property {Boolean} confirm-btn 是否显示工具条右边的"完成"按钮默认true
* @property {Boolean} mask 是否显示遮罩默认true
* @property {String} confirm-text 确认按钮的文字
* @property {String} cancel-text 取消按钮的文字
* @property {Number String} z-index 弹出键盘的z-index值默认1075
* @property {Boolean} random 是否打乱键盘按键的顺序默认false
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配默认false
@ -111,6 +113,16 @@
zIndex: {
type: [Number, String],
default: ''
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmText: {
type: String,
default: '确认'
}
},
data() {
@ -167,7 +179,7 @@
}
.u-tooltip {
display: flex;
@include vue-flex;
justify-content: space-between;
}

19
node_modules/uview-ui/components/u-lazy-load/u-lazy-load.vue

@ -114,7 +114,7 @@
},
// auto%
imgHeight() {
return this.height == 'auto' ? 'auto' : String(this.height).indexOf('%') != -1 ? this.height : this.height + 'rpx';
return this.$u.addUnit(this.height);
}
},
created() {
@ -133,9 +133,24 @@
this.time = this.duration;
this.opacity = 1;
}, 30)
},
// isError
image(n) {
if(!n) {
// null''undefined
this.isError = true;
} else {
this.init();
this.isError = false;
}
}
},
methods: {
//
init() {
this.isError = false;
this.loadStatus = '';
},
// ,loadlazy-loading-loaded-
clickImg() {
let whichImg = '';
@ -222,6 +237,8 @@
transform: transition3d(0, 0, 0);
//
will-change: transform;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
}
</style>

10
node_modules/uview-ui/components/u-line-progress/u-line-progress.vue

@ -8,7 +8,11 @@
type ? `u-type-${type}-bg` : '',
striped ? 'u-striped' : '',
striped && stripedActive ? 'u-striped-active' : ''
]" class="u-active" :style="[progressStyle]">{{showPercent ? percent + '%' : ''}}
]" class="u-active" :style="[progressStyle]">
<slot v-if="$slots.default" />
<block v-else-if="showPercent">
{{percent + '%'}}
</block>
</view>
</view>
</template>
@ -102,7 +106,9 @@
.u-progress {
overflow: hidden;
height: 15px;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
width: 100%;
border-radius: 100rpx;
@ -112,7 +118,7 @@
width: 0;
height: 100%;
align-items: center;
display: flex;
@include vue-flex;
justify-items: flex-end;
justify-content: space-around;
font-size: 20rpx;

8
node_modules/uview-ui/components/u-link/u-link.vue

@ -67,13 +67,13 @@
// #ifdef MP
uni.setClipboardData({
data: this.href,
success() {
success: () => {
uni.hideToast();
this.$nextTick(() => {
this.$u.toast(this.mpTips);
})
}
});
this.$nextTick(() => {
this.$u.toast(this.mpTips);
})
// #endif
}
}

4
node_modules/uview-ui/components/u-loading/u-loading.vue

@ -55,7 +55,9 @@
@import "../../libs/css/style.components.scss";
.u-loading-circle {
display: inline-block;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
vertical-align: middle;
width: 28rpx;
height: 28rpx;

11
node_modules/uview-ui/components/u-loadmore/u-loadmore.vue

@ -28,7 +28,8 @@
* @property {String} icon-color icon-type为circle时有效加载中的动画图标的颜色默认#b7b7b7
* @property {Boolean} is-dot status为nomore时内容显示为一个"●"默认false
* @property {String} color 字体颜色默认#606266
* @property {String Number} font-size 字体大小单位rpx默认28
* @property {String Number} margin-top 到上一个相邻元素的距离
* @property {String Number} margin-bottom 到下一个相邻元素的距离
* @property {Object} load-text 自定义显示的文字见上方说明示例
* @event {Function} loadmore status为loadmore时点击组件会发出此事件
* @example <u-loadmore :status="status" icon-type="iconType" load-text="loadText" />
@ -158,12 +159,12 @@
.u-load-more-wrap {
width: 100%;
display: flex;
@include vue-flex;
justify-content: center;
}
.u-load-more-inner {
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
}
@ -171,7 +172,7 @@
.u-more {
width: 60%;
position: relative;
display: flex;
@include vue-flex;
justify-content: center;
}
@ -191,7 +192,7 @@
}
.u-loadmore-icon {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}

5
node_modules/uview-ui/components/u-mask/u-mask.vue

@ -1,5 +1,5 @@
<template>
<view class="u-mask" :style="[maskStyle, zoomStyle]" @tap="click" @touchmove.stop.prevent :class="{
<view class="u-mask" hover-stop-propagation :style="[maskStyle, zoomStyle]" @tap="click" @touchmove.stop.prevent="() => {}" :class="{
'u-mask-zoom': zoom,
'u-mask-show': show
}">
@ -84,7 +84,8 @@
else style.zIndex = -1;
style.transition = `all ${this.duration / 1000}s ease-in-out`;
//
if (Object.keys(this.customStyle).length) style = { ...style,
if (Object.keys(this.customStyle).length) style = {
...style,
...this.customStyle
};
return style;

31
node_modules/uview-ui/components/u-message-input/u-message-input.vue

@ -2,8 +2,9 @@
<view class="u-char-box">
<view class="u-char-flex">
<input :disabled="disabledKeyboard" :value="valueModel" type="number" :focus="focus" :maxlength="maxlength" class="u-input" @input="getVal"/>
<view v-for="(item, index) in maxlength" :key="index">
<view :class="[breathe && charArrLength == index ? 'u-breathe' : '', 'u-char-item',
<!-- 这里需要通过new Array生成一个供循环的数组是因为头条小程序不支持通过v-for历遍一个数值其他端都是正常的 -->
<view v-for="(item, index) in (new Array(maxlength).fill(0))" :key="index">
<view :class="[breathe && charArrLength == index ? 'u-breathe' : '', 'u-char-item',
charArrLength === index && mode == 'box' ? 'u-box-active' : '',
mode === 'box' ? 'u-box' : '']" :style="{
fontWeight: bold ? 'bold' : 'normal',
@ -15,7 +16,7 @@
<view class="u-placeholder-line" :style="{
display: charArrLength === index ? 'block' : 'none',
height: width * 0.5 +'rpx'
}"
}"
v-if="mode !== 'middleLine'"
></view>
<view v-if="mode === 'middleLine' && charArrLength <= index" :class="[breathe && charArrLength == index ? 'u-breathe' : '', charArrLength === index ? 'u-middle-line-active' : '']"
@ -46,7 +47,7 @@
* @property {Boolean} bold 字体和输入横线是否加粗默认true
* @property {String Number} font-size 字体大小单位rpx默认60
* @property {String} active-color 当前激活输入框的样式默认#2979ff
* @property {String} focus 非激活输入框的样式文字颜色同此值默认#606266
* @property {String} inactive-color 非激活输入框的样式文字颜色同此值默认#606266
* @property {String | Number} width 输入框宽度单位rpx高等于宽默认80
* @property {Boolean} disabled-keyboard 禁止点击输入框唤起系统键盘默认false
* @event {Function} change 输入内容发生改变时触发具体见官网说明
@ -118,13 +119,13 @@
}
},
watch: {
maxlength: {
// truemaxlengthcreated
immediate: true,
handler(val) {
this.maxlength = Number(val);
}
},
// maxlength: {
// // truemaxlengthcreated
// immediate: true,
// handler(val) {
// this.maxlength = Number(val);
// }
// },
value: {
immediate: true,
handler(val) {
@ -176,7 +177,7 @@
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
@keyframes breathe {
0% {
opacity: 0.3;
@ -196,7 +197,7 @@
}
.u-char-flex {
display: flex;
@include vue-flex;
justify-content: center;
flex-wrap: wrap;
position: relative;
@ -223,7 +224,7 @@
font-weight: bold;
color: $u-main-color;
line-height: 90rpx;
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
}
@ -256,7 +257,9 @@
}
.u-placeholder-line {
/* #ifndef APP-NVUE */
display: none;
/* #endif */
position: absolute;
left: 50%;
top: 50%;

492
node_modules/uview-ui/components/u-modal/u-modal.vue

@ -1,44 +1,28 @@
<template>
<view>
<u-popup :zoom="zoom"
mode="center" :popup="false"
:z-index="uZIndex" v-model="value"
:length="width" :mask-close-able="maskCloseAble"
:border-radius="borderRadius"
@close="popupClose"
:negative-top="negativeTop"
>
<u-popup :zoom="zoom" mode="center" :popup="false" :z-index="uZIndex" v-model="value" :length="width"
:mask-close-able="maskCloseAble" :border-radius="borderRadius" @close="popupClose" :negative-top="negativeTop">
<view class="u-model">
<view v-if="showTitle" class="u-model-title u-line-1" :style="[titleStyle]">{{ title }}</view>
<view class="u-model-content">
<view v-if="showTitle" class="u-model__title u-line-1" :style="[titleStyle]">{{ title }}</view>
<view class="u-model__content">
<view :style="[contentStyle]" v-if="$slots.default">
<slot />
</view>
<view v-else class="u-model-content-message" :style="[contentStyle]">{{ content }}</view>
<view v-else class="u-model__content__message" :style="[contentStyle]">{{ content }}</view>
</view>
<view class="u-model-footer u-border-top" v-if="showCancelButton || showConfirmButton">
<view
v-if="showCancelButton"
:hover-stay-time="100"
hover-class="btn-hover"
class="u-model-footer-button"
type="default"
:style="[cancelBtnStyle]"
@tap="cancel"
>
<view class="u-model__footer u-border-top" v-if="showCancelButton || showConfirmButton">
<view v-if="showCancelButton" :hover-stay-time="100" hover-class="u-model__btn--hover" class="u-model__footer__button"
:style="[cancelBtnStyle]" @tap="cancel">
{{cancelText}}
</view>
<view
v-if="showConfirmButton"
:hover-stay-time="100"
:hover-class="asyncClose ? 'none' : 'btn-hover'"
class="u-model-footer-button hairline-left"
:style="[confirmBtnStyle]"
@tap="confirm"
>
<u-loading mode="circle" :color="confirmColor" v-if="loading"></u-loading>
<view v-if="showConfirmButton || $slots['confirm-button']" :hover-stay-time="100" :hover-class="asyncClose ? 'none' : 'u-model__btn--hover'"
class="u-model__footer__button hairline-left" :style="[confirmBtnStyle]" @tap="confirm">
<slot v-if="$slots['confirm-button']" name="confirm-button"></slot>
<block v-else>
{{confirmText}}
<u-loading mode="circle" :color="confirmColor" v-if="loading"></u-loading>
<block v-else>
{{confirmText}}
</block>
</block>
</view>
</view>
@ -48,248 +32,252 @@
</template>
<script>
/**
* modal 模态框
* @description 弹出模态框常用于消息提示消息确认在当前页面内完成特定的交互操作
* @tutorial https://www.uviewui.com/components/modal.html
* @property {Boolean} value 是否显示模态框
* @property {String | Number} z-index 层级
* @property {String} title 模态框标题默认"提示"
* @property {String | Number} width 模态框宽度默认600
* @property {String} content 模态框内容默认"内容"
* @property {Boolean} show-title 是否显示标题默认true
* @property {Boolean} async-close 是否异步关闭只对确定按钮有效默认false
* @property {Boolean} show-confirm-button 是否显示确认按钮默认true
* @property {Stringr | Number} negative-top modal往上偏移的值
* @property {Boolean} show-cancel-button 是否显示取消按钮默认false
* @property {Boolean} mask-close-able 是否允许点击遮罩关闭modal默认false
* @property {String} confirm-text 确认按钮的文字内容默认"确认"
* @property {String} cancel-text 取消按钮的文字内容默认"取消"
* @property {String} cancel-color 取消按钮的颜色默认"#606266"
* @property {String} confirm-color 确认按钮的文字内容默认"#2979ff"
* @property {String | Number} border-radius 模态框圆角值单位rpx默认16
* @property {Object} title-style 自定义标题样式对象形式
* @property {Object} content-style 自定义内容样式对象形式
* @property {Object} cancel-style 自定义取消按钮样式对象形式
* @property {Object} confirm-style 自定义确认按钮样式对象形式
* @property {Boolean} zoom 是否开启缩放模式默认true
* @event {Function} confirm 确认按钮被点击
* @event {Function} cancel 取消按钮被点击
* @example <u-modal :src="title" :content="content"></u-modal>
*/
export default {
name: 'u-modal',
props: {
// Modal
value: {
type: Boolean,
default: false
},
// z-index
zIndex: {
type: [Number, String],
default: ''
},
//
title: {
type: [String],
default: '提示'
},
// (rpx)auto
width: {
type: [Number, String],
default: 600
},
//
content: {
type: String,
default: '内容'
},
//
showTitle: {
type: Boolean,
default: true
},
//
showConfirmButton: {
type: Boolean,
default: true
},
//
showCancelButton: {
type: Boolean,
default: false
},
//
confirmText: {
type: String,
default: '确认'
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmColor: {
type: String,
default: '#2979ff'
},
//
cancelColor: {
type: String,
default: '#606266'
},
//
borderRadius: {
type: [Number, String],
default: 16
},
//
titleStyle: {
type: Object,
default() {
return {}
/**
* modal 模态框
* @description 弹出模态框常用于消息提示消息确认在当前页面内完成特定的交互操作
* @tutorial https://www.uviewui.com/components/modal.html
* @property {Boolean} value 是否显示模态框
* @property {String | Number} z-index 层级
* @property {String} title 模态框标题默认"提示"
* @property {String | Number} width 模态框宽度默认600
* @property {String} content 模态框内容默认"内容"
* @property {Boolean} show-title 是否显示标题默认true
* @property {Boolean} async-close 是否异步关闭只对确定按钮有效默认false
* @property {Boolean} show-confirm-button 是否显示确认按钮默认true
* @property {Stringr | Number} negative-top modal往上偏移的值
* @property {Boolean} show-cancel-button 是否显示取消按钮默认false
* @property {Boolean} mask-close-able 是否允许点击遮罩关闭modal默认false
* @property {String} confirm-text 确认按钮的文字内容默认"确认"
* @property {String} cancel-text 取消按钮的文字内容默认"取消"
* @property {String} cancel-color 取消按钮的颜色默认"#606266"
* @property {String} confirm-color 确认按钮的文字内容默认"#2979ff"
* @property {String | Number} border-radius 模态框圆角值单位rpx默认16
* @property {Object} title-style 自定义标题样式对象形式
* @property {Object} content-style 自定义内容样式对象形式
* @property {Object} cancel-style 自定义取消按钮样式对象形式
* @property {Object} confirm-style 自定义确认按钮样式对象形式
* @property {Boolean} zoom 是否开启缩放模式默认true
* @event {Function} confirm 确认按钮被点击
* @event {Function} cancel 取消按钮被点击
* @example <u-modal :src="title" :content="content"></u-modal>
*/
export default {
name: 'u-modal',
props: {
// Modal
value: {
type: Boolean,
default: false
},
// z-index
zIndex: {
type: [Number, String],
default: ''
},
//
title: {
type: [String],
default: '提示'
},
// (rpx)auto
width: {
type: [Number, String],
default: 600
},
//
content: {
type: String,
default: '内容'
},
//
showTitle: {
type: Boolean,
default: true
},
//
showConfirmButton: {
type: Boolean,
default: true
},
//
showCancelButton: {
type: Boolean,
default: false
},
//
confirmText: {
type: String,
default: '确认'
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmColor: {
type: String,
default: '#2979ff'
},
//
cancelColor: {
type: String,
default: '#606266'
},
//
borderRadius: {
type: [Number, String],
default: 16
},
//
titleStyle: {
type: Object,
default () {
return {}
}
},
//
contentStyle: {
type: Object,
default () {
return {}
}
},
//
cancelStyle: {
type: Object,
default () {
return {}
}
},
//
confirmStyle: {
type: Object,
default () {
return {}
}
},
//
zoom: {
type: Boolean,
default: true
},
//
asyncClose: {
type: Boolean,
default: false
},
// modal
maskCloseAble: {
type: Boolean,
default: false
},
// margin-top
negativeTop: {
type: [String, Number],
default: 0
}
},
//
contentStyle: {
type: Object,
default() {
return {}
data() {
return {
loading: false, //
}
},
//
cancelStyle: {
type: Object,
default() {
return {}
computed: {
cancelBtnStyle() {
return Object.assign({
color: this.cancelColor
}, this.cancelStyle);
},
confirmBtnStyle() {
return Object.assign({
color: this.confirmColor
}, this.confirmStyle);
},
uZIndex() {
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
//
confirmStyle: {
type: Object,
default() {
return {}
watch: {
// v-modelfalseloading
//
value(n) {
if (n === true) this.loading = false;
}
},
//
zoom: {
type: Boolean,
default: true
},
//
asyncClose: {
type: Boolean,
default: false
},
// modal
maskCloseAble: {
type: Boolean,
default: false
},
// margin-top
negativeTop: {
type: [String, Number],
default: 0
}
},
data() {
return {
loading: false, //
}
},
computed: {
cancelBtnStyle() {
return Object.assign({color: this.cancelColor}, this.cancelStyle);
},
confirmBtnStyle() {
return Object.assign({color: this.confirmColor}, this.confirmStyle);
},
uZIndex() {
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
watch: {
// v-modelfalseloading
//
value(n) {
if(n === true) this.loading = false;
}
},
methods: {
confirm() {
this.$emit('confirm');
//
if(this.asyncClose) {
this.loading = true;
} else {
methods: {
confirm() {
//
if (this.asyncClose) {
this.loading = true;
} else {
this.$emit('input', false);
}
this.$emit('confirm');
},
cancel() {
this.$emit('cancel');
this.$emit('input', false);
}
},
cancel() {
this.$emit('cancel');
this.$emit('input', false);
// popup
// ""modal
setTimeout(() => {
// popup
// ""modal
setTimeout(() => {
this.loading = false;
}, 300);
},
// modalv-modelfalsemodal
popupClose() {
this.$emit('input', false);
},
//
clearLoading() {
this.loading = false;
}, 300);
},
// modalv-modelfalsemodal
popupClose() {
this.$emit('input', false);
},
//
clearLoading() {
this.loading = false;
}
}
}
};
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
@import "../../libs/css/style.components.scss";
.btn-hover {
background-color: rgb(230, 230, 230);
}
.u-model {
height: auto;
overflow: hidden;
font-size: 32rpx;
background-color: #fff;
.u-model {
height: auto;
overflow: hidden;
font-size: 32rpx;
background-color: #fff;
&-title {
padding-top: 48rpx;
font-weight: 500;
text-align: center;
color: $u-main-color;
}
&__btn--hover {
background-color: rgb(230, 230, 230);
}
&-content {
&-message {
padding: 48rpx;
font-size: 30rpx;
&__title {
padding-top: 48rpx;
font-weight: 500;
text-align: center;
color: $u-content-color;
color: $u-main-color;
}
}
&-footer {
display: flex;
&__content {
&__message {
padding: 48rpx;
font-size: 30rpx;
text-align: center;
color: $u-content-color;
}
}
&-button {
flex: 1;
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
box-sizing: border-box;
cursor: pointer;
text-align: center;
border-radius: 4rpx;
&__footer {
@include vue-flex;
&__button {
flex: 1;
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
box-sizing: border-box;
cursor: pointer;
text-align: center;
border-radius: 4rpx;
}
}
}
}
</style>

514
node_modules/uview-ui/components/u-navbar/u-navbar.vue

@ -4,292 +4,306 @@
<view class="u-status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="u-navbar-inner" :style="[navbarInnerStyle]">
<view class="u-back-wrap" v-if="isBack" @tap="goBack">
<view class="u-icon-wrap"><u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon></view>
<view class="u-icon-wrap">
<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
</view>
<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">{{ backText }}</view>
</view>
<view class="u-navbar-content-title" v-if="title" :style="[titleStyle]">
<view
class="u-title u-line-1"
:style="{
class="u-title u-line-1"
:style="{
color: titleColor,
fontSize: titleSize + 'rpx'
}"
>
}">
{{ title }}
</view>
</view>
<view class="u-slot-content"><slot></slot></view>
<view class="u-slot-right"><slot name="right"></slot></view>
<view class="u-slot-content">
<slot></slot>
</view>
<view class="u-slot-right">
<slot name="right"></slot>
</view>
</view>
</view>
<!-- 解决fixed定位后导航栏塌陷的问题 -->
<view class="u-navbar-placeholder" v-if="isFixed" :style="{ width: '100%', height: Number(navbarHeight) + statusBarHeight + 'px' }"></view>
<view class="u-navbar-placeholder" v-if="isFixed && !immersive" :style="{ width: '100%', height: Number(navbarHeight) + statusBarHeight + 'px' }"></view>
</view>
</template>
<script>
//
let systemInfo = uni.getSystemInfoSync();
let menuButtonInfo = {};
// (API)
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
// #endif
/**
* navbar 自定义导航栏
* @description 此组件一般用于在特殊情况下需要自定义导航栏的时候用到一般建议使用uniapp自带的导航栏
* @tutorial https://www.uviewui.com/components/navbar.html
* @property {String Number} height 导航栏高度(不包括状态栏高度在内内部自动加上)注意这里的单位是px默认44
* @property {String} back-icon-color 左边返回图标的颜色默认#606266
* @property {String} back-icon-name 左边返回图标的名称只能为uView自带的图标默认arrow-left
* @property {String Number} back-icon-size 左边返回图标的大小单位rpx默认30
* @property {String} back-text 返回图标右边的辅助提示文字
* @property {Object} back-text-style 返回图标右边的辅助提示文字的样式对象形式默认{ color: '#606266' }
* @property {String} title 导航栏标题如设置为空字符将会隐藏标题占位区域
* @property {String Number} title-width 导航栏标题的最大宽度内容超出会以省略号隐藏单位rpx默认250
* @property {String} title-color 标题的颜色默认#606266
* @property {String Number} title-size 导航栏标题字体大小单位rpx默认32
* @property {Function} custom-back 自定义返回逻辑方法
* @property {String Number} z-index 固定在顶部时的z-index值默认980
* @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字默认true
* @property {Object} background 导航栏背景设置见官网说明默认{ background: '#ffffff' }
* @property {Boolean} is-fixed 导航栏是否固定在顶部默认true
* @property {Boolean} border-bottom 导航栏底部是否显示下边框如定义了较深的背景颜色可取消此值默认true
* @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
*/
export default {
name: "u-navbar",
props: {
// pxrpx
height: {
type: [String, Number],
default: ''
},
//
backIconColor: {
type: String,
default: '#606266'
},
//
backIconName: {
type: String,
default: 'arrow-left'
},
// rpx
backIconSize: {
type: [String, Number],
default: '30'
},
//
backText: {
type: String,
default: ''
},
//
backTextStyle: {
type: Object,
default() {
return {
color: '#606266'
//
let systemInfo = uni.getSystemInfoSync();
let menuButtonInfo = {};
// (API)
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
menuButtonInfo = uni.getMenuButtonBoundingClientRect();
// #endif
/**
* navbar 自定义导航栏
* @description 此组件一般用于在特殊情况下需要自定义导航栏的时候用到一般建议使用uniapp自带的导航栏
* @tutorial https://www.uviewui.com/components/navbar.html
* @property {String Number} height 导航栏高度(不包括状态栏高度在内内部自动加上)注意这里的单位是px默认44
* @property {String} back-icon-color 左边返回图标的颜色默认#606266
* @property {String} back-icon-name 左边返回图标的名称只能为uView自带的图标默认arrow-left
* @property {String Number} back-icon-size 左边返回图标的大小单位rpx默认30
* @property {String} back-text 返回图标右边的辅助提示文字
* @property {Object} back-text-style 返回图标右边的辅助提示文字的样式对象形式默认{ color: '#606266' }
* @property {String} title 导航栏标题如设置为空字符将会隐藏标题占位区域
* @property {String Number} title-width 导航栏标题的最大宽度内容超出会以省略号隐藏单位rpx默认250
* @property {String} title-color 标题的颜色默认#606266
* @property {String Number} title-size 导航栏标题字体大小单位rpx默认32
* @property {Function} custom-back 自定义返回逻辑方法
* @property {String Number} z-index 固定在顶部时的z-index值默认980
* @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字默认true
* @property {Object} background 导航栏背景设置见官网说明默认{ background: '#ffffff' }
* @property {Boolean} is-fixed 导航栏是否固定在顶部默认true
* @property {Boolean} immersive 沉浸式允许fixed定位后导航栏塌陷仅fixed定位下生效默认false
* @property {Boolean} border-bottom 导航栏底部是否显示下边框如定义了较深的背景颜色可取消此值默认true
* @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
*/
export default {
name: "u-navbar",
props: {
// pxrpx
height: {
type: [String, Number],
default: ''
},
//
backIconColor: {
type: String,
default: '#606266'
},
//
backIconName: {
type: String,
default: 'nav-back'
},
// rpx
backIconSize: {
type: [String, Number],
default: '44'
},
//
backText: {
type: String,
default: ''
},
//
backTextStyle: {
type: Object,
default () {
return {
color: '#606266'
}
}
}
},
//
title: {
type: String,
default: ''
},
// rpx
titleWidth: {
type: [String, Number],
default: '250'
},
//
titleColor: {
type: String,
default: '#606266'
},
//
titleSize: {
type: [String, Number],
default: 32
},
isBack: {
type: [Boolean, String],
default: true
},
// 线
background: {
type: Object,
default() {
return {
background: '#ffffff'
},
//
title: {
type: String,
default: ''
},
// rpx
titleWidth: {
type: [String, Number],
default: '250'
},
//
titleColor: {
type: String,
default: '#606266'
},
//
titleSize: {
type: [String, Number],
default: 32
},
isBack: {
type: [Boolean, String],
default: true
},
// 线
background: {
type: Object,
default () {
return {
background: '#ffffff'
}
}
},
//
isFixed: {
type: Boolean,
default: true
},
// fixedfixed
immersive: {
type: Boolean,
default: false
},
//
borderBottom: {
type: Boolean,
default: true
},
zIndex: {
type: [String, Number],
default: ''
},
//
customBack: {
type: Function,
default: null
}
},
//
isFixed: {
type: Boolean,
default: true
},
//
borderBottom: {
type: Boolean,
default: true
data() {
return {
menuButtonInfo: menuButtonInfo,
statusBarHeight: systemInfo.statusBarHeight
};
},
zIndex: {
type: [String, Number],
default: ''
},
//
customBack: {
type: Function,
default: null
}
},
data() {
return {
menuButtonInfo: menuButtonInfo,
statusBarHeight: systemInfo.statusBarHeight
};
},
computed: {
//
navbarInnerStyle() {
let style = {};
//
style.height = this.navbarHeight + 'px';
// //
// #ifdef MP
let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
style.marginRight = rightButtonWidth + 'px';
// #endif
return style;
},
//
navbarStyle() {
let style = {};
style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
//
Object.assign(style, this.background);
return style;
},
//
titleStyle() {
let style = {};
// #ifndef MP
style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
// #endif
// #ifdef MP
// 使
let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + rightButtonWidth + 'px';
// #endif
style.width = uni.upx2px(this.titleWidth) + 'px';
return style;
computed: {
//
navbarInnerStyle() {
let style = {};
//
style.height = this.navbarHeight + 'px';
// //
// #ifdef MP
let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
style.marginRight = rightButtonWidth + 'px';
// #endif
return style;
},
//
navbarStyle() {
let style = {};
style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
//
Object.assign(style, this.background);
return style;
},
//
titleStyle() {
let style = {};
// #ifndef MP
style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
// #endif
// #ifdef MP
// 使
let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + rightButtonWidth +
'px';
// #endif
style.width = uni.upx2px(this.titleWidth) + 'px';
return style;
},
//
navbarHeight() {
// #ifdef APP-PLUS || H5
return this.height ? this.height : 44;
// #endif
// #ifdef MP
// = + ()
// (px)
// return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//
let height = systemInfo.platform == 'ios' ? 44 : 48;
return this.height ? this.height : height;
// #endif
}
},
//
navbarHeight() {
// #ifdef APP-PLUS || H5
return this.height ? this.height : 44;
// #endif
// #ifdef MP
// = + ()
// (px)
// return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//
let height = systemInfo.platform == 'ios' ? 44 : 48;
return this.height ? this.height : height;
// #endif
}
},
created() {},
methods: {
goBack() {
//
if(typeof this.customBack === 'function') {
this.customBack();
} else {
uni.navigateBack();
created() {},
methods: {
goBack() {
//
if (typeof this.customBack === 'function') {
// (H5)customBack()thisthis
// bind()thisthis.customBack()this
this.customBack.bind(this.$u.$parent.call(this))();
} else {
uni.navigateBack();
}
}
}
}
};
};
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
@import "../../libs/css/style.components.scss";
.u-navbar {
width: 100%;
}
.u-navbar {
width: 100%;
}
.u-navbar-fixed {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 991;
}
.u-navbar-fixed {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 991;
}
.u-status-bar {
width: 100%;
}
.u-status-bar {
width: 100%;
}
.u-navbar-inner {
display: flex;
justify-content: space-between;
position: relative;
align-items: center;
}
.u-navbar-inner {
@include vue-flex;
justify-content: space-between;
position: relative;
align-items: center;
}
.u-back-wrap {
display: flex;
align-items: center;
flex: 1;
flex-grow: 0;
padding: 14rpx 14rpx 14rpx 24rpx;
}
.u-back-wrap {
@include vue-flex;
align-items: center;
flex: 1;
flex-grow: 0;
padding: 14rpx 14rpx 14rpx 24rpx;
}
.u-back-text {
padding-left: 4rpx;
font-size: 30rpx;
}
.u-back-text {
padding-left: 4rpx;
font-size: 30rpx;
}
.u-navbar-content-title {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
position: absolute;
left: 0;
right: 0;
height: 60rpx;
text-align: center;
flex-shrink: 0;
}
.u-navbar-content-title {
@include vue-flex;
align-items: center;
justify-content: center;
flex: 1;
position: absolute;
left: 0;
right: 0;
height: 60rpx;
text-align: center;
flex-shrink: 0;
}
.u-navbar-centent-slot {
flex: 1;
}
.u-navbar-centent-slot {
flex: 1;
}
.u-title {
line-height: 60rpx;
font-size: 32rpx;
flex: 1;
}
.u-title {
line-height: 60rpx;
font-size: 32rpx;
flex: 1;
}
.u-navbar-right {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
}
.u-navbar-right {
flex: 1;
@include vue-flex;
align-items: center;
justify-content: flex-end;
}
.u-slot-content {
flex: 1;
display: flex;
align-items: center;
}
.u-slot-content {
flex: 1;
@include vue-flex;
align-items: center;
}
</style>

4
node_modules/uview-ui/components/u-no-network/u-no-network.vue

@ -1,5 +1,5 @@
<template>
<view class="u-no-network" v-if="!isConnected" :style="{'z-index': uZIndex}" @touchmove.stop.prevent="">
<view class="u-no-network" v-if="!isConnected" :style="{'z-index': uZIndex}" @touchmove.stop.prevent="() => {}">
<view class="u-inner">
<image class="u-error-icon" :src="image" mode="widthFix"></image>
<view class="u-tips">
@ -190,7 +190,7 @@
.u-inner {
height: 100vh;
display: flex;
@include vue-flex;
flex-direction: column;
align-items: center;
justify-content: center;

8
node_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue

@ -227,26 +227,26 @@ export default {
}
.u-direction-row {
display: flex;
@include vue-flex;
align-items: center;
justify-content: space-between;
}
.u-left-icon {
display: flex;
@include vue-flex;
align-items: center;
}
.u-notice-box {
flex: 1;
display: flex;
@include vue-flex;
overflow: hidden;
margin-left: 12rpx;
}
.u-right-icon {
margin-left: 12rpx;
display: flex;
@include vue-flex;
align-items: center;
}

59
node_modules/uview-ui/components/u-number-box/u-number-box.vue

@ -1,21 +1,24 @@
<template>
<view class="u-numberbox">
<view class="u-icon-minus" @touchstart.stop="btnTouchStart('minus')" @touchend.stop="clearTimer" :class="{ 'u-icon-disabled': disabled || inputVal <= min }" :style="{
<view class="u-icon-minus" @touchstart.stop.prevent="btnTouchStart('minus')" @touchend.stop.prevent="clearTimer" :class="{ 'u-icon-disabled': disabled || inputVal <= min }"
:style="{
background: bgColor,
height: inputHeight + 'rpx',
color: color
}">
<u-icon name="minus" :size="size"></u-icon>
</view>
<input :disabled="disabledInput || disabled" :cursor-spacing="getCursorSpacing" :class="{ 'u-input-disabled': disabled }" v-model="inputVal" class="u-number-input" @blur="onBlur"
type="number" :style="{
<input :disabled="disabledInput || disabled" :cursor-spacing="getCursorSpacing" :class="{ 'u-input-disabled': disabled }"
v-model="inputVal" class="u-number-input" @blur="onBlur"
type="number" :style="{
color: color,
fontSize: size + 'rpx',
background: bgColor,
height: inputHeight + 'rpx',
width: inputWidth + 'rpx'
}" />
<view class="u-icon-plus" @touchstart.stop="btnTouchStart('plus')" @touchend.stop="clearTimer" :class="{ 'u-icon-disabled': disabled || inputVal >= max }" :style="{
<view class="u-icon-plus" @touchstart.stop.prevent="btnTouchStart('plus')" @touchend.stop.prevent="clearTimer" :class="{ 'u-icon-disabled': disabled || inputVal >= max }"
:style="{
background: bgColor,
height: inputHeight + 'rpx',
color: color
@ -37,6 +40,7 @@
* @property {Number} step 步长每次加或减的值默认1
* @property {Boolean} disabled 是否禁用操作禁用后无法加减或手动修改输入框的值默认false
* @property {Boolean} disabled-input 是否禁止输入框手动输入值默认false
* @property {Boolean} positive-integer 是否只能输入正整数默认true
* @property {String | Number} size 输入框文字和按钮字体大小单位rpx默认26
* @property {String} color 输入框文字和加减按钮图标的颜色默认#323233
* @property {String | Number} input-width 输入框宽度单位rpx默认80
@ -129,12 +133,25 @@
pressTime: {
type: [Number, String],
default: 250
},
// 0()
positiveInteger: {
type: Boolean,
default: true
}
},
watch: {
value(val, val1) {
// changevalutchange
if(Number(val) != this.inputVal) this.inputVal = Number(val);
value(v1, v2) {
// valueinputVal
if(!this.changeFromInner) {
this.inputVal = v1;
// inputValthis.handleChange()changeFromInnertrue
// this.$nextTick
// changeFromInnerfalse
this.$nextTick(function(){
this.changeFromInner = false;
})
}
},
inputVal(v1, v2) {
//
@ -144,16 +161,26 @@
let tmp = this.$u.test.number(v1);
if (tmp && v1 >= this.min && v1 <= this.max) value = v1;
else value = v2;
// 0
if(this.positiveInteger) {
// 0
if(v1 < 0 || String(v1).indexOf('.') !== -1) {
value = v2;
// input使$nextTick
this.$nextTick(() => {
this.inputVal = v2;
})
}
}
// change
this.handleChange(value, 'change');
this.$nextTick(() => {
this.inputVal = v1;
})
}
},
data() {
return {
inputVal: 1 , // 使propsvalueprops
inputVal: 1, // 使propsvalueprops
timer: null, //
changeFromInner: false, //
};
},
created() {
@ -171,7 +198,7 @@
// clearTimer
this[callback]();
//
if(!this.longPress) return ;
if (!this.longPress) return;
clearInterval(this.timer); //
this.timer = null;
this.timer = setInterval(() => {
@ -221,7 +248,6 @@
} catch (e) {
baseNum2 = 0;
}
console.log(num1, num2, baseNum1, baseNum2);
baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
let precision = baseNum1 >= baseNum2 ? baseNum1 : baseNum2;
return ((num1 * baseNum - num2 * baseNum) / baseNum).toFixed(precision);
@ -259,11 +285,12 @@
this.$nextTick(() => {
this.inputVal = val;
})
this.handleChange(val, "blur");
this.handleChange(val, 'blur');
},
handleChange(value, type) {
if (this.disabled) return;
// inputv-model
this.changeFromInner = true;
this.$emit('input', Number(value));
this.$emit(type, {
// Number
@ -288,7 +315,7 @@
text-align: center;
padding: 0;
margin: 0 6rpx;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}
@ -296,7 +323,7 @@
.u-icon-plus,
.u-icon-minus {
width: 60rpx;
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
}

8
node_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue

@ -1,5 +1,5 @@
<template>
<view class="u-keyboard" @touchmove.stop.prevent>
<view class="u-keyboard" @touchmove.stop.prevent="() => {}">
<view class="u-keyboard-grids">
<view
class="u-keyboard-grids-item"
@ -128,7 +128,7 @@
}
.u-keyboard-grids {
display: flex;
@include vue-flex;
flex-wrap: wrap;
}
@ -137,7 +137,7 @@
text-align: center;
font-size: 50rpx;
color: #333;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
height: 110rpx;
@ -145,7 +145,7 @@
}
.u-bg-gray {
background-color: #e7e6eb;
background-color: $u-border-color;
}
.u-keyboard-back {

53
node_modules/uview-ui/components/u-picker/u-picker.vue

@ -1,9 +1,13 @@
<template>
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<!-- 多加一个if判断避免微信小程序第二次打开后视图没有重新渲染而导致数据混乱 -->
<view class="u-datetime-picker" @tap.stop v-if="value">
<view class="u-datetime-picker">
<view class="u-picker-header" @touchmove.stop.prevent="">
<view class="u-btn-picker u-btn-picker--tips" :style="{ color: cancelColor }" hover-class="u-opacity" :hover-stay-time="150" @tap="getResult('cancel')">取消</view>
<view class="u-btn-picker u-btn-picker--tips"
:style="{ color: cancelColor }"
hover-class="u-opacity"
:hover-stay-time="150"
@tap="getResult('cancel')"
>{{cancelText}}</view>
<view class="u-picker__title">{{ title }}</view>
<view
class="u-btn-picker u-btn-picker--primary"
@ -13,22 +17,22 @@
@touchmove.stop=""
@tap.stop="getResult('confirm')"
>
确定
{{confirmText}}
</view>
</view>
<view class="u-picker-body">
<picker-view v-if="mode == 'region'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
<picker-view-column v-if="params.province">
<picker-view-column v-if="!reset && params.province">
<view class="u-column-item" v-for="(item, index) in provinces" :key="index">
<view class="u-line-1">{{ item.label }}</view>
</view>
</picker-view-column>
<picker-view-column v-if="params.city">
<picker-view-column v-if="!reset && params.city">
<view class="u-column-item" v-for="(item, index) in citys" :key="index">
<view class="u-line-1">{{ item.label }}</view>
</view>
</picker-view-column>
<picker-view-column v-if="params.area">
<picker-view-column v-if="!reset && params.area">
<view class="u-column-item" v-for="(item, index) in areas" :key="index">
<view class="u-line-1">{{ item.label }}</view>
</view>
@ -72,15 +76,15 @@
</view>
</picker-view-column>
</picker-view>
<picker-view v-else-if="mode == 'selector'" :value="defaultSelector" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
<picker-view-column>
<picker-view v-else-if="mode == 'selector'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
<picker-view-column v-if="!reset">
<view class="u-column-item" v-for="(item, index) in range" :key="index">
<view class="u-line-1">{{ getItemValue(item, 'selector') }}</view>
</view>
</picker-view-column>
</picker-view>
<picker-view v-else-if="mode == 'multiSelector'" :value="defaultSelector" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
<picker-view-column v-for="(item, index) in range" :key="index">
<picker-view v-else-if="mode == 'multiSelector'" :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart" @pickend="pickend">
<picker-view-column v-if="!reset" v-for="(item, index) in range" :key="index">
<view class="u-column-item" v-for="(item1, index1) in item" :key="index1">
<view class="u-line-1">{{ getItemValue(item1, 'multiSelector') }}</view>
</view>
@ -109,6 +113,8 @@ import areas from '../../libs/util/area.js';
* @property {String} cancel-color 取消按钮的颜色默认#606266
* @property {String} confirm-color 确认按钮的颜色默认#2979ff
* @property {String} default-time 默认选中的时间mode=time时有效
* @property {String} confirm-text 确认按钮的文字
* @property {String} cancel-text 取消按钮的文字
* @property {String} default-region 默认选中的地区中文形式mode=region时有效
* @property {String} default-code 默认选中的地区编号形式mode=region时有效
* @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭Picker默认true
@ -232,6 +238,16 @@ export default {
title: {
type: String,
default: ''
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmText: {
type: String,
default: '确认'
}
},
data() {
@ -248,10 +264,10 @@ export default {
hour: 0,
minute: 0,
second: 0,
reset: false,
startDate: '',
endDate: '',
valueArr: [],
reset: false,
provinces: provinces,
citys: citys[0],
areas: areas[0][0],
@ -331,6 +347,9 @@ export default {
},
//
generateArray: function(start, end) {
// end-yearend+1
start = Number(start);
end = Number(end);
end = end > start ? end : start;
//
return [...Array(end + 1).keys()].slice(start);
@ -427,6 +446,9 @@ export default {
else if (this.params.month) index = 1;
else if (this.params.year) index = 1;
else index = 0;
//
// 331229day3129(picker-column1)
if(this.day > this.days.length) this.day = this.days.length;
this.valueArr.splice(index, 1, this.getIndex(this.days, this.day));
},
setHours() {
@ -563,7 +585,8 @@ export default {
},
//
getTimestamp() {
let time = this.year + '-' + this.month + '-' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this.second;
// yyyy-mm-ddiOS使"/"
let time = this.year + '/' + this.month + '/' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this.second;
return new Date(time).getTime() / 1000;
}
}
@ -587,7 +610,7 @@ export default {
width: 100%;
height: 90rpx;
padding: 0 40rpx;
display: flex;
@include vue-flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
@ -619,7 +642,7 @@ export default {
}
.u-column-item {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
font-size: 32rpx;

39
node_modules/uview-ui/components/u-popup/u-popup.vue

@ -1,8 +1,8 @@
<template>
<view v-if="visibleSync" :style="[customStyle, {
zIndex: uZindex - 1
}]" :class="{ 'u-drawer-visible': showDrawer }" class="u-drawer">
<u-mask :maskClickAble="maskCloseAble" :z-index="uZindex - 2" :show="showDrawer && mask" @click="maskClick"></u-mask>
}]" class="u-drawer" hover-stop-propagation>
<u-mask :duration="duration" :custom-style="maskCustomStyle" :maskClickAble="maskCloseAble" :z-index="uZindex - 2" :show="showDrawer && mask" @click="maskClick"></u-mask>
<view
class="u-drawer-content"
@tap="modeCenterClose(mode)"
@ -33,10 +33,9 @@
<scroll-view class="u-drawer__scroll-view" scroll-y="true" v-else>
<slot />
</scroll-view>
<view class="u-close" :class="['u-close--' + closeIconPos]">
<view @tap="close" class="u-close" :class="['u-close--' + closeIconPos]">
<u-icon
v-if="mode != 'center' && closeable"
@click="close"
:name="closeIcon"
:color="closeIconColor"
:size="closeIconSize"
@ -182,6 +181,18 @@ export default {
negativeTop: {
type: [String, Number],
default: 0
},
//
maskCustomStyle: {
type: Object,
default() {
return {}
}
},
// ms
duration: {
type: [String, Number],
default: 250
}
},
data() {
@ -189,6 +200,7 @@ export default {
visibleSync: false,
showDrawer: false,
timer: null,
closeFromInner: false, // value
};
},
computed: {
@ -230,6 +242,7 @@ export default {
//
style.overflow = 'hidden';
}
if(this.duration) style.transition = `all ${this.duration / 1000}s linear`;
return style;
},
//
@ -256,9 +269,10 @@ export default {
value(val) {
if (val) {
this.open();
} else {
} else if(!this.closeFromInner) {
this.close();
}
this.closeFromInner = false;
}
},
mounted() {
@ -276,6 +290,9 @@ export default {
this.close();
},
close() {
// valuewatchvalueclose
// @close
this.closeFromInner = true;
this.change('showDrawer', 'visibleSync', false);
},
// .u-drawer-content
@ -291,7 +308,9 @@ export default {
//
change(param1, param2, status) {
// this.popupfalsepickeractionsheetpopup
if (this.popup == true) this.$emit('input', status);
if (this.popup == true) {
this.$emit('input', status);
}
this[param1] = status;
if(status) {
// #ifdef H5 || MP
@ -310,7 +329,7 @@ export default {
this.timer = setTimeout(() => {
this[param2] = status;
this.$emit(status ? 'open' : 'close');
}, 300);
}, this.duration);
}
}
}
@ -338,7 +357,7 @@ export default {
/* #endif */
position: absolute;
z-index: 1003;
transition: all 0.3s linear;
transition: all 0.25s linear;
}
.u-drawer__scroll-view {
@ -375,10 +394,8 @@ export default {
}
.u-drawer-center {
/* #ifndef APP-NVUE */
display: flex;
@include vue-flex;
flex-direction: column;
/* #endif */
bottom: 0;
left: 0;
right: 0;

45
node_modules/uview-ui/components/u-radio-group/u-radio-group.vue

@ -11,10 +11,14 @@
* @description 单选框用于有一个选择用户只能选择其中一个的场景搭配u-radio使用
* @tutorial https://www.uviewui.com/components/radio.html
* @property {Boolean} disabled 是否禁用所有radio默认false
* @property {String Number} size 组件整体的大小单位rpx默认40
* @property {String} active-color 选中时的颜色应用到所有子Radio组件默认#2979ff
* @event {Function} change 任一个radio状态发生变化时触发
* @property {String Number} icon-size 图标大小单位rpx默认20
* @property {String} shape 外观形状shape-方形circle-圆形(默认circle)
* @property {Boolean} label-disabled 是否禁止点击文本操作checkbox(默认false)
* @property {String} width 宽度需带单位
* @property {Boolean} wrap 是否每个radio都换行默认false
* @event {Function} change 任一个radio状态发生变化时触发
* @example <u-radio-group v-model="value"></u-radio-group>
*/
export default {
@ -41,6 +45,21 @@
type: [String, Number],
default: 34
},
//
labelDisabled: {
type: Boolean,
default: false
},
// squarecircle
shape: {
type: String,
default: 'circle'
},
// rpx
iconSize: {
type: [String, Number],
default: 20
},
// checkboxu-checkbox-group
width: {
type: String,
@ -52,23 +71,27 @@
default: false
}
},
provide() {
return {
radioGroup: this
}
created() {
// childrendata
this.children = [];
},
methods: {
// radioradiovalue(propsvalue)
setValue(val) {
// val(parentValueval)
// u-radio
this.children.map(child => {
if(child.parentValue != val) child.parentValue = '';
})
// emitv-model
this.$emit('input', val);
this.$emit('change', val);
// this.$emit('input')
this.$nextTick(function() {
this.$emit('change', this.value);
// checkbox
//
setTimeout(() => {
// u-form-item
this.dispatch('u-form-item', 'on-form-change', this.value);
});
this.dispatch('u-form-item', 'on-form-change', val);
}, 60)
}
}
}
@ -78,7 +101,7 @@
@import "../../libs/css/style.components.scss";
.u-radio-group {
/* #ifndef MP */
/* #ifndef MP || APP-NVUE */
display: inline-flex;
flex-wrap: wrap;
/* #endif */

270
node_modules/uview-ui/components/u-radio/u-radio.vue

@ -1,10 +1,14 @@
<template>
<view class="u-radio" :style="[radioStyle]">
<view class="u-radio__icon-wrap" @tap="toggle">
<u-icon :class="iconClass" name="checkbox-mark" :size="iconSize" :color="iconColor" class="u-radio__icon" :style="[iconStyle]" />
<view class="u-radio__icon-wrap" @tap="toggle" :class="[iconClass]" :style="[iconStyle]">
<u-icon
class="u-radio__icon-wrap__icon"
name="checkbox-mark"
:size="elIconSize"
:color="iconColor"/>
</view>
<view class="u-label-class u-radio__label" @tap="onClickLabel" :style="{
fontSize: labelSize + 'rpx'
<view class="u-radio__label" @tap="onClickLabel" :style="{
fontSize: $u.addUnit(labelSize)
}">
<slot />
</view>
@ -22,7 +26,7 @@
* @property {String} shape 形状见上方说明默认circle
* @property {Boolean} disabled 是否禁用默认false
* @property {Boolean} label-disabled 点击文本是否可以操作radio默认true
* @property {String} active-color 选中时的颜色如设置radioGroup的active-color将失效
* @property {String} active-color 选中时的颜色如设置parent的active-color将失效
* @event {Function} change 某个radio状态发生变化时触发(选中状态)
* @example <u-radio :label-disabled="false">门掩黄昏无计留春住</u-radio>
*/
@ -37,19 +41,19 @@
// squarecircle
shape: {
type: String,
default: 'circle'
default: ''
},
//
disabled: {
type: Boolean,
default: false
type: [String, Boolean],
default: ''
},
//
labelDisabled: {
type: Boolean,
default: false
type: [String, Boolean],
default: ''
},
// radioGroupactiveColor
// parentactiveColor
activeColor: {
type: String,
default: ''
@ -57,66 +61,92 @@
// rpx
iconSize: {
type: [String, Number],
default: 20
default: ''
},
// labelrpx
labelSize: {
type: [String, Number],
default: 28
default: ''
},
},
inject: ['radioGroup'],
data() {
return {
parentDisabled: false
parentValue: ''
};
},
created() {
this.parentDisabled = this.radioGroup.disabled;
this.parent = false;
},
mounted() {
// provide/inject使created
this.parent = this.$u.$parent.call(this, 'u-radio-group');
if(this.parent) {
this.parent.children.push(this);
}
},
computed: {
// radioradionameradioGroupvalue
// u-raios-group
elDisabled() {
return this.disabled !== '' ? this.disabled : this.parent ? this.parent.disabled : false;
},
// label
elLabelDisabled() {
return this.labelDisabled !== '' ? this.labelDisabled : this.parent ? this.parent.labelDisabled : false;
},
// size34rpx
elSize() {
return this.size ? this.size : (this.parent ? this.parent.size : 34);
},
// 20
elIconSize() {
return this.iconSize ? this.iconSize : (this.parent ? this.parent.iconSize : 20);
},
//
elActiveColor() {
return this.activeColor ? this.activeColor : (this.parent ? this.parent.activeColor : 'primary');
},
//
elShape() {
return this.shape ? this.shape : (this.parent ? this.parent.shape : 'circle');
},
// radioradionameparentvalue
iconStyle() {
let style = {};
if (this.radioActiveColor && this.name == this.radioGroup.value && !this.disabled && !this.parentDisabled) {
style.borderColor = this.radioActiveColor;
style.backgroundColor = this.radioActiveColor;
if (this.elActiveColor && this.parentValue && !this.elDisabled) {
style.borderColor = this.elActiveColor;
style.backgroundColor = this.elActiveColor;
}
style.width = this.radioGroup.size + 'rpx';
style.height = this.radioGroup.size + 'rpx';
style.width = this.$u.addUnit(this.elSize);
style.height = this.$u.addUnit(this.elSize);
return style;
},
iconColor() {
return this.name == this.radioGroup.value ? '#ffffff' : 'transparent';
return this.name == this.parentValue ? '#ffffff' : 'transparent';
},
iconClass() {
let classs = [];
classs.push('u-radio__icon--' + this.shape);
if (this.name == this.radioGroup.value) classs.push('u-radio__icon--checked');
if (this.disabled || this.parentDisabled) classs.push('u-radio__icon--disabled');
if (this.name == this.radioGroup.value && (this.disabled || this.parentDisabled)) classs.push(
'u-radio__icon--disabled--checked');
return classs;
},
// radioGroupactiveColor
// activeColor
radioActiveColor() {
return this.activeColor ? this.activeColor : this.radioGroup.activeColor;
let classes = [];
classes.push('u-radio__icon-wrap--' + this.elShape);
if (this.name == this.parentValue) classes.push('u-radio__icon-wrap--checked');
if (this.elDisabled) classes.push('u-radio__icon-wrap--disabled');
if (this.name == this.parentValue && this.elDisabled) classes.push(
'u-radio__icon-wrap--disabled--checked');
// ","
return classes.join(' ');
},
radioStyle() {
let style = {};
if(this.radioGroup.width) {
style.width = this.radioGroup.width;
if (this.parent && this.parent.width) {
style.width = this.parent.width;
// #ifdef MP
// 使float
style.float = 'left';
// #endif
// #ifndef MP
// H5APP使flex
style.flex = `0 0 ${this.radioGroup.width}`;
style.flex = `0 0 ${this.parent.width}`;
// #endif
}
if(this.radioGroup.wrap) {
if (this.parent && this.parent.wrap) {
style.width = '100%';
// #ifndef MP
// H5APP使flex100%
@ -128,102 +158,106 @@
},
methods: {
onClickLabel() {
if (!this.disabled && !this.labelDisabled && !this.parentDisabled) {
this.radioGroup.setValue(this.name);
this.emitEvent();
if (!this.elLabelDisabled && !this.elDisabled) {
this.setRadioCheckedStatus();
}
},
toggle() {
if (!this.disabled && !this.parentDisabled) {
this.radioGroup.setValue(this.name);
this.emitEvent();
if (!this.elDisabled) {
this.setRadioCheckedStatus();
}
},
emitEvent() {
this.$emit('change', this.name)
// u-radionamev-model()
// this.$emit('input')
//
setTimeout(() => {
if(this.parent && this.parent.value != this.name) this.$emit('change', this.name);
}, 80);
},
//
// parentValuenameu-radio
// u-radioparentValue(computed)
setRadioCheckedStatus() {
if(this.parent) {
this.parent.setValue(this.name);
this.parentValue = this.name;
}
this.emitEvent();
}
}
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-radio {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
align-items: center;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
line-height: 1.8;
}
.u-radio__icon-wrap,
.u-radio__label {
color: $u-content-color;
}
.u-radio__icon-wrap {
-webkit-flex: none;
flex: none;
}
.u-radio__icon {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
box-sizing: border-box;
width: 42rpx;
height: 42rpx;
color: transparent;
text-align: center;
transition-property: color, border-color, background-color;
font-size: 20px;
border: 1px solid #c8c9cc;
transition-duration: 0.2s;
}
.u-radio__icon--circle {
border-radius: 100%;
}
.u-radio__icon--square {
border-radius: 3px;
}
.u-radio__icon--checked {
color: #fff;
background-color: #2979ff;
border-color: #2979ff;
}
.u-radio__icon--disabled {
background-color: #ebedf0;
border-color: #c8c9cc;
}
.u-radio__icon--disabled--checked {
color: #c8c9cc !important;
}
.u-radio__label {
word-wrap: break-word;
margin-left: 10rpx;
margin-right: 24rpx;
color: $u-content-color;
font-size: 30rpx;
}
.u-radio__label--disabled {
color: #c8c9cc;
}
.u-radio__label:empty {
margin: 0;
&__icon-wrap {
color: $u-content-color;
@include vue-flex;
flex: none;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 42rpx;
height: 42rpx;
color: transparent;
text-align: center;
transition-property: color, border-color, background-color;
font-size: 20px;
border: 1px solid #c8c9cc;
transition-duration: 0.2s;
/* #ifdef MP-TOUTIAO */
// 0
&__icon {
line-height: 0;
}
/* #endif */
&--circle {
border-radius: 100%;
}
&--square {
border-radius: 3px;
}
&--checked {
color: #fff;
background-color: #2979ff;
border-color: #2979ff;
}
&--disabled {
background-color: #ebedf0;
border-color: #c8c9cc;
}
&--disabled--checked {
color: #c8c9cc !important;
}
}
&__label {
word-wrap: break-word;
margin-left: 10rpx;
margin-right: 24rpx;
color: $u-content-color;
font-size: 30rpx;
&--disabled {
color: #c8c9cc;
}
}
}
</style>

12
node_modules/uview-ui/components/u-rate/u-rate.vue

@ -5,7 +5,7 @@
:name="activeIndex > index ? activeIcon : inactiveIcon"
@click="click(index + 1, $event)"
:color="activeIndex > index ? activeColor : inactiveColor"
:style="{
:custom-style="{
fontSize: size + 'rpx',
padding: `0 ${gutter / 2 + 'rpx'}`
}"
@ -123,14 +123,14 @@ export default {
//
getElRectById() {
// uView
this.$u.getRect('#' + this.elId).then(res => {
this.$uGetRect('#' + this.elId).then(res => {
this.starBoxLeft = res.left;
})
},
//
getElRectByClass() {
// uView
this.$u.getRect('.' + this.elClass).then(res => {
this.$uGetRect('.' + this.elClass).then(res => {
this.starWidth = res.width;
//
for (let i = 0; i < this.count; i++) {
@ -191,8 +191,10 @@ export default {
}
},
mounted() {
this.getElRectById();
this.getElRectByClass();
setTimeout(() => {
this.getElRectById();
this.getElRectByClass();
}, 100)
}
};
</script>

86
node_modules/uview-ui/components/u-read-more/u-read-more.vue

@ -1,19 +1,23 @@
<template>
<view class="">
<view class="u-content" :class="[elId]" :style="{ height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto' }">
<view class="u-content" :class="[elId]" :style="{
height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto',
textIndent: this.textIndent
}">
<slot></slot>
</view>
<view @tap="toggleReadMore" v-if="isLongContent" class="u-showmore-wrap"
:class="{ 'u-show-more': showMore }"
:style="[innerShadowStyle]"
>
<text class="u-readmore-btn" :style="{
<view @tap="toggleReadMore" v-if="isLongContent" class="u-content__showmore-wrap"
:class="{ 'u-content__show-more': showMore }"
:style="[innerShadowStyle]">
<text class="u-content__showmore-wrap__readmore-btn" :style="{
fontSize: fontSize + 'rpx',
color: color
}">
{{ showMore ? openText : closeText }}
</text>
<u-icon :color="color" :size="fontSize" class="u-icon" :name="showMore ? 'arrow-up' : 'arrow-down'"></u-icon>
<view class="u-content__showmore-wrap__readmore-btn__icon u-flex">
<u-icon :color="color" :size="fontSize" :name="showMore ? 'arrow-up' : 'arrow-down'"></u-icon>
</view>
</view>
</view>
</template>
@ -27,6 +31,7 @@
* @property {Boolean} toggle 展开后是否显示收起按钮默认false
* @property {String} close-text 关闭时的提示文字默认展开阅读全文
* @property {String Number} font-size 提示文字的大小单位rpx默认28
* @property {String} text-indent 段落首行缩进的字符个数默认2em
* @property {String} open-text 展开时的提示文字默认收起
* @property {String} color 提示文字的颜色默认#2979ff
* @example <u-read-more><rich-text :nodes="content"></rich-text></u-read-more>
@ -67,13 +72,23 @@
//
shadowStyle: {
type: Object,
default() {
default () {
return {
backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
paddingTop: "300rpx",
marginTop: "-300rpx"
}
}
},
//
textIndent: {
type: String,
default: '2em'
},
// openclose
index: {
type: [Number, String],
default: ''
}
},
watch: {
@ -87,7 +102,7 @@
},
//
innerShadowStyle() {
if(this.showMore) return {};
if (this.showMore) return {};
else return this.shadowStyle
}
},
@ -99,7 +114,9 @@
};
},
mounted() {
this.init();
this.$nextTick(function() {
this.init();
})
},
methods: {
init() {
@ -116,6 +133,8 @@
this.showMore = !this.showMore;
// togglefalse""
if (this.toggle == false) this.isLongContent = false;
//
this.$emit(this.showMore ? 'open' : 'close', this.index);
}
}
};
@ -123,39 +142,38 @@
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-content {
font-size: 30rpx;
color: $u-content-color;
line-height: 1.8;
text-align: left;
text-indent: 2em;
overflow: hidden;
}
.u-showmore-wrap {
position: relative;
width: 100%;
padding-bottom: 26rpx;
display: flex;
align-items: center;
justify-content: center;
}
&__show-more {
padding-top: 0;
background: none;
margin-top: 20rpx;
}
.u-show-more {
padding-top: 0;
background: none;
margin-top: 20rpx;
}
&__showmore-wrap {
position: relative;
width: 100%;
padding-bottom: 26rpx;
@include vue-flex;
align-items: center;
justify-content: center;
.u-readmore-btn {
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
}
&__readmore-btn {
@include vue-flex;
align-items: center;
justify-content: center;
line-height: 1;
.u-icon {
margin-left: 14rpx;
&__icon {
margin-left: 14rpx;
}
}
}
}
</style>

10
node_modules/uview-ui/components/u-row-notice/u-row-notice.vue

@ -217,19 +217,21 @@ export default {
}
.u-direction-row {
display: flex;
@include vue-flex;
align-items: center;
justify-content: space-between;
}
.u-left-icon {
display: inline-flex;
/* #ifndef APP-NVUE */
display: none;
/* #endif */
align-items: center;
}
.u-notice-box {
flex: 1;
display: flex;
@include vue-flex;
overflow: hidden;
margin-left: 12rpx;
}
@ -245,7 +247,7 @@ export default {
text-align: right;
//
padding-left: 100%;
display: flex;
@include vue-flex;
flex-wrap: nowrap;
}

11
node_modules/uview-ui/components/u-row/u-row.vue

@ -38,11 +38,6 @@
default: 'center'
}
},
provide() {
return {
gutter: this.gutter
}
},
computed: {
uJustify() {
if (this.justify == 'end' || this.justify == 'start') return 'flex-' + this.justify;
@ -68,14 +63,14 @@
.u-row {
// 使floatflex
/* #ifndef MP-WEIXIN */
display: flex;
/* #ifndef MP-WEIXIN || MP-QQ || MP-TOUTIAO */
@include vue-flex;
/* #endif */
flex-wrap: wrap;
}
.u-row:after {
/* #ifdef MP-WEIXIN */
/* #ifdef MP-WEIXIN || MP-QQ || MP-TOUTIAO */
display: table;
clear: both;
content: "";

24
node_modules/uview-ui/components/u-search/u-search.vue

@ -1,5 +1,5 @@
<template>
<view class="u-search" :style="{
<view class="u-search" @tap="clickHandler" :style="{
margin: margin,
}">
<view
@ -35,13 +35,13 @@
backgroundColor: bgColor,
}, inputStyle]"
/>
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @touchstart="clear">
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @tap="clear">
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="#c0c4cc"></u-icon>
</view>
</view>
<view :style="[actionStyle]" class="u-action"
:class="[showActionBtn || show ? 'u-action-active' : '']"
@touchstart.stop.prevent="custom"
@tap.stop.prevent="custom"
>{{ actionText }}</view>
</view>
</template>
@ -267,9 +267,17 @@ export default {
},
//
blur() {
this.focused = false;
// 使@touchstarthx2.8.4
// @blur
setTimeout(() => {
this.focused = false;
}, 100)
this.show = false;
this.$emit('blur', this.keyword);
},
// disabled=true
clickHandler() {
if(this.disabled) this.$emit('click');
}
}
};
@ -279,20 +287,20 @@ export default {
@import "../../libs/css/style.components.scss";
.u-search {
display: flex;
@include vue-flex;
align-items: center;
flex: 1;
}
.u-content {
display: flex;
@include vue-flex;
align-items: center;
padding: 0 18rpx;
flex: 1;
}
.u-clear-icon {
display: flex;
@include vue-flex;
align-items: center;
}
@ -307,7 +315,7 @@ export default {
.u-close-wrap {
width: 40rpx;
height: 100%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
border-radius: 50%;

105
node_modules/uview-ui/components/u-section/u-section.vue

@ -1,22 +1,28 @@
<template>
<view class="u-section">
<view class="u-section-title" :style="{
<view class="u-section__title" :style="{
fontWeight: bold ? 'bold' : 'normal',
color: color,
fontSize: fontSize + 'rpx',
paddingLeft: showLine ? '10rpx' : 0
paddingLeft: showLine ? (fontSize * 0.7) + 'rpx' : 0
}" :class="{
'u-section--line': showLine
}">
{{title}}
<view class="u-section__title__icon-wrap u-flex" :style="[lineStyle]" v-if="showLine">
<u-icon top="0" name="column-line" :size="fontSize * 1.25" bold :color="lineColor ? lineColor : color"></u-icon>
</view>
<text class="u-flex u-section__title__text">{{title}}</text>
</view>
<view class="u-right-info" v-if="right" :style="{
<view class="u-section__right-info" v-if="right || $slots.right" :style="{
color: subColor
}" @tap="rightClick">
{{subTitle}}
<view class="u-icon-arrow">
<u-icon name="arrow-right" size="24" :color="subColor"></u-icon>
</view>
}" @tap="rightClick">
<slot name="right" v-if="$slots.right" />
<block v-else>
{{subTitle}}
<view class="u-section__right-info__icon-arrow u-flex" v-if="arrow">
<u-icon name="arrow-right" size="24" :color="subColor"></u-icon>
</view>
</block>
</view>
</view>
</template>
@ -30,6 +36,7 @@
* @property {String} sub-title 右边副标题默认更多
* @property {Boolean} right 是否显示右边的内容默认true
* @property {Boolean} showLine 是否显示左边的竖条默认true
* @property {Boolean} arrow 是否显示右边箭头默认true
* @property {String Number} font-size 主标题的字体大小默认28
* @property {Boolean} bold 主标题是否加粗默认true
* @property {String} color 主标题颜色默认#303133
@ -77,11 +84,27 @@
showLine: {
type: Boolean,
default: true
}
},
// 线
lineColor: {
type: String,
default: ''
},
//
arrow: {
type: Boolean,
default: true
},
},
data() {
return {
computed: {
//
lineStyle() {
// iOStop线
return {
// 线线
left: -(Number(this.fontSize) * 0.9) + 'rpx',
top: -(Number(this.fontSize) * (this.$u.os() == 'ios' ? 0.14 : 0.15)) + 'rpx',
}
}
},
methods: {
@ -96,36 +119,36 @@
@import "../../libs/css/style.components.scss";
.u-section {
display: flex;
@include vue-flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.u-section-title {
position: relative;
font-size: 28rpx;
line-height: 1;
}
.u-section--line:after {
position: absolute;
width: 4px;
height: 100%;
content: '';
left: 0;
border-radius: 10px;
background-color: currentColor;
}
.u-right-info {
color: $u-tips-color;
font-size: 26rpx;
display: flex;
align-items: center;
}
.u-icon-arrow {
margin-left: 6rpx;
&__title {
position: relative;
font-size: 28rpx;
padding-left: 20rpx;
@include vue-flex;
align-items: center;
&__icon-wrap {
position: absolute;
}
&__text {
line-height: 1;
}
}
&__right-info {
color: $u-tips-color;
font-size: 26rpx;
@include vue-flex;
align-items: center;
&__icon-arrow {
margin-left: 6rpx;
}
}
}
</style>

29
node_modules/uview-ui/components/u-select/u-select.vue

@ -10,8 +10,7 @@
</view>
</view> -->
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<!-- 多加一个if判断避免微信小程序第二次打开后视图没有重新渲染而导致数据混乱 -->
<view class="u-select" v-if="value">
<view class="u-select">
<view class="u-select__header" @touchmove.stop.prevent="">
<view
class="u-select__header__cancel u-select__header__btn"
@ -20,7 +19,7 @@
:hover-stay-time="150"
@tap="getResult('cancel')"
>
取消
{{cancelText}}
</view>
<view class="u-select__header__title">
{{title}}
@ -33,7 +32,7 @@
@touchmove.stop=""
@tap.stop="getResult('confirm')"
>
确定
{{confirmText}}
</view>
</view>
<view class="u-select__body">
@ -61,6 +60,8 @@
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
* @property {String} cancel-color 取消按钮的颜色默认#606266
* @property {String} confirm-color 确认按钮的颜色(默认#2979ff)
* @property {String} confirm-text 确认按钮的文字
* @property {String} cancel-text 取消按钮的文字
* @property {String} default-value 提供的默认选中的下标见官网说明
* @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭Picker(默认true)
* @property {String Number} z-index 弹出时的z-index值(默认10075)
@ -145,6 +146,16 @@ export default {
title: {
type: String,
default: ''
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmText: {
type: String,
default: '确认'
}
},
data() {
@ -289,7 +300,7 @@ export default {
label: data ? data[this.labelName] : null,
};
//
if(data && data.extra) tmp.extra = data.extra;
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
})
@ -303,7 +314,7 @@ export default {
label: data ? data[this.labelName] : null,
};
//
if(data && data.extra) tmp.extra = data.extra;
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
} else if(this.mode == 'mutil-column') {
//
@ -315,7 +326,7 @@ export default {
label: data ? data[this.labelName] : null,
};
//
if(data && data.extra) tmp.extra = data.extra;
if(data && data.extra !== undefined) tmp.extra = data.extra;
this.selectValue.push(tmp);
})
}
@ -375,7 +386,7 @@ export default {
}
&__header {
display: flex;
@include vue-flex;
align-items: center;
justify-content: space-between;
height: 80rpx;
@ -393,7 +404,7 @@ export default {
box-sizing: border-box;
&__item {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
font-size: 32rpx;

42
node_modules/uview-ui/components/u-skeleton/u-skeleton.vue

@ -94,8 +94,16 @@
methods: {
//
selecterQueryInfo() {
//
uni.createSelectorQuery().selectAll('.u-skeleton').boundingClientRect().exec((res) => {
//
// 使in(this)
let query = '';
// #ifdef MP-WEIXIN
query = uni.createSelectorQuery().in(this.$parent);
// #endif
// #ifndef MP-WEIXIN
query = uni.createSelectorQuery()
// #endif
query.selectAll('.u-skeleton').boundingClientRect().exec((res) => {
this.windowHeight = res[0][0].height;
this.windowWinth = res[0][0].width;
this.top = res[0][0].bottom - res[0][0].height;
@ -110,19 +118,43 @@
},
//
getRectEls() {
uni.createSelectorQuery().selectAll('.u-skeleton-rect').boundingClientRect().exec((res) => {
let query = '';
// 使in(this)
// #ifdef MP-WEIXIN
query = uni.createSelectorQuery().in(this.$parent);
// #endif
// #ifndef MP-WEIXIN
query = uni.createSelectorQuery()
// #endif
query.selectAll('.u-skeleton-rect').boundingClientRect().exec((res) => {
this.RectNodes = res[0];
});
},
//
getFilletEls() {
uni.createSelectorQuery().selectAll('.u-skeleton-fillet').boundingClientRect().exec((res) => {
let query = '';
// 使in(this)
// #ifdef MP-WEIXIN
query = uni.createSelectorQuery().in(this.$parent);
// #endif
// #ifndef MP-WEIXIN
query = uni.createSelectorQuery()
// #endif
query.selectAll('.u-skeleton-fillet').boundingClientRect().exec((res) => {
this.filletNodes = res[0];
});
},
//
getCircleEls() {
uni.createSelectorQuery().selectAll('.u-skeleton-circle').boundingClientRect().exec((res) => {
let query = '';
// 使in(this)
// #ifdef MP-WEIXIN
query = uni.createSelectorQuery().in(this.$parent);
// #endif
// #ifndef MP-WEIXIN
query = uni.createSelectorQuery()
// #endif
query.selectAll('.u-skeleton-circle').boundingClientRect().exec((res) => {
this.circleNodes = res[0];
});
}

5
node_modules/uview-ui/components/u-slider/u-slider.vue

@ -18,7 +18,8 @@
<slot v-if="$slots.default"/>
<view v-else class="u-slider__button" :style="[blockStyle, {
height: blockWidth + 'rpx',
width: blockWidth + 'rpx'
width: blockWidth + 'rpx',
backgroundColor: blockColor
}]"></view>
</view>
</view>
@ -175,6 +176,8 @@ export default {
updateValue(value, drag) {
// step
const width = this.format(value);
// max100
if(width > this.max || width > 100) return;
//
let barStyle = {
width: width + '%'

14
node_modules/uview-ui/components/u-steps/u-steps.vue

@ -28,7 +28,7 @@
<view class="u-steps__item__dot" v-if="mode == 'dot'" :style="{
backgroundColor: index <= current ? activeColor : unActiveColor
}"></view>
<text :style="{
<text class="u-line-1" :style="{
color: index <= current ? activeColor : unActiveColor,
}" :class="['u-steps__item__text--' + direction]">
{{ item.name }}
@ -114,7 +114,7 @@ $u-steps-item-number-width: 44rpx;
$u-steps-item-dot-width: 20rpx;
.u-steps {
display: flex;
@include vue-flex;
.u-steps__item {
flex: 1;
@ -123,13 +123,13 @@ $u-steps-item-dot-width: 20rpx;
min-width: 100rpx;
font-size: 26rpx;
color: #8799a3;
display: flex;
@include vue-flex;
justify-content: center;
flex-direction: column;
align-items: center;
&--row {
display: flex;
@include vue-flex;
flex-direction: column;
.u-steps__item__line {
@ -149,7 +149,7 @@ $u-steps-item-dot-width: 20rpx;
}
&--column {
display: flex;
@include vue-flex;
flex-direction: row;
justify-content: flex-start;
min-height: 120rpx;
@ -171,7 +171,7 @@ $u-steps-item-dot-width: 20rpx;
}
&__num {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
width: $u-steps-item-number-width;
@ -184,7 +184,7 @@ $u-steps-item-dot-width: 20rpx;
&__dot {
width: $u-steps-item-dot-width;
height: $u-steps-item-dot-width;
display: flex;
@include vue-flex;
border-radius: 50%;
}

7
node_modules/uview-ui/components/u-sticky/u-sticky.vue

@ -29,6 +29,7 @@
* @property {String Number} z-index 吸顶时的z-index值默认970
* @property {String Number} h5-nav-height 导航栏高度自定义导航栏时(无导航栏时需设置为0)需要传入此值单位px默认44
* @event {Function} fixed 组件吸顶时触发
* @event {Function} unfixed 组件取消吸顶时触发
* @example <u-sticky offset-top="200"><view>塞下秋来风景异衡阳雁去无留意</view></u-sticky>
*/
export default {
@ -132,13 +133,17 @@
},
setFixed(top) {
const fixed = top < this.stickyTop;
this.fixed = fixed;
if (fixed) this.$emit('fixed', this.index);
else if(this.fixed) this.$emit('unfixed', this.index);
this.fixed = fixed;
},
disconnectObserver(observerName) {
const observer = this[observerName];
observer && observer.disconnect();
},
},
beforeDestroy() {
this.disconnectObserver('contentObserver');
}
};
</script>

7
node_modules/uview-ui/components/u-subsection/u-subsection.vue

@ -306,7 +306,7 @@
@import "../../libs/css/style.components.scss";
.u-subsection {
display: flex;
@include vue-flex;
align-items: center;
overflow: hidden;
position: relative;
@ -317,11 +317,10 @@
text-align: center;
font-size: 26rpx;
height: 100%;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
color: $u-main-color;
display: inline-flex;
padding: 0 6rpx;
}
@ -348,7 +347,7 @@
.u-item-text {
transition: all 0.35s;
color: $u-main-color;
display: flex;
@include vue-flex;
align-items: center;
position: relative;
z-index: 3;

50
node_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue

@ -1,28 +1,30 @@
<template>
<movable-area class="u-swipe-action" :style="{ backgroundColor: bgColor }">
<movable-view
class="u-swipe-view"
@change="change"
@touchend="touchend"
@touchstart="touchstart"
direction="horizontal"
:disabled="disabled"
:x="moveX"
:style="{
width: movableViewWidth ? movableViewWidth : '100%'
}"
>
<view
class="u-swipe-content"
@tap.stop="contentClick"
<view class="">
<movable-area class="u-swipe-action" :style="{ backgroundColor: bgColor }">
<movable-view
class="u-swipe-view"
@change="change"
@touchend="touchend"
@touchstart="touchstart"
direction="horizontal"
:disabled="disabled"
:x="moveX"
:style="{
width: movableViewWidth ? movableViewWidth : '100%'
}"
>
<slot></slot>
</view>
<view class="u-swipe-del" v-if="showBtn" @tap.stop="btnClick(index)" :style="[btnStyle(item.style)]" v-for="(item, index) in options" :key="index">
<view class="u-btn-text">{{ item.text }}</view>
</view>
</movable-view>
</movable-area>
<view
class="u-swipe-content"
@tap.stop="contentClick"
>
<slot></slot>
</view>
<view class="u-swipe-del" v-if="showBtn" @tap.stop="btnClick(index)" :style="[btnStyle(item.style)]" v-for="(item, index) in options" :key="index">
<view class="u-btn-text">{{ item.text }}</view>
</view>
</movable-view>
</movable-area>
</view>
</template>
<script>
@ -228,7 +230,7 @@ export default {
}
.u-swipe-view {
display: flex;
@include vue-flex;
height: initial;
position: relative;
/* 这一句很关键,覆盖默认的绝对定位 */

61
node_modules/uview-ui/components/u-swiper/u-swiper.vue

@ -2,22 +2,22 @@
<view class="u-swiper-wrap" :style="{
borderRadius: `${borderRadius}rpx`
}">
<swiper @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{
height: height + 'rpx'
}">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[current != index ? 'u-list-scale' : '']" :style="{
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
borderRadius: `${borderRadius}rpx`,
transform: effect3d && current != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && current != index ? '0 20rpx' : 0,
transform: effect3d && uCurrent != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && uCurrent != index ? '0 20rpx' : 0,
backgroundColor: bgColor
}">
<image class="u-swiper-image" :src="item[name]" :mode="imgMode"></image>
<view v-if="title" class="u-swiper-title u-line-1" :style="{
<image class="u-swiper-image" :src="item[name] || item" :mode="imgMode"></image>
<view v-if="title && item.title" class="u-swiper-title u-line-1" :style="[{
'padding-bottom': titlePaddingBottom
}">
}, titleStyle]">
{{ item.title }}
</view>
</view>
@ -30,19 +30,19 @@
padding: `0 ${effect3d ? '74rpx' : '24rpx'}`
}">
<block v-if="mode == 'rect'">
<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == current }" v-for="(item, index) in list"
<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
</block>
<block v-if="mode == 'dot'">
<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == current }" v-for="(item, index) in list"
<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
</block>
<block v-if="mode == 'round'">
<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == current }" v-for="(item, index) in list"
<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }" v-for="(item, index) in list"
:key="index"></view>
</block>
<block v-if="mode == 'number'">
<view class="u-indicator-item-number">{{ current + 1 }}/{{ list.length }}</view>
<view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
</block>
</view>
</view>
@ -156,17 +156,34 @@
bgColor: {
type: String,
default: '#f3f4f6'
},
//
current: {
type: [Number, String],
default: 0
},
//
titleStyle: {
type: Object,
default() {
return {}
}
}
},
watch: {
// listcurrent
// listuCurrent
list(nVal, oVal) {
if(nVal.length !== oVal.length) this.current = 0;
if(nVal.length !== oVal.length) this.uCurrent = 0;
},
// currentuCurrentcurrentuCurrent
// uCurrent
current(n) {
this.uCurrent = n;
}
},
data() {
return {
current: 0 // swiper-itemindex
uCurrent: this.current // swiper-itemindex
};
},
computed: {
@ -186,6 +203,10 @@
tmp = '12rpx';
}
return tmp;
},
// uniswipercurrentNumber
elCurrent() {
return Number(this.current);
}
},
methods: {
@ -194,15 +215,15 @@
},
change(e) {
let current = e.detail.current;
this.current = current;
this.uCurrent = current;
// changeindex0
this.$emit('change', current);
},
// animationfinishchange
// swipercurrent
// swiperuCurrent
animationfinish(e) {
// #ifndef MP-TOUTIAO
// this.current = e.detail.current;
// this.uCurrent = e.detail.current;
// #endif
}
}
@ -222,7 +243,9 @@
width: 100%;
will-change: transform;
height: 100%;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
/* #ifdef H5 */
pointer-events: none;
/* #endif */
@ -231,7 +254,7 @@
.u-swiper-indicator {
padding: 0 24rpx;
position: absolute;
display: flex;
@include vue-flex;
width: 100%;
z-index: 1;
}
@ -310,7 +333,7 @@
}
.u-swiper-item {
display: flex;
@include vue-flex;
overflow: hidden;
align-items: center;
}

15
node_modules/uview-ui/components/u-switch/u-switch.vue

@ -1,7 +1,10 @@
<template>
<view class="u-switch" :class="[value == true ? 'u-switch--on' : '', disabled ? 'u-switch--disabled' : '']" @tap="onClick"
:style="[switchStyle]">
<view class="u-switch__node node-class">
<view class="u-switch__node node-class" :style="{
width: $u.addUnit(this.size),
height: $u.addUnit(this.size)
}">
<u-loading :show="loading" class="u-switch__loading" :size="size * 0.6" :color="loadingColor" />
</view>
</view>
@ -108,7 +111,9 @@
.u-switch {
position: relative;
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
box-sizing: initial;
width: 2em;
height: 1em;
@ -120,7 +125,7 @@
}
.u-switch__node {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
position: absolute;
@ -128,8 +133,6 @@
left: 0;
border-radius: 100%;
z-index: 1;
width: 1em;
height: 1em;
background-color: #fff;
background-color: #fff;
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
@ -141,7 +144,7 @@
}
.u-switch__loading {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}
@ -151,7 +154,7 @@
}
.u-switch--on .u-switch__node {
transform: translateX(1em);
transform: translateX(100%);
}
.u-switch--disabled {

126
node_modules/uview-ui/components/u-tabbar/u-tabbar.vue

@ -1,5 +1,5 @@
<template>
<view v-if="show" class="u-tabbar" @touchmove.stop.prevent>
<view v-if="show" class="u-tabbar" @touchmove.stop.prevent="() => {}">
<view class="u-tabbar__content safe-area-inset-bottom" :style="{
height: $u.addUnit(height),
backgroundColor: bgColor,
@ -14,19 +14,20 @@
<view :class="[
midButton && item.midButton ? 'u-tabbar__content__circle__button' : 'u-tabbar__content__item__button'
]">
<u-icon
:size="midButton && item.midButton ? midButtonSize : iconSize"
:name="index == value ? item.selectedIconPath : item.iconPath"
:color="index == value ? activeColor : inactiveColor"
<u-icon
:size="midButton && item.midButton ? midButtonSize : iconSize"
:name="elIconPath(index)"
img-mode="scaleToFill"
:color="elColor(index)"
:custom-prefix="item.customIcon ? 'custom-icon' : 'uicon'"
></u-icon>
<u-badge :count="item.count" :is-dot="item.isDot"
v-if="item.count > 0"
<u-badge :count="item.count" :is-dot="item.isDot"
v-if="item.count"
:offset="[-2, getOffsetRight(item.count, item.isDot)]"
></u-badge>
</view>
<view class="u-tabbar__content__item__text" :style="{
color: index == value ? activeColor : inactiveColor
color: elColor(index)
}">
<text class="u-line-1">{{item.text}}</text>
</view>
@ -34,12 +35,13 @@
<view v-if="midButton" class="u-tabbar__content__circle__border" :class="{
'u-border': borderTop,
}" :style="{
backgroundColor: bgColor
backgroundColor: bgColor,
left: midButtonLeft
}">
</view>
</view>
<!-- 这里加上一个48rpx的高度,是为了增高有凸起按钮时的防塌陷高度(也即按钮凸出来部分的高度) -->
<view class="u-fixed-placeholder safe-area-inset-bottom" :style="{
<view class="u-fixed-placeholder safe-area-inset-bottom" :style="{
height: `calc(${$u.addUnit(height)} + ${midButton ? 48 : 0}rpx)`,
}"></view>
</view>
@ -110,24 +112,78 @@
type: Boolean,
default: true
},
// tabbar
hideTabBar: {
type: Boolean,
default: true
},
},
data() {
return {
// cssjs
midButtonLeft: '50%',
pageUrl: '', //
}
},
created() {
// tabbar
if(this.hideTabBar) uni.hideTabBar();
// u-tabbar"/"
let pages = getCurrentPages();
// route
this.pageUrl = pages[pages.length - 1].route;
},
computed: {
elIconPath() {
return (index) => {
// u-tabbaritempagePath
// datapageUrlitemtabbar
// 使v-modelvalue
let pagePath = this.list[index].pagePath;
// pagePath使tabbar使tabbar
// tabbar item
if(pagePath) {
if(pagePath == this.pageUrl || pagePath == '/' + this.pageUrl) {
return this.list[index].selectedIconPath;
} else {
return this.list[index].iconPath;
}
} else {
// v-model
return index == this.value ? this.list[index].selectedIconPath : this.list[index].iconPath
}
}
},
elColor() {
return (index) => {
// elIconPath
let pagePath = this.list[index].pagePath;
if(pagePath) {
if(pagePath == this.pageUrl || pagePath == '/' + this.pageUrl) return this.activeColor;
else return this.inactiveColor;
} else {
return index == this.value ? this.activeColor : this.inactiveColor;
}
}
}
},
mounted() {
this.midButton && this.getMidButtonLeft();
},
methods: {
async clickHandler(index) {
if(this.beforeSwitch && typeof(this.beforeSwitch) === 'function') {
//
let beforeSwitch = this.beforeSwitch(index);
// (H5)customBack()thisthis
// bind()thisthis.customBack()this
let beforeSwitch = this.beforeSwitch.bind(this.$u.$parent.call(this))(index);
// promise
if (!!beforeSwitch && typeof beforeSwitch.then === 'function') {
await beforeSwitch.then(res => {
// promise
this.switchTab(index);
}).catch(err => {
})
} else if(beforeSwitch === true) {
// true
@ -141,7 +197,16 @@
switchTab(index) {
// v-model
this.$emit('change', index);
this.$emit('input', index);
// pagePath使uni.switchTab
if(this.list[index].pagePath) {
uni.switchTab({
url: this.list[index].pagePath
})
} else {
// papgePathv-modelvalue
// v-modelvaluegetCurrentPages()
this.$emit('input', index);
}
},
// right
getOffsetRight(count, isDot) {
@ -153,20 +218,29 @@
} else {
return -30;
}
},
// left
getMidButtonLeft() {
let windowWidth = this.$u.sys().windowWidth;
// cssleft: 50%js
this.midButtonLeft = (windowWidth / 2) + 'px';
}
}
}
</script>
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
.u-fixed-placeholder {
/* #ifndef APP-NVUE */
box-sizing: content-box;
/* #endif */
}
.u-tabbar {
&__content {
display: flex;
@include vue-flex;
align-items: center;
position: relative;
position: fixed;
@ -174,18 +248,22 @@
left: 0;
width: 100%;
z-index: 998;
/* #ifndef APP-NVUE */
box-sizing: content-box;
/* #endif */
&__circle__border {
border-radius: 100%;
width: 110rpx;
height: 110rpx;
top: -48rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
z-index: 4;
background-color: #ffffff;
// 3tabbar itemcss
// 使jsjs
left: 50%;
transform: translateX(-50%);
&:after {
border-radius: 100px;
@ -197,14 +275,16 @@
justify-content: center;
height: 100%;
padding: 12rpx 0;
display: flex;
@include vue-flex;
flex-direction: column;
align-items: center;
position: relative;
&__button {
position: absolute;
top: 10rpx;
top: 14rpx;
left: 50%;
transform: translateX(-50%);
}
&__text {
@ -212,7 +292,7 @@
font-size: 26rpx;
line-height: 28rpx;
position: absolute;
bottom: 12rpx;
bottom: 14rpx;
left: 50%;
transform: translateX(-50%);
}
@ -220,17 +300,19 @@
&__circle {
position: relative;
display: flex;
@include vue-flex;
flex-direction: column;
justify-content: space-between;
z-index: 10;
/* #ifndef APP-NVUE */
height: calc(100% - 1px);
/* #endif */
&__button {
width: 90rpx;
height: 90rpx;
border-radius: 100%;
display: flex;
@include vue-flex;
justify-content: center;
align-items: center;
position: absolute;

12
node_modules/uview-ui/components/u-table/u-table.vue

@ -59,12 +59,6 @@
default: '#ffffff'
}
},
provide() {
return {
uTable: this,
uTd: this
};
},
data() {
return {}
},
@ -87,10 +81,4 @@
width: 100%;
box-sizing: border-box;
}
/* #ifdef MP */
.u-table /deep/ t-tr {
display: flex;
}
/* #endif */
</style>

24
node_modules/uview-ui/components/u-tabs-swiper/u-tabs-swiper.vue

@ -252,7 +252,7 @@
//
this.colorGradientArr = color.colorGradient(this.inactiveColor, this.activeColor, this.colorStep);
},
// tab
// tab
getTabsInfo() {
return new Promise((resolve, reject) => {
let view = uni.createSelectorQuery().in(this);
@ -355,13 +355,11 @@
// swiper
setFinishCurrent(current) {
// tabtab
if (current != this.animationFinishCurrent) {
this.tabsInfo.map((val, index) => {
if (current == index) val.color = this.activeColor;
else val.color = this.inactiveColor;
return val;
});
}
this.tabsInfo.map((val, index) => {
if (current == index) val.color = this.activeColor;
else val.color = this.inactiveColor;
return val;
});
this.line3AddDx = 0;
this.animationFinishCurrent = current;
this.countLine3Dx();
@ -372,7 +370,7 @@
<style scoped lang="scss">
@import "../../libs/css/style.components.scss";
view,
scroll-view {
box-sizing: border-box;
@ -383,6 +381,7 @@
transition-property: background-color, color;
}
/* #ifndef APP-NVUE */
::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar {
@ -392,10 +391,11 @@
-webkit-appearance: none;
background: transparent;
}
/* #endif */
/* #ifdef H5 */
// 穿H5scroll-view
scroll-view /deep/ ::-webkit-scrollbar {
scroll-view ::v-deep ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
@ -416,7 +416,7 @@
}
.u-tabs-scorll-flex {
display: flex;
@include vue-flex;
justify-content: space-between;
}
@ -456,7 +456,7 @@
position: absolute;
top: 0;
transition-property: left, background-color;
display: flex;
@include vue-flex;
flex-direction: row;
justify-content: center;
align-items: center;

42
node_modules/uview-ui/components/u-tabs/u-tabs.vue

@ -1,16 +1,19 @@
<template>
<view class="u-tabs" :id="id" :style="{
<view class="u-tabs" :style="{
background: bgColor
}">
<scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation>
<view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll}">
<view class="u-tab-item" :id="'u-tab-item-' + index" v-for="(item, index) in list" :key="index" @tap="clickTab(index)"
:style="[tabItemStyle(index)]">
{{ item[name] || item['name']}}
<!-- $u.getRect()对组件根节点无效因为写了.in(this)故这里获取内层接点尺寸 -->
<view :id="id">
<scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation>
<view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll}">
<view class="u-tab-item u-line-1" :id="'u-tab-item-' + index" v-for="(item, index) in list" :key="index" @tap="clickTab(index)"
:style="[tabItemStyle(index)]">
{{ item[name] || item['name']}}
</view>
<view v-if="showBar" class="u-tab-bar" :style="[tabBarStyle]"></view>
</view>
<view v-if="showBar" class="u-tab-bar" :style="[tabBarStyle]"></view>
</view>
</scroll-view>
</scroll-view>
</view>
</view>
</template>
@ -32,6 +35,7 @@
* @property {Object} bar-style 底部滑块的样式对象形式
* @property {Boolean} show-bar 是否显示底部的滑块默认true
* @property {String Number} bar-height 滑块高度单位rpx默认6
* @property {String Number} item-width 标签的宽度默认auto
* @property {String Number} gutter 单个tab标签的左右内边距之和单位rpx默认40
* @property {String} bg-color tabs导航栏的背景颜色默认#ffffff
* @property {String} name 组件内部读取的list参数中的属性名见官网说明默认name
@ -132,6 +136,11 @@
default() {
return {}
}
},
//
itemWidth: {
type: [Number, String],
default: 'auto'
}
},
data() {
@ -193,7 +202,8 @@
'font-size': this.fontSize + 'rpx',
'transition-duration': `${this.duration}s`,
padding: this.isScroll ? `0 ${this.gutter}rpx` : '',
flex: this.isScroll ? 'auto' : '1'
flex: this.isScroll ? 'auto' : '1',
width: this.$u.addUnit(this.itemWidth)
};
//
if (index == this.currentIndex && this.bold) style.fontWeight = 'bold';
@ -286,6 +296,7 @@
box-sizing: border-box;
}
/* #ifndef APP-NVUE */
::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar {
@ -295,21 +306,24 @@
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.u-scroll-box {
position: relative;
/* #ifdef MP-TOUTIAO */
white-space: nowrap;
/* #endif */
}
/* #ifdef H5 */
// 穿H5scroll-view
scroll-view /deep/ ::-webkit-scrollbar {
scroll-view ::v-deep ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.u-scroll-view {
@ -320,7 +334,9 @@
.u-tab-item {
position: relative;
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
text-align: center;
transition-property: background-color, color;
}
@ -331,7 +347,7 @@
}
.u-tabs-scorll-flex {
display: flex;
@include vue-flex;
justify-content: space-between;
}
</style>

6
node_modules/uview-ui/components/u-tag/u-tag.vue

@ -112,9 +112,9 @@
customStyle() {
let style = {};
// type
if(this.color) style.color = this.color+"!important";
if(this.color) style.color = this.color;
// tagtype
if(this.bgColor) style.backgroundColor = this.bgColor+"!important";
if(this.bgColor) style.backgroundColor = this.bgColor;
// tagborderColor使color
if(this.mode == 'plain' && this.color && !this.borderColor) style.borderColor = this.color;
else style.borderColor = this.borderColor;
@ -164,7 +164,9 @@
box-sizing: border-box;
align-items: center;
border-radius: 6rpx;
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
line-height: 1;
}

85
node_modules/uview-ui/components/u-td/u-td.vue

@ -23,29 +23,27 @@
},
data() {
return {
tr: []
};
},
inject: ['uTable', 'uTr'],
provide() {
return {
uTd: this
tdStyle: {
}
}
},
created() {
this.parent = false;
},
computed: {
tdStyle() {
mounted() {
this.parent = this.$u.$parent.call(this, 'u-table');
if (this.parent) {
//
let style = {};
if (this.width != "auto") style.flex = `0 0 ${this.width}`;
style.textAlign = this.uTable.align;
style.padding = this.tr.length == 0 ? this.uTable.padding : 0;
style.borderBottom = this.tr.length == 0 ? `solid 1px ${this.uTable.borderColor}` : 0;
style.borderRight = this.tr.length == 0 ? `solid 1px ${this.uTable.borderColor}` : 0;
style.fontSize = this.uTable.fontSize + 'rpx';
style.color = this.uTable.color;
return style;
style.textAlign = this.parent.align;
style.fontSize = this.parent.fontSize + 'rpx';
style.padding = this.parent.padding;
style.borderBottom = `solid 1px ${this.parent.borderColor}`;
style.borderRight = `solid 1px ${this.parent.borderColor}`;
style.color = this.parent.color;
this.tdStyle = style;
}
}
};
@ -53,9 +51,9 @@
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-td {
display: flex;
@include vue-flex;
flex-direction: column;
flex: 1;
justify-content: center;
@ -63,53 +61,6 @@
color: $u-content-color;
align-self: stretch;
box-sizing: border-box;
}
.u-col-1 {
flex: 0 0 calc(100%/12);
}
.u-col-2 {
flex: 0 0 calc(100%/12 * 2);
}
.u-col-3 {
flex: 0 0 calc(100%/12 * 3);
}
.u-col-4 {
flex: 0 0 calc(100%/12 * 4);
}
.u-col-5 {
flex: 0 0 calc(100%/12 * 5);
}
.u-col-6 {
flex: 0 0 calc(100%/12 * 6);
}
.u-col-7 {
flex: 0 0 calc(100%/12 * 7);
}
.u-col-8 {
flex: 0 0 calc(100%/12 * 8);
}
.u-col-9 {
flex: 0 0 calc(100%/12 * 9);
}
.u-col-10 {
flex: 0 0 calc(100%/12 * 10);
}
.u-col-11 {
flex: 0 0 calc(100%/12 * 11);
}
.u-col-12 {
flex: 0 0 calc(100%/12 * 12);
height: 100%;
}
</style>

30
node_modules/uview-ui/components/u-th/u-th.vue

@ -23,20 +23,24 @@
},
data() {
return {
};
thStyle: {}
}
},
inject: ['uTable'],
computed: {
thStyle() {
created() {
this.parent = false;
},
mounted() {
this.parent = this.$u.$parent.call(this, 'u-table');
if (this.parent) {
//
let style = {};
if (this.width) style.flex = `0 0 ${this.width}`;
style.textAlign = this.uTable.align;
style.padding = this.uTable.padding;
style.borderBottom = `solid 1px ${this.uTable.borderColor}`;
style.borderRight = `solid 1px ${this.uTable.borderColor}`;
Object.assign(style, this.uTable.thStyle);
return style;
style.textAlign = this.parent.align;
style.padding = this.parent.padding;
style.borderBottom = `solid 1px ${this.parent.borderColor}`;
style.borderRight = `solid 1px ${this.parent.borderColor}`;
Object.assign(style, this.parent.style);
this.thStyle = style;
}
}
};
@ -44,9 +48,9 @@
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
.u-th {
display: flex;
@include vue-flex;
flex-direction: column;
flex: 1;
justify-content: center;

4
node_modules/uview-ui/components/u-time-line-item/u-time-line-item.vue

@ -54,7 +54,7 @@
@import "../../libs/css/style.components.scss";
.u-time-axis-item {
display: flex;
@include vue-flex;
flex-direction: column;
width: 100%;
position: relative;
@ -67,7 +67,7 @@
left: -40rpx;
transform-origin: 0;
transform: translateX(-50%);
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
z-index: 1;

48
node_modules/uview-ui/components/u-toast/u-toast.vue

@ -1,11 +1,11 @@
<template>
<view class="u-toast" :class="[isShow ? 'u-show' : '', 'u-type-' + config.type, 'u-position-' + config.position]" :style="{
<view class="u-toast" :class="[isShow ? 'u-show' : '', 'u-type-' + tmpConfig.type, 'u-position-' + tmpConfig.position]" :style="{
zIndex: uZIndex
}">
<view class="u-icon-wrap">
<u-icon v-if="config.icon" class="u-icon" :name="iconName" :size="30" :color="config.type"></u-icon>
<u-icon v-if="tmpConfig.icon" class="u-icon" :name="iconName" :size="30" :color="tmpConfig.type"></u-icon>
</view>
<text class="u-text">{{config.title}}</text>
<text class="u-text">{{tmpConfig.title}}</text>
</view>
</template>
@ -42,14 +42,15 @@
position: 'center', // toast
callback: null, //
back: false, // toast
}
},
tmpConfig: {}, //
};
},
computed: {
iconName() {
// nonetypeerror|warning|succes|info
if (['error', 'warning', 'success', 'info'].indexOf(this.config.type) >= 0 && this.config.icon) {
let icon = this.$u.type2icon(this.config.type);
if (['error', 'warning', 'success', 'info'].indexOf(this.tmpConfig.type) >= 0 && this.tmpConfig.icon) {
let icon = this.$u.type2icon(this.tmpConfig.type);
return icon;
}
},
@ -61,7 +62,8 @@
methods: {
// toastthis.$refs.xxx.show(options)
show(options) {
this.config = this.$u.deepMerge(this.config, options);
// this.configu-toast
this.tmpConfig = this.$u.deepMerge(this.config, options);
if (this.timer) {
//
clearTimeout(this.timer);
@ -74,9 +76,9 @@
clearTimeout(this.timer);
this.timer = null;
// callback
typeof(this.config.callback) === 'function' && this.config.callback();
typeof(this.tmpConfig.callback) === 'function' && this.tmpConfig.callback();
this.timeEnd();
}, this.config.duration);
}, this.tmpConfig.duration);
},
// toastthis.$refs.xxx.hide()
hide() {
@ -90,35 +92,35 @@
//
timeEnd() {
// urlisTabtruefalse
if (this.config.url) {
if (this.tmpConfig.url) {
// url"/"uni"/"
if (this.config.url[0] != '/') this.config.url = '/' + this.config.url;
if (this.tmpConfig.url[0] != '/') this.tmpConfig.url = '/' + this.tmpConfig.url;
//
if (Object.keys(this.config.params).length) {
if (Object.keys(this.tmpConfig.params).length) {
// url
// 使"/","?","="/page/index/index?name=mary"
// params"?"
let query = '';
if (/.*\/.*\?.*=.*/.test(this.config.url)) {
if (/.*\/.*\?.*=.*/.test(this.tmpConfig.url)) {
// objectget
query = this.$u.queryParams(this.config.params, false);
this.config.url = this.config.url + "&" + query;
query = this.$u.queryParams(this.tmpConfig.params, false);
this.tmpConfig.url = this.tmpConfig.url + "&" + query;
} else {
query = this.$u.queryParams(this.config.params);
this.config.url += query;
query = this.$u.queryParams(this.tmpConfig.params);
this.tmpConfig.url += query;
}
}
// tab使uni.switchTab
if (this.config.isTab) {
if (this.tmpConfig.isTab) {
uni.switchTab({
url: this.config.url
url: this.tmpConfig.url
});
} else {
uni.navigateTo({
url: this.config.url
url: this.tmpConfig.url
});
}
} else if(this.config.back) {
} else if(this.tmpConfig.back) {
// 退
this.$u.route({
type: 'back'
@ -141,7 +143,7 @@
border-radius: 8rpx;
background: #585858;
height: 80rpx;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
@ -162,7 +164,7 @@
.u-icon {
margin-right: 10rpx;
display: flex;
@include vue-flex;
align-items: center;
line-height: normal;
}

2
node_modules/uview-ui/components/u-top-tips/u-top-tips.vue

@ -84,7 +84,7 @@
font-size: 28rpx;
left: 0;
right: 0;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
opacity: 0;

13
node_modules/uview-ui/components/u-tr/u-tr.vue

@ -13,17 +13,6 @@
*/
export default {
name: "u-tr",
inject: ['uTable', 'uTd'],
provide() {
return {
uTr: this,
};
},
created() {
if (this.uTd && this.uTd.tr) {
this.uTd.tr.push(this);
}
}
}
</script>
@ -31,6 +20,6 @@
@import "../../libs/css/style.components.scss";
.u-tr {
display: flex;
@include vue-flex;
}
</style>

128
node_modules/uview-ui/components/u-upload/u-upload.vue

@ -6,8 +6,8 @@
v-for="(item, index) in lists"
:key="index"
:style="{
width: width + 'rpx',
height: width + 'rpx'
width: $u.addUnit(width),
height: $u.addUnit(height)
}"
>
<view
@ -39,8 +39,8 @@
hover-class="u-add-wrap__hover"
hover-stay-time="150"
:style="{
width: width + 'rpx',
height: width + 'rpx'
width: $u.addUnit(width),
height: $u.addUnit(height)
}"
>
<u-icon name="plus" class="u-add-btn" size="40"></u-icon>
@ -63,6 +63,7 @@
* @property {String} image-mode 预览图片等显示模式可选值为uni的image的mode属性值默认aspectFill
* @property {String} del-icon 右上角删除图标名称只能为uView内置图标
* @property {String} del-bg-color 右上角关闭按钮的背景颜色
* @property {String | Number} index 在各个回调事件中的最后一个参数返回用于区别是哪一个组件的事件
* @property {String} del-color 右上角关闭按钮图标的颜色
* @property {Object} header 上传携带的头信息对象形式
* @property {Object} form-data 上传额外携带的参数
@ -201,11 +202,16 @@ export default {
type: Boolean,
default: false
},
//
//
width: {
type: [String, Number],
default: 200
},
//
height: {
type: [String, Number],
default: 200
},
//
delBgColor: {
type: String,
@ -230,6 +236,18 @@ export default {
beforeUpload: {
type: Function,
default: null
},
//
limitType:{
type: Array,
default() {
return ['png', 'jpg', 'jpeg', 'webp', 'gif'];
}
},
//
index: {
type: [Number, String],
default: ''
}
},
mounted() {},
@ -258,7 +276,7 @@ export default {
},
// lists
lists(n) {
this.$emit('on-list-change', n);
this.$emit('on-list-change', n, this.index);
}
},
methods: {
@ -291,26 +309,30 @@ export default {
let file = null;
let listOldLength = this.lists.length;
res.tempFiles.map((val, index) => {
// this.limitTypefalse
if(!this.checkFileExt(val)) return ;
// index1
if (!multiple && index >= 1) return;
if (val.size > maxSize) {
this.$emit('on-oversize', val, this.lists);
this.$emit('on-oversize', val, this.lists, this.index);
this.showToast('超出允许的文件大小');
} else {
if (maxCount <= lists.length) {
this.$emit('on-exceed', val, this.lists);
this.$emit('on-exceed', val, this.lists, this.index);
this.showToast('超出最大允许的文件个数');
return;
}
lists.push({
url: val.path,
progress: 0,
error: false
error: false,
file: val
});
}
});
//
this.$emit('on-choose-complete', this.lists);
this.$emit('on-choose-complete', this.lists, this.index);
if (this.autoUpload) this.uploadFile(listOldLength);
})
.catch(error => {
@ -346,12 +368,7 @@ export default {
if (this.uploading) return;
//
if (index >= this.lists.length) {
this.$emit('on-uploaded', this.lists);
return;
}
//
if (!this.action) {
this.showToast('请配置上传地址', true);
this.$emit('on-uploaded', this.lists, this.index);
return;
}
//
@ -362,7 +379,12 @@ export default {
// before-upload
if(this.beforeUpload && typeof(this.beforeUpload) === 'function') {
//
let beforeResponse = this.beforeUpload(index, this.lists);
// (H5)customBack()thisthis
// bind()thisthis.customBack()this
// uploadu-formthis.$parentu-formthis
// this$parentthis.$u.$parent.call(this)
// this.$u.$parent.call(this)
let beforeResponse = this.beforeUpload.bind(this.$u.$parent.call(this))(index, this.lists);
// promise
if (!!beforeResponse && typeof beforeResponse.then === 'function') {
await beforeResponse.then(res => {
@ -376,6 +398,11 @@ export default {
return this.uploadFile(index + 1);
}
}
//
if (!this.action) {
this.showToast('请配置上传地址', true);
return;
}
this.lists[index].error = false;
this.uploading = true;
//
@ -387,15 +414,15 @@ export default {
header: this.header,
success: res => {
// jsonjson
let data = this.toJson && this.checkIsJSON(res.data) ? JSON.parse(res.data) : res.data;
if (![200, 201].includes(res.statusCode)) {
let data = this.toJson && this.$u.test.jsonString(res.data) ? JSON.parse(res.data) : res.data;
if (![200, 201, 204].includes(res.statusCode)) {
this.uploadError(index, data);
} else {
//
this.lists[index].response = data;
this.lists[index].progress = 100;
this.lists[index].error = false;
this.$emit('on-success', data, index, this.lists);
this.$emit('on-success', data, index, this.lists, this.index);
}
},
fail: e => {
@ -405,13 +432,13 @@ export default {
uni.hideLoading();
this.uploading = false;
this.uploadFile(index + 1);
this.$emit('on-change', res, index, this.lists);
this.$emit('on-change', res, index, this.lists, this.index);
}
});
task.onProgressUpdate(res => {
if (res.progress > 0) {
this.lists[index].progress = res.progress;
this.$emit('on-progress', res, index, this.lists);
this.$emit('on-progress', res, index, this.lists, this.index);
}
});
},
@ -420,7 +447,7 @@ export default {
this.lists[index].progress = 0;
this.lists[index].error = true;
this.lists[index].response = null;
this.$emit('on-error', err, index, this.lists);
this.$emit('on-error', err, index, this.lists, this.index);
this.showToast('上传失败,请重试');
},
//
@ -435,7 +462,7 @@ export default {
}
this.lists.splice(index, 1);
this.$forceUpdate();
this.$emit('on-remove', index, this.lists);
this.$emit('on-remove', index, this.lists, this.index);
this.showToast('移除成功');
}
}
@ -446,7 +473,7 @@ export default {
//
if (index >= 0 && index < this.lists.length) {
this.lists.splice(index, 1);
this.$emit('on-list-change', this.lists);
this.$emit('on-list-change', this.lists, this.index);
}
},
//
@ -457,7 +484,7 @@ export default {
urls: images,
current: url,
success: () => {
this.$emit('on-preview', url, this.lists);
this.$emit('on-preview', url, this.lists, this.index);
},
fail: () => {
uni.showToast({
@ -467,21 +494,28 @@ export default {
}
});
},
// json
checkIsJSON(str) {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
return false;
}
}
return false;
//
checkFileExt(file) {
//
let noArrowExt = false;
//
let fileExt = '';
const reg = /.+\./;
// H5name
// #ifdef H5
fileExt = file.name.replace(reg, "").toLowerCase();
// #endif
// H5path
// #ifndef H5
fileExt = file.path.replace(reg, "").toLowerCase();
// #endif
// 使somelimitTypetrue
noArrowExt = this.limitType.some(ext => {
//
return ext.toLowerCase() === fileExt;
})
if(!noArrowExt) this.showToast(`不允许选择${fileExt}格式的文件`);
return noArrowExt;
}
}
};
@ -491,7 +525,7 @@ export default {
@import '../../libs/css/style.components.scss';
.u-upload {
display: flex;
@include vue-flex;
flex-wrap: wrap;
align-items: center;
}
@ -504,7 +538,9 @@ export default {
background: rgb(244, 245, 246);
position: relative;
border-radius: 10rpx;
display: inline-flex;
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
align-items: center;
justify-content: center;
}
@ -516,7 +552,7 @@ export default {
.u-add-wrap {
flex-direction: column;
color: $u-content-color;
font-size: 28rpx;
font-size: 26rpx;
}
.u-add-tips {
@ -544,13 +580,13 @@ export default {
border-radius: 100rpx;
width: 44rpx;
height: 44rpx;
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}
.u-icon {
display: flex;
@include vue-flex;
align-items: center;
justify-content: center;
}

14
node_modules/uview-ui/components/u-waterfall/u-waterfall.vue

@ -38,11 +38,6 @@ export default {
default: 'id'
}
},
provide() {
return {
uWaterfall: this
}
},
data() {
return {
leftList: [],
@ -112,6 +107,7 @@ export default {
this.rightList = [];
//
this.$emit('input', []);
this.tempList = [];
},
// id
remove(id) {
@ -137,11 +133,11 @@ export default {
index = this.leftList.findIndex(val => val[this.idKey] == id);
if(index != -1) {
// index-1idkey
this.leftList[key] = value;
this.leftList[index][key] = value;
} else {
//
index = this.rightList.findIndex(val => val[this.idKey] == id);
if(index != -1) this.leftList[key] = value;
if(index != -1) this.rightList[index][key] = value;
}
// id
index = this.value.findIndex(val => val[this.idKey] == id);
@ -162,13 +158,13 @@ export default {
@import "../../libs/css/style.components.scss";
.u-waterfall {
display: flex;
@include vue-flex;
flex-direction: row;
align-items: flex-start;
}
.u-column {
display: flex;
@include vue-flex;
flex: 1;
flex-direction: column;
height: auto;

65
node_modules/uview-ui/iconfont.css

File diff suppressed because one or more lines are too long

16
node_modules/uview-ui/index.js

@ -60,6 +60,14 @@ import toast from './libs/function/toast.js'
import getParent from './libs/function/getParent.js'
// 获取整个父组件
import $parent from './libs/function/$parent.js'
// 获取sys()和os()工具方法
// 获取设备信息,挂载到$u的sys()(system的缩写)属性中,
// 同时把安卓和ios平台的名称"ios"和"android"挂到$u.os()中,方便取用
import {sys, os} from './libs/function/sys.js'
// 防抖方法
import debounce from './libs/function/debounce.js'
// 节流方法
import throttle from './libs/function/throttle.js'
// 配置信息
@ -76,6 +84,8 @@ const $u = {
colorGradient: colorGradient.colorGradient,
guid,
color,
sys,
os,
type2icon,
randomArray,
wranning,
@ -97,11 +107,13 @@ const $u = {
http,
toast,
config, // uView配置信息相关,比如版本号
zIndex
zIndex,
debounce,
throttle,
}
const install = Vue => {
Vue.mixin(mixin)
Vue.mixin(mixin)
if (Vue.prototype.openShare) {
Vue.mixin(mpShare);
}

4
node_modules/uview-ui/libs/config/config.js

@ -1,5 +1,5 @@
// 此版本发布于2020-07-13
let version = '1.5.1';
// 此版本发布于2020-09-03
let version = '1.6.6';
export default {
v: version,

1
node_modules/uview-ui/libs/config/zIndex.js

@ -4,6 +4,7 @@
* modal: 999
* navigate: 998
* tabbar: 998
* toast: 999
*/
export default {

9
node_modules/uview-ui/libs/css/common.scss

@ -12,8 +12,6 @@
/* #ifndef APP-NVUE */
image {
display: inline-block;
// 解决图片加载时可能会瞬间变形的问题
will-change: transform;
}
// 在weex也即nvue中所有元素默认为border-box
@ -47,7 +45,7 @@ text {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-direction: row!important;
align-items: center;
}
@ -171,3 +169,8 @@ text {
}
}
// 重置nvue的默认关于flex的样式
.u-reset-nvue {
flex-direction: row;
align-items: center;
}

8
node_modules/uview-ui/libs/css/style.components.scss

@ -1,3 +1,7 @@
.demo {
// 定义混入指令用于在非nvue环境下的flex定义因为nvue没有display属性会报错
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}

43
node_modules/uview-ui/libs/css/style.mp.scss

@ -1,5 +1,5 @@
/* start--微信小程序编译后页面有组件名的元素,特别处理--start */
/* #ifdef MP-WEIXIN */
/* #ifdef MP-WEIXIN || MP-QQ */
u-td, u-th {
flex: 1;
align-self: stretch;
@ -29,5 +29,44 @@ u-switch {
display: inline-flex;
align-items: center;
}
u-dropdown {
flex: 1;
}
/* #endif */
/* end-微信小程序编译后页面有组件名的元素,特别处理--end */
/* #ifdef MP-QQ || MP-TOUTIAO */
// 需要做这一切额外的兼容都是因为TX的无能
u-icon {
line-height: 0;
}
/* #endif */
/* end-微信小程序编译后页面有组件名的元素,特别处理--end */
/* start--头条小程序编译后页面有组件名的元素,特别处理--start */
// 由于头条小程序不支持直接组件名形式写样式目前只能在写组件的时候给组件加上对应的类名
/* #ifdef MP-TOUTIAO */
.u-td, .u-th, .u-tr {
flex: 1;
align-self: stretch;
}
.u-row, .u-col {
flex: 1;
align-self: stretch;
}
// 避免小程序线条组件因为父组件display: flex;而失效
.u-line {
flex: 1;
}
.u-dropdown {
flex: 1;
}
/* #endif */
/* end-头条小程序编译后页面有组件名的元素,特别处理--end */

26
node_modules/uview-ui/libs/css/style.vue.scss

@ -147,3 +147,29 @@ page {
background-color: #FFFFFF;
}
/* end--高斯模糊tabbar底部处理--end */
/* start--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--start */
/* #ifdef H5 */
uni-toast {
z-index: 10090;
}
uni-toast .uni-toast {
z-index: 10090;
}
/* #endif */
/* end--提升H5端uni.toast()的层级,避免被uView的modal等遮盖--end */
/* start--去除button的所有默认样式--start */
.u-reset-button {
padding: 0;
font-size: inherit;
line-height: inherit;
background-color: transparent;
color: inherit;
}
.u-reset-button::after {
border: none;
}
/* end--去除button的所有默认样式--end */

6
node_modules/uview-ui/libs/function/$parent.js

@ -1,11 +1,13 @@
// 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
// this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
export default function $parent(name, keys) {
// 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
// 值(默认为undefined),就是查找最顶层的$parent
export default function $parent(name = undefined) {
let parent = this.$parent;
// 通过while历遍,这里主要是为了H5需要多层解析的问题
while (parent) {
// 父组件
if (parent.$options.name !== name) {
if (parent.$options && parent.$options.name !== name) {
// 如果组件的name不相等,继续上一级寻找
parent = parent.$parent;
} else {

35
node_modules/uview-ui/libs/function/bem.js

@ -1,38 +1,5 @@
var array = require('./array.wxs');
var object = require('./object.wxs');
var PREFIX = 'van-';
function join(name, mods) {
name = PREFIX + name;
mods = mods.map(function(mod) {
return name + '--' + mod;
});
mods.unshift(name);
return mods.join(' ');
}
function traversing(mods, conf) {
if (!conf) {
return;
}
if (typeof conf === 'string' || typeof conf === 'number') {
mods.push(conf);
} else if (array.isArray(conf)) {
conf.forEach(function(item) {
traversing(mods, item);
});
} else if (typeof conf === 'object') {
object.keys(conf).forEach(function(key) {
conf[key] && mods.push(key);
});
}
}
function bem(name, conf) {
var mods = [];
traversing(mods, conf);
return join(name, mods);
}
module.exports.bem = bem;

70
node_modules/uview-ui/libs/function/test.js

@ -127,10 +127,18 @@ function rangeLength(value, param) {
}
/**
* 是否固定电话
*/
function landline(value) {
let reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
return reg.test(value);
}
/**
* 判断是否为空
*/
function empty(value){
switch (typeof value) {
function empty(value) {
switch (typeof value) {
case 'undefined':
return true;
case 'string':
@ -148,8 +156,53 @@ function empty(value){
return false;
}
return true;
}
return false;
}
return false;
}
/**
* 是否json字符串
*/
function jsonString(value) {
if (typeof value == 'string') {
try {
var obj = JSON.parse(value);
if (typeof obj == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
return false;
}
}
return false;
}
/**
* 是否数组
*/
function array(value) {
if (typeof Array.isArray === "function") {
return Array.isArray(value);
} else {
return Object.prototype.toString.call(value) === "[object Array]";
}
}
/**
* 是否对象
*/
function object(value) {
return Object.prototype.toString.call(value) === '[object Object]';
}
/**
* 是否短信验证码
*/
function code(value, len = 6) {
return new RegExp(`^\\d{${len}}$`).test(value);
}
@ -171,5 +224,10 @@ export default {
range,
rangeLength,
empty,
isEmpty: empty
}
isEmpty: empty,
jsonString,
landline,
object,
array,
code
}

23
node_modules/uview-ui/libs/function/timeFormat.js

@ -1,3 +1,26 @@
// padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
// 所以这里做一个兼容polyfill的兼容处理
if (!String.prototype.padStart) {
// 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
String.prototype.padStart = function(maxLength, fillString = ' ') {
if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
'fillString must be String')
let str = this
// 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
if (str.length >= maxLength) return String(str)
let fillLength = maxLength - str.length,
times = Math.ceil(fillLength / fillString.length)
while (times >>= 1) {
fillString += fillString
if (times === 1) {
fillString += fillString
}
}
return fillString.slice(0, fillLength) + str;
}
}
function timeFormat(timestamp = null, fmt = 'yyyy-mm-dd') {
// 其他更多是格式化有如下:
// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合

2
node_modules/uview-ui/libs/mixin/mixin.js

@ -8,6 +8,8 @@ module.exports = {
},
methods: {
// 查询节点信息
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
// 解决办法为在组件根部再套一个没有任何作用的view元素
$uGetRect(selector, all) {
return new Promise(resolve => {
uni.createSelectorQuery().

27
node_modules/uview-ui/libs/request/index.js

@ -12,13 +12,13 @@ class Request {
// 检查请求拦截
if (this.interceptor.request && typeof this.interceptor.request === 'function') {
let tmpConfig = {};
let interceptorReuest = this.interceptor.request(options);
if (interceptorReuest === false) {
return false;
let interceptorRequest = this.interceptor.request(options);
if (interceptorRequest === false) {
// 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
return new Promise(()=>{});
}
this.options = interceptorReuest;
this.options = interceptorRequest;
}
options.dataType = options.dataType || this.config.dataType;
options.responseType = options.responseType || this.config.responseType;
options.url = options.url || '';
@ -32,7 +32,7 @@ class Request {
uni.hideLoading();
// 清除定时器,如果请求回来了,就无需loading
clearTimeout(this.config.timer);
this.timer = null;
this.config.timer = null;
// 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
if(this.config.originalData) {
// 判断是否存在拦截器
@ -64,11 +64,11 @@ class Request {
}
} else {
// 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
if(response.errMsg) {
uni.showModal({
title: response.errMsg
});
}
// if(response.errMsg) {
// uni.showModal({
// title: response.errMsg
// });
// }
reject(response)
}
}
@ -92,6 +92,11 @@ class Request {
}
uni.request(options);
})
// .catch(res => {
// // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
// // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
// return new Promise(()=>{});
// })
}
constructor() {

12543
node_modules/uview-ui/libs/util/area.js

File diff suppressed because one or more lines are too long

3
node_modules/uview-ui/libs/util/async-validator.js

@ -866,9 +866,8 @@ function pattern$2(rule, value, callback, source, options) {
}
function date(rule, value, callback, source, options) {
// console.log('integer rule called %j', rule);
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value);
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {

1504
node_modules/uview-ui/libs/util/city.js

File diff suppressed because one or more lines are too long

140
node_modules/uview-ui/libs/util/province.js

@ -1,139 +1 @@
/* eslint-disable */
var provinceData = [{
"label": "北京市",
"value": "11"
},
{
"label": "天津市",
"value": "12"
},
{
"label": "河北省",
"value": "13"
},
{
"label": "山西省",
"value": "14"
},
{
"label": "内蒙古自治区",
"value": "15"
},
{
"label": "辽宁省",
"value": "21"
},
{
"label": "吉林省",
"value": "22"
},
{
"label": "黑龙江省",
"value": "23"
},
{
"label": "上海市",
"value": "31"
},
{
"label": "江苏省",
"value": "32"
},
{
"label": "浙江省",
"value": "33"
},
{
"label": "安徽省",
"value": "34"
},
{
"label": "福建省",
"value": "35"
},
{
"label": "江西省",
"value": "36"
},
{
"label": "山东省",
"value": "37"
},
{
"label": "河南省",
"value": "41"
},
{
"label": "湖北省",
"value": "42"
},
{
"label": "湖南省",
"value": "43"
},
{
"label": "广东省",
"value": "44"
},
{
"label": "广西壮族自治区",
"value": "45"
},
{
"label": "海南省",
"value": "46"
},
{
"label": "重庆市",
"value": "50"
},
{
"label": "四川省",
"value": "51"
},
{
"label": "贵州省",
"value": "52"
},
{
"label": "云南省",
"value": "53"
},
{
"label": "西藏自治区",
"value": "54"
},
{
"label": "陕西省",
"value": "61"
},
{
"label": "甘肃省",
"value": "62"
},
{
"label": "青海省",
"value": "63"
},
{
"label": "宁夏回族自治区",
"value": "64"
},
{
"label": "新疆维吾尔自治区",
"value": "65"
},
{
"label": "台湾",
"value": "66"
},
{
"label": "香港",
"value": "67"
},
{
"label": "澳门",
"value": "68"
}
]
export default provinceData;
var provinceData=[{"label":"北京市","value":"11"},{"label":"天津市","value":"12"},{"label":"河北省","value":"13"},{"label":"山西省","value":"14"},{"label":"内蒙古自治区","value":"15"},{"label":"辽宁省","value":"21"},{"label":"吉林省","value":"22"},{"label":"黑龙江省","value":"23"},{"label":"上海市","value":"31"},{"label":"江苏省","value":"32"},{"label":"浙江省","value":"33"},{"label":"安徽省","value":"34"},{"label":"福建省","value":"35"},{"label":"江西省","value":"36"},{"label":"山东省","value":"37"},{"label":"河南省","value":"41"},{"label":"湖北省","value":"42"},{"label":"湖南省","value":"43"},{"label":"广东省","value":"44"},{"label":"广西壮族自治区","value":"45"},{"label":"海南省","value":"46"},{"label":"重庆市","value":"50"},{"label":"四川省","value":"51"},{"label":"贵州省","value":"52"},{"label":"云南省","value":"53"},{"label":"西藏自治区","value":"54"},{"label":"陕西省","value":"61"},{"label":"甘肃省","value":"62"},{"label":"青海省","value":"63"},{"label":"宁夏回族自治区","value":"64"},{"label":"新疆维吾尔自治区","value":"65"},{"label":"台湾","value":"66"},{"label":"香港","value":"67"},{"label":"澳门","value":"68"}];export default provinceData;

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

Loading…
Cancel
Save