Authored by yyq

Merge branch 'feature/return' of git.yoho.cn:fe/yoho-blk into feature/return

@@ -86,11 +86,32 @@ const exchange = (req, res, next) => { @@ -86,11 +86,32 @@ const exchange = (req, res, next) => {
86 next(); 86 next();
87 }; 87 };
88 88
  89 +const detailExchange = (req, res) => {
  90 + // const uid = global.yoho.uid || '8050560';
  91 + // const page = req.query.page;
  92 +
  93 + res.display('index', {
  94 + page: 'exchange-detail',
  95 + isMe: true,
  96 + content: {
  97 + nav: mcHandler.getMeCrumb('我的退/换货'),
  98 + navigation: mcHandler.getSideMenu('我的退/换货'),
  99 + banner: 'http://placehold.it/{width}x{height}'
  100 +
  101 + // exchange: {
  102 +
  103 +
  104 + // }
  105 + }
  106 + });
  107 +};
  108 +
89 module.exports = { 109 module.exports = {
90 index, 110 index,
91 detail, 111 detail,
92 refund, 112 refund,
93 refundApply, 113 refundApply,
94 refundDetail, 114 refundDetail,
95 - exchange 115 + exchange,
  116 + detailExchange
96 }; 117 };
@@ -31,6 +31,7 @@ router.get('/return', returns.index); @@ -31,6 +31,7 @@ router.get('/return', returns.index);
31 router.get('/return/refund/:orderCode', returns.refund); 31 router.get('/return/refund/:orderCode', returns.refund);
32 router.get('/return/exchange/:orderCode', returns.exchange); 32 router.get('/return/exchange/:orderCode', returns.exchange);
33 router.get('/return/refund/detail/:applyId', returns.refundDetail); 33 router.get('/return/refund/detail/:applyId', returns.refundDetail);
  34 +router.get('/return/exchange/detail', returns.detailExchange);
