<!--我的-->
<template>
  <view>
    <view class="head">
      <text class="text1">我的</text>
      <text class="text2">My</text>
    </view>
    <view class="u-p-30">
      <view class="item item--round" @click="edit">
        <view class="u-font-32 u-m-b-8 u-line-1">{{ msg.fullName }}</view>
        <view class="u-font-24">{{ msg.userName }}</view>
      </view>
      <view
        @click="toBrowse"
        class="u-l-height-44 commonStyle"
        v-if="type === 2"
      >
        <view>
          <u-icon name="clock" class="browseicon"></u-icon>
          <text>浏览记录</text>
        </view>
        <u-icon name="arrow-right" class="comicon"></u-icon>
      </view>
      <view @click="toRegister" class="u-l-height-44 commonStyle"
        >切换身份 <u-icon name="arrow-right" class="comicon"></u-icon
      ></view>
    </view>

    <hs-tab-bar></hs-tab-bar>
  </view>
</template>

<script>
import HsTabBar from "../../../components/hs-tab-bar/hs-tab-bar";
export default {
  name: "index",
  components: { HsTabBar },
  data() {
    return {
      msg: uni.getStorageSync("userInfo"),
      type: uni.getStorageSync("assignType"),
    };
  },
  created() {
    // let msg = uni.getStorageSync("userInfo")
    // console.log(msg)
  },
  methods: {
    edit() {
      this.$Router.push({
        path: "/pages/user/register/completeInformation",
        query: {
          type: this.type,
        },
      });
    },
    toBrowse() {
      this.$Router.push({
        path: "/pages/brands/browse",
      });
    },
    toRegister() {
      this.$Router.push({
        path: "/pages/user/register/stepSelectType",
        query: {
          type: this.type,
        },
      });
    },
  },
};
</script>

<style scoped lang="scss">
.item--round {
  border-radius: 8rpx;
}
.item {
  padding: 36rpx 30px;
  height: 160rpx;
  background: url(~@/static/images/myCenter/bg.png) no-repeat;
  background-size: 100% 100%;
  margin-bottom: 20rpx;
  color: #fff;
}
.head {
  width: 100%;
  margin-top: 16rpx;
  position: relative;
  .text1 {
    width: 160rpx;
    height: 56rpx;
    font-size: 40rpx;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
    line-height: 56rpx;
    margin-left: 38rpx;
  }
  .text2 {
    width: 194rpx;
    height: 40-rpx;
    font-size: 28rpx;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    color: #dda973;
    line-height: 40rpx;
    margin-left: 10rpx;
  }
  .btn {
    width: 56rpx;
    height: 40rpx;
    font-size: 28rpx;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 700;
    text-align: right;
    color: rgba(0, 0, 0, 0.6);
    line-height: 40rpx;
    position: absolute;
    right: 30rpx;
    bottom: 0;
  }
}
//浏览和切换身份样式
.commonStyle {
  width: 100%;
  height: 160rpx;
  line-height: 160rpx;
  border-bottom: 1px solid #e4e5e7;
  display: flex;
  justify-content: space-between;
  align-content: center;
  ::v-deep .browseicon {
    font-size: 40rpx;
    color: red;
    margin-right: 20rpx;
    vertical-align: middle;
  }
}
</style>