master
xy 1 year ago
parent c6d13af29b
commit 23f1ff37d4

@ -1,4 +1,3 @@
//api集合
let apiApp = {
// 用户
@ -8,7 +7,7 @@ let apiApp = {
getMobile: '/api/mobile/user/mobile',
// 用户订单
accompanyOrders: '/api/mobile/user/accompany-orders',
accompanyOrdersDetail: '/api/mobile/user/accompany-orders-detail',
accompanyOrdersDetail: '/api/mobile/user/accompany-orders-detail',
// 医院 陪护下单
listHospital: '/api/mobile/hospital/hospital',
detailHospital: '/api/mobile/hospital/hospital-detail',
@ -39,12 +38,14 @@ let apiApp = {
userAddressShow: '/api/mobile/user-address/show',
userAddressSave: '/api/mobile/user-address/save',
userAddressDestroy: '/api/mobile/user-address/destroy',
// 用户商城订单
userOrders: '/api/mobile/user/orders',
// 用户商城订单
userOrders: '/api/mobile/user/orders',
userOrdersDetail: '/api/mobile/user/orders-detail',
hospital: '/api/mobile/hospital/hospital',
banner: '/api/mobile/other/banner',
}
// 此处第二个参数vm就是我们在页面使用的this你可以通过vm获取vuex等操作
@ -83,41 +84,47 @@ const install = (Vue, vm) => {
const productList = (params = {}) => vm.$u.get(apiApp.productList, params)
const productDetail = (params = {}) => vm.$u.get(apiApp.productDetail, params)
const productOrder = (params = {}) => vm.$u.get(apiApp.productOrder, params)
const productPay = (params = {}) => vm.$u.get(apiApp.productPay, params)
// 收货地址
const userAddress = (params = {}) => vm.$u.get(apiApp.userAddress, params)
const userAddressShow = (params = {}) => vm.$u.get(apiApp.userAddressShow, params)
const userAddressSave = (params = {}) => vm.$u.post(apiApp.userAddressSave, params)
const userAddressDestroy = (params = {}) => vm.$u.get(apiApp.userAddressDestroy, params)
// 用户商城订单
const userOrders = (params = {}) => vm.$u.get(apiApp.userOrders, params)
const userOrdersDetail = (params = {}) => vm.$u.get(apiApp.userOrdersDetail, params)
const productPay = (params = {}) => vm.$u.get(apiApp.productPay, params)
// 收货地址
const userAddress = (params = {}) => vm.$u.get(apiApp.userAddress, params)
const userAddressShow = (params = {}) => vm.$u.get(apiApp.userAddressShow, params)
const userAddressSave = (params = {}) => vm.$u.post(apiApp.userAddressSave, params)
const userAddressDestroy = (params = {}) => vm.$u.get(apiApp.userAddressDestroy, params)
// 用户商城订单
const userOrders = (params = {}) => vm.$u.get(apiApp.userOrders, params)
const userOrdersDetail = (params = {}) => vm.$u.get(apiApp.userOrdersDetail, params)
const hospitalList = (params = {}) => vm.$u.get(apiApp.hospital, params)
const banner = (params = {}) => vm.$u.get(apiApp.banner, params)
// end
vm.$u.api = {
vm.$u.api = {
hospitalList,
banner,
// 用户
login,getUserInfo,updateUser,getMobile,
//用户订单
login,
getUserInfo,
updateUser,
getMobile,
//用户订单
accompanyOrders,accompanyOrdersDetail,
// 医院 陪护下单
listHospital,detailHospital,accompanyProduct,accompanyProductDetail,accompanyProductOrder,accompanyPay,
// 服务对象
userArchive,userArchiveShow,userArchiveSave,userArchiveDestroy,
// 服务对象
userArchive,userArchiveShow,userArchiveSave,userArchiveDestroy,
// other
otherBanner,otherSite,otherArticleType,otherArticle,otherArticleDetail,otherUpload,
// 商城
productCategory,productList,productDetail,productOrder,productPay,
// 收货地址
userAddress,userAddressShow,userAddressSave,userAddressDestroy,
// 用户商城订单
userOrders,userOrdersDetail,
otherBanner,otherSite,otherArticleType,otherArticle,otherArticleDetail,otherUpload,
// 商城
productCategory,productList,productDetail,productOrder,productPay,
// 收货地址
userAddress,userAddressShow,userAddressSave,userAddressDestroy,
// 用户商城订单
userOrders,userOrdersDetail,
};
}
export default {
install
}
}

@ -20,7 +20,6 @@ const install = (Vue, vm) => {
// 请求拦截部分,如配置,每次请求前都会执行
Vue.prototype.$u.http.interceptor.request = (config) => {
console.log('config-http', config)
// 引用token
let token = vm.vuex_token ? vm.vuex_token : uni.getStorageSync('lifeData')?.vuex_token;
if (token) {
@ -31,7 +30,6 @@ const install = (Vue, vm) => {
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
console.log('res-http',res)
if (res.statusCode === 200) {
if (res.data.hasOwnProperty("errcode")) {
if (res.data.errcode === 40001) {

File diff suppressed because it is too large Load Diff

@ -1,14 +1,14 @@
<template>
<view class="page safe-area-inset-bottom">
<!-- <image class="bkg" src="~@/package_sub/static/ServiceDetail/bkg.png" mode="aspectFill"></image> -->
<view class="bkg">
<u-swiper :height="316" img-mode="scaleToFill" mode="none" border-radius="0" :list="info.images" name="url"></u-swiper>
</view>
<view class="bkg">
<u-swiper :height="316" img-mode="scaleToFill" mode="none" border-radius="0" :list="info.images" name="url"></u-swiper>
</view>
<view class="container">
<view class="card detail">
<view class="detail__text">
{{info.introduce}}
{{info.introduce || ' '}}
</view>
<view class="detail__price">
<text class="detail__price--number">{{info.price}}</text>
@ -127,16 +127,16 @@
async getDetail(id) {
await this.$u.api.accompanyProductDetail({
id: id
}).then(res=>{
console.log("res", res)
this.info = res
}).then(res=>{
console.log("res", res)
this.info = res
})
},
toOrder(info) {
this.$u.route({
url: '/package_sub/pages/AddOrder/AddOrder?id='+info.id+'&site_id='+info.site_id+'&type='+info.type
})
},
toOrder(info) {
this.$u.route({
url: '/package_sub/pages/AddOrder/AddOrder?id='+info.id+'&site_id='+info.site_id+'&type='+info.type
})
},
}
}
@ -469,4 +469,4 @@
}
}
}
</style>
</style>

@ -67,7 +67,7 @@
'width': '130rpx',
'height': '60rpx',
'line-height': '60rpx'
},
},
last_page:1,
select: {
page: 1,
@ -105,32 +105,37 @@
async getList() {
const res = await this.$u.api.accompanyProduct({
...this.select
})
this.last_page = res.last_page
})
this.last_page = res.last_page
this.loadStatus = this.select.page >= this.last_page ?'nomore':'loadmore'
this.list.push(...res.data)
this.list.push(...res.data)
console.log(this.select.page,this.last_page)
},
reachBottom() {
if (this.select.page > this.last_page) {
this.loadStatus = 'nomore'
return
}
this.loadStatus = 'loading'
this.select.page++
this.getList()
},
reachBottom() {
if (this.select.page > this.last_page) {
this.loadStatus = 'nomore'
return
}
this.loadStatus = 'loading'
this.select.page++
this.getList()
},
confirmSite(e) {
this.select.site_name = e[0].label
this.select.site_id = e[0].value
this.list = []
this.list = []
this.select.page = 1
this.getList()
},
toOrder(item) {
this.$u.route({
url: '/package_sub/pages/AddOrder/AddOrder?id=' + item.id + '&title=' + item.name +
'&site_id=' + item.site_id + '&type=' + item.type
url: '/package_sub/pages/AddOrder/AddOrder',
params: {
id: item.id,
title: item.name,
site_id: item.site_id,
type: item.type
}
})
},
toDetail(item) {
@ -253,4 +258,4 @@
}
}
}
</style>
</style>

