Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bandengtechs插件 #817

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"execa": "^0.11.0",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不允许修改根目录下的 package.json

"husky": "^1.0.0-rc.8",
"mip2": "^1.5.2"
}
}
14 changes: 14 additions & 0 deletions sites/bandtechs.com/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
UTF-8
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{js,styl,html,json,vue}]
indent_size = 2
indent_style = space
[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions sites/bandtechs.com/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
39 changes: 39 additions & 0 deletions sites/bandtechs.com/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"allowImportExportEverywhere": false
},
"extends": [
"standard",
"plugin:vue/recommended"
],
"plugins": [
"jsdoc"
],
"globals": {
"MIP": true
},
"env": {
"browser": true
},
"rules": {
"jsdoc/check-param-names": 1,
"jsdoc/check-tag-names": 1,
"jsdoc/check-types": 1,
"jsdoc/newline-after-description": 1,
"jsdoc/no-undefined-types": 1,
"jsdoc/require-description-complete-sentence": 0,
"jsdoc/require-example": 0,
"jsdoc/require-hyphen-before-param-description": 0,
"jsdoc/require-param": 1,
"jsdoc/require-param-description": 1,
"jsdoc/require-param-name": 1,
"jsdoc/require-param-type": 1,
"jsdoc/require-returns-description": 1,
"jsdoc/require-returns-type": 1,
"jsdoc/valid-types": 1,
"no-var": 2
}
}
8 changes: 8 additions & 0 deletions sites/bandtechs.com/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
.idea/
*.log
Thumbs.db
.DS_Store
*.swp
*.gz
Empty file.
30 changes: 30 additions & 0 deletions sites/bandtechs.com/components/mip-company/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# mip-company

标题|内容
----|----
类型|
支持布局|
所需脚本| [https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-company/mip-company.js](https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-company/mip-company.js)

## 说明
主要是对请求并在首页储存的json文件数据提取和数据分类处理,再循环遍历出来

## 示例

示例说明

```
// 代码示例
```

## 属性

### url

**说明**:
获取动态的图片地址
**必选项**:

**单位**:

