You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
5.3 KiB

{"remainingRequest":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/linhuakun/Downloads/nodejs/codewhy/src/views/moment/Moment.vue?vue&type=style&index=0&id=0775d42b&scoped=true&lang=css&","dependencies":[{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/src/views/moment/Moment.vue","mtime":1608823241642},{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/css-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/vue-loader/lib/loaders/stylePostLoader.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/postcss-loader/src/index.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/linhuakun/Downloads/nodejs/codewhy/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCi5uYXYtYmFyIHsKICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMTk2LCAxNSwgMTUpOwogIGZvbnQtd2VpZ2h0OiA3MDA7CiAgY29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC44NzcpOwp9Ci5ob21lIHsKICBoZWlnaHQ6IDEwMHZoOwogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjEyLCAyMTIsIDIxMik7Cn0KLmNvbnRlbnQgewogIGxlZnQ6IDA7CiAgcmlnaHQ6IDA7CiAgdG9wOiAzOXB4OwogIGJvdHRvbTogNDlweDsKICBvdmVyZmxvdzogaGlkZGVuOwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKfQoucHVsbGRvd24gewogIHRleHQtYWxpZ246IGNlbnRlcjsKICB0b3A6IDE1cHg7CiAgei1pbmRleDogMTAwOwp9Ci5wdWxsVXB7CiAgdGV4dC1hbGlnbjogY2VudGVyOwogIGJvdHRvbTo1MHB4OwogIHotaW5kZXg6IDEwMDsKfQo="},{"version":3,"sources":["Moment.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"Moment.vue","sourceRoot":"src/views/moment","sourcesContent":["<template >\n <div class=\"home\">\n <NavBar class=\"nav-bar\">\n <div slot=\"center\">白酒论坛</div>\n <div slot=\"right\" @click=\"createmoment\"><i class=\"el-icon-plus\"></i></div>\n </NavBar>\n <Scroll\n class=\"content\"\n ref=\"scroll\"\n :pull-up-load=\"true\"\n :probe-type=\"3\"\n @pullingUp=\"loadMore\"\n @pullingDown=\"pullingDown\"\n >\n <div class=\"pulldown\" v-show=\"pullingdown\"><span>Loading...</span></div>\n <MomentList v-if=\"replace\" :moments=\"moments\"></MomentList>\n <div class=\"pullUp\" v-show=\"pullingUp\"><span>Loading...</span></div>\n </Scroll>\n </div>\n</template>\n\n<script>\nimport NavBar from \"@/components/common/navbar/NavBar\";\nimport { getMomentList } from \"@/network/moment\";\nimport MomentList from \"@/components/content/goods/MomentList\";\nimport Scroll from \"@/components/common/Scroll/Scroll\";\nimport { debounce } from \"@/common/utils\";\n\nexport default {\n name: \"Moment\",\n components: {\n NavBar,\n MomentList,\n Scroll,\n },\n data() {\n return {\n moments: [],\n uploadavatar: null,\n size: 10,\n offset: 0,\n pullingdown: false,\n replace:true,\n pullingUp:false\n };\n },\n created() {\n this.getMoment()\n },\n methods: {\n createmoment() {\n this.$router.push(\"/createmoment\");\n },\n getMoment() {\n getMomentList(this.offset, this.size).then((res) => {\n this.moments.push(...res.data);\n this.offset += 10;\n });\n },\n ReMoment() {\n getMomentList(0, 10).then((res) => {\n this.moments=res.data\n });\n },\n loadMore() {\n this.pullingUp = true;\n setTimeout(() => {\n this.offset=10\n this.getMoment();\n this.pullingUp = false;\n this.$refs.scroll.finishPullUp();\n }, 1000);\n },\n pullingDown() {\n this.pullingdown = true;\n setTimeout(() => {\n this.offset\n this.ReMoment();\n this.pullingdown = false;\n this.$refs.scroll.finishPullDown();\n this.replace=false;\n this.replace=true;\n this.$refs.scroll.refresh();\n }, 3000);\n },\n },\n computed: {\n //切换板块时,回来保存当前的位置\n activated() {\n this.$refs.scroll.refresh();\n this.$refs.scroll.scrollTo(0, this.saveY, 0);\n },\n deactivated() {\n this.saveY = this.$refs.scroll.getScrollY();\n //判断当前哪个图片加载监听\n this.$bus.$off(\"upload\", this.uploadavatar);\n },\n },\n mounted() {\n const refresh = debounce(this.$refs.scroll.refresh, 300);\n this.uploadavatar = () => {\n refresh();\n };\n this.$bus.$on(\"upload\", this.uploadavatar);\n },\n};\n</script>\n\n<style scoped>\n.nav-bar {\n background-color: rgb(196, 15, 15);\n font-weight: 700;\n color: rgba(255, 255, 255, 0.877);\n}\n.home {\n height: 100vh;\n position: relative;\n background-color: rgb(212, 212, 212);\n}\n.content {\n left: 0;\n right: 0;\n top: 39px;\n bottom: 49px;\n overflow: hidden;\n position: absolute;\n}\n.pulldown {\n text-align: center;\n top: 15px;\n z-index: 100;\n}\n.pullUp{\n text-align: center;\n bottom:50px;\n z-index: 100;\n}\n</style>"]}]}