From 2febfcd87c3ed9463b96ad314c78939fd9dcc832 Mon Sep 17 00:00:00 2001
From: Hong <1470048117@qq.com>
Date: Sat, 13 Jul 2024 14:55:23 +0800
Subject: [PATCH] =?UTF-8?q?7.13(=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/index/index.vue | 32 ++-----
pages/login/weixin-login.vue | 2 +-
pages/serve/coupons/cou_detail.vue | 2 +-
pages/serve/coupons/cou_store.vue | 2 +-
pages/serve/hot_list.vue | 6 +-
pages/serve/index.vue | 132 ++++++++++++++++-------------
pages/showroom/index.vue | 2 +-
7 files changed, 89 insertions(+), 89 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index fe32cd5..c5881be 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -116,7 +116,7 @@
{{item.authorName}}
- {{item.city || "未知"}} {{item.diffDays}}天前
+ {{item.city || "未知"}} {{item.createTime|filtersTime}}
@@ -292,7 +292,8 @@
} from "@/api/system/user.js"
import {
shareApi,
- formatNumber
+ formatNumber,
+ getTimeDifference
} from "@/utils/index.js"
import promptBox from "@/components/prompt-box/prompt-box.vue"
import popupbox from "@/components/prompt-box/popupbox.vue"
@@ -320,6 +321,11 @@
popupbox
},
filters: {
+ filtersTime(value) {
+ // console.log(value);
+ if (!value) return '--';
+ return getTimeDifference(value);
+ },
filtersLikeNum(value) {
if (!value) return 0;
return formatNumber(value);
@@ -669,13 +675,6 @@
item.wide = uni.$u.getPx(`${item.wide}rpx`) * num + 'rpx'
item.high = uni.$u.getPx(`${item.high}rpx`) * num + 'rpx'
}
- const date1 = new Date();
- const date2 = new Date(item.createTime);
- // 计算相差的毫秒数
- const diffTime = Math.abs(date2 - date1);
- // 将毫秒数转换为天数
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
- item.diffDays = diffDays
})
this.$refs.paging.complete(res.data.list);
}).catch(err => {
@@ -709,13 +708,6 @@
// item.high = this.pxToRpx(item.high) + 'rpx'
// }
}
- const date1 = new Date();
- const date2 = new Date(item.createTime);
- // 计算相差的毫秒数
- const diffTime = Math.abs(date2 - date1);
- // 将毫秒数转换为天数
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
- item.diffDays = diffDays
})
this.$refs.paging.complete(res.data.list);
}).catch(err => {
@@ -758,14 +750,6 @@
// item.high = this.pxToRpx(item.high) + 'rpx'
// }
}
-
- const date1 = new Date();
- const date2 = new Date(item.createTime);
- // 计算相差的毫秒数
- const diffTime = Math.abs(date2 - date1);
- // 将毫秒数转换为天数
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
- item.diffDays = diffDays
})
this.$refs.paging.complete(res.data.list);
}).catch(err => {
diff --git a/pages/login/weixin-login.vue b/pages/login/weixin-login.vue
index 17c5f48..2c2c7fa 100644
--- a/pages/login/weixin-login.vue
+++ b/pages/login/weixin-login.vue
@@ -4,7 +4,7 @@
-
+
用户协议与隐私政策
diff --git a/pages/serve/coupons/cou_detail.vue b/pages/serve/coupons/cou_detail.vue
index cbd58ca..2f254e3 100644
--- a/pages/serve/coupons/cou_detail.vue
+++ b/pages/serve/coupons/cou_detail.vue
@@ -104,7 +104,7 @@
-
+
{{merchantObj.name ? merchantObj.name : '--'}}
diff --git a/pages/serve/coupons/cou_store.vue b/pages/serve/coupons/cou_store.vue
index 2a47f45..39e3b59 100644
--- a/pages/serve/coupons/cou_store.vue
+++ b/pages/serve/coupons/cou_store.vue
@@ -6,7 +6,7 @@