Authored by zhangxiaoru

会员等级列表

... ... @@ -41,10 +41,95 @@ class familyModel extends global.yoho.BaseModel {
}
}
/**
* 列表排序
*/
_sourceSort(source) {
return function(a, b) {
let value1 = a[source],
value2 = b[source];
return value1 - value2;
};
}
/**
* 获取APP列表
*/
_getAppList() {
let result = {
code: 200,
data: [
{
uid: null,
iconUrl: 'http://img12.static.yhbimg.com/article/2017/08/23/10/02412723632a13bd6ad1eef8fe580095a5.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'yoho',
source: 1,
login: false
},
{
uid: null,
iconUrl: 'http://img13.static.yhbimg.com/article/2017/08/23/10/0222be3d6a9d8a1617b89fcf35357a3593.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'now',
source: 2,
login: false
},
{
uid: null,
iconUrl: 'http://img12.static.yhbimg.com/article/2017/08/23/10/02fe755abdc5d390252cf6df25c01dffae.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'mars',
source: 3,
login: false
},
{
uid: null,
iconUrl: 'http://img11.static.yhbimg.com/article/2017/08/23/10/0112f200ab5ae424173fa2df7a490c80bf.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'green',
source: 4,
login: false
},
{
uid: null,
iconUrl: 'http://img12.static.yhbimg.com/article/2017/08/23/10/022279d464ee6bd9ef86089c60e2832210.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'coffee',
source: 5,
login: false
},
{
uid: null,
iconUrl: 'http://img10.static.yhbimg.com/article/2017/08/23/10/01a1704bc87316008d769443a8ae50ad7e.png?imageView/{mode}/w/{width}/h/{height}',
sourceName: 'life',
source: 6,
login: false
}
]
};
let loginList = [];
let noLoginList = [];
let appList = [];
_.forEach(result.data, value => {
if (value.login === true) {
loginList.push(value);
} else {
noLoginList.push(value);
}
});
loginList.sort(this._sourceSort('source'));
noLoginList.sort(this._sourceSort('source'));
appList = loginList.concat(noLoginList);
return appList;
}
familyIndex(uid) {
return Promise.all([
this._userData(uid),
this._getCode(uid)
this._getCode(uid),
this._getAppList()
]).then((result) => {
let familyIndexData = {};
... ... @@ -61,6 +146,10 @@ class familyModel extends global.yoho.BaseModel {
familyIndexData = _.assign(familyIndexData, result[1].data);
}
if (result[2]) {
familyIndexData.appList = result[2];
}
return familyIndexData;
});
}
... ...
... ... @@ -36,26 +36,13 @@
<div class="vip-grade">
<div class="title">会员等级及权益</div>
<div class="grade-content">
<div class="content-item">
<img class="item-tag" src="">
<span class="name">Yoho!bUY</span>
<span class="level">黄金</span>
</div>
<div class="content-item">
<img class="item-tag" src="">
<span class="name">Yoho!bUY</span>
<span class="level">黄金</span>
</div>
<div class="content-item">
<img class="item-tag" src="">
<span class="name">Yoho!bUY</span>
<span class="level">黄金</span>
</div>
<div class="content-item">
<img class="item-tag" src="">
<span class="name">Yoho!bUY</span>
{{# appList}}
<div class="content-item" data-login="{{login}}">
<img class="item-tag" src="{{image iconUrl 140 140}}">
<span class="name">{{sourceName}}</span>
<span class="level">黄金</span>
</div>
{{/ appList}}
</div>
</div>
<div class="integral">
... ... @@ -74,4 +61,15 @@
</div>
</div>
{{/ familyIndexData}}
</div>
\ No newline at end of file
<div class="vip-detail">
<div class="back"></div>
<div class="detail-content">
<div class="banner">
</div>
<div class="main">
</div>
</div>
</div>
</div>
... ...
... ... @@ -29,15 +29,18 @@ class FamilyIndex extends Page {
};
this.init();
this.selector.$codeSet.on('click', this.setTrendPop.bind(this));
this.selector.$textarea.on('blur', this.saveTrendWord.bind(this));
this.selector.integralCh.on('click', this.jump.bind(this));
}
init() {
this.headIco();
this.integralCharts();
this.bindEvents();
}
bindEvents() {
this.selector.$codeSet.on('click', this.setTrendPop.bind(this));
this.selector.$textarea.on('blur', this.saveTrendWord.bind(this));
this.selector.integralCh.on('click', this.jump.bind(this));
}
// 头像
... ... @@ -116,11 +119,7 @@ class FamilyIndex extends Page {
// 积分图表点击跳转
jump(params) {
if (yoho && yoho.isApp) {
yoho.goH5(`${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`);
} else {
window.location.href = `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`; // eslint-disable-line
}
yoho.goH5(`${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=${params.data.plateType}`);
}
}
... ...
... ... @@ -280,4 +280,40 @@
}
}
}
.vip-detail {
position: fixed;
top: 0;
width: 100%;
height: 100%;
z-index: 5;
.back {
width: 100%;
height: 100%;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #000;
opacity: 0.5;
}
.detail-content {
width: 630px;
height: auto;
background-color: #fff;
position: fixed;
top: 0;
left: 50%;
margin-top: 180px;
margin-left: -315px;
}
.banner {
width: 100%;
height: 200px;
}
}
}
... ...