mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 14:53:26 +08:00
【新增】新增微信扫码支付功能,对接PC端。
【新增】增加DTO类库,将逐步完善dto层。 【修复】修复【分类】切换后,切换回来未清零原始数据,导致更新数据重复的问题。 【调整】移除模板库功能,防止出现审核因为模板库页面存在而导致的审核失败。暂将模板库的代码存放到会员QQ群内,方便下载使用。 【调整】代码生成器【Repository.tpl】移除Cache手动增删改,【SqlSugarSetup】增加sqlsugar自动检测增删改后清理二级缓存。 【调整】后端新增秒杀独立组件,用于区分团购及秒杀的差异,首页新增秒杀组件。 【优化】重写首页所有组件样式及接口数据获取效率。 【优化】优化拼团,秒杀,团购,接龙数据获取逻辑,提升列表及详情页面数据获取效率。 【优化】调整拼团,秒杀,团购,服务商品推广海报为新式海报效果。增加服务商品推广海报。 【优化】清理h5相关代码判断,移除h5支付组件,提高响应速度。 【优化】移除小程序前端冗余代码。加快代码执行效率。
This commit is contained in:
@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CoreCms.Net.Repository
|
||||
{% for field in ModelFields %}oldModel.{{field.DbColumnName}} = entity.{{field.DbColumnName}};
|
||||
{% endfor %}
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<{{ModelClassName}}>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<{{ModelClassName}}>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<{{ModelClassName}}>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<{{ModelClassName}}>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -417,19 +417,19 @@ namespace CoreCms.Net.Configuration
|
||||
public enum OrderStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单正常
|
||||
/// 进行中
|
||||
/// </summary>
|
||||
[Description("<button type='button' class='layui-btn layui-btn-normal layui-btn-xs'>订单正常</button>")]
|
||||
[Description("<button type='button' class='layui-btn layui-btn-normal layui-btn-xs'>进行中</button>")]
|
||||
Normal = 1,
|
||||
/// <summary>
|
||||
/// 订单完成
|
||||
/// 已完结
|
||||
/// </summary>
|
||||
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-xs'>订单完成</button>")]
|
||||
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-xs'>已完结</button>")]
|
||||
Complete = 2,
|
||||
/// <summary>
|
||||
/// 订单取消
|
||||
/// 已取消
|
||||
/// </summary>
|
||||
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-disabled layui-btn-xs'>订单取消</button>")]
|
||||
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-disabled layui-btn-xs'>已取消</button>")]
|
||||
Cancel = 3
|
||||
}
|
||||
|
||||
@@ -439,19 +439,19 @@ namespace CoreCms.Net.Configuration
|
||||
public enum OrderStatusDescription
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单正常
|
||||
/// 进行中
|
||||
/// </summary>
|
||||
[Description("正常(-)")]
|
||||
[Description("进行中(-)")]
|
||||
Normal = 1,
|
||||
/// <summary>
|
||||
/// 订单完成
|
||||
/// 已完结
|
||||
/// </summary>
|
||||
[Description("完成(√)")]
|
||||
[Description("已完结(√)")]
|
||||
Complete = 2,
|
||||
/// <summary>
|
||||
/// 订单取消
|
||||
/// 已取消
|
||||
/// </summary>
|
||||
[Description("取消(×)")]
|
||||
[Description("已取消(×)")]
|
||||
Cancel = 3
|
||||
}
|
||||
|
||||
@@ -1696,15 +1696,15 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
public enum WeiChatPayTradeType
|
||||
{
|
||||
[Description("JSAPI")]
|
||||
[Description("JSAPI(小程序支付)")]
|
||||
JSAPI = 1,
|
||||
[Description("JSAPI_OFFICIAL")]
|
||||
[Description("JSAPI_OFFICIAL(公众号支付)")]
|
||||
JSAPI_OFFICIAL = 2,
|
||||
[Description("NATIVE")]
|
||||
[Description("NATIVE(扫码支付)")]
|
||||
NATIVE = 3,
|
||||
[Description("APP")]
|
||||
[Description("APP(APP支付)")]
|
||||
APP = 4,
|
||||
[Description("MWEB")]
|
||||
[Description("MWEB(H5支付)")]
|
||||
MWEB = 5
|
||||
}
|
||||
|
||||
@@ -1944,6 +1944,11 @@ namespace CoreCms.Net.Configuration
|
||||
/// </summary>
|
||||
[Description("12接龙")]
|
||||
Solitaire = 12,
|
||||
/// <summary>
|
||||
/// 13服务商品
|
||||
/// </summary>
|
||||
[Description("13服务商品")]
|
||||
ServiceGoods = 13,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Core.Config
|
||||
//判断数据库类型
|
||||
DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,
|
||||
//是否开启自动关闭数据库连接
|
||||
IsAutoCloseConnection = true,
|
||||
IsAutoCloseConnection = true
|
||||
});
|
||||
|
||||
//设置参数
|
||||
@@ -51,6 +51,11 @@ namespace CoreCms.Net.Core.Config
|
||||
//判断是否开启redis设置二级缓存方式
|
||||
DataInfoCacheService = AppSettingsConstVars.RedisUseCache ? (ICacheService)new SqlSugarRedisCache() : new SqlSugarMemoryCache()
|
||||
};
|
||||
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
//所有 增、删 、改 会自动调用.RemoveDataCache()清理二级缓存
|
||||
IsAutoRemoveDataCache = true
|
||||
};
|
||||
|
||||
//执行SQL 错误事件,可监控sql(暂时屏蔽,需要可开启)
|
||||
//db.Aop.OnLogExecuting = (sql, p) =>
|
||||
|
||||
9
CoreCms.Net.DTO/CoreCms.Net.DTO.csproj
Normal file
9
CoreCms.Net.DTO/CoreCms.Net.DTO.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
112
CoreCms.Net.DTO/GroupPurchaseSeckillDTO.cs
Normal file
112
CoreCms.Net.DTO/GroupPurchaseSeckillDTO.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// 秒杀列表返回dto数据层
|
||||
/// </summary>
|
||||
public class GroupPurchaseSeckillDTO
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 序列
|
||||
/// </summary>
|
||||
public System.Int32 id { get; set; }
|
||||
/// <summary>
|
||||
/// 促销名称
|
||||
/// </summary>
|
||||
public System.String name { get; set; }
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public System.Int32 type { get; set; }
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public System.Int32 sort { get; set; }
|
||||
/// <summary>
|
||||
/// 每人限购数量
|
||||
/// </summary>
|
||||
public System.Int32 maxNums { get; set; }
|
||||
/// <summary>
|
||||
/// 每个商品活动数量
|
||||
/// </summary>
|
||||
public System.Int32 maxGoodsNums { get; set; }
|
||||
/// <summary>
|
||||
/// 最大领取数量
|
||||
/// </summary>
|
||||
public System.Int32 maxRecevieNums { get; set; }
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public System.DateTime startTime { get; set; }
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public System.DateTime endTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否排他
|
||||
/// </summary>
|
||||
public System.Boolean isExclusive { get; set; }
|
||||
/// <summary>
|
||||
/// 是否自动领取
|
||||
/// </summary>
|
||||
public System.Boolean isAutoReceive { get; set; }
|
||||
/// <summary>
|
||||
/// 是否开启
|
||||
/// </summary>
|
||||
public System.Boolean isEnable { get; set; }
|
||||
/// <summary>
|
||||
/// 有效天数
|
||||
/// </summary>
|
||||
public System.Int32 effectiveDays { get; set; }
|
||||
/// <summary>
|
||||
/// 有效小时
|
||||
/// </summary>
|
||||
public System.Int32 effectiveHours { get; set; }
|
||||
/// <summary>
|
||||
/// 倒计时
|
||||
/// </summary>
|
||||
public System.Int32 timestamp { get; set; }
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public System.Int32 startStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string goodBrief { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string goodName { get; set; }
|
||||
/// <summary>
|
||||
/// 商品缩略图
|
||||
/// </summary>
|
||||
public string goodThumbnail { get; set; }
|
||||
/// <summary>
|
||||
/// 商品图集
|
||||
/// </summary>
|
||||
public string goodImages { get; set; }
|
||||
/// <summary>
|
||||
/// 商品库存
|
||||
/// </summary>
|
||||
public int goodStock { get; set; }
|
||||
/// <summary>
|
||||
/// 商品浏览量
|
||||
/// </summary>
|
||||
public int goodViewCount { get; set; }
|
||||
/// <summary>
|
||||
/// 商品单位
|
||||
/// </summary>
|
||||
public string goodUnit { get; set; }
|
||||
/// <summary>
|
||||
/// 商品市场价
|
||||
/// </summary>
|
||||
public decimal mktPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 商品价格
|
||||
/// </summary>
|
||||
public decimal price { get; set; }
|
||||
}
|
||||
}
|
||||
120
CoreCms.Net.DTO/PinTuanListDTO.cs
Normal file
120
CoreCms.Net.DTO/PinTuanListDTO.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace CoreCms.Net.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// 拼团列表返回
|
||||
/// </summary>
|
||||
public class PinTuanListDTO
|
||||
{
|
||||
/// <summary>
|
||||
/// 拼团序列
|
||||
/// </summary>
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 商品序列
|
||||
/// </summary>
|
||||
public System.Int32 goodsId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拼团排序
|
||||
/// </summary>
|
||||
public System.Int32 sortId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拼团名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拼团单数
|
||||
/// </summary>
|
||||
public System.Int32 pinTuanRecordNums { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拼团销量
|
||||
/// </summary>
|
||||
public System.Int32 buyPinTuanCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多少人团
|
||||
/// </summary>
|
||||
public System.Int32 peopleNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 倒计时
|
||||
/// </summary>
|
||||
public System.Int32 timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
public System.DateTime startTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
public System.DateTime endTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 优惠金额
|
||||
/// </summary>
|
||||
public System.Decimal discountAmount { get; set; }
|
||||
/// <summary>
|
||||
/// 每人限购数量
|
||||
/// </summary>
|
||||
public System.Int32 maxNums { get; set; }
|
||||
/// <summary>
|
||||
/// 每个商品活动数量
|
||||
/// </summary>
|
||||
public System.Int32 maxGoodsNums { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public System.Int32 startStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 商品描述
|
||||
/// </summary>
|
||||
public string goodBrief { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string goodName { get; set; }
|
||||
/// <summary>
|
||||
/// 商品缩略图
|
||||
/// </summary>
|
||||
public string goodThumbnail { get; set; }
|
||||
/// <summary>
|
||||
/// 商品图集
|
||||
/// </summary>
|
||||
public string goodImages { get; set; }
|
||||
/// <summary>
|
||||
/// 商品库存
|
||||
/// </summary>
|
||||
public int goodStock { get; set; }
|
||||
/// <summary>
|
||||
/// 商品浏览量
|
||||
/// </summary>
|
||||
public int goodViewCount { get; set; }
|
||||
/// <summary>
|
||||
/// 商品单位
|
||||
/// </summary>
|
||||
public string goodUnit { get; set; }
|
||||
/// <summary>
|
||||
/// 商品市场价
|
||||
/// </summary>
|
||||
public decimal mktPrice { get; set; }
|
||||
/// <summary>
|
||||
/// 拼团价格
|
||||
/// </summary>
|
||||
public decimal pinTuanPrice { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,19 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* CreateTime: 2022/10/24 3:54:14
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
@@ -18,5 +25,28 @@ namespace CoreCms.Net.IRepository
|
||||
/// </summary>
|
||||
public interface ICoreCmsArticleTypeRepository : IBaseRepository<CoreCmsArticleType>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(CoreCmsArticleType entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(CoreCmsArticleType entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CoreCms.Net.DTO\CoreCms.Net.DTO.csproj" />
|
||||
<ProjectReference Include="..\CoreCms.Net.Model\CoreCms.Net.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -170,5 +170,18 @@ namespace CoreCms.Net.IRepository
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<EnumEntity>> QueryEnumEntityAsync();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取商品及默认货品信息
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderByPredicate"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsGoods>> QueryGoodWithDefaultProductAsync(Expression<Func<CoreCmsGoods, bool>> predicate,
|
||||
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
@@ -53,5 +54,20 @@ namespace CoreCms.Net.IRepository
|
||||
/// <param name="ruleId">规则序列</param>
|
||||
/// <returns></returns>
|
||||
Task<TagPinTuanResult> GetPinTuanInfo(int ruleId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据规则ID数组获取拼团相关信息
|
||||
/// </summary>
|
||||
/// <param name="ruleIds">规则序列</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
Task<IPageList<PinTuanListDTO>> GetPinTuanInfos(int[] ruleIds,
|
||||
Expression<Func<PinTuanListDTO, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,16 +38,10 @@ namespace CoreCms.Net.IRepository
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表首页用
|
||||
/// 获取首页组件数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate,
|
||||
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20);
|
||||
Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate);
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,18 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* CreateTime: 2022/10/24 3:54:14
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
@@ -17,5 +24,27 @@ namespace CoreCms.Net.IServices
|
||||
/// </summary>
|
||||
public interface ICoreCmsArticleTypeServices : IBaseServices<CoreCmsArticleType>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> InsertAsync(CoreCmsArticleType entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> UpdateAsync(CoreCmsArticleType entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CoreCms.Net.Configuration\CoreCms.Net.Configuration.csproj" />
|
||||
<ProjectReference Include="..\CoreCms.Net.DTO\CoreCms.Net.DTO.csproj" />
|
||||
<ProjectReference Include="..\CoreCms.Net.Model\CoreCms.Net.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -114,8 +114,7 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="groupId"></param>
|
||||
/// <param name="needSku"></param>
|
||||
/// <returns></returns>
|
||||
Task<CoreCmsGoods> GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods",
|
||||
int groupId = 0, bool needSku = false);
|
||||
Task<CoreCmsGoods> GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0, bool needSku = false);
|
||||
|
||||
/// <summary>
|
||||
/// 通过商品序列获取sku列表
|
||||
@@ -263,5 +262,18 @@ namespace CoreCms.Net.IServices
|
||||
Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取商品及默认货品信息
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderByPredicate"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsGoods>> QueryGoodWithDefaultProductAsync(Expression<Func<CoreCmsGoods, bool>> predicate,
|
||||
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
@@ -37,7 +38,7 @@ namespace CoreCms.Net.IServices
|
||||
/// 接口上获取拼团所有商品
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> GetPinTuanList(int userId = 0);
|
||||
Task<WebApiCallBack> GetPinTuanList(int userId = 0, int pageIndex = 1, int pageSize = 20);
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -60,5 +61,20 @@ namespace CoreCms.Net.IServices
|
||||
/// <param name="ruleId">规则序列</param>
|
||||
/// <returns></returns>
|
||||
Task<TagPinTuanResult> GetPinTuanInfo(int ruleId);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据规则ID数组获取拼团相关信息
|
||||
/// </summary>
|
||||
/// <param name="ruleIds">规则序列</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
Task<IPageList<PinTuanListDTO>> GetPinTuanInfos(int[] ruleIds,
|
||||
Expression<Func<PinTuanListDTO, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20);
|
||||
}
|
||||
}
|
||||
@@ -51,13 +51,13 @@ namespace CoreCms.Net.IServices
|
||||
/// 获取团购列表数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> GetGroupList(int type, int userId, int status, int pageIndex, int pageSize);
|
||||
Task<WebApiCallBack> GetGroupList(int type, int status, int pageIndex, int pageSize);
|
||||
|
||||
/// <summary>
|
||||
/// 获取团购/秒杀商品详情
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> GetGroupDetail(int goodId = 0, int userId = 0, int type = (int)GlobalEnumVars.PromotionType.Group, int groupId = 0, bool needSku = false);
|
||||
Task<WebApiCallBack> GetGroupDetail(int goodId, int userId, int type, bool needSku);
|
||||
|
||||
/// <summary>
|
||||
/// 获取可领取的优惠券
|
||||
|
||||
@@ -38,16 +38,10 @@ namespace CoreCms.Net.IServices
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表首页用
|
||||
/// 获取首页组件数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate,
|
||||
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20);
|
||||
Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate);
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities
|
||||
/// </summary>
|
||||
[Display(Name = "促销ID")]
|
||||
[SugarColumn(ColumnDescription = "促销ID", IsNullable = true)]
|
||||
public System.Int32? promotionId { get; set; }
|
||||
public System.Int32 promotionId { get; set; }
|
||||
/// <summary>
|
||||
/// 促销条件编码
|
||||
/// </summary>
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities
|
||||
/// </summary>
|
||||
[Display(Name = "促销ID")]
|
||||
[SugarColumn(ColumnDescription = "促销ID", IsNullable = true)]
|
||||
public System.Int32? promotionId { get; set; }
|
||||
public System.Int32 promotionId { get; set; }
|
||||
/// <summary>
|
||||
/// 促销条件编码
|
||||
/// </summary>
|
||||
|
||||
@@ -26,6 +26,13 @@ namespace CoreCms.Net.Model.Entities
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int timestamp { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 开启状态
|
||||
/// </summary>
|
||||
[Display(Name = "开启状态")]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int openStatus { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 允许购买用户等级
|
||||
/// </summary>
|
||||
|
||||
@@ -38,17 +38,16 @@ namespace CoreCms.Net.Model.FromBody
|
||||
public int status { get; set; } = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取团购秒杀商品详情
|
||||
/// </summary>
|
||||
|
||||
public class FMGetGoodsDetial
|
||||
{
|
||||
public int id { get; set; }
|
||||
public int groupId { get; set; }
|
||||
|
||||
public int type { get; set; }
|
||||
|
||||
public bool needSku { get; set; } = false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
|
||||
public int areaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 购物车货品数据
|
||||
/// 购物车序列
|
||||
/// </summary>
|
||||
public string cartIds { get; set; }
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
|
||||
public int storeId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型,1是普通订单,2是拼团订单
|
||||
/// 订单类型[对应CoreCmsOrder表orderType字段]/也对应购物车cart订单类型
|
||||
/// </summary>
|
||||
public int orderType { get; set; } = 1;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
|
||||
public decimal orderMoney { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 购物车货品序列号
|
||||
/// 购物车序列号
|
||||
/// </summary>
|
||||
public string ids { get; set; }
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
|
||||
var bl = id > 0;
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
@@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
if (entity.isDefault)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsAgentGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsAgentGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
return jm;
|
||||
@@ -106,7 +106,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.description = entity.description;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
@@ -114,7 +114,7 @@ namespace CoreCms.Net.Repository
|
||||
//其他处理
|
||||
if (entity.isDefault)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsAgentGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsAgentGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace CoreCms.Net.Repository
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await DbClient.Deleteable<CoreCmsAgentProducts>().Where(p => p.agentGradeId == id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
await DbClient.Deleteable<CoreCmsAgentProducts>().Where(p => p.agentGradeId == id).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
entity.createTime = DateTime.Now;
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.storeId = entity.storeId;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsPrinter>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsPrinter>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -4,13 +4,22 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* CreateTime: 2022/10/24 3:54:14
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
@@ -19,8 +28,72 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
public class CoreCmsArticleTypeRepository : BaseRepository<CoreCmsArticleType>, ICoreCmsArticleTypeRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsArticleTypeRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsArticleType>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
//oldModel.id = entity.id;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.parentId = entity.parentId;
|
||||
oldModel.sort = entity.sort;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsArticleType>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -66,8 +66,8 @@ namespace CoreCms.Net.Repository
|
||||
_unitOfWork.BeginTran();
|
||||
|
||||
//先清理掉数据,因为是配置数据,可直接删除添加新的
|
||||
await DbClient.Deleteable<CoreCmsContinuousCheckInRules>().Where(p => p.id > 0).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsContinuousCheckInRuleDetails>().Where(p => p.id > 0).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsContinuousCheckInRules>().Where(p => p.id > 0).ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsContinuousCheckInRuleDetails>().Where(p => p.id > 0).ExecuteCommandAsync();
|
||||
|
||||
//遍历数据存值
|
||||
foreach (var item in entity)
|
||||
@@ -77,13 +77,13 @@ namespace CoreCms.Net.Repository
|
||||
days = item.days
|
||||
};
|
||||
|
||||
var id = await DbClient.Insertable(continuous).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var id = await DbClient.Insertable(continuous).ExecuteReturnIdentityAsync();
|
||||
if (id <= 0) continue;
|
||||
foreach (var detail in item.details)
|
||||
{
|
||||
detail.ruleId = id;
|
||||
}
|
||||
await DbClient.Insertable(item.details).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
await DbClient.Insertable(item.details).ExecuteReturnIdentityAsync();
|
||||
}
|
||||
|
||||
_unitOfWork.CommitTran();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
|
||||
var bl = id > 0;
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
@@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
if (entity.isDefault == true)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
return jm;
|
||||
@@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.description = entity.description;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
@@ -111,7 +111,7 @@ namespace CoreCms.Net.Repository
|
||||
//其他处理
|
||||
if (entity.isDefault)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,13 +133,13 @@ namespace CoreCms.Net.Repository
|
||||
jm.msg = "存在关联的分销用户数据,禁止删除";
|
||||
return jm;
|
||||
}
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionGrade>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionGrade>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await DbClient.Deleteable<CoreCmsDistributionCondition>().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsDistributionResult>().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsDistributionCondition>().Where(p => p.gradeId == id).ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsDistributionResult>().Where(p => p.gradeId == id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
return jm;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.parameters = entity.parameters;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
return jm;
|
||||
@@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CoreCms.Net.Repository
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsCategory>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsCategory>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
|
||||
|
||||
#region 重写异步插入方法
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
@@ -285,6 +286,9 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写异步更新方法方法
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
@@ -734,7 +738,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写删除指定ID集合的数据(批量删除)
|
||||
/// <summary>
|
||||
@@ -1923,5 +1927,132 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取商品及默认货品信息
|
||||
|
||||
/// <summary>
|
||||
/// 获取商品及默认货品信息
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderByPredicate"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsGoods>> QueryGoodWithDefaultProductAsync(Expression<Func<CoreCmsGoods, bool>> predicate, Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
||||
{
|
||||
List<CoreCmsGoods> listData;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
listData = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, pd) => new JoinQueryInfos(JoinType.Left, good.id == pd.goodsId))
|
||||
.Where((good, pd) => pd.isDefalut == true && pd.isDel == false)
|
||||
.Select((good, pd) => new CoreCmsGoods
|
||||
{
|
||||
id = good.id,
|
||||
bn = good.bn,
|
||||
name = good.name,
|
||||
brief = good.brief,
|
||||
image = good.image,
|
||||
images = good.images,
|
||||
video = good.video,
|
||||
productsDistributionType = good.productsDistributionType,
|
||||
goodsCategoryId = good.goodsCategoryId,
|
||||
goodsTypeId = good.goodsTypeId,
|
||||
brandId = good.brandId,
|
||||
isNomalVirtual = good.isNomalVirtual,
|
||||
isMarketable = good.isMarketable,
|
||||
unit = good.unit,
|
||||
//intro = good.intro,
|
||||
spesDesc = good.spesDesc,
|
||||
parameters = good.parameters,
|
||||
commentsCount = good.commentsCount,
|
||||
viewCount = good.viewCount,
|
||||
buyCount = good.buyCount,
|
||||
uptime = good.uptime,
|
||||
downtime = good.downtime,
|
||||
sort = good.sort,
|
||||
labelIds = good.labelIds,
|
||||
newSpec = good.newSpec,
|
||||
openSpec = good.openSpec,
|
||||
createTime = good.createTime,
|
||||
updateTime = good.updateTime,
|
||||
isRecommend = good.isRecommend,
|
||||
isHot = good.isHot,
|
||||
isDel = good.isDel,
|
||||
sn = pd.sn,
|
||||
price = pd.price,
|
||||
costprice = pd.costprice,
|
||||
mktprice = pd.mktprice,
|
||||
stock = pd.stock,
|
||||
freezeStock = pd.freezeStock,
|
||||
pointsDeduction = pd.pointsDeduction,
|
||||
points = pd.points,
|
||||
weight = pd.weight,
|
||||
initialSales = good.initialSales,
|
||||
})
|
||||
.With(SqlWith.NoLock)
|
||||
.MergeTable()
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
||||
.ToListAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
listData = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, pd) => new JoinQueryInfos(
|
||||
JoinType.Left, good.id == pd.goodsId))
|
||||
.Where((good, pd) => pd.isDefalut == true && pd.isDel == false)
|
||||
.Select((good, pd) => new CoreCmsGoods
|
||||
{
|
||||
id = good.id,
|
||||
bn = good.bn,
|
||||
name = good.name,
|
||||
brief = good.brief,
|
||||
image = good.image,
|
||||
images = good.images,
|
||||
video = good.video,
|
||||
productsDistributionType = good.productsDistributionType,
|
||||
goodsCategoryId = good.goodsCategoryId,
|
||||
goodsTypeId = good.goodsTypeId,
|
||||
brandId = good.brandId,
|
||||
isNomalVirtual = good.isNomalVirtual,
|
||||
isMarketable = good.isMarketable,
|
||||
unit = good.unit,
|
||||
//intro = good.intro,
|
||||
spesDesc = good.spesDesc,
|
||||
parameters = good.parameters,
|
||||
commentsCount = good.commentsCount,
|
||||
viewCount = good.viewCount,
|
||||
buyCount = good.buyCount,
|
||||
uptime = good.uptime,
|
||||
downtime = good.downtime,
|
||||
sort = good.sort,
|
||||
labelIds = good.labelIds,
|
||||
newSpec = good.newSpec,
|
||||
openSpec = good.openSpec,
|
||||
createTime = good.createTime,
|
||||
updateTime = good.updateTime,
|
||||
isRecommend = good.isRecommend,
|
||||
isHot = good.isHot,
|
||||
isDel = good.isDel,
|
||||
sn = pd.sn,
|
||||
price = pd.price,
|
||||
costprice = pd.costprice,
|
||||
mktprice = pd.mktprice,
|
||||
stock = pd.stock,
|
||||
freezeStock = pd.freezeStock,
|
||||
pointsDeduction = pd.pointsDeduction,
|
||||
points = pd.points,
|
||||
weight = pd.weight,
|
||||
initialSales = good.initialSales,
|
||||
})
|
||||
.MergeTable()
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
||||
.ToListAsync();
|
||||
}
|
||||
return listData;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ namespace CoreCms.Net.Repository
|
||||
var goodsTypeSpec = new CoreCmsGoodsTypeSpec();
|
||||
goodsTypeSpec.name = entity.name;
|
||||
goodsTypeSpec.sort = entity.sort;
|
||||
var specId = await DbClient.Insertable(goodsTypeSpec).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var specId = await DbClient.Insertable(goodsTypeSpec).ExecuteReturnIdentityAsync();
|
||||
if (specId <= 0 || entity.value is not { Count: > 0 }) return jm;
|
||||
var list = entity.value.Select((item, index) => new CoreCmsGoodsTypeSpecValue() { specId = specId, value = item, sort = index + 1 }).ToList();
|
||||
var bl = await DbClient.Insertable(list).RemoveDataCache().ExecuteCommandAsync() > 0;
|
||||
var bl = await DbClient.Insertable(list).ExecuteCommandAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
oldModel.name = entity.name;
|
||||
oldModel.sort = entity.sort;
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
if (bl)
|
||||
{
|
||||
var oldValues = await DbClient.Queryable<CoreCmsGoodsTypeSpecValue>().OrderBy(p => p.sort).Where(p => p.specId == oldModel.id).ToListAsync();
|
||||
@@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository
|
||||
//获取需要删除的数据库数据
|
||||
var deleteValues = oldValues.Where(p => !entity.value.Contains(p.value)).ToList();
|
||||
//删除旧数据
|
||||
if (deleteValues.Any()) bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(deleteValues).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
if (deleteValues.Any()) bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(deleteValues).ExecuteCommandHasChangeAsync();
|
||||
|
||||
//新数据
|
||||
var values = oldValues.Select(p => p.value).ToList();
|
||||
@@ -125,7 +125,7 @@ namespace CoreCms.Net.Repository
|
||||
if (newValues.Any())
|
||||
{
|
||||
var newList = newValues.Select((t, index) => new CoreCmsGoodsTypeSpecValue() { specId = oldModel.id, value = t, sort = oldValues.Count + index }).ToList();
|
||||
bl = await DbClient.Insertable<CoreCmsGoodsTypeSpecValue>(newList).RemoveDataCache().ExecuteCommandAsync() > 0;
|
||||
bl = await DbClient.Insertable<CoreCmsGoodsTypeSpecValue>(newList).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
}
|
||||
jm.code = bl ? 0 : 1;
|
||||
@@ -144,12 +144,12 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpec>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpec>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(p => p.specId == (int)id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(p => p.specId == (int)id).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
return jm;
|
||||
|
||||
@@ -150,7 +150,6 @@ namespace CoreCms.Net.Repository
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据用户id和商品id获取下了多少订单
|
||||
/// <summary>
|
||||
/// 根据用户id和商品id获取下了多少订单
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
@@ -176,5 +177,71 @@ namespace CoreCms.Net.Repository
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据规则ID数组获取拼团相关信息
|
||||
|
||||
/// <summary>
|
||||
/// 根据规则ID数组获取拼团相关信息
|
||||
/// </summary>
|
||||
/// <param name="ruleIds">规则序列</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IPageList<PinTuanListDTO>> GetPinTuanInfos(int[] ruleIds, Expression<Func<PinTuanListDTO, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, int pageSize = 20)
|
||||
{
|
||||
var dt = DateTime.Now;
|
||||
RefAsync<int> totalCount = 0;
|
||||
var reuslt = await DbClient.Queryable<CoreCmsPinTuanRule, CoreCmsPinTuanGoods, CoreCmsGoods, CoreCmsProducts>(
|
||||
(prModel, pgModel, goodModel, productsModel) => new object[]
|
||||
{
|
||||
JoinType.Inner, prModel.id ==pgModel.ruleId ,
|
||||
JoinType.Inner, pgModel.goodsId == goodModel.id,
|
||||
JoinType.Left, goodModel.id == productsModel.goodsId
|
||||
})
|
||||
.Where((prModel, pgModel, goodModel, productsModel) => prModel.isStatusOpen == true && ruleIds.Contains(prModel.id) && prModel.endTime > dt && productsModel.isDefalut == true && productsModel.isDel == false)
|
||||
.Select((prModel, pgModel, goodModel, productsModel) => new PinTuanListDTO
|
||||
{
|
||||
id = prModel.id,
|
||||
goodsId = pgModel.goodsId,
|
||||
sortId = prModel.sort,
|
||||
name = prModel.name,
|
||||
pinTuanRecordNums = SqlFunc.Subqueryable<CoreCmsOrder>().Where(s => s.objectId == prModel.id).Count(),
|
||||
|
||||
buyPinTuanCount = SqlFunc.Subqueryable<CoreCmsOrderItem>()
|
||||
.LeftJoin<CoreCmsOrder>((sOrderItem, sOrder) => sOrder.orderId == sOrderItem.orderId)
|
||||
.Where((sOrderItem, sOrder) => sOrderItem.goodsId == pgModel.goodsId
|
||||
&& sOrder.orderType == (int)GlobalEnumVars.OrderType.PinTuan
|
||||
&& sOrder.objectId == prModel.id)
|
||||
.Sum(p => p.nums),
|
||||
|
||||
peopleNumber = prModel.peopleNumber,
|
||||
timestamp = 0,
|
||||
startStatus = 0,
|
||||
goodBrief = goodModel.brief,
|
||||
goodName = goodModel.name,
|
||||
goodThumbnail = goodModel.image,
|
||||
goodImages = goodModel.images,
|
||||
goodStock = productsModel.stock,
|
||||
goodViewCount = goodModel.viewCount,
|
||||
goodUnit = goodModel.unit,
|
||||
mktPrice = productsModel.mktprice,
|
||||
pinTuanPrice = productsModel.price,
|
||||
startTime = prModel.startTime,
|
||||
endTime = prModel.endTime,
|
||||
discountAmount = prModel.discountAmount,
|
||||
maxGoodsNums = prModel.maxGoodsNums,
|
||||
maxNums = prModel.maxNums,
|
||||
|
||||
}).MergeTable()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.With(SqlWith.Null).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
|
||||
var list = new PageList<PinTuanListDTO>(reuslt, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.sort = entity.sort;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsArea>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsArea>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -54,35 +54,31 @@ namespace CoreCms.Net.Repository
|
||||
sort = p.sort,
|
||||
isDel = p.isDel,
|
||||
createTime = p.createTime
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}).WithCache().ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
var list = new PageList<CoreCmsNotice>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表首页用
|
||||
/// 获取首页组件数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate,
|
||||
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20)
|
||||
public async Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate)
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsNotice>().OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsNotice
|
||||
var list = await DbClient.Queryable<CoreCmsNotice>()
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.OrderBy(p => p.sort)
|
||||
.Select(p => (dynamic)new
|
||||
{
|
||||
id = p.id,
|
||||
title = p.title,
|
||||
type = p.type,
|
||||
sort = p.sort,
|
||||
isDel = p.isDel,
|
||||
createTime = p.createTime
|
||||
}).ToPageListAsync(pageIndex, pageSize);
|
||||
p.id,
|
||||
p.title,
|
||||
p.type,
|
||||
p.sort,
|
||||
p.createTime
|
||||
})
|
||||
.WithCache().ToListAsync();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.isOpenSelfDelivery = entity.isOpenSelfDelivery;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsOrderDistributionModel>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsOrderDistributionModel>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.sortId = entity.sortId;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsServiceDescription>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsServiceDescription>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.isDelete = entity.isDelete;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsSolitaireItems>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsSolitaireItems>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsSolitaireItems>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsSolitaireItems>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.identificationCode = entity.identificationCode;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace CoreCms.Net.Repository
|
||||
var ids = new List<int>() { id };
|
||||
GetIds(all, id, ids);
|
||||
|
||||
var bl = await DbClient.Deleteable<SysMenu>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<SysMenu>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -4,14 +4,23 @@
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2021/1/31 21:45:10
|
||||
* CreateTime: 2022/10/24 3:54:14
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
@@ -25,9 +34,40 @@ namespace CoreCms.Net.Services
|
||||
|
||||
public CoreCmsArticleTypeServices(IUnitOfWork unitOfWork, ICoreCmsArticleTypeRepository dal)
|
||||
{
|
||||
_dal = dal;
|
||||
BaseDal = dal;
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsArticleType entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
|
||||
<PackageReference Include="Qiniu" Version="8.2.0" />
|
||||
<PackageReference Include="QRCoder" Version="1.4.3" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
|
||||
|
||||
@@ -998,7 +998,6 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询代理池商品分页数据
|
||||
/// </summary>
|
||||
@@ -1045,5 +1044,19 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取商品及默认货品信息
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderByPredicate"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsGoods>> QueryGoodWithDefaultProductAsync(Expression<Func<CoreCmsGoods, bool>> predicate,
|
||||
Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryGoodWithDefaultProductAsync(predicate, orderByPredicate, orderByType, blUseNoLock);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +185,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取税号
|
||||
/// <summary>
|
||||
/// 获取税号
|
||||
|
||||
@@ -17,6 +17,7 @@ using Newtonsoft.Json;
|
||||
using System.Threading.Tasks;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Essensoft.Paylink.Alipay;
|
||||
using Essensoft.Paylink.Alipay.Domain;
|
||||
using Essensoft.Paylink.Alipay.Request;
|
||||
@@ -67,7 +68,7 @@ namespace CoreCms.Net.Services
|
||||
OutTradeNo = entity.paymentId,
|
||||
Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
|
||||
ProductCode = entity.paymentCode,
|
||||
TotalAmount = entity.money.ToString(),
|
||||
TotalAmount = entity.money.ToString(CultureInfo.InvariantCulture),
|
||||
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle
|
||||
};
|
||||
var req = new AlipayTradeAppPayRequest();
|
||||
|
||||
@@ -19,6 +19,7 @@ using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.WeChat.Service.HttpClients;
|
||||
using Essensoft.Paylink.Alipay.Domain;
|
||||
using Essensoft.Paylink.WeChatPay;
|
||||
using Essensoft.Paylink.WeChatPay.V2;
|
||||
using Essensoft.Paylink.WeChatPay.V2.Request;
|
||||
@@ -26,6 +27,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using QRCoder;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
|
||||
@@ -178,36 +180,69 @@ namespace CoreCms.Net.Services
|
||||
var response = await _client.ExecuteAsync(orderRequest, _optionsAccessor.Value);
|
||||
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)
|
||||
{
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
WeChatPayDictionary parameter;
|
||||
//App微信支付
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString())
|
||||
{
|
||||
var reqApp = new WeChatPayAppSdkRequest()
|
||||
{
|
||||
PrepayId = response.PrepayId
|
||||
};
|
||||
parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
parameter = await _client.ExecuteAsync(req, _optionsAccessor.Value);
|
||||
}
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
|
||||
jm.status = true;
|
||||
//jm.msg = "创建支付环境成功";
|
||||
jm.msg = "创建微信APP支付环境成功";
|
||||
jm.data = parameter;
|
||||
jm.otherData = response;
|
||||
}
|
||||
//JsApi通用微信支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString())
|
||||
{
|
||||
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
|
||||
var req = new WeChatPayJsApiSdkRequest
|
||||
{
|
||||
Package = "prepay_id=" + response.PrepayId
|
||||
};
|
||||
var parameter = await _client.ExecuteAsync(req, _optionsAccessor.Value);
|
||||
parameter.Add("paymentId", entity.paymentId);
|
||||
jm.status = true;
|
||||
jm.msg = "创建JSAPI支付环境成功";
|
||||
jm.data = parameter;
|
||||
//jm.otherData = response;
|
||||
}
|
||||
//扫码支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.NATIVE.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建微信扫码支付环境成功";
|
||||
jm.data = new
|
||||
{
|
||||
response,
|
||||
entity.paymentId
|
||||
};
|
||||
//确定是否存在扫码的图片,然后转成base64到前端进行扫码支付
|
||||
if (!string.IsNullOrEmpty(response.CodeUrl) && response.CodeUrl.Contains("weixin://wxpay/bizpayurl?pr="))
|
||||
{
|
||||
using var qrGenerator = new QRCodeGenerator();
|
||||
using var qrCodeData = qrGenerator.CreateQrCode(response.CodeUrl, QRCodeGenerator.ECCLevel.L);
|
||||
using var pngByteQrCode = new PngByteQRCode(qrCodeData);
|
||||
var pngBytes = pngByteQrCode.GetGraphic(20, false);
|
||||
var stringBase64Str = Convert.ToBase64String(pngBytes);
|
||||
jm.otherData = stringBase64Str;
|
||||
}
|
||||
}
|
||||
//H5支付
|
||||
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.MWEB.ToString())
|
||||
{
|
||||
jm.status = true;
|
||||
jm.msg = "创建H5支付环境成功";
|
||||
jm.data = response;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.status = false;
|
||||
jm.msg = "微信建立支付请求失败";
|
||||
jm.otherData = response;
|
||||
//jm.otherData = response;
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -63,9 +63,7 @@ namespace CoreCms.Net.Services
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>();
|
||||
var pinTuanRuleServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRuleServices>();
|
||||
var pinTuanRecordServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRecordServices>();
|
||||
var pinTuanGoodsServices = container.ServiceProvider.GetService<ICoreCmsPinTuanGoodsServices>();
|
||||
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
|
||||
|
||||
var goodsInfo = await goodsServices.GetGoodsDetail(goodsId, userId, false, "goods", 0, needGoodSku);
|
||||
@@ -83,14 +81,14 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
goodsInfo.pinTuanRule.pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun;
|
||||
|
||||
TimeSpan ts = goodsInfo.pinTuanRule.startTime.Subtract(dt);
|
||||
var ts = goodsInfo.pinTuanRule.startTime.Subtract(dt);
|
||||
goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (goodsInfo.pinTuanRule.startTime <= dt && goodsInfo.pinTuanRule.endTime > dt)
|
||||
{
|
||||
goodsInfo.pinTuanRule.pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin;
|
||||
|
||||
TimeSpan ts = goodsInfo.pinTuanRule.endTime.Subtract(dt);
|
||||
var ts = goodsInfo.pinTuanRule.endTime.Subtract(dt);
|
||||
goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
@@ -23,6 +24,7 @@ using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using Essensoft.Paylink.Alipay.Domain;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SqlSugar;
|
||||
@@ -65,15 +67,18 @@ namespace CoreCms.Net.Services
|
||||
/// 接口上获取拼团所有商品
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> GetPinTuanList(int userId = 0)
|
||||
public async Task<WebApiCallBack> GetPinTuanList(int userId = 0, int pageIndex = 1, int pageSize = 20)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
var pinTuanGoodsServices = container.ServiceProvider.GetService<ICoreCmsPinTuanGoodsServices>();
|
||||
var pinTuanRuleServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRuleServices>();
|
||||
var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>();
|
||||
|
||||
var pinTuanRules = await pinTuanRuleServices.QueryListByClauseAsync(p => p.isStatusOpen == true, p => p.sort, OrderByType.Asc, true, true, 24 * 60);
|
||||
//从缓存中获取有效的数据
|
||||
var dt = DateTime.Now;
|
||||
var pinTuanRules = await pinTuanRuleServices.QueryListByClauseAsync(p => p.isStatusOpen == true && p.startTime < dt && p.endTime > dt, p => p.sort, OrderByType.Asc, true, true, 24 * 60);
|
||||
if (pinTuanRules == null && !pinTuanRules.Any())
|
||||
{
|
||||
jm.status = true;
|
||||
@@ -81,30 +86,35 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
//获取开启的规则集序列
|
||||
var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToList();
|
||||
//获取下级商品数据
|
||||
var pinTuanGoods = await pinTuanGoodsServices.QueryListByClauseAsync(p => pinTuanRuleIds.Contains(p.ruleId), p => p.ruleId, OrderByType.Asc, true, true);
|
||||
//从缓存中获取有效的数据
|
||||
var dt = DateTime.Now;
|
||||
var list = pinTuanRules.Where(p => p.startTime < dt && p.endTime > dt).OrderBy(p => p.sort).ToList();
|
||||
var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToArray();
|
||||
|
||||
if (list.Any())
|
||||
|
||||
var dtoData = await _dal.GetPinTuanInfos(pinTuanRuleIds, p => p.sortId, OrderByType.Asc, pageIndex, pageSize);
|
||||
foreach (var item in dtoData)
|
||||
{
|
||||
var goods = new List<CoreCmsGoods>();
|
||||
foreach (var item in list)
|
||||
//判断拼团状态
|
||||
var dtNow = DateTime.Now;
|
||||
if (item.startTime > dt)
|
||||
{
|
||||
var pinTuanGood = pinTuanGoods.Find(p => p.ruleId == item.id);
|
||||
if (pinTuanGood != null)
|
||||
{
|
||||
var g = await pinTuanGoodsServices.GetGoodsInfo(item, pinTuanGood.goodsId, userId, false,
|
||||
false, false);
|
||||
if (g == null) continue;
|
||||
goods.Add(g);
|
||||
item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun;
|
||||
var ts = item.startTime.Subtract(dt);
|
||||
item.timestamp = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (item.startTime <= dt && item.endTime > dt)
|
||||
{
|
||||
item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin;
|
||||
var ts = item.endTime.Subtract(dt);
|
||||
item.timestamp = (int)ts.TotalSeconds;
|
||||
}
|
||||
jm.data = goods;
|
||||
else
|
||||
{
|
||||
item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired;
|
||||
}
|
||||
|
||||
item.pinTuanPrice -= item.discountAmount;
|
||||
}
|
||||
|
||||
jm.data = dtoData;
|
||||
jm.status = true;
|
||||
return jm;
|
||||
}
|
||||
@@ -136,5 +146,25 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
return await _dal.GetPinTuanInfo(ruleId);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据规则ID数组获取拼团相关信息
|
||||
/// </summary>
|
||||
/// <param name="ruleIds">规则序列</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="pageIndex"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IPageList<PinTuanListDTO>> GetPinTuanInfos(int[] ruleIds,
|
||||
Expression<Func<PinTuanListDTO, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20)
|
||||
{
|
||||
|
||||
return await _dal.GetPinTuanInfos(ruleIds, orderByExpression, orderByType, pageIndex, pageSize);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
@@ -175,17 +176,17 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 获取团购列表数据
|
||||
/// <summary>
|
||||
/// 获取团购列表数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> GetGroupList(int type, int userId, int status, int pageIndex, int pageSize)
|
||||
public async Task<WebApiCallBack> GetGroupList(int type, int status, int pageIndex, int pageSize)
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>();
|
||||
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
|
||||
|
||||
var jm = new WebApiCallBack { status = true };
|
||||
|
||||
@@ -207,51 +208,75 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
where = where.And(p => p.endTime < dt);
|
||||
}
|
||||
|
||||
var goods = new List<CoreCmsGoods>();
|
||||
var list = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize);
|
||||
if (list != null && list.Any())
|
||||
var promotions = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize, true, true, 60);
|
||||
var dtoData = new List<GroupPurchaseSeckillDTO>();
|
||||
if (promotions != null && promotions.Any())
|
||||
{
|
||||
foreach (var item in list)
|
||||
//获取团购序列
|
||||
var pIds = promotions.Select(p => p.id).ToList();
|
||||
//获取规则参数
|
||||
var conditions = await _promotionConditionServices.QueryListByClauseAsync(p => pIds.Contains(p.promotionId), p => p.id, OrderByType.Asc, true, true);
|
||||
//获取规则结果集
|
||||
var results = await _promotionResultServices.QueryListByClauseAsync(p => pIds.Contains(p.promotionId), p => p.id, OrderByType.Asc, true, true);
|
||||
|
||||
var goodIds = (from condition in conditions where condition != null && condition.parameters.Contains("goodsId") select (JObject)JsonConvert.DeserializeObject(condition.parameters) into parameters select parameters["goodsId"].ObjectToInt(0)).ToList();
|
||||
|
||||
var goodData = await goodsServices.QueryGoodWithDefaultProductAsync(p => goodIds.Contains(p.id), p => p.id, OrderByType.Asc, true);
|
||||
|
||||
foreach (var item in promotions)
|
||||
{
|
||||
var promotionId = item.id;
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId);
|
||||
var dtNow = DateTime.Now;
|
||||
|
||||
var dto = new GroupPurchaseSeckillDTO();
|
||||
|
||||
//事物处理过程开始
|
||||
dto.id = item.id;
|
||||
dto.name = item.name;
|
||||
dto.type = item.type;
|
||||
dto.sort = item.sort;
|
||||
dto.maxNums = item.maxNums;
|
||||
dto.maxGoodsNums = item.maxGoodsNums;
|
||||
dto.maxRecevieNums = item.maxRecevieNums;
|
||||
dto.startTime = item.startTime;
|
||||
dto.endTime = item.endTime;
|
||||
dto.isEnable = item.isEnable;
|
||||
dto.isExclusive = item.isExclusive;
|
||||
dto.isAutoReceive = item.isAutoReceive;
|
||||
dto.effectiveDays = item.effectiveDays;
|
||||
dto.effectiveHours = item.effectiveHours;
|
||||
dto.startStatus = status;
|
||||
|
||||
var condition = conditions.Find(p => p.promotionId == item.id);
|
||||
if (condition != null && condition.parameters.Contains("goodsId"))
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters);
|
||||
|
||||
|
||||
var res = await GetGroupDetail(parameters["goodsId"].ObjectToInt(0), userId, type, item.id);
|
||||
if (res.status)
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters);
|
||||
var goodId = parameters["goodsId"].ObjectToInt(0);
|
||||
var good = goodData.Find(p => p.id == goodId);
|
||||
if (good != null)
|
||||
{
|
||||
var good = res.data as CoreCmsGoods;
|
||||
dto.goodBrief = good.brief;
|
||||
dto.goodName = good.name;
|
||||
dto.goodThumbnail = good.image;
|
||||
dto.goodImages = good.images;
|
||||
dto.goodStock = good.stock;
|
||||
dto.goodViewCount = good.viewCount;
|
||||
dto.goodUnit = good.unit;
|
||||
dto.mktPrice = good.mktprice;
|
||||
dto.price = good.price;
|
||||
|
||||
good.groupId = item.id;
|
||||
good.groupType = item.type;
|
||||
good.groupStatus = item.isEnable;
|
||||
good.groupTime = DateTime.Now;
|
||||
good.groupStartTime = item.startTime;
|
||||
good.groupEndTime = item.endTime;
|
||||
|
||||
TimeSpan ts = item.endTime.Subtract(dt);
|
||||
good.groupTimestamp = (int)ts.TotalSeconds;
|
||||
|
||||
goods.Add(good);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.expression1 = res.msg;
|
||||
TimeSpan ts = item.endTime.Subtract(dtNow);
|
||||
dto.timestamp = (int)ts.TotalSeconds;
|
||||
}
|
||||
}
|
||||
dtoData.Add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
jm.data = new
|
||||
{
|
||||
goods,
|
||||
list.TotalCount,
|
||||
list.TotalPages,
|
||||
list,
|
||||
promotions.TotalCount,
|
||||
promotions.TotalPages,
|
||||
list = dtoData,
|
||||
pageIndex,
|
||||
pageSize
|
||||
};
|
||||
@@ -266,7 +291,7 @@ namespace CoreCms.Net.Services
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<WebApiCallBack> GetGroupDetail(int goodId = 0, int userId = 0, int type = (int)GlobalEnumVars.PromotionType.Group, int groupId = 0, bool needSku = false)
|
||||
public async Task<WebApiCallBack> GetGroupDetail(int groupId, int userId, int type, bool needSku)
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
@@ -275,31 +300,40 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var jm = new WebApiCallBack() { msg = "关键参数丢失" };
|
||||
|
||||
if (goodId == 0)
|
||||
if (groupId == 0)
|
||||
{
|
||||
return jm;
|
||||
}
|
||||
|
||||
//判断商品是否参加团购
|
||||
var isInGroup = _dal.IsInGroup(goodId, out var promotionId, type);
|
||||
if (!isInGroup)
|
||||
{
|
||||
jm.msg = "商品未参加团购";
|
||||
return jm;
|
||||
}
|
||||
|
||||
var promotion = await _dal.QueryByClauseAsync(p => p.isDel == false && p.isEnable == true && p.id == promotionId);
|
||||
var promotion = await _dal.QueryByClauseAsync(p => p.isDel == false && p.isEnable == true && p.id == groupId, true, true);
|
||||
if (promotion == null)
|
||||
{
|
||||
jm.msg = "无此活动";
|
||||
jm.otherData = promotionId;
|
||||
jm.otherData = groupId;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var goodId = 0;
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == groupId, true, true);
|
||||
if (condition != null)
|
||||
{
|
||||
var obj = (JObject)JsonConvert.DeserializeObject(condition.parameters);
|
||||
if (obj.ContainsKey("goodsId") && obj["goodsId"].ObjectToInt(0) > 0)
|
||||
{
|
||||
goodId = obj["goodsId"].ObjectToInt(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (goodId == 0)
|
||||
{
|
||||
jm.msg = "未提交商品信息";
|
||||
jm.otherData = groupId;
|
||||
return jm;
|
||||
}
|
||||
|
||||
var goods = new CoreCmsGoods();
|
||||
string typeStr = type == (int)GlobalEnumVars.PromotionType.Group ? GlobalEnumVars.PromotionType.Group.ToString().ToLowerInvariant() : GlobalEnumVars.PromotionType.Seckill.ToString().ToLowerInvariant();
|
||||
|
||||
goods = await goodsServices.GetGoodsDetail(goodId, userId, true, typeStr, groupId, needSku);
|
||||
var goods = await goodsServices.GetGoodsDetail(goodId, userId, true, typeStr, groupId, needSku);
|
||||
if (goods == null)
|
||||
{
|
||||
jm.msg = "商品不存在";
|
||||
@@ -315,8 +349,6 @@ namespace CoreCms.Net.Services
|
||||
//调整前台显示数量
|
||||
var checkOrder = orderServices.FindLimitOrder(goods.product.id, userId, promotion.startTime, promotion.endTime, promotion.type);
|
||||
|
||||
var productStock = goods.product.stock;
|
||||
|
||||
//如果最大为设置值
|
||||
if (promotion.maxGoodsNums > 0)
|
||||
{
|
||||
@@ -335,10 +367,8 @@ namespace CoreCms.Net.Services
|
||||
goods.product.stock = checkOrder.TotalOrders - promotion.maxNums >= 0 ? 0 : promotion.maxNums - checkOrder.TotalOrders;
|
||||
}
|
||||
|
||||
|
||||
goods.buyPromotionCount = checkOrder.TotalOrders;
|
||||
|
||||
|
||||
var dt = DateTime.Now;
|
||||
|
||||
goods.groupId = promotion.id;
|
||||
@@ -351,7 +381,6 @@ namespace CoreCms.Net.Services
|
||||
TimeSpan ts = promotion.endTime.Subtract(dt);
|
||||
goods.groupTimestamp = (int)ts.TotalSeconds;
|
||||
|
||||
|
||||
//进行促销后要更换原销售价替换原市场价
|
||||
var originPrice = Math.Round(goods.product.price + goods.product.promotionAmount, 2);
|
||||
goods.product.mktprice = originPrice;
|
||||
|
||||
@@ -532,9 +532,9 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.PinTuan:
|
||||
if (parameter.ContainsKey("goodsId") && parameter.ContainsKey("teamId") && parameter.ContainsKey("groupId"))
|
||||
if (parameter.ContainsKey("teamId") && parameter.ContainsKey("groupId"))
|
||||
{
|
||||
str = parameter["goodsId"] + "_" + parameter["groupId"] + "_" + parameter["teamId"];
|
||||
str = parameter["groupId"] + "_" + parameter["teamId"];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -565,9 +565,9 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.AddPinTuan:
|
||||
if (parameter.ContainsKey("goodsId") && parameter.ContainsKey("groupId") && parameter.ContainsKey("teamId"))
|
||||
if (parameter.ContainsKey("groupId") && parameter.ContainsKey("teamId"))
|
||||
{
|
||||
str = parameter["goodsId"] + "_" + parameter["groupId"] + "_" + parameter["teamId"];
|
||||
str = parameter["groupId"] + "_" + parameter["teamId"];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -598,24 +598,24 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.Group:
|
||||
if (parameter.ContainsKey("goodsId") || parameter.ContainsKey("groupId"))
|
||||
if (parameter.ContainsKey("groupId"))
|
||||
{
|
||||
str = parameter["goodsId"] + "_" + parameter["groupId"];
|
||||
str = parameter["groupId"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = "参数必须传goodsId,groupId";
|
||||
jm.msg = "参数必须传groupId";
|
||||
return jm;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.Seckill:
|
||||
if (parameter.ContainsKey("goodsId") || parameter.ContainsKey("groupId"))
|
||||
if (parameter.ContainsKey("groupId"))
|
||||
{
|
||||
str = parameter["goodsId"] + "_" + parameter["groupId"];
|
||||
str = parameter["groupId"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = "参数必须传goodsId,groupId";
|
||||
jm.msg = "参数必须传groupId";
|
||||
return jm;
|
||||
}
|
||||
break;
|
||||
@@ -641,6 +641,17 @@ namespace CoreCms.Net.Services
|
||||
return jm;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods:
|
||||
if (parameter.ContainsKey("serviceGoodsId"))
|
||||
{
|
||||
str = parameter["serviceGoodsId"]?.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = "参数必须传id";
|
||||
return jm;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
jm.msg = GlobalErrorCodeVars.Code10000;
|
||||
return jm;
|
||||
@@ -682,9 +693,8 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
goodsId = arr[0],
|
||||
groupId = arr[1],
|
||||
teamId = arr[2]
|
||||
groupId = arr[0],
|
||||
teamId = arr[1]
|
||||
};
|
||||
jm.status = true;
|
||||
}
|
||||
@@ -712,9 +722,8 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
goodsId = arr[0],
|
||||
groupId = arr[1],
|
||||
teamId = arr[2]
|
||||
groupId = arr[0],
|
||||
teamId = arr[1]
|
||||
};
|
||||
jm.status = true;
|
||||
}
|
||||
@@ -734,23 +743,21 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.Group:
|
||||
if (arr.Length == 2)
|
||||
if (arr.Length == 1)
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
goodsId = arr[0],
|
||||
groupId = arr[1],
|
||||
groupId = arr[0],
|
||||
};
|
||||
jm.status = true;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.Seckill:
|
||||
if (arr.Length == 2)
|
||||
if (arr.Length == 1)
|
||||
{
|
||||
jm.data = new
|
||||
{
|
||||
goodsId = arr[0],
|
||||
groupId = arr[1],
|
||||
groupId = arr[0],
|
||||
};
|
||||
jm.status = true;
|
||||
}
|
||||
@@ -769,6 +776,13 @@ namespace CoreCms.Net.Services
|
||||
jm.status = true;
|
||||
}
|
||||
break;
|
||||
case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods:
|
||||
if (arr.Length == 1)
|
||||
{
|
||||
jm.data = new { serviceGoodsId = arr[0] };
|
||||
jm.status = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
jm.msg = GlobalErrorCodeVars.Code10000;
|
||||
return jm;
|
||||
|
||||
@@ -57,19 +57,13 @@ namespace CoreCms.Net.Services
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表首页用
|
||||
/// 获取首页组件数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate,
|
||||
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20)
|
||||
public async Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate)
|
||||
{
|
||||
return await _dal.QueryListAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize);
|
||||
return await _dal.QueryComponentAsync(predicate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ using CoreCms.Net.Model.FromBody;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using CoreCms.Net.Utility.Extensions;
|
||||
using Essensoft.Paylink.Alipay.Domain;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
@@ -43,6 +44,7 @@ namespace CoreCms.Net.Services
|
||||
private readonly ICoreCmsSettingServices _settingServices;
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsArticleServices _articleServices;
|
||||
private readonly ICoreCmsArticleTypeServices _articleTypeServices;
|
||||
private readonly ICoreCmsPromotionConditionServices _promotionConditionServices;
|
||||
private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices;
|
||||
private readonly ICoreCmsServicesServices _servicesServices;
|
||||
@@ -51,7 +53,7 @@ namespace CoreCms.Net.Services
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public CoreCmsPagesServices(IUnitOfWork unitOfWork
|
||||
, ICoreCmsPagesRepository dal
|
||||
, ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices)
|
||||
, ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices, ICoreCmsArticleTypeServices articleTypeServices)
|
||||
{
|
||||
this._dal = dal;
|
||||
_pagesItemsRepository = pagesItemsRepository;
|
||||
@@ -64,6 +66,7 @@ namespace CoreCms.Net.Services
|
||||
_promotionConditionServices = promotionConditionServices;
|
||||
_pinTuanRuleServices = pinTuanRuleServices;
|
||||
_servicesServices = servicesServices;
|
||||
_articleTypeServices = articleTypeServices;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
@@ -136,13 +139,13 @@ namespace CoreCms.Net.Services
|
||||
|
||||
wherePage = code == "mobile_home" ? wherePage.And(p => p.type == 1) : wherePage.And(p => p.code == code);
|
||||
|
||||
var model = await _dal.QueryByClauseAsync(wherePage);
|
||||
var model = await _dal.QueryByClauseAsync(wherePage, true, true);
|
||||
if (model == null)
|
||||
{
|
||||
return jm;
|
||||
}
|
||||
jm.status = true;
|
||||
var items = await _pagesItemsRepository.QueryListByClauseAsync(p => p.pageCode == model.code, p => p.sort, OrderByType.Asc);
|
||||
var items = await _pagesItemsRepository.QueryListByClauseAsync(p => p.pageCode == model.code, p => p.sort, OrderByType.Asc, true, true);
|
||||
|
||||
var itemsDto = new List<PagesItemsDto>();
|
||||
foreach (var item in items)
|
||||
@@ -156,24 +159,22 @@ namespace CoreCms.Net.Services
|
||||
|
||||
item.parameters = item.parameters.Replace("/images/empty-banner.png", "/static/images/common/empty-banner.png");
|
||||
|
||||
if (item.widgetCode == "search") //搜索
|
||||
switch (item.widgetCode)
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "tabBar")
|
||||
//搜索
|
||||
case "search":
|
||||
case "tabBar":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "notice":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "notice")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto")
|
||||
{
|
||||
var list = await _noticeServices.QueryListAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc, 1, 20);
|
||||
var list = await _noticeServices.QueryComponentAsync(p => p.isDel == false);
|
||||
if (list != null && list.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(list);
|
||||
var result = JArray.FromObject(list);
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", result);
|
||||
}
|
||||
@@ -187,16 +188,8 @@ namespace CoreCms.Net.Services
|
||||
var noticeIdsStr = string.Empty;
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
JArray result = JArray.Parse(parameters["list"].ToString());
|
||||
var noticeIds = new List<int>();
|
||||
foreach (var ss in result) //查找某个字段与值
|
||||
{
|
||||
var noticeId = ((JObject)ss)["id"].ObjectToInt(0);
|
||||
if (noticeId > 0)
|
||||
{
|
||||
noticeIds.Add(noticeId);
|
||||
}
|
||||
}
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var noticeIds = result.Select(ss => ((JObject)ss)["id"].ObjectToInt(0)).Where(noticeId => noticeId > 0).ToList();
|
||||
where = where.And(p => noticeIds.Contains(p.id));
|
||||
if (noticeIds.Any())
|
||||
{
|
||||
@@ -215,7 +208,7 @@ namespace CoreCms.Net.Services
|
||||
var notices = await _noticeServices.QueryListByClauseAsync(where, orderBy);
|
||||
if (notices != null && notices.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(notices);
|
||||
var result = JArray.FromObject(notices);
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", result);
|
||||
}
|
||||
@@ -227,59 +220,50 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "imgSlide")
|
||||
case "imgSlide":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "coupon":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "coupon")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) != 0)
|
||||
{
|
||||
var list = await _promotionServices.ReceiveCouponList(parameters["limit"].ObjectToInt(0));
|
||||
if (list != null && list.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(list);
|
||||
var result = JArray.FromObject(list);
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", result);
|
||||
}
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "blank")
|
||||
case "blank":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "textarea":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "textarea")
|
||||
{
|
||||
JObject parameters = new JObject();
|
||||
var parameters = new JObject();
|
||||
parameters["value"] = item.parameters;
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "video")
|
||||
case "video":
|
||||
case "imgWindow":
|
||||
case "imgSingle":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "goodTabBar":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "imgWindow")
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "imgSingle")
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "goodTabBar")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
var list = JArray.Parse(parameters["list"].ToString());
|
||||
var newList = new JArray();
|
||||
var count = 0;
|
||||
foreach (var jToken in list)
|
||||
{
|
||||
var child = (JObject)jToken;
|
||||
@@ -320,7 +304,7 @@ namespace CoreCms.Net.Services
|
||||
var goods = await _goodsServices.QueryListByClauseAsync(where, limit, p => p.createTime, OrderByType.Desc, true);
|
||||
if (goods != null && goods.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(goods);
|
||||
var result = JArray.FromObject(goods);
|
||||
child.Remove("list");
|
||||
child.Add("list", result);
|
||||
}
|
||||
@@ -336,16 +320,8 @@ namespace CoreCms.Net.Services
|
||||
string goodidsStr;
|
||||
if (child != null && child.ContainsKey("list"))
|
||||
{
|
||||
JArray result = JArray.Parse(child["list"].ToString());
|
||||
var goodids = new List<int>();
|
||||
foreach (var ss in result) //查找某个字段与值
|
||||
{
|
||||
var goodid = ((JObject)ss)["id"].ObjectToInt(0);
|
||||
if (goodid > 0)
|
||||
{
|
||||
goodids.Add(goodid);
|
||||
}
|
||||
}
|
||||
var result = JArray.Parse(child["list"].ToString());
|
||||
var goodids = result.Select(ss => ((JObject)ss)["id"].ObjectToInt(0)).Where(goodid => goodid > 0).ToList();
|
||||
where = where.And(p => goodids.Contains(p.id));
|
||||
if (goodids.Any())
|
||||
{
|
||||
@@ -361,10 +337,10 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy);
|
||||
var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy, true);
|
||||
if (goods != null && goods.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(goods);
|
||||
var result = JArray.FromObject(goods);
|
||||
child.Remove("list");
|
||||
child.Add("list", result);
|
||||
}
|
||||
@@ -374,10 +350,8 @@ namespace CoreCms.Net.Services
|
||||
child.Add("list", new JArray());
|
||||
}
|
||||
}
|
||||
count++;
|
||||
newList.Add(child);
|
||||
}
|
||||
|
||||
if (newList != null && newList.Any())
|
||||
{
|
||||
parameters.Remove("list");
|
||||
@@ -385,11 +359,11 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
}
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "goods")
|
||||
case "goods":
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
var where = PredicateBuilder.True<CoreCmsGoods>();
|
||||
where = where.And(p => p.isDel == false);
|
||||
where = where.And(p => p.isMarketable == true);
|
||||
@@ -415,7 +389,7 @@ namespace CoreCms.Net.Services
|
||||
var brandId = parameters["brandId"].ObjectToInt(0);
|
||||
where = where.And(p => p.brandId == brandId);
|
||||
}
|
||||
|
||||
//数量
|
||||
var limit = 0;
|
||||
if (parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) > 0)
|
||||
{
|
||||
@@ -426,7 +400,7 @@ namespace CoreCms.Net.Services
|
||||
var goods = await _goodsServices.QueryPageAsync(where, " sort desc,id desc ", 1, limit, true);
|
||||
if (goods != null && goods.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(goods);
|
||||
var result = JArray.FromObject(goods);
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", result);
|
||||
}
|
||||
@@ -467,7 +441,7 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy);
|
||||
var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy, true);
|
||||
if (goods != null && goods.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(goods);
|
||||
@@ -482,16 +456,14 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "article")
|
||||
case "article":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "articleClassify":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "articleClassify")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null)
|
||||
{
|
||||
if (parameters.ContainsKey("articleClassifyId") && parameters["articleClassifyId"].ObjectToInt(0) > 0)
|
||||
@@ -499,11 +471,15 @@ namespace CoreCms.Net.Services
|
||||
var articleClassifyId = parameters["articleClassifyId"].ObjectToInt(0);
|
||||
var limit = parameters["limit"].ObjectToInt(0);
|
||||
limit = limit > 0 ? limit : 20;
|
||||
var list = await _articleServices.QueryPageAsync(p => p.typeId == articleClassifyId && p.isPub == true,
|
||||
p => p.createTime, OrderByType.Desc, 1, limit);
|
||||
var articleClassifyObj = await _articleTypeServices.QueryByClauseAsync(p => p.id == articleClassifyId, true, true);
|
||||
var articleClassifyObjJson = JsonConvert.SerializeObject(articleClassifyObj);
|
||||
|
||||
parameters.Add("articleClassifyObj", JToken.Parse(articleClassifyObjJson));
|
||||
|
||||
var list = await _articleServices.QueryPageAsync(p => p.typeId == articleClassifyId && p.isPub == true, p => p.createTime, OrderByType.Desc, 1, limit, true, true);
|
||||
if (list != null && list.Any())
|
||||
{
|
||||
JArray result = JArray.FromObject(list);
|
||||
var result = JArray.FromObject(list);
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", result);
|
||||
}
|
||||
@@ -511,18 +487,17 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "navBar")
|
||||
case "navBar":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "groupPurchase":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "groupPurchase")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
JArray result = JArray.Parse(parameters["list"].ToString());
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var newReslut = new JArray();
|
||||
foreach (var jToken in result)
|
||||
{
|
||||
@@ -531,58 +506,43 @@ namespace CoreCms.Net.Services
|
||||
{
|
||||
//判断拼团状态
|
||||
var dt = DateTime.Now;
|
||||
|
||||
var promotionId = ((JObject)ss)["id"].ObjectToInt(0);
|
||||
var promotionId = ss["id"].ObjectToInt(0);
|
||||
if (promotionId > 0)
|
||||
{
|
||||
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true);
|
||||
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true);
|
||||
if (promotionModel != null)
|
||||
{
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true);
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true);
|
||||
if (condition != null)
|
||||
{
|
||||
var obj = (JObject)JsonConvert.DeserializeObject(condition.parameters);
|
||||
if (obj.ContainsKey("goodsId") && obj["goodsId"].ObjectToInt(0) > 0)
|
||||
{
|
||||
var goodsId = obj["goodsId"].ObjectToInt(0);
|
||||
var goods = await _promotionServices.GetGroupDetail(goodsId, 0, (int)GlobalEnumVars.PromotionType.Group, promotionId);
|
||||
var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Group, false);
|
||||
if (goods.status)
|
||||
{
|
||||
var goodJson = JsonConvert.SerializeObject(goods.data);
|
||||
((JObject)ss).Add("goods", JToken.Parse(goodJson));
|
||||
ss.Add("goods", JToken.Parse(goodJson));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var startStatus = 1;
|
||||
int lastTime = 0;
|
||||
bool isOverdue = false;
|
||||
|
||||
int startStatus;
|
||||
var lastTime = 0;
|
||||
if (promotionModel.startTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming;
|
||||
|
||||
TimeSpan ts = promotionModel.startTime.Subtract(dt);
|
||||
var ts = promotionModel.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
isOverdue = lastTime > 0;
|
||||
}
|
||||
else if (promotionModel.startTime <= dt && promotionModel.endTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress;
|
||||
|
||||
TimeSpan ts = promotionModel.endTime.Subtract(dt);
|
||||
var ts = promotionModel.endTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
isOverdue = lastTime > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished;
|
||||
}
|
||||
|
||||
((JObject)ss).Add("startStatus", startStatus);
|
||||
((JObject)ss).Add("lastTime", lastTime);
|
||||
((JObject)ss).Add("isOverdue", isOverdue);
|
||||
|
||||
ss.Add("startStatus", startStatus);
|
||||
ss.Add("lastTime", lastTime);
|
||||
newReslut.Add(ss);
|
||||
}
|
||||
}
|
||||
@@ -593,85 +553,64 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "record")
|
||||
case "seckill":
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "pinTuan")
|
||||
{
|
||||
JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
JArray result = JArray.Parse(parameters["list"].ToString());
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var newReslut = new JArray();
|
||||
foreach (JObject ss in result)
|
||||
foreach (var jToken in result)
|
||||
{
|
||||
if (ss.ContainsKey("goodsId"))
|
||||
var ss = (JObject)jToken;
|
||||
if (ss.ContainsKey("id"))
|
||||
{
|
||||
var ruleId = ((JObject)ss)["id"].ObjectToInt(0);
|
||||
if (ruleId > 0)
|
||||
{
|
||||
var goodsInfo = await _pinTuanRuleServices.GetPinTuanInfo(ruleId);
|
||||
if (goodsInfo != null)
|
||||
{
|
||||
var pinTuanStartStatus = 1;
|
||||
int lastTime = 0;
|
||||
bool isOverdue = false;
|
||||
//判断拼团状态
|
||||
var dt = DateTime.Now;
|
||||
|
||||
if (goodsInfo.startTime > dt)
|
||||
var promotionId = ss["id"].ObjectToInt(0);
|
||||
if (promotionId > 0)
|
||||
{
|
||||
pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun;
|
||||
|
||||
TimeSpan ts = goodsInfo.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
isOverdue = lastTime > 0;
|
||||
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true);
|
||||
if (promotionModel != null)
|
||||
{
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true);
|
||||
if (condition != null)
|
||||
{
|
||||
var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Seckill, false);
|
||||
if (goods.status)
|
||||
{
|
||||
var goodJson = JsonConvert.SerializeObject(goods.data);
|
||||
ss.Add("goods", JToken.Parse(goodJson));
|
||||
}
|
||||
}
|
||||
else if (goodsInfo.startTime <= dt && goodsInfo.endTime > dt)
|
||||
{
|
||||
pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin;
|
||||
|
||||
TimeSpan ts = goodsInfo.endTime.Subtract(dt);
|
||||
int startStatus;
|
||||
int lastTime = 0;
|
||||
|
||||
if (promotionModel.startTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming;
|
||||
|
||||
var ts = promotionModel.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (promotionModel.startTime <= dt && promotionModel.endTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress;
|
||||
|
||||
var ts = promotionModel.endTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
isOverdue = lastTime > 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired;
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished;
|
||||
}
|
||||
|
||||
decimal pinTuanPrice = goodsInfo.goodsPrice - goodsInfo.discountAmount;
|
||||
if (pinTuanPrice < 0) pinTuanPrice = 0;
|
||||
|
||||
var obj = new JObject();
|
||||
((JObject)obj).Add("pinTuanStartStatus", pinTuanStartStatus);
|
||||
((JObject)obj).Add("lastTime", lastTime);
|
||||
((JObject)obj).Add("isOverdue", isOverdue);
|
||||
((JObject)obj).Add("pinTuanPrice", pinTuanPrice);
|
||||
|
||||
((JObject)obj).Add("createTime", goodsInfo.createTime);
|
||||
((JObject)obj).Add("discountAmount", goodsInfo.discountAmount);
|
||||
((JObject)obj).Add("endTime", goodsInfo.endTime);
|
||||
((JObject)obj).Add("goodsId", goodsInfo.goodsId);
|
||||
((JObject)obj).Add("goodsImage", goodsInfo.goodsImage);
|
||||
((JObject)obj).Add("goodsName", goodsInfo.goodsName);
|
||||
((JObject)obj).Add("goodsPrice", goodsInfo.goodsPrice);
|
||||
((JObject)obj).Add("id", goodsInfo.id);
|
||||
((JObject)obj).Add("isStatusOpen", goodsInfo.isStatusOpen);
|
||||
((JObject)obj).Add("maxGoodsNums", goodsInfo.maxGoodsNums);
|
||||
((JObject)obj).Add("maxNums", goodsInfo.maxNums);
|
||||
((JObject)obj).Add("name", goodsInfo.name);
|
||||
((JObject)obj).Add("peopleNumber", goodsInfo.peopleNumber);
|
||||
((JObject)obj).Add("significantInterval", goodsInfo.significantInterval);
|
||||
((JObject)obj).Add("sort", goodsInfo.sort);
|
||||
((JObject)obj).Add("startTime", goodsInfo.startTime);
|
||||
((JObject)obj).Add("updateTime", goodsInfo.updateTime);
|
||||
|
||||
//((JObject)ss).Add("goodsInfo", JToken.FromObject(goodsInfo));
|
||||
newReslut.Add(obj);
|
||||
ss.Add("startStatus", startStatus);
|
||||
ss.Add("lastTime", lastTime);
|
||||
newReslut.Add(ss);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -681,9 +620,57 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "service")
|
||||
case "record":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
case "pinTuan":
|
||||
{
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var newReslut = new JArray();
|
||||
|
||||
var ruleIdIds = (from JObject ss in result where ss.ContainsKey("goodsId") select ss["id"].ObjectToInt(0)).ToArray();
|
||||
|
||||
if (ruleIdIds.Any())
|
||||
{
|
||||
var dtoData = await _pinTuanRuleServices.GetPinTuanInfos(ruleIdIds, p => p.sortId, OrderByType.Asc, 1, result.Count);
|
||||
foreach (var itemDto in dtoData)
|
||||
{
|
||||
//判断拼团状态
|
||||
var dt = DateTime.Now;
|
||||
|
||||
if (itemDto.startTime > dt)
|
||||
{
|
||||
itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun;
|
||||
itemDto.timestamp = (int)itemDto.startTime.Subtract(dt).TotalSeconds;
|
||||
}
|
||||
else if (itemDto.startTime <= dt && itemDto.endTime > dt)
|
||||
{
|
||||
itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin;
|
||||
itemDto.timestamp = (int)itemDto.endTime.Subtract(dt).TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired;
|
||||
}
|
||||
|
||||
itemDto.pinTuanPrice -= itemDto.discountAmount;
|
||||
if (itemDto.pinTuanPrice < 0) itemDto.pinTuanPrice = 0;
|
||||
|
||||
newReslut.Add(JObject.FromObject(itemDto));
|
||||
}
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", newReslut);
|
||||
}
|
||||
}
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
case "service":
|
||||
{
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
|
||||
@@ -694,28 +681,28 @@ namespace CoreCms.Net.Services
|
||||
|
||||
if (ids.Any())
|
||||
{
|
||||
var serviceObj = await _servicesServices.QueryListByClauseAsync(p => ids.Contains(p.id));
|
||||
var serviceObj = await _servicesServices.QueryListByClauseAsync(p => ids.Contains(p.id), p => p.id, OrderByType.Asc, true, true);
|
||||
foreach (var jToken in result)
|
||||
{
|
||||
var ss = (JObject) jToken;
|
||||
var id = ((JObject)ss)["id"].ObjectToInt(0);
|
||||
var ss = (JObject)jToken;
|
||||
var id = ss["id"].ObjectToInt(0);
|
||||
var serviceInfo = serviceObj.Find(p => p.id == id);
|
||||
if (serviceInfo != null)
|
||||
{
|
||||
var openStatus = 1;
|
||||
int openStatus;
|
||||
int lastTime = 0;
|
||||
var dt = DateTime.Now;
|
||||
if (serviceInfo.startTime > dt)
|
||||
{
|
||||
openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun;
|
||||
TimeSpan ts = serviceInfo.startTime.Subtract(dt);
|
||||
var ts = serviceInfo.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (serviceInfo.startTime <= dt && serviceInfo.endTime > dt)
|
||||
{
|
||||
openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin;
|
||||
|
||||
TimeSpan ts = serviceInfo.endTime.Subtract(dt);
|
||||
var ts = serviceInfo.endTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else
|
||||
@@ -733,18 +720,15 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
else if (item.widgetCode == "adpop")
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else if (item.widgetCode == "topImgSlide")
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
|
||||
case "adpop":
|
||||
case "topImgSlide":
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
default:
|
||||
dto.parameters = JsonConvert.DeserializeObject(item.parameters);
|
||||
break;
|
||||
}
|
||||
itemsDto.Add(dto);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
showLoginTip: false,
|
||||
},
|
||||
onLaunch() {
|
||||
|
||||
// 此版本发布于2022-10-23
|
||||
const version = '0.6.4'
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;');
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.autoUpdate();
|
||||
// #endif
|
||||
@@ -21,14 +29,6 @@
|
||||
// 获取店铺配置信息 全局只请求一次
|
||||
this.$u.api.shopConfigV2().then(res => {
|
||||
this.$store.commit('config', res.data)
|
||||
// #ifdef H5
|
||||
//百度统计
|
||||
if (res.data.statistics) {
|
||||
var script = document.createElement("script");
|
||||
script.innerHTML = res.data.statistics;
|
||||
document.getElementsByTagName("body")[0].appendChild(script);
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
//获取三级联动城市信息
|
||||
this.$u.api.getAreaList().then(res => {
|
||||
@@ -36,12 +36,11 @@
|
||||
this.$db.set('areaList', res.data)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
onShow: function (obj) {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$store.commit('scene', obj.scene)
|
||||
console.log(obj);
|
||||
//console.log(obj);
|
||||
// #endif
|
||||
//console.log('App Show')
|
||||
},
|
||||
@@ -170,7 +169,7 @@
|
||||
|
||||
// vue App的样式
|
||||
/* #ifdef APP-PLUS */
|
||||
@import "@/static/style/style.vue.scss";
|
||||
@import "@/static/style/style.app.scss";
|
||||
/* #endif */
|
||||
|
||||
// 小程序特有的样式
|
||||
|
||||
@@ -160,21 +160,25 @@ module.exports = {
|
||||
this.$u.route(url)
|
||||
},
|
||||
// 秒杀详情
|
||||
goSeckillDetail(id, groupId) {
|
||||
this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id, groupId: groupId, });
|
||||
goSeckillDetail(id) {
|
||||
this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id });
|
||||
},
|
||||
// 团购详情
|
||||
goGroupBuyingDetail(id, groupId) {
|
||||
this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id, groupId: groupId, });
|
||||
goGroupBuyingDetail(id) {
|
||||
this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id });
|
||||
},
|
||||
//拼团详情页
|
||||
goPinTuanDetail(id, pinTuanId, teamId) {
|
||||
goPinTuanDetail(id, teamId) {
|
||||
if (teamId) {
|
||||
this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, pinTuanId: pinTuanId, teamId: teamId, });
|
||||
this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, teamId: teamId, });
|
||||
} else {
|
||||
this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, pinTuanId: pinTuanId });
|
||||
this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id });
|
||||
}
|
||||
},
|
||||
// 查看团购列表
|
||||
goGroupPurchase() {
|
||||
this.$u.route('/pages/activity/groupBuying/list/list')
|
||||
},
|
||||
// 查看秒杀列表
|
||||
goSeckillList() {
|
||||
this.$u.route('/pages/activity/seckill/list/list')
|
||||
@@ -189,7 +193,10 @@ module.exports = {
|
||||
* 文章接口
|
||||
*/
|
||||
|
||||
// 查看文章总列表
|
||||
// 查看文章分类
|
||||
goArticleClassify(id) {
|
||||
this.$u.route('/pages/article/list/list', { id: id });
|
||||
},
|
||||
goArticleList() {
|
||||
this.$u.route('/pages/article/list/list')
|
||||
},
|
||||
@@ -231,7 +238,7 @@ module.exports = {
|
||||
* 接龙接口信息
|
||||
*/
|
||||
|
||||
// 查看服务详情
|
||||
// 查看接龙详情
|
||||
goSolitaireDetail(id) {
|
||||
this.$u.route('/pages/activity/solitaire/solitaireDetails/solitaireDetails', { id: id });
|
||||
},
|
||||
@@ -241,7 +248,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
//服务接口信息
|
||||
// 查看服务详情
|
||||
goServicesDetail(serviceId) {
|
||||
this.$u.route('/pages/serviceGoods/details/details', { id: serviceId });
|
||||
},
|
||||
@@ -266,14 +272,11 @@ module.exports = {
|
||||
}
|
||||
if (type == navLinkType.urlLink) {
|
||||
if (val.indexOf('http') != -1) {
|
||||
// #ifdef H5
|
||||
window.location.href = val
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||
this.$u.route('/pages/webview/webview', { src: val });
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE || MP
|
||||
if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') {
|
||||
this.$u.route({ type: 'switchTab', url: val });
|
||||
return;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
const install = (Vue, vm) => {
|
||||
|
||||
// 获取店铺配置
|
||||
//let shopConfig = (params, config = {}) => http.post('/Api/Common/GetConfig', params, { custom: { methodName: 'common.shopConfig', needToken: false } });
|
||||
let shopConfigV2 = (params, config = {}) => http.post('/Api/Common/GetConfigV2', params, { custom: { methodName: 'common.shopConfigV2', needToken: false } });
|
||||
//获取商城关键词说明
|
||||
let getServiceDescription = (params, config = {}) => http.post('/Api/Common/GetServiceDescription', params, { custom: { methodName: 'common.getServiceDescription', needToken: false } });
|
||||
@@ -399,24 +398,11 @@ const install = (Vue, vm) => {
|
||||
let serviceVerificationTicket = (params, config = {}) => http.post('/Api/Service/VerificationTicket', params, { custom: { methodName: 'service.verificationTicket', needToken: true } });
|
||||
|
||||
|
||||
|
||||
//获取接龙列表
|
||||
let getSolitairePageList = (params, config = {}) => http.post('/Api/Solitaire/GetList', params, { custom: { methodName: 'solitaire.getList', needToken: false } });
|
||||
let getSolitaireDetail = (params, config = {}) => http.post('/Api/Solitaire/GetDetail', params, { custom: { methodName: 'solitaire.getDetail', needToken: false } });
|
||||
|
||||
|
||||
|
||||
// 用户注册(废弃,改为自动获取app数据及使用短信验证码登录)建议直接使用smsLogin接口
|
||||
//let reg = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.reg', needToken: true } });
|
||||
// 用户登录(废弃,改为短信验证码登录)
|
||||
//let login = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.login', needToken: true } });
|
||||
// 获取用户信息(废弃)
|
||||
// let trustLogin = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.trustcallback', needToken: true } });
|
||||
// 订单售后状态(废弃方法,建议直接用order.details接口)
|
||||
// let afterSalesStatus = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'order.aftersalesstatus', needToken: true } });
|
||||
// 我的积分(弃用)
|
||||
//let myPoint = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.mypoint', needToken: true } });
|
||||
|
||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||
vm.$u.api = {
|
||||
shopConfigV2,
|
||||
@@ -485,8 +471,7 @@ const install = (Vue, vm) => {
|
||||
paymentInfo,
|
||||
pay,
|
||||
orderEvaluate,
|
||||
//isSign,
|
||||
//sign,
|
||||
|
||||
userCheckIn,
|
||||
getUserCheckByMonth,
|
||||
getUserCheckCount,
|
||||
|
||||
@@ -17,16 +17,12 @@ module.exports = (vm) => {
|
||||
// #endif
|
||||
// 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部)
|
||||
//defaultConfig.custom = {}; // 全局自定义参数默认值
|
||||
// #ifdef H5 || APP-PLUS || MP-ALIPAY || MP-WEIXIN
|
||||
// #ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN
|
||||
defaultConfig.timeout = 60000;
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
defaultConfig.sslVerify = true;
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
// 跨域请求时是否携带凭证(cookies)仅H5支持(HBuilderX 2.6.15+)
|
||||
defaultConfig.withCredentials = false;
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
defaultConfig.firstIpv4 = false; // DNS解析时优先使用ipv4 仅 App-Android 支持 (HBuilderX 2.8.0+)
|
||||
// #endif
|
||||
@@ -84,7 +80,7 @@ module.exports = (vm) => {
|
||||
//console.log(page.route);
|
||||
// 登录信息过期或者未登录
|
||||
if (data.data === 14007 || data.data === 14006) {
|
||||
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
if (page.route.indexOf('pages/login/loginBySMS/loginBySMS') < 0) {
|
||||
db.del("userToken");
|
||||
uni.showToast({
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
/**
|
||||
* 全局配置文件
|
||||
* @version 0.6.2
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
//接口请求地址,如果需要不部署接口端的情况下测试uni-app,可以直接替换为官方测试接口:https://api.demo.coreshop.cn
|
||||
//export const apiBaseUrl = 'https://api.pro.coreshop.cn';
|
||||
export const apiBaseUrl = 'http://localhost:2015';
|
||||
export const apiBaseUrl = process.env.NODE_ENV === 'development' ? 'https://api.nsts.mvccms.cn' : 'https://api.nsts.mvccms.cn';
|
||||
|
||||
//项目静态资源请求地址,如果使用官方的静态文件地址可以直接替换为:https://files.cdn.coreshop.cn
|
||||
export const apiFilesUrl = 'https://files.cdn.coreshop.cn';
|
||||
|
||||
export const h5Url = apiBaseUrl + "/wap/"; //H5端网站地址,
|
||||
|
||||
// #ifdef H5
|
||||
export const baseUrl = process.env.NODE_ENV === 'development' ? window.location.origin + '/' : apiBaseUrl
|
||||
// #endif
|
||||
|
||||
//支付单类型
|
||||
export const paymentType = {
|
||||
//普通订单
|
||||
@@ -25,7 +19,6 @@ export const paymentType = {
|
||||
group: 3,
|
||||
//秒杀订单
|
||||
seckill: 4,
|
||||
|
||||
//砍价
|
||||
bargain: 6,
|
||||
//赠品
|
||||
@@ -34,10 +27,8 @@ export const paymentType = {
|
||||
solitaire: 8,
|
||||
//交易组件
|
||||
transactionComponent: 10,
|
||||
|
||||
//充值
|
||||
recharge: 201,
|
||||
|
||||
//服务订单
|
||||
serviceOrder: 501,
|
||||
//表单付款码
|
||||
@@ -46,7 +37,6 @@ export const paymentType = {
|
||||
formOrder: 302,
|
||||
};
|
||||
|
||||
|
||||
//分享链接及海报类型
|
||||
export const shareType = {
|
||||
// 首页
|
||||
@@ -55,7 +45,7 @@ export const shareType = {
|
||||
goods: 2,
|
||||
// 3拼团详情页
|
||||
pinTuan: 3,
|
||||
// 4店铺邀请
|
||||
// 4分销店铺
|
||||
inv: 4,
|
||||
// 5文章页面
|
||||
article: 5,
|
||||
@@ -69,15 +59,54 @@ export const shareType = {
|
||||
group: 9,
|
||||
// 10秒杀
|
||||
seckill: 10,
|
||||
// 11代理
|
||||
// 11代理店铺
|
||||
agent: 11,
|
||||
// 12接龙
|
||||
solitaire: 12,
|
||||
// 13 服务商品
|
||||
serviceGoods: 13
|
||||
};
|
||||
|
||||
//分享终端
|
||||
export const shareClient = {
|
||||
// 普通h5
|
||||
h5: 1,
|
||||
// 微信小程序
|
||||
wxMiNiProgram: 2,
|
||||
// 微信公众号(h5)
|
||||
wxOfficial: 3,
|
||||
// 头条系小程序
|
||||
ttMiNiProgram: 4,
|
||||
// 电脑pc端
|
||||
pc: 5,
|
||||
// 阿里小程序
|
||||
aLiMiNiProgram: 6,
|
||||
};
|
||||
|
||||
|
||||
//分享终端
|
||||
export const shareModel = {
|
||||
// 链接分享
|
||||
url: 1,
|
||||
// 二维码
|
||||
qrCode: 2,
|
||||
// 海报
|
||||
poster: 3,
|
||||
};
|
||||
|
||||
export const shareUrl = 'pages/share/jump/jump'; //分享初始化地址
|
||||
|
||||
|
||||
//列表加载状态
|
||||
export const loadStatus = {
|
||||
// 加载前的状态
|
||||
loadMore: 'loadmore',
|
||||
// 加载中的状态
|
||||
loading: 'loading',
|
||||
// 没有更多的状态
|
||||
noMore: 'nomore',
|
||||
};
|
||||
|
||||
|
||||
//nav页面导航类型
|
||||
export const navLinkType = {
|
||||
@@ -87,3 +116,5 @@ export const navLinkType = {
|
||||
articleCategory: 4,// "文章分类",
|
||||
intelligentForms: 5// "智能表单"
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
/**
|
||||
* 很多无法css实现的换肤效果,通过此模块实现
|
||||
* 使用方法,在代码中直接使用 this.$coreTheme.mainNabBar.background
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
//通用头部背景样式
|
||||
export const mainNabBar = {
|
||||
background: {
|
||||
//颜色
|
||||
backgroundColor: '#e54d42',
|
||||
// 导航栏背景图
|
||||
// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
|
||||
// 还可以设置背景图size属性
|
||||
// backgroundSize: 'cover',
|
||||
|
||||
// 渐变色
|
||||
//backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
||||
},
|
||||
//通用头部文字颜色
|
||||
titleColor: "#fff",
|
||||
//通用头部文字颜色
|
||||
backIconColor: "#fff",
|
||||
};
|
||||
|
||||
@@ -29,26 +29,8 @@ function modelShow(
|
||||
};
|
||||
|
||||
|
||||
//时间差转倒计时数据
|
||||
function timeToDateObj(micro_second) {
|
||||
var time = {}
|
||||
// 总秒数
|
||||
var second = Math.floor(micro_second)
|
||||
// 天数
|
||||
time.day = Math.floor(second / 3600 / 24)
|
||||
// 小时
|
||||
time.hour = Math.floor((second / 3600) % 24)
|
||||
// 分钟
|
||||
time.minute = Math.floor((second / 60) % 60)
|
||||
// 秒
|
||||
time.second = Math.floor(second % 60)
|
||||
return time
|
||||
};
|
||||
|
||||
//货币格式化
|
||||
function formatMoney(number, places, symbol, thousand, decimal) {
|
||||
// console.log(number)
|
||||
// console.log(places)
|
||||
number = number || 0
|
||||
places = !isNaN((places = Math.abs(places))) ? places : 2
|
||||
symbol = symbol !== undefined ? symbol : '¥'
|
||||
@@ -71,41 +53,6 @@ function formatMoney(number, places, symbol, thousand, decimal) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取url参数
|
||||
*
|
||||
* @param {*} name
|
||||
* @param {*} [url=window.location.serach]
|
||||
* @returns
|
||||
*/
|
||||
function getQueryString(name, url) {
|
||||
var url = url || window.location.href
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 判断是否在微信浏览器 true是
|
||||
*/
|
||||
function isWeiXinBrowser() {
|
||||
// #ifdef H5
|
||||
// window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
|
||||
let ua = window.navigator.userAgent.toLowerCase()
|
||||
// 通过正则表达式匹配ua中是否含有MicroMessenger字符串
|
||||
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
// #endif
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额相加
|
||||
* @param {Object} value1
|
||||
@@ -125,29 +72,9 @@ function moneySub(value1, value2) {
|
||||
}
|
||||
|
||||
|
||||
//设置手机通知栏字体颜色
|
||||
function setBarColor(black = false) {
|
||||
if (black) {
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: '#000000',
|
||||
backgroundColor: '#FAFAFA'
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarColor({
|
||||
frontColor: '#ffffff',
|
||||
backgroundColor: '#FAFAFA'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export {
|
||||
formatMoney,
|
||||
modelShow,
|
||||
isWeiXinBrowser,
|
||||
getQueryString,
|
||||
timeToDateObj,
|
||||
moneySum,
|
||||
moneySub,
|
||||
setBarColor
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
* @property {Boolean} value=showLoginTip - 由v-model控制显示隐藏。
|
||||
* @property {Boolean} forceOauth - 小程序端特制的全屏登录提示。
|
||||
*/
|
||||
import { mapMutations, mapActions, mapState } from 'vuex';
|
||||
import { mapState } from 'vuex';
|
||||
export default {
|
||||
name: 'coreshopLoginModal',
|
||||
components: {},
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
<template>
|
||||
<view class='coreshop-index-article coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white' v-if="coreshopdata.parameters.list && count">
|
||||
<view class='coreshop-cell-item' v-for="item in coreshopdata.parameters.list" :key="item.id" @click="articleDetail(item.id)">
|
||||
<view class="coreshop-cell-item-bd">
|
||||
<view class="article-title ">
|
||||
{{ item.title }}
|
||||
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
|
||||
<u-toast ref="uToast" />
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @click="articleDetail(id)"></u-icon>
|
||||
</view>
|
||||
<view class="article-des u-line-2">
|
||||
{{ item.brief }}
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-margin-bottom-10 coreshop-bg-main coreshop-text-black coreshop-index-article">
|
||||
<view class='coreshop-cell-item'>
|
||||
<view class="coreshop-cell-item-bd">
|
||||
<view class="article-des u-line-5">
|
||||
{{ brief }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-title-img">
|
||||
<image :src="item.coverImage" mode="aspectFill" class="coverImage"></image>
|
||||
<image :src="coverImage" mode="aspectFill" class="coverImage"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -18,16 +26,32 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshoparticle",
|
||||
name: "coreshopArticle",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
brief: "",
|
||||
coverImage: "",
|
||||
id: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.coreshopData.parameters.list.length > 0) {
|
||||
this.title = this.coreshopData.parameters.list[0].title;
|
||||
this.brief = this.coreshopData.parameters.list[0].brief;
|
||||
this.coverImage = this.coreshopData.parameters.list[0].coverImage;
|
||||
this.id = this.coreshopData.parameters.list[0].id;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -40,14 +64,13 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coreshop-index-article { border-radius: 8px; padding: 0px 10px; background: #FFFFFF !important; color: #333333 !important; overflow: hidden;
|
||||
.coreshop-index-article { background: #FFFFFF !important; color: #333333 !important; overflow: hidden;
|
||||
.coreshop-cell-item { padding: 5px 0px 5px 0; float: left; width: 100%; border-bottom: 1px solid #f3f3f3;
|
||||
.coreshop-cell-item-bd { float: left; width: calc(100% - 100px);
|
||||
.article-title { font-size: 14px; color: #333; width: 100%; overflow: hidden; float: left; margin-bottom: 5px; }
|
||||
.article-des { font-size: 14px; color: #999; overflow: hidden; float: left; line-height: 20px; }
|
||||
}
|
||||
.cell-title-img { width: 80px; height: 80px; float: right;
|
||||
.coverImage { width: 80px; height: 80px; }
|
||||
.coverImage { width: 80px; height: 80px; border-radius: 2px; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
<template>
|
||||
<view class='coreshop-index-article coreshop-cell-group coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white' v-if="coreshopdata.parameters.list && count">
|
||||
<view class='coreshop-cell-item' v-for="item in coreshopdata.parameters.list" :key="item.id" @click="articleDetail(item.id)">
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.articleClassifyObj.name}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @click="goArticleClassify(coreshopData.parameters.articleClassifyObj.id)"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-bg-main coreshop-text-black">
|
||||
<view class='coreshop-index-article coreshop-cell-group coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white' v-if="coreshopData.parameters.list && count">
|
||||
<view class='coreshop-cell-item' v-for="item in coreshopData.parameters.list" :key="item.id" @click="articleDetail(item.id)">
|
||||
<view class="coreshop-cell-item-bd">
|
||||
<view class="article-title">
|
||||
{{ item.title }}
|
||||
@@ -14,23 +23,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshoparticleclassify",
|
||||
name: "coreshopArticleclassify",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
if (!this.coreshopdata.parameters.list) {
|
||||
if (!this.coreshopData.parameters.list) {
|
||||
return false;
|
||||
}
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -43,14 +54,14 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.coreshop-index-article { border-radius: 8px; padding: 0px 10px; background: #FFFFFF !important; color: #333333 !important; overflow: hidden;
|
||||
.coreshop-cell-item { padding: 5px 0px 5px 0; float: left; width: 100%; border-bottom: 1px solid #f3f3f3;
|
||||
.coreshop-index-article { border-radius: 8px; background: #FFFFFF !important; color: #333333 !important; overflow: hidden;
|
||||
.coreshop-cell-item { padding: 8px 0px 8px 0; float: left; width: 100%; border-bottom: 1px solid #f3f3f3;
|
||||
.coreshop-cell-item-bd { float: left; display: flex; flex-direction: column;
|
||||
.article-title { font-size: 14px; color: #333; width: 100%; overflow: hidden; float: left; margin-bottom: 5px; }
|
||||
.article-des { font-size: 12px; color: #999; overflow: hidden; float: left; line-height: 20px; }
|
||||
}
|
||||
.cell-title-img { width: 80px; height: 80px; float: right;
|
||||
.coverImage { width: 80px; height: 80px; }
|
||||
.coverImage { width: 80px; height: 80px; border-radius: 2px; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view class="coreshop-padding-10 coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white">
|
||||
<u-gap :height="coreshopdata.parameters.height * 2" :bg-color="coreshopdata.parameters.backgroundColor"></u-gap>
|
||||
<view>
|
||||
<u-gap :height="coreshopData.parameters.height * 2" :bg-color="coreshopData.parameters.backgroundColor"></u-gap>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopblank",
|
||||
name: "coreshopBlank",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: true,
|
||||
}
|
||||
@@ -18,6 +18,3 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
@@ -12,15 +12,6 @@
|
||||
content: {
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
created() { },
|
||||
methods: {
|
||||
preview(src, e) {
|
||||
// do something
|
||||
},
|
||||
navigate(href, e) {
|
||||
// do something
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,36 +1,23 @@
|
||||
<template>
|
||||
<!-- 首页优惠券卡片 -->
|
||||
<view class="coupon-box coreshop-margin-bottom-5 coreshop-padding-10" v-if="count">
|
||||
<!--提示框组件-->
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
|
||||
<u-toast ref="uToast" />
|
||||
<view class="head-box coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-margin-bottom-10">
|
||||
<view class="head-title u-ellipsis-1">领券专区</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">领券专区</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="$u.route('/pages/coupon/coupon')"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-margin-bottom-10 coreshop-bg-main coreshop-text-black">
|
||||
<scroll-view class="groupon-scroll" enable-flex scroll-anchoring scroll-x scroll-with-animation>
|
||||
<view class="groupon-card-wrap coreshop-flex coreshop-align-center">
|
||||
<view v-for="(item, index) in coreshopdata.parameters.list" :key="item.id">
|
||||
<!-- mini -->
|
||||
<!--<view class="coupon-card u-flex u-row-between u-m-r-16" v-if="couponType === 2" :style="{ background: `linear-gradient(to right, ${bgColor1}, ${bgColor2})` }">
|
||||
<view class="card-left u-flex-col u-row-center u-p-l-30">
|
||||
<view class="price coreshop-margin-bottom-10" :style="{ color: priceColor }">{{ item.amount }}</view>
|
||||
<view class="notice" :style="{ color: color }">满{{ item.enough }}元可用</view>
|
||||
<view class="notice coreshop-margin-bottom-10" :style="{ color: color }">仅剩{{ item.stock }}张</view>
|
||||
</view>
|
||||
<view class="card-right u-p-y-20 u-p-r-10 u-flex-col u-row-center u-col-center">
|
||||
<button class="u-reset-button get-btn coreshop-margin-bottom-10" :style="{ color: color }" @tap="getCoupon(item.id, index)">
|
||||
{{ item.status_code === 'cannot_get' ? '不可领取' : '领券购买' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>-->
|
||||
<!-- big -->
|
||||
<view v-for="(item, index) in coreshopData.parameters.list" :key="item.id">
|
||||
<view class="coreshop-padding-right-5">
|
||||
<view class="coupon-wrap " :style="{ background: `linear-gradient(to right, ${bgColor1}, ${bgColor2})` }">
|
||||
<view class="coupon-item coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between">
|
||||
<view class="coupon-left coreshop-flex coreshop-flex-direction">
|
||||
<view class="sum-box">
|
||||
<text class="unit" style="color: #6b3f12">¥</text>
|
||||
<!--<text class="sum " style="color: #6b3f12">{{ item.name }}</text>-->
|
||||
<text class="sub" style="color: #6b3f12">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="notice " style="color: #9d6d25">
|
||||
@@ -53,42 +40,32 @@
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopcoupon",
|
||||
name: "coreshopCoupon",
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
coreshopdata: {
|
||||
// type: Array,
|
||||
coreshopData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
if (!this.coreshopdata) {
|
||||
if (!this.coreshopData) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopdata.parameters) {
|
||||
if (!this.coreshopData.parameters) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopdata.parameters.list) {
|
||||
if (!this.coreshopData.parameters.list) {
|
||||
return false;
|
||||
}
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
coupons: [
|
||||
{
|
||||
color: '#9F6DFA', ltBg: "#FFFFFF", height: '90px',
|
||||
unit: "¥", number: 5, txt: "满50元可用", title: "全场通用券", desc: "有效期至 2018-05-20",
|
||||
btn: "领取", drawed: "已抢2100张"
|
||||
}
|
||||
]
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -99,32 +76,6 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 失效
|
||||
.gray-wrap { filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1) !important; -webkit-filter: grayscale(100%) !important; -moz-filter: grayscale(100%) !important; -ms-filter: grayscale(100%) !important; -o-filter: grayscale(100%) !important; filter: grayscale(100%) !important; filter: gray !important; }
|
||||
.groupon-scroll { height: 100px;
|
||||
.groupon-card-wrap { height: 100px; }
|
||||
}
|
||||
.coupon-box { background-color: #fff;
|
||||
.head-box {
|
||||
.head-title { width: 150px; font-size: 16px; font-weight: bold; color: #333333; }
|
||||
.head-more {
|
||||
.more-text { font-size: 11px; font-weight: 500; color: #333333; }
|
||||
.more-icon { color: #333333; font-size: 12px; }
|
||||
}
|
||||
}
|
||||
.coupon-card { width: 171.5px; height: 100px; background: linear-gradient(90deg, #f8dca5, #efc480); border-radius: 5px; mask: url($apiFilesUrl+'/static/images/coupon/coupon_mini_bg.png'); -webkit-mask-box-image: url($apiFilesUrl+'/static/images/coupon/coupon_mini_bg.png'); mask-size: 100% 100%;
|
||||
.card-left { height: 100%; width: 130px;
|
||||
.price { color: #4f3a1e; font-size: 15px; font-weight: bold;
|
||||
&::before { content: '¥'; font-size: 10px; }
|
||||
}
|
||||
.notice { font-size: 11px; font-weight: 500; color: #a8700d; }
|
||||
}
|
||||
.card-right { height: 100%; width: 30px;
|
||||
.get-btn { font-size: 12px; font-weight: 500; text-align: right; color: #a8700d; writing-mode: vertical-lr; /*从左向右 从右向左是 writing-mode: vertical-rl;*/ writing-mode: tb-lr; /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/ }
|
||||
}
|
||||
}
|
||||
}
|
||||
// 未领取,已领取
|
||||
.coupon-wrap { mask: url($apiFilesUrl+'/static/images/coupon/coupon_bg1.png'); -webkit-mask-box-image: url($apiFilesUrl+'/static/images/coupon/coupon_bg1.png'); mask-size: 100% 100%; position: relative; border-radius: 5px; width: 355px; height: 100px; background: linear-gradient(to right, $u-type-warning-disabled, $u-type-warning);
|
||||
.coupon-item { width: 100%; height: 100%; border-radius: 5px;
|
||||
.coupon-left { justify-content: center; padding-left: 10px; padding-right: 5px;
|
||||
|
||||
@@ -1,91 +1,135 @@
|
||||
<template>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18">
|
||||
<u-tabs :list="nameList" :current="current" @change="onChange"></u-tabs>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
|
||||
<view class="coreshop-text-black">
|
||||
<custom-waterfalls-flow :value="newData.list" :column="newData.column" @wapperClick="wapperClick" @imageClick="imageClick" v-if="newData.column>1">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="goods coreshop-padding-bottom-10 coreshop-bg-main" v-for="(item,index) in newData.list" :key="index" slot="slot{{index}}">
|
||||
<view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-main coreshop-border-radius-bl-18">
|
||||
<view class="coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-14">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center coreshop-margin-bottom-5">
|
||||
<view class="coreshop-text-red coreshop-font-weight-bold">
|
||||
<text class="coreshop-font-12">¥</text>
|
||||
<text class="coreshop-font-16">{{item.price}}</text>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="newData.column==2">{{item.mktprice}}元</span>
|
||||
</view>
|
||||
<view>
|
||||
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-divider" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-margin-bottom-5" :class="newData.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view>
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5 coreshop-margin-bottom-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
<view>
|
||||
购买赠送:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{item.points}}{{ pointShowName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<template v-slot:default="item">
|
||||
<view class="goods">
|
||||
<view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-white coreshop-border-radius-bl-18">
|
||||
<view class="coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-14">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center coreshop-margin-bottom-5">
|
||||
<view class="coreshop-text-red coreshop-font-weight-bold">
|
||||
<text class="coreshop-font-12">¥</text>
|
||||
<text class="coreshop-font-16">{{item.price}}</text>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="newData.column==2">{{item.mktprice}}元</span>
|
||||
</view>
|
||||
<view>
|
||||
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-divider" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-margin-bottom-5" :class="newData.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view>
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5 coreshop-margin-bottom-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
<view>
|
||||
购买赠送:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{item.points}}{{ pointShowName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- #endif -->
|
||||
</custom-waterfalls-flow>
|
||||
|
||||
<u-tabs :list="nameList" :current="current" @change="change"></u-tabs>
|
||||
|
||||
<view v-for="(child,indexP) in newData.parameters.list" :key="indexP">
|
||||
<view class="goodsBox" v-show="child.isShow==true">
|
||||
<!-- 列表平铺两列三列 -->
|
||||
<view v-if="child.column == '2' || child.column == '3' " v-bind:class="'column'+child.column">
|
||||
<view class="" v-if="child.list">
|
||||
<u-grid :col="child.column" :border="false" align="left">
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding: '0rpx'}" v-for="(item, index) in child.list" :key="index" @click="goGoodsDetail(item.id)">
|
||||
<view class="good_box">
|
||||
<u--image :src="item.image" mode="widthFix" width="100%" :height="child.column==2?'164px':'104px'" radius="10"></u--image>
|
||||
<view class="good_title u-line-2">
|
||||
{{item.name}}
|
||||
<view class="coreshop-text-black" v-for="(item, index) in newData.list" :key="item.id" v-if="newData.column==1">
|
||||
<view class="coreshop-flex coreshop-justify-start coreshop-padding-top-10 coreshop-padding-bottom-10" v-if="newData.list.length">
|
||||
<view>
|
||||
<u--image :src="item.image" mode="widthFix" width="130px" height="130px" radius="8"></u--image>
|
||||
</view>
|
||||
<view class="good-price coreshop-display-block">
|
||||
{{item.price}}元 <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5 coreshop-text-gray">{{item.mktprice}}元</span>
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10">
|
||||
<view class="coreshop-font-14 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.brief }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-10">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已售{{item.buyCount}}{{item.unit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.viewCount}}人访问</view>
|
||||
</view>
|
||||
<view class="good-tag-recommend" v-if="item.isRecommend">
|
||||
推荐
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{ item.price }}</view>
|
||||
<view class="coreshop-font-12 coreshop-text-gray coreshop-text-through">¥{{ item.mktprice }}</view>
|
||||
</view>
|
||||
<view class="good-tag-hot" v-if="item.isHot">
|
||||
热门
|
||||
<view class="coreshop-buy-btn" @tap="goPinTuanDetail(item.id,item.pinTuanRule.id)">立即购</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
<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 v-else-if="!count && !child.listAjax">
|
||||
<u-grid col="3" border="false" align="center">
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding: '0rpx'}" v-for="item in 3" :key="item" @click="goGoodsDetail(item.id)">
|
||||
<view class="good_box">
|
||||
<u--image src="/static/images/common/empty.png" mode="widthFix" width="100%" radius="10"></u--image>
|
||||
<view class="good_title u-line-2">
|
||||
无
|
||||
</view>
|
||||
<view class="good-price">
|
||||
0元
|
||||
</view>
|
||||
<view class="good-tag-recommend">
|
||||
推荐
|
||||
</view>
|
||||
<view class="good-tag-hot">
|
||||
热门
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
<view>
|
||||
购买赠送:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{item.points}}{{ pointShowName}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表平铺单列 -->
|
||||
<view v-if="child.column == '1'">
|
||||
<view v-if="child.list">
|
||||
<u-grid :col="1" :border="false" align="left">
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding: '0rpx'}" v-for="item in child.list" :key="item.id" @click="goGoodsDetail(item.id)">
|
||||
<view class="good_box">
|
||||
<u-row gutter="5" justify="space-between">
|
||||
<u-col span="4">
|
||||
<u--image :src="item.image" mode="widthFix" width="100%" radius="10"></u--image>
|
||||
<view class="good-tag-recommend2" v-if="item.isRecommend">
|
||||
推荐
|
||||
</view>
|
||||
<view class="good-tag-hot" v-if="item.isHot">
|
||||
热门
|
||||
</view>
|
||||
</u-col>
|
||||
<u-col span="8">
|
||||
<view class="good_title-xl u-line-3 u-padding-10">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="good-price u-padding-10">
|
||||
{{item.price}}元 <span class="u-font-xs coreshop-text-through u-margin-left-15 coreshop-text-gray">{{item.mktprice}}元</span>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
<view class="order-none" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无" mode="list"></u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -98,41 +142,55 @@
|
||||
newData: {}
|
||||
};
|
||||
},
|
||||
name: "coreshopgoodTabBar",
|
||||
name: "coreshopGoodTabBar",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var _this = this;
|
||||
this.newData = this.coreshopdata;
|
||||
for (var i = 0; i < this.newData.parameters.list.length; i++) {
|
||||
this.newData = this.coreshopData;
|
||||
for (var i = 0; i < this.coreshopData.parameters.list.length; i++) {
|
||||
let item = {
|
||||
name: this.newData.parameters.list[i].title
|
||||
name: this.coreshopData.parameters.list[i].title
|
||||
}
|
||||
this.nameList.push(item);
|
||||
|
||||
if (_this.current == i) {
|
||||
_this.newData.parameters.list[i].isShow = true;
|
||||
} else {
|
||||
_this.newData.parameters.list[i].isShow = false;
|
||||
_this.newData = this.coreshopData.parameters.list[i];
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
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 },
|
||||
pointGetModel() { return this.$store.state.config.pointGetModel },
|
||||
pointShowPoint() { return this.$store.state.config.pointShowPoint },
|
||||
},
|
||||
methods: {
|
||||
change(item) {
|
||||
wapperClick(item) {
|
||||
this.goGoodsDetail(item.id)
|
||||
},
|
||||
imageClick(item) {
|
||||
this.goGoodsDetail(item.id)
|
||||
},
|
||||
onChange(item) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
});
|
||||
var _this = this;
|
||||
this.current = item.index;
|
||||
for (var i = 0; i < _this.newData.parameters.list.length; i++) {
|
||||
for (var i = 0; i < _this.coreshopData.parameters.list.length; i++) {
|
||||
if (_this.current == i) {
|
||||
_this.newData.parameters.list[i].isShow = true;
|
||||
} else {
|
||||
_this.newData.parameters.list[i].isShow = false;
|
||||
_this.newData = this.coreshopData.parameters.list[i];
|
||||
setTimeout(function () {
|
||||
uni.hideLoading();
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,4 +214,5 @@
|
||||
.indicator-dots-active { background-color: $u-type-primary; }
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
<template>
|
||||
|
||||
<view class="goodsBox coreshop-margin-bottom-10 coreshop-padding-top-5">
|
||||
<view>
|
||||
<!-- 列表平铺两列三列 -->
|
||||
<view v-if="coreshopdata.parameters.column == '2' && coreshopdata.parameters.display == 'list' || coreshopdata.parameters.column == '3' && coreshopdata.parameters.display == 'list'" v-bind:class="'column'+coreshopdata.parameters.column">
|
||||
<view class="coreshop-margin-left-5 coreshop-margin-right-5 coreshop-margin-top-10 coreshop-margin-bottom-10 " v-if="coreshopdata.parameters.lookTitle == 'true'">
|
||||
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" v-if="coreshopdata.parameters.title != '' && coreshopdata.parameters.lookTitle == 'true'" @click="coreshopdata.parameters.lookMore == 'true' ? goGoodsList({catId: coreshopdata.parameters.classifyId,brandId:coreshopdata.parameters.brandId}) :''" :arrow="coreshopdata.parameters.lookMore == 'true'" :sub-title="coreshopdata.parameters.lookMore == 'true'?'更多':''"></coreshop-section>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="coreshopData.parameters.column == '2' && coreshopData.parameters.display == 'list' || coreshopData.parameters.column == '3' && coreshopData.parameters.display == 'list'">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30" v-if="coreshopData.parameters.lookTitle == 'true'">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" v-if="coreshopData.parameters.lookMore == 'true'" @click="goGoodsList({catId: coreshopData.parameters.classifyId,brandId:coreshopData.parameters.brandId})"></u-icon>
|
||||
</view>
|
||||
<view class=" coreshop-margin-bottom-10 coreshop-margin-top-10" v-if="count">
|
||||
<custom-waterfalls-flow :value="coreshopdata.parameters.list" :column="coreshopdata.parameters.column" @wapperClick="wapperClick" @imageClick="imageClick">
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-text-black">
|
||||
<custom-waterfalls-flow :value="coreshopData.parameters.list" :column="coreshopData.parameters.column" @wapperClick="wapperClick" @imageClick="imageClick">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="goods" v-for="(item,index) in coreshopdata.parameters.list" :key="index" slot="slot{{index}}">
|
||||
<view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-white coreshop-border-radius-bl-18">
|
||||
<view class="goods coreshop-padding-bottom-10 coreshop-bg-main" v-for="(item,index) in coreshopData.parameters.list" :key="index" slot="slot{{index}}">
|
||||
<view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-main coreshop-border-radius-bl-18">
|
||||
<view class="coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-14">{{item.name}}</text>
|
||||
</view>
|
||||
@@ -18,18 +21,21 @@
|
||||
<view class="coreshop-text-red coreshop-font-weight-bold">
|
||||
<text class="coreshop-font-12">¥</text>
|
||||
<text class="coreshop-font-16">{{item.price}}</text>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="coreshopdata.parameters.column==2">{{item.mktprice}}元</span>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="coreshopData.parameters.column==2">{{item.mktprice}}元</span>
|
||||
</view>
|
||||
<view>
|
||||
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-padding-top-10 coreshop-solid-top coreshop-margin-bottom-5" :class="coreshopdata.parameters.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="coreshop-divider" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-margin-bottom-5" :class="coreshopData.parameters.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view>
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ $common.formatMoney(item.price - item.pointsDeduction, 2, '')}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}}元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5 coreshop-margin-bottom-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -54,18 +60,21 @@
|
||||
<view class="coreshop-text-red coreshop-font-weight-bold">
|
||||
<text class="coreshop-font-12">¥</text>
|
||||
<text class="coreshop-font-16">{{item.price}}</text>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="coreshopdata.parameters.column==2">{{item.mktprice}}元</span>
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="coreshopData.parameters.column==2">{{item.mktprice}}元</span>
|
||||
</view>
|
||||
<view>
|
||||
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-padding-top-10 coreshop-solid-top coreshop-margin-bottom-5" :class="coreshopdata.parameters.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="coreshop-divider" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-font-11 coreshop-margin-top-10 coreshop-margin-bottom-5" :class="coreshopData.parameters.column>2?'coreshop-flex-direction-column':'coreshop-flex-direction-row'" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
|
||||
<view>
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ $common.formatMoney(item.price - item.pointsDeduction, 2, '')}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}}元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5 coreshop-margin-bottom-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -81,41 +90,44 @@
|
||||
</template>
|
||||
<!-- #endif -->
|
||||
</custom-waterfalls-flow>
|
||||
|
||||
|
||||
</view>
|
||||
<view v-else-if="!count && !coreshopdata.parameters.listAjax">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表平铺单列 -->
|
||||
<view v-if="coreshopdata.parameters.column == '1' && coreshopdata.parameters.display == 'list'">
|
||||
<view class="coreshop-margin-left-5 coreshop-margin-right-5 coreshop-margin-top-10 coreshop-margin-bottom-10 ">
|
||||
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" v-if="coreshopdata.parameters.title != '' && coreshopdata.parameters.lookTitle == 'true'" @click="coreshopdata.parameters.lookMore == 'true' ? goGoodsList({catId: coreshopdata.parameters.classifyId,brandId:coreshopdata.parameters.brandId}) :''" :arrow="coreshopdata.parameters.lookMore == 'true'" :sub-title="coreshopdata.parameters.lookMore == 'true'?'更多':''"></coreshop-section>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="coreshopData.parameters.column == '1' && coreshopData.parameters.display == 'list'">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30" v-if="coreshopData.parameters.lookTitle == 'true'">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" v-if="coreshopData.parameters.lookMore == 'true'" @click="goGoodsList({catId: coreshopData.parameters.classifyId,brandId:coreshopData.parameters.brandId})"></u-icon>
|
||||
</view>
|
||||
<view v-if="count">
|
||||
<u-grid :col="1" :border="false" align="left">
|
||||
<u-grid-item :custom-style="{padding: '0px'}" v-for="item in coreshopdata.parameters.list" :key="item.id">
|
||||
<view class="good_box" @click="goGoodsDetail(item.id)">
|
||||
<u--image :src="item.image" width="100%" radius="10"></u--image>
|
||||
<view class="good_title u-line-2">
|
||||
{{item.name}}
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="good-price coreshop-display-block">
|
||||
{{item.price}}元 <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5 coreshop-text-gray">{{item.mktprice}}元</span>
|
||||
<view class="coreshop-text-black" v-for="(item, index) in coreshopData.parameters.list" :key="item.id" v-if="count">
|
||||
<view class="coreshop-flex coreshop-justify-start coreshop-padding-top-10 coreshop-padding-bottom-10">
|
||||
<view>
|
||||
<u--image :src="item.image" mode="widthFix" width="130px" height="130px" radius="8"></u--image>
|
||||
</view>
|
||||
<view class="good-tag-recommend" v-if="item.isRecommend">
|
||||
推荐
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
|
||||
<view class="coreshop-font-14 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.brief }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-10">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已售{{item.buyCount}}{{item.unit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.viewCount}}人访问</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{ item.price }}</view>
|
||||
<view class="coreshop-font-12 coreshop-text-gray coreshop-text-through">¥{{ item.mktprice }}</view>
|
||||
</view>
|
||||
<view class="coreshop-buy-btn" @tap="goGoodsDetail(item.id)">马上抢</view>
|
||||
</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 class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -127,8 +139,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
<view class="order-none" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无" mode="list"></u-empty>
|
||||
@@ -136,18 +146,21 @@
|
||||
</view>
|
||||
|
||||
<!-- 横向滚动 -->
|
||||
<block v-if="coreshopdata.parameters.display == 'slide'"
|
||||
v-bind:class="'slide'+coreshopdata.parameters.column">
|
||||
<view class="coreshop-margin-left-15 coreshop-margin-right-15 coreshop-margin-top-15 coreshop-margin-bottom-15" v-if="coreshopdata.parameters.lookTitle == 'true'">
|
||||
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" v-if="coreshopdata.parameters.title != '' && coreshopdata.parameters.lookTitle == 'true'" @click="coreshopdata.parameters.lookMore == 'true' ? goGoodsList({catId: coreshopdata.parameters.classifyId,brandId:coreshopdata.parameters.brandId}) :''" :arrow="coreshopdata.parameters.lookMore == 'true'" :sub-title="coreshopdata.parameters.lookMore == 'true'?'更多':''"></coreshop-section>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="coreshopData.parameters.display == 'slide'">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30" v-if="coreshopData.parameters.lookTitle == 'true'">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" v-if="coreshopData.parameters.lookMore == 'true'" @click="goGoodsList({catId: coreshopData.parameters.classifyId,brandId:coreshopData.parameters.brandId})"></u-icon>
|
||||
</view>
|
||||
<block v-if="count">
|
||||
<swiper :class="coreshopdata.parameters.column==3?'swiper3':coreshopdata.parameters.column==2?'swiper2':''" @change="change">
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view v-if="count">
|
||||
<swiper :class="coreshopData.parameters.column==3?'swiper3':coreshopData.parameters.column==2?'swiper2':''" @change="change">
|
||||
<swiper-item v-for="no of pageCount" :key="no">
|
||||
<u-grid :col="coreshopdata.parameters.column" :border="false" align="left" :data-id="no">
|
||||
<u-grid-item v-for="(item, index) in coreshopdata.parameters.list" v-if="index >=coreshopdata.parameters.column*no && index <coreshopdata.parameters.column*(no+1)" :key="index" @click="goGoodsDetail(item.id)">
|
||||
<u-grid :col="coreshopData.parameters.column" :border="false" align="left" :data-id="no">
|
||||
<u-grid-item v-for="(item, index) in coreshopData.parameters.list" v-if="index >=coreshopData.parameters.column*no && index <coreshopData.parameters.column*(no+1)" :key="index" @click="goGoodsDetail(item.id)">
|
||||
<view class="good_box">
|
||||
<u-image :src="item.image" :index="item.id" mode="widthFit" width="100%" :height="coreshopdata.parameters.column==3?'104px':coreshopdata.parameters.column==2?'164px':'104px'" radius="10">
|
||||
<u-image :src="item.image" :index="item.id" mode="widthFit" width="100%" :height="coreshopData.parameters.column==3?'104px':coreshopData.parameters.column==2?'164px':'104px'" radius="10">
|
||||
</u-image>
|
||||
<view class="good_title u-line-2">
|
||||
{{item.name}}
|
||||
@@ -166,7 +179,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -186,12 +199,15 @@
|
||||
<view class="indicator-dots-item" v-for="no of pageCount" :key="no" :class="[current == no ? 'indicator-dots-active' : '']">
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-else="">
|
||||
<scroll-view class='swiper-list' scroll-x="true"></scroll-view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -204,20 +220,9 @@
|
||||
count: false
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
substr(val) {
|
||||
if (val.length == 0 || val == undefined) {
|
||||
return false;
|
||||
} else if (val.length > 13) {
|
||||
return val.substring(0, 13) + "...";
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
},
|
||||
name: "coreshopgoods",
|
||||
name: "coreshopGoods",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: true,
|
||||
}
|
||||
@@ -243,9 +248,9 @@
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.count = this.coreshopdata.parameters.list.length > 0;
|
||||
var page = Number(this.coreshopdata.parameters.list.length / this.coreshopdata.parameters.column).toFixed(0);
|
||||
if (this.coreshopdata.parameters.column * page < this.coreshopdata.parameters.list.length) {
|
||||
this.count = this.coreshopData.parameters.list.length > 0;
|
||||
var page = Number(this.coreshopData.parameters.list.length / this.coreshopData.parameters.column).toFixed(0);
|
||||
if (this.coreshopData.parameters.column * page < this.coreshopData.parameters.list.length) {
|
||||
page = Number(page) + 1;
|
||||
}
|
||||
for (var i = 0; i < page; i++) {
|
||||
@@ -256,10 +261,8 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goodsBox { color: #333333 !important; padding: 0 5px; overflow: hidden;
|
||||
.good_box { border-radius: 8px; margin: 3px; background-color: #ffffff; padding: 5px; position: relative; width: 100%;
|
||||
.good_title { font-size: 13px; margin-top: 5px; color: $u-main-color; }
|
||||
.good_title-xl { font-size: 14px; margin-top: 5px; color: $u-main-color; }
|
||||
.good_box { border-radius: 8px; background-color: #ffffff; padding: 5px; position: relative; width: 100%;
|
||||
.good_title { font-size: 14px; margin-top: 5px; color: $u-main-color; }
|
||||
.good-tag-hot { display: flex; margin-top: 5px; position: absolute; top: 7.5px; left: 7.5px; background-color: $u-type-error; color: #FFFFFF; display: flex; align-items: center; padding: 2px 7px; border-radius: 25px; font-size: 10px; line-height: 1; }
|
||||
.good-tag-recommend { display: flex; margin-top: 5px; position: absolute; top: 7.5px; right: 7.5px; background-color: $u-type-primary; color: #FFFFFF; margin-left: 10px; border-radius: 25px; line-height: 1; padding: 2px 7px; display: flex; align-items: center; border-radius: 25px; font-size: 10px; }
|
||||
.good-tag-recommend2 { display: flex; margin-top: 5px; position: absolute; bottom: 7.5px; left: 7.5px; background-color: $u-type-primary; color: #FFFFFF; border-radius: 25px; line-height: 1; padding: 2px 7px; display: flex; align-items: center; border-radius: 25px; font-size: 10px; }
|
||||
@@ -270,7 +273,6 @@
|
||||
.indicator-dots-item { background-color: $u-tips-color; height: 6px; width: 6px; border-radius: 10px; margin: 0 3px; }
|
||||
.indicator-dots-active { background-color: $u-type-primary; }
|
||||
}
|
||||
}
|
||||
.swiper3 { height: 200px; }
|
||||
.swiper2 { height: 270px; }
|
||||
.image2 { height: 150px; }
|
||||
|
||||
@@ -1,75 +1,132 @@
|
||||
<template>
|
||||
<!-- 团购秒杀 -->
|
||||
<view v-if="count">
|
||||
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-top-10 coreshop-margin-bottom-10">
|
||||
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" @click="goSeckillList()"></coreshop-section>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="listData && count">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goGroupPurchase()"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-margin-left-15 coreshop-margin-right-15" v-if="coreshopdata.parameters.list && count">
|
||||
<view class="img-list-item" v-if="item.id !== 'undefined' && item.id" v-for="(item, key) in coreshopdata.parameters.list" :key="key" @click="goSeckillDetail(item.goods.id, item.goods.groupId)">
|
||||
<view class="img-list-item-l">
|
||||
<u-image :src="item.goods.image" :index="item.id" :showLoading="true" width="100%" height="96px"></u-image>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="img-list-item-r">
|
||||
<view class="coreshop-font-18 u-line-1">{{item.name}}</view>
|
||||
<view class="u-line-2 coreshop-margin-top-5 coreshop-margin-bottom-5">{{item.goods.name}}</view>
|
||||
<view class="item-c coreshop-flex coreshop-justify-between">
|
||||
<view class="red-price coreshop-justify-between">
|
||||
¥{{item.goods.product.price}}
|
||||
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}元</span>
|
||||
<view class="coreshop-flex-direction-row coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key">
|
||||
<view class="coreshop-flex coreshop-justify-start">
|
||||
<view>
|
||||
<u--image :src="item.goods.image" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-justify-between">
|
||||
<view class="red-price coreshop-font-15 coreshop-flex-direction-row" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime" format="HH:mm:ss"></u-count-down>
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
|
||||
<view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.goods.name }}</view>
|
||||
<!--<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxBuyNumber>0">限购{{item.maxBuyNumber}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxBuyNumber==0">不限购</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.ticketNumber}}张券</view>
|
||||
</view>-->
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<view class="coreshop-font-12 red-price" v-if="item.startStatus == 3">已结束</view>
|
||||
<view class="coreshop-font-12 red-price" v-if="item.startStatus == 2">即将开始</view>
|
||||
<u-icon name="shopping-cart" color="#2979ff" size="25" class="btnCart"></u-icon>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 2) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time">
|
||||
<view class="coreshop-font-12">即将开始:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.goods.product.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 1" @click="goGroupBuyingDetail(item.id)">立即团</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
<view class="coreshop-buy-btn-disabled" v-if="item.startStatus == 2">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-list-item" v-if="!item.id" v-for="(item, key) in coreshopdata.parameters.list" :key="key">
|
||||
<image class="img-list-item-l" :src="item.image== '/images/empty-banner.png'? '/static/images/common/empty-banner.png':item.image" mode='aspectFill'></image>
|
||||
<view class="img-list-item-r">
|
||||
<view class="goods-name list-goods-name">{{item.name}}</view>
|
||||
<view class="item-c">
|
||||
<view class=" red-price">{{item.price}}</view>
|
||||
<view v-if="key+1 < listData.length">
|
||||
<view class="coreshop-divider">
|
||||
<view class="groupPurchase"></view>
|
||||
<view class="dot">●</view>
|
||||
<view class="groupPurchase"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopgrouppurchase",
|
||||
name: "coreshopGroupPurchase",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listData = uni.$u.deepClone(this.coreshopData.parameters.list);
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
if (!this.coreshopdata) {
|
||||
if (!this.coreshopData) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopdata.parameters) {
|
||||
if (!this.coreshopData.parameters) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopdata.parameters.list) {
|
||||
if (!this.coreshopData.parameters.list) {
|
||||
return false;
|
||||
}
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
end(index) {
|
||||
let _that = this;
|
||||
_that.list.splice(index, 1)
|
||||
}
|
||||
},
|
||||
onChange(e, key) {
|
||||
this.$set(this.listData[key], 'timeData', e)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -80,7 +137,6 @@
|
||||
.img-list-item-r { width: calc(100% - 120px); display: inline-block; margin-left: 7.5px; float: left; position: relative;
|
||||
.description { font-size: 12px; color: #929292; }
|
||||
.item-c { width: 100%; margin-top: 0;
|
||||
.red-price { color: #FF7159 !important; }
|
||||
.btnCart { float: right; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<!-- 单图 -->
|
||||
<view class="coreshop-imgsingle coreshop-bg-white" v-if="coreshopdata.parameters.list && coreshopdata.parameters.list.length > 0">
|
||||
<view class="" v-for="child in coreshopdata.parameters.list">
|
||||
<view class="coreshop-imgsingle coreshop-bg-white" v-if="listData && listData.length > 0">
|
||||
<view class="" v-for="child in listData">
|
||||
<view @click="taped(child)">
|
||||
<image class="ad-img" :src="child.image" mode="widthFix"></image>
|
||||
</view>
|
||||
@@ -14,19 +14,21 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopimgsingle",
|
||||
name: "coreshopImgSingle",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
// type: Object,
|
||||
coreshopData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
// console.log(coreshopdata)
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
data() {
|
||||
return {
|
||||
count: 0,
|
||||
listData: [],
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.listData = this.coreshopData;
|
||||
},
|
||||
methods: {
|
||||
taped(item) {
|
||||
@@ -40,7 +42,7 @@
|
||||
.coreshop-imgsingle { overflow: hidden; position: relative;
|
||||
.ad-img { width: 100%; float: left; }
|
||||
.ad-img:last-child { margin-bottom: 0; }
|
||||
.imgup-btn { position: absolute; z-index: 668; bottom: 40px; left: 20px;
|
||||
.imgup-btn { position: absolute; z-index: 1; bottom: 10px; width: 100%; min-height: 30px; text-align: center;
|
||||
.coreshop-btn { line-height: 2; font-size: 14px; padding: 0 25px; border-radius: 25px; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white">
|
||||
<u-swiper :list="swiperItems" :height="swiperHeight" :interval="swiperDuration" keyName="image" @click="taped" indicator indicatorMode="line" circular></u-swiper>
|
||||
<view class="coreshop-bg-white">
|
||||
<u-swiper :list="swiperItems" :height="swiperHeight" :interval="swiperDuration" keyName="image" @click="onClicked" indicator indicatorMode="line" circular radius="0"></u-swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopimgSlide",
|
||||
name: "coreshopImgSlide",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
// type: Object,
|
||||
coreshopData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
@@ -22,15 +22,14 @@
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.list.length > 0)
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
var data = this.coreshopdata.parameters.list;
|
||||
var data = this.coreshopData.list;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
let moder = {
|
||||
image: data[i].image == '/images/empty-banner.png' ? '/static/images/common/empty-banner.png' : data[i].image,
|
||||
image: data[i].image,
|
||||
opentype: 'click',
|
||||
url: '',
|
||||
title: data[i].linkType,
|
||||
@@ -39,12 +38,11 @@
|
||||
}
|
||||
this.swiperItems.push(moder);
|
||||
}
|
||||
this.swiperHeight = this.coreshopdata.parameters.height;
|
||||
this.swiperDuration = this.coreshopdata.parameters.duration;
|
||||
this.swiperHeight = this.coreshopData.height;
|
||||
this.swiperDuration = this.coreshopData.duration;
|
||||
},
|
||||
watch: {},
|
||||
methods: {
|
||||
taped: function (e) {
|
||||
onClicked: function (e) {
|
||||
this.showSliderInfo(this.swiperItems[e].linkType, this.swiperItems[e].linkValue);
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,48 +1,55 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10">
|
||||
<u-grid :border="false" align="left" :col="coreshopdata.parameters.style" v-if="coreshopdata.parameters.style == '2' ||coreshopdata.parameters.style == '3' ||coreshopdata.parameters.style == '4'">
|
||||
<u-grid-item bg-color="transparent" v-for="(item, index) in coreshopdata.parameters.list" :key="index" :custom-style="{padding:coreshopdata.parameters.margin+'px'}">
|
||||
<image :src="item.image" mode="widthFix" @click="showSliderInfo(item.linkType, item.linkValue)" style="width:100%;"></image>
|
||||
<u-grid :border="false" align="left" :col="coreshopData.parameters.style" v-if="coreshopData.parameters.style == '2' ||coreshopData.parameters.style == '3' ||coreshopData.parameters.style == '4'">
|
||||
<u-grid-item bg-color="transparent" v-for="(item, index) in coreshopData.parameters.list" :key="index" :custom-style="{padding:coreshopData.parameters.margin+'px'}">
|
||||
<image :src="item.image" mode="widthFix" @click="showSliderInfo(item.linkType, item.linkValue)" style="width: 100%;"></image>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
<u-grid :border="false" align="left" :col="2" v-if="coreshopdata.parameters.style == '0'">
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}">
|
||||
<image :src="coreshopdata.parameters.list[0].image" mode="widthFix" v-if="coreshopdata.parameters.list[0]" @click="showSliderInfo(coreshopdata.parameters.list[0].linkType, coreshopdata.parameters.list[0].linkValue)" class="coreshop-percent-100"></image>
|
||||
</u-grid-item>
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}">
|
||||
<image :src="coreshopdata.parameters.list[1].image" mode="widthFix" v-if="coreshopdata.parameters.list[1]" @click="showSliderInfo(coreshopdata.parameters.list[1].linkType, coreshopdata.parameters.list[1].linkValue)" class="coreshop-percent-100"></image>
|
||||
<u-grid :border="false" align="left" :col="2">
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}">
|
||||
<image :src="coreshopdata.parameters.list[2].image" mode="widthFix" v-if="coreshopdata.parameters.list[2]" @click="showSliderInfo(coreshopdata.parameters.list[2].linkType, coreshopdata.parameters.list[2].linkValue)" class="coreshop-percent-100"></image>
|
||||
</u-grid-item>
|
||||
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}">
|
||||
<image :src="coreshopdata.parameters.list[3].image" mode="widthFix" v-if="coreshopdata.parameters.list[3]" @click="showSliderInfo(coreshopdata.parameters.list[3].linkType, coreshopdata.parameters.list[3].linkValue)" class="coreshop-percent-100"></image>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between mainWindow" v-if="coreshopData.parameters.style == '0'">
|
||||
<view class="left" :style="{paddingRight:coreshopData.parameters.margin+'px'}">
|
||||
<u--image :src="coreshopData.parameters.list[0].image" height="200px" width="100%" v-if="coreshopData.parameters.list[0]" @click="showSliderInfo(coreshopData.parameters.list[0].linkType, coreshopData.parameters.list[0].linkValue)"></u--image>
|
||||
</view>
|
||||
<view class="right" :style="{paddingLeft:coreshopData.parameters.margin+'px'}">
|
||||
<view>
|
||||
<u--image :src="coreshopData.parameters.list[1].image" height="120px" width="100%" v-if="coreshopData.parameters.list[1]" @click="showSliderInfo(coreshopData.parameters.list[1].linkType, coreshopData.parameters.list[1].linkValue)"></u--image>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between" :style="{marginTop:coreshopData.parameters.margin +'px'}">
|
||||
<view :style="{paddingRight:coreshopData.parameters.margin / 2+'px'}" class="minBox">
|
||||
<u--image :src="coreshopData.parameters.list[2].image" :height="(200-120-coreshopData.parameters.margin)+'px'" width="100%" v-if="coreshopData.parameters.list[2]" @click="showSliderInfo(coreshopData.parameters.list[2].linkType, coreshopData.parameters.list[2].linkValue)"></u--image>
|
||||
</view>
|
||||
<view :style="{paddingLeft:coreshopData.parameters.margin / 2+'px'}" class="minBox">
|
||||
<u--image :src="coreshopData.parameters.list[3].image" :height="(200-120-coreshopData.parameters.margin)+'px'" width="100%" v-if="coreshopData.parameters.list[3]" @click="showSliderInfo(coreshopData.parameters.list[3].linkType, coreshopData.parameters.list[3].linkValue)"></u--image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopimgwindow",
|
||||
name: "coreshopImgWindow",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Object,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
padding: '3'
|
||||
height: 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
.mainWindow { width: 100%; height: 200px;
|
||||
.left { width: 50%; height: 200px; }
|
||||
.right { width: 50%; height: 200px; }
|
||||
.minBox { width: 50%; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<view class=" coreshop-margin-bottom-5 coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-bg-white">
|
||||
<view class=" coreshop-margin-bottom-10 coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-bg-white">
|
||||
<u-grid :col="limit" :border="false">
|
||||
<u-grid-item v-for="(item, index) in ListData" :key="index" @click="showSliderInfo(item.linkType, item.linkValue)">
|
||||
<view class="coreshop-padding-bottom-10 coreshop-padding-top-10">
|
||||
<u-icon :name="item.image" width="40" height="40" :label="item.text" :labelSize="13" labelPos="bottom" :top="25" space="10"></u-icon>
|
||||
<u-icon :name="item.image" width="50" height="50" :label="item.text" :labelSize="13" labelPos="bottom" :top="25" space="10"></u-icon>
|
||||
</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
@@ -11,12 +11,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { navLinkType } from '@/common/setting/constVarsHelper.js';
|
||||
export default {
|
||||
name: "coreshopnavbar",
|
||||
name: "coreshopData",
|
||||
components: {},
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Object,
|
||||
required: true,
|
||||
}
|
||||
@@ -35,8 +34,8 @@
|
||||
|
||||
},
|
||||
created() {
|
||||
this.ListData = this.coreshopdata.parameters.list;
|
||||
this.limit = this.coreshopdata.parameters.limit;
|
||||
this.ListData = this.coreshopData.parameters.list;
|
||||
this.limit = this.coreshopData.parameters.limit;
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
|
||||
@@ -1,37 +1,35 @@
|
||||
<template>
|
||||
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white" v-if="count > 0">
|
||||
<u-notice-bar :text="model.text" @click="goNoticeList()"></u-notice-bar>
|
||||
<u-notice-bar :text="notcieText" url="/pages/notice/list/list" bgColor="#ffffff" color="#333333"></u-notice-bar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopnotice",
|
||||
name: "coreshopNotice",
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
text: "",
|
||||
},
|
||||
notcieText: "",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var data = this.coreshopdata.parameters.list;
|
||||
if (data.length > 0) {
|
||||
this.model.text = data[0].title;
|
||||
if (this.coreshopData.length > 0) {
|
||||
for (var i = 0; i < this.coreshopData.length; i++) {
|
||||
this.notcieText += this.coreshopData[i].title + '【' + this.$u.timeFormat(this.coreshopData[i].createTime, 'yyyy年mm月dd日') + '】' + '\u00A0\u00A0\u00A0\u00A0\u00A0';
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.length > 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,99 +1,105 @@
|
||||
<template>
|
||||
<view>
|
||||
<block v-for="(item,index) in coreshopdata" :key="index">
|
||||
<!--搜索(修复)-->
|
||||
<coreshopsearch :coreshopdata="item" v-if="item.widgetCode=='search' "></coreshopsearch>
|
||||
<!--切换-->
|
||||
<coreshoptabbar :coreshopdata="item" v-if="item.widgetCode=='tabBar' "></coreshoptabbar>
|
||||
<!--公告(修复)-->
|
||||
<coreshopnotice :coreshopdata="item" v-if="item.widgetCode=='notice' "></coreshopnotice>
|
||||
<!--图片轮播(修复)-->
|
||||
<coreshopimgSlide :coreshopdata="item" v-if="item.widgetCode=='imgSlide' "></coreshopimgSlide>
|
||||
<!--优惠券(修复)-->
|
||||
<coreshopcoupon :coreshopdata="item" v-if="item.widgetCode=='coupon' "></coreshopcoupon>
|
||||
<!--空格(修复)-->
|
||||
<coreshopblank :coreshopdata="item" v-if="item.widgetCode=='blank' "></coreshopblank>
|
||||
<!--多行文本输入区(修复)-->
|
||||
<coreshoptextarea :coreshopdata="item" v-if="item.widgetCode=='textarea' "></coreshoptextarea>
|
||||
<!--视频(修复)-->
|
||||
<coreshopvideo :coreshopdata="item" v-if="item.widgetCode=='video' "></coreshopvideo>
|
||||
<!--图片集(修复)-->
|
||||
<coreshopimgWindow :coreshopdata="item" v-if="item.widgetCode=='imgWindow' "></coreshopimgWindow>
|
||||
<!--图片--(修复)-->
|
||||
<coreshopimgSingle :coreshopdata="item" v-if="item.widgetCode=='imgSingle' "></coreshopimgSingle>
|
||||
<!--商品(修复)-->
|
||||
<coreshopgoods :coreshopdata="item" v-if="item.widgetCode=='goods' "></coreshopgoods>
|
||||
<!--商品选项卡(修复)-->
|
||||
<coreshopgoodTabBar :coreshopdata="item" v-if="item.widgetCode=='goodTabBar' "></coreshopgoodTabBar>
|
||||
<!--文章(修复)-->
|
||||
<coreshoparticle :coreshopdata="item" v-if="item.widgetCode=='article' "></coreshoparticle>
|
||||
<!--文章分类(修复)-->
|
||||
<coreshoparticleClassify :coreshopdata="item" v-if="item.widgetCode=='articleClassify' "></coreshoparticleClassify>
|
||||
<!--宫格自定义导航(修复)-->
|
||||
<coreshopnavBar :coreshopdata="item" v-if="item.widgetCode=='navBar' "></coreshopnavBar>
|
||||
<!--团购(修复)-->
|
||||
<coreshopgroupPurchase :coreshopdata="item" v-if="item.widgetCode=='groupPurchase' "></coreshopgroupPurchase>
|
||||
<!--浏览记录(修复)-->
|
||||
<coreshoprecord :coreshopdata="item" v-if="item.widgetCode=='record' "></coreshoprecord>
|
||||
<!--拼团(修复)-->
|
||||
<coreshoppinTuan :coreshopdata="item" v-if="item.widgetCode=='pinTuan' "></coreshoppinTuan>
|
||||
<!--服务(修复)-->
|
||||
<coreshopservice :coreshopdata="item" v-if="item.widgetCode=='service' "></coreshopservice>
|
||||
<!--图片-->
|
||||
<coreshopImgSingle :coreshopData="item.parameters.list" v-if="item.widgetCode=='imgSingle' "></coreshopImgSingle>
|
||||
<!--服务商品-->
|
||||
<coreshopServiceGood :coreshopData="item" v-if="item.widgetCode=='service' "></coreshopServiceGood>
|
||||
<!--图片轮播-->
|
||||
<coreshopImgSlide :coreshopData="item.parameters" v-if="item.widgetCode=='imgSlide' "></coreshopImgSlide>
|
||||
<!--公告-->
|
||||
<coreshopNotice :coreshopData="item.parameters.list" v-if="item.widgetCode=='notice' "></coreshopNotice>
|
||||
<!--优惠券-->
|
||||
<coreshopCoupon :coreshopData="item" v-if="item.widgetCode=='coupon' "></coreshopCoupon>
|
||||
<!--拼团-->
|
||||
<coreshopPinTuan :coreshopData="item" v-if="item.widgetCode=='pinTuan' "></coreshopPinTuan>
|
||||
<!--搜索-->
|
||||
<coreshopSearch :coreshopData="item" v-if="item.widgetCode=='search' "></coreshopSearch>
|
||||
<!--宫格自定义导航-->
|
||||
<coreshopNavBar :coreshopData="item" v-if="item.widgetCode=='navBar' "></coreshopNavBar>
|
||||
<!--商品选项卡-->
|
||||
<coreshopGoodTabBar :coreshopData="item" v-if="item.widgetCode=='goodTabBar' "></coreshopGoodTabBar>
|
||||
<!--文章-->
|
||||
<coreshopArticle :coreshopData="item" v-if="item.widgetCode=='article' "></coreshopArticle>
|
||||
<!--文章分类-->
|
||||
<coreshopArticleClassify :coreshopData="item" v-if="item.widgetCode=='articleClassify' "></coreshopArticleClassify>
|
||||
<!--视频-->
|
||||
<coreshopVideo :coreshopData="item" v-if="item.widgetCode=='video' "></coreshopVideo>
|
||||
<!--商品-->
|
||||
<coreshopGoods :coreshopData="item" v-if="item.widgetCode=='goods' "></coreshopGoods>
|
||||
<!--浏览记录-->
|
||||
<coreshopRecord :coreshopData="item" v-if="item.widgetCode=='record' "></coreshopRecord>
|
||||
<!--空格-->
|
||||
<coreshopBlank :coreshopData="item" v-if="item.widgetCode=='blank' "></coreshopBlank>
|
||||
<!--多行文本输入区-->
|
||||
<coreshopTextArea :coreshopData="item" v-if="item.widgetCode=='textarea' "></coreshopTextArea>
|
||||
<!--图片集-->
|
||||
<coreshopImgWindow :coreshopData="item" v-if="item.widgetCode=='imgWindow' "></coreshopImgWindow>
|
||||
<!--文本内容-->
|
||||
<coreshopContent :coreshopData="item" v-if="item.widgetCode=='content' "></coreshopContent>
|
||||
<!--团购-->
|
||||
<coreshopGroupPurchase :coreshopData="item" v-if="item.widgetCode=='groupPurchase' "></coreshopGroupPurchase>
|
||||
<!--秒杀-->
|
||||
<coreshopSeckill :coreshopData="item" v-if="item.widgetCode=='seckill' "></coreshopSeckill>
|
||||
|
||||
|
||||
|
||||
<!--弹窗广告-->
|
||||
<coreshopadpop :coreshopdata="item" v-if="item.widgetCode=='adpop' "></coreshopadpop>
|
||||
<!--文本内容(修复)-->
|
||||
<coreshopContent :coreshopdata="item" v-if="item.widgetCode=='content' "></coreshopContent>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import coreshopimgSlide from '@/components/coreshop-page/coreshop-imgSlide.vue'
|
||||
import coreshopsearch from '@/components/coreshop-page/coreshop-search.vue'
|
||||
import coreshopnotice from '@/components/coreshop-page/coreshop-notice.vue'
|
||||
import coreshopcoupon from '@/components/coreshop-page/coreshop-coupon.vue'
|
||||
import coreshopblank from '@/components/coreshop-page/coreshop-blank.vue'
|
||||
import coreshoptextarea from '@/components/coreshop-page/coreshop-textarea.vue'
|
||||
import coreshopvideo from '@/components/coreshop-page/coreshop-video.vue'
|
||||
import coreshopimgWindow from '@/components/coreshop-page/coreshop-imgWindow.vue'
|
||||
import coreshopimgSingle from '@/components/coreshop-page/coreshop-imgSingle.vue'
|
||||
import coreshopgoods from '@/components/coreshop-page/coreshop-goods.vue'
|
||||
import coreshopgoodTabBar from '@/components/coreshop-page/coreshop-goodTabBar.vue'
|
||||
import coreshoparticle from '@/components/coreshop-page/coreshop-article.vue'
|
||||
import coreshoparticleClassify from '@/components/coreshop-page/coreshop-articleClassify.vue'
|
||||
import coreshopnavBar from '@/components/coreshop-page/coreshop-navBar.vue'
|
||||
import coreshopgroupPurchase from '@/components/coreshop-page/coreshop-groupPurchase.vue'
|
||||
import coreshoprecord from '@/components/coreshop-page/coreshop-record.vue'
|
||||
import coreshoppinTuan from '@/components/coreshop-page/coreshop-pinTuan.vue'
|
||||
import coreshopservice from '@/components/coreshop-page/coreshop-service.vue'
|
||||
import coreshoptabbar from '@/components/coreshop-page/coreshop-tabbar.vue'
|
||||
import coreshopadpop from '@/components/coreshop-page/coreshop-adpop.vue'
|
||||
import coreshopImgSingle from '@/components/coreshop-page/coreshop-imgSingle.vue'
|
||||
import coreshopServiceGood from '@/components/coreshop-page/coreshop-serviceGood.vue'
|
||||
import coreshopImgSlide from '@/components/coreshop-page/coreshop-imgSlide.vue'
|
||||
import coreshopNotice from '@/components/coreshop-page/coreshop-notice.vue'
|
||||
import coreshopCoupon from '@/components/coreshop-page/coreshop-coupon.vue'
|
||||
import coreshopPinTuan from '@/components/coreshop-page/coreshop-pinTuan.vue'
|
||||
import coreshopSearch from '@/components/coreshop-page/coreshop-search.vue'
|
||||
import coreshopNavBar from '@/components/coreshop-page/coreshop-navBar.vue'
|
||||
import coreshopArticle from '@/components/coreshop-page/coreshop-article.vue'
|
||||
import coreshopArticleClassify from '@/components/coreshop-page/coreshop-articleClassify.vue'
|
||||
import coreshopGoodTabBar from '@/components/coreshop-page/coreshop-goodTabBar.vue'
|
||||
import coreshopVideo from '@/components/coreshop-page/coreshop-video.vue'
|
||||
import coreshopGoods from '@/components/coreshop-page/coreshop-goods.vue'
|
||||
import coreshopRecord from '@/components/coreshop-page/coreshop-record.vue'
|
||||
import coreshopBlank from '@/components/coreshop-page/coreshop-blank.vue'
|
||||
import coreshopTextArea from '@/components/coreshop-page/coreshop-textarea.vue'
|
||||
import coreshopImgWindow from '@/components/coreshop-page/coreshop-imgWindow.vue'
|
||||
import coreshopContent from '@/components/coreshop-page/coreshop-content.vue'
|
||||
import coreshopGroupPurchase from '@/components/coreshop-page/coreshop-groupPurchase.vue'
|
||||
import coreshopSeckill from '@/components/coreshop-page/coreshop-seckill.vue'
|
||||
|
||||
import coreshopadpop from '@/components/coreshop-page/coreshop-adpop.vue'
|
||||
|
||||
export default {
|
||||
name: 'coreshop-page',
|
||||
components: {
|
||||
coreshopimgSlide,
|
||||
coreshopsearch,
|
||||
coreshopnotice,
|
||||
coreshopcoupon,
|
||||
coreshopblank,
|
||||
coreshoptextarea,
|
||||
coreshopvideo,
|
||||
coreshopimgWindow,
|
||||
coreshopimgSingle,
|
||||
coreshopgoods,
|
||||
coreshopgoodTabBar,
|
||||
coreshoparticle,
|
||||
coreshoparticleClassify,
|
||||
coreshopnavBar,
|
||||
coreshopgroupPurchase,
|
||||
coreshoprecord,
|
||||
coreshoppinTuan,
|
||||
coreshopservice,
|
||||
coreshoptabbar,
|
||||
coreshopImgSingle,
|
||||
coreshopServiceGood,
|
||||
coreshopImgSlide,
|
||||
coreshopNotice,
|
||||
coreshopCoupon,
|
||||
coreshopPinTuan,
|
||||
coreshopSearch,
|
||||
coreshopNavBar,
|
||||
coreshopArticle,
|
||||
coreshopArticleClassify,
|
||||
coreshopGoodTabBar,
|
||||
coreshopVideo,
|
||||
coreshopGoods,
|
||||
coreshopRecord,
|
||||
coreshopBlank,
|
||||
coreshopTextArea,
|
||||
coreshopImgWindow,
|
||||
coreshopContent,
|
||||
coreshopGroupPurchase,
|
||||
coreshopSeckill,
|
||||
|
||||
coreshopadpop,
|
||||
coreshopContent
|
||||
},
|
||||
props: {
|
||||
coreshopdata: {
|
||||
|
||||
@@ -1,37 +1,43 @@
|
||||
<template>
|
||||
<!-- 活动商品 -->
|
||||
<view class="activity-wrap coreshop-padding-left-10 coreshop-padding-right-10 coreshop-padding-bottom-10 coreshop-margin-bottom-5 groupon-card" v-if="count">
|
||||
<!-- 标题栏 -->
|
||||
<view class="title-box coreshop-flex coreshop-justify-between coreshop-padding-top-10 coreshop-padding-bottom-10 groupon-title">
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-align-center">
|
||||
<view class="title-text coreshop-margin-right-10 u-line-1">每日拼团</view>
|
||||
</view>
|
||||
<view class="activity-wrap coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
|
||||
<view class="coreshop-padding-bottom-10 coreshop-padding-top-10 groupon-title coreshop-min-height-30">
|
||||
<view class="title-box coreshop-flex coreshop-justify-between">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">每日拼团</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goPinTuanList()"></u-icon>
|
||||
</view>
|
||||
<!-- 活动商品 -->
|
||||
<scroll-view class="scroll-box" scroll-x scroll-anchoring>
|
||||
<view class="goods-box coreshop-flex">
|
||||
<view class="min-goods coreshop-margin-right-6" v-for="mgoods in coreshopdata.parameters.list" :key="mgoods.id" @tap="goPinTuanDetail(mgoods.goodsId,mgoods.id)">
|
||||
<view class="img-box">
|
||||
<image class="img" :src="mgoods.goodsImage" mode=""></image>
|
||||
</view>
|
||||
<view class="mgoods-card-bottom coreshop-padding-10">
|
||||
<view class="goods-title coreshop-margin-bottom-5 u-line-1">{{ mgoods.name }}</view>
|
||||
<view class="price coreshop-margin-bottom-5">{{mgoods.pinTuanPrice}}</view>
|
||||
<view class="original-price">¥{{ mgoods.pinTuanPrice + mgoods.discountAmount }}</view>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<scroll-view class="scroll-box" scroll-x scroll-anchoring>
|
||||
<view class="goods-box coreshop-flex coreshop-justify-between coreshop-text-black">
|
||||
<view class="min-goods" v-for="item in coreshopData.parameters.list" :key="item.id" @tap="goPinTuanDetail(item.id)">
|
||||
<view class="img-box">
|
||||
<image class="img" :src="item.goodThumbnail" mode=""></image>
|
||||
</view>
|
||||
<view class="item-card-bottom coreshop-padding-10">
|
||||
<view class="goods-title u-line-1">{{ item.name }}</view>
|
||||
<view class="price coreshop-margin-bottom-5">{{item.pinTuanPrice}}</view>
|
||||
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between">
|
||||
<view class="original-price">¥{{ item.pinTuanPrice + item.discountAmount }}</view>
|
||||
<view class="coreshop-font-10">
|
||||
<u-tag :text="'限购'+item.maxNums" type="warning" plain plainFill size="mini" v-if="item.maxNums>0"></u-tag>
|
||||
<u-tag text="不限购" type="success" plain plainFill size="mini" v-if="item.maxNums==0"></u-tag>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshoppinTuan",
|
||||
name: "coreshopPinTuan",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
@@ -43,14 +49,14 @@
|
||||
},
|
||||
created() {
|
||||
let that = this;
|
||||
if (that.coreshopdata.parameters.list.length > 0) {
|
||||
let arr = that.sortData(that.coreshopdata.parameters.list, 4);
|
||||
if (that.coreshopData.parameters.list.length > 0) {
|
||||
let arr = that.sortData(that.coreshopData.parameters.list, 4);
|
||||
that.goodsList = arr;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
return (this.coreshopdata.parameters.list.length > 0)
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -77,32 +83,29 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.groupon-card { background: linear-gradient(#faecca 20%, #ffffff 30%, #ffffff 100%); }
|
||||
|
||||
.activity-wrap { background-color: #fff; min-height: 150px; background: linear-gradient(#faecca 20%, #ffffff 30%, #ffffff 100%);
|
||||
.groupon-title { background: url($apiFilesUrl+'/static/images/pinTuan/groupon_title_bg.png') no-repeat; background-position: center top; background-size: 100% auto; }
|
||||
.activity-wrap { background-color: #fff; min-height: 300rpx;
|
||||
.title-box {
|
||||
.title-text { font-size: 32rpx; font-weight: bold; color: #333333; }
|
||||
.title-text { font-size: 16px; font-weight: bold; color: #333333; }
|
||||
.more-box {
|
||||
.more-text { font-size: 22rpx; font-weight: 500; color: #333333; }
|
||||
.more-icon { font-size: 24rpx; color: #333333; }
|
||||
.more-text { font-size: 11px; font-weight: 500; color: #333333; }
|
||||
.more-icon { font-size: 12px; color: #333333; }
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-box,
|
||||
.goods-box { height: 380rpx; width: 100%; }
|
||||
.goods-box { min-height: 190px; width: 100%; }
|
||||
}
|
||||
|
||||
// 小商品卡片
|
||||
.min-goods { width: 220rpx; height: 380rpx; background: #fffaef; box-shadow: 0px 7rpx 8rpx 1rpx rgba(162, 117, 27, 0.24); border-radius: 10rpx;
|
||||
.img-box { width: 220rpx; height: 220rpx; overflow: hidden; position: relative; border-radius: 10rpx 10rpx 0 0;
|
||||
.img { width: 220rpx; height: 220rpx; background-color: #ccc; }
|
||||
// 商品卡片
|
||||
.min-goods { background: #fffaef; box-shadow: 0px 3.5px 4px 0.5px rgba(162, 117, 27, 0.24); border-radius: 5px; margin-right: 15px !important;
|
||||
.img-box { width: 140px; height: 140px; overflow: hidden; position: relative; border-radius: 5px 5px 0 0;
|
||||
.img { width: 140px; height: 140px; background-color: #ccc; }
|
||||
}
|
||||
.mgoods-card-bottom { height: 160rpx; background: url($apiFilesUrl+'/static/images/pinTuan/groupon_goods_bg.png') no-repeat; background-position: bottom center; background-size: 100% 100%; }
|
||||
.goods-title { font-size: 26rpx; font-weight: 500; color: #000000; width: 180rpx; line-height: 26rpx; }
|
||||
|
||||
.price { font-size: 30rpx; font-weight: 500; color: #ff0000;
|
||||
&::before { content: '¥'; font-size: 24rpx; }
|
||||
.item-card-bottom { min-height: 75px; background: url($apiFilesUrl+'/static/images/pinTuan/groupon_goods_bg.png') no-repeat; background-position: bottom center; background-size: 100% 100%; }
|
||||
.goods-title { font-size: 13px; font-weight: 500; color: #000000; line-height: 13px; margin-bottom: 5px; }
|
||||
.price { font-size: 15px; font-weight: 500; color: #ff0000;
|
||||
&::before { content: '¥'; font-size: 12px; }
|
||||
}
|
||||
.original-price { font-size: 20rpx; font-weight: 500; text-decoration: line-through; color: #c4c4c4; }
|
||||
.groupon-num-box {
|
||||
@@ -112,29 +115,4 @@
|
||||
.groupon-num-text { font-size: 18rpx; font-weight: 500; color: #e9b461; }
|
||||
}
|
||||
}
|
||||
|
||||
// 大商品卡片
|
||||
.big-goods { width: 710rpx; min-height: 260rpx; background: #ffffff; box-shadow: 0px 7rpx 8rpx 1rpx #fffaef; border-radius: 20rpx;
|
||||
.goods-img { width: 220rpx; height: 220rpx; border-radius: 6rpx; }
|
||||
.card-right { width: 430rpx; height: 100%; }
|
||||
.goods-title { font-size: 26rpx; font-weight: 600; width: 400rpx; color: #000000; vertical-align: middle;
|
||||
.title-tag { transform: scale(0.9); }
|
||||
}
|
||||
.subtitle-text { font-size: 22rpx; width: 400rpx; font-weight: 500; color: #666666; }
|
||||
.buy-btn { width: 120rpx; line-height: 50rpx; background: linear-gradient(90deg, #ff6600 0%, #fe832a 100%); border-radius: 25rpx; font-size: 24rpx; font-weight: 500; color: #ffffff; }
|
||||
|
||||
.sell-box { background: rgba(#f9efd6, 0.3); border-radius: 16rpx; line-height: 32rpx;
|
||||
.sell-num { font-size: 20rpx; font-weight: 400; color: #ff6904; }
|
||||
|
||||
.hot-icon { font-size: 26rpx; color: #ff6904; margin-right: 8rpx; }
|
||||
}
|
||||
.group-num { font-size: 20rpx; font-weight: 500; color: rgba(153, 153, 153, 1); margin-left: 20rpx; }
|
||||
|
||||
.price { color: #ff0000; font-weight: 600;
|
||||
&::before { content: '¥'; font-size: 20rpx; }
|
||||
}
|
||||
.origin-price { color: #c4c4c4; font-size: 24rpx; text-decoration: line-through;
|
||||
&::before { content: '¥'; font-size: 20rpx; }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="adbrathing" v-show="adbshow" v-bind:class="['adbrathing'+coreshopdata.parameters.style.align,!hideanimation?'pc':hideanimation?'hc':'']" :style="{top:coreshopdata.parameters.style.top+'%'}">
|
||||
<view class="adbrathing" v-show="adbshow" v-bind:class="['adbrathing'+coreshopData.parameters.style.align,!hideanimation?'pc':hideanimation?'hc':'']" :style="{top:coreshopData.parameters.style.top+'%'}">
|
||||
<view class="adbrathing-c coreshop-flex-direction-row">
|
||||
<view class="adbrathing-l">
|
||||
<image class="user-head-img" :src="log.avatar" mode="aspectFill"></image>
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshoprecord",
|
||||
name: "coreshopRecord",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Object,
|
||||
required: true,
|
||||
},
|
||||
@@ -57,12 +57,12 @@
|
||||
_this.hideanimation = !_this.hideanimation;
|
||||
clearInterval(_this.times);
|
||||
_this.times = setInterval(function () {
|
||||
_this.getRecod();
|
||||
_this.getRecord();
|
||||
}, 5000);
|
||||
}, 3000)
|
||||
},
|
||||
//获取日志
|
||||
getRecod() {
|
||||
getRecord() {
|
||||
var _this = this;
|
||||
if (_this.times != {}) {
|
||||
clearInterval(_this.times);
|
||||
@@ -72,7 +72,7 @@
|
||||
value: _this.lvalue,
|
||||
};
|
||||
uni.request({
|
||||
url: this.$globalConstVars.apiBaseUrl + '/Api/Page/GetRecod',
|
||||
url: this.$globalConstVars.apiBaseUrl + '/Api/Page/GetRecord',
|
||||
data: data,
|
||||
header: {
|
||||
'Accept': 'application/json',
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<!-- 搜索组件宽度自适应于外层 -->
|
||||
<view class="coreshop-padding-left-10 coreshop-padding-right-10 coreshop-padding-bottom-10 coreshop-padding-top-10 coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white" v-bind:class="coreshopdata.parameters.style">
|
||||
<view class="coreshop-padding-left-10 coreshop-padding-right-10 coreshop-padding-bottom-10 coreshop-padding-top-10 coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white" v-bind:class="coreshopData.parameters.style">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<u-search :placeholder="coreshopdata.parameters.keywords" v-model="keyword" shape="square" :show-action="true" action-text="搜索" @custom="goSearch" @search="goSearch"></u-search>
|
||||
<u-search :placeholder="coreshopData.parameters.keywords" v-model="keyword" shape="square" :show-action="true" action-text="搜索" @custom="goSearch" @search="goSearch"></u-search>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopsearch",
|
||||
name: "coreshopSearch",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
@@ -22,22 +22,11 @@
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//#ifdef H5
|
||||
this.$nextTick(() => {
|
||||
this.searchTop = this.$refs.searchBar.$el.offsetTop;
|
||||
})
|
||||
// #endif
|
||||
this.searchStyle()
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef H5
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
searchStyle() {
|
||||
this.$store.commit('searchStyle', this.coreshopdata.parameters.style)
|
||||
// console.log(this.data.parameters.style)
|
||||
this.$store.commit('searchStyle', this.coreshopData.parameters.style)
|
||||
},
|
||||
change(value) {
|
||||
// 搜索框内容变化时,会触发此事件,value值为输入框的内容
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="listData && count">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goSeckillList()"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex-direction coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key" @click="goSeckillDetail(item.id)">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.goods.image" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
|
||||
<view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.goods.name }}</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 2) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time">
|
||||
<view class="coreshop-font-12">即将开始:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.goods.product.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 1" @click="goSeckillDetail(item.id)">马上秒</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
<view class="coreshop-buy-btn-disabled" v-if="item.startStatus == 2">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="key+1 < listData.length">
|
||||
<view class="coreshop-divider">
|
||||
<view class="seckill"></view>
|
||||
<view class="dot">●</view>
|
||||
<view class="seckill"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopGroupPurchase",
|
||||
props: {
|
||||
coreshopData: {
|
||||
// type: Array,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listData = uni.$u.deepClone(this.coreshopData.parameters.list);
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
if (!this.coreshopData) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopData.parameters) {
|
||||
return false;
|
||||
}
|
||||
if (!this.coreshopData.parameters.list) {
|
||||
return false;
|
||||
}
|
||||
return (this.coreshopData.parameters.list.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
end(index) {
|
||||
let _that = this;
|
||||
_that.list.splice(index, 1)
|
||||
},
|
||||
onChange(e, key) {
|
||||
this.$set(this.listData[key], 'timeData', e)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img-list-item { border-radius: 8px; margin: 2.5px 2.5px 10px 2.5px; background-color: #ffffff; padding: 5px; position: relative; overflow: hidden; flex-direction: row;
|
||||
.img-list-item-l { width: 100px; height: 100px; display: inline-block; float: left; }
|
||||
.img-list-item-r { width: calc(100% - 120px); display: inline-block; margin-left: 7.5px; float: left; position: relative;
|
||||
.description { font-size: 12px; color: #929292; }
|
||||
.item-c { width: 100%; margin-top: 0;
|
||||
.btnCart { float: right; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-count-down__text { font-size: 12px; }
|
||||
</style>
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="listData && count">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
|
||||
<view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
|
||||
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goServicesList()"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-divider">
|
||||
<view class="complete"></view>
|
||||
</view>
|
||||
<view class="coreshop-flex-direction-row coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key" @click="goServicesDetail(item.id)">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.thumbnail" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10">
|
||||
<view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.title }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.description }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxBuyNumber>0">限购{{item.maxBuyNumber}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxBuyNumber==0">不限购</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.ticketNumber}}张券</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="item.openStatus != 3">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="item.openStatus == 1 && item.lastTime > 0">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom" v-if="item.timeData.days>0">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc" v-if="item.timeData.days>0">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="item.openStatus == 2 && item.lastTime > 0">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time">
|
||||
<view class="coreshop-font-12">即将开始:</view>
|
||||
<view class="time__custom" v-if="item.timeData.days>0">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc" v-if="item.timeData.days>0">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{ item.money }}</view>
|
||||
</view>
|
||||
<view class="coreshop-buy-btn" v-if="item.openStatus != 3">马上抢</view>
|
||||
<view class="coreshop-buy-btn-disabled" v-if="item.openStatus == 3">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="key+1 < listData.length">
|
||||
<view class="coreshop-divider">
|
||||
<view class="serviceGood"></view>
|
||||
<view class="dot">●</view>
|
||||
<view class="serviceGood"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopServiceGood",
|
||||
data() {
|
||||
return {
|
||||
listData: [],
|
||||
}
|
||||
},
|
||||
props: {
|
||||
coreshopData: {
|
||||
type: Object,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listData = uni.$u.deepClone(this.coreshopData.parameters.list);
|
||||
},
|
||||
computed: {
|
||||
count() {
|
||||
return (this.listData.length > 0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChange(e, key) {
|
||||
this.$set(this.listData[key], 'timeData', e)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.time { display: flex; align-items: center;
|
||||
.time__custom { min-width: 18px; height: 18px; background-color: #3c9cff; border-radius: 4px; display: flex; justify-content: center; align-items: center;
|
||||
.time__custom__item { color: #fff; font-size: 10px; text-align: center; }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -28,22 +28,13 @@
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//#ifdef H5
|
||||
this.$nextTick(() => {
|
||||
this.searchTop = this.$refs.tabBar.$el.offsetTop - 52;
|
||||
})
|
||||
// #endif
|
||||
this.searchStyle()
|
||||
},
|
||||
mounted() {
|
||||
// #ifdef H5
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
searchStyle() {
|
||||
this.$store.commit('searchStyle', this.coreshopdata.parameters.style)
|
||||
// console.log(this.data.parameters.style)
|
||||
},
|
||||
handleScroll() {
|
||||
this.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="textarea coreshop-margin-left-10 coreshop-margin-right-10 coreshop-padding-10">
|
||||
<coreshopContent :content="coreshopdata.parameters.value" v-if="coreshopdata.parameters.value"></coreshopContent>
|
||||
<view class="textarea coreshop-margin-10 coreshop-padding-10">
|
||||
<coreshopContent :content="coreshopData.parameters.value" v-if="coreshopData.parameters.value"></coreshopContent>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -10,20 +10,12 @@
|
||||
components: {
|
||||
coreshopContent
|
||||
},
|
||||
name: "coreshoptextarea",
|
||||
name: "coreshopTextArea",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
// type: Object,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view class="video coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10">
|
||||
<video class="videoCT" id="myVideo" :src="coreshopdata.parameters.list[0].url" :autoplay="autoplay" :poster="coreshopdata.parameters.list[0].image"></video>
|
||||
<video class="videoCT" id="myVideo" :src="coreshopData.parameters.list[0].url" :autoplay="autoplay" :poster="coreshopData.parameters.list[0].image"></video>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "coreshopvideo",
|
||||
name: "coreshopVideo",
|
||||
props: {
|
||||
coreshopdata: {
|
||||
coreshopData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.coreshopdata.parameters.autoplay == 'true' || this.coreshopdata.parameters.autoplay == true) {
|
||||
if (this.coreshopData.parameters.autoplay == 'true' || this.coreshopData.parameters.autoplay == true) {
|
||||
this.autoplay = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
<template>
|
||||
<view class="coreshop-share-Box">
|
||||
<u-toast ref="uToast" />
|
||||
<view class="coreshop-share-pop">
|
||||
<view class="coreshop-share-item" @click="copyUrl()" v-show="!ifwx">
|
||||
<button class="coreshop-btn">
|
||||
<u-icon label="复制链接" labelPos="bottom" size="40" name="/static/images/common/share-friend.png"></u-icon>
|
||||
</button>
|
||||
</view>
|
||||
<view class="coreshop-share-item" @click="$u.throttle(createPoster, 500)">
|
||||
<button class="coreshop-btn">
|
||||
<u-icon label="生成海报" labelPos="bottom" size="40" name="/static/images/common/share-poster.png"></u-icon>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-bottomBox">
|
||||
<button class="coreshop-btn coreshop-btn-w coreshop-btn-square" @click="close()">关闭</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { h5Url } from '@/common/setting/constVarsHelper.js'
|
||||
export default {
|
||||
props: {
|
||||
// 商品id
|
||||
goodsId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// 分享的图片
|
||||
shareImg: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 分享标题
|
||||
shareTitle: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 分享内容
|
||||
shareContent: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 分享链接
|
||||
shareHref: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//分享类型
|
||||
shareType: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
//拼团id
|
||||
groupId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
//拼团的团队id
|
||||
teamId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
ifwx: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
/**
|
||||
*
|
||||
* H5端分享两种 (微信浏览器内引导用户去分享, 其他浏览器)
|
||||
*
|
||||
*/
|
||||
},
|
||||
methods: {
|
||||
// 关闭弹出层
|
||||
close() {
|
||||
this.$emit('close')
|
||||
},
|
||||
// 生成海报
|
||||
createPoster() {
|
||||
let data = {};
|
||||
if (this.shareType == 1) {
|
||||
//商品
|
||||
data = {
|
||||
page: 2, //商品
|
||||
url: h5Url + this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
goodsId: this.goodsId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 1
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
} else if (this.shareType == 3) {
|
||||
//拼团
|
||||
data = {
|
||||
page: 3, //商品
|
||||
url: h5Url + this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
groupId: this.groupId,
|
||||
teamId: this.teamId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 1
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
}
|
||||
this.$u.api.share(data).then(res => {
|
||||
if (res.status) {
|
||||
this.close()
|
||||
this.$u.route('/pages/share/sharePoster/sharePoster?poster=' + encodeURIComponent(res.data))
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
});
|
||||
},
|
||||
copyUrl() {
|
||||
let data = {};
|
||||
if (this.shareType == 1) {
|
||||
data = {
|
||||
page: 2, //商品
|
||||
url: h5Url + this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
goodsId: this.goodsId
|
||||
},
|
||||
type: 1,//URL
|
||||
client: 1
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
} else if (this.shareType == 3) {
|
||||
data = {
|
||||
page: 3, //拼团
|
||||
url: h5Url + this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
groupId: this.groupId,
|
||||
teamId: this.teamId
|
||||
},
|
||||
type: 1,//URL
|
||||
client: 1
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
}
|
||||
let _this = this;
|
||||
_this.$u.api.share(data).then(res => {
|
||||
if (res.status) {
|
||||
uni.setClipboardData({
|
||||
data: res.data,
|
||||
success: function (data) {
|
||||
_this.$refs.uToast.show({ message: '复制成功', type: 'success' })
|
||||
},
|
||||
fail: function (err) {
|
||||
_this.$u.toast('复制分享URL失败');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.$u.toast('复制分享URL失败');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 分享操作
|
||||
share() {
|
||||
// h5分享 判断是否是微信浏览器 引导用户完成分享操作
|
||||
|
||||
// 其他浏览器的分享
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -96,8 +96,8 @@
|
||||
params: {
|
||||
goodsId: this.goodsId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2 //终端
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
@@ -112,31 +112,43 @@
|
||||
goodsId: this.goodsId,
|
||||
teamId: this.teamId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
console.log(data);
|
||||
}
|
||||
else if (this.shareType == this.$globalConstVars.shareType.group || this.shareType == this.$globalConstVars.shareType.seckill) {
|
||||
else if (this.shareType == this.$globalConstVars.shareType.group) {
|
||||
data = {
|
||||
page: this.shareType,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
groupId: this.groupId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
}
|
||||
else if (this.shareType == this.$globalConstVars.shareType.seckill) {
|
||||
data = {
|
||||
page: this.shareType,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
groupId: this.groupId
|
||||
},
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
console.log(data);
|
||||
}
|
||||
else if (this.shareType == this.$globalConstVars.shareType.goods) {
|
||||
data = {
|
||||
@@ -145,14 +157,13 @@
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
console.log(data);
|
||||
}
|
||||
else if (this.shareType == this.$globalConstVars.shareType.addPinTuan) {
|
||||
data = {
|
||||
@@ -163,14 +174,13 @@
|
||||
groupId: this.groupId,
|
||||
teamId: this.teamId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
console.log(data);
|
||||
} else if (this.shareType == this.$globalConstVars.shareType.solitaire) {
|
||||
data = {
|
||||
page: this.shareType,
|
||||
@@ -178,8 +188,22 @@
|
||||
params: {
|
||||
id: this.objectId
|
||||
},
|
||||
type: 3,//海报
|
||||
client: 2
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
data.token = userToken
|
||||
}
|
||||
} else if (this.shareType == this.$globalConstVars.shareType.serviceGoods) {
|
||||
data = {
|
||||
page: this.shareType,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
params: {
|
||||
serviceGoodsId: this.objectId
|
||||
},
|
||||
type: this.$globalConstVars.shareModel.poster,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram
|
||||
}
|
||||
let userToken = this.$db.get('userToken')
|
||||
if (userToken) {
|
||||
@@ -191,7 +215,10 @@
|
||||
uni.hideLoading();
|
||||
if (
|
||||
this.shareType == this.$globalConstVars.shareType.goods ||
|
||||
this.shareType == this.$globalConstVars.shareType.pinTuan
|
||||
this.shareType == this.$globalConstVars.shareType.pinTuan ||
|
||||
this.shareType == this.$globalConstVars.shareType.seckill ||
|
||||
this.shareType == this.$globalConstVars.shareType.group ||
|
||||
this.shareType == this.$globalConstVars.shareType.serviceGoods
|
||||
) {
|
||||
//data.posterUrl = encodeURIComponent(res.data);
|
||||
data.params.posterUrl = res.data;
|
||||
|
||||
@@ -205,16 +205,7 @@
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
uni.createSelectorQuery().in(this).select('#fy_dropdown__menu').boundingClientRect().exec(rect => {
|
||||
const data = rect[0];
|
||||
const top = data.top + this.titleHeight + this.H5NavBarHeight + 'px';
|
||||
this.maskClass.top = top;
|
||||
this.transClass.top = top;
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef APP-NVUE || H5
|
||||
// #ifndef APP-NVUE
|
||||
uni.createSelectorQuery().in(this).select('.fy_dropdown__menu').boundingClientRect(rect => {
|
||||
const top = rect.top + this.titleHeight + 'px';
|
||||
this.maskClass.top = top;
|
||||
|
||||
@@ -9,9 +9,6 @@ import * as Db from '@/common/utils/dbHelper.js'
|
||||
//全局常量配置
|
||||
import * as GlobalConstVars from '@/common/setting/constVarsHelper.js'
|
||||
|
||||
//全局常量配置
|
||||
import * as CoreTheme from '@/common/setting/coreThemeHelper.js'
|
||||
|
||||
import store from '@/common/store'
|
||||
|
||||
//引入全局uView
|
||||
@@ -44,7 +41,6 @@ Vue.prototype.$upload = Upload;
|
||||
Vue.prototype.$common = Common;
|
||||
Vue.prototype.$db = Db;
|
||||
Vue.prototype.$globalConstVars = GlobalConstVars;
|
||||
Vue.prototype.$coreTheme = CoreTheme;
|
||||
Vue.prototype.$store = store;
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"name": "南山田舍",
|
||||
"appid": "__UNI__EAACF14",
|
||||
"description": "核心商城系统(CoreShop)是基于uni-app框架开发的商城应用程序",
|
||||
"versionName": "1.0",
|
||||
"versionCode": 1,
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"name" : "核心商城系统",
|
||||
"appid" : "__UNI__EAACF14",
|
||||
"description" : "核心商城系统(CoreShop)是基于uni-app框架开发的商城应用程序",
|
||||
"versionName" : "1.0",
|
||||
"versionCode" : 1,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
/* 5+App特有相关 */
|
||||
"modules": {
|
||||
"Payment": {},
|
||||
"VideoPlayer": {},
|
||||
"Maps": {}
|
||||
"modules" : {
|
||||
"Payment" : {},
|
||||
"VideoPlayer" : {},
|
||||
"Maps" : {}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"distribute": {
|
||||
"distribute" : {
|
||||
/* 应用发布信息 */
|
||||
"android": {
|
||||
"android" : {
|
||||
/* android打包配置 */
|
||||
"permissions": [
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
@@ -43,140 +43,137 @@
|
||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
],
|
||||
"abiFilters": [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||
},
|
||||
"ios": {},
|
||||
"ios" : {},
|
||||
/* ios打包配置 */
|
||||
"sdkConfigs": {
|
||||
"payment": {
|
||||
"weixin": {
|
||||
"appid": "wx11d95cdaee6058f6"
|
||||
"sdkConfigs" : {
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx11d95cdaee6058f6"
|
||||
}
|
||||
},
|
||||
"ad": {},
|
||||
"maps": {
|
||||
"amap": {
|
||||
"appkey_ios": "91b94ecb48605c4e048aa1971459eca7",
|
||||
"appkey_android": "91b94ecb48605c4e048aa1971459eca7"
|
||||
"ad" : {},
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"appkey_ios" : "91b94ecb48605c4e048aa1971459eca7",
|
||||
"appkey_android" : "91b94ecb48605c4e048aa1971459eca7"
|
||||
}
|
||||
},
|
||||
"oauth": {
|
||||
"univerify": {}
|
||||
"oauth" : {
|
||||
"univerify" : {}
|
||||
},
|
||||
"share": {}
|
||||
"share" : {}
|
||||
},
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "",
|
||||
"xhdpi" : "",
|
||||
"xxhdpi" : "",
|
||||
"xxxhdpi" : ""
|
||||
},
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
"ios" : {
|
||||
"appstore" : "",
|
||||
"ipad" : {
|
||||
"app" : "",
|
||||
"app@2x" : "",
|
||||
"notification" : "",
|
||||
"notification@2x" : "",
|
||||
"proapp@2x" : "",
|
||||
"settings" : "",
|
||||
"settings@2x" : "",
|
||||
"spotlight" : "",
|
||||
"spotlight@2x" : ""
|
||||
},
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
"iphone" : {
|
||||
"app@2x" : "",
|
||||
"app@3x" : "",
|
||||
"notification@2x" : "",
|
||||
"notification@3x" : "",
|
||||
"settings@2x" : "",
|
||||
"settings@3x" : "",
|
||||
"spotlight@2x" : "",
|
||||
"spotlight@3x" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen": {
|
||||
"waiting": true
|
||||
"splashscreen" : {
|
||||
"waiting" : true
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"quickapp": {},
|
||||
"quickapp" : {},
|
||||
/* 快应用特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "wx6fc139d4de0b470f",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"es6": true,
|
||||
"checkSiteMap": false
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx6fc139d4de0b470f",
|
||||
"setting" : {
|
||||
"urlCheck" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true,
|
||||
"es6" : true,
|
||||
"checkSiteMap" : false
|
||||
},
|
||||
"plugins": {
|
||||
"chooseLocation": {
|
||||
"version": "1.0.9",
|
||||
"provider": "wx76a9a06e5b4e693e"
|
||||
"plugins" : {
|
||||
"chooseLocation" : {
|
||||
"version" : "1.0.9",
|
||||
"provider" : "wx76a9a06e5b4e693e"
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于小程序定位"
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "你的位置信息将用于小程序定位"
|
||||
}
|
||||
},
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
"requiredPrivateInfos": [
|
||||
"getLocation",
|
||||
"chooseAddress"
|
||||
]
|
||||
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ]
|
||||
},
|
||||
"h5": {
|
||||
"title": "南山田舍",
|
||||
"domain": "https://h5.coreshop.coreshop.net",
|
||||
"router": {
|
||||
"base": "./",
|
||||
"mode": "hash"
|
||||
"h5" : {
|
||||
"title" : "南山田舍",
|
||||
"domain" : "https://h5.coreshop.coreshop.net",
|
||||
"router" : {
|
||||
"base" : "./",
|
||||
"mode" : "hash"
|
||||
},
|
||||
"template": "index.html",
|
||||
"devServer": {
|
||||
"port": 80,
|
||||
"disableHostCheck": true,
|
||||
"https": true
|
||||
"template" : "index.html",
|
||||
"devServer" : {
|
||||
"port" : 80,
|
||||
"disableHostCheck" : true,
|
||||
"https" : true
|
||||
},
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"qqmap": {
|
||||
"key": "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33"
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33"
|
||||
}
|
||||
}
|
||||
},
|
||||
"optimization": {
|
||||
"treeShaking": {
|
||||
"enable": false
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"setting": {
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true
|
||||
"mp-toutiao" : {
|
||||
"setting" : {
|
||||
"es6" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"appid": ""
|
||||
"appid" : ""
|
||||
},
|
||||
"mp-qq": {
|
||||
"setting": {
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true
|
||||
"mp-qq" : {
|
||||
"setting" : {
|
||||
"es6" : true,
|
||||
"postcss" : true,
|
||||
"minified" : true
|
||||
},
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
}
|
||||
},
|
||||
"mp-alipay": {},
|
||||
"mp-baidu": {}
|
||||
"mp-alipay" : {},
|
||||
"mp-baidu" : {}
|
||||
}
|
||||
|
||||
@@ -195,13 +195,6 @@
|
||||
"navigationBarTitleText": "支付"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "waiting/waiting",
|
||||
"style": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "等待支付"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "result/result",
|
||||
"style": {
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapActions, mapState } from 'vuex';
|
||||
import { mapState } from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
<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>
|
||||
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
||||
<u-icon name="share-fill" size="22" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view slot="right">
|
||||
</view>
|
||||
@@ -24,7 +22,7 @@
|
||||
<text class="coreshop-font-16">¥</text>
|
||||
<text class="coreshop-font-24">{{ product.price || '0.00' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-flex-sub coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-text-right coreshop-time-right">
|
||||
<u-count-down :time="goodsInfo.groupTimestamp*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
|
||||
<view class="time">
|
||||
@@ -34,7 +32,7 @@
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
<text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
@@ -48,10 +46,6 @@
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<u-icon name="star-fill" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
|
||||
@@ -71,12 +65,11 @@
|
||||
<text class="font-color-orange">{{ goodsInfo.buyCount || '0' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>累计销售:</text>
|
||||
<text>{{ goodsInfo.buyCount || '0' }}</text>
|
||||
<u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>库存:</text>
|
||||
<text>{{product.stock}}</text>
|
||||
<u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -193,13 +186,9 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<view class="coreshop-padding-0">
|
||||
<u-popup mode="bottom" :show="shareBox" ref="share">
|
||||
<!-- #ifdef H5 -->
|
||||
<coreshop-share-h5 :shareType='$globalConstVars.shareType.group' :groupId="groupId" :goodsId="goodsInfo.id" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-h5>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<coreshop-share-wx :shareType='$globalConstVars.shareType.group' :groupId="groupId" :goodsId="goodsInfo.id" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-wx>
|
||||
<!-- #endif -->
|
||||
@@ -258,7 +247,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -295,7 +284,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -354,7 +343,7 @@
|
||||
<view class="tabbar">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4">
|
||||
<!-- 客服按钮 -->
|
||||
<!-- #ifdef H5 || APP-PLUS-NVUE || APP-PLUS -->
|
||||
<!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
|
||||
<view class="action" @click="showChat()">
|
||||
<button class="noButtonStyle">
|
||||
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
|
||||
@@ -442,9 +431,8 @@
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.goodsId = e.id;
|
||||
this.groupId = e.groupId;
|
||||
if (this.goodsId && this.groupId) {
|
||||
this.groupId = e.id;
|
||||
if (this.groupId) {
|
||||
this.getServiceDescription();
|
||||
this.getGoodsInfo();
|
||||
this.getGoodsParams();
|
||||
@@ -517,7 +505,7 @@
|
||||
shareHref() {
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
// #ifdef H5 || MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
// #ifdef MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&groupId=' + this.groupId;
|
||||
// #endif
|
||||
}
|
||||
@@ -593,8 +581,7 @@
|
||||
},
|
||||
getGoodsInfo() {
|
||||
let data = {
|
||||
id: this.goodsId,
|
||||
groupId: this.groupId,
|
||||
id: this.groupId,
|
||||
type: this.cartType,
|
||||
needSku: true,
|
||||
};
|
||||
@@ -626,6 +613,7 @@
|
||||
let info = res.data;
|
||||
_this.product = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
_this.goodsId = info.id;
|
||||
this.goodsSkuInfo = res.data.skuList;
|
||||
|
||||
if (_this.goodsInfo.album) {
|
||||
@@ -751,7 +739,6 @@
|
||||
this.submitStatus = true;
|
||||
this.buyNow();
|
||||
},
|
||||
// 跳转到h5分享页面
|
||||
goShare() {
|
||||
this.shareBox = true;
|
||||
},
|
||||
@@ -768,8 +755,6 @@
|
||||
},
|
||||
//在线客服
|
||||
showChat() {
|
||||
// #ifdef H5
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
this.$u.route('/pages/member/customerService/index');
|
||||
// #endif
|
||||
@@ -777,18 +762,17 @@
|
||||
//获取分享URL
|
||||
getShareUrl() {
|
||||
let data = {
|
||||
client: 2,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
type: 1,
|
||||
page: 9,
|
||||
type: this.$globalConstVars.shareModel.url,
|
||||
page: this.$globalConstVars.shareType.group,
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
groupId: this.groupId
|
||||
}
|
||||
};
|
||||
let userToken = this.$db.get('userToken');
|
||||
if (userToken && userToken != '') {
|
||||
data['token'] = userToken;
|
||||
data.token = userToken
|
||||
}
|
||||
this.$u.api.share(data).then(res => {
|
||||
this.shareUrl = res.data
|
||||
|
||||
@@ -9,35 +9,89 @@
|
||||
<view slot="right">
|
||||
</view>
|
||||
</u-navbar>
|
||||
<view class="goods-item" v-for="item in goodsList" :key="item.id" v-if="goodsList.length>0">
|
||||
<view class="activity-goods-box coreshop-flex coreshop-justify-between">
|
||||
<view class="img-box">
|
||||
<slot name="tag"></slot>
|
||||
<image class="img" :src="item.image" mode="aspectFill"></image>
|
||||
|
||||
<view class="coreshop-flex-direction coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-text-black" v-for="(item, key) in goodsList" :key="key" v-if="goodsList.length>0">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.goodThumbnail" mode="widthFix" width="96px" height="96px"></u--image>
|
||||
</view>
|
||||
<view class="goods-right coreshop-flex coreshop-justify-between coreshop-flex-direction">
|
||||
<view class="title u-line-2">{{ item.name }}</view>
|
||||
<view class="tip u-line-1">{{ item.brief }}</view>
|
||||
<view class="slod-end">
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
|
||||
<view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.goodName }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxNums>0">限购{{item.maxNums}}{{item.goodUnit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxNums==0">不限购</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxGoodsNums>0">总量{{item.maxGoodsNums}}{{item.goodUnit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxGoodsNums==0">不限总量</view>
|
||||
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.goodViewCount}}人浏览</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="item.timestamp">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 1) && item.timestamp">
|
||||
<u-count-down :time="item.timestamp*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 0) && item.timestamp">
|
||||
<u-count-down :time="item.timestamp*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time">
|
||||
<view class="coreshop-font-12">即将开始:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<u-line-progress :percentage="getPercent(item.buyPromotionCount, item.stock)"></u-line-progress>
|
||||
<view class="progress-text">已抢{{ getProgress(item.buyPromotionCount, item.stock) }}</view>
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.mktPrice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 1" @click="goGroupBuyingDetail(item.id)">立即团</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
<view class="coreshop-buy-btn-disabled" v-if="item.startStatus == 2">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="current">¥{{ item.price }}</view>
|
||||
<view class="original">¥{{ item.mktprice }}</view>
|
||||
</view>
|
||||
<view class="coreshop-width-fit-content">
|
||||
<u-button type="error" size="mini" v-if="tabCurrent=='ing'" @click="goGroupBuyingDetail(item.id, item.groupId)">{{ btnType[tabCurrent].name }}</u-button>
|
||||
<u-button type="error" size="mini" v-else>{{ btnType[tabCurrent].name }}</u-button>
|
||||
<view v-if="key+1 < listData.length">
|
||||
<view class="coreshop-divider">
|
||||
<view class="seckill"></view>
|
||||
<view class="dot">●</view>
|
||||
<view class="seckill"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无团购信息" mode="list"></u-empty>
|
||||
@@ -126,7 +180,7 @@
|
||||
this.$u.api.getGroup(data).then(res => {
|
||||
if (res.status) {
|
||||
if (res.data) {
|
||||
let _goodsList = res.data.goods;
|
||||
let _goodsList = res.data.list;
|
||||
_this.goodsList = [..._this.goodsList, ..._goodsList]
|
||||
}
|
||||
_this.lastPage = res.data.totalPages;
|
||||
@@ -141,7 +195,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
onChange(e, key) {
|
||||
this.$set(this.goodsList[key], 'timeData', e)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -17,37 +17,37 @@
|
||||
<text class="group-head__title">爆款推荐</text>
|
||||
<text class="group-head__notice">省钱省心限时拼</text>
|
||||
</view>
|
||||
<view class="group-box">
|
||||
<view class="goods-item" v-for="(item, index) in goodsList" :key="item.id" v-if="goodsList.length>0">
|
||||
<view class="group-box" v-if="list.length>0">
|
||||
<view class="goods-item" v-for="(item, index) in list" :key="item.id">
|
||||
<view class="coreshop-flex coreshop-justify-start coreshop-padding-left-10 coreshop-padding-top-10 coreshop-padding-bottom-10">
|
||||
<view>
|
||||
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
||||
<u--image :src="item.image" mode="widthFix" width="100px" height="100px" radius="10"></u--image>
|
||||
<u--image :src="item.goodThumbnail" mode="widthFix" width="100px" height="100px" radius="10"></u--image>
|
||||
</view>
|
||||
<view class="goods-right coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-padding-right-10">
|
||||
<view class="title u-line-2 coreshop-text-black">{{ item.pinTuanRule.name }}</view>
|
||||
<view class="tip u-line-2 coreshop-text-grey">{{ item.name }}</view>
|
||||
<view class="goods-right coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-padding-right-10 coreshop-percent-100">
|
||||
<view class="title u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="tip u-line-2 coreshop-text-grey">{{ item.goodName }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-10">
|
||||
<u-tag :text="'已拼'+item.pinTuanRecordNums+'单'" type="warning coreshop-margin-right-5 coreshop-font-10" shape="circle" size="mini"></u-tag>
|
||||
<u-tag :text="'已售'+item.buyCount+ item.unit" type="warning coreshop-margin-right-5 coreshop-font-10" shape="circle" size="mini"></u-tag>
|
||||
<u-tag :text="(item.pinTuanRule.peopleNumber || 0) +'人团'" type="success coreshop-font-10" shape="circle" size="mini"></u-tag>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已拼{{item.buyPinTuanCount}}单</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已售{{item.pinTuanRecordNums}}{{item.goodUnit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.peopleNumber}}人团</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="current">¥{{ item.pinTuanPrice }}</view>
|
||||
<view class="original">¥{{ item.price }}</view>
|
||||
<view class="original">¥{{ item.mktPrice }}</view>
|
||||
</view>
|
||||
<view class="cu-btn buy-btn" @tap="goPinTuanDetail(item.id,item.pinTuanRule.id)">马上拼</view>
|
||||
<view class="coreshop-buy-btn" @tap="goPinTuanDetail(item.id)">马上拼</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/history.png'" icon-size="150" text="暂无提现明细" mode="list"></u-empty>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空白 -->
|
||||
</scroll-view>
|
||||
@@ -62,7 +62,9 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
list: [],
|
||||
status: 'loadmore',
|
||||
iconType: 'flower',
|
||||
loadText: {
|
||||
@@ -72,12 +74,41 @@
|
||||
}
|
||||
};
|
||||
},
|
||||
//加载执行
|
||||
onShow: function () {
|
||||
_this = this
|
||||
_this.getGoods();
|
||||
onLoad() {
|
||||
this.getPinTuanlist()
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.status === 'loadmore') {
|
||||
this.getPinTuanlist()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPinTuanlist() {
|
||||
let _this = this;
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.status = 'loading'
|
||||
this.$u.api.pinTuanList(data).then(res => {
|
||||
if (res.status) {
|
||||
if (res.data) {
|
||||
let _list = res.data
|
||||
this.list = [...this.list, ..._list]
|
||||
}
|
||||
if (res.code >= _this.list.length) {
|
||||
_this.page++
|
||||
_this.status = 'loadmore'
|
||||
} else {
|
||||
_this.status = 'nomore'
|
||||
}
|
||||
} else {
|
||||
_this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
//取得列表数据
|
||||
getGoods: function () {
|
||||
uni.showLoading({
|
||||
@@ -93,7 +124,7 @@
|
||||
if (item.pinTuanPrice <= 0) {
|
||||
item.pinTuanPrice = '0.00';
|
||||
} else {
|
||||
item.pinTuanPrice = _this.$common.moneySub(item.price, item.pinTuanRule.discountAmount);
|
||||
item.pinTuanPrice = parseFloat(item.price - item.pinTuanRule.discountAmount).toFixed(2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.groupHeight { height: 61px !important; }
|
||||
|
||||
.group-swiper-c { height: 121px; }
|
||||
.group-swiper-c .swiper-item .coreshop-cell-item { height: 50%; }
|
||||
.group-swiper-c .swiper-item .coreshop-cell-item { height: 50%; padding: 10px 0px; }
|
||||
.group-swiper-c .swiper-item .coreshop-cell-item .user-head-img { width: 40px; height: 40px; border-radius: 50%; }
|
||||
.group-swiper-c .swiper-item .coreshop-cell-item .coreshop-cell-hd-title { max-width: 100px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
|
||||
.group-swiper-c .swiper-item .coreshop-cell-item .coreshop-cell-item-bd { min-width: 75px; text-align: center; display: block; }
|
||||
@@ -33,3 +33,8 @@
|
||||
.coreshop-lower-shelf .coreshop-cell-item-bd { opacity: 0.4; }
|
||||
.coreshop-lower-shelf .coreshop-cell-item-ft { opacity: 0.4; }
|
||||
.coreshop-lower-shelf .coreshop-lower-box { position: absolute; height: calc(100% - 20px); width: calc(100% - 10px); background-color: rgba(0, 0, 0, 0.6); text-align: center; font-size: 14px; color: #dedede; -webkit-transition: left .15s; transition: left .15s; z-index: 999; -webkit-transition: all .15s; transition: all .15s; line-height: 40px; }
|
||||
|
||||
|
||||
.u-count-down {
|
||||
.u-count-down__text { font-size: 12px; }
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
<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>
|
||||
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
||||
<u-icon name="share-fill" size="22" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view slot="right">
|
||||
</view>
|
||||
@@ -24,7 +22,7 @@
|
||||
<text class="coreshop-font-16">¥</text>
|
||||
<text class="coreshop-font-24">{{ price || '0.00' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-flex-sub coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-text-right coreshop-time-right" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 1">
|
||||
<u-count-down :time="goodsInfo.pinTuanRule.lastTime*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
|
||||
<view class="time">
|
||||
@@ -34,7 +32,7 @@
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
<text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
@@ -56,7 +54,7 @@
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
<text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
@@ -70,12 +68,7 @@
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<u-icon name="star-fill" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
|
||||
</view>
|
||||
@@ -94,12 +87,11 @@
|
||||
<text class="font-color-orange">{{ goodsInfo.buyPinTuanCount || '0' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>累计销售:</text>
|
||||
<text>{{ goodsInfo.buyCount || '0' }}</text>
|
||||
<u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>库存:</text>
|
||||
<text>{{product.stock}}</text>
|
||||
<u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -140,7 +132,6 @@
|
||||
<view class="coreshop-margin-bottom-16">
|
||||
<text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">开团信息</text>
|
||||
</view>
|
||||
<view class="tuan">
|
||||
<view class="coreshop-cell-group coreshop-margin-top-10 coreshop-margin-bottom-10" v-if="pinTuanRecord.length > 0">
|
||||
<view class="coreshop-cell-item right-img">
|
||||
<view class="coreshop-cell-item-hd">
|
||||
@@ -152,11 +143,6 @@
|
||||
<swiper-item v-for="(item, index) in pinTuanRecord" :key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="coreshop-cell-item" :class="item[0].isOverdue?'coreshop-lower-shelf':''">
|
||||
<view class="img-lower-box" :class="item[0].isOverdue?'coreshop-lower-box':''" v-if="item[0].isOverdue">已结束</view>
|
||||
<view class="coreshop-cell-item-hd">
|
||||
<u--image width="35px" height="35px" :src="item[0].userAvatar" shape="circle"></u--image>
|
||||
<view class="coreshop-cell-hd-title coreshop-margin-left-8">{{ item[0].nickName || '' }}</view>
|
||||
</view>
|
||||
<view class="coreshop-cell-item-bd">
|
||||
<view class="coreshop-cell-bd-view">
|
||||
<text class="coreshop-cell-bd-text coreshop-font-xs">
|
||||
@@ -167,20 +153,19 @@
|
||||
</view>
|
||||
<view class="coreshop-cell-bd-view coreshop-text-center coreshop-flex coreshop-flex-nowrap coreshop-justify-center coreshop-align-center">
|
||||
<text class="coreshop-font-xs">剩余:</text>
|
||||
<u-count-down :time="item[0].lastTime * 1000 " class="coreshop-font-12"></u-count-down>
|
||||
<u-count-down :time="item[0].lastTime * 1000 " class="coreshop-font-11"></u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-lower-box" :class="item[0].isOverdue?'coreshop-lower-box':''" v-if="item[0].isOverdue">已结束</view>
|
||||
<view class="coreshop-cell-item-hd">
|
||||
<u-avatar-group :urls="item[0].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
|
||||
</view>
|
||||
<view class="coreshop-cell-item-ft">
|
||||
<u-button type="success" size="mini" @click="selectTap(2, item[0].teamId)" v-if="!item[0].isOverdue">去拼单</u-button>
|
||||
<u-button type="default" size="mini" v-if="item[0].isOverdue">已结束</u-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-cell-item" v-if="item[1]" :class="item[1].isOverdue?'coreshop-lower-shelf':''">
|
||||
<view class="img-lower-box" :class="item[1].isOverdue?'coreshop-lower-box':''" v-if="item[1].isOverdue">已结束</view>
|
||||
<view class="coreshop-cell-item-hd">
|
||||
<u--image width="40px" height="40px" :src="item[1].userAvatar" shape="circle" class="coreshop-margin-right-8"></u--image>
|
||||
<view class="coreshop-cell-hd-title">{{ item[1].nickName || '' }}</view>
|
||||
</view>
|
||||
<view class="coreshop-cell-item-bd">
|
||||
<view class="coreshop-cell-bd-view">
|
||||
<text class="coreshop-cell-bd-text coreshop-font-xs">
|
||||
@@ -189,12 +174,14 @@
|
||||
拼成
|
||||
</text>
|
||||
</view>
|
||||
<view class="coreshop-cell-bd-view">
|
||||
<view class="commodity-day">
|
||||
<view class="coreshop-cell-bd-view coreshop-text-center coreshop-flex coreshop-flex-nowrap coreshop-justify-center coreshop-align-center">
|
||||
<text class="coreshop-font-xs">剩余:</text>
|
||||
<u-count-down :timestamp="item[1].lastTime" separator="zh" :show-days="true" :show-hours="true" :show-minutes="true" :show-seconds="true" font-size="22" separator-size="22" color="#ff7300" bg-color="#ffd4b0" @end="end(index,1)"></u-count-down>
|
||||
<u-count-down :time="item[1].lastTime * 1000 " class="coreshop-font-11" @end="end(index,1)"></u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-lower-box" :class="item[1].isOverdue?'coreshop-lower-box':''" v-if="item[1].isOverdue">已结束</view>
|
||||
<view class="coreshop-cell-item-hd">
|
||||
<u-avatar-group :urls="item[1].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
|
||||
</view>
|
||||
<view class="coreshop-cell-item-ft">
|
||||
<u-button type="success" size="mini" @click="selectTap(2, item[1].teamId)" v-if="!item[1].isOverdue">去拼单</u-button>
|
||||
@@ -212,7 +199,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--评论-->
|
||||
<view class="coreshop-margin-left-16 coreshop-margin-right-16 coreshop-margin-top-12 coreshop-padding-16 coreshop-border-radius-9 coreshop-bg-white">
|
||||
@@ -306,7 +292,7 @@
|
||||
<view class="ig-top-b">
|
||||
<view class="igtb-top">
|
||||
还差
|
||||
<text class="red-price">{{ teamInfo.teamNums || '' }}</text>
|
||||
<text class="coreshop-text-red">{{ teamInfo.teamNums || '' }}</text>
|
||||
人,赶快拼单吧
|
||||
</view>
|
||||
<view class="igtb-mid"><button class="coreshop-btn" @click="selectTap(2, teamInfo.id)">参与拼团</button></view>
|
||||
@@ -317,9 +303,6 @@
|
||||
<!-- 分享弹窗 -->
|
||||
<view class="coreshop-padding-0">
|
||||
<u-popup mode="bottom" :show="shareBox" ref="share">
|
||||
<!-- #ifdef H5 -->
|
||||
<coreshop-share-h5 :shareType='$globalConstVars.shareType.pinTuan' :goodsId="goodsInfo.id" :groupId="pinTuanId" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-h5>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<coreshop-share-wx :shareType='$globalConstVars.shareType.pinTuan' :goodsId="goodsInfo.id" :groupId="pinTuanId" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-wx>
|
||||
<!-- #endif -->
|
||||
@@ -378,7 +361,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -415,7 +398,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -440,7 +423,7 @@
|
||||
<view class="tabbar">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4">
|
||||
<!-- 客服按钮 -->
|
||||
<!-- #ifdef H5 || APP-PLUS-NVUE || APP-PLUS -->
|
||||
<!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
|
||||
<view class="action" @click="showChat()">
|
||||
<button class="noButtonStyle">
|
||||
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
|
||||
@@ -533,7 +516,7 @@
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations, mapActions, mapState } from 'vuex';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
|
||||
export default {
|
||||
@@ -546,7 +529,6 @@
|
||||
// 后端返回的商品信息
|
||||
goodsSkuInfo: {},
|
||||
discountsGoodsSkuInfo: {},
|
||||
|
||||
goodsId: 0, // 商品id
|
||||
pinTuanId: 0, // 拼团ID
|
||||
goodsInfo: {}, // 商品详情
|
||||
@@ -594,13 +576,12 @@
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.goodsId = e.id;
|
||||
this.pinTuanId = e.pinTuanId;
|
||||
this.pinTuanId = e.id;
|
||||
if (e.teamId && e.teamId > 0) {
|
||||
this.teamId = e.teamId;
|
||||
this.getTeam(this.teamId);
|
||||
}
|
||||
if (this.goodsId) {
|
||||
if (this.pinTuanId) {
|
||||
this.getServiceDescription();
|
||||
this.getGoodsInfo();
|
||||
this.getGoodsParams();
|
||||
@@ -681,7 +662,7 @@
|
||||
shareHref() {
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
// #ifdef H5 || MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
// #ifdef MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&pinTuanId=' + this.pinTuanId;
|
||||
// #endif
|
||||
},
|
||||
@@ -777,7 +758,7 @@
|
||||
// 如果用户已经登录 要传用户token
|
||||
let userToken = this.$db.get('userToken');
|
||||
if (userToken) {
|
||||
data['token'] = userToken;
|
||||
data.token = userToken
|
||||
}
|
||||
let _this = this;
|
||||
_this.$u.api.pinTuanGoodsInfo(data).then(res => {
|
||||
@@ -801,7 +782,7 @@
|
||||
} else {
|
||||
let info = res.data;
|
||||
this.product = res.data.product;
|
||||
|
||||
this.goodsId = info.id;
|
||||
_this.goodsInfo = info;
|
||||
this.goodsSkuInfo = res.data.skuList;
|
||||
|
||||
@@ -836,8 +817,9 @@
|
||||
_this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
|
||||
|
||||
_this.isfav = _this.goodsInfo.isfav;
|
||||
_this.price = _this.pinTuanPrice = _this.$common.moneySub(_this.product.price, _this.discountAmount);
|
||||
_this.price = _this.pinTuanPrice = parseFloat(_this.product.price - _this.discountAmount).toFixed(2);
|
||||
|
||||
// 获取拼团记录
|
||||
// 获取拼团记录
|
||||
let pinTuanData = info.pinTuanRecord;
|
||||
let newData = new Array();
|
||||
@@ -852,6 +834,9 @@
|
||||
}
|
||||
}
|
||||
pinTuanData.length < 2 ? (_this.swiperSet.groupHeight = 'groupHeight') : (_this.swiperSet.groupHeight = '');
|
||||
if (pinTuanData.length > 1) {
|
||||
_this.swiperSet.autoplay = true;
|
||||
}
|
||||
_this.pinTuanRecord = newData;
|
||||
_this.teamCount = info.pinTuanRecordNums;
|
||||
// 判断如果登录用户添加商品浏览足迹
|
||||
@@ -968,7 +953,6 @@
|
||||
end(index, number) {
|
||||
this.pinTuanRecord[index][number].isOverdue = true;
|
||||
},
|
||||
// 跳转到h5分享页面
|
||||
goShare() {
|
||||
this.shareBox = true;
|
||||
},
|
||||
@@ -989,8 +973,6 @@
|
||||
},
|
||||
//在线客服
|
||||
showChat() {
|
||||
// #ifdef H5
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
this.$u.route('/pages/member/customerService/index');
|
||||
// #endif
|
||||
@@ -998,10 +980,10 @@
|
||||
//获取分享URL
|
||||
getShareUrl() {
|
||||
let data = {
|
||||
client: 2,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
type: 1,
|
||||
page: 3,
|
||||
type: this.$globalConstVars.shareModel.url,
|
||||
page: this.$globalConstVars.shareType.pinTuan,
|
||||
params: {
|
||||
groupId: this.pinTuanId,
|
||||
goodsId: this.goodsId,
|
||||
@@ -1028,7 +1010,7 @@
|
||||
if (teamId) {
|
||||
this.teamId = teamId;
|
||||
} else {
|
||||
this.teamId == 0;
|
||||
this.teamId = 0;
|
||||
}
|
||||
if (this.pinTuanType == 2) {
|
||||
this.price = this.pinTuanPrice;
|
||||
|
||||
@@ -17,36 +17,88 @@
|
||||
</view>
|
||||
<view class="content-box">
|
||||
<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-box">
|
||||
<view class="goods-item" v-for="item in goodsList" :key="item.id" v-if="goodsList.length>0">
|
||||
<view class="activity-goods-box coreshop-flex coreshop-justify-between">
|
||||
<view class="img-box">
|
||||
<slot name="tag"></slot>
|
||||
<image class="img" :src="item.image" mode="aspectFill"></image>
|
||||
<view class="coreshop-flex-direction coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-text-black" v-for="(item, key) in goodsList" :key="key" v-if="goodsList.length>0">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.goodThumbnail" mode="widthFix" width="96px" height="96px"></u--image>
|
||||
</view>
|
||||
<view class="goods-right coreshop-flex coreshop-justify-between coreshop-flex-direction">
|
||||
<view class="title u-line-2">{{ item.name }}</view>
|
||||
<view class="tip u-line-1">{{ item.brief }}</view>
|
||||
<view class="slod-end">
|
||||
<view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
|
||||
<view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
|
||||
<view class="coreshop-font-11 coreshop-padding-top-5 coreshop-padding-bottom-3 u-line-2 coreshop-text-brown">{{ item.goodName }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxNums>0">限购{{item.maxNums}}{{item.goodUnit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxNums==0">不限购</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxGoodsNums>0">总量{{item.maxGoodsNums}}{{item.goodUnit}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxGoodsNums==0">不限总量</view>
|
||||
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.goodViewCount}}人浏览</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="item.timestamp">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 1) && item.timestamp">
|
||||
<u-count-down :time="item.timestamp*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 0) && item.timestamp">
|
||||
<u-count-down :time="item.timestamp*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time">
|
||||
<view class="coreshop-font-12">即将开始:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.minutes }}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.seconds }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<u-line-progress :percentage="getPercent(item.buyPromotionCount, item.stock)"></u-line-progress>
|
||||
<view class="progress-text">已抢{{ getProgress(item.buyPromotionCount, item.stock) }}</view>
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.mktPrice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 1" @click="goSeckillDetail(item.id)">马上秒</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
<view class="coreshop-buy-btn-disabled" v-if="item.startStatus == 2">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<view class="current">¥{{ item.price }}</view>
|
||||
<view class="original">¥{{ item.mktprice }}</view>
|
||||
</view>
|
||||
<view class="coreshop-width-fit-content">
|
||||
<u-button type="error" class="buy-btn" size="mini" v-if="tabCurrent=='ing'" @click="goSeckillDetail(item.id, item.groupId)">{{ btnType[tabCurrent].name }}</u-button>
|
||||
<u-button type="error" class="buy-btn" size="mini" v-else>{{ btnType[tabCurrent].name }}</u-button>
|
||||
<view v-if="key+1 < listData.length">
|
||||
<view class="coreshop-divider">
|
||||
<view class="seckill"></view>
|
||||
<view class="dot">●</view>
|
||||
<view class="seckill"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- 无数据时默认显示 -->
|
||||
<view class="coreshop-emptybox" v-else>
|
||||
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无秒杀信息" mode="list"></u-empty>
|
||||
@@ -80,20 +132,6 @@
|
||||
status: 1,
|
||||
tabCurrent: 'ing',
|
||||
goodsList: [],
|
||||
btnType: {
|
||||
ing: {
|
||||
name: '立即抢购',
|
||||
color: 'btn-ing'
|
||||
},
|
||||
nostart: {
|
||||
name: '尚未开始',
|
||||
color: 'btn-nostart'
|
||||
},
|
||||
ended: {
|
||||
name: '已结束',
|
||||
color: 'btn-end',
|
||||
},
|
||||
},
|
||||
tabList: [
|
||||
{
|
||||
id: 'ing',
|
||||
@@ -115,16 +153,13 @@
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
setTimeout(() => {
|
||||
this.loading = true;
|
||||
}, 500);
|
||||
this.getGoodsList();
|
||||
},
|
||||
//onReachBottom() {
|
||||
// if (this.loadStatus === 'loadmore') {
|
||||
// this.getGoodsList()
|
||||
// }
|
||||
//},
|
||||
onReachBottom() {
|
||||
if (this.loadStatus === 'loadmore') {
|
||||
this.getGoodsList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onTab(id, status) {
|
||||
this.tabCurrent = id;
|
||||
@@ -132,7 +167,7 @@
|
||||
this.goodsList = [];
|
||||
this.page = 1;
|
||||
this.loadStatus = 'loading';
|
||||
this.$u.debounce(this.getGoodsList, 500);
|
||||
this.getGoodsList();
|
||||
},
|
||||
// 百分比
|
||||
getProgress(sales, stock) {
|
||||
@@ -168,14 +203,14 @@
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
type: 4, //秒杀
|
||||
type: this.$globalConstVars.paymentType.seckill,
|
||||
status: this.status
|
||||
}
|
||||
this.loadStatus = 'loading';
|
||||
this.$u.api.getGroup(data).then(res => {
|
||||
if (res.status) {
|
||||
if (res.data) {
|
||||
let _goodsList = res.data.goods;
|
||||
let _goodsList = res.data.list;
|
||||
_this.goodsList = [..._this.goodsList, ..._goodsList]
|
||||
}
|
||||
_this.lastPage = res.data.totalPages;
|
||||
@@ -190,7 +225,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
onChange(e, key) {
|
||||
this.$set(this.goodsList[key], 'timeData', e)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
<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>
|
||||
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
||||
<u-icon name="share-fill" size="22" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view slot="right">
|
||||
</view>
|
||||
@@ -24,7 +22,7 @@
|
||||
<text class="coreshop-font-16">¥</text>
|
||||
<text class="coreshop-font-24">{{ product.price || '0.00' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-flex-sub coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
|
||||
<view class="coreshop-text-right coreshop-time-right">
|
||||
<u-count-down :time="goodsInfo.groupTimestamp*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
|
||||
<view class="time">
|
||||
@@ -34,7 +32,7 @@
|
||||
</view>
|
||||
<text class="time__doc">天</text>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
<text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
|
||||
</view>
|
||||
<text class="time__doc">:</text>
|
||||
<view class="time__custom">
|
||||
@@ -48,10 +46,6 @@
|
||||
</u-count-down>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center">
|
||||
<u-icon name="star-fill" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="20" label="收藏" :labelSize="14" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp">
|
||||
<text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
|
||||
@@ -66,17 +60,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-margin-top-16 coreshop-padding-top-16 coreshop-solid-top coreshop-flex coreshop-justify-between coreshop-align-center coreshop-text-gray">
|
||||
<view class="coreshop-font-12">
|
||||
<text>运费:</text>
|
||||
<text class="font-color-orange">包邮</text>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>销量:</text>
|
||||
<text>{{ goodsInfo.buyCount || '0' }}</text>
|
||||
<text class="font-color-orange">{{ goodsInfo.buyCount || '0' }}</text>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<text>库存:</text>
|
||||
<text>{{product.stock}}</text>
|
||||
<u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-font-12">
|
||||
<u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
|
||||
<u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -201,14 +194,11 @@
|
||||
<!-- 分享弹窗 -->
|
||||
<view class="coreshop-padding-0">
|
||||
<u-popup mode="bottom" :show="shareBox" ref="share">
|
||||
<!-- #ifdef H5 -->
|
||||
<coreshop-share-h5 :shareType='$globalConstVars.shareType.seckill' :goodsId="goodsInfo.id" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-h5>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<coreshop-share-wx :shareType='$globalConstVars.shareType.seckill' :goodsId="goodsInfo.id" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-wx>
|
||||
<coreshop-share-wx :shareType='$globalConstVars.shareType.seckill' :groupId="groupId" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-wx>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
|
||||
<coreshop-share-app :shareType='$globalConstVars.shareType.seckill' :goodsId="goodsInfo.id" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-app>
|
||||
<coreshop-share-app :shareType='$globalConstVars.shareType.seckill' :groupId="groupId" :shareImg="goodsInfo.image" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-app>
|
||||
<!-- #endif -->
|
||||
</u-popup>
|
||||
<div id="qrCode" ref="qrCodeDiv"></div>
|
||||
@@ -261,7 +251,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -298,7 +288,7 @@
|
||||
{{ pointShowName}}兑换价:
|
||||
</view>
|
||||
<view class="coreshop-text-red">
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元
|
||||
{{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
|
||||
@@ -357,7 +347,7 @@
|
||||
<view class="tabbar">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4">
|
||||
<!-- 客服按钮 -->
|
||||
<!-- #ifdef H5 || APP-PLUS-NVUE || APP-PLUS -->
|
||||
<!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
|
||||
<view class="action" @click="showChat()">
|
||||
<button class="noButtonStyle">
|
||||
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
|
||||
@@ -378,11 +368,6 @@
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view class="coreshop-border-radius-20 coreshop-flex coreshop-align-end">
|
||||
<view class="btn-buy" @click="openSkuPopup">
|
||||
<text>立即秒杀</text>
|
||||
</view>
|
||||
</view>-->
|
||||
<view class="btn-group coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-basis-5">
|
||||
<u-button type="error" size="normal" @click="openSkuPopup" shape="circle">立即秒杀</u-button>
|
||||
</view>
|
||||
@@ -407,7 +392,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations, mapActions, mapState } from 'vuex';
|
||||
import { mapState } from 'vuex';
|
||||
export default {
|
||||
|
||||
data() {
|
||||
@@ -441,7 +426,6 @@
|
||||
selectType: '',
|
||||
shareUrl: this.$globalConstVars.shareUrl,
|
||||
shareBox: false,
|
||||
shareType: 10,
|
||||
serviceDescription: {
|
||||
commonQuestion: [],
|
||||
delivery: [],
|
||||
@@ -451,11 +435,10 @@
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.goodsId = e.id;
|
||||
this.groupId = e.groupId;
|
||||
if (this.goodsId && this.groupId) {
|
||||
this.groupId = e.id;
|
||||
if (this.groupId) {
|
||||
this.getServiceDescription();
|
||||
this.getGoodsInfo();
|
||||
this.getGroupInfo();
|
||||
this.getGoodsParams();
|
||||
this.getGoodsComments();
|
||||
} else {
|
||||
@@ -526,8 +509,8 @@
|
||||
shareHref() {
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
// #ifdef H5 || MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&groupId=' + this.groupId;
|
||||
// #ifdef MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
|
||||
return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.groupId;
|
||||
// #endif
|
||||
},
|
||||
},
|
||||
@@ -600,17 +583,16 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
getGoodsInfo() {
|
||||
getGroupInfo() {
|
||||
let data = {
|
||||
id: this.goodsId,
|
||||
groupId: this.groupId,
|
||||
id: this.groupId,
|
||||
type: this.cartType,
|
||||
needSku: true
|
||||
};
|
||||
// 如果用户已经登录 要传用户token
|
||||
let userToken = this.$db.get('userToken');
|
||||
if (userToken) {
|
||||
data['token'] = userToken;
|
||||
data.token = userToken
|
||||
}
|
||||
let _this = this;
|
||||
this.$u.api.groupInfo(data).then(res => {
|
||||
@@ -635,7 +617,7 @@
|
||||
} else {
|
||||
let info = res.data;
|
||||
this.product = res.data.product;
|
||||
|
||||
_this.goodsId = info.id;
|
||||
_this.goodsInfo = info;
|
||||
this.goodsSkuInfo = res.data.skuList;
|
||||
if (_this.goodsInfo.album) {
|
||||
@@ -771,8 +753,6 @@
|
||||
},
|
||||
//在线客服
|
||||
showChat() {
|
||||
// #ifdef H5
|
||||
// #endif
|
||||
// #ifdef APP-PLUS || APP-PLUS-NVUE
|
||||
this.$u.route('/pages/member/customerService/index');
|
||||
// #endif
|
||||
@@ -780,12 +760,11 @@
|
||||
//获取分享URL
|
||||
getShareUrl() {
|
||||
let data = {
|
||||
client: 2,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
type: 1,
|
||||
page: this.shareType,
|
||||
type: this.$globalConstVars.shareModel.url,
|
||||
page: this.$globalConstVars.shareType.seckill,
|
||||
params: {
|
||||
goodsId: this.goodsId,
|
||||
groupId: this.groupId
|
||||
}
|
||||
};
|
||||
@@ -809,7 +788,6 @@
|
||||
},
|
||||
showModal() {
|
||||
this.bottomModal = true;
|
||||
console.log("打开弹窗");
|
||||
},
|
||||
hideModal(e) {
|
||||
this.bottomModal = false;
|
||||
|
||||
@@ -35,17 +35,22 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="left">
|
||||
<u--image :showLoading="true" :src="item.thumbnail && item.thumbnail!='null' ? item.thumbnail : '/static/images/common/empty-banner.png'" width="80px" height="80px" mode="aspectFill"></u--image>
|
||||
<u--image :showLoading="true" :src="item.thumbnail" width="80px" height="80px" mode="aspectFill"></u--image>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="type u-line-4">{{item.description}}</view>
|
||||
<view class="type u-line-2">{{item.description}}</view>
|
||||
<view class="delivery-time">截止时间:{{ $u.timeFormat(item.endTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.minDeliveryPrice>0">{{item.minDeliveryPrice}}元起送</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.startBuyPrice>0">{{item.startBuyPrice}}元起购</view>
|
||||
<!--<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.ticketNumber}}张券</view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom coreshop-margin-top-10">
|
||||
<view class="more">正在接龙中</view>
|
||||
<view class="coreshop-flex">
|
||||
<view class='logistics coreshop-btn' @click="goSolitaireDetail(item.id)">查看详情</view>
|
||||
<view class='coreshop-solitaire-btn' @click="goSolitaireDetail(item.id)">立即接龙</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="coreshop-font-11 coreshop-text-gray coreshop-margin-bottom-10 ">
|
||||
{{$u.timeFormat(model.createTime, 'mm月dd日')}}发布截至{{$u.timeFormat(model.endTime, 'mm月dd日 hh:MM:ss')}}
|
||||
{{$u.timeFormat(model.createTime, 'yyyy年mm月dd日')}}发布截至{{$u.timeFormat(model.endTime, 'yyyy年mm月dd日 hh:MM:ss')}}
|
||||
</view>
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-padding-bottom-5">
|
||||
<view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="model.minDeliveryPrice>0">{{model.minDeliveryPrice}}元起送</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="model.startBuyPrice>0">{{model.startBuyPrice}}元起购</view>
|
||||
</view>
|
||||
<view class="coreshop-padding-10 coreshop-content">
|
||||
<u-parse :content="model.contentBody" :selectable="true" v-if="model.contentBody"></u-parse>
|
||||
@@ -80,15 +84,19 @@
|
||||
<view class="coreshop-font-md coreshop-padding-top-10 coreshop-padding-bottom-10 coreshop-padding-left-10 coreshop-padding-right-10 coreshop-flex-direction-row">
|
||||
<u-icon name="more-circle" color="#e54d42" label="接龙清单" labelSize="15px" label-pos="right"></u-icon>
|
||||
</view>
|
||||
<view class="coreshop-padding-top-10">
|
||||
<view class="coreshop-padding-bottom-10">
|
||||
<!--接龙记录-->
|
||||
<view class="coreshop-padding-left-10 coreshop-padding-right-10 coreshop-padding-top-10 coreshop-padding-bottom-10" v-if="records.length>0">
|
||||
<view class="coreshop-flex coreshop-flex-nowrap coreshop-justify-between coreshop-margin-bottom-10" v-for="(item, index) in records" :key="index">
|
||||
<view v-if="records.length>0">
|
||||
<view class="coreshop-flex coreshop-flex-nowrap coreshop-justify-between coreshop-padding-5 coreshop-margin-10 coreshop-bg-main" v-for="(item, index) in records" :key="index">
|
||||
<view class="coreshop-flex coreshop-flex-nowrap coreshop-justify-between coreshop-align-center">
|
||||
<text class="coreshop-text-black coreshop-margin-right-10 coreshop-font-12">{{ records.length-index}}</text>
|
||||
<u-avatar :src="item.avatarImage" :size="30"></u-avatar>
|
||||
<text class="coreshop-text-black coreshop-font-12 u-line-1">{{ item.nickName}}</text>
|
||||
<text class="coreshop-text-black coreshop-font-12">{{ records.length-index}}</text>
|
||||
<view class="coreshop-margin-left-10 coreshop-width-max-content">
|
||||
<view class="coreshop-flex coreshop-flex-nowrap coreshop-justify-between ">
|
||||
<view class="coreshop-margin-right-5">
|
||||
<u-avatar :src="item.avatarImage" :size="20"></u-avatar>
|
||||
</view>
|
||||
<text class="coreshop-text-black coreshop-font-12 u-line-1">{{ item.nickName==null ?'佚名': item.nickName}}</text>
|
||||
</view>
|
||||
<text class="coreshop-text-gray coreshop-font-10">{{$u.timeFormat(item.create, 'mm月dd日')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -108,9 +116,6 @@
|
||||
<!-- 分享弹窗 -->
|
||||
<view class="coreshop-padding-10">
|
||||
<u-popup mode="bottom" :show="shareBox" ref="share">
|
||||
<!-- #ifdef H5 -->
|
||||
<coreshop-share-h5 :objectId="model.id" :shareType="12" @close="closeShare()"></coreshop-share-h5>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<coreshop-share-wx :objectId="model.id" :shareType="12" @close="closeShare()"></coreshop-share-wx>
|
||||
<!-- #endif -->
|
||||
@@ -312,20 +317,14 @@
|
||||
this.$u.toast('请先选择商品')
|
||||
return true
|
||||
}
|
||||
var totalprice = parseFloat(this.totalprice);
|
||||
var startBuyPrice = parseFloat(this.model.startBuyPrice);
|
||||
console.log('商品价格:' + this.totalprice);
|
||||
console.log('起购价格:' + this.model.startBuyPrice);
|
||||
//var totalprice = parseFloat(this.totalprice);
|
||||
//var startBuyPrice = parseFloat(this.model.startBuyPrice);
|
||||
//console.log('商品价格:' + this.totalprice);
|
||||
//console.log('起购价格:' + this.model.startBuyPrice);
|
||||
if (this.totalprice < this.model.startBuyPrice) {
|
||||
this.$u.toast('最小购买价格为' + this.model.startBuyPrice + '元,请增加购买产品')
|
||||
return true
|
||||
}
|
||||
//let userToken = this.$db.get('userToken');
|
||||
//let obj = {
|
||||
// cart: this.cart,
|
||||
// id: this.id,
|
||||
// token: userToken
|
||||
//}
|
||||
this.submitStatus = true;
|
||||
let newData = '';
|
||||
for (var i = 0; i < this.cart.length; i++) {
|
||||
@@ -337,7 +336,9 @@
|
||||
newData = newData.substr(1);
|
||||
}
|
||||
if (newData.length > 0) {
|
||||
this.$u.route('/pages/placeOrder/index/index?orderType=' + this.cartType + '&objectId=' + this.id + '&cartIds=' + JSON.stringify(newData));
|
||||
var str = '/pages/placeOrder/index/index?orderType=' + this.cartType + '&objectId=' + this.id + '&cartIds=' + JSON.stringify(newData);
|
||||
console.log(str);
|
||||
this.$u.route(str);
|
||||
return true;
|
||||
} else {
|
||||
//没有选择不跳转
|
||||
@@ -353,17 +354,17 @@
|
||||
//获取分享URL
|
||||
getShareUrl() {
|
||||
let data = {
|
||||
client: 2,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
type: 1,
|
||||
page: 12,
|
||||
type: this.$globalConstVars.shareModel.url,
|
||||
page: this.$globalConstVars.shareType.solitaire,
|
||||
params: {
|
||||
id: this.model.id,
|
||||
}
|
||||
};
|
||||
let userToken = this.$db.get('userToken');
|
||||
if (userToken && userToken != '') {
|
||||
data['token'] = userToken;
|
||||
data.token = userToken
|
||||
}
|
||||
this.$u.api.share(data).then(res => {
|
||||
this.shareUrl = res.data
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</u-navbar>
|
||||
|
||||
<view class="coreshop-bg-white coreshop-padding-10 coreshop-margin-10">
|
||||
<u--image width="100%" height="150px" v-if="info.coverImage" :src="info.coverImage && info.coverImage!='null' ? info.coverImage+'?x-oss-process=image/resize,m_lfit,h_320,w_240' : '/static/images/common/empty-banner.png'"></u--image>
|
||||
<u--image width="100%" height="150px" v-if="info.coverImage" :src="info.coverImage"></u--image>
|
||||
<view class="article-title">
|
||||
{{ info.title }}
|
||||
</view>
|
||||
@@ -117,10 +117,10 @@
|
||||
//获取分享URL
|
||||
getShareUrl() {
|
||||
let data = {
|
||||
client: 2,
|
||||
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
||||
url: this.$globalConstVars.shareUrl,
|
||||
type: 1,
|
||||
page: 5,
|
||||
type: this.$globalConstVars.shareModel.url,
|
||||
page: this.$globalConstVars.shareType.article,
|
||||
params: {
|
||||
articleId: this.id,
|
||||
articleType: this.idType
|
||||
@@ -128,7 +128,7 @@
|
||||
};
|
||||
let userToken = this.$db.get('userToken');
|
||||
if (userToken && userToken != '') {
|
||||
data['token'] = userToken;
|
||||
data.token = userToken
|
||||
}
|
||||
this.$u.api.share(data).then(res => {
|
||||
this.shareUrl = res.data
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
.u-wrap { height: calc(100vh); /* #ifdef H5 */ height: calc(100vh - var(--window-top)); /* #endif */ }
|
||||
.u-wrap { height: calc(100vh); }
|
||||
.u-menu-wrap { flex: 1; display: flex; overflow: hidden;
|
||||
.u-tab-view { width: 100px; height: 100%; background: #f6f6f6;
|
||||
.u-tab-item { height: 55px; background: #f6f6f6; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #444; font-weight: 400; line-height: 1; }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user