Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -1246,3 +1246,29 @@ @@ -1246,3 +1246,29 @@
1246 'isCollect':true// 1246 'isCollect':true//
1247 } 1247 }
1248 } 1248 }
  1249 +
  1250 +### 支付中心
  1251 +
  1252 + {
  1253 + 'payAppInfo' : {
  1254 + 'appIcon' : 'http://static.yohobuy.com/images/icon.png',
  1255 + 'payLink' : '/weixin/pay/'
  1256 + 'app' : '微信支付',
  1257 + 'hint' : '需下载微信客户端',
  1258 + 'subHint' : '推荐使用'
  1259 + }
  1260 + }
  1261 +
  1262 +### 物流详情
  1263 +
  1264 + {
  1265 + 'logisticImg' : 'http://static.yohobuy.com/images/icon.png',
  1266 + 'logisticUrl' : 'http://www.shunfeng.com',
  1267 + 'logisticCompany' : '顺丰',
  1268 + 'logisticNumber' : '1231231231',
  1269 + 'logisticDetail' : {
  1270 + 'status' : '南京市 派送中',
  1271 + 'date' : '2015-12-03'
  1272 + }
  1273 + }
  1274 +
@@ -15,3 +15,5 @@ require('./address'); @@ -15,3 +15,5 @@ require('./address');
15 require('./suggest'); 15 require('./suggest');
16 require('./browse-record'); 16 require('./browse-record');
17 require('./address-act'); 17 require('./address-act');
  18 +require('./logistic');
  19 +require('./pay');
