You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/goods/components/setPrice.vue

249 lines
5.6 KiB

9 months ago
<template>
<view>
<u-popup v-model="afterSale" width="80%" border-radius="10" @close="onClose" :closeable="true" mode="center">
<view class="afterSales">
<view class="filterTitle">
请设置秒杀价
</view>
<view class="priceContainer">
<view class="priceCon">
9 months ago
<text>秒杀价</text><input type="text" v-model="secondPrice" class="input"
placeholder="秒杀价格可低于成本价" />
9 months ago
</view>
<view class="priceTime">
<view class="text">秒杀区间</view>
<view class="priceDate">
9 months ago
<view class="selectTime" :style="'color: ' + (startTime?fontColor:'')" @click="timeShow=true">
9 months ago
{{startTime?startTime:'起始时间'}}
</view>
<text>-</text>
9 months ago
<view class="selectTime" :style="'color: ' + (endTime?fontColor:'')" @click="timeShow=true">
9 months ago
{{endTime?endTime:'终止时间'}}
</view>
</view>
</view>
<view class="priceCon" style="justify-content: space-between;">
<text>秒杀限购</text>
9 months ago
<u-switch v-model="secondQuota" size='35' @change="change" activeColor='#55BD6A' inactiveColor='#F1F1F1'>
9 months ago
</u-switch>
</view>
9 months ago
<view class="priceCon" v-if="secondQuota">
9 months ago
<text>每人限购</text>
9 months ago
<input type="number" style="width: 130rpx;margin-right: 15rpx;" class="input" v-model="quotaNum"
placeholder="请输入" />
9 months ago
</view>
</view>
<view class="btnGroup">
<view class="reset" @click="reset">
重置
</view>
<view class="submit" @click="submit" style="margin-left:24upx;">
确定
</view>
</view>
</view>
</u-popup>
</view>
9 months ago
<u-calendar v-model="timeShow" mode="multiple" minDate='0' @change="getTime" :pickerOptions="pickerOptions" range-color='#FF6257' range-bg-color='#FFBDBA'
9 months ago
active-bg-color='#FF6257'></u-calendar>
</template>
<script>
export default {
data() {
return {
afterSale: false,
timeShow: false,
startTime: '',
endTime: '',
9 months ago
secondPrice: '',
9 months ago
secondQuota: 1,
9 months ago
quotaNum: '',
9 months ago
fontColor:'#262626',
pickerOptions:{
disabledDate(time){
return true
}
}
9 months ago
}
},
methods: {
reset() {
this.startTime = null;
this.endTime = null
this.secondPrice = null;
this.quotaNum = null
},
getTime(e) {
this.startTime = e.startDate;
this.endTime = e.endDate;
},
submit() {
if (!this.secondPrice) {
return this.$toast('请输入最低价格')
}
if (!this.startTime) {
return this.$toast('请选择开始时间')
}
if (!this.endTime) {
return this.$toast('请选择结束时间')
}
9 months ago
if (!this.quotaNum&&this.secondQuota) {
9 months ago
return this.$toast('请输入限购次数')
}
this.$emit('getprice', {
startTime: this.startTime,
endTime: this.endTime,
secondPrice: this.secondPrice,
9 months ago
quotaNum: this.secondQuota?this.quotaNum:'',
secondQuota: this.secondQuota?1:2
9 months ago
})
}
}
}
</script>
<style lang="scss" scoped>
9 months ago
::v-deep .u-btn--primary {
background-color: #FF6257 !important;
9 months ago
border-color: #FF6257 !important;
9 months ago
}
9 months ago
.afterSales {
padding: 32upx;
.filterTitle {
font-size: 32upx;
font-family: PingFang SC, PingFang SC;
font-weight: 700;
color: #303030;
text-align: center;
}
.priceContainer {
overflow: hidden;
padding-top: 40upx;
margin-top: 30upx;
border-top: 1rpx solid #EAEAEA;
.priceCon {
display: flex;
align-items: center;
font-size: 28rpx;
color: #262626;
9 months ago
margin-bottom: 20rpx;
9 months ago
text {
9 months ago
width: 140rpx;
9 months ago
font-family: PingFang SC, PingFang SC;
font-weight: 400;
9 months ago
line-height: 70rpx;
9 months ago
text-align: left;
font-style: normal;
text-transform: none;
}
.input {
width: 350rpx;
9 months ago
height: 68rpx;
9 months ago
background: #FFFFFF;
border-radius: 4rpx;
border: 1rpx solid #EBEBEB;
padding: 0 20rpx;
font-size: 28rpx;
}
}
.priceTime {
9 months ago
margin-bottom: 20rpx;
9 months ago
.text {
width: 150rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #262626;
line-height: 72rpx;
text-align: left;
font-style: normal;
text-transform: none;
}
.priceDate {
display: flex;
align-items: center;
.selectTime {
width: 238rpx;
height: 70rpx;
background: #F3F3F3;
border-radius: 44rpx;
text-align: center;
line-height: 70rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
color: #A1A1A1;
font-style: normal;
text-transform: none;
}
text {
margin: 0 15rpx;
}
}
}
// ::v-deep .u-input {
// height: 70upx;
// background: #F3F3F3;
// border-radius: 22px 22px 22px 22px;
// opacity: 1;
// text-align: center;
// }
// ::v-deep .u-input__input {
// text-align: center;
// }
}
.btnGroup {
9 months ago
margin: 40rpx;
9 months ago
display: flex;
9 months ago
justify-content: space-between;
9 months ago
align-items: center;
.reset {
width: 216upx;
height: 70upx;
background: #E9E9E9;
border-radius: 22px 22px 22px 22px;
opacity: 1;
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #585858;
line-height: 70upx;
text-align: center;
}
.submit {
width: 216upx;
height: 70upx;
background: linear-gradient(180deg, #FD5D06 0%, #F3211A 100%);
border-radius: 50px 50px 50px 50px;
opacity: 1;
font-size: 28upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
line-height: 70upx;
text-align: center;
}
}
}
</style>