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) => { @@ -44,6 +44,12 @@ exports.addressJson = (req, res, next) => {
44 addressModel.address({ 44 addressModel.address({
45 uid: req.user.uid 45 uid: req.user.uid
46 }).then(result => { 46 }).then(result => {
  47 + if (result && result.address) {
  48 + result.address.map(value => {
  49 + value.uid && delete value.uid;
  50 + return value;
  51 + });
  52 + }
47 res.json(result); 53 res.json(result);
48 }).catch(next); 54 }).catch(next);
49 }; 55 };
@@ -11,7 +11,11 @@ const exchange = { @@ -11,7 +11,11 @@ const exchange = {
11 module: 'home', 11 module: 'home',
12 page: 'refund-exchange', 12 page: 'refund-exchange',
13 pageHeader: headerModel.setNav({ 13 pageHeader: headerModel.setNav({
14 - navTitle: '换货申请' 14 + navTitle: '换货申请',
  15 + suggestSub: {
  16 + text: '提交'
  17 + },
  18 + navBtn: false
15 }), 19 }),
16 title: '换货申请', 20 title: '换货申请',
17 }); 21 });
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 * DOC: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/exchange.md 3 * DOC: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/exchange.md
4 */ 4 */
5 const api = global.yoho.API; 5 const api = global.yoho.API;
  6 +const crypto = global.yoho.crypto;
