lilei 2 yıl önce
ebeveyn
işleme
858f99b749

+ 7 - 7
pages/digitalShelf/choosePart.vue

@@ -60,11 +60,11 @@
 												<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
 													<u-icon name="plus" color="#fff" size="28"></u-icon>
 												</u-button>
-												<u-number-box v-else @change="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
+												<u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
 											</view>
 											<view class="item-detail-text" v-if="item.affiliation=='SUPER_CATALOGUE'||!item.currentInven">
 												<text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要临配</text>
-												<u-number-box v-else @change="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
+												<u-number-box v-else @change="updateVinNums" @blur="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
 											</view>
 										</view>
 									</view>
@@ -109,11 +109,11 @@
 											<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx',background:'#066cff'}" type="primary" size="mini">
 												<u-icon name="plus" color="#fff" size="28"></u-icon>
 											</u-button>
-											<u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
+											<u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
 										</view>
 										<view class="item-detail-text" v-else>
 											<text @click="addPart(item)" v-if="!item.checked" class="phtxt">我要临配</text>
-											<u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
+											<u-number-box v-else @change="updateNums" @blur="updateNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
 										</view>
 									</view>
 								</view>
@@ -173,7 +173,7 @@
 											<text class="item-price" v-if="item.affiliation!='SUPER_CATALOGUE'">¥{{item.price||0}}</text>
 										</view>
 										<view class="item-detail-text">
-											<u-number-box @change="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
+											<u-number-box @change="updateCartNums" @blur="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
 										</view>
 									</view>
 								</view>
@@ -400,7 +400,7 @@
 				const prow = this[type].find(item => item.productSn == data.index)
 				const index = this.partListData.findIndex(item => item.productSn == data.index)
 				// 删除
