就医服务

master
lion 1 year ago
parent 0d1117a0f3
commit 4245b40401

@ -10,7 +10,9 @@
const token = this.vuex_token ? this.vuex_token : uni.getStorageSync('lifeData')?.vuex_token;
if (token) {
try {
const { user } = await this.$u.api.getUserInfo()
const {
user
} = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
} catch (err) {
console.error(err)
@ -29,6 +31,7 @@
<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
page {
background-color: #f2f3f7;
}

@ -51,6 +51,11 @@ let apiApp = {
hospital: '/api/mobile/hospital/hospital',
banner: '/api/mobile/other/banner',
// 就医服务
serveHospital:'/api/mobile/serve-hospital/hospital',
serveHospitalDetail:'/api/mobile/serve-hospital/hospital-detail',
serveHospitalForm:'/api/mobile/serve-hospital/forms'
}
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
@ -108,7 +113,10 @@ const install = (Vue, vm) => {
const cartShow = (params = {}) => vm.$u.get(apiApp.cartShow, params)
const cartSave = (params = {}) => vm.$u.post(apiApp.cartSave, params)
const cartDestroy = (params = {}) => vm.$u.get(apiApp.cartDestroy, params)
// 就医服务
const serveHospital = (params = {}) => vm.$u.get(apiApp.serveHospital, params)
const serveHospitalDetail = (params = {}) => vm.$u.get(apiApp.serveHospitalDetail, params)
const serveHospitalForm = (params = {}) => vm.$u.get(apiApp.serveHospitalForm, params)
// end
vm.$u.api = {
@ -134,7 +142,9 @@ const install = (Vue, vm) => {
// 用户商城订单
userOrders,userOrdersDetail,productOrderRefund,
// 购物车
cartList, cartSave, cartShow, cartDestroy
cartList, cartSave, cartShow, cartDestroy,
//就医服务
serveHospital,serveHospitalDetail,serveHospitalForm
};
}

@ -0,0 +1,233 @@
<template>
<view class="page">
<image class="bkg" :src="info.cover?info.cover.url:''"></image>
<view class="cotainer">
<view class="hospital">
<view class="title">{{ info.name }}</view>
<view class="tag">
<view class="tag__item" v-if="info.level">{{ info.level }}</view>
<view class="tag__item" v-if="info.type">{{ info.type }}</view>
</view>
<view class="description"> 对接科室{{info.serve_hospital_department_count}}
累计咨询量{{info.serve_hospital_forms_count}} </view>
</view>
<view class="department">
<view class="title">选择科室</view>
<view class="department-list">
<view class="department-list-item" :class="department_id==item.id?'department-list-active':''"
@click="clickDepartment(item)" v-for="item in info.serve_hospital_department">
<view class="title">
{{item.name}}
</view>
<view class="description">
累计咨询数量{{item.serve_hospital_forms_count}}
</view>
</view>
</view>
</view>
<u-button ripple shape="circle" :custom-style="orderBtnStyle" :throttle-time="2000"
@click="goSubmit">下一步</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
orderBtnStyle: {
'background-image': 'linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)',
'font-weight': '500',
'font-size': '27rpx',
'color': '#fff',
'width': '440rpx',
'height': '80rpx',
'line-height': '80rpx'
},
id: '',
info: {},
department_id: '',
department_name: ''
};
},
mounted() {
// if (this.$store.state.vuex_location !== 2) {
// this.$store.dispatch('getLocation')
// }
},
onLoad(options) {
this.id = options.id ? options.id : ''
this.getDetail()
},
methods: {
async getDetail() {
const res = await this.$u.api.serveHospitalDetail({
id: this.id
})
this.info = res
},
clickDepartment(item) {
this.department_id = item.id
this.department_name = item.name
},
goSubmit() {
if(!this.department_id){
uni.showToast({
title:'请先选择想要咨询的科室',
icon:'none',
})
return
}
this.$u.route({
url: '/package_sub/pages/ServeForm/ServeForm',
params: {
id: this.id,
department_id: this.department_id,
}
})
}
},
computed: {
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
}
}
</script>
<style lang="scss">
.page {
position: relative;
background-color: #f5efee;
height: 100vh;
padding-bottom: 80rpx;
}
.bkg {
height: 540rpx;
width: 100vw;
position: absolute;
}
.cotainer {
padding-top: 460rpx;
}
.hospital {
background-color: #fff;
border-radius: 10rpx;
filter: drop-shadow(2.192rpx 4.494rpx 5rpx rgba(33, 32, 32, 0.15));
// padding-top:460rpx;
padding: 40rpx;
margin: 25rpx;
margin-top: 0;
.title {
font-size: 28rpx;
color: #000000;
font-weight: bold;
}
.tag {
margin-top: 16rpx;
display: flex;
flex-wrap: wrap;
&__item {
padding: 5rpx 16rpx;
font-size: 22rpx;
line-height: 31rpx;
font-weight: 500;
&:nth-child(1) {
color: #ca2328;
background-color: #faefef;
}
&:nth-child(2) {
color: #f38628;
background-color: #fcf3e9;
}
}
.tag__item+.tag__item {
margin-left: 12rpx;
}
}
.description {
// max-width: 350rpx;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 22rpx;
color: #929196;
font-weight: 500;
margin-top: 16rpx;
}
}
.department {
background-color: #fff;
border-radius: 10rpx;
filter: drop-shadow(2.192rpx 4.494rpx 5rpx rgba(33, 32, 32, 0.15));
// padding-top:460rpx;
padding: 30rpx 40rpx;
margin: 25rpx;
margin-top: 0;
margin-bottom: 50rpx;
.title {
font-size: 28rpx;
color: #000000;
font-weight: bold;
margin-bottom: 30rpx;
}
.description {
// max-width: 350rpx;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 22rpx;
color: #929196;
font-weight: 500;
}
&-list {
display: flex;
align-items: flex-start;
justify-content: space-between;
flex-wrap: wrap;
&-item {
width: calc(50% - 15rpx);
padding: 30rpx;
padding-right: 10rpx;
border: 2rpx solid rgba(33, 32, 32, 0.15);
border-radius: 10rpx;
margin-bottom: 30rpx;
.title {
margin-bottom: 25rpx;
}
}
&-active {
border: 2rpx solid transparent;
background-image: url(@/package_sub/static/ServeHospital/active.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
}
}
</style>

@ -0,0 +1,322 @@
<template>
<view class="page">
<image class="bkg" :src="info.cover?info.cover.url:''"></image>
<view class="cotainer">
<view class="hospital">
<view class="title">咨询科室{{ info.name?info.name:'' }} - {{department_name?department_name:''}}</view>
<view class="hospital-title">患者信息</view>
<view class="hospital-form">
<view class="form-card form-card-1">
<u-form :model="form" :rules="rules" ref="uForm" :label-width="178" :error-type="['toast']">
<u-form-item label="姓名" prop="name" required>
<u-input v-model="form.name" placeholder="请填写姓名" />
</u-form-item>
<u-form-item label="性别" prop="sex" required>
<view slot="right">
<view class="sexs">
<view v-for="item in list_sex" class="sexs-item" @click="confirmSex(item)"
:class="form.sex==item?'sexs-active':''">{{item}}</view>
</view>
</view>
</u-form-item>
<u-form-item label="出生年月" prop="birthday" required>
<u-input type="select" placeholder="请选择" v-model="form.birthday"
:select-open="isShowTime" @click="isShowTime = true" />
</u-form-item>
<u-form-item label="所在城市" prop="city">
<u-input v-model="form.city" placeholder="请填写所在城市" />
</u-form-item>
<u-form-item label="患者关系" prop="relationship" required>
<u-input type="select" placeholder="请选择" v-model="form.relationship"
:select-open="isShowRelationship" @click="isShowRelationship = true" />
</u-form-item>
<u-form-item label="手机号码" prop="mobile" required>
<u-input v-model="form.mobile" placeholder="请填写手机号码" type="number" />
</u-form-item>
<u-form-item label="咨询类别" prop="type" required>
<u-input type="select" placeholder="请选择" v-model="form.type" :select-open="isShowType"
@click="isShowType = true" />
</u-form-item>
<view class="form-card-2">
<u-form-item label="咨询信息" prop="content" label-position="top" :border-bottom="false">
<u-input border :custom-style="{ 'letter-spacing': '2rpx' }" border-color="#dad9d9"
placeholder="请简单描述您要咨询的内容(内容加密保护)" v-model="form.content"
type="textarea"></u-input>
</u-form-item>
</view>
</u-form>
</view>
</view>
</view>
<u-button ripple shape="circle" :custom-style="orderBtnStyle" :throttle-time="2000"
@click="submit">提交咨询</u-button>
</view>
<!-- 出生年月 -->
<u-picker v-model="isShowTime" :params="{
year: true,
month: true,
day: true,
}" mode="time" @confirm="confirmTime"></u-picker>
<!-- 患者关系 -->
<u-select v-model="isShowRelationship" value-name="value" @confirm="confirmRelationship" label-name="label"
:list="list_relationship"></u-select>
<!-- 咨询类别 -->
<u-select v-model="isShowType" value-name="value" @confirm="confirmType" label-name="label"
:list="list_type"></u-select>
</view>
</template>
<script>
export default {
data() {
return {
orderBtnStyle: {
'background-image': 'linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)',
'font-weight': '500',
'font-size': '27rpx',
'color': '#fff',
'width': '440rpx',
'height': '80rpx',
'line-height': '80rpx'
},
serve_hospital_id: '',
serve_hospital_department_id: '',
info: {},
department_name: '',
form: {
name: '',
sex: '男',
birthday: '',
city: '',
relationship: '',
mobile: '',
type: '',
content: '',
},
rules: {
name: [{
required: true,
message: "请填写姓名",
trigger: ["blur", "change"],
}],
sex: [{
required: true,
message: "请选择性别",
trigger: ["blur", "change"],
}],
birthday: [{
required: true,
message: "请选择出生日期",
trigger: ["blur", "change"],
}],
relationship: [{
required: true,
message: "请选择患者关系",
trigger: ["blur", "change"],
}],
mobile: [{
required: true,
message: "请填写手机号码",
trigger: ["blur", "change"],
},
{
//
validator: (rule, value, callback) => {
return this.$u.test.mobile(value);
},
message: "手机号码不正确",
// blurchange
trigger: ["change", "blur"],
}
],
type: [{
required: true,
message: "请选择咨询类别",
trigger: ["blur", "change"],
}],
},
isShowTime: false,
isShowRelationship: false,
list_sex: ['男', '女'],
list_relationship: [{
label: '本人',
value: '本人'
}, {
label: '家庭成员',
value: '家庭成员'
}, {
label: '亲戚朋友',
value: '亲戚朋友'
}, {
label: '其他',
value: '其他'
}],
isShowType: false,
list_type: [{
label: '专家咨询',
value: '专家咨询'
}, {
label: '普通咨询',
value: '普通咨询'
}],
};
},
mounted() {
// if (this.$store.state.vuex_location !== 2) {
// this.$store.dispatch('getLocation')
// }
},
onReady() {
this.$refs.uForm.setRules(this.rules);
},
onLoad(options) {
this.serve_hospital_id = options.id ? options.id : ''
this.serve_hospital_department_id = options.department_id ? options.department_id : ''
this.getDetail()
},
methods: {
async getDetail() {
const res = await this.$u.api.serveHospitalDetail({
id: this.serve_hospital_id
})
this.info = res
res.serve_hospital_department.map(item => {
if (this.serve_hospital_department_id == item.id) {
this.department_name = item.name
}
})
},
confirmSex(e) {
this.form.sex = e
},
confirmTime(e) {
this.form.birthday = `${e.year}-${e.month}-${e.day}`;
},
confirmRelationship(e) {
this.form.relationship = e[0].value;
},
confirmType(e) {
this.form.type = e[0].value;
},
submit() {
this.$refs.uForm.validate(async (valid) => {
if (valid) {
const res = await this.$u.api.serveHospitalForm({
serve_hospital_id: this.serve_hospital_id,
serve_hospital_department_id: this.serve_hospital_department_id,
...this.form
});
if (res) {
uni.showToast({
title: '提交成功',
duration: 1500,
icon:'none',
success() {
setTimeout(function() {
uni.switchTab({
url: '/pages/index/index'
})
}, 1500)
}
})
}
} else {
console.log("验证失败");
}
});
}
},
computed: {
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
}
}
</script>
<style lang="scss">
.page {
position: relative;
background-color: #f5efee;
height: 100vh;
padding-bottom: 80rpx;
}
.bkg {
height: 540rpx;
width: 100vw;
position: absolute;
}
.cotainer {
padding-top: 460rpx;
padding-bottom: 80rpx;
background-color: #f5efee;
}
.hospital {
background-color: #fff;
border-radius: 10rpx;
filter: drop-shadow(2.192rpx 4.494rpx 5rpx rgba(33, 32, 32, 0.15));
margin: 25rpx;
margin-top: 0;
padding-bottom: 60rpx;
margin-bottom: 50rpx;
.title {
font-size: 28rpx;
color: #222222;
padding: 40rpx;
border-bottom: 1rpx solid rgba(33, 32, 32, 0.15);
}
&-title {
font-size: 28rpx;
padding: 40rpx;
color: #000;
padding-bottom: 20rpx;
}
&-form {
.form-card {
padding: 0 60rpx;
}
}
.sexs {
display: flex;
align-items: center;
&-item {
width: 130rpx;
height: 48rpx;
line-height: 48rpx;
color: #000000;
font-size: 24rpx;
text-align: center;
border-radius: 48rpx;
background-color: #e4e9f0;
margin-left: 10rpx
}
&-active {
color: #fff;
background: linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%);
}
}
::v-deep .form-card .u-input__input {
text-align: right;
}
::v-deep .form-card-2 .u-input__input {
text-align: left;
}
}
</style>

