商品详情页跳转
parent
aa94a0bf49
commit
4a1a808581
|
@ -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}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue