diff --git a/mip-90ff-gg/README.md b/mip-90ff-gg/README.md new file mode 100644 index 00000000..f75411c4 --- /dev/null +++ b/mip-90ff-gg/README.md @@ -0,0 +1,28 @@ +# 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 + +``` + +1、在页面底部增加下面代码: + + +2、在需要增加定位广告的地方增加 +
+ + +## 属性 +### mip-90ff-gg +说明:管理非凡漫画(90ff.com)广告固定位素材轮播的组件 , 广告类型是固定广告 , 在组件中通过获取页面中加载的div标签以图片的形式展示 \ No newline at end of file diff --git a/mip-90ff-gg/mip-90ff-gg.js b/mip-90ff-gg/mip-90ff-gg.js new file mode 100644 index 00000000..fa203ea0 --- /dev/null +++ b/mip-90ff-gg/mip-90ff-gg.js @@ -0,0 +1,24 @@ +/** + * @file 非凡漫画网广告轮播组件 + * + * @author shen@shenl.com + * @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; +}); diff --git a/mip-90ff-gg/package.json b/mip-90ff-gg/package.json new file mode 100644 index 00000000..3b3eefb2 --- /dev/null +++ b/mip-90ff-gg/package.json @@ -0,0 +1,13 @@ +{ + "name": "mip-90ff-gg", + "version": "1.0.0", + "description":"非凡漫画广告轮播组件", + "author": { + "name": "Shen.L", + "email": "shen@shenl.com", + "url": "https://www.shenl.com" + }, + "engines": { + "mip": ">=1.1.0" + } +} diff --git a/mip-fetch-comment/README.md b/mip-fetch-comment/README.md index ea435c8a..26fd0104 100644 --- a/mip-fetch-comment/README.md +++ b/mip-fetch-comment/README.md @@ -58,7 +58,15 @@ mip-fetch-comment 根据点击的年份异步加载酒款的评价信息 +
+ +
+
+ +
+ + ``` diff --git a/mip-fetch-comment/mip-fetch-comment.js b/mip-fetch-comment/mip-fetch-comment.js index 27cc0726..6f6deff9 100644 --- a/mip-fetch-comment/mip-fetch-comment.js +++ b/mip-fetch-comment/mip-fetch-comment.js @@ -36,6 +36,9 @@ 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 += '
获奖时间:' @@ -43,9 +46,17 @@ define(function (require) { + json.hj[i].grade + '
葡萄酒年份:' + json.hj[i].year + '
颁奖组织:' - + json.hj[i].agency + '
?
'; + + json.hj[i].agency + '?'; + pjhjHtml += ' '; } awardsHtml.innerHTML += hjhtml; + pjhjLightboxhtml.innerHTML += pjhjHtml; } else { var awardsContent = element.querySelector('#awardsContent'); @@ -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) { @@ -72,13 +86,21 @@ define(function (require) { showStr = '' + json.pf[i].score + '
'; } pfhtml += '
适饮时间:' - + json.pf[i].date == null ? '' : json.pf[i].date + + json.pf[i].date + '
' + showStr + '
葡萄酒年份:' + json.pf[i].year + '
评分者:' - + json.pf[i].critic + '
?
'; + + json.pf[i].critic + ' ?'; + pjpfHtml += ' '; } gradeHtml.innerHTML += pfhtml; + pjpfLightboxhtml.innerHTML += pjpfHtml; } else { var gradeContent = element.querySelector('#gradeContent'); gradeContent.style = 'display:none'; diff --git a/mip-fetch-comment/package.json b/mip-fetch-comment/package.json index f024bfbc..58680441 100644 --- a/mip-fetch-comment/package.json +++ b/mip-fetch-comment/package.json @@ -1,6 +1,6 @@ { "name": "mip-fetch-comment", - "version": "1.0.1", + "version": "1.0.2", "description": "根据点击的年份异步加载酒款的相关评价信息", "contributors": [ { diff --git a/mip-fetch-wine/README.md b/mip-fetch-wine/README.md new file mode 100644 index 00000000..1445e804 --- /dev/null +++ b/mip-fetch-wine/README.md @@ -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 + + +
+
+
+
+
+
+
+
+
+
--暂无酒庄详细资料--
+
+
+
+``` + + diff --git a/mip-fetch-wine/mip-fetch-wine.js b/mip-fetch-wine/mip-fetch-wine.js new file mode 100644 index 00000000..29aa0020 --- /dev/null +++ b/mip-fetch-wine/mip-fetch-wine.js @@ -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 += '
' + + json.rows[i].cname + '' + + json.rows[i].fname + '

产区:' + json.rows[i].areaName + '
酿酒葡萄:' + + json.rows[i].grapeName + '

' + json.rows[i].productShopUrl + '
'; + } + list1.innerHTML += html; + } + else { + var jkshow = element.querySelector('#jkshow'); + jkshow.style = 'display:block'; + } + }); + }; + return customElement; +}); diff --git a/mip-fetch-wine/package.json b/mip-fetch-wine/package.json new file mode 100644 index 00000000..828f8a7f --- /dev/null +++ b/mip-fetch-wine/package.json @@ -0,0 +1,14 @@ +{ + "name": "mip-fetch-wine", + "version": "1.0.0", + "description": "根据酒庄的Id异步加载酒庄的相关酒款", + "contributors": [ + { + "name": "chenwenkai", + "email": "1084072318@qq.com" + } + ], + "engines": { + "mip": ">=1.1.0" + } +} \ No newline at end of file