Skip to content

Commit

Permalink
update extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mip-platform committed Sep 6, 2018
1 parent 237a55b commit 379b225
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 4 deletions.
28 changes: 28 additions & 0 deletions mip-90ff-gg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# mip-90ff-gg 非凡漫画广告轮播组件

`<mip-90ff-gg>` 用于管理非凡漫画(90ff.com)广告固定位素材轮播的组件。 通过引入非凡漫画的素材管理组件,实现自动更换广告素材的功能

标题|内容
----|----
类型|通用
支持布局|responsive, fixed-height, fill, container, nodisplay, fixed, flex-item
所需脚本|https://c.mipcdn.com/static/v1/mip-90ff-gg/mip-90ff-gg.js

## 示例

### 基本使用

```html
<mip-90ff-gg></mip-90ff-gg>
```

1、在页面底部增加下面代码:
<script src="https://c.mipcdn.com/static/v1/mip-90ff-gg/mip-90ff-gg.js"></script>
<mip-90ff-gg></mip-90ff-gg>
2、在需要增加定位广告的地方增加
<div class="a-90ff" data-name="name1"></div>


## 属性
### mip-90ff-gg
说明:管理非凡漫画(90ff.com)广告固定位素材轮播的组件 , 广告类型是固定广告 , 在组件中通过获取页面中加载的div标签以图片的形式展示
24 changes: 24 additions & 0 deletions mip-90ff-gg/mip-90ff-gg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @file 非凡漫画网广告轮播组件
*
* @author [email protected]
* @version 1.0.0
* @copyright 2018 shenl.com, Inc. All Rights Reserved
*/

define(function (require) {
var customElement = require('customElement').create();
var $ = require('zepto');

function render() {
var element = this.element;
var node = document.createElement('script');
node.type = 'text/javascript';
// 引入非凡漫画网广告管理组件,实现广告素材轮播功能,服务提供商为:非凡漫画网
node.src = 'http://www.90ff.com/mip/a-90ff.js';
node.async = 'async';
$(element).append(node);
}
customElement.prototype.build = render;
return customElement;
});
13 changes: 13 additions & 0 deletions mip-90ff-gg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "mip-90ff-gg",
"version": "1.0.0",
"description":"非凡漫画广告轮播组件",
"author": {
"name": "Shen.L",
"email": "[email protected]",
"url": "https://www.shenl.com"
},
"engines": {
"mip": ">=1.1.0"
}
}
8 changes: 8 additions & 0 deletions mip-fetch-comment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ mip-fetch-comment 根据点击的年份异步加载酒款的评价信息
<ul class="jiuping wineComment" id="pjjiuping"></ul>
</div>
</div>
<div id='pjpfLightbox'>

</div>
<div id='pjhjLightbox'>

</div>

