修复部分bug
This commit is contained in:
@@ -79,7 +79,20 @@
|
||||
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
|
||||
<block v-if="timeIndex === 0">
|
||||
<view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' 至 ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view>
|
||||
<tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/>
|
||||
<u-calendar
|
||||
:safe-area-inset-bottom="true"
|
||||
v-model="showDatePicker"
|
||||
mode="range"
|
||||
active-bg-color="#e93340"
|
||||
range-bg-color="rgba(0, 0, 0, .05)"
|
||||
range-color="#e93340"
|
||||
btn-type="default"
|
||||
max-date="2099-12-12"
|
||||
:min-date="minDate"
|
||||
@change="confirmDatePicker"
|
||||
>
|
||||
</u-calendar>
|
||||
<!-- <tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/> -->
|
||||
</block>
|
||||
<block v-if="timeIndex === 1">
|
||||
<view class="input-number">
|
||||
@@ -107,6 +120,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import date from '@/public/date'
|
||||
import TnDatePicker from "@/components/tn-datepicker/tn-datepicker";
|
||||
import { uploads } from '@/apis/interfaces/uploading'
|
||||
import { pushCoupons } from '@/apis/interfaces/coupons'
|
||||
@@ -138,12 +152,19 @@
|
||||
price : '', // 减少金额
|
||||
description : '', // 使用规则
|
||||
coupongoods : [], // 关联商品
|
||||
timeNumber : 1 // 延期券时间
|
||||
timeNumber : 1 , // 延期券时间
|
||||
minDate : '' // 优惠券最小期限
|
||||
};
|
||||
},
|
||||
onShow(){
|
||||
new date().then(res => {
|
||||
this.minDate = res
|
||||
})
|
||||
this.coupongoods = this.$store.getters.getCoupongoods
|
||||
},
|
||||
onUnload() {
|
||||
this.$store.commit('setCoupongoods', [])
|
||||
},
|
||||
methods:{
|
||||
// 发券数量
|
||||
quantityChange(value){
|
||||
@@ -163,11 +184,15 @@
|
||||
},
|
||||
// 选择
|
||||
changePicker(e){
|
||||
if(e.target.dataset.type === 'typeIndex'){
|
||||
this.$store.commit('setCoupongoods', [])
|
||||
this.coupongoods = this.$store.getters.getCoupongoods
|
||||
}
|
||||
this[e.target.dataset.type] = e.detail.value
|
||||
},
|
||||
// 日期
|
||||
confirmDatePicker(e){
|
||||
this.datePickerValue = e.value
|
||||
this.datePickerValue = [e.startDate , e.endDate]
|
||||
this.showDatePicker = false
|
||||
},
|
||||
// 上传优惠券封面
|
||||
|
||||
Reference in New Issue
Block a user