商品详情页跳转

master
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',
children: [
{
path: 'product-detail',
path: 'product-detail/:detailId(\\d+)',
component: () => import('@/views/product/info/detail/index'),
name: 'Demo',
meta: {title: '商品详情', icon: 'dashboard', affix: true}

View File

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

View File

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