Parcourir la source

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

baijunde il y a 7 mois
Parent
commit
2082034fc7
1 fichiers modifiés avec 59 ajouts et 1 suppressions
  1. 59 1
      pages/product/creatProduct.vue

+ 59 - 1
pages/product/creatProduct.vue

@@ -265,7 +265,7 @@
 				</view>
 			</view>
 		</view>
-		<rangTime ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" :title="timeTitle"/>
+		<!-- <rangTime ref="rangTime" :mode="mode" @onSubmit="onEndTimeChange" :title="timeTitle"/> -->
 		<refund v-show="isRefund" :Confirm="form.refundConfirm" :Label="form.refundLabel" @confirm="saveFound"
 			@close="cutRule" />
 		<view class="popup" v-if="isSelectType">
@@ -584,6 +584,33 @@
 					url: `/pages/product/usable${str}`
 				})
 			},
+			// 更新时间
+			updateRangeTime() {
+				uni.getStorage({
+					key: 'smdate',
+					success: (res) => {
+						if (res.data.useType == 2) {
+							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.useType == 1) {
+							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 = '长期有效'
+						}
+
+					}
+				})
+			},
 			// 保存退款规则
 			saveFound(rules) {
 				this.form.refundConfirm = rules.refundConfirm.refundConfirm
@@ -844,6 +871,37 @@
 				})
 			}
 		},
+		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>