Commit cf29e757 authored by chenwei's avatar chenwei

Merge branch 'feature' into 'dev'

t年月日格式

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