-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
237a55b
commit 379b225
Showing
9 changed files
with
186 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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标签以图片的形式展示 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |