21-微信小程序商城 會員首頁(微信小程序商城開發、小程序畢業設計、小程序源代碼)(黃菊華-微信小程
發表時(shí)間:2020-11-17
發布人(rén):融晨科技
浏覽次數:88
本章主要(yào / yāo)講解會員相關功能的(de)界面實戰。包含:會員首頁界面、我的(de)訂單頁面,收貨地(dì / de)址管理、新增、修改頁面、我的(de)收藏頁面、常見問題頁面、聯系客服頁面等。
本章節不(bù)在(zài)分析界面的(de)層級了(le/liǎo),大(dà)家可以(yǐ)根據示意圖分析,然後結合給出(chū)的(de)示例代碼對比實戰。
會員首頁
本節主要(yào / yāo)講解會員首頁界面的(de)實現。效果如圖15-1所示
1.布局分析
結構布局分析示意如圖15-2所示。
根據上(shàng)面的(de)布局分析,我們會産生基礎的(de)框架,代碼示例如下:
<view>
<image></image>
<view >
<text>用戶昵稱</text>
<text>等級:普通會員</text>
<text>手機:【綁定手機号碼】</text>
</view>
</view>
<navigator >
<view>
<image></image>
<text>我的(de)訂單</text>
<image ></image>
</view>
</navigator>
2.功能實現
.wxml文件代碼示例如下:
<view class='toubu'>
<image class="toubu-img" src="{{userInfo.avatarUrl}}" background-size="cover"></image>
<view class='two-line-text'>
<text class='txt1'>{{userInfo.nickName}}</text>
<text class="txt2">等級:普通會員</text>
<text class="txt3">手機:【綁定手機号碼】</text>
</view>
</view>
<navigator url='/pages/huiyuan/order/order_list2'>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys01.png"></image>
<text class="wx-cell-text">我的(de)訂單</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
</navigator>
<navigator url='/pages/huiyuan/addr/index'>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys02.png"></image>
<text class="wx-cell-text">收貨地(dì / de)址管理</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
</navigator>
<navigator url='/pages/huiyuan/qita/01-shoucang'>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys03.png"></image>
<text class="wx-cell-text">我的(de)收藏</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
</navigator>
<navigator url='/pages/huiyuan/qita/02-wenti'>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys06.png"></image>
<text class="wx-cell-text">常見問題</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
</navigator>
<navigator url='/pages/huiyuan/qita/03-kefu'>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys05.png"></image>
<text class="wx-cell-text">聯系客服</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
</navigator>
<view class="wx-cell">
<image class="wx-cell-icon" src="/images/sys04.png"></image>
<text class="wx-cell-text">退出(chū)登錄</text>
<image class="wx-cell-arrow" src="/images/right.png"></image>
</view>
.wxss文件樣式代碼示例如下:
/*頭部樣式*/
.toubu{
display: flex;
margin: 1rpx;
border: #ddd solid 1px;
padding: 10rpx;
background-color: crimson;
}
.toubu-img{
width: 80px;
height: 80px;
margin: 20rpx;
border-radius: 50%;
}
.two-line-text{
padding: 3px;
display: flex;
flex-direction: column;
}
.txt1{
margin: 3px 3px;
font-size: 16px;
font-weight: bold;
white-space: nowrap; color: white;
}
.txt2{
margin: 5px 3px 5px;
font-size: 14px;
color: white;
white-space: nowrap; background-color: darkorange;
}
.txt3{
margin: 3px 3px;
font-size: 15px;
color: white;
white-space: nowrap;
}
/*會員首頁菜單樣式*/
.wx-cell {
width: 100%;
margin-top: 15rpx;
font-size: 34rpx;
border-top: 1rpx solid #d9d9d9;
border-bottom: 1rpx solid #d9d9d9;
background-color: #fff;
padding: 20rpx 25rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.wx-cell-icon{
width: 56rpx;
height: 56rpx;
}
.wx-cell-text{
flex: 1;
margin-left: 30rpx;
}
.wx-cell-arrow{
width: 30rpx;
height: 30rpx;
margin-right:30rpx;
}
小程序商城配備了(le/liǎo)javaweb、php、asp、net幾個(gè)版本的(de)後台、其他(tā)版本陸續制作中
【微信小程序參考資料】
(1)微信小程序學習路線 http://www.hzyaoyi.cn/
(2)Java微信小程序商城系統指導 https://ke.qq.com/course/3066521
(3)PHP微信小程序商城系統指導 https://ke.qq.com/course/3066518
(4)微信官方文檔 https://developers.weixin.qq.com/miniprogram/dev/framework/