|
@@ -1,445 +0,0 @@
|
|
|
-<template>
|
|
|
- <view class="container my-container" v-if="haveData">
|
|
|
- <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
|
|
|
- <view class="content">
|
|
|
- <view class="text">我的</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="my-background">
|
|
|
- <view class="my-notice" v-if="myNotice">
|
|
|
- 添加到我的小程序,做您手边的弘则研究素材库
|
|
|
- <van-icon @click="myNotice = false" class="my-icon" name="cross" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="my-info">
|
|
|
- <view class="my-top-info">
|
|
|
- <view class="info">
|
|
|
- <view class="info-img">
|
|
|
- <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
|
|
- <image class="avatar" v-if="headimgurl" :src="headimgurl"></image>
|
|
|
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/logo.png" class="avatar" v-else></image>
|
|
|
- </button>
|
|
|
- </view>
|
|
|
- <view class="info-list">
|
|
|
- <block v-if="isLogin">
|
|
|
- <text class="name">{{ userInfo.RealName || "--" }}</text>
|
|
|
- <text class="mobile">{{ userInfo.Mobile || userInfo.Email }}</text>
|
|
|
- <text class="company-name">{{ userInfo.CompanyName || "--" }}</text>
|
|
|
- </block>
|
|
|
- <block v-else>
|
|
|
- <text class="name">Hi,请绑定联系方式~</text>
|
|
|
- <text class="bind-btn" @click="loginHandle">绑定联系方式</text>
|
|
|
- </block>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="auth-info">
|
|
|
- <template v-if="isLogin">
|
|
|
- <scroll-view scroll-x="true" scroll-with-animation class="auth-ul" v-if="userInfo.HasPermission === 0">
|
|
|
- <text class="auth-li" v-for="item in authList" :key="item">{{ item }}</text>
|
|
|
- </scroll-view>
|
|
|
- <block v-else>
|
|
|
- <button class="auth-btn" @click="applyAuth" v-if="userInfo.HasPermission != 3">申请开通权限</button>
|
|
|
- </block>
|
|
|
- </template>
|
|
|
- <text v-else class="no-auth">暂无品种权限信息</text>
|
|
|
- </view>
|
|
|
- <view class="info-item">
|
|
|
- <view class="item" @click="itemClickHandle('mySchedulepage')">
|
|
|
- <text class="item-number">{{ userInfo.ScheduleNum }}</text>
|
|
|
- <text class="item-text">活动日程</text>
|
|
|
- </view>
|
|
|
- <view class="item item-label" @click="itemClickHandle('myCollection')">
|
|
|
- <text class="item-number">{{ userInfo.ConNum }}</text>
|
|
|
- <text class="item-text">收藏</text>
|
|
|
- </view>
|
|
|
- <view class="item" @click="itemClickHandle('browseHistory')">
|
|
|
- <text class="item-number">{{ userInfo.HistoryNum }}</text>
|
|
|
- <text class="item-text">足迹</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="info-bot">
|
|
|
- <view class="list-item border_bottom" v-for="type in typeArr" :key="type" @click="itemClickHandle(type)">
|
|
|
- <text>{{ type }}</text>
|
|
|
- <view class="my-bot-box">
|
|
|
- <block v-if="type == '外呼号码'">
|
|
|
- <text v-if="userInfo.OutboundCountryCode && userInfo.OutboundMobile" style="margin-right: 40rpx; font-size: 28rpx">{{ userInfo.OutboundCountryCode }}-{{ userInfo.OutboundMobile }}</text>
|
|
|
- <text v-else style="margin-right: 40rpx; font-size: 28rpx">未设置</text>
|
|
|
- </block>
|
|
|
- <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="bottom-text">您手边的弘则研究素材库</view>
|
|
|
- </view>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { uploadurl, Mine, checkToken, User } from "@/config/api.js";
|
|
|
-import freeCharge from "@/components/freeCharge";
|
|
|
-let app = getApp();
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- freeCharge,
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isLogin: false, //是否绑定且授权
|
|
|
- login_txt: "",
|
|
|
- haveData: null, //显示页面
|
|
|
- typeArr: ["外呼号码", "访谈申请", "我的提问", "优化建议"],
|
|
|
- typeObj: new Map([
|
|
|
- ["外呼号码", "editOutbound"],
|
|
|
- ["访谈申请", "applyInterview"],
|
|
|
- ["我的提问", "myAskPage"],
|
|
|
- ["优化建议", "advice"],
|
|
|
- ]),
|
|
|
- userInfo: {},
|
|
|
- authList: [],
|
|
|
- navBarStyle: {
|
|
|
- height: 60 + "px",
|
|
|
- paddingTop: 40 + "px",
|
|
|
- paddingBottom: "4px",
|
|
|
- },
|
|
|
- myNotice: true,
|
|
|
- headimgurl: "",
|
|
|
- };
|
|
|
- },
|
|
|
- async onShow() {
|
|
|
- await this.$store.dispatch("checkHandle", "noGO");
|
|
|
- this.haveData = true;
|
|
|
- if (!this.$store.state.isAuth && !this.$store.state.isBind) {
|
|
|
- //已授权已绑定
|
|
|
- this.isLogin = true;
|
|
|
- this.getUser();
|
|
|
- } else {
|
|
|
- this.login_txt = this.$store.state.isAuth ? "点击登录" : "绑定联系方式";
|
|
|
- this.isLogin = false;
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- this.initNavBar();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //点击了头像
|
|
|
- onChooseAvatar(e) {
|
|
|
- let token = this.$db.get("access_token");
|
|
|
- let authHeader = token || "";
|
|
|
- let that = this;
|
|
|
- uni.uploadFile({
|
|
|
- url: uploadurl,
|
|
|
- filePath: e.detail.avatarUrl,
|
|
|
- header: {
|
|
|
- "Content-Type": "multipart/form-data",
|
|
|
- Authorization: authHeader,
|
|
|
- },
|
|
|
- name: "file",
|
|
|
- success(res) {
|
|
|
- let data = JSON.parse(res.data);
|
|
|
- that.headimgurl = data.Data.ResourceUrl;
|
|
|
- User.headimgurlUpdate({ Headimgurl: data.Data.ResourceUrl });
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- //导航条的高度
|
|
|
- initNavBar() {
|
|
|
- let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
|
|
- this.navBarStyle = {
|
|
|
- height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
|
|
|
- paddingTop: menuButtonInfo.top - 4 + "px",
|
|
|
- paddingBottom: "4px",
|
|
|
- };
|
|
|
- },
|
|
|
- /* 检查状态 */
|
|
|
- /* 获取用户信息 */
|
|
|
- getUser() {
|
|
|
- Mine.getInfo().then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.authList = res.Data.PermissionName && res.Data.PermissionName.split(",");
|
|
|
- this.userInfo = res.Data;
|
|
|
- this.headimgurl = res.Data.Headimgurl;
|
|
|
- res.Data.Mobile && this.$db.set("mobile", res.Data.Mobile);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /* 点击登录 检验是否绑定或是否授权*/
|
|
|
- loginHandle() {
|
|
|
- /* 先授权再绑定 */
|
|
|
- if (this.$store.state.isAuth) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pageMy/authGuide/authGuide",
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$store.state.isBind &&
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pageMy/login/login",
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- /* 申请开通权限 */
|
|
|
- applyAuth() {
|
|
|
- /* 查看是否是潜在用户 */
|
|
|
- this.userInfo.HasPermission === 1
|
|
|
- ? User.applyTry({
|
|
|
- ApplyMethod: 3,
|
|
|
- }).then((res) => {
|
|
|
- if (res.Ret === 200) {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pageMy/applyResult/applyResult",
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- : this.userInfo.HasPermission === 2
|
|
|
- ? uni.navigateTo({
|
|
|
- url: "/pageMy/applyTrial/applyTrial",
|
|
|
- })
|
|
|
- : this.userInfo.HasPermission === 3
|
|
|
- ? uni.showModal({
|
|
|
- title: "",
|
|
|
- content: "您已经提交过申请了,请耐心等待",
|
|
|
- showCancel: false,
|
|
|
- confirmColor: "#365595",
|
|
|
- success: function (res) {},
|
|
|
- })
|
|
|
- : "";
|
|
|
- },
|
|
|
- /* 路径跳转 */
|
|
|
- itemClickHandle(type) {
|
|
|
- /* 是否登录 */
|
|
|
- if (this.isLogin) {
|
|
|
- if (type == "外呼号码") {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=我的",
|
|
|
- });
|
|
|
- } else if (type == "我的提问") {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/reportPages/myAskPage/myAskPage",
|
|
|
- });
|
|
|
- } else if (type == "myCollection" || type == "browseHistory" || type == "mySchedulepage") {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageMy/${type}/${type}`,
|
|
|
- });
|
|
|
- } else {
|
|
|
- let path = this.typeObj.get(type);
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pageMy/${path}/${path}`,
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.loginHandle();
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.my-container {
|
|
|
- background: #f9f9f9;
|
|
|
- position: relative;
|
|
|
- .nav-bar-wrap {
|
|
|
- color: #fff;
|
|
|
- position: fixed;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- z-index: 999;
|
|
|
- .content {
|
|
|
- position: relative;
|
|
|
- height: 100%;
|
|
|
- .text {
|
|
|
- text-align: center;
|
|
|
- width: 50vw;
|
|
|
- position: absolute;
|
|
|
- left: 50%;
|
|
|
- top: 50%;
|
|
|
- transform: translate(-50%, -50%);
|
|
|
- font-weight: bold;
|
|
|
- font-size: 30rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .my-background {
|
|
|
- height: 480rpx;
|
|
|
- width: 100%;
|
|
|
- background: url("https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/my_bg.jpg") no-repeat;
|
|
|
- background-size: 100% 100%;
|
|
|
- padding-top: 206rpx;
|
|
|
- .my-notice {
|
|
|
- height: 55rpx;
|
|
|
- width: 690rpx;
|
|
|
- margin: 0 auto;
|
|
|
- background: rgba(255, 255, 255, 0.5);
|
|
|
- border-radius: 8px 8px 8px 8px;
|
|
|
- line-height: 55rpx;
|
|
|
- text-align: center;
|
|
|
- color: #ffffff;
|
|
|
- position: relative;
|
|
|
- .my-icon {
|
|
|
- position: absolute;
|
|
|
- right: 20rpx;
|
|
|
- top: 50%;
|
|
|
- transform: translateY(-50%);
|
|
|
- font-weight: bold;
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .my-info {
|
|
|
- position: absolute;
|
|
|
- top: 301rpx;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- .my-top-info {
|
|
|
- width: 690rpx;
|
|
|
- margin: 0 auto;
|
|
|
- height: 436rpx;
|
|
|
- background: url("https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/my_log.png") no-repeat;
|
|
|
- background-color: #ffffff;
|
|
|
- background-position: right top;
|
|
|
- background-size: 267rpx 274rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- box-shadow: 0px 0rpx 7rpx 1rpx #f0f3f5;
|
|
|
- border-radius: 8rpx;
|
|
|
- .info {
|
|
|
- padding: 61rpx 0 0 30rpx;
|
|
|
- display: flex;
|
|
|
- .info-img {
|
|
|
- width: 126rpx;
|
|
|
- height: 126rpx;
|
|
|
- background: #c4c4c4;
|
|
|
- border-radius: 50%;
|
|
|
- overflow: hidden;
|
|
|
- .avatar-wrapper {
|
|
|
- width: 126rpx;
|
|
|
- height: 126rpx;
|
|
|
- }
|
|
|
- .avatar {
|
|
|
- width: 126rpx;
|
|
|
- height: 126rpx;
|
|
|
- border-radius: 50%;
|
|
|
- }
|
|
|
- }
|
|
|
- .info-list {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- margin-left: 32rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- font-weight: 400;
|
|
|
- color: #666666;
|
|
|
- .name {
|
|
|
- font-size: 30rpx;
|
|
|
- color: #000000;
|
|
|
- line-height: 35rpx;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
- .bind-btn {
|
|
|
- color: #3385ff;
|
|
|
- width: 181rpx;
|
|
|
- height: 49rpx;
|
|
|
- background: #ffffff;
|
|
|
- border-radius: 8rpx;
|
|
|
- border: 2rpx solid #3385ff;
|
|
|
- text-align: center;
|
|
|
- line-height: 47rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .auth-info {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- margin-top: 36rpx;
|
|
|
- .auth-ul {
|
|
|
- white-space: nowrap;
|
|
|
- padding: 0 30rpx;
|
|
|
- color: #3385ff;
|
|
|
- .auth-li {
|
|
|
- display: inline-block;
|
|
|
- padding: 1rpx 20rpx;
|
|
|
- border: 1rpx solid #3385ff;
|
|
|
- border-radius: 4rpx;
|
|
|
- font-size: 24rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
- background: #edf4ff;
|
|
|
- &:last-child {
|
|
|
- margin-right: 50rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .no-auth {
|
|
|
- text-align: center;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- .auth-btn {
|
|
|
- width: 181rpx;
|
|
|
- height: 49rpx;
|
|
|
- margin: 0 auto;
|
|
|
- color: #3385ff;
|
|
|
- font-size: 24rpx;
|
|
|
- line-height: 47rpx;
|
|
|
- border: 2rpx solid #3385ff;
|
|
|
- }
|
|
|
- }
|
|
|
- .info-item {
|
|
|
- display: flex;
|
|
|
- padding-left: 30rpx;
|
|
|
- margin: 36rpx auto 0;
|
|
|
- .item {
|
|
|
- width: 208rpx;
|
|
|
- height: 76rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- text-align: center;
|
|
|
- .item-number {
|
|
|
- font-size: 40rpx;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
- }
|
|
|
- .item-label {
|
|
|
- border-right: 1rpx solid #ececec;
|
|
|
- border-left: 1rpx solid #ececec;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .info-bot {
|
|
|
- padding: 0 20rpx;
|
|
|
- background-color: #fff;
|
|
|
- box-shadow: 0px 0rpx 7rpx 1rpx #f0f3f5;
|
|
|
- border-radius: 8rpx;
|
|
|
- margin-top: 20rpx;
|
|
|
- .list-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- font-size: 34rpx;
|
|
|
- color: #4a4a4a;
|
|
|
- padding: 33rpx 34rpx;
|
|
|
- .icon-area {
|
|
|
- width: 100rpx;
|
|
|
- }
|
|
|
- &:last-child {
|
|
|
- position: static;
|
|
|
- }
|
|
|
- }
|
|
|
- .my-bot-box {
|
|
|
- display: flex;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .bottom-text {
|
|
|
- position: fixed;
|
|
|
- bottom: 130rpx;
|
|
|
- right: 0;
|
|
|
- z-index: 9;
|
|
|
- font-size: 20rpx;
|
|
|
- color: #999999;
|
|
|
- width: 100%;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|