Commit 92be6719 authored by Smile's avatar Smile Committed by wux

feat:修改会员积分页面,隐藏积分兑换和积分活动页面,新增会员等级页面

parent 4e2a2b18
......@@ -8,6 +8,14 @@ export function logList(data) {
data
})
}
// 获取等级日志列表
export function levelLogList(data) {
return request({
url: '/admin-api/member/level-operate-log/page',
method: 'post',
data
})
}
// 获取兑换日志列表 礼品
export function exchangeLogList(data) {
......
......@@ -68,6 +68,7 @@ export default {
customer: 'customers',
integral: 'integral',
Integrallog: 'Integral log',
LevelLog: 'Level log',
ExchangeDetails: 'Exchange Details',
Exchangelog: 'Exchange log',
ExchangeOperate: 'Exchange Operate',
......
......@@ -30,6 +30,7 @@ export default {
advice: '咨询建议',
help: '帮助',
Integrallog: '积分日志',
LevelLog: '等级日志',
ExchangeDetails: '兑换详情',
Exchangelog: '兑换日志',
DetailsActivity: '活动详情',
......@@ -1186,6 +1187,7 @@ export default {
available: '可用积分为',
logPoints: '积分日志',
logExchange: '兑换日志',
logLevel: '等级日志',
redeemGifts: '兑换礼品',
pointsCampaign: '积分活动',
pointsTitle: '选择提货点',
......
......@@ -106,6 +106,12 @@ const jiedaoRouter = {
name: "ExchangeLog",
meta: { title: "Exchangelog" },
},
{
path: "jd-level-log",
component: () => import("@/views/jiedao/profile/levelLog"),
name: "LevelLog",
meta: { title: "LevelLog" },
},
{
path: "jd-exchange-operate",
component: () => import("@/views/jiedao/profile/exchangeOperate"),
......
......@@ -168,6 +168,8 @@ export const DICT_TYPE = {
YES_OR_NO: "yes_or_no",
CLIENT_PLATFORM: "client_platform",
MEMBER_SCORE_SOURCE: "member_score_source", //会员积分来源
MEMBERSHIP_LEVELS: "membership_levels", //会员等级
MEMBER_USER_OPERATE_LOG: "member_user_operate_log", //会员等级操作日志
};
/**
......
......@@ -32,18 +32,25 @@
<div class="divider-active" :style="{ width: `${score}%` }" />
</div>
</div>
<!--关闭兑换日志入口-->
<div class="header-menu">
<div class="menu-item" @click="toJump(1)">
{{ $t("integral.logPoints") }}&emsp;<i class="el-icon-arrow-right" />
</div>
<div class="menu-item" @click="toJump(2)">
<div class="menu-item" @click="toJump(2)" v-if="false">
{{ $t("integral.logExchange") }}&emsp;<i
class="el-icon-arrow-right"
/>
</div>
<div class="menu-item" @click="toJump(3)">
{{ $t("integral.logLevel") }}&emsp;<i
class="el-icon-arrow-right"
/>
</div>
</div>
</div>
<div class="nav">
<!--暂时关闭兑换礼品盒积分活动的入口-->
<div class="nav" v-if="false">
<div
class="nav-item"
:class="{ 'nav-item-active1': count == 1 }"
......@@ -59,8 +66,8 @@
{{ $t("integral.pointsCampaign") }}
</div>
</div>
<IntegralExchange v-show="count == 1" />
<IntegralActivity v-show="count == 2" />
<IntegralExchange v-show="count == 1" v-if="false" />
<IntegralActivity v-show="count == 2" v-if="false" />
</div>
</template>
<script>
......@@ -107,8 +114,14 @@ export default {
methods: {
// 跳转 日志
toJump(val) {
const path =
val === 1 ? '/jiedao/jd-integral-log' : '/jiedao/jd-exchange-log'
let path = ''
if (val === 1) {
path = '/jiedao/jd-integral-log'
} else if (val === 2) {
path = '/jiedao/jd-exchange-log'
} else {
path = '/jiedao/jd-level-log'
}
this.$router.push({ path })
},
// 获取个人积分信息
......@@ -135,6 +148,8 @@ export default {
background: #b9bcc8;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
box-sizing: border-box;
padding: 20px;
display: flex;
......
<template>
<div class="container">
<div v-for="(item, index) in list" :key="index" class="item">
<div class="item-title">
{{ formatLevelsDate(item.level) }}
</div>
<div class="item-box">
<div class="box-img">
<!-- <img class="imgs" :src="imgArr[item.sourceType]" />-->
</div>
<div class="box-content">
<div class="content-text">
{{ item.remarks }}
</div>
<div class="content-time">{{ formatDate(item.createTime) }}</div>
</div>
<div class="box-right">
<div v-if="item.expired" class="box-right-img">
<img class="imgs" src="@/assets/log/overdue.png" alt/>
</div>
<div class="box-right-text">
{{formatOperateDate(item.operateType)}}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { levelLogList } from '@/api/log'
import { DICT_TYPE } from '@/utils/dict'
export default {
data() {
return {
list: []
}
},
computed: {
locale() {
return this.$store.getters.language
},
levels() {
return this.getDictDatas(DICT_TYPE.MEMBERSHIP_LEVELS)
},
operateTypeList() {
return this.getDictDatas(DICT_TYPE.MEMBER_USER_OPERATE_LOG)
}
},
created() {
this.getList()
},
methods: {
formatLevelsDate(val) {
const item = this.levels.filter(item => val === item.value)[0]
return this.locale === 'zh_CN' ? item.label : item.labelEn
},
formatOperateDate(val) {
const item = this.operateTypeList.filter(item => val === item.value)[0]
return this.locale === 'zh_CN' ? item.label : item.labelEn
},
async getList() {
try {
const id = this.$store.getters.id
const { code, data } = await levelLogList({ memberId: id })
if (code === 0) {
this.list = data.list
}
} catch (err) {
console.log(err)
}
},
// 时间戳转换为YYYY-MM-DD HH:mm:ss
formatDate(time) {
const date = new Date(time)
const Y = date.getFullYear() + '-'
const M =
(date.getMonth() + 1 < 10
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1) + '-'
const D = `${date.getDate()}`.padStart(2, '0') + ' '
const h = `${date.getHours()}`.padStart(2, '0') + ':'
const m = `${date.getMinutes()}`.padStart(2, '0') + ':'
const s = `${date.getSeconds()}`.padStart(2, '0')
return Y + M + D + h + m + s
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 10px;
box-sizing: border-box;
.item {
padding: 10px 15px 15px 15px;
margin-bottom: 10px;
width: 100%;
box-sizing: border-box;
border-radius: 8px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.1);
}
}
.item-title {
font-size: 14px;
font-weight: 500;
margin-bottom: 10px;
}
.item-box {
width: 100%;
display: flex;
box-sizing: border-box;
}
.box-img {
width: 50px;
height: 60px;
margin-right: 10px;
display: flex;
align-items: center;
justify-content: center;
.imgs {
width: 50px;
height: 50px;
object-fit: cover;
}
}
.box-content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
.content-text {
font-size: 14px;
color: #7f7f7f;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
overflow: hidden;
}
.content-time {
font-size: 12px;
color: #7f7f7f;
}
}
.box-right {
margin-left: 5px;
width: 60px;
height: 60px;
display: flex;
align-items: flex-end;
flex-direction: column;
justify-content: space-between;
border-radius: 50%;
font-size: 12px;
color: #333333;
.box-right-text {
margin-top: auto;
}
}
.box-right-img {
transform: translate(10px, -30px);
width: 60px;
height: 60px;
.imgs {
width: 100%;
height: 100%;
object-fit: cover;
}
}
</style>
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