微信小程序简单的用户页面模板

简介: 微信小程序简单的用户页面模板


wxml

<view class='index-contier'>
  <view class="index-center">
    <view class="logo">
      <open-data type="userAvatarUrl" class="userinfo" id="userinfo1"></open-data>
    </view>
    <view id="userinfo2">
      <open-data type="userNickName" class="userinfo"></open-data>
    </view>
  </view>
</view>
<view class='inform'>
  <view class="item-box">
    <view class="items">
      <view class="item">
        <view class="inner txt">
          <image class="item-icon" mode="widthFix" src="/img/manger.png"></image>
          <i> 工号</i>
          <span class="item-data">
            <i class="rankpace"> {{user.empNo}}</i>
          </span>
        </view>
      </view>
      <view class="item">
        <view class="inner txt">
          <image class="item-icon" mode="widthFix" src="/img/name.png"></image>
          <i> 姓名</i>
          <span class="item-data">
            <i class="rankpace">{{user.name}}</i>
          </span>
        </view>
      </view>
      <view class="item">
        <view class="inner txt">
          <image class="item-icon" mode="widthFix" src="/img/sex.png"></image>
          <i> 性别</i>
          <span class="item-data">
            <i wx:if="{{user.sex == '1'}}">男</i>
            <i wx:if="{{user.sex == '0'}}">女</i>
          </span>
        </view>
      </view>
      <view class="item">
        <view class="inner txt">
          <image class="item-icon" mode="widthFix" src="/img/phone.png"></image>
          <i> 手机</i>
          <span class="item-data">
            <i class="rankpace"> {{user.phone}}</i>
          </span>
        </view>
      </view>
    </view>
  </view>
</view>

js

var app = getApp()
Page({
  data: {
    user: {},
  },
  onShow: function (options) {
    console.log()
    var that = this;
    wx.request({
      url: app.globalData.root + "wx/" + app.globalData.openid + ".do",
      method: 'GET',
      header: {
        'Content-type': 'application/json'
      },
      success: function (res) {
        that.setData({ user: res.data });
      }
    });
  }
})

css

.img {
  width: 60rpx;
  height: 60rpx;
  margin-top: 18rpx;
}
.index-contier {
  color: #fff;
  font-size: 12px;
  width: 100%;
  height: 570rpx;
  background-size: cover;
  background-repeat: no-repeat;
  background-image: url("图片路径");
}
.index-left {
  float: left;
  width: 30%;
  text-align: center;
  margin-top: 477rpx;
  color: #000;
}
.index-center {
  float: left;
  width: 40%;
  text-align: center;
  margin-top: 240rpx;
  color: #000;
}
.logo {
  margin: 0 auto;
  width: 80px;
  height: 80px;
  border-radius: 40px;
}
.index-right {
  float: left;
  width: 30%;
  text-align: center;
  margin-top: 477rpx;
  color: #000;
}
.index-right image {
  height: 100%;
  width: 100%;
}
.inform {
  padding: 0 6px;
  font-size: 30rpx;
}
#userinfo1 {
  width: 185rpx;
  height: 185rpx;
  /* margin:20rpx; */
  border-radius: 50%;
  display: flex;
  overflow: hidden;
  text-align: center;
}
#userinfo2 {
  font-family: "微软雅黑";
  font-size: 15px;
  margin-top: 75rpx;
  color:#ffffff;
}
/* pages/leftSwiperDel/index.wxss */
view {
  box-sizing: border-box;
}
.item-box {
  width: 700rpx;
  margin: 0 auto;
}
.items {
  width: 100%;
}
.item {
  position: relative;
  border-top: 2rpx solid #eee;
  height: 110rpx;
  line-height: 120rpx;
  overflow: hidden;
}
.item:last-child {
  border-bottom: 2rpx solid #eee;
}
.inner {
  position: absolute;
  top: 0;
}
.inner.txt {
  background-color: #fff;
  width: 100%;
  z-index: 5;
  padding: 0 10rpx;
  transition: left 0.2s ease-in-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inner.del {
  background-color: #e64340;
  width: 180rpx;
  text-align: center;
  z-index: 4;
  right: 0;
  color: #fff;
}
.item-icon {
  width: 60rpx;
  height: 60rpx;
  vertical-align: middle;
  margin-right: 16rpx;
  margin-left: 6px;
  border-radius: 50%;
}
.item-data {
  margin-left: 15%;
}
目录
打赏
0
0
0
0
11
分享
相关文章
微信小程序页面导航与路由:实现多页面跳转与数据传递
本文深入探讨微信小程序的页面导航与路由机制,介绍多种页面跳转方式如`wx.navigateTo`、`wx.redirectTo`、`wx.switchTab`等,并讲解通过URL、全局变量和事件传递数据的方法。结合案例实现多页面跳转与数据传递,帮助开发者掌握这一重要技能。
thinkphp+uniapp开发的多端商城系统源码/H5/小程序/APP支持DIY模板直播分销
thinkphp+uniapp开发的多端商城系统源码/H5/小程序/APP支持DIY模板直播分销
50 0
uni-vue3-wetrip自创跨三端(H5+小程序+App)酒店预订app系统模板
vue3-uni-wetrip原创基于vite5+vue3+uniapp+pinia2+uni-ui等技术开发的仿去哪儿/携程预约酒店客房app系统。实现首页酒店展示、预订搜索、列表/详情、订单、聊天消息、我的等模块。支持编译H5+小程序+App端。
131 8
小程序的页面如何布局?
【10月更文挑战第16天】小程序的页面如何布局?
251 1
|
5月前
|
java--微信小程序发送模板消息
java--微信小程序发送模板消息
201 0
微信小程序页面事件,下拉刷新事件和上拉触底事件
这篇文章介绍了微信小程序中如何实现下拉刷新和上拉触底事件,包括开启下拉刷新、配置下拉刷新样式、监听下拉刷新事件,以及监听上拉触底事件和配置上拉触底的距离。
微信小程序开发学习之页面导航(声明式导航和编程式导航)
这篇文章介绍了微信小程序中页面导航的两种方式:声明式导航和编程式导航,包括如何导航到tabBar页面、非tabBar页面、后退导航,以及如何在导航过程中传递参数和获取传递的参数。
微信小程序开发学习之页面导航(声明式导航和编程式导航)
在线课堂+工具组件小程序uniapp移动端源码
在线课堂+工具组件小程序uniapp移动端源码
97 0
在线课堂+工具组件小程序uniapp移动端源码
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
基于npm CLI脚手架的uniapp项目创建、运行与打包全攻略(微信小程序、H5、APP全覆盖)
665 3
|
5月前
|
微信小程序更新提醒uniapp
在小程序开发中,版本更新至关重要。本方案利用 `uni-app` 的 `uni.getUpdateManager()` API 在启动时检测版本更新,提示用户并提供立即更新选项,自动下载更新内容,并在更新完成后重启小程序以应用新版本。适用于微信小程序,确保用户始终使用最新版本。以下是实现步骤: ### 实现步骤 1. **创建更新方法**:在 `App.vue` 中创建 `updateApp` 方法用于检查小程序是否有新版本。 2. **测试**:添加编译模式并选择成功状态进行模拟测试。
113 0
微信小程序更新提醒uniapp

热门文章

最新文章