123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813 |
- <template>
- <div>
- <div style="width: 100%; height: 190px; background: #fff">
- <div style="float: left; width: 20%; height: 100%; position: relative">
- <div
- style="
- width: 130px;
- height: 130px;
- position: absolute;
- left: 50%;
- top: 45%;
- transform: translate(-50%, -50%);
- border-radius: 65px;
- overflow: hidden;
- "
- >
- <img
- v-if="!showDefaultImg"
- :src="'api/file/pub/' + this.userPic"
- alt=""
- style="width: 100%; height: 130px"
- @error="showDefault()"
- />
- <img
- v-if="showDefaultImg"
- :src="require('@/assets/img/userCenter/user.png')"
- alt=""
- style="width: 100%; height: 130px"
- />
- </div>
- </div>
- <div style="float: left; width: 50%; height: 100%">
- <div
- style="width: 96.5%; margin-left: 10px; margin-top: 20px; height: 80%"
- >
- <div>
- <span style="font-size: 20px; color: #2c5589; font-weight: 700">{{
- realName
- }}</span>
- <span v-if="userInfor.userType" class="tagFA6400">{{
- userTypeDicts[this.userInfor.userType]
- }}</span>
- <span v-if="userInfor.tag1" class="tag6DD400">{{
- realStatusDicts[this.realStatus]
- }}</span>
- <span v-if="userInfor.tag1" class="tag00D4C3">{{
- userMobileStatusDicts[this.mobileStatus]
- }}</span>
- <span v-if="userInfor.tag1" class="tag00B9FF">{{
- userEmailStatusDicts[this.emailStatus]
- }}</span>
- </div>
- <div style="margin-top: 10px; font-size: 14px; color: #999">
- <div
- style="margin-top: 10px; font-size: 14px; color: #999"
- v-if="userInfor.unitName"
- >
- <span>
- <i class="el-icon-office-building" aria-hidden="true"></i>
- {{ userInfor.unitName }}
- </span>
- </div>
- <span style="margin-right: 25px">
- <i class="el-icon-message" aria-hidden="true"></i>
- {{ userInfor.Email }}
- </span>
- <div style="margin-top: 10px; font-size: 14px; color: #999">
- <span>
- <i class="el-icon-mobile-phone" aria-hidden="true"></i>
- {{ userInfor.tel }}
- </span>
- </div>
- </div>
- </div>
- </div>
- <div
- style="
- float: left;
- width: 19.8%;
- height: 100%;
- border-left: 1px solid #ebebeb;
- "
- >
- <div
- style="width: 96.4%; margin-left: 10px; margin-top: 20px; height: 80%"
- >
- <div>
- <span style="font-size: 18px; color: #2c5589; font-weight: 700">{{
- $t("common.MessageRemind")
- }}</span>
- <i
- class="fa fa-volume-up"
- aria-hidden="true"
- style="color: #2c5589; margin-left: 20px; font-size: 18px"
- ></i>
- </div>
- <div style="margin-top: 10px; font-size: 14px; color: #999">
- <span
- style="display: block; line-height: 30px"
- @click="toView('SystemMessage', '/SystemMessage')"
- class="cursor"
- >
- {{ $t("common.SystemRemind") }}:<span class="num1">{{
- SystemRemindNum
- }}</span>
- </span>
- <span
- style="display: block; line-height: 30px"
- @click="toView('notification', '/notification')"
- class="cursor"
- >
- {{ $t("common.Announcements") }}:<span class="num1">{{
- AnnouncementsNum
- }}</span>
- </span>
- <span
- style="display: block; line-height: 30px"
- @click="toView('myConsultingService', '/myConsultingService')"
- class="cursor"
- >
- {{ $t("common.MyAdvice") }}:<span class="num2">{{
- MyAdviceNum
- }}</span>
- </span>
- <span
- style="display: block; line-height: 30px"
- @click="toView('communication', '/communication')"
- class="cursor"
- >
- {{ $t("common.interactiveMessage") }}:<span class="num2">{{
- interactiveMessageNum
- }}</span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <div style="width: 100%; height: 100px; background: #fff; margin-top: 15px">
- <div class="title">
- <span>
- <i
- class="el-icon-menu"
- aria-hidden="true"
- style="margin-right: 10px"
- ></i
- >{{ $t("common.FunctionRecommended") }}</span
- >
- </div>
- <div
- style="
- width: 100%;
- height: 50px;
- line-height: 50px;
- font-size: 15px;
- color: #666;
- "
- >
- <span
- style="padding: 3px 30px; border-right: 1px solid #2c5589"
- class="cursor"
- @click="toViewDevelopmentCooperation()"
- >
- <i
- class="el-icon-message"
- aria-hidden="true"
- style="margin-right: 5px; color: #2c5589"
- ></i
- >{{ $t("common.CooperationForum") }}</span
- >
- <span
- style="padding: 3px 30px; border-right: 1px solid #2c5589"
- class="cursor"
- @click="toOnlineMeeting()"
- >
- <i
- class="el-icon-microphone"
- aria-hidden="true"
- style="margin-right: 5px; color: #2c5589"
- ></i
- >{{ $t("common.OnlineMeeting") }}</span
- >
- </div>
- </div>
- <!--我的项目-->
- <div style="width: 100%; background: #fff; margin-top: 15px">
- <div class="title">
- <span>
- <i
- class="el-icon-office-building"
- aria-hidden="true"
- style="margin-right: 10px"
- ></i
- >{{ $t("common.UserMyProject") }}</span
- >
- <span
- style="float: right; font-size: 14px; color: #666; margin-top: 12px"
- class="cursor"
- @click="toMyProject()"
- >{{ $t("common.More") }}
- <i
- class="el-icon-arrow-right"
- aria-hidden="true"
- style="margin-right: 10px"
- ></i
- ></span>
- </div>
- <div style="width: 100%; height: 160px">
- <div class="recommend">
- <ul>
- <li
- v-for="(item, index) in myProject"
- v-if="index < 4"
- :key="index + 2"
- style="margin-left: 20px"
- >
- <img
- @click="
- toViewProject('projectPresentationDetails', item, index)
- "
- :src="'api/file/pub/' + item.bannerImg"
- alt
- style="width: 100%; height: 115px; cursor: pointer"
- />
- <div
- style="
- color: #bcbcbc;
- font-size: 14px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- "
- >
- {{ item.followName }}
- </div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div style="width: 100%; background: #fff; margin-top: 15px">
- <div class="title">
- <span>
- <i
- class="el-icon-wind-power"
- aria-hidden="true"
- style="margin-right: 10px"
- ></i
- >{{ $t("common.UserMyActivities") }}</span
- >
- <span
- style="float: right; font-size: 14px; color: #666; margin-top: 12px"
- class="cursor"
- @click="toMyProject()"
- >{{ $t("common.More") }}
- <i
- class="el-icon-arrow-right"
- aria-hidden="true"
- style="margin-right: 10px"
- ></i
- ></span>
- </div>
- <div style="width: 100%; height: 160px">
- <div class="recommend">
- <ul>
- <li
- v-for="(item, index) in myActivity"
- v-if="index < 4"
- :key="index + 2"
- style="margin-left: 20px"
- >
- <img
- @click="
- toViewActivity('cooperationExchangeListDetails', item, index)
- "
- :src="'api/file/pub/' + item.bannerImg"
- alt
- style="width: 100%; height: 115px; cursor: pointer"
- />
- <div
- style="
- color: #bcbcbc;
- font-size: 14px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- "
- >
- {{ item.followName }}
- </div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { selectPushMsgNum, selectNoticeInfoNum } from "@/api/userCenter";
- import { getDicts } from "@/api/dict";
- import { getPortalMyFollowMode } from "@/api/userCenter/myFollow";
- import { saveFollowModelLanguage } from "@/api/operation/basePortalModelFollowInfo";
- import { dropUmsUser } from "@/api/userCenter/ums";
- import { getToken } from "@/utils/auth";
- import {
- getUserInfoStatus,
- getUserInfoStatusByLanuage,
- } from "@/api/userCenter";
- import Base from "@/views/base/Base";
- export default {
- name: "userCenterView",
- extends: Base,
- data() {
- return {
- showDefaultImg: false,
- //系统提示
- SystemRemindNum: 0,
- //通知公告
- AnnouncementsNum: 0,
- //我的咨询
- MyAdviceNum: 0,
- //互动留言
- interactiveMessageNum: 0,
- projectNum: [],
- projectParams: {
- pageNo: 1,
- pageSize: 10,
- technicalCategories: "",
- technicalScope: "",
- phaseType: "",
- createBy: "",
- projectName: "",
- publishingChannels: "1",
- approveStatus: "",
- language: "",
- },
- userInfor: {
- userName: "",
- tag1: "1",
- tag2: "1",
- tag3: "1",
- enterpriseName: "common.threeGorgesCorporation",
- Email: "",
- tel: "",
- userType: "",
- userTypeDict: "",
- unitName: "",
- },
- userPic: "/def/user.png",
- mobileStatus: "",
- emailStatus: "",
- realStatus: "",
- userTypeDicts: {
- 2: this.$t("common.UserUsertyp1"),
- 5: this.$t("common.UserUsertyp2"),
- 4: this.$t("common.UserUsertyp3"),
- },
- userMobileStatusDicts: {
- 0: this.$t("common.PhoneNumberVerified"),
- 1: this.$t("common.PhoneNumberNotVerified"),
- },
- userEmailStatusDicts: {
- 0: this.$t("common.EmailVerified"),
- 1: this.$t("common.EmailNotVerified"),
- },
- realStatusDicts: {
- true: this.$t("common.RealNameVerification"),
- false: this.$t("common.RealNameNotVerification"),
- },
- myProject: [],
- myActivity: [],
- recommend: [],
- user: {
- umsUser: {},
- },
- };
- },
- watch: {
- "$i18n.locale"() {
- this.userMobileStatusDicts = {
- 0: this.$t("common.PhoneNumberVerified"),
- 1: this.$t("common.PhoneNumberNotVerified"),
- };
- this.userEmailStatusDicts = {
- 0: this.$t("common.EmailVerified"),
- 1: this.$t("common.EmailNotVerified"),
- };
- this.realStatusDicts = {
- true: this.$t("common.RealNameVerification"),
- false: this.$t("common.RealNameNotVerification"),
- };
- this.userTypeDicts = {
- 2: this.$t("common.UserUsertyp1"),
- 5: this.$t("common.UserUsertyp2"),
- 4: this.$t("common.UserUsertyp3"),
- };
- this.initData();
- },
- },
- mounted() {
- this.initData();
- },
- computed: {
- // 判断有无真名
- realName() {
- if (this.user.umsUser.userNickName) {
- return this.user.umsUser.userNickName;
- } else {
- return this.user.username;
- }
- },
- },
- methods: {
- exinfo() {
- let token = "" + getToken();
- this.resetToken();
- // 接口逻辑
- dropUmsUser(token)
- .then((result) => {
- // console.log(result);
- this.$message({
- message: result.data,
- type: "success",
- });
- this.getList();
- })
- .catch((error) => {
- // 此处你的业务代码
- });
- },
- //获取系统消息数量
- getMessageNum() {
- if (this.i != 1) {
- let readStatus = "unread";
- selectPushMsgNum(readStatus).then((res) => {
- if (res.data.page.totalCount > 0) {
- this.SystemRemindNum = res.data.page.totalCount;
- } else {
- this.SystemRemindNum = 0;
- }
- });
- }
- },
- //获取通知公告数量
- getNoticeNum() {
- if (this.i != 1) {
- let readStatus = "unread";
- selectNoticeInfoNum(readStatus).then((res) => {
- if (res.data.page.totalCount > 0) {
- this.AnnouncementsNum = res.data.page.totalCount;
- } else {
- this.AnnouncementsNum = 0;
- }
- });
- }
- },
- toView(router, json, index) {
- window.localStorage.setItem("router", router);
- this.$store.commit("modify", router);
- const { href } = this.$router.resolve({
- name: router,
- query: {
- key: json,
- dataIndex: index,
- },
- });
- window.open(href, "_blank");
- },
- //项目跳转
- toViewProject(router, json, index) {
- if ("已删除" == json.followName || "Deleted" == json.followName) {
- this.saveFollowModelDo("unfollow", json.id, "project");
- return;
- }
- window.localStorage.setItem("router", router);
- this.$store.commit("modify", router);
- const { href } = this.$router.resolve({
- name: router,
- query: {
- key: json.id,
- dataIndex: index,
- },
- });
- window.open(href, "_blank");
- },
- //活动跳转
- toViewActivity(router, json) {
- if ("已删除" == json.followName || "Deleted" == json.followName) {
- this.saveFollowModelDo("unfollow", json.id, "activity");
- return;
- }
- this.$store.commit("modify", router);
- window.localStorage.setItem("router", router);
- const { href } = this.$router.resolve({
- name: router,
- query: {
- key: json.id,
- },
- });
- window.open(href, "_blank");
- },
- //跳转到发展合作留言
- toViewDevelopmentCooperation() {
- var router = "developmentCooperation";
- this.toView(router);
- },
- //跳转到在线会议
- toOnlineMeeting() {
- var router = "onlineMeeting";
- this.toView(router);
- },
- //跳到我的项目
- toMyProject() {
- this.toView("myFollow");
- },
- //查看项目
- findProject(item, index) {
- this.toView("projectPresentationDetails", item.id, index);
- },
- //查看留言
- findLeavMesage(item) {
- alert("查看留言");
- },
- initData() {
- let language = this.$i18n.locale.toUpperCase();
- this.user = JSON.parse(window.localStorage.getItem("user"));
- //获取用户信息
- getUserInfoStatusByLanuage(language).then((result) => {
- var data = result.data;
- console.log(data);
- this.userInfor.userName = data.name;
- this.userInfor.Email = data.email;
- if (!this.userInfor.Email) {
- this.userInfor.Email = this.$t("common.noHave");
- }
- this.userInfor.tel = data.newMobile;
- if (!this.userInfor.tel) {
- this.userInfor.tel = this.$t("common.noHave");
- }
- this.mobileStatus = this.user.umsUser.userMobileStatus;
- this.emailStatus = data.userEmailStatus;
- this.realStatus = data.realStatus;
- this.userInfor.userType = data.userType;
- this.userInfor.userTypeDict = data.userTypeDict;
- this.userInfor.unitName = data.unitName;
- if (!data.userPic) {
- this.userPic = "/def/user.png";
- } else {
- this.userPic = data.userPic;
- }
- });
- //获取对应的项目数据
- this.projectParams.language = this.$i18n.locale.toUpperCase();
- let token = getToken();
- let list = {
- modelType: "project",
- language: this.$i18n.locale.toUpperCase(),
- pageNo: 1,
- pageSize: 4,
- };
- getPortalMyFollowMode(list, token).then((res) => {
- this.myProject = res.data ? res.data.models : [];
- if (this.myProject && this.myProject.length > 0) {
- this.myProject.forEach((element) => {
- if (
- element.bannerImg &&
- element.bannerImg instanceof Array &&
- element.bannerImg[0] != ""
- ) {
- var bannerImgs = element.bannerImg;
- element.bannerImg = bannerImgs[0];
- } else if (
- element.bannerImg &&
- element.bannerImg.constructor == String &&
- element.bannerImg != ""
- ) {
- var bannerImgs = element.bannerImg.split(",");
- element.bannerImg = bannerImgs[0];
- } else {
- element.bannerImg = "def/projectdefault.png";
- }
- });
- }
- });
- token = getToken();
- list = {
- modelType: "activity",
- language: this.$i18n.locale.toUpperCase(),
- pageNo: 1,
- pageSize: 4,
- };
- getPortalMyFollowMode(list, token).then((res) => {
- this.myActivity = res.data ? res.data.models : [];
- if (this.myActivity && this.myActivity.length > 0) {
- this.myActivity.forEach((element) => {
- if (element.bannerImg && element.bannerImg != "") {
- var bannerImgs = element.bannerImg.split(",");
- element.bannerImg = bannerImgs[0];
- }
- });
- }
- });
- //获取系统消息数量
- this.getMessageNum();
- this.getNoticeNum();
- },
- getIconUrl(url) {
- return require("@/assets/img/userCenter/" + url);
- },
- getPorjectUrl(url) {
- if (null == url) {
- url = "api/file/pub//def/projectdefault.png";
- }
- return url;
- },
- saveFollowModelDo: function (followType, projectId, modelType) {
- let user = window.localStorage.getItem("user");
- var users = JSON.parse(user);
- if (!user) {
- this.$message.warning("请先登录");
- } else {
- let token = "" + getToken();
- this.resetToken();
- // 接口逻辑
- this.submitHandler((token) => {
- saveFollowModelLanguage(
- this.$i18n.locale.toUpperCase(),
- projectId,
- modelType,
- users.userId,
- followType,
- token
- )
- .then((result) => {
- // console.log(result);
- this.$message({
- message: result.data,
- type: "success",
- });
- this.getList();
- })
- .catch((error) => {
- // 此处你的业务代码
- });
- });
- }
- },
- showDefault() {
- this.showDefaultImg = true;
- },
- },
- };
- </script>
- <style scoped>
- .tagFA6400,
- .tag6DD400,
- .tag00D4C3,
- .tag00B9FF {
- display: inline-block;
- padding: 3px 10px;
- border-radius: 12px;
- color: #fff;
- font-size: 12px;
- margin-left: 15px;
- }
- .tagFA6400 {
- background: #fa6400;
- }
- .tag6DD400 {
- background: #6dd400;
- }
- .tag00D4C3 {
- background: #00d4c3;
- }
- .tag00B9FF {
- background: #00b9ff;
- }
- .num1 {
- color: #328cfc;
- font-weight: 700;
- }
- .num2 {
- font-weight: 700;
- color: #d8361d;
- }
- .title {
- height: 50px;
- margin-left: 30px;
- margin-right: 30px;
- border-bottom: 1px solid #ebebeb;
- line-height: 50px;
- font-size: 17px;
- color: #2c5589;
- font-weight: 700;
- }
- .init {
- /* padding:0 30px; */
- height: 450px;
- padding-bottom: 30px;
- width: 100%;
- }
- .init ul {
- text-align: top;
- height: 100%;
- display: flex;
- display: -webkit-flex; /* Safari */
- justify-content: space-between;
- flex-wrap: wrap;
- }
- .init li {
- width: 430px;
- height: 130px;
- text-align: top;
- margin-bottom: 10px;
- }
- .initLiItem {
- float: left;
- height: 100%;
- width: 230px;
- position: relative;
- display: flex;
- flex-direction: column;
- }
- .initLiItemFirst {
- text-align: center;
- margin-top: 40px;
- font-size: 18px;
- color: #666;
- font-weight: 600;
- }
- /* .initLiItem div, */
- .initLiItem span:hover {
- color: #2c5589;
- }
- #myActivity li {
- float: left;
- width: 300px;
- height: 200px;
- margin-right: -80px;
- background: skyblue;
- }
- #myActivity ul {
- text-align: top;
- margin-top: 20px;
- height: 200px;
- display: flex;
- display: -webkit-flex; /* Safari */
- justify-content: space-between;
- flex-wrap: nowrap;
- }
- .swiper-container {
- width: 100%;
- height: 200px;
- }
- .swiper-slide {
- text-align: center;
- font-size: 18px;
- background: #fff;
- /* Center slide text vertically */
- display: -webkit-box;
- display: -ms-flexbox;
- display: -webkit-flex;
- display: flex;
- -webkit-box-pack: center;
- -ms-flex-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- -webkit-box-align: center;
- -ms-flex-align: center;
- -webkit-align-items: center;
- align-items: center;
- }
- .swiper-slide {
- margin-right: 10px !important;
- }
- .recommend {
- margin-top: 16px;
- /* margin-left: 30px; */
- }
- .recommend li {
- display: inline-block;
- width: 170px;
- /* height: 130px; */
- text-align: center;
- margin-right: 16px;
- }
- .cursor:hover {
- color: red;
- }
- </style>
|