增加上门时间
This commit is contained in:
parent
144433d920
commit
0bc72d8603
@ -19,7 +19,9 @@
|
||||
<u-text size="28" :text="dlCurrent.item.title"></u-text>
|
||||
</u-col>
|
||||
<view span="2" class="chk-icon">
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-row>
|
||||
<u-line margin="20rpx 0 0 0"></u-line>
|
||||
|
||||
@ -15,7 +15,9 @@
|
||||
<u-text size="30" :text="dlCurrent.item.title"></u-text>
|
||||
</u-col>
|
||||
<view v-if="dlCurrent.item.val != payTypeEnum.postMonth" span="2" class="chk-icon">
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-row>
|
||||
<u-text v-if="dlCurrent.item.desc" size="28" :text="dlCurrent.item.desc" color="#999"></u-text>
|
||||
@ -35,7 +37,9 @@
|
||||
{{caCurrent.item.title}}
|
||||
</u-col>
|
||||
<view span="2" class="chk-icon">
|
||||
<u-checkbox :checked="caCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox :checked="caCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-row>
|
||||
</view>
|
||||
|
||||
201
components/buns-revtime-sheet/buns-revtime-sheet.vue
Normal file
201
components/buns-revtime-sheet/buns-revtime-sheet.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<tpx-dialog :show="show" title="上门取件时间" @onClose="handleCloseModal()">
|
||||
<view style="position: relative;height: calc(70vh);">
|
||||
<tpx-layout>
|
||||
<template v-slot:body>
|
||||
<view class="shet-cont">
|
||||
<view>
|
||||
<u-text :text="tips" size="28" color="#999" margin="0 0 20rpx 0"></u-text>
|
||||
</view>
|
||||
<view style="flex: 1;">
|
||||
<view style="display: flex;flex-direction: row;height: 100%;">
|
||||
<view style="width: 300rpx;height: 100%;background-color:#F6F6F6;">
|
||||
<tpx-checkitems :list="dayList"
|
||||
v-model:value="model.date" v-slot="dCurrent" min-checked="1" type="single"
|
||||
>
|
||||
<view slot :class="`day-item ${dCurrent.checked?'active':''}`">
|
||||
{{ dCurrent.item.title }}
|
||||
</view>
|
||||
</tpx-checkitems>
|
||||
</view>
|
||||
<view style="flex: 1;position: relative;">
|
||||
<view class="pos-abt-all" style="overflow-y: auto;">
|
||||
<tpx-checkitems :list="timeFilterList"
|
||||
v-model:value="model.time" v-slot="tCurrent" min-checked="1" type="single"
|
||||
>
|
||||
<view slot :class="`time-item ${tCurrent.checked?'active':''}`">
|
||||
<u-row justify="between">
|
||||
<view>
|
||||
{{ tCurrent.item.title }}
|
||||
</view>
|
||||
<view v-if="tCurrent.checked">
|
||||
<u-icon name="checkbox-mark" size="32" :bold="true"
|
||||
:custom-style="`${tCurrent.checked?'color:#B12D29;':''}`"
|
||||
></u-icon>
|
||||
</view>
|
||||
</u-row>
|
||||
</view>
|
||||
</tpx-checkitems>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-slot:footer>
|
||||
<view class="blcok-white-noradius" style="margin-top: 0;margin-bottom: 0;">
|
||||
<u-button @click="handleEditItem()" type="primary" size="large" shape="circle"
|
||||
custom-style="height:80rpx;font-size: 30rpx;"
|
||||
>确认</u-button>
|
||||
</view>
|
||||
</template>
|
||||
</tpx-layout>
|
||||
</view>
|
||||
</tpx-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setClipboardData } from "@/common/untool"
|
||||
import dayjs from 'dayjs/esm/index'
|
||||
export default {
|
||||
computed: {
|
||||
timeFilterList() {
|
||||
const _this = this
|
||||
let list = []
|
||||
const tItem = this.dayList.filter(t=> _this.model.date == t.val)[0] || {}
|
||||
list = tItem.timeList || []
|
||||
return list
|
||||
},
|
||||
},
|
||||
props: {
|
||||
show: {
|
||||
default () {
|
||||
return false
|
||||
}
|
||||
},
|
||||
value: {
|
||||
default () {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tips: '推荐上午 9:00 - 15:00 之间',
|
||||
range: [8, 19],
|
||||
model: {
|
||||
date: '',
|
||||
time: ''
|
||||
},
|
||||
dayList: [
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.initData()
|
||||
},
|
||||
onHide() {
|
||||
|
||||
},
|
||||
destroyed() {},
|
||||
|
||||
methods: {
|
||||
initData() {
|
||||
this.makeList()
|
||||
// 默认值
|
||||
this.model.date = this.dayList[0].val
|
||||
},
|
||||
makeList() {
|
||||
const _this = this
|
||||
const now = dayjs(new Date())
|
||||
const nowDate = dayjs(now).format('YYYY-MM-DD')
|
||||
const plus1Date = dayjs(nowDate).add(1, 'day').format('YYYY-MM-DD')
|
||||
const plus2Date = dayjs(nowDate).add(2, 'day').format('YYYY-MM-DD')
|
||||
const nowHour = now.get("hours")
|
||||
let dayList = [
|
||||
{ title: '今天', val: nowDate },
|
||||
{ title: '明天', val: plus1Date },
|
||||
{ title: '后天', val: plus2Date }
|
||||
]
|
||||
dayList.map((dItem, dIndex)=> {
|
||||
const timeList = []
|
||||
let start = _this.range[0]
|
||||
let end = _this.range[1]
|
||||
if(dIndex == 0) {
|
||||
start = nowHour + 1
|
||||
}
|
||||
for(var tIndex = start; tIndex <= end; tIndex ++) {
|
||||
let cTlt = '', cVal
|
||||
let timeStr = `${tIndex < 10?'0':''}${tIndex}:00`
|
||||
let timeNextStr = `${(tIndex + 1) < 10?'0':''}${(tIndex + 1)}:00`
|
||||
cVal = timeStr
|
||||
cTlt = `${timeStr}-${timeNextStr}`
|
||||
if(dIndex == 0 && tIndex == start) {
|
||||
cTlt = '一小时内'
|
||||
}
|
||||
timeList.push({
|
||||
title: cTlt , val: cVal
|
||||
})
|
||||
}
|
||||
dItem.timeList = timeList
|
||||
})
|
||||
dayList = dayList.filter(d=> d.timeList.length > 0)
|
||||
this.dayList = dayList
|
||||
},
|
||||
handleCloseModal() {
|
||||
this.$emit('update:show', false)
|
||||
},
|
||||
handleEditItem() {
|
||||
const { date, time } = this.model
|
||||
const value = `${date} ${time}`
|
||||
this.$emit('onChange', this.model)
|
||||
this.$emit('update:value', value)
|
||||
this.handleCloseModal()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shet-cont{
|
||||
height: 100%;
|
||||
padding: 10rpx 0 30rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.chk-icon{
|
||||
position: relative;
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.day-item{
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
&.active{
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.time-item{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
padding-left: 100rpx;
|
||||
&.active{
|
||||
font-weight: 600;
|
||||
color: $uni-color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -22,7 +22,9 @@
|
||||
<u-text size="28" :text="dlCurrent.item.title"></u-text>
|
||||
</u-col>
|
||||
<view span="2" class="chk-icon">
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-row>
|
||||
<view v-if="dlCurrent.checked" class="w-tem" @click="handleCopy(dlCurrent.item)">
|
||||
|
||||
@ -19,7 +19,9 @@
|
||||
<u-text size="28" :text="dlCurrent.item.title"></u-text>
|
||||
</u-col>
|
||||
<view span="2" class="chk-icon">
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
<u-checkbox-group>
|
||||
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
</u-row>
|
||||
<u-line margin="20rpx 0 0 0"></u-line>
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
</u-row>
|
||||
</view>
|
||||
|
||||
<view class="pt-30 pb-30" style="border-bottom: 2rpx solid #F6F6F6;;">
|
||||
<view @click="handleDialogClick(revtimeModal)" class="pt-30 pb-30" style="border-bottom: 2rpx solid #F6F6F6;;">
|
||||
<u-row>
|
||||
<view>
|
||||
<u-text text="期望上门时间 " size="28" :bold="true"></u-text>
|
||||
@ -237,6 +237,7 @@
|
||||
<buns-stockroom-sheet v-model:show="stockRoomModal.show" v-model:value="submitParam.stockRoomId"></buns-stockroom-sheet>
|
||||
<buns-paytype-sheet v-model:show="paytypeModal.show" v-model:value="submitParam.paytype"></buns-paytype-sheet>
|
||||
<buns-privacy-dialog v-model:show="privacyModal.show"> </buns-privacy-dialog>
|
||||
<buns-revtime-sheet v-model:show="revtimeModal.show" v-model:value="submitParam.revtime"></buns-revtime-sheet>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -256,7 +257,7 @@
|
||||
return {
|
||||
...(JSON.parse(JSON.stringify({ sendTypeEnum, sendTypeList }))),
|
||||
proList: [
|
||||
{val: 1},{val: 2}
|
||||
{val: 1 },{ val: 2 }
|
||||
],
|
||||
tipsList: [
|
||||
{ title: '请带纸箱', val: '请带纸箱' },
|
||||
@ -280,6 +281,9 @@
|
||||
privacyModal: {
|
||||
show: false,
|
||||
},
|
||||
revtimeModal: {
|
||||
show: false,
|
||||
},
|
||||
submitParam: {
|
||||
stockRoomId: '',
|
||||
countryId: '',
|
||||
@ -289,6 +293,7 @@
|
||||
otherDes: '',
|
||||
prodId: 1,
|
||||
tips: [],
|
||||
revtime: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user