From b0b756c1c59da60fe887478680a75abeb0b3683e Mon Sep 17 00:00:00 2001 From: dy-hu Date: Wed, 31 Jul 2024 15:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=92=E5=8A=A8=E5=9B=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 ++-- src/locales/zh-CN.json | 6 ++--- src/util/server.js | 6 ++--- .../components/interactionDiagramImage.vue | 21 ++++++++++------- .../interactionDiagramDetail.vue | 26 +++++++++------------- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/App.vue b/src/App.vue index a8078f8..faf75ad 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,8 +30,8 @@ export default { methods: { initLanguage(){ getAllLangInfo().then((res) => { - i18n.mergeLocaleMessage('en',res.data.en); - i18n.mergeLocaleMessage('zh', res.data.zh); + i18n.mergeLocaleMessage('en',res.data.data.en); + i18n.mergeLocaleMessage('zh', res.data.data.zh); }); }, reload () { diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 34671fb..f6b6fa3 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -331,7 +331,7 @@ "product.productbrief_en":"卖点英文简介", "product.productbriefhint_en":"请输入卖点英文简介", "product.productdetail_en":"商品英文详情", - "client.alreadyhasaccount":"已有账号,", + "client.alreadyhasaccount":"已有账号?", "client.tologin":"去登录", "client.registermeansagree":"注册即代表同意", "client.appuserservice":"《APP用户服务协议》", @@ -604,5 +604,5 @@ "common.exportafterorder_filename":"售后订单数据明细表.xls", "common.after-salestatus_info":"售后信息", "common.more":"更多" - -} \ No newline at end of file + +} diff --git a/src/util/server.js b/src/util/server.js index 052e0f2..7f3efa3 100644 --- a/src/util/server.js +++ b/src/util/server.js @@ -4,7 +4,7 @@ import promise from 'es6-promise' import axios from 'axios' import qs from 'qs' import store from '@/store/index' -import router from '../router' +import router from '../router' // import localStorage from '../storage/localStorage' import Cookie from 'js-cookie' promise.polyfill() @@ -30,7 +30,7 @@ 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') } @@ -40,7 +40,7 @@ service.interceptors.request.use(config => { let result = qs.stringify(params, { arrayFormat: 'repeat' }) return result } - + var fullUrl = window.location.search; if (fullUrl.indexOf("?") != -1) { fullUrl = fullUrl.substring(1); diff --git a/src/views/interactionDiagram/components/interactionDiagramImage.vue b/src/views/interactionDiagram/components/interactionDiagramImage.vue index eceb8e8..08554db 100644 --- a/src/views/interactionDiagram/components/interactionDiagramImage.vue +++ b/src/views/interactionDiagram/components/interactionDiagramImage.vue @@ -26,18 +26,23 @@ export default { showPoint: {}, pointList: [], canvasWidth: 0, - canvasHeight: 0 + canvasHeight: 0, + currentPoint: [] } }, methods: { toProductDetail () { - this.$emit('clickProductDetail', { - productId: this.productData.productId - }) + if (this.currentPoint.product) { + this.$emit('clickProductDetail', { + productId: this.currentPoint.product.productId, + skuId: this.currentPoint.product.skuId, + shopId: this.currentPoint.product.shopId + }) + } }, // 点击元素获取组件配置 handleClick(row, index) { - console.log("handleClick"); + this.currentPoint = row if(this.showPoint == row){ this.showPoint = null }else{ @@ -47,7 +52,7 @@ export default { setParams (data, pointList) { this.interactionDiagramDetailData = data this.pointList = pointList - + const position = { height: 650, width: 900 @@ -113,7 +118,7 @@ export default { padding: 0; transition: border-color .25s ease-in-out,opacity .25s ease-in-out,visibility .25s ease-in-out; width: 32px; - + &:after { background: #fff; border-radius: 50%; @@ -174,7 +179,7 @@ export default { top: -100px; } .product-detail-bottom{ - + } .product-detail-left{ position: relative; diff --git a/src/views/interactionDiagram/interactionDiagramDetail.vue b/src/views/interactionDiagram/interactionDiagramDetail.vue index 4ea3b67..cb147cb 100644 --- a/src/views/interactionDiagram/interactionDiagramDetail.vue +++ b/src/views/interactionDiagram/interactionDiagramDetail.vue @@ -66,7 +66,6 @@ export default { } this.showPointList = this.pointList.filter(item => item.product) let productIdList = this.showPointList.map(item => item.product.productId) - const getProductsResponse = await getProducts({ ids: productIdList, page: 1, @@ -91,21 +90,18 @@ export default { this.$message.error(res.message || '请求失败!') } }, - clickProductDetail(prointData) { - console.log(prointData) - if (prointData.product) { - let data = { - productId: prointData.product.productId, - skuId: prointData.product.skuId, - shopId: prointData.product.shopId - } - this.$router.push({ - path: "/productDetail", - query: { - proData: JSON.stringify(data) - } - }) + clickProductDetail(product) { + let data = { + productId: product.productId, + skuId: product.skuId, + shopId: product.shopId } + this.$router.push({ + path: "/productDetail", + query: { + proData: JSON.stringify(data) + } + }) } }