Browse Source

框架升级

lilei 4 years ago
parent
commit
06bd16fa21

+ 1 - 1
node_modules/uview-ui/components/u-back-top/u-back-top.vue

@@ -6,7 +6,7 @@
 		zIndex: uZIndex,
 		zIndex: uZIndex,
 		opacity: opacity
 		opacity: opacity
 	}, customStyle]">
 	}, customStyle]">
-		<view class="u-back-top__content" v-if="!$slots.default">
+		<view class="u-back-top__content" v-if="!$slots.default && !$slots.$default">
 			<u-icon @click="backToTop" :name="icon" :custom-style="iconStyle"></u-icon>
 			<u-icon @click="backToTop" :name="icon" :custom-style="iconStyle"></u-icon>
 			<view class="u-back-top__content__tips">
 			<view class="u-back-top__content__tips">
 				{{tips}}
 				{{tips}}

+ 1 - 1
node_modules/uview-ui/components/u-card/u-card.vue

@@ -74,7 +74,7 @@
 /**
 /**
  * card 卡片
  * card 卡片
  * @description 卡片组件一般用于多个列表条目,且风格统一的场景
  * @description 卡片组件一般用于多个列表条目,且风格统一的场景
- * @tutorial https://www.uviewui.com/components/line.html
+ * @tutorial https://www.uviewui.com/components/card.html
  * @property {Boolean} full 卡片与屏幕两侧是否留空隙(默认false)
  * @property {Boolean} full 卡片与屏幕两侧是否留空隙(默认false)
  * @property {String} title 头部左边的标题
  * @property {String} title 头部左边的标题
  * @property {String} title-color 标题颜色(默认#303133)
  * @property {String} title-color 标题颜色(默认#303133)

+ 13 - 1
node_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view class="u-dropdown-item" v-if="active" @touchmove.stop.prevent="() => {}" @tap.stop.prevent="() => {}">
 	<view class="u-dropdown-item" v-if="active" @touchmove.stop.prevent="() => {}" @tap.stop.prevent="() => {}">
-		<block v-if="!$slots.default">
+		<block v-if="!$slots.default && !$slots.$default">
 			<scroll-view scroll-y="true" :style="{
 			<scroll-view scroll-y="true" :style="{
 				height: $u.addUnit(height)
 				height: $u.addUnit(height)
 			}">
 			}">
@@ -21,6 +21,18 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	/**
+	 * dropdown-item 下拉菜单
+	 * @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
+	 * @tutorial http://uviewui.com/components/dropdown.html
+	 * @property {String | Number} v-model 双向绑定选项卡选择值
+	 * @property {String} title 菜单项标题
+	 * @property {Array[Object]} options 选项数据,如果传入了默认slot,此参数无效
+	 * @property {Boolean} disabled 是否禁用此选项卡(默认false)
+	 * @property {String | Number} duration 选项卡展开和收起的过渡时间,单位ms(默认300)
+	 * @property {String | Number} height 弹窗下拉内容的高度(内容超出将会滚动)(默认auto)
+	 * @example <u-dropdown-item title="标题"></u-dropdown-item>
+	 */
 	export default {
 	export default {
 		name: 'u-dropdown-item',
 		name: 'u-dropdown-item',
 		props: {
 		props: {

+ 47 - 2
node_modules/uview-ui/components/u-dropdown/u-dropdown.vue

@@ -21,7 +21,8 @@
 		</view>
 		</view>
 		<view class="u-dropdown__content" :style="[contentStyle, {
 		<view class="u-dropdown__content" :style="[contentStyle, {
 			transition: `opacity ${duration / 1000}s linear`,
 			transition: `opacity ${duration / 1000}s linear`,
-			top: $u.addUnit(height)
+			top: $u.addUnit(height),
+			height: contentHeight + 'px'
 		}]"
 		}]"
 		 @tap="maskClick" @touchmove.stop.prevent>
 		 @tap="maskClick" @touchmove.stop.prevent>
 			<view @tap.stop.prevent class="u-dropdown__content__popup" :style="[popupStyle]">
 			<view @tap.stop.prevent class="u-dropdown__content__popup" :style="[popupStyle]">
