Commit a3b3041f by 李嘉林

测试规格

parent 6f68575b
...@@ -54,36 +54,14 @@ export default { ...@@ -54,36 +54,14 @@ export default {
return { return {
goodsList: [ goodsList: [
{ {
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", productId: "266",
productImgUrl: "",
productName: "瑞士进口 雀巢(Nestle) 金牌 黑咖啡粉 至臻原味 速溶 咖啡豆微研磨", productName: "瑞士进口 雀巢(Nestle) 金牌 黑咖啡粉 至臻原味 速溶 咖啡豆微研磨",
productImgUrl:'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/de6ca6a1-f161-49da-8b76-3450144b4d47.jpg', productImgUrl:'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/de6ca6a1-f161-49da-8b76-3450144b4d47.jpg',
minSale: 0, },
maxSale: 0, {
goodsImg: 0, productId: "102",
minSuggestedRetailPrice: 0, productName: "ad新 外衣",
maxSuggestedRetailPrice: 0, productImgUrl:'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/58ab315c-61d5-4799-8d1b-f0d3b0e1f0ad.jpg',
goodsLowerShelf: false
}, },
], ],
itemGoods:{},//选中商品 itemGoods:{},//选中商品
...@@ -109,7 +87,11 @@ export default { ...@@ -109,7 +87,11 @@ export default {
showSpeDia(val) { showSpeDia(val) {
let productId=val.productId; let productId=val.productId;
this.itemGoods.productId=productId; this.itemGoods.productId=productId;
wx.showLoading({
title: '加载中...',
})
live.getProductInfo(productId).then(res=>{ live.getProductInfo(productId).then(res=>{
wx.hideLoading();
if(res.data.code==200){ if(res.data.code==200){
this.itemGoods.maxSale = Number(res.data.data.maxSuggestedRetailPrice); this.itemGoods.maxSale = Number(res.data.data.maxSuggestedRetailPrice);
this.itemGoods.minSale = Number(res.data.data.minSuggestedRetailPrice); this.itemGoods.minSale = Number(res.data.data.minSuggestedRetailPrice);
...@@ -117,8 +99,8 @@ export default { ...@@ -117,8 +99,8 @@ export default {
this.itemGoods.minDiscountPrice = Number(res.data.data.minDiscountPrice); this.itemGoods.minDiscountPrice = Number(res.data.data.minDiscountPrice);
this.itemGoods.productNature = res.data.data.productNature; this.itemGoods.productNature = res.data.data.productNature;
this.itemGoods.goodsLowerShelf = res.data.data.saleStatus != 1 ? true : false; //1 上架 0下架 true 下架 this.itemGoods.goodsLowerShelf = res.data.data.saleStatus != 1 ? true : false; //1 上架 0下架 true 下架
if(res.data.data.productPics && res.data.data.productPics.length > 0){ if(res.data.data.productPictures && res.data.data.productPictures.length > 0){
this.itemGoods.goodsImg = DFSImg(res.data.data.productPics[0].url); this.itemGoods.goodsImg = DFSImg(res.data.data.productPictures[0].url);
} }
this.showSpe = true; this.showSpe = true;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<van-popup <van-popup
:show="show" :show="show"
position="bottom" position="bottom"
custom-style="height: 60vh;padding:14px;border-top-left-radius:10px;border-top-right-radius:10px;" custom-style="border-top-left-radius:10px;border-top-right-radius:10px;"
:close-on-click-overlay="true" :close-on-click-overlay="true"
@close="closeDia" @close="closeDia"
> >
...@@ -23,19 +23,24 @@ ...@@ -23,19 +23,24 @@
<div class="price" v-if="product_goods_info.discountPrice"> <div class="price" v-if="product_goods_info.discountPrice">
<div>{{product_goods_info.discountPrice}}</div> <div>{{product_goods_info.discountPrice}}</div>
<div v-if="product_goods_info.singleItemActivityId"> <div v-if="product_goods_info.singleItemActivityId">
<del style="color:#666;">{{product_goods_info.originalPrice}}</del> <p class="delPrice">{{product_goods_info.originalPrice}}</p>
<!-- <del style="color:#666;">{{product_goods_info.originalPrice}}</!--> -->
</div> </div>
<div <div
v-else-if="product_goods_info.discountPrice-0<product_goods_info.goodsSuggestedRetailPrice-0" v-else-if="product_goods_info.discountPrice-0<product_goods_info.goodsSuggestedRetailPrice-0"
> >
<del style="color:#666;">{{product_goods_info.goodsSuggestedRetailPrice}}</del> <p class="delPrice">{{product_goods_info.goodsSuggestedRetailPrice}}</p>
<!-- <del style="color:#666;">{{product_goods_info.goodsSuggestedRetailPrice}}</del> -->
</div> </div>
</div> </div>
<template v-else-if="minSale<maxSale"> <template v-else-if="minSale<maxSale">
<div class="price">{{minSale}}-¥{{maxSale}}</div> <div class="price">{{minSale}}-¥{{maxSale}}</div>
<del <p class="delPrice" v-if="(minSale-0<minSuggestedRetailPrice-0)&&(maxSale-0<maxSuggestedRetailPrice-0)">
{{minSuggestedRetailPrice}}-¥{{maxSuggestedRetailPrice}}
</p>
<!-- <del
v-if="(minSale-0<minSuggestedRetailPrice-0)&&(maxSale-0<maxSuggestedRetailPrice-0)" v-if="(minSale-0<minSuggestedRetailPrice-0)&&(maxSale-0<maxSuggestedRetailPrice-0)"
>{{minSuggestedRetailPrice}}-¥{{maxSuggestedRetailPrice}}</del> >{{minSuggestedRetailPrice}}-¥{{maxSuggestedRetailPrice}}</del> -->
</template> </template>
<template v-else> <template v-else>
<div class="price">{{minSale}}</div> <div class="price">{{minSale}}</div>
...@@ -69,13 +74,15 @@ ...@@ -69,13 +74,15 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="buyQty flex flex-btw"> <div class="buyQty flex">
<div class="ti">购买数量</div> <div class="ti">购买数量{{buyQty}}</div>
<van-stepper <van-stepper
:value="buyQty" :value="buyQty"
:min="product_goods_info.productMinCount=='0'?1:product_goods_info.productMinCount" :min="product_goods_info.productMinCount=='0'?1:Number(product_goods_info.productMinCount)"
:max="MaxQtyNum" :max="MaxQtyNum"
@minus="numMinus" :disable-input="true"
@change="changeQty"
input-class="ipt"
/> />
</div> </div>
</div> </div>
...@@ -151,7 +158,8 @@ export default { ...@@ -151,7 +158,8 @@ export default {
isGetMixId: false, // 是否取价格 isGetMixId: false, // 是否取价格
paramData: "", //埋点数据 paramData: "", //埋点数据
maxSelectedPrice: 0, // 限时特惠选中规格后划线价 maxSelectedPrice: 0, // 限时特惠选中规格后划线价
allSellOut: false //全部售罄标识 allSellOut: false, //全部售罄标识
isDefault:false,
}; };
}, },
components: {}, components: {},
...@@ -268,11 +276,17 @@ export default { ...@@ -268,11 +276,17 @@ export default {
} }
}); });
}, },
changeQty(event){
console.log(event.mp.detail,'------------------------------279')
this.buyQty=event.mp.detail;
},
// 默认选中一组规格 // 默认选中一组规格
// 两个参数goodsSpc,allSpc sku及所有规格 // 两个参数goodsSpc,allSpc sku及所有规格
defaultSelection(goodsSpc,allSpc){ defaultSelection(goodsSpc,allSpc){
console.log(goodsSpc,'-------371') // 是默认调取getMixid接口状态
console.log(allSpc,'-------372') this.isDefault=true;
// console.log(goodsSpc,'-------371')
// console.log(allSpc,'-------372')
for(let i=0;i<allSpc.length;i++){ for(let i=0;i<allSpc.length;i++){
for(let j=0;j<allSpc[i].specificationValue.length;j++){ for(let j=0;j<allSpc[i].specificationValue.length;j++){
for(let k=0;k<goodsSpc.length;k++){ for(let k=0;k<goodsSpc.length;k++){
...@@ -323,11 +337,18 @@ export default { ...@@ -323,11 +337,18 @@ export default {
}, },
// 取价格 // 取价格
getMixId(val) { getMixId(val) {
if(!this.isDefault){
wx.showLoading({
title: '加载中...',
})
}
this.isDefault=false;
this.isGetMixId = true; this.isGetMixId = true;
let productGoodsMixId=this.product_goods_info.productGoodsMixId let productGoodsMixId=this.product_goods_info.productGoodsMixId
live live
.getProductGoodsByMixId(productGoodsMixId) .getProductGoodsByMixId(productGoodsMixId)
.then(res => { .then(res => {
wx.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
if (this.nonstandardGoods == false) { if (this.nonstandardGoods == false) {
res.data.data.specifications.forEach((item, index) => { res.data.data.specifications.forEach((item, index) => {
...@@ -362,8 +383,8 @@ export default { ...@@ -362,8 +383,8 @@ export default {
this.product_goods_info.singleItemActivityId = this.product_goods_info.singleItemActivityId =
res.data.data.singleItemActivityId||''; res.data.data.singleItemActivityId||'';
this.buyQty = // this.buyQty =
res.data.data.productMinCount == "0" ? 1 : Number(res.data.data.productMinCount); // res.data.data.productMinCount == "0" ? 1 : Number(res.data.data.productMinCount);
if ( if (
this.product_goods_info.oversoldFlag != 1 && this.product_goods_info.oversoldFlag != 1 &&
this.product_goods_info.sellMaxQty - 0 <= 0 this.product_goods_info.sellMaxQty - 0 <= 0
...@@ -543,6 +564,10 @@ export default { ...@@ -543,6 +564,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.delPrice{
text-decoration: line-through;
color: #666;
}
.flex{ .flex{
display: flex; display: flex;
} }
...@@ -582,7 +607,7 @@ export default { ...@@ -582,7 +607,7 @@ export default {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 8px 8px 0px 0px; border-radius: 8px 8px 0px 0px;
.sku { .sku {
padding: 8px 9px; padding: 8px 10px;
position: relative; position: relative;
.close { .close {
position: absolute; position: absolute;
...@@ -636,10 +661,10 @@ export default { ...@@ -636,10 +661,10 @@ export default {
} }
.commoditySty { .commoditySty {
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
max-height: 200px; // max-height: 240px;
overflow-y: scroll; // overflow-y: scroll;
ul { ul {
height: 95%; height: 100%;
li { li {
height: 100%; height: 100%;
.property { .property {
...@@ -648,15 +673,16 @@ export default { ...@@ -648,15 +673,16 @@ export default {
} }
.specification { .specification {
div.specification-item { div.specification-item {
font-size: 15px;
border: 1px solid #606060; border: 1px solid #606060;
border-radius: 0.08rem; border-radius: 4px;
color: #606060; color: #606060;
text-align: center; text-align: center;
padding: 0.04rem 0.16rem; padding: 2px 4px;
float: left; float: left;
margin-right: 0.16rem; margin-right: 6px;
min-width: 0.96rem; min-width: 30px;
margin-bottom: 0.16rem; margin-bottom: 6px;
box-sizing: content-box; box-sizing: content-box;
div { div {
text-align: left; text-align: left;
...@@ -683,12 +709,21 @@ export default { ...@@ -683,12 +709,21 @@ export default {
margin-top: 10px; margin-top: 10px;
width: 100%; width: 100%;
height: 60px; height: 60px;
justify-content: space-between;
.ti{
font-size: 14px;
}
/deep/.ipt{
color: #000!important;
}
} }
.bottom { .bottom {
margin-top: 60px; margin-top: 60px;
.van-button { .van-button {
width: 188px; width: 50vw;
height: 49px; height: 50px;
text-align: center;
line-height: 50px;
} }
.toPay { .toPay {
background: #ff4240; background: #ff4240;
......
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