Commit 730e1a07 authored by IvyXia123's avatar IvyXia123

ui

parent 9c2f7c50
...@@ -14,16 +14,14 @@ ...@@ -14,16 +14,14 @@
</div> </div>
</div> </div>
<div class="preservation" @click="preservationClick">保存</div> <div class="preservation" @click="preservationClick">保存</div>
<div class="bottom-top">
<van-popup v-model="dateShow" position="bottom"> <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> </van-popup>
</div> </div>
</div>
</template> </template>
<script> <script>
import { postNotifySettingApi, getNotifyApi } from "../../service/api"; import { postNotifySettingApi } from "../../service/api";
import { DatetimePicker, Popup, Toast } from 'vant'; import { DatetimePicker, Popup, Toast } from 'vant';
import tishiTimer from '../../assets/evaluate/tishi_timer.png' import tishiTimer from '../../assets/evaluate/tishi_timer.png'
import youjiantou from '../../assets/evaluate/youjiantou.png' import youjiantou from '../../assets/evaluate/youjiantou.png'
...@@ -32,9 +30,7 @@ ...@@ -32,9 +30,7 @@
name: "promptTime", name: "promptTime",
data() { data() {
return { return {
currentTime: '07:00', currentTime: '',
minHour: 7,
maxHour: 22,
dateVal: '', dateVal: '',
dateShow: false, dateShow: false,
selectedValue: '', selectedValue: '',
...@@ -46,18 +42,10 @@ ...@@ -46,18 +42,10 @@
[DatetimePicker.name]: DatetimePicker, [DatetimePicker.name]: DatetimePicker,
[Popup.name]: Popup, [Popup.name]: Popup,
}, },
watch: {
dateShow(val) {
if(!val) {
this.contentFn()
}
}
},
methods: { methods: {
dateShowClick() { dateShowClick() {
this.dateShow = true; this.dateShow = true;
this.$nextTick(() => { this.$nextTick(() => {
document.querySelectorAll('.van-picker__confirm')[0].innerText = '完成'
document.querySelectorAll('.van-picker-column')[1].style.display = 'none'; document.querySelectorAll('.van-picker-column')[1].style.display = 'none';
let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li'); let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li');
for (var i = 0; i < oLi.length; i++) { for (var i = 0; i < oLi.length; i++) {
...@@ -81,61 +69,36 @@ ...@@ -81,61 +69,36 @@
} }
}, },
preservationClick() { 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 => { postNotifySettingApi(pushAtData).then(res => {
Toast("时间设定完成"); Toast("时间设定完成");
this.$router.go(-1); 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> </script>
<style lang="less"> <style lang="less">
@import "../../util/public"; @import "../../util/public";
.bottom-top {
.van-picker { .van-picker {
border-radius: 30 * @toVw 30 * @toVw 0 0; 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 { .van-picker-column__item {
color: #666666; color: #666666;
font-size: 17 * @toVw; font-size: 20 * @toVw;
} }
.van-picker-column__item--selected { .van-picker-column__item--selected {
color: #40A9FF; color: #40A9FF;
font-size: 21 * @toVw; font-size: 26 * @toVw;
}
} }
.prompt-time { .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