1234567891011121314151617181920212223242526272829303132 |
- Vue.component('signal-source', {
- template:
- '<div><div class="c-f16 c-border-b pb5">号  源</div>\
- <ul class="clearfix pl40">\
- <li v-for="(list, index) in detailtime" class="fl mr30 mb20" >\
- <a v-show="list.max - list.used > 0" class="fc-12b7f5 bd1 h38" title="预约时间段" @click="looking(list)">{{handleTime(list.startTime)}} - {{handleTime(list.endTime)}}</a>\
- <a v-show="list.max - list.used <= 0" class="fc-fff bgc-d7dce6 bd1 h38">{{handleTime(list.startTime)}} - {{handleTime(list.endTime)}}</a>\
- </li>\
- </ul>\
- </div>',
- props: ['detailtime'],
- data: function () {
- return {}
- },
- mounted: function () {},
- methods: {
- looking: function (list) {
- this.$emit('booking', list)
- },
- handleTime: function (data) {
- var time = data.split(' ')[1],
- str = this.add0(time.split(':')[0]) + ':' + time.split(':')[1]
- return str
- },
- add0: function (num) {
- if (num < 10) {
- return '0' + num
- }
- return num
- }
- }
- })
|