123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <template>
- <scroll-view scroll-y class="content">
- <div class="user">
- <van-cell
- center
- :value="userInfo.nickName ? userInfo.nickName : '新用户'"
-
- >
- <view slot="title">
- <image
- class="user-headImg"
- v-if="userInfo.headImage"
- :src="userInfo.headImage"
- ></image>
- <image class="user-headImg" v-else :src="unLoginHead"></image>
- </view>
- </van-cell>
- <van-cell
- title="资料下载"
- is-link
- @click="goVipPath('/otherPages/pdfList/index')"
- center
- >
- <template #icon>
- <m-icon type="fkbz" class="cell-icon" />
- </template>
- </van-cell>
- <!-- <van-cell title="我要提现" value="" is-link center @click="goCashOut">
- </van-cell> -->
- <!-- <van-cell title="我的下级" value="" is-link center @click="goMyBranch">
- <template #icon>
- <m-icon type="hyyxq" class="cell-icon" />
- </template>
- </van-cell> -->
- <!-- <van-cell
- title="我的推广积分"
- value=""
- is-link
- center
- @click="goMyIntegral"
- >
- </van-cell> -->
- <!-- #ifdef MP-WEIXIN -->
- <!-- <van-cell
- title="会员有效期"
- :value="expireTime ? expireTime : '开通会员'"
- is-link
- center
- url="/otherPages/buyVip/index"
- >
- </van-cell> -->
- <!-- #endif -->
- <!-- #ifdef MP-TOUTIAO -->
- <van-cell
- v-if="!isVip"
- title="会员有效期"
- :value="'开通会员'"
- is-link
- center
- url="/otherPages/buyVip/index"
- >
- </van-cell>
- <van-cell
- v-if="isVip"
- title="会员有效期"
- :value="'已开通'"
- is-link
- center
- >
- </van-cell>
- <van-cell
- title="资料下载"
- is-link
- @click="goVipPath('/otherPages/pdfList/index')"
- center
- >
- <template #icon>
- <m-icon type="fkbz" class="cell-icon" />
- </template>
- </van-cell>
- <!-- #endif -->
- <!-- #ifdef MP-WEIXIN -->
- <van-cell
- title="反馈帮助"
- is-link
- center
- url="/pages/extraWeb/index?src=https://support.qq.com/product/359609"
- >
- <template #icon>
- <m-icon type="fkbz" class="cell-icon" />
- </template>
- </van-cell>
- <!-- #endif -->
- </div>
- <!-- <view class="ad-box serviceBox">
- <ad unit-id="adunit-d8c1548cc9663765"></ad>
- </view> -->
- </scroll-view>
- </template>
- <script>
- import api from "@/api/index";
- import unLoginHead from "@/assets/img/unLoginHead.png";
- export default {
- computed: {
- unLoginHead() {
- return unLoginHead;
- },
- userInfo() {
- return this.$store.state.user.userInfo;
- },
- expireTime() {
- return this.$store.state.user.userInfo.expireTime &&
- this.$store.getters.isVip
- ? this.$store.state.user.userInfo.expireTime.split(" ")[0]
- : null;
- },
- isVip() {
- return this.$store.getters.isVip;
- },
- },
- mounted() {
- this.$store.dispatch("GetInfo");
- },
- methods: {
- goVipPath(url) {
- if (this.isVip) {
- uni.navigateTo({
- url,
- });
- } else {
- uni.showToast({
- title: "vip才能使用",
- icon:'none'
- });
- }
- },
- getUserProfile(e) {
- let that = this;
- uni.getUserProfile({
- desc: "业务需要",
- success(res) {
- console.log(res);
- api.user
- .userInfoUserInfo({
- headImage: res.userInfo.avatarUrl,
- nickName: res.userInfo.nickName,
- })
- .then((res) => {
- that.$store.dispatch("GetInfo");
- });
- },
- });
- // let updateRes = await this.$api.user.updateUserInfo({
- // headImage: userInfo.userInfo.avatarUrl,
- // nickName: userInfo.userInfo.nickName,
- // });
- // if (updateRes.code == 200) {
- // this.$store.state.user.userInfo.headImage = userInfo.userInfo.avatarUrl;
- // this.$store.state.user.userInfo.nickName = userInfo.userInfo.nickName;
- // }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .user {
- background-color: #f2f3f5;
- /* height: 100vh; */
- .group {
- margin: 10px 0;
- }
- .user-avatar {
- width: 46px;
- height: 46px;
- margin-right: 10px;
- }
- }
- .user-headImg {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- }
- .cell-icon {
- margin-right: 5px;
- }
- </style>
|