Browse Source

互动图修改

master
dy-hu 6 months ago
parent
commit
b0b756c1c5
  1. 4
      src/App.vue
  2. 6
      src/locales/zh-CN.json
  3. 6
      src/util/server.js
  4. 21
      src/views/interactionDiagram/components/interactionDiagramImage.vue
  5. 26
      src/views/interactionDiagram/interactionDiagramDetail.vue

4
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 () {

6
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":"更多"
}
}

6
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);

21
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;

26
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)
}
})
}
}

Loading…
Cancel
Save