调整购物商品兑换,节点中心调整,权证转让管理增加筛选,调整交易市场
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<view class="NumberWeight">
|
||||
<view class="header-tabs">
|
||||
<view class="tabs-item" :class="{'show' : status === ''}" @click="onTabs('')">全部</view>
|
||||
<view class="tabs-item" :class="{'show' : status === 1}" @click="onTabs(1)">转让中</view>
|
||||
<view class="tabs-item" :class="{'show' : status === 2}" @click="onTabs(2)">已取消</view>
|
||||
</view>
|
||||
<!-- 有订单列表 -->
|
||||
<view v-if="lists.length > 0">
|
||||
<block v-for="(item, index) in lists" :key="index">
|
||||
@@ -18,10 +23,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<uni-load-more :status="pageMore"></uni-load-more>
|
||||
</view>
|
||||
<!-- 没有订单列表 -->
|
||||
<no-list v-if="lists.length === 0" name="no-order" txt="暂无数据~" />
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -30,47 +35,45 @@ import { marketsMag, marketsCancel } from '@/apis/interfaces/market';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
lists: [],
|
||||
page: 1,
|
||||
total: 0
|
||||
lists : [],
|
||||
page : 1,
|
||||
status : '',
|
||||
total : 0,
|
||||
pageMore: 'more'
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getList();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.total > this.lists.length) {
|
||||
if (this.pageMore) {
|
||||
this.page = this.page + 1;
|
||||
this.getList();
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: '吼吼吼~我是有底的~',
|
||||
type: 'error',
|
||||
icon: false,
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onTabs(status){
|
||||
this.status = status
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
let data = {
|
||||
perPage: 10,
|
||||
page: this.page
|
||||
};
|
||||
marketsMag(data)
|
||||
.then(res => {
|
||||
console.log(res.markets.data);
|
||||
this.lists = this.lists.concat(res.markets.data);
|
||||
this.total = res.markets.page.total;
|
||||
if(this.page === 1){
|
||||
this.lists = []
|
||||
}
|
||||
marketsMag({
|
||||
status : this.status,
|
||||
page : this.page
|
||||
}).then(res => {
|
||||
this.lists = this.lists.concat(res.markets.data);
|
||||
this.total = res.markets.page.current;
|
||||
this.pageMore = res.markets.page.has_more ? 'more' : 'noMore';
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none'
|
||||
})
|
||||
.catch(err => {
|
||||
this.$refs.uToast.show({
|
||||
title: err.message,
|
||||
type: 'error',
|
||||
icon: false,
|
||||
duration: 3000
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
// 取消转让
|
||||
removeGoods(id, index) {
|
||||
@@ -79,12 +82,20 @@ export default {
|
||||
icon : 'none',
|
||||
title: res
|
||||
})
|
||||
let statusObj = this.lists[index]
|
||||
statusObj.status = {
|
||||
value: 2,
|
||||
text : '已取消',
|
||||
|
||||
if(this.status === ''){
|
||||
let statusObj = this.lists[index]
|
||||
statusObj.status = {
|
||||
value: 2,
|
||||
text : '已取消',
|
||||
}
|
||||
this.$set(this.lists, index, statusObj)
|
||||
return
|
||||
}
|
||||
|
||||
if(this.status === 1 || this.status === 2){
|
||||
this.lists.splice(index, 1)
|
||||
}
|
||||
this.$set(this.lists, index, statusObj)
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon : 'none',
|
||||
@@ -102,6 +113,29 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.NumberWeight {
|
||||
box-sizing: border-box;
|
||||
padding-top: 90rpx;
|
||||
.header-tabs{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
line-height: 90rpx;
|
||||
font-size: $title-size-lg;
|
||||
height: 90rpx;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
background: white;
|
||||
.tabs-item{
|
||||
color: $text-gray;
|
||||
width: 33.33%;
|
||||
text-align: center;
|
||||
&.show{
|
||||
color: $mian-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 订单列表
|
||||
.order-item {
|
||||
background-color: white;
|
||||
|
||||
Reference in New Issue
Block a user