<template>
|
<view>
|
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
<u-navbar title="我购买的服务" safeAreaInsetTop fixed placeholder>
|
<view class="coreshop-navbar-left-slot" slot="left">
|
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
|
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
<u-icon name="home" size="22" @click="goHome"></u-icon>
|
</view>
|
<view slot="right">
|
</view>
|
</u-navbar>
|
<view>
|
<view class="page-box" v-if="list.length > 0">
|
<view class="orderList" v-for="(item, index) in list" :key="index">
|
<view class="coreshop-flex coreshop-justify-between" @click="goServicesUserDetail(item.serviceOrderId)">
|
<view class="coreshop-flex coreshop-align-center">
|
<u-icon name="order" :size="20" color="rgb(94,94,94)"></u-icon>
|
<view class="store">订单号 : {{item.serviceOrderId}}</view>
|
</view>
|
<view>{{ item.statusStr }}</view>
|
</view>
|
<view class="item">
|
<view class="left">
|
<u--image :showLoading="true" :src="item.service.thumbnail" width="80px" height="80px" mode="aspectFill"></u--image>
|
</view>
|
<view class="content">
|
<view class="title u-line-2">{{item.service.title}}</view>
|
<view class="type">{{item.service.description}}</view>
|
<view class="delivery-time">下单时间:{{ $u.timeFormat(item.payTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
|
</view>
|
</view>
|
<view class="bottom">
|
<view class="more">
|
<u-tag :text="item.statusStr" mode="light" />
|
</view>
|
|
<view class="coreshop-flex">
|
<view class='coreshop-btn exchange' @click="goServicesUserDetail(item.serviceOrderId)">查看详情</view>
|
</view>
|
</view>
|
</view>
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
|
</view>
|
<!-- 无数据时默认显示 -->
|
<view class="coreshop-emptybox" v-else>
|
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无购买的服务" mode="list"></u-empty>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
|
export default {
|
|
computed: {
|
},
|
data() {
|
return {
|
page: 1,
|
limit: 10,
|
list: [],
|
status: 'loadmore',
|
iconType: 'flower',
|
loadText: {
|
loadmore: '轻轻上拉',
|
loading: '努力加载中',
|
nomore: '实在没有了'
|
}
|
};
|
},
|
onLoad() {
|
this.getUserServicesPageList()
|
},
|
onShow() {
|
},
|
onReachBottom() {
|
if (this.status === 'loadmore') {
|
this.getUserServicesPageList()
|
}
|
},
|
methods: {
|
getUserServicesPageList() {
|
let _this = this;
|
let data = {
|
page: this.page,
|
limit: this.limit
|
}
|
this.status = 'loading'
|
|
this.$u.api.getUserServicesPageList(data).then(res => {
|
if (res.status) {
|
|
let _list = res.data.list
|
this.list = [...this.list, ..._list]
|
|
if (res.data.count > _this.list.length) {
|
_this.page++
|
_this.status = 'loadmore'
|
} else {
|
_this.status = 'nomore'
|
}
|
} else {
|
_this.$u.toast(res.msg)
|
}
|
})
|
},
|
}
|
};
|
</script>
|
|
<style lang="scss">
|
</style>
|