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

最火软件新增请求接口判断城市 #850

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0d99012
最火移动端mip组件
faith1314 Jul 23, 2019
a98da54
错误修改
faith1314 Jul 24, 2019
6b69ec8
Merge branch 'master' into master
faith1314 Jul 24, 2019
58daf07
新自定义组件
faith1314 Aug 9, 2019
38d7a61
错误修改,新添加组件
faith1314 Aug 12, 2019
3df240a
Merge branch 'master' into master
faith1314 Aug 14, 2019
485c968
新加组件
faith1314 Aug 14, 2019
12891a4
新加组件
faith1314 Aug 14, 2019
03e43db
新加组件
faith1314 Aug 14, 2019
baf1709
Merge branch 'master' into master
faith1314 Aug 15, 2019
6533e2a
Merge branch 'master' into master
faith1314 Aug 17, 2019
7b776bd
Update mip-veryhuo-index.js
faith1314 Aug 17, 2019
92ba7be
Update mip-veryhuo-rank.js
faith1314 Aug 17, 2019
4d6bd88
Update mip-veryhuo-type.js
faith1314 Aug 17, 2019
4c32f86
Update mip-veryhuo-column.js
faith1314 Aug 17, 2019
668639d
Update mip-veryhuo-column.js
faith1314 Aug 17, 2019
2158dbe
Update mip-veryhuo-special.js
faith1314 Aug 17, 2019
dc5ff62
Update mip-veryhuo-zx.js
faith1314 Aug 17, 2019
18ae4cd
Update mip-veryhuo-androidsoft.js
faith1314 Aug 17, 2019
462d09c
Update mip-veryhuo-zx.js
faith1314 Aug 17, 2019
cdf0530
Update mip-veryhuo-index.js
faith1314 Aug 17, 2019
8eb01f9
Update mip-veryhuo-index.js
faith1314 Aug 17, 2019
06699bf
Update README.md
faith1314 Aug 19, 2019
8b1b591
Update README.md
faith1314 Aug 19, 2019
c222903
Update README.md
faith1314 Aug 19, 2019
8fc6fbd
Update README.md
faith1314 Aug 19, 2019
a2240f0
Update README.md
faith1314 Aug 19, 2019
ad56b32
Update README.md
faith1314 Aug 19, 2019
1778105
Update README.md
faith1314 Aug 19, 2019
aa13ccb
Update README.md
faith1314 Aug 19, 2019
6a4cc57
Update README.md
faith1314 Aug 19, 2019
e1617a9
Merge branch 'master' into master
faith1314 Aug 19, 2019
b09ec5a
Update README.md
faith1314 Aug 19, 2019
fcf1651
添加屏蔽城市
May 12, 2020
b08312f
错误解决1
May 12, 2020
5f04969
错误处理2
May 12, 2020
375f8c4
错误修改3
May 12, 2020
2d71781
错误提交4
May 12, 2020
73eae83
Merge branch 'master' into master
faith1314 May 12, 2020
0e9e93a
接口修改1
May 12, 2020
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
31 changes: 31 additions & 0 deletions sites/m.veryhuo.com/components/mip-veryhuo-androidsoft/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# mip-veryhuo-androidsoft

移动端样式、逻辑