@@ -127,10 +127,22 @@ orderHammer.on('tap', function(e) { @@ -127,10 +127,22 @@ orderHammer.on('tap', function(e) {
127 }, 127 },
128 success: function(data) { 128 success: function(data) {
129 if (data.code === 200) { 129 if (data.code === 200) {
  130 + dialog.showDialog({
  131 + dialogText: '删除订单成功',
  132 + autoHide: true,
  133 + fast: true
  134 + });
130 135
131 //删除订单页面刷新 136 //删除订单页面刷新
132 history.go(0); 137 history.go(0);
133 } 138 }
  139 + },
  140 + error: function() {
  141 + dialog.showDialog({
  142 + dialogText: '删除订单失败',
  143 + autoHide: true,
  144 + fast: true
  145 + });
134 } 146 }
135 }); 147 });
136 }); 148 });
@@ -152,10 +164,22 @@ orderHammer.on('tap', function(e) { @@ -152,10 +164,22 @@ orderHammer.on('tap', function(e) {
152 }, 164 },
153 success: function(data) { 165 success: function(data) {
154 if (data.code === 200) { 166 if (data.code === 200) {
  167 + dialog.showDialog({
  168 + dialogText: '取消订单成功',
  169 + autoHide: true,
  170 + fast: true
  171 + });
155 172
156 //取消订单页面刷新 173 //取消订单页面刷新
157 history.go(0); 174 history.go(0);
158 } 175 }
  176 + },
  177 + error: function() {
  178 + dialog.showDialog({
  179 + dialogText: '取消订单失败',
  180 + autoHide: true,
  181 + fast: true
  182 + });
159 } 183 }
160 }); 184 });
161 }); 185 });
@@ -3,12 +3,11 @@ @@ -3,12 +3,11 @@
3 * @author: 赵彪<bill.zhao@yoho.cn> 3 * @author: 赵彪<bill.zhao@yoho.cn>
4 * @date: 2015/12/03 4 * @date: 2015/12/03
5 */ 5 */
6 - 6 +var loading = require('../plugin/loading');
7 7
8 function isWXOpen() { 8 function isWXOpen() {
9 var ua = navigator.userAgent.toLowerCase(); 9 var ua = navigator.userAgent.toLowerCase();
10 10
11 -  
12 if (ua.match(/MicroMessenger/i) === 'micromessenger') { 11 if (ua.match(/MicroMessenger/i) === 'micromessenger') {
13 return true; 12 return true;
14 } else { 13 } else {
@@ -19,7 +18,6 @@ function isWXOpen() { @@ -19,7 +18,6 @@ function isWXOpen() {
19 function hideWeChatPay() { 18 function hideWeChatPay() {
20 var payApps = document.getElementsByClassName('app'); 19 var payApps = document.getElementsByClassName('app');
21 20
22 -  
23 [].forEach.call(payApps, function(app, index) { 21 [].forEach.call(payApps, function(app, index) {
24 if (app.innerHTML.indexOf('微信') !== -1) { 22 if (app.innerHTML.indexOf('微信') !== -1) {
25 app.parentNode.style.display = 'none'; 23 app.parentNode.style.display = 'none';
@@ -29,9 +27,61 @@ function hideWeChatPay() { @@ -29,9 +27,61 @@ function hideWeChatPay() {
29 } 27 }
30 28
31 function handleForWX() { 29 function handleForWX() {
32 - if (isWXOpen()) { 30 + if (!isWXOpen()) {
33 hideWeChatPay(); 31 hideWeChatPay();
34 } 32 }
35 } 33 }
36 34
37 -window.onload = handleForWX; 35 +function setIcon(div, appName) {
  36 +
  37 + if (appName.indexOf('百度') !== -1) {
  38 + div.style.backgroundPositionY = '-2.7rem';
  39 + return false;
  40 + }
  41 +
  42 + if (appName.indexOf('微信') !== -1) {
  43 + div.style.backgroundPositionY = '-1.2rem';
  44 + return false;
  45 + }
  46 +
  47 + if (appName.indexOf('银联') !== -1) {
  48 + div.style.backgroundPositionY = '-4rem';
  49 + return false;
  50 + }
  51 +
  52 + if (appName.indexOf('QQ') !== -1) {
  53 + div.style.backgroundPositionY = '-5.4rem';
  54 + return false;
  55 + }
  56 +}
  57 +
  58 +function loadIcon() {
  59 + var boxs = document.getElementsByClassName('box');
  60 + var div = null;
  61 + var appName = null;
  62 +
  63 + [].forEach.call(boxs, function(box, index) {
  64 + div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0];
  65 + if (div) {
  66 + appName = box.getElementsByClassName('app')[0].innerHTML;
  67 + setIcon(div, appName);
  68 + }
  69 + });
  70 +}
  71 +
  72 +function showPage() {
  73 + var pageList = document.getElementsByClassName('payapp-list')[0];
  74 +
  75 + pageList.style.visibility = 'visible';
  76 +}
  77 +
  78 +function main() {
  79 + handleForWX();
  80 + loading.hideLoadingMask();
  81 + showPage();
  82 + loadIcon();
  83 +}
  84 +
  85 +loading.showLoadingMask();
  86 +
  87 +window.onload = main;
@@ -82,6 +82,9 @@ headerNavHammer.on('tap', function(e) { @@ -82,6 +82,9 @@ headerNavHammer.on('tap', function(e) {
82 autoHide: true, 82 autoHide: true,
83 dialogText: '提交成功' 83 dialogText: '提交成功'
84 }); 84 });
  85 + setTimeout(function() {
  86 + location.pathname = 'home/suggest';
  87 + }, 2000);
85 } 88 }
86 }).fail(function() { 89 }).fail(function() {
87 90
1 $vip: sprite-map("me/vip/*.png", $spacing: 10px); 1 $vip: sprite-map("me/vip/*.png", $spacing: 10px);
2 $fav: sprite-map("me/fav/*.png", $spacing: 5px); 2 $fav: sprite-map("me/fav/*.png", $spacing: 5px);
3 3
4 -@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record"; 4 +@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "pay";
5 5
1 .pay-page { 1 .pay-page {
2 padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0; 2 padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
3 3
  4 + .payapp-list {
  5 + visibility: hidden;
  6 + }
  7 +
4 .box { 8 .box {
5 border: 1px solid #eee; 9 border: 1px solid #eee;
6 border-radius: 10rem / $pxConvertRem; 10 border-radius: 10rem / $pxConvertRem;
@@ -16,31 +20,37 @@ @@ -16,31 +20,37 @@
16 } 20 }
17 21
18 .icon { 22 .icon {
19 - flex-grow: 0.3; 23 + width: 15%;
20 24
21 img { 25 img {
22 width: 60rem / $pxConvertRem; 26 width: 60rem / $pxConvertRem;
23 margin: 0; 27 margin: 0;
24 } 28 }
  29 + > div {
  30 + width: 60rem / $pxConvertRem;
  31 + height: 60rem / $pxConvertRem;
  32 + background-image: url(http://localhost:8000/img/layout/pay-icon.png);
  33 + background-size: 90%;
  34 + background-position-y: 8rem / $pxConvertRem;
  35 + background-position-x: center;
  36 + background-repeat: no-repeat;
  37 + }
25 } 38 }
26 39
27 .app { 40 .app {
28 - flex-grow: 3; 41 + width: 40%;
29 font-size: 32rem / $pxConvertRem; 42 font-size: 32rem / $pxConvertRem;
30 color: #414141; 43 color: #414141;
31 -  
32 - //padding-left: 20rem/$pxConvertRem  
33 -  
34 } 44 }
35 45
36 .hint { 46 .hint {
37 - flex-grow: 4; 47 + width: 40%;
38 font-size: 24rem / $pxConvertRem; 48 font-size: 24rem / $pxConvertRem;
39 color: #4b4b4b; 49 color: #4b4b4b;
40 } 50 }
41 51
42 .iconfont { 52 .iconfont {
43 - flex-grow: 1; 53 + width: 5%;
44 justify-content: flex-end; 54 justify-content: flex-end;
45 color: #e0e0e0; 55 color: #e0e0e0;
46 font-size: 28rem / $pxConvertRem; 56 font-size: 28rem / $pxConvertRem;
1 -{{> layout/header}}  
2 -<div class="logistic-page yoho-page">  
3 - <div class="overview">  
4 - <div class="left" >  
5 - <div class="icon" style='background-image:url("{{logisticImg}}")'> </div>  
6 - </div>  
7 -  
8 - <div class="right">  
9 - <div>  
10 - <span class='info'>物流公司:</span>  
11 - <span >{{logisticCompany}}</span>  
12 - </div>  
13 - <div>  
14 - <span class='info'>快递单号:</span>  
15 - <span>{{logisticNumber}}</span>  
16 - </div>  
17 - </div>  
18 -  
19 - </div>  
20 -  
21 - <div class="title">  
22 - <span>物流详情</span>  
23 - </div>  
24 -  
25 - <div class="detail">  
26 - {{# logisticDetail}}  
27 - <div class="timeline-box ">  
28 - <span class="timeline-node"></span>  
29 - <div class="timeline-info">  
30 - <div class="timeline-info-row">  
31 - {{ city}}&nbsp;&nbsp;&nbsp;{{ status}}  
32 - </div>  
33 - <div class="timeline-info-row">  
34 - {{date}}  
35 - </div>  
36 - </div>  
37 - </div>  
38 - {{/ logisticDetail}}  
39 - </div>  
40 -</div>  
41 -{{> layout/footer}}  
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="pay-page yoho-page"> 2 <div class="pay-page yoho-page">
  3 + <div class="payapp-list">
3 {{# payAppInfo}} 4 {{# payAppInfo}}
  5 + <a href="{{payLink}}">
4 <div class="box"> 6 <div class="box">
5 <div class="icon"> 7 <div class="icon">
  8 + {{#if appIcon}}
6 <img src="{{appIcon}}" alt="app图标"> 9 <img src="{{appIcon}}" alt="app图标">
  10 + {{else}}
  11 + <div></div>
  12 + {{/if}}
7 </div> 13 </div>
8 <div class="app">{{app}}</div> 14 <div class="app">{{app}}</div>
9 <div class="hint"> 15 <div class="hint">
@@ -12,12 +18,12 @@ @@ -12,12 +18,12 @@
12 <br> 18 <br>
13 {{subHint}} 19 {{subHint}}
14 {{/if}} 20 {{/if}}
15 -  
16 </div> 21 </div>
17 <div class="iconfont">&#xe604</div> 22 <div class="iconfont">&#xe604</div>
18 </div> 23 </div>
  24 + </a>
19 {{/ payAppInfo}} 25 {{/ payAppInfo}}
20 - 26 + </div>
21 </div> 27 </div>
22 {{> layout/footer}} 28 {{> layout/footer}}
23 29
@@ -288,7 +288,10 @@ @@ -288,7 +288,10 @@
288 </script> 288 </script>
289 {{/if}} 289 {{/if}}
290 {{#if logisticInfoPage}} 290 {{#if logisticInfoPage}}
291 -<script>  
292 seajs.use('js/me/logistic'); 291 seajs.use('js/me/logistic');
  292 +{{/if}}
  293 +{{#if payCenterPage}}
  294 +<script>
  295 + seajs.use('js/me/pay');
293 </script> 296 </script>
294 {{/if}} 297 {{/if}}
@@ -104,7 +104,7 @@ class SideModel @@ -104,7 +104,7 @@ class SideModel
104 'textCn' => '查看全部', 104 'textCn' => '查看全部',
105 'textEn' => '', 105 'textEn' => '',
106 'back' => false, 106 'back' => false,
107 - 'isSelect' => ($guangChoosed === 'all') ? true : false, 107 + 'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
108 'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang') 108 'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
109 ), 109 ),
110 2 => array( 110 2 => array(
@@ -239,8 +239,8 @@ class UserModel @@ -239,8 +239,8 @@ class UserModel
239 $product = array(); 239 $product = array();
240 $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; 240 $product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
241 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; 241 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
242 - $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;  
243 - $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0; 242 + $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
  243 + $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0;
244 244
245 $brand['productList'][] = $product; 245 $brand['productList'][] = $product;
246 } 246 }