Commit 730e1a07 authored by IvyXia123's avatar IvyXia123

ui

parent 9c2f7c50
......@@ -14,16 +14,14 @@
</div>
</div>
<div class="preservation" @click="preservationClick">保存</div>
<div class="bottom-top">
<van-popup v-model="dateShow" position="bottom">
<van-datetime-picker :min-hour="minHour" :max-hour="maxHour" @confirm="dateConfirm" @cancel="dateConfirmNo" v-model="currentTime" type="time"/>
<van-datetime-picker @confirm="dateConfirm" @cancel="dateConfirmNo" v-model="currentTime" type="time"/>
</van-popup>
</div>
</div>
</template>
<script>
import { postNotifySettingApi, getNotifyApi } from "../../service/api";
import { postNotifySettingApi } from "../../service/api";
import { DatetimePicker, Popup, Toast } from 'vant';
import tishiTimer from '../../assets/evaluate/tishi_timer.png'
import youjiantou from '../../assets/evaluate/youjiantou.png'
......@@ -32,9 +30,7 @@
name: "promptTime",
data() {
return {
currentTime: '07:00',
minHour: 7,
maxHour: 22,
currentTime: '',
dateVal: '',
dateShow: false,
selectedValue: '',
......@@ -46,18 +42,10 @@
[DatetimePicker.name]: DatetimePicker,
[Popup.name]: Popup,
},
watch: {
dateShow(val) {
if(!val) {
this.contentFn()
}
}
},
methods: {
dateShowClick() {
this.dateShow = true;
this.$nextTick(() => {
document.querySelectorAll('.van-picker__confirm')[0].innerText = '完成'
document.querySelectorAll('.van-picker-column')[1].style.display = 'none';
let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li');
for (var i = 0; i < oLi.length; i++) {
......@@ -81,61 +69,36 @@
}
},
preservationClick() {
let pushAtData = { time: this.currentTime, periods_id: this.$route.query.periods_id }
if(this.currentTime) {
let pushAtData = { time: this.currentTime }
postNotifySettingApi(pushAtData).then(res => {
Toast("时间设定完成");
this.$router.go(-1);
})
}else {
Toast("请先设定时间");
this.$refs.timeSetting.style.borderBottom = '1px solid red'
}
}
},
mounted() {
getNotifyApi(this.$route.query.periods_id).then(res => {
if(res.time)
this.currentTime = res.time.split(':')[0] + ':' + res.time.split(':')[1]
})
}
}
</script>
<style lang="less">
@import "../../util/public";
.bottom-top {
.van-picker {
border-radius: 30 * @toVw 30 * @toVw 0 0;
}
.van-picker__toolbar::after {
content: '';
border: none;
}
.van-picker__confirm {
color: #333333;
font-size: 15 * @toVw;
margin: 0;
padding-right: 30 * @toVw;
}
.van-picker__frame, .van-picker__loading .van-loading {
height: 54px!important;
}
.van-picker__cancel {
color: #333333;
font-size: 15 * @toVw;
margin: 0;
padding-left: 30 * @toVw;
}
.van-picker-column__item {
color: #666666;
font-size: 17 * @toVw;
font-size: 20 * @toVw;
}
.van-picker-column__item--selected {
color: #40A9FF;
font-size: 21 * @toVw;
}
font-size: 26 * @toVw;
}
.prompt-time {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment