From d15948b649a33f0ff0d2fd989678089f49fee8f3 Mon Sep 17 00:00:00 2001 From: xuwenbo <717567226@qq.com> Date: Sat, 5 Sep 2020 20:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2wxjava=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4roomid=E4=B8=8D=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=AD=A5=E6=97=B6=E5=80=99=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.js | 22 ++++++++++++++++++---- src/views/wechat/live/index.vue | 21 +++++++++++++++------ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index f61ed3f..e2758e4 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -54,7 +54,7 @@ export function parseTime(time, cFormat) { * @returns {string} */ export function formatTime(time, option) { - if(time == null) return '----' + if (time == null) return '----' if (('' + time).length === 10) { time = parseInt(time) * 1000 @@ -94,8 +94,23 @@ export function formatTime(time, option) { } export function formatTimeTwo(time) { - if(time == null) return "无" - //time = time * 1000 + if (time == null) return '无' + // time = time * 1000 + const d = new Date(time) + return ( + d.getFullYear() + '年' + + (d.getMonth() + 1) + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) +} +export function formatTimeThree(time) { + time = time * 1000 const d = new Date(time) return ( d.getFullYear() + '年' + @@ -109,7 +124,6 @@ export function formatTimeTwo(time) { '分' ) } - /** * @param {string} url * @returns {Object} diff --git a/src/views/wechat/live/index.vue b/src/views/wechat/live/index.vue index 579e605..b3e550f 100644 --- a/src/views/wechat/live/index.vue +++ b/src/views/wechat/live/index.vue @@ -88,7 +88,7 @@ - + - - + + + + + + @@ -188,15 +196,15 @@ import pagination from '@crud/Pagination' import MaterialList from '@/components/material' import LiveGoods from '@/views/components/livegoods' import udOperation from '@crud/UD.operation' - +import {formatTimeThree} from '@/utils/index' // crud交由presenter持有 const defaultCrud = CRUD({ optShow: { add: true, edit: false, del: false, download: true - },title: '直播房间', url: 'api/yxWechatLive', sort: 'roomId,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: null, screenType: null, closeLike: null,closeGoods: null, closeComment: null } + },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: null, screenType: null, closeLike: null,closeGoods: null, closeComment: null } export default { name: 'YxWechatLive', components: { pagination, crudOperation, rrOperation ,MaterialList,udOperation,LiveGoods}, @@ -258,6 +266,7 @@ export default { } }, methods: { + formatTimeThree, getGoods(p) { var ids = [] p.forEach((item,index) => {