@@ -33,6 +34,23 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	/**
+	 * dropdown 下拉菜单
+	 * @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
+	 * @tutorial http://uviewui.com/components/dropdown.html
+	 * @property {String} active-color 标题和选项卡选中的颜色(默认#2979ff)
+	 * @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266)
+	 * @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true)
+	 * @property {Boolean} close-on-click-self 点击当前激活项标题是否关闭菜单(默认true)
+	 * @property {String | Number} duration 选项卡展开和收起的过渡时间,单位ms(默认300)
+	 * @property {String | Number} height 标题菜单的高度,单位任意(默认80)
+	 * @property {String | Number} border-radius 菜单展开内容下方的圆角值,单位任意(默认0)
+	 * @property {Boolean} border-bottom 标题菜单是否显示下边框(默认false)
+	 * @property {String | Number} title-size 标题的字体大小,单位任意,数值默认为rpx单位(默认28)
+	 * @event {Function} open 下拉菜单被打开时触发
+	 * @event {Function} close 下拉菜单被关闭时触发
+	 * @example <u-dropdown></u-dropdown>
+	 */
 	export default {
 	export default {
 		name: 'u-dropdown',
 		name: 'u-dropdown',
 		props: {
 		props: {
@@ -75,6 +93,11 @@
 			titleSize: {
 			titleSize: {
 				type: [Number, String],
 				type: [Number, String],
 				default: 28
 				default: 28
+			},
+			// 下拉出来的内容部分的圆角值
+			borderRadius: {
+				type: [Number, String],
+				default: 0
 			}
 			}
 		},
 		},
 		data() {
 		data() {
@@ -91,7 +114,8 @@
 					opacity: 0
 					opacity: 0
 				},
 				},
 				// 让某个菜单保持高亮的状态
 				// 让某个菜单保持高亮的状态
-				highlightIndex: 99999
+				highlightIndex: 99999,
+				contentHeight: 0
 			}
 			}
 		},
 		},
 		computed: {
 		computed: {
@@ -101,6 +125,7 @@
 				// 进行Y轴位移,展开状态时,恢复原位。收齐状态时,往上位移100%,进行隐藏
 				// 进行Y轴位移,展开状态时,恢复原位。收齐状态时,往上位移100%,进行隐藏
 				style.transform = `translateY(${this.active ? 0 : '-100%'})`
 				style.transform = `translateY(${this.active ? 0 : '-100%'})`
 				style['transition-duration'] = this.duration / 1000 + 's';
 				style['transition-duration'] = this.duration / 1000 + 's';
+				style.borderRadius = `0 0 ${this.$u.addUnit(this.borderRadius)} ${this.$u.addUnit(this.borderRadius)}`;
 				return style;
 				return style;
 			}
 			}
 		},
 		},
@@ -108,6 +133,9 @@
 			// 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错
 			// 引用所有子组件(u-dropdown-item)的this,不能在data中声明变量,否则在微信小程序会造成循环引用而报错
 			this.children = [];
 			this.children = [];
 		},
 		},
+		mounted() {
+			this.getContentHeight();
+		},
 		methods: {
 		methods: {
 			init() {
 			init() {
 				// 当某个子组件内容变化时,触发父组件的init,父组件再让每一个子组件重新初始化一遍
 				// 当某个子组件内容变化时,触发父组件的init,父组件再让每一个子组件重新初始化一遍
@@ -171,6 +199,20 @@
 			// 外部手动设置某个菜单高亮
 			// 外部手动设置某个菜单高亮
 			highlight(index = undefined) {
 			highlight(index = undefined) {
 				this.highlightIndex = index !== undefined ? index : 99999;
 				this.highlightIndex = index !== undefined ? index : 99999;
+			},
+			// 获取下拉菜单内容的高度
+			getContentHeight() {
+				// 这里的原理为,因为dropdown组件是相对定位的,它的下拉出来的内容,必须给定一个高度
+				// 才能让遮罩占满菜单一下,直到屏幕底部的高度
+				// this.$u.sys()为uView封装的获取设备信息的方法
+				let windowHeight = this.$u.sys().windowHeight;
+				this.$uGetRect('.u-dropdown__menu').then(res => {
+					// 这里获取的是dropdown的尺寸,在H5上,uniapp获取尺寸是有bug的(以前提出修复过,后来又出现了此bug,目前hx2.8.11版本)
+					// H5端bug表现为元素尺寸的top值为导航栏底部到到元素的上边沿的距离,但是元素的bottom值确是导航栏顶部到元素底部的距离
+					// 二者是互相矛盾的,本质原因是H5端导航栏非原生,uni的开发者大意造成
+					// 这里取菜单栏的botton值合理的,不能用res.top,否则页面会造成滚动
+					this.contentHeight = windowHeight - res.bottom;
+				})
 			}
 			}
 		}
 		}
 	}
 	}