@ -0,0 +1,265 @@
<template>
<view class="page">
<!-- <view class="top">
<view class="position" @click="isShowSite = true">
<u-icon name="map-fill"></u-icon>
<text>{{ vuex_site.name || ' ' }}</text>
<u-icon name="arrow-down" size="22"></u-icon>
</view>
</view> -->
<image class="bkg" src="~@/package_sub/static/ServeHospital/bkg.png"></image>
<view class="container">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view v-if="list.length>0">
<view class="list">
<view class="list-item" v-for="(item,i) in list" :key="i" @click="toDetail(item)">
<view class="left">
<image :src="item.cover?item.cover.url:''" alt=""></image>
</view>
<view class="center">
<view class="title">{{ item.name }}</view>
<view class="tag">
<view class="tag__item" v-if="item.level">{{ item.level }}</view>
<view class="tag__item" v-if="item.type">{{ item.type }}</view>
</view>
<view class="description"> 对接科室{{item.serve_hospital_department_count}} 累计咨询量{{item.serve_hospital_forms_count}} </view>
</view>
<view class="right">
<u-icon size="40" color="#7f7f7f" name="arrow-right"></u-icon>
</view>
</view>
<u-loadmore :margin-top="20" :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
</view>
</view>
<view v-else style="height: 100%;" class="d-flex ai-center jc-center">
<u-empty mode="list"></u-empty>
</view>
</scroll-view>
</view>
<!-- 选择站点 -->
<u-select v-model="isShowSite" value-name="id" @confirm="confirmSite" label-name="name"
:list="list_site"></u-select>
</view>
</template>
<script>
export default {
data() {
return {
orderBtnStyle: {
'background-image': 'linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)',
'font-weight': '500',
'font-size': '27rpx',
'color': '#fff',
'width': '130rpx',
'height': '60rpx',
'line-height': '60rpx'
},
last_page: 1,
select: {
page: 1,
page_size: 5,
},
list: [],
loadStatus: 'loadmore',
isShowSite: false,
list_site: [{
id: '',
name: '全部站点'
}],
};
},
mounted() {
// if (this.$store.state.vuex_location !== 2) {
// this.$store.dispatch('getLocation')
// }
},
onLoad(options) {
this.select.type = options.type ? options.type : ''
this.getSiteList()
this.getList()
},
methods: {
async getSiteList() {
const res = await this.$u.api.otherSite()
this.list_site.push(...res)
},
async getList() {
const res = await this.$u.api.serveHospital({
...this.select,
// site_id: this.vuex_site?.id
})
this.last_page = res.last_page
this.loadStatus = this.select.page >= this.last_page ? 'nomore' : 'loadmore'
this.list.push(...res.data)
console.log(this.select.page, this.last_page)
},
reachBottom() {
if (this.select.page > this.last_page) {
this.loadStatus = 'nomore'
return
}
this.loadStatus = 'loading'
this.select.page++
this.getList()
},
confirmSite(e) {
this.$u.vuex("vuex_site", e[0])
this.list = []
this.select.page = 1
this.getList()
},
toDetail(item) {
if(item.serve_hospital_department_count<1){
uni.showToast({
title:'当前还未设置对接科室',
icon:'none',
})
return
}
this.$u.route({
url: '/package_sub/pages/ServeDetail/ServeDetail?id=' + item.id
})
}
},
computed: {
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
}
}
</script>
<style lang="scss">
.page {
position: relative;
background-color: #f5efee;
height:100vh;
padding-bottom:40rpx;
}
::v-deep .u-load-more-wrap {
background-color: #fff !important;
.u-line-1 {
background-color: #fff !important;
}
}
.top {
width: 100vw;
background: #fff;
padding: 26rpx 28rpx;
z-index: 4;
position: sticky;
top: 0;
height: 94rpx;
.position {
color: #000;
font-size: 30rpx;
letter-spacing: 3rpx;
font-weight: 500;
&>text {
padding: 0 13rpx;
}
}
}
.bkg {
height: 316rpx;
width: 100vw;
position: absolute;
}
.container {
z-index: 1;
height: calc(100vh - 390rpx);
position: relative;
top:350rpx;
.list {
position: relative;
z-index: 3;
padding-bottom: 40rpx;
padding-top:20rpx;
background-color: #fff;
border-radius: 10rpx;
margin: 0 25rpx;
&-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15rpx 30rpx;
.left {
&>image {
height: 160rpx;
width: 220rpx;
border-radius: 6rpx;
}
}
.center {
width:calc(100% - 300rpx);
.title {
font-size: 28rpx;
color: #000000;
font-weight: bold;
}
.tag {
margin-top: 16rpx;
display: flex;
flex-wrap: wrap;
&__item {
padding: 5rpx 16rpx;
font-size: 22rpx;
line-height: 31rpx;
font-weight: 500;
&:nth-child(1) {
color: #ca2328;
background-color: #faefef;
}
&:nth-child(2) {
color: #f38628;
background-color: #fcf3e9;
}
}
.tag__item+.tag__item {
margin-left: 12rpx;
}
}
.description {
// max-width: 350rpx;
width:100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 22rpx;
color: #929196;
font-weight: 500;
margin-top: 16rpx;
}
}
.right {
width:40rpx;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

@ -137,7 +137,28 @@
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/ServeHospital/ServeHospital",
"style": {
"navigationBarTitleText": "就医服务",
"enablePullDownRefresh": true
}
},
{
"path": "pages/ServeDetail/ServeDetail",
"style": {
"navigationBarTitleText": "选择科室"
}
},
{
"path": "pages/ServeForm/ServeForm",
"style": {
"navigationBarTitleText": "提交咨询"
}
}
]
}
],

@ -68,7 +68,7 @@
</view>
<view class="swiper">
<u-swiper :list="banners" name="url"></u-swiper>
<u-swiper :height="366" :list="banners" name="url"></u-swiper>
</view>
<view class="links">
@ -272,6 +272,7 @@ export default {
{
text: "就医服务",
icon: "/static/index/jiuyifuwu.png",
to: "/package_sub/pages/ServeHospital/ServeHospital",
},
{
text: "居家照护",

Loading…
Cancel
Save