diff --git a/package.json b/package.json index aacef1f18..6195713e8 100644 --- a/package.json +++ b/package.json @@ -1,41 +1,41 @@ -{ - "name": "mip2-extensions-platform", - "version": "1.0.0", - "description": "MIP 2.0 站长组件", - "scripts": { - "lint": "eslint --ext .vue,.js .", - "validate": "sh tools/validate.sh", - "deploy:preview": "sh tools/build.sh", - "fix": "eslint --ext .vue,.js . --fix" - }, - "husky": { - "hooks": { - "pre-commit": "npm run lint" - } - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mipengine/mip2-extensions-platform.git" - }, - "keywords": [ - "MIP" - ], - "author": "MIP", - "license": "MIT", - "devDependencies": { - "babel-eslint": "^8.2.5", - "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", - "execa": "^0.11.0", - "fs-extra": "^7.0.1", - "glob": "^7.1.3", - "husky": "^1.0.0-rc.8", - "mip2": "^1.5.2" - } -} +{ + "name": "mip2-extensions-platform", + "version": "1.0.0", + "description": "MIP 2.0 站长组件", + "scripts": { + "lint": "eslint --ext .vue,.js .", + "validate": "sh tools/validate.sh", + "deploy:preview": "sh tools/build.sh", + "fix": "eslint --ext .vue,.js . --fix" + }, + "husky": { + "hooks": { + "pre-commit": "npm run lint" + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mipengine/mip2-extensions-platform.git" + }, + "keywords": [ + "MIP" + ], + "author": "MIP", + "license": "MIT", + "devDependencies": { + "babel-eslint": "^8.2.5", + "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", + "execa": "^0.11.0", + "fs-extra": "^7.0.1", + "glob": "^7.1.3", + "husky": "^1.3.1", + "mip2": "^1.5.2" + } +} diff --git a/sites/www.188soft.com/.editorconfig b/sites/www.188soft.com/.editorconfig new file mode 100644 index 000000000..cb530eac4 --- /dev/null +++ b/sites/www.188soft.com/.editorconfig @@ -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 diff --git a/sites/www.188soft.com/.eslintignore b/sites/www.188soft.com/.eslintignore new file mode 100644 index 000000000..db4c6d9b6 --- /dev/null +++ b/sites/www.188soft.com/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/sites/www.188soft.com/.eslintrc b/sites/www.188soft.com/.eslintrc new file mode 100644 index 000000000..84a3a2e9c --- /dev/null +++ b/sites/www.188soft.com/.eslintrc @@ -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 + } +} diff --git a/sites/www.188soft.com/.gitignore b/sites/www.188soft.com/.gitignore new file mode 100644 index 000000000..1207415d5 --- /dev/null +++ b/sites/www.188soft.com/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +dist/ +.idea/ +*.log +Thumbs.db +.DS_Store +*.swp +*.gz diff --git a/sites/www.188soft.com/common/.gitkeep b/sites/www.188soft.com/common/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/www.188soft.com/components/mip-soft-jump/README.md b/sites/www.188soft.com/components/mip-soft-jump/README.md new file mode 100644 index 000000000..88d20a743 --- /dev/null +++ b/sites/www.188soft.com/components/mip-soft-jump/README.md @@ -0,0 +1,45 @@ +# mip-soft-jump + +| 标题 | 内容 | +| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 类型 | +| 支持布局 | +| 所需脚本 | [https://c.mipcdn.com/extensions/platform/v2/www.188soft.com/mip-soft-jump/mip-soft-jump.js](https://c.mipcdn.com/extensions/platform/v2/www.188soft.com/mip-soft-jump/mip-soft-jump.js) | + +## 说明 + +判断用户使用是移动端还是非移动端,如果是非移动端访问m站时,页面进行跳转到www站 + +## 示例 + +示例说明 + +``` html + + + + + + + MIP page + + + + + + +
+ +
+ + + + + +``` + +## 属性 +无 \ No newline at end of file diff --git a/sites/www.188soft.com/components/mip-soft-jump/example/index.html b/sites/www.188soft.com/components/mip-soft-jump/example/index.html new file mode 100644 index 000000000..efb68ee0c --- /dev/null +++ b/sites/www.188soft.com/components/mip-soft-jump/example/index.html @@ -0,0 +1,24 @@ + + + + + + + MIP page + + + + + + +
+ +
+ + + + + diff --git a/sites/www.188soft.com/components/mip-soft-jump/index.less b/sites/www.188soft.com/components/mip-soft-jump/index.less new file mode 100644 index 000000000..9dc48508e --- /dev/null +++ b/sites/www.188soft.com/components/mip-soft-jump/index.less @@ -0,0 +1,6 @@ +mip-soft-jump { + .wrapper { + margin: 0 auto; + text-align: center; + } +} diff --git a/sites/www.188soft.com/components/mip-soft-jump/mip-soft-jump.js b/sites/www.188soft.com/components/mip-soft-jump/mip-soft-jump.js new file mode 100644 index 000000000..3f544dfd5 --- /dev/null +++ b/sites/www.188soft.com/components/mip-soft-jump/mip-soft-jump.js @@ -0,0 +1,77 @@ +/** + * @file 188soft网站js判断非移动端访问M站,跳转到www站 + * @author wangying (wangying@njxzwh.com) + */ +import './index.less' + +export default class MIPExample extends MIP.CustomElement { + connectedCallback () { + let urls = window.location.href + // 获取域名 + let domain = urls.split('/') + if (domain[2]) { + domain = domain[2] + } + // 移动平台不跳,非移动平台就跳转 + if (!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { + let mprefix = null + let wprefix = null + if (domain === 'm.188soft.com') { // 188soft + mprefix = 'http://m.188soft.com' + wprefix = 'http://www.188soft.com' + let soft = urls.toString().split('soft/')[1] + let sort = urls.toString().split('sorts/')[1] + let info = urls.toString().split('info/')[1] + let list = null + if (sort !== 'game/' && sort !== '') { + list = '/sorts/' + sort + } + let softDetail = '/soft/' + soft + let infoDetail = '/info/' + info + if (urls === mprefix + list && sort !== '') { // 聚合页(列表) + getData(mprefix + list, wprefix + list) + window.location.href = wprefix + list + } else if (urls === mprefix + softDetail && soft !== '') { // 软件详情页 + getData(mprefix + softDetail, wprefix + softDetail) + window.location.href = wprefix + softDetail + } else if (urls === mprefix + infoDetail && info !== '') { // 资讯情页 + getData(mprefix + infoDetail, wprefix + infoDetail) + window.location.href = wprefix + infoDetail + } + switch (urls) { + case 'http://m.188soft.com/': // 首页 + getData('http://m.188soft.com/', 'http://www.188soft.com/') + window.location.href = 'http://www.188soft.com/' + break + case 'http://m.188soft.com/new/': // 最近更新 + getData('http://m.188soft.com/new/', 'http://www.188soft.com/new/') + window.location.href = 'http://www.188soft.com/new/' + break + case 'http://m.188soft.com/sorts/': // 软件频道页 + getData('http://m.188soft.com/sorts/', 'http://www.188soft.com/sorts/') + window.location.href = 'http://www.188soft.com/sorts/' + break + case 'http://m.188soft.com/news/': // 资讯页 + getData('http://m.188soft.com/news/', 'http://www.188soft.com/news/') + window.location.href = 'http://www.188soft.com/news/' + break + case 'http://m.188soft.com/sorts/game/': // 安卓手游频道页 + getData('http://m.188soft.com/sorts/game/', 'http://www.188soft.com/sorts/game/') + window.location.href = 'http://www.188soft.com/sorts/game/' + break + default: + } + } + } + + function getData (startUrl, endUrl) { // 跳转统计接口 + fetch('https://mip.js.xzstatic.com/collect', { + method: 'POST', + body: 'startUrl=' + startUrl + '&endUrl=' + endUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + } + } +} diff --git a/sites/www.188soft.com/example/index.html b/sites/www.188soft.com/example/index.html new file mode 100644 index 000000000..a0ad2dec7 --- /dev/null +++ b/sites/www.188soft.com/example/index.html @@ -0,0 +1,26 @@ + + + + + + MIP page + + + + + +
+

First MIP page

+

Add MIP components here

+ +
+ + + + diff --git a/sites/www.188soft.com/mip.config.js b/sites/www.188soft.com/mip.config.js new file mode 100644 index 000000000..d5457bef4 --- /dev/null +++ b/sites/www.188soft.com/mip.config.js @@ -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 + } +} diff --git a/sites/www.188soft.com/package.json b/sites/www.188soft.com/package.json new file mode 100644 index 000000000..36a08b2e1 --- /dev/null +++ b/sites/www.188soft.com/package.json @@ -0,0 +1,25 @@ +{ + "name": "www.188soft.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": "wangying@njxzwh.com", + "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" + } +} diff --git a/sites/www.188soft.com/static/.gitkeep b/sites/www.188soft.com/static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/www.onlinedown.net/.editorconfig b/sites/www.onlinedown.net/.editorconfig new file mode 100644 index 000000000..cb530eac4 --- /dev/null +++ b/sites/www.onlinedown.net/.editorconfig @@ -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 diff --git a/sites/www.onlinedown.net/.eslintignore b/sites/www.onlinedown.net/.eslintignore new file mode 100644 index 000000000..db4c6d9b6 --- /dev/null +++ b/sites/www.onlinedown.net/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/sites/www.onlinedown.net/.eslintrc b/sites/www.onlinedown.net/.eslintrc new file mode 100644 index 000000000..84a3a2e9c --- /dev/null +++ b/sites/www.onlinedown.net/.eslintrc @@ -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 + } +} diff --git a/sites/www.onlinedown.net/.gitignore b/sites/www.onlinedown.net/.gitignore new file mode 100644 index 000000000..1207415d5 --- /dev/null +++ b/sites/www.onlinedown.net/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +dist/ +.idea/ +*.log +Thumbs.db +.DS_Store +*.swp +*.gz diff --git a/sites/www.onlinedown.net/common/.gitkeep b/sites/www.onlinedown.net/common/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/www.onlinedown.net/components/mip-jump/README.md b/sites/www.onlinedown.net/components/mip-jump/README.md new file mode 100644 index 000000000..56218e195 --- /dev/null +++ b/sites/www.onlinedown.net/components/mip-jump/README.md @@ -0,0 +1,41 @@ +# mip-jump + +标题|内容 +----|---- +类型| +支持布局| +所需脚本| [https://c.mipcdn.com/extensions/platform/v2/onlinedown.net/mip-jump/mip-jump.js](https://c.mipcdn.com/extensions/platform/v2/onlinedown.net/mip-jump/mip-jump.js) + +## 说明 + +判断用户使用是移动端还是非移动端,如果是非移动端访问m站时,页面进行跳转到www站 + +## 示例 + +示例说明 + +``` html + + + + + + MIP page + + + + + +
+ +
+ + + + +``` + +## 属性 +无 diff --git a/sites/www.onlinedown.net/components/mip-jump/example/index.html b/sites/www.onlinedown.net/components/mip-jump/example/index.html new file mode 100644 index 000000000..be6ca8cbb --- /dev/null +++ b/sites/www.onlinedown.net/components/mip-jump/example/index.html @@ -0,0 +1,20 @@ + + + + + + MIP page + + + + + +
+ +
+ + + + diff --git a/sites/www.onlinedown.net/components/mip-jump/index.less b/sites/www.onlinedown.net/components/mip-jump/index.less new file mode 100644 index 000000000..45a4b7739 --- /dev/null +++ b/sites/www.onlinedown.net/components/mip-jump/index.less @@ -0,0 +1,6 @@ +mip-jump { + .wrapper { + margin: 0 auto; + text-align: center; + } +} diff --git a/sites/www.onlinedown.net/components/mip-jump/mip-jump.js b/sites/www.onlinedown.net/components/mip-jump/mip-jump.js new file mode 100644 index 000000000..99982958f --- /dev/null +++ b/sites/www.onlinedown.net/components/mip-jump/mip-jump.js @@ -0,0 +1,222 @@ +/** + * @file 非移动端访问M站,跳转到www站 + * @author wangying (wangying@njxzwh.com) + */ +import './index.less' + +export default class MIPExample extends MIP.CustomElement { + connectedCallback () { + let urls = window.location.href + // 获取域名 + let domain = urls.split('/') + if (domain[2]) { + domain = domain[2] + } + // 移动平台不跳,非移动平台就跳转 + if (!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { + let mprefix = null + let wprefix = null + if (domain === 'm.onlinedown.net' || domain === 'mnews.onlinedown.net') { // 华军 + if (domain === 'm.onlinedown.net') { + mprefix = 'https://m.onlinedown.net' + wprefix = 'https://www.onlinedown.net' + } else { + mprefix = 'https://mnews.onlinedown.net' + wprefix = 'https://news.onlinedown.net' + } + let zt = urls.toString().split('zt/')[1] + let soft = urls.toString().split('soft/')[1] + let sort = urls.toString().split('sort/')[1] + let miniapp = urls.toString().split('miniapp/')[1] + let it = urls.toString().split('it/')[1] + let list = '/sort/' + sort + let zuanti = '/zt/' + zt + let softDetail = '/soft/' + soft + let appDetail = '/miniapp/' + miniapp + let itDetail = '/it/' + it + if (urls === mprefix + list && sort !== '') { // 聚合页(列表) + getData(mprefix + list, wprefix + list) + window.location.href = wprefix + list + } else if (urls === mprefix + softDetail && soft !== '') { // 软件详情页 + getData(mprefix + softDetail, wprefix + softDetail) + window.location.href = wprefix + softDetail + } else if (urls === mprefix + zuanti && zt !== '') { // 专题详情页 + getData(mprefix + zuanti, wprefix + zuanti) + window.location.href = wprefix + zuanti + } else if (urls === mprefix + appDetail && miniapp !== '') { // 小程序详情页 + getData(mprefix + appDetail, wprefix + appDetail) + window.location.href = wprefix + appDetail + } else if (urls === mprefix + itDetail && it !== '') { // 资讯详情页 + getData(mprefix + itDetail, wprefix + itDetail) + window.location.href = wprefix + itDetail + } + switch (urls) { + case 'https://m.onlinedown.net/': // 首页 + getData('https://m.onlinedown.net/', 'https://www.onlinedown.net/') + window.location.href = 'https://www.onlinedown.net/' + break + case 'https://m.onlinedown.net/new/': // 最近更新 + getData('https://m.onlinedown.net/new/', 'https://www.onlinedown.net/new/') + window.location.href = 'https://www.onlinedown.net/new/' + break + case 'https://m.onlinedown.net/new/zt/': // 专题频道页 + getData('https://m.onlinedown.net/zt/', 'https://www.onlinedown.net/zt/') + window.location.href = 'https://www.onlinedown.net/zt/' + break + case 'https://m.onlinedown.net/sort/': // 软件频道页 + getData('https://m.onlinedown.net/sort/', 'https://www.onlinedown.net/sort/') + window.location.href = 'https://www.onlinedown.net/sort/' + break + case 'https://mnews.onlinedown.net/': // 资讯频道页 + getData('https://mnews.onlinedown.net/', 'https://news.onlinedown.net/') + window.location.href = 'https://news.onlinedown.net/' + break + case 'https://m.onlinedown.net/miniapp/': // 小程序频道页 + getData('https://m.onlinedown.net/miniapp/', 'https://www.onlinedown.net/miniapp/') + window.location.href = 'https://www.onlinedown.net/miniapp/' + break + case 'https://m.onlinedown.net/game/': // 安卓手游频道页 + getData('https://m.onlinedown.net/game/', 'https://www.onlinedown.net/game/') + window.location.href = 'https://www.onlinedown.net/game/' + break + default: + } + } else if (domain === 'm.pcsoft.com.cn') { // pcsoft + mprefix = 'https://m.pcsoft.com.cn' + wprefix = 'https://www.pcsoft.com.cn' + let anGame = null + let sort = null + let zt = urls.toString().split('zhuanti/')[1] + let article = urls.toString().split('article/')[1] + let anSoft = urls.toString().split('android/soft/')[1] + let iosGame = urls.toString().split('ios/game/')[1] + let iosSoft = urls.toString().split('ios/soft/')[1] + let soft = urls.toString().split('soft/')[1] + let android = urls.toString().split('android/game/')[1] + if (android !== undefined && android.indexOf('html') !== -1) { // 安卓游戏详情页 + anGame = android + } else { // 聚合页(列表) + sort = android + } + let list = '/android/game/' + sort + let softDetail = '/soft/' + soft + let zuanti = '/zhuanti/' + zt + let articleDetail = '/article/' + article + let angDetail = '/android/game/' + anGame + let ansDetail = '/android/soft/' + anSoft + let iosgDetail = '/ios/game/' + iosGame + let iossDetail = '/ios/soft/' + iosSoft + if (urls === mprefix + list && sort !== '') { // 聚合页(列表) + getData(mprefix + list, wprefix + list) + window.location.href = wprefix + list + } else if (urls === mprefix + softDetail && soft !== '') { // 软件详情页 + getData(mprefix + softDetail, wprefix + softDetail) + window.location.href = wprefix + softDetail + } else if (urls === mprefix + zuanti && zt !== '') { // 专题详情页 + getData(mprefix + zuanti, wprefix + zuanti) + window.location.href = wprefix + zuanti + } else if (urls === mprefix + articleDetail && article !== '') { // 资讯详情页 + getData(mprefix + articleDetail, wprefix + articleDetail) + window.location.href = wprefix + articleDetail + } else if (urls === mprefix + iossDetail && iosSoft !== '') { // 苹果软件详情页 + getData(mprefix + iossDetail, wprefix + iossDetail) + window.location.href = wprefix + iossDetail + } else if (urls === mprefix + iosgDetail && iosGame !== '') { // 苹果游戏详情页 + getData(mprefix + iosgDetail, wprefix + iosgDetail) + window.location.href = wprefix + iosgDetail + } else if (urls === mprefix + ansDetail && anSoft !== '') { // 安卓软件详情页 + getData(mprefix + ansDetail, wprefix + ansDetail) + window.location.href = wprefix + ansDetail + } else if (urls === mprefix + angDetail && anGame !== '') { // 安卓游戏详情页 + getData(mprefix + angDetail, wprefix + angDetail) + window.location.href = wprefix + angDetail + } + switch (urls) { + case 'https://m.pcsoft.com.cn/': // 首页 + getData('https://m.pcsoft.com.cn/', 'https://www.pcsoft.com.cn/') + window.location.href = 'https://www.pcsoft.com.cn/' + break + case 'https://m.pcsoft.com.cn/soft/newlist.html': // 最近更新 + getData('https://m.pcsoft.com.cn/soft/newlist.html', 'https://www.pcsoft.com.cn/soft/newlist.html') + window.location.href = 'https://www.pcsoft.com.cn/soft/newlist.html' + break + case 'https://m.pcsoft.com.cn/zhuanti/': // 专题频道页 + getData('https://m.pcsoft.com.cn/zhuanti/', 'https://www.pcsoft.com.cn/zhuanti/') + window.location.href = 'https://www.pcsoft.com.cn/zhuanti/' + break + case 'https://m.pcsoft.com.cn/android/soft/': // 软件频道页 + getData('https://m.pcsoft.com.cn/android/soft/', 'https://www.pcsoft.com.cn/android/soft/') + window.location.href = 'https://www.pcsoft.com.cn/android/soft/' + break + case 'https://m.pcsoft.com.cn/android/': // 安卓频道页 + getData('https://m.pcsoft.com.cn/android/', 'https://www.pcsoft.com.cn/android/') + window.location.href = 'https://www.pcsoft.com.cn/android/' + break + case 'https://m.pcsoft.com.cn/ios/': // 苹果频道页 + getData('https://m.pcsoft.com.cn/ios/', 'https://www.pcsoft.com.cn/ios/') + window.location.href = 'https://www.pcsoft.com.cn/ios/' + break + case 'https://m.pcsoft.com.cn/wap_article/': // 资讯频道页 + getData('https://m.pcsoft.com.cn/wap_article/', 'https://www.pcsoft.com.cn/wap_article/') + window.location.href = 'https://www.pcsoft.com.cn/wap_article/' + break + default: + } + } else if (domain === 'm.188soft.com') { // 188soft + mprefix = 'http://m.188soft.com' + wprefix = 'http://www.188soft.com' + let soft = urls.toString().split('soft/')[1] + let sort = urls.toString().split('sorts/')[1] + let info = urls.toString().split('info/')[1] + let list = null + if (sort !== 'game/' && sort !== '') { + list = '/sorts/' + sort + } + let softDetail = '/soft/' + soft + let infoDetail = '/info/' + info + if (urls === mprefix + list && sort !== '') { // 聚合页(列表) + getData(mprefix + list, wprefix + list) + window.location.href = wprefix + list + } else if (urls === mprefix + softDetail && soft !== '') { // 软件详情页 + getData(mprefix + softDetail, wprefix + softDetail) + window.location.href = wprefix + softDetail + } else if (urls === mprefix + infoDetail && info !== '') { // 软件详情页 + getData(mprefix + infoDetail, wprefix + infoDetail) + window.location.href = wprefix + infoDetail + } + switch (urls) { + case 'http://m.188soft.com/': // 首页 + getData('http://m.188soft.com/', 'http://www.188soft.com/') + window.location.href = 'http://www.188soft.com/' + break + case 'http://m.188soft.com/new/': // 最近更新 + getData('http://m.188soft.com/new/', 'http://www.188soft.com/new/') + window.location.href = 'http://www.188soft.com/new/' + break + case 'http://m.188soft.com/sorts/': // 软件频道页 + getData('http://m.188soft.com/sorts/', 'http://www.188soft.com/sorts/') + window.location.href = 'http://www.188soft.com/sorts/' + break + case 'http://m.188soft.com/news/': // 资讯页 + getData('http://m.188soft.com/news/', 'http://www.188soft.com/news/') + window.location.href = 'http://www.188soft.com/news/' + break + case 'http://m.188soft.com/sorts/game/': // 安卓手游频道页 + getData('http://m.188soft.com/sorts/game/', 'http://www.188soft.com/sorts/game/') + window.location.href = 'http://www.188soft.com/sorts/game/' + break + default: + } + } + } + function getData (startUrl, endUrl) { // 跳转统计 + fetch('https://mip.js.xzstatic.com/collect', { + method: 'POST', + body: 'startUrl=' + startUrl + '&endUrl=' + endUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + } + } +} diff --git a/sites/www.onlinedown.net/example/index.html b/sites/www.onlinedown.net/example/index.html new file mode 100644 index 000000000..a0ad2dec7 --- /dev/null +++ b/sites/www.onlinedown.net/example/index.html @@ -0,0 +1,26 @@ + + + + + + MIP page + + + + + +
+

First MIP page

+

Add MIP components here

+ +
+ + + + diff --git a/sites/www.onlinedown.net/mip.config.js b/sites/www.onlinedown.net/mip.config.js new file mode 100644 index 000000000..d5457bef4 --- /dev/null +++ b/sites/www.onlinedown.net/mip.config.js @@ -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 + } +} diff --git a/sites/www.onlinedown.net/package.json b/sites/www.onlinedown.net/package.json new file mode 100644 index 000000000..22cee4140 --- /dev/null +++ b/sites/www.onlinedown.net/package.json @@ -0,0 +1,25 @@ +{ + "name": "www.onlinedown.net", + "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": "wangying (wangying@njxzwh.com)", + "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" + } +} diff --git a/sites/www.onlinedown.net/static/.gitkeep b/sites/www.onlinedown.net/static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/www.pcsoft.com.cn/.editorconfig b/sites/www.pcsoft.com.cn/.editorconfig new file mode 100644 index 000000000..cb530eac4 --- /dev/null +++ b/sites/www.pcsoft.com.cn/.editorconfig @@ -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 diff --git a/sites/www.pcsoft.com.cn/.eslintignore b/sites/www.pcsoft.com.cn/.eslintignore new file mode 100644 index 000000000..db4c6d9b6 --- /dev/null +++ b/sites/www.pcsoft.com.cn/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/sites/www.pcsoft.com.cn/.eslintrc b/sites/www.pcsoft.com.cn/.eslintrc new file mode 100644 index 000000000..84a3a2e9c --- /dev/null +++ b/sites/www.pcsoft.com.cn/.eslintrc @@ -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 + } +} diff --git a/sites/www.pcsoft.com.cn/.gitignore b/sites/www.pcsoft.com.cn/.gitignore new file mode 100644 index 000000000..1207415d5 --- /dev/null +++ b/sites/www.pcsoft.com.cn/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +dist/ +.idea/ +*.log +Thumbs.db +.DS_Store +*.swp +*.gz diff --git a/sites/www.pcsoft.com.cn/common/.gitkeep b/sites/www.pcsoft.com.cn/common/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/README.md b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/README.md new file mode 100644 index 000000000..76f7f10f2 --- /dev/null +++ b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/README.md @@ -0,0 +1,44 @@ +# mip-pcsoft-jump + +| 标题 | 内容 | +| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 类型 | +| 支持布局 | +| 所需脚本 | [https://c.mipcdn.com/extensions/platform/v2/www.pcsoft.com.cn/mip-pcsoft-jump/mip-pcsoft-jump.js](https://c.mipcdn.com/extensions/platform/v2/www.pcsoft.com.cn/mip-pcsoft-jump/mip-pcsoft-jump.js) | +## 说明 + +判断用户使用是移动端还是非移动端,如果是非移动端访问m站时,页面进行跳转到www站 + +## 示例 + +示例说明 + +``` html + + + + + + + MIP page + + + + + + +
+ +
+ + + + + +``` + +## 属性 +无 \ No newline at end of file diff --git a/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/example/index.html b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/example/index.html new file mode 100644 index 000000000..7e1d15e10 --- /dev/null +++ b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/example/index.html @@ -0,0 +1,20 @@ + + + + + + MIP page + + + + + +
+ +
+ + + + diff --git a/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/index.less b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/index.less new file mode 100644 index 000000000..8b7c72c63 --- /dev/null +++ b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/index.less @@ -0,0 +1,6 @@ +mip-pcsoft-jump { + .wrapper { + margin: 0 auto; + text-align: center; + } +} diff --git a/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/mip-pcsoft-jump.js b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/mip-pcsoft-jump.js new file mode 100644 index 000000000..dccf84861 --- /dev/null +++ b/sites/www.pcsoft.com.cn/components/mip-pcsoft-jump/mip-pcsoft-jump.js @@ -0,0 +1,113 @@ +/** + * @file pcsoft网站js判断非移动端访问M站,跳转到www站 + * @author wangying (wangying@njxzwh.com) + */ +import './index.less' + +export default class MIPExample extends MIP.CustomElement { + connectedCallback () { + let urls = window.location.href + // 获取域名 + let domain = urls.split('/') + if (domain[2]) { + domain = domain[2] + } + // 移动平台不跳,非移动平台就跳转 + if (!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { + let mprefix = null + let wprefix = null + if (domain === 'm.pcsoft.com.cn') { // pcsoft + mprefix = 'https://m.pcsoft.com.cn' + wprefix = 'https://www.pcsoft.com.cn' + let anGame = null + let sort = null + let zt = urls.toString().split('zhuanti/')[1] + let article = urls.toString().split('article/')[1] + let anSoft = urls.toString().split('android/soft/')[1] + let iosGame = urls.toString().split('ios/game/')[1] + let iosSoft = urls.toString().split('ios/soft/')[1] + let soft = urls.toString().split('soft/')[1] + let android = urls.toString().split('android/game/')[1] + if (android !== undefined && android.indexOf('html') !== -1) { // 安卓游戏详情页 + anGame = android + } else { // 聚合页(列表) + sort = android + } + let list = '/android/game/' + sort + let softDetail = '/soft/' + soft + let zuanti = '/zhuanti/' + zt + let articleDetail = '/article/' + article + let angDetail = '/android/game/' + anGame + let ansDetail = '/android/soft/' + anSoft + let iosgDetail = '/ios/game/' + iosGame + let iossDetail = '/ios/soft/' + iosSoft + if (urls === mprefix + list && sort !== '') { // 聚合页(列表) + getData(mprefix + list, wprefix + list) + window.location.href = wprefix + list + } else if (urls === mprefix + softDetail && soft !== '') { // 软件详情页 + getData(mprefix + softDetail, wprefix + softDetail) + window.location.href = wprefix + softDetail + } else if (urls === mprefix + zuanti && zt !== '') { // 专题详情页 + getData(mprefix + zuanti, wprefix + zuanti) + window.location.href = wprefix + zuanti + } else if (urls === mprefix + articleDetail && article !== '') { // 资讯详情页 + getData(mprefix + articleDetail, wprefix + articleDetail) + window.location.href = wprefix + articleDetail + } else if (urls === mprefix + iossDetail && iosSoft !== '') { // 苹果软件详情页 + getData(mprefix + iossDetail, wprefix + iossDetail) + window.location.href = wprefix + iossDetail + } else if (urls === mprefix + iosgDetail && iosGame !== '') { // 苹果游戏详情页 + getData(mprefix + iosgDetail, wprefix + iosgDetail) + window.location.href = wprefix + iosgDetail + } else if (urls === mprefix + ansDetail && anSoft !== '') { // 安卓软件详情页 + getData(mprefix + ansDetail, wprefix + ansDetail) + window.location.href = wprefix + ansDetail + } else if (urls === mprefix + angDetail && anGame !== '') { // 安卓游戏详情页 + getData(mprefix + angDetail, wprefix + angDetail) + window.location.href = wprefix + angDetail + } + switch (urls) { + case 'https://m.pcsoft.com.cn/': // 首页 + getData('https://m.pcsoft.com.cn/', 'https://www.pcsoft.com.cn/') + window.location.href = 'https://www.pcsoft.com.cn/' + break + case 'https://m.pcsoft.com.cn/soft/newlist.html': // 最近更新 + getData('https://m.pcsoft.com.cn/soft/newlist.html', 'https://www.pcsoft.com.cn/soft/newlist.html') + window.location.href = 'https://www.pcsoft.com.cn/soft/newlist.html' + break + case 'https://m.pcsoft.com.cn/zhuanti/': // 专题频道页 + getData('https://m.pcsoft.com.cn/zhuanti/', 'https://www.pcsoft.com.cn/zhuanti/') + window.location.href = 'https://www.pcsoft.com.cn/zhuanti/' + break + case 'https://m.pcsoft.com.cn/android/soft/': // 软件频道页 + getData('https://m.pcsoft.com.cn/android/soft/', 'https://www.pcsoft.com.cn/android/soft/') + window.location.href = 'https://www.pcsoft.com.cn/android/soft/' + break + case 'https://m.pcsoft.com.cn/android/': // 安卓频道页 + getData('https://m.pcsoft.com.cn/android/', 'https://www.pcsoft.com.cn/android/') + window.location.href = 'https://www.pcsoft.com.cn/android/' + break + case 'https://m.pcsoft.com.cn/ios/': // 苹果频道页 + getData('https://m.pcsoft.com.cn/ios/', 'https://www.pcsoft.com.cn/ios/') + window.location.href = 'https://www.pcsoft.com.cn/ios/' + break + case 'https://m.pcsoft.com.cn/wap_article/': // 资讯频道页 + getData('https://m.pcsoft.com.cn/wap_article/', 'https://www.pcsoft.com.cn/wap_article/') + window.location.href = 'https://www.pcsoft.com.cn/wap_article/' + break + default: + } + } + } + + function getData (startUrl, endUrl) { // 跳转统计接口 + fetch('https://mip.js.xzstatic.com/collect', { + method: 'POST', + body: 'startUrl=' + startUrl + '&endUrl=' + endUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + } + }) + } + } +} diff --git a/sites/www.pcsoft.com.cn/example/index.html b/sites/www.pcsoft.com.cn/example/index.html new file mode 100644 index 000000000..a0ad2dec7 --- /dev/null +++ b/sites/www.pcsoft.com.cn/example/index.html @@ -0,0 +1,26 @@ + + + + + + MIP page + + + + + +
+

First MIP page

+

Add MIP components here

+ +
+ + + + diff --git a/sites/www.pcsoft.com.cn/mip.config.js b/sites/www.pcsoft.com.cn/mip.config.js new file mode 100644 index 000000000..d5457bef4 --- /dev/null +++ b/sites/www.pcsoft.com.cn/mip.config.js @@ -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 + } +} diff --git a/sites/www.pcsoft.com.cn/package.json b/sites/www.pcsoft.com.cn/package.json new file mode 100644 index 000000000..11d4d28bc --- /dev/null +++ b/sites/www.pcsoft.com.cn/package.json @@ -0,0 +1,25 @@ +{ + "name": "www.pcsoft.com.cn", + "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": "wangying@njxzwh.com", + "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" + } +} diff --git a/sites/www.pcsoft.com.cn/static/.gitkeep b/sites/www.pcsoft.com.cn/static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/xiongzhang.baidu.com/components/mip-auth-page/mip-auth-page.vue b/sites/xiongzhang.baidu.com/components/mip-auth-page/mip-auth-page.vue index 86329e1be..c7836cc90 100644 --- a/sites/xiongzhang.baidu.com/components/mip-auth-page/mip-auth-page.vue +++ b/sites/xiongzhang.baidu.com/components/mip-auth-page/mip-auth-page.vue @@ -1,137 +1,137 @@ - - - - - + + + + +