Files
frontend-app/pages/mine/mine.vue
T
2025-08-06 22:24:53 +08:00

664 lines
18 KiB
Vue

<template>
<view class="mine_warp">
<view class="mine_header">
<view class="mine_login_data" v-if="currentUserData && Object.keys(currentUserData).length !== 0">
<view class="mine_data">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/logo_y.png" shape="circle" width="80"
height="80" bgColor="#f1f6ff00"></up-image>
<view class="mine_info">
<view class="mine_info_name">
<text style="margin-right: 20rpx;">{{ currentUserData.name || '信任桥用户' }}</text>
<view class="grade_warp" v-if="currentUserData && Object.keys(currentUserData).length !== 0">
<up-image
:src="currentUserData.gradeLevel || currentUserData.gradeLevel === 0 ? 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/grade/V' + currentUserData.gradeLevel + '.png' : 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/grade/V0.png'"
width="96" height="26" bgColor="#f1f6ff00"></up-image>
<view
:class="currentUserData.gradeName.length > 3 ? 'grade_key_warp grade_key_warp3' : 'grade_key_warp grade_key_warp1'">
{{ currentUserData.gradeName }}</view>
</view>
</view>
<view class="mine_info_id">
<text style="margin-right: 20rpx;">邀请码:{{ currentUserData.inviteCode }} </text>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00"
@click="copyData(currentUserData.inviteCode)"></up-image>
</view>
</view>
</view>
<view @click="jumpSetting">
<up-image src="/static/common/setting.png" width="22" height="22" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view class="mine_no_login_data" v-else>
<view class="mine_data">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/avater_not.png" shape="circle"
width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="mine_info_not_login">
未登录
</view>
</view>
<view @click="jumpLogin" class="login_warp">
<text style="margin-right: 10rpx;">立即登录</text>
<up-image src="/static/common/right_y_st.png" width="18" height="18" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<view class="mine_content_warp">
<!-- 我的订单 -->
<view class="mine_content_comm_warp">
<view class="mine_order_title">
<view>我的订单</view>
<view class="mine_order_title_all" @click="jumpOrder({})">
<view style="margin-right: 10rpx;">全部</view>
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view class="mine_order_list">
<view class="mine_fontsize_comm_warp order_list_item" v-for="item in orderTemplList" :key="item.id"
@click="jumpOrder(item)">
<up-image :src="item.url" width="30" height="30" bgColor="#f1f6ff00"></up-image>
<view>{{ item.title }}</view>
<up-badge :absolute="true" :offset="[0, 8]" max="99" :value="statisticsObj[item.note]"></up-badge>
</view>
</view>
</view>
<!-- 应用 -->
<view class="mine_content_comm_warp mine_top_comm_warp apply_list">
<view class="apply_item mine_fontsize_comm_warp" v-for="item in applyList" :key="item.id"
@click="jumpTool(item)">
<up-image :src="item.url" width="36" height="36" bgColor="#f1f6ff00"></up-image>
<view>{{ item.title }}</view>
</view>
</view>
<!-- 入驻 -->
<view class="mine_top_comm_warp enter_list">
<view class="enter_item" @click="jumpEnter('merchant')">
<view>
<view class="enter_title">商家入驻</view>
<view class="enter_apply">
<text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/enter_sj.png" width="50" height="50"
bgColor="#f1f6ff00"></up-image>
</view>
<view class="enter_item" @click="jumpEnter('brand')">
<view>
<view class="enter_title">企业/品牌入驻</view>
<view class="enter_apply">
<text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/enter_pp.png" width="50" height="50"
bgColor="#f1f6ff00"></up-image>
</view>
</view>
<!-- 服务工具 -->
<view class="mine_content_comm_warp mine_top_comm_warp mine_tool_warp">
<view class="mine_tool_title">服务工具</view>
<view class="tool_list">
<view class="tool_item" v-for="item in toolList" :key="item.id" @click="jumpTool(item)">
<up-image :src="item.url" width="30" height="30" bgColor="#f1f6ff00"></up-image>
<text class="mine_fontsize_comm_warp">{{ item.title }}</text>
</view>
</view>
</view>
</view>
<CustomTabBar :tabIndex="4" />
<!-- 品牌入驻弹框 -->
<up-modal :show="brandShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="brandShow = false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">企业入驻</view>
<view class="content_2">请联系负责人</view>
<view class="content_3">139 2278 6999</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile('13922786999')">复制号码</view>
<view class="but_close" @click="brandShow = false;">取消</view>
</view>
</view>
</up-modal>
<!-- 我的客服 -->
<up-modal :show="serviceShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="serviceShow = false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">联系客服</view>
<view class="content_3">{{ CUSTOMER_SERVICE_PHONE_NUMBER }}</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile(CUSTOMER_SERVICE_PHONE_NUMBER)">复制号码</view>
<view class="but_close" @click="serviceShow = false;">取消</view>
</view>
</view>
</up-modal>
<!-- 暂未开放 -->
<up-modal :show="openShow" :showConfirmButton="false">
<view class="slot-content">
<view class="close_warp" @click="openShow = false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">温馨提示</view>
<view class="content_2">暂未开放</view>
</view>
<view class="but_">
<view class="but_copy" @click="openShow = false;">确定</view>
</view>
</view>
</up-modal>
</view>
</template>
<script>
import { getStorageFun, USER_DATA, clear } from '@/utils/auth.js'
import { ORDER_TYPE, MINE_ORDER_TYPE } from '@/utils/enumUtils.js';
import { copyData } from '@/utils/index.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
import { getStatistics } from '@/api/order.js';
import { getUserInfo } from '@/api/auth.js';
import { CUSTOMER_SERVICE_PHONE_NUMBER } from '@/utils/config.js';
export default {
computed: {
CUSTOMER_SERVICE_PHONE_NUMBER() {
return CUSTOMER_SERVICE_PHONE_NUMBER;
},
},
components: { CustomTabBar },
data() {
return {
userData: {},// 当前登录对象
currentUserData: {},// 当前登录对象
orderTemplList: [
{
id: ORDER_TYPE.UNPAID,
title: "待支付",
url: '/static/mine/order_unpaid.png',
path: "/pages/mine/mine_order/mine_order?type=" + MINE_ORDER_TYPE.UNPAID,
note: "unPayNum",
}, {
id: ORDER_TYPE.UNSHIPPED,
title: "待发货",
url: '/static/mine/order_unshipped.png',
path: "/pages/mine/mine_order/mine_order?type=" + MINE_ORDER_TYPE.UNSHIPPED,
note: "unSentNum",
}, {
id: ORDER_TYPE.NOT_RECEIVE,
title: "待收货",
url: '/static/mine/order_notReceive.png',
path: "/pages/mine/mine_order/mine_order?type=" + MINE_ORDER_TYPE.NOT_RECEIVE,
note: "unTakeNum",
}, {
id: ORDER_TYPE.SUCCEED,
title: "已完成",
url: '/static/mine/order_afterSale.png',
path: "/pages/mine/mine_order/mine_order?type=" + MINE_ORDER_TYPE.SUCCEED,
note: "unCommentNum",
},
],
applyList: [
{
id: 1,
title: "钱包",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/apply_purse.png',
path: "/pages/mine/mine_purse/mine_purse"
}, {
id: 2,
title: "抽奖",
url: '/static/mine/apply_prize.png',
path: "/pages/other_package/turntable/turntable"
},
{
id: 4,
title: "我的团队",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_team.png',
path: "/pages/mine/mine_my_team/mine_my_team"
},
{
id: 5,
title: "加速次数",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_js.png',
path: "/pages/login_package/accelerate/accelerate"
},
{
id: 3,
title: "交易",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/apply_hm.png'
},
// {
// id:4,
// title:"贡献值",
// url:'/static/mine/apply_gx.png'
// },{
// id:5,
// title:"数据",
// url:'/static/mine/apply_sj.png'
// },
],// 应用模版
toolList: [
{
id: 5,
title: "地址管理",
url: '/static/mine/tool_dz.png',
path: '/pages/mine/mine_address/mine_address'
},
{
id: 9,
title: "实名认证",
url: '/static/mine/tool_sm.png',
},
{
id: 10,
title: "银行卡管理",
url: '/static/mine/tool_card.png',
path: '/pages/mine/mine_bank_card/mine_bank_card'
}, {
id: 3,
title: "邀请好友",
url: '/static/mine/tool_invite.png',
path: '/pages/other_package/invite_friends/invite_friends'
},
// {
// id:2,
// title:"我的团队",
// url:'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_team.png',
// path:"/pages/mine/mine_my_team/mine_my_team",
// },
// {
// id:6,
// title:"卡券",
// url:'/static/mine/tool_kj.png',
// // path:"/pages/mine/mine_coupon/mine_coupon",
// },
{
id: 7,
title: "联系客服",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_kf.png'
},
// {
// id:4,
// title:"加速次数",
// url:'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_js.png',
// path:"/pages/login_package/accelerate/accelerate"
// },
{
id: 8,
title: "商学院资讯",
url: '/static/mine/tool_sxy.png',
path: "/pages/login_package/news/news"
},
{
id: 12,
title: "财务",
url: '/static/mine/tool_cw.png',
path: "/pages/finance/finance",
}, {
id: 11,
title: "RWA交易",
url: 'https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/tool_hxjy.png',
path: "/pages/rwa_package/rwa/rwa",
},
// {
// id:1,
// title:"IM聊天",
// url:'/static/mine/tool_im.png'
// },
],// 工具
brandShow: false,// 品牌入驻弹框
statisticsObj: {
unPayNum: 0,//待支付数量
unSentNum: 0,//待发货数量
unTakeNum: 0,//待收货数量
unCommentNum: 0,//待评价数量
},// 角标统计
serviceShow: false,// 我的客服弹框
openShow: false,// 暂未开放
}
},
onShow() {
this.userData = getStorageFun(USER_DATA);
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
this.getStatistics();
this.getUserInfo();
},
mounted() {
},
methods: {
copyData,
// 查询用户等级
async getUserInfo() {
const result = await getUserInfo();
if (result && result.bizcode === 100) {
const data = result.data;
this.currentUserData = result.data || {};
}
},
/**
* 跳转到工具
* @param {Object} item
*/
jumpTool(item) {
// 客服
if (item.id === 7) {
this.serviceShow = true;
} else if (item.id === 9) {// 实名认证
const currentUserData = this.currentUserData;
let path = "/pages/mine/mine_authentication/mine_authentication"
if (currentUserData && Object.keys(currentUserData).length !== 0 && currentUserData.certStatus && currentUserData.certStatus !== 0) {
path = "/pages/mine/mine_authentication_ok/mine_authentication_ok"
}
uni.navigateTo({
url: path,
})
} else if (item.path) {
uni.navigateTo({
url: item.path,
})
} else {
this.openShow = true;
}
},
jumpOrder(item) {
let path = '/pages/mine/mine_order/mine_order'
if (item && Object.keys(item).length !== 0) {
path = item.path;
}
uni.navigateTo({
url: path,
})
},
jumpLogin() {
uni.navigateTo({
url: '/pages/login_package/login/login',
})
},
// 跳转到入驻页面
jumpEnter(type) {
// 商家入驻
if (type === "merchant") {
uni.navigateTo({
url: '/pages/merchant_settlement/merchant_settlement',
})
// this.openShow = true;
} else if (type === "brand") {
// 企业/品牌入驻
// uni.navigateTo({
// url:'/pages/brand_settlement/brand_settlement',
// })
this.brandShow = true;
}
},
copyMobile(mobile) {
copyData(mobile);
this.brandShow = false;
this.serviceShow = false;
},
// 查询统计
async getStatistics() {
const result = await getStatistics();
if (result && result.bizcode === 100 && result.data) {
this.statisticsObj = {
...result.data,
unCommentNum: 0,//待评价数量
};
} else {
this.statisticsObj = {
unPayNum: 0,//待支付数量
unSentNum: 0,//待发货数量
unTakeNum: 0,//待收货数量
unCommentNum: 0,//待评价数量
};
}
},
jumpSetting() {
uni.navigateTo({
url: '/pages/mine/mine_settings/mine_settings'
})
}
},
beforeDestroy() {
this.statisticsObj = {
unPayNum: 0,//待支付数量
unSentNum: 0,//待发货数量
unTakeNum: 0,//待收货数量
unCommentNum: 0,//待评价数量
};// 角标统计
},
}
</script>
<style lang="scss">
.mine_warp {
height: calc(100vh - 140rpx);
overflow: auto;
position: relative;
background-color: $app-bj;
}
.mine_header {
height: 300rpx;
background-image: url("https: //cex-pub.s3.ap-southeast-1.amazonaws.com/static/resultmine.png");
background-size: 100% 100%;
background-position: center;
/* 将图片居中显示 */
padding: 90rpx 40rpx 0;
.mine_login_data {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.mine_content_warp {
position: absolute;
top: 278rpx;
width: 92%;
height: auto;
left: 4%;
}
.mine_no_login_data {
display: flex;
justify-content: space-between;
align-items: center;
.login_warp {
display: flex;
align-items: center;
font-weight: 500;
font-size: 26rpx;
color: #111111;
}
}
.mine_data {
display: flex;
align-items: center;
}
.mine_info_not_login {
font-weight: bold;
font-size: 40rpx;
color: #111111;
}
.mine_info {
margin-left: 20rpx;
}
.mine_info_name {
font-weight: bold;
font-size: 36rpx;
color: #111111;
display: flex;
.grade_warp {
position: relative;
}
.grade_key_warp {
position: absolute;
top: 0rpx;
left: 30%;
font-size: 24rpx;
color: #FFFFFF;
width: 100rpx;
height: 44rpx;
line-height: 50rpx;
text-align: center;
}
.grade_key_warp1 {
font-size: 24rpx;
line-height: 48rpx;
}
.grade_key_warp3 {
font-size: 20rpx;
}
}
.mine_info_id {
font-weight: 500;
font-size: 24rpx;
color: #666666;
display: flex;
margin-top: 10rpx;
}
/* 内容公共 start */
.mine_content_comm_warp {
background: #FFFFFF;
box-shadow: 0rpx 0rpx 10rpx 0rpx #EEEEEE;
border-radius: 30rpx;
padding: 30rpx;
}
.mine_fontsize_comm_warp {
font-weight: 500;
font-size: 24rpx;
color: #222222;
}
.mine_top_comm_warp {
margin-top: 30rpx;
}
/* 内容公共 end */
.mine_order_title {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: bold;
font-size: 30rpx;
color: #333333;
}
.mine_order_title_all {
display: flex;
font-size: 20rpx;
color: #BBBBBB;
}
.mine_order_list {
display: flex;
justify-content: space-between;
margin: 40rpx 0 30rpx 0;
}
.order_list_item {
width: 25%;
text-align: center;
position: relative;
}
.apply_list {
display: flex;
justify-content: space-between;
}
.apply_item {
width: 20%;
text-align: center;
}
.enter_list {
display: flex;
justify-content: space-between;
}
.enter_item {
width: 40%;
background: #FFFFFF;
border-radius: 30rpx;
display: flex;
justify-content: space-between;
padding: 12rpx 30rpx;
align-items: center;
}
.enter_title {
font-weight: bold;
font-size: 26rpx;
color: #333333;
}
.enter_apply {
font-weight: 400;
font-size: 24rpx;
color: #666666;
display: flex;
align-items: center;
margin-top: 10rpx;
}
.enter_apply_title {
margin-right: 10rpx;
}
.mine_tool_title {
font-weight: bold;
font-size: 30rpx;
color: #333333;
}
.tool_list {
display: flex;
flex-wrap: wrap;
margin-top: 10rpx;
}
.tool_item {
width: 25%;
text-align: center;
margin-top: 20rpx;
}
::v-deep .u-modal__content {
padding: 40rpx !important;
}
</style>