parent
6b9e290830
commit
928c5a06d3
@ -1,89 +0,0 @@
|
||||
import moment from "moment"
|
||||
import Dialog from "../../miniprogram_npm/@vant/weapp/dialog/dialog"
|
||||
Component({
|
||||
data: {
|
||||
start: moment().format("YYYY-MM-DD HH:mm:ss"),
|
||||
startTime: moment().valueOf(),
|
||||
end: moment().format("YYYY-MM-DD HH:mm:ss"),
|
||||
endTime: moment().valueOf(),
|
||||
show1: false,
|
||||
show2: false,
|
||||
dt: '',
|
||||
dt1: '',
|
||||
showDialog: false
|
||||
},
|
||||
methods: {
|
||||
onDisplay() {
|
||||
this.setData({
|
||||
show1: true
|
||||
});
|
||||
},
|
||||
onDisplay1() {
|
||||
this.setData({
|
||||
show2: true
|
||||
});
|
||||
},
|
||||
onInput(event) {
|
||||
let dt = moment(event.detail).format("YYYY-MM-DD HH:mm:ss");
|
||||
this.setData({
|
||||
dt: dt
|
||||
});
|
||||
},
|
||||
onInput1(event) {
|
||||
let dt = moment(event.detail).format("YYYY-MM-DD HH:mm:ss");
|
||||
this.setData({
|
||||
dt1: dt,
|
||||
});
|
||||
},
|
||||
onConfirm() {
|
||||
let isBefore = moment(this.data.dt).isBefore(this.data.dt1)
|
||||
if(!isBefore) {
|
||||
Dialog.alert({
|
||||
title: '注意',
|
||||
message: '开始时间不能大于结束时间',
|
||||
zIndex: 1000
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
show1: false,
|
||||
start: this.data.dt
|
||||
});
|
||||
},
|
||||
onConfirm1() {
|
||||
let isBefore = moment(this.data.dt).isBefore(this.data.dt1)
|
||||
if(!isBefore) {
|
||||
Dialog.alert({
|
||||
title: '注意',
|
||||
message: '开始时间不能大于结束时间',
|
||||
zIndex: 1000
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
show2: false,
|
||||
end: this.data.dt1
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({
|
||||
show1: false,
|
||||
});
|
||||
},
|
||||
onCancel1() {
|
||||
this.setData({
|
||||
show2: false,
|
||||
});
|
||||
},
|
||||
cdialog() {
|
||||
this.setData({
|
||||
showDialog: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
})
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<view class="tc-outer">
|
||||
<van-tabs type="card">
|
||||
<van-tab title="二十四小时"></van-tab>
|
||||
<van-tab title="最近七天"></van-tab>
|
||||
<van-tab title="最近三十天"></van-tab>
|
||||
<van-tab title="自定义">
|
||||
<van-cell title="选择开始时间" is-link value="{{ start }}" bind:click="onDisplay" />
|
||||
<van-cell title="选择结束时间" is-link value="{{ end }}" bind:click="onDisplay1" />
|
||||
<van-popup show="{{ show1 }}" position="bottom">
|
||||
<van-datetime-picker type="datetime" value="{{startTime}}" bind:input="onInput" bind:confirm="onConfirm"
|
||||
bind:cancel="onCancel" />
|
||||
</van-popup>
|
||||
<van-popup show="{{ show2 }}" position="bottom">
|
||||
<van-datetime-picker type="datetime" value="{{endTime}}" bind:input="onInput1" bind:confirm="onConfirm1"
|
||||
bind:cancel="onCancel1" />
|
||||
</van-popup>
|
||||
<van-dialog use-slot title="注意" show="{{ showDialog }}" bind:confirm="cdialog">
|
||||
<view class="tc-d-t">结束时间不能小于开始时间</view>
|
||||
</van-dialog>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
@ -1,7 +0,0 @@
|
||||
|
||||
.tc-d-t {
|
||||
font-size: 14px;
|
||||
padding: 15px 0px;
|
||||
color: #909497;
|
||||
text-align: center;
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"time-channel": "../../components/time-channel/index",
|
||||
"time-component": "../../components/timecomponent/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
|
@ -1,9 +1,11 @@
|
||||
<view class="view-page">
|
||||
<view class="navigation nav-top" style="background: #006BFF">
|
||||
<view class="bs-top-title">品牌洞察</view>
|
||||
<view class="v-t-outer">
|
||||
<time-component></time-component>
|
||||
<!-- <time-channel></time-channel> -->
|
||||
</view>
|
||||
<view class="bs-top-title">硕为思汽车智能洞察</view>
|
||||
<van-tabs class="menu-tabs" active="{{ active }}">
|
||||
<van-tab wx:for="{{navData}}" title="{{item.text}}" wx:key="index">
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
<view style="height: 180px;"></view>
|
||||
<c-dropdown tabs="{{dataArr}}"></c-dropdown>
|
||||
</view>
|
Loading…
Reference in new issue