标题|内容
----|----
类型|通用
支持布局|responsive, fixed-height, fill, container, fixed
所需脚本| [https://c.mipcdn.com/extensions/platform/v2/m.veryhuo.com/mip-veryhuo-androidsoft/mip-veryhuo-androidsoft.js](https://c.mipcdn.com/extensions/platform/v2/m.veryhuo.com/mip-veryhuo-androidsoft/mip-veryhuo-androidsoft.js)

## 示例

### 基本使用

```html
<mip-veryhuo-androidsoft></mip-veryhuo-androidsoft>
```

## 属性

### url

说明:点击搜索按钮跳转;顶部菜单按钮点击显示隐藏;下方点击加载更多,请求数据

必选项:是

类型:字符串

取值范围:URL

默认值:无
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<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 class="mip-veryhuo-common">
<mip-veryhuo-androidsoft></mip-veryhuo-androidsoft>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-veryhuo-androidsoft/mip-veryhuo-androidsoft.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
/**
* @file 评论模块
* @author fl
*/

const { CustomElement, util } = MIP
const { css } = util

export default class MIPMhotComment extends CustomElement {
build () {
let bnum = 0
let nnum = 0
let mclassifyCont = this.element.querySelectorAll('#mclassifyCont')[0]
let ztheader = this.element.querySelectorAll('.ztheader')
let oDiv = this.element.querySelectorAll('.SearchBox')[0]
let searBtn = this.element.querySelectorAll('.SBBtn button')[0]
let alert = this.element.querySelectorAll('#confirm')[0]
let csearchDiv = this.element.querySelectorAll('.searchDiv')[0]
let sear = this.element.querySelectorAll('.searchDiv input')
let cnav = this.element.querySelectorAll('nav')[0]
let mclassify = this.element.querySelectorAll('#mclassify')[0]
let pullNav = this.element.querySelectorAll('#nav .pullNav')
let moreNav = this.element.querySelectorAll('#nav .moreNav')
let cmslass = this.element.querySelectorAll('#mclassifyCont p span')
let cul = this.element.querySelectorAll('#mclassifyCont ul')
let fixNav = this.element.querySelector('.fixNav')
let cbacktop = this.element.querySelectorAll('#Cbacktop')[0]
let zxNav = this.element.querySelector('#zxNav')
searBtn.onclick = function () {
if (oDiv.length === 0) {
css(alert, {display: 'block'})
} else {
css(alert, {display: 'none'})
}
}
window.addEventListener('scroll', function () {
if (document.documentElement.scrollTop > 80) {
css(fixNav, {display: 'block'})
css(zxNav, {display: 'none'})
} else if (document.documentElement.scrollTop < 30) {
css(fixNav, {display: 'none'})
css(zxNav, {display: 'block'})
}
if (document.documentElement.scrollTop > 300) {
css(cbacktop, {display: 'block'})
} else {
css(cbacktop, {display: 'none'})
}
})
cbacktop.onclick = function () {
document.documentElement.scrollTop = 0
}
if (ztheader.length === 0) {
oDiv.onclick = function () {
if (bnum === 0) {
css(mclassifyCont, {display: 'none'})
css(csearchDiv, {display: 'block'})
if (sear.length > 0) {
sear[0].focus()
}
bnum = 1
nnum = 0
} else {
if (nnum === 1) {
css(mclassifyCont, {display: 'none'})
nnum = 0
} else {
css(cnav, {height: 40})
css(csearchDiv, {display: 'none'})
bnum = 0
}
}
}
for (let i = 0; i < cmslass.length; i++) {
cmslass[i].onclick = function () {
let siblings = this.parentNode.childNodes
for (let i = 0; i < siblings.length; i++) {
if (siblings[i].nodeType === 1) {
siblings[i].className = ''
this.className = 'cur'
cmslass[i].index = i
}
}
if (this.index === 0) {
cul[0].className = 'on'
} else {
cul[0].className = ''
}
if (this.index === 1) {
cul[1].className = 'on'
} else {
cul[1].className = ''
}
}
}
mclassify.onclick = function () {
if (nnum === 0) {
css(mclassifyCont, {display: 'block'})
if (pullNav.length > 0) {
pullNav[0].classList.remove('open')
}
if (moreNav.length > 0) {
css(moreNav[0], {display: 'none'})
}
nnum = 1
} else {
css(mclassifyCont, {display: 'none'})
nnum = 0
}
}
}
let browser1 = {
versions: (function () {
let u = navigator.userAgent
return {
trident: u.indexOf('Trident') > -1,
presto: u.indexOf('Presto') > -1,
webKit: u.indexOf('AppleWebKit') > -1,
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1,
mobile: !!u.match(/AppleWebKit.*Mobile/i) || !!u.match(/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/),
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1,
iPad: u.indexOf('iPad') > -1,
webApp: u.indexOf('Safari') === -1
}
})(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
}
if (location.href.indexOf('m.veryhuo.com') > -1 && browser1.versions.mobile === false && browser1.versions.ios === false && browser1.versions.android === false && browser1.versions.iPhone === false && browser1.versions.iPad === false) {
window.location = 'http://www.veryhuo.com'
}
let moreBtn = this.element.querySelector('#androidsoft-more')
let asmUl = this.element.querySelector('#asm')
let asm = 18
moreBtn.onclick = function () {
let req = new Request('https://admin.veryhuo.com/mobile/open/more_soft?p=' + asm + '&type=2' + '&isgame=0', {
method: 'GET',
cache: 'reload'
})
fetch(req).then(function (response) {
return response.json()
}).then(function (data) {
if (data === '') {
moreBtn.innerText = '加载完毕啦,么么哒~'
return false
} else {
moreBtn.innerText = '加载中...'
let khtml = ''
let len = data.length
for (let i = 0; i < len; i++) {
let dt = data[i]
dt.pubdate = toDate(dt.pubdate)
khtml = document.createElement('li')
khtml.innerHTML = '<a class=\'img\' href=\'/s/' + dt.id + '.html\'><mip-img src=\'' + dt.litpic + '\'></a><p><a href=\'/s/' + dt.id + '.html\'></mip-img>' + dt.title + '</a><span><u>' + dt.typename + '</u>' + dt.softsize + '</span><span><u class=\'vis\'>' + dt.os + '</u><u class=\'time\'>' + dt.pubdate + '</u></span></p><a href=\'/s/' + dt.id + '.html\' class=\'btn\'><em></em>下载</a>'
asmUl.appendChild(khtml)
}
if (len < 20) {
moreBtn.innerText = '加载完毕啦,么么哒~'
} else {
moreBtn.innerText = '点击有惊喜,萌萌哒~'
}
asm = asm + 20
}
function toDate (phpstr) {
let str = parseInt(phpstr) * 1000
let newDate = new Date(str)
let yy = newDate.getUTCFullYear()
let mm = newDate.getUTCMonth() + 1
let dd = newDate.getUTCDate()
return yy + '-' + mm + '-' + dd
}
})
}
let gameBtn = this.element.querySelector('#androidgame-more')
let agmUl = this.element.querySelector('#agm')
let agm = 18
gameBtn.onclick = function () {
let req = new Request('https://admin.veryhuo.com/mobile/open/more_soft?p=' + agm + '&type=2' + '&isgame=1', {
method: 'GET',
cache: 'reload'
})
fetch(req).then(function (response) {
return response.json()
}).then(function (data) {
if (data === '') {
gameBtn.innerText = '加载完毕啦,么么哒~'
return false
} else {
gameBtn.innerText = '加载中...'
let ghtml = ''
let len = data.length
for (let i = 0; i < len; i++) {
let dt = data[i]
dt.pubdate = toDate(dt.pubdate)
ghtml = document.createElement('li')
ghtml.innerHTML = '<a class=\'img\' href=\'/s/' + dt.id + '.html\'><mip-img src=\'' + dt.litpic + '\'></mip-img></a><p><a href=\'/s/' + dt.id + '.html\'>' + dt.title + '</a><span><u>' + dt.typename + '</u>' + dt.softsize + '</span><span><u class=\'vis\'>' + dt.os + '</u><u class=\'time\'>' + dt.pubdate + '</u></span></p><a href=\'/s/' + dt.id + '.html\' class=\'btn\'><em></em>下载</a>'
agmUl.appendChild(ghtml)
}
if (len < 20) {
gameBtn.innerText = '加载完毕啦,么么哒~'
} else {
gameBtn.innerText = '点击有惊喜,萌萌哒~'
}
agm = agm + 20
}
function toDate (phpstr) {
let str = parseInt(phpstr) * 1000
let newDate = new Date(str)
let yy = newDate.getUTCFullYear()
let mm = newDate.getUTCMonth() + 1
let dd = newDate.getUTCDate()
return yy + '-' + mm + '-' + dd
}
})
}
}
}
31 changes: 31 additions & 0 deletions sites/m.veryhuo.com/components/mip-veryhuo-azyy-azyx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# mip-veryhuo-azyy-azyx

移动端样式、逻辑

标题|内容
----|----
类型|通用
支持布局|responsive, fixed-height, fill, container, fixed
所需脚本| [https://c.mipcdn.com/extensions/platform/v2/m.veryhuo.com/mip-veryhuo-azyy-azyx/mip-veryhuo-azyy-azyx.js](https://c.mipcdn.com/extensions/platform/v2/m.veryhuo.com/mip-veryhuo-azyy-azyx/mip-veryhuo-azyy-azyx.js)

## 示例

### 基本使用

```html
<mip-veryhuo-azyy-azyx></mip-veryhuo-azyy-azyx>
```

## 属性

### url

说明:顶部菜单按钮点击显示隐藏;点击搜索按钮跳转到新网页;下方点击加载更多,请求数据。

必选项:是

类型:字符串

取值范围:URL

默认值:无
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<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 class="mip-veryhuo-common">
<mip-veryhuo-azyy-azyx></mip-veryhuo-azyy-azyx>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-veryhuo-azyy-azyx/mip-veryhuo-azyy-azyx.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading