...
|
...
|
@@ -31,7 +31,7 @@ |
|
|
:is-visible="showFeatureSelector"
|
|
|
:entity="entity"
|
|
|
:on-add-to-cart="whenFeatureChange"
|
|
|
:config="{btnTxt:'确定'}">
|
|
|
buttonText="确定">
|
|
|
</feature-selector>
|
|
|
</div>
|
|
|
</template>
|
...
|
...
|
@@ -51,6 +51,7 @@ |
|
|
return {
|
|
|
title: '请选择换货商品',
|
|
|
page: 'exchange',
|
|
|
orderCode: qs.orderId,
|
|
|
showFeatureSelector: false,
|
|
|
entity: {},
|
|
|
exchangeData: {},
|
...
|
...
|
@@ -92,7 +93,7 @@ |
|
|
$.ajax({
|
|
|
url: '/home/exchange/order',
|
|
|
data: {
|
|
|
orderId: qs.orderId
|
|
|
orderId: this.orderCode
|
|
|
}
|
|
|
}).then(res => {
|
|
|
const self = this;
|
...
|
...
|
@@ -147,14 +148,48 @@ |
|
|
return result;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 生成提交数据
|
|
|
submitData() {
|
|
|
const data = {
|
|
|
order_code: this.orderCode,
|
|
|
address_id: this.address.address_id,
|
|
|
address: this.address.address,
|
|
|
consigee_name: this.address.consignee,
|
|
|
area_code: this.address.areaCode,
|
|
|
zip_code: this.address.zipCode,
|
|
|
mobile: this.address.mobile,
|
|
|
delivery_typ: this.deliveryType,
|
|
|
app_type: 1,
|
|
|
goods: []
|
|
|
};
|
|
|
|
|
|
this.selectedGoods.forEach(good => {
|
|
|
data.goods.push({
|
|
|
product_skn: good.productSkn,
|
|
|
product_skc: good.productSku,
|
|
|
goods_type: good.goodsTypeId,
|
|
|
last_price: good.lastPrice,
|
|
|
exchange_reason: good.reason.id,
|
|
|
remark: good.remark,
|
|
|
evidence_images: good.imageList,
|
|
|
new_goods_id: good.newGoodsId,
|
|
|
new_product_sku: good.newProductSku
|
|
|
});
|
|
|
});
|
|
|
|
|
|
return data;
|
|
|
},
|
|
|
|
|
|
// 提交 换货
|
|
|
submit() {
|
|
|
if (!this.checkSubmitData()) {
|
|
|
alert('请填写完整退换货信息');
|
|
|
}
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/home/refund/submit',
|
|
|
data: this.submitData
|
|
|
url: '/home/exchange/submit',
|
|
|
data: this.submitData()
|
|
|
}).then(result => {
|
|
|
if (result.code === 200) {
|
|
|
console.log(result);
|
...
|
...
|
|