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>

View File

@@ -0,0 +1,32 @@
<script>
import template1 from './template1.vue';
import template2 from './template2.vue';
import template3 from './template3.vue';
export default {
components: {
template1,
template2,
template3
},
props: {
menuData: {
type: Object,
default: () => {}
},
routineContact: {
type: Number,
default: 0
}
}
};
</script>
<template>
<view v-if="menuData.is_show">
<template1 v-if="menuData.style == 1" :menuData="menuData" :routineContact='routineContact'></template1>
<template2 v-if="menuData.style == 2" :menuData="menuData" :routineContact='routineContact'></template2>
<template3 v-if="menuData.style == 3" :menuData="menuData" :routineContact='routineContact'></template3>
</view>
</template>
<style></style>

View File

@@ -0,0 +1,53 @@
<script>
export default {
inject: ['goMenuPage'],
props: {
menuData: {
type: Object,
default: () => {}
},
routineContact: {
type: Number,
default: 0
}
}
};
</script>
<template>
<view class="">
<view class="pt-34 pr-30 pb-36 pl-32 bg--w111-fff rd-16rpx mt-20 service ml-20 mr-20">
<view class="fs-30 fw-500 lh-42rpx text--w111-333">{{ menuData.title }}</view>
<view class="grid-column-4 grid-gap-x-76rpx grid-gap-y-54rpx mt-38">
<view v-show="item.is_show" v-for="(item, index) in menuData.list" :key="index">
<!-- #ifdef MP -->
<view class="flex-col flex-center" v-if="item.url!='/pages/extension/customer_list/chat' || (item.url=='/pages/extension/customer_list/chat' && routineContact == 0)" @click="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="image"></image>
<text class="fs-26 lh-36rpx text--w111-282828 pt-22">{{ item.name }}</text>
</view>
<button class="flex-col flex-center" open-type='contact' v-if="item.url=='/pages/extension/customer_list/chat' && routineContact == 1">
<image :src="item.pic" class="image"></image>
<text class="fs-26 lh-36rpx text--w111-282828 pt-22">{{ item.name }}</text>
</button>
<!-- #endif -->
<!-- #ifndef MP -->
<view class="flex-col flex-center" @click="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="image"></image>
<text class="fs-26 lh-36rpx text--w111-282828 pt-22">{{ item.name }}</text>
</view>
<!-- #endif -->
</view>
</view>
</view>
</view>
</template>
<style scoped lang="scss">
.service {
.image {
width: 48rpx;
height: 48rpx;
}
}
</style>

View File

@@ -0,0 +1,76 @@
<script>
export default {
inject: ['goMenuPage'],
props: {
menuData: {
type: Object,
default: () => {}
},
routineContact: {
type: Number,
default: 0
}
}
};
</script>
<template>
<view class="">
<view class="service">
<view v-show="item.is_show" v-for="(item, index) in menuData.list" :key="index">
<!-- #ifdef MP -->
<view class="flex-y-center item" v-if="item.url!='/pages/extension/customer_list/chat' || (item.url=='/pages/extension/customer_list/chat' && routineContact == 0)" @click="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="image"></image>
<view class="name">{{ item.name }}</view>
<text class="iconfont icon-ic_rightarrow"></text>
</view>
<button class="w-full flex-y-center item " open-type='contact' v-if="item.url=='/pages/extension/customer_list/chat' && routineContact == 1">
<image :src="item.pic" class="image"></image>
<view class="name text-left">{{ item.name }}</view>
<text class="iconfont icon-ic_rightarrow"></text>
</button>
<!-- #endif -->
<!-- #ifndef MP -->
<view class="flex-y-center item" @click="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="image"></image>
<view class="name">{{ item.name }}</view>
<text class="iconfont icon-ic_rightarrow"></text>
</view>
<!-- #endif -->
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.service {
padding: 20rpx 0;
border-radius: 16rpx;
margin: 20rpx;
background-color: #ffffff;
.text-left{
text-align: left;
}
.item {
padding: 28rpx 20rpx 28rpx 32rpx;
}
.image {
width: 40rpx;
height: 40rpx;
margin-right: 24rpx;
}
.name {
flex: 1;
font-size: 28rpx;
color: #333333;
}
.iconfont {
font-size: 28rpx;
color: #999999;
}
}
</style>

View File

@@ -0,0 +1,41 @@
<script>
export default {
inject: ['goMenuPage'],
props: {
menuData: {
type: Object,
default: () => {}
},
routineContact: {
type: Number,
default: 0
}
}
};
</script>
<template>
<view class="px-20 grid-column-3 grid-gap-24rpx mt-20">
<view v-show="item.is_show" v-for="(item, index) in menuData.list" :key="index">
<!-- #ifdef MP -->
<view class="flex-col flex-center bg--w111-fff h-220 rd-24rpx" v-if="item.url!='/pages/extension/customer_list/chat' || (item.url=='/pages/extension/customer_list/chat' && routineContact == 0)"
@tap="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="w-64 h-64 block mb-16"></image>
<view class="fs-26 lh-36rpx">{{ item.name }}</view>
</view>
<button class="flex-col flex-center bg--w111-fff h-220 rd-24rpx" open-type='contact' v-if="item.url=='/pages/extension/customer_list/chat' && routineContact == 1">
<image :src="item.pic" class="w-64 h-64 block mb-16"></image>
<view class="fs-26 lh-36rpx">{{ item.name }}</view>
</button>
<!-- #endif -->
<!-- #ifndef MP -->
<view class="flex-col flex-center bg--w111-fff h-220 rd-24rpx"
@tap="goMenuPage(item.url, item.name)">
<image :src="item.pic" class="w-64 h-64 block mb-16"></image>
<view class="fs-26 lh-36rpx">{{ item.name }}</view>
</view>
<!-- #endif -->
</view>
</view>
</template>

View File

@@ -0,0 +1,74 @@
<script>
import propertyList from '@/utils/propertyList.js';
import template1 from './template1.vue';
import template2 from './template2.vue';
export default {
components: {
template1,
template2
},
props: {
userInfo: {
type: Object,
default: () => {}
},
orderData: {
type: Object,
default: () => {}
},
orderMenu: {
type: Array,
default() {
return [];
}
},
orderAdminData: {
type: Object,
default: () => {}
}
},
watch: {
orderData: {
handler(nVal, oVal) {
// this.iconFilter(nVal.style);
},
immediate: true,
deep: true
}
},
data() {
return {
property: []
};
},
methods: {}
};
</script>
<template>
<view>
<template1 v-if="orderData.style == 1" :orderMenu="orderMenu" :notPayOrder="orderAdminData.not_pay_order" :commission="orderAdminData.commission"></template1>
<template2 v-if="orderData.style == 2 || orderData.style == 3" :notPayOrder="orderAdminData.not_pay_order" :orderStyle="orderData.style" :orderMenu="orderMenu"></template2>
</view>
</template>
<style lang="scss" scoped>
// /deep/ .section-content .uni-badge-left-margin {
// position: absolute;
// top: 0rpx;
// right: 44rpx;
// /deep/.uni-badge--error {
// background-color: #fff !important;
// }
// /deep/.uni-badge {
// color: var(--view-theme);
// border: 1px solid var(--view-theme);
// z-index: 29;
// }
// }
.text-primary-con {
color: var(--view-theme);
}
</style>

View File

@@ -0,0 +1,158 @@
<script>
import countDown from '@/components/countDown';
export default {
components: { countDown },
inject: ['intoPage', 'goMenuPage', 'getMenuData'],
props: {
orderMenu: {
type: Array,
default: () => []
},
notPayOrder: {
type: Object,
default: () => {}
}
},
methods: {
goUserSpread() {
uni.navigateTo({
url: '/pages/users/user_spread_user/index'
});
}
}
};
</script>
<template>
<view class="">
<view class="pr-24 pl-24 bg--w111-fff rd-16rpx mt-20 ml-20 mr-20">
<view class="acea-row row-middle row-between section-header">
<view>订单中心</view>
<view class="arrow flex-x-center" @click="intoPage('/pages/goods/order_list/index')">
查看全部
<text class="iconfont icon-ic_rightarrow"></text>
</view>
</view>
<view class="acea-row section-content">
<view v-for="(item,index) in orderMenu" :key="index" class="item"
@click="intoPage(item.url)">
<view class="icon"><text :class="item.icon" class="iconfont"></text></view>
<view class="">{{ item.title }}</view>
<uni-badge class="uni-badge-left-margin" v-if="item.num > 0" :text="item.num"></uni-badge>
</view>
<view class="w-full h-120 rd-16rpx bg--w111-f5f5f5 mt-32 p-10 flex-between-center" v-if="notPayOrder" @click="intoPage('/pages/goods/order_list/index?status=0')">
<view class="flex-y-center">
<image :src="notPayOrder.img" class="w-100 h-100 rd-12rpx"></image>
<view class="ml-16">
<view class="fs-24 lh-34rpx text--w111-333 fw-500">等待付款</view>
<view class="fs-22 lh-30rpx text--w111-333 mt-12 flex-y-center">
还剩
<!-- <text class="text-primary-con SemiBold">23:57:16</text> -->
<countDown
:is-day="false"
tip-text=" "
day-text=" "
hour-text=":"
minute-text=":"
second-text=" "
:datatime="notPayOrder.stop_time"
bgColor="#F5F5F5"
colors="var(--view-theme)"
dotColor="var(--view-theme)"
@endTime="getMenuData"
></countDown>
订单自动关闭
</view>
</view>
</view>
<view class="w-136 h-56 rd-30rpx flex-center fs-24 fw-500 text-primary-con con_border mr-14">去支付</view>
</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.section-content {
padding: 48rpx 0 36rpx;
.item {
position: relative;
flex: 1;
text-align: center;
font-size: 26rpx;
line-height: 36rpx;
color: #333333;
.uni-badge-left-margin {
position: absolute;
top: -20rpx;
right: 26rpx;
/deep/ .uni-badge--error {
background-color: var(--view-theme) !important;
}
.uni-badge {
color: var(--view-theme);
border: 1px solid var(--view-theme);
z-index: 29;
}
}
}
.icon {
margin-bottom: 18rpx;
}
.iconfont {
font-size: 48rpx;
}
.con_border {
color: var(--view-theme);
border: 1px solid var(--view-theme);
}
}
.section-header {
padding: 32rpx 6rpx 0;
font-weight: 500;
font-size: 30rpx;
line-height: 42rpx;
color: #333333;
.arrow {
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.iconfont {
font-size: 24rpx;
}
}
.top {
position: relative;
height: 84rpx;
display: flex;
justify-content: space-between;
&::after {
content: '';
position: absolute;
right: 8rpx;
bottom: 0;
left: 8rpx;
height: 1rpx;
background-color: #eeeeee;
}
.item {
// flex: 1;
padding: 0 8rpx;
font-size: 26rpx;
color: #999999;
}
.value {
margin-left: 8rpx;
font-size: 28rpx;
color: #333333;
}
}
</style>

View File

@@ -0,0 +1,104 @@
<script>
import countDown from '@/components/countDown';
export default {
components: { countDown },
inject: ['intoPage', 'goMenuPage'],
props: {
orderMenu: {
type: Array,
default: () => []
},
orderStyle: {
type: Number,
default: 0
},
notPayOrder: {
type: Object,
default: () => {}
}
}
};
</script>
<template>
<view class="">
<view class="pt-34 pr-24 pb-32 pl-24 bg--w111-fff rd-16rpx mt-20 order-wrapper ml-20 mr-20">
<view class="flex-between-center">
<text class="fs-30 fw-500 lh-42rpx text--w111-333">订单中心</text>
<view class="flex-y-center text--w111-999" @click="intoPage('/pages/goods/order_list/index')">
<text class="fs-26 lh-26rpx">查看全部</text>
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</view>
</view>
<view class="flex-between-center mt-30" :class="{ theme: orderStyle == 2 }">
<view class="w-128 flex-col flex-center item" v-for="item in orderMenu" :key="item.title" @click="intoPage(item.url)">
<text :class="item.icon" class="iconfont fs-48"></text>
<text class="fs-26 lh-36rpx text--w111-282828 pt-22">{{ item.title }}</text>
<uni-badge class="uni-badge-left-margin" v-if="item.num > 0" :text="item.num"></uni-badge>
</view>
</view>
<view class="w-full h-120 rd-16rpx bg--w111-f5f5f5 mt-32 p-10 flex-between-center" v-if="notPayOrder" @click="intoPage('/pages/goods/order_list/index?status=0')">
<view class="flex-y-center">
<image :src="notPayOrder.img" class="w-100 h-100 rd-12rpx"></image>
<view class="ml-16">
<view class="fs-24 lh-34rpx text--w111-333 fw-500">等待付款</view>
<view class="fs-22 lh-30rpx text--w111-333 mt-12 flex-y-center">
还剩
<!-- <text class="text-primary-con SemiBold">23:57:16</text> -->
<countDown
:is-day="false"
tip-text=" "
day-text=" "
hour-text=":"
minute-text=":"
second-text=" "
:datatime="notPayOrder.stop_time"
bgColor="#F5F5F5"
colors="var(--view-theme)"
dotColor="var(--view-theme)"
@endTime="getMenuData"
></countDown>
订单自动关闭
</view>
</view>
</view>
<view class="w-136 h-56 rd-30rpx flex-center fs-24 fw-500 text-primary-con con_border mr-14">去支付</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.order-wrapper {
.uni-badge-left-margin {
position: absolute;
top: -12rpx;
right: 24rpx;
.uni-badge--error {
background-color: #fff !important;
}
/deep/ .uni-badge--error {
background-color: var(--view-theme) !important;
}
.uni-badge {
color: var(--view-theme);
border: 1px solid var(--view-theme);
z-index: 29;
}
}
.con_border {
color: var(--view-theme);
border: 1px solid var(--view-theme);
}
.image {
width: 48rpx;
height: 48rpx;
}
.theme .iconfont {
color: var(--view-theme);
}
.item {
position: relative;
}
}
</style>

View File

@@ -0,0 +1,31 @@
<script>
import template1 from './template1.vue';
import template2 from './template2.vue';
export default {
components: {
template1,
template2
},
props: {
orderAdminData: {
type: Object,
default: () => {}
},
orderStaticData: {
type: Object,
default() {
return () => {};
}
}
}
};
</script>
<template>
<view v-if="orderStaticData.is_show">
<template1 v-if="orderStaticData.style == 1" :staticData="orderAdminData"></template1>
<template2 v-if="orderStaticData.style == 2" :staticData="orderAdminData"></template2>
</view>
</template>
<style></style>

View File

@@ -0,0 +1,71 @@
<script>
import {HTTP_REQUEST_URL} from '@/config/app';
export default {
props: {
staticData: {
type: Object,
default: () => {}
}
},
inject: ['goMenuPage'],
computed:{
bgStyle1(){
return {
backgroundImage: 'url('+ HTTP_REQUEST_URL +'/statics/images/product/group1_pic.png'+')'
}
},
bgStyle2(){
return {
backgroundImage: 'url('+ HTTP_REQUEST_URL +'/statics/images/product/group2_pic.png'+')'
}
},
bgStyle3(){
return {
backgroundImage: 'url('+ HTTP_REQUEST_URL +'/statics/images/product/group3_pic.png'+')'
}
},
}
};
</script>
<template>
<view class="pt-32 pr-24 pb-32 pl-24 bg--w111-fff rd-16rpx mt-20 ml-20 mr-20">
<view class="fs-30 fw-500 lh-42rpx text--w111-333">运营统计</view>
<view class="flex-between-center mt-14">
<view class="w-208 rd-16rpx pt-24 pl-24 pb-20 flex-col bg-cover"
:style="[bgStyle1]"
@click="goMenuPage('/pages/admin/order/index')">
<text class="fs-24 text--w111-999 lh-34rpx">
支付金额
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
<text class="fs-32 text--w111-333 fw-bold lh-52rpx num-fa-semi">{{ staticData.price }}</text>
</view>
<view class="w-208 rd-16rpx pt-24 pl-24 pb-20 flex-col bg-cover"
:style="[bgStyle2]"
@click="goMenuPage('/pages/admin/order/index')">
<text class="fs-24 text--w111-999 lh-34rpx">
支付订单数
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
<text class="fs-32 text--w111-333 fw-bold lh-52rpx num-fa-semi">{{ staticData.num }}</text>
</view>
<view class="w-208 rd-16rpx pt-24 pl-24 pb-20 flex-col bg-cover"
:style="[bgStyle3]"
@click="goMenuPage('/pages/admin/orderList/index?types=1')">
<text class="fs-24 text--w111-999 lh-34rpx">
待发货订单
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
<text class="fs-32 text--w111-333 fw-bold lh-52rpx num-fa-semi">{{ staticData.consignment }}</text>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.bg-cover{
background-size: cover;
}
</style>

View File

@@ -0,0 +1,49 @@
<script>
export default {
props: {
staticData: {
type: Object,
default: () => {}
}
},
inject: ['goMenuPage'],
};
</script>
<template>
<view class="">
<view class="mt-20 rd-16rpx bg--w111-fff pt-36 pr-40 pb-36 pl-40 ml-20 mr-20 flex-between-center">
<view class="flex-col flex-center text--w111-333" @click="goMenuPage('/pages/admin/order/index')">
<text class="fs-36 fw-600 lh-36rpx num-fa-semi">{{ staticData.price }}</text>
<text class="fs-24 lh-34rpx pt-16">
支付订单金额
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
</view>
<view class="v-Line"></view>
<view class="flex-col flex-center text--w111-333" @click="goMenuPage('/pages/admin/order/index')">
<text class="fs-36 fw-600 lh-36rpx num-fa-semi">{{ staticData.num }}</text>
<text class="fs-24 lh-34rpx pt-16">
支付订单数
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
</view>
<view class="v-Line"></view>
<view class="flex-col flex-center text--w111-333" @click="goMenuPage('/pages/admin/orderList/index?types=1')">
<text class="fs-36 fw-600 lh-36rpx num-fa-semi">{{ staticData.consignment }}</text>
<text class="fs-24 lh-34rpx pt-16">
待发货订单数
<text class="iconfont icon-ic_rightarrow fs-24"></text>
</text>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.v-Line {
width: 1px;
height: 40rpx;
background: #eee;
}
</style>

View File

@@ -0,0 +1,62 @@
<script>
export default {
props: {
posterData: {
type: Object,
default: () => {}
}
},
data() {
return {
autoplay: true,
circular: true,
interval: 3000,
duration: 500
};
},
inject: ['goMenuPage'],
methods: {}
};
</script>
<template>
<!-- 轮播 -->
<view class="slider-wrapper" v-if="posterData.list.length && posterData.is_show">
<swiper
:indicator-dots="posterData.list.length > 1 ? true : false"
:autoplay="autoplay"
:circular="circular"
:interval="interval"
:duration="duration"
indicator-color="rgba(255,255,255,0.6)"
indicator-active-color="#fff"
>
<block v-for="(item, index) in posterData.list" :key="index">
<swiper-item>
<view @click="goMenuPage(item.url)" class="slide-navigator acea-row row-between-wrapper" hover-class="none">
<image :src="item.pic" class="slide-image" mode="aspectFill"></image>
</view>
</swiper-item>
</block>
</swiper>
</view>
</template>
<style lang="scss" scoped>
.slider-wrapper {
margin: 20rpx 20rpx;
height: 188rpx;
swiper,
swiper-item {
height: 100%;
}
image {
width: 100%;
height: 188rpx;
border-radius: 16rpx;
}
}
</style>

View File

@@ -0,0 +1,80 @@
<template>
<view class="navbar">
<view class="content" :class="[`style-${styleType}`]" :style="{ background: isScrolling && [2, 3, 4, 5].includes(styleType) ? '#fff' : 'transparent' }">
<view :style="{ height: `${getHeight.barTop}px` }"></view>
<view class="acea-row row-center-wrapper" :style="{ height: `${getHeight.barHeight }px` }">
<view class="title">个人中心</view>
</view>
</view>
<view class="placeholder">
<view :style="{ height: `${getHeight.barTop}px` }"></view>
<view :style="{ height: `${getHeight.barHeight}px` }"></view>
</view>
</view>
</template>
<script>
export default {
props: {
styleType: {
type: Number,
default: 0
},
isScrolling: {
type: Boolean,
default: false
}
},
data() {
return {
getHeight: this.$util.getWXStatusHeight()
};
}
};
</script>
<style lang="scss">
.navbar {
position: relative;
.content.style-1 {
background-color: var(--view-theme) !important;
}
.content.style-2 {
background-color: #f5f5f5;
.title {
color: #333;
}
}
.content.style-3 {
background-color: rgba(0, 0, 0, 0);
.title {
color: #333;
}
}
.content.style-4 {
background-color: #f5f5f5;
.title {
color: #333;
}
}
.content.style-5 {
// background-color: rgba(0, 0, 0, 0);
// background: #ffffff linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
// background-image: url('https://test-pro30.crmeb.net/statics/images/users/header_bg4.jpg');
.title {
color: #333;
}
}
.content {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 998;
background-color: var(--view-theme);
font-weight: 500;
font-size: 34rpx;
color: #ffffff;
}
}
</style>

View File

@@ -0,0 +1,751 @@
<template>
<!-- 个人中心模块 -->
<view class="user-page" :style="colorStyle">
<template v-if="isObjectData(diyData)">
<user-member :userInfo="userInfo" :memberData="diyData.member" :orderAdminData="orderAdminData" :balanceStatus="balanceStatus" :isScrolling="isScrolling"></user-member>
<user-order :orderMenu="orderMenu" :orderAdminData="orderAdminData" :userInfo="userInfo" :memberData="diyData.member" :orderData="diyData.order"></user-order>
<!-- fsgx 快捷入口我的资产 & 推荐佣金 member-points 保持一致风格 -->
<view class="acea-row member-points hjf-nav-row">
<view class="acea-row row-middle row-center item" @tap="intoPage('/pages/assets/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/queue/status')">
<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>
<user-order-static
v-if="isObjectData(orderAdminData) && orderAdminData.order.user_order"
:orderAdminData="orderAdminData.order"
:orderStaticData="diyData.orderStatic"
></user-order-static>
<user-poster :posterData="diyData.poster"></user-poster>
<user-menu :menuData="diyData.menu" :routineContact="routineContact"></user-menu>
<user-menu v-if="storeMenuShow" :menuData="diyData.merMenu"></user-menu>
<view class="copy_right pb-20">
<template v-if="configData && configData.copyrightContext">
<image :src="configData.copyrightImage" mode="aspectFill" class="copyRightImg"></image>
<view class="of0b21">
{{ configData.copyrightContext }}
</view>
</template>
<image v-else :src="copyrightImage" mode="aspectFill" class="support"></image>
</view>
</template>
<view class="mark" v-show="isextension"></view>
<pageFooter :style="colorStyle"></pageFooter>
<ewcomerPop v-if="isComerGift" :comerGift="comerGift" @comerPop="comerPop"></ewcomerPop>
<activityModal :pageIndex="4"></activityModal>
<!-- #ifdef MP -->
<editUserModal :isShow="editModal" @closeEdit="closeEdit" @editSuccess="editSuccess"></editUserModal>
<!-- #endif -->
</view>
</template>
<script>
import { storeCardApi } from '@/api/store.js';
import { newcomerGift } from '@/api/activity.js';
import { copyRight } from '@/api/api.js';
import { getMenuList, getUserInfo, setVisit, updateUserInfo, getRandCode, updateWechatInfo, getMenuData, checkIdentityApi } from '@/api/user.js';
import { wechatAuthV2, silenceAuth } from '@/api/public.js';
import { toLogin } from '@/libs/login.js';
import { mapState, mapGetters } from 'vuex';
import Cache from '@/utils/cache';
// #ifdef H5
import Auth from '@/libs/wechat';
// #endif
import { HTTP_REQUEST_URL } from '@/config/app';
const app = getApp();
import ewcomerPop from '@/components/ewcomerPop/index.vue';
import pageFooter from '@/components/pageFooter/index.vue';
import Routine from '@/libs/routine';
import colors from '@/mixins/color';
// #ifdef MP
import editUserModal from '@/components/eidtUserModal/index.vue';
// #endif
import userMember from './components/member/index.vue';
import userOrder from './components/order/index.vue';
import userOrderStatic from './components/order_static/index.vue';
import userMenu from './components/menus/index.vue';
import userPoster from './components/poster/index.vue';
import activityModal from "@/components/activityModal/index.vue";
export default {
components: {
userMember,
userOrder,
userOrderStatic,
userMenu,
userPoster,
pageFooter,
ewcomerPop,
activityModal,
// #ifdef MP
editUserModal
// #endif
},
computed: {
...mapGetters(['isLogin','cartNum']),
},
filters: {},
mixins: [colors],
provide() {
return {
tapQrCode: this.tapQrCode,
bindPhone: this.bindPhone,
intoPage: this.intoPage,
goMenuPage: this.goMenuPage,
getMenuData: this.getMenuData,
goEdit: this.goEdit,
checkApp: this.checkIdentity
};
},
data() {
return {
diyData: {},
orderAdminData: {},
// #ifdef MP
getHeight: this.$util.getWXStatusHeight(),
// #endif
vipStatus: 0,
stu: false,
orderMenu: [
{
icon: '',
title: '待付款',
url: '/pages/goods/order_list/index?status=0'
},
{
icon: '',
title: '待发货',
url: '/pages/goods/order_list/index?status=1'
},
{
icon: '',
title: '待收货',
url: '/pages/goods/order_list/index?status=2'
},
{
icon: '',
title: '待评价',
url: '/pages/goods/order_list/index?status=3'
},
{
icon: '',
title: '售后/退款',
url: '/pages/users/user_return_list/index'
}
],
imgUrls: [],
orderStatusNum: {},
userInfo: {
pay_vip_status: 0,
avatar: '',
uid: '',
nickname: '',
level: '',
phone: '',
service_num: null,
level_status: 0,
is_promoter: 0
},
storeMenuShow: false, // 商家管理是否显示
showStatus: 1,
// #ifdef H5
isWeixin: Auth.isWeixin(),
//#endif
footerSee: false,
member_style: 1,
my_banner_status: 1,
menu_status: 1,
service_status: 1,
newcomer_status: 1,
codeIndex: 0,
config: {
bar: {
code: '',
color: ['#000'],
bgColor: '#FFFFFF', // 背景色
width: 480, // 宽度
height: 110 // 高度
},
qrc: {
code: '',
size: 380, // 二维码大小
level: 3, //等级 04
bgColor: '#FFFFFF', //二维码背景色 默认白色
border: {
color: ['#eee', '#eee'], //边框颜色支持渐变色
lineWidth: 3 //边框宽度
},
// img: '/static/logo.png', //图片
// iconSize: 40, //二维码图标的大小
color: ['#333', '#333'] //边框颜色支持渐变色
}
},
isCode: false,
isextension: false,
extension: {
code: '',
size: 380, // 二维码大小
level: 3, //等级 04
bgColor: '#FFFFFF', //二维码背景色 默认白色
border: {
color: ['#eee', '#eee'], //边框颜色支持渐变色
lineWidth: 3 //边框宽度
},
// img: '/static/logo.png', //图片
// iconSize: 40, //二维码图标的大小
color: ['#333', '#333'] //边框颜色支持渐变色
},
imgHost: HTTP_REQUEST_URL,
configData: Cache.get('BASIC_CONFIG') || {},
copyrightImage: HTTP_REQUEST_URL + '/statics/images/product/support.png',
giftPic: '',
vip_type: 1,
newcomer_style: 1,
newList: [],
newBg: '',
comerGift: {},
isComerGift: false,
memberStatus: 0,
balanceStatus: 0, // 余额是否展示
editModal: false, // 编辑头像信息
isScrolling: false,
orderStyle: {
1: ['icon-ic_daifukuan12', 'icon-ic_daifahuo11', 'icon-ic_daishouhuo1', 'icon-ic_daipingjia1', 'icon-ic_daituikuan1'],
2: ['icon-ic_daifukuan2', 'icon-ic_daifahuo2', 'icon-ic_daishouhuo2', 'icon-ic_daipingji2', 'icon-ic_daituikuan2'],
3: ['icon-ic_daifukuan', 'icon-ic_daifahuo', 'icon-ic_daishouhuo', 'icon-ic_daipingjia', 'icon-ic_daituikuan']
},
routineContact: 0
};
},
onShow() {
if (this.cartNum > 0) {
uni.setTabBarBadge({
index: 3,
text: this.cartNum > 99 ? '99+' : this.cartNum + ''
});
} else {
uni.hideTabBarRedDot({
index: 3
});
}
// this.copyRightText = uni.getStorageSync('copyNameInfo');
// this.copyRightImg = uni.getStorageSync('copyImageInfo');
uni.removeStorageSync('form_type_cart');
if (this.isLogin) {
this.getUserInfo();
this.getMyMenus();
this.setVisit();
this.getMenuData();
this.getChannel();
} else {
// #ifdef H5
let allPages = getCurrentPages(); //获取当前页面栈的实例;
let lastPages = allPages.length - 1; // 获得倒数第二个元素的索引;
let option = allPages[lastPages].options; // 获得上个页面传递的参数;
let WX_AUTH = this.$Cache.get('WX_AUTH');
if (Auth.isWeixin() && option.code) {
//微信公众号静默授权
if (WX_AUTH) {
this.wechatAuthoize(option.code);
} else {
uni.navigateTo({
url: '/pages/users/wechat_login/index'
});
}
} else {
this.getMyMenus();
}
// #endif
// #ifdef MP || APP-PLUS
this.getMyMenus();
// #endif
}
},
// #ifdef MP || APP-PLUS
onPageScroll(e) {
if (e.scrollTop > 50) {
this.isScrolling = true;
} else if (e.scrollTop < 50) {
this.isScrolling = false;
}
},
// #endif
methods: {
isObjectData(obj) {
return Object.keys(obj).length !== 0;
},
// #ifdef MP
editSuccess() {
this.editModal = false;
this.getUserInfo();
},
closeEdit() {
this.editModal = false;
},
// #endif
// 查看订单
intoPage(url) {
if (this.isLogin) {
this.$util.JumpPath(url);
} else {
toLogin();
}
},
// 编辑页面
goEdit() {
if (this.isLogin == false || !this.userInfo.uid) {
toLogin();
} else {
// #ifdef MP
if (this.userInfo.is_default_avatar) {
this.editModal = true;
return;
}
// #endif
uni.navigateTo({
url: '/pages/users/user_set/index'
});
}
},
goDetail(item) {
uni.navigateTo({
url: `/pages/goods_details/index?id=${item.id}&fromPage='newVip'`
});
},
comerPop() {
this.isComerGift = false;
},
getNewcomerGift() {
if (uni.getStorageSync('newcomerGift')) {
return (this.isComerGift = false);
}
newcomerGift()
.then((res) => {
this.comerGift = res.data;
if (Object.prototype.toString.call(this.comerGift) == '[object Object]') {
if (res.data.coupon_count || res.data.product_count || res.data.register_give_money || res.data.first_order_discount || res.data.register_give_integral) {
uni.setStorageSync('newcomerGift', true);
this.isComerGift = true;
}
}
})
.catch((err) => {
return this.$util.Tips({
title: err
});
});
},
tapQrCode() {
if(this.isLogin){
uni.navigateTo({
url: '/pages/users/user_member_code/index'
});
}else{
toLogin();
}
},
getRoutineUserInfo(e) {
updateUserInfo({
userInfo: e.detail.userInfo
})
.then((res) => {
this.getUserInfo();
return this.$util.Tips('更新用户信息成功');
})
.catch((err) => {
return this.$util.Tips(err);
});
},
// 记录会员访问
setVisit() {
setVisit({
url: '/pages/user/index'
}).then((res) => {});
},
// 打开授权
openAuto() {
toLogin();
},
// 授权回调
onLoadFun(e) {
this.getUserInfo(e);
this.getMyMenus();
this.setVisit();
},
// 绑定手机
bindPhone() {
uni.navigateTo({
url: '/pages/users/user_phone/index'
});
},
// 获取行销数据
getMenuData() {
getMenuData().then((res) => {
this.orderAdminData = res.data;
});
},
/**
* 获取个人用户信息
*/
getUserInfo() {
let that = this;
getUserInfo().then((res) => {
that.userInfo = res.data;
that.stu = res.data.svip_open;
that.balanceStatus = res.data.balance_func_status;
that.memberStatus = parseInt(res.data.member_func_status);
that.vipStatus = res.data.vip_status;
that.$store.commit('SETUID', res.data.uid);
that.$store.commit('UPDATE_USERINFO', res.data);
that.orderMenu.forEach((item, index) => {
switch (item.title) {
case '待付款':
this.$set(item, 'num', res.data.orderStatusNum.unpaid_count);
break;
case '待发货':
this.$set(item, 'num', res.data.orderStatusNum.unshipped_count);
break;
case '待收货':
this.$set(item, 'num', res.data.orderStatusNum.received_count);
break;
case '待评价':
this.$set(item, 'num', res.data.orderStatusNum.evaluated_count);
break;
case '售后/退款':
this.$set(item, 'num', res.data.orderStatusNum.refunding_count);
break;
}
});
});
},
getMyMenus: function () {
let that = this;
// if (this.MyMenus.length) return;
getMenuList().then((res) => {
res.data.routine_my_menus.forEach((el, index, arr) => {
if (el.type == '2') {
this.storeMenuShow = true;
}
});
this.diyData = res.data.diy_data;
this.switchTab(this.diyData.order.style);
this.my_banner_status = res.data.diy_data.my_banner_status;
this.menu_status = res.data.diy_data.menu_status;
this.service_status = res.data.diy_data.service_status;
this.vip_type = res.data.diy_data.vip_type;
this.newcomer_style = res.data.diy_data.newcomer_style;
this.newcomer_status = res.data.diy_data.newcomer_status;
this.imgUrls = res.data.routine_my_banner;
this.routineContact = Number(res.data.routine_contact_type);
});
},
switchTab(style) {
this.orderMenu.forEach((item, index) => {
item.icon = this.orderStyle[style][index];
});
},
goMenuPage(url, name) {
if (this.isLogin) {
let arr = url.split('@APPID=');
if (arr.length > 1) {
//#ifdef MP
uni.navigateToMiniProgram({
appId: arr[arr.length - 1], // 此为生活缴费appid
path: arr[0], // 此为生活缴费首页路径
envVersion: 'release',
success: (res) => {
console.log('打开成功', res);
},
fail: (err) => {
console.log('sgdhgf', err);
}
});
//#endif
//#ifndef MP
this.Tips({
title: 'h5与app端不支持跳转外部小程序'
});
//#endif
} else {
if (url == '/pages/extension/customer_list/chat' || url == 'https://chat.crmeb.net/chat/mobile') {
this.$util.getCustomer(this.userInfo);
} else {
if (url.indexOf('http') === -1) {
// #ifdef H5
if (name && name === '订单核销') {
return (window.location.href = `${location.origin}${url}`);
}
// #endif
// #ifdef MP
if (url != '#' && url == '/pages/users/user_set/index') {
uni.openSetting({
success: function (res) {}
});
}
// #endif
if (url == '/pages/store_spread/index') {
storeCardApi()
.then((res) => {
this.isextension = true;
this.$nextTick(function () {
this.extension.code = res.data.url;
});
})
.catch((err) => {
uni.hideLoading();
this.$util.Tips({
title: err
});
});
}
if (url == '/pages/users/spreadData/index' || url == '/pages/users/user_spread_user/index') {
if (this.userInfo.is_promoter == 0) {
uni.showToast({
title:'无推广权限,请申请分销权限或联系管理员',
icon:'none'
})
} else {
uni.navigateTo({
url
});
}
return;
}
if (url == '/pages/users/agent/apply') {
if (this.userInfo.division_status == -1) {
uni.navigateTo({
url: '/pages/users/agent/apply'
});
} else {
uni.navigateTo({
url: '/pages/users/agent/state'
});
}
return;
}
if (url == '/pages/users/distributor/apply') {
if (this.userInfo.promoter_status == -1) {
uni.navigateTo({
url: '/pages/users/distributor/apply'
});
} else {
uni.navigateTo({
url: '/pages/users/agent/state?type=promoter'
});
}
return;
}
if (
['/pages/goods_cate/goods_cate', '/pages/order_addcart/order_addcart', '/pages/user/index', '/pages/store_cate/store_cate', '/pages/index/index'].indexOf(url) == -1
) {
uni.navigateTo({
url: url
});
} else {
uni.reLaunch({
url: url
});
}
} else {
// #ifdef H5
this.$util.JumpPath(url);
// #endif
// #ifndef H5
uni.navigateTo({
url: `/pages/annex/web_view/index?url=${url}`
});
// #endif
}
}
}
}else{
toLogin()
}
},
isWork() {
return navigator.userAgent.toLowerCase().indexOf('wxwork') !== -1 && navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1;
},
wechatAuthoize(code) {
let that = this;
if (!this.isWork()) {
this.$Cache.set('WX_AUTH', code);
silenceAuth({
code: code,
snsapi: 'snsapi_base',
spread_spid: that.$Cache.get('spid')
})
.then((res) => {
if (res.data.key) {
this.$Cache.set('snsapiKey', res.data.key);
} else {
let time = res.data.expires_time - this.$Cache.time();
this.$store.commit('LOGIN', {
token: res.data.token,
time: time
});
this.$store.commit('SETUID', res.data.userInfo.uid);
this.$store.commit('UPDATE_USERINFO', res.data.userInfo);
location.reload();
}
})
.catch((err) => {
uni.hideLoading();
return this.$util.Tips({
title: error
});
});
}
},
checkIdentity(val){
// let o5c782 = this.$store.state.app.system_channel_style;
checkIdentityApi({identity: val}).then(res=>{
getUserInfo().then((res) => {
this.$store.commit('UPDATE_USERINFO', res.data);
if(val == 1){
uni.redirectTo({
// url: o5c782 == 1 ? '/pages/merchant/index/index' : '/pages/merchant/index/goods'
url: '/pages/merchant/index/index'
})
}
if(val == 2){
uni.redirectTo({
url: '/pages/admin/work/index'
})
}
});
}).catch(err=>{
return this.$util.Tips({
title: err
});
})
},
getChannel(){
let o8e37 = this.$store.state.app.identity;
if(o8e37 == 1 && this.isLogin){
setTimeout(()=>{
uni.redirectTo({
url: "/pages/merchant/index/goods"
})
},500)
}
if(o8e37 == 2 && this.isLogin){
uni.redirectTo({
url:"/pages/admin/work/index"
})
}
}
}
};
</script>
<style lang="scss" scoped>
.footer-placeholder {
height: calc(98rpx + constant(safe-area-inset-bottom));
height: calc(98rpx + env(safe-area-inset-bottom));
height: 98rpx;
}
.user-page {
padding-bottom: calc(100rpx+ constant(safe-area-inset-bottom));
padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
padding-bottom: 100rpx;
}
.copy_right {
text-align: center;
color: #ccc;
font-size: 22rpx;
margin-top: 40rpx;
.copyRightImg {
width: 219rpx;
height: 74rpx;
margin: 16rpx auto;
display: block;
}
.support {
width: 219rpx;
height: 74rpx;
margin: 54rpx auto;
display: block;
}
.of0b21 {
margin-top: 0rpx;
color: #ccc;
font-size: 20rpx;
margin-bottom: 20rpx;
}
}
// fsgx 导航行:复用 member-points 样式(与会员中心/积分商城完全一致)
.hjf-nav-row {
margin-top: 0 !important;
}
.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;
}
}
</style>