Authored by ccbikai

Merge branch 'develop' into release/1.0

... ... @@ -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('', {
... ...
... ... @@ -92,11 +92,8 @@ if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohoblk.com for test',
domains: {
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
api: 'http://api-test1.yohops.com:9999/',
service: 'http://service-test1.yohops.com:9999/'
},
memcache: {
master: ['127.0.0.1:12111'],
... ...
... ... @@ -45,7 +45,7 @@ function Select(items) {
lis.each(function(index) {
if ($(this).attr('status') === 'false' || $(this).attr('status') === '') {
$(this).click(function(e) {
$(this).click(function() {
hide();
cb(items[index]);
});
... ...
<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) {
... ... @@ -103,6 +103,8 @@
$('#li-' + id).css('transform', 'translateX(-' + width + 'px)');
delBtn.removeClass('hide');
this.pandata.id = id;
this.pandata.objX = -width;
},
hideDelBth() {
this.brandData.forEach(function(d) {
... ... @@ -137,7 +139,7 @@
},
panstart: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -155,7 +157,7 @@
},
panmove: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -182,7 +184,7 @@
},
panend: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -197,6 +199,10 @@
this.pandata.objX = -width;
}
li.css('transform', 'translateX(' + this.pandata.objX + 'px)');
if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) {
this.pandata = {};
}
}
},
created: function() {
... ... @@ -214,11 +220,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 ? '完成' : '编辑',
... ... @@ -226,7 +232,7 @@
},
defaultSelectedIndex: '1'
},
url: location.origin + '/me/collection?tab=brand'
url: location.href
});
}
});
... ... @@ -249,6 +255,7 @@
padding-left: 20px;
list-style: none;
overflow: hidden;
border-top: 1px solid #e0e0e0;
li {
position: relative;
... ...
... ... @@ -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) {
... ... @@ -120,6 +120,8 @@
delBtn.removeClass('hide');
$('#li-' + id).css('transform', 'translateX(-' + width + 'px)');
this.pandata.id = id;
this.pandata.objX = -width;
},
hideDelBth() {
this.productData.forEach(function(d) {
... ... @@ -154,7 +156,7 @@
},
panstart: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -172,7 +174,7 @@
},
panmove: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -199,7 +201,7 @@
},
panend: function(id) {
event.preventDefault();
if (this.editmodel) {
if (this.editmodel && this.pandata.id !== id) {
return false;
}
... ... @@ -214,6 +216,10 @@
this.pandata.objX = -width;
}
li.css('transform', 'translateX(' + this.pandata.objX + 'px)');
if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) {
this.pandata = {};
}
}
},
created: function() {
... ... @@ -231,11 +237,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 ? '完成' : '编辑',
... ... @@ -243,7 +249,7 @@
},
defaultSelectedIndex: '0'
},
url: location.origin + '/me/collection?tab=brand'
url: location.href
});
}
});
... ... @@ -266,6 +272,7 @@
padding-left: 20px;
list-style: none;
overflow: hidden;
border-top: 1px solid #e0e0e0;
li {
position: relative;
... ...
... ... @@ -9,7 +9,7 @@
</label>
</li>
<li>
<label>昵称<input class="nickname" v-model='nickname' @blur="setNickname"></label>
<label>昵称<input class="nickname" v-model='nickname' @input="setNickname" @change="checkNickname"></label>
</li>
<li>
<label @click="setAender">性别
... ... @@ -53,14 +53,19 @@
setAvatar: function() {
yoho.goSetAvatar();
},
setNickname: function() {
checkNickname: function() {
if (!this.nickname) {
tip('昵称不能为空');
this.nickname = this.currentval;
return false;
}
this.currentval = this.nickname;
},
setNickname: function() {
if (!this.nickname || this.currentval === this.nickname) {
return false;
}
this.saveDetails({
nickname: this.nickname
});
... ...
... ... @@ -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>
... ...
... ... @@ -214,11 +214,14 @@
font-size: 28px;
vertical-align: middle;
margin-left: 30px;
width: 50%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
a {
float: right;
margin-top: 12px;
font-size: 28px;
color: #b0b0b0;
}
... ...
... ... @@ -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 {
... ...