6 7
7 const exchange = { 8 const exchange = {
8 // 获取 换货列表 9 // 获取 换货列表
@@ -30,10 +31,14 @@ const exchange = { @@ -30,10 +31,14 @@ const exchange = {
30 }, 31 },
31 32
32 submitExchange(uid, params) { 33 submitExchange(uid, params) {
33 - const data = Object.assign({ 34 + const data = Object.assign(params, {
34 uid, 35 uid,
35 method: 'app.change.submit' 36 method: 'app.change.submit'
36 - }, params); 37 + });
  38 +
  39 + if (data.address_id) {
  40 + data.address_id = crypto.decrypt(null, data.address_id);
  41 + }
37 42
38 return api.post('', data); 43 return api.post('', data);
39 }, 44 },
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 <div class="chose-items"> 24 <div class="chose-items">
25 {{#each props}} 25 {{#each props}}
26 <div class="block-list"> 26 <div class="block-list">
27 - <span class="name">{{name}}</span> 27 + <span class="name">{{name}}</span>
28 <ul class="size-row clearfix"> 28 <ul class="size-row clearfix">
29 {{#each values}} 29 {{#each values}}
30 <li class="block" data-prop-id="{{../type}}" data-value-id="{{id}}">{{name}}</li> 30 <li class="block" data-prop-id="{{../type}}" data-value-id="{{id}}">{{name}}</li>
@@ -45,14 +45,14 @@ @@ -45,14 +45,14 @@
45 </a> 45 </a>
46 </div> 46 </div>
47 {{#if @root.discountBuy}} 47 {{#if @root.discountBuy}}
48 - <input id="mnum" type="hidden" value="{{@root.discountBuy.num}}"> 48 + <input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">
49 {{#if @root.discountBuy.discount}} 49 {{#if @root.discountBuy.discount}}
50 - <span class="left-num-discount">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span> 50 + <span class="left-num-discount">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span>
51 {{^}} 51 {{^}}
52 - <span class="left-num-discount">{{@root.discountBuy.num}}件起购</span>  
53 - {{/if}} 52 + <span class="left-num-discount">{{@root.discountBuy.num}}件起购</span>
  53 + {{/if}}
54 {{^}} 54 {{^}}
55 - <span class="left-num"></span> 55 + <span class="left-num"></span>
56 {{/if}} 56 {{/if}}
57 <input id="left-num" type="hidden" value="0"> 57 <input id="left-num" type="hidden" value="0">
58 <input id="limitNum" type="hidden" value="{{limit}}"> 58 <input id="limitNum" type="hidden" value="{{limit}}">
@@ -25,13 +25,6 @@ @@ -25,13 +25,6 @@
25 </select> 25 </select>
26 </div> 26 </div>
27 </div> 27 </div>
28 -  
29 -<!-- <feature-selector  
30 - :is-visible="showFeatureSelector"  
31 - :entity="entity"  
32 - :on-add-to-cart="whenFeatureChange"  
33 - button-text="确定">  
34 - </feature-selector> -->  
35 </div> 28 </div>
36 </template> 29 </template>
37 30
@@ -41,6 +34,7 @@ @@ -41,6 +34,7 @@
41 const Modal = require('plugin/modal2'); 34 const Modal = require('plugin/modal2');
42 const returnUtil = require('plugin/util'); 35 const returnUtil = require('plugin/util');
43 const bus = require('plugin/vue-bus'); 36 const bus = require('plugin/vue-bus');
  37 + const loading = require('plugin/loading');
44 const chosePanel = require('common/chose-panel-new'); 38 const chosePanel = require('common/chose-panel-new');
45 39
46 const productList = require('home/return/list.vue'); 40 const productList = require('home/return/list.vue');
@@ -76,6 +70,11 @@ @@ -76,6 +70,11 @@
76 } 70 }
77 }, 71 },
78 created() { 72 created() {
  73 + // 提交按钮dom
  74 + this.$submitBtn = $('#yoho-header .nav-btn');
  75 +
  76 + this.$submitBtn.on('click', this.submit);
  77 +
79 // 打开 更换 颜色尺码 TAR-TODO 这个可能得重写 78 // 打开 更换 颜色尺码 TAR-TODO 这个可能得重写
80 bus.$on('open.featureSelector', msg => { 79 bus.$on('open.featureSelector', msg => {
81 this.queryProductFeature(msg.pid, msg.sku, msg.rid); 80 this.queryProductFeature(msg.pid, msg.sku, msg.rid);
@@ -143,11 +142,9 @@ @@ -143,11 +142,9 @@
143 goods.change = { 142 goods.change = {
144 color: selection.sku.prop.color.valName, 143 color: selection.sku.prop.color.valName,
145 size: selection.sku.prop.size.valName, 144 size: selection.sku.prop.size.valName,
146 - goodsId: selection.productId, 145 + goodsId: selection.sku.prop.color.goodsId,
147 sku: selection.sku.skuId 146 sku: selection.sku.skuId
148 }; 147 };
149 -  
150 - // this.showFeatureSelector = false;  
151 }, 148 },
152 149
153 // 处理商品尺码数据 150 // 处理商品尺码数据
@@ -320,17 +317,21 @@ @@ -320,17 +317,21 @@
320 } 317 }
321 }, 318 },
322 watch: { 319 watch: {
323 - // area code 改变,重新获取 换货方式  
324 - 'address.areaCode': function(newVal) { 320 + showChoseAddress(val) {
  321 + if (val) {
  322 + this.$submitBtn.hide();
  323 + } else {
  324 + this.$submitBtn.show();
  325 + }
  326 + },
  327 + 'address.areaCode': function(newVal) { // area code 改变,重新获取 换货方式
325 this.reflushDeliveryTpye(newVal); 328 this.reflushDeliveryTpye(newVal);
326 }, 329 },
327 processing(val) { 330 processing(val) {
328 if (val) { 331 if (val) {
329 -  
330 - // when processing 332 + loading.showLoading();
331 } else { 333 } else {
332 -  
333 - // when not in processing 334 + loading.hideLoading();
334 } 335 }
335 336
336 } 337 }
@@ -340,8 +341,8 @@ @@ -340,8 +341,8 @@
340 addressList 341 addressList
341 } 342 }
342 }; 343 };
343 -  
344 </script> 344 </script>
  345 +
345 <style> 346 <style>
346 @import "home/refund/_return.css"; 347 @import "home/refund/_return.css";
347 @import "cart/chose-panel.css"; 348 @import "cart/chose-panel.css";
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 </div> 10 </div>
11 <template v-if="specialReasons.indexOf(product.reason.id) !== -1"> 11 <template v-if="specialReasons.indexOf(product.reason.id) !== -1">
12 <div class="remark"> 12 <div class="remark">
13 - <textarea v-model="product.remark" max-length="100" placeholder="退货原因说明"></textarea> 13 + <textarea v-model="product.remark" max-length="100" placeholder="原因说明"></textarea>
14 </div> 14 </div>
15 <div class="image-list clearfix"> 15 <div class="image-list clearfix">
16 <div class="image-item" v-for="(image, index) in imageListForShow" :key="index"> 16 <div class="image-item" v-for="(image, index) in imageListForShow" :key="index">
@@ -33,7 +33,6 @@ @@ -33,7 +33,6 @@
33 module.exports = { 33 module.exports = {
34 props: ['product', 'data'], 34 props: ['product', 'data'],
35 data() { 35 data() {
36 - console.log(this);  
37 return { 36 return {
38 bucket: 'evidenceImages', 37 bucket: 'evidenceImages',
39 reasons: [], 38 reasons: [],
@@ -459,6 +459,7 @@ exports.processSkusInfo = (origin) => { @@ -459,6 +459,7 @@ exports.processSkusInfo = (origin) => {
459 prop: { 459 prop: {
460 color: { 460 color: {
461 valId: color.product_skc, 461 valId: color.product_skc,
  462 + goodsId: color.goods_id,
462 valName: color.factory_goods_name || color.color_name 463 valName: color.factory_goods_name || color.color_name
463 }, 464 },
464 size: { 465 size: {