From 9a139cc25da8396c1b257ccf99eb8d2fedfbc94d Mon Sep 17 00:00:00 2001 From: Liuyi <candymxq888@outlook.com> Date: 星期三, 23 十月 2024 17:24:35 +0800 Subject: [PATCH] 添加校验,修改头像 --- pages/index/index.vue | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 2603032..600aa26 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,5 +1,6 @@ <script setup> import { onMounted, ref } from "vue"; + import { BASE_URL } from '../../config/baseUrl'; import { getVipInfoApi,getUserInfo,reportLossApi,removeCardApi,buyWaterApi } from '../../api/index.js' import { onShow,getCurrentPages } from '@dcloudio/uni-app' //状态栏高度 @@ -25,6 +26,7 @@ state:'',//state:true:挂失,false:正常 userCardType:'',//userCardType:true:共享卡,false:正常卡 }) + // const showHeadImg = ref(BASE_URL + '/upload' + cardInfo.value.headImg) const isLoss = ref(false) const isVip = ref(false) const isShareCard = ref(false) @@ -56,6 +58,7 @@ if(res.code == 200){ cardInfo.value.userName = res.data.userInfo.userName ? res.data.userInfo.userName : cardInfo.value.userName cardInfo.value.headImg = res.data.userInfo.headImg + // showHeadImg.value = BASE_URL + '/upload' + cardInfo.value.headImg cardInfo.value.userPhone = res.data.userInfo.userPhone cardInfo.value.id = res.data.userInfo.id await getVipInfo() @@ -242,7 +245,7 @@ <view class="content"> <view class="card-box" :style="{paddingTop:topHeight + 'rpx'}"> <view class="user-info" > - <image v-if="cardInfo.headImg" class="user-img" :src='cardInfo.headImg' alt=''></image> + <image v-if="cardInfo.headImg" class="user-img" :src= "BASE_URL + '/upload' + cardInfo.headImg" alt=''></image> <image v-else class="user-img" src='../../static/images/index/head.png' alt=''></image> <text @click="navTo('/pages/userInfo/index')">{{cardInfo.userName}}</text> <image @click="navTo('/pages/userInfo/index')" class="user-more"src="../../static/images/index/back.png"></image> -- Gitblit v1.9.3