|
@@ -112,7 +112,7 @@
|
|
|
<u-line color="#EEEEEE" />
|
|
|
<view class="foot" v-if="activeList.subscribeStatus === 1">
|
|
|
<view class="btn" @click="hideModel">知道了</view>
|
|
|
- <view class="btn cancel" v-if="isShowFun(activeList.applyEndTime)" @click="cancelBtn">取消预约</view>
|
|
|
+ <view class="btn cancel" v-if="isShowFun(activeList)" @click="cancelBtn">取消预约</view>
|
|
|
</view>
|
|
|
<view class="foot" v-else><view class="abtns" @click="hideModel">知道了</view></view>
|
|
|
</view>
|
|
@@ -185,12 +185,38 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- isShowFun(times){
|
|
|
- var timestamp=parseInt(new Date().getTime() / 1000)
|
|
|
- if(times < timestamp){
|
|
|
- return false
|
|
|
- }else{
|
|
|
- return true
|
|
|
+ isShowFun(times) {
|
|
|
+ var timestamp = parseInt(new Date().getTime() / 1000);
|
|
|
+ var newDataAge = parseInt(new Date(new Date().toLocaleDateString()).getTime() / 1000);
|
|
|
+ if (times.applyEndTime < timestamp) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ if (times.beforeStatus === 1) {
|
|
|
+ return false;
|
|
|
+ } else if (times.examStatus !== 0) {
|
|
|
+ return false;
|
|
|
+ } else if (times.applySiteExamTime < times.newDataAge) {
|
|
|
+ return false;
|
|
|
+ } else if (times.applySiteExamTime > times.newDataAge) {
|
|
|
+ return true;
|
|
|
+ } else if (times.applySiteExamTime == times.newDataAge) {
|
|
|
+ var hours = new Date().getHours();
|
|
|
+ var mins = new Date().getMinutes();
|
|
|
+ var arrays = times.applySiteStartTime.split('-').map(Number);
|
|
|
+ if (arrays[0] > hours) {
|
|
|
+ return true;
|
|
|
+ } else if (arrays[0] < hours) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ if (arrays[1] <= mins) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
showDetails(item) {
|
|
@@ -204,6 +230,14 @@ export default {
|
|
|
this.details_show = false;
|
|
|
},
|
|
|
submit() {
|
|
|
+ var bols = this.isShowFun(this.activeList)
|
|
|
+ if(!bols){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"当前已无法取消预约"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$api
|
|
|
.editApply({
|
|
|
subscribeId: this.activeList.subscribeId,
|