jf 5 年 前
コミット
d5a4a77e5a

+ 3 - 3
ghsApp/src/App.vue

@@ -117,10 +117,10 @@ import store from '@/store'
 	page {
 		height: 100%;
 	}
-	.animation{animation:imgmove 0.3s infinite;}
+	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
 	@-webkit-keyframes imgmove{
-		0%{transform: scale(1);}
-		50%{transform: scale(1.1);}
+		0%{transform: scale(0.7);}
+		//50%{transform: scale(1);}
 		100%{transform: scale(1);}
 	}
 </style>

+ 3 - 0
ghsApp/src/admin/billing/index.vue

@@ -171,6 +171,9 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
+			this.$nextTick(()=>{
+				this.initAllInput();
+			})
 		},
 		modalCancel() {
 			this.isModel = false;

+ 7 - 4
ghsApp/src/components/module/allMoreSelectInput.vue

@@ -16,6 +16,9 @@
 				position: absolute;
 				width: 100%;
 				height: 100%;
+				&.active{
+					opacity:0;
+				}
 			}
 			text{
 				&.active{
@@ -33,13 +36,13 @@
 <template>
 	<view class="change-input-box">
 		<view class="change-input">
-				<input :focus="isFocus" type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" >
-				<text :class="isActive?'active':''">{{value}}</text>
+				<input :focus="isFocus" :class="isActive&&value?'active':''" type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" >
+				<text :class="isActive?'active':''">{{value?value:''}}</text>
 		</view>
 		<view class="unit">扎</view>
 		<view class="change-input">
-			<input :focus="isFocusOne" type="number" @focus="initAllInputOne" @blur="moveAllInputOne" v-model="inputValOne" @input="changeAllInputOne" >
-			<text :class="isActiveOne?'active':''">{{valueOne}}</text>
+			<input :focus="isFocusOne" :class="isActiveOne&&valueOne?'active':''" type="number" @focus="initAllInputOne" @blur="moveAllInputOne" v-model="inputValOne" @input="changeAllInputOne" >
+			<text :class="isActiveOne?'active':''">{{valueOne?valueOne:''}}</text>
 		</view>
 		<view class="unit">支</view>
 	</view>

+ 5 - 2
ghsApp/src/components/module/allSelectInput.vue

@@ -13,6 +13,9 @@
 			position: absolute;
 			width: 100%;
 			height: 100%;
+			&.active{
+				opacity:0;
+			}
 		}
 		text{
 			&.active{
@@ -23,8 +26,8 @@
 </style>
 <template>
 	<view class="change-input">
-			<input :focus="isFocus" type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" :placeholder="value==''&&inputVal==''?'自动调价':''">
-			<text :class="isActive?'active':''">{{value}}</text>
+			<input :focus="isFocus" :class="isActive&&value?'active':''" type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" :placeholder="value==''&&inputVal==''?'自动调价':''">
+			<text :class="isActive?'active':''">{{value?value:''}}</text>
 	</view>
 </template>
 <script>

+ 6 - 6
ghsApp/src/components/module/app-commodity.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="item-cmd_bx">
-		<view class="img_bx">
-			<app-img @click="addEvent" :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />
+		<view class="img_bx" @click="addEvents">
+			<app-img  :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />
 		</view>
 		<view class="cmd-info_bx">
-			<view class="tit" @click="addEvent">{{ info.itemName || "" }}</view>
-			<view class="kc" @click="addEvent">库存 {{ info.stock }}</view>
+			<view class="tit" @click="addEvents">{{ info.itemName || "" }}</view>
+			<view class="kc" @click="addEvents">库存 {{ info.stock }}</view>
 			<view class="num-open_bx">
 				<view class="price">¥{{ showPrice }}</view>
 				<view class="open-bx" v-if="type == COMMODITY_TYPE.COMMON">
@@ -15,7 +15,7 @@
 						<text v-if="smallCount > 0">/</text>
 						<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
 					</text>
-					<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click="addEvent"></i>
+					<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click="addEvents"></i>
 				</view>
 				<view class="open-bx" v-else-if="type == COMMODITY_TYPE.CHANGE">
 					<allSelectInput :isActive="isActive" :isFocus="isFocus" :value="changeAutoPrice"
@@ -83,7 +83,7 @@ export default {
 		this.showPrice = this.info.price
 	},
 	methods: {
-		addEvent() {
+		addEvents() {
 			this.animationFun('add');
 			// let params = {
 			// 	...this.info,

+ 8 - 2
ghsApp/src/mixins/animation.js

@@ -12,10 +12,16 @@ export default {
 		animationFun(type){
 			if(type=='add'){
 				this.addAnimationData = true;
-				setTimeout(()=>{this.addAnimationData = false;},300)
+				this.$nextTick(()=>{
+					this.addAnimationData = false;
+				})
+				// setTimeout(()=>{this.addAnimationData = false;},100)
 			}else{
 				this.delAnimationData = true;
-				setTimeout(()=>{this.delAnimationData = false;},300)
+				this.$nextTick(()=>{
+					this.addAnimationData = false;
+				})
+				// setTimeout(()=>{this.delAnimationData = false;},100)
 			}
 
 		},

+ 19 - 10
ghsApp/src/pagesPurchase/add.vue

@@ -68,7 +68,8 @@
 								:bigCount=" getSelectItemById(productItem.id, classItem.classId).bigCount"
 								:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 								@customNum="customNum"
-								@add="addCustomNumEvent"
+								@add="addEvent"
+								@addOneEvent="addCustomNumEvent"
 								@del="delAllEvent"
 							></CommodityPurchase>
 						</template>
@@ -185,26 +186,34 @@ export default {
 		customNum(info) {
 			this.isModel = true;
 			this.customData = info;
+			this.$nextTick(()=>{
+				this.initAllInput();
+			})
 		},
 		modalCancel() {
 			this.isModel = false;
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
+			// this.moveAllInput();
+			// this.moveAllInputOne();
 			this.isFocus = false;
 			this.isFocusOne = false;
-			if(this.customData.bigCount==0 && this.customData.smallCount==0){
-				this.delAllEvent(this.customData)}
+			this.$nextTick(()=>{
+				if(this.customData.bigCount==0 && this.customData.smallCount==0){
+					this.delAllEvent(this.customData)}
 
-			if (val.index === 0) {
-				this.modalCancel();
-			} else {
+				if (val.index === 0) {
+					this.modalCancel();
+				} else {
 
 					// delAllEvent
-				//超过库存时 设置为库存最大值
-				this.updateItemEvent(this.customData);
-				this.modalCancel();
-			}
+					//超过库存时 设置为库存最大值
+					this.updateItemEvent(this.customData);
+					this.modalCancel();
+				}
+			})
+
 		},
 		cancelEvent() {},
 		submitEvent(val) {

+ 17 - 7
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -15,7 +15,8 @@
 				</view>
 				<view class="open-bx">
 					<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>
-					<text class="num" @click="customNum" v-if="bigCount > 0 || smallCount > 0">
+					<text class="num" @click="customNum" >
+<!--					<text class="num" @click="customNum" v-if="bigCount > 0 || smallCount > 0">-->
 						<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
 						<text v-if="smallCount > 0">/</text>
 						<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
@@ -71,12 +72,12 @@ export default {
 	methods: {
 		addEvent() {
 			this.animationFun('add');
-			let params = {
-				...this.info,
-				bigCount: this.bigCount,
-				smallCount: this.smallCount
-			};
-			this.$emit("add", this.info,params);
+			// let params = {
+			// 	...this.info,
+			// 	bigCount: this.bigCount,
+			// 	smallCount: this.smallCount
+			// };
+			this.$emit("add", this.info);
 		},
 		delEvent() {
 			this.animationFun('del');
@@ -93,6 +94,14 @@ export default {
 			this.$emit("changePrice", this.info, value);
 		},
 		customNum() {
+			if(!this.info.bigCount){
+				let params = {
+					...this.info,
+					bigCount: this.bigCount,
+					smallCount: this.smallCount
+				};
+				this.$emit("addOneEvent", this.info,params);
+			}
 			this.$emit("customNum", {
 				...this.info,
 				bigCount: this.bigCount,
@@ -156,6 +165,7 @@ export default {
 				& > .num {
 					display: inline-block;
 					width: 120rpx;
+					height:45rpx;
 					text-align:center;
 					margin: 0 8px;
 					color: #868686;