商品参数修改
parent
8ecc85a21c
commit
29630a8495
|
@ -153,7 +153,7 @@
|
||||||
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
|
||||||
|
|
||||||
<!-- 宝贝详情 -->
|
<!-- 宝贝详情 -->
|
||||||
<GoodsIntro id="main9" :res="goodsDetail" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" />
|
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" />
|
||||||
|
|
||||||
<!-- 宝贝推荐 -->
|
<!-- 宝贝推荐 -->
|
||||||
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
<GoodsRecommend id="main11" :res="likeGoodsList" />
|
||||||
|
@ -328,6 +328,7 @@ export default {
|
||||||
top: 0,
|
top: 0,
|
||||||
height: 50,
|
height: 50,
|
||||||
},
|
},
|
||||||
|
goodsParams: [], // 商品参数
|
||||||
headerFlag: false, //顶部导航显示与否
|
headerFlag: false, //顶部导航显示与否
|
||||||
headerList: [
|
headerList: [
|
||||||
//顶部导航文字按照规则来 详情全局搜索
|
//顶部导航文字按照规则来 详情全局搜索
|
||||||
|
@ -499,15 +500,13 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectSku (idObj) {
|
selectSku (idObj) { // 选择sku的回调
|
||||||
console.log(idObj)
|
|
||||||
this.init(idObj.skuId,idObj.goodsId)
|
this.init(idObj.skuId,idObj.goodsId)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 初始化信息
|
* 初始化信息
|
||||||
*/
|
*/
|
||||||
async init(id, goodsId, distributionId) {
|
async init(id, goodsId, distributionId) {
|
||||||
console.log(id, goodsId)
|
|
||||||
this.isGroup = false; //初始化拼团
|
this.isGroup = false; //初始化拼团
|
||||||
this.productId = id; // skuId
|
this.productId = id; // skuId
|
||||||
// 这里请求获取到页面数据 解析数据
|
// 这里请求获取到页面数据 解析数据
|
||||||
|
@ -534,6 +533,7 @@ export default {
|
||||||
this.goodsDetail = response.data.result.data;
|
this.goodsDetail = response.data.result.data;
|
||||||
this.goodsSpec = response.data.result.specs;
|
this.goodsSpec = response.data.result.specs;
|
||||||
this.PromotionList = response.data.result.promotionMap;
|
this.PromotionList = response.data.result.promotionMap;
|
||||||
|
this.goodsParams = response.data.result.goodsParamsDTOList || []
|
||||||
|
|
||||||
// 判断是否拼团活动或者积分商品 如果有则显示拼团活动信息
|
// 判断是否拼团活动或者积分商品 如果有则显示拼团活动信息
|
||||||
this.PromotionList &&
|
this.PromotionList &&
|
||||||
|
|
|
@ -18,20 +18,19 @@
|
||||||
<div class="goods-detail-box">
|
<div class="goods-detail-box">
|
||||||
<div class="goods-detail-item goods-active">商品参数</div>
|
<div class="goods-detail-item goods-active">商品参数</div>
|
||||||
</div>
|
</div>
|
||||||
<u-divider>商品参数</u-divider>
|
<!-- <u-divider>商品参数</u-divider> -->
|
||||||
<div class="param-list" v-if="!goodsDetail.goodsParamsList || goodsDetail.goodsParamsList.length == 0">
|
<div class="param-list" v-if="goodsParams.length == 0">
|
||||||
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
<u-empty text="暂无商品参数" mode="list"></u-empty>
|
||||||
</div>
|
</div>
|
||||||
<div class="param-list" v-if="goodsDetail.goodsParamsList && goodsDetail.goodsParamsList.length != 0">
|
<div class="params-group" v-for="(group,groupIndex) in goodsParams" :key="groupIndex">
|
||||||
<div class="param-item" v-for="(param,index) in goodsDetail.goodsParamsList" :key="index">
|
<view style="font-weight: bold;margin-left: 10px;">{{group.groupName}}</view>
|
||||||
<div class="param-left">
|
<div class="param-list">
|
||||||
{{param.paramName}}
|
<div class="param-item" v-for="(param,index) in group.goodsParamsItemDTOList" :key="index">
|
||||||
</div>
|
<div class="param-left">{{param.paramName}}</div>
|
||||||
<div class="param-right">
|
<div class="param-right">{{param.paramValue}}</div>
|
||||||
{{param.paramValue}}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -43,11 +42,12 @@ import { getGoodsMessage } from "@/api/goods";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
goodsDetail: "",
|
goodsDetail: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["res", "goodsId"],
|
props: ["res", "goodsId", "goodsParams"],
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
console.log(this.res)
|
||||||
let res = await getGoodsMessage(this.goodsId);
|
let res = await getGoodsMessage(this.goodsId);
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.goodsDetail = res.data.result;
|
this.goodsDetail = res.data.result;
|
||||||
|
|
Loading…
Reference in New Issue