From e529a4de517fbd6610580b8461c6bef99f3e6f41 Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Fri, 11 Sep 2020 22:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=92=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=95=86=E5=93=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/yxWechatLive.js | 10 ++- src/views/components/livegoods/index.vue | 17 ++-- src/views/wechat/live/index.vue | 108 ++++++++++++----------- 3 files changed, 70 insertions(+), 65 deletions(-) diff --git a/src/api/yxWechatLive.js b/src/api/yxWechatLive.js index aa92c51..320d7e7 100644 --- a/src/api/yxWechatLive.js +++ b/src/api/yxWechatLive.js @@ -30,4 +30,12 @@ export function sync() { method: 'get' }) } -export default { add, edit, del, sync } + +export function addGoods(data) { + return request({ + url: 'api/yxWechatLive/addGoods', + method: 'post', + data + }) +} +export default { add, edit, del, sync, addGoods } diff --git a/src/views/components/livegoods/index.vue b/src/views/components/livegoods/index.vue index 298b1b3..43cf972 100644 --- a/src/views/components/livegoods/index.vue +++ b/src/views/components/livegoods/index.vue @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - @@ -240,6 +213,7 @@ import MaterialList from '@/components/material' import LiveGoods from '@/views/components/livegoods' import udOperation from '@crud/UD.operation' import {formatTimeThree} from '@/utils/index' +import { addGoods } from '@/api/yxWechatLive' // crud交由presenter持有 const defaultCrud = CRUD({ optShow: { add: true, @@ -247,13 +221,14 @@ const defaultCrud = CRUD({ optShow: { del: false, download: true },title: '直播房间', url: 'api/yxWechatLive', sort: 'room_id,desc', crudMethod: { ...crudYxWechatLive }}) -const defaultForm = { product: [],roomId: null,productId: null, name: null, coverImge: null, startDate: null, endDate : null,shareImge: null, liveStatus: null, coverImgArr: [],shareImgArr: [],anchorImgArr: [],startTime: null, endTime: null, anchorName: null, anchorWechat: null, anchorImge: null, type: 1, screenType: 0, closeLike: 0,closeGoods: 0, closeComment: 0,closeReplay: 0,closeShare:0,closeKf:0 } +const defaultForm = { product: [],roomId: null,productId: null, name: null, coverImge: null, startDate: null, endDate : null,shareImge: null, liveStatus: null, coverImgArr: [],shareImgArr: [],anchorImgArr: [],startTime: null, endTime: null, anchorName: null, anchorWechat: null, anchorImge: null, type: 0, screenType: 0, closeLike: 0,closeGoods: 0, closeComment: 0,closeReplay: 0,closeShare:0,closeKf:0 } export default { name: 'YxWechatLive', components: { pagination, crudOperation, rrOperation ,MaterialList,udOperation,LiveGoods}, mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()], data() { return { + closeDialogVisible:false, disabled: false, syncLoading: false, permission: { @@ -309,6 +284,33 @@ export default { } }, methods: { + closeDialog(){ + this.form.product = [] + this.closeDialogVisible=false; + }, + showCloseOrderDialog(row){ + this.closeDialogVisible=true; + this.form.roomId = row.id; + this.form.product = row.product + }, + handleCloseOrder(){ + this.$confirm('是否提交?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let params ={ + "roomId": this.form.roomId, + "productId": this.form.productId + } + addGoods(params).then(res=>{ + console.log(res,89888) + this.closeDialogVisible=true; + }).catch(err => { + + }) + }); + }, formatTimeThree, getGoods(p) { var ids = []