Parcourir la source

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

baijunde il y a 7 mois
Parent
commit
dc080d9944

+ 1 - 0
components/dengrq-datetime-picker/dateSelector/index.css

@@ -4,6 +4,7 @@
   color: #333;
 }
 .popup-box {
+  min-height: 290px;
   background: #FFFFFF;
   padding: 0 27upx;
   border-radius: 24upx 24upx 0px 0px;

+ 4 - 6
pages/product/creatProduct update.vue

@@ -308,12 +308,10 @@
 						可用时间<span>*</span>
 					</view>
 					<view class="picker set">
-						<view class="picker set inp" @click="setUsable" v-if="showSellDate == ''">
-							<u-input placeholder="去设置" />
-							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
-						</view>
-						<view class="picker set inp" @click="setUsable" v-else>
-							<span style="color: #333333;">{{ showSellDate }}</span>
+						<view class="picker set inp" @click="setUsable">
+							<text :style="{
+								color: showSellDate ? '#333333' : '#c0c4cc'
+							}">{{ showSellDate || '去设置' }}</text>
 							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>

+ 58 - 61
pages/product/creatProduct.vue

@@ -206,12 +206,10 @@
 							可用时间<span>*</span>
 						</view>
 						<view class="picker set">
-							<view class="picker set inp" @click="setUsable" v-if="showSellDate == ''">
-								<u-input placeholder="去设置" />
-								<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
-							</view>
-							<view class="picker set inp" @click="setUsable" v-else>
-								<span style="color: #333333;">{{ showSellDate }}</span>
+							<view class="picker set inp" @click="setUsable">
+								<text :style="{
+									color: showSellDate ? '#333333' : '#c0c4cc'
+								}">{{ showSellDate || '去设置' }}</text>
 								<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 							</view>
 						</view>
@@ -376,6 +374,58 @@
 				groupOptions: [],
 			}
 		},
+		mounted() {
+			this.getProductGroup()
+			this.getLeftTree()
+			this.getForm()
+		},
+		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
+				}
+			})
+			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 = '长期有效'
+					}
+
+				}
+			})
+			uni.getStorage({
+				key: 'group',
+				success: function(res) {
+					that.form.productGroups = res.data
+				}
+			})
+		},
 		methods: {
 			//全选
 			allSelect() {
@@ -529,10 +579,10 @@
 			},
 			//跳转至可用时间
 			setUsable() {
+				let str = this.$u.queryParams({ useType: this.form.useType })
 				uni.navigateTo({
-					url: '/pages/product/usable'
+					url: `/pages/product/usable${str}`
 				})
-
 			},
 			// 保存退款规则
 			saveFound(rules) {
@@ -794,59 +844,6 @@
 				})
 			}
 		},
-		mounted() {
-			this.getProductGroup()
-			this.getLeftTree()
-			this.getForm()
-		},
-		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
-				}
-			})
-			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 = '长期有效'
-					}
-
-				}
-			})
-			uni.getStorage({
-				key: 'group',
-				success: function(res) {
-					that.form.productGroups = res.data
-				}
-			})
-		}
 	}
 </script>
 

+ 29 - 15
pages/product/usable.vue

@@ -21,19 +21,23 @@
 					</view>
 				</u-radio>
 				<u-radio @change="radioChange" name="now"
-					style="width: 100%;height:65rpx; flex;align-items: center;margin-top: 16rpx;">
+					style="width: 100%; height:65rpx; display: flex; align-items: center; margin-top: 16rpx;">
 					<view class="title now">
-						购买后立即生效,生效后
-						<input type="number" style="background-color:#F7F8FC;margin-top: 16rpx;" v-model="expirationDays" /> 天失效
+						<text>购买后立即生效,生效后</text>
+						<input class="input" type="number" v-model="expirationDays" /> 
+						<text>天失效</text>
 					</view>
 				</u-radio>
 				<u-radio @change="radioChange" name="date"
-					style="width: 100%;margin-top: 16rpx;;border-bottom: 1px solid #eeeeee;">
+					style="width: 100%;margin-top: 16rpx;border-bottom: 1px solid #eeeeee;">
 					<view class="title now">
 						固定时间段
-						<view class="picker">
-							<u-input placeholder="去设置" v-model="showDate"/>
-							<u-icon name="arrow-right" style="margin-left: 17rpx;" @click="selectDate" ></u-icon>
+						<view class="picker" @click="selectDate">
+							<u-input class="form-input" placeholder="去设置" inputAlign="right" 
+								disabled
+								v-model="showDate"
+							/>
+							<u-icon name="arrow-right" style="margin-left: 17rpx;"></u-icon>
 						</view>
 					</view>
 				</u-radio>
@@ -65,6 +69,12 @@ export default {
 			showDate: ''
 		}
 	},
+	onLoad(query) {
+		if (query.useType) {
+			let a = ['now', 'date', 'long']
+			this.value = a[query.useType - 1]
+		}
+	},
 	methods: {
 		//返回
 		back() {
@@ -86,7 +96,7 @@ export default {
 		onEndTimeChange(val) {
 			this.availableStartDate = val.startDate
 			this.availableEndDate = val.endDate
-			this.showDate = val.startDate + '-' + val.endDate
+			this.showDate = val.startDate + ' ~ ' + val.endDate
 			this.$forceUpdate(); // 强制刷新视图
 		},
 		selectDate() {
@@ -150,7 +160,6 @@ export default {
 		height: var(--status-bar-height);
 		background-color: #fff;
 	}
-
 	/*#endif*/
 
 	.head {
@@ -180,6 +189,12 @@ export default {
 		flex: 1;
 		padding: 24rpx;
 
+		.form-input {
+			pointer-events: none;
+		}
+		::v-deep .uni-input-input:disabled {
+			pointer-events: none;
+		}
 	}
 
 	.title {
@@ -204,14 +219,13 @@ export default {
 			justify-content: flex-end;
 			font-size: 28rpx;
 			color: #999999;
-
-			::v-deep.u-input {
-				text-align: right !important;
-			}
 		}
 
-		input {
-			width: 100rpx;
+		.input {
+			flex: 1;
+			margin: 0 12rpx;
+			text-align: center;
+			background-color: #F7F8FC;
 		}
 	}