**默认值**:
20 changes: 20 additions & 0 deletions sites/bandtechs.com/components/mip-company/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=no">
<title>MIP page</title>
<link rel="canonical" href="对应的原页面地址">
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
/* 自定义样式 */
</style>
</head>
<body>
<div >
<mip-company></mip-company>
</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-company/mip-company.js"></script>
</body>
</html>
56 changes: 56 additions & 0 deletions sites/bandtechs.com/components/mip-company/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
mip-company {
.wrapper {

}
.ox{
display: flex;
flex-direction:row;
align-items: center;
justify-content: space-around;
margin-top:15px;
}
.right-box{
width: auto;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
height:90px;
width:70%;
margin-left:10px;
}
.bar-title{
color:#333333;
font-size: 15px;
font-family:PingFang SC;
font-weight:bold;
}
a{
color:#3D97FE;
font-size:12px;
margin-left: -7px;
padding: 0;
border: none;
}
.see{
color:#999999;
font-size:12px;
margin-left: 10px;
}
.see-div{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.creat-time{
color:#999999;
font-size:12px;
}
.see-num{
display: flex;
align-items: center;
height: 100%;
}
}
37 changes: 37 additions & 0 deletions sites/bandtechs.com/components/mip-company/mip-company.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import './index.less'

export default class MIPCompany extends MIP.CustomElement {
build () {
let wrapper = document.createElement('div')
let url = this.element.getAttribute('url')
wrapper.classList.add('wrapper')
let dataList = sessionStorage.getItem('dataList')
dataList = JSON.parse(dataList)
let arr = []
dataList.newsList.forEach((item) => {
if (item.group === 4) {
arr.push(item)
}
})
for (let i = 0; i < arr.length; i++) {
wrapper.innerHTML += `
<div class="ox">
<mip-img src="` + arr[i].imageUrl + `" width="100" height="100"></mip-img>
<div class="right-box">
<span class="bar-title">` + arr[i].title + `</span>
<span class="creat-time">发布时间` + arr[i].createTime + `</span>
<div class="see-div">
<a href="companyDetail.html?index=` + i + `" mip-link>【查看详情】</a>
<div class="see-num">
<mip-img src="` + url + `/bandeng/查看@2x.png" width="17" height="16"></mip-img>
<span class="see">9654</span>
</div>
</div>
</div>
</div>
`
}

this.element.appendChild(wrapper)
}
}
31 changes: 31 additions & 0 deletions sites/bandtechs.com/components/mip-news/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# mip-news

标题|内容
----|----
类型|
支持布局|
所需脚本| [https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-news/mip-news.js](https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-news/mip-news.js)

## 说明

新闻中心通用组件,用于展示页面的各个新闻条目

## 示例

示例说明

```
// 代码示例
```

## 属性

### 属性1

**说明**:

**必选项**:

**单位**:

**默认值**:
20 changes: 20 additions & 0 deletions sites/bandtechs.com/components/mip-news/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=no">
<title>MIP page</title>
<link rel="canonical" href="对应的原页面地址">
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
/* 自定义样式 */
</style>
</head>
<body>
<div>
<mip-news></mip-news>
</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-news/mip-news.js"></script>
</body>
</html>
41 changes: 41 additions & 0 deletions sites/bandtechs.com/components/mip-news/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mip-news {

.img{
width: 100%;
height:140px;
border-radius:5px;
//background: url('../../static/images/about.png');
}
.news-box{
margin-bottom: 20px;
}
.article-title{
font-size:15px;
font-family:PingFang SC;
font-weight:bold;
margin-top: 10px;
color:rgba(51,51,51,1);
}
.time{
color:#999999;
font-size: 12px;
font-family:PingFang SC;
font-weight:500;
margin-top: 10px;
color:rgba(153,153,153,1);
display: flex;
align-items: center;
justify-content: space-between;
}
.watch{
display: flex;
align-items: center;
}
.left-1{
margin-left: 20px;
margin-right: 9px;
}
.left-2{
margin-right: 9px;
}
}
35 changes: 35 additions & 0 deletions sites/bandtechs.com/components/mip-news/mip-news.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import './index.less'
export default class MIPNews extends MIP.CustomElement {
build () {
let wrapper = document.createElement('div')
let dataList = sessionStorage.getItem('dataList')
dataList = JSON.parse(dataList)
let url = this.element.getAttribute('url')
let arr = []
dataList.newsList.forEach((item) => {
if (item.group !== 4) {
arr.push(item)
}
})
for (let i = 0; i < arr.length; i++) {
wrapper.innerHTML += `
<div class="news-box">
<div class="img">
<mip-img class="img" src="` + arr[i].imageUrl + `" width="690" height="280" layout="responsive"></mip-img>
</div>
<div class="article-title"><a href="newsDetail.html?index=` + i + `" mip-link>` + arr[i].title + `</a></div>
<div class="time">
<span>发布时间:<span>` + arr[i].createTime + `</span></span>
<div class="watch">
<mip-img src="` + url + `/bandeng/查看@2x.png" class="left-2" width="17" height="16"></mip-img>
<span>9888</span>
<mip-img src="` + url + `/bandeng/点赞数@2x.png" class="left-1" width="17" height="16"></mip-img>
<span>88676</span>
</div>
</div>
</div>
`
}
this.element.appendChild(wrapper)
}
}
31 changes: 31 additions & 0 deletions sites/bandtechs.com/components/mip-success/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# mip-success

标题|内容
----|----
类型|
支持布局|
所需脚本| [https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-success/mip-success.js](https://c.mipcdn.com/extensions/platform/v2/mipWebsite/mip-success/mip-success.js)

## 说明
案列中心通用组件,用于展示各个案列的条目。简化页面


## 示例

示例说明

```
// 代码示例
```

## 属性

### 属性1

**说明**:

**必选项**:

**单位**:

**默认值**:
Loading