Commit 4040b07d authored by zhanglw's avatar zhanglw

个人中心产品管理

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