-				if(data.value == 0){
+				if(!data.value){
 					prow.checked = false
 					if(index>=0){
 						this.partListData.splice(index,1)
@@ -424,7 +424,7 @@
 			// 点击购物车修改数量
 			updateCartNums(data){
 				console.log(data)
-				if(data.value == 0){
+				if(!data.value){
 					const index = this.partListData.findIndex(item => 'cart_'+item.productSn == data.index)
 					if(index>=0){
 						this.partListData.splice(index,1)

+ 0 - 13
uni_modules/xt-verify-code/changelog.md

@@ -1,13 +0,0 @@
-## 1.0.4(2021-12-27)
-## 修改文档
-## 1.0.3(2021-10-18)
-修改说明文档
-## 1.0.2(2021-10-18)
-修改size 传入值,可以传入1~6 的值
-
-## 1.0.1(2021-09-02)
-- type 属性参数修改 box、middle、bottom 三种
-- 新增middle模式
-## 1.0.0(2021-08-31)
-- 验证码输入
-- 提供两种显示模式

+ 0 - 293
uni_modules/xt-verify-code/components/xt-verify-code/xt-verify-code.vue

@@ -1,293 +0,0 @@
-<template>
-	<view class="xt__verify-code">
-		<!-- 输入框 -->
-		<input
-			id="xt__input"
-			:value="code"
-			class="xt__input"
-			:focus="isFocus"
-			:password="isPassword"
-			:type="inputType"
-			:maxlength="itemSize"
-			@input="input"
-			@focus="inputFocus"
-			@blur="inputBlur"
-		/>
-
-		<!-- 光标 -->
-		<view
-			id="xt__cursor"
-			v-if="cursorVisible && type !== 'middle'"
-			class="xt__cursor"
-			:style="{ left: codeCursorLeft[code.length] + 'px', height: cursorHeight + 'px', backgroundColor: cursorColor }"
-		></view>
-
-		<!-- 输入框 - 组 -->
-		<view id="xt__input-ground" class="xt__input-ground">
-			<template v-for="(item, index) in itemSize">
-				<view
-					:key="index"
-					:style="{ borderColor: code.length === index && cursorVisible ? boxActiveColor : boxNormalColor }"
-					:class="['xt__box', `xt__box-${type + ''}`, `xt__box::after`]"
-				>
-					<view :style="{ borderColor: boxActiveColor }" class="xt__middle-line" v-if="type === 'middle' && !code[index]"></view>
-					<text class="xt__code-text">{{ code[index] | codeFormat(isPassword) }}</text>
-				</view>
-			</template>
-		</view>
-	</view>
-</template>
-<script>
-/**
- * @description 输入验证码组件
- * @property {string} type = [box|middle|bottom] - 显示类型 默认:box -eg:bottom
- * @property {string} inputType = [text|number] - 输入框类型 默认:number -eg:number
- * @property {number} size = [1|2|3|4|5|6] - 支持的验证码数量 默认:6 -eg:6
- * @property {boolean} isFocus - 是否立即聚焦 默认:true
- * @property {boolean} isPassword - 是否以密码形式显示 默认false -eg:false
- * @property {string} cursorColor - 光标颜色 默认:#cccccc
- * @property {string} boxNormalColor - 光标未聚焦到的框的颜色 默认:#cccccc
- * @property {string} boxActiveColor - 光标聚焦到的框的颜色 默认:#000000
- * @event {Function(data)} confirm - 输入完成
- */
-export default {
-	name: 'xt-verify-code',
-	props: {
-		value: {
-			type: String,
-			default: () => ''
-		},
-		type: {
-			type: String,
-			default: () => 'box'
-		},
-		inputType: {
-			type: String,
-			default: () => 'number'
-		},
-		size: {
-			type: Number,
-			default: () => 6
-		},
-		isFocus: {
-			type: Boolean,
-			default: () => true
-		},
-		isPassword: {
-			type: Boolean,
-			default: () => false
-		},
-		cursorColor: {
-			type: String,
-			default: () => '#cccccc'
-		},
-		boxNormalColor: {
-			type: String,
-			default: () => '#cccccc'
-		},
-		boxActiveColor: {
-			type: String,
-			default: () => '#000000'
-		}
-	},
-	model: {
-		prop: 'value',
-		event: 'input'
-	},
-	data() {
-		return {
-			cursorVisible: false,
-			cursorHeight: 35,
-			code: '', // 输入的验证码
-			codeCursorLeft: [], // 向左移动的距离数组,
-			itemSize: 6
-		};
-	},
-	created() {
-		this.cursorVisible = this.isFocus;
-		this.itemSize = this.size
-		// this.validatorSize();
-	},
-	mounted() {
-		this.init();
-	},
-	methods: {
-		/**
-		 *
-		 */
-		validatorSize() {
-			if (this.size <= 6 && this.size > 0) {
-				this.itemSize = Math.floor(this.size);
-			} else {
-				this.itemSize = 6;
-			}
-		},
-		/**
-		 * @description 初始化
-		 */
-		init() {
-			this.getCodeCursorLeft();
-			this.setCursorHeight();
-		},
-		/**
-		 * @description 获取元素节点
-		 * @param {string} elm - 节点的id、class 相当于 document.querySelect的参数 -eg: #id
-		 * @param {string} type = [single|array] - 单个元素获取多个元素 默认是单个元素
-		 * @param {Function} callback - 回调函数
-		 */
-		getElement(elm, type = 'single', callback) {
-			uni
-				.createSelectorQuery()
-				.in(this)
-				[type === 'array' ? 'selectAll' : 'select'](elm)
-				.boundingClientRect()
-				.exec(data => {
-					callback(data[0]);
-				});
-		},
-		/**
-		 * @description 计算光标的高度
-		 */
-		setCursorHeight() {
-			this.getElement('.xt__box', 'single', boxElm => {
-				this.cursorHeight = boxElm.height * 0.6;
-			});
-		},
-		/**
-		 * @description 获取光标在每一个box的left位置
-		 */
-		getCodeCursorLeft() {
-			// 获取父级框的位置信息
-			this.getElement('#xt__input-ground', 'single', parentElm => {
-				const parentLeft = parentElm.left;
-				// 获取各个box信息
-				this.getElement('.xt__box', 'array', elms => {
-					this.codeCursorLeft = [];
-					elms.forEach(elm => {
-						this.codeCursorLeft.push(elm.left - parentLeft + elm.width / 2);
-					});
-				});
-			});
-		},
-
-		// 输入框输入变化的回调
-		input(e) {
-			const value = e.detail.value;
-			this.cursorVisible = value.length !== this.itemSize;
-			this.$emit('input', value);
-			this.inputSuccess(value);
-		},
-
-		// 输入完成回调
-		inputSuccess(value) {
-			if (value.length === this.itemSize) {
-				this.$emit('confirm', value);
-			}
-		},
-		// 输入聚焦
-		inputFocus() {
-			this.cursorVisible = this.code.length !== this.itemSize;
-		},
-		// 输入失去焦点
-		inputBlur() {
-			this.cursorVisible = false;
-		}
-	},
-	watch: {
-		value(val) {
-			this.code = val;
-		}
-	},
-	filters: {
-		codeFormat(val, isPassword) {
-			let value = '';
-			if (val) {
-				value = isPassword ? '*' : val;
-			}
-			return value;
-		}
-	}
-};
-</script>
-<style lang="scss" scoped>
-
-.xt__verify-code {
-	position: relative;
-	width: 100%;
-	box-sizing: border-box;
-	padding: 50rpx 20rpx;
-	.xt__input {
-		height: 100%;
-		width: 200%;
-		position: absolute;
-		left: -100%;
-		z-index: 1;
-	}
-	.xt__cursor {
-		position: absolute;
-		top: 50%;
-		transform: translateY(-50%);
-		display: inline-block;
-		width: 2px;
-		animation-name: cursor;
-		animation-duration: 0.8s;
-		animation-iteration-count: infinite;
-	}
-
-	.xt__input-ground {
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		width: 100%;
-		box-sizing: border-box;
-		.xt__box {
-			position: relative;
-			display: inline-block;
-			width: 40rpx;
-			height: 80rpx;
-			&-bottom {
-				border-bottom-width: 2rpx;
-				border-bottom-style: solid;
-			}
-
-			&-box {
-				border-width: 2rpx;
-				border-style: solid;
-				border-radius: 6rpx;
-			}
-
-			&-middle {
-				border: none;
-			}
-
-			.xt__middle-line {
-				position: absolute;
-				top: 50%;
-				left: 50%;
-				width: 50%;
-				transform: translate(-50%, -50%);
-				border-bottom-width: 2px;
-				border-bottom-style: solid;
-			}
-
-			.xt__code-text {
-				position: absolute;
-				top: 50%;
-				left: 50%;
-				font-size: 40rpx;
-				transform: translate(-50%, -50%);
-			}
-		}
-	}
-}
-
-@keyframes cursor {
-	0% {
-		opacity: 1;
-	}
-
-	100% {
-		opacity: 0;
-	}
-}
-</style>

+ 0 - 82
uni_modules/xt-verify-code/package.json

@@ -1,82 +0,0 @@
-{
-	"id": "xt-verify-code",
-	"displayName": "xt-verify-code验证码输入",
-	"version": "1.0.4",
-	"description": "xt-verify-code验证码输入组件,提供三种显示模式",
-	"keywords": [
-        "xt-verify-code",
-        "verify",
-        "验证码"
-    ],
-	"repository": "https://github.com/xiaodaweb/xt-ui/tree/main/uni_modules/xt-verify-code",
-	"engines": {
-		"HBuilderX": "^3.1.0"
-	},
-	"dcloudext": {
-		"category": [
-			"前端组件",
-			"通用组件"
-		],
-		"sale": {
-			"regular": {
-				"price": "0.00"
-			},
-			"sourcecode": {
-				"price": "0.00"
-			}
-		},
-		"contact": {
-			"qq": "1010161292"
-		},
-		"declaration": {
-			"ads": "无",
-			"data": "无",
-			"permissions": "无"
-		},
-		"npmurl": ""
-	},
-	"uni_modules": {
-		"dependencies": [],
-		"encrypt": [],
-		"platforms": {
-			"cloud": {
-				"tcb": "y",
-				"aliyun": "y"
-			},
-			"client": {
-				"Vue": {
-					"vue2": "y",
-					"vue3": "u"
-				},
-				"App": {
-					"app-vue": "u",
-					"app-nvue": "u"
-				},
-				"H5-mobile": {
-					"Safari": "u",
-					"Android Browser": "y",
-					"微信浏览器(Android)": "y",
-					"QQ浏览器(Android)": "y"
-				},
-				"H5-pc": {
-					"Chrome": "y",
-					"IE": "u",
-					"Edge": "y",
-					"Firefox": "y",
-					"Safari": "y"
-				},
-				"小程序": {
-					"微信": "y",
-					"阿里": "y",
-					"百度": "y",
-					"字节跳动": "y",
-					"QQ": "y"
-				},
-				"快应用": {
-					"华为": "u",
-					"联盟": "u"
-				}
-			}
-		}
-	}
-}

+ 0 - 20
uni_modules/xt-verify-code/readme.md

@@ -1,20 +0,0 @@
-# 验证码输入框
-## 使用方法
-```vue
-<xt-verify-code v-model="verifyCode" @confirm="confirm"></xt-verify-code>
-```
-## 插件使用了scss,安装本插件之前,请选择安装scss
-
-### 参数
-|属性						|类型		|说明																								|默认值	|
-|--							|--			|--																									|--			|
-|value(v-model)	|string	|值(可双向绑定)																			|''			|
-|type						|string	|验证输入框类型可选值: box、middle、bottom					|box		|
-|inputType			|string	|输入类型 可选值:text、number											|number	|
-|size						|number	|验证码长度 可选值: 1、2、3、4、5、6								|6			|
-|isFocus				|boolean|是否一开始聚焦																			|true		|
-|isPassword			|boolean|是否使用密码方式显示																|false	|
-|cursorColor		|string	|光标颜色																						|#cccccc|
-|boxNormalColor	|string	|显示框未选中的颜色																	|#cccccc|
-|boxActiveColor	|string	|显示框选中的颜色如果type='middle' 则是线的默认样式	|#000000|
-|@confirm				|event	|输入完成的回调事件  {(code)=>{}}										|				|