Commit 987972474c72fbc1e3705207bb2b48dfbd8e0c18

Authored by BigBoss
1 parent 1dbed037e6
Exists in master

订单页card组件提取

1 { 1 {
2 "pages": [ 2 "pages": [
3 {
4 "path": "pages/index/index",
5 "style": {
6 "navigationBarTitleText": "商城一览"
7 // "enablePullDownRefresh":true
8 }
9 },
10 { 3 {
11 "path" : "pages/myOrder/myOrder", 4 "path" : "pages/myOrder/myOrder",
12 "style" : { 5 "style" : {
13 "navigationBarTitleText": "我的订单"} 6 "navigationBarTitleText": "我的订单"}
14 }, 7 },
15 { 8 {
16 "path": "pages/index/index", 9 "path": "pages/index/index",
17 "style": { 10 "style": {
18 "navigationBarTitleText": "商城一览" 11 "navigationBarTitleText": "商城一览"
19 // "enablePullDownRefresh":true 12 // "enablePullDownRefresh":true
20 } 13 }
21 }, 14 },
22 { 15 {
23 "path": "pages/addArddess/addArddess", 16 "path": "pages/addArddess/addArddess",
24 "style": { 17 "style": {
25 "navigationBarTitleText": "新增地址" 18 "navigationBarTitleText": "新增地址"
26 } 19 }
27 }, 20 },
28 { 21 {
29 "path" : "pages/confirmOrder/confirmOrder", 22 "path" : "pages/confirmOrder/confirmOrder",
30 "style" : { 23 "style" : {
31 "navigationBarTitleText": "确认订单"} 24 "navigationBarTitleText": "确认订单"}
32 }, 25 },
33 { 26 {
34 "path": "pages/cart/cart", 27 "path": "pages/cart/cart",
35 "style": { 28 "style": {
36 "navigationBarTitleText": "购物车" 29 "navigationBarTitleText": "购物车"
37 } 30 }
38 }, 31 },
39 { 32 {
40 "path": "pages/user/user", 33 "path": "pages/user/user",
41 "style": { 34 "style": {
42 "navigationBarTitleText": "我的" 35 "navigationBarTitleText": "我的"
43 } 36 }
44 }, 37 },
45 { 38 {
46 "path": "pages/details-3/details-3" 39 "path": "pages/details-3/details-3"
47 }, 40 },
48 { 41 {
49 "path": "pages/detail/detail" 42 "path": "pages/detail/detail"
50 } 43 }
51 ], 44 ],
52 "globalStyle": { 45 "globalStyle": {
53 "navigationBarTextStyle": "black", 46 "navigationBarTextStyle": "black",
54 "navigationBarTitleText": "uni-app", 47 "navigationBarTitleText": "uni-app",
55 "navigationBarBackgroundColor": "#F8F8F8", 48 "navigationBarBackgroundColor": "#F8F8F8",
56 "backgroundColor": "#F8F8F8" 49 "backgroundColor": "#F8F8F8"
57 }, 50 },
58 "tabBar": { 51 "tabBar": {
59 "color": "#C0C4CC", 52 "color": "#C0C4CC",
60 "selectedColor": "#fa436a", 53 "selectedColor": "#fa436a",
61 "borderStyle": "black", 54 "borderStyle": "black",
62 "backgroundColor": "#ffffff", 55 "backgroundColor": "#ffffff",
63 "list": [{ 56 "list": [{
64 "pagePath": "pages/index/index", 57 "pagePath": "pages/index/index",
65 "iconPath": "static/tab-home.png", 58 "iconPath": "static/tab-home.png",
66 "selectedIconPath": "static/tab-home-current.png", 59 "selectedIconPath": "static/tab-home-current.png",
67 "text": "首页" 60 "text": "首页"
68 }, 61 },
69 { 62 {
70 "pagePath": "pages/cart/cart", 63 "pagePath": "pages/cart/cart",
71 "iconPath": "static/tab-cart.png", 64 "iconPath": "static/tab-cart.png",
72 "selectedIconPath": "static/tab-cart-current.png", 65 "selectedIconPath": "static/tab-cart-current.png",
73 "text": "购物车" 66 "text": "购物车"
74 }, 67 },
75 { 68 {
76 "pagePath": "pages/user/user", 69 "pagePath": "pages/user/user",
77 "iconPath": "static/tab-my.png", 70 "iconPath": "static/tab-my.png",
78 "selectedIconPath": "static/tab-my-current.png", 71 "selectedIconPath": "static/tab-my-current.png",
79 "text": "我的" 72 "text": "我的"
80 } 73 }
81 ] 74 ]
82 } 75 }
83 } 76 }
84 77
src/pages/myOrder/myOrder.vue
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
3 <view class="header"> 3 <view class="header">
4 <!-- 搜索--> 4 <!-- 搜索-->
5 <view class="searchBar"> 5 <view class="searchBar">
6 <icon class="searchIcon" type="search" size="14"></icon> 6 <icon class="searchIcon" type="search" size="14"></icon>
7 <input class="searchIpt" placeholder="老花镜" confirm-type="search"/> 7 <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search"/>
8 </view>
9 <view class="screenBar">
10 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)" >
11 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view>
12 </view>
8 </view> 13 </view>
9
10 </view> 14 </view>
15 <OrderCard></OrderCard>
11 16
12 </view> 17 </view>
13 </template> 18 </template>
14 19
15 <script> 20 <script>
16 export default { 21 import OrderCard from './OrderCard.vue'
22 export default {
23 components:{
24 'OrderCard':OrderCard
25 },
17 data() { 26 data() {
18 return { 27 return {
28 screenItems: [
29 {current:0,text:'全部'},
30 {current:1,text:'待付款'},
31 {current:2,text:'待发货'},
32 {current:3,text:'待收货'},
33 {current:4,text:'退款售后'},
34 ],
35 current: 0,
19 36
20 }; 37 };
38 },
39 methods:{
40 onClickItem(e) {
41 if (this.current !== e) {
42 this.current = e;
43 }
44 }
21 } 45 }
22 } 46 }
23 </script> 47 </script>
24 48
25 <style lang="scss"> 49 <style lang="scss">
26 .content { 50 .content {
27 display: flex; 51 display: flex;
28 flex-direction: column; 52 flex-direction: column;
29 align-items: center; 53 align-items: center;
30 background-color: #F7F6F6; 54 background-color: #F7F6F6;
31 height: 100vh; 55 height: 100vh;
32 } 56 }
33 .header{ 57 .header{
34 background-color: #ffffff; 58 background-color: #ffffff;
35 width: 100%; 59 width: 100%;
36 height: 232rpx; 60 height: 232rpx;
37 padding: 40rpx 40rpx 36rpx 40rpx; 61 padding: 40rpx 40rpx 36rpx 40rpx;
38 box-sizing: border-box; 62 box-sizing: border-box;
39 .searchBar { 63 .searchBar {
40 width: 670rpx; 64 width: 670rpx;
41 display: flex; 65 display: flex;
42 justify-content: center; 66 justify-content: center;
43 align-items: center; 67 align-items: center;
44 box-sizing: border-box; 68 box-sizing: border-box;
45 padding: 0rpx 16rpx; 69 padding: 0rpx 16rpx;
46 border: 1px solid #FF6B4A; 70 border: 1px solid #FF6B4A;
47 border-radius: 8rpx; 71 border-radius: 8rpx;
48 background-color: #ffffff; 72 background-color: #ffffff;
49 } 73 }
50 74
75 .screenBar{
76 width: 670rpx;
77 height: 110rpx;
78 display: flex;
79 flex-direction: row;
80 justify-content: space-between;
81 align-items: center;
82 color: #333333;
83 font-size: 32rpx;
84 }
85 .screenItem{
86 height: 50rpx;
87 font-size: 32rpx;
88 color: #333333;
89 display: flex;
90 justify-content: center;
91 align-items: center;
92 transition:all 0.2s;
93 }
94 .active{
95 // font-size: 34rpx;
96 color: #EC5D3B;
97 }
51 .searchIpt { 98 .searchIpt {
52 height: 68rpx; 99 height: 68rpx;
53 width: 670rpx; 100 width: 670rpx;
54 padding: 16rpx; 101 padding: 16rpx;
55 font-size: 28rpx; 102 font-size: 28rpx;
56 box-sizing: border-box; 103 box-sizing: border-box;
57 } 104 }
58 } 105 }
59 </style> 106 </style>
src/pages/myOrder/orderCard.vue
1 <template> 1 <template>
2 <view> 2 <view class="card">
3 3
4 </view> 4 </view>
5 </template> 5 </template>
6 6
7 <script> 7 <script>
8 export default { 8 export default {
9 data() { 9 data() {
10 return { 10 return {
11 11
12 }; 12 };
13 } 13 }
14 } 14 }
15 </script> 15 </script>
16 16
17 <style lang="scss"> 17 <style lang="scss">
18 18 .card{
19 width: 670rpx;
20 height: 478rpx;
21 background: #FFFFFF;
22 box-shadow: 0 0 10px 0 rgba(177,128,128,0.06);
23 border-radius: 8px;
24 border-radius: 8px;
25 margin-top: 20rpx;
26 }
19 </style> 27 </style>
20 28