2022-11-25 10:58:46 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="app">
|
2023-02-16 10:44:21 +08:00
|
|
|
<view class="inputs">
|
|
|
|
|
<i class="icon"></i>
|
|
|
|
|
<input v-model="goodsName" type="text" name="" id="" class="input" placeholder="请输入">
|
2022-11-25 10:58:46 +08:00
|
|
|
</view>
|
2023-02-16 10:44:21 +08:00
|
|
|
<view class="Classificationlist">
|
|
|
|
|
<view v-for="(item,index) in nurseItemClassifyInfoList" :key="index" @tap='tapitemclass(item)'
|
|
|
|
|
:class="item.id == itemClassId?'itemclass':'item'">
|
|
|
|
|
<image :src="item.classifyPictureUrl" mode=""></image>
|
|
|
|
|
<view class="title">
|
|
|
|
|
{{item.classifyName}}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="item" v-if='nurseItemClassifyInfoList.length>8'>
|
|
|
|
|
<image src="../../static/gd.png" mode=""></image>
|
|
|
|
|
<view class="title">
|
|
|
|
|
更多
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<swiper class="swiper-block" :indicator-dots="true" :autoplay="true" :interval="5000" :duration="3000"
|
|
|
|
|
circular='true' current='0'>
|
|
|
|
|
<swiper-item class="swiper-item" v-for="(item,index) in lbinfo">
|
|
|
|
|
<image :src="item.image" class="slide-image">
|
|
|
|
|
</image>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
</swiper>
|
2022-11-25 10:58:46 +08:00
|
|
|
<view class="conNew">
|
2023-02-16 10:44:21 +08:00
|
|
|
<view class="title">
|
|
|
|
|
周边医养机构
|
|
|
|
|
</view>
|
|
|
|
|
<u-tabs :list="nurseAgencyClassifyInfoList" :current="conNewcurrent" @change="change"></u-tabs>
|
2022-11-25 10:58:46 +08:00
|
|
|
<view class="addressContent" v-for="(item,index) in nursestationlist" :key="index">
|
|
|
|
|
<view class="lists" @tap='godetails(item)'>
|
|
|
|
|
<view class="nurse">{{item.nurseStationName}}</view>
|
2023-01-12 16:16:36 +08:00
|
|
|
<view class="distance"
|
|
|
|
|
v-show="homeLatitudeLongitude.homeLatitude&&homeLatitudeLongitude.homeLongitude">
|
|
|
|
|
距离您{{item.distance}}KM</view>
|
2022-11-25 10:58:46 +08:00
|
|
|
<image class="background" :src="item.stationPictureUrl" mode=""></image>
|
2023-02-16 10:44:21 +08:00
|
|
|
<view class="tags">
|
|
|
|
|
<view class="tag" v-for="uitem in item.nurseStationClassifyList">
|
|
|
|
|
{{uitem.classifyName}}
|
|
|
|
|
</view>
|
2022-11-25 10:58:46 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="masks" style="" v-if="mask">
|
|
|
|
|
<view class="mask">
|
|
|
|
|
<view class="picture">
|
|
|
|
|
<image src="../../static/locatinsmall.png"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="text">
|
|
|
|
|
请打开系统定位
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btns">
|
|
|
|
|
<view class="bt" @tap='cancel()'>取消</view>
|
|
|
|
|
<view class="btn" @tap='getlocation()'>确定</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
nearbyList,
|
2023-02-16 10:44:21 +08:00
|
|
|
getPatientInfo,
|
|
|
|
|
getNurseClassifyList
|
2022-11-25 10:58:46 +08:00
|
|
|
} from '@/api/site/site.js';
|
|
|
|
|
import baseurl from '@/api/baseurl.js'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-02-16 10:44:21 +08:00
|
|
|
nurseAgencyClassifyInfoList: [], //护理站分类
|
|
|
|
|
conNewcurrent: 0,
|
|
|
|
|
nurseItemClassifyInfoList: [], //护理项目分类
|
|
|
|
|
lbinfo: [{
|
|
|
|
|
image: 'http://192.168.16.30:8088/profile/goodsPictureUrl/2023/02/15/2ff771a32e9e218b7a375437f3912a4_20230215094755A00126dbdd9a1d.png',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
image: 'http://192.168.16.30:8088/profile/goodsPictureUrl/2023/02/15/2ff771a32e9e218b7a375437f3912a4_20230215094755A00126dbdd9a1d.png',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
image: 'http://192.168.16.30:8088/profile/goodsPictureUrl/2023/02/15/2ff771a32e9e218b7a375437f3912a4_20230215094755A00126dbdd9a1d.png',
|
|
|
|
|
}
|
|
|
|
|
], //轮播list
|
2022-11-25 10:58:46 +08:00
|
|
|
nursestationlist: [],
|
|
|
|
|
mask: false,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
total: 0,
|
|
|
|
|
latitude: 39.90374,
|
|
|
|
|
longitude: 116.397827,
|
2023-01-12 16:16:36 +08:00
|
|
|
homeLatitudeLongitude: null,
|
2023-02-16 10:44:21 +08:00
|
|
|
nurseClassId: '', //护理站分类id
|
|
|
|
|
itemClassId: '', //护理项目分类id
|
2022-11-25 10:58:46 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2023-02-16 10:44:21 +08:00
|
|
|
//点击护理项目分类
|
|
|
|
|
tapitemclass(item) {
|
|
|
|
|
if (this.itemClassId == item.id) {
|
|
|
|
|
this.itemClassId = ''
|
|
|
|
|
} else {
|
|
|
|
|
this.itemClassId = item.id
|
|
|
|
|
}
|
|
|
|
|
this.requestinfo()
|
|
|
|
|
},
|
|
|
|
|
//护理站和护理项目分类
|
|
|
|
|
getNurseClassifyinfo() {
|
|
|
|
|
getNurseClassifyList().then(res => {
|
|
|
|
|
this.nurseAgencyClassifyInfoList.push({
|
|
|
|
|
name: '全部',
|
|
|
|
|
id: '',
|
|
|
|
|
})
|
|
|
|
|
res.data.nurseAgencyClassifyInfoList.forEach(e => {
|
|
|
|
|
e.name = e.classifyName
|
|
|
|
|
this.nurseAgencyClassifyInfoList.push(e)
|
|
|
|
|
})
|
|
|
|
|
res.data.nurseItemClassifyInfoList.forEach(e => {
|
|
|
|
|
e.classifyPictureUrl = baseurl + e.classifyPictureUrl
|
|
|
|
|
})
|
|
|
|
|
this.nurseItemClassifyInfoList = res.data.nurseItemClassifyInfoList.slice(0, 7)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
change(index) {
|
|
|
|
|
this.conNewcurrent = index;
|
|
|
|
|
this.nurseClassId = this.nurseAgencyClassifyInfoList[index].id
|
|
|
|
|
this.requestinfo()
|
|
|
|
|
},
|
2022-11-25 10:58:46 +08:00
|
|
|
getlocation(value) {
|
|
|
|
|
var that = this
|
|
|
|
|
uni.openSetting({
|
|
|
|
|
success(res) {
|
|
|
|
|
if (res.authSetting['scope.userLocation']) {
|
2023-01-12 16:16:36 +08:00
|
|
|
// uni.getLocation({
|
|
|
|
|
// type: 'wgs84',
|
|
|
|
|
// success: function(res) {
|
|
|
|
|
// that.latitude = res.latitude
|
|
|
|
|
// that.longitude = res.longitude
|
|
|
|
|
// that.mask = false
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2022-11-25 10:58:46 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
requestinfo() {
|
2022-12-27 09:22:42 +08:00
|
|
|
this.pageNum = 1;
|
2023-02-16 10:44:21 +08:00
|
|
|
nearbyList(this.pageSize, this.pageNum, this.longitude, this.latitude, this.nurseClassId, this.itemClassId)
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.total > 0) {
|
|
|
|
|
uni.removeStorageSync('Refresh');
|
|
|
|
|
res.rows.forEach(e => {
|
|
|
|
|
e.stationPictureUrl = baseurl + e.stationPictureUrl
|
|
|
|
|
e.nurseStationClassifyList = e.nurseStationClassifyList.slice(0, 2)
|
|
|
|
|
})
|
|
|
|
|
this.nursestationlist = res.rows
|
|
|
|
|
this.mask = false
|
|
|
|
|
this.total = res.total
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-11-25 10:58:46 +08:00
|
|
|
},
|
|
|
|
|
godetails(item) {
|
|
|
|
|
uni.navigateTo({
|
2023-02-16 10:44:21 +08:00
|
|
|
url: `/pages/nursestation/nursestation?nurseStationId=${item.nurseStationId}&distance=${item.distance}`
|
2022-11-25 10:58:46 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancel() {
|
|
|
|
|
this.mask = false
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/homepage/homepage',
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-02-16 10:44:21 +08:00
|
|
|
onReachBottom() { //上滑加载
|
2022-11-25 10:58:46 +08:00
|
|
|
if (this.nursestationlist.length >= this.total) {} else {
|
|
|
|
|
this.pageNum++;
|
2023-02-16 10:44:21 +08:00
|
|
|
nearbyList(this.pageSize, this.pageNum, this.longitude, this.latitude, this.nurseClassId, this.itemClassId)
|
2022-11-25 10:58:46 +08:00
|
|
|
.then(res => {
|
|
|
|
|
res.rows.forEach(e => {
|
|
|
|
|
e.stationPictureUrl = baseurl + e.stationPictureUrl
|
2023-02-16 10:44:21 +08:00
|
|
|
e.nurseStationClassifyList = e.nurseStationClassifyList.slice(0, 2)
|
2022-11-25 10:58:46 +08:00
|
|
|
this.nursestationlist.push(e)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onPullDownRefresh() { //下拉刷新
|
|
|
|
|
this.pageNum = 1;
|
2023-02-16 10:44:21 +08:00
|
|
|
this.requestinfo()
|
2022-11-25 10:58:46 +08:00
|
|
|
setTimeout(function() {
|
|
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
|
}, 1000);
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
iptVal() {
|
|
|
|
|
// this.requestinfo()
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-12-27 09:22:42 +08:00
|
|
|
onShow() {
|
2023-02-16 10:44:21 +08:00
|
|
|
this.nurseClassId = ''
|
|
|
|
|
this.itemClassId = ''
|
2022-11-25 10:58:46 +08:00
|
|
|
var that = this
|
2023-01-13 09:08:31 +08:00
|
|
|
const value = uni.getStorageSync('patientId');
|
|
|
|
|
if (value) {
|
|
|
|
|
getPatientInfo(value).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.homeLatitudeLongitude = res.data
|
|
|
|
|
if (res.data.homeLatitude && res.data.homeLongitude) {
|
|
|
|
|
that.latitude = res.data.homeLatitude
|
|
|
|
|
that.longitude = res.data.homeLongitude
|
|
|
|
|
that.requestinfo();
|
2022-11-25 10:58:46 +08:00
|
|
|
} else {
|
2023-01-12 16:16:36 +08:00
|
|
|
that.requestinfo();
|
|
|
|
|
// uni.getLocation({
|
|
|
|
|
// type: 'wgs84',
|
2023-01-13 09:08:31 +08:00
|
|
|
// success: function(resp) {
|
|
|
|
|
// that.latitude = resp.latitude
|
|
|
|
|
// that.longitude = resp.longitude
|
2023-01-12 16:16:36 +08:00
|
|
|
// that.requestinfo();
|
|
|
|
|
// },
|
|
|
|
|
// fail(err) {
|
|
|
|
|
// that.mask = true;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2022-11-25 10:58:46 +08:00
|
|
|
}
|
2023-02-16 10:44:21 +08:00
|
|
|
} else if (res.code == 9999) {} else {
|
2023-01-13 09:08:31 +08:00
|
|
|
that.requestinfo();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
that.requestinfo();
|
|
|
|
|
// uni.getLocation({
|
|
|
|
|
// type: 'wgs84',
|
|
|
|
|
// success: function(res) {
|
|
|
|
|
// that.latitude = res.latitude
|
|
|
|
|
// that.longitude = res.longitude
|
|
|
|
|
// that.requestinfo();
|
|
|
|
|
// },
|
|
|
|
|
// fail(err) {
|
|
|
|
|
// that.mask = true;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
2022-11-25 10:58:46 +08:00
|
|
|
},
|
2023-02-16 10:44:21 +08:00
|
|
|
onLoad() {
|
|
|
|
|
this.getNurseClassifyinfo();
|
|
|
|
|
},
|
2022-12-28 12:08:50 +08:00
|
|
|
//1.分享给朋友
|
|
|
|
|
onShareAppMessage(res) {
|
2023-01-03 09:02:23 +08:00
|
|
|
let pages = getCurrentPages();
|
|
|
|
|
let url = pages[pages.length - 1].$page.fullPath
|
2022-12-28 12:08:50 +08:00
|
|
|
return {
|
|
|
|
|
title: '泉医到家',
|
2023-01-03 09:02:23 +08:00
|
|
|
path: url,
|
2022-12-28 12:08:50 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//2.分享到朋友圈
|
|
|
|
|
onShareTimeline(res) {
|
2023-01-03 09:02:23 +08:00
|
|
|
let pages = getCurrentPages();
|
|
|
|
|
let url = pages[pages.length - 1].$page.fullPath
|
2022-12-28 12:08:50 +08:00
|
|
|
return {
|
|
|
|
|
title: '泉医到家',
|
2023-01-03 09:02:23 +08:00
|
|
|
path: url,
|
2022-12-28 12:08:50 +08:00
|
|
|
}
|
|
|
|
|
},
|
2022-11-25 10:58:46 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
@import './site.scss'
|
|
|
|
|
</style>
|