|
|
<template>
|
|
|
<view class="">
|
|
|
<u-sticky bgColor="#fff">
|
|
|
<u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="click"></u-tabs>
|
|
|
<u-tabs :list="list2" lineColor="#FED000" :scrollable="false" @click="toggle"></u-tabs>
|
|
|
</u-sticky>
|
|
|
<view class="misslist">
|
|
|
<u-empty
|
|
|
marginTop="251"
|
|
|
mode="list"
|
|
|
text="暂无数据"
|
|
|
v-if="!list.length"
|
|
|
>
|
|
|
</u-empty>
|
|
|
<view class="misslist" v-if="list.length">
|
|
|
<custom-waterfalls-flow :isSend="1" :value="list" :columnSpace="1.5" :seat="2" @edit="edit" @del="del" @wapperClick="wapperClick" @imageClick="wapperClick">
|
|
|
|
|
|
<template v-slot:default="item">
|
|
|
<view class="item">
|
|
|
<view class="title">{{item.title}}</view>
|
|
|
<view class="desc">{{item.desc}}</view>
|
|
|
<view class="title">{{item.name}}</view>
|
|
|
<view class="desc">所属分裂 {{item.sort.name}}</view>
|
|
|
<view class="desc flexA">
|
|
|
张三
|
|
|
{{item.seller_name}}
|
|
|
<view class="money">
|
|
|
<text style="font-size: 20rpx;">¥</text>120
|
|
|
<text style="font-size: 20rpx;">¥</text>{{item.price}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
</custom-waterfalls-flow>
|
|
|
</view>
|
|
|
<u-modal :show="showDel" :showCancelButton="true" @confirm="delPro" @cancel="showDel=false" content='您是否删除此物品'></u-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
|
|
|
<script>
|
|
|
var that
|
|
|
import { myProduct ,delProduct} from '@/api/mine.js'
|
|
|
import {toa} from '@/utils/toast.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
...
|
...
|
@@ -35,50 +46,109 @@ |
|
|
}, {
|
|
|
name: '已售出'
|
|
|
}],
|
|
|
list: [{
|
|
|
image: 'https://via.placeholder.com/200x500.png/ff0000',
|
|
|
title: '比特币',
|
|
|
desc: '所属分类:1 文博收藏品'
|
|
|
}, {
|
|
|
image: 'https://via.placeholder.com/200x300.png/9400D3',
|
|
|
title: '我是标题4',
|
|
|
desc: '描述描述描述描述描述描述描述描述4'
|
|
|
},
|
|
|
{
|
|
|
image: 'https://via.placeholder.com/100x240.png/B0E0E6',
|
|
|
title: '我是标题5',
|
|
|
desc: '描述描述描述描述描述描述描述描述5'
|
|
|
},
|
|
|
{
|
|
|
image: 'https://via.placeholder.com/140x280.png/7FFFAA',
|
|
|
title: '我是标题6',
|
|
|
desc: '描述描述描述描述描述描述描述描述6'
|
|
|
},
|
|
|
{
|
|
|
image: 'https://via.placeholder.com/40x60.png/EEE8AA',
|
|
|
title: '我是标题7',
|
|
|
desc: '描述描述描述描述描述描述描述描述7'
|
|
|
}
|
|
|
]
|
|
|
list: [],
|
|
|
// [ {
|
|
|
// image: 'https://via.placeholder.com/200x500.png/ff0000',
|
|
|
// title: '比特币',
|
|
|
// desc: '所属分类:1 文博收藏品'
|
|
|
// }, {
|
|
|
// image: 'https://via.placeholder.com/200x300.png/9400D3',
|
|
|
// title: '我是标题4',
|
|
|
// desc: '描述描述描述描述描述描述描述描述4'
|
|
|
// },
|
|
|
// {
|
|
|
// image: 'https://via.placeholder.com/100x240.png/B0E0E6',
|
|
|
// title: '我是标题5',
|
|
|
// desc: '描述描述描述描述描述描述描述描述5'
|
|
|
// },
|
|
|
// {
|
|
|
// image: 'https://via.placeholder.com/140x280.png/7FFFAA',
|
|
|
// title: '我是标题6',
|
|
|
// desc: '描述描述描述描述描述描述描述描述6'
|
|
|
// },
|
|
|
// {
|
|
|
// image: 'https://via.placeholder.com/40x60.png/EEE8AA',
|
|
|
// title: '我是标题7',
|
|
|
// desc: '描述描述描述描述描述描述描述描述7'
|
|
|
// }
|
|
|
// ]
|
|
|
page:1,
|
|
|
num:15,
|
|
|
idx:0,
|
|
|
delId:'',
|
|
|
showDel:false
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
that = this
|
|
|
this.myProduct()
|
|
|
},
|
|
|
methods: {
|
|
|
async myProduct(f){
|
|
|
console.log(f);
|
|
|
try {
|
|
|
toa.loading('加载中')
|
|
|
const res = await myProduct(this.idx,this.page,this.num)
|
|
|
toa.hideLoading()
|
|
|
this.lastPage = res.list.last_page
|
|
|
res.list.data.forEach(it=>it.image = it.images_preview[0])
|
|
|
this.list = f?res.list.data :this.list.concat(res.list.data)
|
|
|
console.log('myProduct', res,this.list)
|
|
|
// 保存数据
|
|
|
} catch (err) {
|
|
|
uni.showToast({ title:err,icon:'none' })
|
|
|
console.log('myProduct', err)
|
|
|
}
|
|
|
},
|
|
|
edit(e){
|
|
|
console.log('edit',e);
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/index/send?id=' + e.id
|
|
|
})
|
|
|
console.log('跳转');
|
|
|
},
|
|
|
del(e){
|
|
|
this.delId = e.id
|
|
|
this.showDel = true
|
|
|
console.log('del',e);
|
|
|
},
|
|
|
wapperClick(item) {
|
|
|
uni.navigateTo({
|
|
|
url:'/pages/index/detail?id='+item.id
|
|
|
})
|
|
|
console.log('单项点击事件', item)
|
|
|
},
|
|
|
toggle(e){
|
|
|
this.idx = e.index
|
|
|
this.page = 1
|
|
|
this.myProduct(1)
|
|
|
console.log(e);
|
|
|
},
|
|
|
async delPro(){
|
|
|
try {
|
|
|
const res = await delProduct(this.delId)
|
|
|
console.log('delProduct', res)
|
|
|
setTimeout(()=>{
|
|
|
toa.success('删除成功')
|
|
|
},200)
|
|
|
this.page = 1
|
|
|
this.showDel = false
|
|
|
this.list = []
|
|
|
this.myProduct(1)
|
|
|
// 保存数据
|
|
|
} catch (err) {
|
|
|
uni.showToast({ title:err,icon:'none' })
|
|
|
console.log('delProduct', err)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// 触底触发
|
|
|
onReachBottom() {
|
|
|
// if(that.page >= that.lastPage) return
|
|
|
// that.page=that.page+1
|
|
|
if(that.page >= that.lastPage) return
|
|
|
that.page=that.page+1
|
|
|
this.myProduct()
|
|
|
// this.getForum()
|
|
|
this.list = this.list.concat(this.list)
|
|
|
// this.list = this.list.concat(this.list)
|
|
|
},
|
|
|
}
|
|
|
</script>
|
...
|
...
|
|