diff --git a/components/time-select/time-select.vue b/components/time-select/time-select.vue index d46af242..66d52699 100644 --- a/components/time-select/time-select.vue +++ b/components/time-select/time-select.vue @@ -6,7 +6,7 @@ × - + {{ propTitle || this.$t('buy.buy.q8u066') }} {{ propSubhead }} @@ -48,7 +48,7 @@ }, propRangeType: { type: Boolean, - default: false, + default: true, }, propIsShow: { type: Boolean, @@ -170,6 +170,7 @@ } this.time_active_index = e; this.activeTimeArr = timeArr; + _data['value'] = this.propRangeType ? _data._dateRange : _data._date; this._selectEvent(_data); }, _handleData() { @@ -443,7 +444,7 @@ bottom: 0; left: 0; width: 100%; - padding: 40rpx 10rpx 0 10rpx; + padding: 20rpx 10rpx 0 10rpx; transition: height 0.5s; border-top-right-radius: 20rpx; border-top-left-radius: 20rpx; diff --git a/pages/buy/buy.vue b/pages/buy/buy.vue index 8c87bd8e..e09832c2 100644 --- a/pages/buy/buy.vue +++ b/pages/buy/buy.vue @@ -42,7 +42,7 @@ {{ buy_datetime_info.title }} - + {{ buy_datetime_info.placeholder }} {{ buy_datetime_info.value }} @@ -609,11 +609,11 @@ var temp_dt = data.buy_datetime_info || {}; var datetime = { // 是否开启时间选择 - is_select: (temp_dt.is_select || 0) == 1, + is_select: parseInt(temp_dt.is_select || 0) == 1, // 是否必选 - required: (temp_dt.required || 0) == 1, + required: parseInt(temp_dt.required || 0) == 1, // 状态 - status: data_dt.status || (temp_dt.status || 0) == 1 || false, + status: data_dt.status || parseInt(temp_dt.status || 0) == 1 || false, // 默认值 value: data_dt.value || temp_dt.value || '', // 标题 @@ -623,9 +623,11 @@ // 天起始时间 time_start: temp_dt.time_start || '', // 天结束时间 - time_end: temp_dt.time_end || '', + time_end: temp_dt.time_end || '', + // 随机类型(区间还是固定时间, 0或1) + range_type: (temp_dt.range_type == undefined || parseInt(temp_dt.range_type || 0) == 1), // 可选最大天数 - range_day: temp_dt.range_day || 2, + range_day: parseInt(temp_dt.range_day || 2), // 禁止选择的时间 disabled: temp_dt.disabled || '', // 未选择错误提示 @@ -636,14 +638,14 @@ var data_ct = this.buy_extraction_contact_info || {}; var temp_ct = data.buy_extraction_contact_info || {}; var extraction_contact = { - is_write: (temp_ct.is_write || 0) == 1, + is_write: parseInt(temp_ct.is_write || 0) == 1, // 状态 status: data_ct.status || (temp_ct.status || 0) == 1 || false, // 默认值、姓名和电话 name: data_ct.name || temp_ct.name || '', tel: data_ct.tel || temp_ct.tel || '', // 是否必选 - required: (temp_ct.required || 0) == 1, + required: parseInt(temp_ct.required || 0) == 1, // 未选择错误提示 error_msg: temp_ct.error_msg || this.$t('buy.buy.8fghje'), }; @@ -1171,7 +1173,7 @@ var temp = this.buy_datetime_info; temp['status'] = !temp.status; if (e != 'open' && e != 'close') { - temp['value'] = ((e || null) != null ? e._date : '') || ''; + temp['value'] = ((e || null) != null ? e.value : '') || ''; } this.setData({ buy_datetime_info: temp,