NurseStationApp/pages/nursestation/nursestation.vue

268 lines
7.4 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>
<view class="textInfo">
2022-10-20 09:15:48 +08:00
{{list.agencyIntroduce}}
</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-03 17:26:15 +08:00
<view class="item" v-for="item in servelist" :key="" v-show='choicetab==0'>
2022-10-31 09:04:45 +08:00
<image :src="item.itemPictureUrl"></image>
2022-10-20 09:15:48 +08:00
<view class="huanyao">{{item.nurseItemName}}
</view>
2022-10-31 09:04:45 +08:00
<!-- <view class="pingfen">
<u-rate :count="5" value="2"></u-rate>
</view> -->
2022-11-03 17:26:15 +08:00
<view class="servicetime">服务时长:{{item.serveDurationUnit?item.serveDurationUnit:'0'}}</view>
2022-10-21 09:27:49 +08:00
<view class="appointment" @tap='goappointments(item)'>预约</view>
2022-11-03 17:26:15 +08:00
<view class="price">{{item.price==null?'0':item.price}}</view>
2022-10-20 09:15:48 +08:00
</view>
2022-11-03 17:26:15 +08:00
<view class="item" v-show='choicetab==1' v-for="(item,index) in productlist" :key="index">
2022-10-31 09:04:45 +08:00
<image :src="item.goodsPictureUrl"></image>
2022-10-21 09:27:49 +08:00
<view class="product">{{item.goodsName}}</view>
2022-10-31 09:04:45 +08:00
<view class="buy appointment" @tap="goCommodityDetails(item)">购买</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
this.getInfo()
this.serveinfo()
this.productinfo()
2022-10-20 09:15:48 +08:00
},
2022-11-10 14:20:16 +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
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() {
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() {
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
2022-11-03 17:26:15 +08:00
console.log(this.choicetab)
2022-10-31 09:04:45 +08:00
},
//跳转商品详情页
goCommodityDetails(item) {
uni.navigateTo({
url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'NURSE_STATION'}`
})
},
//跳转完善页面
goinformation() {
uni.navigateTo({
url: '/pages/information/information'
})
},
2022-11-03 17:26:15 +08:00
gophone() {
var that = this
uni.getSystemInfo({
success: function(res) {
// console.log(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 //仅为示例
});
}
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
},
fail: function(res) {
// console.log(res.errMsg);
2022-10-25 08:58:53 +08:00
}
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) {
console.log(1)
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-11-10 14:20:16 +08:00
2022-11-03 17:26:15 +08:00
}
2022-10-21 17:44:04 +08:00
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>