Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -28,7 +28,7 @@ const component = {
page: 'index',
noLocalCSS: true,
head_ico: proData && proData.head_ico ? helpers.image(proData.head_ico, 200, 200) : '',
nickname: proData ? proData.nickname : '登录/注册'
nickname: Object.keys(proData).length ? proData.nickname : '登录/注册'
};
res.render('index', Object.assign(result, data[1]));
... ... @@ -41,7 +41,6 @@ const component = {
var gender = '';
data = data || {};
if (data.gender === '1') {
gender = 'men';
} else if (data.gender === '2') {
... ...
... ... @@ -12,7 +12,7 @@ const helpers = global.yoho.helpers;
*/
const _getUserProfileData = exports.getUserProfileData = (uid) => {
if (!uid) {
return;
return Promise.resolve({});
}
return api.get('', {
... ... @@ -33,7 +33,7 @@ const _getUserProfileData = exports.getUserProfileData = (uid) => {
*/
const _getInfoNumData = (uid) => {
if (!uid) {
return;
return Promise.resolve({});
}
return api.all([api.get('', {
... ...
<template>
<tab v-bind:page="'cate'"></tab>
<div class="cate-page" id='cate-page'>
<div class="cate-nav clearfix">
<ul>
<li v-for="(index, cate) in brandCate" v-on:click='cateNavTopFun(index)' v-bind:class="{focus: index === topcurrent}" v-bind:style="{width: widthli + '%'}">
<span>{{index}}</span>
</li>
</ul>
</div>
<!--<div class="cate-nav clearfix">-->
<!--<ul>-->
<!--<li v-for="(index, cate) in brandCate" v-on:click='cateNavTopFun(index)' v-bind:class="{focus: index === topcurrent}" v-bind:style="{width: widthli + '%'}">-->
<!--<span>{{index}}</span>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<div class="cate-container clearfix">
<div class="content" style="height: 522px;">
<ul class="primary-level">
... ... @@ -31,6 +32,10 @@
font-size: 36px;
font-family: helvetica, Arial, "黑体";
.cate-container {
margin-top: 80px;
}
ul,
li {
margin: 0;
... ... @@ -202,11 +207,21 @@
const tab = require('channel/tab.vue');
const contentCode = require('content-code');
const qs = require('yoho-qs');
const bus = require('common/vue-bus');
const genderCode = {
MEN男士: '1,3',
WOMEN女士: '2,3',
LIFESTYLE生活: '1,2,3'
const channelTrans = {
men: {
key: 'MEN男士',
code: '1,3'
},
women: {
key: 'WOMEN女士',
code: '2,3'
},
lifestyle: {
key: 'LIFESTYLE生活',
code: '1,2,3'
}
};
module.exports = {
... ... @@ -226,6 +241,8 @@
},
methods: {
getCateList() {
let self = this;
let data = {
channel: ''
};
... ... @@ -235,20 +252,14 @@
data: data
}).then(result => {
if (result) {
this.brandCate = result;
this.cateNavLeftData = result['MEN男士'];
this.cateNavRightData = result['MEN男士'][0].sub;
self.$set('brandCate', result);
self.$set('cateNavLeftData', result['MEN男士']);
self.$set('cateNavRightData', result['MEN男士'][0].sub);
}
}).fail(() => {
tip('网络错误');
});
},
cateNavTopFun(index) {
this.topcurrent = index;
this.gender = genderCode[index];
this.cateNavLeftData = this.brandCate[index];
this.cateNavRightData = this.cateNavLeftData[0].sub;
},
cateNavLeftFun(index) {
this.leftcurrent = index;
this.cateNavRightData = this.cateNavLeftData[index].sub;
... ... @@ -258,7 +269,15 @@
tab
},
created() {
const self = this;
this.getCateList();
bus.$on('channel.change', function(page, channel) {
self.gender = channelTrans[channel].code;
self.cateNavLeftData = self.brandCate[channelTrans[channel].key];
self.cateNavRightData = self.cateNavLeftData[0].sub;
});
}
};
</script>
... ...
... ... @@ -48,8 +48,12 @@
}
.brand-name {
white-space: nowrap;
width: 100%;
color: #d0d0d0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
}
}
}
... ...
... ... @@ -65,7 +65,7 @@
tab: 'brand'
}
}).then(data => {
if ($.isEmptyObject(data)) {
if ($.isEmptyObject(data) || data.pageTotal === 0) {
_this.busy = true;
} else {
if (data.pageTotal && _this.page === data.pageTotal) {
... ... @@ -214,11 +214,11 @@
},
ltitle: {
des: '商品',
action: origin + '/me/collection'
action: location.origin + '/me/collection'
},
rtitle: {
des: '品牌',
action: origin + '/me/collection?tab=brand'
action: location.origin + '/me/collection?tab=brand'
},
right: {
des: _this.editmodel ? '完成' : '编辑',
... ...
... ... @@ -69,7 +69,7 @@
page: ++_this.page
}
}).then(data => {
if ($.isEmptyObject(data)) {
if ($.isEmptyObject(data) || data.pageTotal === 0) {
_this.busy = true;
} else {
if (_this.page === data.pageTotal) {
... ... @@ -231,11 +231,11 @@
},
ltitle: {
des: '商品',
action: origin + '/me/collection'
action: location.origin + '/me/collection'
},
rtitle: {
des: '品牌',
action: origin + '/me/collection?tab=brand'
action: location.origin + '/me/collection?tab=brand'
},
right: {
des: _this.editmodel ? '完成' : '编辑',
... ...
... ... @@ -47,7 +47,7 @@
<div class="order-empty {{emptybox}}">
<p>您暂时还没有订单</p>
<p>Your do not have an order <br>for the time being</p>
<a href="/new">去购物</a>
<a href="/new">随便逛逛</a>
</div>
<select id="cancel-reason" class="cancel-reason" v-on:change="reasonChange" v-model="selected">
<option v-for="option in options" v-bind:value="{id:option.id}">{{option.reason}}</option>
... ...
... ... @@ -109,7 +109,7 @@
this.inSearching = true;
$.get(this.url, Object.assign({
page: this.page
page: nextPage
}, this.filter, locationQuery)).done(result => {
if (result.code === 200) {
self.page = result.data.page;
... ...
<template>
<div class="top-box clearfix" v-bind:class='{"top-box-left" : this.$parent.$refs.filter.isVisible,"top-change" : topChange || !shareData.isBlkShop}' v-infinite-scroll="changeTopStatus()">
<span class="icon icon-back back" @click="goBack()"></span>
<span v-if="!shareData.isBlkShop">{{shareData.brandName}}</span>
<span class="brand-name" v-if="!shareData.isBlkShop">{{shareData.brandName}}</span>
<div class="right">
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()">&#xe60d;</span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
... ... @@ -28,6 +28,16 @@
width: 60px;
height: 60px;
float: left;
font-size: 52px;
}
.brand-name {
display: inline-block;
max-width: 78%;
height: 60px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.right {
... ...