@@ -182,6 +224,7 @@
 	.u-dropdown {
 	.u-dropdown {
 		flex: 1;
 		flex: 1;
 		width: 100%;
 		width: 100%;
+		position: relative;
 
 
 		&__menu {
 		&__menu {
 			@include vue-flex;
 			@include vue-flex;
@@ -220,6 +263,7 @@
 			left: 0px;
 			left: 0px;
 			bottom: 0;
 			bottom: 0;
 			overflow: hidden;
 			overflow: hidden;
+			
 
 
 			&__mask {
 			&__mask {
 				position: absolute;
 				position: absolute;
@@ -236,6 +280,7 @@
 				z-index: 10;
 				z-index: 10;
 				transition: all 0.3s;
 				transition: all 0.3s;
 				transform: translate3D(0, -100%, 0);
 				transform: translate3D(0, -100%, 0);
+				overflow: hidden;
 			}
 			}
 		}
 		}
 
 

+ 96 - 30
node_modules/uview-ui/components/u-icon/u-icon.vue

@@ -1,7 +1,12 @@
 <template>
 <template>
 	<view :style="[customStyle]" class="u-icon" @tap="click" :class="['u-icon--' + labelPos]">
 	<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>
 		<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-else class="u-icon__icon" :class="customClass" :style="[iconStyle]" :hover-class="hoverClass"
+			  @touchstart="touchstart">
+			<text v-if="showDecimalIcon" :style="[decimalIconStyle]" :class="decimalIconClass" :hover-class="hoverClass"
+				  class="u-icon__decimal">
+			</text>
+		</text>
 		<!-- 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 -->
 		<!-- 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 -->
 		<text v-if="label !== ''" class="u-icon__label" :style="{
 		<text v-if="label !== ''" class="u-icon__label" :style="{
 			color: labelColor,
 			color: labelColor,
@@ -10,7 +15,8 @@
 			marginTop: labelPos == 'bottom' ? $u.addUnit(marginTop) : 0,
 			marginTop: labelPos == 'bottom' ? $u.addUnit(marginTop) : 0,
 			marginRight: labelPos == 'left' ? $u.addUnit(marginRight) : 0,
 			marginRight: labelPos == 'left' ? $u.addUnit(marginRight) : 0,
 			marginBottom: labelPos == 'top' ? $u.addUnit(marginBottom) : 0,
 			marginBottom: labelPos == 'top' ? $u.addUnit(marginBottom) : 0,
-		}">{{label}}</text>
+		}">{{ label }}
+		</text>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -38,6 +44,11 @@
  * @property {String} width 显示图片小图标时的宽度
  * @property {String} width 显示图片小图标时的宽度
  * @property {String} height 显示图片小图标时的高度
  * @property {String} height 显示图片小图标时的高度
  * @property {String} top 图标在垂直方向上的定位
  * @property {String} top 图标在垂直方向上的定位
+ * @property {String} top 图标在垂直方向上的定位
+ * @property {String} top 图标在垂直方向上的定位
+ * @property {Boolean} show-decimal-icon 是否为DecimalIcon
+ * @property {String} inactive-color 背景颜色,可接受主题色,仅Decimal时有效
+ * @property {String | Number} percent 显示的百分比,仅Decimal时有效
  * @event {Function} click 点击图标时触发
  * @event {Function} click 点击图标时触发
  * @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
  * @example <u-icon name="photo" color="#2979ff" size="28"></u-icon>
  */
  */
@@ -145,71 +156,120 @@ export default {
 		top: {
 		top: {
 			type: [String, Number],
 			type: [String, Number],
 			default: 0
 			default: 0
+		},
+		// 是否为DecimalIcon
+		showDecimalIcon: {
+			type: Boolean,
+			default: false
+		},
+		// 背景颜色,可接受主题色,仅Decimal时有效
+		inactiveColor: {
+			type: String,
+			default: '#ececec'
+		},
+		// 显示的百分比,仅Decimal时有效
+		percent: {
+			type: [Number, String],
+			default: '50'
 		}
 		}
 	},
 	},
 	computed: {
 	computed: {
 		customClass() {
 		customClass() {
-			let classes = [];
-			classes.push(this.customPrefix + '-' + this.name);
+			let classes = []
+			classes.push(this.customPrefix + '-' + this.name)
 			// uView的自定义图标类名为u-iconfont
 			// uView的自定义图标类名为u-iconfont
-			if (this.customPrefix == 'uicon') classes.push('u-iconfont');
-			else classes.push(this.customPrefix);
+			if (this.customPrefix == 'uicon') {
+				classes.push('u-iconfont')
+			} else {
+				classes.push(this.customPrefix)
+			}
 			// 主题色,通过类配置
 			// 主题色,通过类配置
-			if (this.color && this.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color);
+			if (this.showDecimalIcon && this.inactiveColor && this.$u.config.type.includes(this.inactiveColor)) {
+				classes.push('u-icon__icon--' + this.inactiveColor)
+			} else if (this.color && this.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color)
 			// 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
 			// 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
 			// 故需将其拆成一个字符串的形式,通过空格隔开各个类名
 			// 故需将其拆成一个字符串的形式,通过空格隔开各个类名
 			//#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU
 			//#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU
-			classes = classes.join(' ');
+			classes = classes.join(' ')
 			//#endif
 			//#endif
-			return classes;
+			return classes
 		},
 		},
 		iconStyle() {
 		iconStyle() {
-			let style = {};
+			let style = {}
 			style = {
 			style = {
 				fontSize: this.size == 'inherit' ? 'inherit' : this.$u.addUnit(this.size),
 				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)
 				top: this.$u.addUnit(this.top)
-			};
+			}
 			// 非主题色值时,才当作颜色值
 			// 非主题色值时,才当作颜色值
-			if (this.color && !this.$u.config.type.includes(this.color)) style.color = this.color;
-			return style;
+			if (this.showDecimalIcon && this.inactiveColor && !this.$u.config.type.includes(this.inactiveColor)) {
+				style.color = this.inactiveColor
+			} else if (this.color && !this.$u.config.type.includes(this.color)) style.color = this.color
+
+			return style
 		},
 		},
 		// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
 		// 判断传入的name属性,是否图片路径,只要带有"/"均认为是图片形式
 		isImg() {
 		isImg() {
-			return this.name.indexOf('/') !== -1;
+			return this.name.indexOf('/') !== -1
 		},
 		},
 		imgStyle() {
 		imgStyle() {
-			let style = {};
+			let style = {}
 			// 如果设置width和height属性,则优先使用,否则使用size属性
 			// 如果设置width和height属性,则优先使用,否则使用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;
+			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
+		},
+		decimalIconStyle() {
+			let style = {}
+			style = {
+				fontSize: this.size == 'inherit' ? 'inherit' : this.$u.addUnit(this.size),
+				fontWeight: this.bold ? 'bold' : 'normal',
+				// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
+				top: this.$u.addUnit(this.top),
+				width: this.percent + '%'
+			}
+			// 非主题色值时,才当作颜色值
+			if (this.color && !this.$u.config.type.includes(this.color)) style.color = this.color
+			return style
+		},
+		decimalIconClass() {
+			let classes = []
+			classes.push(this.customPrefix + '-' + this.name)
+			// uView的自定义图标类名为u-iconfont
+			if (this.customPrefix == 'uicon') {
+				classes.push('u-iconfont')
+			} else {
+				classes.push(this.customPrefix)
+			}
+			// 主题色,通过类配置
+			if (this.color && this.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color)
+			else classes.push('u-icon__icon--primary')
+			// 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
+			// 故需将其拆成一个字符串的形式,通过空格隔开各个类名
+			//#ifdef MP-ALIPAY || MP-TOUTIAO || MP-BAIDU
+			classes = classes.join(' ')
+			//#endif
+			return classes
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
 		click() {
 		click() {
-			this.$emit('click', this.index);
+			this.$emit('click', this.index)
 		},
 		},
 		touchstart() {
 		touchstart() {
-			this.$emit('touchstart', this.index);
+			this.$emit('touchstart', this.index)
 		}
 		}
 	}
 	}
-};
+}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
 @import "../../libs/css/style.components.scss";
 @import "../../libs/css/style.components.scss";
-/* #ifndef APP-NVUE */
-// 目前由于nvue对定义字体时的content属性报错,所以nvue先不引入
 @import '../../iconfont.css';
 @import '../../iconfont.css';
-/* #endif */
 
 
 .u-icon {
 .u-icon {
-	/* #ifndef APP-NVUE */
 	display: inline-flex;
 	display: inline-flex;
-	/* #endif */
-	flex-direction: row;
 	align-items: center;
 	align-items: center;
 
 
 	&--left {
 	&--left {
@@ -234,7 +294,7 @@ export default {
 
 
 	&__icon {
 	&__icon {
 		position: relative;
 		position: relative;
-		
+
 		&--primary {
 		&--primary {
 			color: $u-type-primary;
 			color: $u-type-primary;
 		}
 		}
@@ -256,11 +316,17 @@ export default {
 		}
 		}
 	}
 	}
 
 
+	&__decimal {
+		position: absolute;
+		top: 0;
+		left: 0;
+		display: inline-block;
+		overflow: hidden;
+	}
+
 	&__img {
 	&__img {
-		/* #ifndef APP-PLUS */
 		height: auto;
 		height: auto;
 		will-change: transform;
 		will-change: transform;
-		/* #endif */
 	}
 	}
 
 
 	&__label {
 	&__label {

+ 1 - 1
node_modules/uview-ui/components/u-line-progress/u-line-progress.vue

@@ -9,7 +9,7 @@
 			striped ? 'u-striped' : '',
 			striped ? 'u-striped' : '',
 			striped && stripedActive ? 'u-striped-active' : ''
 			striped && stripedActive ? 'u-striped-active' : ''
 		]" class="u-active" :style="[progressStyle]">
 		]" class="u-active" :style="[progressStyle]">
-			<slot v-if="$slots.default" />
+			<slot v-if="$slots.default || $slots.$default" />
 			<block v-else-if="showPercent">
 			<block v-else-if="showPercent">
 				{{percent + '%'}}
 				{{percent + '%'}}
 			</block>
 			</block>

+ 1 - 1
node_modules/uview-ui/components/u-message-input/u-message-input.vue

@@ -100,7 +100,7 @@
 			// 激活样式
 			// 激活样式
 			activeColor: {
 			activeColor: {
 				type: String,
 				type: String,
-				default: 'red'
+				default: '#2979ff'
 			},
 			},
 			// 未激活的样式
 			// 未激活的样式
 			inactiveColor: {
 			inactiveColor: {

+ 1 - 1
node_modules/uview-ui/components/u-modal/u-modal.vue

@@ -5,7 +5,7 @@
 			<view class="u-model">
 			<view class="u-model">
 				<view v-if="showTitle" class="u-model__title u-line-1" :style="[titleStyle]">{{ title }}</view>
 				<view v-if="showTitle" class="u-model__title u-line-1" :style="[titleStyle]">{{ title }}</view>
 				<view class="u-model__content">
 				<view class="u-model__content">
-					<view :style="[contentStyle]" v-if="$slots.default">
+					<view :style="[contentStyle]" v-if="$slots.default  || $slots.$default">
 						<slot />
 						<slot />
 					</view>
 					</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>

+ 5 - 5
node_modules/uview-ui/components/u-number-box/u-number-box.vue

@@ -181,7 +181,7 @@
 				inputVal: 1, // 输入框中的值,不能直接使用props中的value,因为应该改变props的状态
 				inputVal: 1, // 输入框中的值,不能直接使用props中的value,因为应该改变props的状态
 				timer: null, // 用作长按的定时器
 				timer: null, // 用作长按的定时器
 				changeFromInner: false, // 值发生变化,是来自内部还是外部
 				changeFromInner: false, // 值发生变化,是来自内部还是外部
-				timer: null, // 内部定时器
+				innerChangeTimer: null, // 内部定时器
 			};
 			};
 		},
 		},
 		created() {
 		created() {
@@ -291,15 +291,15 @@
 			handleChange(value, type) {
 			handleChange(value, type) {
 				if (this.disabled) return;
 				if (this.disabled) return;
 				// 清除定时器,避免造成混乱
 				// 清除定时器,避免造成混乱
-				if(this.timer) {
-					clearTimeout(this.timer);
-					this.timer = null;
+				if(this.innerChangeTimer) {
+					clearTimeout(this.innerChangeTimer);
+					this.innerChangeTimer = null;
 				}
 				}
 				// 发出input事件,修改通过v-model绑定的值,达到双向绑定的效果
 				// 发出input事件,修改通过v-model绑定的值,达到双向绑定的效果
 				this.changeFromInner = true;
 				this.changeFromInner = true;
 				// 一定时间内,清除changeFromInner标记,否则内部值改变后
 				// 一定时间内,清除changeFromInner标记,否则内部值改变后
 				// 外部通过程序修改value值,将会无效
 				// 外部通过程序修改value值,将会无效
-				setTimeout(() => {
+				this.innerChangeTimer = setTimeout(() => {
 					this.changeFromInner = false;
 					this.changeFromInner = false;
 				}, 150);
 				}, 150);
 				this.$emit('input', Number(value));
 				this.$emit('input', Number(value));

+ 94 - 35
node_modules/uview-ui/components/u-rate/u-rate.vue

@@ -2,20 +2,23 @@
 	<view class="u-rate" :id="elId" @touchmove.stop.prevent="touchMove">
 	<view class="u-rate" :id="elId" @touchmove.stop.prevent="touchMove">
 		<view class="u-star-wrap" v-for="(item, index) in count" :key="index" :class="[elClass]">
 		<view class="u-star-wrap" v-for="(item, index) in count" :key="index" :class="[elClass]">
 			<u-icon
 			<u-icon
-				:name="activeIndex > index ? activeIcon : inactiveIcon"
+				:name="activeIndex > index ? elActiveIcon : inactiveIcon"
 				@click="click(index + 1, $event)"
 				@click="click(index + 1, $event)"
-				:color="activeIndex > index ? activeColor : inactiveColor"
+				:color="activeIndex > index ? elActiveColor : inactiveColor"
 				:custom-style="{
 				:custom-style="{
 					fontSize: size + 'rpx',
 					fontSize: size + 'rpx',
 					padding: `0 ${gutter / 2 + 'rpx'}`
 					padding: `0 ${gutter / 2 + 'rpx'}`
 				}"
 				}"
+				:custom-prefix="customPrefix"
+				:show-decimal-icon="showDecimalIcon(index)"
+				:percent="decimal"
+				:inactiveColor="inactiveColor"
 			></u-icon>
 			></u-icon>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
-<script>
-/**
+<script>/**
  * rate 评分
  * rate 评分
  * @description 该组件一般用于满意度调查,星型评分的场景
  * @description 该组件一般用于满意度调查,星型评分的场景
  * @tutorial https://www.uviewui.com/components/rate.html
  * @tutorial https://www.uviewui.com/components/rate.html
@@ -33,6 +36,7 @@
  * @event {Function} change 选中的星星发生变化时触发
  * @event {Function} change 选中的星星发生变化时触发
  * @example <u-rate :count="count" :current="2"></u-rate>
  * @example <u-rate :count="count" :current="2"></u-rate>
  */
  */
+
 export default {
 export default {
 	name: 'u-rate',
 	name: 'u-rate',
 	props: {
 	props: {
@@ -97,6 +101,23 @@ export default {
 		inactiveIcon: {
 		inactiveIcon: {
 			type: String,
 			type: String,
 			default: 'star'
 			default: 'star'
+		},
+		// 自定义扩展前缀,方便用户扩展自己的图标库
+		customPrefix: {
+			type: String,
+			default: 'uicon'
+		},
+		colors: {
+			type: Array,
+			default() {
+				return []
+			}
+		},
+		icons: {
+			type: Array,
+			default() {
+				return []
+			}
 		}
 		}
 	},
 	},
 	data() {
 	data() {
@@ -109,94 +130,132 @@ export default {
 			activeIndex: this.value != -1 ? this.value : this.current,
 			activeIndex: this.value != -1 ? this.value : this.current,
 			starWidth: 0, // 每个星星的宽度
 			starWidth: 0, // 每个星星的宽度
 			starWidthArr: [] //每个星星最右边到组件盒子最左边的距离
 			starWidthArr: [] //每个星星最右边到组件盒子最左边的距离
-		};
+		}
 	},
 	},
 	watch: {
 	watch: {
 		current(val) {
 		current(val) {
-			this.activeIndex = val;
+			this.activeIndex = val
 		},
 		},
 		value(val) {
 		value(val) {
-			this.activeIndex = val;
+			this.activeIndex = val
+		}
+	},
+	computed: {
+		decimal() {
+			if (this.disabled) {
+				return this.activeIndex * 100 % 100
+			} else if (this.allowHalf) {
+				return 50
+			}
+		},
+		elActiveIcon() {
+			const len = this.icons.length
+			// 此处规则类似于下方的elActiveColor参数,都是根据一定的规则,显示不同的图标
+			// 结果可能如此:icons参数传递了3个图标,当选中两个时,用第一个图标,4个时,用第二个图标
+			// 第三个时,用第三个图标作为激活的图标
+			if (len && len <= this.count) {
+				const step = Math.round(this.activeIndex / Math.round(this.count / len))
+				if (step < 1) return this.icons[0]
+				if (step > len) return this.icons[len - 1]
+				return this.icons[step - 1]
+			}
+			return this.activeIcon
+		},
+		elActiveColor() {
+			const len = this.colors.length
+			// 如果有设置colors参数(此参数用于将图标分段,比如一共5颗星,colors传3个颜色值,那么根据一定的规则,2颗星可能为第一个颜色
+			// 4颗星为第二个颜色值,5颗星为第三个颜色值)
+			if (len && len <= this.count) {
+				const step = Math.round(this.activeIndex / Math.round(this.count / len))
+				if (step < 1) return this.colors[0]
+				if (step > len) return this.colors[len - 1]
+				return this.colors[step - 1]
+			}
+			return this.activeColor
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
 		// 获取评分组件盒子的布局信息
 		// 获取评分组件盒子的布局信息
 		getElRectById() {
 		getElRectById() {
 			// uView封装的获取节点的方法,详见文档
 			// uView封装的获取节点的方法,详见文档
-			this.$uGetRect('#' + this.elId).then(res => {
-				this.starBoxLeft = res.left;
+			this.$u.getRect('#' + this.elId).then(res => {
+				this.starBoxLeft = res.left
 			})
 			})
 		},
 		},
 		// 获取单个星星的尺寸
 		// 获取单个星星的尺寸
 		getElRectByClass() {
 		getElRectByClass() {
 			// uView封装的获取节点的方法,详见文档
 			// uView封装的获取节点的方法,详见文档
-			this.$uGetRect('.' + this.elClass).then(res => {
-				this.starWidth = res.width;
+			this.$u.getRect('.' + this.elClass).then(res => {
+				this.starWidth = res.width
 				// 把每个星星右边到组件盒子左边的距离放入数组中
 				// 把每个星星右边到组件盒子左边的距离放入数组中
 				for (let i = 0; i < this.count; i++) {
 				for (let i = 0; i < this.count; i++) {
-					this.starWidthArr[i] = (i + 1) * this.starWidth;
+					this.starWidthArr[i] = (i + 1) * this.starWidth
 				}
 				}
 			})
 			})
 		},
 		},
 		// 手指滑动
 		// 手指滑动
 		touchMove(e) {
 		touchMove(e) {
 			if (this.disabled) {
 			if (this.disabled) {
-				return;
+				return
 			}
 			}
 			if (!e.changedTouches[0]) {
 			if (!e.changedTouches[0]) {
-				return;
+				return
 			}
 			}
-			const movePageX = e.changedTouches[0].pageX;
+			const movePageX = e.changedTouches[0].pageX
 			// 滑动点相对于评分盒子左边的距离
 			// 滑动点相对于评分盒子左边的距离
-			const distance = movePageX - this.starBoxLeft;
+			const distance = movePageX - this.starBoxLeft
 
 
 			// 如果滑动到了评分盒子的左边界,就设置为0星
 			// 如果滑动到了评分盒子的左边界,就设置为0星
 			if (distance <= 0) {
 			if (distance <= 0) {
-				this.activeIndex = 0;
+				this.activeIndex = 0
 			}
 			}
 			// 滑动的距离,相当于多少颗星星
 			// 滑动的距离,相当于多少颗星星
-			let index = Math.ceil(distance / this.starWidth);
-			this.activeIndex = index > this.count ? this.count : index;
+			let index = Math.ceil(distance / this.starWidth)
+			this.activeIndex = index > this.count ? this.count : index
 			// 对最少颗星星的限制
 			// 对最少颗星星的限制
-			if (this.activeIndex < this.minCount) this.activeIndex = this.minCount;
-			this.emitEvent();
+			if (this.activeIndex < this.minCount) this.activeIndex = this.minCount
+			this.emitEvent()
 		},
 		},
 		// 通过点击,直接选中
 		// 通过点击,直接选中
 		click(index, e) {
 		click(index, e) {
 			if (this.disabled) {
 			if (this.disabled) {
-				return;
+				return
 			}
 			}
 			// 半星选择,尚未实现
 			// 半星选择,尚未实现
 			if (this.allowHalf) {
 			if (this.allowHalf) {
 			}
 			}
 			// 对第一个星星特殊处理,只有一个的时候,点击可以取消,否则无法作0星评价
 			// 对第一个星星特殊处理,只有一个的时候,点击可以取消,否则无法作0星评价
 			if (index == 1) {
 			if (index == 1) {
-				if (this.activeIndex == 1) this.activeIndex = 0;
-				else this.activeIndex = 1;
+				if (this.activeIndex == 1) {
+					this.activeIndex = 0
+				} else {
+					this.activeIndex = 1
+				}
 			} else {
 			} else {
-				this.activeIndex = index;
+				this.activeIndex = index
 			}
 			}
 			// 对最少颗星星的限制
 			// 对最少颗星星的限制
-			if (this.activeIndex < this.minCount) this.activeIndex = this.minCount;
-			this.emitEvent();
+			if (this.activeIndex < this.minCount) this.activeIndex = this.minCount
+			this.emitEvent()
 		},
 		},
 		// 发出事件
 		// 发出事件
 		emitEvent() {
 		emitEvent() {
 			// 发出change事件
 			// 发出change事件
-			this.$emit('change', this.activeIndex);
+			this.$emit('change', this.activeIndex)
 			// 同时修改双向绑定的value的值
 			// 同时修改双向绑定的value的值
-			if(this.value != -1) {
-				this.$emit('input', this.activeIndex);
+			if (this.value != -1) {
+				this.$emit('input', this.activeIndex)
 			}
 			}
+		},
+		showDecimalIcon(index) {
+			return this.disabled && parseInt(this.activeIndex) === index
 		}
 		}
 	},
 	},
 	mounted() {
 	mounted() {
-		setTimeout(() => {
-			this.getElRectById();
-			this.getElRectByClass();
-		}, 100)
+		this.getElRectById()
+		this.getElRectByClass()
 	}
 	}
-};
+}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">

+ 1 - 1
node_modules/uview-ui/components/u-slider/u-slider.vue

@@ -15,7 +15,7 @@
 			<view class="u-slider__button-wrap" @touchstart="onTouchStart" 
 			<view class="u-slider__button-wrap" @touchstart="onTouchStart" 
 				@touchmove="onTouchMove" @touchend="onTouchEnd" 
 				@touchmove="onTouchMove" @touchend="onTouchEnd" 
 				@touchcancel="onTouchEnd">
 				@touchcancel="onTouchEnd">
-				<slot v-if="$slots.default"/>
+				<slot v-if="$slots.default  || $slots.$default"/>
 				<view v-else class="u-slider__button" :style="[blockStyle, {
 				<view v-else class="u-slider__button" :style="[blockStyle, {
 					height: blockWidth + 'rpx',
 					height: blockWidth + 'rpx',
 					width: blockWidth + 'rpx',
 					width: blockWidth + 'rpx',

+ 2 - 2
node_modules/uview-ui/components/u-tabbar/u-tabbar.vue

@@ -120,9 +120,9 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
-				// 由于安卓太菜了,通过css居中凸起按钮的外层元素有误差,故通过js计算将其
+				// 由于安卓太菜了,通过css居中凸起按钮的外层元素有误差,故通过js计算将其
 				midButtonLeft: '50%',
 				midButtonLeft: '50%',
-				pageUrl: '', // 当前
+				pageUrl: '', // 当前页面URL
 			}
 			}
 		},
 		},
 		created() {
 		created() {

+ 2 - 2
node_modules/uview-ui/libs/config/config.js

@@ -1,5 +1,5 @@
-// 此版本发布于2020-09-17
-let version = '1.7.1';
+// 此版本发布于2020-09-22
+let version = '1.7.3';
 
 
 export default {
 export default {
 	v: version,
 	v: version,

+ 5 - 0
node_modules/uview-ui/libs/mixin/mpShare.js

@@ -9,5 +9,10 @@ module.exports = {
 	},
 	},
 	onShareAppMessage() {
 	onShareAppMessage() {
 		return this.$u.mpShare
 		return this.$u.mpShare
+	},
+	// #ifdef MP-WEIXIN
+	onShareTimeline() {
+		return this.$u.mpShare
 	}
 	}
+	// #endif
 }
 }

+ 10 - 10
node_modules/uview-ui/package.json

@@ -1,27 +1,27 @@
 {
 {
-  "_from": "uview-ui@1.7.1",
-  "_id": "uview-ui@1.7.1",
+  "_from": "uview-ui@1.7.3",
+  "_id": "uview-ui@1.7.3",
   "_inBundle": false,
   "_inBundle": false,
-  "_integrity": "sha512-e2s7F7omTHxzdrE8kPtiaEof5LC4ADeY4m6i6ROqLoA0VCEqC2Y4SNGXZKW3y9D04z2EKX239w1l3H1jtdLTow==",
+  "_integrity": "sha512-s2B2hN7Q5c/XbZya5ZIi5wPJikvgfcGsXkv/s91jr3pmrsAJD6bmJqunHPX6nTYjbivYa7H/xCEnG9qn+DPaHQ==",
   "_location": "/uview-ui",
   "_location": "/uview-ui",
   "_phantomChildren": {},
   "_phantomChildren": {},
   "_requested": {
   "_requested": {
     "type": "version",
     "type": "version",
     "registry": true,
     "registry": true,
-    "raw": "uview-ui@1.7.1",
+    "raw": "uview-ui@1.7.3",
     "name": "uview-ui",
     "name": "uview-ui",
     "escapedName": "uview-ui",
     "escapedName": "uview-ui",
-    "rawSpec": "1.7.1",
+    "rawSpec": "1.7.3",
     "saveSpec": null,
     "saveSpec": null,
-    "fetchSpec": "1.7.1"
+    "fetchSpec": "1.7.3"
   },
   },
   "_requiredBy": [
   "_requiredBy": [
     "#USER",
     "#USER",
     "/"
     "/"
   ],
   ],
-  "_resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.7.1.tgz",
-  "_shasum": "e800b7384d7ea7b79aa9434326497e0098798d55",
-  "_spec": "uview-ui@1.7.1",
+  "_resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.7.3.tgz",
+  "_shasum": "248d29891b94a5430fc9c05463587c4470fac352",
+  "_spec": "uview-ui@1.7.3",
   "_where": "D:\\workSpace\\storeCheck-app",
   "_where": "D:\\workSpace\\storeCheck-app",
   "author": {
   "author": {
     "name": "uView"
     "name": "uView"
@@ -63,5 +63,5 @@
   "scripts": {
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
     "test": "echo \"Error: no test specified\" && exit 1"
   },
   },
-  "version": "1.7.1"
+  "version": "1.7.3"
 }
 }