NurseStationApp/pages/site/site.vue

135 lines
3.3 KiB
Vue
Raw Normal View History

2022-10-13 11:30:22 +08:00
<template>
2022-10-21 11:01:04 +08:00
<view class="app">
2022-10-24 16:40:37 +08:00
<view class="nursetation" @tap='detailed()'>
<text class="what">什么是护理站</text>
<u-icon class="icon" name="arrow-right"></u-icon>
</view>
<view class="map">
<map style="width:100%; height:40vh;" scale="17" :latitude="latitude" :longitude="longitude"
:markers="markers"></map>
2022-10-13 11:30:22 +08:00
</view>
2022-10-24 16:40:37 +08:00
2022-10-25 10:04:44 +08:00
2022-10-14 19:48:48 +08:00
<view class="conNew">
2022-10-24 16:40:37 +08:00
<view class="addressContent" v-for="(item,index) in nursestationlist" :key="index">
<view class="lists">
2022-10-21 11:01:04 +08:00
<view class="nurse">{{item.nurseStationName}}</view>
2022-10-24 16:40:37 +08:00
<view class="distance">距离您{{item.distance}}</view>
2022-10-14 19:48:48 +08:00
<view class="background">
2022-10-21 11:01:04 +08:00
<image src="/static/logo.png" mode=""></image>
2022-10-24 16:40:37 +08:00
<text class="qyttext">泉医通</text>
<text class="lianmeng">济卫护理联盟NO.1</text>
2022-10-14 19:48:48 +08:00
</view>
2022-10-24 16:40:37 +08:00
<view class="understand" @tap='godetails(item)'>
2022-10-14 19:48:48 +08:00
点击了解
</view>
</view>
2022-10-13 11:30:22 +08:00
</view>
2022-10-13 16:31:59 +08:00
</view>
2022-10-14 19:48:48 +08:00
2022-10-24 16:40:37 +08:00
<view class="masks" style="" v-if="mask">
2022-10-13 16:31:59 +08:00
<view class="mask">
2022-10-24 16:40:37 +08:00
<view class="picture">
2022-10-13 16:31:59 +08:00
<image src="../../static/locatinsmall.png"></image>
</view>
2022-10-24 16:40:37 +08:00
<view class="text">
2022-10-13 16:31:59 +08:00
请打开系统定位
</view>
<view class="btns">
2022-10-24 16:40:37 +08:00
<view class="bt" @tap='cancel()'>取消</view>
<view class="btn" @tap='getsite()'>确定</view>
2022-10-13 11:30:22 +08:00
</view>
2022-10-24 16:40:37 +08:00
2022-10-13 11:30:22 +08:00
</view>
</view>
2022-10-13 16:31:59 +08:00
</view>
2022-10-13 11:30:22 +08:00
</template>
<script>
2022-10-14 19:48:48 +08:00
import {
nearbyList
2022-10-20 09:15:48 +08:00
} from '@/api/site/site.js';
2022-10-14 19:48:48 +08:00
import baseurl from '@/api/baseurl.js'
2022-10-13 11:30:22 +08:00
export default {
data() {
return {
2022-10-24 16:40:37 +08:00
nursestationlist: [],
mask: true,
2022-10-14 19:48:48 +08:00
pageNum: 1,
pageSize: 10,
2022-10-21 11:01:04 +08:00
//map地图所需
id: 0, // 使用 marker点击事件 需要填写id
latitude: 39.909,
longitude: 116.39742,
markers: [],
covers: []
2022-10-13 11:30:22 +08:00
}
},
2022-10-20 09:15:48 +08:00
onReachBottom() {
this.pageNum++;
if (this.nurseTypeCode != undefined) {
nearbyList(this.pageSize, this.pageNum, this.longitude, this.latitude, this.nurseTypeCode, this.iptVal)
.then(res => {
2022-10-24 16:40:37 +08:00
if (res.total == this.nursestationlist.length) {
2022-10-20 09:15:48 +08:00
} else {
res.rows.forEach(e => {
2022-10-24 16:40:37 +08:00
this.nursestationlist.push(e)
2022-10-20 09:15:48 +08:00
})
}
})
} else {
uni.request({
url: baseurl +
`/nurseApplet/nearbyNursingStation/nearbyList?pageSize=${this.pageSize}&pageNum=${this.pageNum}&homeLongitude=${this.longitude}&homeLatitude=${this.latitude}&nurseStationName=${this.iptVal}`, //仅为示例,并非真实接口地址。
success: (res) => {
2022-10-24 16:40:37 +08:00
if (res.data.total == this.nursestationlist.length) {} else {
2022-10-20 09:15:48 +08:00
res.data.rows.forEach(e => {
2022-10-24 16:40:37 +08:00
this.nursestationlist.push(e)
2022-10-20 09:15:48 +08:00
})
}
console.log(this.nearbylist)
}
});
}
},
2022-10-14 19:48:48 +08:00
watch: {
iptVal() {
// this.requestinfo()
},
},
2022-10-13 11:30:22 +08:00
onShow() {},
2022-10-14 19:48:48 +08:00
onLoad() {
var that = this
this.requestinfo()
},
2022-10-13 11:30:22 +08:00
methods: {
2022-10-14 19:48:48 +08:00
requestinfo() {
2022-10-24 16:40:37 +08:00
nearbyList(this.pageSize, this.pageNum, this.longitude, this.latitude, this.nurseTypeCode, ).then(res => {
this.nursestationlist = res.rows
// console.log(this.nursestationlist)
})
2022-10-14 19:48:48 +08:00
},
2022-10-24 16:40:37 +08:00
godetails(item) {
console.log(item)
2022-10-14 19:48:48 +08:00
uni.navigateTo({
2022-10-24 16:40:37 +08:00
url: `/pages/nursestation/nursestation?nurseStationId=${item.nurseStationId}`
2022-10-14 19:48:48 +08:00
})
},
detailed() {
uni.navigateTo({
url: `/pages/detail/detail`
})
},
cancel() {
this.mask = false
},
},
}
2022-10-13 11:30:22 +08:00
</script>
<style lang="scss">
2022-10-24 16:40:37 +08:00
@import './site.scss'
2022-10-13 11:30:22 +08:00
</style>