397 lines
12 KiB
Vue
397 lines
12 KiB
Vue
<template>
|
|
<view class="app">
|
|
<u-swiper v-if="lbinfo" :list="lbinfo" height="400" style='background-size: 100%;' mode='none'></u-swiper>
|
|
<view class="content">
|
|
<view class="righttext">
|
|
<view class="title" v-if="list.nurseStationName">
|
|
{{list.nurseStationName}}
|
|
</view>
|
|
<view class="title" v-else>
|
|
暂无
|
|
</view>
|
|
<view class="time">
|
|
<view class="text">
|
|
{{list.businessStatus}}
|
|
</view>
|
|
<view class="timeday">
|
|
{{list.openingHoursDescribe}}
|
|
</view>
|
|
<view class="texttime">
|
|
<view class="">
|
|
上午:{{list.morningOpenStartTime}}-{{list.morningOpenEndTime}}
|
|
</view>
|
|
<view class="">
|
|
下午:{{list.afternoonOpenStartTime}}-{{list.afternoonOpenEndTime}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="configuration">
|
|
<view class="text" v-for="(item,index) in nurseStationLabelList" :key="index">
|
|
{{item.labelDescription}}
|
|
</view>
|
|
</view>
|
|
<view class="address" v-if="list.address">
|
|
<image src="../../static/locatinsmall.png" mode=""></image>
|
|
<view class="text">
|
|
{{list.address}}
|
|
</view>
|
|
<view class="distance">
|
|
{{distance}}KM
|
|
</view>
|
|
</view>
|
|
<view class="address" v-else>
|
|
暂无
|
|
</view>
|
|
<view class="address" v-if="list.dutyPhone" style="margin: 20rpx 0 0 33rpx;" @tap='gophone'>
|
|
<image src="../../static/phone.png" mode=""></image>
|
|
<view class="text">
|
|
{{list.dutyPhone}}
|
|
</view>
|
|
</view>
|
|
<view class="address" v-else style="margin: 0 0 0 30rpx;">
|
|
暂无
|
|
</view>
|
|
</view>
|
|
<view class="tive">
|
|
<!-- <view class="tab-box">
|
|
<view class="tab-item" @tap="testTabClick(index)" v-for="(item,index) in tabList" :key="index"
|
|
:class="tabIndex == index?'active':''">
|
|
{{item.classifyName}}
|
|
</view>
|
|
</view> -->
|
|
<u-tabs :list="tabList" :current="classifycurrent" @change="change"></u-tabs>
|
|
<view class="" v-if="servelist.length>0&&choicetab==false">
|
|
<view class="item" v-for="item in servelist" :key="" v-show='choicetab==false'
|
|
@click.stop='goProjectDetails(item)'>
|
|
<image :src="item.itemPictureUrl"></image>
|
|
<view class="huanyao">{{item.nurseItemName}}
|
|
</view>
|
|
<!-- <view class="pingfen">
|
|
<u-rate :count="5" value="2"></u-rate>
|
|
</view> -->
|
|
<!-- <view class="servicetime">服务时长:{{item.serveDurationUnit?item.serveDurationUnit:'0'}}</view> -->
|
|
<view class="appointment" @tap.stop='goappointments(item)'>预约</view>
|
|
<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>
|
|
</view>
|
|
<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>
|
|
<!-- <view class="product" style="top:38%;font-size: 24rpx;color: #999999;">
|
|
{{item.attributeDetailsName}}
|
|
</view> -->
|
|
<view class="buy appointment" @tap="goCommodityDetails(item)">购买</view>
|
|
<view class="price">¥{{item.goodsPrice==null?'0':item.goodsPrice}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="noorder" v-if="productlist.length==0&&choicetab">
|
|
<image src="../../static/noorder.png" mode=""></image>
|
|
<view class="">
|
|
暂无产品
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<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>
|
|
<u-toast ref="uToast" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
AppIdentification
|
|
} from '@/api/AppIdentification/index.js'
|
|
import {
|
|
introductionList,
|
|
itemList,
|
|
productInformation,
|
|
} from '@/api/nursestation/nursestation.js';
|
|
import baseurl from '@/api/baseurl.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
lbinfo: [], //轮播list
|
|
usershow: false, //完善信息开关
|
|
choicetab: false, //切换
|
|
list: [], //护理站list
|
|
servelist: [], //服务项目
|
|
productlist: [], //产品
|
|
servetotal: 0, //服务项目total
|
|
producttotal: 0, //产品total
|
|
stationid: '', //护理站id
|
|
nurseStationLabelList: [], //护理站配置
|
|
nearbyNursingStationItemList: [],
|
|
nurseStationId: '',
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
timer: null,
|
|
tabList: [{
|
|
name: '全部',
|
|
id: ''
|
|
}], //分类标题
|
|
classifycurrent: 0, //分类下标
|
|
distance: null, //距离
|
|
nurseClassifyInfoId: '', //分类id
|
|
}
|
|
},
|
|
onShow() {
|
|
this.usershow = false
|
|
this.getInfo()
|
|
},
|
|
onLoad(options) {
|
|
this.nurseStationId = options.nurseStationId
|
|
this.distance = options.distance
|
|
},
|
|
methods: {
|
|
//点击分类标题
|
|
change(index) {
|
|
this.classifycurrent = index;
|
|
this.nurseClassifyInfoId = this.tabList[index].id
|
|
this.serveinfo()
|
|
if (this.tabList[index].name == '产品') {
|
|
this.choicetab = true
|
|
} else {
|
|
this.choicetab = false
|
|
}
|
|
},
|
|
goappointments(item) {
|
|
let that = this
|
|
try {
|
|
const value = uni.getStorageSync('openid');
|
|
const value2 = uni.getStorageSync('patientId');
|
|
if (value && value2) {
|
|
AppIdentification(value2).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.data.loginFlag) {
|
|
that.usershow = false
|
|
uni.navigateTo({
|
|
url: `/pages/appointmenttime/appointmenttime?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
|
|
})
|
|
} else {
|
|
that.usershow = true
|
|
}
|
|
} else if (res.code == 9999) {} else {
|
|
that.$refs.uToast.show({
|
|
title: res.msg,
|
|
type: 'error'
|
|
})
|
|
if (that.timer) {
|
|
clearTimeout(that.timer)
|
|
}
|
|
that.timer = setTimeout(e => {
|
|
uni.navigateTo({
|
|
url: '/pages/login/login'
|
|
})
|
|
}, 1500)
|
|
}
|
|
})
|
|
} else {
|
|
that.$refs.uToast.show({
|
|
title: '未登录,请先登录',
|
|
type: 'error'
|
|
})
|
|
if (that.timer) {
|
|
clearTimeout(that.timer)
|
|
}
|
|
that.timer = setTimeout(e => {
|
|
uni.navigateTo({
|
|
url: '/pages/login/login'
|
|
})
|
|
}, 1500)
|
|
}
|
|
} catch (e) {
|
|
uni.navigateTo({
|
|
url: '/pages/login/login'
|
|
})
|
|
}
|
|
},
|
|
getInfo() {
|
|
introductionList(this.nurseStationId).then(res => {
|
|
if (res.code == 200) {
|
|
this.serveinfo()
|
|
this.productinfo()
|
|
res.data.morningOpenStartTime = res.data.morningOpenStartTime.slice(0, 5)
|
|
res.data.morningOpenEndTime = res.data.morningOpenEndTime.slice(0, 5)
|
|
res.data.afternoonOpenStartTime = res.data.afternoonOpenStartTime.slice(0, 5)
|
|
res.data.afternoonOpenEndTime = res.data.afternoonOpenEndTime.slice(0, 5)
|
|
res.data.stationIntroducePcitureUrl = baseurl + res.data.stationIntroducePcitureUrl
|
|
if (res.data.agencyIntroduce) {
|
|
res.data.agencyIntroduce = res.data.agencyIntroduce.replace(/\<img/gi,
|
|
"<br/><img class='richPic'")
|
|
}
|
|
res.data.nurseClassifyInfoList.forEach(e => {
|
|
e.name = e.classifyName
|
|
this.tabList.push(e)
|
|
})
|
|
var obj = {
|
|
name: '产品'
|
|
}
|
|
this.tabList.push(obj)
|
|
this.list = res.data
|
|
res.data.poserInfoList.forEach(e => {
|
|
e.posterPictureUrl = baseurl + e.posterPictureUrl
|
|
var obj = {
|
|
image: e.posterPictureUrl
|
|
}
|
|
this.lbinfo.push(obj)
|
|
})
|
|
if (res.data.nurseStationLabelList) {
|
|
this.nurseStationLabelList = res.data.nurseStationLabelList
|
|
}
|
|
}
|
|
})
|
|
},
|
|
serveinfo() {
|
|
this.pageNum = 1
|
|
itemList(this.nurseStationId, this.pageSize, this.pageNum, this.nurseClassifyInfoId).then(res => {
|
|
uni.removeStorageSync('Refresh');
|
|
res.rows.forEach(e => {
|
|
e.itemPictureUrl = baseurl + e.itemPictureUrl
|
|
})
|
|
this.servelist = res.rows
|
|
this.servetotal = res.total
|
|
})
|
|
},
|
|
productinfo() {
|
|
this.pageNum = 1
|
|
productInformation(this.nurseStationId, this.pageNum, this.pageSize).then(res => {
|
|
uni.removeStorageSync('Refresh');
|
|
res.rows.forEach(e => {
|
|
e.goodsPictureUrl = baseurl + e.goodsPictureUrl
|
|
})
|
|
this.productlist = res.rows
|
|
this.producttotal = res.total
|
|
})
|
|
},
|
|
//跳转商品详情页
|
|
goCommodityDetails(item) {
|
|
uni.navigateTo({
|
|
url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'NURSE_STATION'}&goodsAttributeId=${item.goodsAttributeId}`
|
|
})
|
|
},
|
|
//跳转完善页面
|
|
goinformation() {
|
|
this.usershow = false
|
|
uni.navigateTo({
|
|
url: '/pages/information/information'
|
|
})
|
|
},
|
|
goProjectDetails(item) {
|
|
uni.navigateTo({
|
|
url: `/pages/ProjectDetails/ProjectDetails?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
|
|
})
|
|
},
|
|
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 //仅为示例
|
|
});
|
|
}
|
|
},
|
|
fail: function(res) {}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
onReachBottom() { //上滑加载
|
|
if (!this.choicetab) {
|
|
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)
|
|
})
|
|
})
|
|
}
|
|
} 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)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
onPullDownRefresh() { //下拉刷新
|
|
this.pageNum = 1;
|
|
if (!this.choicetab) {
|
|
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);
|
|
},
|
|
//1.分享给朋友
|
|
onShareAppMessage(res) {
|
|
let pages = getCurrentPages();
|
|
let url = pages[pages.length - 1].$page.fullPath
|
|
return {
|
|
title: '泉医到家',
|
|
path: url,
|
|
}
|
|
},
|
|
//2.分享到朋友圈
|
|
onShareTimeline(res) {
|
|
let pages = getCurrentPages();
|
|
let url = pages[pages.length - 1].$page.fullPath
|
|
return {
|
|
title: '泉医到家',
|
|
path: url,
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import './nursestation.scss';
|
|
</style>
|