Jelajahi Sumber

Merge branch 'master' of http://39.101.143.165:8090/hxl13994548489/LocalLivingServicesUniapp

baijunde 7 bulan lalu
induk
melakukan
2204e5514c
1 mengubah file dengan 22 tambahan dan 66 penghapusan
  1. 22 66
      pages/product/creatProduct.vue

+ 22 - 66
pages/product/creatProduct.vue

@@ -189,7 +189,7 @@
 							售卖时间<span>*</span>
 						</view>
 						<view class="picker set inp" @click="selectDate">
-							<u-input :disabled="tabIndex==1" placeholder="去设置" v-model="showDate" @click="selectDate" />
+							<u-input class="form-input" :disabled="true" placeholder="去设置" v-model="showDate" @click="selectDate" />
 							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>
@@ -265,9 +265,9 @@
 				</view>
 			</view>
 		</view>
-		<!-- <rangTime ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" :title="timeTitle"/> -->
-		<refund v-show="isRefund" :Confirm="form.refundConfirm" :Label="form.refundLabel" @confirm="saveFound"
-			@close="cutRule" />
+		<refund v-show="isRefund" :Confirm="form.refundConfirm" :Label="form.refundLabel" 
+			@confirm="saveFound" @close="cutRule" 
+		/>
 		<view class="popup" v-if="isSelectType">
 			<view class="model">
 				<view class="title">
@@ -304,6 +304,8 @@
 		<!-- 商品分组 -->
 		<u-select v-model="showGroupPicker" mode="single-column" label-name="name" value-name="id" :list="groupOptions"
 			@confirm="groupConfirm($event)" @cancel="showGroupPicker = false"></u-select>
+		<!-- 时间组件 -->
+		<rangTime ref="rangTime" :mode="mode" :title="timeTitle" @onSubmit="onEndTimeChange" />
 	</view>
 </template>
 
@@ -383,48 +385,26 @@
 			if (options.productId) {
 				this.productId = options.productId
 			}
+			// 商品类型
 			if (options.tabIndex) {
 				this.tabIndex = options.tabIndex
 			}
 		},
 		onShow() {
-			let that = this
 			uni.getStorage({
 				key: 'login_user_info',
-				success: function(res) {
-					that.form.merchantId = res.data.merchantId
-				}
-			})
-			uni.getStorage({
-				key: 'smdate',
 				success: (res) => {
-					if (res.data.availableEndDate) {
-						this.showSellDate = res.data.availableStartDate + '-' + res.data.availableEndDate
-						this.form.availableStartDate = res.data.availableStartDate
-						this.form.availableEndDate = res.data.availableEndDate
-						this.form.expirationDays = null
-						this.form.useType = 2
-					} else if (res.data.expirationDays) {
-						this.form.expirationDays = res.data.expirationDays
-						this.form.availableEndDate = null
-						this.form.availableStartDate = null
-						this.form.useType = 1
-						this.$nextTick(() => {
-							this.showSellDate = res.data.expirationDays + '天后失效'
-						});
-					}else if(res.data.useType == 3){
-						this.form.useType = 3
-						this.showSellDate = '长期有效'
-					}
-
+					this.form.merchantId = res.data.merchantId
 				}
 			})
 			uni.getStorage({
 				key: 'group',
-				success: function(res) {
-					that.form.productGroups = res.data
+				success: (res) => {
+					this.form.productGroups = res.data
 				}
 			})
+			
+			this.updateRangeTime()
 		},
 		methods: {
 			//全选
@@ -738,7 +718,7 @@
 			onEndTimeChange(val) {
 				this.form.saleStartDate = val.startDate
 				this.form.saleEndDate = val.endDate
-				this.showDate = val.startDate + '-' + val.endDate
+				this.showDate = val.startDate + ' ~ ' + val.endDate
 				this.$forceUpdate(); // 强制刷新视图
 			},
 			//提交审核
@@ -846,7 +826,7 @@
 							console.log(this.xqImage)
 						}
 
-						this.showDate = res.data.result.saleStartDate.slice(0, 10) + '-' + res.data.result.saleEndDate.slice(0,
+						this.showDate = res.data.result.saleStartDate.slice(0, 10) + ' ~ ' + res.data.result.saleEndDate.slice(0,
 							10)
 						if (res.data.resultuseType == 2) {
 							this.showSellDate = res.data.result.availableStartDate.slice(0, 10) + '-' + res.data.result
@@ -870,37 +850,6 @@
 					}
 				})
 			}
-		},
-		mounted() {
-			this.getProductGroup()
-			this.getLeftTree()
-			this.getForm()
-			this.updateRangeTime()
-		},
-		onLoad(options) {
-			if (options.productId) {
-				this.productId = options.productId
-			}
-			if (options.tabIndex) {
-				this.tabIndex = options.tabIndex
-			}
-
-		},
-		onShow() {
-			let that = this
-			uni.getStorage({
-				key: 'login_user_info',
-				success: function(res) {
-					that.form.merchantId = res.data.merchantId
-				}
-			})
-		 that.updateRangeTime()
-			uni.getStorage({
-				key: 'group',
-				success: function(res) {
-					that.form.productGroups = res.data
-				}
-			})
 		}
 	}
 </script>
@@ -920,8 +869,8 @@
 			height: var(--status-bar-height);
 			background-color: #fff;
 		}
-
 		/*#endif*/
+
 		.head {
 			width: 100%;
 			height: 112rpx;
@@ -1130,6 +1079,13 @@
 					margin-top: 6rpx;
 				}
 			}
+
+			.form-input {
+				pointer-events: none;
+			}
+			::v-deep .uni-input-input:disabled {
+				pointer-events: none;
+			}
 		}
 
 		.btn {