+
{{foodNameConcat(item.FoodList)}}
@@ -14,10 +14,16 @@
-
+
@@ -49,15 +55,41 @@ export default {
components:{
Coupon
},
+ computed:{
+ filterList(){
+ return (index)=>{
+ let list=['all','topay','complated','cancelled']
+ let state=list[index]
+ return this.ordersList.filter((item)=>{
+ return state=="all"||item.orderSrate==state
+ })
+ }
+
+ }
+ },
methods:{
dateFormat(date){
return date.getFullYear()+"-"+date.getMonth()+"-"+date.getDate()
},
foodNameConcat(list){
return list.reduce((total,item)=>{
+ let arr=['topay','cancelled','complated']
return total+" "+item.foodName
},"")
+ },
+ onDeleteOrder(item){
+ let order=item
+ let index=this.ordersList.indexOf(item)
+ this.$delete(this.ordersList,index)
+ },
+ onCancelOrder(item){
+ item.orderSrate='cancelled'
+ },
+ toDefail(item){
+ console.log(this.$router);
+ this.$router.push({name:'myorderdetail',params:{orderList:item}})
}
+
},
created(){
this.$http.get("https://www.fastmock.site/mock/0986597585a34d83a11da7a620d2fec3/food/myorder")
@@ -69,59 +101,100 @@ export default {
\ No newline at end of file