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

m.qqtn.com #858

Open
wants to merge 9 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
46 changes: 46 additions & 0 deletions sites/m.qqtn.com/components/mip-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# mip-example

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

## 说明

首次点击进入页面的搜索引擎来路地址,判断不为百度和站内点击跳转,就实现点击按钮#address替换自身href连接地址;当前页面还需要判断data-durl、data-ismoney、data-special的值进行排除筛选和js自定义中的noAd数据去排除

## 示例

示例说明

```
<div class="g-box f-yydiv" id="m-down-msg">
<header class="info">
<div class="pic">
<div class="ico-wrap middle f-game-img">
<mip-img class="ico mip-element mip-layout-container mip-img-loaded" src="https://p.qqan.com/up/2020-7/2020714192755977.png!100_100"></mip-img>
</div>
<ul>
<li class="cpname"><h1 class="f-game-h1">王者传奇手游</h1></li><li class="type"><b>大小:238.5M</b><b>语言:中文</b></li><li class="type"><b>类别:角色扮演</b><b class="f-tags-system">系统:Android</b></li>
</ul>
</div>
<div id="downAddress" class="g-downAddress">
<ul class="m-down-ul f-downbtn-url g-nav-full">
<li class="m-down-last m-down-msg"><a href="tj.tcyl77.com" class="span9 m-game-down down f-eject-btn" data-flag="downbtn" id="address">普通下载</a></li>
</ul>
</div></div>
</header>
</div>

<div class="f-information f-hide" data-id="189880" data-path="down" data-categroyId="203" data-rootid="16" data-commendid="0" data-system="Android" data-ppaddress="" data-ismoney="0" data-CommentTpye="0" data-Username="yinpan" data-Type="0" data-DateTime="2017/4/11" data-attr="免费" data-phpurl="2" data-star="5" data-durl="tj.tcyl77.com" data-ismoney="0" data-special="2"></div>

```

## 属性

根据页面 data-durl 字段的值,去判断匹配排除,并获取首次点击进入页面的来路地址,判断不为百度和站内点击跳转,进行 #address href 地址替换

## 开发理由

