You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
595 lines
15 KiB
Vue
595 lines
15 KiB
Vue
<template>
|
|
<view class="p-person-inedx g_w_all g_bg_f_5 g_kuaishou">
|
|
<view class="g_h_10"></view>
|
|
<!-- 基本信息 -->
|
|
<g-panel-card-info
|
|
:info="{
|
|
avatar: userinfo.avatar,
|
|
title: userinfo.name,
|
|
num: userinfo.tel,
|
|
isHaveOrder: isHaveOrder,
|
|
}"
|
|
@clickCard="goPage('/root/person/info')"
|
|
/>
|
|
<view class="g_mt_10 g_mb_10 g_ml_10 g_mr_10" v-if="isLogin && isCreator">
|
|
<!-- 数据展示 -->
|
|
<view class="g_bg_f g_radius_8" v-if="true">
|
|
<view v-if="isHaveOrder" class="g_pt_12 g_pb_12 g_flex_row_between" style="border-bottom: 1px solid #f5f5f5">
|
|
<view class="g_fs_16 g_c_3 g_fw_600 g_flex_none g_pl_16">我的发单账号</view>
|
|
<view class="g_flex_row_end g_flex_1 g_pr_16" hover-class="thover" @click="goPage('/root/person/myOrder')">
|
|
<view class="g_fs_16 g_c_6">{{ userinfo.agencyName }}</view>
|
|
<view class="g_ml_6 g_flex_column_center">
|
|
<i class="iconfont icon-gengduo11 g_c_c"></i>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="g_flex_row_center">
|
|
<view
|
|
v-for="(item, index) in userinfo.num"
|
|
:key="index"
|
|
@click="handleClickNum(item, index)"
|
|
hover-class="g_bg_e"
|
|
class="g_flex_row_center"
|
|
:style="{
|
|
'border-right': index < 3 && isHaveOrder ? '1px solid #f5f5f5' : 'none',
|
|
width: isHaveOrder ? '25%' : '100%',
|
|
}"
|
|
>
|
|
<view class="g_pt_16 g_pb_16">
|
|
<view class="g_flex_row_center g_fs_20 g_c_3 g_fw_bold">
|
|
<view style="position: relative">
|
|
{{ item.num }}
|
|
<view v-if="item.tip" style="position: absolute; right: -10px; top: 0" class="g_w_6 g_h_6 g_radius_50 g_bg_f40"></view>
|
|
</view>
|
|
</view>
|
|
<view class="g_flex_row_center g_fs_14 g_c_6 g_mt_4">{{ item.name }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-if="isHaveOrder" style="border-top: 1px solid #f5f5f5" class="g_flex_row_between">
|
|
<view
|
|
v-for="(item, index) in mamageList"
|
|
:key="index"
|
|
class="g_flex_row_between g_pt_12 g_pb_12"
|
|
style="width: 50%"
|
|
hover-class="g_bg_e"
|
|
:style="{
|
|
'border-right': index < 1 ? '1px solid #f5f5f5' : 'none',
|
|
}"
|
|
@click="goPage(item.path)"
|
|
>
|
|
<view class="g_flex_row_start g_pl_16">
|
|
<view class="g_mr_5 g_flex_column_center">
|
|
<i class="t-icon g_w_20 g_h_20" :class="'t-' + item.icon" style="font-size: 20px; width: 20px; height: 20px"></i>
|
|
</view>
|
|
<view class="g_fs_16 g_c_3 g_flex_column_center">{{ item.name }}</view>
|
|
</view>
|
|
<view class="g_pr_13 g_flex_column_center">
|
|
<i class="iconfont icon-gengduo11 g_c_c"></i>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="g_flex_row_between g_m_10" v-if="false">
|
|
<g-panel-fond
|
|
style="width: 100%"
|
|
:showRemark="false"
|
|
:item="{
|
|
icon: 't-icon-fazhandaili',
|
|
title: '发展代理',
|
|
remark: '让更多代理关注我',
|
|
remarkFS: 14,
|
|
}"
|
|
themeColor="green"
|
|
btnText="去添加"
|
|
@clickCard="goPage('/root/bind/search?active=1')"
|
|
/>
|
|
</view>
|
|
<view class="m-set g_bg_f g_radius_8" v-if="false" @click="showToggle">
|
|
<view class="item g_flex_row_start" hover-class="g_bg_e" @click="handleClickItem" :style="{ padding: '19px 12px' }">
|
|
<view class="g_flex_1 g_flex_row_start flex_center g_pl_10">
|
|
<view class="t-icon g_h_22 g_w_22 g_pl_7 g_mr_5 t-icon-wodetuandui" style="width: 20px; height: 20px; background-repeat: no-repeat"></view>
|
|
<view class="g_flex_column_center g_c_3 g_fs_16">切换团队</view>
|
|
<!-- <view class="g_flex_row_start flex_center g_fs_11 g_ml_4" style="padding: 2px 6px; background-color: #f2fcf7; color: #00b666; border-radius: 10px" hover-class="none" hover-stop-propagation="false" @click="showToggle">
|
|
切换
|
|
<view class="iconfont icon-qiehuantuandui g_ml_4 g_fsi_10"></view>
|
|
</view> -->
|
|
</view>
|
|
<i class="iconfont icon-gengduo11 g_c_c"></i>
|
|
<!-- <view class="g_flex_row_end g_fs_16"> {{ userinfo.agencyName }} </view> -->
|
|
</view>
|
|
</view>
|
|
<!-- <g-panel-form-item :list="[{ icon: 'icon-my_setup', label: '创建发单号', result: '', path: '/root/person/order', tip: 'createOrder', pRow: 12 }]" @clickItem="handleClickItem" /> -->
|
|
|
|
<view class="g_mt_10">
|
|
<g-panel-form-item :list="itemList" @clickItem="handleClickItem" />
|
|
</view>
|
|
|
|
<view class="g_mt_24">
|
|
<g-panel-form-item
|
|
:list="[
|
|
{
|
|
icon: 'icon-shezhi',
|
|
label: '设置',
|
|
result: '',
|
|
path: '/root/person/set',
|
|
tip: 'set',
|
|
pRow: 12,
|
|
},
|
|
]"
|
|
@clickItem="goPage('/root/person/set')"
|
|
/>
|
|
</view>
|
|
<view class="g_h_100"></view>
|
|
<u-popup v-model="showTeamToggle" class="" mode="bottom" uZindex="9999" :closeable="true" border-radius="12" :mask-close-able="true">
|
|
<view class="title g_text_c g_fs_18 g_fw_600 g_pt_32 g_pb_20">切换团队</view>
|
|
<scroll-view class="g_pb_32" scroll-y="true" hover-class="none" style="height: calc(70vh)">
|
|
<view class="weui-check__label g_flex_row_between g_p_16 g_border_e_b" hover-class="thover" v-for="item in teamList" @click="toogleTeam(item)">
|
|
<view class="weui-cell__bd">
|
|
<view class="g_fs_16">{{ item.agencyName || item.userName }}</view>
|
|
</view>
|
|
<view class style="color: #00b666" hover-class="none">{{ item.checked ? "当前" : "" }}</view>
|
|
</view>
|
|
</scroll-view>
|
|
<!-- <view class="g_flex_row_between g_pl_20 g_pr_20 g_pb_32 g_pt_12" style="box-shadow: 0px -3px 6px 0px rgba(153, 153, 153, 0.1)">
|
|
<g-button btnText="创建团队" @clickBtn="goHome" size="160"></g-button>
|
|
<g-button btnText="加入团队" type="primary" @clickBtn="goHome" size="160"></g-button>
|
|
</view> -->
|
|
</u-popup>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
onReady() {
|
|
this.G.setNavStyle();
|
|
},
|
|
// onShareAppMessage() {
|
|
// return {
|
|
// title: " ",
|
|
// imageUrl: "../../static/image/fdzsshare.png",
|
|
// };
|
|
// // return this.G.shareFun();
|
|
// },
|
|
watch: {
|
|
showTeamToggle(val) {
|
|
if (val) {
|
|
uni.hideTabBar();
|
|
} else {
|
|
uni.showTabBar();
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
scrollTop: 0,
|
|
defaultTop: 0,
|
|
pageSpeed: -1,
|
|
isLogin: null,
|
|
localBaseImg: this.G.store().localBaseImg,
|
|
cdnBaseImg: this.G.store().cdnBaseImg,
|
|
showDot: true, // 小红点是否显示
|
|
showTeamToggle: false,
|
|
teamList: [], // 团队列表
|
|
speed: -1,
|
|
mamageList: [
|
|
{
|
|
icon: "icon-zhiweiguanli",
|
|
name: "我的职位",
|
|
path: "/pages/bill/index",
|
|
},
|
|
{
|
|
icon: "icon-fazhandaili1",
|
|
name: "发展代理",
|
|
path: "/root/bind/search?active=1",
|
|
},
|
|
],
|
|
userinfo: {
|
|
all: {},
|
|
avatar: "",
|
|
name: "请登录",
|
|
tel: "-",
|
|
num: [
|
|
{
|
|
name: "",
|
|
num: "",
|
|
},
|
|
],
|
|
agencyName: "",
|
|
teamType: 0,
|
|
},
|
|
|
|
serverList: [
|
|
{
|
|
icon: "t-icon-dakaixiaoxitongzhi",
|
|
name: "消息通知",
|
|
tip: "message",
|
|
},
|
|
{
|
|
icon: "t-icon-shangjiahoutai",
|
|
name: "商家后台",
|
|
tip: "admin",
|
|
},
|
|
{
|
|
icon: "t-icon-fankuiyujianyi",
|
|
name: "反馈与建议",
|
|
tip: "feedback",
|
|
},
|
|
{
|
|
icon: "t-icon-shezhi4",
|
|
name: "设置",
|
|
tip: "set",
|
|
},
|
|
],
|
|
|
|
isHaveOrder: false,
|
|
isHaveInvite: false,
|
|
waitNum_ups: 0,
|
|
itemList: [],
|
|
isCreator: false,
|
|
};
|
|
},
|
|
onShow() {
|
|
let that = this;
|
|
that.isCreator = uni.getStorageSync("IS_CREATOR") == 1 ? true : false;
|
|
|
|
if (uni.getStorageSync("apply-token")) {
|
|
that.setUserInfo();
|
|
} else {
|
|
that.waitNum_ups = 0;
|
|
that.pageSpeed = 1;
|
|
that.isLogin = false;
|
|
that.userinfo.avatar = that.G.store().localBaseImg + "fadanzhushou.png";
|
|
that.userinfo.name = "请登录";
|
|
that.userinfo.tel = "-";
|
|
that.userinfo.agencyName = "";
|
|
that.userinfo.teamType = 0;
|
|
that.speed = 0;
|
|
}
|
|
},
|
|
onTabItemTap(e) {
|
|
let that = this;
|
|
if (uni.getStorageSync("apply-token")) {
|
|
that.getWaitNum();
|
|
}
|
|
},
|
|
methods: {
|
|
setUserInfo() {
|
|
let that = this;
|
|
let defaultList = [
|
|
// {
|
|
// icon: "icon-dakaixiaoxitongzhi",
|
|
// label: "打开消息通知",
|
|
// result: "",
|
|
// path: "/root/person/message",
|
|
// tip: "open-message",
|
|
// pRow: 12,
|
|
// },
|
|
{
|
|
icon: "icon-wodetuandui",
|
|
label: "团队管理",
|
|
result: "",
|
|
path: "/root/person/teamManage",
|
|
pRow: 12,
|
|
},
|
|
// {
|
|
// icon: "icon-shangjiahoutai",
|
|
// label: "进入商家后台",
|
|
// result: "",
|
|
// path: "/root/person/admin",
|
|
// tip: "go-admin",
|
|
// pRow: 12,
|
|
// },
|
|
{
|
|
icon: "icon-fankuiyujianyi",
|
|
label: "反馈与建议",
|
|
result: "",
|
|
path: "/root/person/feedback",
|
|
tip: "message",
|
|
pRow: 12,
|
|
},
|
|
];
|
|
if (uni.getStorageSync("apply-supplierAccount") == 1) {
|
|
// 有
|
|
that.isHaveOrder = true;
|
|
if (that.isCreator) {
|
|
that.itemList = defaultList;
|
|
} else {
|
|
that.itemList = [
|
|
{
|
|
icon: "icon-wodetuandui",
|
|
label: "切换团队",
|
|
result: "",
|
|
path: "qiehuan",
|
|
pRow: 12,
|
|
},
|
|
{
|
|
icon: "icon-fankuiyujianyi",
|
|
label: "反馈与建议",
|
|
result: "",
|
|
path: "/root/person/feedback",
|
|
tip: "message",
|
|
pRow: 12,
|
|
},
|
|
];
|
|
}
|
|
}
|
|
let userInfo = uni.getStorageSync("apply-userinfo");
|
|
that.isLogin = true;
|
|
|
|
that.userinfo.agencyName = userInfo.agencyName;
|
|
that.userinfo.user = userInfo.user;
|
|
|
|
that.userinfo.avatar = uni.getStorageSync("apply-avatar");
|
|
that.userinfo.name = userInfo.userName || userInfo.aliasName;
|
|
that.userinfo.tel = uni.getStorageSync("apply-tel");
|
|
|
|
if (that.userinfo.num[0].name == "-") {
|
|
that.userinfo.num = [
|
|
{
|
|
name: "-",
|
|
num: "-",
|
|
},
|
|
];
|
|
}
|
|
|
|
that.userinfo.agencyName = userInfo.agencyName;
|
|
that.userinfo.teamType = userInfo.teamType;
|
|
that.getWaitNum();
|
|
that.checkInvite();
|
|
that.getTeamList();
|
|
|
|
if (uni.getStorageSync("watch_invite")) {
|
|
if (uni.getStorageSync("watch_invite") == 1) {
|
|
that.showDot = false;
|
|
} else if (uni.getStorageSync("watch_invite") == 2) {
|
|
that.showDot = true;
|
|
}
|
|
}
|
|
},
|
|
checkInvite() {
|
|
let that = this;
|
|
that.G.Get(
|
|
that.api.user_getInviteList,
|
|
{
|
|
pageSize: 15,
|
|
pageNum: 1,
|
|
},
|
|
|
|
(res) => {
|
|
if (res.length > 0) {
|
|
that.isHaveInvite = true;
|
|
} else {
|
|
that.isHaveInvite = false;
|
|
}
|
|
}
|
|
);
|
|
},
|
|
getWaitNum() {
|
|
let that = this;
|
|
if (!that.isHaveOrder) {
|
|
that.getDetail();
|
|
return false;
|
|
}
|
|
that.G.Get(
|
|
that.api.bind_getWaitNum + "/" + 2,
|
|
{
|
|
type: 2,
|
|
},
|
|
(res) => {
|
|
if (res.total > 0) {
|
|
uni.setTabBarBadge({
|
|
index: 2,
|
|
text: String(res.total),
|
|
});
|
|
} else {
|
|
uni.removeTabBarBadge({
|
|
index: 2,
|
|
});
|
|
}
|
|
that.waitNum_ups = res.total;
|
|
that.getDetail();
|
|
}
|
|
);
|
|
},
|
|
getDetail() {
|
|
let that = this;
|
|
if (uni.getStorageSync("apply-agencyId")) {
|
|
that.pageSpeed = 0;
|
|
that.G.Get(
|
|
that.api.bind_enterpriseDetail + "/" + uni.getStorageSync("apply-agencyId"),
|
|
{
|
|
agencyId: uni.getStorageSync("apply-agencyId"),
|
|
type: 1,
|
|
},
|
|
(res) => {
|
|
console.log("item.", res);
|
|
that.pageSpeed = 1;
|
|
if (uni.getStorageSync("apply-supplierAccount") == 1) {
|
|
// 有
|
|
that.userinfo.num = [
|
|
{
|
|
name: "全部职位",
|
|
num: res.jobNum,
|
|
},
|
|
{
|
|
name: "在招职位",
|
|
num: res.recruitmentJobNum,
|
|
},
|
|
{
|
|
name: "关注",
|
|
num: res.upNum,
|
|
tip: that.isHaveInvite && that.showDot ? 1 : 0,
|
|
},
|
|
{
|
|
name: "粉丝",
|
|
num: res.downNum,
|
|
tip: that.isHaveOrder ? that.waitNum_ups : 0,
|
|
},
|
|
];
|
|
} else {
|
|
// 无
|
|
that.userinfo.num = [
|
|
{
|
|
name: "关注",
|
|
num: res.upNum,
|
|
tip: that.isHaveInvite && that.showDot ? 1 : 0,
|
|
},
|
|
];
|
|
}
|
|
}
|
|
);
|
|
}
|
|
},
|
|
goPage($path) {
|
|
this.G.isLogin();
|
|
if (this.G.isLogin()) {
|
|
uni.navigateTo({
|
|
url: $path,
|
|
});
|
|
}
|
|
},
|
|
handleClickNum(item, index) {
|
|
let that = this;
|
|
this.G.isLogin();
|
|
if (this.G.isLogin()) {
|
|
console.log("数据展示:", item.name);
|
|
switch (item.name) {
|
|
case "全部职位":
|
|
uni.navigateTo({
|
|
url: "/pages/bill/index",
|
|
});
|
|
break;
|
|
case "在招职位":
|
|
uni.navigateTo({
|
|
url: "/pages/bill/index?active=1",
|
|
});
|
|
break;
|
|
case "关注":
|
|
uni.navigateTo({
|
|
url: "/root/bind/order?active=0",
|
|
});
|
|
break;
|
|
case "粉丝":
|
|
if (that.waitNum_ups == 0) {
|
|
uni.navigateTo({
|
|
url: "/root/bind/fensi?active=1&tab=1",
|
|
});
|
|
} else {
|
|
uni.navigateTo({
|
|
url: "/root/bind/fensi?active=1&tab=0",
|
|
});
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
},
|
|
handleClickItem(e) {
|
|
this.G.isLogin();
|
|
if (this.G.isLogin()) {
|
|
console.log("e", e);
|
|
if (e.item.path == "qiehuan") {
|
|
console.log("切换团队");
|
|
this.showTeamToggle = true;
|
|
} else {
|
|
uni.navigateTo({
|
|
url: e.item.path,
|
|
});
|
|
}
|
|
}
|
|
},
|
|
/**
|
|
* 获取团队列表
|
|
*/
|
|
getTeamList() {
|
|
let that = this;
|
|
that.G.Get(that.api.user_getTeamList, {}, (res) => {
|
|
console.log("res", res);
|
|
res.forEach((item) => {
|
|
if (item.id == that.userinfo.user.agencyId) {
|
|
item.checked = true;
|
|
}
|
|
});
|
|
that.teamList = res;
|
|
});
|
|
},
|
|
checkToken(_item) {
|
|
let that = this;
|
|
uni.setStorageSync("apply-agencyId", _item.id);
|
|
that.G.checkTokenNew().then((res) => {
|
|
console.log(" checkToken res", res);
|
|
that.G.Get(that.api.login_agencyInfo, {}, (aRes) => {
|
|
console.log(" checkToken aRes", aRes);
|
|
uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员
|
|
that.showTeamToggle = false;
|
|
that.setUserInfo();
|
|
|
|
// that.$forceupdate()
|
|
// that.onShow();
|
|
});
|
|
});
|
|
},
|
|
/**
|
|
* 切换团队
|
|
*/
|
|
toogleTeam(item) {
|
|
let that = this;
|
|
console.log(item);
|
|
if (wx.getStorageSync("apply-agencyId") == item.id) {
|
|
return false;
|
|
}
|
|
wx.showLoading({
|
|
title: "切换中...",
|
|
});
|
|
that.G.Get(that.api.user_toggleTeam + `/${item.id}`, {}, (res) => {
|
|
console.log("res", res);
|
|
that.checkToken(item);
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title: "切换成功",
|
|
icon: "success",
|
|
duration: 2000,
|
|
});
|
|
});
|
|
},
|
|
showToggle() {
|
|
let that = this;
|
|
that.showTeamToggle = true;
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.p-person-inedx {
|
|
min-height: 100%;
|
|
background-color: #f5f5f5;
|
|
|
|
.m-info {
|
|
width: calc(100% - 40rpx);
|
|
margin: 0 auto;
|
|
margin-bottom: 20rpx;
|
|
|
|
.data-box {
|
|
.item {
|
|
width: 33.3333%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.m-state {
|
|
width: calc(100% - 40rpx);
|
|
margin: 0 auto;
|
|
margin-bottom: 48rpx;
|
|
}
|
|
|
|
.m-set {
|
|
width: calc(100% - 40rpx);
|
|
margin: 0 auto;
|
|
}
|
|
}
|
|
</style>
|