Commit df5f0538 by liwk

权益商品编辑

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