Commit b6aaac47 by 梁建民

js

parent 6767420a
Showing with 17 additions and 7 deletions
...@@ -22,15 +22,20 @@ ...@@ -22,15 +22,20 @@
<p class="t1">{{item.title}}</p> <p class="t1">{{item.title}}</p>
<div class="bar"> <div class="bar">
<p class="t2">已下载{{item.download_num}}次</p> <p class="t2">已下载{{item.download_num}}次</p>
<a class="btn" @click="download(item.data_id)">下载</a> <template v-if="loginCheck">
<a class="btn" @click="download(item.data_id)">下载</a>
</template>
<template>
<a class="btn" @click="toUrl">下载</a>
</template>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<template v-if="articleShowData.length <= 3"> <template v-if="!loginCheck">
<div class="islogin" @click="toUrl"> <div class="islogin" @click="toUrl">
<img src="../../assets/images/download/loading.png" alt=""> <img src="../../assets/images/download/loading.png" alt="">
<a href="javascript:;">点击登录查看更多 ></a> <a href="javascript:;">登录查看更多哦</a>
</div> </div>
</template> </template>
<div class="slide-bar" v-backTopWindow style="cursor: pointer;"> <div class="slide-bar" v-backTopWindow style="cursor: pointer;">
...@@ -63,7 +68,8 @@ ...@@ -63,7 +68,8 @@
computed: { computed: {
...mapState({ ...mapState({
getfileuploadbanner: state => state.download.getfileuploadbanner, getfileuploadbanner: state => state.download.getfileuploadbanner,
articleShowData: state => state.download.articleShowData articleShowData: state => state.download.articleShowData,
loginCheck: state => state.common.loginCheck
}) })
}, },
created() { created() {
...@@ -80,6 +86,10 @@ ...@@ -80,6 +86,10 @@
this.$store.dispatch({ this.$store.dispatch({
type: "articleShowData" type: "articleShowData"
}); });
this.$store.dispatch({
type: "loginCheck",
is_jump: false
});
}, },
download(id) { download(id) {
this.$store.dispatch({ this.$store.dispatch({
...@@ -94,7 +104,7 @@ ...@@ -94,7 +104,7 @@
}); });
setTimeout(() => { setTimeout(() => {
window.location.href = '/v3/login?from=download' window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
}, 2000) }, 2000)
}, },
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime@7.4.5@@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.1@vuex/dist/vuex.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.0.1@vant/es/index.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_3__[\"SwipeItem\"]).use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"news\",\n data: function data() {\n return {\n title: \"资料下载\",\n p: 1,\n meaushow: true,\n bannerHeight: 200,\n navListfixed: false\n };\n },\n computed: Object(E_h5_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])({\n getfileuploadbanner: function getfileuploadbanner(state) {\n return state.download.getfileuploadbanner;\n },\n articleShowData: function articleShowData(state) {\n return state.download.articleShowData;\n }\n })),\n created: function created() {\n this.getData();\n },\n mounted: function mounted() {\n this.scrollFns();\n },\n methods: {\n getData: function getData() {\n this.$store.dispatch({\n type: \"getfileuploadbanner\"\n });\n this.$store.dispatch({\n type: \"articleShowData\"\n });\n },\n download: function download(id) {\n this.$store.dispatch({\n type: \"downloadFile\",\n id: id\n });\n },\n toUrl: function toUrl() {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: \"请登录后下载\",\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = '/v3/login?from=download';\n }, 2000);\n },\n scrollFns: function scrollFns() {\n var self = this;\n\n window.onscroll = function () {\n var t = document.documentElement.scrollTop || document.body.scrollTop;\n\n if (t >= 300) {\n self.navListfixed = true;\n } else {\n self.navListfixed = false;\n }\n };\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/download/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime@7.4.5@@babel/runtime/helpers/esm/objectSpread.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.1@vuex/dist/vuex.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.0.1@vant/es/index.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_3__[\"SwipeItem\"]).use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"news\",\n data: function data() {\n return {\n title: \"资料下载\",\n p: 1,\n meaushow: true,\n bannerHeight: 200,\n navListfixed: false\n };\n },\n computed: Object(E_h5_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])({\n getfileuploadbanner: function getfileuploadbanner(state) {\n return state.download.getfileuploadbanner;\n },\n articleShowData: function articleShowData(state) {\n return state.download.articleShowData;\n },\n loginCheck: function loginCheck(state) {\n return state.common.loginCheck;\n }\n })),\n created: function created() {\n this.getData();\n },\n mounted: function mounted() {\n this.scrollFns();\n },\n methods: {\n getData: function getData() {\n this.$store.dispatch({\n type: \"getfileuploadbanner\"\n });\n this.$store.dispatch({\n type: \"articleShowData\"\n });\n this.$store.dispatch({\n type: \"loginCheck\",\n is_jump: false\n });\n },\n download: function download(id) {\n this.$store.dispatch({\n type: \"downloadFile\",\n id: id\n });\n },\n toUrl: function toUrl() {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: \"请登录后下载\",\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download';\n }, 2000);\n },\n scrollFns: function scrollFns() {\n var self = this;\n\n window.onscroll = function () {\n var t = document.documentElement.scrollTop || document.body.scrollTop;\n\n if (t >= 300) {\n self.navListfixed = true;\n } else {\n self.navListfixed = false;\n }\n };\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/download/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.6@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options");
/***/ }), /***/ }),
...@@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var E_h5 ...@@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var E_h5
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"section\",\n { staticClass: \"news\" },\n [\n _c(\"Header\", {\n attrs: { bgcolor: \"#fff\", title: _vm.title, meaushow: _vm.meaushow }\n }),\n _vm._m(0),\n _vm.getfileuploadbanner.length > 0\n ? [\n _c(\n \"van-swipe\",\n {\n staticClass: \"a\",\n attrs: { autoplay: 3000, height: _vm.bannerHeight }\n },\n _vm._l(_vm.getfileuploadbanner, function(item, index) {\n return _c(\"van-swipe-item\", { key: index }, [\n _c(\n \"a\",\n {\n attrs: {\n href: item.url,\n target: item.window_open > 0 ? \"_blank\" : \"_self\"\n }\n },\n [\n _c(\"img\", {\n attrs: {\n src: item.images,\n height: \"100%\",\n width: \"100%\"\n }\n })\n ]\n )\n ])\n }),\n 1\n )\n ]\n : _vm._e(),\n _c(\"div\", { staticClass: \"down-list\" }, [\n _c(\n \"ul\",\n { staticClass: \"boxsiz\" },\n _vm._l(_vm.articleShowData, function(item, index) {\n return _c(\"li\", { key: index, staticClass: \"boxsiz\" }, [\n _c(\"p\", { staticClass: \"t1\" }, [_vm._v(_vm._s(item.title))]),\n _c(\"div\", { staticClass: \"bar\" }, [\n _c(\"p\", { staticClass: \"t2\" }, [\n _vm._v(\"已下载\" + _vm._s(item.download_num) + \"次\")\n ]),\n _c(\n \"a\",\n {\n staticClass: \"btn\",\n on: {\n click: function($event) {\n return _vm.download(item.data_id)\n }\n }\n },\n [_vm._v(\"下载\")]\n )\n ])\n ])\n }),\n 0\n )\n ]),\n _vm.articleShowData.length <= 3\n ? [\n _c(\"div\", { staticClass: \"islogin\", on: { click: _vm.toUrl } }, [\n _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! ../../assets/images/download/loading.png */ \"./src/assets/images/download/loading.png\"),\n alt: \"\"\n }\n }),\n _c(\"a\", { attrs: { href: \"javascript:;\" } }, [\n _vm._v(\"点击登录查看更多 >\")\n ])\n ])\n ]\n : _vm._e(),\n _c(\n \"div\",\n {\n directives: [{ name: \"backTopWindow\", rawName: \"v-backTopWindow\" }],\n staticClass: \"slide-bar\",\n staticStyle: { cursor: \"pointer\" }\n },\n [\n _vm.navListfixed\n ? _c(\"div\", { staticClass: \"backtop\" }, [\n _c(\"i\", { staticClass: \"iconfont icon-xiangshang1\" })\n ])\n : _vm._e()\n ]\n )\n ],\n 2\n )\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"new-head boxsiz\" }, [\n _c(\"a\", { staticClass: \"logo\", attrs: { href: \"/\" } }, [\n _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! ../../assets/images/download/logo.png */ \"./src/assets/images/download/logo.png\"),\n alt: \"猎芯网\"\n }\n })\n ]),\n _c(\"span\", { staticClass: \"t1\" }, [_vm._v(\"猎芯网\")])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/views/download/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%223fdc9e70-vue-loader-template%22%7D!./node_modules/_vue-loader@15.7.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"section\",\n { staticClass: \"news\" },\n [\n _c(\"Header\", {\n attrs: { bgcolor: \"#fff\", title: _vm.title, meaushow: _vm.meaushow }\n }),\n _vm._m(0),\n _vm.getfileuploadbanner.length > 0\n ? [\n _c(\n \"van-swipe\",\n {\n staticClass: \"a\",\n attrs: { autoplay: 3000, height: _vm.bannerHeight }\n },\n _vm._l(_vm.getfileuploadbanner, function(item, index) {\n return _c(\"van-swipe-item\", { key: index }, [\n _c(\n \"a\",\n {\n attrs: {\n href: item.url,\n target: item.window_open > 0 ? \"_blank\" : \"_self\"\n }\n },\n [\n _c(\"img\", {\n attrs: {\n src: item.images,\n height: \"100%\",\n width: \"100%\"\n }\n })\n ]\n )\n ])\n }),\n 1\n )\n ]\n : _vm._e(),\n _c(\"div\", { staticClass: \"down-list\" }, [\n _c(\n \"ul\",\n { staticClass: \"boxsiz\" },\n _vm._l(_vm.articleShowData, function(item, index) {\n return _c(\"li\", { key: index, staticClass: \"boxsiz\" }, [\n _c(\"p\", { staticClass: \"t1\" }, [_vm._v(_vm._s(item.title))]),\n _c(\n \"div\",\n { staticClass: \"bar\" },\n [\n _c(\"p\", { staticClass: \"t2\" }, [\n _vm._v(\"已下载\" + _vm._s(item.download_num) + \"次\")\n ]),\n _vm.loginCheck\n ? [\n _c(\n \"a\",\n {\n staticClass: \"btn\",\n on: {\n click: function($event) {\n return _vm.download(item.data_id)\n }\n }\n },\n [_vm._v(\"下载\")]\n )\n ]\n : _vm._e(),\n [\n _c(\"a\", { staticClass: \"btn\", on: { click: _vm.toUrl } }, [\n _vm._v(\"下载\")\n ])\n ]\n ],\n 2\n )\n ])\n }),\n 0\n )\n ]),\n !_vm.loginCheck\n ? [\n _c(\"div\", { staticClass: \"islogin\", on: { click: _vm.toUrl } }, [\n _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! ../../assets/images/download/loading.png */ \"./src/assets/images/download/loading.png\"),\n alt: \"\"\n }\n }),\n _c(\"a\", { attrs: { href: \"javascript:;\" } }, [\n _vm._v(\"登录查看更多哦\")\n ])\n ])\n ]\n : _vm._e(),\n _c(\n \"div\",\n {\n directives: [{ name: \"backTopWindow\", rawName: \"v-backTopWindow\" }],\n staticClass: \"slide-bar\",\n staticStyle: { cursor: \"pointer\" }\n },\n [\n _vm.navListfixed\n ? _c(\"div\", { staticClass: \"backtop\" }, [\n _c(\"i\", { staticClass: \"iconfont icon-xiangshang1\" })\n ])\n : _vm._e()\n ]\n )\n ],\n 2\n )\n}\nvar staticRenderFns = [\n function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\"div\", { staticClass: \"new-head boxsiz\" }, [\n _c(\"a\", { staticClass: \"logo\", attrs: { href: \"/\" } }, [\n _c(\"img\", {\n attrs: {\n src: __webpack_require__(/*! ../../assets/images/download/logo.png */ \"./src/assets/images/download/logo.png\"),\n alt: \"猎芯网\"\n }\n })\n ]),\n _c(\"span\", { staticClass: \"t1\" }, [_vm._v(\"猎芯网\")])\n ])\n }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/views/download/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%223fdc9e70-vue-loader-template%22%7D!./node_modules/_vue-loader@15.7.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options");
/***/ }), /***/ }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment