Authored by 郭成尧

Merge branch 'feature/refund' of git.yoho.cn:fe/yohobuywap-node into feature/refund

... ... @@ -44,6 +44,12 @@ exports.addressJson = (req, res, next) => {
addressModel.address({
uid: req.user.uid
}).then(result => {
if (result && result.address) {
result.address.map(value => {
value.uid && delete value.uid;
return value;
});
}
res.json(result);
}).catch(next);
};
... ...
... ... @@ -11,7 +11,11 @@ const exchange = {
module: 'home',
page: 'refund-exchange',
pageHeader: headerModel.setNav({
navTitle: '换货申请'
navTitle: '换货申请',
suggestSub: {
text: '提交'
},
navBtn: false
}),
title: '换货申请',
});
... ...
... ... @@ -3,6 +3,7 @@
* DOC: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/exchange.md
*/
const api = global.yoho.API;
const crypto = global.yoho.crypto;
const exchange = {
// 获取 换货列表
... ... @@ -30,10 +31,14 @@ const exchange = {
},
submitExchange(uid, params) {
const data = Object.assign({
const data = Object.assign(params, {
uid,
method: 'app.change.submit'
}, params);
});
if (data.address_id) {
data.address_id = crypto.decrypt(null, data.address_id);
}
return api.post('', data);
},
... ...
... ... @@ -24,7 +24,7 @@
<div class="chose-items">
{{#each props}}
<div class="block-list">
<span class="name">{{name}}</span>
<span class="name">{{name}}</span>
<ul class="size-row clearfix">
{{#each values}}
<li class="block" data-prop-id="{{../type}}" data-value-id="{{id}}">{{name}}</li>
... ... @@ -45,14 +45,14 @@
</a>
</div>
{{#if @root.discountBuy}}
<input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">
<input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">
{{#if @root.discountBuy.discount}}
<span class="left-num-discount">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span>
<span class="left-num-discount">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span>
{{^}}
<span class="left-num-discount">{{@root.discountBuy.num}}件起购</span>
{{/if}}
<span class="left-num-discount">{{@root.discountBuy.num}}件起购</span>
{{/if}}
{{^}}
<span class="left-num"></span>
<span class="left-num"></span>
{{/if}}
<input id="left-num" type="hidden" value="0">
<input id="limitNum" type="hidden" value="{{limit}}">
... ...
... ... @@ -25,13 +25,6 @@
</select>
</div>
</div>
<!-- <feature-selector
:is-visible="showFeatureSelector"
:entity="entity"
:on-add-to-cart="whenFeatureChange"
button-text="确定">
</feature-selector> -->
</div>
</template>
... ... @@ -41,6 +34,7 @@
const Modal = require('plugin/modal2');
const returnUtil = require('plugin/util');
const bus = require('plugin/vue-bus');
const loading = require('plugin/loading');
const chosePanel = require('common/chose-panel-new');
const productList = require('home/return/list.vue');
... ... @@ -76,6 +70,11 @@
}
},
created() {
// 提交按钮dom
this.$submitBtn = $('#yoho-header .nav-btn');
this.$submitBtn.on('click', this.submit);
// 打开 更换 颜色尺码 TAR-TODO 这个可能得重写
bus.$on('open.featureSelector', msg => {
this.queryProductFeature(msg.pid, msg.sku, msg.rid);
... ... @@ -143,11 +142,9 @@
goods.change = {
color: selection.sku.prop.color.valName,
size: selection.sku.prop.size.valName,
goodsId: selection.productId,
goodsId: selection.sku.prop.color.goodsId,
sku: selection.sku.skuId
};
// this.showFeatureSelector = false;
},
// 处理商品尺码数据
... ... @@ -320,17 +317,21 @@
}
},
watch: {
// area code 改变,重新获取 换货方式
'address.areaCode': function(newVal) {
showChoseAddress(val) {
if (val) {
this.$submitBtn.hide();
} else {
this.$submitBtn.show();
}
},
'address.areaCode': function(newVal) { // area code 改变,重新获取 换货方式
this.reflushDeliveryTpye(newVal);
},
processing(val) {
if (val) {
// when processing
loading.showLoading();
} else {
// when not in processing
loading.hideLoading();
}
}
... ... @@ -340,8 +341,8 @@
addressList
}
};
</script>
<style>
@import "home/refund/_return.css";
@import "cart/chose-panel.css";
... ...
... ... @@ -10,7 +10,7 @@
</div>
<template v-if="specialReasons.indexOf(product.reason.id) !== -1">
<div class="remark">
<textarea v-model="product.remark" max-length="100" placeholder="退货原因说明"></textarea>
<textarea v-model="product.remark" max-length="100" placeholder="原因说明"></textarea>
</div>
<div class="image-list clearfix">
<div class="image-item" v-for="(image, index) in imageListForShow" :key="index">
... ... @@ -33,7 +33,6 @@
module.exports = {
props: ['product', 'data'],
data() {
console.log(this);
return {
bucket: 'evidenceImages',
reasons: [],
... ...
... ... @@ -459,6 +459,7 @@ exports.processSkusInfo = (origin) => {
prop: {
color: {
valId: color.product_skc,
goodsId: color.goods_id,
valName: color.factory_goods_name || color.color_name
},
size: {
... ...