master
lion 2 years ago
parent 43286ef3f8
commit fd2cbcc11a

@ -161,12 +161,13 @@
</script>
<style lang="scss">
page {
background: #fff;
}
</style>
<style lang="scss" scoped>
<style lang="scss" scoped>
page {
background: #fff;
}
.container {
// padding: 34rpx 44rpx;
// margin: 34rpx 25rpx 95rpx;

@ -1,280 +1,280 @@
<template>
<view class="page">
<scroll-view
scroll-y
style="height: 100%; width: 100%"
@scrolltolower="reachBottom"
>
<view>
<view class="order" v-for="i in list" :key="i.id">
<view class="title">
<view class="title__name">
<u-tag size="mini" type="primary" mode="dark" shape="circleLeft" :text="i.type === 1 ? '陪诊' : '陪护'"></u-tag>
<text style="padding-left: 10rpx;">专享半天陪诊</text>
</view>
<view class="title__status">{{ statusFormat(i.pay_status) }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon :name="i.cover ? i.cover.url : vuex_default_icon" size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">¥{{ i.accompany_product ? i.accompany_product.price : 0 }}</view>
<view class="price-text__no"
>订单号 {{ i.no }}</view
>
</view>
</view>
<view class="info"
@click.stop.native="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})">
<view class="info__item">
<text>就诊城市</text>
<text>{{ i.city || ((i.hospital && i.hospital.site) ? i.hospital.site.name : "") || " " }}</text>
</view>
<view class="info__item">
<text>就诊医院</text>
<text>{{ i.hospital ? i.hospital.name : '' }}</text>
</view>
<view class="info__item">
<text>就诊人</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view>
<view class="info__item">
<text>就诊时间</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
</view>
<view class="bottom">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple
shape="circle"
:custom-style="payBtnStyle"
:throttle-time="2000"
@click="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})"
>{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button
>
</view>
</view>
<u-loadmore
:status="loadStatus"
bgColor="#f2f2f2"
></u-loadmore>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
payBtnStyle: {
"background-image":
"linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
loadStatus: 'loadmore',
list: [],
total: 0,
select: {
page: 1,
pay_status: "",
page_size: 20,
},
};
},
computed: {
statusFormat() {
return function (status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
}
},
methods: {
reachBottom() {
this.getOrder()
},
query2select(option) {
for (let key in option) {
this.select[key] = option[key]
}
},
async getOrder(isRefresh=false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus = 'loadmore'
}
if (this.loadStatus === 'nomore') return
try {
this.loadStatus = 'loading'
const res = await this.$u.api.accompanyOrders(this.select);
console.log(res);
this.total = res.total;
if (isRefresh) {
this.list.length = 0;
}
this.list.push(...res.data)
if (this.list.length >= res.total) {
this.loadStatus = 'nomore'
} else {
this.loadStatus = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus = 'loadmore'
}
},
},
onLoad(option) {
this.query2select(option)
this.getOrder(true)
},
}
</script>
<style lang="scss">
.page {
padding-top: 24rpx;
padding-bottom: calc(20rpx);
padding-bottom: calc(
constant(safe-area-inset-bottom) + 20rpx
);
padding-bottom: calc(
env(safe-area-inset-bottom) + 20rpx
);
}
.order {
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin: 0 25rpx 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 24rpx;
color: #333333;
font-weight: bold;
}
&__status {
font-size: 24rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 24rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 24rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
& > text {
display: block;
}
& > text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
& > text:nth-child(2) {
}
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
</style>
<template>
<view class="page">
<scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom">
<view>
<view class="order" v-for="i in list" :key="i.id">
<view class="title">
<view class="title__name">
<u-tag size="mini" type="primary" mode="dark" shape="circleLeft"
:text="i.type === 1 ? '陪诊' : '陪护'"></u-tag>
<text style="padding-left: 10rpx;">专享半天陪诊</text>
</view>
<view class="title__status">{{ statusFormat(i.pay_status) }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon :name="i.cover ? i.cover.url : vuex_default_icon" size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">¥{{ i.accompany_product ? i.accompany_product.price : 0 }}
</view>
<view class="price-text__no">订单号 {{ i.no }}</view>
</view>
</view>
<view class="info" @click.stop.native="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})">
<view class="info__item">
<text>就诊城市</text>
<text>{{ i.city || ((i.hospital && i.hospital.site) ? i.hospital.site.name : "") || " " }}</text>
</view>
<view class="info__item">
<text>就诊医院</text>
<text>{{ i.hospital ? i.hospital.name : '' }}</text>
</view>
<view class="info__item">
<text>就诊人</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view>
<view class="info__item">
<text>就诊时间</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
</view>
<view class="bottom">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple shape="circle" :custom-style="payBtnStyle" :throttle-time="2000" @click="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})">{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button>
</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
payBtnStyle: {
"background-image": "linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
loadStatus: 'loadmore',
list: [],
total: 0,
select: {
page: 1,
pay_status: "",
page_size: 20,
},
};
},
computed: {
statusFormat() {
return function(status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
}
},
methods: {
reachBottom() {
this.getOrder()
},
query2select(option) {
for (let key in option) {
this.select[key] = option[key]
}
},
async getOrder(isRefresh = false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus = 'loadmore'
}
if (this.loadStatus === 'nomore') return
try {
this.loadStatus = 'loading'
const res = await this.$u.api.accompanyOrders(this.select);
console.log(res);
this.total = res.total;
if (isRefresh) {
this.list.length = 0;
}
this.list.push(...res.data)
if (this.list.length >= res.total) {
this.loadStatus = 'nomore'
} else {
this.loadStatus = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus = 'loadmore'
}
},
},
onLoad(option) {
this.query2select(option)
this.getOrder(true)
},
}
</script>
<style lang="scss">
.page {
padding-top: 24rpx;
padding-bottom: calc(20rpx);
padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
}
::v-deep .u-load-more-wrap {
background-color: #f2f3f7 !important;
.u-line-1 {
background-color: #f2f3f7 !important;
}
}
.order {
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin: 0 25rpx 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 26rpx;
color: #333333;
font-weight: bold;
::v-deep .u-tag {
font-size: 26rpx;
}
}
&__status {
font-size: 26rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 30rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 26rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
&>text {
display: block;
}
&>text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
&>text:nth-child(2) {}
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
</style>

@ -113,13 +113,13 @@
position: relative;
&__name {
font-size: 24rpx;
font-size: 26rpx;
color: #333333;
font-weight: bold;
}
&__status {
font-size: 24rpx;
font-size: 26rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
@ -145,7 +145,7 @@
&__item {
flex-basis: 50%;
color: #333;
font-size: 24rpx;
font-size: 26rpx;
font-weight: 500;
display: flex;
margin-bottom: 16rpx;

@ -5,7 +5,7 @@
<view class="position" @click="isShowSite = true">
<u-icon name="map-fill"></u-icon>
<!-- <text>{{ vuex_location.city.replace(/(市|区|县)/,'') }}</text> -->
<text>{{ vuex_site.name || ' ' }}</text>
<text>{{ site_name || ' ' }}</text>
<u-icon name="arrow-down" size="22"></u-icon>
</view>
</view>
@ -72,15 +72,17 @@
select: {
page: 1,
page_size: 5,
type: '',
type: '',
site_id:''
},
list: [],
loadStatus: 'loadmore',
isShowSite: false,
list_site: [{
id: '',
name: '全部站点'
}],
name: '全部'
}],
site_name:''
};
@ -91,7 +93,9 @@
// }
},
onLoad(options) {
this.select.type = options.type ? options.type : ''
this.select.type = options.type ? options.type : ''
this.select.site_id = this.vuex_site?this.vuex_site.id:''
this.site_name = this.vuex_site?this.vuex_site.name:'全部'
this.getSiteList()
this.getList()
},
@ -103,7 +107,7 @@
async getList() {
const res = await this.$u.api.accompanyProduct({
...this.select,
site_id: this.vuex_site?.id
})
this.last_page = res.last_page
this.loadStatus = this.select.page >= this.last_page ? 'nomore' : 'loadmore'
@ -120,7 +124,9 @@
this.getList()
},
confirmSite(e) {
this.$u.vuex("vuex_site", e[0])
// this.$u.vuex("vuex_site", e[0])
this.select.site_id = e[0].id?e[0].id:''
this.site_name = e[0].name?e[0].name:'全部'
this.list = []
this.select.page = 1
this.getList()

@ -1,373 +1,369 @@
<template>
<view>
<navbar :use-search="false" title="订单"></navbar>
<view class="wrap safe-area-inset-bottom" v-if="token">
<view class="u-tabs-box">
<u-tabs-swiper
:height="76"
:font-size="24"
active-color="#c20d12"
bg-color="transparent"
inactive-color="#999"
ref="tabs"
:list="tabs"
:current="swiperCurrent"
@change="change"
:is-scroll="false"
:offset="[10, 5]"
swiperWidth="750"
></u-tabs-swiper>
</view>
<swiper
class="swiper-box"
:current="swiperCurrent"
@transition="transition"
@animationfinish="animationfinish"
>
<swiper-item class="swiper-item"
v-for="(swiper, swiperIndex) in tabs"
:key="swiperIndex">
<scroll-view
scroll-y
style="height: 100%; width: 100%"
@scrolltolower="reachBottom"
>
<view>
<view class="order" v-for="i in list[swiperIndex]" :key="i.id">
<view class="title">
<view class="title__name">
<text style="padding-left: 10rpx;">{{ i.title }}</text>
</view>
<view class="title__status">{{ i.pay_status === 4 ? '已退款' : (i.pay_status ? '已支付' : '待支付') }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon :name="(i.order_detail[0] && i.order_detail[0].product && i.order_detail[0].product.image) ? i.order_detail[0].product.image.url : vuex_default_icon" size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">¥{{ i.price }}</view>
<view class="price-text__no"
>订单号 {{ i.no }}</view
>
</view>
</view>
<view class="bottom">
<view class="row1">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple
shape="circle"
:custom-style="payBtnStyle"
:throttle-time="2000"
@click="$u.route({
url: '/package_sub/pages/Shop/Pay',
params: {
order_id: i.id
}
})"
>{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button
>
</view>
</view>
</view>
<u-loadmore
:status="loadStatus[swiperIndex]"
bgColor="#f2f2f2"
></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<view v-if="!token">
<u-empty :margin-top="360" text="未登录" mode="order">
<u-button shape="circle"
slot="bottom"
type="primary"
ripple
@click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</u-empty>
</view>
<tabbar class="tabbar"></tabbar>
</view>
</template>
<script>
import navbar from "@/package_sub/pages/Shop/Navbar.vue";
import tabbar from "@/package_sub/pages/Shop/Tabbar.vue";
export default {
components: {
navbar,
tabbar
},
data() {
return {
payBtnStyle: {
"background-image":
"linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
tabs: [
{
name: "全部",
value: "",
count: 0,
},
{
name: "待支付",
value: 0,
count: 0,
},
{
// name: '待评价',
name: "已支付",
value: 1,
count: 0,
}
// {
// name: '已取消'
// }
],
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
scrollTop: [],
loadStatus: [],
refresherStatus: [],
select: {
page: 1,
pay_status: "",
page_size: 20,
},
list: [],
};
},
onShow() {
if (this.token) {
this.getOrder(true);
}
},
created() {
for (let i = 0; i < this.tabs.length; i++) {
this.refresherStatus.push(false);
this.list.push([]);
this.loadStatus.push("loadmore");
}
},
computed: {
statusFormat() {
return function (status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
},
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
methods: {
reachBottom() {
// 此tab为空数据
this.getOrder()
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
},
transition({ detail: { dx } }) {
this.$refs.tabs.setDx(dx);
},
animationfinish({ detail: { current } }) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.select.pay_status = this.tabs[this.swiperCurrent].value;
this.getOrder(true)
},
async getOrder(isRefresh=false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
if (this.loadStatus[this.swiperCurrent] === 'nomore') return
try {
this.loadStatus[this.swiperCurrent] = 'loading'
const res = await this.$u.api.userOrders(this.select);
this.tabs[this.swiperCurrent].count = res.total;
if (isRefresh) {
this.list[this.swiperCurrent].length = 0;
}
this.list[this.swiperCurrent].push(...res.data)
if (this.list[this.swiperCurrent].length >= res.total) {
this.loadStatus[this.swiperCurrent] = 'nomore'
} else {
this.select.page++;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
},
},
};
</script>
<style>
page {
height: 100%;
background-color: #eee;
}
</style>
<style lang="scss" scoped>
::v-deep .u-load-more-wrap {
padding: 20rpx 0;
}
.d-flex {
display: flex;
}
.ai-center {
align-items: center;
}
.jc-center {
justify-content: center;
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top) - calc(60px + 6px));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.order {
margin: 0 25rpx;
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin-top: 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 24rpx;
color: #333333;
font-weight: bold;
}
&__status {
font-size: 24rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 24rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 24rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
& > text {
display: block;
}
& > text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
& > text:nth-child(2) {
}
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
.row1 {
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
}
</style>
<template>
<view>
<navbar :use-search="false" title="订单"></navbar>
<view class="wrap safe-area-inset-bottom" v-if="token">
<view class="u-tabs-box">
<u-tabs-swiper :height="76" :font-size="24" active-color="#c20d12" bg-color="transparent"
inactive-color="#999" ref="tabs" :list="tabs" :current="swiperCurrent" @change="change"
:is-scroll="false" :offset="[10, 5]" swiperWidth="750"></u-tabs-swiper>
</view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
@animationfinish="animationfinish">
<swiper-item class="swiper-item" v-for="(swiper, swiperIndex) in tabs" :key="swiperIndex">
<scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom">
<view>
<view class="order" v-for="i in list[swiperIndex]" :key="i.id">
<view class="title">
<view class="title__name">
<text style="padding-left: 10rpx;">{{ i.title }}</text>
</view>
<view class="title__status">
{{ i.pay_status === 4 ? '已退款' : (i.pay_status ? '已支付' : '待支付') }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon
:name="(i.order_detail[0] && i.order_detail[0].product && i.order_detail[0].product.image) ? i.order_detail[0].product.image.url : vuex_default_icon"
size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">¥{{ i.price }}</view>
<view class="price-text__no">订单号 {{ i.no }}</view>
</view>
</view>
<view class="bottom">
<view class="row1">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple shape="circle" :custom-style="payBtnStyle"
:throttle-time="2000" @click="$u.route({
url: '/package_sub/pages/Shop/Pay',
params: {
order_id: i.id
}
})">{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[swiperIndex]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<view v-if="!token">
<u-empty :margin-top="360" text="未登录" mode="order">
<u-button shape="circle" slot="bottom" type="primary" ripple @click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</u-empty>
</view>
<tabbar class="tabbar"></tabbar>
</view>
</template>
<script>
import navbar from "@/package_sub/pages/Shop/Navbar.vue";
import tabbar from "@/package_sub/pages/Shop/Tabbar.vue";
export default {
components: {
navbar,
tabbar
},
data() {
return {
payBtnStyle: {
"background-image": "linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
tabs: [{
name: "全部",
value: "",
count: 0,
},
{
name: "待支付",
value: 0,
count: 0,
},
{
// name: '待评价',
name: "已支付",
value: 1,
count: 0,
}
// {
// name: '已取消'
// }
],
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
scrollTop: [],
loadStatus: [],
refresherStatus: [],
select: {
page: 1,
pay_status: "",
page_size: 20,
},
list: [],
};
},
onShow() {
if (this.token) {
this.getOrder(true);
}
},
created() {
for (let i = 0; i < this.tabs.length; i++) {
this.refresherStatus.push(false);
this.list.push([]);
this.loadStatus.push("loadmore");
}
},
computed: {
statusFormat() {
return function(status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
},
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
methods: {
reachBottom() {
// 此tab为空数据
this.getOrder()
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
},
transition({
detail: {
dx
}
}) {
this.$refs.tabs.setDx(dx);
},
animationfinish({
detail: {
current
}
}) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.select.pay_status = this.tabs[this.swiperCurrent].value;
this.getOrder(true)
},
async getOrder(isRefresh = false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
if (this.loadStatus[this.swiperCurrent] === 'nomore') return
try {
this.loadStatus[this.swiperCurrent] = 'loading'
const res = await this.$u.api.userOrders(this.select);
this.tabs[this.swiperCurrent].count = res.total;
if (isRefresh) {
this.list[this.swiperCurrent].length = 0;
}
this.list[this.swiperCurrent].push(...res.data)
if (this.list[this.swiperCurrent].length >= res.total) {
this.loadStatus[this.swiperCurrent] = 'nomore'
} else {
this.select.page++;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
},
},
};
</script>
<style>
page {
height: 100%;
background-color: #eee;
}
</style>
<style lang="scss" scoped>
::v-deep .u-load-more-wrap {
padding: 20rpx 0;
}
::v-deep .u-load-more-wrap {
background-color: #eee !important;
.u-line-1 {
background-color: #eee !important;
}
}
.d-flex {
display: flex;
}
.ai-center {
align-items: center;
}
.jc-center {
justify-content: center;
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top) - calc(60px + 6px));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.order {
margin: 0 25rpx;
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin-top: 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 26rpx;
color: #333333;
font-weight: bold;
}
&__status {
font-size: 26rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 30rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 26rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
&>text {
display: block;
}
&>text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
&>text:nth-child(2) {}
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
.row1 {
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
}
</style>

@ -155,7 +155,7 @@ export default {
if(option.id) {
this.getDetail(option.id)
}
this.type = options.type?options.type:''
this.type = option.type?option.type:''
}
};
</script>

@ -95,6 +95,8 @@ export default {
<style lang="scss" scoped>
.item {
padding: 40rpx 20rpx;
background: #fff;
margin: 20rpx;
.top {
display: flex;
font-weight: bold;

@ -1,159 +1,176 @@
<template>
<view>
<view class="service-list" style="padding-bottom: 120rpx">
<view
class="service-list-item"
v-for="(item, i) in list_archive"
:key="i.id"
>
<view class="service-list-item__wrap">
<view class="service-list-item__name">
{{ item.name }}
</view>
<view class="service-list-item__price">
<u-icon name="phone-fill"></u-icon>
{{ item.mobile }}
</view>
</view>
<view class="service-list-item__wrap">
<view class="service-list-item__address">
{{ item.address }}
</view>
<view class="service-list-item__idcard">
{{ item.idcard }}
</view>
</view>
</view>
</view>
<view class="service-list-btn">
<u-button
shape="circle"
ripple
:custom-style="btnStyle"
@click="addArchive"
>新增就诊人</u-button
>
</view>
<service-archive ref="serviceArchive"></service-archive>
</view>
</template>
<script>
import serviceArchive from "@/component/serviceArchive/service-archive.vue";
export default {
components: {
serviceArchive
},
data() {
return {
btnStyle: {
"background-image":
"linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "288rpx",
"margin-right": "25rpx",
},
list_archive: [],
};
},
methods: {
async getUserArchive() {
try {
const res = await this.$u.api.userArchive({
page: 1,
page_size: 999,
});
this.list_archive = res.data;
} finally {
uni.stopPullDownRefresh()
}
},
addArchive() {
this.$refs.serviceArchive.isShow = true;
},
},
onLoad() {
this.getUserArchive()
},
onPullDownRefresh() {
this.getUserArchive()
},
}
</script>
<style lang="scss">
.service-list {
padding-top: 80rpx;
&-item {
border: 2rpx solid #e6e6eb;
border-radius: 10rpx;
background-color: #ffffff;
margin: 0 25rpx;
padding: 28rpx 39rpx;
display: flex;
align-items: center;
flex-wrap: wrap;
&__wrap {
display: flex;
align-items: center;
width: 100%;
}
&__address {
width: 100%;
padding-left: 14rpx;
line-height: 2;
}
&__icon {
display: flex;
justify-content: center;
align-items: center;
// background: #f9f5e9;
// padding: 20rpx;
}
&__name {
padding-left: 14rpx;
font-size: 28rpx;
color: #333333;
font-weight: 500;
line-height: 2;
}
&__price {
color: #c20d12;
font-weight: 500;
margin-left: auto;
line-height: 2;
}
&__idcard {
color: #c20d12;
font-weight: 500;
margin-left: auto;
line-height: 2;
}
}
&-btn {
position: fixed;
bottom: 40rpx;
left: calc(50% - 144rpx);
}
&-item + &-item {
margin-top: 20rpx;
}
}
</style>
<template>
<view>
<view class="item" v-for="(res, index) in list_archive" :key="res.id">
<view class="top">
<view class="name">{{ res.name }}</view>
<view class="phone">{{ res.mobile }}</view>
</view>
<view class="bottom">
<text>{{ res.address }}</text>
<view class="icon">
<u-icon name="edit-pen" :size="40" color="#999999" @tap="toEdit(res)"></u-icon>
<u-icon name="trash" style="margin-left: 40rpx;" :size="40" color="red"
@tap="selectSite = res,show = true"></u-icon>
</view>
</view>
</view>
<view class="addSite" @tap="addArchive">
<view class="add">
<u-icon name="plus" color="#ffffff" class="icon" :size="30"></u-icon>新增就诊人
</view>
</view>
<u-modal v-model="show" content="确认操作?" show-cancel-button @confirm="destroy"></u-modal>
<service-archive ref="serviceArchive"></service-archive>
</view>
</template>
<script>
import serviceArchive from "@/component/serviceArchive/service-archive.vue";
export default {
components: {
serviceArchive
},
data() {
return {
btnStyle: {
"background-image": "linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "288rpx",
"margin-right": "25rpx",
},
show: false,
list_archive: [],
selectSite: {}
};
},
methods: {
toEdit(item) {
this.$refs.serviceArchive.form = item
this.$refs.serviceArchive.isShow = true;
},
async getUserArchive() {
try {
const res = await this.$u.api.userArchive({
page: 1,
page_size: 999,
});
this.list_archive = res.data;
} finally {
uni.stopPullDownRefresh()
}
},
addArchive() {
this.$refs.serviceArchive.isShow = true;
},
async destroy() {
try {
if (!this.selectSite?.id) return
const res = await this.$u.api.userArchiveDestroy({
id: this.selectSite?.id
})
this.getUserArchive()
} catch (err) {
console.error(err)
}
}
},
onLoad() {
this.getUserArchive()
},
onPullDownRefresh() {
this.getUserArchive()
},
}
</script>
<style>
</style>
<style lang="scss" scoped>
page {
height: 100%;
background-color: #f2f3f7;
}
.item {
padding: 40rpx 20rpx;
background: #fff;
margin: 20rpx;
.top {
display: flex;
font-weight: bold;
font-size: 34rpx;
.phone {
margin-left: 60rpx;
}
.tag {
display: flex;
font-weight: normal;
align-items: center;
text {
display: block;
width: 60rpx;
height: 34rpx;
line-height: 34rpx;
color: #ffffff;
font-size: 20rpx;
border-radius: 6rpx;
text-align: center;
margin-left: 30rpx;
background-color: rgb(49, 145, 253);
}
.red {
background-color: $uni-color-primary;
}
}
}
.bottom {
display: flex;
margin-top: 20rpx;
font-size: 28rpx;
justify-content: space-between;
align-items: flex-start;
color: #999999;
.icon {
text-align: right;
margin-left: 10rpx;
flex: 0;
flex-basis: 200rpx;
}
}
}
.addSite {
display: flex;
justify-content: space-around;
width: 600rpx;
line-height: 100rpx;
position: absolute;
bottom: 30rpx;
left: 80rpx;
background: linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%);
border-radius: 60rpx;
font-size: 30rpx;
.add {
display: flex;
align-items: center;
color: #ffffff;
.icon {
margin-right: 10rpx;
}
}
}
</style>

@ -0,0 +1,156 @@
<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.tags">{{ info.tags }}</view>
<view v-if="info.good_at">{{ info.good_at }}</view>
</view>
<view class="description" v-if="info.address">
<u-icon name="map"></u-icon>
<text style="margin-left:20rpx">{{info.address?info.address:'12333333'}}</text>
</view>
</view>
<view class="department">
<view class="title">医院简介</view>
<view class="content">
{{info.content?info.content:'暂无简介'}}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: '',
info: {},
};
},
mounted() {
},
onLoad(options) {
this.id = options.id ? options.id : ''
this.getDetail()
},
methods: {
async getDetail() {
const res = await this.$u.api.detailHospital({
id: this.id
})
this.info = res
},
},
}
</script>
<style lang="scss">
.page {
position: relative;
background-color: #f5efee;
min-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;
padding-bottom:15rpx;
margin: 25rpx;
margin-top: 0;
.title {
font-size: 28rpx;
color: #000000;
font-weight: bold;
}
.tag {
margin-top: 16rpx;
display: flex;
flex-wrap: wrap;
font-size: 24rpx;
color:#929196;
padding-bottom: 25rpx;
&__item {
padding: 5rpx 16rpx;
font-size: 22rpx;
line-height: 31rpx;
font-weight: 500;
margin-bottom:10rpx;
&: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%;
font-size: 26rpx;
color: #929196;
font-weight: 500;
border-top:1rpx solid rgba(0,0,0,0.1);
padding-top: 25rpx;
padding-bottom:25rpx;
}
}
.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: 40rpx;
margin: 25rpx;
margin-top: 0;
margin-bottom: 50rpx;
.title {
font-size: 28rpx;
color: #000000;
font-weight: bold;
margin-bottom: 30rpx;
}
.content {
color:#666666;
font-size: 26rpx;
line-height: 1.8;
}
}
</style>

@ -171,8 +171,14 @@
"navigationBarTitleText": "就医服务",
"enablePullDownRefresh": true
}
},
{
"path": "pages/hotHospital/hotHospital",
"style": {
"navigationBarTitleText": "热门医院",
"enablePullDownRefresh": true
}
}
]
}
],

@ -47,12 +47,12 @@
<view class="swiper">
<u-swiper :height="366" :list="banners" name="url"></u-swiper>
</view>
<view class="links-title">
<text></text><text>服务·</text><text class="c3">一站式服务</text>
<view class="links-title">
<text></text><text>服务·</text><text class="c3">一站式服务</text>
</view>
<view class="links">
<view v-for="item in links" :key="item.text" bg-color="transparent" @click="goLinks(item)">
<image class="icon" :src="item.icon" mode="aspectFit"></image>
<view class="links">
<view v-for="item in links" :key="item.text" bg-color="transparent" @click="goLinks(item)">
<image class="icon" :src="item.icon" mode="aspectFit"></image>
</view>
<!-- <u-grid :col="3" :border="false">
<u-grid-item :custom-style="{'padding-top':'20rpx','padding-bottom':0}" v-for="item in links" :key="item.text" bg-color="transparent" @click="goLinks(item)">
@ -62,15 +62,20 @@
</u-grid> -->
</view>
<view class="img1">
<!-- <view class="img1">
<image src="~@/static/index/ask-png.png" alt="" mode="aspectFit"></image>
</view>
</view> -->
<view class="hospitals">
<view class="hospitals__title">热门医院</view>
<view class="hospitals__content">
<view class="hospitals__content__item" v-for="(item, index) in hospitals" :key="item.id">
<view class="hospitals__content__item" @click="$u.throttle($u.route({
url: '/package_sub/pages/hotHospital/hotHospital',
params: {
id: item.id
}
}))" v-for="(item, index) in hospitals" :key="item.id">
<view class="left">
<image :src="item.cover ? item.cover.url : ''" alt="" mode="scaleToFill"></image>
</view>
@ -92,7 +97,7 @@
type: 1
}
}))">
<view class="text1">陪诊团队介绍</view>
<view class="text1">陪诊服务</view>
<view class="text2">让就医体验更美好</view>
<view class="order">预约陪诊</view>
@ -117,7 +122,7 @@
</view>
</view>
<view class="honor">
<!-- <view class="honor">
<view class="honor__title">
<image src="~@/static/index/honor-title.png" alt="" mode="aspectFit"></image>
<text>资质荣誉</text>
@ -127,7 +132,7 @@
<image class="images" v-for="i in photos" :key="i.id" :src="i.image ? i.image.url : ''"
mode="aspectFit"></image>
</scroll-view>
</view>
</view> -->
<image class="bottom" src="~@/static/index/bottom.png" mode="aspectFit" alt=""></image>
@ -205,11 +210,11 @@
text: "商城服务",
icon: "/static/index/index5.png",
to: "/package_sub/pages/Shop/Home",
},
{
text: "智能AI",
icon: "/static/index/index6.png",
to: "/pages/aichat/index",
},
{
text: "智能AI",
icon: "/static/index/index6.png",
to: "/pages/aichat/index",
},
],
@ -234,7 +239,7 @@
this.getSiteList().then(_ => {
this.getHospital();
this.getBanner();
this.getPhotos();
// this.getPhotos();
})
},
onPageScroll(e) {
@ -337,9 +342,11 @@
::v-deep .u-indicator-item-round-active {
background: #ca2328 !important;
}
::v-deep .u-grid-item-box{
padding-bottom:0;
::v-deep .u-grid-item-box {
padding-bottom: 0;
}
.container {
padding-bottom: calc(76px + 34px + 10px);
position: relative;
@ -464,39 +471,45 @@
margin-top: 24rpx;
padding: 0 25rpx;
}
.links-title{
padding: 0 25rpx;
margin-top: calc(43rpx + 25rpx);
font-size: 29rpx;
color:#191919;
display: flex;
align-items: center;
margin-bottom:5rpx;
&>text:first-child{
width:12rpx;
height:57rpx;
border-radius: 20rpx;
display: inline-block;
margin-right:15rpx;
background:linear-gradient(to bottom,
.links-title {
padding: 0 25rpx;
margin-top: calc(43rpx + 25rpx);
font-size: 29rpx;
color: #191919;
display: flex;
align-items: center;
margin-bottom: 5rpx;
&>text:first-child {
width: 12rpx;
height: 57rpx;
border-radius: 20rpx;
display: inline-block;
margin-right: 15rpx;
background: linear-gradient(to bottom,
#ef9478 0%,
#c10d12 94%,
#d03434 100%);
}
.c3{
color:#3e3e3e
}
#d03434 100%);
}
.c3 {
color: #3e3e3e
}
}
.links {
padding: 0 25rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
&>view{
font-size: 0;
padding-top:20rpx;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
&>view {
font-size: 0;
padding-top: 20rpx;
}
.icon {
height: 130rpx;
width: 220rpx;
@ -515,6 +528,7 @@
margin-top: 26rpx;
padding: 0 25rpx;
font-size: 0;
&>image {
width: 700rpx;
height: 169rpx;
@ -531,8 +545,8 @@
font-size: 28rpx;
color: #000000;
font-weight: bold;
padding: 0 32rpx 28rpx;
padding-left:0;
padding: 0 32rpx 28rpx;
padding-left: 0;
}
&__content {
@ -634,7 +648,7 @@
}
.text2 {
font-size: 18rpx;
font-size: 22rpx;
color: #ffffff;
font-weight: 500;
padding: 17rpx 0 0 34rpx;
@ -796,7 +810,7 @@
.bottom {
margin: 50rpx auto 20rpx;
width: 700rpx;
height: 45rpx;
height: 45rpx;
display: block;
}

@ -1,391 +1,399 @@
<template>
<view class="container">
<image class="bkg" mode="aspectFill" src="~@/static/me/bkg.png"></image>
<view class="top" @click="isShowMyInfo = true">
<image class="avatar" mode="aspectFit" :src="vuex_user.headimgurl || vuex_default_icon"></image>
<view v-if="token" class="info">
<view class="info-name">
{{ vuex_user.nickname || '微信用户' }}
</view>
<view class="info-mobile">手机号:
<text v-if="vuex_user.mobile">
{{ vuex_user.mobile || '' }}
</text>
<u-button v-if="!vuex_user.mobile"
shape="circle"
size="mini"
open-type="getPhoneNumber"
type="primary"
@getphonenumber="onPhoneNumber"
ripple>获取手机号</u-button>
</view>
</view>
<view v-else class="info">
<view class="info-name">未登录</view>
<u-button shape="circle"
size="mini"
type="primary"
ripple
@click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</view>
</view>
<view v-if="token" class="panel panel1">
<view class="tab"
@click="$u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
type: 1
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/peizheng.png"></image>
<view>陪诊订单</view>
</view>
<view class="tab"
@click="$u.route({
url: '/package_sub/pages/Shop/Order'
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/shangcheng.png"></image>
<view>商城订单</view>
</view>
<!-- <view class="tab"
@click="$u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
type: 2
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/jujia.png"></image>
<view>居家照护订单</view>
</view> -->
<view class="tab"
@click="$u.route({
url: '/package_sub/pages/ServeOrder/ServeOrder',
params: {
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/jujia.png"></image>
<view>就医服务订单</view>
</view>
<view class="tab"
@click="$u.route({
url: '/package_sub/pages/UserAddress/UserAddress'
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/dizhi.png"></image>
<view>收货地址</view>
</view>
<view class="tab" @click="$u.throttle($u.route({ url: '/package_sub/pages/UserArchive/UserArchive' }))">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/lianxiren.png"></image>
<view>常用联系人</view>
</view>
<view class="tab"
@click="$u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
pay_status: 2
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/shouhou.png"></image>
<view>售后订单</view>
</view>
</view>
<view class="panel panel2">
<button class="row" open-type="share">
<u-icon class="row__icon" name="share"></u-icon>
<view>我要分享</view>
</button>
<view class="row" @click="isShowModal = true">
<u-icon class="row__icon" name="man-add"></u-icon>
<view>加入我们</view>
</view>
<view class="row" @click="isShowModal = true">
<u-icon class="row__icon" name="kefu-ermai"></u-icon>
<view>联系我们</view>
</view>
<!-- <view class="row" v-if="token" @click="logout">-->
<!-- <u-icon class="row__icon" name="backspace"></u-icon>-->
<!-- <view>退出</view>-->
<!-- </view>-->
</view>
<tabbar />
<!-- 设置头像 -->
<view class="myinfo">
<u-popup v-model="isShowMyInfo" mode="bottom" :border-radius="30" safe-area-inset-bottom>
<view class="form-wrapper">
<u-form :model="form" ref="uForm" label-width="140rpx">
<u-form-item label="头像">
<button class="btn-normal" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image :src="form.headimgurl || vuex_default_icon" mode="aspectFit"></image>
</button>
</u-form-item>
<u-form-item label="昵称">
<input type="nickname" v-model="form.nickname" @change="nicknameChange"></input>
</u-form-item>
<u-form-item label="性别">
<u-radio-group v-model="form.sex" active-color="#b83531">
<u-radio name="男">男</u-radio>
<u-radio name="女">女</u-radio>
<u-radio name="保密">保密</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="手机号">
<u-input v-model="form.mobile"></u-input>
</u-form-item>
</u-form>
</view>
<!-- 操作按钮 -->
<view class="footer">
<view class="btn-wrapper">
<u-button type="primary" shape="circle" ripple :custom-style="{ 'width': '90%', 'margin': 'auto' }" @click="submit">保存</u-button>
</view>
</view>
</u-popup>
</view>
<u-modal v-model="isShowModal" :show-title="false" content="客服热线:xxx-xxxxxxxx"></u-modal>
</view>
</template>
<script>
import { ROOTPATH } from '@/common/config'
import { WXBizDataCrypt } from '@/libs/WXBizDataCrypt'
import Tabbar from "@/component/Tabbar/Tabbar.vue";
export default {
components: {
Tabbar
},
data() {
return {
isShowModal: false,
isShowMyInfo: false,
form: {
nickname: '',
headimgurl: '',
mobile: '',
sex: ''
},
};
},
methods: {
nicknameChange(e) {
this.form.nickname = e.target.value
},
async onPhoneNumber(e) {
try {
if (e.detail.encryptedData) {
const res = await this.$u.api.getMobile({
code: e.detail.encryptedData
})
const { user } = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
}
} catch (err) {
console.error(err)
}
},
onChooseAvatar(e) {
uni.uploadFile({
url: ROOTPATH + "/api/mobile/upload-file",
filePath: e.detail.avatarUrl,
name: 'file',
header: {
['Authorization']: `Bearer ${this.token}`
},
success: (res) => {
uni.showToast({
title: '上传成功',
duration: 1000,
icon: 'none'
})
let data = JSON.parse(res.data)
this.form.headimgurl = data.url
}
})
},
submit() {
this.$u.api.updateUser(this.form).then(async (_) => {
const { user } = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
this.$u.toast('保存成功')
this.isShowMyInfo = false
})
},
logout() {
uni.showModal({
title: '提示',
content: '确认退出?',
success: status => {
if (status.confirm) {
this.$u.vuex('vuex_token', '')
this.$u.vuex('vuex_user', {})
uni.setStorageSync('lifeData', {})
this.$u.route({
url: '/pages/index/index',
type: 'tab'
})
}
}
})
}
},
computed: {
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
watch: {
vuex_user: {
handler: function (newVal) {
this.form.mobile = newVal.mobile
this.form.sex = newVal.sex
this.form.headimgurl = newVal.headimgurl
this.form.nickname = newVal.nickname
},
immediate: true
}
},
onLoad() {
},
}
</script>
<style lang="scss">
.container {
min-height: 100vh;
position: relative;
background: #f4efef;
.bkg {
width: 100vw;
z-index: 0;
height: 550rpx;
position: absolute;
top: 0;
left: 0;
}
.top {
display: flex;
align-items: center;
position: relative;
padding: 4vh 25rpx 0;
.avatar {
width: 112rpx;
height: 112rpx;
border-radius: 100%;
background: #fff;
border: 6rpx #fff solid;
filter: drop-shadow(4rpx 6rpx 10rpx #ba534c);
}
.info {
color: #333;
padding-left: 40rpx;
&-name {
font-size: 28rpx;
font-weight: 600;
}
&-mobile {
font-size: 24rpx;
padding-top: 18rpx;
}
}
}
.panel {
position: relative;
background: #fff;
border-radius: 10rpx;
margin: 40rpx 25rpx 0;
padding: 28rpx 25rpx;
}
.panel1 {
display: grid;
grid-gap: 24rpx;
grid-template-columns: repeat(3, 1fr);
.tab {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&__icon {
width: 80rpx;
height: 80rpx;
margin-bottom: 10rpx;
}
}
}
.panel2 {
button {
border: none;
background-color: transparent;
line-height: 1.5;
font-size: 28rpx;
color: #333;
&::after {
border: none;
}
}
.row {
display: flex;
padding: 20rpx 10rpx;
border-bottom: 2rpx #dee2e6 solid;
&__icon {
margin-right: 20rpx;
color: $uni-color-primary;
font-size: 36rpx;
}
}
}
}
.form-wrapper {
margin: 20rpx auto 20rpx auto;
padding: 0 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
.btn-normal {
display: block;
margin: 0;
padding: 0;
line-height: normal;
background: none;
border-radius: 0;
box-shadow: none;
border: none;
font-size: unset;
text-align: unset;
overflow: visible;
color: inherit;
image {
width: 120rpx;
height: 120rpx;
border-radius: 100%;
border: 2px solid #fff;
margin-right: 30rpx;
}
}
.btn-normal::after {
border: none
}
.auth-btn {
color: $uni-color-primary;
}
}
</style>
<template>
<view class="container">
<image class="bkg" mode="aspectFill" src="~@/static/me/bkg.png"></image>
<view class="top" @click="isShowMyInfo = true">
<image class="avatar" mode="aspectFit" :src="vuex_user.headimgurl || vuex_default_icon"></image>
<view v-if="token" class="info">
<view class="info-name">
{{ vuex_user.nickname || '微信用户' }}
</view>
<view class="info-mobile">手机号:
<text v-if="vuex_user.mobile">
{{ vuex_user.mobile || '' }}
</text>
<u-button v-if="!vuex_user.mobile" shape="circle" size="mini" open-type="getPhoneNumber"
type="primary" @getphonenumber="onPhoneNumber" ripple>获取手机号</u-button>
</view>
</view>
<view v-else class="info">
<view class="info-name">未登录</view>
<u-button shape="circle" size="mini" type="primary" ripple @click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</view>
</view>
<view v-if="token" class="panel panel1">
<view class="tab" @click="goOrder">
<!-- $u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
type: 1
}
}) -->
<image class="tab__icon" mode="aspectFit" src="~@/static/me/peizheng.png"></image>
<view>陪诊订单</view>
</view>
<view class="tab" @click="$u.route({
url: '/package_sub/pages/Shop/Order'
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/shangcheng.png"></image>
<view>商城订单</view>
</view>
<!-- <view class="tab"
@click="$u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
type: 2
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/jujia.png"></image>
<view>居家照护订单</view>
</view> -->
<view class="tab" @click="$u.route({
// url: '/pages/order/order',
url: '/package_sub/pages/ServeOrder/ServeOrder',
params: {
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/jujia.png"></image>
<view>就医服务订单</view>
</view>
<view class="tab" @click="$u.route({
url: '/package_sub/pages/UserAddress/UserAddress'
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/dizhi.png"></image>
<view>收货地址</view>
</view>
<view class="tab" @click="$u.throttle($u.route({ url: '/package_sub/pages/UserArchive/UserArchive' }))">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/lianxiren.png"></image>
<view>常用联系人</view>
</view>
<view class="tab" @click="$u.route({
url: '/package_sub/pages/OrderList/OrderList',
params: {
pay_status: 4
}
})">
<image class="tab__icon" mode="aspectFit" src="~@/static/me/shouhou.png"></image>
<view>售后订单</view>
</view>
</view>
<view class="panel panel2">
<button class="row" open-type="share">
<u-icon class="row__icon" name="share"></u-icon>
<view>我要分享</view>
</button>
<!-- <view class="row" @click="isShowModal = true">
<u-icon class="row__icon" name="man-add"></u-icon>
<view>加入我们</view>
</view> -->
<view class="row" @click="isShowModal = true">
<u-icon class="row__icon" name="kefu-ermai"></u-icon>
<view>联系我们</view>
</view>
<!-- <view class="row" v-if="token" @click="logout">-->
<!-- <u-icon class="row__icon" name="backspace"></u-icon>-->
<!-- <view>退出</view>-->
<!-- </view>-->
</view>
<tabbar />
<!-- 设置头像 -->
<view class="myinfo">
<u-popup v-model="isShowMyInfo" mode="bottom" :border-radius="30" safe-area-inset-bottom>
<view class="form-wrapper">
<u-form :model="form" ref="uForm" label-width="140rpx">
<u-form-item label="头像">
<button class="btn-normal" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image :src="form.headimgurl || vuex_default_icon" mode="aspectFit"></image>
</button>
</u-form-item>
<u-form-item label="昵称">
<input type="nickname" v-model="form.nickname" @change="nicknameChange"></input>
</u-form-item>
<u-form-item label="性别">
<u-radio-group v-model="form.sex" active-color="#b83531">
<u-radio name="男">男</u-radio>
<u-radio name="女">女</u-radio>
<u-radio name="保密">保密</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="手机号">
<u-input v-model="form.mobile"></u-input>
</u-form-item>
</u-form>
</view>
<!-- 操作按钮 -->
<view class="footer">
<view class="btn-wrapper">
<u-button type="primary" shape="circle" ripple
:custom-style="{ 'width': '90%', 'margin': 'auto' }" @click="submit">保存</u-button>
</view>
</view>
</u-popup>
</view>
<u-modal v-model="isShowModal" :show-title="false" content="客服热线:xxx-xxxxxxxx"></u-modal>
</view>
</template>
<script>
import {
ROOTPATH
} from '@/common/config'
import {
WXBizDataCrypt
} from '@/libs/WXBizDataCrypt'
import Tabbar from "@/component/Tabbar/Tabbar.vue";
export default {
components: {
Tabbar
},
data() {
return {
isShowModal: false,
isShowMyInfo: false,
form: {
nickname: '',
headimgurl: '',
mobile: '',
sex: ''
},
};
},
methods: {
goOrder() {
uni.switchTab({
url: '/pages/order/order'
})
},
nicknameChange(e) {
this.form.nickname = e.target.value
},
async onPhoneNumber(e) {
try {
if (e.detail.encryptedData) {
const res = await this.$u.api.getMobile({
code: e.detail.encryptedData
})
const {
user
} = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
}
} catch (err) {
console.error(err)
}
},
onChooseAvatar(e) {
uni.uploadFile({
url: ROOTPATH + "/api/mobile/upload-file",
filePath: e.detail.avatarUrl,
name: 'file',
header: {
['Authorization']: `Bearer ${this.token}`
},
success: (res) => {
uni.showToast({
title: '上传成功',
duration: 1000,
icon: 'none'
})
let data = JSON.parse(res.data)
this.form.headimgurl = data.url
}
})
},
submit() {
this.$u.api.updateUser(this.form).then(async (_) => {
const {
user
} = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
this.$u.toast('保存成功')
this.isShowMyInfo = false
})
},
logout() {
uni.showModal({
title: '提示',
content: '确认退出?',
success: status => {
if (status.confirm) {
this.$u.vuex('vuex_token', '')
this.$u.vuex('vuex_user', {})
uni.setStorageSync('lifeData', {})
this.$u.route({
url: '/pages/index/index',
type: 'tab'
})
}
}
})
}
},
computed: {
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
watch: {
vuex_user: {
handler: function(newVal) {
this.form.mobile = newVal.mobile
this.form.sex = newVal.sex
this.form.headimgurl = newVal.headimgurl
this.form.nickname = newVal.nickname
},
immediate: true
}
},
onLoad() {},
}
</script>
<style lang="scss">
.container {
min-height: 100vh;
position: relative;
background: #f4efef;
.bkg {
width: 100vw;
z-index: 0;
height: 550rpx;
position: absolute;
top: 0;
left: 0;
}
.top {
display: flex;
align-items: center;
position: relative;
padding: 4vh 25rpx 0;
.avatar {
width: 112rpx;
height: 112rpx;
border-radius: 100%;
background: #fff;
border: 6rpx #fff solid;
filter: drop-shadow(4rpx 6rpx 10rpx #ba534c);
}
.info {
color: #333;
padding-left: 40rpx;
&-name {
font-size: 28rpx;
font-weight: 600;
}
&-mobile {
font-size: 24rpx;
padding-top: 18rpx;
}
}
}
.panel {
position: relative;
background: #fff;
border-radius: 10rpx;
margin: 40rpx 25rpx 0;
padding: 28rpx 25rpx;
}
.panel1 {
display: grid;
grid-gap: 24rpx;
grid-template-columns: repeat(3, 1fr);
.tab {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
&__icon {
width: 80rpx;
height: 80rpx;
margin-bottom: 10rpx;
}
}
}
.panel2 {
button {
border: none;
background-color: transparent;
line-height: 1.5;
font-size: 28rpx;
color: #333;
&::after {
border: none;
}
}
.row {
display: flex;
padding: 20rpx 10rpx;
border-bottom: 2rpx #dee2e6 solid;
&__icon {
margin-right: 20rpx;
color: $uni-color-primary;
font-size: 36rpx;
}
}
}
}
.form-wrapper {
margin: 20rpx auto 20rpx auto;
padding: 0 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
.btn-normal {
display: block;
margin: 0;
padding: 0;
line-height: normal;
background: none;
border-radius: 0;
box-shadow: none;
border: none;
font-size: unset;
text-align: unset;
overflow: visible;
color: inherit;
image {
width: 120rpx;
height: 120rpx;
border-radius: 100%;
border: 2px solid #fff;
margin-right: 30rpx;
}
}
.btn-normal::after {
border: none
}
.auth-btn {
color: $uni-color-primary;
}
}
</style>

@ -1,408 +1,411 @@
<template>
<view>
<view class="wrap safe-area-inset-bottom" v-if="token">
<view class="u-tabs-box">
<u-tabs-swiper
:height="76"
:font-size="24"
active-color="#c20d12"
bg-color="transparent"
inactive-color="#999"
ref="tabs"
:list="tabs"
:current="swiperCurrent"
@change="change"
:is-scroll="false"
:offset="[5, 5]"
swiperWidth="750"
></u-tabs-swiper>
</view>
<swiper
class="swiper-box"
:current="swiperCurrent"
@transition="transition"
@animationfinish="animationfinish"
>
<swiper-item class="swiper-item"
v-for="(swiper, swiperIndex) in tabs"
:key="swiperIndex">
<scroll-view
scroll-y
style="height: 100%; width: 100%"
@scrolltolower="reachBottom"
>
<view>
<view class="order" v-for="i in list[swiperIndex]" :key="i.id">
<view class="title">
<view class="title__name">
<u-tag size="mini" type="primary" mode="dark" shape="circleLeft" :text="i.type === 1 ? '陪诊' : '陪护'"></u-tag>
<text style="padding-left: 10rpx;">专享半天陪诊</text>
</view>
<view class="title__status">{{ statusFormat(i.pay_status) }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon :name="i.cover ? i.cover.url : vuex_default_icon" size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">¥{{ i.accompany_product ? i.accompany_product.price : 0 }}</view>
<view class="price-text__no"
>订单号 {{ i.no }}</view
>
</view>
</view>
<view class="info"
@click.stop.native="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})">
<view class="info__item">
<text>就诊城市</text>
<text>{{ i.city || ((i.hospital && i.hospital.site) ? i.hospital.site.name : "") || " " }}</text>
</view>
<view class="info__item">
<text>就诊医院</text>
<text>{{ i.hospital ? i.hospital.name : '' }}</text>
</view>
<view class="info__item">
<text>就诊人</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view>
<view class="info__item">
<text>就诊时间</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
</view>
<view class="bottom">
<view class="row1">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple
shape="circle"
:custom-style="payBtnStyle"
:throttle-time="2000"
@click="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital ? i.hospital.site_id : ''
}
})"
>{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button
>
</view>
</view>
</view>
<u-loadmore
:status="loadStatus[swiperIndex]"
bgColor="#f2f2f2"
></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<view v-if="!token">
<u-empty :margin-top="360" text="未登录" mode="order">
<u-button shape="circle"
slot="bottom"
type="primary"
ripple
@click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</u-empty>
</view>
<Tabbar />
</view>
</template>
<script>
import Tabbar from "@/component/Tabbar/Tabbar.vue";
export default {
components: {
Tabbar,
},
data() {
return {
payBtnStyle: {
"background-image":
"linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
tabs: [
{
name: "全部",
value: "",
count: 0,
},
{
name: "待支付",
value: 0,
count: 0,
},
{
// name: '待评价',
name: "已支付",
value: 1,
count: 0,
},
{
name: "服务中",
value: 2,
count: 0,
},
{
name: "已完成",
value: 3,
count: 0,
},
// {
// name: '已取消'
// }
],
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
scrollTop: [],
loadStatus: [],
refresherStatus: [],
select: {
page: 1,
pay_status: "",
page_size: 10,
},
list: [],
};
},
onShow() {
if (this.token) {
this.getOrder(true);
}
},
created() {
for (let i = 0; i < this.tabs.length; i++) {
this.refresherStatus.push(false);
this.list.push([]);
this.loadStatus.push("loadmore");
}
},
computed: {
statusFormat() {
return function (status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
},
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
methods: {
reachBottom() {
// 此tab为空数据
this.getOrder()
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
},
transition({ detail: { dx } }) {
this.$refs.tabs.setDx(dx);
},
animationfinish({ detail: { current } }) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.select.pay_status = this.tabs[this.swiperCurrent].value;
this.getOrder(true)
},
async getOrder(isRefresh=false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
if (this.loadStatus[this.swiperCurrent] === 'nomore') return
try {
this.loadStatus[this.swiperCurrent] = 'loading'
const res = await this.$u.api.accompanyOrders(this.select);
console.log(res);
this.tabs[this.swiperCurrent].count = res.total;
if (isRefresh) {
this.list[this.swiperCurrent].length = 0;
}
this.list[this.swiperCurrent].push(...res.data)
if (this.list[this.swiperCurrent].length >= res.total) {
this.loadStatus[this.swiperCurrent] = 'nomore'
} else {
this.select.page++;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
},
},
};
</script>
<style>
page {
height: 100%;
background-color: #eee;
}
</style>
<style lang="scss" scoped>
::v-deep .u-load-more-wrap {
padding: 20rpx 0;
}
.d-flex {
display: flex;
}
.ai-center {
align-items: center;
}
.jc-center {
justify-content: center;
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top) - calc(60px + 6px));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.order {
margin: 0 25rpx;
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin-top: 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 24rpx;
color: #333333;
font-weight: bold;
}
&__status {
font-size: 24rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 24rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 24rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
& > text {
display: block;
}
& > text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
& > text:nth-child(2) {
}
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
.row1 {
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
}
</style>
<template>
<view>
<view class="wrap safe-area-inset-bottom" v-if="token">
<view class="u-tabs-box">
<u-tabs-swiper :height="76" :font-size="24" active-color="#c20d12" bg-color="transparent"
inactive-color="#999" ref="tabs" :list="tabs" :current="swiperCurrent" @change="change"
:is-scroll="false" :offset="[5, 5]" swiperWidth="750"></u-tabs-swiper>
</view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition"
@animationfinish="animationfinish">
<swiper-item class="swiper-item" v-for="(swiper, swiperIndex) in tabs" :key="swiperIndex">
<scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom">
<view>
<view class="order" v-for="i in list[swiperIndex]" :key="i.id">
<view class="title">
<view class="title__name">
<u-tag size="mini" type="primary" mode="dark" shape="circleLeft"
:text="i.type === 1 ? '陪诊' : '陪护'"></u-tag>
<text style="padding-left: 10rpx;">专享半天陪诊</text>
</view>
<view class="title__status">{{ statusFormat(i.pay_status) }}</view>
</view>
<view class="price">
<view class="price-icon">
<u-icon :name="i.cover ? i.cover.url : vuex_default_icon" size="30"></u-icon>
</view>
<view class="price-text">
<view class="price-text__num">
¥{{ i.accompany_product ? i.accompany_product.price : 0 }}</view>
<view class="price-text__no">订单号 {{ i.no }}</view>
</view>
</view>
<view class="info" @click.stop.native="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital.site_id
}
})">
<view class="info__item">
<text>就诊人</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view>
<view class="info__item">
<text>就诊城市</text>
<text>{{ i.city || ((i.hospital && i.hospital.site) ? i.hospital.site.name : "") || " " }}</text>
</view>
<view class="info__item flex100">
<text>就诊医院</text>
<text>{{ i.hospital ? i.hospital.name : '' }}</text>
</view>
<view class="info__item flex100">
<text>就诊时间</text>
<text>{{ i.time ? $moment(i.time).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
</view>
<view class="bottom">
<view class="row1">
<view class="time">
<text>下单时间: </text>
<text>{{ i.created_at ? $moment(i.created_at).format('YYYY年MM月DD日 HH:mm') : '' }}</text>
</view>
<u-button ripple shape="circle" :custom-style="payBtnStyle"
:throttle-time="2000" @click="$u.route({
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
order_id: i.id,
type: i.type,
site_id: i.hospital ? i.hospital.site_id : ''
}
})">{{ i.pay_status === 0 ? '立即支付' : '查看订单' }}</u-button>
</view>
</view>
</view>
<u-loadmore :status="loadStatus[swiperIndex]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view>
<view v-if="!token">
<u-empty :margin-top="360" text="未登录" mode="order">
<u-button shape="circle" slot="bottom" type="primary" ripple @click="$u.route({
url: '/pages/login/login',
type: 'redirect'
})">点击登录</u-button>
</u-empty>
</view>
<Tabbar />
</view>
</template>
<script>
import Tabbar from "@/component/Tabbar/Tabbar.vue";
export default {
components: {
Tabbar,
},
data() {
return {
payBtnStyle: {
"background-image": "linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%)",
"font-weight": "500",
"font-size": "28rpx",
color: "#fff",
width: "185rpx",
height: "60rpx",
"line-height": "60rpx",
},
tabs: [{
name: "全部",
value: "",
count: 0,
},
{
name: "待支付",
value: 0,
count: 0,
},
{
// name: '待评价',
name: "已支付",
value: 1,
count: 0,
},
{
name: "服务中",
value: 2,
count: 0,
},
{
name: "已完成",
value: 3,
count: 0,
},
// {
// name: '已取消'
// }
],
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
scrollTop: [],
loadStatus: [],
refresherStatus: [],
select: {
page: 1,
pay_status: "",
page_size: 10,
},
list: [],
};
},
onShow() {
if (this.token) {
this.getOrder(true);
}
},
created() {
for (let i = 0; i < this.tabs.length; i++) {
this.refresherStatus.push(false);
this.list.push([]);
this.loadStatus.push("loadmore");
}
},
computed: {
statusFormat() {
return function(status) {
return this.vuex_order_status.find(i => i.value === status)?.name
}
},
token() {
return this.vuex_token || uni.getStorageSync('lifeData')?.vuex_token
}
},
methods: {
reachBottom() {
// 此tab为空数据
this.getOrder()
},
// tab栏切换
change(index) {
this.swiperCurrent = index;
},
transition({
detail: {
dx
}
}) {
this.$refs.tabs.setDx(dx);
},
animationfinish({
detail: {
current
}
}) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.select.pay_status = this.tabs[this.swiperCurrent].value;
this.getOrder(true)
},
async getOrder(isRefresh = false) {
if (isRefresh) {
this.select.page = 1;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
if (this.loadStatus[this.swiperCurrent] === 'nomore') return
try {
this.loadStatus[this.swiperCurrent] = 'loading'
const res = await this.$u.api.accompanyOrders(this.select);
console.log(res);
this.tabs[this.swiperCurrent].count = res.total;
if (isRefresh) {
this.list[this.swiperCurrent].length = 0;
}
this.list[this.swiperCurrent].push(...res.data)
if (this.list[this.swiperCurrent].length >= res.total) {
this.loadStatus[this.swiperCurrent] = 'nomore'
} else {
this.select.page++;
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
},
},
};
</script>
<style>
page {
height: 100%;
background-color: #eee;
}
</style>
<style lang="scss" scoped>
::v-deep .u-load-more-wrap {
padding: 20rpx 0;
}
::v-deep .u-load-more-wrap {
background-color: #eee !important;
.u-line-1 {
background-color: #eee !important;
}
}
.d-flex {
display: flex;
}
.ai-center {
align-items: center;
}
.jc-center {
justify-content: center;
}
.wrap {
display: flex;
flex-direction: column;
height: calc(100vh - var(--window-top) - calc(60px + 6px));
width: 100%;
}
.swiper-box {
flex: 1;
}
.swiper-item {
height: 100%;
}
.order {
margin: 0 25rpx;
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin-top: 24rpx;
.title {
display: flex;
align-items: center;
padding: 37rpx 39rpx 32rpx 45rpx;
position: relative;
&__name {
font-size: 26rpx;
color: #333333;
font-weight: bold;
::v-deep .u-tag {
font-size: 26rpx;
}
}
&__status {
font-size: 26rpx;
color: #c20d12;
font-weight: 500;
margin-left: auto;
}
&::after {
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
position: absolute;
bottom: 0;
left: 39rpx;
right: 39rpx;
}
}
.price {
display: flex;
align-items: center;
padding: 28rpx 0 0 44rpx;
&-icon {
display: flex;
justify-content: center;
align-items: center;
width: 90rpx;
height: 84rpx;
border-radius: 10rpx;
background-color: #f3e7d8;
}
&-text {
padding-left: 28rpx;
&__num {
font-size: 30rpx;
color: #000000;
font-weight: bold;
}
&__no {
font-size: 24rpx;
color: #999999;
font-weight: 500;
padding-top: 14rpx;
}
}
}
.info {
display: flex;
flex-wrap: wrap;
padding: 35rpx 45rpx 0;
&__item {
flex-basis: 50%;
color: #333;
font-size: 26rpx;
font-weight: 500;
display: flex;
margin-bottom: 32rpx;
&>text {
display: block;
}
&>text:nth-child(1) {
color: #999;
padding-right: 20rpx;
flex: 0;
word-break: keep-all;
}
&>text:nth-child(2) {}
}
.flex100 {
flex-basis: 100%;
}
}
.bottom {
padding: 6rpx 28rpx 35rpx 43rpx;
.row1 {
display: flex;
align-items: center;
justify-content: space-between;
.time {
font-size: 24rpx;
color: #999999;
font-weight: 500;
}
}
}
}
</style>
Loading…
Cancel
Save