ソースを参照

Merge branch 'master' into master-pro

wuguojie 2 ヶ月 前
コミット
ab8eb92ac7
2 ファイル変更17 行追加5 行削除
  1. 3 3
      pages/groupMeal/goods/list.vue
  2. 14 2
      pages/product/creatProduct.vue

+ 3 - 3
pages/groupMeal/goods/list.vue

@@ -96,7 +96,7 @@
 									@click="handleAction('publish', goods)"
 								>上架</u-button>
 								<u-button 
-									v-if="!isManaging && [0,1].indexOf(currentStatusTab) !== -1" 
+									v-if="!isManaging && currentStatusTab == 0" 
 									type="primary" plain
 									@click="handleAction('unpublish', goods)"
 								>下架</u-button>
@@ -128,7 +128,7 @@
 			</u-checkbox-group>
 			
 			<view class="action-buttons">
-				<template v-if="currentStatusTab === 0 || currentStatusTab === 1">
+				<template v-if="currentStatusTab === 0">
 					<u-button type="primary" @click="handleBatchAction('unpublish')">下架</u-button>
 				</template>
 				<template v-if="currentStatusTab === 2">
@@ -235,7 +235,7 @@ export default {
 			else if (this.currentStatusTab == 1) {
 				params = {
 					...params,
-					status: 0,
+					status: null,
 					reviewStatus: 0,
 				}
 			}

+ 14 - 2
pages/product/creatProduct.vue

@@ -378,6 +378,8 @@
 				// 商品分组列表
 				showGroupPicker: false,
 				groupOptions: [],
+				// 防止提交审核重复提交
+				submitLoading: false
 			}
 		},
 		mounted() {
@@ -747,6 +749,14 @@
 			//提交审核
 			submit() {
 				console.log(this.form)
+				if(this.submitLoading) {
+					uni.showToast({
+						title: '正在提交数据,请勿重复提交!',
+						icon: 'none'
+					});
+					return
+				}
+				this.submitLoading = true
 				this.form.specItems = this.selectProductSunItem
 				this.makeChecked ? this.form.preBook = 1 : this.form.preBook = 0
 				if (!this.form.saleStartDate) {
@@ -778,6 +788,7 @@
 					if (this.productId == '') {
 						this.$http.post("/app/product/add", this.form).then(res => {
 							if (res.data.code == 200) {
+								this.submitLoading = false
 								uni.showToast({
 									title: '添加成功',
 									icon: 'none'
@@ -790,24 +801,25 @@
 									key: 'group',
 								});
 							} else {
+								this.submitLoading = false
 								uni.showToast({
 									title: res.data.message,
 									icon: 'none'
 								});
 							}
-
-
 						})
 					} else {
 						this.form.productId = this.productId
 						this.$http.post("/app/product/edit", this.form).then(res => {
 							if (res.data.code == 200) {
+								this.submitLoading = false
 								uni.showToast({
 									title: '编辑成功',
 									icon: 'none'
 								});
 								this.back()
 							} else {
+								this.submitLoading = false
 								uni.showToast({
 									icon: 'none',
 									title: res.data.message