mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:13:26 +08:00
# 2022-02-12
### 1.3.5 开源社区版: 无 ### 0.1.7 会员专业版: 【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。 【新增】用户地址新增及编辑增加地图选择获取街道及经纬度坐标功能。 【新增】【平台设置-订单管理】,新增【同城配送运费设置】,可设置2公里内,5公里内,10公里内,15公里内,20公里内不同距离运费。根据用户地址坐标与门店坐标进行计算。 【新增】商品详情轮播图增加视频图片混播结合功能,类似淘宝打开商品详情后显示视频并支持播放,左右滑动切换图片,实现混播。 【新增】商品添加/删除面板增加视频上传功能。
This commit is contained in:
@@ -727,5 +727,31 @@ namespace CoreCms.Net.Configuration
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送2公里内
|
||||
/// </summary>
|
||||
public static readonly string IntraCityServiceBy2KM = "intraCityServiceBy2KM";
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送5公里内
|
||||
/// </summary>
|
||||
public static readonly string IntraCityServiceBy5KM = "intraCityServiceBy5KM";
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送10公里内
|
||||
/// </summary>
|
||||
public static readonly string IntraCityServiceBy10KM = "intraCityServiceBy10KM";
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送15公里内
|
||||
/// </summary>
|
||||
public static readonly string IntraCityServiceBy15KM = "intraCityServiceBy15KM";
|
||||
|
||||
/// <summary>
|
||||
/// 同城配送20公里内
|
||||
/// </summary>
|
||||
public static readonly string IntraCityServiceBy20KM = "intraCityServiceBy20KM";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -211,6 +211,14 @@ namespace CoreCms.Net.Configuration
|
||||
di.Add(SystemSettingConstVars.SmsTplForCommon, new DictionaryKeyValues() { sKey = "通用类型", sValue = "欢迎您访问我们的微信小程序,有问题请联系客服。" });
|
||||
|
||||
|
||||
//自提运费设置
|
||||
di.Add(SystemSettingConstVars.IntraCityServiceBy2KM, new DictionaryKeyValues() { sKey = "2公里内", sValue = "0" });
|
||||
di.Add(SystemSettingConstVars.IntraCityServiceBy5KM, new DictionaryKeyValues() { sKey = "5公里内", sValue = "0" });
|
||||
di.Add(SystemSettingConstVars.IntraCityServiceBy10KM, new DictionaryKeyValues() { sKey = "10公里内", sValue = "0" });
|
||||
di.Add(SystemSettingConstVars.IntraCityServiceBy15KM, new DictionaryKeyValues() { sKey = "15公里内", sValue = "0" });
|
||||
di.Add(SystemSettingConstVars.IntraCityServiceBy20KM, new DictionaryKeyValues() { sKey = "20公里内", sValue = "0" });
|
||||
|
||||
|
||||
return di;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
@@ -76,7 +76,6 @@ namespace CoreCms.Net.IServices
|
||||
Task<WebApiCallBack> GetCartDtoData(int userId, int[] ids = null, int type = 1, int objectId = 0);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取处理后的购物车信息
|
||||
/// </summary>
|
||||
@@ -86,13 +85,12 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="areaId">收货地址id</param>
|
||||
/// <param name="point">消费的积分</param>
|
||||
/// <param name="couponCode">优惠券码</param>
|
||||
/// <param name="freeFreight">是否免运费</param>
|
||||
/// <param name="deliveryType">关联上面的是否免运费/1=快递配送(要去算运费)生成订单记录快递方式,2=同城配送/3=门店自提(不需要计算运费)生成订单记录门店自提信息</param>
|
||||
/// <param name="userShipId">用户收货地址</param>
|
||||
/// <param name="objectId">关联非普通订单营销类型序列</param>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point,
|
||||
string couponCode, bool freeFreight = false,
|
||||
int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int objectId = 0);
|
||||
string couponCode, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int userShipId = 0, int objectId = 0);
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -100,9 +98,8 @@ namespace CoreCms.Net.IServices
|
||||
/// </summary>
|
||||
/// <param name="cartDto">购物车信息</param>
|
||||
/// <param name="areaId">收货地址id</param>
|
||||
/// <param name="freeFreight">是否包邮,默认false</param>
|
||||
/// <returns></returns>
|
||||
bool CartFreight(CartDto cartDto, int areaId, bool freeFreight = false);
|
||||
bool CartFreight(CartDto cartDto, int areaId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,87 +4,112 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021-06-08 22:14:59
|
||||
* CreateTime: 2022/2/11 22:59:40
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
using SqlSugar;
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
namespace CoreCms.Net.Model.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 用户地址表
|
||||
/// </summary>
|
||||
public partial class CoreCmsUserShip
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户地址表
|
||||
/// </summary>
|
||||
[SugarTable("CoreCmsUserShip",TableDescription = "用户地址表")]
|
||||
public partial class CoreCmsUserShip
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户地址表
|
||||
/// </summary>
|
||||
public CoreCmsUserShip()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
[Display(Name = "序列")]
|
||||
[SugarColumn(ColumnDescription = "序列", IsPrimaryKey = true, IsIdentity = true)]
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
public System.Int32 id { get; set; }
|
||||
public int id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户id 关联user.id
|
||||
/// </summary>
|
||||
[Display(Name = "用户id 关联user.id")]
|
||||
[SugarColumn(ColumnDescription = "用户id 关联user.id")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
public System.Int32 userId { get; set; }
|
||||
public int userId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 收货地区ID
|
||||
/// </summary>
|
||||
[Display(Name = "收货地区ID")]
|
||||
[SugarColumn(ColumnDescription = "收货地区ID")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
public System.Int32 areaId { get; set; }
|
||||
public int areaId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 收货详细地址
|
||||
/// </summary>
|
||||
[Display(Name = "收货详细地址")]
|
||||
[SugarColumn(ColumnDescription = "收货详细地址", IsNullable = true)]
|
||||
[StringLength(200, ErrorMessage = "【{0}】不能超过{1}字符长度")]
|
||||
public System.String address { get; set; }
|
||||
[StringLength(200, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string address { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 收货人姓名
|
||||
/// </summary>
|
||||
[Display(Name = "收货人姓名")]
|
||||
[SugarColumn(ColumnDescription = "收货人姓名", IsNullable = true)]
|
||||
[StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")]
|
||||
public System.String name { get; set; }
|
||||
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 收货电话
|
||||
/// </summary>
|
||||
[Display(Name = "收货电话")]
|
||||
[SugarColumn(ColumnDescription = "收货电话", IsNullable = true)]
|
||||
[StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")]
|
||||
public System.String mobile { get; set; }
|
||||
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string mobile { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否默认
|
||||
/// </summary>
|
||||
[Display(Name = "是否默认")]
|
||||
[SugarColumn(ColumnDescription = "是否默认")]
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
public System.Boolean isDefault { get; set; }
|
||||
public bool isDefault { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
[SugarColumn(ColumnDescription = "创建时间", IsNullable = true)]
|
||||
public System.DateTime? createTime { get; set; }
|
||||
public DateTime? createTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[Display(Name = "更新时间")]
|
||||
[SugarColumn(ColumnDescription = "更新时间", IsNullable = true)]
|
||||
public System.DateTime? updateTime { get; set; }
|
||||
}
|
||||
public DateTime? updateTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 经度
|
||||
/// </summary>
|
||||
[Display(Name = "经度")]
|
||||
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string longitude { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 纬度
|
||||
/// </summary>
|
||||
[Display(Name = "纬度")]
|
||||
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string latitude { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 街道
|
||||
/// </summary>
|
||||
[Display(Name = "街道")]
|
||||
[StringLength(50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public string street { get; set; }
|
||||
}
|
||||
@@ -86,6 +86,11 @@ namespace CoreCms.Net.Model.FromBody
|
||||
/// </summary>
|
||||
public int receiptType { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 用户收货地址
|
||||
/// </summary>
|
||||
public int userShipId { get; set; } = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 关联非普通订单对象序列
|
||||
|
||||
@@ -49,6 +49,10 @@ namespace CoreCms.Net.Model.ViewModels.DTO
|
||||
public int isDefault { get; set; } = 2;
|
||||
public string mobile { get; set; }
|
||||
public string name { get; set; }
|
||||
public string longitude { get; set; }
|
||||
public string latitude { get; set; }
|
||||
public string street { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -79,6 +79,11 @@ namespace CoreCms.Net.Repository
|
||||
//oldModel.createTime = entity.createTime;
|
||||
oldModel.updateTime = entity.updateTime;
|
||||
|
||||
oldModel.longitude = entity.longitude;
|
||||
oldModel.latitude = entity.latitude;
|
||||
oldModel.street = entity.street;
|
||||
|
||||
|
||||
if (oldModel.isDefault)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsUserShip>().SetColumns(p => p.isDefault == false).Where(p => p.userId == entity.userId).ExecuteCommandAsync();
|
||||
|
||||
@@ -19,8 +19,8 @@ using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -55,7 +55,8 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsGoodsCategoryServices _goodsCategoryServices;
|
||||
private readonly ICoreCmsSolitaireServices _solitaireServices;
|
||||
|
||||
private readonly ICoreCmsUserShipServices _userShipServices;
|
||||
private readonly ICoreCmsStoreServices _storeServices;
|
||||
|
||||
public CoreCmsCartServices(
|
||||
ICoreCmsCartRepository dal
|
||||
@@ -68,7 +69,7 @@ namespace CoreCms.Net.Services
|
||||
, ICoreCmsUserServices userServices
|
||||
, ICoreCmsSettingServices settingServices
|
||||
, ICoreCmsProductsServices productsServices
|
||||
, ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsSolitaireServices solitaireServices)
|
||||
, ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsSolitaireServices solitaireServices, ICoreCmsUserShipServices userShipServices, ICoreCmsStoreServices storeServices)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
@@ -89,6 +90,8 @@ namespace CoreCms.Net.Services
|
||||
_promotionResultServices = promotionResultServices;
|
||||
_pinTuanRecordServices = pinTuanRecordServices;
|
||||
_solitaireServices = solitaireServices;
|
||||
_userShipServices = userShipServices;
|
||||
_storeServices = storeServices;
|
||||
}
|
||||
|
||||
#region 设置购物车商品数量====================================================
|
||||
@@ -162,6 +165,7 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
#region 添加单个货品到购物车
|
||||
|
||||
/// <summary>
|
||||
/// 添加单个货品到购物车
|
||||
/// </summary>
|
||||
@@ -514,7 +518,6 @@ namespace CoreCms.Net.Services
|
||||
return solitaireInfo;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
jm.msg = GlobalErrorCodeVars.Code10000;
|
||||
@@ -541,11 +544,11 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="areaId">收货地址id</param>
|
||||
/// <param name="point">消费的积分</param>
|
||||
/// <param name="couponCode">优惠券码</param>
|
||||
/// <param name="freeFreight">是否免运费</param>
|
||||
/// <param name="deliveryType">关联上面的是否免运费/1=快递配送(要去算运费)生成订单记录快递方式 2=门店自提(不需要计算运费)生成订单记录门店自提信息</param>
|
||||
/// <param name="userShipId">用户收货地址</param>
|
||||
/// <param name="objectId">关联非普通订单营销类型序列</param>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, bool freeFreight = false, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int objectId = 0)
|
||||
public async Task<WebApiCallBack> GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int userShipId = 0, int objectId = 0)
|
||||
{
|
||||
var jm = new WebApiCallBack() { methodDescription = "获取处理后的购物车信息" };
|
||||
var cartDto = new CartDto(); //必须初始化
|
||||
@@ -583,17 +586,26 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
//门店订单,强制无运费
|
||||
if (deliveryType == (int)GlobalEnumVars.OrderReceiptType.IntraCityService || deliveryType == (int)GlobalEnumVars.OrderReceiptType.SelfDelivery)
|
||||
if (deliveryType == (int)GlobalEnumVars.OrderReceiptType.SelfDelivery)
|
||||
{
|
||||
freeFreight = true;
|
||||
cartDto.costFreight = 0;
|
||||
}
|
||||
//运费判断
|
||||
if (CartFreight(cartDto, areaId, freeFreight) == false)
|
||||
else if (deliveryType == (int)GlobalEnumVars.OrderReceiptType.Logistics)
|
||||
{
|
||||
// 运费判断
|
||||
if (CartFreight(cartDto, areaId) == false)
|
||||
{
|
||||
jm.data = cartDto;
|
||||
jm.msg = "运费判断";
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
else if (deliveryType == (int)GlobalEnumVars.OrderReceiptType.IntraCityService)
|
||||
{
|
||||
await CartFreightByIntraCityService(cartDto, userShipId);
|
||||
}
|
||||
|
||||
|
||||
//接下来算订单促销金额,有些模式不需要计算促销信息,这里就增加判断
|
||||
if (orderType == (int)GlobalEnumVars.OrderType.Common)
|
||||
{
|
||||
@@ -651,17 +663,83 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <param name="cartDto">购物车信息</param>
|
||||
/// <param name="areaId">收货地址id</param>
|
||||
/// <param name="freeFreight">是否包邮,默认false</param>
|
||||
/// <returns></returns>
|
||||
public bool CartFreight(CartDto cartDto, int areaId, bool freeFreight = false)
|
||||
{
|
||||
if (freeFreight == false)
|
||||
public bool CartFreight(CartDto cartDto, int areaId)
|
||||
{
|
||||
if (areaId > 0)
|
||||
{
|
||||
cartDto.costFreight = _shipServices.GetShipCost(areaId, cartDto.weight, cartDto.goodsAmount);
|
||||
cartDto.amount = Math.Round(cartDto.amount + cartDto.costFreight, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据经纬度算运费
|
||||
|
||||
/// <summary>
|
||||
/// 根据经纬度算运费
|
||||
/// </summary>
|
||||
/// <param name="cartDto">购物车信息</param>
|
||||
/// <param name="userShipId">用户地址信息</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> CartFreightByIntraCityService(CartDto cartDto, int userShipId)
|
||||
{
|
||||
if (userShipId > 0)
|
||||
{
|
||||
var userShip = await _userShipServices.QueryByClauseAsync(p => p.id == userShipId);
|
||||
if (userShip == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
var store = await _storeServices.QueryByClauseAsync(p => p.isDefault == true);
|
||||
if (store == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(userShip.longitude) || string.IsNullOrEmpty(userShip.latitude) || string.IsNullOrEmpty(store.longitude) || string.IsNullOrEmpty(store.latitude))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//第一种调用方法
|
||||
var result = MapHelper.GetDistance(Convert.ToDouble(userShip.latitude.Trim()), Convert.ToDouble(userShip.longitude.Trim()), Convert.ToDouble(store.latitude.Trim()), Convert.ToDouble(store.longitude.Trim()));
|
||||
|
||||
var allConfigs = await _settingServices.GetConfigDictionaries();
|
||||
var intraCityServiceBy2Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy2KM).ObjectToDecimal(0);
|
||||
var intraCityServiceBy5Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy5KM).ObjectToDecimal(0);
|
||||
var intraCityServiceBy10Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy10KM).ObjectToDecimal(0);
|
||||
var intraCityServiceBy15Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy15KM).ObjectToDecimal(0);
|
||||
var intraCityServiceBy20Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy20KM).ObjectToDecimal(0);
|
||||
|
||||
if (0 <= result && result <= 2)
|
||||
{
|
||||
cartDto.costFreight = intraCityServiceBy2Km;
|
||||
}
|
||||
else if (result > 2 && result <= 5)
|
||||
{
|
||||
cartDto.costFreight = intraCityServiceBy5Km;
|
||||
}
|
||||
else if (result > 5 && result <= 10)
|
||||
{
|
||||
cartDto.costFreight = intraCityServiceBy5Km;
|
||||
}
|
||||
else if (result > 10 && result <= 15)
|
||||
{
|
||||
cartDto.costFreight = intraCityServiceBy5Km;
|
||||
}
|
||||
else if (result > 15 && result <= 20)
|
||||
{
|
||||
cartDto.costFreight = intraCityServiceBy5Km;
|
||||
}
|
||||
else
|
||||
{
|
||||
cartDto.costFreight = 0;
|
||||
}
|
||||
cartDto.amount = Math.Round(cartDto.amount + cartDto.costFreight, 2);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -760,7 +838,6 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据提交的数据判断哪些购物券可以使用
|
||||
/// <summary>
|
||||
/// 根据提交的数据判断哪些购物券可以使用
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace CoreCms.Net.Services
|
||||
//通过购物车生成订单信息和订单明细信息
|
||||
List<CoreCmsOrderItem> orderItems;
|
||||
var ids = CommonHelper.StringToIntArray(cartIds);
|
||||
var orderRes = await FormatOrder(order, userId, ids, areaId, point, couponCode, false, receiptType, objectId);
|
||||
var orderRes = await FormatOrder(order, userId, ids, areaId, point, couponCode, ushipId, receiptType, objectId);
|
||||
if (!orderRes.status)
|
||||
{
|
||||
return orderRes;
|
||||
@@ -487,17 +487,16 @@ namespace CoreCms.Net.Services
|
||||
/// <param name="areaId">收货地区</param>
|
||||
/// <param name="point">使用积分</param>
|
||||
/// <param name="couponCode">使用优惠券</param>
|
||||
/// <param name="freeFreight">是否包邮</param>
|
||||
/// <param name="userShipId"></param>
|
||||
/// <param name="deliveryType">收货方式,1快递物流,2同城配送,3门店自提</param>
|
||||
/// <param name="groupId">团队明细</param>
|
||||
/// <returns>返回订单明细信息</returns>
|
||||
private async Task<WebApiCallBack> FormatOrder(CoreCmsOrder order, int userId, int[] cartIds, int areaId, int point,
|
||||
string couponCode, bool freeFreight = false, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int groupId = 0)
|
||||
string couponCode, int userShipId = 0, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int groupId = 0)
|
||||
{
|
||||
var res = new WebApiCallBack() { methodDescription = "生成订单信息及明细信息" };
|
||||
|
||||
var cartModel = await _cartServices.GetCartInfos(userId, cartIds, order.orderType, areaId, point, couponCode,
|
||||
freeFreight, deliveryType, groupId);
|
||||
var cartModel = await _cartServices.GetCartInfos(userId, cartIds, order.orderType, areaId, point, couponCode, deliveryType, userShipId, groupId);
|
||||
if (!cartModel.status)
|
||||
{
|
||||
return cartModel;
|
||||
|
||||
@@ -375,6 +375,13 @@
|
||||
"navigationBarTitleText": "修改地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "address/map/map",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "选取街道"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "setting/index/index",
|
||||
"style": {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</u-navbar>
|
||||
<!--幻灯片-->
|
||||
<view class="coreshop-full-screen-banner-swiper-box">
|
||||
<u-swiper height="325" :list="goodsInfo.album" indicator indicatorMode="line" circular @click="clickImg"></u-swiper>
|
||||
<u-swiper height="325" :list="goodsInfo.album" :autoplay="autoplay" indicator indicatorMode="line" circular @click="clickImg"></u-swiper>
|
||||
</view>
|
||||
<!--限时秒杀-->
|
||||
<view class="coreshop-limited-seckill-box coreshop-bg-red">
|
||||
@@ -435,7 +435,8 @@
|
||||
commonQuestion: [],
|
||||
delivery: [],
|
||||
service: [],
|
||||
}
|
||||
},
|
||||
autoplay: true
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -587,6 +588,12 @@
|
||||
let info = res.data;
|
||||
let products = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
|
||||
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
_this.goodsInfo.album.unshift(_this.goodsInfo.video);
|
||||
_this.autoplay = false;
|
||||
}
|
||||
|
||||
_this.isfav = res.data.isFav;
|
||||
_this.product = _this.spesClassHandle(products);
|
||||
|
||||
@@ -611,6 +618,12 @@
|
||||
let info = res.data;
|
||||
let products = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
|
||||
if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
_this.goodsInfo.album.unshift(_this.goodsInfo.video);
|
||||
_this.autoplay = false;
|
||||
}
|
||||
|
||||
_this.isfav = res.data.isFav;
|
||||
_this.product = _this.spesClassHandle(products);
|
||||
|
||||
|
||||
@@ -38,6 +38,33 @@
|
||||
<!-- #endif -->
|
||||
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="选取街道" borderBottom>
|
||||
<!-- 注意:由于兼容性差异,如果需要使用前后插槽,nvue下需使用u--input,非nvue下需使用u-input -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-input :value="form.street" type="text" disabled placeholder="请选择街道">
|
||||
<template slot="suffix">
|
||||
<u-button text="选择" type="success" size="mini" @click="toMap"></u-button>
|
||||
</template>
|
||||
</u-input>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<u--input :value="form.street" type="text" disabled placeholder="请选择街道">
|
||||
<template slot="suffix">
|
||||
<u-button text="选择" type="success" size="mini" @click="toMap"></u-button>
|
||||
</template>
|
||||
</u--input>
|
||||
<!-- #endif -->
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="经度" prop="longitude" borderBottom>
|
||||
<u--input v-model="form.longitude" disabled placeholder="请选择街道获取经度" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="纬度" prop="latitude" disabled borderBottom>
|
||||
<u--input v-model="form.latitude" disabled placeholder="请选择街道获取纬度" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="详细地址" prop="address" borderBottom clearValidate>
|
||||
<u--textarea v-model="form.address" placeholder="请输入内容"></u--textarea>
|
||||
<!--<u--input v-model="form.address" placeholder="请填写收货详细地址" type="textarea" />-->
|
||||
@@ -65,6 +92,9 @@
|
||||
mobile: '',
|
||||
address: '',
|
||||
isDefault: 2,
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
street: ''
|
||||
},
|
||||
region: ['湖南省', '怀化市', '鹤城区'],
|
||||
areaId: 0,
|
||||
@@ -132,7 +162,6 @@
|
||||
//this.pickerValue = this.region[0] + " " + this.region[1] + " " + this.region[2];
|
||||
//this.init();
|
||||
}
|
||||
console.log(this.pickerList);
|
||||
},
|
||||
computed: {},
|
||||
onReady() {
|
||||
@@ -140,7 +169,6 @@
|
||||
},
|
||||
methods: {
|
||||
onConfirm(e) {
|
||||
console.log(e);
|
||||
let provinceName = e[0].label;
|
||||
let cityName = e[1].label;
|
||||
let countyName = e[2].label;
|
||||
@@ -150,7 +178,6 @@
|
||||
cityName: cityName,
|
||||
countyName: countyName
|
||||
}
|
||||
//let regionName = [provinceName, cityName, countyName];
|
||||
this.$u.api.getAreaId(data).then(res => {
|
||||
if (res.status) {
|
||||
this.areaId = res.data;
|
||||
@@ -180,6 +207,9 @@
|
||||
this.pickerValue = this.region[0] + " " + this.region[1] + " " + this.region[2]
|
||||
this.form.address = res.data.address;
|
||||
this.form.isDefault = res.data.isDefault;
|
||||
this.form.longitude = res.data.longitude;
|
||||
this.form.latitude = res.data.latitude;
|
||||
this.form.street = res.data.street;
|
||||
if (res.data.isDefault) {
|
||||
this.checked = true;
|
||||
this.isDefault = 1;
|
||||
@@ -235,8 +265,14 @@
|
||||
} else if (this.areaId <= 0) {
|
||||
this.$u.toast('请选择地区信息')
|
||||
return false
|
||||
} else if (!this.form.address) {
|
||||
this.$u.toast('请输入收货地址详细信息')
|
||||
} else if (!this.form.street) {
|
||||
this.$u.toast('请选择街道')
|
||||
return false
|
||||
} else if (!this.form.latitude) {
|
||||
this.$u.toast('请选择街道获取纬度')
|
||||
return false
|
||||
} else if (!this.form.longitude) {
|
||||
this.$u.toast('请选择街道获取经度')
|
||||
return false
|
||||
}
|
||||
let data = {
|
||||
@@ -244,7 +280,10 @@
|
||||
address: this.form.address,
|
||||
mobile: this.form.mobile,
|
||||
isDefault: this.form.isDefault,
|
||||
areaId: this.areaId
|
||||
areaId: this.areaId,
|
||||
longitude: this.form.longitude,
|
||||
latitude: this.form.latitude,
|
||||
street: this.form.street,
|
||||
}
|
||||
if (this.id && this.id != 0) {
|
||||
//编辑存储
|
||||
@@ -324,8 +363,16 @@
|
||||
init() {
|
||||
this.getFullPath(this.areaId, this.province);
|
||||
this.pickerIndex = [this.provinceKey, this.cityKey, this.areaKey];
|
||||
console.log(this.pickerIndex);
|
||||
},
|
||||
toMap() {
|
||||
if (!this.pickerValue) {
|
||||
this.$u.toast('请先获取省市区信息');
|
||||
return false;
|
||||
} else {
|
||||
this.$u.route('/pages/member/address/map/map', { pickerValue: this.pickerValue, });
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" @click="isSelect(item)">
|
||||
{{item.areaName + item.address}}
|
||||
{{item.areaName }} {{item.street}} {{item.address}}
|
||||
<u-icon name="edit-pen-fill" :size="20" color="#999999" v-show="type != 'order'" @click="toEdit(item.id)"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
@@ -30,13 +30,11 @@
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/address.png'" icon-size="150" text="暂无地址信息" mode="list"></u-empty>
|
||||
</view>
|
||||
<view class="coreshop-bottomBox">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-b" @click="wechatAddress">从微信获取</button>
|
||||
<!-- #endif -->
|
||||
<button class="coreshop-btn coreshop-btn-square coreshop-btn-w" @click="toAdd()">新增收货地址</button>
|
||||
</view>
|
||||
|
||||
<!--按钮-->
|
||||
<view class="coreshop-bg-white coreshop-footer-fixed coreshop-foot-padding-bottom">
|
||||
<u-button class="coreshop-percent-100" type="error" size="normal" @click="toAdd">新增收货地址</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
.controls-location { height: 30px; width: 30px; position: absolute; }
|
||||
.server-place { position: fixed; left: 0; top: 0; height: 100vh; width: 100%; background: #ffffff; z-index: 999;
|
||||
.map-tools { position: fixed; width: 100%; bottom: 30rpx; left: 0; display: flex; justify-content: center; align-items: center; flex-direction: column;
|
||||
.my-location { width: 90%; margin: 0 auto; height: 120rpx; box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.2); background: #fff; border-radius: 20rpx; display: flex; justify-content: flex-start; align-items: center; overflow: hidden;
|
||||
.left { background: #3384ff; height: 120rpx; width: 120rpx; }
|
||||
.right { margin-left: 20rpx; color: #111; display: flex; justify-content: center; align-items: flex-start; flex-direction: column;
|
||||
.title { font-size: 28rpx; font-weight: bold; }
|
||||
.text { font-size: 26rpx; width: 500rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #3384FF; margin-top: 10rpx; }
|
||||
}
|
||||
}
|
||||
|
||||
.start-place { width: 85%; margin: 0 auto; margin: 0 auto; margin-top: 20rpx; box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.2); background: #fff; border-radius: 20rpx; padding: 20rpx;
|
||||
.place { display: flex; justify-content: flex-start; align-items: center;
|
||||
.title { font-size: 28rpx; font-weight: bold; color: #111; }
|
||||
.text { font-size: 28rpx; color: #3384FF; font-weight: bold; width: 450rpx; display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
||||
}
|
||||
.tip { font-size: 22rpx; color: #666; margin-top: 15rpx; }
|
||||
.sure { margin-top: 15rpx; color: #FFFFFF; background: #212121; font-weight: blod; font-size: 32rpx; }
|
||||
}
|
||||
}
|
||||
}
|
||||
292
CoreCms.Net.Uni-App/CoreShop/pages/member/address/map/map.vue
Normal file
292
CoreCms.Net.Uni-App/CoreShop/pages/member/address/map/map.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<view class="server-place">
|
||||
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
||||
<u-navbar title="我的位置" safeAreaInsetTop fixed placeholder>
|
||||
<view class="coreshop-navbar-left-slot" slot="left">
|
||||
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
|
||||
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
||||
<u-icon name="home" size="22" @click="goHome"></u-icon>
|
||||
</view>
|
||||
<view slot="right">
|
||||
</view>
|
||||
</u-navbar>
|
||||
<map id='map'
|
||||
ref='map'
|
||||
v-bind:style="{height: mapH + 'px'}"
|
||||
style="width: 100%;"
|
||||
:latitude="latitude"
|
||||
:longitude="longitude"
|
||||
:controls='controls'
|
||||
:markers="covers"
|
||||
@regionchange='mapChange'>
|
||||
</map>
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<cover-image v-bind:style="{left: controlsLeft + 'px', top: controlsTop + 'px'}" class="controls-location" :src="positionIcon"></cover-image>
|
||||
<!-- #endif -->
|
||||
<view class="map-tools">
|
||||
<view class="my-location" @tap="toMyLocation">
|
||||
<image class="left" :src="myPositionIcon" mode=""></image>
|
||||
<view class="right">
|
||||
<text class="title">我的位置</text>
|
||||
<text class="text">{{myAddress}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="start-place">
|
||||
<view class="place">
|
||||
<text class="title">{{tipText}}:</text>
|
||||
<text class="text">{{addressObj.address}}</text>
|
||||
</view>
|
||||
<view class="tip">{{descText}}</view>
|
||||
<button @tap="submitAdress" class="sure" type="primary">确认选择</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var QQMapWX = require('./qqmap-wx-jssdk.min.js')
|
||||
var qqmapsdk = new QQMapWX({
|
||||
key: 'SJTBZ-6H5C2-3F5UG-CCJIS-RZPXJ-I6FBY'
|
||||
})
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mapH: 0,// 地图高度,可在initMapH()中设置高度
|
||||
mapW: 0, // 屏幕宽度
|
||||
longitude: 0, // 初始经度
|
||||
latitude: 0, // 初始纬度
|
||||
myAddress: '', // 初始地址信息
|
||||
addressObj: { // 地图选点信息
|
||||
longitude: '',
|
||||
latitude: '',
|
||||
address: ''
|
||||
},
|
||||
|
||||
// cover-image的默认 超出屏幕外 不然会有闪烁出现
|
||||
controlsLeft: 1000,
|
||||
controlsTop: 1000,
|
||||
controls: [], // 地图中心点图标, 可更换iconPath, 详情见官方文档关于map组件的介绍
|
||||
|
||||
tipText: '选择位置',
|
||||
descText: '使用当前定位或在地图上标记位置',
|
||||
positionIcon: 'https://files.cdn.coreshop.cn/static/images/map/positionIcon.png',
|
||||
myPositionIcon: 'https://files.cdn.coreshop.cn/static/images/map/myPositionIcon.png',
|
||||
|
||||
covers: [{
|
||||
'longitude': 0,
|
||||
'latitude': 0
|
||||
}],
|
||||
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e);
|
||||
this.getLocation()
|
||||
this.initMapH()
|
||||
this.initPositionIcon();
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 初始化地图中心位置的定位图片
|
||||
initPositionIcon() {
|
||||
setTimeout(() => {
|
||||
// H5 微信小程序 使用<cover-image>
|
||||
// #ifndef APP-PLUS
|
||||
this.controlsLeft = this.mapW / 2 - 10
|
||||
this.controlsTop = this.mapH / 2
|
||||
// #endif
|
||||
|
||||
// App使用map的controls
|
||||
// #ifdef APP-PLUS
|
||||
var controls = {
|
||||
id: '1',
|
||||
iconPath: this.positionIcon,
|
||||
position: {
|
||||
left: this.mapW / 2 - 10,
|
||||
top: this.mapH / 2 - 100,
|
||||
width: 30,
|
||||
height: 30,
|
||||
},
|
||||
clickable: false
|
||||
}
|
||||
this.controls.push(controls)
|
||||
console.log(this.controls, '==========');
|
||||
// #endif
|
||||
}, 100)
|
||||
},
|
||||
// 查询现在的位置
|
||||
getLocation() {
|
||||
let this_ = this
|
||||
uni.getLocation({
|
||||
// type: 'gcj02', // 返回国测局坐标
|
||||
geocode: true,
|
||||
success: function (res) {
|
||||
this_.initMap(res)
|
||||
console.log(res);
|
||||
},
|
||||
fail: function (e) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '获取地址失败, 请检查是否开启定位权限~~'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 初始化我的位置
|
||||
async initMap(res) {
|
||||
this.longitude = res.longitude;
|
||||
this.latitude = res.latitude;
|
||||
this.myAddress = await this.getAddressName(res);
|
||||
|
||||
this.addressObj = Object.assign({}, this.addressObj, {
|
||||
longitude: res.longitude,
|
||||
latitude: res.latitude,
|
||||
address: this.myAddress
|
||||
})
|
||||
},
|
||||
// 地图选择位置后 查询地点名称
|
||||
async checkMap(res) {
|
||||
this.addressObj = Object.assign({}, this.addressObj, {
|
||||
longitude: res.longitude,
|
||||
latitude: res.latitude,
|
||||
address: await this.getAddressName(res)
|
||||
})
|
||||
console.log('当前位置:' + res.latitude + '|' + res.longitude);
|
||||
},
|
||||
|
||||
// 监听地图位置变化
|
||||
mapChange(e) {
|
||||
let that = this
|
||||
clearTimeout(this.timer)
|
||||
this.timer = setTimeout(() => {
|
||||
if (e.type == 'regionchange' || e.type == 'end') {
|
||||
that.mapCtx = uni.createMapContext('map', this)
|
||||
that.mapCtx.getCenterLocation({
|
||||
success: res => {
|
||||
this.checkMap(res)
|
||||
console.log(res);
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 200)
|
||||
},
|
||||
// 查询地图中心点的名称
|
||||
getAddressName(addressObj) {
|
||||
return new Promise((res) => {
|
||||
// #ifdef APP-PLUS
|
||||
qqmapsdk.reverseGeocoder({
|
||||
location: {
|
||||
latitude: addressObj.latitude,
|
||||
longitude: addressObj.longitude
|
||||
},
|
||||
get_poi: 1,
|
||||
poi_options: "page_size=1;page_index=1",
|
||||
output: 'jsonp',
|
||||
success: (e) => {
|
||||
res(e.result.formatted_addresses.recommend);
|
||||
},
|
||||
fail: err => {
|
||||
res(err);
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
// ======================== jsonp跨域 ========================
|
||||
const KEY = 'SJTBZ-6H5C2-3F5UG-CCJIS-RZPXJ-I6FBY'
|
||||
let locationObj = addressObj.latitude + ',' + addressObj.longitude
|
||||
let url = 'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1';
|
||||
this.$jsonp(url, {
|
||||
key: KEY,
|
||||
location: locationObj
|
||||
}).then(e => {
|
||||
res(e.result.formatted_addresses.recommend);
|
||||
})
|
||||
.catch(err => {
|
||||
res(err);
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
console.log(addressObj, '======================');
|
||||
qqmapsdk.reverseGeocoder({
|
||||
location: {
|
||||
latitude: addressObj.latitude,
|
||||
longitude: addressObj.longitude
|
||||
},
|
||||
get_poi: 1,
|
||||
poi_options: "page_size=1;page_index=1",
|
||||
output: 'jsonp',
|
||||
success: (e) => {
|
||||
res(e.result.formatted_addresses.recommend);
|
||||
},
|
||||
fail: err => {
|
||||
res(err);
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
|
||||
},
|
||||
// 计算地图的高度
|
||||
initMapH() {
|
||||
// #ifdef APP-PLUS
|
||||
this.mapW = uni.getSystemInfoSync().windowWidth
|
||||
this.mapH = uni.getSystemInfoSync().windowHeight - 210;
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.mapW = uni.getSystemInfoSync().windowWidth
|
||||
this.mapH = uni.getSystemInfoSync().windowHeight - 170;
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.mapW = uni.getSystemInfoSync().windowWidth
|
||||
this.mapH = uni.getSystemInfoSync().windowHeight - 210;
|
||||
// #endif
|
||||
},
|
||||
// 移动到我的位置
|
||||
toMyLocation() {
|
||||
this.getLocation()
|
||||
},
|
||||
// 提交
|
||||
submitAdress() {
|
||||
console.log(this.addressObj);
|
||||
this.controls = []
|
||||
//setTimeout(() => {
|
||||
// this.$emit('updateAddress', this.addressObj)
|
||||
//}, 100)
|
||||
|
||||
let pages = getCurrentPages();//当前页
|
||||
let beforePage = pages[pages.length - 2];//上个页面
|
||||
|
||||
// #ifdef MP-ALIPAY || MP-TOUTIAO
|
||||
this.$db.set('addressObj', this.addressObj, true);
|
||||
// #endif
|
||||
|
||||
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE
|
||||
this.$store.commit("addressObj", this.addressObj)
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
beforePage.$vm.form.longitude = this.addressObj.longitude;
|
||||
beforePage.$vm.form.latitude = this.addressObj.latitude;
|
||||
beforePage.$vm.form.street = this.addressObj.address;
|
||||
// #endif
|
||||
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "map.scss";
|
||||
</style>
|
||||
1
CoreCms.Net.Uni-App/CoreShop/pages/member/address/map/qqmap-wx-jssdk.min.js
vendored
Normal file
1
CoreCms.Net.Uni-App/CoreShop/pages/member/address/map/qqmap-wx-jssdk.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -30,7 +30,7 @@
|
||||
<text class="coreshop-margin-left-10">{{ userShip.mobile || ''}}</text>
|
||||
</view>
|
||||
<view class="coreshop-text-gray coreshop-font-sm flex">
|
||||
<view class="u-line-1">{{ userShip.areaName || ''}} {{userShip.address || ''}}</view>
|
||||
<view class="u-line-2">{{ userShip.areaName || ''}} {{userShip.street || ''}} {{userShip.address || ''}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action coreshop-text-gray">
|
||||
@@ -65,7 +65,7 @@
|
||||
<text class="coreshop-margin-left-10">{{store.mobile|| ''}}</text>
|
||||
</view>
|
||||
<view class="coreshop-text-gray coreshop-font-sm flex">
|
||||
<view class="u-line-1">{{store.address|| ''}}</view>
|
||||
<view class="u-line-2">{{store.address|| ''}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action coreshop-text-gray">
|
||||
@@ -263,6 +263,7 @@
|
||||
receiptType: 1, // 订单类型 1快递物流发货订单,2同城配送,3是门店自提订单
|
||||
params: {
|
||||
ids: 0, // 传递过来的购物车id
|
||||
userShipId: 0,
|
||||
areaId: 0, // 收货地址id
|
||||
couponCode: '', // 优惠券码列表(string)多张逗号分隔
|
||||
point: 0,// 抵扣积分额
|
||||
@@ -352,6 +353,7 @@
|
||||
let userShip = this.$db.get('addressUserShip', true);
|
||||
if (userShip) {
|
||||
this.userShip = userShip;
|
||||
this.params.userShipId = userShip.id;
|
||||
this.params.areaId = userShip.areaId;
|
||||
this.$db.del('addressUserShip', true);
|
||||
}
|
||||
@@ -370,6 +372,7 @@
|
||||
let userShip = this.$store.state.userShip;
|
||||
if (userShip) {
|
||||
this.userShip = userShip;
|
||||
this.params.userShipId = userShip.id;
|
||||
this.params.areaId = userShip.areaId;
|
||||
}
|
||||
let userInvoice = this.$store.state.invoice;
|
||||
@@ -445,6 +448,7 @@
|
||||
this.$u.api.userDefaultShip().then(res => {
|
||||
if (res.status && res.data && Object.keys(res.data).length) {
|
||||
this.userShip = res.data
|
||||
this.params.userShipId = this.userShip.id;
|
||||
this.params.areaId = this.userShip.areaId
|
||||
|
||||
this.storePick.name = res.data.name;
|
||||
|
||||
83
CoreCms.Net.Utility/Helper/MapHelper.cs
Normal file
83
CoreCms.Net.Utility/Helper/MapHelper.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CoreCms.Net.Utility.Helper
|
||||
{
|
||||
/// <summary>
|
||||
/// 通过地图上的两个坐标计算距离(C#版本)
|
||||
/// Add by 成长的小猪(Jason.Song) on 2017/11/01
|
||||
/// http://blog.csdn.net/jasonsong2008
|
||||
/// </summary>
|
||||
public class MapHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 地球半径
|
||||
/// </summary>
|
||||
private const double EarthRadius = 6378.137;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 经纬度转化成弧度
|
||||
/// Add by 成长的小猪(Jason.Song) on 2017/11/01
|
||||
/// http://blog.csdn.net/jasonsong2008
|
||||
/// </summary>
|
||||
/// <param name="d"></param>
|
||||
/// <returns></returns>
|
||||
private static double Rad(double d)
|
||||
{
|
||||
return d * Math.PI / 180d;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 计算两个坐标点之间的距离
|
||||
/// Add by 成长的小猪(Jason.Song) on 2017/11/01
|
||||
/// http://blog.csdn.net/jasonsong2008
|
||||
/// </summary>
|
||||
/// <param name="firstLatitude">第一个坐标的纬度</param>
|
||||
/// <param name="firstLongitude">第一个坐标的经度</param>
|
||||
/// <param name="secondLatitude">第二个坐标的纬度</param>
|
||||
/// <param name="secondLongitude">第二个坐标的经度</param>
|
||||
/// <returns>返回两点之间的距离,单位:公里/千米</returns>
|
||||
public static double GetDistance(double firstLatitude, double firstLongitude, double secondLatitude, double secondLongitude)
|
||||
{
|
||||
var firstRadLat = Rad(firstLatitude);
|
||||
var firstRadLng = Rad(firstLongitude);
|
||||
var secondRadLat = Rad(secondLatitude);
|
||||
var secondRadLng = Rad(secondLongitude);
|
||||
|
||||
|
||||
var a = firstRadLat - secondRadLat;
|
||||
var b = firstRadLng - secondRadLng;
|
||||
var cal = 2 * Math.Asin(Math.Sqrt(Math.Pow(Math.Sin(a / 2), 2) + Math.Cos(firstRadLat)
|
||||
* Math.Cos(secondRadLat) * Math.Pow(Math.Sin(b / 2), 2))) * EarthRadius;
|
||||
var result = Math.Round(cal * 10000) / 10000;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 计算两个坐标点之间的距离
|
||||
/// Add by 成长的小猪(Jason.Song) on 2017/11/01
|
||||
/// http://blog.csdn.net/jasonsong2008
|
||||
/// </summary>
|
||||
/// <param name="firstPoint">第一个坐标点的(纬度,经度)</param>
|
||||
/// <param name="secondPoint">第二个坐标点的(纬度,经度)</param>
|
||||
/// <returns>返回两点之间的距离,单位:公里/千米</returns>
|
||||
public static double GetPointDistance(string firstPoint, string secondPoint)
|
||||
{
|
||||
var firstArray = firstPoint.Split(',');
|
||||
var secondArray = secondPoint.Split(',');
|
||||
var firstLatitude = Convert.ToDouble(firstArray[0].Trim());
|
||||
var firstLongitude = Convert.ToDouble(firstArray[1].Trim());
|
||||
var secondLatitude = Convert.ToDouble(secondArray[0].Trim());
|
||||
var secondLongitude = Convert.ToDouble(secondArray[1].Trim());
|
||||
return GetDistance(firstLatitude, firstLongitude, secondLatitude, secondLongitude);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -554,7 +554,7 @@
|
||||
后端常用方法
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsArticleServices,CoreCms.Net.IServices.ICoreCmsFormServices,CoreCms.Net.IServices.ICoreCmsArticleTypeServices,CoreCms.Net.IServices.ICoreCmsNoticeServices,CoreCms.Net.IServices.ICoreCmsPinTuanRuleServices,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ISysUserServices,CoreCms.Net.IServices.ISysRoleServices,CoreCms.Net.IServices.ISysMenuServices,CoreCms.Net.IServices.ISysUserRoleServices,CoreCms.Net.IServices.ISysOrganizationServices,CoreCms.Net.IServices.ICodeGeneratorServices,CoreCms.Net.IServices.ICoreCmsLogisticsServices,CoreCms.Net.IServices.ISysLoginRecordServices,CoreCms.Net.IServices.ISysNLogRecordsServices,CoreCms.Net.IServices.ICoreCmsBillPaymentsServices,CoreCms.Net.IServices.ICoreCmsBillDeliveryServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsBillAftersalesServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsServicesServices,Microsoft.Extensions.Options.IOptions{CoreCms.Net.Model.ViewModels.Options.FilesStorageOptions},CoreCms.Net.IServices.ISysRoleMenuServices,CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.IToolsServices)">
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.#ctor(CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsArticleServices,CoreCms.Net.IServices.ICoreCmsFormServices,CoreCms.Net.IServices.ICoreCmsArticleTypeServices,CoreCms.Net.IServices.ICoreCmsNoticeServices,CoreCms.Net.IServices.ICoreCmsPinTuanRuleServices,CoreCms.Net.IServices.ICoreCmsPromotionServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.ISysUserServices,CoreCms.Net.IServices.ISysRoleServices,CoreCms.Net.IServices.ISysMenuServices,CoreCms.Net.IServices.ISysUserRoleServices,CoreCms.Net.IServices.ISysOrganizationServices,CoreCms.Net.IServices.ICoreCmsLogisticsServices,CoreCms.Net.IServices.ISysLoginRecordServices,CoreCms.Net.IServices.ISysNLogRecordsServices,CoreCms.Net.IServices.ICoreCmsBillPaymentsServices,CoreCms.Net.IServices.ICoreCmsBillDeliveryServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsBillAftersalesServices,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsServicesServices,CoreCms.Net.IServices.ISysRoleMenuServices,CoreCms.Net.WeChat.Service.HttpClients.IWeChatApiHttpClientFactory,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.IToolsServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
@@ -783,6 +783,24 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.MiNiShopOpenComponent2_UploadImgByUrl(CoreCms.Net.Model.FromBody.FMStringId)">
|
||||
<summary>
|
||||
自定义交易组件上传图片(Url交换)
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.MiNiShopOpenComponent2_UploadImgByUrlArr(CoreCms.Net.Model.FromBody.FMArrayStringIds)">
|
||||
<summary>
|
||||
自定义交易组件上传图片(Url交换)
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.ToolsController.MiNiShopOpenComponent2_UploadImgByUrlSingle(CoreCms.Net.Model.FromBody.FMStringId)">
|
||||
<summary>
|
||||
自定义交易组件上传图片(Url交换单张)
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.CoreCmsDistributionController">
|
||||
<summary>
|
||||
分销商表
|
||||
|
||||
@@ -160,8 +160,9 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" for="video">视频:</label>
|
||||
<div class="layui-input-inline layui-inline-10">
|
||||
<input name="goods[video]" size="15" autocomplete="off" class="layui-input" lay-reqText="请输入【视频地址】" />
|
||||
<input name="goods[video]" size="15" autocomplete="off" class="layui-input" id="videoInput" lay-reqText="请输入【视频地址】" />
|
||||
</div>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upVideoBtn"><i class="layui-icon"></i>上传视频</button>
|
||||
<div class="layui-form-mid">支持常用视频播放格式。</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1229,6 +1230,28 @@
|
||||
}
|
||||
});
|
||||
|
||||
//视频上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upVideoBtn'
|
||||
, accept: 'video'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$("#videoInput").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
}
|
||||
});
|
||||
|
||||
//提交操作
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-CoreCmsGoods-createForm-submit)',
|
||||
|
||||
@@ -155,8 +155,9 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" for="video">视频:</label>
|
||||
<div class="layui-input-inline layui-inline-10">
|
||||
<input name="goods[video]" size="15" autocomplete="off" class="layui-input" value="{{d.data.model.video ||'' }}" lay-reqText="请输入【视频地址】" />
|
||||
<input name="goods[video]" size="15" autocomplete="off" class="layui-input" id="videoInput" value="{{d.data.model.video ||'' }}" lay-reqText="请输入【视频地址】" />
|
||||
</div>
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upVideoBtn"><i class="layui-icon"></i>上传视频</button>
|
||||
<div class="layui-form-mid">支持常用视频播放格式。</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1333,6 +1334,28 @@
|
||||
}
|
||||
});
|
||||
|
||||
//视频上传
|
||||
var uploadInst = upload.render({
|
||||
elem: '#upVideoBtn'
|
||||
, accept: 'video'
|
||||
, url: layui.setter.apiUrl + 'Api/Tools/UploadFiles'
|
||||
, before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
layer.msg('上传中', { icon: 16, shade: 0.4 });
|
||||
});
|
||||
}
|
||||
, done: function (res) {
|
||||
layer.closeAll('loading'); //关闭加载层
|
||||
if (res.code > 0) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
layer.msg('上传成功');
|
||||
$("#videoInput").val(res.data.fileUrl);
|
||||
}
|
||||
, error: function () {
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(LAY-app-CoreCmsGoods-editForm-submit)',
|
||||
function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
@@ -388,6 +388,46 @@
|
||||
先分销后代理:指先计算是否三级分销满足,满足则只计算三级分级分销,如果不满足再继续执行代理分佣逻辑。<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<blockquote class="layui-elem-quote">
|
||||
同城配送运费设置
|
||||
</blockquote>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['intraCityServiceBy2KM']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="number" min="0" max="999999" name="intraCityServiceBy2KM" value="{{d.data.configs['intraCityServiceBy2KM']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" list="defaultNumbers">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">2公里以内</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['intraCityServiceBy5KM']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="number" min="0" max="999999" name="intraCityServiceBy5KM" value="{{d.data.configs['intraCityServiceBy5KM']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" list="defaultNumbers">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">2-5公里以内</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['intraCityServiceBy10KM']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="number" min="0" max="999999" name="intraCityServiceBy10KM" value="{{d.data.configs['intraCityServiceBy10KM']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" list="defaultNumbers">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">5-10公里以内</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['intraCityServiceBy15KM']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="number" min="0" max="999999" name="intraCityServiceBy15KM" value="{{d.data.configs['intraCityServiceBy15KM']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" list="defaultNumbers">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">10-15公里以内</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">{{d.data.configs['intraCityServiceBy20KM']['sKey']}}:</label>
|
||||
<div class="layui-input-inline layui-inline-2">
|
||||
<input type="number" min="0" max="999999" name="intraCityServiceBy20KM" value="{{d.data.configs['intraCityServiceBy20KM']['sValue']}}" lay-verify="title|number" autocomplete="off" placeholder="请输入正整数" class="layui-input" list="defaultNumbers">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">15-20公里以内</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"> </label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
using CoreCms.Net.Auth.HttpContextUser;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
|
||||
namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
@@ -73,10 +73,9 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
public async Task<WebApiCallBack> GetList([FromBody] FMCartGetList entity)
|
||||
{
|
||||
var ids = CommonHelper.StringToIntArray(entity.ids);
|
||||
//判断免费运费
|
||||
var freeFreight = entity.receiptType != 1;
|
||||
|
||||
//获取数据
|
||||
var jm = await _cartServices.GetCartInfos(_user.ID, ids, entity.type, entity.areaId, entity.point, entity.couponCode, freeFreight, entity.receiptType, entity.objectId);
|
||||
var jm = await _cartServices.GetCartInfos(_user.ID, ids, entity.type, entity.areaId, entity.point, entity.couponCode, entity.receiptType, entity.userShipId, entity.objectId);
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -139,5 +138,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
|
||||
#endregion 根据提交的数据判断哪些购物券可以使用==================================================
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,8 @@ using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using CoreCms.Net.WeChat.Service.Enums;
|
||||
@@ -85,12 +85,14 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
private readonly ICoreCmsStoreServices _storeServices;
|
||||
private readonly ICoreCmsCouponServices _couponServices;
|
||||
private readonly ICoreCmsOrderServices _orderServices;
|
||||
|
||||
private readonly IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
|
||||
private readonly WeChatOptions _weChatOptions;
|
||||
|
||||
|
||||
private readonly AsyncLock _mutex = new AsyncLock();
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
@@ -235,7 +237,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//注意:生产环境下SessionKey属于敏感信息,不能进行传输!
|
||||
//return new JsonResult(new { success = true, msg = "OK", sessionAuthId = sessionBag.Key, sessionKey = sessionBag.SessionKey, data = jsonResult, sessionBag = sessionBag });
|
||||
jm.status = true;
|
||||
@@ -271,6 +272,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
jm.msg = "用户信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var decodedEntity = EncryptHelper.DecodeUserInfoBySessionId(userInfo.sessionKey, entity.encryptedData, entity.iv);
|
||||
var token = string.Empty;
|
||||
var userWxId = entity.sessionAuthId;
|
||||
@@ -355,15 +357,16 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
jm.msg = "请输入合法的手机号码";
|
||||
return jm;
|
||||
}
|
||||
if (entity.code == "login")
|
||||
{
|
||||
var shave = await _userServices.ExistsAsync(p => p.mobile == entity.mobile && p.userWx > 0);
|
||||
if (shave)
|
||||
{
|
||||
jm.msg = "手机号码已被绑定,请更换";
|
||||
return jm;
|
||||
}
|
||||
}
|
||||
//此验证貌似没意义。
|
||||
//if (entity.code == "login")
|
||||
//{
|
||||
// var shave = await _userServices.ExistsAsync(p => p.mobile == entity.mobile && p.userWx > 0);
|
||||
// if (shave)
|
||||
// {
|
||||
// jm.msg = "手机号码已被绑定,请更换";
|
||||
// return jm;
|
||||
// }
|
||||
//}
|
||||
jm = await _smsServices.DoSendSms(entity.code, entity.mobile);
|
||||
return jm;
|
||||
}
|
||||
@@ -378,7 +381,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
[HttpPost]
|
||||
public async Task<WebApiCallBack> SmsLogin([FromBody] FMWxAccountCreate entity)
|
||||
{
|
||||
var jm = await _userServices.SmsLogin(entity, 2, entity.platform);
|
||||
var jm = await _userServices.SmsLogin(entity, (int)GlobalEnumVars.LoginType.Sms, entity.platform);
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -428,7 +431,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 用户短信注册并返回jwt token(弃用)======================================================
|
||||
@@ -525,8 +527,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var log = new CoreCmsUserLog();
|
||||
log.userId = id;
|
||||
log.state = (int)GlobalEnumVars.UserLogTypes.注册;
|
||||
log.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ?
|
||||
_httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||
log.ip = _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress != null ? _httpContextAccessor.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString() : "127.0.0.1";
|
||||
log.createTime = DateTime.Now;
|
||||
log.parameters = GlobalEnumVars.UserLogTypes.注册.ToString();
|
||||
await _userLogServices.InsertAsync(log);
|
||||
@@ -602,7 +603,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
/// <summary>
|
||||
/// 统一分享url处理
|
||||
/// 新的分享,不管是二维码,还是地址,都走这个
|
||||
/// page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理
|
||||
/// page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理,12接龙
|
||||
/// url:前端地址
|
||||
/// params:参数,根据场景值不一样而内容不一样
|
||||
/// 1
|
||||
@@ -727,7 +728,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取用户信息
|
||||
/// <summary>
|
||||
/// 获取用户信息
|
||||
@@ -988,6 +988,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
userShip.address = entity.address;
|
||||
userShip.mobile = entity.mobile;
|
||||
userShip.updateTime = DateTime.Now;
|
||||
|
||||
userShip.longitude = entity.longitude;
|
||||
userShip.latitude = entity.latitude;
|
||||
userShip.street = entity.street;
|
||||
|
||||
|
||||
var ship = await _userShipServices.UpdateAsync(userShip);
|
||||
jm.status = true;
|
||||
jm.data = ship;
|
||||
@@ -1008,6 +1014,11 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
userShip.address = entity.address;
|
||||
userShip.mobile = entity.mobile;
|
||||
userShip.createTime = DateTime.Now;
|
||||
|
||||
userShip.longitude = entity.longitude;
|
||||
userShip.latitude = entity.latitude;
|
||||
userShip.street = entity.street;
|
||||
|
||||
var ship = await _userShipServices.InsertAsync(userShip);
|
||||
jm.status = true;
|
||||
jm.data = ship;
|
||||
@@ -1104,7 +1115,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
//生成支付单,并发起支付
|
||||
jm = await _billPaymentsServices.Pay(entity.ids, entity.payment_code, _user.ID, entity.payment_type,
|
||||
entity.@params);
|
||||
|
||||
//NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.RedisMessageQueue, "支付",JsonConvert.SerializeObject(jm));
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -1259,7 +1270,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
[Authorize]
|
||||
public async Task<WebApiCallBack> GetBankCardsOrganization([FromBody] FMStringId entity)
|
||||
{
|
||||
var jm = await _userBankCardServices.BankCardsOrganization(entity.id);
|
||||
var jm =await _userBankCardServices.BankCardsOrganization(entity.id);
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -1316,9 +1327,9 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
if (!string.IsNullOrEmpty(entity.propsDate))
|
||||
{
|
||||
if (entity.propsDate.Contains("-"))
|
||||
if (entity.propsDate.Contains("至"))
|
||||
{
|
||||
var dts = entity.propsDate.Split("-");
|
||||
var dts = entity.propsDate.Split("至");
|
||||
if (dts.Length == 2)
|
||||
{
|
||||
var dt = dts[0].ObjectToDate(DateTime.Now);
|
||||
@@ -1558,7 +1569,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
jm.status = await _goodsBrowsingServices.DeleteAsync(p => p.userId == _user.ID && p.goodsId == entity.id);
|
||||
jm.status = await _goodsBrowsingServices.DeleteAsync(p => p.userId == _user.ID && p.id == entity.id);
|
||||
jm.msg = jm.status ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
@@ -1725,7 +1736,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取我的上级邀请人
|
||||
/// <summary>
|
||||
/// 获取我的上级邀请人
|
||||
@@ -1740,8 +1750,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取我的下级用户数量
|
||||
/// <summary>
|
||||
/// 获取我的下级用户数量
|
||||
@@ -1776,8 +1784,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取用户推荐列表
|
||||
/// <summary>
|
||||
/// 获取用户推荐列表
|
||||
@@ -1926,8 +1932,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
foreach (var item in orders)
|
||||
{
|
||||
item.service = services.Find(p => p.id == item.servicesId);
|
||||
item.statusStr =
|
||||
EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.ServicesOrderStatus>(item.status);
|
||||
item.statusStr = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.ServicesOrderStatus>(item.status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -954,7 +954,7 @@
|
||||
<summary>
|
||||
统一分享url处理
|
||||
新的分享,不管是二维码,还是地址,都走这个
|
||||
page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理
|
||||
page 场景值 1店铺首页,2商品详情页,3拼团详情页,4邀请好友(店铺页面,params里需要传store),5文章页面,6参团页面,7自定义页面,8智能表单,9团购,10秒杀,11代理,12接龙
|
||||
url:前端地址
|
||||
params:参数,根据场景值不一样而内容不一样
|
||||
1
|
||||
|
||||
BIN
数据库/MySql/20220212/coreshop20220212完整脚本.rar
Normal file
BIN
数据库/MySql/20220212/coreshop20220212完整脚本.rar
Normal file
Binary file not shown.
3
数据库/MySql/20220212/升级脚本.sql
Normal file
3
数据库/MySql/20220212/升级脚本.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE CoreCmsUserShip ADD COLUMN latitude VARCHAR(50) DEFAULT NULL COMMENT '纬度' AFTER updateTime;
|
||||
ALTER TABLE CoreCmsUserShip ADD COLUMN longitude VARCHAR(50) DEFAULT NULL COMMENT '经度' AFTER latitude;
|
||||
ALTER TABLE CoreCmsUserShip ADD COLUMN street VARCHAR(50) DEFAULT NULL COMMENT '街道' AFTER longitude;
|
||||
@@ -1,3 +1,6 @@
|
||||
2022-02-12
|
||||
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
||||
|
||||
2022-02-11
|
||||
【新增】增加【CoreCmsAgentOrderDetails】表,实现代理佣金订单详情列表功能,精确到具体商品明细。
|
||||
【新增】增加【CoreCmsDistributionOrderDetails】表,实现三级佣金订单详情列表功能,精确到具体商品明细。
|
||||
|
||||
BIN
数据库/SqlServer/20220212/202202112250完整数据库.rar
Normal file
BIN
数据库/SqlServer/20220212/202202112250完整数据库.rar
Normal file
Binary file not shown.
13
数据库/SqlServer/20220212/升级脚本.sql
Normal file
13
数据库/SqlServer/20220212/升级脚本.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
ALTER TABLE [dbo].[CoreCmsUserShip]
|
||||
ADD [longitude] NVARCHAR (50) NULL,
|
||||
[latitude] NVARCHAR (50) NULL,
|
||||
[street] NVARCHAR (50) NULL;
|
||||
|
||||
GO
|
||||
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'纬度', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CoreCmsUserShip', @level2type = N'COLUMN', @level2name = N'latitude';
|
||||
|
||||
GO
|
||||
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'经度', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CoreCmsUserShip', @level2type = N'COLUMN', @level2name = N'longitude';
|
||||
|
||||
GO
|
||||
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'街道', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'CoreCmsUserShip', @level2type = N'COLUMN', @level2name = N'street';
|
||||
@@ -1,3 +1,6 @@
|
||||
2022-02-12
|
||||
【新增】表【CoreCmsUserShip】增加【精度longitude】【纬度latitude】【街道street】三字段。
|
||||
|
||||
2022-02-11
|
||||
【新增】增加【CoreCmsAgentOrderDetails】表,实现代理佣金订单详情列表功能,精确到具体商品明细。
|
||||
【新增】增加【CoreCmsDistributionOrderDetails】表,实现三级佣金订单详情列表功能,精确到具体商品明细。
|
||||
|
||||
Reference in New Issue
Block a user