@ -8,9 +8,12 @@
alt=""
></image>
<view class="top" :style="{ 'padding-right': menuButtonRight + 'px' }">
<view class="position" @click="$u.route({ url: '/pages/CitySelect/CitySelect' })">
<view
class="position"
@click="$u.route({ url: '/pages/CitySelect/CitySelect' })"
>
<u-icon name="map-fill"></u-icon>
<view>{{ vuex_location.city.replace(/(市|区|县)/,'') }}</view>
<view>{{ vuex_location.city.replace(/(市|区|县)/, "") }}</view>
<u-icon name="arrow-down" size="22"></u-icon>
</view>
<view class="icon">
@ -34,28 +37,35 @@
</view>
</view>
<view v-if="isShowSticky" class="search-sticky" :style="{ 'padding-top': statusBarHeight + 'px','padding-right': menuButtonRight + 'px' }">
<view class="search-sticky__position" @click="isShowCity = true">
<view
v-if="isShowSticky"
class="search-sticky"
:style="{
'padding-top': statusBarHeight + 'px',
'padding-right': menuButtonRight + 'px',
}"
>
<view class="search-sticky__position" @click="$u.route({ url: '/pages/CitySelect/CitySelect' })">
<u-icon name="map-fill"></u-icon>
<view>{{ vuex_location.city.replace(/(市|区|县)/,'') }}</view>
<view>{{ vuex_location.city.replace(/(市|区|县)/, "") }}</view>
<u-icon name="arrow-down" size="22"></u-icon>
</view>
<view class="search-sticky__search">
<view class="search-sticky__search--content">
<u-input
:clearable="false"
:value="select.keyword"
placeholder="请输入要搜索的内容"
height="46"
@input="searchInput"
:clearable="false"
:value="select.keyword"
placeholder="请输入要搜索的内容"
height="46"
@input="searchInput"
></u-input>
</view>
</view>
</view>
<view class="swiper">
<u-swiper :list="list" name="url"></u-swiper>
<u-swiper :list="banners" name="url"></u-swiper>
</view>
<view class="links">
@ -64,9 +74,13 @@
v-for="item in links"
:key="item.text"
bg-color="transparent"
@click="$u.throttle($u.route({
url: item.to
}))"
@click="
$u.throttle(
$u.route({
url: item.to,
})
)
"
>
<image class="icon" :src="item.icon" mode="aspectFit"></image>
<view class="text">{{ item.text }}</view>
@ -75,17 +89,25 @@
</view>
<view class="img1">
<image src="~@/static/index/ask-png.png" alt="" mode="aspectFit"></image>
<image
src="~@/static/index/ask-png.png"
alt=""
mode="aspectFit"
></image>
</view>
<view class="hospitals">
<view class="hospitals__title">热门医院</view>
<view class="hospitals__content">
<view class="hospitals__content__item" v-for="(item,index) in list_hospital" :key="index">
<view
class="hospitals__content__item"
v-for="(item, index) in hospitals"
:key="item.id"
>
<view class="left">
<image
:src="item.cover?item.cover.url:''"
:src="item.cover ? item.cover.url : ''"
alt=""
mode="scaleToFill"
></image>
@ -96,55 +118,89 @@
<view class="tag__item">{{ item.good_at }}</view>
<view class="tag__item">综合医院</view>
</view>
<view class="description"> {{item.good_at}} </view>
<view class="description"> {{ item.good_at }} </view>
</view>
</view>
</view>
</view>
<view class="statistics">
<view class="block1" @click="toPage('/package_sub/pages/ServiceList/ServiceList?type=1')">
<view
class="block1"
@click="toPage('/package_sub/pages/ServiceList/ServiceList?type=1')"
>
<view class="text1">陪诊团队介绍</view>
<view class="text2">让就医体验更美好</view>
<view class="order">预约陪诊</view>
<image class="img" src="~@/static/index/block1.png" mode="aspectFit" alt=""></image>
<image
class="img"
src="~@/static/index/block1.png"
mode="aspectFit"
alt=""
></image>
</view>
<view class="block2">
<view class="text1">
<text>142812</text><text>人次</text>
</view>
<view class="text1"> <text>142812</text><text>人次</text> </view>
<view class="text2">医院陪护累计</view>
<image class="img" src="~@/static/index/block2.png" mode="aspectFit" alt=""></image>
<image
class="img"
src="~@/static/index/block2.png"
mode="aspectFit"
alt=""
></image>
</view>
<view class="block3">
<view class="text1">
<text>12456</text><text>人次</text>
</view>
<view class="text1"> <text>12456</text><text>人次</text> </view>
<view class="text2">居家照护累计</view>
<image class="img" src="~@/static/index/block3.png" mode="aspectFit" alt=""></image>
<image
class="img"
src="~@/static/index/block3.png"
mode="aspectFit"
alt=""
></image>
</view>
<view class="block4">
<view class="text1">关于我们</view>
<image class="img" src="~@/static/index/block4.png" mode="aspectFit" alt=""></image>
<image
class="img"
src="~@/static/index/block4.png"
mode="aspectFit"
alt=""
></image>
</view>
</view>
<view class="honor">
<view class="honor__title">
<image src="~@/static/index/honor-title.png" alt="" mode="aspectFit"></image>
<image
src="~@/static/index/honor-title.png"
alt=""
mode="aspectFit"
></image>
<text>资质荣誉</text>
</view>
<scroll-view class="scroll-content" scroll-x="true">
<image class="images" v-for="i in 5" :key="i" src="https://sstt.115.langye.net/storage/files/172760356266f9236a22e58.png" mode="aspectFit"></image>
<image
class="images"
v-for="i in 5"
:key="i"
src="https://sstt.115.langye.net/storage/files/172760356266f9236a22e58.png"
mode="aspectFit"
></image>
</scroll-view>
</view>
<image class="bottom" src="~@/static/index/bottom.png" mode="aspectFit" alt=""></image>
<image
class="bottom"
src="~@/static/index/bottom.png"
mode="aspectFit"
alt=""
></image>
</view>
<u-top-tips :navbar-height="navbarHeight" ref="uTips"></u-top-tips>
@ -161,7 +217,7 @@ import PrivacyPopup from "@/component/privacy-popup/privacy-popup.vue";
export default {
components: {
Tabbar,
PrivacyPopup
PrivacyPopup,
},
data() {
return {
@ -178,13 +234,11 @@ export default {
select: {
keyword: "",
},
list: [],
list_hospital:[],
links: [
{
text: "陪诊服务",
icon: "/static/index/peizhenfuwu.png",
to: "/package_sub/pages/ServiceList/ServiceList?type=1"
to: "/package_sub/pages/ServiceList/ServiceList?type=1",
},
{
text: "就医服务",
@ -193,7 +247,7 @@ export default {
{
text: "居家照护",
icon: "/static/index/jujiazhaohu.png",
to: "/package_sub/pages/ServiceList/ServiceList?type=2"
to: "/package_sub/pages/ServiceList/ServiceList?type=2",
},
{
text: "医院陪护",
@ -210,9 +264,9 @@ export default {
};
},
mounted() {
this.getElScrollTop()
this.getElScrollTop();
if (this.$store.state.vuex_location.status !== 2) {
this.$store.dispatch('getLocation')
this.$store.dispatch("getLocation");
}
},
created() {
@ -222,74 +276,52 @@ export default {
10;
this.statusBarHeight = uni.getMenuButtonBoundingClientRect().top;
this.getHospital()
this.getBanner()
this.getHospital();
this.getBanner();
},
onPageScroll(e) {
this.isShowSticky = e.scrollTop > this.scrollTop
},
onLoad() {
this.getBanners()
this.getHospital()
this.isShowSticky = e.scrollTop > this.scrollTop;
},
computed: {
navbarHeight() {
return getApp().globalData.navbarHeight
}
return getApp().globalData.navbarHeight;
},
},
methods: {
getElScrollTop () {
const query = uni.createSelectorQuery().in(this)
query.select('.links').boundingClientRect(data => {
if (data) {
this.scrollTop = data.top
}
}).exec()
getElScrollTop() {
const query = uni.createSelectorQuery().in(this);
query
.select(".links")
.boundingClientRect((data) => {
if (data) {
this.scrollTop = data.top;
}
})
.exec();
},
async getBanners(){
const res = await this.$u.api.otherBanner({
position:1
})
res.map(item=>{
item.url = item.image.url
})
this.list = res
},
async getHospital(){
const res = await this.$u.api.listHospital({
page:1,
page_size:3
})
this.list_hospital = res.data
},
searchInput(e) {},
async getHospital() {
try {
const res = await this.$u.api.hospitalList({
page: 1,
page_size: 10,
'show_relation[0]': 'site'
})
this.hospitals = res.data
} catch (err) {
}
page_size: 5,
"show_relation[0]": "site",
});
this.hospitals = res.data;
} catch (err) {}
},
async getBanner() {
try {
const res = await this.$u.api.banner({
position: 1
})
this.banners = res.map(i => ({
position: 1,
});
this.banners = res.map((i) => ({
...i,
url: i.image?.url
}))
} catch (err) {
}
}
url: i.image?.url,
}));
} catch (err) {}
},
},
};
</script>
@ -377,7 +409,7 @@ export default {
top: 0;
width: 100vw;
padding-bottom: 20rpx;
animation: fade .4s;
animation: fade 0.4s;
filter: drop-shadow(0 2rpx 6rpx #c20d1266);
@keyframes fade {
from {
@ -542,7 +574,12 @@ export default {
}
}
.block1 {
background: linear-gradient(-90deg, #e26165 0%, #c10d12 94%, #c10d12 100%);
background: linear-gradient(
-90deg,
#e26165 0%,
#c10d12 94%,
#c10d12 100%
);
position: relative;
.text1 {

@ -16,7 +16,10 @@
:custom-style="mobileBtnStyle"
open-type="getPhoneNumber"
@getphonenumber="mobileLogin">手机登录</u-button>
<u-button ripple :hair-line="false" :custom-style="authBtnStyle" @click="authLogin"></u-button>
<u-button ripple
:hair-line="false"
:custom-style="authBtnStyle"
@click="authLogin">一件授权登录</u-button>
</view>
<view class="auth">
<u-checkbox v-model="isAuth" shape="circle" active-color="#c20d12">
@ -67,7 +70,7 @@ export default {
}
},
methods: {
authLogin() {
authLogin(e) {
if (!this.isAuth) {
this.$refs.uToast.show({
title: '请先阅读协议',
@ -84,7 +87,7 @@ export default {
code: loginRes.code
})
this.$u.vuex('vuex_token', token)
const {user} = await this.$u.api.getUserInfo()
const { user } = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
this.$u.route({
type: 'switchTab',

@ -3,7 +3,7 @@
<image class="bkg" mode="aspectFill" src="~@/static/me/bkg.png"></image>
<view class="top">
<image class="avatar" mode="aspectFit" :src="vuex_user.headimgurl"></image>
<image class="avatar" mode="aspectFit" :src="vuex_user.headimgurl || vuex_default_icon"></image>
<view class="info">
<view class="info-name">{{ vuex_user.nickname || '微信用户' }}</view>
@ -18,10 +18,22 @@
</view>
</view>
<view class="panel panel2">
<view class="row" v-for="i in 4">
<image class="row__icon" mode="aspectFit" src="~@/static/index/block1.png"></image>
<view class="row" @click="share">
<u-icon class="row__icon" name="share"></u-icon>
<view>我要分享</view>
</view>
<view class="row">
<u-icon class="row__icon" name="man-add"></u-icon>
<view>加入我们</view>
</view>
<view class="row">
<u-icon class="row__icon" name="heart"></u-icon>
<view>关注</view>
</view>
<view class="row">
<u-icon class="row__icon" name="kefu-ermai"></u-icon>
<view>联系我们</view>
</view>
</view>
<tabbar />
</view>
@ -35,8 +47,13 @@ export default {
Tabbar
},
data() {
return {};
}
return {
};
},
methods: {
},
onLoad() {
},
}
</script>
@ -62,12 +79,13 @@ export default {
padding: 4vh 25rpx 0;
.avatar {
width: 100rpx;
height: 100rpx;
width: 80rpx;
height: 80rpx;
border-radius: 100%;
background: #fff;
padding: 10rpx;
padding: 20rpx;
object-fit: cover;
filter: drop-shadow(4rpx 6rpx 10rpx #ba534c);
}
.info {
padding-left: 40rpx;
@ -107,12 +125,12 @@ export default {
.row {
display: flex;
padding: 20rpx 10rpx;
border-bottom: 2rpx #aaa solid;
border-bottom: 2rpx #dee2e6 solid;
&__icon {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
color: $uni-color-primary;
font-size: 36rpx;
}
}
}

@ -2,31 +2,43 @@
<view>
<view class="wrap safe-area-inset-bottom">
<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="current"
@change="change"
:is-scroll="false"
:offset="[5,5]"
swiperWidth="750"></u-tabs-swiper>
<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">
<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
refresher-enabled
scroll-y
style="height: 100%;width: 100%;"
@scrolltolower="reachBottom">
scroll-y
style="height: 100%; width: 100%"
@scrolltolower="reachBottom"
>
<view>
<view class="order" v-for="i in 10" :key="i">
<view class="order" v-for="i in list[swiperIndex]" :key="i.id">
<view class="title">
<view class="title__name">专享半天陪诊</view>
<view class="title__status">待支付</view>
<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">
@ -35,76 +47,61 @@
</view>
<view class="price-text">
<view class="price-text__num">600</view>
<view class="price-text__no">订单号 PZ2024111855448048</view>
<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">
<view class="info__item">
<text>就诊城市</text>
<text>苏州</text>
<text>{{ i.city || ((i.hospital && i.hospital.site) ? i.hospital.site.name : "") || " " }}</text>
</view>
<view class="info__item">
<text>就诊医院</text>
<text>苏大附属</text>
<text>{{ i.hospital ? i.hospital.name : '' }}</text>
</view>
<view class="info__item">
<text>就诊人</text>
<text>萍萍</text>
<text>{{ i.user_archive ? i.user_archive.name : i.user_archive_id }}</text>
</view>
<view class="info__item">
<text>就诊时间</text>
<text>2024-12-18 17:00</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>2024-11-18 17:48:47</text>
<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">立即支付</u-button>
<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[0]" bgColor="#f2f2f2"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
<view style="height: 100%;" class="d-flex ai-center jc-center">
<u-empty mode="order"></u-empty>
<u-loadmore
:status="loadStatus[swiperIndex]"
bgColor="#f2f2f2"
></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom">
</scroll-view>
</swiper-item>
</swiper>
</view>
<Tabbar />
@ -112,76 +109,89 @@
</template>
<script>
import Tabbar from '@/component/Tabbar/Tabbar.vue'
import Tabbar from "@/component/Tabbar/Tabbar.vue";
export default {
components: {
Tabbar
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'
"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: '全部',
id:''
name: "全部",
value: "",
count: 0,
},
{
name: '待支付',
id:0
name: "待支付",
value: 0,
count: 0,
},
{
// name: '',
name: '已支付',
id:1
name: "已支付",
value: 1,
count: 0,
},
{
name: '服务中',
id:2,
count: 12
name: "服务中",
value: 2,
count: 0,
},
{
name: '已完成',
id:3
name: "已完成",
value: 3,
count: 0,
},
// {
// name: ''
// }
],
current: 0,
swiperCurrent: 0,
tabsHeight: 0,
dx: 0,
scrollTop: [],
loadStatus: [],
refresherStatus: [],
select: {
page: 1,
pay_status: "",
page_size: 20,
},
list: [],
};
},
onLoad() {
onShow() {
this.getOrder(true);
},
created() {
for(let i = 0;i < this.tabs.length;i++) {
this.refresherStatus.push(false)
this.loadStatus.push('loadmore')
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.tabs.find(i => i.value === status)?.name
}
}
},
methods: {
reachBottom() {
// tab
this.loadStatus.splice(this.current,1,"loading")
setTimeout(() => {
this.loadStatus.splice(this.current,1,"nomore")
}, 2000)
this.getOrder()
},
// tab
change(index) {
@ -193,14 +203,35 @@ export default {
animationfinish({ detail: { current } }) {
this.$refs.tabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
this.select.pay_status = this.tabs[this.swiperCurrent].value;
this.getOrder(true)
},
async getOrder(){
const res = await this.$u.api.accompanyOrders({
pay_status:1
})
},
}
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.loadStatus[this.swiperCurrent] = 'loadmore'
}
} catch (err) {
console.error(err);
this.loadStatus[this.swiperCurrent] = 'loadmore'
}
},
},
};
</script>
@ -239,7 +270,7 @@ page {
.order {
margin: 0 25rpx;
border-radius: 10rpx;
filter: drop-shadow(0 0 10rpx rgba(211,211,214,0.3));
filter: drop-shadow(0 0 10rpx rgba(211, 211, 214, 0.3));
background-color: #ffffff;
margin-top: 24rpx;
@ -261,7 +292,7 @@ page {
margin-left: auto;
}
&::after {
content: '';
content: "";
height: 2rpx;
background: #999999;
opacity: 0.302;
@ -318,7 +349,6 @@ page {
& > text {
display: block;
}
& > text:nth-child(1) {
color: #999;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -34,6 +34,7 @@ const store = new Vuex.Store({
// 加上vuex_前缀是防止变量名冲突也让人一目了然
// 如果vuex_version无需保存到本地永久存储无需lifeData.vuex_version方式
vuex_version: '1.0.0',
vuex_default_icon: '/static/logo-mini.png',
vuex_token: '',
vuex_user: {},

Loading…
Cancel
Save