|
@@ -1,17 +1,16 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
- <!-- <image src="../../static/images/top-bg.png"></image> -->
|
|
|
- <!-- <navigation-bar :title="title" background-color="#fff" front-color="#000000" :left-button="null" /> -->
|
|
|
- <uni-nav-bar color="#fff" height="60" left-icon="back" @clickLeft="back()" @clickRight="rightClick()"
|
|
|
+ <!-- <image src="../../static/images/role/bm.png"></image> -->
|
|
|
+ <uni-nav-bar color="#fff" height="60" :fixed="true" left-icon="back" @clickLeft="back()" @clickRight="rightClick()"
|
|
|
right-icon="list" :border="false" backgroundColor="#0081ff" title="一级市场" />
|
|
|
</u-navbar>
|
|
|
- <u-list v-if="active==1" class="list" width="100%" @scrolltolower="scrolltolower">
|
|
|
+ <u-list class="list" width="100%" @scrolltolower="scrolltolower">
|
|
|
<u-list-item v-for="(item, index) in goods" :key="index">
|
|
|
<view class="item-box">
|
|
|
<view class="goods-item">
|
|
|
<u-row>
|
|
|
<u-col span="5" @click="toDetails(item.id)">
|
|
|
- <u--image :showLoading="true" src="" width="270rpx" height="220rpx"></u--image>
|
|
|
+ <u--image radius="10" :showLoading="true" src="" width="250rpx" height="220rpx"></u--image>
|
|
|
</u-col>
|
|
|
<u-col span="7">
|
|
|
<view class="t1 txt" @click="toDetails(item.id)">
|
|
@@ -27,7 +26,7 @@
|
|
|
<view class="t4">
|
|
|
<view class="price">¥{{item.price}}</view>
|
|
|
<view class="car" @click="addCar(item)">
|
|
|
- <u-icon color="#fff" name="shopping-cart-fill" size="30"></u-icon>
|
|
|
+ <uni-icons type="cart" color="#fff" size="30"></uni-icons>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-col>
|
|
@@ -43,28 +42,12 @@
|
|
|
<view class="rows">
|
|
|
<view class="row omit" v-for="(item, index) in typeList" :key="index">
|
|
|
<view class="out">
|
|
|
- <view class="int" :style="{color:index==5?'#0081FF':'#213227'}">{{item.name}}</view>
|
|
|
+ <view class="int" @click="typeClick(item)" :style="{color: item.check?'#0081FF':'#213227'}">{{item.name}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="clear"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
- <view class="title">生鲜海鲜</view>
|
|
|
- <view class="rows">
|
|
|
- <view class="row omit" v-for="(item, index) in typeList" :key="index">
|
|
|
- <view class="out">
|
|
|
- <view class="int" :active="{active:true}">{{item.name}}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="clear"></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- <view class="u-page__tag-item" style="display: flex; align-items: center;"
|
|
|
- v-for="(item, index) in typeList" :key="index">
|
|
|
- <u-tag class="tag" :text="item.name" :plain="!item.checked" :name="item.no" @click="checkboxClick">
|
|
|
- </u-tag>
|
|
|
- </view> -->
|
|
|
<u-button class="custom-style" shape="circle" type="primary" size="small" text="确定"
|
|
|
@click="close()"></u-button>
|
|
|
</view>
|
|
@@ -86,10 +69,11 @@
|
|
|
return {
|
|
|
loadmoreStatus: 'loadmore',
|
|
|
goods: [],
|
|
|
- active: '',
|
|
|
+ active: 0,
|
|
|
title: '一级市场',
|
|
|
show: false,
|
|
|
typeList: [],
|
|
|
+ typeCheck: [],
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -105,13 +89,13 @@
|
|
|
url: '/level-one-server/TbGoodsTransit/getTransitList',
|
|
|
success: res => {
|
|
|
this.goods = res.data.data;
|
|
|
- this.goods.forEach((item, index) => {
|
|
|
- if (index === this.goods.length - 1) {
|
|
|
- this.loadmoreStatus = 'nomore'
|
|
|
- } else {
|
|
|
- this.loadmoreStatus = 'loadmore'
|
|
|
- }
|
|
|
- })
|
|
|
+ // this.goods.forEach((item, index) => {
|
|
|
+ // if (index === this.goods.length - 1) {
|
|
|
+ // this.loadmoreStatus = 'nomore'
|
|
|
+ // } else {
|
|
|
+ // this.loadmoreStatus = 'loadmore'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -128,7 +112,6 @@
|
|
|
goodsName: goods.goodsName,
|
|
|
// buyNum: parseInt(this.num)
|
|
|
}
|
|
|
- console.log(goods)
|
|
|
this.http.request({
|
|
|
url: '/level-one-server/app/TbGoodsCart/addGoodsInShopCart',
|
|
|
data: params,
|
|
@@ -137,7 +120,7 @@
|
|
|
success: res => {
|
|
|
setTimeout(function() {
|
|
|
uni.showToast({
|
|
|
- title: res.data.data.msg
|
|
|
+ title: res.data.msg
|
|
|
});
|
|
|
}, 1000)
|
|
|
}
|
|
@@ -149,7 +132,9 @@
|
|
|
url: '/level-one-server/TbGoodsType/getList',
|
|
|
success: res => {
|
|
|
this.typeList = res.data.data
|
|
|
- console.log(this.typeList)
|
|
|
+ this.typeList.map(item => {
|
|
|
+ item.check=false
|
|
|
+ })
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -159,20 +144,6 @@
|
|
|
toDetails(id) {
|
|
|
this.$common.to('/pages/goodsDetails/goodsDetails?id=' + id)
|
|
|
},
|
|
|
- // 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 = '订单列表'
|
|
|
- // }
|
|
|
- // },
|
|
|
back() {
|
|
|
uni.switchTab({
|
|
|
url: '/pages/index/index'
|
|
@@ -186,8 +157,10 @@
|
|
|
// console.log('open');
|
|
|
},
|
|
|
close() {
|
|
|
+ this.typeList.map(item => {
|
|
|
+ if(item.check) this.typeCheck.push(item)
|
|
|
+ })
|
|
|
this.show = false
|
|
|
- // console.log('close');
|
|
|
},
|
|
|
BtnClick(type) {
|
|
|
type == 1 ? uni.navigateTo({
|
|
@@ -196,10 +169,11 @@
|
|
|
url: '/pages/oneMarket/order/order'
|
|
|
})
|
|
|
},
|
|
|
- checkboxClick(name) {
|
|
|
- this.typeList.map((item, index) => {
|
|
|
- if (item.no == name) item.checked = true
|
|
|
+ typeClick(data) {
|
|
|
+ this.typeList.map(item => {
|
|
|
+ if(item.no == data.no) item.check=!item.check
|
|
|
})
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -251,7 +225,7 @@
|
|
|
.list {
|
|
|
height: auto;
|
|
|
border-radius: 10rpx;
|
|
|
- margin: 15rpx;
|
|
|
+ margin: 10rpx 20rpx 10rpx 20rpx;
|
|
|
}
|
|
|
|
|
|
.goods-item {
|
|
@@ -260,8 +234,8 @@
|
|
|
|
|
|
.item-box {
|
|
|
height: 230rpx;
|
|
|
- width: 90%;
|
|
|
- padding: 20rpx;
|
|
|
+ width: 86%;
|
|
|
+ padding: 30rpx;
|
|
|
background-color: #fff;
|
|
|
border: 1rpx #FFF solid;
|
|
|
margin: 10rpx 0rpx;
|
|
@@ -297,9 +271,9 @@
|
|
|
|
|
|
.car {
|
|
|
background-color: #0081ff;
|
|
|
- width: 60rpx;
|
|
|
- height: 60rpx;
|
|
|
- border-radius: 30rpx;
|
|
|
+ width: 80rpx;
|
|
|
+ height: 70rpx;
|
|
|
+ border-radius: 40rpx;
|
|
|
text-align: center;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -337,17 +311,6 @@
|
|
|
width: 300rpx;
|
|
|
}
|
|
|
|
|
|
- .tag {
|
|
|
- margin-bottom: 30rpx;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- /* width: 300rpx;
|
|
|
- height: 50rpx;
|
|
|
- background-color: #f3f4f6;
|
|
|
- border-radius: 10rpx;
|
|
|
- text-align: center; */
|
|
|
- }
|
|
|
-
|
|
|
/* .active-btn {
|
|
|
width: 35%;
|
|
|
height: 100%;
|