NurseStationApp/pages/nursestation/nursestation.vue

291 lines
8.5 KiB
Vue
Raw Normal View History

2022-10-20 09:15:48 +08:00
<template>
2022-11-03 17:26:15 +08:00
<view class="app">
<view class="content">
2022-10-20 09:15:48 +08:00
<view class="righttext">
2022-10-31 09:04:45 +08:00
<image class="picture" :src="list.stationIntroducePcitureUrl"></image>
2022-10-20 09:15:48 +08:00
<view class="title">
{{list.nurseStationName}}
</view>
<view class="address">{{list.address}} </view>
2022-10-21 17:44:04 +08:00
<view class="call">
<view class="callme" @tap="gophone()">
2022-10-31 09:04:45 +08:00
<u-icon class='icon' name="phone-fill" color="#ffffff" size="30"></u-icon>
<view class="text">联系我们</view>
2022-10-21 17:44:04 +08:00
</view>
2022-11-03 17:26:15 +08:00
<!-- <view class="Navigation">
2022-10-21 17:44:04 +08:00
<image src="/static/daohang.png" mode="">导航</image>
2022-10-31 09:04:45 +08:00
</view> -->
2022-10-20 09:15:48 +08:00
</view>
</view>
<view class="detail">
2022-10-21 09:27:49 +08:00
<view class="Introduction">机构简介</view>
2022-12-01 17:03:02 +08:00
<view class="textInfo" v-html="list.agencyIntroduce">
2022-10-20 09:15:48 +08:00
</view>
</view>
<view class="Nursestationconfiguration">
<view class="configuration">
护理站配置
2022-10-31 09:04:45 +08:00
<view class="" style="margin-top: 30rpx;">
<view class="text" v-for="(item,index) in nurseStationLabelList" :key="index">
{{item.labelDescription}}
2022-10-20 09:15:48 +08:00
</view>
</view>
</view>
</view>
2022-10-21 10:01:09 +08:00
<view class="tive">
2022-10-20 09:15:48 +08:00
<view class="tab-box">
2022-10-21 17:44:04 +08:00
<view class="tab-item" @tap="testTabClick(index)" v-for="(item,index) in tabList" :key="index"
:class="tabIndex == index?'active':''">
2022-10-20 09:15:48 +08:00
{{item.name}}
</view>
</view>
2022-11-11 14:19:07 +08:00
<view class="" v-if="servelist.length>0&&choicetab==false">
2022-12-27 09:21:01 +08:00
<view class="item" v-for="item in servelist" :key="" v-show='choicetab==false'
@click.stop='goProjectDetails(item)'>
2022-11-11 14:19:07 +08:00
<image :src="item.itemPictureUrl"></image>
<view class="huanyao">{{item.nurseItemName}}
</view>
<!-- <view class="pingfen">
2022-10-31 09:04:45 +08:00
<u-rate :count="5" value="2"></u-rate>
</view> -->
2022-11-11 14:19:07 +08:00
<view class="servicetime">服务时长:{{item.serveDurationUnit?item.serveDurationUnit:'0'}}</view>
2022-12-27 09:21:01 +08:00
<view class="appointment" @tap.stop='goappointments(item)'>预约</view>
2022-11-11 14:19:07 +08:00
<view class="price">{{item.nurseItemPrice==null?'0':item.nurseItemPrice}}</view>
</view>
</view>
<view class="noorder" v-if='servelist.length==0&&choicetab==false'>
<image src="../../static/noorder.png" mode=""></image>
<view class="">
暂无服务项目
</view>
2022-10-20 09:15:48 +08:00
</view>
2022-11-11 14:19:07 +08:00
<view class="" v-if="productlist.length>0&&choicetab">
<view class="item" v-show='choicetab' v-for="(item,index) in productlist" :key="index">
<image :src="item.goodsPictureUrl"></image>
<view class="product">{{item.goodsName}}</view>
2023-01-10 13:35:23 +08:00
<view class="product" style="top:38%;font-size: 24rpx;color: #999999;">
{{item.attributeDetailsName}}
</view>
2022-11-11 14:19:07 +08:00
<view class="buy appointment" @tap="goCommodityDetails(item)">购买</view>
2023-01-10 13:35:23 +08:00
<view class="price" style="left:32%">{{item.goodsPrice==null?'0':item.goodsPrice}}</view>
2022-11-11 14:19:07 +08:00
</view>
</view>
<view class="noorder" v-if="productlist.length==0&&choicetab">
<image src="../../static/noorder.png" mode=""></image>
<view class="">
暂无产品
</view>
2022-10-20 09:15:48 +08:00
</view>
</view>
</view>
2022-10-31 09:04:45 +08:00
<u-mask :show="usershow" class='mask'>
<view class="information">
<image src="../../static/information.png" mode=""></image>
<view class="title">
请完善个人信息
</view>
<view class="cancel" @tap='usershow=false'>
取消
</view>
<view class="determine" @tap='goinformation'>
去完善
</view>
</view>
</u-mask>
2022-10-20 09:15:48 +08:00
</view>
</template>
<script>
2022-10-31 09:04:45 +08:00
import {
AppIdentification
} from '@/api/AppIdentification/index.js'
2022-10-20 09:15:48 +08:00
import {
introductionList,
itemList,
2022-10-21 09:27:49 +08:00
productInformation,
2022-10-20 09:15:48 +08:00
} from '@/api/nursestation/nursestation.js';
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
2022-11-03 17:26:15 +08:00
patientId: '', //
2022-10-31 09:04:45 +08:00
usershow: false, //完善信息开关
2022-10-20 09:15:48 +08:00
choicetab: false, //切换
2022-11-10 14:20:16 +08:00
list: [], //护理站list
2022-10-20 09:15:48 +08:00
servelist: [], //服务项目
productlist: [], //产品
2022-11-10 14:20:16 +08:00
servetotal: 0, //服务项目total
producttotal: 0, //产品total
2022-10-21 09:27:49 +08:00
stationid: '', //护理站id
2022-10-20 09:15:48 +08:00
nurseStationLabelList: [], //护理站配置
nearbyNursingStationItemList: [],
2022-10-31 09:04:45 +08:00
nurseStationId: '',
2022-10-20 09:15:48 +08:00
pageNum: 1,
pageSize: 10,
tabIndex: 0,
tabList: [{
name: "服务项目"
}, {
name: "产品"
}, ]
}
},
2022-11-10 14:20:16 +08:00
onShow() {
2022-10-31 09:04:45 +08:00
this.usershow = false
2022-12-02 16:04:52 +08:00
this.getInfo()
this.serveinfo()
this.productinfo()
2022-11-10 14:20:16 +08:00
},
2022-12-27 09:21:01 +08:00
onLoad(options) {
this.nurseStationId = options.nurseStationId
},
2022-10-20 09:15:48 +08:00
methods: {
2022-10-21 09:27:49 +08:00
goappointments(item) {
2022-11-10 14:20:16 +08:00
let that = this
try {
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
AppIdentification(this.patientId).then(res => {
if (res.data.loginFlag) {
uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
})
this.usershow = false
} else {
this.usershow = true
}
2022-10-31 09:04:45 +08:00
})
}
2022-11-10 14:20:16 +08:00
} catch (e) {}
2022-10-20 09:15:48 +08:00
},
getInfo() {
introductionList(this.nurseStationId).then(res => {
2022-11-03 17:26:15 +08:00
res.data.stationIntroducePcitureUrl = baseurl + res.data.stationIntroducePcitureUrl
2022-12-27 09:21:01 +08:00
if (res.data.agencyIntroduce) {
res.data.agencyIntroduce = res.data.agencyIntroduce.replace(/\<img/gi,
"<br/><img class='richPic'")
}
2022-11-03 17:26:15 +08:00
this.list = res.data
if (res.data.nurseStationLabelList) {
this.nurseStationLabelList = res.data.nurseStationLabelList
2022-10-21 17:44:04 +08:00
}
2022-10-20 09:15:48 +08:00
})
},
serveinfo() {
2022-12-27 09:21:01 +08:00
this.pageNum = 1
2022-10-20 09:15:48 +08:00
itemList(this.nurseStationId, this.pageSize, this.pageNum).then(res => {
2022-10-31 09:04:45 +08:00
res.rows.forEach(e => {
e.itemPictureUrl = baseurl + e.itemPictureUrl
})
2022-10-20 09:15:48 +08:00
this.servelist = res.rows
2022-11-10 14:20:16 +08:00
this.servetotal = res.total
2022-10-20 09:15:48 +08:00
})
},
productinfo() {
2022-12-27 09:21:01 +08:00
this.pageNum = 1
2022-10-20 09:15:48 +08:00
productInformation(this.nurseStationId, this.pageNum, this.pageSize).then(res => {
2022-10-31 09:04:45 +08:00
res.rows.forEach(e => {
e.goodsPictureUrl = baseurl + e.goodsPictureUrl
})
2022-10-20 09:15:48 +08:00
this.productlist = res.rows
2022-11-10 14:20:16 +08:00
this.producttotal = res.total
2022-10-20 09:15:48 +08:00
})
},
testTabClick(index) {
this.tabIndex = index
2022-10-31 09:04:45 +08:00
this.choicetab = this.tabIndex
},
//跳转商品详情页
goCommodityDetails(item) {
uni.navigateTo({
2023-01-10 13:35:23 +08:00
url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'NURSE_STATION'}&goodsAttributeId=${item.goodsAttributeId}`
2022-10-31 09:04:45 +08:00
})
},
//跳转完善页面
goinformation() {
uni.navigateTo({
url: '/pages/information/information'
})
},
2022-12-27 09:21:01 +08:00
goProjectDetails(item) {
uni.navigateTo({
url: `/pages/ProjectDetails/ProjectDetails?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
})
},
2022-11-03 17:26:15 +08:00
gophone() {
var that = this
uni.getSystemInfo({
success: function(res) {
if (res.platform == 'ios') {
uni.makePhoneCall({
phoneNumber: that.list.phone //仅为示例
});
} else {
uni.showActionSheet({
itemList: ['呼叫', ],
success: function(res) {
if (res.tapIndex + 1 == 1) {
uni.makePhoneCall({
phoneNumber: that.list.phone //仅为示例
});
}
},
2023-01-10 13:35:23 +08:00
fail: function(res) {}
2022-11-03 17:26:15 +08:00
});
}
2022-10-25 08:58:53 +08:00
}
2022-11-03 17:26:15 +08:00
});
},
},
onReachBottom() { //下滑加载
if (this.choicetab == 0) {
if (this.servelist.length >= this.servetotal) {} else {
this.pageNum++
itemList(this.nurseStationId, this.pageSize, this.pageNum).then(res => {
res.rows.forEach(e => {
e.itemPictureUrl = baseurl + e.itemPictureUrl
this.servelist.push(e)
})
})
2022-10-25 08:58:53 +08:00
}
2022-11-03 17:26:15 +08:00
} else {
if (this.productlist.length >= this.producttotal) {} else {
this.pageNum++
productInformation(this.nurseStationId, this.pageNum, this.pageSize).then(res => {
res.rows.forEach(e => {
e.goodsPictureUrl = baseurl + e.goodsPictureUrl
this.productlist.push(e)
})
})
}
}
2022-10-25 08:58:53 +08:00
},
2022-11-03 17:26:15 +08:00
onPullDownRefresh() { //下拉刷新
this.pageNum = 1;
if (this.choicetab == 0) {
itemList(this.nurseStationId, this.pageSize, this.pageNum).then(res => {
res.rows.forEach(e => {
e.itemPictureUrl = baseurl + e.itemPictureUrl
})
this.servelist = res.rows
})
} else {
productInformation(this.nurseStationId, this.pageNum, this.pageSize).then(res => {
res.rows.forEach(e => {
e.goodsPictureUrl = baseurl + e.goodsPictureUrl
})
this.productlist = res.rows
})
}
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
2022-10-20 09:15:48 +08:00
}
</script>
2022-10-31 09:04:45 +08:00
<style lang="scss">
2022-10-25 08:58:53 +08:00
@import './nursestation.scss'
2022-10-20 09:15:48 +08:00
</style>