|
@@ -10,11 +10,15 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="navbar" v-show="currentIndex == 0">
|
|
|
- <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index, 0)">{{ item.text }}</view>
|
|
|
+ <view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index, 0)">
|
|
|
+ {{ item.text }}
|
|
|
+ <view class="dian" v-if="tabCurrentIndex != index && item.isnew == 2"></view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="navbar" v-show="currentIndex == 1">
|
|
|
<view v-for="(item, index) in navList1" :key="index" class="nav-item" :class="{ current: tabCurrentIndex1 === index }" @click="tabClick(index, 1)">
|
|
|
{{ item.text }}
|
|
|
+ <view class="dian" v-if="tabCurrentIndex1 != index && item.isnew == 2"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -63,7 +67,7 @@
|
|
|
<!-- 订单列表 -->
|
|
|
<view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
|
|
|
<view class="i-top b-b">
|
|
|
- <text class="time">{{ item.order_id }}</text>
|
|
|
+ <text class="time">{{ item.order_id ? item.order_id : item.order }}</text>
|
|
|
<text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
|
|
|
</view>
|
|
|
<view class="goods-box-single">
|
|
@@ -78,12 +82,20 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="buy-box">
|
|
|
- <view class="buy-info" v-if="item.status != 0">
|
|
|
+ <view class="buy-info" v-if="item.status != 0 && item.status">
|
|
|
<view class="font">买家:</view>
|
|
|
<image class="avter" :src="item.avatar" mode=""></image>
|
|
|
<view class="buy-name">{{ item.nickname }}</view>
|
|
|
<view class="phone">{{ item.phone }}</view>
|
|
|
</view>
|
|
|
+ <view v-if="!item.status">
|
|
|
+ <view class="buy-info">
|
|
|
+ <view class="font">挂售价格:{{ item.hanging_price }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="buy-info">
|
|
|
+ <view class="font">挂售时间:{{ item.update_time }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="upimg" v-if="item.status == 2 || item.status == 3">
|
|
|
<view class="up-tit">打款凭证:</view>
|
|
@@ -95,6 +107,10 @@
|
|
|
<!-- <button @click.stop="orderPay(item)" class="refuse recom">拒绝</button> -->
|
|
|
<button @click.stop="orderPay(item)" class="action-btn recom">通过</button>
|
|
|
</view>
|
|
|
+ <view class="action-box b-t" v-if="!item.status">
|
|
|
+ <!-- <button @click.stop="orderPay(item)" class="refuse recom">拒绝</button> -->
|
|
|
+ <button @click.stop="cancel(item)" class="action-btn recom">取消挂售</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
<uni-load-more :status="tabItem.loadingType"></uni-load-more>
|
|
@@ -108,7 +124,7 @@
|
|
|
<script>
|
|
|
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
|
|
import empty from '@/components/empty';
|
|
|
-import { orderList, orderCancel, orderDel, orderTake, adopt, user_auction_order, seller } from '@/api/order.js';
|
|
|
+import { orderList, orderCancel, orderDel, orderTake, adopt, user_auction_order, seller, cancel, untreated } from '@/api/order.js';
|
|
|
import { tabbar } from '@/utils/tabbar.js';
|
|
|
export default {
|
|
|
components: {
|
|
@@ -137,6 +153,7 @@ export default {
|
|
|
text: '已过期',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -145,6 +162,7 @@ export default {
|
|
|
text: '待支付',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -153,6 +171,7 @@ export default {
|
|
|
text: '待审核',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -161,6 +180,7 @@ export default {
|
|
|
text: '待挂售',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -169,6 +189,7 @@ export default {
|
|
|
text: '已完成',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
}
|
|
@@ -179,6 +200,16 @@ export default {
|
|
|
text: '已过期',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
+ page: 1, //当前页数
|
|
|
+ limit: 10 //每次信息条数
|
|
|
+ },
|
|
|
+ {
|
|
|
+ state: 4,
|
|
|
+ text: '售卖中',
|
|
|
+ loadingType: 'more',
|
|
|
+ orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -187,6 +218,7 @@ export default {
|
|
|
text: '待支付',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -195,6 +227,7 @@ export default {
|
|
|
text: '待审核',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
},
|
|
@@ -203,6 +236,7 @@ export default {
|
|
|
text: '已完成',
|
|
|
loadingType: 'more',
|
|
|
orderList: [],
|
|
|
+ isnew:1,//判断是否有新的订单
|
|
|
page: 1, //当前页数
|
|
|
limit: 10 //每次信息条数
|
|
|
}
|
|
@@ -225,14 +259,10 @@ export default {
|
|
|
* 替换onLoad下代码即可
|
|
|
*/
|
|
|
this.tabCurrentIndex = +options.state || 0;
|
|
|
- // #ifndef MP
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
this.loadData();
|
|
|
- // #endif
|
|
|
- // #ifdef MP
|
|
|
- if (options.state == 0) {
|
|
|
- this.loadData();
|
|
|
- }
|
|
|
- // #endif
|
|
|
+ this.upData();
|
|
|
},
|
|
|
// #ifdef APP-PLUS || H5
|
|
|
onBackPress(e) {
|
|
@@ -287,6 +317,20 @@ export default {
|
|
|
moneyNum(value) {
|
|
|
return +value;
|
|
|
},
|
|
|
+ upData() {
|
|
|
+ untreated().then(({ data }) => {
|
|
|
+ console.log(data);
|
|
|
+ if(data.user.hanging != 0){
|
|
|
+ this.navList[3].isnew = 2
|
|
|
+ }
|
|
|
+ if(data.user.paid != 0){
|
|
|
+ this.navList[1].isnew = 2
|
|
|
+ }
|
|
|
+ if(data.seller.reviewed != 0) {
|
|
|
+ this.navList1[3].isnew = 2
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 查看大图
|
|
|
lookimg(src) {
|
|
|
console.log(src);
|
|
@@ -337,13 +381,19 @@ export default {
|
|
|
},
|
|
|
gsell(item) {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/hall/gsell?id=' + item.id
|
|
|
+ url: '/pages/hall/gsell?id=' + item.product_id
|
|
|
});
|
|
|
},
|
|
|
orderPay(e) {
|
|
|
- console.log(e);
|
|
|
adopt({ order_id: e.order_id }).then(({ data }) => {
|
|
|
- this.loadData();
|
|
|
+ console.log('1111');
|
|
|
+ this.loadData('reload');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancel(e) {
|
|
|
+ cancel({ id: e.id }).then(({ data }) => {
|
|
|
+ this.loadData('reload');
|
|
|
+ this.upData()
|
|
|
});
|
|
|
},
|
|
|
//获取订单列表
|
|
@@ -360,6 +410,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
let state = navItem.state;
|
|
|
+ if (source == 'reload') {
|
|
|
+ navItem.orderList = [];
|
|
|
+ navItem.page = 1;
|
|
|
+ navItem.limit = 10;
|
|
|
+ navItem.loadingType = 'more';
|
|
|
+ }
|
|
|
if (source === 'tabChange' && navItem.loaded === true) {
|
|
|
//tab切换只有第一次需要加载数据
|
|
|
return;
|
|
@@ -383,17 +439,17 @@ export default {
|
|
|
.then(({ data }) => {
|
|
|
let arr = data.map(e => {
|
|
|
console.log(state == 4);
|
|
|
- if(state == 4) {
|
|
|
+ if (state == 4) {
|
|
|
e.stateTip = '待挂售';
|
|
|
e.stateTipColor = '#fa436a';
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
let b = this.orderStateExp(e.status);
|
|
|
e.stateTip = b.stateTip;
|
|
|
e.stateTipColor = b.stateTipColor;
|
|
|
}
|
|
|
return e;
|
|
|
});
|
|
|
- console.log(arr,"123456");
|
|
|
+ console.log(arr, '123456');
|
|
|
navItem.orderList = navItem.orderList.concat(arr);
|
|
|
|
|
|
// console.log(navItem.orderList);
|
|
@@ -422,9 +478,14 @@ export default {
|
|
|
.then(({ data }) => {
|
|
|
console.log(data);
|
|
|
let arr = data.map(e => {
|
|
|
- let b = this.orderStateExp(e.status);
|
|
|
- e.stateTip = b.stateTip;
|
|
|
- e.stateTipColor = b.stateTipColor;
|
|
|
+ if (state == 4) {
|
|
|
+ e.stateTip = '售卖中';
|
|
|
+ e.stateTipColor = '#fa436a';
|
|
|
+ } else {
|
|
|
+ let b = this.orderStateExp(e.status);
|
|
|
+ e.stateTip = b.stateTip;
|
|
|
+ e.stateTipColor = b.stateTipColor;
|
|
|
+ }
|
|
|
return e;
|
|
|
});
|
|
|
navItem.orderList = navItem.orderList.concat(arr);
|
|
@@ -655,7 +716,15 @@ page,
|
|
|
font-size: 15px;
|
|
|
color: $font-color-dark;
|
|
|
position: relative;
|
|
|
-
|
|
|
+ .dian {
|
|
|
+ position: absolute;
|
|
|
+ top: 20rpx;
|
|
|
+ right: 10rpx;
|
|
|
+ width: 8rpx;
|
|
|
+ height: 8rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: $base-color;
|
|
|
+ }
|
|
|
&.current {
|
|
|
color: $base-color;
|
|
|
|
|
@@ -792,13 +861,12 @@ page,
|
|
|
}
|
|
|
}
|
|
|
.buy-box {
|
|
|
- height: 84rpx;
|
|
|
- padding: 0 22rpx;
|
|
|
+ padding: 10rpx 22rpx;
|
|
|
background-color: #ffffff;
|
|
|
.buy-info {
|
|
|
- height: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ margin-top: 20rpx;
|
|
|
.font {
|
|
|
font-size: 32rpx;
|
|
|
font-family: PingFang SC;
|