mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 16:17:21 +08:00
# 2022-02-24
### 1.3.7 开源社区版: 无 ### 0.2.4 会员专业版: 【新增】数据库sku表【CoreCmsProducts】增加"积分可抵扣金额"【pointsDeduction】字段 【新增】商品sku新增最高抵扣金额功能,可通过积分进行价格抵扣,实现单品使用【积分+价格】的购买模式。与订单积分折扣并存。 【新增】积分新增积分模式功能,分为全局计算和单品计算,【全局计算】是指直接对订单按照使用比例进行计算,【单品计算】是指根据单个商品下sku独立设置的最高可抵扣金额进行计算。 【新增】积分新增显示积分组合兑换价功能,勾选显示,将在商品详情,购物车等界面显示积分加价格的效果。 【新增】积分新增显示名称功能,前端可改名积分显示名称为自定义,如:金豆,衡豆等。 【新增】商品列表页面、购物车界面、下单界面、商品详情界面新增积分新增是否显示组合价功能,如果勾选,将显示【1000积分+25元换购】的内容。 【优化】当添加视频后,默认采用商品封面图作为视频底图,防止视频大小差异出现黑边或预加载中黑屏的问题。 【优化】商品列表展示列表去除padding留白效果。 【优化】优化form表单redio和checkBox选项分行显示的问题。 【修复】修复拼团分享页面倒计时识别失败的问题,修复拼团分享页面分享按钮点击失败的问题。#I4QWDH #I4QWFC
This commit is contained in:
@@ -241,6 +241,21 @@ namespace CoreCms.Net.Configuration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string PointSwitch = "pointSwitch";
|
public const string PointSwitch = "pointSwitch";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 积分模式
|
||||||
|
/// </summary>
|
||||||
|
public const string PointExchangeModel = "pointExchangeModel";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 积分昵称
|
||||||
|
/// </summary>
|
||||||
|
public const string PointShowName = "pointShowName";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示积分组合兑换价
|
||||||
|
/// </summary>
|
||||||
|
public const string PointShowExchangePrice = "pointShowExchangePrice";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单积分折现比例
|
/// 订单积分折现比例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ namespace CoreCms.Net.Configuration
|
|||||||
di.Add(SystemSettingConstVars.ContinuitySignAdditional, new DictionaryKeyValues() { sKey = "连续签到追加", sValue = "1" });
|
di.Add(SystemSettingConstVars.ContinuitySignAdditional, new DictionaryKeyValues() { sKey = "连续签到追加", sValue = "1" });
|
||||||
di.Add(SystemSettingConstVars.SignMostPoint, new DictionaryKeyValues() { sKey = "单日最大奖励", sValue = "10" });
|
di.Add(SystemSettingConstVars.SignMostPoint, new DictionaryKeyValues() { sKey = "单日最大奖励", sValue = "10" });
|
||||||
di.Add(SystemSettingConstVars.PointSwitch, new DictionaryKeyValues() { sKey = "开启积分功能", sValue = "1" });
|
di.Add(SystemSettingConstVars.PointSwitch, new DictionaryKeyValues() { sKey = "开启积分功能", sValue = "1" });
|
||||||
|
di.Add(SystemSettingConstVars.PointExchangeModel, new DictionaryKeyValues() { sKey = "积分模式", sValue = "1" });
|
||||||
|
di.Add(SystemSettingConstVars.PointShowName, new DictionaryKeyValues() { sKey = "积分昵称", sValue = "积分" });
|
||||||
|
di.Add(SystemSettingConstVars.PointShowExchangePrice, new DictionaryKeyValues() { sKey = "显示积分组合兑换价", sValue = "1" });
|
||||||
di.Add(SystemSettingConstVars.PointDiscountedProportion, new DictionaryKeyValues() { sKey = "订单积分折现比例", sValue = "100" });
|
di.Add(SystemSettingConstVars.PointDiscountedProportion, new DictionaryKeyValues() { sKey = "订单积分折现比例", sValue = "100" });
|
||||||
di.Add(SystemSettingConstVars.OrdersPointProportion, new DictionaryKeyValues() { sKey = "订单积分使用比例", sValue = "10" });
|
di.Add(SystemSettingConstVars.OrdersPointProportion, new DictionaryKeyValues() { sKey = "订单积分使用比例", sValue = "10" });
|
||||||
di.Add(SystemSettingConstVars.OrdersRewardProportion, new DictionaryKeyValues() { sKey = "订单积分奖励比例", sValue = "1" });
|
di.Add(SystemSettingConstVars.OrdersRewardProportion, new DictionaryKeyValues() { sKey = "订单积分奖励比例", sValue = "1" });
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ using CoreCms.Net.Configuration;
|
|||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.FromBody;
|
using CoreCms.Net.Model.FromBody;
|
||||||
using CoreCms.Net.Model.ViewModels.Basics;
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
|
||||||
using CoreCms.Net.Model.ViewModels.DTO;
|
using CoreCms.Net.Model.ViewModels.DTO;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace CoreCms.Net.IServices
|
namespace CoreCms.Net.IServices
|
||||||
@@ -48,8 +48,10 @@ namespace CoreCms.Net.IServices
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">用户序列</param>
|
/// <param name="userId">用户序列</param>
|
||||||
/// <param name="orderMoney">订单金额</param>
|
/// <param name="orderMoney">订单金额</param>
|
||||||
|
/// <param name="ids">货品序列</param>
|
||||||
|
/// <param name="cartType">购物车类型</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<GetUserPointResult> GetUserPoint(int userId, decimal orderMoney);
|
Task<GetUserPointResult> GetUserPoint(int userId, decimal orderMoney, int[] ids, int cartType);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -102,7 +104,7 @@ namespace CoreCms.Net.IServices
|
|||||||
/// <param name="platform"></param>
|
/// <param name="platform"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
Task<WebApiCallBack> SmsLogin(FMWxAccountCreate entity,
|
||||||
int loginType = (int) GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1);
|
int loginType = (int)GlobalEnumVars.LoginType.WeChatPhoneNumber, int platform = 1);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public decimal weight { get; set; } = 0;
|
public decimal weight { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 积分抵扣金额
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "积分抵扣金额")]
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public decimal pointsDeduction { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图集
|
/// 图集
|
||||||
@@ -95,6 +101,7 @@ 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>
|
||||||
/// 是否收藏
|
/// 是否收藏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
* Web: https://www.corecms.net
|
* Web: https://www.corecms.net
|
||||||
* Author: 大灰灰
|
* Author: 大灰灰
|
||||||
* Email: jianweie@163.com
|
* Email: jianweie@163.com
|
||||||
* CreateTime: 2021-06-08 22:14:58
|
* CreateTime: 2022/2/22 0:43:08
|
||||||
* Description: 暂无
|
* Description: 暂无
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace CoreCms.Net.Model.Entities
|
namespace CoreCms.Net.Model.Entities
|
||||||
@@ -15,11 +17,10 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品表
|
/// 货品表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("CoreCmsProducts",TableDescription = "货品表")]
|
|
||||||
public partial class CoreCmsProducts
|
public partial class CoreCmsProducts
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品表
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CoreCmsProducts()
|
public CoreCmsProducts()
|
||||||
{
|
{
|
||||||
@@ -29,104 +30,195 @@ namespace CoreCms.Net.Model.Entities
|
|||||||
/// 货品序列
|
/// 货品序列
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "货品序列")]
|
[Display(Name = "货品序列")]
|
||||||
[SugarColumn(ColumnDescription = "货品序列", IsPrimaryKey = true, IsIdentity = true)]
|
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Int32 id { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Int32 id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 商品序列
|
/// 商品序列
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "商品序列")]
|
[Display(Name = "商品序列")]
|
||||||
[SugarColumn(ColumnDescription = "商品序列")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Int32 goodsId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Int32 goodsId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 商品条码
|
/// 商品条码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "商品条码")]
|
[Display(Name = "商品条码")]
|
||||||
[SugarColumn(ColumnDescription = "商品条码", IsNullable = true)]
|
|
||||||
[StringLength(128, ErrorMessage = "【{0}】不能超过{1}字符长度")]
|
|
||||||
public System.String barcode { get; set; }
|
[StringLength(maximumLength:128,ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
|
||||||
|
|
||||||
|
public System.String barcode { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品编码
|
/// 货品编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "货品编码")]
|
[Display(Name = "货品编码")]
|
||||||
[SugarColumn(ColumnDescription = "货品编码", IsNullable = true)]
|
|
||||||
[StringLength(30, ErrorMessage = "【{0}】不能超过{1}字符长度")]
|
|
||||||
public System.String sn { get; set; }
|
[StringLength(maximumLength:30,ErrorMessage = "{0}不能超过{1}字")]
|
||||||
|
|
||||||
|
|
||||||
|
public System.String sn { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品价格
|
/// 货品价格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "货品价格")]
|
[Display(Name = "货品价格")]
|
||||||
[SugarColumn(ColumnDescription = "货品价格")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Decimal price { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Decimal price { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品成本价
|
/// 货品成本价
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "货品成本价")]
|
[Display(Name = "货品成本价")]
|
||||||
[SugarColumn(ColumnDescription = "货品成本价")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Decimal costprice { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Decimal costprice { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货品市场价
|
/// 货品市场价
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "货品市场价")]
|
[Display(Name = "货品市场价")]
|
||||||
[SugarColumn(ColumnDescription = "货品市场价")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Decimal mktprice { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Decimal mktprice { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否上架
|
/// 是否上架
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "是否上架")]
|
[Display(Name = "是否上架")]
|
||||||
[SugarColumn(ColumnDescription = "是否上架")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Boolean marketable { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Boolean marketable { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 积分可抵扣金额
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "积分可抵扣金额")]
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Decimal pointsDeduction { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 重量(千克)
|
/// 重量(千克)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "重量(千克)")]
|
[Display(Name = "重量(千克)")]
|
||||||
[SugarColumn(ColumnDescription = "重量(千克)")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Decimal weight { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Decimal weight { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 库存
|
/// 库存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "库存")]
|
[Display(Name = "库存")]
|
||||||
[SugarColumn(ColumnDescription = "库存")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Int32 stock { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Int32 stock { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 冻结库存
|
/// 冻结库存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "冻结库存")]
|
[Display(Name = "冻结库存")]
|
||||||
[SugarColumn(ColumnDescription = "冻结库存")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Int32 freezeStock { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Int32 freezeStock { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 规格值
|
/// 规格值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "规格值")]
|
[Display(Name = "规格值")]
|
||||||
[SugarColumn(ColumnDescription = "规格值", IsNullable = true)]
|
|
||||||
public System.String spesDesc { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.String spesDesc { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否默认货品
|
/// 是否默认货品
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "是否默认货品")]
|
[Display(Name = "是否默认货品")]
|
||||||
[SugarColumn(ColumnDescription = "是否默认货品")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Boolean isDefalut { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Boolean isDefalut { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 规格图片
|
/// 规格图片
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "规格图片")]
|
[Display(Name = "规格图片")]
|
||||||
[SugarColumn(ColumnDescription = "规格图片", IsNullable = true)]
|
|
||||||
public System.String images { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.String images { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否删除
|
/// 是否删除
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "是否删除")]
|
[Display(Name = "是否删除")]
|
||||||
[SugarColumn(ColumnDescription = "是否删除")]
|
|
||||||
[Required(ErrorMessage = "请输入{0}")]
|
[Required(ErrorMessage = "请输入{0}")]
|
||||||
public System.Boolean isDel { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
public System.Boolean isDel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,6 +36,16 @@ namespace CoreCms.Net.Model.ViewModels.DTO
|
|||||||
/// 订单金额
|
/// 订单金额
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal orderMoney { get; set; }
|
public decimal orderMoney { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 购物车货品序列号
|
||||||
|
/// </summary>
|
||||||
|
public string ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 购物车类型
|
||||||
|
/// </summary>
|
||||||
|
public int cartType { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ namespace CoreCms.Net.Repository
|
|||||||
obj.weight = p.weight;
|
obj.weight = p.weight;
|
||||||
obj.freezeStock = 0;
|
obj.freezeStock = 0;
|
||||||
obj.spesDesc = p.spesDesc;
|
obj.spesDesc = p.spesDesc;
|
||||||
|
obj.pointsDeduction = p.pointsDeduction;
|
||||||
obj.isDefalut = p.isDefalut;
|
obj.isDefalut = p.isDefalut;
|
||||||
obj.isDel = false;
|
obj.isDel = false;
|
||||||
products.Add(obj);
|
products.Add(obj);
|
||||||
@@ -233,6 +234,7 @@ namespace CoreCms.Net.Repository
|
|||||||
obj.weight = oldObj.weight;
|
obj.weight = oldObj.weight;
|
||||||
obj.freezeStock = 0;
|
obj.freezeStock = 0;
|
||||||
obj.spesDesc = oldObj.spesDesc;
|
obj.spesDesc = oldObj.spesDesc;
|
||||||
|
obj.pointsDeduction = oldObj.pointsDeduction;
|
||||||
obj.isDefalut = true;
|
obj.isDefalut = true;
|
||||||
obj.isDel = false;
|
obj.isDel = false;
|
||||||
if (string.IsNullOrEmpty(obj.images) || !obj.images.Contains(".jpg"))
|
if (string.IsNullOrEmpty(obj.images) || !obj.images.Contains(".jpg"))
|
||||||
@@ -514,11 +516,13 @@ namespace CoreCms.Net.Repository
|
|||||||
p.mktprice = child.mktprice;
|
p.mktprice = child.mktprice;
|
||||||
p.price = child.price;
|
p.price = child.price;
|
||||||
p.spesDesc = child.spesDesc;
|
p.spesDesc = child.spesDesc;
|
||||||
|
p.pointsDeduction = child.pointsDeduction;
|
||||||
p.stock = child.stock;
|
p.stock = child.stock;
|
||||||
p.weight = child.weight;
|
p.weight = child.weight;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
oldDistributions.ForEach(o =>
|
oldDistributions.ForEach(o =>
|
||||||
{
|
{
|
||||||
var oldPost = oldPostProducts.Find(p => p.id == o.productsId);
|
var oldPost = oldPostProducts.Find(p => p.id == o.productsId);
|
||||||
@@ -578,7 +582,6 @@ namespace CoreCms.Net.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -607,6 +610,7 @@ namespace CoreCms.Net.Repository
|
|||||||
obj.weight = p.weight;
|
obj.weight = p.weight;
|
||||||
obj.freezeStock = 0;
|
obj.freezeStock = 0;
|
||||||
obj.spesDesc = p.spesDesc;
|
obj.spesDesc = p.spesDesc;
|
||||||
|
obj.pointsDeduction = p.pointsDeduction;
|
||||||
obj.isDefalut = p.isDefalut;
|
obj.isDefalut = p.isDefalut;
|
||||||
obj.images = p.images;
|
obj.images = p.images;
|
||||||
if (string.IsNullOrEmpty(p.images) || !p.images.Contains(".jpg"))
|
if (string.IsNullOrEmpty(p.images) || !p.images.Contains(".jpg"))
|
||||||
@@ -661,6 +665,7 @@ namespace CoreCms.Net.Repository
|
|||||||
obj.marketable = true;
|
obj.marketable = true;
|
||||||
obj.stock = newObj.stock;
|
obj.stock = newObj.stock;
|
||||||
obj.weight = newObj.weight;
|
obj.weight = newObj.weight;
|
||||||
|
obj.pointsDeduction = newObj.pointsDeduction;
|
||||||
obj.images = newObj.images;
|
obj.images = newObj.images;
|
||||||
obj.isDefalut = true;
|
obj.isDefalut = true;
|
||||||
obj.isDel = false;
|
obj.isDel = false;
|
||||||
@@ -690,6 +695,7 @@ namespace CoreCms.Net.Repository
|
|||||||
obj.marketable = true;
|
obj.marketable = true;
|
||||||
obj.stock = newObj.stock;
|
obj.stock = newObj.stock;
|
||||||
obj.weight = newObj.weight;
|
obj.weight = newObj.weight;
|
||||||
|
obj.pointsDeduction = newObj.pointsDeduction;
|
||||||
obj.freezeStock = 0;
|
obj.freezeStock = 0;
|
||||||
obj.spesDesc = "";
|
obj.spesDesc = "";
|
||||||
obj.isDefalut = true;
|
obj.isDefalut = true;
|
||||||
@@ -911,6 +917,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -973,6 +980,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -1045,6 +1053,7 @@ namespace CoreCms.Net.Repository
|
|||||||
price = pd.price,
|
price = pd.price,
|
||||||
costprice = pd.costprice,
|
costprice = pd.costprice,
|
||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
@@ -1095,6 +1104,7 @@ namespace CoreCms.Net.Repository
|
|||||||
price = pd.price,
|
price = pd.price,
|
||||||
costprice = pd.costprice,
|
costprice = pd.costprice,
|
||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
@@ -1169,6 +1179,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.With(SqlWith.NoLock)
|
.With(SqlWith.NoLock)
|
||||||
@@ -1221,6 +1232,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -1246,12 +1258,6 @@ namespace CoreCms.Net.Repository
|
|||||||
public new async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, int take,
|
public new async Task<List<CoreCmsGoods>> QueryListByClauseAsync(Expression<Func<CoreCmsGoods, bool>> predicate, int take,
|
||||||
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
||||||
{
|
{
|
||||||
//return blUseNoLock
|
|
||||||
// ? await DbBaseClient.Queryable<T>().OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
|
||||||
// .WhereIF(predicate != null, predicate).Take(take).With(SqlWith.NoLock).ToListAsync()
|
|
||||||
// : await DbBaseClient.Queryable<T>().OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
|
||||||
// .WhereIF(predicate != null, predicate).Take(take).ToListAsync();
|
|
||||||
|
|
||||||
List<CoreCmsGoods> page;
|
List<CoreCmsGoods> page;
|
||||||
if (blUseNoLock)
|
if (blUseNoLock)
|
||||||
{
|
{
|
||||||
@@ -1297,6 +1303,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.With(SqlWith.NoLock)
|
.With(SqlWith.NoLock)
|
||||||
@@ -1349,6 +1356,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -1417,6 +1425,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.With(SqlWith.NoLock)
|
.With(SqlWith.NoLock)
|
||||||
@@ -1469,6 +1478,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -1481,9 +1491,9 @@ namespace CoreCms.Net.Repository
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 根据条件查询分页数据
|
#region 重写根据条件及自定义排序查询分页数据
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条件查询分页数据
|
/// 重写根据条件及自定义排序查询分页数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="predicate"></param>
|
/// <param name="predicate"></param>
|
||||||
/// <param name="orderBy"></param>
|
/// <param name="orderBy"></param>
|
||||||
@@ -1540,6 +1550,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.With(SqlWith.NoLock)
|
.With(SqlWith.NoLock)
|
||||||
@@ -1592,6 +1603,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
@@ -1608,7 +1620,6 @@ namespace CoreCms.Net.Repository
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 根据条件查询代理池商品分页数据
|
#region 根据条件查询代理池商品分页数据
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据条件查询代理池商品分页数据
|
/// 根据条件查询代理池商品分页数据
|
||||||
@@ -1668,6 +1679,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.With(SqlWith.NoLock)
|
.With(SqlWith.NoLock)
|
||||||
@@ -1720,6 +1732,7 @@ namespace CoreCms.Net.Repository
|
|||||||
mktprice = pd.mktprice,
|
mktprice = pd.mktprice,
|
||||||
stock = pd.stock,
|
stock = pd.stock,
|
||||||
freezeStock = pd.freezeStock,
|
freezeStock = pd.freezeStock,
|
||||||
|
pointsDeduction = pd.pointsDeduction,
|
||||||
weight = pd.weight
|
weight = pd.weight
|
||||||
})
|
})
|
||||||
.MergeTable()
|
.MergeTable()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ using CoreCms.Net.Model.Entities;
|
|||||||
using CoreCms.Net.Model.ViewModels.Basics;
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace CoreCms.Net.Repository
|
namespace CoreCms.Net.Repository
|
||||||
@@ -111,25 +112,26 @@ namespace CoreCms.Net.Repository
|
|||||||
List<CoreCmsProducts> page;
|
List<CoreCmsProducts> page;
|
||||||
if (blUseNoLock)
|
if (blUseNoLock)
|
||||||
{
|
{
|
||||||
page = await DbClient.Queryable<CoreCmsProducts, CoreCmsGoods>((p, good) => new JoinQueryInfos(
|
page = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, product) => new JoinQueryInfos(
|
||||||
JoinType.Left, p.goodsId == good.id))
|
JoinType.Inner, good.id == product.goodsId))
|
||||||
.Select((p, good) => new CoreCmsProducts
|
.Select((good, product) => new CoreCmsProducts
|
||||||
{
|
{
|
||||||
id = p.id,
|
id = product.id,
|
||||||
goodsId = p.goodsId,
|
goodsId = product.goodsId,
|
||||||
barcode = p.barcode,
|
barcode = product.barcode,
|
||||||
sn = p.sn,
|
sn = product.sn,
|
||||||
price = p.price,
|
price = product.price,
|
||||||
costprice = p.costprice,
|
costprice = product.costprice,
|
||||||
mktprice = p.mktprice,
|
mktprice = product.mktprice,
|
||||||
marketable = p.marketable,
|
marketable = product.marketable,
|
||||||
weight = p.weight,
|
weight = product.weight,
|
||||||
stock = p.stock,
|
stock = product.stock,
|
||||||
freezeStock = p.freezeStock,
|
freezeStock = product.freezeStock,
|
||||||
spesDesc = p.spesDesc,
|
pointsDeduction = product.pointsDeduction,
|
||||||
isDefalut = p.isDefalut,
|
spesDesc = product.spesDesc,
|
||||||
images = p.images,
|
isDefalut = product.isDefalut,
|
||||||
isDel = p.isDel,
|
images = product.images,
|
||||||
|
isDel = good.isDel,
|
||||||
name = good.name,
|
name = good.name,
|
||||||
bn = good.bn,
|
bn = good.bn,
|
||||||
isMarketable = good.isMarketable,
|
isMarketable = good.isMarketable,
|
||||||
@@ -142,25 +144,26 @@ namespace CoreCms.Net.Repository
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
page = await DbClient.Queryable<CoreCmsProducts, CoreCmsGoods>((p, good) => new JoinQueryInfos(
|
page = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, product) => new JoinQueryInfos(
|
||||||
JoinType.Left, p.goodsId == good.id))
|
JoinType.Inner, good.id == product.goodsId))
|
||||||
.Select((p, good) => new CoreCmsProducts
|
.Select((good, product) => new CoreCmsProducts
|
||||||
{
|
{
|
||||||
id = p.id,
|
id = product.id,
|
||||||
goodsId = p.goodsId,
|
goodsId = product.goodsId,
|
||||||
barcode = p.barcode,
|
barcode = product.barcode,
|
||||||
sn = p.sn,
|
sn = product.sn,
|
||||||
price = p.price,
|
price = product.price,
|
||||||
costprice = p.costprice,
|
costprice = product.costprice,
|
||||||
mktprice = p.mktprice,
|
mktprice = product.mktprice,
|
||||||
marketable = p.marketable,
|
marketable = product.marketable,
|
||||||
weight = p.weight,
|
weight = product.weight,
|
||||||
stock = p.stock,
|
stock = product.stock,
|
||||||
freezeStock = p.freezeStock,
|
freezeStock = product.freezeStock,
|
||||||
spesDesc = p.spesDesc,
|
pointsDeduction = product.pointsDeduction,
|
||||||
isDefalut = p.isDefalut,
|
spesDesc = product.spesDesc,
|
||||||
images = p.images,
|
isDefalut = product.isDefalut,
|
||||||
isDel = p.isDel,
|
images = product.images,
|
||||||
|
isDel = good.isDel,
|
||||||
name = good.name,
|
name = good.name,
|
||||||
bn = good.bn,
|
bn = good.bn,
|
||||||
isMarketable = good.isMarketable,
|
isMarketable = good.isMarketable,
|
||||||
@@ -204,6 +207,7 @@ namespace CoreCms.Net.Repository
|
|||||||
weight = p.weight,
|
weight = p.weight,
|
||||||
stock = p.stock,
|
stock = p.stock,
|
||||||
freezeStock = p.freezeStock,
|
freezeStock = p.freezeStock,
|
||||||
|
pointsDeduction = p.pointsDeduction,
|
||||||
spesDesc = p.spesDesc,
|
spesDesc = p.spesDesc,
|
||||||
isDefalut = p.isDefalut,
|
isDefalut = p.isDefalut,
|
||||||
images = p.images,
|
images = p.images,
|
||||||
@@ -309,6 +313,7 @@ namespace CoreCms.Net.Repository
|
|||||||
weight = p.weight,
|
weight = p.weight,
|
||||||
stock = p.stock,
|
stock = p.stock,
|
||||||
freezeStock = p.freezeStock,
|
freezeStock = p.freezeStock,
|
||||||
|
pointsDeduction = p.pointsDeduction,
|
||||||
spesDesc = p.spesDesc,
|
spesDesc = p.spesDesc,
|
||||||
isDefalut = p.isDefalut,
|
isDefalut = p.isDefalut,
|
||||||
images = p.images,
|
images = p.images,
|
||||||
|
|||||||
@@ -780,8 +780,8 @@ namespace CoreCms.Net.Services
|
|||||||
var jm = new WebApiCallBack() { status = true };
|
var jm = new WebApiCallBack() { status = true };
|
||||||
if (point != 0)
|
if (point != 0)
|
||||||
{
|
{
|
||||||
var getUserPointDto = await _userServices.GetUserPoint(userId, 0);
|
var user = await _userServices.QueryByClauseAsync(p => p.id == userId);
|
||||||
if (getUserPointDto.point < point)
|
if (user.point < point)
|
||||||
{
|
{
|
||||||
jm.status = false;
|
jm.status = false;
|
||||||
jm.msg = "积分不足,无法使用积分";
|
jm.msg = "积分不足,无法使用积分";
|
||||||
@@ -789,23 +789,45 @@ namespace CoreCms.Net.Services
|
|||||||
}
|
}
|
||||||
//判断积分值多少钱
|
//判断积分值多少钱
|
||||||
//计算可用积分
|
//计算可用积分
|
||||||
|
|
||||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||||
|
|
||||||
var ordersPointProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrdersPointProportion).ObjectToInt(10);//订单积分使用比例
|
var pointExchangeModel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointExchangeModel).ObjectToInt(); //判断是全局模式还是单品模式
|
||||||
var maxPointDeductedMoney = Math.Round(cartDto.amount * ordersPointProportion / 100, 2); //最大积分抵扣的钱
|
if (pointExchangeModel == 1)
|
||||||
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100); //积分兑换比例
|
|
||||||
var pointDeductedMoney = point / pointDiscountedProportion; //积分可以抵扣的钱
|
|
||||||
|
|
||||||
if (maxPointDeductedMoney < pointDeductedMoney)
|
|
||||||
{
|
{
|
||||||
jm.status = false;
|
var ordersPointProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrdersPointProportion).ObjectToInt(10);//订单积分使用比例
|
||||||
jm.msg = "积分超过订单可使用的积分数量";
|
var maxPointDeductedMoney = Math.Round(cartDto.amount * ordersPointProportion / 100, 2); //最大积分抵扣的钱
|
||||||
return jm;
|
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100); //积分兑换比例
|
||||||
|
var pointDeductedMoney = point / pointDiscountedProportion; //积分可以抵扣的钱
|
||||||
|
|
||||||
|
if (maxPointDeductedMoney < pointDeductedMoney)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "积分超过订单可使用的积分数量";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
cartDto.point = point;
|
||||||
|
cartDto.pointExchangeMoney = pointDeductedMoney;
|
||||||
|
cartDto.amount -= pointDeductedMoney;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//可抵扣金额
|
||||||
|
decimal money = 0;
|
||||||
|
|
||||||
|
foreach (var item in cartDto.list)
|
||||||
|
{
|
||||||
|
money += item.nums * item.products.pointsDeduction;
|
||||||
|
}
|
||||||
|
//计算抵扣这么多金额需要多少积分。
|
||||||
|
//订单积分折现比例(多少积分可以折现1块钱)
|
||||||
|
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100);
|
||||||
|
//计算需要多少积分
|
||||||
|
var needsPoint = money * pointDiscountedProportion;
|
||||||
|
|
||||||
|
cartDto.point = point;
|
||||||
|
cartDto.pointExchangeMoney = Convert.ToInt32(money);
|
||||||
|
cartDto.amount -= Convert.ToInt32(money);
|
||||||
}
|
}
|
||||||
cartDto.point = point;
|
|
||||||
cartDto.pointExchangeMoney = pointDeductedMoney;
|
|
||||||
cartDto.amount -= pointDeductedMoney;
|
|
||||||
}
|
}
|
||||||
jm.data = cartDto;
|
jm.data = cartDto;
|
||||||
return jm;
|
return jm;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -22,12 +23,13 @@ using CoreCms.Net.IServices;
|
|||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.FromBody;
|
using CoreCms.Net.Model.FromBody;
|
||||||
using CoreCms.Net.Model.ViewModels.Basics;
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
|
||||||
using CoreCms.Net.Model.ViewModels.DTO;
|
using CoreCms.Net.Model.ViewModels.DTO;
|
||||||
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Utility.Extensions;
|
using CoreCms.Net.Utility.Extensions;
|
||||||
using CoreCms.Net.Utility.Helper;
|
using CoreCms.Net.Utility.Helper;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
@@ -47,6 +49,8 @@ namespace CoreCms.Net.Services
|
|||||||
private readonly ICoreCmsUserGradeServices _userGradeServices;
|
private readonly ICoreCmsUserGradeServices _userGradeServices;
|
||||||
private readonly ICoreCmsUserLogServices _userLogServices;
|
private readonly ICoreCmsUserLogServices _userLogServices;
|
||||||
|
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
private readonly IUnitOfWork _unitOfWork;
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
private readonly PermissionRequirement _permissionRequirement;
|
private readonly PermissionRequirement _permissionRequirement;
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
@@ -56,7 +60,7 @@ namespace CoreCms.Net.Services
|
|||||||
, ICoreCmsUserRepository dal
|
, ICoreCmsUserRepository dal
|
||||||
, ICoreCmsUserBalanceServices userBalanceServices
|
, ICoreCmsUserBalanceServices userBalanceServices
|
||||||
, ICoreCmsSettingServices settingServices
|
, ICoreCmsSettingServices settingServices
|
||||||
, ICoreCmsUserPointLogServices userPointLogServices, ICoreCmsSmsServices smsServices, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, ICoreCmsUserGradeServices userGradeServices, PermissionRequirement permissionRequirement, IHttpContextAccessor httpContextAccessor, ICoreCmsUserLogServices userLogServices)
|
, ICoreCmsUserPointLogServices userPointLogServices, ICoreCmsSmsServices smsServices, ICoreCmsUserWeChatInfoServices userWeChatInfoServices, ICoreCmsUserGradeServices userGradeServices, PermissionRequirement permissionRequirement, IHttpContextAccessor httpContextAccessor, ICoreCmsUserLogServices userLogServices, IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
this._dal = dal;
|
this._dal = dal;
|
||||||
base.BaseDal = dal;
|
base.BaseDal = dal;
|
||||||
@@ -70,6 +74,7 @@ namespace CoreCms.Net.Services
|
|||||||
_permissionRequirement = permissionRequirement;
|
_permissionRequirement = permissionRequirement;
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
_userLogServices = userLogServices;
|
_userLogServices = userLogServices;
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -160,9 +165,13 @@ namespace CoreCms.Net.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId">用户序列</param>
|
/// <param name="userId">用户序列</param>
|
||||||
/// <param name="orderMoney">订单金额</param>
|
/// <param name="orderMoney">订单金额</param>
|
||||||
|
/// <param name="ids">货品序列</param>
|
||||||
|
/// <param name="cartType">购物车类型</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<GetUserPointResult> GetUserPoint(int userId, decimal orderMoney)
|
public async Task<GetUserPointResult> GetUserPoint(int userId, decimal orderMoney, int[] ids, int cartType)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
GetUserPointResult dto = new GetUserPointResult();
|
GetUserPointResult dto = new GetUserPointResult();
|
||||||
//1是2否
|
//1是2否
|
||||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||||
@@ -177,19 +186,67 @@ namespace CoreCms.Net.Services
|
|||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
dto.point = user.point;
|
dto.point = user.point;
|
||||||
if (orderMoney != 0)
|
|
||||||
|
var pointExchangeModel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointExchangeModel).ObjectToInt(); //判断是全局模式还是单品模式
|
||||||
|
if (pointExchangeModel == 1)
|
||||||
{
|
{
|
||||||
//计算可用积分
|
if (orderMoney != 0)
|
||||||
var ordersPointProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrdersPointProportion).ObjectToInt(10);//订单积分使用比例
|
{
|
||||||
//最多可以抵扣的金额
|
//计算可用积分//订单积分使用比例
|
||||||
var maxPointDeductedMoney = Math.Round((orderMoney * ordersPointProportion) / 100, 2);
|
var ordersPointProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrdersPointProportion).ObjectToInt(10);
|
||||||
//订单积分折现比例(多少积分可以折现1块钱)
|
//最多可以抵扣的金额
|
||||||
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100);
|
var maxPointDeductedMoney = Math.Round((orderMoney * ordersPointProportion) / 100, 2);
|
||||||
//计算需要多少积分
|
|
||||||
var needsPoint = maxPointDeductedMoney * pointDiscountedProportion;
|
//订单积分折现比例(多少积分可以折现1块钱)
|
||||||
//确定是否有那么多积分去抵扣比例计算出的能抵扣的钱
|
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100);
|
||||||
dto.availablePoint = Convert.ToInt32(needsPoint > user.point ? user.point : needsPoint);
|
//计算需要多少积分
|
||||||
dto.pointExchangeMoney = dto.availablePoint / pointDiscountedProportion;
|
var needsPoint = maxPointDeductedMoney * pointDiscountedProportion;
|
||||||
|
//确定是否有那么多积分去抵扣比例计算出的能抵扣的钱
|
||||||
|
dto.availablePoint = Convert.ToInt32(needsPoint > user.point ? user.point : needsPoint);
|
||||||
|
dto.pointExchangeMoney = dto.availablePoint / pointDiscountedProportion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (pointExchangeModel == 2)
|
||||||
|
{
|
||||||
|
using var container = _serviceProvider.CreateScope();
|
||||||
|
|
||||||
|
var cartServices = container.ServiceProvider.GetService<ICoreCmsCartServices>();
|
||||||
|
var productsServices = container.ServiceProvider.GetService<ICoreCmsProductsServices>();
|
||||||
|
|
||||||
|
//获取购物车数据
|
||||||
|
var cartProducts = await cartServices.QueryListByClauseAsync(p => p.type == cartType && p.userId == userId && ids.Contains(p.id));
|
||||||
|
if (cartProducts.Any())
|
||||||
|
{
|
||||||
|
//获取购物车货品序列
|
||||||
|
var cartIds = cartProducts.Select(p => p.productId).ToList();
|
||||||
|
//根据货品序列去找货品
|
||||||
|
var products = await productsServices.QueryListByClauseAsync(p => cartIds.Contains(p.id));
|
||||||
|
if (products.Any())
|
||||||
|
{
|
||||||
|
//可抵扣金额
|
||||||
|
decimal money = 0;
|
||||||
|
//迭代货品,获取到最高可优惠金额,进行累加
|
||||||
|
foreach (var item in products)
|
||||||
|
{
|
||||||
|
var numObj = cartProducts.Find(p => p.productId == item.id);
|
||||||
|
if (numObj != null)
|
||||||
|
{
|
||||||
|
money += numObj.nums * item.pointsDeduction;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//计算抵扣这么多金额需要多少积分。
|
||||||
|
//订单积分折现比例(多少积分可以折现1块钱)
|
||||||
|
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(100);
|
||||||
|
//计算需要多少积分
|
||||||
|
var needsPoint = money * pointDiscountedProportion;
|
||||||
|
|
||||||
|
//确定是否有那么多积分去抵扣比例计算出的能抵扣的钱
|
||||||
|
dto.availablePoint = Convert.ToInt32(needsPoint > user.point ? 0 : needsPoint);
|
||||||
|
|
||||||
|
dto.pointExchangeMoney = Convert.ToInt32(user.point > needsPoint ? money : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dto;
|
return dto;
|
||||||
@@ -613,14 +670,13 @@ namespace CoreCms.Net.Services
|
|||||||
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme);
|
||||||
identity.AddClaims(claims);
|
identity.AddClaims(claims);
|
||||||
jm.status = true;
|
jm.status = true;
|
||||||
jm.msg = "注册成功";
|
jm.msg = "成功";
|
||||||
jm.data = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement);
|
jm.data = JwtToken.BuildJwtToken(claims.ToArray(), _permissionRequirement);
|
||||||
//录入登录日志
|
//录入登录日志
|
||||||
var log = new CoreCmsUserLog();
|
var log = new CoreCmsUserLog();
|
||||||
log.userId = userInfo.id;
|
log.userId = userInfo.id;
|
||||||
log.state = isReg ? (int)GlobalEnumVars.UserLogTypes.注册 : (int)GlobalEnumVars.UserLogTypes.登录;
|
log.state = isReg ? (int)GlobalEnumVars.UserLogTypes.注册 : (int)GlobalEnumVars.UserLogTypes.登录;
|
||||||
log.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ?
|
log.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||||
_httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
|
||||||
log.createTime = DateTime.Now;
|
log.createTime = DateTime.Now;
|
||||||
log.parameters = isReg ? GlobalEnumVars.UserLogTypes.注册.ToString() : GlobalEnumVars.UserLogTypes.登录.ToString();
|
log.parameters = isReg ? GlobalEnumVars.UserLogTypes.注册.ToString() : GlobalEnumVars.UserLogTypes.登录.ToString();
|
||||||
await _userLogServices.InsertAsync(log);
|
await _userLogServices.InsertAsync(log);
|
||||||
|
|||||||
@@ -569,8 +569,17 @@
|
|||||||
} else {
|
} else {
|
||||||
let info = res.data;
|
let info = res.data;
|
||||||
let products = res.data.product;
|
let products = res.data.product;
|
||||||
|
|
||||||
_this.goodsInfo = info;
|
_this.goodsInfo = info;
|
||||||
|
|
||||||
|
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||||
|
var videoObj = {
|
||||||
|
url: _this.goodsInfo.video,
|
||||||
|
poster: _this.goodsInfo.image
|
||||||
|
};
|
||||||
|
_this.goodsInfo.album.unshift(videoObj);
|
||||||
|
_this.autoplay = false;
|
||||||
|
}
|
||||||
|
|
||||||
_this.isfav = _this.goodsInfo.isfav;
|
_this.isfav = _this.goodsInfo.isfav;
|
||||||
_this.type = _this.goodsInfo.groupType;
|
_this.type = _this.goodsInfo.groupType;
|
||||||
_this.product = _this.spesClassHandle(products);
|
_this.product = _this.spesClassHandle(products);
|
||||||
|
|||||||
@@ -709,6 +709,16 @@
|
|||||||
let products = res.data.product;
|
let products = res.data.product;
|
||||||
|
|
||||||
_this.goodsInfo = info;
|
_this.goodsInfo = info;
|
||||||
|
|
||||||
|
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||||
|
var videoObj = {
|
||||||
|
url: _this.goodsInfo.video,
|
||||||
|
poster: _this.goodsInfo.image
|
||||||
|
};
|
||||||
|
_this.goodsInfo.album.unshift(videoObj);
|
||||||
|
_this.autoplay = false;
|
||||||
|
}
|
||||||
|
|
||||||
_this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
|
_this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
|
||||||
_this.product = _this.spesClassHandle(products);
|
_this.product = _this.spesClassHandle(products);
|
||||||
|
|
||||||
|
|||||||
@@ -574,6 +574,16 @@
|
|||||||
let products = res.data.product;
|
let products = res.data.product;
|
||||||
|
|
||||||
_this.goodsInfo = info;
|
_this.goodsInfo = info;
|
||||||
|
|
||||||
|
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||||
|
var videoObj = {
|
||||||
|
url: _this.goodsInfo.video,
|
||||||
|
poster: _this.goodsInfo.image
|
||||||
|
};
|
||||||
|
_this.goodsInfo.album.unshift(videoObj);
|
||||||
|
_this.autoplay = false;
|
||||||
|
}
|
||||||
|
|
||||||
_this.isfav = _this.goodsInfo.isfav;
|
_this.isfav = _this.goodsInfo.isfav;
|
||||||
_this.type = _this.goodsInfo.groupType;
|
_this.type = _this.goodsInfo.groupType;
|
||||||
_this.product = _this.spesClassHandle(products);
|
_this.product = _this.spesClassHandle(products);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.topBox { position: sticky; z-index: 1; width: 100%; /* #ifdef APP-PLUS */ top: calc(var(--status-bar-height) + 35px); /* #endif */ /* #ifdef H5 */ top: calc(var(--status-bar-height) + 55px); /* #endif */ /* #ifdef MP */ top: calc(var(--status-bar-height) + 62.5px); /* #endif */ }
|
.topBox { position: sticky; z-index: 1; width: 100%; /* #ifdef APP-PLUS */ top: calc(var(--status-bar-height) + 35px); /* #endif */ /* #ifdef H5 */ top: calc(var(--status-bar-height) + 55px); /* #endif */ /* #ifdef MP */ top: calc(var(--status-bar-height) + 62.5px); /* #endif */ }
|
||||||
|
.goodsBox { display: flex; flex-flow: row wrap; align-content: flex-start; margin-top: 10px; }
|
||||||
.good_box { border-radius: 8px; margin: 5px; background-color: #ffffff; padding: 5px; position: relative; width: calc(100% - 6px); }
|
.good_box { border-radius: 8px; margin: 0 5px 8px 5px; background-color: #ffffff; position: relative; box-sizing: border-box; break-inside: avoid; overflow: auto; width: calc(50% - 10px); }
|
||||||
.good_image { width: 100%; border-radius: 4px; }
|
.good_image { width: 100%; border-top-left-radius: 4px; border-top-right-radius: 4px; }
|
||||||
.good_title { font-size: 13px; margin-top: 5px; color: $core-main-color; }
|
.good_title { font-size: 13px; margin-top: 5px; color: $core-main-color; }
|
||||||
.good_title-xl { font-size: 14px; margin-top: 5px; color: $core-main-color; }
|
.good_title-xl { font-size: 14px; margin-top: 5px; color: $core-main-color; }
|
||||||
.good-tag-hot { display: flex; margin-top: 5px; position: absolute; top: 7.5px; left: 7.5px; background-color: $core-type-error; color: #FFFFFF; display: flex; align-items: center; padding: 2px 7px; border-radius: 25px; font-size: 10px; line-height: 1; }
|
.good-tag-hot { display: flex; margin-top: 5px; position: absolute; top: 7.5px; left: 7.5px; background-color: $core-type-error; color: #FFFFFF; display: flex; align-items: center; padding: 2px 7px; border-radius: 25px; font-size: 10px; line-height: 1; }
|
||||||
|
|||||||
@@ -84,36 +84,44 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- 商品列表 -->
|
<!-- 商品列表 -->
|
||||||
|
|
||||||
<scroll-view scroll-y="true" :scroll-into-view="toView" class="scroll-Y" @scrolltolower="lower" enable-back-to-top="true" lower-threshold="45">
|
<scroll-view scroll-y="true" :scroll-into-view="toView" class="scroll-Y" @scrolltolower="lower" enable-back-to-top="true" lower-threshold="45">
|
||||||
<!-- 表格图片 -->
|
<!-- 表格图片 -->
|
||||||
<view v-if="current === 0">
|
<view v-if="current === 0">
|
||||||
<view v-if="goodsList.length > 0" class="goodsBox">
|
<view v-if="goodsList.length > 0" class="goodsBox">
|
||||||
<u-grid :col="2" :border="false" align="left">
|
<view class="good_box" v-for="item in goodsList" :key="item.id" @click="goGoodsDetail(item.id)">
|
||||||
<u-grid-item bg-color="transparent" :custom-style="{padding: '1px'}" v-for="item in goodsList" :key="item.id" @click="goGoodsDetail(item.id)">
|
<u--image :src="item.image" :index="item.id" width="100%" height="167px" mode="widthFix"></u--image>
|
||||||
<view class="good_box">
|
<view class="coreshop-padding-5">
|
||||||
<u--image :src="item.image" :index="item.id" width="100%" height="167px" mode="widthFix" radius="10"></u--image>
|
<view class="good_title u-line-2 coreshop-min-height-34">
|
||||||
<view class="good_title u-line-2 coreshop-min-height-34">
|
{{item.name}}
|
||||||
{{item.name}}
|
</view>
|
||||||
|
<view class="good-price">
|
||||||
|
{{item.price}}元 <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-15 coreshop-text-gray">{{item.mktprice}}元</span>
|
||||||
|
</view>
|
||||||
|
<view class="good-tag-recommend" v-if="item.isRecommend">
|
||||||
|
推荐
|
||||||
|
</view>
|
||||||
|
<view class="good-tag-hot" v-if="item.isHot">
|
||||||
|
热门
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||||
|
<view>
|
||||||
|
{{ pointShowName}}兑换价:
|
||||||
</view>
|
</view>
|
||||||
<view class="good-price">
|
<view class="coreshop-text-red">
|
||||||
{{item.price}}元 <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-15 coreshop-text-gray">{{item.mktprice}}元</span>
|
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元
|
||||||
</view>
|
|
||||||
<view class="good-tag-recommend" v-if="item.isRecommend">
|
|
||||||
推荐
|
|
||||||
</view>
|
|
||||||
<view class="good-tag-hot" v-if="item.isHot">
|
|
||||||
热门
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-grid-item>
|
</view>
|
||||||
</u-grid>
|
</view>
|
||||||
<u-loadmore :status="loadStatus" :icon-type="loadIconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
|
<view class="coreshop-btn-all">
|
||||||
|
<u-loadmore :status="loadStatus" :icon-type="loadIconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 无数据时默认显示 -->
|
<!-- 无数据时默认显示 -->
|
||||||
<view class="coreshop-emptybox" v-else>
|
<view class="coreshop-emptybox" v-else>
|
||||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="当前列表为空" mode="list"></u-empty>
|
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="当前列表为空" mode="list"></u-empty>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 列表图片 -->
|
<!-- 列表图片 -->
|
||||||
@@ -134,7 +142,7 @@
|
|||||||
</u-col>
|
</u-col>
|
||||||
<u-col span="8">
|
<u-col span="8">
|
||||||
<view class="contentBody">
|
<view class="contentBody">
|
||||||
<view class="good_title-xl u-line-2 coreshop-padding-left-10 coreshop-padding-right-10">
|
<view class="good_title-xl u-line-2 coreshop-padding-left-10 coreshop-padding-right-10">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="good-price coreshop-padding-10">
|
<view class="good-price coreshop-padding-10">
|
||||||
@@ -306,6 +314,13 @@
|
|||||||
this.getGoods();
|
this.getGoods();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
pointSwitch() { return this.$store.state.config.pointSwitch },
|
||||||
|
pointShowExchangePrice() { return this.$store.state.config.pointShowExchangePrice },
|
||||||
|
pointDiscountedProportion() { return this.$store.state.config.pointDiscountedProportion },
|
||||||
|
pointExchangeModel() { return this.$store.state.config.pointExchangeModel },
|
||||||
|
pointShowName() { return this.$store.state.config.pointShowName },
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listGrid() {
|
listGrid() {
|
||||||
if (this.current == 0) {
|
if (this.current == 0) {
|
||||||
|
|||||||
@@ -18,8 +18,19 @@
|
|||||||
<view class="coreshop-limited-seckill-box coreshop-bg-red">
|
<view class="coreshop-limited-seckill-box coreshop-bg-red">
|
||||||
<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">
|
<view class="coreshop-font-xs coreshop-cost-price-num price-4">
|
||||||
<view class="coreshop-text-through">原价¥{{ product.mktprice || '0.00'}}</view>
|
<view v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && product.pointsDeduction > 0">
|
||||||
<view>{{ goodsInfo.buyCount || '0' }} 人已购买</view>
|
<view class="coreshop-padding-bottom-5 coreshop-font-14">
|
||||||
|
兑换价:{{pointDiscountedProportion * product.pointsDeduction }}{{ pointShowName}}+{{ product.price - product.pointsDeduction}} 元
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-flex coreshop-flex-wrap coreshop-flex-direction-row">
|
||||||
|
<view class="coreshop-text-through coreshop-padding-bottom-5">原价¥{{ product.mktprice || '0.00'}}</view>
|
||||||
|
<view class="coreshop-margin-left-10">{{ goodsInfo.buyCount || '0' }} 人已购买</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<view class="coreshop-text-through coreshop-padding-bottom-5">原价¥{{ product.mktprice || '0.00'}}</view>
|
||||||
|
<view>{{ goodsInfo.buyCount || '0' }} 人已购买</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="coreshop-text-right coreshop-share-right">
|
<view class="coreshop-text-right coreshop-share-right">
|
||||||
<u-icon name="share" @click="goShare()" label="分享" size="20" labelSize="11" color="#fff" labelColor="#fff" labelPos="bottom"></u-icon>
|
<u-icon name="share" @click="goShare()" label="分享" size="20" labelSize="11" color="#fff" labelColor="#fff" labelPos="bottom"></u-icon>
|
||||||
@@ -436,7 +447,7 @@
|
|||||||
delivery: [],
|
delivery: [],
|
||||||
service: [],
|
service: [],
|
||||||
},
|
},
|
||||||
autoplay: true
|
autoplay: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@@ -504,6 +515,11 @@
|
|||||||
this.$store.commit('userInfo', val);
|
this.$store.commit('userInfo', val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
pointSwitch() { return this.$store.state.config.pointSwitch },
|
||||||
|
pointShowExchangePrice() { return this.$store.state.config.pointShowExchangePrice },
|
||||||
|
pointDiscountedProportion() { return this.$store.state.config.pointDiscountedProportion },
|
||||||
|
pointExchangeModel() { return this.$store.state.config.pointExchangeModel },
|
||||||
|
pointShowName() { return this.$store.state.config.pointShowName },
|
||||||
shopName() {
|
shopName() {
|
||||||
return this.$store.state.config.shopName;
|
return this.$store.state.config.shopName;
|
||||||
},
|
},
|
||||||
@@ -590,7 +606,11 @@
|
|||||||
_this.goodsInfo = info;
|
_this.goodsInfo = info;
|
||||||
|
|
||||||
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||||
_this.goodsInfo.album.unshift(_this.goodsInfo.video);
|
var videoObj = {
|
||||||
|
url: _this.goodsInfo.video,
|
||||||
|
poster: _this.goodsInfo.image
|
||||||
|
};
|
||||||
|
_this.goodsInfo.album.unshift(videoObj);
|
||||||
_this.autoplay = false;
|
_this.autoplay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
.cart-shoppingcard:last-child { margin-bottom: 75px }
|
.cart-shoppingcard:last-child { margin-bottom: 75px }
|
||||||
|
|
||||||
.cart-shoppingcard-checkbtn { width: 100px; margin-left: 25px; flex-shrink: 0; }
|
.cart-shoppingcard-checkbtn { /*width: 100px;*/ margin-left: 15px; flex-shrink: 0; }
|
||||||
.cart-shoppingcard-checkout { width: 90px; height: 50px; line-height: 50px; font-size: 14px; text-align: center; flex-shrink: 0; }
|
.cart-shoppingcard-checkout { width: 90px; height: 50px; line-height: 50px; font-size: 14px; text-align: center; flex-shrink: 0; }
|
||||||
.cart-bg-gray { background: #A5A7B2 !important; color: #FFFFFF !important; }
|
.cart-bg-gray { background: #A5A7B2 !important; color: #FFFFFF !important; }
|
||||||
.cart-badge { border-radius: 19px; height: 19px; line-height: 19px; padding: 0 6.5px; font-size: 11px; }
|
.cart-badge { border-radius: 19px; height: 19px; line-height: 19px; padding: 0 6.5px; font-size: 11px; }
|
||||||
|
|||||||
@@ -38,10 +38,25 @@
|
|||||||
<text class="cart-shoppingcard-remove coreshop-text-green" v-if="item.stockNo">库存不足</text>
|
<text class="cart-shoppingcard-remove coreshop-text-green" v-if="item.stockNo">库存不足</text>
|
||||||
<text class="cart-shoppingcard-remove coreshop-text-green" v-else-if="item.stockTension">库存紧张</text>
|
<text class="cart-shoppingcard-remove coreshop-text-green" v-else-if="item.stockTension">库存紧张</text>
|
||||||
<text class="cart-shoppingcard-remove " v-else=""></text>
|
<text class="cart-shoppingcard-remove " v-else=""></text>
|
||||||
<u-icon name="trash" size="14" @click="removeGoods" :index="index" label="删除" labelSize="12"></u-icon>
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="coreshop-flex coreshop-flex-direction-row coreshop-justify-between coreshop-margin-top-10">
|
||||||
|
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-13" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.products.pointsDeduction > 0">
|
||||||
|
<view>
|
||||||
|
{{ pointShowName}}兑换价:
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-text-red">
|
||||||
|
{{pointDiscountedProportion * item.products.pointsDeduction }}{{ pointShowName}}+{{ item.products.price - item.products.pointsDeduction}}元
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else></view>
|
||||||
|
<u-icon name="trash" size="14" @click="removeGoods" :index="index" label="删除" labelSize="12"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
|
|
||||||
@@ -61,7 +76,18 @@
|
|||||||
<u-checkbox name="全选" label="全选" active-color="red"></u-checkbox>
|
<u-checkbox name="全选" label="全选" active-color="red"></u-checkbox>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<view class="cart-shoppingcard-count coreshop-flex coreshop-flex-direction-row coreshop-justify-between coreshop-align-center">
|
<view class="cart-shoppingcard-count coreshop-flex coreshop-flex-direction-column coreshop-justify-between coreshop-align-left coreshop-margin-right-5" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && pointShowMoney>0">
|
||||||
|
<view>
|
||||||
|
<text class="cart-text">合计 :</text>
|
||||||
|
<text class="coreshop-font-18 coreshop-text-red">¥{{totalprice}}</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text class="coreshop-font-12">{{ pointShowName}}兑换价:</text>
|
||||||
|
<text class="coreshop-font-12 coreshop-text-red">{{pointShowText}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="cart-shoppingcard-count coreshop-flex coreshop-flex-direction-row coreshop-justify-between coreshop-align-center coreshop-margin-right-5" v-else>
|
||||||
<text class="cart-text">合计 :</text>
|
<text class="cart-text">合计 :</text>
|
||||||
<text class="coreshop-font-18 coreshop-text-red">¥{{totalprice}}</text>
|
<text class="coreshop-font-18 coreshop-text-red">¥{{totalprice}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -84,7 +110,9 @@
|
|||||||
shoppingCard: {},
|
shoppingCard: {},
|
||||||
cartIds: [], //选中ids
|
cartIds: [], //选中ids
|
||||||
goSettlement: false, //去结算按钮
|
goSettlement: false, //去结算按钮
|
||||||
selectAll: ['全选']
|
selectAll: ['全选'],
|
||||||
|
pointShowText: "",
|
||||||
|
pointShowMoney: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//页面加载
|
//页面加载
|
||||||
@@ -103,14 +131,18 @@
|
|||||||
},
|
},
|
||||||
GoodsStocksWarn() {
|
GoodsStocksWarn() {
|
||||||
return this.$store.state.config.goodsStocksWarn;
|
return this.$store.state.config.goodsStocksWarn;
|
||||||
}
|
},
|
||||||
|
pointSwitch() { return this.$store.state.config.pointSwitch },
|
||||||
|
pointShowExchangePrice() { return this.$store.state.config.pointShowExchangePrice },
|
||||||
|
pointDiscountedProportion() { return this.$store.state.config.pointDiscountedProportion },
|
||||||
|
pointExchangeModel() { return this.$store.state.config.pointExchangeModel },
|
||||||
|
pointShowName() { return this.$store.state.config.pointShowName },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//数组转字符串
|
//数组转字符串
|
||||||
arrayToStr: function (array) {
|
arrayToStr: function (array) {
|
||||||
return array.toString();
|
return array.toString();
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取购物车数据
|
//获取购物车数据
|
||||||
getCartData: function () {
|
getCartData: function () {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@@ -127,7 +159,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//渲染前配置数据
|
//渲染前配置数据
|
||||||
showHandle: function (data, flag = true) {
|
showHandle: function (data, flag = true) {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@@ -214,16 +245,22 @@
|
|||||||
}
|
}
|
||||||
_this.countTotoal();
|
_this.countTotoal();
|
||||||
},
|
},
|
||||||
|
|
||||||
//计算总计函数
|
//计算总计函数
|
||||||
countTotoal: function () {
|
countTotoal: function () {
|
||||||
let _that = this;
|
let _that = this;
|
||||||
var total = 0;
|
var total = 0;
|
||||||
|
var pointsMoneySum = 0;
|
||||||
|
var pointsSum = 0;
|
||||||
|
|
||||||
for (let i in _that.shoppingCard.list) {
|
for (let i in _that.shoppingCard.list) {
|
||||||
if (_that.shoppingCard.list[i].isSelect) {
|
if (_that.shoppingCard.list[i].isSelect) {
|
||||||
total += Number(_that.shoppingCard.list[i].products.price) * Number(_that.shoppingCard.list[i].nums);
|
total += Number(_that.shoppingCard.list[i].products.price) * Number(_that.shoppingCard.list[i].nums);
|
||||||
|
_that.pointShowMoney += Number(_that.shoppingCard.list[i].products.pointsDeduction) * Number(_that.shoppingCard.list[i].nums);
|
||||||
|
pointsSum += _that.pointDiscountedProportion * Number(_that.shoppingCard.list[i].products.pointsDeduction) * Number(_that.shoppingCard.list[i].nums);
|
||||||
|
pointsMoneySum += Number(_that.shoppingCard.list[i].products.price - _that.shoppingCard.list[i].products.pointsDeduction) * Number(_that.shoppingCard.list[i].nums);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_that.pointShowText = pointsSum + _that.pointShowName + '+' + _that.$common.formatMoney(pointsMoneySum, 2, '');
|
||||||
_that.totalprice = _that.$common.formatMoney(total, 2, '');
|
_that.totalprice = _that.$common.formatMoney(total, 2, '');
|
||||||
},
|
},
|
||||||
toNumberChange: function (e) {
|
toNumberChange: function (e) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<!-- 弹出层 -->
|
<!-- 弹出层 -->
|
||||||
<view class="coreshop-padding-10">
|
<view class="coreshop-padding-10">
|
||||||
<u-popup mode="bottom" v-model="shareBox" ref="share">
|
<u-popup mode="bottom" :show="shareBox" ref="share">
|
||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<coreshop-share-h5 :shareType='3' :goodsId="goodsInfo.goodsId" :teamId="teamInfo.teamId" :groupId="teamInfo.ruleId"
|
<coreshop-share-h5 :shareType='3' :goodsId="goodsInfo.goodsId" :teamId="teamInfo.teamId" :groupId="teamInfo.ruleId"
|
||||||
:shareImg="goodsInfo.image_url" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref"
|
:shareImg="goodsInfo.image_url" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref"
|
||||||
@@ -121,33 +121,8 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$u.toast('参数错误');
|
this.$u.toast('参数错误');
|
||||||
}
|
}
|
||||||
let teamInfo, orderInfo, goodsInfo
|
this.orderDetail();
|
||||||
|
this.getTeam();
|
||||||
let pages = getCurrentPages()
|
|
||||||
let pre = pages[pages.length - 2]
|
|
||||||
if (typeof pre != 'undefined') {
|
|
||||||
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE
|
|
||||||
teamInfo = pre.teamInfo
|
|
||||||
orderInfo = pre.orderInfo
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
teamInfo = pre.$vm.teamInfo
|
|
||||||
orderInfo = pre.$vm.orderInfo
|
|
||||||
// #endif
|
|
||||||
// #ifdef MP-ALIPAY || MP-TOUTIAO
|
|
||||||
teamInfo = pre.data.teamInfo;
|
|
||||||
orderInfo = pre.data.orderInfo
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
if (teamInfo && orderInfo) {
|
|
||||||
this.teamInfo = teamInfo;
|
|
||||||
this.orderInfo = orderInfo;
|
|
||||||
this.goodsInfo = orderInfo.items[0];
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.orderDetail();
|
|
||||||
this.getTeam();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
shareHref() {
|
shareHref() {
|
||||||
@@ -259,20 +234,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
//watch: {
|
||||||
goodsInfo: {
|
// goodsInfo: {
|
||||||
handler() {
|
// handler() {
|
||||||
this.getShareUrl();
|
// this.getShareUrl();
|
||||||
},
|
// },
|
||||||
deep: true
|
// deep: true
|
||||||
},
|
// },
|
||||||
teamInfo: {
|
// teamInfo: {
|
||||||
handler() {
|
// handler() {
|
||||||
this.getShareUrl();
|
// this.getShareUrl();
|
||||||
},
|
// },
|
||||||
deep: true
|
// deep: true
|
||||||
}
|
// }
|
||||||
},
|
//},
|
||||||
//分享
|
//分享
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -107,10 +107,31 @@
|
|||||||
<u-tag :text="v.name" mode="light" size="mini" v-for="(v, k) in item.products.promotionList" :key="k" />
|
<u-tag :text="v.name" mode="light" size="mini" v-for="(v, k) in item.products.promotionList" :key="k" />
|
||||||
</view>
|
</view>
|
||||||
<view class="goods-price-view">
|
<view class="goods-price-view">
|
||||||
<text class="coreshop-text-price coreshop-text-red coreshop-font-lg">{{ item.products.price || ''}}</text>
|
<view class="coreshop-flex coreshop-flex-direction-row">
|
||||||
|
<text class="coreshop-text-price coreshop-text-red coreshop-font-lg">{{ item.products.price || ''}}</text>
|
||||||
|
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-10 coreshop-align-center" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.products.pointsDeduction > 0">
|
||||||
|
<view>
|
||||||
|
({{ pointShowName}}兑换价:
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-text-red">
|
||||||
|
{{pointDiscountedProportion * item.products.pointsDeduction }}{{ pointShowName}}+{{ item.products.price - item.products.pointsDeduction}}元
|
||||||
|
</view>
|
||||||
|
)
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class='coreshop-text-right goods-num'>× {{ item.nums || ''}}</view>
|
<view class='coreshop-text-right goods-num'>× {{ item.nums || ''}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-13 coreshop-margin-top-10" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.products.pointsDeduction > 0">
|
||||||
|
<view>
|
||||||
|
{{ pointShowName}}兑换价合计:
|
||||||
|
</view>
|
||||||
|
<view class="coreshop-text-red">
|
||||||
|
{{pointDiscountedProportion * item.products.pointsDeduction * item.nums }}{{ pointShowName}}+{{(item.products.price - item.products.pointsDeduction)*item.nums }}元
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -162,10 +183,10 @@
|
|||||||
<view class="coreshop-list-item" v-if="isOpenPoint === 1 && userPointNums > 0">
|
<view class="coreshop-list-item" v-if="isOpenPoint === 1 && userPointNums > 0">
|
||||||
<!--<view class="coreshop-list-item arrow">-->
|
<!--<view class="coreshop-list-item arrow">-->
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<text class="coreshop-text-black">积分抵扣</text>
|
<text class="coreshop-text-black">{{ pointShowName}}抵扣</text>
|
||||||
<view class="coreshop-text-gray coreshop-font-xs flex">
|
<view class="coreshop-text-gray coreshop-font-xs flex">
|
||||||
<text class="u-line-1">
|
<text class="u-line-1">
|
||||||
可用{{ canUsePoint}}积分,可抵扣{{ pointMoney}}元,共有{{ userPointNums}}积分
|
可用{{ canUsePoint}}{{ pointShowName}},可抵扣{{ pointMoney}}元,共有{{ userPointNums}}{{ pointShowName}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -468,6 +489,8 @@
|
|||||||
// 判断是否开启积分抵扣 并且 没有勾选积分使用
|
// 判断是否开启积分抵扣 并且 没有勾选积分使用
|
||||||
if (this.isOpenPoint === 1 && !this.isUsePoint) {
|
if (this.isOpenPoint === 1 && !this.isUsePoint) {
|
||||||
let money = {
|
let money = {
|
||||||
|
cartType: this.orderType,
|
||||||
|
ids: this.params.ids,
|
||||||
orderMoney: data.amount
|
orderMoney: data.amount
|
||||||
}
|
}
|
||||||
this.$u.api.usablePoint(money).then(res => {
|
this.$u.api.usablePoint(money).then(res => {
|
||||||
@@ -841,7 +864,11 @@
|
|||||||
//console.log(this.cartData.coupon);
|
//console.log(this.cartData.coupon);
|
||||||
return this.cartData.coupon && this.cartData.coupon.length > 0;
|
return this.cartData.coupon && this.cartData.coupon.length > 0;
|
||||||
},
|
},
|
||||||
|
pointSwitch() { return this.$store.state.config.pointSwitch },
|
||||||
|
pointShowExchangePrice() { return this.$store.state.config.pointShowExchangePrice },
|
||||||
|
pointDiscountedProportion() { return this.$store.state.config.pointDiscountedProportion },
|
||||||
|
pointExchangeModel() { return this.$store.state.config.pointExchangeModel },
|
||||||
|
pointShowName() { return this.$store.state.config.pointShowName },
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 监听数据状态(切换收货地址, 是否使用优惠券, 是否使用积分) 重新请求订单数据
|
// 监听数据状态(切换收货地址, 是否使用优惠券, 是否使用积分) 重新请求订单数据
|
||||||
|
|||||||
@@ -297,6 +297,7 @@
|
|||||||
<col width="80">
|
<col width="80">
|
||||||
<col width="80">
|
<col width="80">
|
||||||
<col width="80">
|
<col width="80">
|
||||||
|
<col width="80">
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -305,6 +306,7 @@
|
|||||||
<th>货号</th>
|
<th>货号</th>
|
||||||
<th>SKU</th>
|
<th>SKU</th>
|
||||||
<th>重量(克)</th>
|
<th>重量(克)</th>
|
||||||
|
<th>低分最大<br />可抵金额</th>
|
||||||
<th>库存</th>
|
<th>库存</th>
|
||||||
<th><i class="required-color">*</i>销售价</th>
|
<th><i class="required-color">*</i>销售价</th>
|
||||||
<th>成本价</th>
|
<th>成本价</th>
|
||||||
@@ -345,6 +347,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<input type="text" name="product[weight][]" value="{{item.weight}}" placeholder="重量" class="layui-input layui-inline-1">
|
<input type="text" name="product[weight][]" value="{{item.weight}}" placeholder="重量" class="layui-input layui-inline-1">
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="product[pointsDeduction][]" value="{{item.pointsDeduction}}" placeholder="金额" class="layui-input layui-inline-1">
|
||||||
|
</td>
|
||||||
<td class="have-add-td">
|
<td class="have-add-td">
|
||||||
<input type="text" name="product[stock][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock">
|
<input type="text" name="product[stock][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock">
|
||||||
</td>
|
</td>
|
||||||
@@ -507,6 +512,7 @@
|
|||||||
sn: layui.coreHelper.getSN('SN'),
|
sn: layui.coreHelper.getSN('SN'),
|
||||||
spesDesc: "",
|
spesDesc: "",
|
||||||
stock: 1000,
|
stock: 1000,
|
||||||
|
pointsDeduction: 0,
|
||||||
weight: 0,
|
weight: 0,
|
||||||
price: 0,
|
price: 0,
|
||||||
costprice: 0,
|
costprice: 0,
|
||||||
@@ -781,7 +787,7 @@
|
|||||||
}
|
}
|
||||||
, done: function (res) {
|
, done: function (res) {
|
||||||
if (res.code > 0) {
|
if (res.code > 0) {
|
||||||
return layer.msg('上传失败');
|
return layer.msg('上传失败');
|
||||||
} else {
|
} else {
|
||||||
layer.msg('上传成功');
|
layer.msg('上传成功');
|
||||||
imgs.push(res.data.fileUrl);
|
imgs.push(res.data.fileUrl);
|
||||||
@@ -1428,6 +1434,7 @@
|
|||||||
productModel.levelOne = field['product[levelOne][' + i + ']'];
|
productModel.levelOne = field['product[levelOne][' + i + ']'];
|
||||||
productModel.levelTwo = field['product[levelTwo][' + i + ']'];
|
productModel.levelTwo = field['product[levelTwo][' + i + ']'];
|
||||||
productModel.levelThree = field['product[levelThree][' + i + ']'];
|
productModel.levelThree = field['product[levelThree][' + i + ']'];
|
||||||
|
productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']'];
|
||||||
products.push(productModel);
|
products.push(productModel);
|
||||||
}
|
}
|
||||||
//会员价格模型
|
//会员价格模型
|
||||||
|
|||||||
@@ -289,6 +289,7 @@
|
|||||||
<col width="80">
|
<col width="80">
|
||||||
<col width="80">
|
<col width="80">
|
||||||
<col width="80">
|
<col width="80">
|
||||||
|
<col width="80">
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -298,6 +299,7 @@
|
|||||||
<th>SKU</th>
|
<th>SKU</th>
|
||||||
<th>冻结库存</th>
|
<th>冻结库存</th>
|
||||||
<th>重量(克)</th>
|
<th>重量(克)</th>
|
||||||
|
<th>低分最大<br />可抵金额</th>
|
||||||
<th>库存</th>
|
<th>库存</th>
|
||||||
<th><i class="required-color">*</i>销售价</th>
|
<th><i class="required-color">*</i>销售价</th>
|
||||||
<th>成本价</th>
|
<th>成本价</th>
|
||||||
@@ -341,7 +343,9 @@
|
|||||||
<td>
|
<td>
|
||||||
<input type="text" name="product[weight][]" value="{{item.weight}}" placeholder="重量" class="layui-input layui-inline-1">
|
<input type="text" name="product[weight][]" value="{{item.weight}}" placeholder="重量" class="layui-input layui-inline-1">
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="product[pointsDeduction][]" value="{{item.pointsDeduction}}" placeholder="金额" class="layui-input layui-inline-1">
|
||||||
|
</td>
|
||||||
<td class="have-add-td">
|
<td class="have-add-td">
|
||||||
<input type="text" name="product[stock][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock">
|
<input type="text" name="product[stock][]" value="{{item.stock}}" placeholder="库存" class="layui-input layui-inline-1 goods-stock">
|
||||||
</td>
|
</td>
|
||||||
@@ -610,6 +614,7 @@
|
|||||||
sn: layui.coreHelper.getSN('SN'),
|
sn: layui.coreHelper.getSN('SN'),
|
||||||
spesDesc: "",
|
spesDesc: "",
|
||||||
stock: 1000,
|
stock: 1000,
|
||||||
|
pointsDeduction: 0,
|
||||||
weight: 0,
|
weight: 0,
|
||||||
price: 0,
|
price: 0,
|
||||||
costprice: 0,
|
costprice: 0,
|
||||||
@@ -1537,6 +1542,7 @@
|
|||||||
productModel.levelOne = field['product[levelOne][' + i + ']'];
|
productModel.levelOne = field['product[levelOne][' + i + ']'];
|
||||||
productModel.levelTwo = field['product[levelTwo][' + i + ']'];
|
productModel.levelTwo = field['product[levelTwo][' + i + ']'];
|
||||||
productModel.levelThree = field['product[levelThree][' + i + ']'];
|
productModel.levelThree = field['product[levelThree][' + i + ']'];
|
||||||
|
productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']'];
|
||||||
products.push(productModel);
|
products.push(productModel);
|
||||||
}
|
}
|
||||||
//会员价格模型
|
//会员价格模型
|
||||||
|
|||||||
@@ -445,6 +445,29 @@
|
|||||||
<input type="radio" lay-filter="pointSwitch" name="pointSwitch" value="2" title="不开启" {{d.data.configs['pointSwitch']['sValue']==="2" ? 'checked':''}}>
|
<input type="radio" lay-filter="pointSwitch" name="pointSwitch" value="2" title="不开启" {{d.data.configs['pointSwitch']['sValue']==="2" ? 'checked':''}}>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">{{d.data.configs['pointExchangeModel']['sKey']}}:</label>
|
||||||
|
<div class="layui-input-inline layui-inline-7">
|
||||||
|
<input type="radio" lay-filter="pointExchangeModel" name="pointExchangeModel" value="1" title="全局计算" {{d.data.configs['pointExchangeModel']['sValue']==="1" ? 'checked':''}}>
|
||||||
|
<input type="radio" lay-filter="pointExchangeModel" name="pointExchangeModel" value="2" title="单品计算" {{d.data.configs['pointExchangeModel']['sValue']==="2" ? 'checked':''}}>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">【全局计算】是指直接对订单按照使用比例进行计算,【单品计算】是指根据单个商品下sku独立设置的最高可抵扣金额进行计算。</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">{{d.data.configs['pointShowExchangePrice']['sKey']}}:</label>
|
||||||
|
<div class="layui-input-inline layui-inline-7">
|
||||||
|
<input type="radio" lay-filter="pointShowExchangePrice" name="pointShowExchangePrice" value="1" title="显示" {{d.data.configs['pointShowExchangePrice']['sValue']==="1" ? 'checked':''}}>
|
||||||
|
<input type="radio" lay-filter="pointShowExchangePrice" name="pointShowExchangePrice" value="2" title="不显示" {{d.data.configs['pointShowExchangePrice']['sValue']==="2" ? 'checked':''}}>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">勾选显示,将在商品详情,购物车等界面显示积分加价格的效果。</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">{{d.data.configs['pointShowName']['sKey']}}:</label>
|
||||||
|
<div class="layui-input-inline layui-inline-2">
|
||||||
|
<input type="text" name="pointShowName" value="{{d.data.configs['pointShowName']['sValue']}}" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-mid layui-word-aux">前端积分可以展示别的名称如:衡豆。金豆等等</div>
|
||||||
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">{{d.data.configs['pointDiscountedProportion']['sKey']}}:</label>
|
<label class="layui-form-label">{{d.data.configs['pointDiscountedProportion']['sKey']}}:</label>
|
||||||
<div class="layui-input-inline layui-inline-2">
|
<div class="layui-input-inline layui-inline-2">
|
||||||
@@ -457,7 +480,7 @@
|
|||||||
<div class="layui-input-inline layui-inline-2">
|
<div class="layui-input-inline layui-inline-2">
|
||||||
<input type="number" name="ordersPointProportion" value="{{d.data.configs['ordersPointProportion']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" max="100" min="0">
|
<input type="number" name="ordersPointProportion" value="{{d.data.configs['ordersPointProportion']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" max="100" min="0">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid layui-word-aux">(%)单个订单积分折现最大百分比</div>
|
<div class="layui-form-mid layui-word-aux">(%)单个订单积分折现最大百分比【仅全局计算下有小,单品计算模式直接根据单品的设置】</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">{{d.data.configs['ordersRewardProportion']['sKey']}}:</label>
|
<label class="layui-form-label">{{d.data.configs['ordersRewardProportion']['sKey']}}:</label>
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
var toCashMoneyLow = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyLow); //最低提现
|
var toCashMoneyLow = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyLow); //最低提现
|
||||||
var toCashMoneyRate = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyRate); //服务费
|
var toCashMoneyRate = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.TocashMoneyRate); //服务费
|
||||||
var pointSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointSwitch).ObjectToInt(); //是否开启积分功能
|
var pointSwitch = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointSwitch).ObjectToInt(); //是否开启积分功能
|
||||||
|
var pointExchangeModel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointExchangeModel).ObjectToInt(); //积分模式
|
||||||
|
var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToInt(); //积分折现比例
|
||||||
|
var pointShowName = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointShowName); //积分昵称
|
||||||
|
var pointShowExchangePrice = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointShowExchangePrice).ObjectToInt(); //积分昵称
|
||||||
var statistics = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StatisticsCode); //获取统计代码
|
var statistics = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.StatisticsCode); //获取统计代码
|
||||||
var recommendKeysStr = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.RecommendKeys);
|
var recommendKeysStr = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.RecommendKeys);
|
||||||
var recommendKeys = !string.IsNullOrEmpty(recommendKeysStr) ? recommendKeysStr.Split("|") : new string[] { }; //搜索推荐关键字
|
var recommendKeys = !string.IsNullOrEmpty(recommendKeysStr) ? recommendKeysStr.Split("|") : new string[] { }; //搜索推荐关键字
|
||||||
@@ -173,6 +177,10 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
toCashMoneyLow,
|
toCashMoneyLow,
|
||||||
toCashMoneyRate,
|
toCashMoneyRate,
|
||||||
pointSwitch,
|
pointSwitch,
|
||||||
|
pointExchangeModel,
|
||||||
|
pointShowName,
|
||||||
|
pointShowExchangePrice,
|
||||||
|
pointDiscountedProportion,
|
||||||
statistics,
|
statistics,
|
||||||
recommendKeys,
|
recommendKeys,
|
||||||
invoiceSwitch,
|
invoiceSwitch,
|
||||||
|
|||||||
@@ -919,7 +919,14 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
var jm = new WebApiCallBack();
|
var jm = new WebApiCallBack();
|
||||||
|
|
||||||
var ship = await _userServices.GetUserPoint(_user.ID, entity.orderMoney);
|
var ids = CommonHelper.StringToIntArray(entity.ids);
|
||||||
|
if (!ids.Any())
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "请提交货品信息";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
var ship = await _userServices.GetUserPoint(_user.ID, entity.orderMoney, ids, entity.cartType);
|
||||||
jm.status = true;
|
jm.status = true;
|
||||||
jm.data = ship;
|
jm.data = ship;
|
||||||
|
|
||||||
|
|||||||
BIN
数据库/MySql/20220224/coreshop20220224完整脚本.rar
Normal file
BIN
数据库/MySql/20220224/coreshop20220224完整脚本.rar
Normal file
Binary file not shown.
1
数据库/MySql/20220224/升级脚本.sql
Normal file
1
数据库/MySql/20220224/升级脚本.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE CoreCmsProducts ADD COLUMN pointsDeduction decimal(10,2) DEFAULT 0 NOT NULL COMMENT '积分可抵扣金额' AFTER isDel;
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
2022-02-24
|
||||||
|
【新增】表【CoreCmsProducts】增加【积分可抵扣金额pointsDeduction】字段
|
||||||
|
|
||||||
2022-02-12
|
2022-02-12
|
||||||
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
||||||
|
|
||||||
|
|||||||
BIN
数据库/SqlServer/20220224/202202240135完整数据库.rar
Normal file
BIN
数据库/SqlServer/20220224/202202240135完整数据库.rar
Normal file
Binary file not shown.
12
数据库/SqlServer/20220224/升级脚本.sql
Normal file
12
数据库/SqlServer/20220224/升级脚本.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
ALTER TABLE [dbo].[CoreCmsProducts]
|
||||||
|
ADD [pointsDeduction] DECIMAL(10, 2)
|
||||||
|
DEFAULT 0 NOT NULL;
|
||||||
|
|
||||||
|
EXECUTE sp_addextendedproperty @name = N'MS_Description',
|
||||||
|
@value = N'»ý·Ö¿ÉµÖ¿Û½ð¶î',
|
||||||
|
@level0type = N'SCHEMA',
|
||||||
|
@level0name = N'dbo',
|
||||||
|
@level1type = N'TABLE',
|
||||||
|
@level1name = N'CoreCmsProducts',
|
||||||
|
@level2type = N'COLUMN',
|
||||||
|
@level2name = N'pointsDeduction';
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
2022-02-24
|
||||||
|
【新增】表【CoreCmsProducts】增加【积分可抵扣金额pointsDeduction】字段
|
||||||
|
|
||||||
2022-02-12
|
2022-02-12
|
||||||
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user