diff --git a/sites/pc0359.cn/.editorconfig b/sites/pc0359.cn/.editorconfig new file mode 100644 index 000000000..cb530eac4 --- /dev/null +++ b/sites/pc0359.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/pc0359.cn/.eslintignore b/sites/pc0359.cn/.eslintignore new file mode 100644 index 000000000..db4c6d9b6 --- /dev/null +++ b/sites/pc0359.cn/.eslintignore @@ -0,0 +1,2 @@ +dist +node_modules \ No newline at end of file diff --git a/sites/pc0359.cn/.eslintrc b/sites/pc0359.cn/.eslintrc new file mode 100644 index 000000000..84a3a2e9c --- /dev/null +++ b/sites/pc0359.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/pc0359.cn/.gitignore b/sites/pc0359.cn/.gitignore new file mode 100644 index 000000000..1207415d5 --- /dev/null +++ b/sites/pc0359.cn/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +dist/ +.idea/ +*.log +Thumbs.db +.DS_Store +*.swp +*.gz diff --git a/sites/pc0359.cn/common/.gitkeep b/sites/pc0359.cn/common/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/sites/pc0359.cn/components/mip-cyb-comment/README.md b/sites/pc0359.cn/components/mip-cyb-comment/README.md new file mode 100644 index 000000000..ef5e1d906 --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-comment/README.md @@ -0,0 +1,48 @@ +# mip-cyb-comment +标题|移动端评论块 +----|---- +类型|通用 +支持布局| +所需脚本| [https://c.mipcdn.com/extensions/platform/v2/pc0359.cn/mip-cyb-comment/mip-cyb-comment.js](https://c.mipcdn.com/extensions/platform/v2/pc0359.cn/mip-cyb-comment/mip-cyb-comment.js) + +## 说明 + +显示评论列表,分页,回复,支持评论 + +## 示例 + +``` + +``` + +## 属性 + +### id + +**说明**:本页面ID + +**必选项**:是 + +**单位**:字符串 + +**默认值**:无 + +### cid + +**说明**:本页面分类ID + +**必选项**:是 + +**单位**:字符串 + +**默认值**:无 + +### url + +**说明**:本站点网址 + +**必选项**:是 + +**单位**:字符串 + +**默认值**:无 \ No newline at end of file diff --git a/sites/pc0359.cn/components/mip-cyb-comment/example/index.html b/sites/pc0359.cn/components/mip-cyb-comment/example/index.html new file mode 100644 index 000000000..ff339f373 --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-comment/example/index.html @@ -0,0 +1,55 @@ + + + + + + 评论块 + + + + + +
+ +
+ + + + + + +
    +
  • +
  • 取消
  • +
