商品详情页跳转

123
DongZeLiang 2024-03-26 15:22:27 +08:00
parent aa94a0bf49
commit 4a1a808581
3 changed files with 12 additions and 4 deletions

View File

@ -80,7 +80,7 @@ export const constantRoutes = [
redirect: 'product-detail', redirect: 'product-detail',
children: [ children: [
{ {
path: 'product-detail', path: 'product-detail/:detailId(\\d+)',
component: () => import('@/views/product/info/detail/index'), component: () => import('@/views/product/info/detail/index'),
name: 'Demo', name: 'Demo',
meta: {title: '商品详情', icon: 'dashboard', affix: true} meta: {title: '商品详情', icon: 'dashboard', affix: true}

View File

@ -131,7 +131,8 @@ export default {
} }
}, },
created() { created() {
this.initProjectDetailInfo(); const detailId = this.$route.params && this.$route.params.detailId;
this.initProjectDetailInfo(detailId);
}, },
methods: { methods: {
initSku(){ initSku(){
@ -154,8 +155,8 @@ export default {
} }
this.checkSkuInfo = this.projectDetail.projectSkuInfoList.find(skuInfo => skuInfo.sku === sku) this.checkSkuInfo = this.projectDetail.projectSkuInfoList.find(skuInfo => skuInfo.sku === sku)
}, },
initProjectDetailInfo(){ initProjectDetailInfo(detailId){
getDetailInfo(3).then(response => { getDetailInfo(detailId).then(response => {
this.projectDetail = response.data; this.projectDetail = response.data;
this.projectDetail.productAttributeInfoList.map(productAttributeInfo => { this.projectDetail.productAttributeInfoList.map(productAttributeInfo => {
let key = productAttributeInfo.attributeId; let key = productAttributeInfo.attributeId;

View File

@ -115,6 +115,9 @@
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="link-type" @click="toProjectDetail(scope.row.id)">
商品详情
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -514,6 +517,10 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
toProjectDetail(detailId){
let url = `${window.location.origin}/product-detail/${detailId}`;
window.open(url)
},
oneSetting(){ oneSetting(){
this.skuList.forEach(skuInfo => { this.skuList.forEach(skuInfo => {
skuInfo.image = this.oneSettingForm.image; skuInfo.image = this.oneSettingForm.image;