- 删除多余的 mock 数据
- 添加商品 title 显示
This commit is contained in:
parent
486278e1cf
commit
bc5af47f67
@ -245,12 +245,10 @@
|
||||
},
|
||||
onBuyClicked(data) {
|
||||
const { selectedNum } = data;
|
||||
// debugger;
|
||||
// console.log(data);
|
||||
// this.$toast(JSON.stringify(data));
|
||||
this.$router.push({
|
||||
path:'/order',
|
||||
query:{
|
||||
goodsId: data.id,
|
||||
skuId: data.selectedSkuComb.id,
|
||||
quantity: selectedNum,
|
||||
}
|
||||
|
@ -76,7 +76,6 @@
|
||||
data() {
|
||||
return {
|
||||
from: 'direct_order', // 目前有两个来源。direct_order:直接下单; card: 购物车下单。
|
||||
|
||||
// 如下两个参数,在直接下单时使用
|
||||
skuId: this.$route.query.skuId,
|
||||
quantity: this.$route.query.quantity,
|
||||
@ -85,7 +84,6 @@
|
||||
addressData: {
|
||||
|
||||
},
|
||||
|
||||
itemGroups: [],
|
||||
fee: {
|
||||
originalTotal: undefined,
|
||||
@ -93,48 +91,11 @@
|
||||
postageTotal: undefined,
|
||||
presentTotal: undefined,
|
||||
},
|
||||
|
||||
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
|
||||
},
|
||||
]
|
||||
products: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.$toast("点击按钮");
|
||||
const { skuId, quantity } = this.$route.query;
|
||||
const userAddressId = this.addressData.id;
|
||||
const remark = '';
|
||||
@ -148,6 +109,16 @@
|
||||
orderItems,
|
||||
userAddressId,
|
||||
remark,
|
||||
}).then(result => {
|
||||
if (result) {
|
||||
const { orderNo } = result;
|
||||
this.$router.push({ //核心语句
|
||||
path:`/order/success`, //跳转的路径
|
||||
query:{ //路由传参时push和query搭配使用 ,作用时传递参数
|
||||
...result,
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
convertProduct(item) {
|
||||
|
@ -23,17 +23,19 @@
|
||||
</div>
|
||||
<div v-if="item.products.length > 0" class="more">
|
||||
<div class="item" v-for="(product,i) in item.products" :key="i">
|
||||
<div>
|
||||
<div class="products-item">
|
||||
<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>
|
||||
</router-link>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<div slot="footer" class="footer">
|
||||
<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="item.status === 2 " 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 === 3 " size="small">确认收货</van-button>
|
||||
<van-button v-if="item.status === 1 " size="small" type="danger">支付</van-button>
|
||||
</div>
|
||||
</van-panel>
|
||||
@ -51,85 +53,7 @@
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
|
||||
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
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -221,6 +145,11 @@
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: block;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.van-button {
|
||||
margin-left: 5px;
|
||||
}
|
||||
@ -249,5 +178,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.products-item {
|
||||
/*display: flex;*/
|
||||
/*flex-direction: row;*/
|
||||
|
||||
.product-title {
|
||||
justify-items: center;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user