main
fanfan 6 months ago
parent caf265f5cc
commit 1c8748e04b
  1. 26
      pages/goods/components/setPrice.vue

@ -16,7 +16,7 @@
{{startTime?startTime:'起始时间'}} {{startTime?startTime:'起始时间'}}
</view> </view>
</view> </view>
<view class="priceCon" v-if="secondQuota"> <view class="priceCon">
<text>秒杀时长</text> <text>秒杀时长</text>
<input type="number" style="width: 130rpx;margin-right: 15rpx;" class="input" v-model="sec_hour" <input type="number" style="width: 130rpx;margin-right: 15rpx;" class="input" v-model="sec_hour"
placeholder="请输入"> / placeholder="请输入"> /
@ -44,8 +44,9 @@
</view> </view>
</u-popup> </u-popup>
</view> </view>
<u-calendar v-model="timeShow" mode="date" minDate='0' @change="getTime" :pickerOptions="pickerOptions" <u-picker v-model="timeShow" mode="time" @confirm="getTime" :params="params"></u-picker>
range-color='#FF6257' range-bg-color='#FFBDBA' active-bg-color='#FF6257'></u-calendar> <!-- <u-calendar v-model="timeShow" mode="date" minDate='0' @change="getTime" :pickerOptions="pickerOptions"
range-color='#FF6257' range-bg-color='#FFBDBA' active-bg-color='#FF6257'></u-calendar> -->
</template> </template>
<script> <script>
@ -57,9 +58,17 @@
startTime: '', startTime: '',
sec_hour: '', sec_hour: '',
secondPrice: '', secondPrice: '',
secondQuota: 1, secondQuota: false,
quotaNum: '', quotaNum: '',
fontColor: '#262626', fontColor: '#262626',
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true
},
} }
}, },
methods: { methods: {
@ -70,7 +79,7 @@
this.quotaNum = null this.quotaNum = null
}, },
getTime(e) { getTime(e) {
this.startTime = e.result; this.startTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second;
}, },
submit() { submit() {
if (!this.secondPrice) { if (!this.secondPrice) {
@ -79,7 +88,7 @@
if (!this.startTime) { if (!this.startTime) {
return this.$toast('请选择开始时间') return this.$toast('请选择开始时间')
} }
if (!this.sec_hour) { if (!this.sec_hour && this.secondQuota) {
return this.$toast('请输入秒杀时长') return this.$toast('请输入秒杀时长')
} }
if (!this.quotaNum && this.secondQuota) { if (!this.quotaNum && this.secondQuota) {
@ -168,11 +177,11 @@
} }
.selectTime { .selectTime {
width: 300rpx; width: 358rpx;
height: 70rpx; height: 70rpx;
background: #F3F3F3; background: #F3F3F3;
border-radius: 44rpx; border-radius: 44rpx;
text-align: center; text-align: left;
line-height: 70rpx; line-height: 70rpx;
font-family: PingFang SC, PingFang SC; font-family: PingFang SC, PingFang SC;
font-weight: 500; font-weight: 500;
@ -180,6 +189,7 @@
color: #A1A1A1; color: #A1A1A1;
font-style: normal; font-style: normal;
text-transform: none; text-transform: none;
padding-left: 30rpx;
} }
text { text {

Loading…
Cancel
Save