Commit df5f0538 by liwk

权益商品编辑

1 parent 8776a17a
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
:hasPage="false" :hasPage="false"
:hasNum="false" :hasNum="false"
> >
<div <div
slot="mainPageFlag" slot="mainPageFlag"
slot-scope="scope" slot-scope="scope"
> >
...@@ -123,6 +123,10 @@ ...@@ -123,6 +123,10 @@
> >
<el-button <el-button
type="text" type="text"
@click="editEquity(scope.scope,2)"
>编辑</el-button>
<el-button
type="text"
@click="updateShelves(scope.scope,'goods')" @click="updateShelves(scope.scope,'goods')"
>{{scope.scope.status == 0?'上架':'下架'}}</el-button> >{{scope.scope.status == 0?'上架':'下架'}}</el-button>
<el-button <el-button
...@@ -147,7 +151,7 @@ import { goodsEquityManageApi, carEquityManageApi } from '@api/api' ...@@ -147,7 +151,7 @@ import { goodsEquityManageApi, carEquityManageApi } from '@api/api'
export default { export default {
name: '', name: '',
mixins: [carMixin, goodsMixin], mixins: [carMixin, goodsMixin],
data() { data () {
return { return {
showDialog: false, showDialog: false,
isEdit: false, isEdit: false,
...@@ -155,45 +159,45 @@ export default { ...@@ -155,45 +159,45 @@ export default {
editData: {} editData: {}
} }
}, },
mounted() { mounted () {
this.init() this.init()
}, },
methods: { methods: {
/*更改汽车展示状态 */ /*更改汽车展示状态 */
carsDisplay(row) { carsDisplay (row) {
if (row.mainPageFlag == 0) { if (row.mainPageFlag == 0) {
carEquityManageApi carEquityManageApi
.cardsDisplay({ id: row.id, mainPageFlag: 1 }) .cardsDisplay({ id: row.id, mainPageFlag: 1 })
.then(res => {}) .then(res => { })
} else { } else {
carEquityManageApi carEquityManageApi
.cardsDisplay({ id: row.id, mainPageFlag: 0 }) .cardsDisplay({ id: row.id, mainPageFlag: 0 })
.then(res => {}) .then(res => { })
} }
this.getCarList() this.getCarList()
}, },
/*改变商品展示状态 */ /*改变商品展示状态 */
goodsDisplay(row) { goodsDisplay (row) {
if (row.mainPageFlag == 0) { if (row.mainPageFlag == 0) {
goodsEquityManageApi goodsEquityManageApi
.goodsDisplay({ id: row.id, mainPageFlag: 1 }) .goodsDisplay({ id: row.id, mainPageFlag: 1 })
.then(res => {}) .then(res => { })
} else { } else {
goodsEquityManageApi goodsEquityManageApi
.goodsDisplay({ id: row.id, mainPageFlag: 0 }) .goodsDisplay({ id: row.id, mainPageFlag: 0 })
.then(res => {}) .then(res => { })
} }
this.getCategoryList() this.getCategoryList()
}, },
init() { init () {
this.getCarList() this.getCarList()
this.getCategoryList() this.getCategoryList()
}, },
addEquity(type) { addEquity (type) {
this.dialogType = type this.dialogType = type
this.showDialog = true this.showDialog = true
}, },
setTop(id, type) { setTop (id, type) {
let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi
target.setTop({ id }).then(({ code, message }) => { target.setTop({ id }).then(({ code, message }) => {
if (code == 0) { if (code == 0) {
...@@ -204,12 +208,12 @@ export default { ...@@ -204,12 +208,12 @@ export default {
} }
}) })
}, },
editEquity(data, type) { editEquity (data, type) {
this.editData = data this.editData = data
this.isEdit = true this.isEdit = true
this.addEquity(type) this.addEquity(type)
}, },
updateShelves({ id, status }, type) { updateShelves ({ id, status }, type) {
let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi let target = type == 'car' ? carEquityManageApi : goodsEquityManageApi
status = status == 1 ? 0 : 1 status = status == 1 ? 0 : 1
const callBack = () => { const callBack = () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!