|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <navigation-bar title="一级市场" background-color="#fff" front-color="#000000" :left-button="null" />
|
|
|
- <u-list class="list" width="100%" @scrolltolower="scrolltolower">
|
|
|
+ <navigation-bar :title="title" background-color="#fff" front-color="#000000" :left-button="null" />
|
|
|
+ <u-list v-if="active==1" class="list" width="100%" @scrolltolower="scrolltolower">
|
|
|
<u-list-item v-for="(item, index) in goods" :key="index">
|
|
|
<view class="card" @click="toDetails(item.id)">
|
|
|
<view class="card-body">
|
|
@@ -15,13 +15,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-list-item>
|
|
|
- <!-- <u-loadmore v-if="goods" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore"
|
|
|
- margin-bottom="50" /> -->
|
|
|
</u-list>
|
|
|
- <view style="padding: 20px; display: flex;">
|
|
|
- <u-button type="primary" text="市场"></u-button>
|
|
|
- <u-button type="primary" text="购物车"></u-button>
|
|
|
- <u-button type="primary" text="订单列表" @click="swiTap"></u-button>
|
|
|
+ <order v-if="active==3"></order>
|
|
|
+ <view class="tab">
|
|
|
+ <view :class="active==item.id ? 'active-btn' : 'tabBtn'" v-for="item in tabList" :key="item.id" @click="tabClick(item.id)">{{item.name}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -33,11 +30,25 @@
|
|
|
loadmoreStatus: 'loadmore',
|
|
|
goods: [],
|
|
|
active: 1,
|
|
|
+ title: '一级市场',
|
|
|
+ tabList: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: "市场"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ name: "购物车"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ name: "订单列表"
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.getGoodsList()
|
|
|
- // this.loadmore()
|
|
|
},
|
|
|
// onShow() {
|
|
|
// var a = document.getElementsByClassName('uni-page-head-hd')[0]
|
|
@@ -65,10 +76,19 @@
|
|
|
toDetails(id) {
|
|
|
this.$common.to('/pages/goodsDetails/goodsDetails?id=' + id)
|
|
|
},
|
|
|
- swiTap() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/order/order'
|
|
|
- })
|
|
|
+ change(index) {
|
|
|
+ console.log(index)
|
|
|
+ this.active = index
|
|
|
+ },
|
|
|
+ tabClick(id) {
|
|
|
+ this.active = id
|
|
|
+ if(id==1) {
|
|
|
+ this.title='一级市场'
|
|
|
+ }else if(id==2) {
|
|
|
+ this.title='购物车'
|
|
|
+ } else{
|
|
|
+ this.title='订单列表'
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -112,4 +132,34 @@
|
|
|
top: 50rpx;
|
|
|
/* left: 5rpx; */
|
|
|
}
|
|
|
+
|
|
|
+ .tab{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 1rpx;
|
|
|
+ width: 100%;
|
|
|
+ height: 100rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-top: #CFCFCF 1rpx solid;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabBtn{
|
|
|
+ width: 35%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin: 0 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .active-btn{
|
|
|
+ width: 35%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #fff;
|
|
|
+ background-color: #00BFFF;
|
|
|
+ }
|
|
|
</style>
|