This commit is contained in:
曹辉 2023-02-17 09:36:17 +08:00
parent 349e0d1698
commit b4e080db92
24 changed files with 606 additions and 1185 deletions

View File

@ -286,37 +286,25 @@
{ {
"path": "pages/medicine/medicine", "path": "pages/medicine/medicine",
"style": { "style": {
"navigationBarTitleText": "就医", "navigationBarTitleText": "健康咨询",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, },
{ {
"path": "pages/Doctordetails/Doctordetails",
"style": {
"navigationBarTitleText": "医生信息",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
}, {
"path": "pages/Geriatricdisease/Geriatricdisease",
"style": {
"navigationBarTitleText": "老年病中心",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
}, {
"path": "pages/diseasemanagement/diseasemanagement", "path": "pages/diseasemanagement/diseasemanagement",
"style": { "style": {
"navigationBarTitleText": "专病管理", "navigationBarTitleText": "专病管理",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, { },
"path": "pages/toptabbar/toptabbar", {
"path": "pages/utabs/u-tabs",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
} }
}, },
{ {

View File

@ -1,120 +0,0 @@
<template>
<view class="app">
<view class="info">
<view class="image">
</view>
<view class="name">
某某某
</view>
<view class="position">
主任医师
</view>
<view class="border">
</view>
<view class="text">
熟悉呼吸系统疾病的诊治尤其擅 长肺栓塞肺动脉高压和慢性气道疾 病的研究
</view>
</view>
<view class="price">
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
//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">
.app {
padding-top: 20rpx;
.price {
width: 94%;
height: 105rpx;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 0 auto;
margin-top: 15rpx;
}
.info {
width: 94%;
height: 651rpx;
margin: 0 auto;
background: #FFFFFF;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
position: relative;
font-size: 36rpx;
.text {
width: 90%;
line-height: 67rpx;
position: absolute;
left: 5%;
top: 263rpx;
text-indent: 1em;
}
.border {
width: 90%;
margin: 0 auto;
height: 1rpx;
background: #D8D4D4;
position: absolute;
left: 5%;
top: 209rpx;
}
.position {
font-size: 35rpx;
color: #969394;
position: absolute;
left: 264rpx;
top: 122rpx;
}
.name {
position: absolute;
left: 264rpx;
top: 68rpx;
}
.image {
width: 147rpx;
height: 150rpx;
background: #BFBFBF;
border-radius: 25rpx;
position: absolute;
left: 74rpx;
top: 32rpx;
}
}
}
</style>

View File

@ -1,95 +0,0 @@
<template>
<view class="app">
<view class="concent">
<view class="background">
<image src="/static/logo.png" mode=""></image>
<view>
<view class="detailed">
<view class="">
国家老年病中心山东分中心是依托于首都医科大学宣武医院的国家老年疾病临床医学研究中心国家科技部国家卫计委中央军委后勤保障部国家食品药品监督管理总局联合批准的国家级临床医学研究中心老年慢性病全国网络化诊治体系及医疗大数据系统医疗与健康一体化的新型服务体系和数据体系山东省建设单位为提升山东省基层医院老年病学科水平建设区域老年疾病预防管理体系利用国家中心在老年疾病临床诊疗的优势在衰老老年常见重大疾病帕金森和老年痴呆等老年神经变性病心脑及外周血管病糖尿病和老年综合征衰弱跌倒便秘等防治领域围绕老年高龄外科围手术期管理老年用药管理老年共病老年重症以及老年常见疾病帕金森病痴呆心脑外周血管病糖尿病等早期预警干预及全程管理的综合评估干预和管理新技术
</view>
<view class="">
主要开展的科室有帕金森两腺科妇科心脑血管等精准治疗
</view>
<view class="">
开展项目有慢病管理血液净化高血脂症妇科筛查老年病筛查康复治疗等
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
//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">
.app {
padding-top: 10rpx;
.concent {
width: 701rpx;
height: 100%;
background: #4C7BC9;
box-shadow: 0px 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx;
margin: 5% auto 20px;
padding: 30rpx 0;
.background {
width: 657rpx;
height: 100%;
background: #FFFFFF;
border-radius: 25rpx;
background-color: white;
margin: 0 auto;
image {
width: 178rpx;
height: 84rpx;
background: #FFFFFF;
border-radius: 25px;
margin-left: 68%;
margin-top: 5%;
}
}
}
}
.detailed {
width: 657rpx;
height: 100%;
padding: 0 42rpx 20rpx;
line-height: 56rpx;
}
.detailed view {
text-indent: 2em;
}
</style>

View File

@ -8,7 +8,7 @@
</view> </view>
</view> </view>
<view class=" item" style="background-color: #E1AE3C ;" @tap='goorder'> <view class=" item" style="background-color: #E1AE3C ;" @tap='goorder'>
<!-- <image src="../../static/dingdan.png" mode=""></image> --> <image src="../../static/dingdan.png" mode=""></image>
<view class="title"> <view class="title">
我的订单 我的订单
</view> </view>

View File

@ -1,9 +1,11 @@
<template> <template>
<view class="app"> <view class="app">
<view class="" v-if='GoodsCategorychildrenlist.length>1'> <u-tabs :list="GoodsCategorychildrenlist" :current="tabIndex" @change="toggleTab"></u-tabs>
<top-tabbar :tabIndex="tabIndex" :tabBars="GoodsCategorychildrenlist" @toggleToptab="toggleTab" <view class="fenlei" @tap='toggleTab(1111111111111)'>
selectedBottomColor="#D43953" selectedTextColor="#D43953" textColor="#000000" bgColor="#ffffff"> <image src="../../static/fenlei.png" mode=""></image>
</top-tabbar> <view class="">
分类
</view>
</view> </view>
<view class="inputs"> <view class="inputs">
<i class="icon"></i> <i class="icon"></i>
@ -41,11 +43,8 @@
getGoodsCategoryNameList getGoodsCategoryNameList
} from '@/api/ProductList/ProductList.js'; } from '@/api/ProductList/ProductList.js';
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
import topTabbar from '../toptabbar/toptabbar.vue'
export default { export default {
components: { components: {},
topTabbar
},
data() { data() {
return { return {
//tabIndex便 //tabIndex便
@ -137,10 +136,11 @@
GoodsCategorychildren(value) { GoodsCategorychildren(value) {
getGoodsCategoryNameList(value).then(res => { getGoodsCategoryNameList(value).then(res => {
this.GoodsCategorychildrenlist = [{ this.GoodsCategorychildrenlist = [{
goodsCategoryName: '全部', name: '全部',
id: 99999999999999999, id: 99999999999999999,
}] }]
res.data.forEach(e => { res.data.forEach(e => {
e.name = e.goodsCategoryName
this.GoodsCategorychildrenlist.push(e) this.GoodsCategorychildrenlist.push(e)
}) })
}) })
@ -216,9 +216,42 @@
</script> </script>
<style lang="scss"> <style lang="scss">
::v-deep .u-tabs {
width: 80%;
}
.app { .app {
padding: 0; padding: 0;
.fenlei {
width: 20%;
display: inline-block;
background-color: #fff;
line-height: 86rpx;
font-weight: normal;
height: 86rpx;
text-align: center;
color: #000000;
position: absolute;
right: 0;
top: 0;
font-size: 32rpx;
view {
position: absolute;
right: 20%;
}
image {
width: 45rpx;
height: 45rpx;
position: absolute;
left: 10%;
top: 50%;
transform: translateY(-50%);
}
}
.noorder { .noorder {
view { view {
text-align: center; text-align: center;

View File

@ -76,6 +76,7 @@
this.stationItemPriceId = options.stationItemPriceId this.stationItemPriceId = options.stationItemPriceId
}, },
onShow() { onShow() {
this.baseurl = baseurl
this.usershow = false this.usershow = false
// //
this.getlist(this.stationId, this.stationItemId, this.stationItemPriceId) this.getlist(this.stationId, this.stationItemId, this.stationItemPriceId)
@ -149,7 +150,7 @@
res.data.nurseItemContent = res.data.nurseItemContent.replace(/\<img/gi, res.data.nurseItemContent = res.data.nurseItemContent.replace(/\<img/gi,
"<br/> <img class='richPic'") "<br/> <img class='richPic'")
} }
if (res.data.poserInfoList) { if (res.data.poserInfoList.length >= 1) {
res.data.poserInfoList.forEach(e => { res.data.poserInfoList.forEach(e => {
e.posterPictureUrl = baseurl + e.posterPictureUrl e.posterPictureUrl = baseurl + e.posterPictureUrl
var obj = { var obj = {
@ -157,8 +158,12 @@
} }
this.lbinfo.push(obj) this.lbinfo.push(obj)
}) })
} else {
var obj = {
image: this.baseurl + res.data.itemPictureUrl
}
this.lbinfo.push(obj)
} }
res.data.itemPictureUrl = baseurl + res.data.itemPictureUrl
this.list = res.data this.list = res.data
}) })
}, },

View File

@ -40,7 +40,7 @@
<view class="contacts">·联系人{{list.patientName}}</view> <view class="contacts">·联系人{{list.patientName}}</view>
<view class="contacts">·电话{{list.patientPhone}}</view> <view class="contacts">·电话{{list.patientPhone}}</view>
<view class="contacts">·地址{{list.serviceAddress}}</view> <view class="contacts">·地址{{list.serviceAddress}}</view>
<view class="contacts">·时间{{list.serviceDate}} {{list.serviceStartTime}}-{{list.serviceEndTime}}</view> <view class="contacts">·时间{{list.serviceDate}} {{list.serviceStartTime}}</view>
</view> </view>
<view class="Package">套餐信息 <view class="Package">套餐信息
<span>{{list.nurseItemPrice}}</span> <span>{{list.nurseItemPrice}}</span>

View File

@ -98,31 +98,63 @@
border-radius: 20rpx; border-radius: 20rpx;
line-height: 93rpx; line-height: 93rpx;
.selecttime { .timeyear{
height: 93rpx; .bottomtext{
margin-left: 3%; width: 96%;
position: relative; margin: 0 auto;
.items{
text { display: flex;
font-size: 34rpx; justify-content:flex-start;
color: #878987; flex-wrap: wrap;
} text-align: center;
.timeitem{
image { width: 21%;
width: 18rpx; margin: 0 2% 20rpx;
height: 27rpx; height: 86rpx;
position: absolute; border-radius: 5rpx;
right: 5%;
top: 50%;
transform: translateY(-50%);
}
.addition {
color: #666666;
line-height: 30rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 86rpx;
border: 2rpx solid #DADADA;
}
.timeitemtap{
width: 21%;
margin: 0 2% 20rpx;
height: 86rpx;
border: 2rpx solid #F44B2F;
border-radius: 5rpx;
font-size: 28rpx;
color: #F44B2F;
line-height: 86rpx;
} }
} }
}
.toptext{
padding-top: 10rpx;
display: flex;
justify-content:space-around;
height: 50rpx;
font-size: 30rpx;
color: #000000;
line-height: 27rpx;
margin-bottom: 30rpx;
text-align: center;
.Soonerorlater{
width: 200rpx;
height: 50rpx;
}
.Soonerorlaterclass{
color: #F44B2F;
width: 200rpx;
height: 50rpx;
}
view:nth-child(2){
width: 4rpx;
height: 27rpx;
background: #C5C3C3;
border-radius: 2rpx;
}
}
}
.item { .item {
width: 97%; width: 97%;

View File

@ -14,24 +14,41 @@
<view class='addition'>{{personInfo.address}}</view> <view class='addition'>{{personInfo.address}}</view>
</view> </view>
<view class="item" style="border: 0;"> <view class="item" style="border: 0;">
<span></span> <span>上门时间</span>
<span class='addition'>请您选择希望护理员到达的时间区间</span> <span class='addition'>请您选择希望护理员到达的时间区间</span>
</view> </view>
<view class="selecttime" @tap='yearshow=true'> <tabs :list="orderlist.appointmentTimeList" :is-scroll="false" :current="timecurrent" @change="timechange">
<span>日期</span> </tabs>
<text v-if="yeartime==''" class='addition'>请选择日期 <view class="timeyear">
<image src="../../static/jiantou.png"></image> <view class="toptext">
</text> <view :class="Soonerorlater=='morning'?'Soonerorlaterclass':'Soonerorlater'"
<text v-else class='addition'>{{yeartime}}</text> @tap="Soonerorlater='morning'">
上午
</view>
<view class="">
</view>
<view :class="Soonerorlater=='after'?'Soonerorlaterclass':'Soonerorlater'"
@tap="Soonerorlater='after'">
下午
</view>
</view>
<view class="bottomtext">
<view class="items" v-if="Soonerorlater=='morning'">
<view @tap='taptime(item,index)'
v-for="(item ,index) in orderlist.appointmentTimeList[timecurrent].morningList"
:class="timeindex==index?'timeitemtap':'timeitem'">
{{item}}
</view>
</view>
<view class="items" v-if="Soonerorlater=='after'">
<view @tap='taptime(item,index)'
v-for="(item ,index) in orderlist.appointmentTimeList[timecurrent].afternoonList"
:class="timeindex==index?'timeitemtap':'timeitem'">
{{item}}
</view>
</view>
</view>
</view> </view>
<view class="selecttime" @tap='timeshow=true'>
<span>时间</span>
<text v-if="usertime==''" class='addition'>请选择时间区间
<image src="../../static/jiantou.png"></image>
</text>
<text v-else class='addition'>{{usertime}}</text>
</view>
</view> </view>
<view class="remarks"> <view class="remarks">
服务时长: 服务时长:
@ -75,9 +92,6 @@
<view class="queren" @tap='updata'>确认预约</view> <view class="queren" @tap='updata'>确认预约</view>
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<u-picker v-model="yearshow" mode="time" start-year='2022' :params="yearparams" @confirm='yeartimeconfirm'>
</u-picker>
<upicker v-model="timeshow" mode="time" :params="timeparams" @confirm='timeconfirm'></upicker>
<!-- // --> <!-- // -->
<u-mask :show="maskshow" class='mask' @click='maskshow=false'> <u-mask :show="maskshow" class='mask' @click='maskshow=false'>
<view class="Agreement"> <view class="Agreement">
@ -105,37 +119,18 @@
appletAppointmentOrderPay appletAppointmentOrderPay
} from '@/api/appointmenttime/appointmenttime.js' } from '@/api/appointmenttime/appointmenttime.js'
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
import upicker from '../picker/picker.vue'
import appointmenttext from './text.vue' import appointmenttext from './text.vue'
import tabs from '../utabs/u-tabs.vue'
export default { export default {
components: { components: {
upicker, appointmenttext,
appointmenttext tabs
}, },
data() { data() {
return { return {
Soonerorlater: 'morning',
timecurrent: 0, //
openid: '', openid: '',
timeparams: { //picker
year: false,
month: false,
day: false,
hour: true,
endhour: true,
minute: true,
endminute: true,
},
timeshow: false, //
usertime: '', //
yearparams: { //picker
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
},
yearshow: false, //
yeartime: '', //
maskshow: false, // maskshow: false, //
radio: 1, // radio: 1, //
personInfo: {}, // personInfo: {}, //
@ -150,7 +145,7 @@
stationItemPriceId: '', stationItemPriceId: '',
serviceAddress: "", serviceAddress: "",
serviceDate: "", serviceDate: "",
serviceStartTime: "", serviceStartTime: null,
serviceEndTime: "", serviceEndTime: "",
nurseItemName: "", nurseItemName: "",
nurseItemPrice: '', nurseItemPrice: '',
@ -161,6 +156,7 @@
orderConsumableList: [], orderConsumableList: [],
orderChannel: '', orderChannel: '',
}, },
timeindex: 0,
} }
}, },
onShow() { onShow() {
@ -191,6 +187,11 @@
that.userinfo(); that.userinfo();
}, },
methods: { methods: {
//
taptime(item, index) {
this.orderlist.serviceStartTime = item
this.timeindex = index
},
userinfo() { userinfo() {
//patientId //patientId
var that = this var that = this
@ -208,9 +209,14 @@
} }
} catch (e) {} } catch (e) {}
}, },
timechange(index) {
this.serviceDate = this.orderlist.appointmentTimeList[index].date
this.timecurrent = index
},
// //
getPatientInfo(stationId, stationItemId, stationItemPriceId) { getPatientInfo(stationId, stationItemId, stationItemPriceId) {
getAppStationItemInfo(stationId, stationItemId, stationItemPriceId).then(res => { getAppStationItemInfo(stationId, stationItemId, stationItemPriceId).then(res => {
console.log(res)
res.data.nurseItemContent = '' res.data.nurseItemContent = ''
if (res.code == 200) { if (res.code == 200) {
if (res.data.itemConsumableList) { if (res.data.itemConsumableList) {
@ -218,7 +224,13 @@
e.radio = true e.radio = true
}) })
} }
res.data.appointmentTimeList.forEach(e => {
e.dates = e.date.slice(5, 10)
e.name = e.week
})
this.orderlist = res.data this.orderlist = res.data
this.orderlist.serviceStartTime = res.data.appointmentTimeList[0].morningList[0]
this.orderlist.serviceDate = res.data.appointmentTimeList[0].date
this.consumableTotalPrice = res.data.consumableTotalPrice this.consumableTotalPrice = res.data.consumableTotalPrice
} }
}) })
@ -243,6 +255,10 @@
} }
}) })
} }
this.orderlist.afternoonOpenEndTime = this.orderlist.afternoonOpenEndTime.slice(0, 5)
this.orderlist.afternoonOpenStartTime = this.orderlist.afternoonOpenStartTime.slice(0, 5)
this.orderlist.morningOpenEndTime = this.orderlist.morningOpenEndTime.slice(0, 5)
this.orderlist.morningOpenStartTime = this.orderlist.morningOpenStartTime.slice(0, 5)
submitAppointment(this.orderlist).then(res => { submitAppointment(this.orderlist).then(res => {
if (res.code == 500) { if (res.code == 500) {
that.$refs.uToast.show({ that.$refs.uToast.show({
@ -376,18 +392,6 @@
}, },
// checkboxcheckbox-group // checkboxcheckbox-group
checkboxGroupChange(e) {}, checkboxGroupChange(e) {},
//
timeconfirm(e) {
this.orderlist.serviceStartTime = e.hour + ":" + e.minute
this.usertime = e.hour + ":" + e.minute + '--' + e.endhour + ":" + e.endminute
this.orderlist.serviceEndTime = e.endhour + ":" + e.endminute
this.orderlist.patientId = this.personInfo.patientId
this.orderlist.serviceAddress = this.personInfo.address
},
yeartimeconfirm(e) {
this.orderlist.serviceDate = e.year + '-' + e.month + '-' + e.day
this.yeartime = e.year + '年' + e.month + '月' + e.day + "日"
},
goaddress() { goaddress() {
uni.navigateTo({ uni.navigateTo({
url: `/pages/modifyAddress/modifyAddress?updata=${JSON.stringify(this.orderlist)}` url: `/pages/modifyAddress/modifyAddress?updata=${JSON.stringify(this.orderlist)}`

View File

@ -58,7 +58,7 @@
.background { .background {
position: relative; position: relative;
width: 657rpx; width: 657rpx;
height: 800rpx; height: 850rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 25rpx; border-radius: 25rpx;
background-color: white; background-color: white;
@ -68,11 +68,11 @@
image { image {
width: 178rpx; width: 178rpx;
height: 84rpx; height: 160rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 25px; border-radius: 25px;
margin-left: 68%; margin-left: 68%;
margin-top: 5%; margin-top: 0;
} }
} }
} }

View File

@ -1,12 +1,6 @@
<template> <template>
<view class="app"> <view class="app">
<swiper class="swiper-block" :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" <u-swiper :list="swiperImgUrls" effect3d='true' height='400' interval='5000' duration='2000'></u-swiper>
circular='true' previous-margin='70rpx' next-margin='70rpx' current='0' @change="swiperChange">
<swiper-item class="swiper-item" v-for="(item,index) in swiperImgUrls">
<image :src="item" :class="['slide-image', currentIndex === index?'active':'']">
</image>
</swiper-item>
</swiper>
<view class="items"> <view class="items">
<view class="item" @tap="gosite"> <view class="item" @tap="gosite">
<image src="../../static/hlz.png" mode=""></image> <image src="../../static/hlz.png" mode=""></image>
@ -14,7 +8,7 @@
护理站 护理站
</view> </view>
</view> </view>
<view class="item"> <view class="item" @tap="gomedicine">
<image src="../../static/jkzx.png" mode=""></image> <image src="../../static/jkzx.png" mode=""></image>
<view class="title"> <view class="title">
健康咨询 健康咨询
@ -68,20 +62,25 @@
informationCategoryVOList: [], // informationCategoryVOList: [], //
}; };
}, },
onLoad() { onShow() {
this.informationCategoryinfo() this.informationCategoryinfo()
}, },
methods: { methods: {
informationCategoryinfo() { informationCategoryinfo() {
informationCategoryList().then(res => { informationCategoryList().then(res => {
res.data.informationCategoryVOList.forEach(e => { if (res.code == 200) {
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl res.data.informationCategoryVOList.forEach(e => {
}) e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
this.informationCategoryVOList = res.data.informationCategoryVOList })
res.data.poserInfoList.forEach(e => { this.informationCategoryVOList = res.data.informationCategoryVOList
e.posterPictureUrl = baseurl + e.posterPictureUrl res.data.poserInfoList.forEach(e => {
this.swiperImgUrls.push(e.posterPictureUrl) e.posterPictureUrl = baseurl + e.posterPictureUrl
}) var obj = {
image: e.posterPictureUrl
}
this.swiperImgUrls.push(obj)
})
}
}) })
}, },
swiperChange(event) { swiperChange(event) {
@ -93,6 +92,12 @@
url: '/pages/diseasemanagement/diseasemanagement' url: '/pages/diseasemanagement/diseasemanagement'
}) })
}, },
//
gomedicine() {
uni.navigateTo({
url: '/pages/medicine/medicine'
})
},
// //
gosite() { gosite() {
uni.navigateTo({ uni.navigateTo({
@ -123,7 +128,7 @@
<style lang="scss"> <style lang="scss">
.app { .app {
padding: 0; padding: 100rpx 0 0 0;
.Healthknowledge { .Healthknowledge {
width: 100%; width: 100%;
@ -227,36 +232,6 @@
} }
} }
.swiper-block {
padding-top: 120rpx;
background-color: #fff;
height: 400rpx;
width: 100%;
margin: 0 auto;
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
overflow: unset;
}
.slide-image {
height: 340rpx;
width: 96%;
margin: 0 auto;
border-radius: 30rpx;
z-index: 1;
}
.active {
transform: scale(1.14);
transition: all 0.2s ease-in 0s;
z-index: 20;
}
.items { .items {
background-color: #fff; background-color: #fff;
padding: 30rpx 80rpx 20px; padding: 30rpx 80rpx 20px;

View File

@ -84,11 +84,10 @@
image { image {
width: 178rpx; width: 178rpx;
height: 84rpx; height: 160rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 25px; border-radius: 25px;
margin-left: 68%; margin-left: 68%;
margin-top: 5%;
} }
} }
} }

View File

@ -40,7 +40,7 @@
<view class="contacts">·联系人{{list.patientName}}</view> <view class="contacts">·联系人{{list.patientName}}</view>
<view class="contacts">·电话:{{list.patientPhone}}</view> <view class="contacts">·电话:{{list.patientPhone}}</view>
<view class="contacts">·地址{{list.serviceAddress}}</view> <view class="contacts">·地址{{list.serviceAddress}}</view>
<view class="contacts">·时间{{list.serviceDate}} {{list.serviceStartTime}}-{{list.serviceEndTime}}</view> <view class="contacts">·时间{{list.serviceDate}} {{list.serviceStartTime}}</view>
</view> </view>
<view class="Package">套餐信息 <view class="Package">套餐信息
<span>{{list.nurseItemPrice}}</span> <span>{{list.nurseItemPrice}}</span>

View File

@ -229,7 +229,7 @@
background-color: #ffffff; background-color: #ffffff;
border-radius: 20rpx; border-radius: 20rpx;
margin: 10px auto; margin: 10px auto;
padding-bottom: 20rpx; padding-bottom: 30rpx;
.time{ .time{
font-size: 27rpx; font-size: 27rpx;
margin: 10rpx 0; margin: 10rpx 0;
@ -257,55 +257,10 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.call {
// display: flex;
.Navigation {
width: 103rpx;
height: 48rpx;
background: #00C176;
border-radius: 24px;
font-size: 21rpx;
color: #ffffff;
line-height: 48rpx;
margin-left: 5%;
text-align: center;
margin-top: 3%;
image {
width: 24rpx;
height: 24rpx;
}
}
.callme {
width: 150rpx;
height: 48rpx;
background: #D43953;
border-radius: 24px;
font-size: 21rpx;
color: #ffffff;
line-height: 48rpx;
margin-left: 35%;
margin-top: 3%;
text-align: center;
position: relative;
.icon{
position: absolute;
left:10%;
top:50%;
transform: translateY(-50%);
}
.text{
position: absolute;
top:50%;
right:10%;
transform: translateY(-50%);
}
}
}
.address { .address {
font-size: 27rpx; font-size: 27rpx;
color: #666666; color: #666666;
margin:40rpx 0 10rpx 30rpx; margin:40rpx 0 20rpx 30rpx;
word-break:break-all; word-break:break-all;
line-height: 40rpx; line-height: 40rpx;
// overflow: hidden; // overflow: hidden;

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="app"> <view class="app">
<u-swiper v-if="lbinfo" :list="lbinfo" height="400" style='background-size: 100%;' mode='none'></u-swiper> <u-swiper v-if="lbinfo" :list="lbinfo" height="450" style='background-size: 100%;' mode='none'></u-swiper>
<view class="content"> <view class="content">
<view class="righttext"> <view class="righttext">
<view class="title" v-if="list.nurseStationName"> <view class="title" v-if="list.nurseStationName">
@ -130,6 +130,7 @@
export default { export default {
data() { data() {
return { return {
baseurl:'',
lbinfo: [], //list lbinfo: [], //list
usershow: false, // usershow: false, //
choicetab: false, // choicetab: false, //
@ -155,6 +156,7 @@
} }
}, },
onShow() { onShow() {
this.baseurl = baseurl
this.usershow = false this.usershow = false
this.getInfo() this.getInfo()
}, },
@ -235,6 +237,7 @@
res.data.afternoonOpenStartTime = res.data.afternoonOpenStartTime.slice(0, 5) res.data.afternoonOpenStartTime = res.data.afternoonOpenStartTime.slice(0, 5)
res.data.afternoonOpenEndTime = res.data.afternoonOpenEndTime.slice(0, 5) res.data.afternoonOpenEndTime = res.data.afternoonOpenEndTime.slice(0, 5)
res.data.stationIntroducePcitureUrl = baseurl + res.data.stationIntroducePcitureUrl res.data.stationIntroducePcitureUrl = baseurl + res.data.stationIntroducePcitureUrl
res.data.stationPictureUrl = baseurl + res.data.stationPictureUrl
if (res.data.agencyIntroduce) { if (res.data.agencyIntroduce) {
res.data.agencyIntroduce = res.data.agencyIntroduce.replace(/\<img/gi, res.data.agencyIntroduce = res.data.agencyIntroduce.replace(/\<img/gi,
"<br/><img class='richPic'") "<br/><img class='richPic'")
@ -248,13 +251,25 @@
} }
this.tabList.push(obj) this.tabList.push(obj)
this.list = res.data this.list = res.data
res.data.poserInfoList.forEach(e => { if (res.data.poserInfoList.length >= 1) {
e.posterPictureUrl = baseurl + e.posterPictureUrl res.data.poserInfoList.forEach(e => {
e.posterPictureUrl = baseurl + e.posterPictureUrl
var obj = {
image: e.posterPictureUrl
}
this.lbinfo.push(obj)
})
} else {
var obj = { var obj = {
image: e.posterPictureUrl image: res.data.stationPictureUrl
} }
this.lbinfo.push(obj) this.lbinfo.push(obj)
}) var obj2 = {
image: res.data.stationIntroducePcitureUrl
}
this.lbinfo.push(obj2)
}
if (res.data.nurseStationLabelList) { if (res.data.nurseStationLabelList) {
this.nurseStationLabelList = res.data.nurseStationLabelList this.nurseStationLabelList = res.data.nurseStationLabelList
} }

View File

@ -1,562 +0,0 @@
<template>
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
<view class="u-datetime-picker">
<view class="u-picker-header" @touchmove.stop.prevent="">
<view class="u-btn-picker u-btn-picker--tips" :style="{ color: cancelColor }" hover-class="u-opacity"
:hover-stay-time="150" @tap="getResult('cancel')">{{cancelText}}</view>
<view class="u-picker__title">{{ title }}</view>
<view class="u-btn-picker u-btn-picker--primary" :style="{ color: moving ? cancelColor : confirmColor }"
hover-class="u-opacity" :hover-stay-time="150" @touchmove.stop="" @tap.stop="getResult('confirm')">
{{confirmText}}
</view>
</view>
<view class="u-picker-body">
<picker-view :value="valueArr" @change="change" class="u-picker-view" @pickstart="pickstart"
@pickend="pickend">
<picker-view-column v-if="!reset && params.year" style="flex:6">
<view class="u-column-item" v-for="(item, index) in years" :key="index">
{{ item }}
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.month" style="flex:5">
<view class="u-column-item" v-for="(item, index) in months" :key="index">
{{ formatNumber(item) }}
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.day" style="flex:5">
<view class="u-column-item" v-for="(item, index) in days" :key="index">
{{ formatNumber(item) }}
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.hour" style="flex:6">
<view class="u-column-item" v-for="(item, index) in hours" :key="index">
<view class="" style="font-size:38rpx">
{{ formatNumber(item) }}
</view>
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.minute" style="flex:6">
<view class="u-column-item" v-for="(item, index) in minutes" :key="index">
<view class="" style="font-size:38rpx">
{{ formatNumber(item) }}
</view>
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column style="flex:2">
<view class="u-column-item">
<text class="u-text"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.endhour" style="flex:6">
<view class="u-column-item" v-for="(item, index) in endhours" :key="index">
<view class="" style="font-size:38rpx">
{{ formatNumber(item) }}
</view>
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
<picker-view-column v-if="!reset && params.endminute" style="flex:6">
<view class="u-column-item" v-for="(item, index) in endminutes" :key="index">
<view class="" style="font-size:38rpx">
{{ formatNumber(item) }}
</view>
<text class="u-text" v-if="showTimeTag"></text>
</view>
</picker-view-column>
</picker-view>
</view>
</view>
</u-popup>
</template>
<script>
/**
* picker picker弹出选择器
* @description 此选择器有两种弹出模式一是时间模式可以配置年秒参数 二是地区模式可以配置省区参数
* @tutorial https://www.uviewui.com/components/picker.html
* @property {Object} params 需要显示的参数见官网说明
* @property {String} mode 模式选择region-地区类型time-时间类型默认time
* @property {String Number} start-year 可选的开始年份mode=time时有效默认1950
* @property {String Number} end-year 可选的结束年份mode=time时有效默认2050
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配默认false
* @property {Boolean} show-time-tag 时间模式时是否显示后面的年月日中文提示
* @property {String} cancel-color 取消按钮的颜色默认#606266
* @property {String} confirm-color 确认按钮的颜色默认#2979ff
* @property {String} default-time 默认选中的时间mode=time时有效
* @property {String} confirm-text 确认按钮的文字
* @property {String} cancel-text 取消按钮的文字
* @property {String} default-region 默认选中的地区中文形式mode=region时有效
* @property {String} default-code 默认选中的地区编号形式mode=region时有效
* @property {Boolean} mask-close-able 是否允许通过点击遮罩关闭Picker默认true
* @property {String Number} z-index 弹出时的z-index值默认1075
* @property {Array} default-selector 数组形式其中每一项表示选择了range对应项中的第几个
* @property {Array} range 自定义选择的数据mode=selector或mode=multiSelector时有效
* @property {String} range-key 当range参数的元素为对象时指定Object中的哪个key的值作为选择器显示内容
* @event {Function} confirm 点击确定按钮返回当前选择的值
* @event {Function} cancel 点击取消按钮返回当前选择的值
* @example <u-picker v-model="show" mode="time"></u-picker>
*/
export default {
name: 'u-picker',
props: {
// picker
params: {
type: Object,
default () {
return {
year: false,
month: true,
day: true,
hour: true,
endhour: true,
minute: true,
endminute: true,
second: false,
};
}
},
// mode=selectormode=multiSelector
range: {
type: Array,
default () {
return [];
}
},
// mode=selectormode=multiSelector
defaultSelector: {
type: Array,
default () {
return [0];
}
},
// range ArrayObject range-key Object key
rangeKey: {
type: String,
default: ''
},
// region-time-selector-multiSelector-
mode: {
type: String,
default: 'time'
},
//
startYear: {
type: [String, Number],
default: 1950
},
//
endYear: {
type: [String, Number],
default: 2050
},
// ""
cancelColor: {
type: String,
default: '#606266'
},
// ""
confirmColor: {
type: String,
default: '#2979ff'
},
// 2025-07-02 || 2025-07-02 13:01:00 || 2025/07/02
defaultTime: {
type: String,
default: ''
},
//
showTimeTag: {
type: Boolean,
default: true
},
safeAreaInsetBottom: {
type: Boolean,
default: false
},
// Picker
maskCloseAble: {
type: Boolean,
default: true
},
//
value: {
type: Boolean,
default: false
},
// z-index
zIndex: {
type: [String, Number],
default: 0
},
//
title: {
type: String,
default: '预约时间区间'
},
//
cancelText: {
type: String,
default: '取消'
},
//
confirmText: {
type: String,
default: '确认'
}
},
data() {
return {
years: [],
months: [],
days: [],
hours: [],
endhours: [],
minutes: [],
endminutes: [],
seconds: [],
year: 0,
month: 0,
day: 0,
hour: 0,
endhour: 0,
minute: 0,
endminute: 0,
second: 0,
reset: false,
startDate: '',
endDate: '',
valueArr: [],
moving: false //
};
},
mounted() {
this.init();
},
computed: {
propsChange() {
//
return `${this.mode}-${this.defaultTime}-${this.startYear}-${this.endYear}-${this.defaultRegion}-${this.areaCode}`;
},
regionChange() {
//
return `${this.province}-${this.city}`;
},
yearAndMonth() {
return `${this.year}-${this.month}`;
},
uZIndex() {
// z-index使
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
}
},
watch: {
propsChange() {
this.reset = true;
setTimeout(() => this.init(), 10);
},
// pickerthis.citysthis.areas
regionChange(val) {
this.citys = citys[this.province];
this.areas = areas[this.province][this.city];
},
// watch
// 3031229228
yearAndMonth(val) {
if (this.params.year) this.setDays();
},
// QQ()
value(n) {
if (n) {
this.reset = true;
setTimeout(() => this.init(), 10);
}
}
},
methods: {
//
pickstart() {
// #ifdef MP-WEIXIN
this.moving = true;
// #endif
},
//
pickend() {
// #ifdef MP-WEIXIN
this.moving = false;
// #endif
},
//
getItemValue(item, mode) {
// (2020-05-25)uni-appv-iffalse
// getItemValue
if (this.mode == mode) {
return typeof item == 'object' ? item[this.rangeKey] : item;
}
},
// 100
formatNumber(num) {
return +num < 10 ? '0' + num : String(num);
},
//
generateArray: function(start, end) {
// end-yearend+1
start = Number(start);
end = Number(end);
end = end > start ? end : start;
//
return [...Array(end + 1).keys()].slice(start);
},
getIndex: function(arr, val) {
let index = arr.indexOf(val);
// index-1(index)~(-1)=-(-1)-1=0
return ~index ? index : 0;
},
//
initTimeValue() {
// IE(uni)"-"
let fdate = this.defaultTime.replace(/\-/g, '/');
fdate = fdate && fdate.indexOf('/') == -1 ? `2020/01/01 ${fdate}` : fdate;
let time = null;
if (fdate) time = new Date(fdate);
else time = new Date();
//
this.year = time.getFullYear();
this.month = Number(time.getMonth()) + 1;
this.day = time.getDate();
this.hour = time.getHours();
this.minute = time.getMinutes();
this.endhour = time.getHours();
this.endminute = time.getMinutes();
// this.second = time.getSeconds();
},
init() {
this.valueArr = [];
this.reset = false;
if (this.mode == 'time') {
this.initTimeValue();
if (this.params.year) {
this.valueArr.push(0);
this.setYears();
}
if (this.params.month) {
this.valueArr.push(0);
this.setMonths();
}
if (this.params.day) {
this.valueArr.push(0);
this.setDays();
}
if (this.params.hour) {
this.valueArr.push(0);
this.setHours();
}
if (this.params.minute) {
this.valueArr.push(0);
this.setMinutes();
}
if (this.params.endhour) {
this.valueArr.push(0);
this.setendHours();
}
if (this.params.endminute) {
this.valueArr.push(0);
this.setendMinutes();
}
// if (this.params.second) {
// this.valueArr.push(0);
// this.setSeconds();
// }
}
this.$forceUpdate();
},
// picker
setYears() {
//
this.years = this.generateArray(this.startYear, this.endYear);
// this.valueArrpicker
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.years, this.year));
},
setMonths() {
this.months = this.generateArray(1, 12);
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.months, this.month));
},
setDays() {
let totalDays = new Date(this.year, this.month, 0).getDate();
this.days = this.generateArray(1, totalDays);
let index = 0;
// 使setMonths()this.valueArr.splice(this.valueArr.length - 1, xxx)
// this.monththis.yearwatchthis.setDays()this.valueArr.length
if (this.params.year && this.params.month) index = 2;
else if (this.params.month) index = 1;
else if (this.params.year) index = 1;
else index = 0;
//
// 331229day3129(picker-column1)
if (this.day > this.days.length) this.day = this.days.length;
this.valueArr.splice(index, 1, this.getIndex(this.days, this.day));
},
setHours() {
this.hours = this.generateArray(0, 23);
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.hours, this.hour));
},
setMinutes() {
this.minutes = this.generateArray(0, 59);
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.minutes, this.minute));
},
setendHours() {
this.endhours = this.generateArray(0, 23);
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.endhours, this.endhour));
},
setendMinutes() {
this.endminutes = this.generateArray(0, 59);
this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.endminutes, this.endminute));
},
// setSeconds() {
// this.seconds = this.generateArray(0, 59);
// this.valueArr.splice(this.valueArr.length - 1, 1, this.getIndex(this.seconds, this.second));
// },
close() {
this.$emit('input', false);
},
// picker
change(e) {
this.valueArr = e.detail.value;
let i = 0;
if (this.mode == 'time') {
// 使i++this.valueArrthis.params
// ifi1
if (this.params.year) this.year = this.years[this.valueArr[i++]];
if (this.params.month) this.month = this.months[this.valueArr[i++]];
if (this.params.day) this.day = this.days[this.valueArr[i++]];
if (this.params.hour) this.hour = this.hours[this.valueArr[i++]];
if (this.params.minute) this.minute = this.minutes[this.valueArr[i++]];
if (this.params.endhour) this.endhour = this.hours[this.valueArr[3]]
if (this.params.endminute) this.endminute = this.endminutes[this.valueArr[4]];
// if (this.params.second) this.second = this.seconds[this.valueArr[i++]];
}
},
//
getResult(event = null) {
// #ifdef MP-WEIXIN
if (this.moving) return;
// #endif
let result = {};
// this.paramstrue
if (this.mode == 'time') {
if (this.params.year) result.year = this.formatNumber(this.year || 0);
if (this.params.month) result.month = this.formatNumber(this.month || 0);
if (this.params.day) result.day = this.formatNumber(this.day || 0);
if (this.params.hour) result.hour = this.formatNumber(this.hour || 0);
if (this.params.minute) result.minute = this.formatNumber(this.minute || 0);
if (this.params.endhour) result.endhour = this.formatNumber(this.endhour || 0);
if (this.params.endminute) result.endminute = this.formatNumber(this.endminute || 0);
// if (this.params.second) result.second = this.formatNumber(this.second || 0);
// if (this.params.timestamp) result.timestamp = this.getTimestamp();
}
if (event) this.$emit(event, result);
this.close();
},
//
getTimestamp() {
// yyyy-mm-ddiOS使"/"
let time = this.year + '/' + this.month + '/' + this.day + ' ' + this.hour + ':' + this.minute + ':' + this
.second;
return new Date(time).getTime() / 1000;
}
}
};
</script>
<style lang="scss" scoped>
// nvueflexnvuedisplay
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.u-datetime-picker {
position: relative;
z-index: 999;
}
.u-picker-view {
height: 100%;
box-sizing: border-box;
}
.u-picker-header {
width: 100%;
height: 90rpx;
padding: 0 40rpx;
@include vue-flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
font-size: 30rpx;
background: #fff;
position: relative;
}
.u-picker-header::after {
content: '';
position: absolute;
border-bottom: 1rpx solid #eaeef1;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
bottom: 0;
right: 0;
left: 0;
}
.u-picker__title {
color: $u-content-color;
}
.u-picker-body {
width: 100%;
height: 500rpx;
overflow: hidden;
background-color: #fff;
}
.u-column-item {
@include vue-flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: $u-main-color;
padding: 0 8rpx;
}
.u-text {
font-size: 24rpx;
padding-left: 8rpx;
}
.u-btn-picker {
padding: 16rpx;
box-sizing: border-box;
text-align: center;
text-decoration: none;
}
.u-opacity {
opacity: 0.5;
}
.u-btn-picker--primary {
color: $u-type-primary;
}
.u-btn-picker--tips {
color: $u-tips-color;
}
</style>

View File

@ -7,24 +7,6 @@
background-color: #F4F5F7 !important; background-color: #F4F5F7 !important;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.swiper-block {
height: 200rpx;
width: 94%;
padding: 30rpx 3% 10rpx;
background-color: #F4F5F7;
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
}
.slide-image {
height: 200rpx;
width: 100%;
margin: 0 auto;
border-radius: 20rpx;
}
.Classificationlist{ .Classificationlist{
margin: 30rpx 0 0; margin: 30rpx 0 0;
width: 100%; width: 100%;

View File

@ -19,13 +19,7 @@
</view> </view>
</view> </view>
</view> </view>
<swiper class="swiper-block" :indicator-dots="true" :autoplay="true" :interval="5000" :duration="3000" <u-swiper :list="lbinfo" height='200' interval='3000' duration='1500'></u-swiper>
circular='true' current='0'>
<swiper-item class="swiper-item" v-for="(item,index) in lbinfo">
<image :src="item.image" class="slide-image">
</image>
</swiper-item>
</swiper>
<view class="conNew"> <view class="conNew">
<view class="title"> <view class="title">
周边医养机构 周边医养机构

View File

@ -52,7 +52,7 @@
image { image {
width: 50%; width: 50%;
height: 200rpx; height: 400rpx;
position: absolute; position: absolute;
left: 25%; left: 25%;
top: 28%; top: 28%;

View File

@ -1,168 +0,0 @@
<template>
<view style="position: relative;">
<!--顶部导航栏-->
<view class="uni-top-tabbar">
<scroll-view scroll-x="true" class="uni-swiper-tab" :style="{backgroundColor:bgColor}">
<view v-for="(tabBar,index) in tabBars" :key="index" class="swiper-tab-list"
:class="{'active': tabIndex==index}" :style="{color:tabIndex==index?selectedTextColor:textColor}"
@tap="toggleTab(index)">
<view class="title">
{{tabBar.goodsCategoryName}}
</view>
<view class="swiper-tab-line"
:style="{backgroundColor:tabIndex==index?selectedBottomColor:bgColor}"></view>
</view>
</scroll-view>
<view class="fenlei" @tap='toggleTab(1111111111111)'>
<image src="../../static/fenlei.png" mode=""></image>
<view class="">
分类
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "topTabbar",
props: {
//
tabIndex: {
type: Number,
default: 0
},
//
tabBars: {
type: Array,
default: [{
goodsCategoryName: '标签1',
id: 1
},
{
goodsCategoryName: '标签2',
id: 2
},
{
goodsCategoryName: '标签3',
id: 3
},
{
goodsCategoryName: '标签4',
id: 4
},
{
goodsCategoryName: '标签5',
id: 5
},
{
goodsCategoryName: '标签6',
id: 6
}
]
},
//
selectedBottomColor: {
type: String,
default: '#D43953'
},
//
bgColor: {
type: String,
default: '#ffffff'
},
//
selectedTextColor: {
type: String,
default: '#D43953'
},
//
textColor: {
type: String,
default: '#000000'
}
},
data() {
return {}
},
methods: {
//
toggleTab(index) {
this.$emit("toggleToptab", index)
}
}
}
</script>
<style lang="scss">
.fenlei {
width: 25%;
display: inline-block;
background-color: #fff;
line-height: 70rpx;
font-weight: normal;
height: 75rpx;
text-align: center;
color: #000000;
position: absolute;
right: 0;
top: 0;
font-size: 32rpx;
view {
position: absolute;
right: 25%;
}
image {
width: 45rpx;
height: 45rpx;
position: absolute;
left: 18%;
top: 50%;
transform: translateY(-55%);
}
}
.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
}
.uni-top-tabbar {
/* 以下3项设置用于开启底部阴影显示 */
/* position: relative;
z-index: 1;
overflow: visible; */
width: 75%;
.uni-swiper-tab {
height: 75rpx;
//
//box-shadow: rgba(170, 170, 170, 0.5) 0 2rpx 8rpx 0;
white-space: nowrap;
.swiper-tab-list {
font-size: 32rpx;
font-weight: normal;
line-height: 70rpx;
padding: 0 15rpx;
//
text-align: center;
display: inline-block;
}
.active {
.swiper-tab-line {
height: 4rpx;
width: 100%;
margin: auto;
}
}
}
}
</style>

384
pages/utabs/u-tabs.vue Normal file
View File

@ -0,0 +1,384 @@
<template>
<view class="u-tabs" :style="{
background: bgColor
}">
<!-- $u.getRect()对组件根节点无效因为写了.in(this)故这里获取内层接点尺寸 -->
<view :id="id">
<scroll-view scroll-x class="u-scroll-view" :scroll-left="scrollLeft" scroll-with-animation>
<view class="u-scroll-box" :class="{'u-tabs-scorll-flex': !isScroll}">
<view class="u-tab-item u-line-1" :id="'u-tab-item-' + index" v-for="(item, index) in list"
:key="index" @tap="clickTab(index)" :style="[tabItemStyle(index)]">
<view class="">
{{item.dates}}
</view>
<u-badge :count="item[count] || item['count'] || 0" :offset="offset" size="mini"></u-badge>
{{ item[name] || item['name']}}
</view>
<view v-if="showBar" class="u-tab-bar" :style="[tabBarStyle]"></view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
/**
* tabs 标签
* @description 该组件是一个tabs标签组件在标签多的时候可以配置为左右滑动标签少的时候可以禁止滑动 该组件的一个特点是配置为滚动模式时激活的tab会自动移动到组件的中间位置
* @tutorial https://www.uviewui.com/components/tabs.html
* @property {Boolean} is-scroll tabs是否可以左右拖动默认true
* @property {Array} list 标签数组元素为对象[{name: '推荐'}]
* @property {String Number} current 指定哪个tab为激活状态默认0
* @property {String Number} height 导航栏的高度单位rpx默认80
* @property {String Number} font-size tab文字大小单位rpx默认30
* @property {String Number} duration 滑块移动一次所需的时间单位秒默认0.5
* @property {String} active-color 滑块和激活tab文字的颜色默认#2979ff
* @property {String} inactive-color tabs文字颜色默认#303133
* @property {String Number} bar-width 滑块宽度单位rpx默认40
* @property {Object} active-item-style 活动tabs item的样式对象形式
* @property {Object} bar-style 底部滑块的样式对象形式
* @property {Boolean} show-bar 是否显示底部的滑块默认true
* @property {String Number} bar-height 滑块高度单位rpx默认6
* @property {String Number} item-width 标签的宽度默认auto
* @property {String Number} gutter 单个tab标签的左右内边距之和单位rpx默认40
* @property {String} bg-color tabs导航栏的背景颜色默认#ffffff
* @property {String} name 组件内部读取的list参数中的属性名tab名称见官网说明默认name
* @property {String} count 组件内部读取的list参数中的属性名badge徽标数同name属性的使用见官网说明默认count
* @property {Array} offset 设置badge徽标数的位置偏移格式为 [x, y]也即设置的为top和right的值单位rpx默认[5, 20]
* @property {Boolean} bold 激活选项的字体是否加粗默认true
* @event {Function} change 点击标签时触发
* @example <u-tabs ref="tabs" :list="list" :is-scroll="false"></u-tabs>
*/
export default {
name: "u-tabs",
props: {
// 23使flextab
isScroll: {
type: Boolean,
default: true
},
//
list: {
type: Array,
default () {
return [];
}
},
// tab
current: {
type: [Number, String],
default: 0
},
//
height: {
type: [String, Number],
default: 80
},
//
fontSize: {
type: [String, Number],
default: 24
},
// , ms
duration: {
type: [String, Number],
default: 0.5
},
//
activeColor: {
type: String,
default: '#F44B2F;'
},
//
inactiveColor: {
type: String,
default: '#303133'
},
// barrpx
barWidth: {
type: [String, Number],
default: 40
},
// bar
barHeight: {
type: [String, Number],
default: 6
},
// tab
gutter: {
type: [String, Number],
default: 30
},
//
bgColor: {
type: String,
default: '#ffffff'
},
// (tab)
name: {
type: String,
default: 'name'
},
// ()
count: {
type: String,
default: 'count'
},
//
offset: {
type: Array,
default: () => {
return [5, 20]
}
},
// tab
bold: {
type: Boolean,
default: true
},
// tab item
activeItemStyle: {
type: Object,
default () {
return {}
}
},
//
showBar: {
type: Boolean,
default: true
},
//
barStyle: {
type: Object,
default () {
return {}
}
},
//
itemWidth: {
type: [Number, String],
default: 'auto'
}
},
data() {
return {
scrollLeft: 0, // scroll-view
tabQueryInfo: [], // tab
componentWidth: 0, // px
scrollBarLeft: 0, // bartranslateX()
parentLeft: 0, // (tabs)
id: this.$u.guid(), // id
currentIndex: this.current,
barFirstTimeMove: true, // ()
};
},
watch: {
// tabtab使
// applist
list(n, o) {
// list
if (n.length !== o.length) this.currentIndex = 0;
// $nextTicktabtab
this.$nextTick(() => {
this.init();
});
},
current: {
immediate: true,
handler(nVal, oVal) {
//
this.$nextTick(() => {
this.currentIndex = nVal;
this.scrollByIndex();
});
}
},
},
computed: {
// bar
tabBarStyle() {
let style = {
width: this.barWidth + 'rpx',
transform: `translate(${this.scrollBarLeft}px, -100%)`,
//
'transition-duration': `${this.barFirstTimeMove ? 0 : this.duration }s`,
'background-color': this.activeColor,
height: this.barHeight + 'rpx',
opacity: this.barFirstTimeMove ? 0 : 1,
//
'border-radius': `${this.barHeight / 2}px`
};
Object.assign(style, this.barStyle);
return style;
},
// tab
tabItemStyle() {
return (index) => {
let style = {
height: this.height + 'rpx',
'line-height': '28rpx',
'font-size': this.fontSize + 'rpx',
'transition-duration': `${this.duration}s`,
padding: this.isScroll ? `0 ${this.gutter}rpx` : '',
flex: this.isScroll ? 'auto' : '1',
width: this.$u.addUnit(this.itemWidth)
};
//
if (index == this.currentIndex && this.bold) style.fontWeight = 'bold';
if (index == this.currentIndex) {
style.color = this.activeColor;
// tab item
style = Object.assign(style, this.activeItemStyle);
} else {
style.color = this.inactiveColor;
}
return style;
}
}
},
methods: {
// init便
async init() {
// tabs
let tabRect = await this.$uGetRect('#' + this.id);
// tabs
this.parentLeft = tabRect.left;
// tabs
this.componentWidth = tabRect.width;
this.getTabRect();
},
// tab
clickTab(index) {
// tab
if (index == this.currentIndex) return;
//
this.$emit('change', index);
},
// tab
getTabRect() {
//
let query = uni.createSelectorQuery().in(this);
// tab使exec()
for (let i = 0; i < this.list.length; i++) {
// sizerect
query.select(`#u-tab-item-${i}`).fields({
size: true,
rect: true
});
}
//
query.exec(
function(res) {
this.tabQueryInfo = res;
// bar
this.scrollByIndex();
}.bind(this)
);
},
// scroll-viewtab
scrollByIndex() {
// tabtabwidthleft()
let tabInfo = this.tabQueryInfo[this.currentIndex];
if (!tabInfo) return;
// tab
let tabWidth = tabInfo.width;
// itemtabsitemlefttabsleft
let offsetLeft = tabInfo.left - this.parentLeft;
// tabs-itemscroll-view
let scrollLeft = offsetLeft - (this.componentWidth - tabWidth) / 2;
this.scrollLeft = scrollLeft < 0 ? 0 : scrollLeft;
// item
let left = tabInfo.left + tabInfo.width / 2 - this.parentLeft;
// item
this.scrollBarLeft = left - uni.upx2px(this.barWidth) / 2;
// barFirstTimeMovetruefalse
// scrollBarLeftcomputed
if (this.barFirstTimeMove == true) {
setTimeout(() => {
this.barFirstTimeMove = false;
}, 100)
}
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss" scoped>
// nvueflexnvuedisplay
@mixin vue-flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: $direction;
/* #endif */
}
.u-tabs {
padding: 20rpx 0;
}
view,
scroll-view {
box-sizing: border-box;
}
/* #ifndef APP-NVUE */
::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.u-scroll-box {
position: relative;
/* #ifdef MP-TOUTIAO */
white-space: nowrap;
/* #endif */
}
/* #ifdef H5 */
// 穿H5scroll-view
scroll-view ::v-deep ::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
}
/* #endif */
.u-scroll-view {
width: 100%;
white-space: nowrap;
position: relative;
}
.u-tab-item {
position: relative;
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
text-align: center;
transition-property: background-color, color;
}
.u-tab-bar {
position: absolute;
bottom: 0;
}
.u-tabs-scorll-flex {
@include vue-flex;
justify-content: space-between;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/dingdan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB