Commit 46e5b6c99cd4fb905690df17e7b9858844ac2be2

Authored by BigBoss
1 parent 987972474c
Exists in master

add myOrder

1 { 1 {
2 "pages": [ 2 "pages": [
3 {
4 "path" : "pages/myOrder/myOrder",
5 "style" : {
6 "navigationBarTitleText": "我的订单"}
7 },
8 { 3 {
9 "path": "pages/index/index", 4 "path": "pages/index/index",
10 "style": { 5 "style": {
11 "navigationBarTitleText": "商城一览" 6 "navigationBarTitleText": "商城一览"
12 // "enablePullDownRefresh":true 7 // "enablePullDownRefresh":true
13 } 8 }
14 }, 9 },
10 {
11 "path" : "pages/myOrder/myOrder",
12 "style" : {
13 "navigationBarTitleText": "我的订单"}
14 },
15 { 15 {
16 "path": "pages/addArddess/addArddess", 16 "path": "pages/addArddess/addArddess",
17 "style": { 17 "style": {
18 "navigationBarTitleText": "新增地址" 18 "navigationBarTitleText": "新增地址"
19 } 19 }
20 }, 20 },
21 { 21 {
22 "path" : "pages/confirmOrder/confirmOrder", 22 "path" : "pages/confirmOrder/confirmOrder",
23 "style" : { 23 "style" : {
24 "navigationBarTitleText": "确认订单"} 24 "navigationBarTitleText": "确认订单"}
25 }, 25 },
26 { 26 {
27 "path": "pages/cart/cart", 27 "path": "pages/cart/cart",
28 "style": { 28 "style": {
29 "navigationBarTitleText": "购物车" 29 "navigationBarTitleText": "购物车"
30 } 30 }
31 }, 31 },
32 { 32 {
33 "path": "pages/user/user", 33 "path": "pages/user/user",
34 "style": { 34 "style": {
35 "navigationBarTitleText": "我的" 35 "navigationBarTitleText": "我的"
36 } 36 }
37 }, 37 },
38 { 38 {
39 "path": "pages/details-3/details-3" 39 "path": "pages/details-3/details-3"
40 }, 40 },
41 { 41 {
42 "path": "pages/detail/detail" 42 "path": "pages/detail/detail"
43 } 43 }
44 ], 44 ],
45 "globalStyle": { 45 "globalStyle": {
46 "navigationBarTextStyle": "black", 46 "navigationBarTextStyle": "black",
47 "navigationBarTitleText": "uni-app", 47 "navigationBarTitleText": "uni-app",
48 "navigationBarBackgroundColor": "#F8F8F8", 48 "navigationBarBackgroundColor": "#F8F8F8",
49 "backgroundColor": "#F8F8F8" 49 "backgroundColor": "#F8F8F8"
50 }, 50 },
51 "tabBar": { 51 "tabBar": {
52 "color": "#C0C4CC", 52 "color": "#C0C4CC",
53 "selectedColor": "#fa436a", 53 "selectedColor": "#fa436a",
54 "borderStyle": "black", 54 "borderStyle": "black",
55 "backgroundColor": "#ffffff", 55 "backgroundColor": "#ffffff",
56 "list": [{ 56 "list": [{
57 "pagePath": "pages/index/index", 57 "pagePath": "pages/index/index",
58 "iconPath": "static/tab-home.png", 58 "iconPath": "static/tab-home.png",
59 "selectedIconPath": "static/tab-home-current.png", 59 "selectedIconPath": "static/tab-home-current.png",
60 "text": "首页" 60 "text": "首页"
61 }, 61 },
62 { 62 {
63 "pagePath": "pages/cart/cart", 63 "pagePath": "pages/cart/cart",
64 "iconPath": "static/tab-cart.png", 64 "iconPath": "static/tab-cart.png",
65 "selectedIconPath": "static/tab-cart-current.png", 65 "selectedIconPath": "static/tab-cart-current.png",
66 "text": "购物车" 66 "text": "购物车"
67 }, 67 },
68 { 68 {
69 "pagePath": "pages/user/user", 69 "pagePath": "pages/user/user",
70 "iconPath": "static/tab-my.png", 70 "iconPath": "static/tab-my.png",
71 "selectedIconPath": "static/tab-my-current.png", 71 "selectedIconPath": "static/tab-my-current.png",
72 "text": "我的" 72 "text": "我的"
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> 8 </view>
9 <view class="screenBar"> 9 <view class="screenBar">
10 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)" > 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> 11 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view>
12 </view> 12 </view>
13 </view> 13 </view>
14 </view> 14 </view>
15 <OrderCard></OrderCard> 15 <view class="orderList" >
16 16 <view v-for="(order) in orderList" :key="orderId">
17 <OrderCard :order = "order" :current="current"></OrderCard>
18 </view>
19 </view>
20 <view class="footer">已显示全部</view>
17 </view> 21 </view>
18 </template> 22 </template>
19 23
20 <script> 24 <script>
21 import OrderCard from './OrderCard.vue' 25 import OrderCard from './OrderCard.vue'
22 export default { 26 export default {
23 components:{ 27 components:{
24 'OrderCard':OrderCard 28 'OrderCard':OrderCard
25 }, 29 },
26 data() { 30 data() {
27 return { 31 return {
28 screenItems: [ 32 screenItems: [
29 {current:0,text:'全部'}, 33 {current:0,text:'全部'},
30 {current:1,text:'待付款'}, 34 {current:1,text:'待付款'},
31 {current:2,text:'待发货'}, 35 {current:2,text:'待发货'},
32 {current:3,text:'待收货'}, 36 {current:3,text:'待收货'},
33 {current:4,text:'退款售后'}, 37 {current:4,text:'退款售后'},
34 ], 38 ],
35 current: 0, 39 current: 0,
36 40 //订单数据
41 orderList:[
42 { orderId: 0, img: '/static/img/goods/p1.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1},
43 { orderId: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1},
44 { orderId: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:2 ,buyNum:1},
45 { orderId: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1},
46 { orderId: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1},
47 { orderId: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1},
48 { orderId: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1},
49 { orderId: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1},
50 { orderId: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1}
51 ],
37 }; 52 };
38 }, 53 },
39 methods:{ 54 methods:{
40 onClickItem(e) { 55 onClickItem(e) {
41 if (this.current !== e) { 56 if (this.current !== e) {
42 this.current = e; 57 this.current = e;
43 } 58 }
44 } 59 }
45 } 60 }
46 } 61 }
47 </script> 62 </script>
48 63
49 <style lang="scss"> 64 <style lang="scss">
50 .content { 65 .content {
51 display: flex; 66 display: flex;
52 flex-direction: column; 67 flex-direction: column;
53 align-items: center; 68 align-items: center;
54 background-color: #F7F6F6; 69 background-color: #F7F6F6;
55 height: 100vh; 70 min-height: 100vh;
56 } 71 .header{
57 .header{
58 background-color: #ffffff;
59 width: 100%;
60 height: 232rpx;
61 padding: 40rpx 40rpx 36rpx 40rpx;
62 box-sizing: border-box;
63 .searchBar {
64 width: 670rpx;
65 display: flex;
66 justify-content: center;
67 align-items: center;
68 box-sizing: border-box;
69 padding: 0rpx 16rpx;
70 border: 1px solid #FF6B4A;
71 border-radius: 8rpx;
72 background-color: #ffffff; 72 background-color: #ffffff;
73 width: 100%;
74 height: 232rpx;
75 padding: 40rpx 40rpx 36rpx 40rpx;
76 box-sizing: border-box;
77 position: fixed;
78 top: 0;
79 left: 0;
80 .searchBar {
81 width: 670rpx;
82 display: flex;
83 justify-content: center;
84 align-items: center;
85 box-sizing: border-box;
86 padding: 0rpx 16rpx;
87 border: 1px solid #FF6B4A;
88 border-radius: 8rpx;
89 background-color: #ffffff;
90 }
91
92 .screenBar{
93 width: 670rpx;
94 height: 110rpx;
95 display: flex;
96 flex-direction: row;
97 justify-content: space-between;
98 align-items: center;
99 color: #333333;
100 font-size: 32rpx;
101 }
102 .screenItem{
103 height: 50rpx;
104 font-size: 32rpx;
105 color: #333333;
106 display: flex;
107 justify-content: center;
108 align-items: center;
109 transition:all 0.2s;
110 }
111 .active{
112 // font-size: 34rpx;
113 color: #EC5D3B;
114 }
115 .searchIpt {
116 height: 68rpx;
117 width: 670rpx;
118 padding: 16rpx;
src/pages/myOrder/orderCard.vue
1 <template> 1 <template>
2 <view class="card"> 2 <view>
3 3 <view class="card" v-if="current === order.orderType" >
4 <view class="cardHeader">
5 <text class="orderId">订单号:{{order.orderId}}</text>
6 <text class="orderType" v-if="order.orderType===1">待付款</text>
7 <text class="orderType" v-if="order.orderType===2">待发货</text>
8 <text class="orderType" v-if="order.orderType === 3">待收货</text>
9 <text class="orderType" v-if="order.orderType === 4">退款售后</text>
10 <text class="orderType" v-if="order.orderType === 5">已完成</text>
11 </view>
12 <view class="orderCardInfo">
13 <image :src="order.img" mode="aspectFill"></image>
14 <view class="infoText">
15 <view class="orderName">{{order.name}}</view>
16 <view class="orderDescrib">规格:玫瑰金 / 钛合金 / 防日光防紫外线</view>
17 <view class="infoText-bottom">
18 <view class="markPrice">{{order.price}}</view>
19 <view class="buy-num">X{{order.buyNum}}</view>
20 </view>
21 </view>
22 </view>
23 <view class="payPrice">实付:<text class="priceNum">{{order.price}}</text> </view>
24 <view class="btns" v-if="order.orderType === 1">
25 <view class="btn-type1">申请退款</view>
26 <view class="btn-type2">去支付</view>
27 </view>
28 <view class="btns" v-if="order.orderType === 0">
29 <view class="btn-type1">再次购买</view>
30 </view>
31 </view>
32 <view class="card" v-if="current === 0" >
33 <view class="cardHeader">
34 <text class="orderId">订单号:{{order.orderId}}</text>
35 <text class="orderType" v-if="order.orderType===1">待付款</text>
36 <text class="orderType" v-if="order.orderType===2">待发货</text>
37 <text class="orderType" v-if="order.orderType === 3">待收货</text>
38 <text class="orderType" v-if="order.orderType === 4">退款售后</text>
39 </view>
40 <view class="orderCardInfo">
41 <image :src="order.img" mode="aspectFill"></image>
42 <view class="infoText">
43 <view class="orderName">{{order.name}}</view>
44 <view class="orderDescrib">规格:玫瑰金 / 钛合金 / 防日光防紫外线</view>
45 <view class="infoText-bottom">
46 <view class="markPrice">{{order.price}}</view>
47 <view class="buy-num">X{{order.buyNum}}</view>
48 </view>
49 </view>
50 </view>
51 <view class="payPrice">实付:<text class="priceNum">{{order.price}}</text> </view>
52 <view class="btns" v-if="order.orderType === 1">
53 <view class="btn-type1">申请退款</view>
54 <view class="btn-type2">去支付</view>
55 </view>
56 <view class="btns" v-if="order.orderType === 0">
57 <view class="btn-type1">再次购买</view>
58 </view>
59 </view>
4 </view> 60 </view>
5 </template> 61 </template>
6 62
7 <script> 63 <script>
8 export default { 64 export default {
65 props: {
66 /**
67 * 订单数据
68 */
69 order: {
70 orderId: Number,
71 img: String,
72 name: String,
73 originCost:String,
74 price: String,
75 orderType:Number,
76 buyNum:Number
77 },
78 /**
79 * 当前选择
80 */
81 current:Number
82
83 },
9 data() { 84 data() {
10 return { 85 return {
11
12 }; 86 };
13 } 87 }
14 } 88 }
15 </script> 89 </script>
16 90
17 <style lang="scss"> 91 <style lang="scss">
18 .card{ 92 .card{
19 width: 670rpx; 93 width: 670rpx;
20 height: 478rpx; 94 height: 478rpx;
21 background: #FFFFFF; 95 background: #FFFFFF;
22 box-shadow: 0 0 10px 0 rgba(177,128,128,0.06); 96 box-shadow: 0 0 10px 0 rgba(177,128,128,0.06);
23 border-radius: 8px; 97 border-radius: 8px;
24 border-radius: 8px; 98 border-radius: 8px;
25 margin-top: 20rpx; 99 margin-top: 20rpx;
100 padding: 40rpx;
101 box-sizing: border-box;
102 .cardHeader{
103 width: 100%;
104 height: 40rpx;
105 display: flex;
106 justify-content: space-between;
107 align-items: center;
108 .orderId{
109 font-size: 12px;
110 color: #999999;
111 }
112 .orderType{
113 font-size: 14px;
114 color: #FF6B4A;
115 }
116 }
117 .orderCardInfo{
118 width: 100%;
119 height: 188rpx;
120 display: flex;
121 flex-direction: row;
122 justify-content: space-between;
123 align-items: center;
124 margin-top: 40rpx;
125 image{
126 height: 188rpx;
127 width: 188rpx;
128 margin-right: 24rpx;
129 }
130 .infoText{
131 display: flex;
132 flex-direction: column;
133 justify-content: space-between;
134 align-items: flex-start;
135 height: 188rpx;
136 }
137 .orderName{
138 font-size: 14px;
139 color: #333333;
140 }
141 .orderDescrib{
142 font-size: 12px;
143 color: #999999;
144 }
145 .infoText-bottom{
146 display: flex;
147 flex-direction: row;
148 justify-content: space-between;
149 align-items: center;
150 width: 100%;
151 .markPrice{
152 font-size: 14px;
153 color: #FF6B4A;
154 }
155 .buy-num{
156 font-size: 12px;
157 color: #999999;
158 }
159 }
160 }
161 .payPrice{
162 text-align: right;
163 margin: 20rpx 0;
164 font-size: 14px;
165 color: #333333;
166 .priceNum{
167 font-size: 14px;
168 color: #FF6B4A;
169 }
170 }
171 .btns{
172 display: flex;
173 justify-content: flex-end;
174 align-items: center;
175 .btn-type1{
176 height: 48rpx;
177 width: 156rpx;
178 border: 1px solid #FF6B4A;
179 border-radius: 12px;
180 border-radius: 12px;
181 text-align: center;
182 line-height: 48rpx;
183 font-size: 12px;
184 color: #FF6B4A;
185 }
186 .btn-type2{
187 height: 48rpx;
188 width: 140rpx;
189 background: #FF6B4A;
190 border-radius: 12px;
191 border-radius: 12px;
192 text-align: center;
193 line-height: 48rpx;
194 font-size: 12px;
195 color: #FFFFFF;
196 margin-left: 20rpx;
197 }
198 }
26 } 199 }
27 </style> 200 </style>