|
@@ -1,29 +1,29 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
<view class="search">
|
|
<view class="search">
|
|
- <u-search placeholder="搜索商品名称" v-model="param.customerName" bgColor="white" @search="refresh()" :animation="true" actionText="取消" @clear="refresh()"></u-search>
|
|
|
|
|
|
+ <u-search placeholder="搜索商品名称" v-model="param.goodsName" bgColor="white" @search="refresh()" :animation="true" actionText="取消" @clear="refresh()"></u-search>
|
|
<view class="clear"></view>
|
|
<view class="clear"></view>
|
|
</view>
|
|
</view>
|
|
<view class="goodsList">
|
|
<view class="goodsList">
|
|
<view class="sort-list">
|
|
<view class="sort-list">
|
|
<view class="sort-item" :class="{ active: item.check }" v-for="(item, index) in sort" :key="index" @click="select(item, index)">
|
|
<view class="sort-item" :class="{ active: item.check }" v-for="(item, index) in sort" :key="index" @click="select(item, index)">
|
|
<text>{{ item.name }}</text>
|
|
<text>{{ item.name }}</text>
|
|
- <text v-if="index > 0 && item.isAsc == 'desc'" class="icon"></text>
|
|
|
|
- <text v-if="index > 0 && item.isAsc == 'asc'" class="icon"></text>
|
|
|
|
|
|
+ <text v-if="index > 0 && item.orderBy == 'desc'" class="icon"></text>
|
|
|
|
+ <text v-if="index > 0 && item.orderBy == 'asc'" class="icon"></text>
|
|
</view>
|
|
</view>
|
|
- <view class="type" @click="show = true">
|
|
|
|
- <text>分类</text>
|
|
|
|
|
|
+ <view class="type" @click="go()">
|
|
|
|
+ <text>{{ param.goodsType || '分类' }}</text>
|
|
<text class="icon"></text>
|
|
<text class="icon"></text>
|
|
</view>
|
|
</view>
|
|
- <view class="clear"></view>
|
|
|
|
</view>
|
|
</view>
|
|
<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id)">
|
|
<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id)">
|
|
- <view class="title">{{item.merchantName}}</view>
|
|
|
|
|
|
+ <view class="title">{{ item.merchantName }}</view>
|
|
|
|
+ <view class="goodsType omit">{{ item.goodsType }}</view>
|
|
<image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
|
|
<image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
|
|
<view class="con">
|
|
<view class="con">
|
|
<view class="productName omit">{{ item.goodsName }}</view>
|
|
<view class="productName omit">{{ item.goodsName }}</view>
|
|
<view class="desc omit">
|
|
<view class="desc omit">
|
|
- <text>{{item.grossWeight}} {{item.goodsUnits}}</text>
|
|
|
|
|
|
+ <text>{{ item.grossWeight }} {{ item.goodsUnits }}</text>
|
|
<text>{{ item.tradeAreaName }}</text>
|
|
<text>{{ item.tradeAreaName }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="price">¥ {{ item.price }}</view>
|
|
<view class="price">¥ {{ item.price }}</view>
|
|
@@ -43,7 +43,11 @@ export default {
|
|
return {
|
|
return {
|
|
show: false,
|
|
show: false,
|
|
user: this.getUser(),
|
|
user: this.getUser(),
|
|
- sort: [{ name: '综合' }, { name: '日期' }, { name: '价格' }],
|
|
|
|
|
|
+ sort: [
|
|
|
|
+ { name: '综合', sortType: 1, orderBy: 'desc', check: false },
|
|
|
|
+ { name: '日期', sortType: 15, orderBy: 'desc', check: false },
|
|
|
|
+ { name: '价格', sortType: 7, orderBy: 'desc', check: false }
|
|
|
|
+ ],
|
|
list: [],
|
|
list: [],
|
|
param: { pageNo: 1, pageSize: 10 },
|
|
param: { pageNo: 1, pageSize: 10 },
|
|
loadMore: true
|
|
loadMore: true
|
|
@@ -51,8 +55,26 @@ export default {
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
this.getData();
|
|
this.getData();
|
|
|
|
+ //选择商品分类
|
|
|
|
+ uni.$on('productType', res => {
|
|
|
|
+ this.param.goodsType = res.name;
|
|
|
|
+ this.param.current = res.current;
|
|
|
|
+ this.param.now = res.now;
|
|
|
|
+ this.refresh();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ select(item, index) {
|
|
|
|
+ this.sort.forEach(it => (it.check = false));
|
|
|
|
+ item.check = true;
|
|
|
|
+ if (index > 0) {
|
|
|
|
+ this.orderBy = this.orderBy == 'desc' ? 'asc' : 'desc';
|
|
|
|
+ item.orderBy = this.orderBy;
|
|
|
|
+ }
|
|
|
|
+ this.param.orderBy = item.orderBy;
|
|
|
|
+ this.param.sortType = item.sortType;
|
|
|
|
+ this.refresh();
|
|
|
|
+ },
|
|
getData() {
|
|
getData() {
|
|
this.http.request({
|
|
this.http.request({
|
|
url: '/level-one-server/app/TbGoodsTransit/getList',
|
|
url: '/level-one-server/app/TbGoodsTransit/getList',
|
|
@@ -64,6 +86,10 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ //选择分类
|
|
|
|
+ go() {
|
|
|
|
+ uni.navigateTo({ url: '/pages/market/productType?current=' + this.param.current + '&now=' + this.param.now });
|
|
|
|
+ },
|
|
// 添加购物车
|
|
// 添加购物车
|
|
addCar(goods) {
|
|
addCar(goods) {
|
|
let params = {
|
|
let params = {
|
|
@@ -121,4 +147,4 @@ page {
|
|
.search {
|
|
.search {
|
|
padding: 12px 12px 0px 12px;
|
|
padding: 12px 12px 0px 12px;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|