前言
????????以下給出來四個常見的小程序個人主頁,分別是商城系統(tǒng)個人主頁,外賣系統(tǒng)個人主頁,掛號系統(tǒng)個人主頁,電影購票系統(tǒng)個人主頁。包括完整的頁面布局代碼,完整的樣式代碼。使用的時候,只需要將頁面代碼和樣式代碼復(fù)制到自己項目對應(yīng)的頁面即可。而且可以根據(jù)已有代碼只需稍微改造,便可以作為其他小程序的個人首頁。
1、個人主頁(商城系統(tǒng))
1.1 頁面效果
1.2 頁面源碼(.wxml)
這里的圖片地址,修改為自己項目圖片地址。也可以引入在線圖片鏈接
<view class="user_info_wrap">
<view class="user_img_wrap">
<image class="user_bg" src="/images/back01.jpg" />
<view class="user_info">
<image class="user_icon" src="/images/touxiang01.jpg" />
<view class="user_name">張三牛人</view>
</view>
</view>
</view>
<view class="user_content">
<view class="user_main">
<!-- 歷史足跡 -->
<view class="history_wrap">
<navigator>
<view class="his_num">0</view>
<view class="his_name">收藏的店鋪</view>
</navigator>
<navigator url="/pages/collect/index">
<view class="his_num">0</view>
<view class="his_name">收藏的商品</view>
</navigator>
<navigator>
<view class="his_num">0</view>
<view class="his_name">關(guān)注的商品</view>
</navigator>
<navigator>
<view class="his_num">0</view>
<view class="his_name">我的足跡</view>
</navigator>
</view>
<!-- 我的訂單 -->
<view class="orders-wrap">
<view class="orders_title">我的訂單</view>
<view class="order_content">
<navigator url="/pages/order/index?type=1">
<view class="iconfont icon-ding_dan"></view>
<view class="order_name">全部訂單</view>
</navigator>
<navigator url="/pages/order/index?type=2">
<view class="iconfont icon-fukuantongzhi"></view>
<view class="order_name">待付款</view>
</navigator>
<navigator url="/pages/order/index?type=3">
<view class="iconfont icon-receipt-address"></view>
<view class="order_name">待收獲</view>
</navigator>
<navigator>
<view class="iconfont icon-tuihuo"></view>
<view class="order_name">退貨/退貨</view>
</navigator>
</view>
</view>
<!-- 收貨地址 -->
<view class="address_wrap">收獲地址管理</view>
<!-- 應(yīng)用信息相關(guān) -->
<view class="app_info_wrap">
<view class="app_info_item app_info_contact">
<text>聯(lián)系客服</text>
<text>18348392981</text>
</view>
<navigator url="/pages/feedback/index" class="app_info_item" >意見反饋</navigator>
<view class="app_info_item">關(guān)于我們</view>
</view>
<!-- 推薦 -->
<view class="recommend_wrap">把應(yīng)用推薦給其他人</view>
</view>
</view>
1.3 樣式代碼 (.wxss)
page {
background-color: #ccc;
}
.user_info_wrap {
height: 45vh;
overflow: hidden;
background-color: var(--themeColor);
position: relative;
}
.user_info_wrap .user_img_wrap {
position: relative;
}
.user_info_wrap .user_img_wrap .user_bg {
height: 50vh;
text-align: center;
/* filter: blur(10rpx); */
}
.user_info_wrap .user_img_wrap .user_info {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 20%;
text-align: center;
}
.user_info_wrap .user_img_wrap .user_info .user_icon {
width: 150rpx;
height: 150rpx;
border-radius: 50%;
}
.user_info_wrap .user_img_wrap .user_info .user_name {
color: #fff;
margin-top: 40rpx;
font-size: 40rpx;
}
.user_info_wrap .user_btn {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 40%;
border: 1rpx solid greenyellow;
color: greenyellow;
font-size: 38rpx;
padding: 30rpx;
border-radius: 10rpx;
}
.user_content {
position: relative;
}
.user_content .user_main {
padding-bottom: 90rpx;
color: #666;
position: absolute;
width: 90%;
left: 50%;
transform: translateX(-50%);
top: -40rpx;
}
.user_content .user_main .history_wrap {
background-color: #fff;
display: flex;
}
.user_content .user_main .history_wrap navigator {
flex: 1;
text-align: center;
padding: 10rpx 0;
}
.user_content .user_main .history_wrap navigator .his_num {
color: var(--themeColor);
}
.user_content .user_main .orders-wrap {
background-color: #fff;
margin-top: 30rpx;
}
.user_content .user_main .orders-wrap .orders_title {
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
}
.user_content .user_main .orders-wrap .order_content {
display: flex;
}
.user_content .user_main .orders-wrap navigator {
padding: 15rpx 0;
flex: 1;
text-align: center;
}
.user_content .user_main .orders-wrap navigator .iconfont {
color: var(--themeColor);
font-size: 40rpx;
}
.user_content .user_main .address_wrap {
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
}
.user_content .user_main .app_info_wrap {
margin-top: 30rpx;
background-color: #fff;
}
.user_content .user_main .app_info_wrap .app_info_item {
padding: 20rpx;
border-bottom: 1rpx solid #ccc;
}
.user_content .user_main .app_info_wrap .app_info_contact {
display: flex;
justify-content: space-between;
}
.user_content .user_main .recommend_wrap {
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
}
@font-face {
font-family: "iconfont";
/* Project id 4135149 */
src: url('//at.alicdn.com/t/c/font_4135149_lsktbsemkwh.woff2?t=1687535938174') format('woff2'),
url('//at.alicdn.com/t/c/font_4135149_lsktbsemkwh.woff?t=1687535938174') format('woff'),
url('//at.alicdn.com/t/c/font_4135149_lsktbsemkwh.ttf?t=1687535938174') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-fenxiang:before {
content: "\e600";
}
.icon-shoucang:before {
content: "\e602";
}
.icon-receipt-address:before {
content: "\e673";
}
.icon-shoucang1:before {
content: "\e636";
}
.icon-kefu:before {
content: "\e625";
}
.icon-fukuantongzhi:before {
content: "\e60c";
}
.tuikuantuihuo:before {
content: "\e603";
}
.icon-ding_dan:before {
content: "\e61b";
}
.icon-jinqian:before {
content: "\e652";
}
.icon-gouwuchekong:before {
content: "\e601";
}
.icon-gouwuche:before {
content: "\e601"
}
.icon-tuihuo:before{
content: "\e601"
}
2、個人主頁(外賣系統(tǒng))
2.1 頁面效果
2.2 頁面源碼(.wxml)
<scroll-view class='scbg' scroll-y='true'>
<view class="parent_catainer">
<!-- 頭部 -->
<view class="container_head">
<image class="head_img" src="/images/waimai01.jpg"></image>
<view class="head_pers_info" bindtap="head_pers_info">
<view class="head_pic">
<image class="head_pic_content" mode="aspectFit" src="/images/waimai.jpg"></image>
</view>
<view class="inf_content">
<text class="user_info">張麻子</text>
<text class="family_info_ct_phone">聯(lián)系電話:1832437281</text>
</view>
</view>
</view>
<!-- 我的錢包 -->
<view class="orders-wrap">
<view class="orders_title">我的訂單</view>
<view class="order_content">
<navigator url="/pages/order/index?type=1">
<view class="iconfont icon-ding_dan">10.4萬</view>
<view class="order_name">借錢</view>
</navigator>
<navigator url="/pages/order/index?type=2">
<view class="iconfont icon-fukuantongzhi">100.34元</view>
<view class="order_name">我的賬單</view>
</navigator>
<navigator url="/pages/order/index?type=3">
<view class="iconfont icon-receipt-address">6月</view>
<view class="order_name">消費(fèi)賬單</view>
</navigator>
<navigator>
<view class="iconfont icon-tuihuo">1.66元</view>
<view class="order_name">查看卡額度</view>
</navigator>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="myappointpage">
<text>我的米粒</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="openmyorder">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>美團(tuán)紅包</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="myaid">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>商家代金券</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="myfriend">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>拼好飯代金券</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="mycollection">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的收藏</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="mycollection">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的評價</text>
<view class="arrow"></view>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="bind">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>個人資料</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="bind">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的地址</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="bind">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>修改手機(jī)號</text>
<view class="arrow"></view>
</view>
</view>
<view class="my_priview_logout" bindtap="bind"> 退出賬號 </view>
</view>
</scroll-view>
2.3 樣式代碼 (.wxss)
page {
width: 100%;
height: 100%;
background:#f0f0f0;
}
.parent_catainer{
background:#f0f0f0;
}
/* 頭部背景圖片 */
.container_head{
height: 370rpx;
width: 100%;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
.head_img {
position: absolute;
width: 100%;
height: 370rpx;
}
.head_pers_info{
height: 200rpx;
width: 100%;
margin-bottom: 50rpx;
justify-content: left;
display: flex;
align-items: center;
flex-direction: row;
position: absolute;
}
.head_pic{
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background-color: #08cbb0;
color: #ffffff;
align-items: center;
display: flex;
justify-content: center;
}
.head_pic_content{
position: absolute;
width: 110rpx;
height: 110rpx;
border-radius: 55rpx;
background-color: white;
}
.head_pic{
margin-left: 5%;
}
.inf_content{
display: flex;
flex-direction: column;
margin-left: 10rpx;
align-items: flex-start;
justify-content: center;
color: #ffffff;
padding-bottom: 5rpx;
}
.user_info{
text-align: left;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 8rpx;
color: black;
}
.family_info_ct_phone{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
font-weight: bold;
color: black;
}
.family_info_ct{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-align: left;
text-overflow: ellipsis;
}
.userItemListView{
background: #fff;
padding: 0 0rpx;
margin: 24rpx 0;
}
.userItemListView > view{
height: 94rpx;
line-height: 94rpx;
padding-left: 50rpx;
border-bottom: 1rpx solid #F1F1F1;
position: relative;
}
/* 移除最后一個元素的下邊框 */
.userItemListView > view:last-child{
border: none;
}
.my_priview_md{
display: flex;
align-items: center;
}
.my_priview{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.my_priview_logout{
/* margin-top: 10rpx;
width: 50rpx;
height: 50rpx;
margin-right: 10rpx; */
text-align: center;
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
}
.arrow{
width: 16rpx;
height: 16rpx;
border-top: 4rpx solid #999;
border-right: 4rpx solid #999;
/* 旋轉(zhuǎn)45度 */
transform: rotate(45deg);
/* 調(diào)整位置 */
position: absolute;
right: 30rpx;
top: 38rpx;
}
.userItemListView text{
font-size: 30rpx;
}
.last_view{
background:#f0f0f0;
width: 100%;
height:1200rpx;
}
.orders-wrap {
background-color: #fff;
margin-top: 30rpx;
}
.orders-wrap .orders_title {
padding: 20rpx;
}
.orders-wrap .order_content {
display: flex;
}
.orders-wrap navigator {
padding: 15rpx 0;
flex: 1;
text-align: center;
}
.orders-wrap navigator .iconfont {
color: var(--themeColor);
font-size: 25rpx;
}
.address_wrap {
margin-top: 30rpx;
background-color: #fff;
padding: 20rpx;
}
3、個人主頁(醫(yī)療掛號)
3.1 頁面效果
文章來源:http://www.zghlxwxcb.cn/news/detail-515439.html
3.2 頁面源碼(.wxml)
<!-- 用戶列表選項 -->
<scroll-view class='scbg' scroll-y='true'>
<view class="parent_catainer">
<!-- 頭部 -->
<view class="container_head">
<image class="head_img" src="/images/back01.jpg"></image>
<view class="head_pers_info" bindtap="head_pers_info">
<view class="head_pic">
<image class="head_pic_content" mode="aspectFit" src="/images/zhangmazi.jpg"></image>
</view>
<view class="inf_content">
<text class="user_info">張麻子</text>
<text class="family_info_ct_phone">聯(lián)系電話:1832437281</text>
<text class="family_info_ct">關(guān)聯(lián)賬號:張老師 </text>
</view>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="myappointpage">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的預(yù)約</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="openmyorder">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的訂單</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="myaid">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的幫助</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="myfriend">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的親友</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="mycollection">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>我的收藏</text>
<view class="arrow"></view>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="bind">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>個人資料</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="updatepassword">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>修改密碼</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="aboutus" hidden="true">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>關(guān)于我們</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="logout">
<image class="my_priview" src="/images/mine_fiend.png"></image>
<text>退出登錄</text>
<view class="arrow"></view>
</view>
</view>
<view class="last_view"></view>
</view>
</scroll-view>
3.3 樣式代碼 (.wxss)
/* 用戶列表選項樣式 */
page {
width: 100%;
height: 100%;
background:#f0f0f0;
}
.parent_catainer{
background:#f0f0f0;
}
/* 頭部背景圖片 */
.container_head{
height: 370rpx;
width: 100%;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
.head_img {
position: absolute;
width: 100%;
height: 370rpx;
}
.head_pers_info{
height: 200rpx;
width: 100%;
margin-bottom: 50rpx;
justify-content: left;
display: flex;
align-items: center;
flex-direction: row;
position: absolute;
}
.head_pic{
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background-color: #08cbb0;
color: #ffffff;
align-items: center;
display: flex;
justify-content: center;
}
.head_pic_content{
position: absolute;
width: 110rpx;
height: 110rpx;
border-radius: 55rpx;
background-color: white;
}
.head_pic{
margin-left: 5%;
}
.inf_content{
display: flex;
flex-direction: column;
margin-left: 10rpx;
align-items: flex-start;
justify-content: center;
color: #ffffff;
padding-bottom: 5rpx;
}
.user_info{
text-align: left;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 8rpx;
}
.family_info_ct_phone{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
}
.family_info_ct{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-align: left;
text-overflow: ellipsis;
}
.userItemListView{
background: #fff;
padding: 0 0rpx;
margin: 24rpx 0;
}
.userItemListView > view{
height: 94rpx;
line-height: 94rpx;
padding-left: 50rpx;
border-bottom: 1rpx solid #F1F1F1;
position: relative;
}
/* 移除最后一個元素的下邊框 */
.userItemListView > view:last-child{
border: none;
}
.my_priview_md{
display: flex;
align-items: center;
}
.my_priview{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.arrow{
width: 16rpx;
height: 16rpx;
border-top: 4rpx solid #999;
border-right: 4rpx solid #999;
/* 旋轉(zhuǎn)45度 */
transform: rotate(45deg);
/* 調(diào)整位置 */
position: absolute;
right: 30rpx;
top: 38rpx;
}
.userItemListView text{
font-size: 30rpx;
}
.last_view{
background:#f0f0f0;
width: 100%;
height:1200rpx;
}
4、個人主頁(電影購票系統(tǒng))
4.1 頁面效果
文章來源地址http://www.zghlxwxcb.cn/news/detail-515439.html
4.2 頁面源碼(.wxml)
<scroll-view class='scbg' scroll-y='true'>
<view class="parent_catainer">
<!-- 頭部 -->
<view class="container_head">
<image class="head_img" src="/images/back02.jpg"></image>
<view class="head_pers_info" bindtap="head_pers_info">
<view class="head_pic">
<image class="head_pic_content" mode="aspectFit" src="/images/lisi.jpg"></image>
</view>
<view class="inf_content">
<text class="user_info">蛋糕醬</text>
</view>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="myappointpage">
<text>電影票</text>
<text class="my_priview_right">點(diǎn)擊查看已購電影票</text>
</view>
<view class="my_priview_md" bindtap="openmyorder">
<text>優(yōu)惠券</text>
<text class="my_priview_right">點(diǎn)擊查看優(yōu)惠券</text>
</view>
<view class="my_priview_md" bindtap="myaid">
<text>權(quán)益卡</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="myfriend">
<text>我的小食</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="mycollection">
<text>想看的電影</text>
<view class="arrow"></view>
</view>
</view>
<view class="userItemListView">
<view class="my_priview_md" bindtap="bind">
<text>個人資料</text>
<view class="arrow"></view>
</view>
<view class="my_priview_md" bindtap="updatepassword">
<text>聯(lián)系客服</text>
<text class="my_priview_right">點(diǎn)擊咨詢票小密</text>
</view>
<view class="my_priview_md" bindtap="logout">
<text>退出登錄</text>
<view class="arrow"></view>
</view>
</view>
<view class="last_view"></view>
</view>
</scroll-view>
4.3 樣式代碼 (.wxss)
page {
width: 100%;
height: 100%;
background:#f0f0f0;
}
.parent_catainer{
background:#f0f0f0;
}
/* 頭部背景圖片 */
.container_head{
height: 370rpx;
width: 100%;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
.head_img {
position: absolute;
width: 100%;
height: 370rpx;
}
.head_pers_info{
height: 200rpx;
width: 100%;
margin-bottom: 50rpx;
justify-content: left;
display: flex;
align-items: center;
flex-direction: row;
position: absolute;
}
.head_pic{
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
background-color: #08cbb0;
color: #ffffff;
align-items: center;
display: flex;
justify-content: center;
}
.head_pic_content{
position: absolute;
width: 110rpx;
height: 110rpx;
border-radius: 55rpx;
background-color: white;
}
.head_pic{
margin-left: 5%;
}
.inf_content{
display: flex;
flex-direction: column;
margin-left: 10rpx;
align-items: flex-start;
justify-content: center;
color: #ffffff;
padding-bottom: 5rpx;
}
.user_info{
text-align: left;
font-size: 32rpx;
font-weight: bold;
margin-bottom: 8rpx;
}
.family_info_ct_phone{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
}
.family_info_ct{
text-align: center;
justify-content: center;
font-size: 28rpx;
margin-bottom: 2rpx;
width: 500rpx;
overflow: hidden;
white-space: nowrap;
text-align: left;
text-overflow: ellipsis;
}
.userItemListView{
background: #fff;
padding: 0 0rpx;
margin: 24rpx 0;
}
.userItemListView > view{
height: 94rpx;
line-height: 94rpx;
padding-left: 50rpx;
border-bottom: 1rpx solid #F1F1F1;
position: relative;
}
/* 移除最后一個元素的下邊框 */
.userItemListView > view:last-child{
border: none;
}
.my_priview_md{
display: flex;
align-items: center;
justify-content: space-between;
}
.my_priview_right{
/* 調(diào)整位置 */
position: absolute;
right: 30rpx;
color: #ccc;
}
.my_priview{
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
.arrow{
width: 16rpx;
height: 16rpx;
border-top: 4rpx solid #999;
border-right: 4rpx solid #999;
/* 旋轉(zhuǎn)45度 */
transform: rotate(45deg);
/* 調(diào)整位置 */
position: absolute;
right: 30rpx;
top: 38rpx;
}
.userItemListView text{
font-size: 30rpx;
}
.last_view{
background:#f0f0f0;
width: 100%;
height:1200rpx;
}
到了這里,關(guān)于萬能的微信小程序個人主頁:商城系統(tǒng)個人主頁、外賣系統(tǒng)個人主頁、購票系統(tǒng)個人主頁等等【全部源代碼分享+頁面效果展示+直接復(fù)制粘貼編譯即可】的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!