通讯录列表样式

embedded/2025/2/13 8:02:09/

先上效果图,一个H5样式图,一个PC样式图

代码:

<template><div :class="screen>1280?'ms':'xs'"><div class="" v-for="(item,index) in listData" :key="index"><div class="xuhao">{{item.group}}</div><div class="flex flex-between" v-for="(i,j) in item.data" :key="j"><div class="flex libox"><div class="avatar flex1"><img v-if="i.profilePic" :src="i.profilePic" alt="" srcset=""><span v-if="!i.profilePic">{{i.name.slice(-2)}}</span><!-- 如果有头像就展示头像,否则展示名字(取名字最后两位展示) --></div><div class="flex flex-between flex-column lieditbox" style="align-items:flex-start;"><div>{{i.name}}</div><div class="colorgray">{{i.phone}}</div></div></div><div class="color"><span style="margin-right:10px;">编辑</span><span>删除</span></div></div></div></div>
</template>
<script>
import { getPlatformContact } from '@/api/PersonalCenter'
export default {data() {return {keyword: "",listData: [],screen: 0}},methods: {async getList(){let res = await getPlatformContact({searchValue: this.keyword});if (res.code == 200) {this.listData = res.data;}},setRem() {let deviceWidth = document.documentElement.clientWidth;this.screen = deviceWidth;},},mounted(){this.getList()this.setRem();window.addEventListener("resize", this.setRem);},beforeDestroy() {window.removeEventListener("resize", this.setRem);},
}
</script><style lang="scss">.color{color: #ef3c40;}.colorgray{color: #73797F;}.flex{display: flex;}.flex-between{justify-content: space-between;}.flex-column{flex-direction: column;}.flex1{display: flex;align-items: center;justify-content: center;}.xuhao{margin-bottom: 10px;font-size: 20px;font-weight: 400;margin-top: 20px;}.libox{margin-bottom: 10px;.lieditbox{height: 3rem;}.avatar{width: 3rem;height: 3rem;background: #ef3c40;border-radius: 4px;overflow: hidden;text-align: center;margin-right: 8px;img {width: 100%;height: 100%;}span{color: #fff;}}}.xs{font-size: 0.28rem;padding: 0.48rem;.libox{.avatar{width: 1rem;height: 1rem;}.lieditbox{height: 1rem;}}}
</style>

 

接口返回的数据格式:


http://www.ppmy.cn/embedded/161822.html

相关文章

【Ubuntu VScode Remote SSH 问题解决】Resolver error: Error: XHR failed

1. 问题描述 VScode使用remote ssh 远程服务器&#xff0c;报错类似&#xff1a; [12:06:01.219] Downloading VS Code server locally... [12:06:01.310] Resolver error: Error: XHR failedat k.onerror (vscode-file://vscode-app/private/var/folders/g1/cvs2rnpx60qc3b4…

# 解析Excel文件:处理Excel xlsx file not supported错误 [特殊字符]

解析Excel文件&#xff1a;处理Excel xlsx file not supported错误 &#x1f9e9; 嘿&#xff0c;数据分析的小伙伴们&#xff01;&#x1f44b; 我知道在处理Excel文件的时候&#xff0c;很多人可能会遇到这样一个错误&#xff1a;Excel xlsx file not supported。别担心&…

SWIFT 后训练 Deepseek-VL2 命令

SWIFT 后训练 Deepseek-VL2 命令 flyfish 后训练命令 CUDA_VISIBLE_DEVICES1 swift sft --model deepseek-ai/deepseek-vl2-tiny --dataset coco-en-miniswift/cli/sft.py from swift.llm import sft_mainif __name__ __main__:sft_main()init.py 在类型检查阶段导…

java程序员进阶之路需要的学习过程

http://blog.csdn.net/qq_37267015/article/details/77108692

两种方式存图 求树的直径

vector求数的直径 #include<bits/stdc.h> using namespace std; const int N 1e5 9;int n; struct Edge {int id, w; }; vector<Edge> h[N]; int dist[N];void dfs(int u, int father, int distance) {dist[u] distance;for(auto node : h[u])if(node.id ! fat…

linux 内核结构基础

linux 内核对象基础 1.linux 的 kobj(struct kobject) 类2.linux 中的 kset3. linux 下的 ktype (kobj_type 类)4. kobj 的使用理解 1.linux 的 kobj(struct kobject) 类 kobj 是 linux 下的高级抽象类定义&#xff0c;用于派生所有其余的类定义,比如设备类定义struct device.…

【DeepSeek】DeepSeek的横向扩展使用② | 制作PPT

本文的主要内容是使用DeepSeek KIMI 制作PPT&#xff0c;效率飞起。 目录 如何使用DeepSeek制作PPT&#xff1f; ①利用 DeepSeek 生成 PPT 内容。 ②使用 Kimi 转换生成 PPT DeepSeek官网&#xff1a;DeepSeek 点击“开始对话”&#xff0c;进入交互页面。 Chat&#x…

Kafka的消费消息是如何传递的?

大家好&#xff0c;我是锋哥。今天分享关于【Kafka的消费消息是如何传递的&#xff1f;】面试题。希望对大家有帮助&#xff1b; Kafka的消费消息是如何传递的&#xff1f; 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 Kafka 的消息传递机制是基于 发布-订阅 模型…