fix: 我的-》个人信息-》名称显示

This commit is contained in:
admin 2024-07-18 15:41:43 +08:00
parent b6838f3f8d
commit a0c55d0be1
3 changed files with 10 additions and 11 deletions

View File

@ -3,7 +3,7 @@
<up-col span="6" v-for="(item, index) in list" :key="index"> <up-col span="6" v-for="(item, index) in list" :key="index">
<view class="grid-item"> <view class="grid-item">
<up-image <up-image
:src="item.url" :src="item.url || `${url}/static/110/error.jpg`"
:mode="'widthFix'" :mode="'widthFix'"
:width="'100%'" :width="'100%'"
@click="showImage(index)" @click="showImage(index)"
@ -20,13 +20,14 @@
<script setup lang="ts"> <script setup lang="ts">
import { PictureApi } from "@/services"; import { PictureApi } from "@/services";
import { url } from "@/utils/data";
const props = defineProps<{ const props = defineProps<{
params: Object; params: Object;
}>(); }>();
let list: any = ref([]); let list: any = ref([]);
const showImage = (index: number) => { const showImage = (index: number) => {
uni.previewImage({ uni.previewImage({
urls: list.value.map((item: any) => item.url), // urls: list.value.map((item: any) => item.url || `${url}/static/110/error.jpg`), //
current: index, // current: index, //
indicator: "default", // indicator: "default", //
loop: true, loop: true,

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="baseinfo"> <view class="baseinfo">
<view class="box"> <view class="box">
<view> 姓名 {{ profile.userName }} </view> <view> 姓名 {{ profile.name }} </view>
<view> 性别 {{ profile.gender ? (profile.gender === 1 ? '男' : '女') :'未知' }} </view> <view> 性别 {{ profile.gender ? (profile.gender === 1 ? '男' : '女') :'未知' }} </view>
<view> 手机号码 {{ profile.phone }} </view> <view> 手机号码 {{ profile.phone }} </view>
</view> </view>

View File

@ -13,11 +13,8 @@
> >
<view class="time">{{ item.createTime }}</view> <view class="time">{{ item.createTime }}</view>
<text class="tip">{{ getType(item.imagesType) }}过磅</text> <text class="tip">{{ getType(item.imagesType) }}过磅</text>
<image <image :src="item.url || `${url}/static/110/error.jpg`" :mode="'widthFix'" @click="showImage(index)">
:src="item.url" </image>
:mode="'widthFix'"
@click="showImage(index)"
/>
</view> </view>
</up-col> </up-col>
</up-row> </up-row>
@ -31,6 +28,7 @@
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { PictureApi } from "@/services/index"; import { PictureApi } from "@/services/index";
import { ImagesType } from "@/utils/enum"; import { ImagesType } from "@/utils/enum";
import { url } from "@/utils/data";
let list: any = ref([]); let list: any = ref([]);
const getType = (v: number) => { const getType = (v: number) => {
if (v === ImagesType.Tare) { if (v === ImagesType.Tare) {
@ -42,12 +40,12 @@ const getType = (v: number) => {
} }
}; };
const showImage = ( index:number) => { const showImage = (index: number) => {
uni.previewImage({ uni.previewImage({
urls: list.value.map((item:any) => item.url), // urls: list.value.map((item: any) => item.url || `${url}/static/110/error.jpg`), //
current: index, // current: index, //
indicator: "default", // indicator: "default", //
loop:true, loop: true,
}); });
}; };
onLoad((option: any) => { onLoad((option: any) => {