mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:53:27 +08:00
【新增】商品详情新增sku价格区间展示,如【¥100~395】,选中单个sku后自动变更其具体价格
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using CoreCms.Net.Model.FromBody;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace CoreCms.Net.Model.Entities
|
namespace CoreCms.Net.Model.Entities
|
||||||
@@ -108,6 +109,11 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public List<CoreCmsProducts> sku { get; set; } = new();
|
public List<CoreCmsProducts> sku { get; set; } = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 商品规格
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public Dictionary<string, Dictionary<string, DefaultSpesDesc>> specification { get; set; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否收藏
|
/// 是否收藏
|
||||||
@@ -176,5 +182,19 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
[SugarColumn(IsIgnore = true)] public DateTime groupEndTime { get; set; }
|
[SugarColumn(IsIgnore = true)] public DateTime groupEndTime { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsIgnore = true)] public int groupTimestamp { get; set; }
|
[SugarColumn(IsIgnore = true)] public int groupTimestamp { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sku最小价格
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public decimal minPrice { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sku最大价格
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public decimal maxPrice { get; set; } = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -538,6 +538,15 @@ namespace CoreCms.Net.Services
|
|||||||
model.freezeStock = getProductInfo.freezeStock;
|
model.freezeStock = getProductInfo.freezeStock;
|
||||||
model.weight = getProductInfo.weight;
|
model.weight = getProductInfo.weight;
|
||||||
|
|
||||||
|
var minProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id,
|
||||||
|
p => p.price, OrderByType.Asc);
|
||||||
|
|
||||||
|
var maxProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id,
|
||||||
|
p => p.price, OrderByType.Desc);
|
||||||
|
|
||||||
|
model.minPrice = minProduct.price;
|
||||||
|
model.maxPrice = maxProduct.price;
|
||||||
|
|
||||||
//获取品牌
|
//获取品牌
|
||||||
var brand = await _brandServices.QueryByIdAsync(model.brandId);
|
var brand = await _brandServices.QueryByIdAsync(model.brandId);
|
||||||
model.brand = brand;
|
model.brand = brand;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="coreshop-padding-bottom-10">
|
<view class="coreshop-padding-bottom-10">
|
||||||
<view>dsdsads</view>
|
|
||||||
<view class="select-item" v-for="(item, index) in specList" :key="index">
|
<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="coreshop-text-black coreshop-margin-10 coreshop-solid-bottom coreshop-padding-bottom-10">{{ index }}</view>
|
||||||
<view class="select-btn">
|
<view class="select-btn">
|
||||||
@@ -30,8 +29,6 @@
|
|||||||
// #ifdef H5 || APP-PLUS
|
// #ifdef H5 || APP-PLUS
|
||||||
this.specList = JSON.parse(this.spesData);
|
this.specList = JSON.parse(this.spesData);
|
||||||
// #endif
|
// #endif
|
||||||
console.log(this.spesData);
|
|
||||||
console.log(this.specList);
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
spesData: function (val) {
|
spesData: function (val) {
|
||||||
|
|||||||
@@ -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>
|
<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">
|
<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">{{ product.price || '0.00' }}</text>-->
|
||||||
<view class="coreshop-font-xs coreshop-cost-price-num price-4">
|
<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 v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && product.pointsDeduction > 0">
|
||||||
<view class="coreshop-padding-bottom-5 coreshop-font-14">
|
<view class="coreshop-padding-bottom-5 coreshop-font-14">
|
||||||
兑换价:{{pointDiscountedProportion * product.pointsDeduction }}{{ pointShowName}}+{{ product.price - product.pointsDeduction}} 元
|
兑换价:{{pointDiscountedProportion * product.pointsDeduction }}{{ pointShowName}}+{{ product.price - product.pointsDeduction}} 元
|
||||||
@@ -426,6 +427,7 @@
|
|||||||
goodsInfo: {}, // 商品详情
|
goodsInfo: {}, // 商品详情
|
||||||
cartNums: 0, // 购物车数量
|
cartNums: 0, // 购物车数量
|
||||||
product: {}, // 货品详情
|
product: {}, // 货品详情
|
||||||
|
priceSection:'',
|
||||||
shopRecommendData: [], // 本店推荐数据
|
shopRecommendData: [], // 本店推荐数据
|
||||||
otherRecommendData: [], // 其他数据
|
otherRecommendData: [], // 其他数据
|
||||||
goodsParams: [], // 商品参数信息
|
goodsParams: [], // 商品参数信息
|
||||||
@@ -607,6 +609,13 @@
|
|||||||
let products = res.data.product;
|
let products = res.data.product;
|
||||||
_this.goodsInfo = info;
|
_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) {
|
if (_this.goodsInfo.album) {
|
||||||
var albums = [];
|
var albums = [];
|
||||||
for (var i = 0; i < _this.goodsInfo.album.length; i++) {
|
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.buyNum = res.data.stock >= this.minBuyNum ? this.minBuyNum : res.data.stock;
|
||||||
this.product = this.spesClassHandle(res.data);
|
this.product = this.spesClassHandle(res.data);
|
||||||
|
this.priceSection = this.product.price;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
|
|||||||
Reference in New Issue
Block a user