diff --git a/.eslintrc.js b/.eslintrc.js index b6b5d34c..c101e75a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -23,6 +23,7 @@ module.exports = { 'generator-star-spacing': 0, // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'space-before-function-paren': 0 + 'space-before-function-paren': 0, + 'no-multiple-empty-lines': [2, { max: 2, maxEOF: 1 }] } } diff --git a/src/App.vue b/src/App.vue index fe45e6bf..c8f0615d 100755 --- a/src/App.vue +++ b/src/App.vue @@ -1,27 +1,28 @@ \ No newline at end of file + + diff --git a/src/components/feed/commentInputTnstance.js b/src/components/feed/commentInputTnstance.js new file mode 100644 index 00000000..d670c374 --- /dev/null +++ b/src/components/feed/commentInputTnstance.js @@ -0,0 +1,106 @@ +import Vue from 'vue' +import CommentInput from './components/commentInput' + +const prefixCls = 'v-comment-input' + +CommentInput.newInstance = properties => { + const _props = properties || {} + + const Instance = new Vue({ + data: Object.assign({}, { + visible: true, + loading: false, + placeholder: '随便说说~' + }, _props), + + render(h) { + let maskVNodes = [] + maskVNodes.push(h('div', { + attrs: { + class: `${prefixCls}-mask` + }, + on: { + 'click': this.maskClick + } + })) + + let bodyVNodes = [] + + bodyVNodes.push(h('div', { + attrs: { + class: `${prefixCls}-wrap` + } + }, [h(CommentInput, { + class: `${prefixCls}`, + props: { + loading: this.loading, + focus: this.visible, + placeholder: this.placeholder + }, + on: { + 'on-ok': this.ok + } + })])) + + return h('div', { + directives: [{ + name: 'show', + value: this.visible + }] + }, [maskVNodes, bodyVNodes]) + }, + computed: {}, + methods: { + maskClick() { + this.visible = !this.visible + }, + cancel() { + this.onCancel() + this.remove() + }, + ok(txt) { + this.loading = true + this.onOk(txt, () => { + this.loading = false + this.cancel() + }) + }, + remove() { + this.$nextTick(() => { + this.destroy() + }) + }, + destroy() { + this.$destroy() + document.body.removeChild(this.$el) + this.onRemove() + }, + onOk() {}, + onCancel() {}, + onRemove() {} + } + }) + + const Parent = Instance.$mount() + document.body.appendChild(Parent.$el) + const Input = Instance.$children[0] + + return { + show(props) { + if ('onOk' in props) { + Parent.onOk = props.onOk + } + if ('placeholder' in props) { + Parent.placeholder = props.placeholder + } + Parent.onRemove = props.onRemove + Parent.visible = true + }, + remove() { + Parent.remove() + }, + components: Input + } +} + +export default CommentInput diff --git a/src/components/feed/components/commentInput.vue b/src/components/feed/components/commentInput.vue index 696cd02d..ac5df346 100644 --- a/src/components/feed/components/commentInput.vue +++ b/src/components/feed/components/commentInput.vue @@ -1,13 +1,18 @@ + + diff --git a/src/page/common/postWenzi.vue b/src/page/common/postWenzi.vue new file mode 100644 index 00000000..524067ed --- /dev/null +++ b/src/page/common/postWenzi.vue @@ -0,0 +1,15 @@ + + + diff --git a/src/page/common/userHome.vue b/src/page/common/userHome.vue index e8f960ab..c0acc331 100644 --- a/src/page/common/userHome.vue +++ b/src/page/common/userHome.vue @@ -1,95 +1,120 @@ \ No newline at end of file + + diff --git a/src/page/group/children/addGroup.vue b/src/page/group/children/addGroup.vue index 2ce2a148..5269ea51 100644 --- a/src/page/group/children/addGroup.vue +++ b/src/page/group/children/addGroup.vue @@ -1,95 +1,95 @@ \ No newline at end of file + + diff --git a/src/page/group/children/groupAll.less b/src/page/group/children/groupAll.less index 7f75eb63..f24b7530 100644 --- a/src/page/group/children/groupAll.less +++ b/src/page/group/children/groupAll.less @@ -1,96 +1,96 @@ @group-all-prefix: group-all; .@{group-all-prefix} { - // 分类 - &-category { - position: fixed; - top: 90px; - width: 100%; - height: 90px; - padding: 0 40px 0 20px; - line-height: 90px; - border-bottom: 1px solid #ededed; - /*no*/ - background-color: #fff; - &.open { - height: calc(~'100vh -' 90px); - padding: 0 20px; - line-height: normal; - .@{group-all-prefix}-category { + // 分类 + &-category { + position: fixed; + top: 90px; + width: 100%; + height: 90px; + padding: 0 40px 0 20px; + line-height: 90px; + border-bottom: 1px solid #ededed; + /*no*/ + background-color: #fff; + &.open { + height: calc(~'100vh -' 90px); + padding: 0 20px; + line-height: normal; + .@{group-all-prefix}-category { - &-list { - padding-top: 30px; - height: auto; - flex-wrap: wrap; - &-item { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex: none; - height: 60px; - width: calc(~'25% - 30px'); - margin: 0 30px 30px 0; - padding: 0 10px; - line-height: 60px; - border-radius: 4px; - /*no*/ - background: #f4f5f5; - font-size: 28px; - text-align: center; - &.active { - background-color: #d9eef6; - } - } - } - &-switch { - display: none; - } - } - } &-list { - width: 100%; - height: 100%; - overflow-x: scroll; - -webkit-overflow-scrolling: touch; - display: flex; - flex-wrap: nowrap; - &-item { - flex: none; - font-size: 26px; - color: #999; - &+& { - margin-left: 50px; - } - &.active { - color: #333; - } - &:last-child { - padding-right: 40px; - } + padding-top: 30px; + height: auto; + flex-wrap: wrap; + &-item { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + flex: none; + height: 60px; + width: calc(~'25% - 30px'); + margin: 0 30px 30px 0; + padding: 0 10px; + line-height: 60px; + border-radius: 4px; + /*no*/ + background: #f4f5f5; + font-size: 28px; + text-align: center; + &.active { + background-color: #d9eef6; } + } } &-switch { - width: 80px; - height: 80px; - background: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0, white 40%, white); - position: absolute; - top: 50%; - right: 0; - transform: translateY(-50%); - display: flex; - align-items: center; - justify-content: center; - .v-icon { - color: #333; - transform: rotate(90deg); - width: 24px; - height: 24px; - } + display: none; } + } } - - &-content{ - padding-top: 180px; - min-height: 100vh; + &-list { + width: 100%; + height: 100%; + overflow-x: scroll; + -webkit-overflow-scrolling: touch; + display: flex; + flex-wrap: nowrap; + &-item { + flex: none; + font-size: 26px; + color: #999; + &+& { + margin-left: 50px; + } + &.active { + color: #333; + } + &:last-child { + padding-right: 40px; + } + } } -} \ No newline at end of file + &-switch { + width: 80px; + height: 80px; + background: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0, white 40%, white); + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + display: flex; + align-items: center; + justify-content: center; + .v-icon { + color: #333; + transform: rotate(90deg); + width: 24px; + height: 24px; + } + } + } + + &-content { + padding-top: 90px; + min-height: 100vh; + } +} diff --git a/src/page/group/children/groupAll.vue b/src/page/group/children/groupAll.vue index 5229f9ac..4d827596 100644 --- a/src/page/group/children/groupAll.vue +++ b/src/page/group/children/groupAll.vue @@ -6,6 +6,7 @@ +
全部
diff --git a/src/page/group/children/groupDetail.less b/src/page/group/children/groupDetail.less index b9a302f7..e69db69f 100644 --- a/src/page/group/children/groupDetail.less +++ b/src/page/group/children/groupDetail.less @@ -1,302 +1,306 @@ @group-detail-prefix: group-detail; .@{group-detail-prefix} { - &-info { - padding-top: 0; + height: 100vh; + overflow: auto; + -webkit-overflow-scrolling: touch; + &-info { + padding-top: 0 !important; + } + &-bgcover { + overflow: hidden; + height: 320px; + position: relative; + .bg-blur { + width: 100%; + height: 100%; + background-repeat: no-repeat; + background-position: top center; + background-size: cover; + filter: blur(15px); + transform: scale(1.1); } - &-bgcover { - overflow: hidden; - height: 320px; - position: relative; - .bg-blur { - width: 100%; - height: 100%; - background-repeat: no-repeat; - background-position: top center; - background-size: cover; - filter: blur(15px); - transform: scale(1.1); - } + } + &-base { + padding: 30px 20px; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 24px; + color: #f4f5f5; + position: absolute; + bottom: 0; + } + &-avatar { + flex: none; + width: 134px; + height: 134px; + border: 2px solid #fff; + /*no*/ + background-color: #ccc; + img { + overflow: hidden; + width: 100%; + object-fit: cover; } - &-base { - padding: 30px 20px; - display: flex; - align-items: center; - justify-content: space-between; - font-size: 24px; - color: #f4f5f5; - position: absolute; - bottom: 0; - } - &-avatar { - flex: none; - width: 134px; - height: 134px; - border: 2px solid #fff; - /*no*/ - background-color: #ccc; - img { - overflow: hidden; - width: 100%; - object-fit: cover; - } + } + &-txt { + flex: 1 1 auto; + margin: 0 20px; + text-align: left; + h3 { + font-size: 32px; + margin: 0 0 30px; } - &-txt { - flex: 1 1 auto; - margin: 0 20px; - text-align: left; - h3 { - font-size: 32px; - margin: 0 0 30px; - } - p { - display: flex; - flex-wrap: nowrap; - max-width: 390px; - span { - &:first-child { - flex: none; - margin-left: 0; - } - max-width: 100%; - margin-left: 15px; - } + p { + display: flex; + flex-wrap: nowrap; + max-width: 390px; + span { + &:first-child { + flex: none; + margin-left: 0; } + max-width: 100%; + margin-left: 15px; + } } - &-action { - flex: none; - &-btn { - display: flex; - align-items: center; - justify-content: center; - white-space: nowrap; - font-size: 26px; - width: 126px; - height: 50px; - line-height: 46px; - border: 1px solid #fff; - /*no*/ - border-radius: 8px; - color: #fff; - .v-icon { - width: 20px; - height: 20px; - margin-right: 5px; - } - } + } + &-action { + flex: none; + &-btn { + display: flex; + align-items: center; + justify-content: center; + white-space: nowrap; + font-size: 26px; + width: 126px; + height: 50px; + line-height: 46px; + border: 1px solid #fff; + /*no*/ + border-radius: 8px; + color: #fff; + .v-icon { + width: 20px; + height: 20px; + margin-right: 5px; + } } + } - &-other { - padding: 30px 0 30px 20px; - width: 100%; - background-color: #fff; - font-size: 28px; - color: #333; - &-row { - display: flex; - align-items: center; - &+& { - margin-top: 30px; - } - - &.flex-start { - align-items: flex-start; - } - } + &-other { + padding: 30px 0 30px 20px; + width: 100%; + background-color: #fff; + font-size: 28px; + color: #333; + &-row { + display: flex; + align-items: center; + &+& { + margin-top: 30px; + } - &-label { - flex: none; - color: #999; - } - &-content { - flex: 1 1 auto; - padding-right: 20px; - height: 100%; - min-height: 80px; - line-height: 80px; - margin-left: 25px; - border-bottom: 1px solid #ededed; - /*no*/ - &.noborder { - border: none; - } - .contactFounder { - display: block; - float: right; - width: 90px; - height: 40px; - line-height: 40px; - text-align: center; - margin-top: 20px; - border-radius: 20px; - font-size: 24px; - color: #fff; - background-color: #fca308; - } - } - .summary { - line-height: normal; - display: flex; - align-items: center; - a { - color: #59b6d7; - } - } + &.flex-start { + align-items: flex-start; + } } - &-feeds { - &-label { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 20px; - height: 70px; - background-color: #f4f5f5; - font-size: 26px; - color: #999; - } - - &-filter { - &-wrap { - height: 100%; - position: relative; - line-height: 70px; - } - &-select { - position: absolute; - bottom: 0; - right: 0; - background-color: #fff; - transform: translateY(100%); - border-radius: 8px; - box-shadow: 0 0 10px 0 rgba(0, 0, 0, .1); - } - &-option { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 20px; - width: 200px; - height: 150/2px; - &+& { - border-top: 1px solid #ededed; - } - .v-icon { - visibility: hidden; - width: 20px; - height: 20px; - } - &.active { - color: #666; - .v-icon { - visibility: visible; - } - } - } - display: flex; - align-items: center; - .v-icon { - margin-left: 15px; - width: 36px; - height: 30px; - } - } + &-label { + flex: none; + color: #999; } - - &-post-btn { - display: flex; - position: fixed; - bottom: 50px; - left: 50%; - align-items: center; - justify-content: center; - width: 81px; - height: 81px; - border-radius: 50%; - background-color: #59b6d7; - border: 2px solid #fff; - /*no*/ - transform: translateX(-50%); + &-content { + flex: 1 1 auto; + padding-right: 20px; + height: 100%; + min-height: 80px; + line-height: 80px; + margin-left: 25px; + border-bottom: 1px solid #ededed; + /*no*/ + &.noborder { + border: none; + } + .contactFounder { + display: block; + float: right; + width: 90px; + height: 40px; + line-height: 40px; + text-align: center; + margin-top: 20px; + border-radius: 20px; + font-size: 24px; color: #fff; - box-shadow: 0 0 10px 0 rgba(0, 0, 0, .1); + background-color: #fca308; + } } + .summary { + line-height: normal; + display: flex; + align-items: center; + a { + color: #59b6d7; + } + } + } - .main { - transition: transform .3s; + &-feeds { + &-label { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + height: 70px; + background-color: #f4f5f5; + font-size: 26px; + color: #999; } - .menu { - padding: 50px 40px 40px; + &-filter { + &-wrap { height: 100%; position: relative; - &-item { - display: flex; - align-items: center; - justify-content: space-between; - font-size: 30px; - color: #4a4d5e; - border-bottom: 1px solid #4a4d5e; - /*no*/ - height: 110px; - &-prepend { - width: 30px; - height: 30px; - } - - &-append { - width: 24px; - height: 24px; - } - - &-title { - color: #ccc; - flex: 1 1 auto; - margin: 0 15px; - } - - &-tips { - margin: 0 15px; - color: #ccc; - flex: 1 1 auto; - font-size: 28px; - text-align: right; - .v-badge-dot { - transform: scale(.7); - } - } + z-index: 10; + line-height: 70px; + } + &-select { + position: absolute; + bottom: 0; + right: 0; + background-color: #fff; + transform: translateY(100%); + border-radius: 8px; + box-shadow: 0 0 10px 0 rgba(0, 0, 0, .1); + } + &-option { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px; + width: 200px; + height: 150/2px; + &+& { + border-top: 1px solid #ededed; } - &-main { - float: right; - width: 450px; - height: 100%; - background-color: #363845; + .v-icon { + visibility: hidden; + width: 20px; + height: 20px; } - &-wrap { - transition: transform .18s; - transform: translate3d(100%, 0, 0); - position: fixed; - top: 0; - left: 0; - bottom: 0; - right: 0; - &.menuOpen { - transform: translate3d(0, 0, 0); - } + &.active { + color: #666; + .v-icon { + visibility: visible; + } } + } + display: flex; + align-items: center; + .v-icon { + margin-left: 15px; + width: 36px; + height: 30px; + } + } + } + + &-post-btn { + display: flex; + position: fixed; + bottom: 50px; + left: 50%; + align-items: center; + justify-content: center; + width: 81px; + height: 81px; + border-radius: 50%; + background-color: #59b6d7; + border: 2px solid #fff; + /*no*/ + transform: translateX(-50%); + color: #fff; + box-shadow: 0 0 10px 0 rgba(0, 0, 0, .1); + } + + .main { + transition: transform .3s; + } + + .menu { + padding: 50px 40px 40px; + height: 100%; + position: relative; + &-item { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 30px; + color: #4a4d5e; + border-bottom: 1px solid #4a4d5e; + /*no*/ + height: 110px; + &-prepend { + width: 30px; + height: 30px; + } + + &-append { + width: 24px; + height: 24px; + } + + &-title { + color: #ccc; + flex: 1 1 auto; + margin: 0 15px; + } - &-exit-group{ - position: absolute; - bottom: 40px; - left: 50%; - margin-left: -320/2px; - font-size: 30px; - color: #ccc; - display: flex; - align-items: center; - justify-content: center; - width: 320px; - height: 60px; - border-radius: 8px; - border: 1px solid rgb(74, 77,94); + &-tips { + margin: 0 15px; + color: #ccc; + flex: 1 1 auto; + font-size: 28px; + text-align: right; + .v-badge-dot { + transform: scale(.7); } + } + } + &-main { + float: right; + width: 450px; + height: 100%; + background-color: #363845; + } + &-wrap { + transition: transform .18s; + transform: translate3d(100%, 0, 0); + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + &.menuOpen { + transform: translate3d(0, 0, 0); + } + } + + &-exit-group { + position: absolute; + bottom: 40px; + left: 50%; + margin-left: -320/2px; + font-size: 30px; + color: #ccc; + display: flex; + align-items: center; + justify-content: center; + width: 320px; + height: 60px; + border-radius: 8px; + border: 1px solid rgb(74, 77, 94); } -} \ No newline at end of file + } +} diff --git a/src/page/group/children/groupDetail.vue b/src/page/group/children/groupDetail.vue index 145f6cd8..0a54ae88 100644 --- a/src/page/group/children/groupDetail.vue +++ b/src/page/group/children/groupDetail.vue @@ -1,7 +1,7 @@