This commit is contained in:
李志鹏
2026-06-01 13:55:39 +08:00
parent 5a85ff0189
commit e3c889c58a
9 changed files with 70 additions and 22 deletions

View File

@@ -1812,6 +1812,7 @@ export default {
price: "价格",
buyerUsername: "买家用户名",
date: "日期",
dateTimeFormat: 'YYYY-MM-DD<br/>HH:mm',
// 设置
notifications: "通知",
notificationsTitle: "新订单通知",

View File

@@ -1863,6 +1863,7 @@ export default {
price: "Price",
buyerUsername: "Buyer Username",
date: "Date",
dateTimeFormat: 'SM D, YYYY<br/> h:mm A',
// 设置
notifications: "Notifications",
notificationsTitle: "New order notification",

View File

@@ -709,3 +709,37 @@ export {
sketchToMask,
isValidUrl
}
/** 时间格式化-自定义格式
* @param value 时间对象|时间戳|时间字符串
* @param format 格式化字符串,默认值为 'YYYY-MM-DD HH:mm:ss'
* @returns 格式化后的时间字符串
*/
export function FormatDate(value, format = 'YYYY-MM-DD HH:mm:ss') {
const d = new Date(value);
if (!d || isNaN(d.getTime())) return 'Invalid Date';
const pad = (n) => String(n).padStart(2, '0');
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const tokens = {
YYYY: d.getFullYear(),
YY: String(d.getFullYear()).slice(-2),
MM: pad(d.getMonth() + 1),
M: d.getMonth() + 1,
SM: months[d.getMonth()],
DD: pad(d.getDate()),
D: d.getDate(),
HH: pad(d.getHours()),
H: d.getHours(),
hh: pad(d.getHours() % 12 || 12),
h: d.getHours() % 12 || 12,
mm: pad(d.getMinutes()),
m: d.getMinutes(),
ss: pad(d.getSeconds()),
s: d.getSeconds(),
A: d.getHours() < 12 ? 'AM' : 'PM',
a: d.getHours() < 12 ? 'am' : 'pm'
}
const reg = new RegExp(Object.keys(tokens).join('|'), 'g')
return format.replace(reg, match => tokens[match]);
}

View File

@@ -168,12 +168,18 @@
> .session {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
padding: 0.1rem;
> .content {
max-height: 100%;
padding: 2.4rem;
border: 1px solid #b0b0b0;
padding: 0.4rem 1.5rem;
border: 2rem solid transparent;
border-right-width: 0.4rem;
border-left-width: 0.4rem;
border-radius: 2.4rem;
overflow-y: auto;
box-shadow: 0 0 0 0.1rem #b0b0b0;
// margin: 0.2rem;
> .title {
font-size: 2.2rem;

View File

@@ -19,7 +19,7 @@
<button class="home-btn" @click="onBackToHome">
{{ $t("ApplySeller.backToHomepage") }}
</button>
<div class="tip">ID: {{ userId }}</div>
<!-- <div class="tip">ID: {{ userId }}</div> -->
</div>
</template>
@@ -63,7 +63,6 @@
<style scoped lang="less">
.seller-review {
margin: 0 auto;
width: 60rem;
height: 90%;
overflow-y: auto;
display: flex;
@@ -83,6 +82,7 @@
color: #000;
}
> .tip {
width: 66rem;
font-family: pingfang_regular;
font-size: 1.8rem;
line-height: 170%;
@@ -94,8 +94,8 @@
}
}
> .step-list {
width: 60rem;
margin: 2.6rem 0;
width: 100%;
padding: 1.6rem;
background-color: #f9f9f9;
display: flex;

View File

@@ -12,6 +12,7 @@
@realTime="onChange"
outputType="png"
:full="true"
:centerBox="centerBox"
></VueCropper>
</div>
<div class="clip_opterate">
@@ -57,6 +58,10 @@
type: {
type: String,
default: () => ""
},
centerBox: {
type: Boolean,
default: false
}
})
const attrs = useAttrs()

View File

@@ -37,7 +37,7 @@
<p class="tip">&nbsp;</p>
</template>
</div>
<image-clip-dialog ref="imageClipDialogRef" />
<image-clip-dialog ref="imageClipDialogRef" centerBox />
</template>
<script setup>
@@ -123,7 +123,7 @@
...res
}
try {
data.socialLinks = JSON.stringify(data.socialLinks)
data.socialLinks = JSON.stringify(data.socialLinks.filter((v) => v))
} catch (error) {
data.socialLinks = JSON.stringify([])
}

View File

@@ -42,27 +42,27 @@
<div class="item">
<div class="images">
<img
v-for="v in v.item.slice(0, maxItemNum)"
v-for="v in v.items.slice(0, maxItemNum)"
:key="v.id"
:src="v.url"
/>
<span v-if="v.item.length > maxItemNum"
>+{{ v.item.length - maxItemNum }} more</span
<span v-if="v.items.length > maxItemNum"
>+{{ v.items.length - maxItemNum }} more</span
>
</div>
<div class="titles">
<div v-for="v in v.item.slice(0, maxItemNum)" :key="v.id">
<div v-for="v in v.items.slice(0, maxItemNum)" :key="v.id">
{{ v.title }}
</div>
<span v-if="v.item.length > maxItemNum">...</span>
<span v-if="v.items.length > maxItemNum">...</span>
</div>
</div>
<div class="price">{{ v.price }}</div>
<div class="buyer-username">{{ v.username }}</div>
<div class="date">
<div>{{ v.date }}</div>
<div>{{ v.time }}</div>
</div>
<div
class="date"
v-html="FormatDate(v.date, $t('Seller.dateTimeFormat'))"
></div>
</div>
</div>
<div class="null" v-show="list.length === 0 && !loading && finish">
@@ -80,6 +80,7 @@
import { ref, onMounted, onBeforeUnmount, computed } from "vue"
import { Https } from "@/tool/https"
import { useI18n } from "vue-i18n"
import { FormatDate } from "@/tool/util"
const { t } = useI18n()
const totals_obj = ref({
totalRevenue: "--",
@@ -177,6 +178,7 @@
onBeforeUnmount(() => {
observer.disconnect()
})
const formatTimestamp = (ts) => {
const d = new Date(ts)
const h = d.getHours()

View File

@@ -147,15 +147,14 @@
.settings-index {
flex: 1;
overflow-y: auto;
margin: 0 16rem;
margin: 0 10rem;
padding: 0 6rem;
display: flex;
gap: 4.2rem;
> div {
flex: 1;
display: flex;
flex-direction: column;
gap: 4.2rem;
> div {
margin-bottom: 4.2rem;
border-radius: 1.2rem;
overflow: hidden;
border: 0.15rem solid #d1d1d1;