Przeglądaj źródła

代码优化;

郭鹏飞 7 miesięcy temu
rodzic
commit
fe5d73fac0
1 zmienionych plików z 5 dodań i 29 usunięć
  1. 5 29
      pages/product/creatProduct.vue

+ 5 - 29
pages/product/creatProduct.vue

@@ -380,7 +380,6 @@
 			this.getProductGroup()
 			this.getLeftTree()
 			this.getForm()
-			this.updateRangeTime()
 		},
 		onLoad(options) {
 			if (options.productId) {
@@ -392,43 +391,20 @@
 			}
 		},
 		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: {
 			//全选