</mip-fetch-comment>
<script src="https://c.mipcdn.com/static/v1/mip-lightbox/mip-lightbox.js"></script>
```


28 changes: 25 additions & 3 deletions mip-fetch-comment/mip-fetch-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,27 @@ define(function (require) {
awardsContent.style = 'display:block';
var awardsHtml = element.querySelector('#pjawards');
awardsHtml.innerHTML = '';
var pjhjLightboxhtml = element.querySelector('#pjhjLightbox');
pjhjLightboxhtml.innerHTML = '';
var pjhjHtml = '';
var hjhtml = '';
for (var i = 0; i < json.hj.length; i++) {
hjhtml += '<div class="scores bdb-t-1px"><div class="scoreVal"><div class="score-r"> 获奖时间:'
+ json.hj[i].year + '</div><div class="score-l"><div class="score-i"><span class="scoreV">'
+ json.hj[i].grade
+ '</span></div></div></div><div class="scoreVal"><div class="wine-nf">葡萄酒年份:'
+ json.hj[i].year + '</div><div class="wineOrg"><div class="org-t">颁奖组织:'
+ json.hj[i].agency + '</div><i class="rater" >?</i></div></div></div>';
+ json.hj[i].agency + '</div><i class="rater" on="tap:pjhj-'
+ i + '-lightbox.toggle">?</i></div></div></div>';
pjhjHtml += '<mip-lightbox id="pjhj-' + i + '-lightbox" layout="nodisplay" '
+ 'class="mip-hidden"> <div class="lightbox"> <div class="downPop popvt">'
+ ' <span class="close-pop iconfont icon-toclosed" on="tap:pjhj-'
+ i + '-lightbox.toggle"></span><div class="rater-nm" id="raterName">'
+ json.hj[i].agency + '</div><div class="rater-info" id="raterSummary">'
+ json.hj[i].agencySummary + '</div></div></div></mip-lightbox>';
}
awardsHtml.innerHTML += hjhtml;
pjhjLightboxhtml.innerHTML += pjhjHtml;
}
else {
var awardsContent = element.querySelector('#awardsContent');
Expand All @@ -57,6 +68,9 @@ define(function (require) {
var gradeHtml = element.querySelector('#pjgrade');
gradeHtml.innerHTML = '';
var pfhtml = '';
var pjpfLightboxhtml = element.querySelector('#pjpfLightbox');
pjpfLightboxhtml.innerHTML = '';
var pjpfHtml = '';
for (var i = 0; i < json.pf.length; i++) {
var showStr = '';
if (json.pf[i].score.indexOf('/100') > -1) {
Expand All @@ -72,13 +86,21 @@ define(function (require) {
showStr = '<span class=\"scoreV\">' + json.pf[i].score + '</span><br />';
}
pfhtml += '<div class="scores bdb-t-1px"><div class="scoreVal"><div class="score-r"> 适饮时间:'
+ json.pf[i].date == null ? '' : json.pf[i].date
+ json.pf[i].date
+ '</div><div class="score-l"><div class="score-i">'
+ showStr + '</div></div></div><div class="scoreVal"><div class="wine-nf">葡萄酒年份:'
+ json.pf[i].year + '</div><div class="wineOrg"><div class="org-t">评分者:'
+ json.pf[i].critic + '</div> <i class="rater" >?</i></div></div></div>';
+ json.pf[i].critic + '</div> <i class="rater" on="tap:pjpf-'
+ i + '-lightbox.toggle" >?</i></div></div></div>';
pjpfHtml += '<mip-lightbox id="pjpf-' + i + '-lightbox" layout="nodisplay" '
+ 'class="mip-hidden"> <div class="lightbox"> <div class="downPop popvt">'
+ ' <span class="close-pop iconfont icon-toclosed" on="tap:pjpf-'
+ i + '-lightbox.toggle"></span><div class="rater-nm" id="raterName">'
+ json.pf[i].critic + '</div><div class="rater-info" id="raterSummary">'
+ json.pf[i].criticSummary + '</div></div></div></mip-lightbox>';
}
gradeHtml.innerHTML += pfhtml;
pjpfLightboxhtml.innerHTML += pjpfHtml;
} else {
var gradeContent = element.querySelector('#gradeContent');
gradeContent.style = 'display:none';
Expand Down
2 changes: 1 addition & 1 deletion mip-fetch-comment/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mip-fetch-comment",
"version": "1.0.1",
"version": "1.0.2",
"description": "根据点击的年份异步加载酒款的相关评价信息",
"contributors": [
{
Expand Down
30 changes: 30 additions & 0 deletions mip-fetch-wine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# mip-fetch-wine

mip-fetch-wine 根据酒庄id异步加载酒庄的相关酒款
标题|内容
----|----
类型|通用
支持布局|container
所需脚本|https://mipcache.bdstatic.com/static/v1/mip-fetch-wine/mip-fetch-wine.js

## 示例

```html
<mip-fetch-wine>
<input type="hidden" id="chateauId" value="penfolds" />
<div class="winery-jk winerytab" name="content">
<div id="ulList">
<div id="list_1">
</div>
</div>
</div>
<div class="chateau-all" id="jkshow">
<div class="wineInfo">
<div class="none-tipico iconfont icon-tip-line" id="wineIcon"></div>
<div class="wine-text">--暂无酒庄详细资料--</div>
</div>
</div>
</mip-fetch-wine>
```


43 changes: 43 additions & 0 deletions mip-fetch-wine/mip-fetch-wine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @file mip-fetch-wine 组件
* @author
*/

define(function (require) {
var customElement = require('customElement').create();
customElement.prototype.firstInviewCallback = function () {
var element = this.element;
var chateauId = element.querySelector('#chateauId').value;
var url = 'https://mip-test.wine-world.com/winery/ajax/wine?id=' + chateauId;
fetch(url, {
method: 'POST',
header: {
'Content-type': 'application/json'
}
}).then(function (res) {
return res.json();
}).then(function (json) {
if (json.rows.length > 0) {
var list1 = element.querySelector('#list_1');
list1.innerHTML = '';
var jkshow = element.querySelector('#jkshow');
jkshow.style = 'display:none';
var html = '';
for (var i = 0; i < json.rows.length; i++) {
html += ' <div class="vinbox"><a href=' + json.rows[i].url
+ '><dl class="vin-list"><dt> <mip-img src=' + json.rows[i].cover
+ ' width="80" height="80"></mip-img></dt><dd><span class="vin-name-cn">'
+ json.rows[i].cname + '</span><span class="vin-name-en">'
+ json.rows[i].fname + '</span><p>产区:' + json.rows[i].areaName + ' <br />酿酒葡萄:'
+ json.rows[i].grapeName + '</p></dd></dl></a>' + json.rows[i].productShopUrl + '</div>';
}
list1.innerHTML += html;
}
else {
var jkshow = element.querySelector('#jkshow');
jkshow.style = 'display:block';
}
});
};
return customElement;
});
14 changes: 14 additions & 0 deletions mip-fetch-wine/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "mip-fetch-wine",
"version": "1.0.0",
"description": "根据酒庄的Id异步加载酒庄的相关酒款",
"contributors": [
{
"name": "chenwenkai",
"email": "[email protected]"
}
],
"engines": {
"mip": ">=1.1.0"
}
}

0 comments on commit 379b225

Please sign in to comment.