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,22 +1,22 @@
import request from "../request.js"
export function introductionList(id) {
export function introductionList(id, longitude, latitude) {
return request({
url: `/nurseApplet/nearbyNursingStation/introductionList?nurseStationId=${id}`,
url: `/nurseApplet/nearbyNursingStation/introductionList?nurseStationId=${id}&homeLongitude=${longitude}&homeLatitude=${latitude}`,
method: 'GET'
})
}
export function itemList(id,pageSize,pageNum,nurseClassifyInfoId) {
export function itemList(id, pageSize, pageNum, nurseClassifyInfoId) {
return request({
url: `/nurseApplet/nearbyNursingStation/itemList?pageSize=${pageSize}&pageNum=${pageNum}&nurseStationId=${id}&nurseClassifyInfoId=${nurseClassifyInfoId}`,
method: 'GET'
})
}
export function productInformation(id,pageNum, pageSize) {
export function productInformation(id, pageNum, pageSize) {
return request({
url: `/nurseApplet/nearbyNursingStation/productInformation?pageSize=${pageSize}&pageNum=${pageNum}&nurseStationId=${id}`,
method: 'GET'

View File

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

View File

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