|
@@ -2,6 +2,12 @@
|
|
|
<!-- 包月 -->
|
|
|
<view class="monthly">
|
|
|
<z-paging class="paging" ref="paging" v-model="dataList" @query="queryList">
|
|
|
+ <!-- 选项卡 -->
|
|
|
+ <view class="monthly-tab" slot="top">
|
|
|
+ <u-tabs :list="tabList" :is-scroll="false" :current="current" @change="tabChange" bg-color="#fff"
|
|
|
+ inactive-color="#000000" active-color="#008CFF" :bold="false"
|
|
|
+ :active-item-style="{color: '#008CFF'}"></u-tabs>
|
|
|
+ </view>
|
|
|
<view class="monthly-list">
|
|
|
<view class="monthly-list-item" v-for="(monthlyItem, index) in dataList" :key="monthlyItem.id">
|
|
|
<view class="monthly-list-item-top">
|
|
@@ -52,6 +58,15 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ tabList: [{
|
|
|
+ name: '路段',
|
|
|
+ value: 'road'
|
|
|
+ }, {
|
|
|
+ name: '停车场',
|
|
|
+ value: 'park'
|
|
|
+ }],
|
|
|
+ current: 0,
|
|
|
+ currentValue: 'road',
|
|
|
id: '', // 当前选中的条目id
|
|
|
cancelShow: false,
|
|
|
dataList: [],
|
|
@@ -60,6 +75,12 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //tabs通知swiper切换
|
|
|
+ tabChange(index) {
|
|
|
+ this.current = index;
|
|
|
+ this.currentValue = this.tabList[index].value
|
|
|
+ this.$refs.paging.reload()
|
|
|
+ },
|
|
|
customBack() {
|
|
|
this.$u.route({
|
|
|
type: 'switchTab',
|
|
@@ -68,7 +89,11 @@
|
|
|
},
|
|
|
// 下拉刷新操作
|
|
|
queryList(pageNo, pageSize) {
|
|
|
- this.$u.api.getMonthList({
|
|
|
+ const tabObj = {
|
|
|
+ road: 'getMonthList',
|
|
|
+ park: 'getParkMonthList'
|
|
|
+ }
|
|
|
+ this.$u.api[tabObj[this.currentValue]]({
|
|
|
pageSize: pageSize,
|
|
|
pageNum: pageNo,
|
|
|
})
|
|
@@ -84,6 +109,7 @@
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
// 取消订单
|
|
|
cancelMonth(monthId) {
|