feat(mine): 我的页面根据会员号隐藏奖衔内容

This commit is contained in:
woody 2025-05-27 11:03:22 +08:00
parent b66e3243de
commit bf2230600d
1 changed files with 291 additions and 272 deletions

View File

@ -20,13 +20,10 @@
<view class="left_text">
<view class="name_box">
<view class="tTit1">{{ userInfo.memberCode }}</view>
</view>
<view class="cmem">
<view
style="margin-right: 20rpx; display: flex;"
>
<view style="margin-right: 10rpx;">{{ '结算等级' }}:</view>
<view style="margin-right: 20rpx; display: flex">
<view style="margin-right: 10rpx">{{ '结算等级' }}:</view>
<view class="jxTit1">{{ userInfo.pkGradeVal }}</view>
</view>
<view class="grade_left">
@ -43,11 +40,10 @@
</view>
</view>
<view class="cmem">
<view style="margin-right: 10rpx;">{{ '荣誉奖衔' }}:</view>
<view style="margin-right: 10rpx">{{ '荣誉奖衔' }}:</view>
<view class="jxTit1">{{ userInfo.pkAwardsVal }}</view>
</view>
</view>
</view>
<view class="top_right" @click="goTo('/pages/userData/index')">
<view class="ricon">
@ -57,7 +53,6 @@
</view>
</view>
<view class="ju_grade" v-if="!ifSpecial">
<!-- <view v-if="awards.tarAwardsName" class="awards-progress-summary" style="text-align: center;">
<span class="descriptive-text">当前距离</span>
@ -92,7 +87,13 @@
</view>
<view class="yestDay">
<view class="yes_t">昨日业绩</view>
<view :class="awards.aNewPv!=0&&awards.bNewPv!=0?'ju_left_bottom1':'ju_left_bottom'">
<view
:class="
awards.aNewPv != 0 && awards.bNewPv != 0
? 'ju_left_bottom1'
: 'ju_left_bottom'
"
>
<view
class="current-progress"
:style="{
@ -106,7 +107,13 @@
</view>
<view class="yestDay">
<view class="yes_t">当月业绩</view>
<view :class="awards.aMonthPv!=0&&awards.bMonthPv!=0?'ju_left_bottom1':'ju_left_bottom'">
<view
:class="
awards.aMonthPv != 0 && awards.bMonthPv != 0
? 'ju_left_bottom1'
: 'ju_left_bottom'
"
>
<view
class="current-progress"
:style="{
@ -114,14 +121,20 @@
}"
></view>
<view class="cha">
左区 {{ awards.aMonthPv || "0.00" }}/右区 {{ awards.bMonthPv || "0.00" }}
左区 {{ awards.aMonthPv || '0.00' }}/右区
{{ awards.bMonthPv || '0.00' }}
</view>
</view>
</view>
<view class="yestDay">
<view class="yes_t">{{ '历史业绩' }}</view>
<view :class="awards.aSumPv!=0&&awards.bSumPv!=0?'ju_left_bottom1':'ju_left_bottom'">
<view
:class="
awards.aSumPv != 0 && awards.bSumPv != 0
? 'ju_left_bottom1'
: 'ju_left_bottom'
"
>
<view
class="current-progress"
:style="{
@ -133,7 +146,6 @@
>
</view>
</view>
</view>
</view>
</view>
@ -281,13 +293,13 @@
</template>
<script>
import clTabbar from "@/components/cl-tabbar.vue";
import * as min from "@/config/balance.js";
import * as api from "@/config/login.js";
import clTabbar from '@/components/cl-tabbar.vue'
import * as min from '@/config/balance.js'
import * as api from '@/config/login.js'
// import talentList from "@/components/talentList.vue";
export default {
components: {
"cl-tabbar": clTabbar,
'cl-tabbar': clTabbar,
// talentList,
},
data() {
@ -297,76 +309,76 @@ export default {
userInfo: {},
userData: {},
pswShow: false,
password: "",
waitPayNum: "",
payNum: "",
password: '',
waitPayNum: '',
payNum: '',
awards: {},
markMenuList: [
{
url: "/pages/performanceEchart/index",
url: '/pages/performanceEchart/index',
name: '数据查询',
imgurl: "../../static/images/mark1.png",
menuKey: "marketDynamics",
imgurl: '../../static/images/mark1.png',
menuKey: 'marketDynamics',
ifshow: true,
},
{
url: "/pages/bonus/index",
url: '/pages/bonus/index',
name: '奖金明细',
imgurl: "../../static/images/mark2.png",
menuKey: "incomeDetail",
imgurl: '../../static/images/mark2.png',
menuKey: 'incomeDetail',
ifshow: false,
},
{
url: "/pages/market/examineDetail/examineDetail",
url: '/pages/market/examineDetail/examineDetail',
name: '考核明细',
imgurl: "../../static/images/mark5.png",
menuKey: "appraisal",
imgurl: '../../static/images/mark5.png',
menuKey: 'appraisal',
ifshow: false,
},
{
url: "/pages/market/registerList/registerList",
url: '/pages/market/registerList/registerList',
name: '注册列表',
imgurl: "../../static/images/mark6.png",
menuKey: "registration",
imgurl: '../../static/images/mark6.png',
menuKey: 'registration',
ifshow: false,
},
{
url: "/pages/market/investmentList/investmentList",
url: '/pages/market/investmentList/investmentList',
name: '招商列表',
imgurl: "../../static/images/mark7.png",
menuKey: "investment",
imgurl: '../../static/images/mark7.png',
menuKey: 'investment',
ifshow: false,
},
{
url: "/pages/market/activeArea/index",
url: '/pages/market/activeArea/index',
name: '活动专区',
imgurl: "../../static/images/mark9.png",
menuKey: "activeZone",
imgurl: '../../static/images/mark9.png',
menuKey: 'activeZone',
ifshow: false,
},
{
url: "/pages/architecture/architecture",
url: '/pages/architecture/architecture',
name: '架构管理',
imgurl: "../../static/images/my_icon14.png",
menuKey: "recommend",
imgurl: '../../static/images/my_icon14.png',
menuKey: 'recommend',
ifshow: false,
},
],
otherMenuList: [
{
url: "1",
url: '1',
name: '我的钱包',
imgurl: "../../static/images/my_icon1.png",
menuKey: "wallet",
imgurl: '../../static/images/my_icon1.png',
menuKey: 'wallet',
ifshow: false,
},
{
url: "/pages/pickupArea/pickupArea",
url: '/pages/pickupArea/pickupArea',
name: '提货专区',
imgurl: "../../static/images/my_icon3.png",
menuKey: "pickGoods",
imgurl: '../../static/images/my_icon3.png',
menuKey: 'pickGoods',
ifshow: false,
},
// {
@ -377,38 +389,38 @@ export default {
// ifshow: false,
// },
{
url: "/pages/makerspaceView/index",
url: '/pages/makerspaceView/index',
name: '创客空间认证',
imgurl: "../../static/images/my_icon5.png",
menuKey: "space",
imgurl: '../../static/images/my_icon5.png',
menuKey: 'space',
ifshow: false,
},
{
url: "/pages/selfService/index",
url: '/pages/selfService/index',
name: '自助服务',
imgurl: "../../static/images/my_icon6.png",
menuKey: "selfHelp",
imgurl: '../../static/images/my_icon6.png',
menuKey: 'selfHelp',
ifshow: false,
},
{
url: "/pages/userSecure/index",
url: '/pages/userSecure/index',
name: '账号安全',
imgurl: "../../static/images/my_icon8.png",
menuKey: "",
imgurl: '../../static/images/my_icon8.png',
menuKey: '',
ifshow: false,
},
{
url: "/pages/addressList/index",
url: '/pages/addressList/index',
name: '地址管理',
imgurl: "../../static/images/my_icon9.png",
menuKey: "",
imgurl: '../../static/images/my_icon9.png',
menuKey: '',
ifshow: false,
},
{
url: "/pages/mine/bindBank/index",
url: '/pages/mine/bindBank/index',
name: '银行信息',
imgurl: "../../static/images/my_icon10.png",
menuKey: "",
imgurl: '../../static/images/my_icon10.png',
menuKey: '',
ifshow: false,
},
// {
@ -455,133 +467,137 @@ export default {
// ifshow: false,
// },
{
url: "/pages/mine/addNewPv/index",
url: '/pages/mine/addNewPv/index',
name: '新增业绩',
imgurl: "../../static/images/mark9.png",
menuKey: "iNewAchievement",
imgurl: '../../static/images/mark9.png',
menuKey: 'iNewAchievement',
ifshow: false,
},
],
drShow: false,
actMenu: false,
iHonorAward: false,
ifSpecial: false,
awardsList: "",
};
awardsList: '',
}
},
onShow() {
this.getInfo();
this.orderNum();
this.getUserAwardss();
this.getInfo()
this.orderNum()
this.getUserAwardss()
},
computed: {
sprintProgress() {
const targetPvStr = this.awards.targetPv;
const sumRealPvStr = this.awards.sumRealPv; // ""
const targetPvStr = this.awards.targetPv
const sumRealPvStr = this.awards.sumRealPv // ""
const targetPv = parseFloat(targetPvStr);
const sumRealPv = parseFloat(sumRealPvStr);
const targetPv = parseFloat(targetPvStr)
const sumRealPv = parseFloat(sumRealPvStr)
let achievedPv = 0;
let percentage = 0;
const numericTargetPv = Math.floor((isNaN(targetPv) ? 0 : targetPv) * 100) / 100;
let achievedPv = 0
let percentage = 0
const numericTargetPv =
Math.floor((isNaN(targetPv) ? 0 : targetPv) * 100) / 100
if (!isNaN(targetPv) && targetPv > 0) {
// sumRealPv targetPv - sumRealPv
achievedPv = targetPv - (isNaN(sumRealPv) ? 0 : sumRealPv);
achievedPv = targetPv - (isNaN(sumRealPv) ? 0 : sumRealPv)
achievedPv = Math.max(0, Math.min(achievedPv, targetPv));
achievedPv = Math.max(0, Math.min(achievedPv, targetPv))
percentage = (sumRealPvStr / targetPv) * 100;
} else if (!isNaN(targetPv) && targetPv === 0 && !isNaN(sumRealPv) && sumRealPv <=0) {
percentage = (sumRealPvStr / targetPv) * 100
} else if (
!isNaN(targetPv) &&
targetPv === 0 &&
!isNaN(sumRealPv) &&
sumRealPv <= 0
) {
// 000100%
achievedPv = 0;
percentage = 100;
achievedPv = 0
percentage = 100
}
const clampedPercentage = Math.min(100, Math.max(0, percentage));
const clampedPercentage = Math.min(100, Math.max(0, percentage))
return {
percentageString: `${Math.floor(clampedPercentage)}%`,
achieved: (Math.floor(achievedPv * 100) / 100).toFixed(2),
target: numericTargetPv.toFixed(2),
rawPercentage: clampedPercentage
};
rawPercentage: clampedPercentage,
}
},
},
methods: {
goYear() {
uni.navigateTo({
url: "/pages/mine/yearGift/index",
});
url: '/pages/mine/yearGift/index',
})
},
closeShow() {
this.drShow = false;
this.drShow = false
},
goHonoray() {
uni.navigateTo({
url: "/pages/mine/honoraryAwards/honoraryAwards",
});
url: '/pages/mine/honoraryAwards/honoraryAwards',
})
},
//
getUserAwardss() {
api.getUserAwards().then((res) => {
this.awards = res.data || {};
});
api.getUserAwards().then(res => {
this.awards = res.data || {}
})
},
GetPercent(num, total) {
num = parseFloat(num);
total = parseFloat(total);
num = parseFloat(num)
total = parseFloat(total)
if (isNaN(num) || isNaN(total)) {
return "-";
return '-'
}
if (total == 0) {
return "0%";
return '0%'
} else if (total < 0) {
return 100 + "%";
return 100 + '%'
} else {
return Math.round((num / total) * 10000) / 100.0 + "%";
return Math.round((num / total) * 10000) / 100.0 + '%'
}
},
yesPercent(left, right) {
left = parseFloat(left);
right = parseFloat(right);
left = parseFloat(left)
right = parseFloat(right)
if (isNaN(left) || isNaN(right)) {
return '0%';
return '0%'
}
return right + left == 0
? "0%"
: Math.round((left / (right + left)) * 10000) / 100.0 + "%";
? '0%'
: Math.round((left / (right + left)) * 10000) / 100.0 + '%'
},
orderNum() {
api.orderNum().then((res) => {
this.waitPayNum = res.data.waitPayNum;
this.payNum = res.data.payNum;
});
api.orderNum().then(res => {
this.waitPayNum = res.data.waitPayNum
this.payNum = res.data.payNum
})
},
getInfo() {
api.getInfo().then((res) => {
api.getInfo().then(res => {
if (res) {
this.userInfo = res.data;
if (this.userInfo.memberCode == "CN688806280001") {
this.ifSpecial = true;
this.userInfo = res.data
if (this.userInfo.memberCode == 'CN68880628') {
this.ifSpecial = true
this.otherMenuList = [
{
url: "1",
url: '1',
name: '我的钱包',
imgurl: "../../static/images/my_icon1.png",
menuKey: "wallet",
imgurl: '../../static/images/my_icon1.png',
menuKey: 'wallet',
ifshow: false,
},
{
url: "/pages/pickupArea/pickupArea",
url: '/pages/pickupArea/pickupArea',
name: '提货专区',
imgurl: "../../static/images/my_icon3.png",
menuKey: "pickGoods",
imgurl: '../../static/images/my_icon3.png',
menuKey: 'pickGoods',
ifshow: true,
},
// {
@ -592,80 +608,80 @@ export default {
// ifshow: false,
// },
{
url: "/pages/makerspaceView/index",
url: '/pages/makerspaceView/index',
name: '创客空间认证',
imgurl: "../../static/images/my_icon5.png",
menuKey: "space",
imgurl: '../../static/images/my_icon5.png',
menuKey: 'space',
ifshow: false,
},
{
url: "/pages/selfService/index",
url: '/pages/selfService/index',
name: '自助服务',
imgurl: "../../static/images/my_icon6.png",
menuKey: "selfHelp",
imgurl: '../../static/images/my_icon6.png',
menuKey: 'selfHelp',
ifshow: true,
},
{
url: "/pages/userSecure/index",
url: '/pages/userSecure/index',
name: '账号安全',
imgurl: "../../static/images/my_icon8.png",
menuKey: "",
imgurl: '../../static/images/my_icon8.png',
menuKey: '',
ifshow: true,
},
{
url: "/pages/addressList/index",
url: '/pages/addressList/index',
name: '地址管理',
imgurl: "../../static/images/my_icon9.png",
menuKey: "",
imgurl: '../../static/images/my_icon9.png',
menuKey: '',
ifshow: true,
},
{
url: "/pages/mine/bindBank/index",
url: '/pages/mine/bindBank/index',
name: '银行信息',
imgurl: "../../static/images/my_icon10.png",
menuKey: "",
imgurl: '../../static/images/my_icon10.png',
menuKey: '',
ifshow: false,
},
{
url: "2",
name: "达人榜单",
imgurl: "../../static/images/my_icon10.png",
menuKey: "",
url: '2',
name: '达人榜单',
imgurl: '../../static/images/my_icon10.png',
menuKey: '',
ifdr: 1,
ifshow: false,
},
{
url: "/pages/mine/myMarket/myMarket",
url: '/pages/mine/myMarket/myMarket',
name: '我的市场',
imgurl: "../../static/images/my_icon9.png",
menuKey: "",
imgurl: '../../static/images/my_icon9.png',
menuKey: '',
ifshow: true,
},
{
url: "/pages/mine/globalDistribution/globalDistribution",
url: '/pages/mine/globalDistribution/globalDistribution',
name: '全球分布',
imgurl: "../../static/images/my_icon9.png",
menuKey: "",
imgurl: '../../static/images/my_icon9.png',
menuKey: '',
},
{
url: "/pages/mine/honorHall/honorHall",
name: "荣誉馆",
imgurl: "../../static/images/my_icon9.png",
menuKey: "",
url: '/pages/mine/honorHall/honorHall',
name: '荣誉馆',
imgurl: '../../static/images/my_icon9.png',
menuKey: '',
ifshow: false,
},
{
url: "/pages/mine/giftAddress/list",
url: '/pages/mine/giftAddress/list',
name: '礼品地址',
imgurl: "../../static/images/mark9.png",
menuKey: "",
imgurl: '../../static/images/mark9.png',
menuKey: '',
ifshow: false,
},
{
url: "/pages/mine/space/list",
url: '/pages/mine/space/list',
name: '创客空间',
imgurl: "../../static/images/mark9.png",
menuKey: "",
imgurl: '../../static/images/mark9.png',
menuKey: '',
ifshow: false,
},
// {
@ -676,110 +692,110 @@ export default {
// ifshow: false,
// },
];
]
} else {
this.ifSpecial = false;
this.ifSpecial = false
}
}
});
api.getData().then((res) => {
})
api.getData().then(res => {
if (res.code == 200) {
this.userData = res.data;
this.userData = res.data
}
});
})
api.getMenuList().then((res) => {
res.data.forEach((item) => {
if (item.menuKey == "iHonorAward") {
this.iHonorAward = true;
api.getMenuList().then(res => {
res.data.forEach(item => {
if (item.menuKey == 'iHonorAward') {
this.iHonorAward = true
}
this.markMenuList.forEach((ele) => {
if (ele.menuKey == item.menuKey || ele.menuKey == "") {
ele.ifshow = true;
this.markMenuList.forEach(ele => {
if (ele.menuKey == item.menuKey || ele.menuKey == '') {
ele.ifshow = true
}
});
this.otherMenuList.forEach((ele) => {
if (ele.menuKey == item.menuKey || ele.menuKey == "") {
ele.ifshow = true;
})
this.otherMenuList.forEach(ele => {
if (ele.menuKey == item.menuKey || ele.menuKey == '') {
ele.ifshow = true
}
});
});
console.log("🌈ad", this.otherMenuList);
})
})
console.log('🌈ad', this.otherMenuList)
let a = this.markMenuList.some((item) => {
return item.ifshow == true;
});
this.actMenu = a;
});
let a = this.markMenuList.some(item => {
return item.ifshow == true
})
this.actMenu = a
})
// api.memberAwards().then((res) => {
// this.awardsList = res.data;
// });
},
goTo(url) {
if (url == 1) {
this.pswShow = true;
this.pswShow = true
} else if (url == 2) {
//
this.drShow = true;
this.drShow = true
} else {
uni.navigateTo({
url: url,
});
})
}
},
goOrder(index) {
//
uni.navigateTo({
url: "/pages/mine/order/index?isTab=" + index,
});
url: '/pages/mine/order/index?isTab=' + index,
})
},
goRoad(index) {
//12
if (index == 1) {
uni.navigateTo({
url: "/pages/mine/growthRoad/gradeRoad",
});
url: '/pages/mine/growthRoad/gradeRoad',
})
} else if (index == 2) {
uni.navigateTo({
url: "/pages/mine/growthRoad/awardRoad",
});
url: '/pages/mine/growthRoad/awardRoad',
})
}
},
loginOut() {
uni.setStorageSync("pkCountry", "");
uni.setStorageSync("showInfo", 0);
this.$store.dispatch("LogOut");
uni.setStorageSync('pkCountry', '')
uni.setStorageSync('showInfo', 0)
this.$store.dispatch('LogOut')
uni.reLaunch({
url: "/pages/login/index",
});
url: '/pages/login/index',
})
},
surePsw() {
min
.checkPwd({
pwd: this.password,
})
.then((res) => {
.then(res => {
if (res.code == 200) {
this.password = "";
this.pswShow = false;
this.password = ''
this.pswShow = false
uni.navigateTo({
url: "/pages/mine/balance/index",
});
url: '/pages/mine/balance/index',
})
} else {
uni.showToast({
title: res.msg,
icon: "error",
});
icon: 'error',
})
}
});
})
},
goSpecialArea() {
uni.switchTab({
url: "/pages/specialArea/index",
});
url: '/pages/specialArea/index',
})
},
},
};
}
</script>
<style lang="scss" scoped>
@ -799,7 +815,7 @@ export default {
.highlight-name {
font-size: 30rpx; /* 示例字号,您可以根据需要调整 */
font-weight: bold;
color: #005BAC; /* 示例颜色,您可以根据需要调整 */
color: #005bac; /* 示例颜色,您可以根据需要调整 */
padding: 0 8rpx; /* 增加一些内边距,使其更突出 */
margin-right: 10rpx; /* 在名称和下一个标签之间添加间距 */
}
@ -807,7 +823,7 @@ export default {
.highlight-pv {
font-size: 30rpx; /* 示例字号,您可以根据需要调整 */
font-weight: bold;
color: #FF5722; /* 示例颜色,您可以根据需要调整 */
color: #ff5722; /* 示例颜色,您可以根据需要调整 */
padding: 0 8rpx; /* 增加一些内边距,使其更突出 */
}
@ -844,7 +860,7 @@ export default {
}
.ju_text2 {
color: #005BAC;
color: #005bac;
font-weight: bold;
font-size: 16px;
padding: 0 6rpx;
@ -860,20 +876,16 @@ export default {
margin: 10rpx;
// margin-top: 23rpx;
position: relative;
}
.ju_left_bottom1 {
// width: 100%;
flex: 1;
height: 34rpx;
background: #FFB74D;
background: #ffb74d;
border-radius: 20rpx;
margin: 10rpx;
// margin-top: 23rpx;
position: relative;
}
// .current-schedule1 {
// position: absolute;
@ -899,7 +911,7 @@ export default {
.current-progress {
position: absolute;
width: 30%;
background: #3385D6;
background: #3385d6;
height: 34rpx;
border-radius: 20px;
}
@ -911,7 +923,6 @@ export default {
transform: translate(0%, -55%);
white-space: nowrap;
text-align: center;
}
.yestDay {
display: flex;
@ -951,13 +962,17 @@ export default {
.thetitle {
font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-family:
PingFangSC-Semibold,
PingFang SC;
font-weight: 600;
color: #333333;
}
.findallorder {
font-family: PingFangSC-Regular, PingFang SC;
font-family:
PingFangSC-Regular,
PingFang SC;
color: #999999;
font-size: 16rpx;
display: flex;
@ -989,7 +1004,9 @@ export default {
.order_text {
margin-top: 15rpx;
font-size: 20rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-family:
PingFangSC-Semibold,
PingFang SC;
font-weight: 600;
color: #333333;
}
@ -1003,7 +1020,9 @@ export default {
.order_text2 {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-family:
PingFangSC-Regular,
PingFang SC;
font-weight: 400;
color: #333333;
}
@ -1063,7 +1082,7 @@ export default {
font-size: 24rpx;
background-image: linear-gradient(
to bottom,
#005BAC 5%,
#005bac 5%,
#f2f2f2 50%
); // background-position: top;
@ -1140,7 +1159,7 @@ export default {
display: flex;
align-items: center;
font-size: 12px;
color: #005BAC;
color: #005bac;
font-weight: 400;
// margin-left: 20rpx;
.gra_left1 {
@ -1270,7 +1289,7 @@ export default {
top: 0;
height: 100%;
border-radius: 20rpx;
background: linear-gradient(135deg, #ED9A38 0%, #FDD05F 50%, #E68A2E 100%);
background: linear-gradient(135deg, #ed9a38 0%, #fdd05f 50%, #e68a2e 100%);
transition: width 0.6s ease-in-out;
box-shadow: none;
overflow: hidden;
@ -1323,14 +1342,14 @@ export default {
.sprint-progress-text .award-name {
font-weight: bold;
color: #005BAC;
color: #005bac;
font-size: 26rpx;
padding: 0 4rpx;
}
.sprint-progress-text .award-amount {
font-weight: bold;
color: #D9534F;
color: #d9534f;
font-size: 24rpx;
padding: 0 4rpx;
}