123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- <template>
- <view class="container my-container" v-if="haveData">
- <view class="top-content-box">
- <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
- <van-icon custom-class="search-icon" name="arrow-left" size="24px" @click="goBack" />
- </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">
- <block v-if="isUserBindingPhoneNumber">
- <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('活动日程')">
- <text class="item-number">{{ userInfo.ScheduleNum }}</text>
- <text class="item-text">活动日程</text>
- </view>
- <view class="item item-label" @click="itemClickHandle('我的收藏')">
- <text class="item-number">{{ userInfo.ConNum }}</text>
- <text class="item-text">收藏</text>
- </view>
- <view class="item" @click="itemClickHandle('我的足迹')">
- <text class="item-number">{{ userInfo.HistoryNum }}</text>
- <text class="item-text">足迹</text>
- </view>
- </view>
- </block>
- <block v-else>
- <view class="btn-login">
- <image src="https://hzstatic.hzinsights.com/cygx/icon/activity-no-data.png"></image>
- <view>暂无您的登录信息</view>
- <view>请登陆后再查看此页面内容</view>
- <view class="login-button" @click="pleaseGoLogin">立即登陆</view>
- </view>
- </block>
- </view>
- <view class="info-bot">
- <block v-for="type in typeArr" :key="type">
- <view class="list-item border_bottom" v-if="(type === '关于我们' && wholeShowListData.IsShowAboutVideo) || 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>
- <block v-if="type == '关注公众号'">
- <text style="margin-right: 20rpx; font-size: 28rpx">查研观向小助手</text>
- </block>
- <block v-if="type == 'PC网页版'">
- <text @click="copyPcWebUrl" style="margin-right: 20rpx; font-size: 28rpx; color: #376cbb">web.hzinsights.com</text>
- </block>
- <u-icon v-if="type != 'PC网页版'" name="arrow-right" color="#BDBDBD" size="34"></u-icon>
- </view>
- </view>
- </block>
- </view>
- <view class="bottom-text">您手边的研究素材库</view>
- </view>
- <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
- <Loading />
- </view>
- </template>
- <script>
- import { uploadurl, Mine, checkToken, User } from "@/config/api.js";
- import freeCharge from "@/components/freeCharge";
- import NotHaveLogin from "../../components/notHaveLogin.vue";
- let app = getApp();
- export default {
- components: {
- freeCharge,
- NotHaveLogin,
- },
- data() {
- return {
- isLogin: false, //是否绑定且授权
- haveData: null, //显示页面
- typeArr: [],
- typeObj: new Map([
- ["外呼号码", "editOutbound"],
- ["活动提问", "myAskPage"],
- ["我的留言", "myLeavingMessage"],
- ["优化建议", "advice"],
- ["关于我们", "followUs"],
- ["产品内测", "internalTesting"],
- ["关注公众号", "accountsOfficial"],
- ["我的足迹", "browseHistory"],
- ["活动日程", "mySchedulepage"],
- ["我的收藏", "myCollection"],
- ]),
- userInfo: {},
- authList: [],
- myNotice: true,
- headimgurl: "",
- };
- },
- onShow() {
- this.haveData = true;
- if (!this.$store.state.isAuth && !this.$store.state.isBind) {
- //已授权已绑定
- this.isLogin = true;
- this.getUser();
- } else {
- this.isLogin = false;
- }
- },
- watch: {
- "wholeShowListData.IsBelongRai": {
- handler(newVal) {
- this.typeArr = this.isUserBindingPhoneNumber ? ["外呼号码", "活动提问", "我的留言", "优化建议", "关于我们", "产品内测", "关注公众号", "PC网页版"] : ["关于我们", "关注公众号", "PC网页版"];
- if (!newVal) {
- this.typeArr.splice(5, 1);
- }
- },
- deep: true,
- },
- },
- methods: {
- //获取胶囊位置
- initNavBar() {
- let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
- this.navBarStyle = {
- height: menuButtonInfo.height + menuButtonInfo.top + 8 + "px",
- paddingTop: menuButtonInfo.top - 4 + "px",
- paddingBottom: "4px",
- };
- },
- // 返回
- goBack() {
- uni.navigateBack();
- },
- //点击了头像
- onChooseAvatar(e) {
- this.getRecordTracking("头像");
- 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 });
- },
- });
- },
- /* 检查状态 */
- /* 获取用户信息 */
- 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) {
- let istype = type === "关注公众号" || type === "优化建议" || type === "外呼号码" ? type : "";
- istype && this.getRecordTracking("istype");
- /* 是否登录 */
- if (this.isLogin || type === "关注公众号" || type == "关于我们" || type === "PC网页版") {
- switch (type) {
- case "外呼号码":
- uni.navigateTo({
- url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=我的",
- });
- break;
- case "关注公众号":
- uni.navigateTo({
- url: "/activityPages/accountsOfficial/accountsOfficial",
- });
- break;
- case "活动提问":
- uni.navigateTo({
- url: "/reportPages/myAskPage/myAskPage",
- });
- break;
- case "产品内测":
- uni.navigateTo({
- url: "/reportPages/internalTesting/internalTesting",
- });
- break;
- case "PC网页版":
- "";
- break;
- default:
- let path = this.typeObj.get(type);
- uni.navigateTo({
- url: `/pageMy/${path}/${path}`,
- });
- }
- } else {
- this.loginHandle();
- }
- },
- // 复制网页链接
- copyPcWebUrl() {
- uni.setClipboardData({
- data: "web.hzinsights.com",
- success: function () {
- uni.showToast({
- title: "已复制到剪贴板",
- icon: "none",
- duration: 2000,
- });
- },
- });
- },
- },
- onLoad() {
- this.initNavBar();
- },
- };
- </script>
- <style lang="scss" scoped>
- .my-container {
- background-color: $uni-bg-color;
- position: relative;
- .top-content-box {
- position: sticky;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 9;
- }
- .nav-bar-wrap {
- width: 100%;
- padding-left: 35rpx;
- display: flex;
- align-items: center;
- position: relative;
- .search-icon {
- position: absolute;
- left: 34rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- .nav-bar-wrap {
- color: #fff;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 999;
- }
- .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;
- line-height: 55rpx;
- text-align: center;
- color: #ffffff;
- position: relative;
- padding-right: 20rpx;
- .my-icon {
- position: absolute;
- right: 20rpx;
- top: 50%;
- transform: translateY(-50%);
- font-weight: bold;
- font-size: 16px;
- }
- }
- }
- .my-info {
- position: absolute;
- background: $uni-bg-color;
- top: 301rpx;
- left: 50%;
- transform: translateX(-50%);
- padding-bottom: 100rpx;
- padding-bottom: calc(100rpx + constant(safe-area-inset-bottom));
- padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
- .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 {
- display: flex;
- align-items: center;
- justify-content: center;
- color: $uni-color-new;
- width: 181rpx;
- height: 49rpx;
- background: #edf4ff;
- border-radius: 8rpx;
- border: 1rpx solid $uni-color-new;
- }
- }
- }
- .auth-info {
- width: 100%;
- overflow: hidden;
- margin-top: 36rpx;
- .auth-ul {
- white-space: nowrap;
- padding: 0 30rpx;
- color: $uni-color-new;
- .auth-li {
- display: inline-block;
- padding: 1rpx 20rpx;
- border: 1rpx solid $uni-color-new;
- 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: #376cbb;
- font-size: 24rpx;
- line-height: 47rpx;
- border: 2rpx solid #376cbb;
- }
- }
- .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: absolute;
- background: $uni-bg-color;
- bottom: 80rpx;
- right: 0;
- z-index: 9;
- font-size: 20rpx;
- color: #999999;
- width: 100%;
- text-align: center;
- }
- .not-bind-login {
- position: absolute;
- top: 301rpx;
- left: 50%;
- transform: translateX(-50%);
- width: 95%;
- height: 1234rpx;
- background-color: #fff;
- border-radius: 8rpx;
- border: 1px solid #ececec;
- .bottom-text {
- position: absolute;
- bottom: -50rpx;
- }
- }
- .btn-login {
- padding-top: 60rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- color: #999999;
- font-size: 24rpx;
- line-height: 36rpx;
- image {
- width: 261rpx;
- height: 201rpx;
- }
- .login-button {
- margin-top: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 156rpx;
- height: 52rpx;
- border-radius: 9rpx;
- color: #fff;
- font-weight: 600;
- background-color: #376cbb;
- }
- }
- }
- </style>
|