bd 3 years ago
parent
commit
ab2600705b
4 changed files with 39 additions and 38 deletions
  1. 1 1
      src/api/htgj/api.js
  2. 32 32
      src/router/index.js
  3. 2 0
      src/views/htgj/index.scss
  4. 4 5
      src/views/htgj/report.vue

+ 1 - 1
src/api/htgj/api.js

@@ -28,7 +28,7 @@ export const RaiApi = {
   },
   /* 页面复制监听*/
   pageHistoryCopy: (params) => {
-    return post("/config/pageHistoryPublic", params, 1);
+    return post("/article/pageHistoryPublic", params, 1);
   },
   /*上传文章阅读时间接口*/
   addStopTime: (params) => {

+ 32 - 32
src/router/index.js

@@ -1,38 +1,38 @@
-import { createRouter, createWebHistory } from 'vue-router'
-import {hzybRoutes} from './hzyb/index'// 弘则研报小程序路由
-import {cygxRoutes} from './cygx/index'// 查研观向小程序路由
-import {hzslRoutes} from './hzsl/index'// 弘则思路小程序路由
-import {htgjRoutes} from './htgj/index'// 海通国际 APP 路由
+import { createRouter, createWebHistory } from "vue-router";
+import { hzybRoutes } from "./hzyb/index"; // 弘则研报小程序路由
+import { cygxRoutes } from "./cygx/index"; // 查研观向小程序路由
+import { hzslRoutes } from "./hzsl/index"; // 弘则思路小程序路由
+import { htgjRoutes } from "./htgj/index"; // 海通国际 APP 路由
 import store from "@/store";
-const routes=[
-    ...hzybRoutes,
-    ...cygxRoutes,
-    ...hzslRoutes,
-    ...htgjRoutes,
-    //404
-    {
-        path: "/:pathMatch(.*)",
-        name:"404",
-        component: () => import("@/views/Error.vue"),
-    },
-]
+const routes = [
+  ...hzybRoutes,
+  ...cygxRoutes,
+  ...hzslRoutes,
+  ...htgjRoutes,
+  //404
+  {
+    path: "/:pathMatch(.*)",
+    name: "404",
+    component: () => import("@/views/Error.vue"),
+  },
+];
 
 const router = createRouter({
-   history: createWebHistory(import.meta.env.VITE_APP_BASE_URL),
-   routes
-})
+  history: createWebHistory(import.meta.env.VITE_APP_BASE_URL),
+  routes,
+});
 
 router.beforeEach((to, from, next) => {
-        if(to.fullPath.includes('htgj')) {
-             to.query.userName  = '哔哩哔哩老电视-0001'
-             to.query.sign  = 77777
-             let data = {
-                name: to.query.userName,
-                sign: to.query.sign 
-             }
-            store.commit('getUserData', data)
-        }
-	next();
-})
+  if (to.fullPath.includes("htgj")) {
+    let data = {
+        name: to.query.userName,
+        sign: to.query.sign,
+      }
+      if(!store.state.userData.name || !store.state.userData.sign){
+        store.commit("getUserData", data);
+      }
+  }
+  next();
+});
 
-export default router
+export default router;

+ 2 - 0
src/views/htgj/index.scss

@@ -55,6 +55,7 @@
         height: 277px;
         font-size: 24px;
         line-height: 40px;
+        width: 99%;
         color: #7f7f7f;
         overflow: hidden;
         text-overflow: ellipsis;
@@ -87,6 +88,7 @@
         font-size: 26px;
         color: #6a6a6a;
         margin-bottom: 10px;
+        word-break:break-all;
         .report_ico {
           width: 32px;
           height: 26px;

+ 4 - 5
src/views/htgj/report.vue

@@ -80,8 +80,7 @@ const scrolltop = () => {
 /* 复制 */
 const copyMonitor = () => {
   RaiApi.pageHistoryCopy({
-    DetailId: rerportId.value + "",
-    PageType: "ArticleCopy",
+    DetailId: rerportId.value + ""
   }).then((res) => {});
 };
 
@@ -91,8 +90,8 @@ const waterMark = (text) => {
   let ctx = canvas.getContext("2d");
   ctx.font = "20px Arial";
   ctx.rotate((-45 * Math.PI) / 200);
-  ctx.fillText(text, 30, 160);
-  ctx.fillText(text, -40, 80);
+  ctx.fillText(text, 30, 200);
+  ctx.fillText(text, -40, 100);
 
   // 将canvas的内容转换为base64编码
   let data = canvas.toDataURL("image/png");
@@ -274,7 +273,7 @@ const { reportInfo } = toRefs(state);
   .btn-returntop {
     position: fixed;
     right: 40px;
-    bottom: 290px;
+    bottom: 150px;
     width: 88px;
     height: 88px;
     z-index: 10;