Authored by ccbikai

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

<div class="my-page">
<div class="my-header">
<span class="setting icon icon-setting" id="setting"></span>
<a class="user-info no-intercept" id="user-info" href='/home/mydetails'>
<a class="user-info" id="user-info" href='/home/mydetails'>
<span class="user-avatar" {{#if head_ico}} style="background-image: url('{{head_ico}}');" {{/if}}></span>
<br><span class="username">{{nickname}}</span>
</a>
</div>
<div class="my-order">
<a class="order-title no-intercept" href="/home/orders?type=1">
<a class="order-title" href="/home/orders?type=1">
我的订单
<span class="read-order">
查看全部订单 <span class="icon icon-right"></span>
</span>
</a>
<div class="order-type clearfix">
<a class="type-item no-intercept" href="/home/orders?type=2">
<a class="type-item" href="/home/orders?type=2">
<span class="icon icon-wait-pay"></span>
<br>待付款
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item no-intercept" href="/home/orders?type=3">
<a class="type-item" href="/home/orders?type=3">
<span class="icon icon-wait-cargo"></span>
<br>待发货
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item no-intercept" href="/home/orders?type=4">
<a class="type-item" href="/home/orders?type=4">
<span class="icon icon-send-cargo"></span>
<br>待收货
{{#if send_cargo_num}}
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item no-intercept" href="/home/refund/orders">
<a class="type-item" href="/home/refund/orders">
<span class="icon icon-refund-exchange"></span>
<br>退换货
{{#if refund_exchange_num}}
... ... @@ -45,7 +45,7 @@
</div>
</div>
<div class="group-list">
<a class="list-item no-intercept" id="address">
<a class="list-item" id="address">
地址管理
<span class="num">{{address_num}} <span class="icon icon-right"></span></span>
</a>
... ... @@ -61,17 +61,17 @@
</a>
</div>
<div class="group-list">
<a class="list-item no-intercept" href="/home/mycurrency">
<a class="list-item" href="/home/mycurrency">
YOHO 币
<span class="num">{{yoho_coin_num}} <span class="icon icon-right"></span></span>
</a>
</div>
<div class="group-list">
<a class="list-item no-intercept" href="/home/help">
<a class="list-item" href="/home/help">
帮助中心
<span class="num"><span class="icon icon-right"></span></span>
</a>
<a class="list-item no-intercept" href="/home/service">
<a class="list-item" href="/home/service">
在线客服
<span class="num"><span class="icon icon-right"></span></span>
</a>
... ...
var yoho = require('yoho');
var $ = require('yoho-jquery');
var interceptClick = require('common/intercept-click');
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
'type': '2'
if (!yoho.isLogin) {
$('a').addClass('no-intercept');
$('a').on('click', function(){
yoho.goLogin();
return false;
})
} else {
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
'type': '2'
});
return false;
});
return false;
});
}
// 系统设置
$('#setting').on('click', function() {
yoho.goSetting();
return false;
});
$('.my-page').on('click', 'a', function() {
// 未登录时跳转至登录页
if (!yoho.isLogin) {
yoho.goLogin();
return false;
}
// 拦截跳转
var href = $(this).attr('href');
if (href) {
interceptClick(href);
return false;
}
});
... ...
... ... @@ -65,14 +65,15 @@
tab: 'brand'
}
}).then(data => {
if (_this.page === data.pageTotal) {
if (data.pageTotal && _this.page === data.pageTotal) {
_this.busy = true;
} else {
_this.busy = false;
}
data.brandList.forEach(function(o){
if (!_this.keys[o.brandId]) {
if (data.brandList) {
data.brandList.forEach(function(o){
if (!_this.keys[o.brandId]) {
_this.keys[o.brandId] = true;
_this.brandData.push({
... ... @@ -83,7 +84,8 @@
down: o.status === 0
});
}
})
});
}
_this.nullbox = _this.brandData.length ? 'hide' : '';
}).fail(() => {
... ...
... ... @@ -69,38 +69,40 @@
page: ++_this.page
}
}).then(data => {
if (_this.page === data.pageTotal) {
if (data.pageTotal && _this.page === data.pageTotal) {
_this.busy = true;
} else {
_this.busy = false;
}
data.productList.forEach(function(o){
if (!o.productSkn) {
return;
}
if (!_this.keys[o.productId]) {
_this.keys[o.productId] = true;
let discountPrice = false;
if (Number(o.marketPrice) - Number(o.salesPrice) > 0) {
discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2);
if (data.productList) {
data.productList.forEach(function(o){
if (!o.productSkn) {
return;
}
_this.productData.push({
fav_id: o.productId,
link: o.goodsId && o.cnAlphabet ? o.productId : '',
imgUrl: o.image,
title: o.productName,
price: '¥' + Number(Math.max(o.marketPrice, 0)).toFixed(2),
discountPrice: discountPrice,
sellOut: o.storage <= 0,
invalidGoods: o.status === 0
});
}
})
if (!_this.keys[o.productId]) {
_this.keys[o.productId] = true;
let discountPrice = false;
if (Number(o.marketPrice) - Number(o.salesPrice) > 0) {
discountPrice = '¥' + Number(Math.max(o.salesPrice, 0)).toFixed(2);
}
_this.productData.push({
fav_id: o.productId,
link: o.goodsId && o.cnAlphabet ? o.productId : '',
imgUrl: o.image,
title: o.productName,
price: '¥' + Number(Math.max(o.marketPrice, 0)).toFixed(2),
discountPrice: discountPrice,
sellOut: o.storage <= 0,
invalidGoods: o.status === 0
});
}
});
}
_this.nullbox = _this.productData.length ? 'hide' : '';
}).fail(() => {
... ...