|
@@ -73,7 +73,7 @@
|
|
:range="multiSelector"></u-picker> -->
|
|
:range="multiSelector"></u-picker> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-if="isjigou" bindtap="goAdrPostion" class="pr pt10 pb10 margin-lr-sm margin-top-sm m-bg-white" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
|
|
|
|
|
|
+ <view v-if="isjigou" @click="goAdrPostion" class="pr pt10 pb10 margin-lr-sm margin-top-sm m-bg-white" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
|
|
<view class="pr pt15 pb15">
|
|
<view class="pr pt15 pb15">
|
|
<view class="f18 fb plr15">机构地址</view>
|
|
<view class="f18 fb plr15">机构地址</view>
|
|
<view class="pr m-xcenter plr15 mt15">
|
|
<view class="pr m-xcenter plr15 mt15">
|
|
@@ -189,7 +189,9 @@
|
|
ismenzhen: false,
|
|
ismenzhen: false,
|
|
loading: true,
|
|
loading: true,
|
|
is_can_appoint: "",
|
|
is_can_appoint: "",
|
|
- dateshow: false
|
|
|
|
|
|
+ dateshow: false,
|
|
|
|
+ is_date_obsolete: "",
|
|
|
|
+ location: {}
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -236,10 +238,11 @@
|
|
gettime: async function() {
|
|
gettime: async function() {
|
|
this.multiSelector = []
|
|
this.multiSelector = []
|
|
let res = await this.$request.post("/api/v1/docter/schedulePeriodList", {
|
|
let res = await this.$request.post("/api/v1/docter/schedulePeriodList", {
|
|
- docter_id: this.doctorid
|
|
|
|
|
|
+ docter_id: this.doctorid,
|
|
|
|
+ latitude: uni.getStorageSync('latitude'),
|
|
|
|
+ longitude: uni.getStorageSync('longitude')
|
|
})
|
|
})
|
|
if (res.status == 0) {
|
|
if (res.status == 0) {
|
|
- console.log(res, "sssss")
|
|
|
|
if (res.data.data.length != 0) {
|
|
if (res.data.data.length != 0) {
|
|
// let nian = res.data.data.map(item => {
|
|
// let nian = res.data.data.map(item => {
|
|
// return item.schedule_date
|
|
// return item.schedule_date
|
|
@@ -284,6 +287,7 @@
|
|
if (item.id == itm.schedule_id) {
|
|
if (item.id == itm.schedule_id) {
|
|
itm.organization.org_id = itm.organization['id']
|
|
itm.organization.org_id = itm.organization['id']
|
|
return {
|
|
return {
|
|
|
|
+ yeardate: itm.schedule_date,
|
|
schedule_id: itm.schedule_id,
|
|
schedule_id: itm.schedule_id,
|
|
can_appoint_num: itm.can_appoint_num,
|
|
can_appoint_num: itm.can_appoint_num,
|
|
...itm.organization,
|
|
...itm.organization,
|
|
@@ -294,15 +298,27 @@
|
|
times.push(time)
|
|
times.push(time)
|
|
})
|
|
})
|
|
this.multiSelector.push(nian)
|
|
this.multiSelector.push(nian)
|
|
- times.forEach(item => {
|
|
|
|
|
|
+ times.forEach((item, index) => {
|
|
item.sort((a, b) => {
|
|
item.sort((a, b) => {
|
|
return a.end_time_period > b.end_time_period ? 1 : -1
|
|
return a.end_time_period > b.end_time_period ? 1 : -1
|
|
})
|
|
})
|
|
|
|
+ // for (let i = item.length - 1; i >= 0; i--) {
|
|
|
|
+ // let arr = item[i].yeardate + " " + item[i].end_time_period;
|
|
|
|
+ // arr = arr.split(/[- :]/)
|
|
|
|
+ // let nndate = Date.parse(new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4]));
|
|
|
|
+ // let currentTime = Date.parse(new Date())
|
|
|
|
+ // // console.log(nndate<currentTime,index)
|
|
|
|
+ // if (nndate < currentTime) {
|
|
|
|
+ // item.splice(i, 1)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
})
|
|
})
|
|
|
|
+ console.log(times)
|
|
this.multiSelector.push(times)
|
|
this.multiSelector.push(times)
|
|
- console.log(this.multiSelector)
|
|
|
|
this.daytime = this.multiSelector[0][0].date + " " + this.multiSelector[1][0][0].start_time_period + "-" + this.multiSelector[
|
|
this.daytime = this.multiSelector[0][0].date + " " + this.multiSelector[1][0][0].start_time_period + "-" + this.multiSelector[
|
|
1][0][0].end_time_period
|
|
1][0][0].end_time_period
|
|
|
|
+ this.is_date_obsolete = this.multiSelector[0][0].date + " " + this.multiSelector[
|
|
|
|
+ 1][0][0].end_time_period
|
|
this.hospital = this.multiSelector[1][0][0].name
|
|
this.hospital = this.multiSelector[1][0][0].name
|
|
this.address = this.multiSelector[1][0][0].address
|
|
this.address = this.multiSelector[1][0][0].address
|
|
this.jigouid = this.multiSelector[1][0][0].org_id
|
|
this.jigouid = this.multiSelector[1][0][0].org_id
|
|
@@ -310,14 +326,35 @@
|
|
this.year = this.multiSelector[0][0].date
|
|
this.year = this.multiSelector[0][0].date
|
|
this.yearid = this.multiSelector[1][0][0].id
|
|
this.yearid = this.multiSelector[1][0][0].id
|
|
this.distance = parseInt(this.multiSelector[1][0][0].distance) / 1000
|
|
this.distance = parseInt(this.multiSelector[1][0][0].distance) / 1000
|
|
|
|
+ this.location = {
|
|
|
|
+ latitude: this.multiSelector[1][0][0].latitude - 0,
|
|
|
|
+ longitude: this.multiSelector[1][0][0].longitude - 0,
|
|
|
|
+ name: this.multiSelector[1][0][0].name,
|
|
|
|
+ address: this.multiSelector[1][0][0].address,
|
|
|
|
+ }
|
|
let arr = this.multiSelector[1][0]
|
|
let arr = this.multiSelector[1][0]
|
|
- arr.forEach(item=>{
|
|
|
|
|
|
+ arr.forEach(item => {
|
|
item.year = nian[0].date
|
|
item.year = nian[0].date
|
|
})
|
|
})
|
|
this.$refs.date.rightday = arr
|
|
this.$refs.date.rightday = arr
|
|
|
|
+ console.log(this.multiSelector)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ goAdrPostion() {
|
|
|
|
+ uni.openLocation({
|
|
|
|
+ latitude: Number(this.location.latitude),
|
|
|
|
+ longitude: Number(this.location.longitude),
|
|
|
|
+ name: this.location.name,
|
|
|
|
+ address: this.location.address,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
gotoxuanze(e) {
|
|
gotoxuanze(e) {
|
|
if (e.currentTarget.dataset.istrue == 0) {
|
|
if (e.currentTarget.dataset.istrue == 0) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -335,6 +372,19 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
phonezixun() {
|
|
phonezixun() {
|
|
|
|
+ let arr = this.is_date_obsolete.split(/[- :]/)
|
|
|
|
+ let nndate = new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4]);
|
|
|
|
+ nndate = Date.parse(nndate)
|
|
|
|
+ let currentTime = Date.parse(new Date())
|
|
|
|
+ if (this.barindex == 3) {
|
|
|
|
+ if (nndate < currentTime) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "不可预约已过时间",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: "info_write?doctor=" + JSON.stringify(this.doctor) + "&type=" + this.barindex + "&time=" + this.daytime +
|
|
url: "info_write?doctor=" + JSON.stringify(this.doctor) + "&type=" + this.barindex + "&time=" + this.daytime +
|
|
"&hospital=" + this.hospital + "&jigou=" + this.jigouid + "&year=" + this.year + "&yearid=" + this.yearid
|
|
"&hospital=" + this.hospital + "&jigou=" + this.jigouid + "&year=" + this.year + "&yearid=" + this.yearid
|
|
@@ -362,7 +412,7 @@
|
|
// this.yearid = this.multiSelector[1][arr[1]].id
|
|
// this.yearid = this.multiSelector[1][arr[1]].id
|
|
// console.log(this.yearid)
|
|
// console.log(this.yearid)
|
|
// this.distance = parseInt(this.multiSelector[1][arr[1]].distance) / 1000
|
|
// this.distance = parseInt(this.multiSelector[1][arr[1]].distance) / 1000
|
|
-
|
|
|
|
|
|
+ this.is_date_obsolete = item.year + " " + item.end_time_period
|
|
this.daytime = item.year + " " + item.start_time_period + "-" + item.end_time_period
|
|
this.daytime = item.year + " " + item.start_time_period + "-" + item.end_time_period
|
|
this.hospital = item.name
|
|
this.hospital = item.name
|
|
this.address = item.address
|
|
this.address = item.address
|
|
@@ -372,6 +422,7 @@
|
|
this.yearid = item.id
|
|
this.yearid = item.id
|
|
this.distance = parseInt(item.distance) / 1000
|
|
this.distance = parseInt(item.distance) / 1000
|
|
this.dateshow = false
|
|
this.dateshow = false
|
|
|
|
+ this.location = item
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|