+
请填写评论内容
+
+ +
+
+ +
+
+ +
+
+
+
我要跟帖
+ +
所有评论 共 0
+
+
+
+
+ + + + diff --git a/sites/pc0359.cn/components/mip-cyb-comment/index.less b/sites/pc0359.cn/components/mip-cyb-comment/index.less new file mode 100644 index 000000000..961b51dfd --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-comment/index.less @@ -0,0 +1,2 @@ +mip-cyb-comment { +} diff --git a/sites/pc0359.cn/components/mip-cyb-comment/mip-cyb-comment.js b/sites/pc0359.cn/components/mip-cyb-comment/mip-cyb-comment.js new file mode 100644 index 000000000..07b0d33bf --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-comment/mip-cyb-comment.js @@ -0,0 +1,131 @@ +const { CustomElement, util } = MIP +const { jsonParse, dom, css } = util +export default class MIPCybComment extends CustomElement { + data () { + return { + id: this.element.getAttribute('id'), + cid: this.element.getAttribute('cid'), + url: this.element.getAttribute('url'), + hasReply: this.element.getAttribute('hasReply') + } + } + build () { + let ele = this.element + // let morepl = ele.querySelectorAll('#comment-more') + let plbox = ele.querySelectorAll('.plbox')[0] + let plbtn = ele.querySelectorAll('.plbtn')[0] + let cancel = ele.querySelectorAll('#cancel')[0] + // 更多评论 + ele.querySelectorAll('#comment-more input')[0].onclick = () => { + this.readComment() + } + // 读取评论 + this.readComment() + // 显示评论 + plbtn.onclick = () => { + css(plbtn, { display: 'none' }) + css(plbox, { display: 'block' }) + } + // 取消评论 + cancel.onclick = () => { + css(plbox, { display: 'none' }) + css(plbtn, { display: 'block' }) + document.getElementById('repid').value = '0' + } + } + + /* + *读取评论 + */ + readComment () { + // let _this = this + let ul = document.getElementById('comment-list') + let morepl = this.element.querySelectorAll('#comment-more') + let oli = ul.getElementsByTagName('dl') + let p = Math.floor(oli.length / 5 + 1) + fetch(`${this.data().url}/e/extend/comments/?classid=${this.data().cid}&id=${this.data().id}&page=${p}`, { + method: 'GET' + }).then((responseText) => { + return responseText.text() + }).then((responseRes) => { + let html = '' + let data = jsonParse(responseRes) + if (p >= data.pagenum) { + morepl[0].innerHTML = '

没有更多评论了!

' + } + document.getElementById('plnum').innerText = data.num + if (data.num === 0) { + morepl[0].innerHTML = '

还没有发布过评价

' + } + for (let i = 0; i < data.list.length; i++) { + let list = data.list[i] + html += '
' + list.saytime + '' + list.plusername + '[' + list.sayip + ']
' + list.saytext + '

支持 ' + list.zcnum + '回复

' + } + oli.length === 0 ? ul.innerHTML = html : ul.innerHTML = ul.innerHTML + html + this.pldigg() + this.reply() + }) + } + + /* + *赞评论 + */ + pldigg () { + let _this = this + let ctrl = document.getElementsByClassName('up') + for (let i = 0; i < ctrl.length; i++) { + ctrl[i].onclick = function () { + let id = this.getAttribute('data-id') + let pid = document.getElementById('pldigg' + id + '1') + let num = Number(pid.innerText) + fetch(`${_this.data().url}/e/extend/comments/?enews=DoForPlajax&plid=${id}&id=${_this.data().id}&classid=${_this.data().cid}&dopl=1&doajax=1`, { + method: 'GET' + }).then((responseText) => { + return responseText.text() + }).then((responseRes) => { + let data = jsonParse(responseRes) + if (data.status === 1) { + pid.innerText = num + 1 + } else { + _this.cAlert(data.msg) + } + }) + } + } + } + + /* + *回复评论 + */ + reply () { + let _this = this + let ctrl = document.getElementsByClassName('huifu') + let repid = document.getElementById('repid') + let plbox = _this.element.querySelectorAll('.plbox')[0] + let plbtn = _this.element.querySelectorAll('.plbtn')[0] + for (let i = 0; i < ctrl.length; i++) { + ctrl[i].onclick = function () { + let id = this.getAttribute('data-id') + repid.value = id + css(plbtn, { display: 'none' }) + css(plbox, { display: 'block' }) + document.getElementById('saytext').focus() + } + } + } + + /* 提示 + */ + cAlert (msg) { + if (document.getElementById('alert_tips')) { + document.getElementById('alert_tips').parentNode.removeChild(document.getElementById('alert_tips')) + } + let cTips = dom.create(`${msg}`) + document.body.appendChild(cTips) + setTimeout(() => { + if (document.getElementById('alert_tips')) { + document.getElementById('alert_tips').parentNode.removeChild(document.getElementById('alert_tips')) + } + }, 3000) + } +} diff --git a/sites/pc0359.cn/components/mip-cyb-downinfo/README.md b/sites/pc0359.cn/components/mip-cyb-downinfo/README.md new file mode 100644 index 000000000..7fead2e08 --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-downinfo/README.md @@ -0,0 +1,21 @@ +# mip-cyb-downinfo + +标题|下载页面所需逻辑 +----|---- +类型| +支持布局| +所需脚本| [https://c.mipcdn.com/extensions/platform/v2/pc0359.cn/mip-cyb-downinfo/mip-cyb-downinfo.js](https://c.mipcdn.com/extensions/platform/v2/pc0359.cn/mip-cyb-downinfo/mip-cyb-downinfo.js) + +## 说明 + +用于下载地址,判断系统平台。 + +## 示例 + + + +``` + +``` + +## 属性 diff --git a/sites/pc0359.cn/components/mip-cyb-downinfo/example/index.html b/sites/pc0359.cn/components/mip-cyb-downinfo/example/index.html new file mode 100644 index 000000000..339856049 --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-downinfo/example/index.html @@ -0,0 +1,20 @@ + + + + + + MIP page + + + + + +
+ +
+ + + + diff --git a/sites/pc0359.cn/components/mip-cyb-downinfo/index.less b/sites/pc0359.cn/components/mip-cyb-downinfo/index.less new file mode 100644 index 000000000..6c9e9fb45 --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-downinfo/index.less @@ -0,0 +1,6 @@ +mip-cyb-downinfo { + .wrapper { + margin: 0 auto; + text-align: center; + } +} diff --git a/sites/pc0359.cn/components/mip-cyb-downinfo/mip-cyb-downinfo.js b/sites/pc0359.cn/components/mip-cyb-downinfo/mip-cyb-downinfo.js new file mode 100644 index 000000000..106602e6f --- /dev/null +++ b/sites/pc0359.cn/components/mip-cyb-downinfo/mip-cyb-downinfo.js @@ -0,0 +1,37 @@ +const { CustomElement, util } = MIP +const { platform } = util +export default class MIPCybDowninfo extends CustomElement { + build () { + let ele = this.element + // let android = platform.isAndroid() + let ios = platform.isIOS() + let down = ele.querySelectorAll('#soft-download') + let dandroid = ele.querySelectorAll('#down-android') + let dofficial = ele.querySelectorAll('#down-official') + let dappstore = ele.querySelectorAll('#down-appstore') + let dnormal = ele.querySelectorAll('#down-normal') + ele.querySelectorAll('#soft-download').innerHTML = '
  • 此软件不提供苹果版下载
  • ' + if (ios) { + if (dandroid.length) { + down[0].removeChild(dandroid[0]) + } + if (dofficial.length) { + down[0].removeChild(dofficial[0]) + } + if (dappstore.length === 0) { + down[0].innerHTML = '
  • 此软件不提供苹果版下载
  • ' + } + } else { + if (dappstore.length) { + down[0].removeChild(dappstore[0]) + } + if (dandroid.length === 0) { + down[0].innerHTML = '
  • 此软件不提供安卓版下载
  • ' + } + } + if (dnormal.length) { + down[0].removeChild(dnormal[0]) + down[0].innerHTML = '
  • 抱歉!此软件暂不提供手机版下载。
  • ' + } + } +} diff --git a/sites/pc0359.cn/example/comment.html b/sites/pc0359.cn/example/comment.html new file mode 100644 index 000000000..032ac813d --- /dev/null +++ b/sites/pc0359.cn/example/comment.html @@ -0,0 +1,100 @@ + + + + + + MIP page + + + + + +
    + +
    + + + + + + +
      +
    • +
    • 取消
    • +
    +
    请填写评论内容
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    我要跟帖
    + +
    所有评论 共 0
    +
    +
    +
    +
    + + + + diff --git a/sites/pc0359.cn/example/index.html b/sites/pc0359.cn/example/index.html new file mode 100644 index 000000000..a0ad2dec7 --- /dev/null +++ b/sites/pc0359.cn/example/index.html @@ -0,0 +1,26 @@ + + + + + + MIP page + + + + + +
    +

    First MIP page

    +

    Add MIP components here

    + +
    + + + + diff --git a/sites/pc0359.cn/example/info.html b/sites/pc0359.cn/example/info.html new file mode 100644 index 000000000..f241247de --- /dev/null +++ b/sites/pc0359.cn/example/info.html @@ -0,0 +1,24 @@ + + + + + + MIP page + + + + + +
    + + + +
    + + + + diff --git a/sites/pc0359.cn/mip.config.js b/sites/pc0359.cn/mip.config.js new file mode 100644 index 000000000..d5457bef4 --- /dev/null +++ b/sites/pc0359.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/pc0359.cn/package.json b/sites/pc0359.cn/package.json new file mode 100644 index 000000000..5b663151e --- /dev/null +++ b/sites/pc0359.cn/package.json @@ -0,0 +1,25 @@ +{ + "name": "pc0359.cn", + "version": "0.0.1", + "description": "mip", + "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": "chinayubo qq 415204", + "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/pc0359.cn/static/.gitkeep b/sites/pc0359.cn/static/.gitkeep new file mode 100644 index 000000000..e69de29bb