Authored by shuaiguo

feat(电子刊): 新增购买数量

... ... @@ -4,15 +4,27 @@ class detailModel extends global.yoho.BaseModel {
super(ctx);
}
getMagazineInfo(params) {
return this.get({data: {
const infoPromise = this.get({data: {
method: 'app.eBook.queryEBookByEId',
e_id: params[0]
}}).then((data) => {
if (data.code === 200) {
return data.data || {};
}
}});
const buyInfoPromise = this.get({data: {
method: 'app.eBook.querySubscriberInfo',
e_id: params[0]
}});
return {};
return Promise.all([infoPromise, buyInfoPromise]).then((infos)=> {
const [bookInfo, buyInfo] = infos;
let data = {};
if (bookInfo && bookInfo.code === 200) {
data = bookInfo.data;
data.subcribeCount = 0;
if (buyInfo && buyInfo.code === 200) {
data.subcribeCount = buyInfo.data.total;
}
}
return data;
});
}
}
... ...
... ... @@ -15,11 +15,14 @@
<div class="magazine-info-block">
<p class="m-time">{{bookNumber}}</p>
<p class="m-title">{{title}}</p>
<div class="m-order to-download">查看阅读
<i class="iconfont">&#xe614;</i>
<div class="magazine-info">
<div class="m-order to-download">如何订阅
<i class="iconfont">&#xe614;</i>
</div>
<div class="m-buy-info">已有{{subcribeCount}}本订阅</div>
</div>
<button class="buy-magazine-now" data-sku="{{sku}}" data-buy="{{buyFlag}}">立即购买</button>
</div>
</div>
... ...
... ... @@ -127,10 +127,11 @@ new DragableElm($('.magazine-detail-container'));
$('.to-download').on('click', function() {
dialog.showDialog({
dialogText: '请在微信搜索并关注“YOHO潮流志”公众号,或者下载Yoho!Buy有货APP,阅读电子刊',
dialogText: '请在微信搜索并关注“YOHO潮流志”公众号,阅读电子刊',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
centerBtnText: '确定',
// rightBtnText: '确定'
}
}, function() {
window.location.href = downloadPage;
... ...
... ... @@ -3,6 +3,8 @@
html,
body {
height: 100%;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.main-wrap {
... ... @@ -40,6 +42,8 @@ body {
box-sizing: border-box;
// padding-bottom: 134px;
overflow: hidden;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
.filter-bg {
filter: blur(20px);
... ... @@ -89,6 +93,14 @@ body {
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%,);
}
.magazine-info {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40px;
padding-right: 2px;
}
.magazine-info-block {
width: 100%;
height: 0;
... ... @@ -114,17 +126,26 @@ body {
overflow: hidden;
}
.m-buy-info {
color: #fff;
font-size: 24px;
font-weight: bold;
}
.m-order {
margin-bottom: 40px;
color: #fff;
display: flex;
align-items: center;
font-weight: bold;
&:before {
content: "";
width: 26px;
height: 21px;
width: 28px;
height: 28px;
margin-right: 10px;
background-image: url("img/magazine/crown.png");
background-image: url("img/magazine/help-tip@2x.png");
background-size: 100% 100%;
background-repeat: no-repeat;
display: inline-block;
}
}
... ...