From 544a74f4d1450e67e9392a10ddefa13a14848650 Mon Sep 17 00:00:00 2001 From: GuoQiYu <2478948023@qq.com> Date: Mon, 5 Apr 2021 21:09:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=82=B9=E9=A4=90=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HeadBar.vue | 4 + src/router/modules/orderConfirm.js | 1 + src/views/Index/Index.vue | 57 +++++- src/views/Index/Order.vue | 223 +++++++++++++++++++++--- src/views/OrderConfirm/OrderConfirm.vue | 61 ++++++- 5 files changed, 309 insertions(+), 37 deletions(-) diff --git a/src/components/HeadBar.vue b/src/components/HeadBar.vue index 61ec821..c4e1a9f 100644 --- a/src/components/HeadBar.vue +++ b/src/components/HeadBar.vue @@ -20,6 +20,10 @@ export default { "/coupon":"优惠券", "/order":"扫码订餐", "/waitindex":"排队取号", + "/orderconfirm":"确认订单", + "/payfailed":"支付结果", + "/paysuccess":"支付结果", + "/selectcoupons":"优惠券", } } }, diff --git a/src/router/modules/orderConfirm.js b/src/router/modules/orderConfirm.js index 0a370d2..7b889c6 100644 --- a/src/router/modules/orderConfirm.js +++ b/src/router/modules/orderConfirm.js @@ -7,6 +7,7 @@ import SelectCoupons from "@/views/OrderConfirm/SelectCoupons.vue" export default [ { path:"/orderconfirm", + name:"orderconfirm", component:OrderConfirm }, { diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index 2a8b3e7..3b0deae 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -48,8 +48,9 @@ + + \ No newline at end of file -- Gitee From e31501cac70151d4ed7a8213ccc3c5c3f512b137 Mon Sep 17 00:00:00 2001 From: GuoQiYu <2478948023@qq.com> Date: Thu, 8 Apr 2021 21:23:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Coupon.vue | 69 +++++ src/views/Center/MyOrder/MyOrders.vue | 103 +++++++- src/views/Index/Coupon.vue | 93 ++++++- src/views/OrderConfirm/OrderConfirm.vue | 305 ++++++++++++++++++++++- src/views/OrderConfirm/SelectCoupons.vue | 138 +++++----- 5 files changed, 628 insertions(+), 80 deletions(-) create mode 100644 src/components/Coupon.vue diff --git a/src/components/Coupon.vue b/src/components/Coupon.vue new file mode 100644 index 0000000..0e8dd00 --- /dev/null +++ b/src/components/Coupon.vue @@ -0,0 +1,69 @@ + + + + \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrders.vue b/src/views/Center/MyOrder/MyOrders.vue index 4324298..f50b5de 100644 --- a/src/views/Center/MyOrder/MyOrders.vue +++ b/src/views/Center/MyOrder/MyOrders.vue @@ -1,5 +1,102 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/Index/Coupon.vue b/src/views/Index/Coupon.vue index 32f7efa..759a6d2 100644 --- a/src/views/Index/Coupon.vue +++ b/src/views/Index/Coupon.vue @@ -1,6 +1,91 @@ \ No newline at end of file + + + + \ No newline at end of file diff --git a/src/views/OrderConfirm/OrderConfirm.vue b/src/views/OrderConfirm/OrderConfirm.vue index 044165b..db48aa0 100644 --- a/src/views/OrderConfirm/OrderConfirm.vue +++ b/src/views/OrderConfirm/OrderConfirm.vue @@ -80,6 +80,307 @@ import Vue from 'vue'; import { Cell,Card,Field,CellGroup } from 'vant'; +let a= +{ +"data":{ +"orderList":[ + { + orderId:111, + orderSrate:"cancelled", + FoodList:[ + { + "foodId": 239311883, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/7aab6d5b1b198d49e541d91d82f5e87c19616.jpg", + "foodName": "薯霸王Plus", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1500, + "foodPrice": 97, + "oldPrice": "116", + "foodDisCount": "5.6折" + }, + { + "foodId": 141363074, + "foodClass": "汉堡包", + "imgSrc": "http://p1.meituan.net/bbia/9ac880bae387bff7e83bb7907c55f2ac752204.jpg", + "foodName": "火烤菠萝皇堡(牛)", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 2800, + "foodPrice": 71, + "oldPrice": "85", + "foodDisCount": "5.6折" + }, + { + "foodId": 7350105, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/25f6c49d02defdb164a08e38fa940e9e29929.jpg", + "foodName": "炫辣鸡腿堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1700, + "foodPrice": 57, + "oldPrice": "68", + "foodDisCount": "5.6折" + } + ] + + }, + { + orderId:222, + orderSrate:"cancelled", + FoodList:[ + { + "foodId": 193402299, + "foodClass": "鸡肉卷", + "imgSrc": "http://p0.meituan.net/xianfu/f2aee933cfcc175fd0fb170b2f16709e40738.jpg", + "foodName": "缤纷小食袋", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 10200, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + }, + { + "foodId": 183960254, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/d5c14b31a7850a356c4e642ce8f51f7334202.jpg", + "foodName": "又又成双烤鸡堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 2800, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + }, + { + "foodId": 104918887, + "foodClass": "鸡肉卷", + "imgSrc": "http://p1.meituan.net/dealwatera/f7adeca3bb6f7f81a26383cf4115619f57115.jpg", + "foodName": "花样霸王鸡条", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1300, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + } + ] + + }, + { + orderId:333, + orderSrate:"cancelled", + FoodList:[ + { + "foodId": 218993601, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/ac511465b93cb84f66888e5b781e48cb63956.png", + "foodName": "双层香脆鸡排堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 2100, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + }, + { + "foodId": 213174827, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/fe4e52785d2523c4d8710a52262bfc9230520.jpg", + "foodName": "超值美式鸡排堡堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1300, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + } + ] + + }, + + { + orderId:444, + orderSrate:"complated", + FoodList:[ + { + "foodId": 239311883, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/7aab6d5b1b198d49e541d91d82f5e87c19616.jpg", + "foodName": "薯霸王Plus", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1500, + "foodPrice": 97, + "oldPrice": "116", + "foodDisCount": "5.6折" + }, + { + "foodId": 141363074, + "foodClass": "汉堡包", + "imgSrc": "http://p1.meituan.net/bbia/9ac880bae387bff7e83bb7907c55f2ac752204.jpg", + "foodName": "火烤菠萝皇堡(牛)", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 2800, + "foodPrice": 71, + "oldPrice": "85", + "foodDisCount": "5.6折" + }, + { + "foodId": 7350105, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/25f6c49d02defdb164a08e38fa940e9e29929.jpg", + "foodName": "炫辣鸡腿堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1700, + "foodPrice": 57, + "oldPrice": "68", + "foodDisCount": "5.6折" + } + ] + + }, + { + orderId:555, + orderSrate:"complated", + FoodList:[ + { + "foodId": 85978033, + "foodClass": "汉堡包", + "imgSrc": "http://p1.meituan.net/xianfu/2eece260338a52a3eeb782dd2812e7fb27248.jpg", + "foodName": "德克萨斯烟熏鸡堡套餐", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 0, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 220036561, + "foodClass": "汉堡包", + "imgSrc": "", + "foodName": "2层芝士牛肉堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 0, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 415374905, + "foodClass": "汉堡包", + "imgSrc": "https://p0.meituan.net/biztone/2d2d02e5a7bacdaa025f3cae9e0da1191468668.jpg", + "foodName": "黑椒眼肉牛排堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 0, + "foodPrice": 2, + "oldPrice": "2", + "foodDisCount": "5.6折" + } + ] + + }, + + { + orderId:666, + orderSrate:"topay", + FoodList:[ + { + "foodId": 168932299, + "foodClass": "汉堡包", + "imgSrc": "http://p1.meituan.net/dealwatera/f5b3007765933652d0ce5d5bc4cd230c130788.jpg", + "foodName": "黑芝麻熔岩黑巧克力蛋糕", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1500, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 151571669, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/4d06a542ab8d83e46f9631f9eaada51d204216.png", + "foodName": "双层藤椒鸡排堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 2100, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 150899189, + "foodClass": "饮品", + "imgSrc": "http://p1.meituan.net/deal/2efe6999b11c4070aeebe4ebde670c7c126376.jpg", + "foodName": "大果粒草莓新地", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1200, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + } + ] + + }, + { + orderId:777, + orderSrate:"topay", + FoodList:[ + { + "foodId": 8182883, + "foodClass": "汉堡包", + "imgSrc": "http://qcloud.dpfile.com/pc/64BQ7nPs94OKCphNJxXYpQljuknXEWJNMT0fPHd8rjMHrdQHLlU7RQ5A5N84EFR0ZSUjBikR5Ecy-DoGYkMhlg.jpg", + "foodName": "中薯", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 1100, + "foodPrice": 9, + "oldPrice": "11", + "foodDisCount": "5.6折" + }, + { + "foodId": 136798990, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/bbia/d54cfe0f20dfb88c56ea4e7520673e0c1832230.jpg", + "foodName": "双层泡椒鸡排堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 900, + "foodPrice": 7, + "oldPrice": "8", + "foodDisCount": "5.6折" + }, + { + "foodId": 416302008, + "foodClass": "汉堡包", + "imgSrc": "http://qcloud.dpfile.com/pc/SMDE6gN80sKzpEiWeoIAm48qiH3KVZCQPFtA2mxZzBk13qVMrTP15Z4nUwKytNZYZSUjBikR5Ecy-DoGYkMhlg.jpg", + "foodName": "黑椒培根皇堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 0, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 244045820, + "foodClass": "汉堡包", + "imgSrc": "http://p1.meituan.net/xianfu/2ef56ccdf25a003610c83fc8785f1732196230.png", + "foodName": "奶油蘑菇芝士厚牛堡", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 3900, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + }, + { + "foodId": 244043074, + "foodClass": "汉堡包", + "imgSrc": "http://p0.meituan.net/xianfu/3882a43edff90836687c2765fbaad741164277.png", + "foodName": "菠萝很芒派", + "foodTag": ["香辣", "面包片", "生菜"], + "saleNum": 700, + "foodPrice": 3, + "oldPrice": "4", + "foodDisCount": "5.6折" + } + ] + + }, +] +} +} + Vue.use(Cell); Vue.use(Card); Vue.use(Field); @@ -120,10 +421,10 @@ export default { }, created(){ // 接收路由传递的订单列表信息 - this.orderList=this.$route.params.orderList?this.$route.params.orderList:[] + this.orderList=this.$route.params.orderList?this.$route.params.orderList:this.$store.state.orderList this.couponDiscount=this.$route.query.discount?this.$route.query.discount:0; - this.$store.commit("setOrderList",this.orderList ); + this.$store.commit("setOrderList",this.orderList); // 计算总优惠 this.totalDiscount=Number(this.couponDiscount)+15 diff --git a/src/views/OrderConfirm/SelectCoupons.vue b/src/views/OrderConfirm/SelectCoupons.vue index 625f94f..ef2d146 100644 --- a/src/views/OrderConfirm/SelectCoupons.vue +++ b/src/views/OrderConfirm/SelectCoupons.vue @@ -5,26 +5,35 @@
-
+ + + +
确认
+ \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrders.vue b/src/views/Center/MyOrder/MyOrders.vue index f50b5de..b46c91b 100644 --- a/src/views/Center/MyOrder/MyOrders.vue +++ b/src/views/Center/MyOrder/MyOrders.vue @@ -2,14 +2,24 @@
-
- - +
+
+
+
+
{{foodNameConcat(item.FoodList)}}
+ 等 {{item.FoodList.length}} 件商品
+
{{stateTags[item.orderSrate]}}
+
+
+
+ +
+
+
+
+ +
+
@@ -27,55 +37,13 @@ export default { data(){ return { active:0, - stateList:["未使用","已使用","已过期"], - couponList:[ - { - // 优惠券id - couponId:"001", - // 满多少元可用 - couponLimit:100, - // 优惠多少钱 - couponMoney:25, - //过期时间 - couponExpire:new Date("4 10,2021"), - }, - { - couponId:"001", - couponLimit:60, - couponMoney:5, - couponExpire:new Date("4 11,2021"), - }, - { - couponId:"001", - couponLimit:20, - couponMoney:5, - couponExpire:new Date("4 22,2021"), - }, - { - couponId:"001", - couponLimit:100, - couponMoney:30, - couponExpire:new Date("4 13,2021"), - }, - { - couponId:"001", - couponLimit:100, - couponMoney:30, - couponExpire:new Date("4 13,2021"), - }, - { - couponId:"001", - couponLimit:100, - couponMoney:30, - couponExpire:new Date("4 13,2021"), - }, - { - couponId:"001", - couponLimit:100, - couponMoney:30, - couponExpire:new Date("4 13,2021"), - } - ] + stateList:["全部","待支付","已完成","已取消"], + stateTags:{ + cancelled:"已关闭", + complated:"已完成", + topay:"等待付款" + }, + ordersList:[] } }, components:{ @@ -85,6 +53,17 @@ export default { dateFormat(date){ return date.getFullYear()+"-"+date.getMonth()+"-"+date.getDate() }, + foodNameConcat(list){ + return list.reduce((total,item)=>{ + return total+" "+item.foodName + },"") + } + }, + created(){ + this.$http.get("https://www.fastmock.site/mock/0986597585a34d83a11da7a620d2fec3/food/myorder") + .then(res=>{ + this.ordersList=res.data.orderList; + }) } } @@ -93,10 +72,56 @@ export default { height: 100%; box-sizing: border-box; padding-top: 40px; - .couponWrap{ + .orderWrap{ + padding: 0 20px; height:650px; overflow: scroll; - + .orderHead{ + display: flex; + width: 100%; + justify-content: space-between; + font-size: 12px; + color: #666; + .left{ + text-align:left; + display: flex; + .foodNames{ + width: 140px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .right{ + text-align: right; + &.topay{ + color: #f04644; + } + } + } + .imgShow{ + display: flex; + justify-content: space-between; + padding: 10px 0 20px; + .imgwrap{ + display: flex; + justify-content: start; + width: 260px; + overflow: hidden; + img{ + width: 77px; + height: 77px; + border-radius: 8px; + margin-right: 10px; + background-color: #eee; + } + } + .iconfont{ + font-size: 24px; + color: #666; + line-height: 77px; + } + } } } \ No newline at end of file diff --git a/src/views/OrderConfirm/OrderConfirm.vue b/src/views/OrderConfirm/OrderConfirm.vue index db48aa0..15f096e 100644 --- a/src/views/OrderConfirm/OrderConfirm.vue +++ b/src/views/OrderConfirm/OrderConfirm.vue @@ -416,7 +416,7 @@ export default { this.peopleNumShow=false }, goPay(){ - + this.$router.push("/payfailed") } }, created(){ diff --git a/src/views/OrderConfirm/PayFailed.vue b/src/views/OrderConfirm/PayFailed.vue index 438a5dc..e8fbe58 100644 --- a/src/views/OrderConfirm/PayFailed.vue +++ b/src/views/OrderConfirm/PayFailed.vue @@ -1,6 +1,56 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/OrderConfirm/PaySuccess.vue b/src/views/OrderConfirm/PaySuccess.vue index 1a8319a..b8fa77d 100644 --- a/src/views/OrderConfirm/PaySuccess.vue +++ b/src/views/OrderConfirm/PaySuccess.vue @@ -1,6 +1,56 @@ \ No newline at end of file + + + \ No newline at end of file -- Gitee