Prechádzať zdrojové kódy

Merge branch 'master' into master-pro

付晓文。 2 mesiacov pred
rodič
commit
e43bae7917
2 zmenil súbory, kde vykonal 18 pridanie a 10 odobranie
  1. 3 8
      pages/product/creatProduct.vue
  2. 15 2
      pages/product/index.vue

+ 3 - 8
pages/product/creatProduct.vue

@@ -197,14 +197,14 @@
 							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>
-					<view class="item">
+					<!-- <view class="item">
 						<view class="label">
 							库存<span>*</span>
 						</view>
 						<view class="picker set">
 							<u-input type="number" v-model="form.stockQuantity" placeholder="输入库存数量" />
 						</view>
-					</view>
+					</view> -->
 					<view class="item">
 						<view class="label">
 							可用时间<span>*</span>
@@ -759,18 +759,13 @@
 				this.submitLoading = true
 				this.form.specItems = this.selectProductSunItem
 				this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
+				
 				if (!this.form.saleStartDate) {
 					uni.showToast({
 						title: '请设置售卖时间',
 						icon: 'none'
 					});
 					return
-				} else if (!this.form.stockQuantity) {
-					uni.showToast({
-						title: '请输入商品库存',
-						icon: 'none'
-					});
-					return
 				} else if (!this.form.useType) {
 					uni.showToast({
 						title: '请选择可用时间',

+ 15 - 2
pages/product/index.vue

@@ -17,9 +17,9 @@
 
 			<div class="tab-container">
 				<div class="tab-item" :class="tabIndex == 1 ? 'active' : ''"
-					@click="tabIndex = 1; productName = ''; productStatus = 0; getProductList(); getStatus()">品牌标品</div>
+					@click="switchTab(1)">品牌标品</div>
 				<div class="tab-item" :class="tabIndex == 0 ? 'active' : ''"
-					@click="tabIndex = 0; productName = ''; productStatus = 0; getProductList(); getStatus()">自有商品</div>
+					@click="switchTab(0)">自有商品</div>
 			</div>
 
 			<view class="search">
@@ -253,6 +253,19 @@ export default {
 			this.getProductList()
 			// 这里可以添加其他逻辑
 		},
+		// 切换品牌标品 / 自有商品
+		switchTab(index) {
+			if (this.tabIndex === index) return
+			this.tabIndex = index
+			this.productName = ''
+			this.currentIndex = 0
+			this.productStatus = 0
+			this.isManage = false
+			this.isAll = false
+			this.productList = []
+			this.getProductList()
+			this.getStatus()
+		},
 		//切换分类
 		selectType(item, index) {
 			if (!this.isManage) {