From 99692adf3a96415bd24003c71b64af8e34550457 Mon Sep 17 00:00:00 2001 From: xh-pan1 Date: Fri, 19 Apr 2024 13:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=92=E5=8A=A8=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/interactionDiagram.js | 21 ++ src/components/canvasShow/config/mixin/funMixin.js | 6 + src/router/index.js | 10 + src/util/server.js | 10 +- .../components/interactionDiagramImage.vue | 239 +++++++++++++++++++++ .../interactionDiagramDetail.vue | 196 +++++++++++++++++ 6 files changed, 481 insertions(+), 1 deletion(-) create mode 100644 src/api/interactionDiagram.js create mode 100644 src/views/interactionDiagram/components/interactionDiagramImage.vue create mode 100644 src/views/interactionDiagram/interactionDiagramDetail.vue diff --git a/src/api/interactionDiagram.js b/src/api/interactionDiagram.js new file mode 100644 index 0000000..35d105e --- /dev/null +++ b/src/api/interactionDiagram.js @@ -0,0 +1,21 @@ +import request from '@/util/server.js' + +// 获取动态图详情 +export function getInteractionDiagramDetail (params) { + return request({ + url: '/cereInteractionDiagram/getById', + method: 'get', + params + }) +} + + +// 查询商品 +export function getProducts (params) { + return request({ + url: '/canvas/getProducts', + method: 'get', + params + }) +} + diff --git a/src/components/canvasShow/config/mixin/funMixin.js b/src/components/canvasShow/config/mixin/funMixin.js index 5067dcb..a802f62 100644 --- a/src/components/canvasShow/config/mixin/funMixin.js +++ b/src/components/canvasShow/config/mixin/funMixin.js @@ -40,6 +40,12 @@ export const tool = { query: {shopId: linkObj.data.shopId} }); break + case '互动图': + router.push({ + path: '/interactionDiagramDetail', + query: {interactionDiagramId: linkObj.data.interactionDiagramId} + }); + break case '商品': // this.setCurrentPro(linkObj.data) // router.push("/productDetail"); diff --git a/src/router/index.js b/src/router/index.js index 516fbda..7f4f2c6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -363,6 +363,16 @@ const router = new Router({ searchVisible: false } }, + // 互动图详情 + { + path: '/interactionDiagramDetail', + name: 'interactionDiagramDetail', + component: () => import('@/views/interactionDiagram/interactionDiagramDetail'), + meta: { + logoText: '', + searchVisible: false + } + }, // 商品详情 { path: '/productDetail', diff --git a/src/util/server.js b/src/util/server.js index 48e568c..9a1a718 100644 --- a/src/util/server.js +++ b/src/util/server.js @@ -2,6 +2,7 @@ import Vue from 'vue' import promise from 'es6-promise' import axios from 'axios' +import qs from 'qs' import store from '@/store/index' import router from '../router' // import localStorage from '../storage/localStorage' @@ -29,10 +30,17 @@ service.interceptors.request.use(config => { // if (localStorage.get('token')) { // config.headers['x-auth-token'] = localStorage.get('token') // } + if (Cookie.get('token')) { config.headers['Authorization'] = Cookie.get('token') } + config.headers['language'] = localStorage.getItem("language") || 'zh' + config.paramsSerializer = function(params) { + let result = qs.stringify(params, { arrayFormat: 'repeat' }) + return result + } + var fullUrl = window.location.search; if (fullUrl.indexOf("?") != -1) { fullUrl = fullUrl.substring(1); @@ -48,7 +56,7 @@ service.interceptors.request.use(config => { }else{ config.headers['project'] = '0' } - config.headers['language'] = localStorage.getItem("language") || 'zh' + return config }, error => { return Promise.reject(error) diff --git a/src/views/interactionDiagram/components/interactionDiagramImage.vue b/src/views/interactionDiagram/components/interactionDiagramImage.vue new file mode 100644 index 0000000..eceb8e8 --- /dev/null +++ b/src/views/interactionDiagram/components/interactionDiagramImage.vue @@ -0,0 +1,239 @@ + + + + + diff --git a/src/views/interactionDiagram/interactionDiagramDetail.vue b/src/views/interactionDiagram/interactionDiagramDetail.vue new file mode 100644 index 0000000..4ea3b67 --- /dev/null +++ b/src/views/interactionDiagram/interactionDiagramDetail.vue @@ -0,0 +1,196 @@ + + + + +