shish 3 лет назад
Родитель
Сommit
ddb7c1425d

+ 2 - 1
ghsApp/src/admin/changePrice/changeStock.vue

@@ -31,7 +31,7 @@
 
 							<template v-for="(productItem, productIndex) in classItem.child">
 								<view style="height:190upx" :id="`class_${classIndex}`" :key="productIndex">
-									<ItemComponent v-if="classItem.isActive" :isPrice="false" :info="productItem" @saveStock="saveStock" @hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn"></ItemComponent>
+									<ItemComponent v-if="classItem.isActive" :isPrice="false" :info="productItem" @saveStock="saveStock" :ref="`productRef${productItem.id}`" @hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn"></ItemComponent>
 								</view>
 							</template>
 
@@ -131,6 +131,7 @@ export default {
 			changeFrontHide({id:item.id,status:status}).then(res=>{
 				if(res.code == 1){
 					that.$msg(res.msg)
+					that.$refs[`productRef${item.id}`][0].frontHide = status
 				}
 			})
 		},

+ 7 - 3
ghsApp/src/admin/changePrice/components/changeStockItem.vue

@@ -1,7 +1,7 @@
 <template>
 <view class="product">
 	<view class="item-cmd_bx">
-		<button v-if="info.frontHide == 0" @click.stop="hideChangeFn(info,1)" class="admin-button-com mini-btn default" 
+		<button v-if="frontHide == 0" @click.stop="hideChangeFn(info,1)" class="admin-button-com mini-btn default" 
 			style="width:141upx;position:absolute;bottom:0upx;font-size:24upx;left:10upx;z-index:20;padding-top:16upx;padding-bottom:16upx;">
 			隐藏
 			</button>
@@ -23,7 +23,6 @@
 				v-if="info.presell == 1">预售</text>
 				{{ info.name || "" }}
 			</view>
-			<text v-if="info.frontHide == 1" class="front-hide-color">隐</text>
 			<view class="kc">¥{{ parseFloat(info.price) }}</view>
 			<view class="num-open_bx">
 				<view>
@@ -32,6 +31,7 @@
 						<view class="hd-price-area">
 							<input class="change-input" @click.stop @blur="saveStock" placeholder-style="color:#CCCCCC" v-model="modifyStock" type="digit" placeholder="填写数量" />
 						</view>
+						<text v-if="frontHide == 1" class="front-hide-color">隐</text>
 					</view>
 				</view>
 			</view>
@@ -63,10 +63,14 @@ export default {
 	},
 	data() {
 		return {
-			modifyStock:''
+			modifyStock:'',
+			frontHide:0,
 		};
 	},
 	mounted(){
+		if(this.info){
+			this.frontHide = this.info.frontHide
+		}
 	},
 	methods: {
 		cancelPreSellFn(item){