Просмотр исходного кода

Merge branch 'master' of http://git.huaml.com/zhh/front-end

wangn 5 лет назад
Родитель
Сommit
27d11f750d

+ 1 - 1
ghsApp/src/App.vue

@@ -89,6 +89,6 @@ export default {
 		z-index: 2;
 	}
 	/**开单-增加减少动画**/
-	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1}
+	.animation{animation:imgmove 0.3s 1;animation-iteration-count:1;}
 	@-webkit-keyframes imgmove{0%{transform: scale(0.7);}100%{transform: scale(1);}}
 </style>

+ 8 - 1
ghsApp/src/admin/billing/priceChange.vue

@@ -2,7 +2,7 @@
   <view class="billing_box_bg">
     <view class="input-wrap">
       <app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索"
-                         @search="searchFn" />
+                         @input="searchFnContrapose" />
     </view>
     <view class="scroll-middle_bx">
       <!--<scroll-view scroll-y class="right-box" :scroll-into-view="scrollClassId"></scroll-view>-->
@@ -52,9 +52,16 @@ export default {
 		this.initDataContrapose();
   	console.error('111')
 	},
+	onReachBottom(){
+		if(this.isMore){
+			this.page++;
+			this.initDataContrapose()
+		}
+	},
   data () {
     return {
       pageType: "price_change",
+					 // offShowPage: true,
       COMMODITY_TYPE,
     };
   },

+ 1 - 1
ghsApp/src/admin/home/order.vue

@@ -4,7 +4,7 @@
       <view>
         <AppSearchModule
           placeholder="请输入客户名称,支持拼音首字母搜索"
-          @search="searchFn"
+          @input="searchFn"
         />
       </view>
 

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

@@ -1,27 +1,27 @@
 <template>
-	<view class="item-cmd_bx">
+	<view class="item-cmd_bx" @click="addEvents">
 <!--		<view class="img_bx" @click="addEvents">-->
 <!--			<app-img  :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />-->
 <!--		</view>-->
-		<view class="img_bx" @click="addEvents">
+		<view class="img_bx" >
 			<image :src="info.cover"></image>
 		</view>
 		<view class="cmd-info_bx">
-			<view class="tit" @click="addEvents">{{ info.itemName || "" }}</view>
+			<view class="tit" >{{ info.itemName || "" }}</view>
 			<view class="kc num-open_bx flex-end" v-if="type == COMMODITY_TYPE.COMMON">
 				<view class="price" v-if="!offPrice">¥{{ info.price }}</view>
 				<view class="price" v-else></view>
 				<view style="text-align: right" >
 					<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">
+						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>
+						<text class="num" @click.stop="customNum">
 							<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
 							<text v-if="smallCount > 0">/</text>
 							<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
 						</text>
-						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click="addEvents"></i>
+						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents"></i>
 					</view>
-					<text style="padding-right: 55rpx">库存 {{ info.stock }}</text>
+					<text style="padding-right: 55rpx">还剩 {{ info.stock }}</text>
 				</view>
 			</view>
 			<view class="num-open_bx flex-space" v-if="type == COMMODITY_TYPE.CHANGE">

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

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

+ 6 - 46
ghsApp/src/mixins/product.js

