Commit 266d0666 authored by chenwei's avatar chenwei

t年月日格式

parent 9aa24dd2
......@@ -10,14 +10,17 @@
</view>
<view class="container-main">
<view class="activity-title">{{
locale === 'zh' ? detailInfo.titleZh : detailInfo.titleEn
locale === "zh" ? detailInfo.titleZh : detailInfo.titleEn
}}</view>
<view class="activity-remark" v-if="detailInfo.type == 4" v-html="
<view
class="activity-remark"
v-if="detailInfo.type == 4"
v-html="
locale === 'zh_CN'
? detailInfo.extraShare.activityDescZh
: detailInfo.extraShare.activityDescEn
">
"
>
</view>
<view class="activity-cell">
<view class="cell-label">{{ detail.illustrate }}</view>
......@@ -29,7 +32,9 @@
<span v-if="detailInfo.type == 3">{{
detail.referralCodeLabel(detailInfo.getScoreOnce)
}}</span>
<view class="cell-text" v-if="detailInfo.type == '2'">{{detail.registerLabel(detailInfo.getScoreOnce)}}</view>
<view class="cell-text" v-if="detailInfo.type == '2'">{{
detail.registerLabel(detailInfo.getScoreOnce)
}}</view>
<view v-if="detailInfo.type == 1">
<view
class="rule"
......@@ -37,19 +42,18 @@
:key="ruleItem.low"
>
{{
detail.orderRuleLabel( {
detail.orderRuleLabel({
low: ruleItem.low,
high: ruleItem.high,
score: ruleItem.score,
unit:
detailInfo.extraOrderVtransportType == 1 ? "" : "kg",
unit: detailInfo.extraOrderVtransportType == 1 ? "" : "kg"
})
}}
</view>
</view>
</view>
</view>
<view class="activity-cell" v-if="detailInfo.type!=2">
<view class="activity-cell" v-if="detailInfo.type != 2">
<view class="cell-label">{{ detail.maxIntegral }}</view>
<view class="cell-content">
<image class="cell-image" src="../../static/img/score_b.png"></image>
......@@ -65,7 +69,7 @@
<view class="activity-cell">
<view class="cell-label">{{ detail.rulesIllustrate }}</view>
<view class="cell-content">
{{ locale === 'zh' ? detailInfo.descZh : detailInfo.descEn }}
{{ locale === "zh" ? detailInfo.descZh : detailInfo.descEn }}
</view>
</view>
</view>
......@@ -74,7 +78,7 @@
</template>
<script>
import dHeader from '../../components/dHeader/index.vue'
import dHeader from "../../components/dHeader/index.vue"
export default {
components: {
dHeader
......@@ -102,7 +106,7 @@ export default {
// 获取详情
getDetail() {
this.$request
.post('/app-api/member/score-rule/get', { id: this.id })
.post("/app-api/member/score-rule/get", { id: this.id })
.then(({ code, data }) => {
if (code === 0 && data) {
this.detailInfo = data
......@@ -114,12 +118,12 @@ export default {
const formatDate = (timestamp) => {
const date = new Date(timestamp)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}:${month}:${day}`
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
const hours = String(date.getHours()).padStart(2, "0")
const minutes = String(date.getMinutes()).padStart(2, "0")
const seconds = String(date.getSeconds()).padStart(2, "0")
return `${year}-${month}-${day}`
}
return `${formatDate(start)}${this.detail.to}${formatDate(end)}`
}
......
......@@ -18,18 +18,11 @@
</div>
<div class="nav">
<div class="nav-image">
<image
class="img"
:src="locale === 'zh' ? detailInfo.imgZh : detailInfo.imgEn"
></image>
<image class="img" :src="locale === 'zh' ? detailInfo.imgZh : detailInfo.imgEn"></image>
</div>
<div class="nav-content">
<div class="nav-content-text">
{{
locale === "zh"
? detailInfo.rewardTitleZh
: detailInfo.rewardTitleEn
}}
{{ locale === "zh" ? detailInfo.rewardTitleZh : detailInfo.rewardTitleEn }}
</div>
<div class="nav-content-tag">
<div class="tag-image">
......@@ -52,28 +45,20 @@
<div class="main-cell">
<div class="cell-label">{{ detail.exchangeOutlets }}</div>
<div class="cell-content">
{{
locale === "zh" ? detailInfo.nodeTitleZh : detailInfo.nodeTitleEn
}}
{{ locale === "zh" ? detailInfo.nodeTitleZh : detailInfo.nodeTitleEn }}
</div>
</div>
<div class="main-cell">
<div class="cell-label">{{ detail.exchangeType }}</div>
<div class="cell-content">
{{
locale === "zh"
? detailInfo.redeemTypeZh
: detailInfo.redeemTypeEn
}}
{{ locale === "zh" ? detailInfo.redeemTypeZh : detailInfo.redeemTypeEn }}
</div>
</div>
<template v-if="detailInfo.redeemType != 1">
<div class="main-cell">
<div class="cell-label">{{ detail.address }}</div>
<div class="cell-content">
{{ detailInfo.recipientName }}&ensp;+{{
detailInfo.recipientPhoneNum
}},
{{ detailInfo.recipientName }}&ensp;+{{ detailInfo.recipientPhoneNum }},
{{ detailInfo.recipientAddress }}
<view class="red">{{ detail.errorMsg }}</view>
</div>
......@@ -103,66 +88,64 @@
</template>
<script>
import dHeader from "../../components/dHeader/index.vue";
import dHeader from "../../components/dHeader/index.vue"
export default {
components: {
dHeader,
dHeader
},
data() {
return {
id: null,
detailInfo: {},
};
detailInfo: {}
}
},
onLoad(route) {
console.log(route);
this.id = route.id;
this.getDetail();
console.log(route)
this.id = route.id
this.getDetail()
},
computed: {
locale() {
return this.$lang.locale;
return this.$lang.locale
},
detail() {
return this.$lang.lang.detail;
},
return this.$lang.lang.detail
}
},
methods: {
// 获取详情
getDetail() {
this.$request
.post("/app-api/reward/redeem/record/detail", {
redeemId: this.id,
redeemId: this.id
})
.then(({ code, data }) => {
if (code == 0 && data) {
this.detailInfo = data;
this.detailInfo = data
}
})
.catch((error) => {
console.log(error);
});
console.log(error)
})
},
// 时间范围返回
getTimeRange(start, end) {
return `${this.formatDate(start)}${this.detail.to}${this.formatDate(
end
)}`;
return `${this.formatDate(start)}${this.detail.to}${this.formatDate(end)}`
},
// 时间戳转换为YYYY-MM-DD HH:mm:ss
formatDate(timestamp) {
if (!timestamp) return "";
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}:${month}:${day}`;
},
},
};
if (!timestamp) return ""
const date = new Date(timestamp)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, "0")
const day = String(date.getDate()).padStart(2, "0")
const hours = String(date.getHours()).padStart(2, "0")
const minutes = String(date.getMinutes()).padStart(2, "0")
const seconds = String(date.getSeconds()).padStart(2, "0")
return `${year}-${month}-${day}`
}
}
}
</script>
<style lang="scss">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment