| xqd
@@ -8,6 +8,11 @@
|
|
|
</u-dropdown>
|
|
|
<view class="main">
|
|
|
<u-search :clearabled="false" shape="round" :show-action="false" placeholder="搜索医生姓名、医院名" v-model="keyword"></u-search>
|
|
|
+ <view class="margin-top-sm text-df text-bold" @click="xuanzetime" v-if="istime">
|
|
|
+ 选择时间:{{showtime}}
|
|
|
+ <u-picker mode="multiSelector" @confirm="callbacktime" v-model="show" :default-selector='[0, 1]' range-key="start_time_period"
|
|
|
+ :range="multiSelector"></u-picker>
|
|
|
+ </view>
|
|
|
<view style="width: 100%;">
|
|
|
<view class="recommendstyle margin-top-sm" v-for="(item,index) in doctorList" :key="index">
|
|
|
<view class="base_item" @click="gotoinfo" :data-id="item.id">
|
| xqd
@@ -97,13 +102,20 @@
|
|
|
onLoad(options) {
|
|
|
if (options.index) {
|
|
|
this.value1 = options.index
|
|
|
-
|
|
|
+ if (this.value1 == 3) {
|
|
|
+ this.istime = true
|
|
|
+ } else {
|
|
|
+ this.istime = false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getDoctorList()
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.gettime()
|
|
|
},
|
|
|
- mounted() {},
|
|
|
data() {
|
|
|
return {
|
|
|
scrollTop: 0,
|
| xqd
@@ -156,7 +168,21 @@
|
|
|
value: 3,
|
|
|
},
|
|
|
],
|
|
|
- doctorList: []
|
|
|
+ doctorList: [],
|
|
|
+ timeday: "", //年月日
|
|
|
+ timehour: "", //时分
|
|
|
+ multiSelector: [],
|
|
|
+ params: {
|
|
|
+ year: false,
|
|
|
+ month: true,
|
|
|
+ day: true,
|
|
|
+ hour: true,
|
|
|
+ minute: true,
|
|
|
+ second: false
|
|
|
+ },
|
|
|
+ show: false,
|
|
|
+ istime: false,
|
|
|
+ showtime: ""
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
| xqd
@@ -184,6 +210,11 @@
|
|
|
},
|
|
|
allserive(value) {
|
|
|
this.value1 = value
|
|
|
+ if (this.value1 == 3) {
|
|
|
+ this.istime = true
|
|
|
+ } else {
|
|
|
+ this.istime = false
|
|
|
+ }
|
|
|
this.getDoctorList()
|
|
|
},
|
|
|
city(value) {
|
| xqd
@@ -195,7 +226,7 @@
|
|
|
},
|
|
|
gotoinfo(e) {
|
|
|
uni.navigateTo({
|
|
|
- url: "./doctor_info?id=" + e.currentTarget.dataset.id
|
|
|
+ url: "./doctor_info?id=" + e.currentTarget.dataset.id + "&time=" + this.showtime
|
|
|
})
|
|
|
},
|
|
|
submitCollect: async function(e) {
|
| xqd
@@ -226,15 +257,39 @@
|
|
|
name: this.keyword,
|
|
|
sort_type: this.value3,
|
|
|
latitude: uni.getStorageSync("latitude"),
|
|
|
- longitude: uni.getStorageSync("longitude")
|
|
|
+ longitude: uni.getStorageSync("longitude"),
|
|
|
+ schedule_date: this.timeday,
|
|
|
+ time_period_id: this.timehour
|
|
|
}, )
|
|
|
if (res.status == 0) {
|
|
|
this.doctorList = res.data.data
|
|
|
console.log(res)
|
|
|
}
|
|
|
},
|
|
|
+ gettime: async function() {
|
|
|
+ let res = await this.$request.post("/api/v1/docter/timePeriodList")
|
|
|
+ console.log(res)
|
|
|
+ if (res.status == 0) {
|
|
|
+ res.data.list.forEach(item => {
|
|
|
+ item.start_time_period = item.start_time_period + '-' + item.end_time_period
|
|
|
+ })
|
|
|
+ this.multiSelector.push(res.data.dates)
|
|
|
+ this.multiSelector.push(res.data.list)
|
|
|
+ this.showtime = res.data.dates[0] + ' ' + res.data.list[0].start_time_period
|
|
|
+ }
|
|
|
+ },
|
|
|
changeStr() {
|
|
|
this.getDoctorList()
|
|
|
+ },
|
|
|
+ xuanzetime() {
|
|
|
+ this.show = !this.show
|
|
|
+ },
|
|
|
+ //返回时间
|
|
|
+ callbacktime(arr) {
|
|
|
+ this.timeday = this.multiSelector[0][arr[0]]
|
|
|
+ this.timehour = this.multiSelector[1][arr[1]].id
|
|
|
+ this.showtime = this.multiSelector[0][arr[0]] + " " + this.multiSelector[1][arr[1]].start_time_period
|
|
|
+ this.getDoctorList()
|
|
|
}
|
|
|
}
|
|
|
};
|