From d6ea232b812537384f4fbd99aba4064da28c2b96 Mon Sep 17 00:00:00 2001 From: Jruome <2559028966@qq.com> Date: Thu, 1 Jun 2023 11:24:27 +0800 Subject: [PATCH] =?UTF-8?q?uniapp=20=E6=97=B6=E9=97=B4=E6=88=B3=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-app/pages/index/index.vue | 8 ++--- yudao-ui-app/pages/member_record/index.vue | 2 +- yudao-ui-app/pages/notice/index.vue | 7 +++-- yudao-ui-app/pages/sale_performance/index.vue | 30 +++++++++---------- yudao-ui-app/utils/util.js | 14 +++++++++ 5 files changed, 39 insertions(+), 22 deletions(-) diff --git a/yudao-ui-app/pages/index/index.vue b/yudao-ui-app/pages/index/index.vue index 8a907d1f1..bf8723fdf 100644 --- a/yudao-ui-app/pages/index/index.vue +++ b/yudao-ui-app/pages/index/index.vue @@ -28,14 +28,14 @@ - 会员等级1级 + 会员等级{{vipData.findIndex((item) => item == vip.grade) +1}}级 查看权益 - 会员等级0级 + 会员等级{{vipData.findIndex((item) => item == vip.grade) +1}}级 申请会员 @@ -223,7 +223,7 @@ bastInfo: '', fastInfo: '', fastList: [], - text: '尊敬的业主:接环卫所通知,近期将对小区进行大扫除,请大家做好准备', + text: '暂无公告', firstInfo: '', salesInfo: '', indicatorDots: false, @@ -286,7 +286,7 @@ lineColor: 'red', lineStyle: {}, // 下划线位置--动态甲酸 listActive: 0, // 当前选中项 - + vipData:['普通会员','中级会员','高级会员'], duration: 0.2 // 下划线动画时长 } }, diff --git a/yudao-ui-app/pages/member_record/index.vue b/yudao-ui-app/pages/member_record/index.vue index 210e517be..db23f8851 100644 --- a/yudao-ui-app/pages/member_record/index.vue +++ b/yudao-ui-app/pages/member_record/index.vue @@ -14,7 +14,7 @@ 充值档次:{{item.grade}} - 日期:{{item.stringCreateTime}} + 日期:{{$util.timestampToTime(item.stringCreateTime)}} diff --git a/yudao-ui-app/pages/notice/index.vue b/yudao-ui-app/pages/notice/index.vue index 782f84bae..5838f4d3d 100644 --- a/yudao-ui-app/pages/notice/index.vue +++ b/yudao-ui-app/pages/notice/index.vue @@ -15,6 +15,9 @@ import { setVisit, getUserInfo } from '@/api/user.js' + import { + mapGetters + } from "vuex"; export default { data(){ return { @@ -23,11 +26,11 @@ export default { userInfo: {} } }, + computed: mapGetters(['tenantId']), mounted(){ getUserInfo().then(res => { this.userInfo = res.data - console.log(res.data) - getTenant(153).then(res => { + getTenant(this.tenantId).then(res => { this.tenant = res.data this.text = res.data.notice }) diff --git a/yudao-ui-app/pages/sale_performance/index.vue b/yudao-ui-app/pages/sale_performance/index.vue index 85bd0b4fb..e7e53ee0b 100644 --- a/yudao-ui-app/pages/sale_performance/index.vue +++ b/yudao-ui-app/pages/sale_performance/index.vue @@ -67,7 +67,7 @@ {{item.nickname}} - {{ timestampToTime(item.payTime) }} + {{ $util.timestampToTime(item.payTime) }} {{ item.grade }} @@ -152,20 +152,20 @@ } }, methods: { - timestampToTime(timestamp) { - // 时间戳为10位需*1000,时间戳为13位不需乘1000 - var date = new Date(timestamp); - var Y = date.getFullYear() + "-"; - var M = - (date.getMonth() + 1 < 10 - ? "0" + (date.getMonth() + 1) - : date.getMonth() + 1) + "-"; - var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; - var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"; - var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"; - var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()); - return Y + M + D + h + m + s; - }, + // timestampToTime(timestamp) { + // // 时间戳为10位需*1000,时间戳为13位不需乘1000 + // var date = new Date(timestamp); + // var Y = date.getFullYear() + "-"; + // var M = + // (date.getMonth() + 1 < 10 + // ? "0" + (date.getMonth() + 1) + // : date.getMonth() + 1) + "-"; + // var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; + // var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"; + // var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"; + // var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()); + // return Y + M + D + h + m + s; + // }, selectClick(value) { console.log(value) this.active = value.id diff --git a/yudao-ui-app/utils/util.js b/yudao-ui-app/utils/util.js index cf193f044..37dfd4d82 100644 --- a/yudao-ui-app/utils/util.js +++ b/yudao-ui-app/utils/util.js @@ -8,6 +8,20 @@ import { pathToBase64 } from '@/plugin/image-tools/index.js'; export default { + timestampToTime(timestamp) { + // 时间戳为10位需*1000,时间戳为13位不需乘1000 + var date = new Date(timestamp); + var Y = date.getFullYear() + "-"; + var M = + (date.getMonth() + 1 < 10 + ? "0" + (date.getMonth() + 1) + : date.getMonth() + 1) + "-"; + var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "; + var h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"; + var m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"; + var s = (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()); + return Y + M + D + h + m + s; + }, /** * opt object | string * to_url object | string