Commit 6f68575b by 李嘉林

测试规格

parent 1333464e
...@@ -5,17 +5,21 @@ export default { ...@@ -5,17 +5,21 @@ export default {
getLiveInfo(options) { getLiveInfo(options) {
return requestPOST1(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveBroadcastInfoByIds?liveBroadcastId=${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) { 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) { 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) { 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) { addCart(options) {
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<div class="list"> <div class="list">
<div class="item" v-for="(item,index) in goodsList" :key="index"> <div class="item" v-for="(item,index) in goodsList" :key="index">
<div class="img"> <div class="img">
<img :src="item.img" alt /> <img :src="item.productImgUrl" alt />
</div> </div>
<div class="info"> <div class="info">
<p class="name line-clamp2">{{item.name}}</p> <p class="name line-clamp2">{{item.productName}}</p>
<div class="bottom"> <div class="bottom">
<div class="price"> <div class="price">
<p> <p>
<span></span> <span></span>
<span>{{item.price}}</span> <span>{{item.minPrice}}</span>
</p> </p>
<p class="del"> <p class="del">
<span></span> <span></span>
...@@ -34,12 +34,14 @@ ...@@ -34,12 +34,14 @@
</div> </div>
</van-popup> </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> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import livedSelectionSpe from "@/components/livedModel/livedSelectionSpe"; import livedSelectionSpe from "@/components/livedModel/livedSelectionSpe";
import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default { export default {
props: { props: {
showDia: { showDia: {
...@@ -52,32 +54,40 @@ export default { ...@@ -52,32 +54,40 @@ export default {
return { return {
goodsList: [ goodsList: [
{ {
name: "产品名称产品名称产品名称产品名称产品名称", coverImage: "",
img: createDatetime: "2019-07-18 16:16:40",
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg", createOperator: "44",
price: 123 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, itemGoods:{},//选中商品
productInfoId:0, showSpe: false
}; };
}, },
components: { components: {
...@@ -85,18 +95,37 @@ export default { ...@@ -85,18 +95,37 @@ export default {
}, },
computed: {}, computed: {},
created() {}, created() {},
inLoad(){
this.goodsList.forEach((item,index)=>{
item.img=DFSImg(item.productImgUrl);
})
},
mounted() {}, mounted() {},
methods: { methods: {
// 关闭 // 关闭
closeDia() { closeDia() {
this.$emit("changeStatus"); this.$emit("changeStatus");
}, },
showSpeDia(val){ showSpeDia(val) {
this.showSpe=true; 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(){ closeSpeDia() {
this.showSpe=false; this.showSpe = false;
} }
} }
}; };
...@@ -141,7 +170,7 @@ export default { ...@@ -141,7 +170,7 @@ export default {
} }
.price { .price {
font-size: 18px; font-size: 18px;
.del{ .del {
font-size: 16px; font-size: 16px;
text-decoration: line-through; text-decoration: line-through;
span { 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