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.
apply-assistant-v3/pages/person/index.vue

826 lines
20 KiB
Vue

<template>
<view class="p-person-inedx g_w_all g_bg_f_5 g_kuaishou">
<view :class="isLogin ? 'g_h_36' : 'g_h_10'"></view>
<view class="m-info g_p_16 g_bg_f g_m_10 g_radius_8 g_position_rela" v-if="isLogin" hover-class="none" style="margin-top: 0">
<view class="g_flex_row_start">
<view class="g_w_71">
<view class="g_position_abso g_p_4 g_radius_13 g_bg_f" style="top: -20px">
<g-panel-image :radius="13" :size="134" :url="userInfo.avatar" />
</view>
</view>
<view class="g_flex_1 g_ml_11">
<view class="g_flex_row_between flex_center">
<view class="g_flex_row_start flex_center" style="line-height: 22px">
<view class="g_flex_none g_ell_1 g_fs_20 g_fw_bold g_c_3" style="max-width: 240rpx">
{{ userInfo.name ? userInfo.name : "-" }}
</view>
</view>
<view class="g_flex_row_start flex_center g_fs_14 g_border_d g_radius_4 g_c_8 g_p_4" hover-class="thover" @click="goPage('/root/person/info?active=0')">
<i class="iconfont icon-edit g_fs_12 g_mr_4"></i>
编辑资料
</view>
</view>
</view>
</view>
<view class="g_flex_row_start flex_center g_mt_26 g_fs_16 g_c_8" hover-class="thover" @click="goPage('/root/person/info?active=1')">
<view class="">
{{ agencyInfo.agencyName || agencyInfo.fullName || "-" }}
</view>
<i class="iconfont icon-gengduo11" style="line-height: 22px; font-size: 10px"></i>
</view>
</view>
<view v-else @click="goPage" class="g_text_c g_pt_24 g_pb_24 g_c_f g_radius_8 g_bg_main g_ml_10 g_mr_10">
<view class="g_mb_12">
<image class="g_w_64 g_h_64 g_radius_50" src="https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/defaultAva.svg" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""> </image>
</view>
<view class="g_fs_18 g_fw_600 g_mb_4"> 登录/注册 </view>
<view class="g_fs_14"> 劳务上下游收发单工具 </view>
</view>
<view class="g_mt_10" v-if="agencyInfo.supplierAccount == 1">
<view class="g_p_16 g_bg_f g_radius_8 g_flex_row_between flex_center g_ml_10 g_mr_10" hover-class="thover" @click="goPage('/root/bind/search?active=1')">
<view class="g_flex_row_start flex_center">
<img src="https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/fazhandaili0610.svg" class="g_w_48 g_h_48 g_radius_50" alt="" />
<view class="g_flex_column_between g_ml_10">
<view class="g_fs_16 g_c_0 g_fw_600 g_mb_6">发展代理</view>
<view class="g_c_9">邀请更多代理(粉丝)关注我</view>
</view>
</view>
<view class="g_c_main g_bg_e7 g_radius_20" hover-class="thover" style="padding: 4px 12px">去邀请</view>
</view>
</view>
<view class="g_mt_10">
<!-- v-if="userInfo.admin" -->
<view class="g_mt_10 g_position_rela" v-if="userInfo.agencyId">
<div class="g_w_8 g_h_8 g_radius_50 g_bg_f0a g_position_abso" style="right: 18px; top: 10px" v-if="!readed"></div>
<g-panel-form-item
:list="[
{
icon: 'icon-fadanhao-31',
label: '关注的发单号',
result: userNum.upNum,
path: '/root/person/teamManage',
pRow: 12,
itype: 'icon',
},
]"
@clickItem="goPage('/root/bind/order?active=0')"
/>
</view>
<view class="g_mt_10" v-if="userInfo.agencyId">
<g-panel-card-num :list="billDataList" titleNav="/root/person/applyIndex" :border="true" :speed="1" :marginBottom="16" cusType="num" :height="26" :num="5" cusTitle="报名工单(我报的)" @clickItem="goOrder" />
<!-- <g-panel-card-num :list="todayDataList"
titleNav="/root/person/todayData"
:border="true"
:speed="1"
:marginBottom="16"
cusType="num"
:height="26"
:num="5"
cusTitle="今日数据 (我报的)"
@clickItem="handleClickNus"
/> -->
</view>
<view class="g_mt_10" v-if="userInfo.admin">
<g-panel-form-item
:list="[
{
icon: 'icon-tuandui1',
label: '团队管理',
result: agencyInfo.fullName || agencyInfo.agencyName || '设置企业信息',
path: '/root/person/teamManage',
pRow: 12,
itype: 'icon',
},
]"
@clickItem="handleClickItem"
/>
</view>
</view>
<view class="g_mt_10">
<g-panel-form-item
:list="[
{
icon: 'icon-setting',
label: '设置',
result: '',
path: '/root/person/set',
tip: 'set',
pRow: 12,
itype: 'icon',
},
]"
@clickItem="goPage('/root/person/set')"
/>
</view>
<!-- <div class="g_mt_40" v-if="userInfo.admin">
<g-button btnText="添加成员" icon="icon-tianjia g_fsi_16 g_mr_8" @clickBtn="addMemberShow = true"></g-button>
</div> -->
<view class="g_h_100"></view>
<u-popup v-model="addMemberShow" mode="bottom" z-index="999999" border-radius="12" :closeable="false" :mask-close-able="true" @close="addMemberShow = false">
<view class="g_text_c g_bg_f_5 g_fs_17">
<view class="g_bg_f">
<view class="g_c_3">
<view class="g_p_16 g_border_e_t" @click="goPage('/root/person/addOrUpdataMember')"> 手动填写信息 </view>
<view class="g_p_16 g_border_e_t" @click="goPage('/root/person/memberApplyQRCode')"> 微信分享邀请 </view>
</view>
</view>
<view class="g_p_16 g_mt_10 g_bg_f" style="padding-bottom: calc(constant(safe-area-inset-bottom) + 16px); padding-bottom: calc(env(safe-area-inset-bottom) + 16px)" @click="addMemberShow = false"> 取消 </view>
</view>
</u-popup>
<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>
</u-popup>
</view>
</template>
<script>
export default {
onReady() {
this.G.setNavStyle();
},
watch: {
showTeamToggle(val) {
if (val) {
uni.hideTabBar();
} else {
uni.showTabBar();
}
},
addMemberShow(val) {
if (val) {
uni.hideTabBar();
} else {
uni.showTabBar();
}
},
},
data() {
return {
agencyInfo: {},
addMemberShow: false,
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: "/root/person/billIndex",
},
{
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,
showService: false,
readed: true,
isLogin: false,
authInfo: { realNameAuth: 0 }, // 认证信息
userNum: {},
map: { num10: "0", num20: "0", num25: "0", num30: "0", num40: "0", num999: "0", user999: "0", user40: "0", user48: "0", user50: "0", agencyData: {} },
orderDataList: [
{
name: "在招",
num: "-",
path: "/root/merchantManagement/orderManagement?recruitment=1",
},
{
name: "总职位",
num: "-",
path: "/root/merchantManagement/orderManagement",
},
{
name: "互关",
num: "-",
path: "",
},
{
name: "关注",
num: "-",
path: "",
},
{
name: "粉丝",
num: "-",
path: "",
},
],
todayDataList: [
{
name: "报名",
num: "-",
path: "/root/person/todayData",
},
{
name: "到面",
num: "-",
path: "/root/person/todayData",
},
{
name: "通过",
num: "-",
path: "/root/person/todayData",
},
{
name: "入职",
num: "-",
path: "/root/person/todayData",
},
{
name: "在职",
num: "-",
path: "/root/person/todayData",
},
],
billDataList: [
{
name: "审核中",
num: 0,
type: 1,
path: "/root/person/applyIndex?status=1",
},
{
name: "待接待",
num: 0,
type: 2,
path: "/root/person/applyIndex?status=2",
},
{
name: "待面试",
num: 0,
type: 3,
path: "/root/person/applyIndex?status=3",
},
{
name: "待入职",
num: 0,
type: 4,
path: "/root/person/applyIndex?status=4",
},
{
name: "在职中",
num: 0,
type: 5,
path: "/root/person/applyIndex?status=5",
},
],
};
},
onShow() {
let that = this;
if (uni.getStorageSync("apply-token")) {
that.isLogin = true;
this.G.checkToken().then(() => {
that.setUserInfo();
this.getAuthInfo();
this.getData();
this.getNum();
that.isCreator = uni.getStorageSync("IS_CREATOR") == 1 ? true : false;
that.agencyInfo = uni.getStorageSync("agencyInfo");
if (uni.getStorageSync("apply-userinfo").agencyStatus == 1) {
this.getCompanyInfo();
}
});
// that.userInfo = uni.getStorageSync("apply-userinfo");
} 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: "/root/person/teamManage",
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 = { ...userInfo };
console.log(that.userInfo, "that.userInfo");
that.userInfo.avatar = that.userInfo.user.imgSrc;
that.userInfo.name = userInfo.userName || userInfo.aliasName;
that.userInfo.tel = that.userInfo.user.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) => {
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,
});
this.addMemberShow = false;
}
},
handleClickNum(item, index) {
let that = this;
this.G.isLogin();
if (this.G.isLogin()) {
console.log("数据展示:", item.name);
switch (item.name) {
case "全部职位":
uni.navigateTo({
url: "/root/person/billIndex",
});
break;
case "在招职位":
uni.navigateTo({
url: "/root/person/billIndex?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;
},
getAuthInfo() {
let that = this;
console.log("this.agencyInfo.id", this.agencyInfo);
this.G.Get(this.api.get_supplier_info, { agencyId: this.agencyInfo.id || "" }, (res) => {
console.log("resresresresresres", res);
that.authInfo = res;
});
},
getData() {
let that = this;
this.G.Get(
this.api.user_dataValue + "?classify=1",
{
classify: 1,
},
(res) => {
console.log("res", res);
if (res) {
that.map = res;
let resdata = res.classify1num;
that.todayDataList = [
{
name: "报名",
num: resdata.signUps || 0,
path: "/root/person/todayData",
},
{
name: "到面",
num: resdata.arrived || 0,
path: "/root/person/todayData",
},
{
name: "通过",
num: resdata.passed || 0,
path: "/root/person/todayData",
},
{
name: "入职",
num: resdata.entry || 0,
path: "/root/person/todayData",
},
{
name: "在职",
num: resdata.obJob || 0,
path: "/root/person/todayData",
},
];
that.billDataList = [
{
name: "审核中",
num: that.map.classify1num.num10 || 0,
type: 1,
path: "/root/person/applyIndex?status=1",
},
{
name: "待接待",
num: that.map.classify1num.num20 || 0,
type: 2,
path: "/root/person/applyIndex?status=2",
},
{
name: "待面试",
num: that.map.classify1num.num25 || 0,
type: 3,
path: "/root/person/applyIndex?status=3",
},
{
name: "待入职",
num: that.map.classify1num.num30 || 0,
type: 4,
path: "/root/person/applyIndex?status=4",
},
{
name: "在职中",
num: that.map.classify1num.num40 || 0,
type: 5,
path: "/root/person/applyIndex?status=5",
},
];
}
}
);
},
getCompanyInfo() {
let that = this;
that.G.Get(
that.api.bind_enterpriseDetail + "/" + uni.getStorageSync("apply-agencyId"),
{
agencyId: uni.getStorageSync("apply-agencyId"),
type: 1,
},
(res) => {
console.log("item.", res);
that.userNum = res;
}
);
},
getNum() {
let that = this;
that.G.Get(that.api.bind_getApplyNum, {}, (res) => {
console.log("获取待处理数量:", res);
if (res.approvePassHasNotRed > 0) {
uni.setTabBarBadge({
index: 2,
text: String(res.approvePassHasNotRed),
});
that.readed = false;
} else {
try {
uni.removeTabBarBadge({
index: 2,
});
} catch (error) {
console.log("当前页面不是 TabBar 页面,无法移除 badge");
}
that.readed = true;
}
});
},
goOrder(e) {
console.log("e", e);
uni.setStorageSync("applyType", e.item.type ? e.item.type : 0);
uni.switchTab({
url: "/pages/workBench/index",
success: (res) => {},
fail: (res) => {},
complete: (res) => {},
});
},
handleClickNus() {
uni.navigateTo({
url: "/root/person/todayData",
});
},
},
};
</script>
<style lang="scss">
.p-person-inedx {
min-height: 100%;
background-color: #ededed;
.m-info {
width: calc(100% - 52px);
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>