Authored by hf

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

... ... @@ -1246,3 +1246,29 @@
'isCollect':true//
}
}
### 支付中心
{
'payAppInfo' : {
'appIcon' : 'http://static.yohobuy.com/images/icon.png',
'payLink' : '/weixin/pay/'
'app' : '微信支付',
'hint' : '需下载微信客户端',
'subHint' : '推荐使用'
}
}
### 物流详情
{
'logisticImg' : 'http://static.yohobuy.com/images/icon.png',
'logisticUrl' : 'http://www.shunfeng.com',
'logisticCompany' : '顺丰',
'logisticNumber' : '1231231231',
'logisticDetail' : {
'status' : '南京市 派送中',
'date' : '2015-12-03'
}
}
... ...
... ... @@ -15,3 +15,5 @@ require('./address');
require('./suggest');
require('./browse-record');
require('./address-act');
require('./logistic');
require('./pay');
... ...
... ... @@ -127,10 +127,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '删除订单成功',
autoHide: true,
fast: true
});
//删除订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '删除订单失败',
autoHide: true,
fast: true
});
}
});
});
... ... @@ -152,10 +164,22 @@ orderHammer.on('tap', function(e) {
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '取消订单成功',
autoHide: true,
fast: true
});
//取消订单页面刷新
history.go(0);
}
},
error: function() {
dialog.showDialog({
dialogText: '取消订单失败',
autoHide: true,
fast: true
});
}
});
});
... ...
... ... @@ -3,12 +3,11 @@
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/03
*/
var loading = require('../plugin/loading');
function isWXOpen() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
return true;
} else {
... ... @@ -19,7 +18,6 @@ function isWXOpen() {
function hideWeChatPay() {
var payApps = document.getElementsByClassName('app');
[].forEach.call(payApps, function(app, index) {
if (app.innerHTML.indexOf('微信') !== -1) {
app.parentNode.style.display = 'none';
... ... @@ -29,9 +27,61 @@ function hideWeChatPay() {
}
function handleForWX() {
if (isWXOpen()) {
if (!isWXOpen()) {
hideWeChatPay();
}
}
window.onload = handleForWX;
function setIcon(div, appName) {
if (appName.indexOf('百度') !== -1) {
div.style.backgroundPositionY = '-2.7rem';
return false;
}
if (appName.indexOf('微信') !== -1) {
div.style.backgroundPositionY = '-1.2rem';
return false;
}
if (appName.indexOf('银联') !== -1) {
div.style.backgroundPositionY = '-4rem';
return false;
}
if (appName.indexOf('QQ') !== -1) {
div.style.backgroundPositionY = '-5.4rem';
return false;
}
}
function loadIcon() {
var boxs = document.getElementsByClassName('box');
var div = null;
var appName = null;
[].forEach.call(boxs, function(box, index) {
div = box.getElementsByClassName('icon')[0].getElementsByTagName('div')[0];
if (div) {
appName = box.getElementsByClassName('app')[0].innerHTML;
setIcon(div, appName);
}
});
}
function showPage() {
var pageList = document.getElementsByClassName('payapp-list')[0];
pageList.style.visibility = 'visible';
}
function main() {
handleForWX();
loading.hideLoadingMask();
showPage();
loadIcon();
}
loading.showLoadingMask();
window.onload = main;
... ...
... ... @@ -82,6 +82,9 @@ headerNavHammer.on('tap', function(e) {
autoHide: true,
dialogText: '提交成功'
});
setTimeout(function() {
location.pathname = 'home/suggest';
}, 2000);
}
}).fail(function() {
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "pay";
... ...
.pay-page {
padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
.payapp-list {
visibility: hidden;
}
.box {
border: 1px solid #eee;
border-radius: 10rem / $pxConvertRem;
... ... @@ -16,31 +20,37 @@
}
.icon {
flex-grow: 0.3;
width: 15%;
img {
width: 60rem / $pxConvertRem;
margin: 0;
}
> div {
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
background-image: url(http://localhost:8000/img/layout/pay-icon.png);
background-size: 90%;
background-position-y: 8rem / $pxConvertRem;
background-position-x: center;
background-repeat: no-repeat;
}
}
.app {
flex-grow: 3;
width: 40%;
font-size: 32rem / $pxConvertRem;
color: #414141;
//padding-left: 20rem/$pxConvertRem
}
.hint {
flex-grow: 4;
width: 40%;
font-size: 24rem / $pxConvertRem;
color: #4b4b4b;
}
.iconfont {
flex-grow: 1;
width: 5%;
justify-content: flex-end;
color: #e0e0e0;
font-size: 28rem / $pxConvertRem;
... ...
{{> layout/header}}
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<div class="icon" style='background-image:url("{{logisticImg}}")'> </div>
</div>
<div class="right">
<div>
<span class='info'>物流公司:</span>
<span >{{logisticCompany}}</span>
</div>
<div>
<span class='info'>快递单号:</span>
<span>{{logisticNumber}}</span>
</div>
</div>
</div>
<div class="title">
<span>物流详情</span>
</div>
<div class="detail">
{{# logisticDetail}}
<div class="timeline-box ">
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{ city}}&nbsp;&nbsp;&nbsp;{{ status}}
</div>
<div class="timeline-info-row">
{{date}}
</div>
</div>
</div>
{{/ logisticDetail}}
</div>
</div>
{{> layout/footer}}
{{> layout/header}}
<div class="pay-page yoho-page">
<div class="payapp-list">
{{# payAppInfo}}
<a href="{{payLink}}">
<div class="box">
<div class="icon">
{{#if appIcon}}
<img src="{{appIcon}}" alt="app图标">
{{else}}
<div></div>
{{/if}}
</div>
<div class="app">{{app}}</div>
<div class="hint">
... ... @@ -12,12 +18,12 @@
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
</div>
</a>
{{/ payAppInfo}}
</div>
</div>
{{> layout/footer}}
... ...
... ... @@ -288,7 +288,10 @@
</script>
{{/if}}
{{#if logisticInfoPage}}
<script>
seajs.use('js/me/logistic');
{{/if}}
{{#if payCenterPage}}
<script>
seajs.use('js/me/pay');
</script>
{{/if}}
... ...
... ... @@ -104,7 +104,7 @@ class SideModel
'textCn' => '查看全部',
'textEn' => '',
'back' => false,
'isSelect' => ($guangChoosed === 'all') ? true : false,
'isSelect' => ($guangChoosed === 'lifestyle' || $guangChoosed === 'kids') ? true : false,
'url' => Helpers::url('', array('gender' => '1,2,3'), 'guang')
),
2 => array(
... ...
... ... @@ -239,8 +239,8 @@ class UserModel
$product = array();
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0;
$brand['productList'][] = $product;
}
... ...