Commit 6f68575b by 李嘉林

测试规格

parent 1333464e
......@@ -5,17 +5,21 @@ export default {
getLiveInfo(options) {
return requestPOST1(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveBroadcastInfoByIds?liveBroadcastId=${options}`);
},
// 查询商品详情
getProductInfo(options) {
return requestPOST1(`${process.env.OLSHOP_URL}/product/get_product_info?productId=${options}`);
},
// 查询所有产品规格详情
getProductGoodsByProductInfo(options) {
return requestPOST(`${process.env.OLSHOP_URL}/product/get_product_goods_by_product_info`, options);
return requestPOST1(`${process.env.OLSHOP_URL}/product/get_product_goods_by_product_info?productInfoId=${options}`);
},
// 获取商品所有规格
getProductGoodsSpecifications(options) {
return requestPOST(`${process.env.OLSHOP_URL}/product/get_goods_specifications`, options);
return requestPOST1(`${process.env.OLSHOP_URL}/product/get_goods_specifications?productId=${options}`);
},
// 查询产品信息
getProductGoodsByMixId(options) {
return requestPOST(`${process.env.OLSHOP_URL}/product/get_product_goods_by_mix_id`, options);
return requestPOST1(`${process.env.OLSHOP_URL}/product/get_product_goods_by_mix_id?productGoodsMixId=${options}`);
},
// 添加购物车
addCart(options) {
......
......@@ -10,15 +10,15 @@
<div class="list">
<div class="item" v-for="(item,index) in goodsList" :key="index">
<div class="img">
<img :src="item.img" alt />
<img :src="item.productImgUrl" alt />
</div>
<div class="info">
<p class="name line-clamp2">{{item.name}}</p>
<p class="name line-clamp2">{{item.productName}}</p>
<div class="bottom">
<div class="price">
<p>
<span></span>
<span>{{item.price}}</span>
<span>{{item.minPrice}}</span>
</p>
<p class="del">
<span></span>
......@@ -34,12 +34,14 @@
</div>
</van-popup>
<!-- 选择规格弹层 -->
<livedSelectionSpe :show="showSpe" :productInfoId="productInfoId" @closeSpeDia="closeSpeDia"></livedSelectionSpe>
<livedSelectionSpe v-if="showSpe" :show="showSpe" :productInfoId="itemGoods.productId" :minSale="itemGoods.minSale" :maxSale="itemGoods.maxSale" :goodsImg="itemGoods.goodsImg" :minSuggestedRetailPrice="itemGoods.minSuggestedRetailPrice" :maxSuggestedRetailPrice="itemGoods.maxSuggestedRetailPrice" :goodsLowerShelf="itemGoods.goodsLowerShelf" @closeSpeDia="closeSpeDia"></livedSelectionSpe>
</div>
</template>
<script type="text/ecmascript-6">
import livedSelectionSpe from "@/components/livedModel/livedSelectionSpe";
import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default {
props: {
showDia: {
......@@ -52,32 +54,40 @@ export default {
return {
goodsList: [
{
name: "产品名称产品名称产品名称产品名称产品名称",
img:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg",
price: 123
coverImage: "",
createDatetime: "2019-07-18 16:16:40",
createOperator: "44",
customMainPic: "",
expectedArriveDate: "",
firstAttrCode: "",
isDelete: "0",
maxDiscountPrice: "83.000000",
maxSalePrice: "83.000000",
maxSuggestedRetailPrice: "81.000000",
metaDescription: "",
metaKeywords: "",
metaTitle: "",
minDiscountPrice: "49.000000",
minSalePrice: "49.000000",
minSuggestedRetailPrice: "49.100000",
onsaleEndDatetime: null,
onsaleStartDatetime: null,
outerProductCode: "12355455",
productDetails: "",
productId: "266",
productImgUrl: "",
productName: "瑞士进口 雀巢(Nestle) 金牌 黑咖啡粉 至臻原味 速溶 咖啡豆微研磨",
productImgUrl:'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/de6ca6a1-f161-49da-8b76-3450144b4d47.jpg',
minSale: 0,
maxSale: 0,
goodsImg: 0,
minSuggestedRetailPrice: 0,
maxSuggestedRetailPrice: 0,
goodsLowerShelf: false
},
{
name: "产品名称产品名称产品名称产品名称产品名称",
img:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg",
price: 123
},
{
name: "产品名称产品名称产品名称产品名称产品名称",
img:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg",
price: 123
},
{
name: "产品名称产品名称产品名称产品名称产品名称",
img:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg",
price: 123
}
],
showSpe:false,
productInfoId:0,
itemGoods:{},//选中商品
showSpe: false
};
},
components: {
......@@ -85,18 +95,37 @@ export default {
},
computed: {},
created() {},
inLoad(){
this.goodsList.forEach((item,index)=>{
item.img=DFSImg(item.productImgUrl);
})
},
mounted() {},
methods: {
// 关闭
closeDia() {
this.$emit("changeStatus");
},
showSpeDia(val){
this.showSpe=true;
// 调用规格列表及价格信息传入组件先展示
showSpeDia(val) {
let productId=val.productId;
this.itemGoods.productId=productId;
live.getProductInfo(productId).then(res=>{
if(res.data.code==200){
this.itemGoods.maxSale = Number(res.data.data.maxSuggestedRetailPrice);
this.itemGoods.minSale = Number(res.data.data.minSuggestedRetailPrice);
this.itemGoods.maxDiscountPrice = Number(res.data.data.maxDiscountPrice);
this.itemGoods.minDiscountPrice = Number(res.data.data.minDiscountPrice);
this.itemGoods.productNature = res.data.data.productNature;
this.itemGoods.goodsLowerShelf = res.data.data.saleStatus != 1 ? true : false; //1 上架 0下架 true 下架
if(res.data.data.productPics && res.data.data.productPics.length > 0){
this.itemGoods.goodsImg = DFSImg(res.data.data.productPics[0].url);
}
this.showSpe = true;
}
})
},
closeSpeDia(){
this.showSpe=false;
closeSpeDia() {
this.showSpe = false;
}
}
};
......@@ -141,7 +170,7 @@ export default {
}
.price {
font-size: 18px;
.del{
.del {
font-size: 16px;
text-decoration: line-through;
span {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment