feat(uniapp_v2): 二开功能迁移与小程序主包优化

- 从 uniapp 迁移 HJF 页面、API、组件及用户/订单相关改动
- queue、assets 使用独立分包以降低主包体积
- 修复首页单根节点与支付结果页 v-if 链
- 关闭 HjfDemoPanel 全局注册;uniNoticeBar 注释 $getAppWebview 避免 __webviewId__ 报错
- 配置域名与 manifest 应用名称;cache/store 防御性处理

Made-with: Cursor
This commit is contained in:
apple
2026-03-26 12:16:01 +08:00
parent c84aeda062
commit 8e17762510
742 changed files with 184117 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
<script>
import propertyList from '@/utils/propertyList.js';
import template1 from './template1.vue';
import template2 from './template2.vue';
import template3 from './template3.vue';
import template4 from './template4.vue';
import template5 from './template5.vue';
// #ifdef MP || APP-PLUS
import topBar from '../topBar.vue';
// #endif
export default {
components: {
template1,
template2,
template3,
template4,
template5,
// #ifdef MP || APP-PLUS
topBar
// #endif
},
props: {
userInfo: {
type: Object,
default: () => {}
},
memberData: {
type: Object,
default: () => {}
},
orderAdminData: {
type: Object,
default: () => {}
},
isScrolling: {
type: Boolean,
default: false
},
balanceStatus: {
type: Number,
default: 0
}
},
data() {
return {
property: []
};
},
watch: {
memberData: {
handler(nVal, oVal) {
this.$nextTick((e) => {
this.getPropertyArr(nVal.property);
});
},
immediate: true,
deep: true
},
userInfo: {
handler(nVal, oVal) {
this.$nextTick((e) => {
this.getPropertyArr(this.memberData.property);
});
},
deep: true
}
},
methods: {
getPropertyArr(arr) {
let data = [];
const propertyFilter = propertyList.filter((item) => {
return arr.includes(item.value);
});
propertyFilter.forEach((item) => {
if ((item.value == 0 && this.balanceStatus) || item.value != 0) {
data.push({
...item,
value: this.userInfo[item.k]
});
}
});
const filteredItems = data.filter(item => {
if (this.userInfo.is_promoter === 0 && ['spread_user_count','brokerage_price','spread_order_count'].includes(item.k)) {
return false;
}
return true;
});
this.property = filteredItems;
}
}
};
</script>
<template>
<view>
<!-- #ifdef MP || APP-PLUS -->
<topBar v-if="memberData.style != 5" :styleType="memberData.style" :isScrolling="isScrolling"></topBar>
<!-- #endif -->
<template1 v-if="memberData.style == 1" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template1>
<template2 v-if="memberData.style == 2" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template2>
<template3 v-if="memberData.style == 3" :perShowType="memberData.per_show_type" :userInfo="userInfo" :property="property"></template3>
<template4 v-if="memberData.style == 4" :perShowType="memberData.per_show_type" :userInfo="userInfo" :commission="orderAdminData.commission"></template4>
<template5
v-if="memberData.style == 5"
:perShowType="memberData.per_show_type"
:userInfo="userInfo"
:commission="orderAdminData.commission"
:isScrolling="isScrolling"
:property="property"
></template5>
</view>
</template>
<style lang="scss">
/deep/ .bind-phone {
margin-top: 12rpx;
background: rgba(255, 255, 255, 0.3);
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #ffffff;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
/deep/ .tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
}
</style>

View File

@@ -0,0 +1,316 @@
<script>
import { toLogin } from '@/libs/login.js';
export default {
props: {
userInfo: {
type: Object,
default: () => {}
},
property: {
type: Array,
default: () => []
},
// perShowType 0 手机号 1 ID
perShowType: {
type: Number,
default: 0
}
},
inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone', 'checkApp'],
computed:{
showMerBtn(){
return this.$store.state.app.channel_func_status
}
},
methods: {
openAuto(){
toLogin();
}
}
};
</script>
<template>
<view class="header">
<!-- 用户信息设置 -->
<view class="acea-row row-middle user px-30">
<view class="avatar relative" :class="userInfo.pay_vip_status ? 'svip-border' : 'white-border'"
@tap="goEdit">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.avatar"></image>
<image class="avatar-img" src="@/static/images/f.png" mode="aspectFill" v-else></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="userInfo.pay_vip_status"></image>
</view>
<view class="name-wrap flex-1 text--w111-fff pl-28">
<view class="name display-add" v-if="!userInfo.uid" @tap="openAuto">请点击授权</view>
<view class="acea-row row-middle" v-if="userInfo.uid">
<view class="name">{{ userInfo.nickname }}</view><strong></strong>
<view class="vip flex-center" v-if="userInfo.level">
<text class="iconfont icon-huiyuandengji"></text>
V{{userInfo.level}}
</view>
</view>
<view class="flex-y-center mt-10">
<view class="h-42 flex-center fs-22 text--w111-fff pl-16 pr-14 rd-30rpx b-f mr-12"
v-show="userInfo.is_channel && showMerBtn" @tap="checkApp(1)">采购商
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
<view class="h-42 flex-center fs-22 text--w111-fff pl-16 pr-14 rd-30rpx b-f"
v-show="userInfo.is_service" @tap="checkApp(2)">商家管理
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
</view>
<template v-if="!userInfo.is_channel && !userInfo.is_service">
<view class="bind-phone" v-if="!userInfo.phone && userInfo.uid" @tap="bindPhone">绑定手机号</view>
<view class="phone" v-else>{{ perShowType ? 'ID' + userInfo.uid : userInfo.phone }}</view>
</template>
</view>
<view class="text--w111-fff">
<text class="iconfont icon-a-ic_QRcode fs-40" @tap="tapQrCode"><text class="tips">会员码</text></text>
<text class="iconfont icon-a-ic_setup1 fs-40 mx-32" @tap="intoPage('/pages/users/user_set/index')"></text>
<text class="iconfont icon-ic_message3 fs-40 relative" @tap="intoPage('/pages/users/message_center/index')">
<text v-if="userInfo.service_num" class="number">{{ userInfo.service_num >= 100 ? '99+' : userInfo.service_num }}</text>
</text>
</view>
</view>
<!-- 余额优惠券 -->
<view class="acea-row balance-coupon">
<view class="item" v-for="(item, index) in property" @tap="goMenuPage(item.url)" :key="index">
<view class="value num-fa-semi">{{ item.value || 0 }}</view>
<view>{{ item.label }}</view>
</view>
</view>
<!-- 会员中心积分商城 -->
<view class="acea-row member-points">
<view class="acea-row row-middle row-center item" @tap="intoPage(userInfo.level_status == 1 ? '/pages/users/user_vip/index' : '/pages/annex/vip_grade_active/index')">
<view>
<view>会员中心</view>
<view class="arrow">
查看新权益
<text class="iconfont icon-ic_rightarrow"></text>
</view>
</view>
<image src="@/static/images/user-member.png" class="image"></image>
</view>
<view class="acea-row row-middle row-center item" @tap="intoPage('/pages/activity/points_mall/index')">
<view>
<view>积分商城</view>
<view class="arrow">
限量兑神券
<text class="iconfont icon-ic_rightarrow"></text>
</view>
</view>
<image src="@/static/images/user-points.png" class="image"></image>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.header {
padding: 18rpx 0 0rpx;
border-bottom-right-radius: 50% 40rpx;
border-bottom-left-radius: 50% 40rpx;
margin-bottom: 18rpx;
background-color: var(--view-theme);
// .user {
// padding: 0 40rpx 0 30rpx;
// .iconfont {
// position: relative;
// color: #ffffff;
// font-size: 40rpx;
// }
// }
.bind-phone {
margin-top: 12rpx;
background: rgba(255, 255, 255, 0.3);
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #ffffff;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
.tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c;
/* 修改颜色以改变三角形颜色 */
}
.avatar {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
.avatar-img{
width: 100%;
height:100%;
border-radius: 50%;
display: block;
}
}
.vip-badge{
position: absolute;
top: -20rpx;
right: -10rpx;
width: 48rpx;
height: 46rpx;
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.white-border{
border: 2rpx solid #FFFFFF;
}
.name {
font-weight: 500;
font-size: 32rpx;
line-height: 44rpx;
}
.phone {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 34rpx;
}
.tips {
position: absolute;
bottom: 100%;
left: 50%;
height: 28rpx;
padding: 0 14rpx;
border-radius: 14rpx;
margin-bottom: 4rpx;
background-color: #ffd89c;
transform: translateX(-50%);
white-space: nowrap;
font-size: 16rpx;
line-height: 28rpx;
color: #9e5e1a;
}
.number {
position: absolute;
top: -8rpx;
right: 0;
min-width: 10rpx;
height: 24rpx;
padding: 0 6rpx;
border: 2rpx solid var(--view-theme);
border-radius: 12rpx;
background-color: #ffffff;
transform: translateX(50%);
font-weight: 500;
font-size: 18rpx;
line-height: 24rpx;
color: var(--view-theme);
}
}
.vip{
// width: 64rpx;
height: 26rpx;
background: #FEF0D9;
border: 1px solid #FACC7D;
border-radius: 50rpx;
font-size: 18rpx;
font-weight: 500;
color: #DFA541;
margin-left: 10rpx;
padding: 0 6rpx;
.iconfont {
font-size: 20rpx !important;
margin-right: 4rpx;
color: #DFA541 !important;
}
}
.balance-coupon {
margin-top: 44rpx;
.item {
flex: 1;
text-align: center;
font-weight: 500;
font-size: 22rpx;
line-height: 22rpx;
color: rgba(255, 255, 255, 0.6);
}
.value {
margin-bottom: 12rpx;
font-weight: 400;
font-size: 32rpx;
line-height: 32rpx;
color: rgba(255, 255, 255, 0.85);
}
}
.member-points {
border-radius: 20rpx;
margin: 20rpx;
background-color: #ffffff;
.item {
position: relative;
flex: 1;
height: 134rpx;
padding-left: 40rpx;
font-weight: 500;
font-size: 28rpx;
line-height: 34rpx;
color: #333333;
&::before {
content: '';
position: absolute;
top: 50%;
left: 0;
height: 48rpx;
border-left: 1rpx solid #eeeeee;
transform: translateY(-50%);
}
&:first-child::before {
display: none;
}
.iconfont {
position: relative;
font-size: 20rpx;
}
}
.arrow {
margin-top: 12rpx;
font-weight: 400;
font-size: 22rpx;
line-height: 24rpx;
color: #ff7d00;
}
.image {
width: 88rpx;
height: 88rpx;
margin-left: 40rpx;
}
.iconfont {
margin-left: 2rpx;
font-size: 24rpx;
}
}
.b-f{
border: 1rpx solid #fff;
}
</style>

View File

@@ -0,0 +1,338 @@
<script>
export default {
inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone', 'checkApp'],
props: {
userInfo: {
type: Object,
default: () => {}
},
property: {
type: Array,
default: () => []
},
// perShowType 0 手机号 1 ID
perShowType: {
type: Number,
default: 0
}
},
computed:{
showMerBtn(){
return this.$store.state.app.channel_func_status
}
},
};
</script>
<template>
<view class="">
<view class="acea-row row-middle user-wrapper">
<!-- 头像 -->
<view class="avatar relative" :class="{'svip-border': userInfo.pay_vip_status}" @click="goEdit">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.avatar"></image>
<image class="avatar-img" src="@/static/images/f.png" mode="aspectFill" v-else></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="userInfo.pay_vip_status"></image>
</view>
<view class="name-wrap">
<view class="name" v-if="userInfo.nickname">{{ userInfo.nickname }}</view>
<view class="name display-add" v-else @tap="intoPage">请点击授权</view>
<view class="flex-y-center mt-10" v-show="userInfo.is_channel || userInfo.is_service">
<view class="h-42 flex-center fs-22 pl-16 pr-14 rd-30rpx b-c mr-12 text--w111-666"
v-show="userInfo.is_channel && showMerBtn" @tap="checkApp(1)">采购商
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
<view class="h-42 flex-center fs-22 pl-16 pr-14 rd-30rpx b-c text--w111-666"
v-show="userInfo.is_service" @tap="checkApp(2)">商家管理
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
</view>
<template v-if="!userInfo.is_channel && !userInfo.is_service">
<view class="bind-phone" v-if="!userInfo.phone && userInfo.uid" @tap="bindPhone">绑定手机号</view>
<view class="phone" v-else>{{ perShowType ? 'ID' + userInfo.uid : userInfo.phone }}</view>
</template>
</view>
<text class="iconfont icon-a-ic_QRcode set-icon fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
<text class="iconfont icon-a-ic_setup1 set-icon fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
<text class="iconfont icon-ic_message3 set-icon fs-40" @click="intoPage('/pages/users/message_center/index')">
<text v-if="userInfo.service_num" class="number">{{ userInfo.service_num >= 100 ? '99+' : userInfo.service_num }}</text>
</text>
</view>
<view class="acea-row row-between promotion-wrapper">
<view v-for="(item, index) in property" @click="goMenuPage(item.url)" :key="index">
<text>{{ item.label }}</text>
<text class="value num-fa-semi">{{ item.value || 0 }}</text>
</view>
</view>
<!-- 会员 -->
<view class="member-wrapper" v-if="userInfo.vip" @click="intoPage(userInfo.level_status == 1 ? '/pages/users/user_vip/index' : '/pages/annex/vip_grade_active/index')">
<view class="card">
<view class="acea-row row-middle top">
<view class="name-wrap">
<view class="name">
<text class="iconfont icon-ic_crown fs-31"></text>
{{ userInfo.vip_name }}
</view>
<view>
商城购物可享
<text class="number num-fa-semi">{{ userInfo.vip_discount }}</text>
</view>
</view>
<view class="icon-wrap">
<view class="icon">
<text class="iconfont icon-a-ic_discount1 fs-20"></text>
</view>
<view>购物折扣</view>
</view>
<view class="icon-wrap">
<view class="icon">
<text class="iconfont icon-ic_badge fs-20"></text>
</view>
<view>专属徽章</view>
</view>
<text class="iconfont icon-ic_rightarrow fs-24 ml-20"></text>
</view>
<view class="acea-row row-middle row-between bottom">
<view class="acea-row">
<view class="icon-list">
<image class="img" src="@/static/images/vip-icon-row.png" mode=""></image>
</view>
<view class="text">掌握更多快速升级技巧</view>
</view>
<view class="button">去获取</view>
</view>
</view>
<!-- 公告模块 -->
<!-- <view class="acea-row row-middle grow">
<view class="iconfont icon-ic_horn1 fs-28"></view>
<view class="text">查看会员成长值获得更优惠购物折扣</view>
<view class="iconfont icon-ic_rightarrow fs-24"></view>
</view> -->
</view>
</view>
</template>
<style lang="scss" scoped>
.user-wrapper {
padding: 40rpx 40rpx 40rpx 32rpx;
.avatar {
width: 136rpx;
height: 136rpx;
border-radius: 50%;
.avatar-img{
width: 100%;
height:100%;
border-radius: 50%;
display: block;
}
}
.vip-badge{
position: absolute;
top: -10rpx;
right: 0;
width: 36rpx;
height: 36rpx;
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.name-wrap {
flex: 1;
padding: 0 24rpx;
color: #333333;
}
.bind-phone {
margin-top: 12rpx;
background: #fff;
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
.name {
font-weight: 500;
font-size: 32rpx;
line-height: 44rpx;
}
.phone {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 34rpx;
}
.tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
}
.tips {
position: absolute;
bottom: 100%;
left: 50%;
height: 28rpx;
padding: 0 14rpx;
border-radius: 14rpx;
margin-bottom: 4rpx;
background-color: #ffd89c;
transform: translateX(-50%);
white-space: nowrap;
font-size: 16rpx;
line-height: 28rpx;
color: #9e5e1a;
}
.number {
position: absolute;
top: -8rpx;
right: 0;
min-width: 10rpx;
height: 24rpx;
padding: 0 6rpx;
border: 2rpx solid var(--view-theme);
border-radius: 12rpx;
background-color: #ffffff;
transform: translateX(50%);
font-weight: 500;
font-size: 18rpx;
line-height: 24rpx;
color: var(--view-theme);
}
.set-icon {
position: relative;
align-self: flex-start;
margin-top: 22rpx;
}
}
.promotion-wrapper {
padding: 0 48rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #999999;
.value {
margin-left: 8rpx;
font-family: SemiBold;
font-size: 28rpx;
color: #333333;
}
}
.member-wrapper {
margin: 28rpx 20rpx 20rpx;
color: #7e4b06;
.card {
position: relative;
border-radius: 32rpx;
// margin-bottom: -28rpx; // 公告模块
background: linear-gradient(-270deg, #f4dfaf 0%, #d0a15b 100%);
.top {
padding: 25rpx 35rpx;
}
.name-wrap {
flex: 1;
font-size: 19rpx;
line-height: 26rpx;
}
.name {
margin-bottom: 4rpx;
font-weight: 700;
font-size: 34rpx;
line-height: 48rpx;
.iconfont {
margin-right: 12rpx;
font-size: 36rpx;
}
}
.icon-wrap {
font-size: 18rpx;
line-height: 26rpx;
+ .icon-wrap {
margin-left: 32rpx;
}
}
.icon {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin: 0 auto 6rpx;
background-color: #eccd8b;
text-align: center;
line-height: 40rpx;
.iconfont {
font-size: 24rpx;
}
}
.bottom {
position: relative;
padding: 17rpx 35rpx;
font-size: 24rpx;
.icon-list {
display: flex;
align-items: center;
justify-content: center;
margin-right: 22rpx;
.img {
width: 86rpx;
height: 32rpx;
}
}
&::before {
content: '';
position: absolute;
top: 0;
right: 35rpx;
left: 35rpx;
height: 1rpx;
background-color: rgba(0, 0, 0, 0.08);
}
}
.text {
}
.button {
height: 48rpx;
padding: 0 24rpx;
border-radius: 24rpx;
background-color: #eccd8b;
font-weight: 500;
line-height: 48rpx;
}
}
.grow {
padding: 50rpx 40rpx 20rpx;
border-radius: 32rpx;
background: linear-gradient(180deg, #faeed9 0%, #ffffff 100%);
.text {
flex: 1;
padding-left: 16rpx;
}
}
}
.b-c{
border: 1rpx solid #ccc
}
</style>

View File

@@ -0,0 +1,222 @@
<script>
import { HTTP_REQUEST_URL } from '@/config/app';
export default {
inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone', 'checkApp'],
props: {
userInfo: {
type: Object,
default: () => {}
},
// perShowType 0 手机号 1 ID
perShowType: {
type: Number,
default: 0
}
},
computed: {
headerBg() {
return `url(${HTTP_REQUEST_URL}/statics/images/users/user_header_bg.png)`;
},
showMerBtn(){
return this.$store.state.app.channel_func_status
}
},
methods: {
getTimePeriod() {
const currentTime = new Date();
const currentHour = currentTime.getHours();
if (currentHour >= 6 && currentHour < 12) {
return ',早上好';
} else if (currentHour >= 12 && currentHour < 14) {
return ',中午好';
} else if (currentHour >= 14 && currentHour < 18) {
return ',下午好';
} else {
return ',晚上好';
}
}
}
};
</script>
<template>
<view class="user_info_card relative" :style="{ backgroundImage: headerBg }">
<view class="flex-between-center top">
<view class="flex-y-center">
<view class="avatar relative" :class="userInfo.pay_vip_status ? 'svip-border' : 'white-border'"
@click="goEdit">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.avatar"></image>
<image class="avatar-img" src="@/static/images/f.png" mode="aspectFill" v-else></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="userInfo.pay_vip_status"></image>
</view>
<view class="ml-24">
<view class="fs-36 text--w111-333 lh-50rpx fw-500" v-if="userInfo.nickname">{{ userInfo.nickname }}</view>
<view class="fs-36 text--w111-333 lh-50rpx fw-500" v-else @tap="intoPage">请点击授权</view>
<view class="flex-y-center mt-10 text--w111-666" v-show="userInfo.is_channel || userInfo.is_service">
<view class="h-42 flex-center fs-22 pl-16 pr-14 rd-30rpx b-c mr-12"
v-show="userInfo.is_channel && showMerBtn" @tap="checkApp(1)">采购商
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
<view class="h-42 flex-center fs-22 pl-16 pr-14 rd-30rpx b-c"
v-show="userInfo.is_service" @tap="checkApp(2)">商家管理
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
</view>
<template v-if="!userInfo.is_channel && !userInfo.is_service">
<view class="bind-phone" v-if="!userInfo.phone && userInfo.uid" @tap="bindPhone">绑定手机号</view>
<view class="phone" v-else>{{ perShowType ? 'ID' + userInfo.uid : userInfo.phone }}</view>
</template>
</view>
</view>
<view>
<text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
<text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
<text class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
<text v-if="userInfo.service_num" class="number">{{ userInfo.service_num >= 100 ? '99+' : userInfo.service_num }}</text>
</text>
</view>
</view>
<view class="w-full bg_zs">
<view class="svip_card" @tap="intoPage('/pages/annex/vip_paid/index')">
<view class="h-full flex-between-center pl-32 pr-28 text--w111-FFD89C fs-24">
<view class="flex-y-center">
<text class="iconfont icon-ic_crown fs-32"></text>
<text class="pl-12" v-show="userInfo.pay_vip_status">尊贵的SVIP会员{{ getTimePeriod() }}</text>
<text class="pl-12" v-show="!userInfo.pay_vip_status">开通svip会员专享多项特权</text>
</view>
<view class="flex-y-center">
<text>{{userInfo.pay_vip_status ? '去查看' : '去开通'}} </text>
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</view>
</view>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.navbar {
position: relative;
.content {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 998;
font-weight: 500;
font-size: 34rpx;
color: #ffffff;
}
}
.avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
.avatar-img{
width: 100%;
height:100%;
border-radius: 50%;
display: block;
}
}
.vip-badge{
position: absolute;
top: -8rpx;
right: -4rpx;
width: 24rpx;
height: 24rpx;
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.white-border{
border: 2rpx solid #FFFFFF;
}
.user_info_card {
// min-height: 304rpx;
background-size: 100% 100%;
.top {
padding: 44rpx 48rpx 50rpx 48rpx;
}
.iconfont {
position: relative;
}
.bind-phone {
margin-top: 12rpx;
background: #fff;
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
}
.bg_zs {
background-image: url('@/static/img/bg_zs.png');
background-size: 100%;
background-repeat: no-repeat;
background-position-y: 56rpx;
padding-bottom: 130rpx;
}
.svip_card {
width: 662rpx;
height: 92rpx;
background-image: url('@/static/img/user_svip_bg.png');
background-size: 100%;
background-repeat: no-repeat;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.tips {
position: absolute;
top: -34rpx;
left: 50%;
height: 28rpx;
padding: 0 14rpx;
border-radius: 14rpx;
margin-bottom: 4rpx;
background-color: #ffd89c;
transform: translateX(-50%);
white-space: nowrap;
font-size: 16rpx;
line-height: 28rpx;
color: #9e5e1a;
}
.tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
}
.number {
position: absolute;
top: -8rpx;
right: 0;
min-width: 10rpx;
height: 24rpx;
padding: 0 6rpx;
border: 2rpx solid var(--view-theme);
border-radius: 12rpx;
background-color: #ffffff;
transform: translateX(50%);
font-weight: 500;
font-size: 18rpx;
line-height: 24rpx;
color: var(--view-theme);
}
.b-c{
border: 1rpx solid #ccc;
}
</style>

View File

@@ -0,0 +1,260 @@
<script>
import { HTTP_REQUEST_URL } from '@/config/app';
export default {
props: {
userInfo: {
type: Object,
default: () => {}
},
commission: {
type: Object,
default: () => {}
},
// perShowType 0 手机号 1 ID
perShowType: {
type: Number,
default: 0
}
},
inject: ['intoPage', 'tapQrCode', 'goEdit', 'bindPhone', 'checkApp'],
computed: {
headerBg() {
return `url(${HTTP_REQUEST_URL}/statics/images/users/template4_bg.png)`;
},
showMerBtn(){
return this.$store.state.app.channel_func_status
}
}
};
</script>
<template>
<view class="">
<view class="acea-row row-middle user">
<view class="avatar relative" :class="{'svip-border': userInfo.pay_vip_status}" @click="goEdit">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.avatar"></image>
<image class="avatar-img" src="@/static/images/f.png" mode="aspectFill" v-else></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="userInfo.pay_vip_status"></image>
</view>
<view class="name-wrap">
<view class="name" v-if="userInfo.nickname">{{ userInfo.nickname }}</view>
<view class="name display-add" v-else @tap="intoPage">请点击授权</view>
<view class="flex-y-center mt-10" v-show="userInfo.is_channel || userInfo.is_service">
<view class="h-42 flex-center fs-22 text--w111-666 pl-16 pr-14 rd-30rpx b-c mr-12"
v-show="userInfo.is_channel && showMerBtn" @tap="checkApp(1)">采购商
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
<view class="h-42 flex-center fs-22 text--w111-666 pl-16 pr-14 rd-30rpx b-c"
v-show="userInfo.is_service" @tap="checkApp(2)">商家管理
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
</view>
<template v-if="!userInfo.is_channel && !userInfo.is_service">
<view class="bind-phone" v-if="!userInfo.phone && userInfo.uid" @tap="bindPhone">绑定手机号</view>
<view class="phone" v-else>{{ perShowType ? 'ID' + userInfo.uid : userInfo.phone }}</view>
</template>
</view>
<text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
<text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
<text class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
<text v-if="userInfo.service_num" class="number">{{ userInfo.service_num >= 100 ? '99+' : userInfo.service_num }}</text>
</text>
</view>
<view class="distribution">
<view class="acea-row row-middle row-between withdraw">
<view>
<view>可提现()</view>
<view class="value num-fa-semi">{{ userInfo.commissionCount || 0 }}</view>
</view>
<view class="button" @click="intoPage('/pages/users/user_cash/index')">立即提现</view>
</view>
<view class="acea-row">
<view class="item">
<view class="inner">
<view>累计佣金</view>
<view class="value num-fa-semi">{{ commission && commission.brokerage_price || 0 }}</view>
</view>
</view>
<view class="item">
<view class="inner">
<view>推荐人数</view>
<view class="value num-fa-semi">{{ commission && commission.number || 0 }}</view>
</view>
</view>
<view class="item">
<view class="inner">
<view>推荐单数</view>
<view class="value num-fa-semi">{{ commission && commission.order_num || 0 }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.user {
padding: 60rpx 42rpx 56rpx 30rpx;
background-position: bottom;
background-size: 100%;
background-color: #f5f5f5;
.avatar {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
.avatar-img{
width: 100%;
height:100%;
border-radius: 50%;
display: block;
}
}
.vip-badge{
position: absolute;
top: -10rpx;
right: 0;
width: 30rpx;
height: 30rpx;
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.name-wrap {
flex: 1;
padding: 0 32rpx;
color: #333333;
}
.name {
font-weight: 500;
font-size: 32rpx;
line-height: 44rpx;
}
.phone {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 34rpx;
}
.bind-phone {
margin-top: 12rpx;
background: #fff;
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
.iconfont {
position: relative;
}
.tips {
position: absolute;
bottom: 100%;
left: 50%;
height: 28rpx;
padding: 0 14rpx;
border-radius: 14rpx;
margin-bottom: 4rpx;
background-color: #ffd89c;
transform: translateX(-50%);
white-space: nowrap;
font-size: 16rpx;
line-height: 28rpx;
color: #9e5e1a;
}
.tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
}
.number {
position: absolute;
top: -8rpx;
right: 0;
min-width: 10rpx;
height: 24rpx;
padding: 0 6rpx;
border: 2rpx solid var(--view-theme);
border-radius: 12rpx;
background-color: #ffffff;
transform: translateX(50%);
font-weight: 500;
font-size: 18rpx;
line-height: 24rpx;
color: var(--view-theme);
}
}
.distribution {
border-radius: 24rpx;
margin: 0 20rpx 20rpx;
background-color: #ffffff;
.withdraw {
height: 176rpx;
padding: 0 56rpx 0 48rpx;
background-image: url('@/static/img/black_user_bg.png');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
font-size: 26rpx;
line-height: 36rpx;
color: rgba(255, 231, 198, 0.8);
.value {
margin-top: 16rpx;
font-family: SemiBold;
font-size: 56rpx;
line-height: 56rpx;
color: #ffe7c6;
}
.button {
height: 56rpx;
padding: 0 24rpx;
border-radius: 28rpx;
background-color: #fce6c8;
font-weight: 500;
font-size: 24rpx;
line-height: 56rpx;
color: #9c5a00;
}
}
.item {
flex: 1;
padding: 40rpx 0;
text-align: center;
font-size: 26rpx;
line-height: 30rpx;
color: #999999;
.inner {
display: inline-block;
}
.value {
margin-top: 20rpx;
text-align: left;
font-family: SemiBold;
font-size: 36rpx;
line-height: 36rpx;
color: #333333;
}
}
}
.b-c{
border: 1rpx solid #ccc
}
</style>

View File

@@ -0,0 +1,218 @@
<script>
import { HTTP_REQUEST_URL } from '@/config/app';
// #ifdef MP || APP-PLUS
import topBar from '../topBar.vue';
// #endif
export default {
components: {
// #ifdef MP || APP-PLUS
topBar
// #endif
},
props: {
userInfo: {
type: Object,
default: () => {}
},
// perShowType 0 手机号 1 ID
perShowType: {
type: Number,
default: 0
},
isScrolling: {
type: Boolean,
default: false
},
property: {
type: Array,
default: () => []
}
},
inject: ['intoPage', 'tapQrCode', 'goMenuPage', 'goEdit', 'bindPhone', 'checkApp'],
computed: {
headerBg() {
return `url(${HTTP_REQUEST_URL}/statics/images/users/template4_bg.png)`;
},
showMerBtn(){
return this.$store.state.app.channel_func_status
}
}
};
</script>
<template>
<view class="warp" :style="{ backgroundImage: headerBg }">
<!-- #ifdef MP || APP-PLUS -->
<topBar :styleType="5" :isScrolling="isScrolling"></topBar>
<!-- #endif -->
<view class="acea-row row-middle user">
<view class="avatar relative" :class="{'svip-border': userInfo.pay_vip_status}" @click="goEdit">
<image class="avatar-img" :src="userInfo.avatar" mode="aspectFill" v-if="userInfo.avatar"></image>
<image class="avatar-img" src="@/static/images/f.png" mode="aspectFill" v-else></image>
<image class="vip-badge" src="@/static/img/svip_badge.png" v-show="userInfo.pay_vip_status"></image>
</view>
<view class="name-wrap">
<view class="name" v-if="userInfo.nickname">{{ userInfo.nickname }}</view>
<view class="name display-add" v-else @tap="intoPage">请点击授权</view>
<view class="flex-y-center mt-10" v-show="userInfo.is_channel || userInfo.is_service">
<view class="h-42 flex-center fs-22 text--w111-666 pl-16 pr-14 rd-30rpx b-c mr-12"
v-show="userInfo.is_channel && showMerBtn" @tap="checkApp(1)">采购商
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
<view class="h-42 flex-center fs-22 text--w111-666 pl-16 pr-14 rd-30rpx b-c"
v-show="userInfo.is_service" @tap="checkApp(2)">商家管理
<text class="iconfont icon-ic_rightarrow fs-22"></text>
</view>
</view>
<template v-if="!userInfo.is_channel && !userInfo.is_service">
<view class="bind-phone" v-if="!userInfo.phone && userInfo.uid" @tap="bindPhone">绑定手机号</view>
<view class="phone" v-else>{{ perShowType ? 'ID' + userInfo.uid : userInfo.phone }}</view>
</template>
</view>
<view>
<text class="iconfont icon-a-ic_QRcode fs-40" @click="tapQrCode"><text class="tips">会员码</text></text>
<text class="iconfont icon-a-ic_setup1 fs-40 mx-34" @click="intoPage('/pages/users/user_set/index')"></text>
<text class="iconfont icon-ic_message3 fs-40" @click="intoPage('/pages/users/message_center/index')">
<text v-if="userInfo.service_num" class="number">{{ userInfo.service_num >= 100 ? '99+' : userInfo.service_num }}</text>
</text>
</view>
</view>
<view class="acea-row row-middle order justify-between">
<view class="item" v-for="(item, index) in property" @click="goMenuPage(item.url)" :key="index">
{{ item.label }}
<text class="value num-fa-semi">{{ item.value || 0 }}</text>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.warp {
background-position: bottom;
background-size: 100% 100%;
}
.user {
padding: 60rpx 42rpx 56rpx 30rpx;
background-position: bottom;
background-size: 100%;
.avatar {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
.avatar-img{
width: 100%;
height:100%;
border-radius: 50%;
display: block;
}
}
.vip-badge{
position: absolute;
top: -16rpx;
right: -4rpx;
width: 36rpx;
height: 36rpx;
}
.svip-border{
border: 2rpx solid #F1BB0D;
}
.name-wrap {
flex: 1;
padding: 0 32rpx;
color: #333333;
}
.name {
font-weight: 500;
font-size: 32rpx;
line-height: 44rpx;
}
.phone {
margin-top: 10rpx;
font-size: 24rpx;
line-height: 34rpx;
}
.bind-phone {
margin-top: 12rpx;
background: #fff;
border-radius: 30px;
width: max-content;
text-align: center;
font-size: 20rpx;
font-weight: 400;
color: #333333;
line-height: 28rpx;
padding: 6rpx 16rpx;
}
.iconfont {
position: relative;
}
.tips {
position: absolute;
bottom: 100%;
left: 50%;
height: 28rpx;
padding: 0 14rpx;
border-radius: 14rpx;
margin-bottom: 4rpx;
background-color: #ffd89c;
transform: translateX(-50%);
white-space: nowrap;
font-size: 16rpx;
line-height: 28rpx;
color: #9e5e1a;
}
.tips::before {
content: '';
position: absolute;
bottom: -6rpx;
left: calc(50% - 6rpx);
width: 0;
height: 0;
border-left: 6rpx solid transparent;
border-right: 6rpx solid transparent;
border-top: 6rpx solid #ffd89c; /* 修改颜色以改变三角形颜色 */
}
.number {
position: absolute;
top: -8rpx;
right: 0;
min-width: 10rpx;
height: 24rpx;
padding: 0 6rpx;
border: 2rpx solid var(--view-theme);
border-radius: 12rpx;
background-color: #ffffff;
transform: translateX(50%);
font-weight: 500;
font-size: 18rpx;
line-height: 24rpx;
color: var(--view-theme);
}
}
.order {
padding: 0 32rpx 32rpx 32rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #999999;
.item + .item {
margin-left: 40rpx;
}
.value {
margin-left: 8rpx;
font-size: 28rpx;
line-height: 32rpx;
color: #333333;
}
}
.b-c{
border: 1rpx solid #ccc
}
</style>