diff --git a/mip-233-lxkf/README.md b/mip-233-lxkf/README.md new file mode 100644 index 00000000..44cfb4fc --- /dev/null +++ b/mip-233-lxkf/README.md @@ -0,0 +1,18 @@ + +# mip-233-lxkf + +联系客服插件 + +标题|内容 +----|---- +类型|业务,广告 +支持布局|N/S +所需脚本|https://mipcache.bdstatic.com/static/v1/mip-233-lxkf/mip-233-lxkf.js + +## 示例 + +``` html + +

客服咨询

+
+``` diff --git a/mip-233-lxkf/mip-233-lxkf.js b/mip-233-lxkf/mip-233-lxkf.js new file mode 100644 index 00000000..94749b70 --- /dev/null +++ b/mip-233-lxkf/mip-233-lxkf.js @@ -0,0 +1,27 @@ +/** + * @file 联系客服插件 + * @author 233 程序部 + */ +define(function (require) { + var $ = require('zepto'); + var customElem = require('customElement').create(); + // build 方法,元素插入到文档时执行,仅会执行一次 + customElem.prototype.build = function () { + var element = this.element; + var tag = document.createElement('script'); + var tag2 = document.createElement('script'); + var type = $(element).attr('data-type'); + tag.src = 'https://dl.ntalker.com/js/xn6/ntkfstat.js?siteid=kf_9278'; + tag2.src = 'https://img.233.com/x/plus/kf/1.0.0/kefu.js?v=1.0.0'; + $('body').append(tag); + $('body').append(tag2); + $(element).find('.kefu').click(function () { + if (type === 'presale') { + window.kefu233.presale(); + } else { + window.kefu233.aftersale(); + } + }); + }; + return customElem; +}); diff --git a/mip-233-lxkf/package.json b/mip-233-lxkf/package.json new file mode 100644 index 00000000..a6453150 --- /dev/null +++ b/mip-233-lxkf/package.json @@ -0,0 +1,10 @@ +{ + "name": "mip-233-lxkf", + "version": "1.0.0", + "description":"233网校联系客服插件", + "author": { + "name": "lxkf", + "email": "446545975@qq.com", + "url": "www.233.com" + } +} diff --git a/mip-downlink/README.md b/mip-downlink/README.md new file mode 100644 index 00000000..94b88297 --- /dev/null +++ b/mip-downlink/README.md @@ -0,0 +1,30 @@ +# mip-downlink + +mip-downlink 下载软件 + +标题|内容 +----|---- +类型|通用 +支持布局|responsive,fixed-height,fill,container,fixed +所需脚本|http://mipcache.bdstatic.com/static/v1/mip-downlink/mip-downlink.js + +## 示例 + +### 基本用法 +```html + + 下载 + +``` + +## 属性 + +### iurl + +说明:接口地址 +必选项:是 +类型:string +默认值:无 + +## 注意事项 + diff --git a/mip-downlink/mip-downlink.js b/mip-downlink/mip-downlink.js new file mode 100644 index 00000000..b48e2b73 --- /dev/null +++ b/mip-downlink/mip-downlink.js @@ -0,0 +1,27 @@ +/** + * @file mip-downlink 组件 + * @author cc + */ + +define(function (require) { + + var customElement = require('customElement').create(); + + customElement.prototype.build = function () { + + var $ = require('jquery'); + var element = this.element; + var iurl = element.getAttribute('iurl'); + var id = element.getAttribute('tag'); + if (iurl && id) { + window.gourl = function (url) { + window.location.href = url; + }; + element.onclick = function () { + $.getScript(iurl + '?id=' + id + '&callback=gourl'); + }; + } + }; + + return customElement; +}); diff --git a/mip-downlink/mip-downlink.less b/mip-downlink/mip-downlink.less new file mode 100644 index 00000000..c62b22de --- /dev/null +++ b/mip-downlink/mip-downlink.less @@ -0,0 +1,7 @@ +/** + * @file mip-downlink样式文件 + */ + +mip-downlink { + // TODO +} diff --git a/mip-downlink/package.json b/mip-downlink/package.json new file mode 100644 index 00000000..c40cda39 --- /dev/null +++ b/mip-downlink/package.json @@ -0,0 +1,15 @@ +{ + "name": "mip-downlink", + "version": "1.0.0", + "description": "下载软件", + "author": "cc", + "contributors": [ + { + "name": "cc", + "email": "cc@qq.com" + } + ], + "engines": { + "mip": ">=1.1.0" + } +} diff --git a/mip-fn-wapheader/README.md b/mip-fn-wapheader/README.md new file mode 100644 index 00000000..cab86d5b --- /dev/null +++ b/mip-fn-wapheader/README.md @@ -0,0 +1,36 @@ +# mip-fn-wapheader +

蜂鸟网公共头

+ +## 示例 + +```html + +``` + +标题|内容 +----|---- +类型|通用 +所需脚本|http://mipcache.bdstatic.com/static/v1/mip-fn-commonheader/mip-fn-commonheader.js + +## 属性 +### pageName +说明:页面标题 +必选项:是 +类型:字符串 + +### bbusername +说明:用户名 +必选项:是 +类型:字符串 + +### classUrl +说明:返回地址 +必选项:是 +类型:字符串 +取值范围:URL + +### imgSrc +说明:用户头像 +必选项:是 +类型:字符串 +取值范围:URL diff --git a/mip-fn-wapheader/mip-fn-wapheader.js b/mip-fn-wapheader/mip-fn-wapheader.js new file mode 100644 index 00000000..4270f9f1 --- /dev/null +++ b/mip-fn-wapheader/mip-fn-wapheader.js @@ -0,0 +1,60 @@ +/** + * @file mip-fn-wapheader 组件 + * @author fn + */ +define(function (require) { + var customElem = require('customElement').create(); + + // 生命周期 function list,根据组件情况选用,(一般情况选用 build、firstInviewCallback) start + // build 方法,元素插入到文档时执行,仅会执行一次 + customElem.prototype.build = function () { + // this.element 可取到当前实例对应的 dom 元素 + var element = this.element; + var bbusername = element.getAttribute('bbuserName'); + var pageName = element.getAttribute('pageName'); + var classUrl = element.getAttribute('classUrl'); + var imgSrc = element.getAttribute('imgSrc'); + var headerStr; + + if (bbusername) { + headerStr = '' + + '
' + + '返回上一页' + + '' + + '' + pageName + '' + + '
' + + '' + + '' + + '
' + + '
' + + '
' + + '退出' + + '' + + '' + bbusername + '' + + '' + + '
'; + + } else { + headerStr = '' + + '
' + + '返回上一页' + + '' + + '' + pageName + '' + + '
' + + '' + + '
' + + '
'; + } + element.innerHTML = headerStr; + + var headerControl = element.querySelector('#headerControl'); + + headerControl.addEventListener('click', function () { + element.classList.toggle('show-user-layer'); + }, false); + }; + + return customElem; + +}); + diff --git a/mip-fn-wapheader/mip-fn-wapheader.less b/mip-fn-wapheader/mip-fn-wapheader.less new file mode 100644 index 00000000..8571e34a --- /dev/null +++ b/mip-fn-wapheader/mip-fn-wapheader.less @@ -0,0 +1,19 @@ +/* mip-fn-wapheader */ +mip-fn-wapheader {position: relative; left: 0; top: 0; height: 2rem; background-color: #222; text-align: center;} +mip-fn-wapheader .control{position: absolute; right: 0; top: 0; height: 2rem; width: 2.5rem; color: #fff;} +mip-fn-wapheader .control .login-btn{float: right; width: 2rem; height: 2rem; background: url(data:image/png;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sE7AtUl+o+0vOlyLgawrR8v8YXEbUvRVVRCdawgiWnKyR+xmq+VS3kiSbIZrBPqR82auwuEzIziKs3pZCyjHczWx/xn6gyzujV8BYLeIwr2DPqVRN2v+KNm7OKaN3C7jGkXOWYMQZoZkgwr2hkbHgxILDB39SbOvbDiNcr9wSrXIvg/EqQJvwri2G6BArZewqZVdltRCSgThKK8TMz7h7XxFaK0cx0FlxDvchX+4Pjt6XtgYXe+aqMrO1uOT4NUrXvONjNe1jdjVdeRjV0ro1knyhRtY/+LKWZihfeO6WktgljGcFDSdLLHf5fbTCDn01a0TTK3YfsXvaQE/6NPlEbwxuT3PxxcFBOY5V0UWHiS9crJu6GO05ecYtSWMdG3fHQDE+6S8BEcc07nJnQFG6wjpTJGcAdx51ZVCjPMIjk5xH3NnYAwhliYbAHns22jfhc/o9pEiPtvfwOX1jszkDZE5fWitfEK1k6QnJxucvMPUQmUmaRvIXLpdSOUG4FHxHc7jMmrwuI4nL0ndH8joux3zNLB2tFWc96pIck+a7euHzXZp7by8wsg1yb3oPKJxtpEDuAVfeSa6/H1Ex5hfd1eaG1k16zeUvy3Ty9A5bOAUrucPq7tORhfY+vYjI+/TVd/v//85A3zwiVseMmx0rQt48rnl/STVbl70FmXL8YIr5jbhYWkYD3qWs4XFowbtUwzjhxV9OVQo/DRdC8wAAAABJRU5ErkJggg==) no-repeat 50% 50%; -webkit-background-size: 1.1rem 1.1rem; background-size: 1.1rem 1.1rem; font: 0/0 arial;} +mip-fn-wapheader .control .avator{float: right; width: 2.0rem; height: 2.0rem; overflow: hidden; -webkit-border-radius: 50%; border-radius: 50%;} +/*mip-fn-wapheader .control .avator img,*/ +mip-fn-wapheader .control .avator mip-img{float: right; width: 1rem; height: 1rem; margin: 0.5rem 0.5rem 0 0; border: 1px solid #c7c7c7; -webkit-border-radius: 50%; border-radius: 50%;} +mip-fn-wapheader .header-user{height: 2.0rem;} +mip-fn-wapheader .goback{position: absolute; top: 0; left: 5px; height: 2.0rem; width: 1.0rem; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAuCAMAAADjo+I+AAAAe1BMVEUAAAC7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7uGE7PlAAAAKHRSTlMA+vD24+oj22JZU7FDPDEqC6GPg354a0o3HxQG0sO8mpeHcU0cy8dHen80NgAAAM1JREFUOMuV1NkOgjAQBdBSQHYFEdkEFFz6/1+oJHReejvqfT0hobMJSyI5CWtiR6mCQysvH1xzRVhvqHyAL3dDZzExJYw5jEzMWJQaQxMbjQrg/jc8A/QZPBDOHFZ/4s7TeOKwNLElvAEMNB5NvHMoLhrhoNCnQy64Hx57lpMvLEC6RHOBuCeeEOcjPRryQNWE/EBtonRUtBlyAAYL9SNE3HpgT0DVaAHx9Dk1YloIN0XcEGeIaYVlgzjV/BTc0am4a1Zaz6RDiBLKtVNvmgs5SsGmyzYAAAAASUVORK5CYII=) no-repeat 50% 50%; -webkit-background-size: 0.7rem 1.2rem; background-size: 0.7rem 1.2rem; font: 0/0 arial; -webkit-transform: scale(.8); transform: scale(.8);} + +mip-fn-wapheader .page-title{display: inline-block; height: 2.0rem; color: #fff; text-align: center; line-height: 2.0rem;} + +mip-fn-wapheader .username-layer{-webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; top: 0; left: 0; z-index: 1; width: 100%; height: 2.5rem; padding: 0 0.5rem; background: #e7f2f4; font-size: 0.8rem; line-height: 2.5rem; -webkit-transform: translateY(-300%); transform: translateY(-300%); -webkit-transition: all .5s ease; transition: all .5s ease;} +/*mip-fn-wapheader .username-layer .avator mip,*/ +mip-fn-wapheader .username-layer .avator mip-img{float: left; width: 1.0rem; height: 1.0rem; margin: 0.65rem 0.5rem 0 0; -webkit-border-radius: 50%; border-radius: 50%;} +mip-fn-wapheader .username-layer .username{float: left; margin: 0 0 0 0.75rem;} +mip-fn-wapheader .username-layer .login-out-button{float: right; width: 3.0rem; height: 1.4rem; overflow: hidden; margin: 0.55rem 0 0; -webkit-border-radius: 0.15rem; border-radius: 0.15rem; background: #fff; font-size: 0.7rem; text-align: center; line-height: 1.4rem; cursor: pointer;} +mip-fn-wapheader .username-layer .close-username{display: none; position: absolute; right: 0.75rem; top: 0.75rem; width: 0.75rem; height: 0.75rem; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeBAMAAADJHrORAAAAElBMVEUAAACZmZmZmZmZmZmZmZmZmZn7TU31AAAABXRSTlMA1RWYFoRAm8IAAABySURBVBjTZZHBCYAwDACDuoAF/+oE/TiAI0hx/1WEC3KPBNqmvaNNScx7GFOPq4VxjDieXbw1xh8wBRCzOBdxrmITjhXEpOIUEiucYIUVrPCK3Ve/3lffs55ab/2Pyc2x4rI1sQJYAayQWIF+KQz6qdA/TmkU/QqnJncAAAAASUVORK5CYII=) no-repeat center center; -webkit-background-size: 0.75rem 0.75rem; background-size: 0.75rem 0.75rem;} +mip-fn-wapheader.show-user-layer .username-layer{-webkit-transform: translateY(2.15rem); transform: translateY(2.15rem);} \ No newline at end of file diff --git a/mip-fn-wapheader/package.json b/mip-fn-wapheader/package.json new file mode 100644 index 00000000..8af9bb19 --- /dev/null +++ b/mip-fn-wapheader/package.json @@ -0,0 +1,13 @@ +{ + "name": "mip-fn-wapheader", + "version": "1.0.0", + "description": "蜂鸟网WAP站公共头", + "author": { + "name": "fn", + "email": "tech@fengniao.com" + }, + + "engines": { + "mip": ">=1.1.0" + } +}