@@ -102,7 +102,7 @@ export default {
 		},
 		allPrice() {
 			let price = 0;
-			console.log('this.selectList',this.selectList)
+			console.log('this.selectList总价',this.selectList)
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					const itemInfo = this.getSelectItemById(item.id, item.classId);
@@ -440,64 +440,24 @@ export default {
 		 * 减去商品
 		 */
 		delEvent(item) {
-			const list = this.selectList;
+			const list = copyObject(this.selectList);
 			let has = false;
 			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
+				let element = list[index];
 				if (element.id == item.id && element.classId == item.classId) {
 					has = true;
-
 					if (element.bigCount > 0) {
 						if(!this.isSmallCount){list[index] = { ...element, bigCount: --element.bigCount };}
-						// list[index] = { ...element, bigCount: --element.bigCount };
 					}
 					if (element.smallCount > 0) {
 						if(this.isSmallCount){list[index] = { ...element, smallCount: --element.smallCount };}
-
-						// list[index] = { ...element, smallCount: 0 };
 					}
-
-					if (this.isLimit) {
-						const { bigCount, smallCount } = list[index];
-						//超过库存时 设置为库存最大值
-						const ratio = Number(item.ratio);
-						if (
-							Number(bigCount) * ratio + Number(smallCount) >
-							Number(item.bigNum) * ratio + Number(item.smallNum)
-						) {
-							list[index].bigCount = Number(item.bigNum);
-							list[index].smallCount = Number(item.smallNum);
+						if (element.bigCount == 0 && element.smallCount == 0) {
+							list.splice(index, 1);
 						}
 					}
-					if (element.bigCount == 0 && element.smallCount == 0) {
-						list.splice(index, 1);
-					}
-
 					break;
 				}
-			}
-			if (!has) {
-				let info = { classId: item.classId, id: item.id };
-
-				const classInfo =
-					this.productInfo &&
-					this.productInfo.find(element => {
-						return element.classId == item.classId && element.child;
-					});
-				if (classInfo) {
-					info = classInfo.child.find(ele => {
-						return ele.id == item.id;
-					});
-				}
-				let params = {
-					...info,
-					bigCount: 1, //扎数
-					smallCount: 0, //支数
-					autoPrice: 0 //调价价格
-				};
-
-				list.push(params);
-			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 			// this.$forceUpdate();
 		},
@@ -512,7 +472,7 @@ export default {
 				}
 			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
-			console.log('this.selectList',this.selectList)
+			console.log('this.selectList减去所有',this.selectList)
 		},
 		// /**
 		//  * 删除商品

+ 2 - 0
ghsApp/src/mixins/productContrapose.js

@@ -17,6 +17,7 @@ export default {
 			filterProductInfoContrapose:[],
 			allFilterProductInfoContrapose:[],
 			isMore:true,
+			page:1,
 		};
 	},
 	onLoad(options) {
@@ -54,6 +55,7 @@ export default {
 				let params = {
 					py: this.py,
 					type: this.type,
+					// showPage: this.offShowPage?'':1,
 					showPage: 1,
 					page: this.page,
 				};

+ 3 - 3
ghsApp/src/pagesArrears/list.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="order-page">
 		<view class="input-wrap">
-			<AppSearchModule v-model="name" placeholder="请输入客户,支持拼音首字母搜索" @search="searchFn" />
+			<AppSearchModule v-model="name" placeholder="请输入客户,支持拼音首字母搜索" @input="searchFn" />
 		</view>
 		<scroll-view scroll-y class="shop-list">
 			<block v-if="!$util.isEmpty(list.data)">
 				<view class="shop-item" v-for="(item, index) in list.data" :key="index">
-					
+
 					<view class="item-header" @click="gotoDetailsEvent(item)">
 						<image
 							class="logo"
@@ -21,7 +21,7 @@
 						</view>
 					</view>
 				</view>
-				
+
 			</block>
 			<block v-else>
 				<AppWrapperEmpty title="暂无记录" :is-empty="$util.isEmpty(list.data)" />

+ 12 - 12
ghsApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -105,7 +105,6 @@ export default {
 			autoLoad: false, //不自动请求数据  自定义请求
 			pageType: "stock",
 			tabIndex: 0,
-			page:1,
 			tabs: [
 				{
 					name: "库存预警",
@@ -152,6 +151,7 @@ export default {
 				this.tabs[this.tabIndex].key;
 				let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
 				if(type=="waring"){
+					this.filterProductInfoContrapose = this.allFilterProductInfoContrapose;
 					uni.hideLoading();
 					// this.initDataContrapose({ type, shopId: this.shopId });
 				}else{
@@ -159,17 +159,17 @@ export default {
 				}
 			}
 		},
-		searchFn() {
-			uni.showLoading({
-				title: "加载中"
-			});
-			if(type=="waring"){
-				this.initDataContrapose({ type, shopId: this.shopId });
-			}else{
-				this.initData({ type, shopId: this.shopId });
-			}
-			// this.initData({ shopId: this.shopId });
-		},
+		// searchFn() {
+		// 	// uni.showLoading({
+		// 	// 	title: "加载中"
+		// 	// });
+		// 	// if(type=="waring"){
+		// 	// 	this.initDataContrapose({ type, shopId: this.shopId });
+		// 	// }else{
+		// 	// 	this.initData({ type, shopId: this.shopId });
+		// 	// }
+		// 	// this.initData({ shopId: this.shopId });
+		// },
 		scrollTop() {},
 		initProductInfo() {
 			this.filterProductInfoContrapose = [];