Authored by 陈峰

merge release/5.5

@@ -29,6 +29,7 @@ const couponData = (params) => { @@ -29,6 +29,7 @@ const couponData = (params) => {
29 } 29 }
30 ); 30 );
31 } else if (status1) { 31 } else if (status1) {
  32 + delete elem.overState;
32 elem.employbg = true; 33 elem.employbg = true;
33 } 34 }
34 return elem; 35 return elem;
@@ -319,6 +319,29 @@ const getOrders = (params) => { @@ -319,6 +319,29 @@ const getOrders = (params) => {
319 /* 是否是虚拟商品 */ 319 /* 是否是虚拟商品 */
320 let isTickets = order.virtual_type && parseInt(order.virtual_type, 10) === 3; 320 let isTickets = order.virtual_type && parseInt(order.virtual_type, 10) === 3;
321 321
  322 + /* 修改地址按钮控制 */
  323 + let modifyAddress = {
  324 + modifyAddress: false,
  325 + modifyAddressUrl: ''
  326 + };
  327 +
  328 + if (_.find(value.links, o => {
  329 + return o === 'modifyAddress';
  330 + })) {
  331 + modifyAddress.modifyAddress = true;
  332 + modifyAddress.modifyAddressUrl = helpers.urlFormat('/home/orders/addressModify', {
  333 + orderCode: value.order_code,
  334 + areaCode: _.get(value, 'delivery_address.area_code', '')
  335 + });
  336 +
  337 + // 如果不允许修改省
  338 + if (value.is_support_change_province !== 'Y' &&
  339 + !_.get(value, 'delivery_address.province_area_code', false)) {
  340 + modifyAddress.modifyAddressUrl += '&provinceAreaCode=' +
  341 + _.get(value, 'delivery_address.province_area_code', '');
  342 + }
  343 + }
  344 +
322 Object.assign(perOrder, { 345 Object.assign(perOrder, {
323 orderNum: value.order_code, 346 orderNum: value.order_code,
324 orderStatus: value.status_str, 347 orderStatus: value.status_str,
@@ -327,7 +350,8 @@ const getOrders = (params) => { @@ -327,7 +350,8 @@ const getOrders = (params) => {
327 detailUrl: helpers.urlFormat('/home/orderdetail', {order_code: value.order_code}), 350 detailUrl: helpers.urlFormat('/home/orderdetail', {order_code: value.order_code}),
328 count: value.buy_total, 351 count: value.buy_total,
329 isVirtual: isTickets, 352 isVirtual: isTickets,
330 - isDepositAdvance: value.attribute * 1 === 9// 定金预售 353 + isDepositAdvance: value.attribute * 1 === 9, // 定金预售
  354 + modifyAddress: modifyAddress
331 }); 355 });
332 356
333 /* 如果运费大于0,会显示运费 */ 357 /* 如果运费大于0,会显示运费 */
@@ -260,9 +260,15 @@ const orderDetailData = (uid, orderCode) => { @@ -260,9 +260,15 @@ const orderDetailData = (uid, orderCode) => {
260 } 260 }
261 261
262 // 判断是否可以修改地址 262 // 判断是否可以修改地址
263 - if (orderDetail.canUpdateDeliveryAddress === 'Y') { 263 + if (orderDetail.canUpdateDeliveryAddress === 'Y' && orderDetail.isSupportChangeProvince === 'Y') {
264 orderDetail = _.assign(orderDetail, { 264 orderDetail = _.assign(orderDetail, {
265 - changeable: true 265 + changeable: true,
  266 + addressModify: true
  267 + });
  268 + } else if (orderDetail.canUpdateDeliveryAddress === 'Y' && orderDetail.isSupportChangeProvince !== 'Y') {
  269 + orderDetail = _.assign(orderDetail, {
  270 + changeable: false,
  271 + addressModify: true
266 }); 272 });
267 } 273 }
268 274
@@ -286,13 +292,19 @@ const orderDetailData = (uid, orderCode) => { @@ -286,13 +292,19 @@ const orderDetailData = (uid, orderCode) => {
286 292
287 orderDetail = _.assign(orderDetail, { 293 orderDetail = _.assign(orderDetail, {
288 goodsAmount: orderDetail.paymentAmount, 294 goodsAmount: orderDetail.paymentAmount,
289 - url: '/home/orders/addressModify?orderCode=' + orderCode +  
290 - '&areaCode=' + orderDetail.areaCode 295 + newUrl: helpers.urlFormat('/home/orders/addressModify', {
  296 + orderCode: orderCode,
  297 + areaCode: orderDetail.areaCode
  298 + }),
  299 + url: helpers.urlFormat('/home/addressModify', {
  300 + orderCode: orderCode,
  301 + areaCode: orderDetail.areaCode
  302 + })
291 }); 303 });
292 304
293 - // 如果允许修改省  
294 - if (orderDetail.isSupportChangeProvince === 'Y' && orderDetail.provinceAreaCode) {  
295 - orderDetail.url = orderDetail.url + '&provinceAreaCode=' + orderDetail.provinceAreaCode; 305 + // 如果不允许修改省
  306 + if (orderDetail.isSupportChangeProvince !== 'Y' && orderDetail.provinceAreaCode) {
  307 + orderDetail.newUrl = orderDetail.newUrl + '&provinceAreaCode=' + orderDetail.provinceAreaCode;
296 } 308 }
297 309
298 // 为支付的拆单配送信息 310 // 为支付的拆单配送信息
@@ -47,8 +47,7 @@ @@ -47,8 +47,7 @@
47 {{#if sortNameLimits}} 47 {{#if sortNameLimits}}
48 <p>限品类:{{sortNameLimits}}</p> 48 <p>限品类:{{sortNameLimits}}</p>
49 {{/if}} 49 {{/if}}
50 -  
51 - <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isDiscount}}、限量{{/if}}等)暂不支持使用优惠券。</p> 50 + <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isLimited}}、限量{{/if}}等)暂不支持使用优惠券。</p>
52 {{#if explains}}<p>说明:{{explains}}</p>{{/if}} 51 {{#if explains}}<p>说明:{{explains}}</p>{{/if}}
53 </div> 52 </div>
54 </div> 53 </div>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 {{addressAll}} 22 {{addressAll}}
23 </p> 23 </p>
24 24
25 - <div class="rest">其他地址<span class="iconfont iconAddress">&#xe614;</span></div> 25 + <div class="rest">其他地址<span class="iconfont icon-address">&#xe614;</span></div>
26 </div> 26 </div>
27 27
28 </section> 28 </section>
@@ -108,7 +108,24 @@ @@ -108,7 +108,24 @@
108 </ul> 108 </ul>
109 {{/invoice}} 109 {{/invoice}}
110 110
  111 + {{#if unpaid}}
  112 + <div class="clock">
  113 + <ul class="count-down hide">
  114 + <li>
  115 + <span class="iconfont count-down-icon">&#xe64a;</span>
  116 + </li>
  117 + <li>
  118 + <span class="hours">{{leftTime}}</span>
  119 + </li>
  120 + </ul>
  121 + </div>
  122 + {{/if}}
  123 +
111 <div class="opt block"> 124 <div class="opt block">
  125 + {{!-- 修改地址 --}}
  126 + {{#if addressModify}}
  127 + <a href="{{newUrl}}" class="btn">修改地址</a>
  128 + {{/if}}
112 {{#if isDepositAdvance}} 129 {{#if isDepositAdvance}}
113 <div class="order-opt"> 130 <div class="order-opt">
114 <span class="order-opt-info">请到App完成订单相关操作</span> 131 <span class="order-opt-info">请到App完成订单相关操作</span>
@@ -126,19 +143,9 @@ @@ -126,19 +143,9 @@
126 {{/unless}} 143 {{/unless}}
127 144
128 {{#if unpaid}} 145 {{#if unpaid}}
129 - <ul class="count-down hide">  
130 - <li>  
131 - <span class="iconfont count-down-icon">&#xe64a;</span>  
132 - </li>  
133 - <li>  
134 - <span class="hours">{{leftTime}}</span>  
135 - </li>  
136 - </ul>  
137 <span class="btn btn-cancel">取消订单</span> 146 <span class="btn btn-cancel">取消订单</span>
138 {{#if payUrl}} 147 {{#if payUrl}}
139 - <a href="{{payUrl}}">  
140 - <span class="btn btn-pay">立即付款</span>  
141 - </a> 148 + <a class="btn btn-pay" href="{{payUrl}}">立即付款</a>
142 {{/if}} 149 {{/if}}
143 {{/if}} 150 {{/if}}
144 151
@@ -14,6 +14,12 @@ const domains = { @@ -14,6 +14,12 @@ const domains = {
14 service: 'http://service-test3.yohops.com:9999/', 14 service: 'http://service-test3.yohops.com:9999/',
15 liveApi: 'http://testapi.live.yohops.com:9999/', 15 liveApi: 'http://testapi.live.yohops.com:9999/',
16 singleApi: 'http://api-test3.yohops.com:9999/', 16 singleApi: 'http://api-test3.yohops.com:9999/',
  17 +
  18 + // api: 'http://api.yoho.yohoops.org/',
  19 + // service: 'http://service.yoho.yohoops.org/',
  20 + // liveApi: 'http://api.live.yoho.cn/',
  21 + // singleApi: 'http://single.yoho.cn/',
  22 +
17 imSocket: 'wss://imsocket.yohobuy.com:443', 23 imSocket: 'wss://imsocket.yohobuy.com:443',
18 imCs: 'https://imhttp.yohobuy.com/api', 24 imCs: 'https://imhttp.yohobuy.com/api',
19 imServer: 'https://imhttp.yohobuy.com/server' 25 imServer: 'https://imhttp.yohobuy.com/server'
@@ -42,6 +42,12 @@ @@ -42,6 +42,12 @@
42 {{#if refundApply}} 42 {{#if refundApply}}
43 <span class="btn refund">申请退款</span> 43 <span class="btn refund">申请退款</span>
44 {{/if}} 44 {{/if}}
  45 + {{!-- 修改地址 --}}
  46 + {{#if modifyAddress.modifyAddress}}
  47 + <a class="btn" href="{{modifyAddress.modifyAddressUrl}}">
  48 + <span>修改地址</span>
  49 + </a>
  50 + {{/if}}
45 </div> 51 </div>
46 {{/unless}} 52 {{/unless}}
47 {{/unless}} 53 {{/unless}}
1 {{#each list}} 1 {{#each list}}
2 -<div class="coupon-group" data-coupon-id={{couponId}}>  
3 - <div class="coupon-header">{{couponDetailInfomation}}</div>  
4 - <div class="coupon-content">  
5 - <div class="coupon-content-group1">  
6 - <p class="coupon-money">{{couponValue}}</p>  
7 - <p>{{rule4ShortName}}</p>  
8 - </div>  
9 - <div class="coupon-content-group2">  
10 - <div class="coupon-content-group2-table">  
11 - <div>  
12 - {{couponValidity}}  
13 - {{#if overState}}<span class="coupon-soon-expire">{{overState}}</span>{{/if}}  
14 - </div>  
15 - <div>  
16 - <div class="left down info-btn">详细信息<i class="iconfont"></i></div>  
17 - <div class="right">  
18 - {{#if employbg}}  
19 - <span class="employ"></span>  
20 - {{else if bestowLink}}  
21 - <a href="javascript:void(0);" data-link="{{bestowLink}}" class="btn">立即使用</a>  
22 - {{/if}} 2 + <div class="coupon-group" data-coupon-id={{couponId}}>
  3 + <div class="coupon-header">{{couponDetailInfomation}}</div>
  4 + <div class="coupon-content">
  5 + <div class="coupon-content-group1">
  6 + <p class="coupon-money">{{couponValue}}</p>
  7 + <p>{{rule4ShortName}}</p>
  8 + </div>
  9 + <div class="coupon-content-group2">
  10 + <div class="coupon-content-group2-table">
  11 + <div>
  12 + {{couponValidity}}
  13 + {{#if overState}}<span class="coupon-soon-expire">{{overState}}</span>{{/if}}
  14 + </div>
  15 + <div>
  16 + <div class="left down info-btn">详细信息<i class="iconfont"></i></div>
  17 + <div class="right">
  18 + {{#if employbg}}
  19 + <span class="employ"></span>
  20 + {{else if bestowLink}}
  21 + <a href="javascript:void(0);" data-link="{{bestowLink}}" class="btn">立即使用</a>
  22 + {{/if}}
  23 + </div>
23 </div> 24 </div>
24 </div> 25 </div>
25 </div> 26 </div>
26 </div> 27 </div>
27 - </div>  
28 - <div class="coupon-footer hide">  
29 - {{#if isNoLimit}}  
30 - <p>全场通用</p>  
31 - {{/if}} 28 + <div class="coupon-footer hide">
  29 + {{#if isNoLimit}}
  30 + <p>全场通用</p>
  31 + {{/if}}
32 32
33 - {{#if brandNameLimits}}  
34 - <p>限品牌:{{brandNameLimits}}</p>  
35 - {{/if}} 33 + {{#if brandNameLimits}}
  34 + <p>限品牌:{{brandNameLimits}}</p>
  35 + {{/if}}
36 36
37 - {{#if sortNameLimits}}  
38 - <p>限品类:{{sortNameLimits}}</p>  
39 - {{/if}} 37 + {{#if sortNameLimits}}
  38 + <p>限品类:{{sortNameLimits}}</p>
  39 + {{/if}}
40 40
41 - <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isDiscount}}、限量{{/if}}等)暂不支持使用优惠券。</p>  
42 - {{#if explains}}<p>说明:{{explains}}</p>{{/if}} 41 + <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isLimited}}、限量{{/if}}等)暂不支持使用优惠券。</p>
  42 + {{#if explains}}<p>说明:{{explains}}</p>{{/if}}
  43 + </div>
43 </div> 44 </div>
44 -</div>  
45 {{/each}} 45 {{/each}}
@@ -109,7 +109,7 @@ @@ -109,7 +109,7 @@
109 color: #f00; 109 color: #f00;
110 font-size: 24px; 110 font-size: 24px;
111 111
112 - .iconAddress { 112 + .icon-address {
113 position: static; 113 position: static;
114 font-size: 24px; 114 font-size: 24px;
115 } 115 }
@@ -201,33 +201,36 @@ @@ -201,33 +201,36 @@
201 font-size: 24px; 201 font-size: 24px;
202 } 202 }
203 203
204 - .count-down {  
205 - list-style: none;  
206 - padding: 0;  
207 - display: inline-block;  
208 - text-align: right;  
209 - font-size: 24px;  
210 - color: #b0b0b0;  
211 - float: left;  
212 - margin-left: 30px;  
213 - margin-top: 20px; 204 + .clock {
  205 + width: 100%;
  206 + height: 52px;
  207 + background-color: #787878;
  208 + text-align: center;
214 209
215 - .count-down-icon {  
216 - margin-top: -8px;  
217 - font-size: 30px;  
218 - } 210 + .count-down {
  211 + list-style: none;
  212 + line-height: 56px;
  213 + display: inline-block;
  214 + font-size: 24px;
  215 + color: #fff;
219 216
220 - &.hide {  
221 - display: none;  
222 - } 217 + .count-down-icon {
  218 + margin-top: -8px;
  219 + font-size: 30px;
  220 + }
223 221
224 - li {  
225 - display: inline-block;  
226 - } 222 + &.hide {
  223 + display: none;
  224 + }
227 225
228 - li span {  
229 - font-size: 24px;  
230 - line-height: 24px; 226 + li {
  227 + display: inline-block;
  228 + }
  229 +
  230 + li span {
  231 + font-size: 24px;
  232 + line-height: 24px;
  233 + }
231 } 234 }
232 } 235 }
233 236
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 .coupon-content { 45 .coupon-content {
46 border-radius: 0 0 10px 10px; 46 border-radius: 0 0 10px 10px;
47 height: 140px; 47 height: 140px;
48 - border-top: 1px dashed #e53333; 48 + border-top: 2px dashed #e53333;
49 display: table; 49 display: table;
50 padding: 15px 0; 50 padding: 15px 0;
51 background-color: #f06a6b; 51 background-color: #f06a6b;
@@ -129,7 +129,7 @@ @@ -129,7 +129,7 @@
129 display: block; 129 display: block;
130 z-index: 2; 130 z-index: 2;
131 right: 37px; 131 right: 37px;
132 - margin-top: -90px; 132 + margin-top: -95px;
133 background-image: resolve("home/employ.png"); 133 background-image: resolve("home/employ.png");
134 background-size: cover; 134 background-size: cover;
135 } 135 }
@@ -139,7 +139,7 @@ @@ -139,7 +139,7 @@
139 .coupon-footer { 139 .coupon-footer {
140 background-color: #f06a6b; 140 background-color: #f06a6b;
141 padding: 20px; 141 padding: 20px;
142 - font-size: 20px; 142 + font-size: 18px;
143 border-radius: 10px; 143 border-radius: 10px;
144 color: #fff; 144 color: #fff;
145 border-top: 1px dashed #fff; 145 border-top: 1px dashed #fff;