|
@@ -41,9 +41,9 @@ class PublicContent extends Component{
|
|
|
|
|
|
componentDidMount() {
|
|
|
Taro.eventCenter.on('result', () => {
|
|
|
- this.rangeEndRef.clear();
|
|
|
- this.rangeStartRef.clear();
|
|
|
- this.imagePickerRef.clear();
|
|
|
+ this.rangeEndRef && this.rangeEndRef.clear();
|
|
|
+ this.rangeStartRef && this.rangeStartRef.clear();
|
|
|
+ this.imagePickerRef && this.imagePickerRef.clear();
|
|
|
this.setState({
|
|
|
rangeStartVal:'',
|
|
|
rangeEndVal:'',
|
|
@@ -155,14 +155,9 @@ class PublicContent extends Component{
|
|
|
selectArrder(){
|
|
|
const key = 'AWBBZ-GRAC2-JFYUO-CLA7I-JAHXK-YFFGT'; //使用在腾讯位置服务申请的key
|
|
|
const referer = '科德打卡定位'; //调用插件的app的名称
|
|
|
- const location = JSON.stringify({
|
|
|
- latitude: 39.89631551,
|
|
|
- longitude: 116.323459711
|
|
|
- });
|
|
|
- const category = '生活服务,娱乐休闲';
|
|
|
-
|
|
|
+ const category = '公司企业,房产小区';
|
|
|
Taro.navigateTo({
|
|
|
- url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&location=' + location + '&category=' + category
|
|
|
+ url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&category=' + category
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -191,9 +186,15 @@ class PublicContent extends Component{
|
|
|
<DateTimePicker ref={ref=>this.rangeStartRef = ref} onOk={(current)=>{
|
|
|
let arr = [];
|
|
|
if(this.state.rangeEndVal){
|
|
|
- if(dayjs(current.current).isAfter(dayjs(this.state.rangeEndVal.split('-')))){
|
|
|
+ if(dayjs(current.current).isAfter(dayjs(this.state.rangeEndMinuteVal))){
|
|
|
Taro.showToast({title:'开始时间不能在结束时间之后',icon:'none'})
|
|
|
this.rangeStartRef.clear();
|
|
|
+ this.setState({
|
|
|
+ rangeStartVal:'',
|
|
|
+ rangeStartMinuteVal: '',
|
|
|
+ validDates:[],
|
|
|
+ totalDuration:0
|
|
|
+ })
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -237,9 +238,15 @@ class PublicContent extends Component{
|
|
|
<DateTimePicker ref={ref=>this.rangeEndRef = ref} onOk={(current)=>{
|
|
|
let arr = [];
|
|
|
if(this.state.rangeStartVal){
|
|
|
- if(dayjs(current.current).isBefore(dayjs(this.state.rangeStartVal.split('-')))){
|
|
|
+ if(dayjs(current.current).isBefore(dayjs(this.state.rangeStartMinuteVal))){
|
|
|
Taro.showToast({title:'结束时间不能在开始时间之前',icon:'none'})
|
|
|
this.rangeEndRef.clear();
|
|
|
+ this.setState({
|
|
|
+ rangeEndVal:'',
|
|
|
+ rangeEndMinuteVal: '',
|
|
|
+ validDates:[],
|
|
|
+ totalDuration:0
|
|
|
+ })
|
|
|
return;
|
|
|
}
|
|
|
}
|