34 router.get('/return/:returnId', returns.detail); 35 router.get('/return/:returnId', returns.detail);
35 router.post('/return/refund/apply', returns.refundApply); 36 router.post('/return/refund/apply', returns.refundApply);
36 37
@@ -36,6 +36,11 @@ @@ -36,6 +36,11 @@
36 {{> returns}} 36 {{> returns}}
37 {{/if}} 37 {{/if}}
38 38
  39 + {{!-- 换货详情 --}}
  40 + {{#if exchange}}
  41 + {{> exchange-detail}}
  42 + {{/if}}
  43 +
39 {{!-- 我的退换货列表 --}} 44 {{!-- 我的退换货列表 --}}
40 {{#if returnsList}} 45 {{#if returnsList}}
41 {{> returns-list}} 46 {{> returns-list}}
  1 +{{!-- {{# exchange}} --}}
  2 +<div class="exchange-detail-page">
  3 + <p class="state"><span class="iconfont">&#xe618;</span>换货申请审核中</p>
  4 +
  5 + <div class="way">
  6 + <p class="way-title">您已选择{{way}}</p>
  7 + <p>请将商品连同吊牌、包装、发货单(如无发货单,您可找张白纸上注明订单编号,收货人姓名及手机号码)、发票(如有)、赠品(如有)一并保存,
  8 + 如有遗漏将影响您的退换货进度,敬请谅解
  9 + </p>
  10 + <p class="cancel">如果您不想换货了,您可以<span class="cancel-btn">取消申请</span></p>
  11 + </div>
  12 +
  13 + <div class="adress">
  14 + <p class="adress-title">收货地址<span class="modify-btn">修改</span></p>
  15 + <div class="adress-detail">
  16 + <p>所在区域:江苏省 南京市 雨花台区</p>
  17 + <p>收 货 人:赵四</p>
  18 + <p>详细地址:西善桥北路 109 号</p>
  19 + <p>联系电话:17714194699</p>
  20 + </div>
  21 + </div>
  22 +
  23 + <div class="good-info">
  24 + <div class="table">
  25 + <ul class="header">
  26 + <li class="info">商品信息</li>
  27 + <li class="st">换货原因</li>
  28 + <li class="op">换货信息</li>
  29 + </ul>
  30 + </div>
  31 +
  32 + <div class="table">
  33 + <div class="table-body">
  34 + <div class="goods-info">
  35 + <img class="lazy" data-original="{{image img 70 90}}">
  36 + <div class="info">
  37 + <p class="good-name">{{!-- {{name}} --}}fdefwfwefwrefverfref</p>
  38 + <p>颜色:{{color}}&nbsp;尺码:{{size}}</p>
  39 + <p>×{{num}}</p>
  40 + </div>
  41 + </div>
  42 + <div class="common-column special-border">
  43 + <p class="reason">{{reason}}发错货</p>
  44 + </div>
  45 + <div class="common-column special-border operation">
  46 + <p class="subtext">color: 蓝色<br>size: M</p>
  47 + </div>
  48 + </div>
  49 + <div class="reason-info">
  50 + <span>问题描述:太小了</span>
  51 + <div class="reason-img">照片凭证:
  52 + <div class="evidence">
  53 + <img src="{{image img 70 90}}">
  54 + </div>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + </div>
  59 +</div>
  60 +{{!-- {{/ exchange}} --}}
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 {{> refund}} 5 {{> refund}}
6 6
7 {{> refund-detail}} 7 {{> refund-detail}}
  8 +
  9 + {{> exchange}}
8 {{/ returns}} 10 {{/ returns}}
9 - </div>  
10 </div> 11 </div>
  1 +var $ = require('yoho-jquery'),
  2 + lazyLoad = require('yoho-jquery-lazyload');
  3 +
  4 +require('../common/header');
  5 +require('../common/return-top');
  6 +
  7 +lazyLoad($('.content-msg img.lazy'));
  8 +
  9 +$('.editorial-list-page').on('click', '.like-icon', function() {
  10 +
  11 + var $this = $(this),
  12 + msgId = $this.closest('.msg-content').data('id'),
  13 + url;
  14 +
  15 + $this.toggleClass('liked');
  16 + if ($this.hasClass('liked')) {
  17 + url = '/editorial/info/cancelPraise';
  18 + } else {
  19 + url = '/editorial/info/praise';
  20 + }
  21 + $.ajax({
  22 + type: 'GET',
  23 + url: url,
  24 + data: {
  25 + id: msgId,
  26 + time: new Date().getTime()
  27 + }
  28 + }).then(function(data) {
  29 + if (data.code === 200) {
  30 + $this.next('b').removeClass('num-0').children('.num').html(data.data);
  31 + }
  32 +
  33 + // if (data.code === 200) {
  34 + // if (data.data * 1 === 0) {
  35 + // $this.next('b').addClass('num-0').children('.num').html('0'); // 隐藏数字显示
  36 + // } else {
  37 + // console.log(data.data)
  38 + // $this.next('b').removeClass('num-0').children('.num').html(data.data);
  39 + // }
  40 + // }
  41 + // prising = false;
  42 + });
  43 +}).on('mouseenter mouseleave', '.like-icon', function() {
  44 + $(this).closest('.like').toggleClass('hover');
  45 +});
  1 +.exchange-detail-page {
  2 + .state {
  3 + font-size: 16px;
  4 + color: #5cb0de;
  5 +
  6 + span {
  7 + font-size: 20px;
  8 + margin-right: 5px;
  9 + }
  10 + }
  11 +
  12 + .way {
  13 + font-size: 14px;
  14 + border-bottom: 1px solid #eee;
  15 +
  16 + .way-title {
  17 + margin-top: 10px;
  18 + font-weight: bold;
  19 + height: 40px;
  20 + line-height: 35px;
  21 + }
  22 +
  23 + p {
  24 + line-height: 22px;
  25 + height: 22px;
  26 + }
  27 +
  28 + .cancel {
  29 + display: block;
  30 + margin-top: 18px;
  31 + width: 220px;
  32 + height: 50px;
  33 + line-height: 50px;
  34 + font-size: 12px;
  35 + }
  36 +
  37 + .cancel-btn {
  38 + float: right;
  39 + display: block;
  40 + height: 25px;
  41 + width: 70px;
  42 + background: #1b1b1b;
  43 + color: #fff;
  44 + line-height: 25px;
  45 + text-align: center;
  46 + margin-top: 10px;
  47 + }
  48 + }
  49 +
  50 + .adress {
  51 + overflow: hidden;
  52 + margin-top: 30px;
  53 + font-size: 14px;
  54 + border-bottom: 1px solid #eee;
  55 +
  56 + .adress-title {
  57 + display: block;
  58 + font-size: 16px;
  59 + width: 125px;
  60 + height: 40px;
  61 + line-height: 40px;
  62 + }
  63 +
  64 + .modify-btn {
  65 + font-size: 12px;
  66 + float: right;
  67 + display: block;
  68 + height: 20px;
  69 + width: 40px;
  70 + line-height: 20px;
  71 + text-align: center;
  72 + margin-top: 10px;
  73 + border: 1px solid #eee;
  74 + }
  75 +
  76 + .adress-detail {
  77 + margin-bottom: 15px;
  78 +
  79 + p {
  80 + display: block;
  81 + height: 25px;
  82 + line-height: 25px;
  83 + }
  84 + }
  85 + }
  86 +
  87 + .table {
  88 + width: 100%;
  89 +
  90 + .header {
  91 + height: 40px;
  92 + line-height: 40px;
  93 + padding-left: 20px;
  94 + font-size: 14px;
  95 + background-color: #f5f5f5;
  96 + border: 1px solid #f1f1f1;
  97 +
  98 + li {
  99 + height: 100%;
  100 + float: left;
  101 + text-align: center;
  102 + }
  103 +
  104 + .info {
  105 + width: 496px;
  106 + text-align: left;
  107 + }
  108 +
  109 + .st,
  110 + .op {
  111 + width: 206px;
  112 + }
  113 + }
  114 + }
  115 +
  116 + .table-body {
  117 + display: table;
  118 + font-size: 14px;
  119 + border: 1px solid #f1f1f1;
  120 + }
  121 +
  122 + .goods-info {
  123 + width: 516px;
  124 + display: inline-block;
  125 + box-sizing: border-box;
  126 + border-top: none;
  127 + font-weight: normal;
  128 +
  129 + img {
  130 + width: 70px;
  131 + height: 90px;
  132 + display: inline-block;
  133 + box-sizing: border-box;
  134 + margin: 30px 20px;
  135 + }
  136 +
  137 + .info {
  138 + width: 400px;
  139 + padding: 30px 8px 0 0;
  140 + float: right;
  141 + box-sizing: border-box;
  142 + line-height: 1.4;
  143 + font-size: 14px;
  144 + color: #616161;
  145 + }
  146 +
  147 + .good-name {
  148 + margin-bottom: 8px;
  149 + }
  150 + }
  151 +
  152 + .common-column {
  153 + width: 208px;
  154 + display: table-cell;
  155 + text-align: center;
  156 + vertical-align: top;
  157 + padding-top: 30px;
  158 + position: relative;
  159 + }
  160 +
  161 + .subtext {
  162 + display: inline-block;
  163 + line-height: 30px;
  164 + }
  165 +
  166 + .reason {
  167 + display: inline-block;
  168 + margin-top: 20px;
  169 + }
  170 +
  171 + .reason-info {
  172 + overflow: hidden;
  173 + padding: 25px 0 0 20px;
  174 + width: 100%;
  175 + border: 1px solid #eee;
  176 + border-top: none;
  177 +
  178 + img {
  179 + float: left;
  180 + width: 70px;
  181 + height: 90px;
  182 +
  183 + }
  184 +
  185 + span {
  186 + line-height: 25px;
  187 + height: 25px;
  188 + display: block;
  189 + }
  190 + }
  191 +
  192 + .reason-img {
  193 + margin-top: 5px;
  194 + }
  195 +
  196 + .evidence {
  197 + width: 825px;
  198 + overflow: hidden;
  199 + float: right;
  200 + }
  201 +
  202 +}
@@ -106,3 +106,4 @@ @@ -106,3 +106,4 @@
106 @import "return/index"; 106 @import "return/index";
107 @import "currency"; 107 @import "currency";
108 @import "returns"; 108 @import "returns";
  109 +@import "exchange";