|
@@ -1,19 +1,136 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
-
|
|
|
+ <view class="tab">
|
|
|
+ <u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
|
|
|
+ </view>
|
|
|
+ <view class="goodsList">
|
|
|
+ <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
|
|
|
+ <view class="title">广西京东自营店南宁分店</view>
|
|
|
+ <view class="state" v-if="item.enterpriseConfirm == 0">
|
|
|
+ <text class="icon"></text>
|
|
|
+ <text>待确认</text>
|
|
|
+ </view>
|
|
|
+ <view class="state" v-if="item.enterpriseConfirm == 1">
|
|
|
+ <text class="icon" style="color: #13ce66"></text>
|
|
|
+ <text>已确认</text>
|
|
|
+ </view>
|
|
|
+ <view class="state" v-if="item.enterpriseConfirm == 2">
|
|
|
+ <text class="icon" style="color: #f44336"></text>
|
|
|
+ <text>已拒绝</text>
|
|
|
+ </view>
|
|
|
+ <image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
|
|
|
+ <view class="con">
|
|
|
+ <view class="productName omit">越南巴沙鱼</view>
|
|
|
+ <view class="desc omit">
|
|
|
+ <text>50吨</text>
|
|
|
+ <text>{{ item.tradeAreaName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="price">¥ {{ item.price }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="clear"></view>
|
|
|
+ <view class="op">
|
|
|
+ <view class="date">2022-12-12:12:12</view>
|
|
|
+ <template v-if="item.enterpriseConfirm == 0">
|
|
|
+ <view class="an" style="color: #f44336" @click.stop="confirm(item.id, 2, '确认拒绝?')">取消订单</view>
|
|
|
+ <view class="an" style="color: #4581fb" @click.stop="confirm(item.id, 1, '确认接单?')">确认订单</view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
|
|
|
+ <u-empty v-if="!loadMore && list.length == 0"></u-empty>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
-
|
|
|
- };
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tab: [
|
|
|
+ { name: '全部', enterpriseConfirm: '' },
|
|
|
+ { name: '待确认', enterpriseConfirm: 0 },
|
|
|
+ { name: '申报中', enterpriseConfirm: 1 },
|
|
|
+ { name: '已完成', enterpriseConfirm: 2 },
|
|
|
+ { name: '转售中', enterpriseConfirm: 2 },
|
|
|
+ { name: '已取消', enterpriseConfirm: 2 }
|
|
|
+ ],
|
|
|
+ param: { pageNo: 1, pageSize: 10},
|
|
|
+ list: [],
|
|
|
+ loadMore: true
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getData() {
|
|
|
+ this.http.request({
|
|
|
+ url: '/level-one-server/app/TbOrder/getList',
|
|
|
+ loading: 'false',
|
|
|
+ data: this.param,
|
|
|
+ success: res => {
|
|
|
+ this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
|
|
|
+ if(res.data.data){
|
|
|
+ this.list.push(...res.data.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //点击tab切换
|
|
|
+ click(e) {
|
|
|
+ this.param.enterpriseConfirm = e.enterpriseConfirm;
|
|
|
+ this.refresh();
|
|
|
+ },
|
|
|
+ detail(item) {
|
|
|
+ uni.navigateTo({ url: '/pages/market/one/merchant/order/detail?id=' + item.id });
|
|
|
+ },
|
|
|
+ //刷新数据
|
|
|
+ refresh() {
|
|
|
+ this.loadMore = true;
|
|
|
+ this.param.pageNo = 1;
|
|
|
+ this.list = [];
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ //通知商家
|
|
|
+ confirm(item) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content:'是否确认通知商家?',
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.http.request({
|
|
|
+ url: '/level-one-server/app/TbGoodsTransit/update',
|
|
|
+ data: { id: id, enterpriseConfirm: status },
|
|
|
+ method: 'POST',
|
|
|
+ success: resp => {
|
|
|
+ uni.showToast({ title: '操作成功' });
|
|
|
+ this.refresh();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //下拉刷新
|
|
|
+ onPullDownRefresh() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.refresh();
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ //上拉加载
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.loadMore) {
|
|
|
+ this.param.pageNo++;
|
|
|
+ this.getData();
|
|
|
}
|
|
|
}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-
|
|
|
+page {
|
|
|
+ background-color: $pg;
|
|
|
+}
|
|
|
</style>
|