This commit is contained in:
曹辉 2023-05-23 10:37:51 +08:00
parent 767f7bc140
commit 676b43db1e
3 changed files with 88 additions and 55 deletions

View File

@ -1,9 +1,9 @@
import request from "../request.js" import request from "../request.js"
export function introductionList(id) { export function introductionList(id, longitude, latitude) {
return request({ return request({
url: `/nurseApplet/nearbyNursingStation/introductionList?nurseStationId=${id}`, url: `/nurseApplet/nearbyNursingStation/introductionList?nurseStationId=${id}&homeLongitude=${longitude}&homeLatitude=${latitude}`,
method: 'GET' method: 'GET'
}) })
} }

View File

@ -37,22 +37,22 @@
暂无 暂无
</view> </view>
<view class="time"> <view class="time">
<view class="text"> <view class="text" v-if="list.businessStatus">
{{list.businessStatus}} {{list.businessStatus}}
</view> </view>
<view class="timeday" v-if="list.openingHoursDescribe"> <view class="timeday" v-if="list.openingHoursDescribe">
{{list.openingHoursDescribe}} {{list.openingHoursDescribe}}
</view> </view>
<view class="texttime"> <view class="texttime">
<view class=""> <view class="" v-if="list.morningOpenStartTime">
上午{{list.morningOpenStartTime}}-{{list.morningOpenEndTime}} 上午{{list.morningOpenStartTime}}-{{list.morningOpenEndTime}}
</view> </view>
<view class=""> <view class="" v-if="list.afternoonOpenStartTime">
下午{{list.afternoonOpenStartTime}}-{{list.afternoonOpenEndTime}} 下午{{list.afternoonOpenStartTime}}-{{list.afternoonOpenEndTime}}
</view> </view>
</view> </view>
</view> </view>
<view class="configuration"> <view class="configuration" v-if="nurseStationLabelList">
<view class="text" v-for="(item,index) in nurseStationLabelList" :key="index"> <view class="text" v-for="(item,index) in nurseStationLabelList" :key="index">
{{item.labelDescription}} {{item.labelDescription}}
</view> </view>
@ -62,8 +62,8 @@
<view class="text"> <view class="text">
{{list.address}} {{list.address}}
</view> </view>
<view class="distance" v-if="distance!=null"> <view class="distance" v-if="list.distance">
{{distance}}KM {{list.distance}}KM
</view> </view>
</view> </view>
<view class="address" v-else> <view class="address" v-else>
@ -71,9 +71,6 @@
<view class="text"> <view class="text">
暂无 暂无
</view> </view>
<view class="distance" v-if="distance!=null">
{{distance}}KM
</view>
</view> </view>
<view class="address" v-if="list.dutyPhone" style="margin: 20rpx 0 0 33rpx;" @tap='gophone'> <view class="address" v-if="list.dutyPhone" style="margin: 20rpx 0 0 33rpx;" @tap='gophone'>
<image src="../../static/phone.png" mode=""></image> <image src="../../static/phone.png" mode=""></image>
@ -154,6 +151,9 @@
</template> </template>
<script> <script>
import {
getPatientInfo,
} from '@/api/site/site.js';
import { import {
AppIdentification AppIdentification
} from '@/api/AppIdentification/index.js' } from '@/api/AppIdentification/index.js'
@ -176,13 +176,13 @@
baseurl: '', baseurl: '',
usershow: false, // usershow: false, //
choicetab: false, // choicetab: false, //
list: [], //list list: undefined, //list
servelist: [], // servelist: [], //
productlist: [], // productlist: [], //
servetotal: 0, //total servetotal: 0, //total
producttotal: 0, //total producttotal: 0, //total
stationid: '', //id stationid: '', //id
nurseStationLabelList: [], // nurseStationLabelList: undefined, //
nearbyNursingStationItemList: [], nearbyNursingStationItemList: [],
nurseStationId: '', nurseStationId: '',
pageNum: 1, pageNum: 1,
@ -202,9 +202,10 @@
} }
], ],
classifycurrent: 0, // classifycurrent: 0, //
distance: null, //
nurseClassifyInfoId: '', //id nurseClassifyInfoId: '', //id
scrollTop: 0, scrollTop: 0,
latitude: 39.90374,
longitude: 116.397827,
} }
}, },
onShow() { onShow() {
@ -212,7 +213,45 @@
this.nurseClassifyInfoId = '' this.nurseClassifyInfoId = ''
this.baseurl = baseurl this.baseurl = baseurl
this.usershow = false this.usershow = false
this.getInfo() var that = this
const value = uni.getStorageSync('patientId');
if (value) {
getPatientInfo(value).then(res => {
if (res.code == 200) {
if (res.data.homeLatitude && res.data.homeLongitude) {
that.latitude = res.data.homeLatitude
that.longitude = res.data.homeLongitude
that.getInfo();
} else {
uni.getLocation({
type: 'wgs84',
success: function(resp) {
that.latitude = resp.latitude
that.longitude = resp.longitude
that.getInfo();
},
fail(err) {
that.getInfo();
}
});
}
} else if (res.code == 9999) {} else {
that.getInfo();
}
})
} else {
uni.getLocation({
type: 'wgs84',
success: function(res) {
that.latitude = res.latitude
that.longitude = res.longitude
that.getInfo();
},
fail(err) {
that.getInfo();
}
});
}
}, },
onLoad(options) { onLoad(options) {
let that = this let that = this
@ -340,9 +379,8 @@
} }
}, },
getInfo() { getInfo() {
introductionList(this.nurseStationId).then(res => { introductionList(this.nurseStationId, this.longitude, this.latitude).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.distance = res.data.distance
this.Banners = [] this.Banners = []
this.tabList = [{ this.tabList = [{
name: '全部', name: '全部',

View File

@ -29,8 +29,7 @@
<view class="addressContent" v-for="(item,index) in nursestationlist" :key="index"> <view class="addressContent" v-for="(item,index) in nursestationlist" :key="index">
<view class="lists" @tap='godetails(item)'> <view class="lists" @tap='godetails(item)'>
<view class="nurse">{{item.nurseStationName}}</view> <view class="nurse">{{item.nurseStationName}}</view>
<view class="distance" <view class="distance" v-if="item.distance">
v-show="homeLatitudeLongitude.homeLatitude&&homeLatitudeLongitude.homeLongitude">
距离您{{item.distance}}KM</view> 距离您{{item.distance}}KM</view>
<image class="background" :src="item.stationPictureUrl" mode=""></image> <image class="background" :src="item.stationPictureUrl" mode=""></image>
<view class="tags"> <view class="tags">
@ -86,7 +85,6 @@
total: 0, total: 0,
latitude: 39.90374, latitude: 39.90374,
longitude: 116.397827, longitude: 116.397827,
homeLatitudeLongitude: null,
nurseClassId: '', //id nurseClassId: '', //id
itemClassId: '', //id itemClassId: '', //id
searchName: '', // searchName: '', //
@ -167,14 +165,14 @@
uni.openSetting({ uni.openSetting({
success(res) { success(res) {
if (res.authSetting['scope.userLocation']) { if (res.authSetting['scope.userLocation']) {
// uni.getLocation({ uni.getLocation({
// type: 'wgs84', type: 'wgs84',
// success: function(res) { success: function(res) {
// that.latitude = res.latitude that.latitude = res.latitude
// that.longitude = res.longitude that.longitude = res.longitude
// that.mask = false that.mask = false
// } }
// }); });
} }
} }
}); });
@ -261,42 +259,39 @@
if (value) { if (value) {
getPatientInfo(value).then(res => { getPatientInfo(value).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.homeLatitudeLongitude = res.data
if (res.data.homeLatitude && res.data.homeLongitude) { if (res.data.homeLatitude && res.data.homeLongitude) {
that.latitude = res.data.homeLatitude that.latitude = res.data.homeLatitude
that.longitude = res.data.homeLongitude that.longitude = res.data.homeLongitude
that.requestinfo(); that.requestinfo();
} else { } else {
uni.getLocation({
type: 'wgs84',
success: function(resp) {
that.latitude = resp.latitude
that.longitude = resp.longitude
that.requestinfo(); that.requestinfo();
// uni.getLocation({ },
// type: 'wgs84', fail(err) {
// success: function(resp) { that.mask = true;
// that.latitude = resp.latitude }
// that.longitude = resp.longitude });
// that.requestinfo();
// },
// fail(err) {
// that.mask = true;
// }
// });
} }
} else if (res.code == 9999) {} else { } else if (res.code == 9999) {} else {
that.requestinfo(); that.requestinfo();
} }
}) })
} else { } else {
uni.getLocation({
type: 'wgs84',
success: function(res) {
that.latitude = res.latitude
that.longitude = res.longitude
that.requestinfo(); that.requestinfo();
// uni.getLocation({ },
// type: 'wgs84', fail(err) {
// success: function(res) { that.mask = true;
// that.latitude = res.latitude }
// that.longitude = res.longitude });
// that.requestinfo();
// },
// fail(err) {
// that.mask = true;
// }
// });
} }
}, },
//1. //1.