|
|
|
|
@ -7,22 +7,21 @@
|
|
|
|
|
<view class="book-box">
|
|
|
|
|
<view class="activityBox-content flex-col">
|
|
|
|
|
<view class="activityBox-row" style="margin-bottom: 56rpx;">
|
|
|
|
|
<text class="activityBox-title">{{info.name}}</text>
|
|
|
|
|
<text class="activityBox-title">{{info.name||""}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-shijian iconfont"></text>
|
|
|
|
|
<text>预约可入场时间段:{{info.start_time}}-{{info.end_time}}</text>
|
|
|
|
|
|
|
|
|
|
<text>可入场时间段:{{info.start_time||""}}-{{info.end_time||""}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row">
|
|
|
|
|
<text class="icon-huodong iconfont"></text>
|
|
|
|
|
<text>地址:{{info.address}}</text>
|
|
|
|
|
<text>地址:{{info.address||""}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view class="activityBox-row flex-row align-center" style="margin-bottom: 0rpx;"
|
|
|
|
|
@click="openlocation">
|
|
|
|
|
<text class="icon-ditu-dibiao iconfont"></text>
|
|
|
|
|
<text>距离:11.3km</text>
|
|
|
|
|
<text>距离:{{distance||"0"}}km</text>
|
|
|
|
|
<view class="tomap">
|
|
|
|
|
<text class="icon-daohang1 iconfont" style="margin-right: 0;"></text>
|
|
|
|
|
</view>
|
|
|
|
|
@ -31,31 +30,35 @@
|
|
|
|
|
<view class="parkbox-title">可预约车位</view>
|
|
|
|
|
<view class="parkbox-content flex-row justify-around">
|
|
|
|
|
<view class="parkbox-item flex-row align-center" style="margin-right: 15rpx;"
|
|
|
|
|
@click="handleSelectPark(2)" :class="(currentPark==2?'parkbox-item-on':'')">
|
|
|
|
|
@click="handleSelectPark(2)" :class="(currentPark==2?'parkbox-item-on':'')"
|
|
|
|
|
v-if="remain_big_park>0">
|
|
|
|
|
<view class="parkbox-item-status" v-if="currentPark==2">
|
|
|
|
|
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
<text class="iconfont icon-tingchechang1" style="font-size: 28rpx;"></text>
|
|
|
|
|
<view>
|
|
|
|
|
<text>大中:{{info.big_park_total}}</text>
|
|
|
|
|
<text>大中:{{remain_big_park}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="parkbox-item flex-col align-center"
|
|
|
|
|
:class="(currentPark==1?'parkbox-item-on':'')" @click="handleSelectPark(1)"
|
|
|
|
|
style="margin-left: 15rpx;">
|
|
|
|
|
style="margin-left: 15rpx;" v-if="remain_small_park>0">
|
|
|
|
|
<view class="parkbox-item-status" v-if="currentPark==1">
|
|
|
|
|
<u-icon name="checkmark" color="#fff" size="20rpx"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="flex-row align-center">
|
|
|
|
|
<text class="iconfont icon-tingchechang1"
|
|
|
|
|
style="font-size: 28rpx;"></text><text>小车:{{info.small_park_total}}</text>
|
|
|
|
|
style="font-size: 28rpx;"></text><text>小车:{{remain_small_park}}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<text
|
|
|
|
|
style="font-size: 24rpx;color: #828282;">(充电桩空闲{{info.charge_total}})</text>
|
|
|
|
|
<text style="font-size: 24rpx;color: #828282;">(充电桩空闲0)</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="activityBox-row" style="margin-top: 20rpx;color: #EF9525;" @click="showSelectorder=true">
|
|
|
|
|
<text>选择信息:{{selectInfo.info||"暂未选择"}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
@ -65,6 +68,52 @@
|
|
|
|
|
</map>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<u-popup :show="showSelectorder" mode="bottom" :closeOnClickOverlay="false" @close="closeorder" :round="10">
|
|
|
|
|
<view class="mpopup">
|
|
|
|
|
<view class="mpopup-title">
|
|
|
|
|
选择预约的活动或者预约的参观
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mpopup-content" style="padding: 40rpx 20rpx;">
|
|
|
|
|
<view v-if="listOrder.length!=0">
|
|
|
|
|
<view class="mpopup-title" style="text-align: left;padding: 20rpx 0;font-size: 14px;">
|
|
|
|
|
预约的参观
|
|
|
|
|
</view>
|
|
|
|
|
<block v-for="(item,index) in listOrder" :key="index">
|
|
|
|
|
<view class="box-tip flex-row align-center" @click="handleSelectOrder(index,1)"
|
|
|
|
|
style="margin-bottom: 20rpx;">
|
|
|
|
|
<u-icon :name="(item.checked?'checkmark-circle-fill':'checkmark-circle')"
|
|
|
|
|
color="#EF9525">
|
|
|
|
|
</u-icon>
|
|
|
|
|
<view class="box-tiptxt" style="margin-left: 10rpx;">
|
|
|
|
|
{{$u.timeFormat(new Date(item.date), 'mm月dd日')}}
|
|
|
|
|
{{item.time}}丨{{item.details_count}} 位观众</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="listActivtyOrder.length!=0">
|
|
|
|
|
<view class="mpopup-title" style="text-align: left;padding: 20rpx 0;font-size: 14px;">
|
|
|
|
|
预约的活动
|
|
|
|
|
</view>
|
|
|
|
|
<block v-for="(item,index) in listActivtyOrder" :key="index">
|
|
|
|
|
<view class="box-tip flex-row align-center" @click="handleSelectOrder(index,2)"
|
|
|
|
|
style="margin-bottom: 20rpx;">
|
|
|
|
|
<u-icon :name="(item.checked?'checkmark-circle-fill':'checkmark-circle')"
|
|
|
|
|
color="#EF9525">
|
|
|
|
|
</u-icon>
|
|
|
|
|
<view class="box-tiptxt" style="margin-left: 10rpx;">
|
|
|
|
|
活动时间:{{item.activity.start_time}}
|
|
|
|
|
报名数量:{{item.total}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
<u-button type="primary" @click="handleConfirmOrder">确定</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -74,27 +123,90 @@
|
|
|
|
|
return {
|
|
|
|
|
latitude: 31.299893,
|
|
|
|
|
longitude: 120.626022,
|
|
|
|
|
userlatitude: 31.299893,
|
|
|
|
|
userlongitude: 120.626022,
|
|
|
|
|
distance: 0,
|
|
|
|
|
info: {},
|
|
|
|
|
covers: [],
|
|
|
|
|
currentPark: 1,
|
|
|
|
|
btnDisabled: false
|
|
|
|
|
btnDisabled: false,
|
|
|
|
|
showSelectorder: false,
|
|
|
|
|
listOrder: [],
|
|
|
|
|
listActivtyOrder: [],
|
|
|
|
|
selectInfo: {
|
|
|
|
|
info: "",
|
|
|
|
|
orderType: 1,
|
|
|
|
|
orderid: 0,
|
|
|
|
|
userlatitude: 31.299893,
|
|
|
|
|
userlongitude: 120.626022
|
|
|
|
|
},
|
|
|
|
|
remain_big_park: 0,
|
|
|
|
|
remain_small_park: 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.loadInfo();
|
|
|
|
|
this.loadOrder(function(res) {
|
|
|
|
|
that.loadactivityOrder(function(r) {
|
|
|
|
|
if (res.length + r.length == 0) {
|
|
|
|
|
that.util.toast("请先预约活动或参观")
|
|
|
|
|
that.btnDisabled = true;
|
|
|
|
|
} else {
|
|
|
|
|
that.btnDisabled = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
wx.getLocation({
|
|
|
|
|
success(res) {
|
|
|
|
|
that.userlatitude = res.latitude;
|
|
|
|
|
that.userlongitude = res.longitude;
|
|
|
|
|
that.loadOrder(function(res) {
|
|
|
|
|
that.loadactivityOrder(function(r) {
|
|
|
|
|
if (res.length + r.length == 0) {
|
|
|
|
|
that.util.toast("您需要预约参观或者预约活动才可以停车");
|
|
|
|
|
that.btnDisabled = true;
|
|
|
|
|
} else {
|
|
|
|
|
that.btnDisabled = false;
|
|
|
|
|
that.showSelectorder = true;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleConfirmOrder() {
|
|
|
|
|
if (this.selectInfo.orderid === 0) {
|
|
|
|
|
this.util.toast("请选择预约的活动或者预约的参观");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
this.showSelectorder = false;
|
|
|
|
|
},
|
|
|
|
|
handleSelectOrder(index, type) {
|
|
|
|
|
for (var m of this.listActivtyOrder) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
for (var m of this.listOrder) {
|
|
|
|
|
m.checked = false;
|
|
|
|
|
}
|
|
|
|
|
if (type == 1) {
|
|
|
|
|
this.listOrder[index].checked = true;
|
|
|
|
|
this.selectInfo.info = this.$moment(this.listOrder[index].date).format("MM月DD日") + " " + this
|
|
|
|
|
.listOrder[
|
|
|
|
|
index].time
|
|
|
|
|
this.selectInfo.time = this.$moment(this.listOrder[index].date + " " + this.listOrder[
|
|
|
|
|
index].time.split("-")[0]).format("YYYY-MM-DD hh:mm:ss");
|
|
|
|
|
this.selectInfo.orderid = this.orderid = this.listOrder[index].id;
|
|
|
|
|
} else {
|
|
|
|
|
this.listActivtyOrder[index].checked = true
|
|
|
|
|
this.selectInfo.info = this.$moment(this.listActivtyOrder[index].activity.start_time).format(
|
|
|
|
|
"MM月DD日 hh:mm")
|
|
|
|
|
|
|
|
|
|
this.selectInfo.time = this.$moment(this.listActivtyOrder[index].activity.start_time).format(
|
|
|
|
|
"YYYY-MM-DD hh:mm:ss");
|
|
|
|
|
this.selectInfo.orderid = this.orderid = this.listActivtyOrder[index].id;
|
|
|
|
|
}
|
|
|
|
|
this.orderType = type;
|
|
|
|
|
this.selectInfo.orderType = type;
|
|
|
|
|
this.loadInfo();
|
|
|
|
|
},
|
|
|
|
|
openselectorder() {
|
|
|
|
|
this.showSelectorder = true;
|
|
|
|
|
},
|
|
|
|
|
closeorder() {
|
|
|
|
|
this.showSelectorder = false;
|
|
|
|
|
},
|
|
|
|
|
loadOrder(cb) {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.util.request({
|
|
|
|
|
@ -103,6 +215,10 @@
|
|
|
|
|
status: 1
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
for (var mod of res) {
|
|
|
|
|
mod.checked = false;
|
|
|
|
|
}
|
|
|
|
|
that.listOrder = res;
|
|
|
|
|
cb(res)
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
@ -118,6 +234,10 @@
|
|
|
|
|
status: 1
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
for (var mod of res) {
|
|
|
|
|
mod.checked = false;
|
|
|
|
|
}
|
|
|
|
|
that.listActivtyOrder = res;
|
|
|
|
|
cb(res);
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
@ -125,6 +245,7 @@
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleSelectPark(type) {
|
|
|
|
|
this.currentPark = type;
|
|
|
|
|
},
|
|
|
|
|
@ -136,24 +257,31 @@
|
|
|
|
|
address: this.info.address
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
loadInfo(cb) {
|
|
|
|
|
loadInfo() {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.util.request({
|
|
|
|
|
api: '/api/mobile/carpark/index',
|
|
|
|
|
utilSuccess: function(r) {
|
|
|
|
|
var res = r[0];
|
|
|
|
|
res.latitude = parseFloat(res.latitude);
|
|
|
|
|
res.longitude = parseFloat(res.longitude);
|
|
|
|
|
that.info = res;
|
|
|
|
|
api: '/api/mobile/carpark/show',
|
|
|
|
|
data: {
|
|
|
|
|
date: that.selectInfo.time,
|
|
|
|
|
latitude: that.userlatitude,
|
|
|
|
|
longitude: that.userlongitude
|
|
|
|
|
},
|
|
|
|
|
utilSuccess: function(res) {
|
|
|
|
|
that.info = res.detail;
|
|
|
|
|
that.distance = res.distance;
|
|
|
|
|
that.info.latitude = parseFloat(res.detail.latitude);
|
|
|
|
|
that.info.longitude = parseFloat(res.detail.longitude);
|
|
|
|
|
that.remain_big_park = res.remain_big_park;
|
|
|
|
|
that.remain_small_park = res.remain_small_park;
|
|
|
|
|
var mod = {
|
|
|
|
|
latitude: res.latitude,
|
|
|
|
|
longitude: res.longitude,
|
|
|
|
|
latitude: that.info.latitude,
|
|
|
|
|
longitude: that.info.longitude,
|
|
|
|
|
width: 70,
|
|
|
|
|
height: 70,
|
|
|
|
|
iconPath: '/static/img/location.png'
|
|
|
|
|
iconPath: '/static/img/location.png',
|
|
|
|
|
id: 1
|
|
|
|
|
}
|
|
|
|
|
that.covers.push(mod);
|
|
|
|
|
cb(res);
|
|
|
|
|
},
|
|
|
|
|
utilFail: function(res) {
|
|
|
|
|
|
|
|
|
|
@ -164,9 +292,16 @@
|
|
|
|
|
uni.$u.throttle(this.tobook, 500)
|
|
|
|
|
},
|
|
|
|
|
tobook() {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: "book?id=" + this.info.id + "¤tPark=" + this.currentPark
|
|
|
|
|
})
|
|
|
|
|
if (this.selectInfo.orderid === 0) {
|
|
|
|
|
this.util.toast("请选择预约的活动或者预约的参观");
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
var json = escape(JSON.stringify(this.selectInfo));
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: "book?bookinfo=" + json + "&id=" + this.info.id + "¤tPark=" + this.currentPark
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|