Commit 4040b07d authored by zhanglw's avatar zhanglw

个人中心产品管理

parent 993175ae
......@@ -528,6 +528,13 @@ export const HttpReq = {
method: 'get'
})
},
// 个人中心-产品管理
productManagement: function(params) {
return request({
url: '/api/bsw/bigScreen/personalCenter/productManagement?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
id: null
}
}
......
......@@ -18,21 +18,22 @@
<el-col :span="21" style="padding: 0 20px">
<!--查询面板-->
<div class="search-box" style="padding:0;display:flex;font-size: 15px">
<div class="search-item" :class="query.type===undefined?'active':''" style="width: 126px">
<span class="touch label" @click="setQuertType()">收藏时间</span>
<span v-if="query.type===undefined"><i v-if="query.sort" class="el-icon-sort-up touch" /><i v-else class="el-icon-sort-down touch" /></span>
<div class="search-item" :class="query.type==='time'?'active':''" style="width: 126px">
<span class="touch label" @click="setQuertType('time')">收藏时间</span>
<span v-if="query.type==='time'"><i v-if="query.sort" class="el-icon-sort-up touch" /><i v-else class="el-icon-sort-down touch" /></span>
</div>
<div class="search-item" :class="query.type==='hot'?'active':''" style="width: 126px">
<span class="touch label" @click="setQuertType('hot')">销量优先</span>
<span v-if="query.type==='hot'"><i v-if="query.sort" class="el-icon-sort-up touch" /><i v-else class="el-icon-sort-down touch" /></span>
<div class="search-item" :class="query.type==='count'?'active':''" style="width: 126px">
<span class="touch label" @click="setQuertType('count')">询价优先</span>
<span v-if="query.type==='count'"><i v-if="query.sort" class="el-icon-sort-up touch" /><i v-else class="el-icon-sort-down touch" /></span>
</div>
</div>
<div style="width: 100%;height: 62vh;margin-top: 7px;overflow: auto">
<div v-for="(item,index) in tableData" :key="'p_'+index" class="box-card-s">
<el-image
:src="item.imgSrc?imgSrcStart+'/img'+item.imgSrc:defaultImgProduct"
:preview-src-list="item.imgSrcList.length?item.imgSrcList:[defaultImgProduct]"
class="touch"
:src="item.imgSrc?imgSrcStart+'/productPic/'+item.imgSrc:defaultImgProduct"
style="width:200px;height: 160px;margin: 0 5px"
@click="goToDetails(item, '/product/details')"
>
<div slot="placeholder" class="image-slot">加载中<span class="dot">...</span></div>
</el-image>
......@@ -75,6 +76,7 @@ import languageSetting from '../components/languageSettingV2'
import homeFooter from '../components/homeFooter'
import inquiryView from '../components/inquiryView'
import userMenus from '../components/userMenus'
import { HttpReq } from '@/api/common'
export default {
components: { titleMenus, userLogin, languageSetting, homeFooter, inquiryView, userMenus },
......@@ -83,13 +85,10 @@ export default {
defaultImgProduct: default_product,
imgSrcStart: process.env.VUE_APP_BASE_API,
page: 1,
pageSize: 8,
pageSize: 10,
total: 0,
query: {
keyword: '',
area: undefined,
type: undefined,
sort: false
type: 'time'
},
tableData: [
{
......@@ -185,13 +184,21 @@ export default {
},
methods: {
setQuertType(type) {
if (type === this.query.type) {
this.query.sort = !this.query.sort
} else {
if (type !== this.query.type) {
this.query.type = type
this.query.sort = false
this.loadData()
}
},
loadData() {
HttpReq.webClientApi.productManagement({
page: this.page - 1,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.tableData = res.data.data
this.total = res.data.total
})
},
// 点击询价
inquiry(item, type) {
console.log(item, type)
......
......@@ -46,7 +46,7 @@
<el-table-column label="产品预览图" align="center" width="100">
<template slot-scope="scope">
<el-image
:src="scope.row.imgSrc?imgSrcStart+'/img'+scope.row.imgSrc:defaultImgProduct"
:src="scope.row.imgSrc?imgSrcStart+'/productPic/'+scope.row.imgSrc:defaultImgProduct"
:preview-src-list="scope.row.imgSrcList?scope.row.imgSrcList:[defaultImgProduct]"
style="width:64px;height: 64px;border: 1px solid rgba(0, 0, 0, 0.2);"
>
......@@ -139,7 +139,7 @@ export default {
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.queryProduct({
HttpReq.webClientApi.productManagement({
page: this.page - 1,
pageSize: this.pageSize,
...this.query
......
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