123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <template>
- <view>
- <view class="search">
- <u-search placeholder="搜索商品名称" v-model="param.customerName" bgColor="white" @search="refresh()" :animation="true" actionText="取消" @clear="refresh()"></u-search>
- <view class="clear"></view>
- </view>
- <view class="goodsList">
- <view class="sort-list">
- <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 v-if="index > 0 && item.isAsc == 'desc'" class="icon"></text>
- <text v-if="index > 0 && item.isAsc == 'asc'" class="icon"></text>
- </view>
- <view class="type" @click="show = true">
- <text>分类</text>
- <text class="icon"></text>
- </view>
- <view class="clear"></view>
- </view>
- <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
- <view class="title">广西京东自营店南宁分店</view>
- <image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
- <view class="con">
- <view class="productName omit">八角茴香(未磨)(可食用)</view>
- <view class="desc">50吨</view>
- <view class="price">¥ 5000</view>
- <view class="icon buy" v-if="user.userType == 2"></view>
- </view>
- <view class="clear"></view>
- </view>
- </view>
- <productType v-model="show"></productType>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- user: this.getUser(),
- show: false,
- sort: [
- {
- name: '综合',
- key: 1,
- isAsc: 'desc',
- check: false
- },
- {
- name: '日期',
- key: 2,
- isAsc: 'desc',
- check: false
- },
- {
- name: '价格',
- key: 3,
- isAsc: 'desc',
- check: false
- }
- ],
- list: [{}, {}, {}, {}],
- param: { pageNo: 1, pageSize: 10 },
- loadMore: true
- };
- },
- onLoad(e) {
- //this.getData();
- },
- methods: {
- getData() {
- this.http.request({
- url: '/level-one-server/app/TbGoodsTransit/getTransitList',
- data: this.param,
- loading: 'false',
- success: res => {
- this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
- this.list.push(...res.data.data);
- }
- });
- },
- detail(item) {
- uni.navigateTo({ url: '/pages/market/two/detail?id=' + item.id });
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNum = 1;
- this.list = [];
- this.getData();
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNum++;
- this.getData();
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: $pg;
- }
- .search {
- padding: 12px 12px 0px 12px;
- }
- </style>
|