提交 bc5af47f authored 作者: sin's avatar sin

- 删除多余的 mock 数据

- 添加商品 title 显示
上级 486278e1
...@@ -245,12 +245,10 @@ ...@@ -245,12 +245,10 @@
}, },
onBuyClicked(data) { onBuyClicked(data) {
const { selectedNum } = data; const { selectedNum } = data;
// debugger;
// console.log(data);
// this.$toast(JSON.stringify(data));
this.$router.push({ this.$router.push({
path:'/order', path:'/order',
query:{ query:{
goodsId: data.id,
skuId: data.selectedSkuComb.id, skuId: data.selectedSkuComb.id,
quantity: selectedNum, quantity: selectedNum,
} }
......
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
data() { data() {
return { return {
from: 'direct_order', // 目前有两个来源。direct_order:直接下单; card: 购物车下单。 from: 'direct_order', // 目前有两个来源。direct_order:直接下单; card: 购物车下单。
// 如下两个参数,在直接下单时使用 // 如下两个参数,在直接下单时使用
skuId: this.$route.query.skuId, skuId: this.$route.query.skuId,
quantity: this.$route.query.quantity, quantity: this.$route.query.quantity,
...@@ -85,7 +84,6 @@ ...@@ -85,7 +84,6 @@
addressData: { addressData: {
}, },
itemGroups: [], itemGroups: [],
fee: { fee: {
originalTotal: undefined, originalTotal: undefined,
...@@ -93,48 +91,11 @@ ...@@ -93,48 +91,11 @@
postageTotal: undefined, postageTotal: undefined,
presentTotal: undefined, presentTotal: undefined,
}, },
products: [],
products: [
{
imageURL:
"https://img10.360buyimg.com/mobilecms/s88x88_jfs/t17572/12/840082281/351445/e1828c58/5aab8dbbNedb77d88.jpg",
title: "良品铺子 肉肉聚汇猪肉脯 猪蹄卤 辣味小吃520g",
desc: "0.670kg/件,肉肉聚汇520g",
price: "59.80",
quantity: 2
},
{
imageURL:
"https://img10.360buyimg.com/mobilecms/s88x88_jfs/t22720/128/1410375403/319576/8dbd859f/5b5e69b3Nf4f0e9e7.jpg",
title: "元朗 鸡蛋卷 饼干糕点 中秋礼盒 广东特产680g",
desc: "1.320kg/件",
price: "65.80",
quantity: 1,
gift: [
{
title: "星巴克(Starbucks)星冰乐小熊吊饰星巴克(Starbucks)星冰乐小熊吊饰",
quantity: 2
},
{
title: "星巴克(Starbucks)星冰乐小熊吊饰星巴克(Starbucks)星冰乐小熊吊饰",
quantity: 1
}
]
},
{
imageURL:
"https://img10.360buyimg.com/mobilecms/s88x88_jfs/t17572/12/840082281/351445/e1828c58/5aab8dbbNedb77d88.jpg",
title: "良品铺子 肉肉聚汇猪肉脯 猪蹄卤 辣味小吃520g",
desc: "0.670kg/件,肉肉聚汇520g",
price: "59.80",
quantity: 2
},
]
}; };
}, },
methods: { methods: {
onSubmit() { onSubmit() {
this.$toast("点击按钮");
const { skuId, quantity } = this.$route.query; const { skuId, quantity } = this.$route.query;
const userAddressId = this.addressData.id; const userAddressId = this.addressData.id;
const remark = ''; const remark = '';
...@@ -148,6 +109,16 @@ ...@@ -148,6 +109,16 @@
orderItems, orderItems,
userAddressId, userAddressId,
remark, remark,
}).then(result => {
if (result) {
const { orderNo } = result;
this.$router.push({ //核心语句
path:`/order/success`, //跳转的路径
query:{ //路由传参时push和query搭配使用 ,作用时传递参数
...result,
}
});
}
}) })
}, },
convertProduct(item) { convertProduct(item) {
......
...@@ -23,17 +23,19 @@ ...@@ -23,17 +23,19 @@
</div> </div>
<div v-if="item.products.length > 0" class="more"> <div v-if="item.products.length > 0" class="more">
<div class="item" v-for="(product,i) in item.products" :key="i"> <div class="item" v-for="(product,i) in item.products" :key="i">
<div> <div class="products-item">
<img :src="product.imageURL"/> <img :src="product.imageURL"/>
<span class="product-title">{{product.title}}</span>
<!--<span class="product-title">{{product.price / 100}} x{{product.quantity}}</span>-->
</div> </div>
</div> </div>
</div> </div>
</router-link> </router-link>
</div> </div>
<div slot="footer"> <div slot="footer" class="footer">
<span class="total">总价:{{item.payAmount / 100}}</span> <span class="total">总价:{{item.payAmount / 100}}</span>
<van-button v-if="[2,3,4,5].indexOf(item.status) != -1" size="small">查看物流</van-button> <van-button v-if="[3,4,5].indexOf(item.status) != -1" size="small">查看物流</van-button>
<van-button v-if="item.status === 2 " size="small">确认收货</van-button> <van-button v-if="item.status === 3 " size="small">确认收货</van-button>
<van-button v-if="item.status === 1 " size="small" type="danger">支付</van-button> <van-button v-if="item.status === 1 " size="small" type="danger">支付</van-button>
</div> </div>
</van-panel> </van-panel>
...@@ -51,85 +53,7 @@ ...@@ -51,85 +53,7 @@
data() { data() {
return { return {
active: 0, active: 0,
list: [],
list: [
{
orderid: 1,
ordercode: '4511248234235',
state: '待付款',
products: [
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
},
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 1
},
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
},
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
},
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
},
]
},
{
orderid: 2,
ordercode: '4511248234235',
state: '待收货',
products: [
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
}
]
},
{
orderid: 3,
ordercode: '4511248234235',
state: '已完成',
products: [
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
}
]
},
{
orderid: 4,
ordercode: '4511248234235',
state: '已取消',
products: [
{
imageURL: 'https://pop.nosdn.127.net/19e33c9b-6c22-4a4b-96da-1cb7afb32712',
title: 'BEYOND博洋家纺 床上套件 秋冬保暖纯棉床单被套 双人被罩 磨毛全棉印花床品四件套',
price: '499',
quantity: 2
}
]
},
]
} }
}, },
methods: { methods: {
...@@ -221,6 +145,11 @@ ...@@ -221,6 +145,11 @@
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.footer {
display: block;
height: 30px;
}
.van-button { .van-button {
margin-left: 5px; margin-left: 5px;
} }
...@@ -249,5 +178,17 @@ ...@@ -249,5 +178,17 @@
} }
} }
} }
.products-item {
/*display: flex;*/
/*flex-direction: row;*/
.product-title {
justify-items: center;
margin: 10px;
}
}
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论