Commit 3a1ca9d4 by cwq0219

控制台

1 parent 56fbbc0d
......@@ -107,4 +107,26 @@ const updateReplayApi = params => {
})
}
export { getLiveRoomListApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi }
const controlUpOrDownApi = params => {
params.method = `${defaultPath}toggle.status`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const controlDeleteApi = params => {
params.method = `${defaultPath}delete.room.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getLiveRoomListApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi }
......@@ -81,9 +81,10 @@
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handlePush(scope.scope.id)">{{ targetId === scope.scope.id ? '已推送' + pushCountDown + 's' : '推送' }}</el-button>
<el-button type="text" @click="handleUpOrDown(scope.scope)">{{ scope.scope.onSale == '1' ? '下架' : '上架' }}</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button v-if="editForm.liveStatus == '101'" type="text" @click="handlePush(scope.scope.id)">{{ targetId === scope.scope.id ? '已推送' + pushCountDown + 's' : '推送' }}</el-button>
<!-- <el-button type="text" @click="handlePush(scope.scope.id)">{{ targetId === scope.scope.id ? '已推送' + pushCountDown + 's' : '推送' }}</el-button> -->
<el-button v-show="!targetId" type="text" @click="handleUpOrDown(scope.scope)">{{ scope.scope.onSale == '1' ? '下架' : '上架' }}</el-button>
<el-button v-show="!targetId" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
</div>
......@@ -136,7 +137,7 @@
</template>
<script>
import { getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi } from '@/api/modules/liveRoom'
import { getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi } from '@/api/modules/liveRoom'
// import selectMutiProDialog from './selectMutiProDialog'
import { liveStatusList } from '@/common/constant'
import selectMutiProDialog from '@/components/select-muti-pro'
......@@ -341,6 +342,47 @@ export default {
this.pushCountDown = 0
}
},
handleUpOrDown(row) {
var upOrDownTxt = row.onSale == '1' ? '下架' : '上架'
this.$messageBox.confirm('是否'+upOrDownTxt+'该商品?', upOrDownTxt, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
controlUpOrDownApi({ roomId: this.editForm.roomId, goodsId: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleConfigSearch()
}
})
}
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
controlDeleteApi({ roomId: this.editForm.roomId, goodsId: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleConfigSearch()
}
})
}
}
})
},
handleConfigImport() {
var that = this
this.getInfo(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!