shaogen1995 2 лет назад
Родитель
Сommit
af9501d64f

+ 1 - 1
H5场景/public/static/css/main.css

@@ -3898,7 +3898,7 @@ a.tag-link {
     right: 0;
     right: 0;
     text-shadow: 0 0 1px rgba(0, 0, 0, .6);
     text-shadow: 0 0 1px rgba(0, 0, 0, .6);
     z-index: 100;
     z-index: 100;
-    bottom: 110px;
+    bottom: 110px !important;
 }
 }
 
 
 .pinBottom.left {
 .pinBottom.left {

+ 3 - 0
定制化热点/.browserslistrc

@@ -0,0 +1,3 @@
+> 1%
+last 2 versions
+not dead

+ 17 - 0
定制化热点/.eslintrc.js

@@ -0,0 +1,17 @@
+module.exports = {
+  root: true,
+  env: {
+    node: true
+  },
+  'extends': [
+    'plugin:vue/essential',
+    'eslint:recommended'
+  ],
+  parserOptions: {
+    parser: 'babel-eslint'
+  },
+  rules: {
+    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
+  }
+}

+ 23 - 0
定制化热点/.gitignore

@@ -0,0 +1,23 @@
+.DS_Store
+node_modules
+/dist
+
+
+# local env files
+.env.local
+.env.*.local
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?

+ 24 - 0
定制化热点/README.md

@@ -0,0 +1,24 @@
+# hotspot
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Lints and fixes files
+```
+npm run lint
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5 - 0
定制化热点/babel.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  presets: [
+    '@vue/cli-plugin-babel/preset'
+  ]
+}

Разница между файлами не показана из-за своего большого размера
+ 26499 - 0
定制化热点/package-lock.json


+ 32 - 0
定制化热点/package.json

@@ -0,0 +1,32 @@
+{
+  "name": "hotspot",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "axios": "^0.20.0",
+    "core-js": "^3.6.5",
+    "swiper": "^5.4.5",
+    "v-viewer": "^1.5.1",
+    "vue": "^2.6.11",
+    "vue-awesome-swiper": "^4.1.1",
+    "vue-lazyload": "^1.3.3",
+    "vue-router": "^3.2.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.0",
+    "@vue/cli-plugin-eslint": "~4.5.0",
+    "@vue/cli-plugin-router": "~4.5.0",
+    "@vue/cli-service": "~4.5.0",
+    "babel-eslint": "^10.1.0",
+    "eslint": "^6.7.2",
+    "eslint-plugin-vue": "^6.2.2",
+    "less": "^3.0.4",
+    "less-loader": "^5.0.0",
+    "vue-template-compiler": "^2.6.11"
+  }
+}

+ 16 - 0
定制化热点/public/index.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <title><%= htmlWebpackPlugin.options.title %></title>
+  </head>
+  <body>
+    <noscript>
+      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>

+ 22 - 0
定制化热点/src/App.vue

@@ -0,0 +1,22 @@
+<template>
+  <div id="app">
+    <router-view/>
+  </div>
+</template>
+
+<style lang="less">
+html,body{
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+}
+*{
+  margin: 0;
+  padding: 0;
+}
+#app {
+  width: 100%;
+  height: 100%;
+}
+
+</style>

+ 31 - 0
定制化热点/src/assets/base.css

@@ -0,0 +1,31 @@
+.viewer-title {
+  display: none !important;
+}
+
+.viewer-prev {
+  display: none !important;
+}
+
+.viewer-next {
+  display: none !important;
+}
+
+.viewer-navbar {
+  display: none !important;
+}
+
+.viewer-close {
+  display: none !important;
+}
+
+@media screen and (max-width: 800px) {
+  .viewer-footer {
+    bottom: auto;
+    top: 10px;
+  }
+}
+*{
+  margin: 0;
+  padding: 0;
+  box-sizing: border-box;
+}

BIN
定制化热点/src/assets/images/IMGerror.png


BIN
定制化热点/src/assets/images/audio-icon.png


BIN
定制化热点/src/assets/images/iframe-icon.png


BIN
定制化热点/src/assets/images/img-icon.png


BIN
定制化热点/src/assets/images/loading.gif


BIN
定制化热点/src/assets/images/model-icon.png


BIN
定制化热点/src/assets/images/txt-icon.png


BIN
定制化热点/src/assets/images/video-icon.png


BIN
定制化热点/src/assets/logo.png


+ 59 - 0
定制化热点/src/components/HelloWorld.vue

@@ -0,0 +1,59 @@
+<template>
+  <div class="hello">
+    <h1>{{ msg }}</h1>
+    <p>
+      For a guide and recipes on how to configure / customize this project,<br>
+      check out the
+      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
+    </p>
+    <h3>Installed CLI Plugins</h3>
+    <ul>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
+    </ul>
+    <h3>Essential Links</h3>
+    <ul>
+      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
+      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
+      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
+      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
+      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
+    </ul>
+    <h3>Ecosystem</h3>
+    <ul>
+      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
+      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
+      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
+      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
+      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
+    </ul>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'HelloWorld',
+  props: {
+    msg: String
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="less">
+h3 {
+  margin: 40px 0 0;
+}
+ul {
+  list-style-type: none;
+  padding: 0;
+}
+li {
+  display: inline-block;
+  margin: 0 10px;
+}
+a {
+  color: #42b983;
+}
+</style>

+ 23 - 0
定制化热点/src/main.js

@@ -0,0 +1,23 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import axios from 'axios'
+import 'viewerjs/dist/viewer.css'
+import Viewer from 'v-viewer'
+// 图片懒加载
+import VueLazyLoad from 'vue-lazyload'
+Vue.use(VueLazyLoad, {
+  error: require('@/assets/images/IMGerror.png'),
+  loading: require('@/assets/images/loading.gif')
+})
+
+Vue.config.productionTip = false
+Vue.prototype.$http = axios
+
+Vue.use(Viewer)
+
+import './assets/base.css'
+new Vue({
+  router,
+  render: h => h(App)
+}).$mount('#app')

+ 27 - 0
定制化热点/src/router/index.js

@@ -0,0 +1,27 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+import Home from '../views/Home.vue'
+
+Vue.use(VueRouter)
+
+const routes = [
+  {
+    path: '/',
+    name: 'Home',
+    component: Home
+  },
+  {
+    path: '/about',
+    name: 'About',
+    // route level code-splitting
+    // this generates a separate chunk (about.[hash].js) for this route
+    // which is lazy-loaded when the route is visited.
+    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
+  }
+]
+
+const router = new VueRouter({
+  routes
+})
+
+export default router

+ 29 - 0
定制化热点/src/utils/browser.js

@@ -0,0 +1,29 @@
+function versions () {
+    var u = window.navigator.userAgent
+    return {
+      // IE内核
+      trident: u.indexOf('Trident') > -1,
+      // opera内核
+      presto: u.indexOf('Presto') > -1,
+      // 苹果、谷歌内核
+      webKit: u.indexOf('AppleWebKit') > -1,
+      // 火狐内核
+      gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1,
+      // 是否为移动终端 / Tablets use desktop version
+      mobile: (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) && !(/Tablet|iPad/i.test(navigator.userAgent)),
+      // ios终端
+      ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
+      // android终端或者uc浏览器
+      android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
+      // 是否为iPhone或者安卓QQ浏览器
+      iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1,
+      // 是否为iPad
+      iPad: u.indexOf('iPad') > -1,
+      // 是否为web应用程序,没有头部与底部
+      webApp: u.indexOf('Safari') === -1,
+      // 是否为微信浏览器
+      weixin: ~u.indexOf('MicroMessenger')
+    }
+  }
+  
+  export default versions()

+ 0 - 0
定制化热点/src/utils/http.js


+ 5 - 0
定制化热点/src/views/About.vue

@@ -0,0 +1,5 @@
+<template>
+  <div class="about">
+    <h1>This is an about page</h1>
+  </div>
+</template>

+ 187 - 0
定制化热点/src/views/Home.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class="Home">
+    <!-- 标题 -->
+    <div class="title">{{ myTitle || "热点" }}</div>
+    <!-- 主体带滚动条的盒子 -->
+    <div class="main">
+      <!-- 图片 -->
+      <div class="imgBox">
+        <Swiper class="warpper" ref="mySwiper" :options="swiperOptions">
+          <SwiperSlide v-for="item in myImgArr" :key="item">
+            <img :src="item" alt="" @click="lookImg(item)" />
+          </SwiperSlide>
+        </Swiper>
+        <!-- 索引 -->
+        <div class="myIndBox" v-if="myImgArr.length">
+          {{ myInd + 1 }} / <span>{{ myImgArr.length }}</span>
+        </div>
+      </div>
+      <!-- 介绍 -->
+      <div class="txtBox" v-html="myTxt || '暂无内容'"></div>
+    </div>
+    <!-- 查看图片 -->
+    <viewer class="viewerCla" ref="viewer" :images="lookPics">
+      <img :src="lookPics[0]" alt="" />
+    </viewer>
+  </div>
+</template>
+
+<script>
+import { Swiper, SwiperSlide } from "vue-awesome-swiper";
+import "swiper/css/swiper.css";
+export default {
+  components: { Swiper, SwiperSlide },
+  data() {
+    return {
+      m: this.$route.query.m,
+      id: this.$route.query.id,
+      // 标题
+      myTitle: "",
+      // 图片数组
+      myImgArr: [],
+      // 简介
+      myTxt: "",
+      // 图片索引
+      myInd: 0,
+      // 轮播图设置
+      swiperOptions: {
+        slidesPerView: 1,
+        spaceBetween: 0,
+        centeredSlides: true,
+        on: {
+          slideChangeTransitionEnd: () => {
+            let swiper = this.$refs.mySwiper.$swiper;
+            let activeIndex = swiper.activeIndex;
+            this.myInd = activeIndex;
+          },
+        },
+      },
+      // 查看图片
+      lookPics: [],
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {
+    // 点击查看大图
+    lookImg(url) {
+      let dom = this.$refs.viewer.$viewer;
+      this.lookPics = [url];
+      dom.show();
+    },
+    async getData() {
+      // https://www.4dmodel.com/
+      let url = `https://super.4dage.com/data/${
+        this.id
+      }/hot/js/data.js?time=${Math.random()}`;
+      let result = (await this.$http.get(url)).data;
+      const resData = result[this.m];
+      if (!resData) return alert("热点解析错误");
+      this.myTitle = resData.title;
+      this.myImgArr = resData.images || [];
+      this.myTxt = resData.content;
+    },
+  },
+  created() {},
+  mounted() {
+    this.getData();
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='less' scoped>
+.Home {
+  width: 100%;
+  height: 100%;
+  background-color: black;
+  color: #fff;
+  .viewerCla img {
+    display: none;
+  }
+  .title {
+    height: 50px;
+    line-height: 49px;
+    padding: 0 50px 0 10px;
+    border-bottom: 1px solid #ccc;
+  }
+  .main {
+    height: calc(100% - 50px);
+    width: 100%;
+    overflow-y: auto;
+    // &::-webkit-scrollbar {
+    //   /*滚动条整体样式*/
+    //   width: 3px; /*高宽分别对应横竖滚动条的尺寸*/
+    //   height: 1px;
+    // }
+    // &::-webkit-scrollbar-thumb {
+    //   /*滚动条里面小方块*/
+    //   border-radius: 10px;
+    //   -webkit-box-shadow: inset 0 0 5px transparent;
+    //   background: #ccc;
+    // }
+    // &::-webkit-scrollbar-track {
+    //   /*滚动条里面轨道*/
+    //   -webkit-box-shadow: inset 0 0 5px transparent;
+    //   border-radius: 10px;
+    //   background: transparent;
+    // }
+    .imgBox {
+      height: 80vh;
+      position: relative;
+      .warpper {
+        width: 100%;
+        height: 100%;
+        .swiper-wrapper {
+          img {
+            width: 100%;
+            height: 100%;
+            object-fit: contain;
+          }
+        }
+      }
+      .myIndBox {
+        font-size: 12px;
+        position: absolute;
+        bottom: 20px;
+        left: 50%;
+        transform: translateX(-50%);
+        background: rgba(0, 0, 0, 0.4);
+        border: 1px solid #ccc;
+        border-radius: 15px;
+        padding: 6px 10px;
+        & > span {
+          opacity: 0.6;
+        }
+      }
+    }
+    .txtBox {
+      padding: 40px 15px;
+      font-size: 14px;
+      line-height: 20px;
+      color: black;
+      background-color: #fff;
+      border-radius: 8px 8px 0 0;
+      min-height: 80vh;
+      position: relative;
+      &::before {
+        content: "";
+        width: 35px;
+        height: 4px;
+        background: #444;
+        border-radius: 13px 13px 13px 13px;
+        opacity: 1;
+        position: absolute;
+        top: 14px;
+        left: 50%;
+        transform: translateX(-50%);
+      }
+    }
+  }
+}
+</style>

+ 3 - 0
定制化热点/vue.config.js

@@ -0,0 +1,3 @@
+module.exports = {
+  publicPath: "./"
+};