【新增】商品详情新增sku价格区间展示,如【¥100~395】,选中单个sku后自动变更其具体价格

This commit is contained in:
大灰灰
2022-05-11 21:06:00 +08:00
parent fb60a05e02
commit 93efdd425b
4 changed files with 43 additions and 6 deletions

View File

@@ -1,6 +1,5 @@
<template>
<view class="coreshop-padding-bottom-10">
<view>dsdsads</view>
<view class="select-item" v-for="(item, index) in specList" :key="index">
<view class="coreshop-text-black coreshop-margin-10 coreshop-solid-bottom coreshop-padding-bottom-10">{{ index }}</view>
<view class="select-btn">
@@ -30,8 +29,6 @@
// #ifdef H5 || APP-PLUS
this.specList = JSON.parse(this.spesData);
// #endif
console.log(this.spesData);
console.log(this.specList);
},
watch: {
spesData: function (val) {

View File

@@ -13,9 +13,10 @@
<!--幻灯片-->
<u-swiper height="calc(750rpx * 6 / 6)" radius="0" :list="goodsInfo.album" :autoplay="autoplay" indicator indicatorMode="line" circular @click="clickImg"></u-swiper>
<!--限时秒杀-->
<view class="coreshop-limited-seckill-box coreshop-bg-red">
<text class="coreshop-text-price coreshop-font-20">{{ product.price || '0.00' }}</text>
<view class="coreshop-font-xs coreshop-cost-price-num price-4">
<view class="coreshop-limited-seckill-box coreshop-bg-red coreshop-flex coreshop-justify-start">
<!--<text class="coreshop-text-price coreshop-font-20">{{ product.price || '0.00' }}</text>-->
<text class="coreshop-text-price coreshop-font-20">{{ priceSection }}</text>
<view class="coreshop-font-xs price-4 coreshop-margin-left-20">
<view v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && product.pointsDeduction > 0">
<view class="coreshop-padding-bottom-5 coreshop-font-14">
兑换价{{pointDiscountedProportion * product.pointsDeduction }}{{ pointShowName}}+{{ product.price - product.pointsDeduction}}
@@ -426,6 +427,7 @@
goodsInfo: {}, // 商品详情
cartNums: 0, // 购物车数量
product: {}, // 货品详情
priceSection:'',
shopRecommendData: [], // 本店推荐数据
otherRecommendData: [], // 其他数据
goodsParams: [], // 商品参数信息
@@ -607,6 +609,13 @@
let products = res.data.product;
_this.goodsInfo = info;
//价格区间
if (res.data.minPrice != res.data.maxPrice) {
this.priceSection = res.data.minPrice + '~' + res.data.maxPrice;
} else {
this.priceSection = products.price;
}
if (_this.goodsInfo.album) {
var albums = [];
for (var i = 0; i < _this.goodsInfo.album.length; i++) {
@@ -745,6 +754,8 @@
// 切换规格判断可购买数量
this.buyNum = res.data.stock >= this.minBuyNum ? this.minBuyNum : res.data.stock;
this.product = this.spesClassHandle(res.data);
this.priceSection = this.product.price;
}
});
uni.showLoading({