前面的章節講了很多關于頁面 布局 的知識。
現在來看看其他欄目,我的訂單頁面。
1 頁面樣式圖
基本的樣式包含shop頁面 我的訂單
點擊我的訂單,跳轉到訂單頁面
點擊訂單的每一條訂單,跳轉到訂單詳情
2、創建訂單頁面
2.1 創建sub頁面文件夾,創建shop頁面的子文件夾
2.2 創建order 訂單頁面文件夾
2.3 創建order 頁面? 訂單詳情頁面?? detail
3、shop 中的? 我的訂單? 處理
使用?navigator? 跳轉到 訂單頁面
<navigator class="right" url="/pagesub/pageshop/order/order">
??????????????????? <!-- 使用的uview 的圖標? 其實可以用? uniapp 或者iconfont的 -->
??????????????????? <u-icon name="order" color="#FABE50" size="24"></u-icon>
??????????????????? 我的訂單
?</navigator>
4、訂單頁面order 代碼以及樣式
<template><view class="orderPage"><!-- 我的訂單 --><view class="row" v-for="item,index in 5" :key="index" @click="goDetail(item)"><view class="head"><view class="number" v-if="true">編號123456<text class="way">商家外送</text></view><text class="way self" v-else>到店自提</text><view class="state"> <u-icon name="weixin-fill" size="22" color="#04C15F"></u-icon><text>已支付</text> </view> </view><view class="body">衛龍大面筋</view><view class="footer"><view class="time">2023-06-10 18:20</view><view class="count">共2件商品 ,實付<text class="price">¥33.3</text></view></view></view></view>
</template><script>export default {data() {return {};},methods:{//跳轉到詳情頁,后期可以轉成字符串來進行傳輸 但是也可以是存到緩存,用完后直接刪除緩存goDetail(value){uni.navigateTo({url:"/pagesub/pageshop/order/detail?item="+value})}}}
</script><style lang="scss">
page{background: $page-bg-color;
}
.orderPage{padding:30rpx;.row{background: #fff;padding:40rpx 20rpx;border-radius: 20rpx;margin-bottom:30rpx;.head{@include flex-box();font-size:32rpx; .number{@include flex-box-set(start);.way{background: #19be6b;color:#fff;font-size: 22rpx;padding:6rpx 20rpx;border-radius: 30rpx;margin-left: 10rpx;&.self{background: #FF9100;}}}.state{color:$brand-theme-color-aux;@include flex-box-set(start);}}.body{border:1px solid $border-color;padding:60rpx 20rpx;border-radius: 10rpx;background: #F9F9F9;font-size: 34rpx;margin:30px 0;}.footer{@include flex-box();font-size: 26rpx;color:#a5a5a5;.price{font-weight: bold;color:#000;}}}
}
</style>
4.1? 主要包含 多個訂單,每一個訂單包含不同部分 頭部 中部? 尾部
4.2 點擊每一條 跳轉到訂單詳情
gotodetail
4.3 每一部分? 看格局?
共有 三部分? 具體可以看看代碼