实现首次进入页面,首次点击的情况给替换链接地址
57 changes: 57 additions & 0 deletions sites/m.qqtn.com/components/mip-example/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!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>
html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */-webkit-tap-highlight-color: rgba(0, 0, 0, 0);/* 消除移动浏览器点击蓝色背景 */}
img { width:auto\9; height:auto; max-width:100%; vertical-align:middle; border:0; -ms-interpolation-mode:bicubic}
ul,ol,dl,h1,h2,h3,h4,h5,h6,dt,dd{margin:0;padding:0}
ul li,ol li{list-style:none}
.g-box {width: 100%;height: auto;background: none;padding: 0;display: block;overflow: hidden;box-sizing: border-box;margin-bottom: 12px;margin-top: 12px;}
.g-box .info .pic {padding: 0;}.g-box .info {width: 100%;height: auto;box-sizing: border-box;padding: 10px;background: #fff;display: block;overflow: hidden;}
#m-down-msg .info .pic {padding: 10px 10px 0;}
.g-box .info .pic {width: 100%;height: auto;margin: 0;display: -webkit-box;overflow: hidden;}
.g-box .info .pic .ico-wrap {width: 70px;height: 70px;display: block;overflow: hidden;}
.g-box .info .pic ul {width: auto;height: auto;margin: 0;text-align: left;padding: 0 0 0 14px;box-sizing: border-box;display: block;
overflow: hidden;-webkit-box-flex: 1;}
.g-box .info .pic ul .cpname h1 {width: 100%;height: 22px;line-height: 22px;font-size: 18px;font-weight: bold;color: #333;display: block;overflow: hidden;float: left;margin: 2px 0 4px;display: inline;overflow: hidden;}
.g-box .info .pic ul li h1 {font-weight: normal;}
.g-box .info .pic ul li b {width: 50%;height: 18px;line-height: 18px;font-size: 14px;font-weight: normal;color: #999;float: left;margin: 3px 0 -2px 0;display: inline;overflow: hidden;}
.g-downAddress {width: 100%;height: auto;float: left;margin: 0;display: inline;overflow: hidden;padding: 0;box-sizing: border-box;}
.g-downAddress .m-down-ul {width: 100%;height: auto;margin-top: 8px;box-sizing: border-box;display: block;overflow: hidden;}
.g-downAddress .m-down-ul .m-down-last {width: 100%;}
.g-downAddress li.m-down-last {padding-bottom: 10px;}
.g-downAddress .m-down-ul li {width: 50%;height: auto;padding-bottom: 10px;box-sizing: border-box;float: left;display: inline;overflow: hidden;margin: 0;}
.g-downAddress li.m-down-last a {width: 275px;height: 38px;margin: 0 auto;line-height: 38px;border-radius: 18.5px;font-size: 16px;font-weight: normal;color: #fff;text-align: center;display: block;overflow: hidden;text-decoration: none;}
.g-downAddress .m-down-ul li a {width: 275px;height: 38px;margin: 0 auto;line-height: 38px;border-radius: 18.5px;font-size: 16px;font-weight: normal;color: #fff;text-align: center;display: block;overflow: hidden;text-decoration: none;background: -webkit-linear-gradient(left, #fcc030 , #ff971c);background: -o-linear-gradient(right, #fcc030, #ff971c);background: -moz-linear-gradient(right, #fcc030, #ff971c);background: linear-gradient(to right, #fcc030 , #ff971c);}
</style>
</head>
<body>
<mip-example>
<div class="g-box f-yydiv" id="m-down-msg">
<header class="info">
<div class="pic">
<div class="ico-wrap middle f-game-img">
<mip-img class="ico mip-element mip-layout-container mip-img-loaded" src="https://p.qqan.com/up/2020-7/2020714192755977.png!100_100"></mip-img>
</div>
<ul>
<li class="cpname"><h1 class="f-game-h1">王者传奇手游</h1></li><li class="type"><b>大小:238.5M</b><b>语言:中文</b></li><li class="type"><b>类别:角色扮演</b><b class="f-tags-system">系统:Android</b></li>
</ul>
</div>
<div id="downAddress" class="g-downAddress">
<ul class="m-down-ul f-downbtn-url g-nav-full">
<li class="m-down-last m-down-msg"><a href="tj.tcyl77.com" class="span9 m-game-down down f-eject-btn" data-flag="downbtn" id="address">普通下载</a></li>
</ul>
</div></div>
</header>
</div>
<div class="f-information f-hide" data-id="189880" data-path="down" data-categroyId="203" data-rootid="16" data-commendid="0" data-system="Android" data-ppaddress="" data-ismoney="0" data-CommentTpye="0" data-Username="yinpan" data-Type="0" data-DateTime="2017/4/11" data-attr="免费" data-phpurl="2" data-star="5" data-durl="tj.tcyl77.com" data-ismoney="0" data-special="2"></div>
</mip-example>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-example/mip-example.js"></script>
</body>
</html>
43 changes: 43 additions & 0 deletions sites/m.qqtn.com/components/mip-example/mip-example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export default class MIPExample extends MIP.CustomElement {
build () {
var ifswb = false
var downHref = document.querySelector('.f-information').dataset.durl
var noAd = ['6071.com','hsxyb.com','tj.tcyl77.com','tj.chenjianxiang.com','http://g.','http://tj.','moban.com','down1.qianghongbaoyo.com','yiwan.com','down2.guopan.cn','dl.guopan.cn','guopan.cn','duowan.com','ugame.uc.cn','ugame.9game.cn','360.cn','ewan.cn','anfan.com','duokoo.baidu.com','caohua.com','456.com.cn','miyugame.com','sifuba.net','btsysf.com','pyw.cn','sy217.com','17byh.com','xinkuai.com','s.qq.com','down.nntczn.com','down.bugeyu.com','open.play.cn','hgame.com','yxgames.com','ad677.com','sp.ulxue.com','xzsp.9pj8m.com','ydb.vaatn.com','xzsp3.zhanyu55.com','sp2.vaatn.com','sp2.ftaem.cn','tu.apk17.com','tt.wang6g.com','chenjianxiang.com','cyhy8.com','eoemarket.com','haowanyou.com','112wan.com','paojiao.cn','jiyw.com','66shouyou.com','downfx2.cmge.com','unionsy.com','phzdownload.gllkgame.com','hsxizhi.com','dlsutong.cn','602.com','ind9ed.com','63yx.com','6513.com','yileyoo.com','kingcheergame.com','gzjykj.com','songshugame.cn','myx916.com','ksyun.com','xmwan.com','fire2333.com','aliyuncs.com','youdiancx.com','myqcloud.com','yixin.im','yx.127.net','163.com','uri6.com','nikkigames.cn','papa91.com','84fk.com','dovoscape.com','108jz.com','693975.com','niuboli.com','tanwan.com','twanxi.com','huangxiu1.com','jjyx.com','guaishou66.com','duoyi.com','3737.com','leishengame.com','shangshiwl.com','aoingame.com','faxianapk.com','6xwan.com','7gwan.com','youximao.com','zwyouxi.com','happyelements.cn','qiyutianxia.com','yingxiong.com','play800.cn','tpxl.com','xiaodiyouxi.com','bamenzhushou.com','youximax.com','duomiwan.com','66bay.com','btgame99.com','xxzhushou.cn','dongyouxi666.com','277sy.com','wpscdn.cn','inmome.com','185sy.com','anfeng.com','tuanyx.com','game-center.cn','milu.com','xyzs.com','3733.com','kepan365.com','233xyx.com','xzsp3.nevehicle.cn']
for (let i = 0; i < noAd.length; i++) {
if (downHref.indexOf(noAd[i]) > -1) {
ifswb = true
}
}
var iosmoney = document.querySelector('.f-information').dataset.ismoney
var special = document.querySelector('.f-information').dataset.special
if (iosmoney == 1) {
ifswb = true;
}
if (special == 4) {
ifswb = false;
}
if (special == 10) {
ifswb = false;
}
if (special == 11) {
ifswb = false;
}
if (special == 20) {
ifswb = false;
}
var openurl = document.referrer.substr(0,20);
if (openurl.indexOf('qqtn') == -1 && openurl.indexOf('baidu') == -1 && openurl != '' && !ifswb && /android/i.test(navigator.userAgent) && downHref.indexOf('/down.asp') == -1) {
document.getElementById("address").setAttribute('data-ci','0')
document.getElementById("address").classList.add("f-bgbtn")
document.getElementById("address").innerHTML = '点击下载'
document.getElementById("address").onclick = function () {
if (document.querySelector('.f-bgbtn').dataset.ci == '0') {
document.getElementById("address").setAttribute('data-ci','1')
document.getElementById("address").href = 'http://tj.chenjianxiang.com/0006/6874';
} else {
document.getElementById("address").href = downHref
}
}
}
}
}
26 changes: 26 additions & 0 deletions sites/m.qqtn.com/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!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>
/* 自定义样式 */
h2 {
margin: 50px auto;
text-align: center;
}
</style>
</head>
<body>
<div>
<h2>First MIP page</h2>
<h2>Add MIP components here</h2>
<mip-example></mip-example>
</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-example/mip-example.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions sites/m.qqtn.com/mip.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @file mip页面项目配置项
* @author
*/

module.exports = {
dev: {
/**
* 启动mip server调试的端口号
*
* @type {number}
*/
port: 8111,

/**
* 启用调试页面自动刷新
*
* @type {boolean}
*/
livereload: true,

/**
* server 启动自动打开页面,false 为关闭
* 如:
* autoopen: '/example/index.html'
*
* @type {string|boolean}
*/
autoopen: false
}
}
31 changes: 31 additions & 0 deletions sites/m.qqtn.com/mip.config.js.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @file mip页面项目配置项
* @author
*/

module.exports = {
dev: {
/**
* 启动mip server调试的端口号
*
* @type {number}
*/
port: 8111,

/**
* 启用调试页面自动刷新
*
* @type {boolean}
*/
livereload: false,

/**
* server 启动自动打开页面,false 为关闭
* 如:
* autoopen: '/example/index.html'
*
* @type {string|boolean}
*/
autoopen: true
}
}
25 changes: 25 additions & 0 deletions sites/m.qqtn.com/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "qqtn.com",
"version": "0.0.1",
"description": "A MIP project",
"scripts": {
"dev": "mip2 dev",
"build": "mip2 build",
"lint": "npm run lint:js",
"lint:js": "eslint --ext .vue,.js .",
"fix": "npm run fix:js",
"fix:js": "eslint --ext .vue,.js . --fix"
},
"author": "dgm (dgm@email)",
"dependencies": {},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsdoc": "^3.7.1",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"eslint-plugin-vue": "^4.5.0"
}
}
46 changes: 46 additions & 0 deletions sites/qqtn.com/components/mip-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# mip-example

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

## 说明

首次点击进入页面的搜索引擎来路地址,判断不为百度和站内点击跳转,就实现点击按钮#address替换自身href连接地址;当前页面还需要判断data-durl、data-ismoney、data-special的值进行排除筛选和js自定义中的noAd数据去排除

## 示例

示例说明

```
<div class="g-box f-yydiv" id="m-down-msg">
<header class="info">
<div class="pic">
<div class="ico-wrap middle f-game-img">
<mip-img class="ico mip-element mip-layout-container mip-img-loaded" src="https://p.qqan.com/up/2020-7/2020714192755977.png!100_100"></mip-img>
</div>
<ul>
<li class="cpname"><h1 class="f-game-h1">王者传奇手游</h1></li><li class="type"><b>大小:238.5M</b><b>语言:中文</b></li><li class="type"><b>类别:角色扮演</b><b class="f-tags-system">系统:Android</b></li>
</ul>
</div>
<div id="downAddress" class="g-downAddress">
<ul class="m-down-ul f-downbtn-url g-nav-full">
<li class="m-down-last m-down-msg"><a href="tj.tcyl77.com" class="span9 m-game-down down f-eject-btn" data-flag="downbtn" id="address">普通下载</a></li>
</ul>
</div></div>
</header>
</div>

<div class="f-information f-hide" data-id="189880" data-path="down" data-categroyId="203" data-rootid="16" data-commendid="0" data-system="Android" data-ppaddress="" data-ismoney="0" data-CommentTpye="0" data-Username="yinpan" data-Type="0" data-DateTime="2017/4/11" data-attr="免费" data-phpurl="2" data-star="5" data-durl="tj.tcyl77.com" data-ismoney="0" data-special="2"></div>

```

## 属性

根据页面 data-durl 字段的值,去判断匹配排除,并获取首次点击进入页面的来路地址,判断不为百度和站内点击跳转,进行 #address href 地址替换

## 开发理由

实现首次进入页面,首次点击的情况给替换链接地址
57 changes: 57 additions & 0 deletions sites/qqtn.com/components/mip-example/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!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>
html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */-webkit-tap-highlight-color: rgba(0, 0, 0, 0);/* 消除移动浏览器点击蓝色背景 */}
img { width:auto\9; height:auto; max-width:100%; vertical-align:middle; border:0; -ms-interpolation-mode:bicubic}
ul,ol,dl,h1,h2,h3,h4,h5,h6,dt,dd{margin:0;padding:0}
ul li,ol li{list-style:none}
.g-box {width: 100%;height: auto;background: none;padding: 0;display: block;overflow: hidden;box-sizing: border-box;margin-bottom: 12px;margin-top: 12px;}
.g-box .info .pic {padding: 0;}.g-box .info {width: 100%;height: auto;box-sizing: border-box;padding: 10px;background: #fff;display: block;overflow: hidden;}
#m-down-msg .info .pic {padding: 10px 10px 0;}
.g-box .info .pic {width: 100%;height: auto;margin: 0;display: -webkit-box;overflow: hidden;}
.g-box .info .pic .ico-wrap {width: 70px;height: 70px;display: block;overflow: hidden;}
.g-box .info .pic ul {width: auto;height: auto;margin: 0;text-align: left;padding: 0 0 0 14px;box-sizing: border-box;display: block;
overflow: hidden;-webkit-box-flex: 1;}
.g-box .info .pic ul .cpname h1 {width: 100%;height: 22px;line-height: 22px;font-size: 18px;font-weight: bold;color: #333;display: block;overflow: hidden;float: left;margin: 2px 0 4px;display: inline;overflow: hidden;}
.g-box .info .pic ul li h1 {font-weight: normal;}
.g-box .info .pic ul li b {width: 50%;height: 18px;line-height: 18px;font-size: 14px;font-weight: normal;color: #999;float: left;margin: 3px 0 -2px 0;display: inline;overflow: hidden;}
.g-downAddress {width: 100%;height: auto;float: left;margin: 0;display: inline;overflow: hidden;padding: 0;box-sizing: border-box;}
.g-downAddress .m-down-ul {width: 100%;height: auto;margin-top: 8px;box-sizing: border-box;display: block;overflow: hidden;}
.g-downAddress .m-down-ul .m-down-last {width: 100%;}
.g-downAddress li.m-down-last {padding-bottom: 10px;}
.g-downAddress .m-down-ul li {width: 50%;height: auto;padding-bottom: 10px;box-sizing: border-box;float: left;display: inline;overflow: hidden;margin: 0;}
.g-downAddress li.m-down-last a {width: 275px;height: 38px;margin: 0 auto;line-height: 38px;border-radius: 18.5px;font-size: 16px;font-weight: normal;color: #fff;text-align: center;display: block;overflow: hidden;text-decoration: none;}
.g-downAddress .m-down-ul li a {width: 275px;height: 38px;margin: 0 auto;line-height: 38px;border-radius: 18.5px;font-size: 16px;font-weight: normal;color: #fff;text-align: center;display: block;overflow: hidden;text-decoration: none;background: -webkit-linear-gradient(left, #fcc030 , #ff971c);background: -o-linear-gradient(right, #fcc030, #ff971c);background: -moz-linear-gradient(right, #fcc030, #ff971c);background: linear-gradient(to right, #fcc030 , #ff971c);}
</style>
</head>
<body>
<mip-example>
<div class="g-box f-yydiv" id="m-down-msg">
<header class="info">
<div class="pic">
<div class="ico-wrap middle f-game-img">
<mip-img class="ico mip-element mip-layout-container mip-img-loaded" src="https://p.qqan.com/up/2020-7/2020714192755977.png!100_100"></mip-img>
</div>
<ul>
<li class="cpname"><h1 class="f-game-h1">王者传奇手游</h1></li><li class="type"><b>大小:238.5M</b><b>语言:中文</b></li><li class="type"><b>类别:角色扮演</b><b class="f-tags-system">系统:Android</b></li>
</ul>
</div>
<div id="downAddress" class="g-downAddress">
<ul class="m-down-ul f-downbtn-url g-nav-full">
<li class="m-down-last m-down-msg"><a href="tj.tcyl77.com" class="span9 m-game-down down f-eject-btn" data-flag="downbtn" id="address">普通下载</a></li>
</ul>
</div></div>
</header>
</div>
<div class="f-information f-hide" data-id="189880" data-path="down" data-categroyId="203" data-rootid="16" data-commendid="0" data-system="Android" data-ppaddress="" data-ismoney="0" data-CommentTpye="0" data-Username="yinpan" data-Type="0" data-DateTime="2017/4/11" data-attr="免费" data-phpurl="2" data-star="5" data-durl="tj.tcyl77.com" data-ismoney="0" data-special="2"></div>
</mip-example>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-example/mip-example.js"></script>
</body>
</html>
Loading