130 lines
2.6 KiB
Vue
130 lines
2.6 KiB
Vue
<template>
|
|
<view class="content">
|
|
<view class="tabbar">
|
|
<view :class="[active==4?'active':'']" @click="handleActive(4)">审核中</view>
|
|
<view :class="[active==5?'active':'']" @click="handleActive(5)">已驳回</view>
|
|
<view :class="[active==6?'active':'']" @click="handleActive(6)">已发布</view>
|
|
</view>
|
|
<!-- -->
|
|
<view class="list">
|
|
<list :isName="false" :isPhone="false" :isState='true' :list="list" @handleDetail="handleDetail"
|
|
v-if="list.length"></list>
|
|
<view class="nolist" v-else>
|
|
<image src="../../static/none.png"></image>
|
|
<text>暂无数据</text>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import list from "@/components/productList.vue"
|
|
export default {
|
|
data() {
|
|
return {
|
|
type: 3,
|
|
active: 4,
|
|
page: 1,
|
|
list: [],
|
|
lastPage: 1,
|
|
}
|
|
},
|
|
components: {
|
|
list
|
|
},
|
|
onLoad(options) {
|
|
let that = this
|
|
this.type = options.type
|
|
this.handleList()
|
|
uni.setNavigationBarTitle({
|
|
title: this.type == 3 ? "我的商品" : '我的供需'
|
|
});
|
|
},
|
|
onReachBottom() {
|
|
let that = this
|
|
console.log("this.lastPage", this.lastPage)
|
|
if (!this.lastPage || this.page >= this.lastPage) {
|
|
uni.showToast({
|
|
title: '没有更多数据!',
|
|
icon: 'none'
|
|
})
|
|
return
|
|
}
|
|
this.page++
|
|
this.handleList()
|
|
},
|
|
methods: {
|
|
handleList() {
|
|
let that = this
|
|
that.$model.getProductListbyuser({
|
|
status: that.active,
|
|
pageNo: that.page,
|
|
pageSize: 10,
|
|
type: this.type == 3 ? 3 : 9
|
|
}).then(res => {
|
|
if (res.code == 0) {
|
|
that.list = this.list.concat(res.data.rows)
|
|
that.lastPage = res.data.totalpage
|
|
} else {
|
|
that.$tools.msg(res.message);
|
|
}
|
|
});
|
|
},
|
|
handleActive(ind) {
|
|
this.active = ind
|
|
this.list = []
|
|
this.page = 1
|
|
this.handleList()
|
|
},
|
|
handleDetail(item) {
|
|
console.log("详情", item)
|
|
let that = this
|
|
that.$model.getProductDetailbyuser({
|
|
id: item.id,
|
|
type: item.type
|
|
}).then(res => {
|
|
if (res.code == 0) {
|
|
res.data.active = that.active
|
|
res.data.type = item.type
|
|
uni.navigateTo({
|
|
url: "/pageTwo/me/addNeeds?status=edit&item=" + JSON.stringify(res.data)
|
|
})
|
|
} else {
|
|
that.$tools.msg(res.message);
|
|
}
|
|
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.tabbar {
|
|
position: fixed;
|
|
background: #fff;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 45px;
|
|
line-height: 45px;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
|
|
view {
|
|
width: 20%;
|
|
text-align: center;
|
|
}
|
|
|
|
.active {
|
|
color: $orange;
|
|
font-weight: bold;
|
|
border-bottom: 2px solid $orange;
|
|
}
|
|
}
|
|
|
|
.list {
|
|
margin-top: 50px;
|
|
}
|
|
</style> |