Commit dcf936c1 authored by yaya's avatar yaya

feat:会员详情添加TA的藏品Tab

parent cbeee67d
......@@ -17,20 +17,6 @@
<el-table-column align="center" label="用户名" prop="nickname"/>
<el-table-column align="center" label="手机号码" prop="mobile"/>
<!-- <el-table-column align="center" label="性别" prop="gender">
<template slot-scope="scope">
{{ genderDic[scope.row.gender] }}
</template>
</el-table-column>
<el-table-column align="center" label="生日" prop="birthday"/>
<el-table-column align="center" label="用户等级" prop="userLevel">
<template slot-scope="scope">
{{ levelDic[scope.row.userLevel] }}
</template>
</el-table-column>-->
<el-table-column align="center" label="角色" prop="userLevelName"/>
<el-table-column align="center" label="TA的关注" prop="followerNum"/>
<el-table-column align="center" label="TA的粉丝" prop="fansNum"/>
......
......@@ -41,6 +41,7 @@
</el-card>
<el-card :style="{'margin': '16px','height': list.length < 5 ? '500px' : '1000px'}" class="box-card">
<el-menu :default-active="defaultActive" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="0">TA的藏品</el-menu-item>
<el-menu-item index="1">TA的关注</el-menu-item>
<el-menu-item index="2">TA的粉丝</el-menu-item>
<el-menu-item index="3">TA的分享</el-menu-item>
......@@ -57,7 +58,69 @@
</div>
<el-table
v-loading="listLoading"
v-if="defaultActive !== '3'"
v-if="defaultActive === '0'"
:data="list"
:fit="true"
:height="list.length < 5 ? 400 : 900"
size="small"
style="margin-top: 20px; padding-bottom: 20px"
element-loading-text="正在查询中..."
border
highlight-current-row>
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />-->
<el-table-column align="center" min-width="100px" prop="id" label="商品ID" />
<el-table-column align="center" label="封面图" prop="itemImg">
<template slot-scope="scope">
<img v-if="scope.row.images" :src="scope.row.images.split(';')[0]" width="60px" height="60px">
</template>
</el-table-column>
<el-table-column align="center" label="藏品名称" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name || ''" />
</template>
</el-table-column>
<el-table-column align="center" label="藏品价格" prop="distributionPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `¥ ${scope.row.distributionPrice}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="是否出售" prop="isAbleSale" min-width="100px">
<template slot-scope="scope" style="height: 100px">
<el-switch
v-model="scope.row.isAbleSale"
:active-text="scope.row.isAbleSale === true ? '是' : '否'"
style="display: block"
@change="handleSaleSwitch($event, scope.row)" />
</template>
</el-table-column>
<el-table-column align="center" min-width="100px" prop="stock" label="库存" />
<el-table-column align="center" min-width="100px" prop="updateTime" label="更新时间" />
<el-table-column align="center" min-width="100px" prop="statusName" label="状态" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToItemDetail(scope.row)">详情
</el-button>
<el-button
v-if="scope.row.status === 0"
type="danger"
size="mini"
@click="handleSetItemOff(scope.row)">违规下架
</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading"
v-if="defaultActive !== '3' && defaultActive !== '0'"
:data="list"
:fit="true"
:height="list.length < 5 ? 400 : 900"
......@@ -110,6 +173,7 @@
<script>
import Pagination from '@/components/Pagination'
import { fansList, requestUserDetail, updateCollectorPermission, updateAccountState } from '@/api/business/user'
import { getSaleList, irregularOff } from '@/api/business/sale'
import Line2Hidden from '@/components/line2Hidden'
export default {
name: 'UserDetail',
......@@ -142,7 +206,7 @@ export default {
},
list: [],
total: 0,
defaultActive: '1',
defaultActive: '0',
userDetail: {},
userId: ''
}
......@@ -154,7 +218,8 @@ export default {
}
this.userId = userId
this.getDetail()
this.getList()
// this.getList()
this.getItemList()
},
methods: {
......@@ -179,13 +244,11 @@ export default {
this.defaultActive = value
this.listQuery.page = 1
this.listQuery.listType = Number(value)
if (this.defaultActive === '0') {
this.getItemList()
return
}
this.getList()
},
/**
* 开通藏家权限
*/
handleOpen() {
},
/**
* 获取详情
......@@ -213,6 +276,63 @@ export default {
this.listLoading = false
})
},
/**
* 获取列表数据
*/
getItemList() {
this.listLoading = true
this.listQuery.creatorId = this.userId
this.listQuery.type = 3
this.listQuery.id = ''
getSaleList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
console.log('========报错=', e)
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 藏品详情
*/
handleToItemDetail(item) {
this.$router.push({ path: '/sale/itemDetail', query: { id: item.id }})
},
/**
* 违规下架
* @param this.userDetail
*/
handleSetItemOff(row) {
this.$confirm('是否将该商品违规下架?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
id: row.id,
state: 1
}
irregularOff(params).then(response => {
this.list = this.list.filter((item) => {
if (item.id === row.id) {
item.statusName = '违规下架'
item.status = 1
return item
}
return item
})
this.$notify.success({
message: '下架成功'
})
}).catch((e) => {
console.log('===报错=', e)
this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
})
})
},
handleSetUserState() {
if (!this.userDetail || !this.userDetail.id) {
return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment