【新增】新增微信扫码支付功能,对接PC端。

【新增】增加DTO类库,将逐步完善dto层。
【修复】修复【分类】切换后,切换回来未清零原始数据,导致更新数据重复的问题。
【调整】移除模板库功能,防止出现审核因为模板库页面存在而导致的审核失败。暂将模板库的代码存放到会员QQ群内,方便下载使用。
【调整】代码生成器【Repository.tpl】移除Cache手动增删改,【SqlSugarSetup】增加sqlsugar自动检测增删改后清理二级缓存。
【调整】后端新增秒杀独立组件,用于区分团购及秒杀的差异,首页新增秒杀组件。
【优化】重写首页所有组件样式及接口数据获取效率。
【优化】优化拼团,秒杀,团购,接龙数据获取逻辑,提升列表及详情页面数据获取效率。
【优化】调整拼团,秒杀,团购,服务商品推广海报为新式海报效果。增加服务商品推广海报。
【优化】清理h5相关代码判断,移除h5支付组件,提高响应速度。
【优化】移除小程序前端冗余代码。加快代码执行效率。
This commit is contained in:
大灰灰
2022-10-31 05:28:16 +08:00
parent 6ae59c6af7
commit 81dcf814d1
173 changed files with 4172 additions and 3408 deletions

View File

@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; 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}}; {% for field in ModelFields %}oldModel.{{field.DbColumnName}} = entity.{{field.DbColumnName}};
{% endfor %} {% endfor %}
// //
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
jm.code = bl ? 0 : 1; jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -87,7 +87,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
@@ -119,7 +119,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -417,19 +417,19 @@ namespace CoreCms.Net.Configuration
public enum OrderStatus public enum OrderStatus
{ {
/// <summary> /// <summary>
/// 订单正常 /// 进行中
/// </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, Normal = 1,
/// <summary> /// <summary>
/// 订单完成 /// 已完结
/// </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, Complete = 2,
/// <summary> /// <summary>
/// 订单取消 /// 取消
/// </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 Cancel = 3
} }
@@ -439,19 +439,19 @@ namespace CoreCms.Net.Configuration
public enum OrderStatusDescription public enum OrderStatusDescription
{ {
/// <summary> /// <summary>
/// 订单正常 /// 进行中
/// </summary> /// </summary>
[Description("正常-")] [Description("进行中-")]
Normal = 1, Normal = 1,
/// <summary> /// <summary>
/// 订单完成 /// 已完结
/// </summary> /// </summary>
[Description("完成(√)")] [Description("已完结(√)")]
Complete = 2, Complete = 2,
/// <summary> /// <summary>
/// 订单取消 /// 取消
/// </summary> /// </summary>
[Description("取消(×)")] [Description("取消(×)")]
Cancel = 3 Cancel = 3
} }
@@ -1696,15 +1696,15 @@ namespace CoreCms.Net.Configuration
/// </summary> /// </summary>
public enum WeiChatPayTradeType public enum WeiChatPayTradeType
{ {
[Description("JSAPI")] [Description("JSAPI(小程序支付)")]
JSAPI = 1, JSAPI = 1,
[Description("JSAPI_OFFICIAL")] [Description("JSAPI_OFFICIAL(公众号支付)")]
JSAPI_OFFICIAL = 2, JSAPI_OFFICIAL = 2,
[Description("NATIVE")] [Description("NATIVE(扫码支付)")]
NATIVE = 3, NATIVE = 3,
[Description("APP")] [Description("APP(APP支付)")]
APP = 4, APP = 4,
[Description("MWEB")] [Description("MWEB(H5支付)")]
MWEB = 5 MWEB = 5
} }
@@ -1944,6 +1944,11 @@ namespace CoreCms.Net.Configuration
/// </summary> /// </summary>
[Description("12接龙")] [Description("12接龙")]
Solitaire = 12, Solitaire = 12,
/// <summary>
/// 13服务商品
/// </summary>
[Description("13服务商品")]
ServiceGoods = 13,
} }
/// <summary> /// <summary>

View File

@@ -39,7 +39,7 @@ namespace CoreCms.Net.Core.Config
//判断数据库类型 //判断数据库类型
DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,
//是否开启自动关闭数据库连接 //是否开启自动关闭数据库连接
IsAutoCloseConnection = true, IsAutoCloseConnection = true
}); });
//设置参数 //设置参数
@@ -51,6 +51,11 @@ namespace CoreCms.Net.Core.Config
//判断是否开启redis设置二级缓存方式 //判断是否开启redis设置二级缓存方式
DataInfoCacheService = AppSettingsConstVars.RedisUseCache ? (ICacheService)new SqlSugarRedisCache() : new SqlSugarMemoryCache() DataInfoCacheService = AppSettingsConstVars.RedisUseCache ? (ICacheService)new SqlSugarRedisCache() : new SqlSugarMemoryCache()
}; };
db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings()
{
//所有 增、删 、改 会自动调用.RemoveDataCache()清理二级缓存
IsAutoRemoveDataCache = true
};
//执行SQL 错误事件可监控sql暂时屏蔽需要可开启 //执行SQL 错误事件可监控sql暂时屏蔽需要可开启
//db.Aop.OnLogExecuting = (sql, p) => //db.Aop.OnLogExecuting = (sql, p) =>

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View 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; }
}
}

View 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; }
}
}

View File

@@ -4,19 +4,49 @@
* Web: https://www.corecms.net * Web: https://www.corecms.net
* Author: 大灰灰 * Author: 大灰灰
* Email: jianweie@163.com * Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10 * CreateTime: 2022/10/24 3:54:14
* Description: 暂无 * Description: 暂无
***********************************************************************/ ***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.IRepository namespace CoreCms.Net.IRepository
{ {
/// <summary> /// <summary>
/// 文章分类表 工厂接口 /// 文章分类表 工厂接口
/// </summary> /// </summary>
public interface ICoreCmsArticleTypeRepository : IBaseRepository<CoreCmsArticleType> 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);
} }
} }

View File

@@ -5,6 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CoreCms.Net.DTO\CoreCms.Net.DTO.csproj" />
<ProjectReference Include="..\CoreCms.Net.Model\CoreCms.Net.Model.csproj" /> <ProjectReference Include="..\CoreCms.Net.Model\CoreCms.Net.Model.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -170,5 +170,18 @@ namespace CoreCms.Net.IRepository
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<List<EnumEntity>> QueryEnumEntityAsync(); 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);
} }
} }

View File

@@ -12,6 +12,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.DTO;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Model.ViewModels.DTO;
@@ -53,5 +54,20 @@ namespace CoreCms.Net.IRepository
/// <param name="ruleId">规则序列</param> /// <param name="ruleId">规则序列</param>
/// <returns></returns> /// <returns></returns>
Task<TagPinTuanResult> GetPinTuanInfo(int ruleId); 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);
} }
} }

View File

@@ -38,16 +38,10 @@ namespace CoreCms.Net.IRepository
/// <summary> /// <summary>
/// 获取列表首页用 /// 获取首页组件数据
/// </summary> /// </summary>
/// <param name="predicate">判断集合</param> /// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <returns></returns> /// <returns></returns>
Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate, Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate);
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20);
} }
} }

View File

@@ -4,18 +4,47 @@
* Web: https://www.corecms.net * Web: https://www.corecms.net
* Author: 大灰灰 * Author: 大灰灰
* Email: jianweie@163.com * Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10 * CreateTime: 2022/10/24 3:54:14
* Description: 暂无 * Description: 暂无
***********************************************************************/ ***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.IServices namespace CoreCms.Net.IServices
{ {
/// <summary> /// <summary>
/// 文章分类表 服务工厂接口 /// 文章分类表 服务工厂接口
/// </summary> /// </summary>
public interface ICoreCmsArticleTypeServices : IBaseServices<CoreCmsArticleType> 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);
} }
} }

View File

@@ -10,6 +10,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CoreCms.Net.Configuration\CoreCms.Net.Configuration.csproj" /> <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" /> <ProjectReference Include="..\CoreCms.Net.Model\CoreCms.Net.Model.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -114,8 +114,7 @@ namespace CoreCms.Net.IServices
/// <param name="groupId"></param> /// <param name="groupId"></param>
/// <param name="needSku"></param> /// <param name="needSku"></param>
/// <returns></returns> /// <returns></returns>
Task<CoreCmsGoods> GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", Task<CoreCmsGoods> GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0, bool needSku = false);
int groupId = 0, bool needSku = false);
/// <summary> /// <summary>
/// 通过商品序列获取sku列表 /// 通过商品序列获取sku列表
@@ -263,5 +262,18 @@ namespace CoreCms.Net.IServices
Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids); Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
#endregion #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);
} }
} }

View File

@@ -12,6 +12,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.DTO;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Model.ViewModels.DTO;
@@ -37,7 +38,7 @@ namespace CoreCms.Net.IServices
/// 接口上获取拼团所有商品 /// 接口上获取拼团所有商品
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<WebApiCallBack> GetPinTuanList(int userId = 0); Task<WebApiCallBack> GetPinTuanList(int userId = 0, int pageIndex = 1, int pageSize = 20);
/// <summary> /// <summary>
@@ -60,5 +61,20 @@ namespace CoreCms.Net.IServices
/// <param name="ruleId">规则序列</param> /// <param name="ruleId">规则序列</param>
/// <returns></returns> /// <returns></returns>
Task<TagPinTuanResult> GetPinTuanInfo(int ruleId); 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);
} }
} }

View File

@@ -51,13 +51,13 @@ namespace CoreCms.Net.IServices
/// 获取团购列表数据 /// 获取团购列表数据
/// </summary> /// </summary>
/// <returns></returns> /// <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>
/// 获取团购/秒杀商品详情 /// 获取团购/秒杀商品详情
/// </summary> /// </summary>
/// <returns></returns> /// <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> /// <summary>
/// 获取可领取的优惠券 /// 获取可领取的优惠券

View File

@@ -38,16 +38,10 @@ namespace CoreCms.Net.IServices
/// <summary> /// <summary>
/// 获取列表首页用 /// 获取首页组件数据
/// </summary> /// </summary>
/// <param name="predicate">判断集合</param> /// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <returns></returns> /// <returns></returns>
Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate, Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate);
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20);
} }
} }

View File

@@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities
/// </summary> /// </summary>
[Display(Name = "促销ID")] [Display(Name = "促销ID")]
[SugarColumn(ColumnDescription = "促销ID", IsNullable = true)] [SugarColumn(ColumnDescription = "促销ID", IsNullable = true)]
public System.Int32? promotionId { get; set; } public System.Int32 promotionId { get; set; }
/// <summary> /// <summary>
/// 促销条件编码 /// 促销条件编码
/// </summary> /// </summary>

View File

@@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities
/// </summary> /// </summary>
[Display(Name = "促销ID")] [Display(Name = "促销ID")]
[SugarColumn(ColumnDescription = "促销ID", IsNullable = true)] [SugarColumn(ColumnDescription = "促销ID", IsNullable = true)]
public System.Int32? promotionId { get; set; } public System.Int32 promotionId { get; set; }
/// <summary> /// <summary>
/// 促销条件编码 /// 促销条件编码
/// </summary> /// </summary>

View File

@@ -26,6 +26,13 @@ namespace CoreCms.Net.Model.Entities
[SugarColumn(IsIgnore = true)] [SugarColumn(IsIgnore = true)]
public int timestamp { get; set; } = 0; public int timestamp { get; set; } = 0;
/// <summary>
/// 开启状态
/// </summary>
[Display(Name = "开启状态")]
[SugarColumn(IsIgnore = true)]
public int openStatus { get; set; } = 0;
/// <summary> /// <summary>
/// 允许购买用户等级 /// 允许购买用户等级
/// </summary> /// </summary>

View File

@@ -38,17 +38,16 @@ namespace CoreCms.Net.Model.FromBody
public int status { get; set; } = 0; public int status { get; set; } = 0;
} }
/// <summary>
/// 获取团购秒杀商品详情
/// </summary>
public class FMGetGoodsDetial public class FMGetGoodsDetial
{ {
public int id { get; set; } public int id { get; set; }
public int groupId { get; set; }
public int type { get; set; } public int type { get; set; }
public bool needSku { get; set; } = false; public bool needSku { get; set; } = false;
} }
} }

View File

@@ -54,7 +54,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
public int areaId { get; set; } public int areaId { get; set; }
/// <summary> /// <summary>
/// 购物车货品数据 /// 购物车序列
/// </summary> /// </summary>
public string cartIds { get; set; } public string cartIds { get; set; }
@@ -109,7 +109,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
public int storeId { get; set; } = 0; public int storeId { get; set; } = 0;
/// <summary> /// <summary>
/// 订单类型1是普通订单2是拼团订单 /// 订单类型[对应CoreCmsOrder表orderType字段]/也对应购物车cart订单类型
/// </summary> /// </summary>
public int orderType { get; set; } = 1; public int orderType { get; set; } = 1;

View File

@@ -38,7 +38,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO
public decimal orderMoney { get; set; } public decimal orderMoney { get; set; }
/// <summary> /// <summary>
/// 购物车货品序列号 /// 购物车序列号
/// </summary> /// </summary>
public string ids { get; set; } public string ids { get; set; }

View File

@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
return jm; return jm;
} }
var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync(); var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
var bl = id > 0; var bl = id > 0;
jm.code = bl ? 0 : 1; jm.code = bl ? 0 : 1;
@@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository
{ {
if (entity.isDefault) 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; return jm;
@@ -106,7 +106,7 @@ namespace CoreCms.Net.Repository
oldModel.description = entity.description; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
if (bl) if (bl)
@@ -114,7 +114,7 @@ namespace CoreCms.Net.Repository
//其他处理 //其他处理
if (entity.isDefault) 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; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
if (bl) 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; return jm;
} }

View File

@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); var jm = new AdminUiCallBack();
entity.createTime = DateTime.Now; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -88,7 +88,7 @@ namespace CoreCms.Net.Repository
oldModel.storeId = entity.storeId; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -104,7 +104,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -4,23 +4,96 @@
* Web: https://www.corecms.net * Web: https://www.corecms.net
* Author: 大灰灰 * Author: 大灰灰
* Email: jianweie@163.com * Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10 * CreateTime: 2022/10/24 3:54:14
* Description: 暂无 * 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;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Repository namespace CoreCms.Net.Repository
{ {
/// <summary> /// <summary>
/// 文章分类表 接口实现 /// 文章分类表 接口实现
/// </summary> /// </summary>
public class CoreCmsArticleTypeRepository : BaseRepository<CoreCmsArticleType>, ICoreCmsArticleTypeRepository public class CoreCmsArticleTypeRepository : BaseRepository<CoreCmsArticleType>, ICoreCmsArticleTypeRepository
{ {
private readonly IUnitOfWork _unitOfWork;
public CoreCmsArticleTypeRepository(IUnitOfWork unitOfWork) : base(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;
}
} }
} }

View File

@@ -66,8 +66,8 @@ namespace CoreCms.Net.Repository
_unitOfWork.BeginTran(); _unitOfWork.BeginTran();
//先清理掉数据,因为是配置数据,可直接删除添加新的 //先清理掉数据,因为是配置数据,可直接删除添加新的
await DbClient.Deleteable<CoreCmsContinuousCheckInRules>().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).RemoveDataCache().ExecuteCommandAsync(); await DbClient.Deleteable<CoreCmsContinuousCheckInRuleDetails>().Where(p => p.id > 0).ExecuteCommandAsync();
//遍历数据存值 //遍历数据存值
foreach (var item in entity) foreach (var item in entity)
@@ -77,13 +77,13 @@ namespace CoreCms.Net.Repository
days = item.days days = item.days
}; };
var id = await DbClient.Insertable(continuous).RemoveDataCache().ExecuteReturnIdentityAsync(); var id = await DbClient.Insertable(continuous).ExecuteReturnIdentityAsync();
if (id <= 0) continue; if (id <= 0) continue;
foreach (var detail in item.details) foreach (var detail in item.details)
{ {
detail.ruleId = id; detail.ruleId = id;
} }
await DbClient.Insertable(item.details).RemoveDataCache().ExecuteReturnIdentityAsync(); await DbClient.Insertable(item.details).ExecuteReturnIdentityAsync();
} }
_unitOfWork.CommitTran(); _unitOfWork.CommitTran();

View File

@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
return jm; return jm;
} }
var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync(); var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
var bl = id > 0; var bl = id > 0;
jm.code = bl ? 0 : 1; jm.code = bl ? 0 : 1;
@@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository
{ {
if (entity.isDefault == true) 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; return jm;
@@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository
oldModel.description = entity.description; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
if (bl) if (bl)
@@ -111,7 +111,7 @@ namespace CoreCms.Net.Repository
//其他处理 //其他处理
if (entity.isDefault) 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 = "存在关联的分销用户数据,禁止删除"; jm.msg = "存在关联的分销用户数据,禁止删除";
return jm; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
if (bl) if (bl)
{ {
await DbClient.Deleteable<CoreCmsDistributionCondition>().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).RemoveDataCache().ExecuteCommandAsync(); await DbClient.Deleteable<CoreCmsDistributionResult>().Where(p => p.gradeId == id).ExecuteCommandAsync();
} }
return jm; return jm;

View File

@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
return jm; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -84,7 +84,7 @@ namespace CoreCms.Net.Repository
oldModel.parameters = entity.parameters; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm; return jm;
@@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
@@ -131,7 +131,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
public async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity) public async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity)
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -56,7 +56,7 @@ namespace CoreCms.Net.Repository
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -72,7 +72,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -36,6 +36,7 @@ namespace CoreCms.Net.Repository
} }
#region
/// <summary> /// <summary>
/// 重写异步插入方法 /// 重写异步插入方法
/// </summary> /// </summary>
@@ -285,6 +286,9 @@ namespace CoreCms.Net.Repository
return jm; return jm;
} }
#endregion
#region
/// <summary> /// <summary>
/// 重写异步更新方法方法 /// 重写异步更新方法方法
/// </summary> /// </summary>
@@ -734,7 +738,7 @@ namespace CoreCms.Net.Repository
return jm; return jm;
} }
#endregion
#region ID集合的数据() #region ID集合的数据()
/// <summary> /// <summary>
@@ -1923,5 +1927,132 @@ namespace CoreCms.Net.Repository
} }
#endregion #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
} }
} }

View File

@@ -64,10 +64,10 @@ namespace CoreCms.Net.Repository
var goodsTypeSpec = new CoreCmsGoodsTypeSpec(); var goodsTypeSpec = new CoreCmsGoodsTypeSpec();
goodsTypeSpec.name = entity.name; goodsTypeSpec.name = entity.name;
goodsTypeSpec.sort = entity.sort; 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; 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 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -107,7 +107,7 @@ namespace CoreCms.Net.Repository
} }
oldModel.name = entity.name; oldModel.name = entity.name;
oldModel.sort = entity.sort; oldModel.sort = entity.sort;
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
if (bl) if (bl)
{ {
var oldValues = await DbClient.Queryable<CoreCmsGoodsTypeSpecValue>().OrderBy(p => p.sort).Where(p => p.specId == oldModel.id).ToListAsync(); 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(); 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(); var values = oldValues.Select(p => p.value).ToList();
@@ -125,7 +125,7 @@ namespace CoreCms.Net.Repository
if (newValues.Any()) if (newValues.Any())
{ {
var newList = newValues.Select((t, index) => new CoreCmsGoodsTypeSpecValue() { specId = oldModel.id, value = t, sort = oldValues.Count + index }).ToList(); 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; jm.code = bl ? 0 : 1;
@@ -144,12 +144,12 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
if (bl) 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; return jm;

View File

@@ -150,7 +150,6 @@ namespace CoreCms.Net.Repository
#endregion #endregion
#region id和商品id获取下了多少订单 #region id和商品id获取下了多少订单
/// <summary> /// <summary>
/// 根据用户id和商品id获取下了多少订单 /// 根据用户id和商品id获取下了多少订单

View File

@@ -14,6 +14,7 @@ using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.Configuration; using CoreCms.Net.Configuration;
using CoreCms.Net.DTO;
using CoreCms.Net.IRepository; using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
@@ -176,5 +177,71 @@ namespace CoreCms.Net.Repository
#endregion #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
} }
} }

View File

@@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -69,7 +69,7 @@ namespace CoreCms.Net.Repository
oldModel.sort = entity.sort; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -85,7 +85,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -54,35 +54,31 @@ namespace CoreCms.Net.Repository
sort = p.sort, sort = p.sort,
isDel = p.isDel, isDel = p.isDel,
createTime = p.createTime createTime = p.createTime
}).ToPageListAsync(pageIndex, pageSize, totalCount); }).WithCache().ToPageListAsync(pageIndex, pageSize, totalCount);
var list = new PageList<CoreCmsNotice>(page, pageIndex, pageSize, totalCount); var list = new PageList<CoreCmsNotice>(page, pageIndex, pageSize, totalCount);
return list; return list;
} }
/// <summary> /// <summary>
/// 获取列表首页用 /// 获取首页组件数据
/// </summary> /// </summary>
/// <param name="predicate">判断集合</param> /// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <returns></returns> /// <returns></returns>
public async Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate, public async Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate)
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20)
{ {
var list = await DbClient.Queryable<CoreCmsNotice>().OrderByIF(orderByExpression != null, orderByExpression, orderByType) var list = await DbClient.Queryable<CoreCmsNotice>()
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsNotice .WhereIF(predicate != null, predicate)
.OrderBy(p => p.sort)
.Select(p => (dynamic)new
{ {
id = p.id, p.id,
title = p.title, p.title,
type = p.type, p.type,
sort = p.sort, p.sort,
isDel = p.isDel, p.createTime
createTime = p.createTime })
}).ToPageListAsync(pageIndex, pageSize); .WithCache().ToListAsync();
return list; return list;
} }

View File

@@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository
oldModel.isOpenSelfDelivery = entity.isOpenSelfDelivery; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -73,7 +73,7 @@ namespace CoreCms.Net.Repository
oldModel.sortId = entity.sortId; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -89,7 +89,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository
oldModel.isDelete = entity.isDelete; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
@@ -108,7 +108,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
@@ -83,7 +83,7 @@ namespace CoreCms.Net.Repository
oldModel.identificationCode = entity.identificationCode; 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository
{ {
var jm = new AdminUiCallBack(); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
@@ -126,7 +126,7 @@ namespace CoreCms.Net.Repository
var ids = new List<int>() { id }; var ids = new List<int>() { id };
GetIds(all, id, ids); 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.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;

View File

@@ -4,19 +4,28 @@
* Web: https://www.corecms.net * Web: https://www.corecms.net
* Author: 大灰灰 * Author: 大灰灰
* Email: jianweie@163.com * Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10 * CreateTime: 2022/10/24 3:54:14
* Description: 暂无 * 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;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices; using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Services namespace CoreCms.Net.Services
{ {
/// <summary> /// <summary>
/// 文章分类表 接口实现 /// 文章分类表 接口实现
/// </summary> /// </summary>
public class CoreCmsArticleTypeServices : BaseServices<CoreCmsArticleType>, ICoreCmsArticleTypeServices public class CoreCmsArticleTypeServices : BaseServices<CoreCmsArticleType>, ICoreCmsArticleTypeServices
{ {
@@ -25,9 +34,40 @@ namespace CoreCms.Net.Services
public CoreCmsArticleTypeServices(IUnitOfWork unitOfWork, ICoreCmsArticleTypeRepository dal) public CoreCmsArticleTypeServices(IUnitOfWork unitOfWork, ICoreCmsArticleTypeRepository dal)
{ {
_dal = dal; this._dal = dal;
BaseDal = dal; base.BaseDal = dal;
_unitOfWork = unitOfWork; _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);
}
} }
} }

View File

@@ -13,6 +13,7 @@
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" /> <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Qiniu" Version="8.2.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" Version="1.0.4" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" /> <PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" /> <PackageReference Include="System.Drawing.Common" Version="6.0.0" />

View File

@@ -998,7 +998,6 @@ namespace CoreCms.Net.Services
} }
#endregion #endregion
/// <summary> /// <summary>
/// 根据条件查询代理池商品分页数据 /// 根据条件查询代理池商品分页数据
/// </summary> /// </summary>
@@ -1045,5 +1044,19 @@ namespace CoreCms.Net.Services
#endregion #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);
}
} }
} }

View File

@@ -185,6 +185,7 @@ namespace CoreCms.Net.Services
#endregion #endregion
#region #region
/// <summary> /// <summary>
/// 获取税号 /// 获取税号

View File

@@ -17,6 +17,7 @@ using Newtonsoft.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using NLog; using NLog;
using System; using System;
using System.Globalization;
using Essensoft.Paylink.Alipay; using Essensoft.Paylink.Alipay;
using Essensoft.Paylink.Alipay.Domain; using Essensoft.Paylink.Alipay.Domain;
using Essensoft.Paylink.Alipay.Request; using Essensoft.Paylink.Alipay.Request;
@@ -67,7 +68,7 @@ namespace CoreCms.Net.Services
OutTradeNo = entity.paymentId, OutTradeNo = entity.paymentId,
Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle, Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle,
ProductCode = entity.paymentCode, ProductCode = entity.paymentCode,
TotalAmount = entity.money.ToString(), TotalAmount = entity.money.ToString(CultureInfo.InvariantCulture),
Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle
}; };
var req = new AlipayTradeAppPayRequest(); var req = new AlipayTradeAppPayRequest();

View File

@@ -19,6 +19,7 @@ using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions; using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.WeChat.Service.HttpClients; using CoreCms.Net.WeChat.Service.HttpClients;
using Essensoft.Paylink.Alipay.Domain;
using Essensoft.Paylink.WeChatPay; using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay.V2; using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Request; using Essensoft.Paylink.WeChatPay.V2.Request;
@@ -26,6 +27,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using QRCoder;
using SKIT.FlurlHttpClient.Wechat.Api; using SKIT.FlurlHttpClient.Wechat.Api;
using SKIT.FlurlHttpClient.Wechat.Api.Models; using SKIT.FlurlHttpClient.Wechat.Api.Models;
@@ -178,36 +180,69 @@ namespace CoreCms.Net.Services
var response = await _client.ExecuteAsync(orderRequest, _optionsAccessor.Value); var response = await _client.ExecuteAsync(orderRequest, _optionsAccessor.Value);
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success) if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)
{ {
var req = new WeChatPayJsApiSdkRequest //App微信支付
{
Package = "prepay_id=" + response.PrepayId
};
WeChatPayDictionary parameter;
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString()) if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString())
{ {
var reqApp = new WeChatPayAppSdkRequest() var reqApp = new WeChatPayAppSdkRequest()
{ {
PrepayId = response.PrepayId PrepayId = response.PrepayId
}; };
parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value); var parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value);
parameter.Add("paymentId", entity.paymentId);
jm.status = true;
jm.msg = "创建微信APP支付环境成功";
jm.data = parameter;
jm.otherData = response;
} }
else //JsApi通用微信支付
else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString())
{ {
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 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;
} }
// 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6)
parameter.Add("paymentId", entity.paymentId);
jm.status = true;
//jm.msg = "创建支付环境成功";
jm.data = parameter;
jm.otherData = response;
} }
else else
{ {
jm.status = false; jm.status = false;
jm.msg = "微信建立支付请求失败"; jm.msg = "微信建立支付请求失败";
jm.otherData = response; //jm.otherData = response;
} }
return jm; return jm;
} }

View File

@@ -63,9 +63,7 @@ namespace CoreCms.Net.Services
using var container = _serviceProvider.CreateScope(); using var container = _serviceProvider.CreateScope();
var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>(); var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>();
var pinTuanRuleServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRuleServices>();
var pinTuanRecordServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRecordServices>(); var pinTuanRecordServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRecordServices>();
var pinTuanGoodsServices = container.ServiceProvider.GetService<ICoreCmsPinTuanGoodsServices>();
var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>(); var orderServices = container.ServiceProvider.GetService<ICoreCmsOrderServices>();
var goodsInfo = await goodsServices.GetGoodsDetail(goodsId, userId, false, "goods", 0, needGoodSku); 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; 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; goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds;
} }
else if (goodsInfo.pinTuanRule.startTime <= dt && goodsInfo.pinTuanRule.endTime > dt) else if (goodsInfo.pinTuanRule.startTime <= dt && goodsInfo.pinTuanRule.endTime > dt)
{ {
goodsInfo.pinTuanRule.pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin; 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; goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds;
} }
else else

View File

@@ -14,6 +14,7 @@ using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.Configuration; using CoreCms.Net.Configuration;
using CoreCms.Net.DTO;
using CoreCms.Net.IRepository; using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices; 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.Basics;
using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Model.ViewModels.UI;
using Essensoft.Paylink.Alipay.Domain;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using SqlSugar; using SqlSugar;
@@ -65,15 +67,18 @@ namespace CoreCms.Net.Services
/// 接口上获取拼团所有商品 /// 接口上获取拼团所有商品
/// </summary> /// </summary>
/// <returns></returns> /// <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(); var jm = new WebApiCallBack();
using var container = _serviceProvider.CreateScope(); using var container = _serviceProvider.CreateScope();
var pinTuanGoodsServices = container.ServiceProvider.GetService<ICoreCmsPinTuanGoodsServices>(); var pinTuanGoodsServices = container.ServiceProvider.GetService<ICoreCmsPinTuanGoodsServices>();
var pinTuanRuleServices = container.ServiceProvider.GetService<ICoreCmsPinTuanRuleServices>(); 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()) if (pinTuanRules == null && !pinTuanRules.Any())
{ {
jm.status = true; jm.status = true;
@@ -81,30 +86,35 @@ namespace CoreCms.Net.Services
return jm; return jm;
} }
//获取开启的规则集序列 //获取开启的规则集序列
var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToList(); var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToArray();
//获取下级商品数据
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();
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); item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun;
if (pinTuanGood != null) var ts = item.startTime.Subtract(dt);
{ item.timestamp = (int)ts.TotalSeconds;
var g = await pinTuanGoodsServices.GetGoodsInfo(item, pinTuanGood.goodsId, userId, false,
false, false);
if (g == null) continue;
goods.Add(g);
}
} }
jm.data = goods; 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;
}
else
{
item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired;
}
item.pinTuanPrice -= item.discountAmount;
} }
jm.data = dtoData;
jm.status = true; jm.status = true;
return jm; return jm;
} }
@@ -136,5 +146,25 @@ namespace CoreCms.Net.Services
{ {
return await _dal.GetPinTuanInfo(ruleId); 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);
}
} }
} }

View File

@@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.Configuration; using CoreCms.Net.Configuration;
using CoreCms.Net.DTO;
using CoreCms.Net.IRepository; using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices; using CoreCms.Net.IServices;
@@ -175,17 +176,17 @@ namespace CoreCms.Net.Services
#endregion #endregion
#region #region
/// <summary> /// <summary>
/// 获取团购列表数据 /// 获取团购列表数据
/// </summary> /// </summary>
/// <returns></returns> /// <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 }; var jm = new WebApiCallBack { status = true };
@@ -207,51 +208,75 @@ namespace CoreCms.Net.Services
{ {
where = where.And(p => p.endTime < dt); where = where.And(p => p.endTime < dt);
} }
var goods = new List<CoreCmsGoods>(); var goods = new List<CoreCmsGoods>();
var list = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize); var promotions = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize, true, true, 60);
if (list != null && list.Any()) 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 dtNow = DateTime.Now;
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId);
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")) if (condition != null && condition.parameters.Contains("goodsId"))
{ {
JObject parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters); var parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters);
var goodId = parameters["goodsId"].ObjectToInt(0);
var good = goodData.Find(p => p.id == goodId);
var res = await GetGroupDetail(parameters["goodsId"].ObjectToInt(0), userId, type, item.id); if (good != null)
if (res.status)
{ {
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; TimeSpan ts = item.endTime.Subtract(dtNow);
good.groupType = item.type; dto.timestamp = (int)ts.TotalSeconds;
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;
} }
} }
dtoData.Add(dto);
} }
} }
jm.data = new jm.data = new
{ {
goods, promotions.TotalCount,
list.TotalCount, promotions.TotalPages,
list.TotalPages, list = dtoData,
list,
pageIndex, pageIndex,
pageSize pageSize
}; };
@@ -266,7 +291,7 @@ namespace CoreCms.Net.Services
/// </summary> /// </summary>
/// <returns></returns> /// <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(); using var container = _serviceProvider.CreateScope();
@@ -275,31 +300,40 @@ namespace CoreCms.Net.Services
var jm = new WebApiCallBack() { msg = "关键参数丢失" }; var jm = new WebApiCallBack() { msg = "关键参数丢失" };
if (goodId == 0) if (groupId == 0)
{ {
return jm; return jm;
} }
//判断商品是否参加团购 var promotion = await _dal.QueryByClauseAsync(p => p.isDel == false && p.isEnable == true && p.id == groupId, true, true);
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);
if (promotion == null) if (promotion == null)
{ {
jm.msg = "无此活动"; 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; return jm;
} }
var goods = new CoreCmsGoods();
string typeStr = type == (int)GlobalEnumVars.PromotionType.Group ? GlobalEnumVars.PromotionType.Group.ToString().ToLowerInvariant() : GlobalEnumVars.PromotionType.Seckill.ToString().ToLowerInvariant(); 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) if (goods == null)
{ {
jm.msg = "商品不存在"; 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 checkOrder = orderServices.FindLimitOrder(goods.product.id, userId, promotion.startTime, promotion.endTime, promotion.type);
var productStock = goods.product.stock;
//如果最大为设置值 //如果最大为设置值
if (promotion.maxGoodsNums > 0) 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.product.stock = checkOrder.TotalOrders - promotion.maxNums >= 0 ? 0 : promotion.maxNums - checkOrder.TotalOrders;
} }
goods.buyPromotionCount = checkOrder.TotalOrders; goods.buyPromotionCount = checkOrder.TotalOrders;
var dt = DateTime.Now; var dt = DateTime.Now;
goods.groupId = promotion.id; goods.groupId = promotion.id;
@@ -351,7 +381,6 @@ namespace CoreCms.Net.Services
TimeSpan ts = promotion.endTime.Subtract(dt); TimeSpan ts = promotion.endTime.Subtract(dt);
goods.groupTimestamp = (int)ts.TotalSeconds; goods.groupTimestamp = (int)ts.TotalSeconds;
//进行促销后要更换原销售价替换原市场价 //进行促销后要更换原销售价替换原市场价
var originPrice = Math.Round(goods.product.price + goods.product.promotionAmount, 2); var originPrice = Math.Round(goods.product.price + goods.product.promotionAmount, 2);
goods.product.mktprice = originPrice; goods.product.mktprice = originPrice;

View File

@@ -532,9 +532,9 @@ namespace CoreCms.Net.Services
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.PinTuan: 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 else
{ {
@@ -565,9 +565,9 @@ namespace CoreCms.Net.Services
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.AddPinTuan: 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 else
{ {
@@ -598,24 +598,24 @@ namespace CoreCms.Net.Services
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.Group: 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 else
{ {
jm.msg = "参数必须传goodsId,groupId"; jm.msg = "参数必须传groupId";
return jm; return jm;
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.Seckill: 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 else
{ {
jm.msg = "参数必须传goodsId,groupId"; jm.msg = "参数必须传groupId";
return jm; return jm;
} }
break; break;
@@ -641,6 +641,17 @@ namespace CoreCms.Net.Services
return jm; return jm;
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods:
if (parameter.ContainsKey("serviceGoodsId"))
{
str = parameter["serviceGoodsId"]?.ToString();
}
else
{
jm.msg = "参数必须传id";
return jm;
}
break;
default: default:
jm.msg = GlobalErrorCodeVars.Code10000; jm.msg = GlobalErrorCodeVars.Code10000;
return jm; return jm;
@@ -682,9 +693,8 @@ namespace CoreCms.Net.Services
{ {
jm.data = new jm.data = new
{ {
goodsId = arr[0], groupId = arr[0],
groupId = arr[1], teamId = arr[1]
teamId = arr[2]
}; };
jm.status = true; jm.status = true;
} }
@@ -712,9 +722,8 @@ namespace CoreCms.Net.Services
{ {
jm.data = new jm.data = new
{ {
goodsId = arr[0], groupId = arr[0],
groupId = arr[1], teamId = arr[1]
teamId = arr[2]
}; };
jm.status = true; jm.status = true;
} }
@@ -734,23 +743,21 @@ namespace CoreCms.Net.Services
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.Group: case (int)GlobalEnumVars.UrlSharePageType.Group:
if (arr.Length == 2) if (arr.Length == 1)
{ {
jm.data = new jm.data = new
{ {
goodsId = arr[0], groupId = arr[0],
groupId = arr[1],
}; };
jm.status = true; jm.status = true;
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.Seckill: case (int)GlobalEnumVars.UrlSharePageType.Seckill:
if (arr.Length == 2) if (arr.Length == 1)
{ {
jm.data = new jm.data = new
{ {
goodsId = arr[0], groupId = arr[0],
groupId = arr[1],
}; };
jm.status = true; jm.status = true;
} }
@@ -769,6 +776,13 @@ namespace CoreCms.Net.Services
jm.status = true; jm.status = true;
} }
break; break;
case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods:
if (arr.Length == 1)
{
jm.data = new { serviceGoodsId = arr[0] };
jm.status = true;
}
break;
default: default:
jm.msg = GlobalErrorCodeVars.Code10000; jm.msg = GlobalErrorCodeVars.Code10000;
return jm; return jm;

View File

@@ -57,19 +57,13 @@ namespace CoreCms.Net.Services
/// <summary> /// <summary>
/// 获取列表首页用 /// 获取首页组件数据
/// </summary> /// </summary>
/// <param name="predicate">判断集合</param> /// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <returns></returns> /// <returns></returns>
public async Task<List<CoreCmsNotice>> QueryListAsync(Expression<Func<CoreCmsNotice, bool>> predicate, public async Task<List<dynamic>> QueryComponentAsync(Expression<Func<CoreCmsNotice, bool>> predicate)
Expression<Func<CoreCmsNotice, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20)
{ {
return await _dal.QueryListAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize); return await _dal.QueryComponentAsync(predicate);
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,14 @@
showLoginTip: false, showLoginTip: false,
}, },
onLaunch() { 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 // #ifdef MP-WEIXIN
this.autoUpdate(); this.autoUpdate();
// #endif // #endif
@@ -21,14 +29,6 @@
// 获取店铺配置信息 全局只请求一次 // 获取店铺配置信息 全局只请求一次
this.$u.api.shopConfigV2().then(res => { this.$u.api.shopConfigV2().then(res => {
this.$store.commit('config', res.data) 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 => { this.$u.api.getAreaList().then(res => {
@@ -36,12 +36,11 @@
this.$db.set('areaList', res.data) this.$db.set('areaList', res.data)
} }
}); });
}, },
onShow: function (obj) { onShow: function (obj) {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.$store.commit('scene', obj.scene) this.$store.commit('scene', obj.scene)
console.log(obj); //console.log(obj);
// #endif // #endif
//console.log('App Show') //console.log('App Show')
}, },
@@ -170,7 +169,7 @@
// vue App的样式 // vue App的样式
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
@import "@/static/style/style.vue.scss"; @import "@/static/style/style.app.scss";
/* #endif */ /* #endif */
// 小程序特有的样式 // 小程序特有的样式

View File

@@ -160,21 +160,25 @@ module.exports = {
this.$u.route(url) this.$u.route(url)
}, },
// 秒杀详情 // 秒杀详情
goSeckillDetail(id, groupId) { goSeckillDetail(id) {
this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id, groupId: groupId, }); this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id });
}, },
// 团购详情 // 团购详情
goGroupBuyingDetail(id, groupId) { goGroupBuyingDetail(id) {
this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id, groupId: groupId, }); this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id });
}, },
//拼团详情页 //拼团详情页
goPinTuanDetail(id, pinTuanId, teamId) { goPinTuanDetail(id, teamId) {
if (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 { } 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() { goSeckillList() {
this.$u.route('/pages/activity/seckill/list/list') 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() { goArticleList() {
this.$u.route('/pages/article/list/list') this.$u.route('/pages/article/list/list')
}, },
@@ -231,7 +238,7 @@ module.exports = {
* 接龙接口信息 * 接龙接口信息
*/ */
// 查看服务详情 // 查看接龙详情
goSolitaireDetail(id) { goSolitaireDetail(id) {
this.$u.route('/pages/activity/solitaire/solitaireDetails/solitaireDetails', { id: id }); this.$u.route('/pages/activity/solitaire/solitaireDetails/solitaireDetails', { id: id });
}, },
@@ -241,7 +248,6 @@ module.exports = {
}, },
//服务接口信息 //服务接口信息
// 查看服务详情
goServicesDetail(serviceId) { goServicesDetail(serviceId) {
this.$u.route('/pages/serviceGoods/details/details', { id: serviceId }); this.$u.route('/pages/serviceGoods/details/details', { id: serviceId });
}, },
@@ -266,14 +272,11 @@ module.exports = {
} }
if (type == navLinkType.urlLink) { if (type == navLinkType.urlLink) {
if (val.indexOf('http') != -1) { if (val.indexOf('http') != -1) {
// #ifdef H5 // #ifdef APP-PLUS || APP-PLUS-NVUE || MP
window.location.href = val
// #endif
// #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP
this.$u.route('/pages/webview/webview', { src: val }); this.$u.route('/pages/webview/webview', { src: val });
// #endif // #endif
} else { } 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') { 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 }); this.$u.route({ type: 'switchTab', url: val });
return; return;

View File

@@ -5,7 +5,6 @@
const install = (Vue, vm) => { 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 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 } }); 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 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 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 } }); 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(因为vm就是this也即this.$u.api)下
vm.$u.api = { vm.$u.api = {
shopConfigV2, shopConfigV2,
@@ -485,8 +471,7 @@ const install = (Vue, vm) => {
paymentInfo, paymentInfo,
pay, pay,
orderEvaluate, orderEvaluate,
//isSign,
//sign,
userCheckIn, userCheckIn,
getUserCheckByMonth, getUserCheckByMonth,
getUserCheckCount, getUserCheckCount,

View File

@@ -17,16 +17,12 @@ module.exports = (vm) => {
// #endif // #endif
// 注如果局部custom与全局custom有同名属性则后面的属性会覆盖前面的属性相当于Object.assign(全局,局部) // 注如果局部custom与全局custom有同名属性则后面的属性会覆盖前面的属性相当于Object.assign(全局,局部)
//defaultConfig.custom = {}; // 全局自定义参数默认值 //defaultConfig.custom = {}; // 全局自定义参数默认值
// #ifdef H5 || APP-PLUS || MP-ALIPAY || MP-WEIXIN // #ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN
defaultConfig.timeout = 60000; defaultConfig.timeout = 60000;
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
defaultConfig.sslVerify = true; defaultConfig.sslVerify = true;
// #endif // #endif
// #ifdef H5
// 跨域请求时是否携带凭证cookies仅H5支持HBuilderX 2.6.15+
defaultConfig.withCredentials = false;
// #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
defaultConfig.firstIpv4 = false; // DNS解析时优先使用ipv4 仅 App-Android 支持 (HBuilderX 2.8.0+) defaultConfig.firstIpv4 = false; // DNS解析时优先使用ipv4 仅 App-Android 支持 (HBuilderX 2.8.0+)
// #endif // #endif
@@ -84,7 +80,7 @@ module.exports = (vm) => {
//console.log(page.route); //console.log(page.route);
// 登录信息过期或者未登录 // 登录信息过期或者未登录
if (data.data === 14007 || data.data === 14006) { 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) { if (page.route.indexOf('pages/login/loginBySMS/loginBySMS') < 0) {
db.del("userToken"); db.del("userToken");
uni.showToast({ uni.showToast({

View File

@@ -1,20 +1,14 @@
/** /**
* 全局配置文件 * 全局配置文件
* @version 0.6.2 * @version 1.0.0
*/ */
//接口请求地址如果需要不部署接口端的情况下测试uni-app可以直接替换为官方测试接口https://api.demo.coreshop.cn //接口请求地址如果需要不部署接口端的情况下测试uni-app可以直接替换为官方测试接口https://api.demo.coreshop.cn
//export const apiBaseUrl = 'https://api.pro.coreshop.cn'; export const apiBaseUrl = process.env.NODE_ENV === 'development' ? 'https://api.nsts.mvccms.cn' : 'https://api.nsts.mvccms.cn';
export const apiBaseUrl = 'http://localhost:2015';
//项目静态资源请求地址如果使用官方的静态文件地址可以直接替换为https://files.cdn.coreshop.cn //项目静态资源请求地址如果使用官方的静态文件地址可以直接替换为https://files.cdn.coreshop.cn
export const apiFilesUrl = '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 = { export const paymentType = {
//普通订单 //普通订单
@@ -25,7 +19,6 @@ export const paymentType = {
group: 3, group: 3,
//秒杀订单 //秒杀订单
seckill: 4, seckill: 4,
//砍价 //砍价
bargain: 6, bargain: 6,
//赠品 //赠品
@@ -34,10 +27,8 @@ export const paymentType = {
solitaire: 8, solitaire: 8,
//交易组件 //交易组件
transactionComponent: 10, transactionComponent: 10,
//充值 //充值
recharge: 201, recharge: 201,
//服务订单 //服务订单
serviceOrder: 501, serviceOrder: 501,
//表单付款码 //表单付款码
@@ -46,7 +37,6 @@ export const paymentType = {
formOrder: 302, formOrder: 302,
}; };
//分享链接及海报类型 //分享链接及海报类型
export const shareType = { export const shareType = {
// 首页 // 首页
@@ -55,7 +45,7 @@ export const shareType = {
goods: 2, goods: 2,
// 3拼团详情页 // 3拼团详情页
pinTuan: 3, pinTuan: 3,
// 4店铺邀请 // 4分销店铺
inv: 4, inv: 4,
// 5文章页面 // 5文章页面
article: 5, article: 5,
@@ -69,15 +59,54 @@ export const shareType = {
group: 9, group: 9,
// 10秒杀 // 10秒杀
seckill: 10, seckill: 10,
// 11代理 // 11代理店铺
agent: 11, agent: 11,
// 12接龙 // 12接龙
solitaire: 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 shareUrl = 'pages/share/jump/jump'; //分享初始化地址
//列表加载状态
export const loadStatus = {
// 加载前的状态
loadMore: 'loadmore',
// 加载中的状态
loading: 'loading',
// 没有更多的状态
noMore: 'nomore',
};
//nav页面导航类型 //nav页面导航类型
export const navLinkType = { export const navLinkType = {
@@ -87,3 +116,5 @@ export const navLinkType = {
articleCategory: 4,// "文章分类", articleCategory: 4,// "文章分类",
intelligentForms: 5// "智能表单" intelligentForms: 5// "智能表单"
}; };

View File

@@ -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",
};

View File

@@ -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) { function formatMoney(number, places, symbol, thousand, decimal) {
// console.log(number)
// console.log(places)
number = number || 0 number = number || 0
places = !isNaN((places = Math.abs(places))) ? places : 2 places = !isNaN((places = Math.abs(places))) ? places : 2
symbol = symbol !== undefined ? symbol : '¥' 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 * @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 { export {
formatMoney, formatMoney,
modelShow, modelShow,
isWeiXinBrowser,
getQueryString,
timeToDateObj,
moneySum, moneySum,
moneySub, moneySub,
setBarColor
} }

View File

@@ -98,7 +98,7 @@
* @property {Boolean} value=showLoginTip - 由v-model控制显示隐藏。 * @property {Boolean} value=showLoginTip - 由v-model控制显示隐藏。
* @property {Boolean} forceOauth - 小程序端特制的全屏登录提示。 * @property {Boolean} forceOauth - 小程序端特制的全屏登录提示。
*/ */
import { mapMutations, mapActions, mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
name: 'coreshopLoginModal', name: 'coreshopLoginModal',
components: {}, components: {},

View File

@@ -1,33 +1,57 @@
<template> <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-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
<view class="coreshop-cell-item-bd"> <u-toast ref="uToast" />
<view class="article-title "> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
{{ item.title }} <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="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>
<view class="article-des u-line-2"> <view class="cell-title-img">
{{ item.brief }} <image :src="coverImage" mode="aspectFill" class="coverImage"></image>
</view> </view>
</view> </view>
<view class="cell-title-img">
<image :src="item.coverImage" mode="aspectFill" class="coverImage"></image>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshoparticle", name: "coreshopArticle",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: true, 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: { computed: {
count() { count() {
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.parameters.list.length > 0)
} }
}, },
methods: { methods: {
@@ -40,14 +64,13 @@
</script> </script>
<style scoped lang="scss"> <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 { padding: 5px 0px 5px 0; float: left; width: 100%; border-bottom: 1px solid #f3f3f3;
.coreshop-cell-item-bd { float: left; width: calc(100% - 100px); .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; } .article-des { font-size: 14px; color: #999; overflow: hidden; float: left; line-height: 20px; }
} }
.cell-title-img { width: 80px; height: 80px; float: right; .cell-title-img { width: 80px; height: 80px; float: right;
.coverImage { width: 80px; height: 80px; } .coverImage { width: 80px; height: 80px; border-radius: 2px; }
} }
} }
} }

View File

@@ -1,16 +1,27 @@
<template> <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-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
<view class='coreshop-cell-item' v-for="item in coreshopdata.parameters.list" :key="item.id" @click="articleDetail(item.id)"> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
<view class="coreshop-cell-item-bd"> <view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.articleClassifyObj.name}}</view>
<view class="article-title"> <u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @click="goArticleClassify(coreshopData.parameters.articleClassifyObj.id)"></u-icon>
{{ item.title }} </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 }}
</view>
<view class="article-des u-line-2">
{{ item.brief }}
</view>
</view>
<view class="cell-title-img">
<image :src="item.coverImage" mode="aspectFill" class="coverImage"></image>
</view>
</view> </view>
<view class="article-des u-line-2">
{{ item.brief }}
</view>
</view>
<view class="cell-title-img">
<image :src="item.coverImage" mode="aspectFill" class="coverImage"></image>
</view> </view>
</view> </view>
</view> </view>
@@ -18,19 +29,19 @@
<script> <script>
export default { export default {
name: "coreshoparticleclassify", name: "coreshopArticleclassify",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: true, required: true,
} }
}, },
computed: { computed: {
count() { count() {
if (!this.coreshopdata.parameters.list) { if (!this.coreshopData.parameters.list) {
return false; return false;
} }
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.parameters.list.length > 0)
} }
}, },
methods: { methods: {
@@ -43,14 +54,14 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.coreshop-index-article { border-radius: 8px; padding: 0px 10px; background: #FFFFFF !important; color: #333333 !important; overflow: hidden; .coreshop-index-article { border-radius: 8px; 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 { 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; .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-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; } .article-des { font-size: 12px; color: #999; overflow: hidden; float: left; line-height: 20px; }
} }
.cell-title-img { width: 80px; height: 80px; float: right; .cell-title-img { width: 80px; height: 80px; float: right;
.coverImage { width: 80px; height: 80px; } .coverImage { width: 80px; height: 80px; border-radius: 2px; }
} }
} }
} }

View File

@@ -1,14 +1,14 @@
<template> <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"> <view>
<u-gap :height="coreshopdata.parameters.height * 2" :bg-color="coreshopdata.parameters.backgroundColor"></u-gap> <u-gap :height="coreshopData.parameters.height * 2" :bg-color="coreshopData.parameters.backgroundColor"></u-gap>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopblank", name: "coreshopBlank",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: true, required: true,
} }
@@ -17,7 +17,4 @@
} }
} }
</script> </script>
<style scoped lang="scss">
</style>

View File

@@ -12,15 +12,6 @@
content: { content: {
required: true, required: true,
} }
},
created() { },
methods: {
preview(src, e) {
// do something
},
navigate(href, e) {
// do something
}
} }
} }
</script> </script>

View File

@@ -1,94 +1,71 @@
<template> <template>
<!-- 首页优惠券卡片 --> <view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
<view class="coupon-box coreshop-margin-bottom-5 coreshop-padding-10" v-if="count">
<!--提示框组件-->
<u-toast ref="uToast" /> <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="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
<view class="head-title u-ellipsis-1">领券专区</view> <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> <u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="$u.route('/pages/coupon/coupon')"></u-icon>
</view> </view>
<scroll-view class="groupon-scroll" enable-flex scroll-anchoring scroll-x scroll-with-animation> <view class="coreshop-divider">
<view class="groupon-card-wrap coreshop-flex coreshop-align-center"> <view class="complete"></view>
<view v-for="(item, index) in coreshopdata.parameters.list" :key="item.id"> </view>
<!-- mini --> <view class="coreshop-margin-bottom-10 coreshop-bg-main coreshop-text-black">
<!--<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})` }"> <scroll-view class="groupon-scroll" enable-flex scroll-anchoring scroll-x scroll-with-animation>
<view class="card-left u-flex-col u-row-center u-p-l-30"> <view class="groupon-card-wrap coreshop-flex coreshop-align-center">
<view class="price coreshop-margin-bottom-10" :style="{ color: priceColor }">{{ item.amount }}</view> <view v-for="(item, index) in coreshopData.parameters.list" :key="item.id">
<view class="notice" :style="{ color: color }">{{ item.enough }}元可用</view> <view class="coreshop-padding-right-5">
<view class="notice coreshop-margin-bottom-10" :style="{ color: color }">仅剩{{ item.stock }}</view> <view class="coupon-wrap " :style="{ background: `linear-gradient(to right, ${bgColor1}, ${bgColor2})` }">
</view> <view class="coupon-item coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between">
<view class="card-right u-p-y-20 u-p-r-10 u-flex-col u-row-center u-col-center"> <view class="coupon-left coreshop-flex coreshop-flex-direction">
<button class="u-reset-button get-btn coreshop-margin-bottom-10" :style="{ color: color }" @tap="getCoupon(item.id, index)"> <view class="sum-box">
{{ item.status_code === 'cannot_get' ? '不可领取' : '领券购买' }} <text class="unit" style="color: #6b3f12"></text>
</button> <text class="sub" style="color: #6b3f12">{{ item.name }}</text>
</view> </view>
</view>--> <view class="notice " style="color: #9d6d25">
<!-- big --> <text v-for="(itemCondition, index) in item.conditions" :key="index">{{itemCondition}}</text>
<view class="coreshop-padding-right-5"> </view>
<view class="coupon-wrap " :style="{ background: `linear-gradient(to right, ${bgColor1}, ${bgColor2})` }"> <view class="notice" style="color: #9d6d25">
<view class="coupon-item coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between"> 有效期{{$u.timeFormat(item.startTime, 'yyyy-mm-dd')}} {{$u.timeFormat(item.endTime, 'yyyy-mm-dd')}}
<view class="coupon-left coreshop-flex coreshop-flex-direction"> </view>
<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>
<view class="notice " style="color: #9d6d25"> <view class="coupon-right coreshop-flex coreshop-flex-direction">
<text v-for="(itemCondition, index) in item.conditions" :key="index">{{itemCondition}}</text> <button class="get-btn" :style="{ color: bgColor1 }" @tap.stop="receiveCoupon(item.id)">立即领取</button>
</view> <view class="surplus-num" style="color: #9d6d25">
<view class="notice" style="color: #9d6d25"> <text v-for="(itemResult, index) in item.results" :key="index">{{itemResult}}</text>
有效期{{$u.timeFormat(item.startTime, 'yyyy-mm-dd')}} {{$u.timeFormat(item.endTime, 'yyyy-mm-dd')}} </view>
</view>
</view>
<view class="coupon-right coreshop-flex coreshop-flex-direction">
<button class="get-btn" :style="{ color: bgColor1 }" @tap.stop="receiveCoupon(item.id)">立即领取</button>
<view class="surplus-num" style="color: #9d6d25">
<text v-for="(itemResult, index) in item.results" :key="index">{{itemResult}}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </scroll-view>
</scroll-view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopcoupon", name: "coreshopCoupon",
components: { components: {
}, },
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, type: Object,
required: true, required: true,
} }
}, },
computed: { computed: {
count() { count() {
if (!this.coreshopdata) { if (!this.coreshopData) {
return false; return false;
} }
if (!this.coreshopdata.parameters) { if (!this.coreshopData.parameters) {
return false; return false;
} }
if (!this.coreshopdata.parameters.list) { if (!this.coreshopData.parameters.list) {
return false; return false;
} }
return (this.coreshopdata.parameters.list.length > 0) 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张"
}
]
} }
}, },
created() { created() {
@@ -99,32 +76,6 @@
</script> </script>
<style lang="scss" scoped> <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-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-item { width: 100%; height: 100%; border-radius: 5px;
.coupon-left { justify-content: center; padding-left: 10px; padding-right: 5px; .coupon-left { justify-content: center; padding-left: 10px; padding-right: 5px;

View File

@@ -1,91 +1,135 @@
<template> <template>
<view> <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>
<u-tabs :list="nameList" :current="current" @change="change"></u-tabs> <view class="coreshop-text-black">
<custom-waterfalls-flow :value="newData.list" :column="newData.column" @wapperClick="wapperClick" @imageClick="imageClick" v-if="newData.column>1">
<view v-for="(child,indexP) in newData.parameters.list" :key="indexP"> <!-- #ifdef MP-WEIXIN -->
<view class="goodsBox" v-show="child.isShow==true"> <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 v-if="child.column == '2' || child.column == '3' " v-bind:class="'column'+child.column"> <view class="coreshop-multiple-line-clamp">
<view class="" v-if="child.list"> <text class="coreshop-font-14">{{item.name}}</text>
<u-grid :col="child.column" :border="false" align="left"> </view>
<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="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center coreshop-margin-bottom-5">
<view class="good_box"> <view class="coreshop-text-red coreshop-font-weight-bold">
<u--image :src="item.image" mode="widthFix" width="100%" :height="child.column==2?'164px':'104px'" radius="10"></u--image> <text class="coreshop-font-12">¥</text>
<view class="good_title u-line-2"> <text class="coreshop-font-16">{{item.price}}</text>
{{item.name}} <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>
<view class="good-price coreshop-display-block"> <view>
{{item.price}} <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5 coreshop-text-gray">{{item.mktprice}}</span> <text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
</view> </view>
<view class="good-tag-recommend" v-if="item.isRecommend"> </view>
推荐 <view class="coreshop-divider" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
</view> <view class="complete"></view>
<view class="good-tag-hot" v-if="item.isHot"> </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> <view>
</view> {{ pointShowName}}兑换价:
</u-grid-item> </view>
</u-grid> <view class="coreshop-text-red">
</view> {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}}
<view v-else-if="!count && !child.listAjax"> </view>
<u-grid col="3" border="false" align="center"> </view>
<u-grid-item bg-color="transparent" :custom-style="{padding: '0rpx'}" v-for="item in 3" :key="item" @click="goGoodsDetail(item.id)"> <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 class="good_box"> <view>
<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="coreshop-text-red">
</view> {{item.points}}{{ pointShowName}}
<view class="good-price"> </view>
0 </view>
</view>
<view class="good-tag-recommend">
推荐
</view>
<view class="good-tag-hot">
热门
</view>
</view>
</u-grid-item>
</u-grid>
</view> </view>
</view> </view>
<!-- #endif -->
<!-- 列表平铺单列 --> <!-- #ifndef MP-WEIXIN -->
<view v-if="child.column == '1'"> <template v-slot:default="item">
<view v-if="child.list"> <view class="goods">
<u-grid :col="1" :border="false" align="left"> <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">
<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="coreshop-multiple-line-clamp">
<view class="good_box"> <text class="coreshop-font-14">{{item.name}}</text>
<u-row gutter="5" justify="space-between"> </view>
<u-col span="4"> <view class="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center coreshop-margin-bottom-5">
<u--image :src="item.image" mode="widthFix" width="100%" radius="10"></u--image> <view class="coreshop-text-red coreshop-font-weight-bold">
<view class="good-tag-recommend2" v-if="item.isRecommend"> <text class="coreshop-font-12">¥</text>
推荐 <text class="coreshop-font-16">{{item.price}}</text>
</view> <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-6 coreshop-text-gray" v-if="newData.column==2">{{item.mktprice}}</span>
<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> </view>
</u-grid-item> <view>
</u-grid> <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> </view>
<view class="order-none" v-else> </template>
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无" mode="list"></u-empty> <!-- #endif -->
</custom-waterfalls-flow>
<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>
<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="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="goPinTuanDetail(item.id,item.pinTuanRule.id)">立即购</view>
</view>
</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}}+{{ 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">
<view>
购买赠送:
</view>
<view class="coreshop-text-red">
{{item.points}}{{ pointShowName}}
</view>
</view>
</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> </view>
</view> </view>
</template> </template>
@@ -98,41 +142,55 @@
newData: {} newData: {}
}; };
}, },
name: "coreshopgoodTabBar", name: "coreshopGoodTabBar",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: true, required: true,
} }
}, },
mounted() { mounted() {
var _this = this; var _this = this;
this.newData = this.coreshopdata; this.newData = this.coreshopData;
for (var i = 0; i < this.newData.parameters.list.length; i++) { for (var i = 0; i < this.coreshopData.parameters.list.length; i++) {
let item = { let item = {
name: this.newData.parameters.list[i].title name: this.coreshopData.parameters.list[i].title
} }
this.nameList.push(item); this.nameList.push(item);
if (_this.current == i) { if (_this.current == i) {
_this.newData.parameters.list[i].isShow = true; _this.newData = this.coreshopData.parameters.list[i];
} else {
_this.newData.parameters.list[i].isShow = false;
} }
} }
}, },
computed: { 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: { 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; var _this = this;
this.current = item.index; 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) { if (_this.current == i) {
_this.newData.parameters.list[i].isShow = true; _this.newData = this.coreshopData.parameters.list[i];
} else { setTimeout(function () {
_this.newData.parameters.list[i].isShow = false; uni.hideLoading();
}, 300);
} }
} }
} }
@@ -156,4 +214,5 @@
.indicator-dots-active { background-color: $u-type-primary; } .indicator-dots-active { background-color: $u-type-primary; }
} }
} }
</style> </style>

View File

@@ -1,16 +1,19 @@
<template> <template>
<view>
<view class="goodsBox coreshop-margin-bottom-10 coreshop-padding-top-5">
<!-- 列表平铺两列三列 --> <!-- 列表平铺两列三列 -->
<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-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-margin-left-5 coreshop-margin-right-5 coreshop-margin-top-10 coreshop-margin-bottom-10 " v-if="coreshopdata.parameters.lookTitle == 'true'"> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30" 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-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>
<view class=" coreshop-margin-bottom-10 coreshop-margin-top-10" v-if="count"> <view class="coreshop-divider">
<custom-waterfalls-flow :value="coreshopdata.parameters.list" :column="coreshopdata.parameters.column" @wapperClick="wapperClick" @imageClick="imageClick"> <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 --> <!-- #ifdef MP-WEIXIN -->
<view class="goods" v-for="(item,index) in coreshopdata.parameters.list" :key="index" slot="slot{{index}}"> <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-white coreshop-border-radius-bl-18"> <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"> <view class="coreshop-multiple-line-clamp">
<text class="coreshop-font-14">{{item.name}}</text> <text class="coreshop-font-14">{{item.name}}</text>
</view> </view>
@@ -18,18 +21,21 @@
<view class="coreshop-text-red coreshop-font-weight-bold"> <view class="coreshop-text-red coreshop-font-weight-bold">
<text class="coreshop-font-12">¥</text> <text class="coreshop-font-12">¥</text>
<text class="coreshop-font-16">{{item.price}}</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>
<view> <view>
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text> <text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
</view> </view>
</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> <view>
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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 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"> <view class="coreshop-text-red coreshop-font-weight-bold">
<text class="coreshop-font-12">¥</text> <text class="coreshop-font-12">¥</text>
<text class="coreshop-font-16">{{item.price}}</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>
<view> <view>
<text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text> <text class="coreshop-font-10 coreshop-text-gray">{{item.buyCount+'人付款'}}</text>
</view> </view>
</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> <view>
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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 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,54 +90,55 @@
</template> </template>
<!-- #endif --> <!-- #endif -->
</custom-waterfalls-flow> </custom-waterfalls-flow>
</view>
<view v-else-if="!count && !coreshopdata.parameters.listAjax">
</view> </view>
</view> </view>
<!-- 列表平铺单列 --> <!-- 列表平铺单列 -->
<view v-if="coreshopdata.parameters.column == '1' && coreshopdata.parameters.display == 'list'"> <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-margin-left-5 coreshop-margin-right-5 coreshop-margin-top-10 coreshop-margin-bottom-10 "> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30" 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-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>
<view v-if="count"> <view class="coreshop-divider">
<u-grid :col="1" :border="false" align="left"> <view class="complete"></view>
<u-grid-item :custom-style="{padding: '0px'}" v-for="item in coreshopdata.parameters.list" :key="item.id"> </view>
<view class="good_box" @click="goGoodsDetail(item.id)"> <view class="coreshop-text-black" v-for="(item, index) in coreshopData.parameters.list" :key="item.id" v-if="count">
<u--image :src="item.image" width="100%" radius="10"></u--image> <view class="coreshop-flex coreshop-justify-start coreshop-padding-top-10 coreshop-padding-bottom-10">
<view class="good_title u-line-2"> <view>
{{item.name}} <u--image :src="item.image" mode="widthFix" width="130px" height="130px" radius="8"></u--image>
</view> </view>
<view class="good-price coreshop-display-block"> <view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
{{item.price}} <span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5 coreshop-text-gray">{{item.mktprice}}</span> <view class="coreshop-font-14 u-line-2 coreshop-text-black">{{ item.name }}</view>
</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="good-tag-recommend" v-if="item.isRecommend"> <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> <view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.viewCount}}人访问</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}}
</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">
<view>
购买赠送:
</view>
<view class="coreshop-text-red">
{{item.points}}{{ pointShowName}}
</view>
</view>
</view> </view>
</u-grid-item> <view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
</u-grid> <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>
<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}}+{{ 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">
<view>
购买赠送:
</view>
<view class="coreshop-text-red">
{{item.points}}{{ pointShowName}}
</view>
</view>
</view>
</view> </view>
<view class="order-none" v-else> <view class="order-none" v-else>
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无" mode="list"></u-empty> <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无" mode="list"></u-empty>
@@ -136,18 +146,21 @@
</view> </view>
<!-- 横向滚动 --> <!-- 横向滚动 -->
<block v-if="coreshopdata.parameters.display == 'slide'" <view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="coreshopData.parameters.display == 'slide'">
v-bind:class="'slide'+coreshopdata.parameters.column"> <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-margin-left-15 coreshop-margin-right-15 coreshop-margin-top-15 coreshop-margin-bottom-15" v-if="coreshopdata.parameters.lookTitle == 'true'"> <view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
<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> <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>
<block v-if="count"> <view class="coreshop-divider">
<swiper :class="coreshopdata.parameters.column==3?'swiper3':coreshopdata.parameters.column==2?'swiper2':''" @change="change"> <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"> <swiper-item v-for="no of pageCount" :key="no">
<u-grid :col="coreshopdata.parameters.column" :border="false" align="left" :data-id="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-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"> <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> </u-image>
<view class="good_title u-line-2"> <view class="good_title u-line-2">
{{item.name}} {{item.name}}
@@ -166,7 +179,7 @@
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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 class="indicator-dots-item" v-for="no of pageCount" :key="no" :class="[current == no ? 'indicator-dots-active' : '']">
</view> </view>
</view> </view>
</block> </view>
<view v-else=""> <view v-else="">
<scroll-view class='swiper-list' scroll-x="true"></scroll-view> <scroll-view class='swiper-list' scroll-x="true"></scroll-view>
</view> </view>
</block> </view>
</view> </view>
</template> </template>
@@ -204,20 +220,9 @@
count: false count: false
}; };
}, },
filters: { name: "coreshopGoods",
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",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: true, required: true,
} }
@@ -243,9 +248,9 @@
}, },
}, },
created() { created() {
this.count = this.coreshopdata.parameters.list.length > 0; this.count = this.coreshopData.parameters.list.length > 0;
var page = Number(this.coreshopdata.parameters.list.length / this.coreshopdata.parameters.column).toFixed(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) { if (this.coreshopData.parameters.column * page < this.coreshopData.parameters.list.length) {
page = Number(page) + 1; page = Number(page) + 1;
} }
for (var i = 0; i < page; i++) { for (var i = 0; i < page; i++) {
@@ -256,20 +261,17 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.goodsBox { color: #333333 !important; padding: 0 5px; overflow: hidden; .good_box { border-radius: 8px; background-color: #ffffff; padding: 5px; position: relative; width: 100%;
.good_box { border-radius: 8px; margin: 3px; background-color: #ffffff; padding: 5px; position: relative; width: 100%; .good_title { font-size: 14px; margin-top: 5px; color: $u-main-color; }
.good_title { font-size: 13px; 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_title-xl { font-size: 14px; margin-top: 5px; color: $u-main-color; } .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-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-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; }
.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-price { font-size: 15px; color: $u-type-error; margin-top: 5px; }
.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; } }
.good-price { font-size: 15px; color: $u-type-error; margin-top: 5px; }
}
.indicator-dots { margin-top: 10px; margin-bottom: 10px; display: flex; justify-content: center; align-items: center; flex-direction: row; .indicator-dots { margin-top: 10px; margin-bottom: 10px; display: flex; justify-content: center; align-items: center; flex-direction: row;
.indicator-dots-item { background-color: $u-tips-color; height: 6px; width: 6px; border-radius: 10px; margin: 0 3px; } .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; } .indicator-dots-active { background-color: $u-type-primary; }
}
} }
.swiper3 { height: 200px; } .swiper3 { height: 200px; }
.swiper2 { height: 270px; } .swiper2 { height: 270px; }

View File

@@ -1,75 +1,132 @@
<template> <template>
<!-- 团购秒杀 --> <view class="coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="listData && count">
<view v-if="count"> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-min-height-30">
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-top-10 coreshop-margin-bottom-10"> <view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{coreshopData.parameters.title}}</view>
<coreshop-section font-size="15" :title="coreshopdata.parameters.title" @click="goSeckillList()"></coreshop-section> <u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goGroupPurchase()"></u-icon>
</view> </view>
<view class="coreshop-margin-left-15 coreshop-margin-right-15" v-if="coreshopdata.parameters.list && count"> <view class="coreshop-divider">
<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="complete"></view>
<view class="img-list-item-l"> </view>
<u-image :src="item.goods.image" :index="item.id" :showLoading="true" width="100%" height="96px"></u-image> <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>
<view class="img-list-item-r"> <view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
<view class="coreshop-font-18 u-line-1">{{item.name}}</view> <view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
<view class="u-line-2 coreshop-margin-top-5 coreshop-margin-bottom-5">{{item.goods.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="item-c coreshop-flex coreshop-justify-between"> <!--<view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
<view class="red-price coreshop-justify-between"> <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>
{{item.goods.product.price}} <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>
<span class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}</span> <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>
<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-flex-direction-row coreshop-justify-between"> <view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 2) && item.lastTime">
<view class="red-price coreshop-font-15 coreshop-flex-direction-row" 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)">
<u-count-down :time="item.lastTime" format="HH:mm:ss"></u-count-down> <view class="time">
</view> <view class="coreshop-font-12">即将开始</view>
<view class="coreshop-font-12 red-price" v-if="item.startStatus == 3">已结束</view> <view class="time__custom">
<view class="coreshop-font-12 red-price" v-if="item.startStatus == 2">即将开始</view> <text class="time__custom__item">{{ item.timeData.days }}</text>
<u-icon name="shopping-cart" color="#2979ff" size="25" class="btnCart"></u-icon> </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> </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>
<view class="img-list-item" v-if="!item.id" v-for="(item, key) in coreshopdata.parameters.list" :key="key"> <view v-if="key+1 < listData.length">
<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="coreshop-divider">
<view class="img-list-item-r"> <view class="groupPurchase"></view>
<view class="goods-name list-goods-name">{{item.name}}</view> <view class="dot"></view>
<view class="item-c"> <view class="groupPurchase"></view>
<view class=" red-price">{{item.price}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopgrouppurchase", name: "coreshopGroupPurchase",
props: { props: {
coreshopdata: { coreshopData: {
// type: Array, // type: Array,
required: false, required: false,
} }
}, },
data() {
return {
listData: [],
}
},
mounted() {
this.listData = uni.$u.deepClone(this.coreshopData.parameters.list);
},
computed: { computed: {
count() { count() {
if (!this.coreshopdata) { if (!this.coreshopData) {
return false; return false;
} }
if (!this.coreshopdata.parameters) { if (!this.coreshopData.parameters) {
return false; return false;
} }
if (!this.coreshopdata.parameters.list) { if (!this.coreshopData.parameters.list) {
return false; return false;
} }
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.parameters.list.length > 0)
} }
}, },
methods: { methods: {
end(index) { end(index) {
let _that = this; let _that = this;
_that.list.splice(index, 1) _that.list.splice(index, 1)
} },
onChange(e, key) {
this.$set(this.listData[key], 'timeData', e)
},
}, },
} }
</script> </script>
@@ -80,7 +137,6 @@
.img-list-item-r { width: calc(100% - 120px); display: inline-block; margin-left: 7.5px; float: left; position: relative; .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; } .description { font-size: 12px; color: #929292; }
.item-c { width: 100%; margin-top: 0; .item-c { width: 100%; margin-top: 0;
.red-price { color: #FF7159 !important; }
.btnCart { float: right; } .btnCart { float: right; }
} }
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<!-- 单图 --> <!-- 单图 -->
<view class="coreshop-imgsingle coreshop-bg-white" v-if="coreshopdata.parameters.list && coreshopdata.parameters.list.length > 0"> <view class="coreshop-imgsingle coreshop-bg-white" v-if="listData && listData.length > 0">
<view class="" v-for="child in coreshopdata.parameters.list"> <view class="" v-for="child in listData">
<view @click="taped(child)"> <view @click="taped(child)">
<image class="ad-img" :src="child.image" mode="widthFix"></image> <image class="ad-img" :src="child.image" mode="widthFix"></image>
</view> </view>
@@ -14,19 +14,21 @@
<script> <script>
export default { export default {
name: "coreshopimgsingle", name: "coreshopImgSingle",
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, type: Array,
required: true, required: true,
} }
}, },
computed: { data() {
count() { return {
// console.log(coreshopdata) count: 0,
return (this.coreshopdata.parameters.list.length > 0) listData: [],
} }
},
created() {
this.listData = this.coreshopData;
}, },
methods: { methods: {
taped(item) { taped(item) {
@@ -40,7 +42,7 @@
.coreshop-imgsingle { overflow: hidden; position: relative; .coreshop-imgsingle { overflow: hidden; position: relative;
.ad-img { width: 100%; float: left; } .ad-img { width: 100%; float: left; }
.ad-img:last-child { margin-bottom: 0; } .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; } .coreshop-btn { line-height: 2; font-size: 14px; padding: 0 25px; border-radius: 25px; }
} }
} }

View File

@@ -1,15 +1,15 @@
<template> <template>
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10 coreshop-bg-white"> <view class="coreshop-bg-white">
<u-swiper :list="swiperItems" :height="swiperHeight" :interval="swiperDuration" keyName="image" @click="taped" indicator indicatorMode="line" circular></u-swiper> <u-swiper :list="swiperItems" :height="swiperHeight" :interval="swiperDuration" keyName="image" @click="onClicked" indicator indicatorMode="line" circular radius="0"></u-swiper>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopimgSlide", name: "coreshopImgSlide",
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, type: Object,
required: true, required: true,
} }
}, },
@@ -22,15 +22,14 @@
}, },
computed: { computed: {
count() { count() {
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.list.length > 0)
} }
}, },
components: {},
created() { created() {
var data = this.coreshopdata.parameters.list; var data = this.coreshopData.list;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
let moder = { 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', opentype: 'click',
url: '', url: '',
title: data[i].linkType, title: data[i].linkType,
@@ -39,12 +38,11 @@
} }
this.swiperItems.push(moder); this.swiperItems.push(moder);
} }
this.swiperHeight = this.coreshopdata.parameters.height; this.swiperHeight = this.coreshopData.height;
this.swiperDuration = this.coreshopdata.parameters.duration; this.swiperDuration = this.coreshopData.duration;
}, },
watch: {},
methods: { methods: {
taped: function (e) { onClicked: function (e) {
this.showSliderInfo(this.swiperItems[e].linkType, this.swiperItems[e].linkValue); this.showSliderInfo(this.swiperItems[e].linkType, this.swiperItems[e].linkValue);
}, },
} }

View File

@@ -1,48 +1,55 @@
<template> <template>
<view class="coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10 coreshop-margin-top-10"> <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 :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'}"> <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> <image :src="item.image" mode="widthFix" @click="showSliderInfo(item.linkType, item.linkValue)" style="width: 100%;"></image>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
<u-grid :border="false" align="left" :col="2" v-if="coreshopdata.parameters.style == '0'"> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between mainWindow" v-if="coreshopData.parameters.style == '0'">
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}"> <view class="left" :style="{paddingRight: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--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>
</u-grid-item> </view>
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}"> <view class="right" :style="{paddingLeft: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> <view>
<u-grid :border="false" align="left" :col="2"> <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>
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}"> </view>
<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> <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between" :style="{marginTop:coreshopData.parameters.margin +'px'}">
</u-grid-item> <view :style="{paddingRight:coreshopData.parameters.margin / 2+'px'}" class="minBox">
<u-grid-item bg-color="transparent" :custom-style="{padding:coreshopdata.parameters.margin+'px'}"> <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>
<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> </view>
</u-grid-item> <view :style="{paddingLeft:coreshopData.parameters.margin / 2+'px'}" class="minBox">
</u-grid> <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>
</u-grid-item> </view>
</u-grid> </view>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopimgwindow", name: "coreshopImgWindow",
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, // type: Object,
required: true, required: true,
} }
}, },
data() { data() {
return { return {
padding: '3' height: 0
} }
}, },
onLoad() {
},
methods: { methods: {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mainWindow { width: 100%; height: 200px;
</style> .left { width: 50%; height: 200px; }
.right { width: 50%; height: 200px; }
.minBox { width: 50%; }
}
</style>

View File

@@ -1,9 +1,9 @@
<template> <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 :col="limit" :border="false">
<u-grid-item v-for="(item, index) in ListData" :key="index" @click="showSliderInfo(item.linkType, item.linkValue)"> <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"> <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> </view>
</u-grid-item> </u-grid-item>
</u-grid> </u-grid>
@@ -11,12 +11,11 @@
</template> </template>
<script> <script>
import { navLinkType } from '@/common/setting/constVarsHelper.js';
export default { export default {
name: "coreshopnavbar", name: "coreshopData",
components: {}, components: {},
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, // type: Object,
required: true, required: true,
} }
@@ -35,8 +34,8 @@
}, },
created() { created() {
this.ListData = this.coreshopdata.parameters.list; this.ListData = this.coreshopData.parameters.list;
this.limit = this.coreshopdata.parameters.limit; this.limit = this.coreshopData.parameters.limit;
}, },
methods: { methods: {
} }

View File

@@ -1,37 +1,35 @@
<template> <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"> <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> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopnotice", name: "coreshopNotice",
components: { components: {
}, },
props: { props: {
coreshopdata: { coreshopData: {
type: Array,
required: true, required: true,
} }
}, },
data() { data() {
return { return {
model: { notcieText: "",
text: "",
},
} }
}, },
created() { created() {
var data = this.coreshopdata.parameters.list; if (this.coreshopData.length > 0) {
if (data.length > 0) { for (var i = 0; i < this.coreshopData.length; i++) {
this.model.text = data[0].title; this.notcieText += this.coreshopData[i].title + '【' + this.$u.timeFormat(this.coreshopData[i].createTime, 'yyyy年mm月dd日') + '】' + '\u00A0\u00A0\u00A0\u00A0\u00A0';
}
}; };
}, },
methods: {
},
computed: { computed: {
count() { count() {
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.length > 0)
} }
} }
} }

View File

@@ -1,99 +1,105 @@
<template> <template>
<view> <view>
<block v-for="(item,index) in coreshopdata" :key="index"> <block v-for="(item,index) in coreshopdata" :key="index">
<!--搜索修复--> <!--图片-->
<coreshopsearch :coreshopdata="item" v-if="item.widgetCode=='search' "></coreshopsearch> <coreshopImgSingle :coreshopData="item.parameters.list" v-if="item.widgetCode=='imgSingle' "></coreshopImgSingle>
<!--切换--> <!--服务商品-->
<coreshoptabbar :coreshopdata="item" v-if="item.widgetCode=='tabBar' "></coreshoptabbar> <coreshopServiceGood :coreshopData="item" v-if="item.widgetCode=='service' "></coreshopServiceGood>
<!--公告修复--> <!--图片轮播-->
<coreshopnotice :coreshopdata="item" v-if="item.widgetCode=='notice' "></coreshopnotice> <coreshopImgSlide :coreshopData="item.parameters" v-if="item.widgetCode=='imgSlide' "></coreshopImgSlide>
<!--图片轮播修复--> <!--公告-->
<coreshopimgSlide :coreshopdata="item" 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> <coreshopCoupon :coreshopData="item" v-if="item.widgetCode=='coupon' "></coreshopCoupon>
<!--空格修复--> <!--拼团-->
<coreshopblank :coreshopdata="item" v-if="item.widgetCode=='blank' "></coreshopblank> <coreshopPinTuan :coreshopData="item" v-if="item.widgetCode=='pinTuan' "></coreshopPinTuan>
<!--多行文本输入区修复--> <!--搜索-->
<coreshoptextarea :coreshopdata="item" v-if="item.widgetCode=='textarea' "></coreshoptextarea> <coreshopSearch :coreshopData="item" v-if="item.widgetCode=='search' "></coreshopSearch>
<!--视频修复--> <!--宫格自定义导航-->
<coreshopvideo :coreshopdata="item" v-if="item.widgetCode=='video' "></coreshopvideo> <coreshopNavBar :coreshopData="item" v-if="item.widgetCode=='navBar' "></coreshopNavBar>
<!--图片集修复--> <!--商品选项卡-->
<coreshopimgWindow :coreshopdata="item" v-if="item.widgetCode=='imgWindow' "></coreshopimgWindow> <coreshopGoodTabBar :coreshopData="item" v-if="item.widgetCode=='goodTabBar' "></coreshopGoodTabBar>
<!--图片--修复--> <!--文章-->
<coreshopimgSingle :coreshopdata="item" v-if="item.widgetCode=='imgSingle' "></coreshopimgSingle> <coreshopArticle :coreshopData="item" v-if="item.widgetCode=='article' "></coreshopArticle>
<!--商品修复--> <!--文章分类-->
<coreshopgoods :coreshopdata="item" v-if="item.widgetCode=='goods' "></coreshopgoods> <coreshopArticleClassify :coreshopData="item" v-if="item.widgetCode=='articleClassify' "></coreshopArticleClassify>
<!--商品选项卡修复--> <!--视频-->
<coreshopgoodTabBar :coreshopdata="item" v-if="item.widgetCode=='goodTabBar' "></coreshopgoodTabBar> <coreshopVideo :coreshopData="item" v-if="item.widgetCode=='video' "></coreshopVideo>
<!--文章修复--> <!--商品-->
<coreshoparticle :coreshopdata="item" v-if="item.widgetCode=='article' "></coreshoparticle> <coreshopGoods :coreshopData="item" v-if="item.widgetCode=='goods' "></coreshopGoods>
<!--文章分类修复--> <!--浏览记录-->
<coreshoparticleClassify :coreshopdata="item" v-if="item.widgetCode=='articleClassify' "></coreshoparticleClassify> <coreshopRecord :coreshopData="item" v-if="item.widgetCode=='record' "></coreshopRecord>
<!--宫格自定义导航修复--> <!--空格-->
<coreshopnavBar :coreshopdata="item" v-if="item.widgetCode=='navBar' "></coreshopnavBar> <coreshopBlank :coreshopData="item" v-if="item.widgetCode=='blank' "></coreshopBlank>
<!--团购修复--> <!--多行文本输入区-->
<coreshopgroupPurchase :coreshopdata="item" v-if="item.widgetCode=='groupPurchase' "></coreshopgroupPurchase> <coreshopTextArea :coreshopData="item" v-if="item.widgetCode=='textarea' "></coreshopTextArea>
<!--浏览记录修复--> <!--图片集-->
<coreshoprecord :coreshopdata="item" v-if="item.widgetCode=='record' "></coreshoprecord> <coreshopImgWindow :coreshopData="item" v-if="item.widgetCode=='imgWindow' "></coreshopImgWindow>
<!--拼团修复--> <!--文本内容-->
<coreshoppinTuan :coreshopdata="item" v-if="item.widgetCode=='pinTuan' "></coreshoppinTuan> <coreshopContent :coreshopData="item" v-if="item.widgetCode=='content' "></coreshopContent>
<!--服务修复--> <!--团购-->
<coreshopservice :coreshopdata="item" v-if="item.widgetCode=='service' "></coreshopservice> <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> <coreshopadpop :coreshopdata="item" v-if="item.widgetCode=='adpop' "></coreshopadpop>
<!--文本内容修复-->
<coreshopContent :coreshopdata="item" v-if="item.widgetCode=='content' "></coreshopContent>
</block> </block>
</view> </view>
</template> </template>
<script> <script>
import coreshopimgSlide from '@/components/coreshop-page/coreshop-imgSlide.vue' import coreshopImgSingle from '@/components/coreshop-page/coreshop-imgSingle.vue'
import coreshopsearch from '@/components/coreshop-page/coreshop-search.vue' import coreshopServiceGood from '@/components/coreshop-page/coreshop-serviceGood.vue'
import coreshopnotice from '@/components/coreshop-page/coreshop-notice.vue' import coreshopImgSlide from '@/components/coreshop-page/coreshop-imgSlide.vue'
import coreshopcoupon from '@/components/coreshop-page/coreshop-coupon.vue' import coreshopNotice from '@/components/coreshop-page/coreshop-notice.vue'
import coreshopblank from '@/components/coreshop-page/coreshop-blank.vue' import coreshopCoupon from '@/components/coreshop-page/coreshop-coupon.vue'
import coreshoptextarea from '@/components/coreshop-page/coreshop-textarea.vue' import coreshopPinTuan from '@/components/coreshop-page/coreshop-pinTuan.vue'
import coreshopvideo from '@/components/coreshop-page/coreshop-video.vue' import coreshopSearch from '@/components/coreshop-page/coreshop-search.vue'
import coreshopimgWindow from '@/components/coreshop-page/coreshop-imgWindow.vue' import coreshopNavBar from '@/components/coreshop-page/coreshop-navBar.vue'
import coreshopimgSingle from '@/components/coreshop-page/coreshop-imgSingle.vue' import coreshopArticle from '@/components/coreshop-page/coreshop-article.vue'
import coreshopgoods from '@/components/coreshop-page/coreshop-goods.vue' import coreshopArticleClassify from '@/components/coreshop-page/coreshop-articleClassify.vue'
import coreshopgoodTabBar from '@/components/coreshop-page/coreshop-goodTabBar.vue' import coreshopGoodTabBar from '@/components/coreshop-page/coreshop-goodTabBar.vue'
import coreshoparticle from '@/components/coreshop-page/coreshop-article.vue' import coreshopVideo from '@/components/coreshop-page/coreshop-video.vue'
import coreshoparticleClassify from '@/components/coreshop-page/coreshop-articleClassify.vue' import coreshopGoods from '@/components/coreshop-page/coreshop-goods.vue'
import coreshopnavBar from '@/components/coreshop-page/coreshop-navBar.vue' import coreshopRecord from '@/components/coreshop-page/coreshop-record.vue'
import coreshopgroupPurchase from '@/components/coreshop-page/coreshop-groupPurchase.vue' import coreshopBlank from '@/components/coreshop-page/coreshop-blank.vue'
import coreshoprecord from '@/components/coreshop-page/coreshop-record.vue' import coreshopTextArea from '@/components/coreshop-page/coreshop-textarea.vue'
import coreshoppinTuan from '@/components/coreshop-page/coreshop-pinTuan.vue' import coreshopImgWindow from '@/components/coreshop-page/coreshop-imgWindow.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 coreshopContent from '@/components/coreshop-page/coreshop-content.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 { export default {
name: 'coreshop-page', name: 'coreshop-page',
components: { components: {
coreshopimgSlide, coreshopImgSingle,
coreshopsearch, coreshopServiceGood,
coreshopnotice, coreshopImgSlide,
coreshopcoupon, coreshopNotice,
coreshopblank, coreshopCoupon,
coreshoptextarea, coreshopPinTuan,
coreshopvideo, coreshopSearch,
coreshopimgWindow, coreshopNavBar,
coreshopimgSingle, coreshopArticle,
coreshopgoods, coreshopArticleClassify,
coreshopgoodTabBar, coreshopGoodTabBar,
coreshoparticle, coreshopVideo,
coreshoparticleClassify, coreshopGoods,
coreshopnavBar, coreshopRecord,
coreshopgroupPurchase, coreshopBlank,
coreshoprecord, coreshopTextArea,
coreshoppinTuan, coreshopImgWindow,
coreshopservice, coreshopContent,
coreshoptabbar, coreshopGroupPurchase,
coreshopSeckill,
coreshopadpop, coreshopadpop,
coreshopContent
}, },
props: { props: {
coreshopdata: { coreshopdata: {

View File

@@ -1,37 +1,43 @@
<template> <template>
<!-- 活动商品 --> <view class="activity-wrap coreshop-padding-10 coreshop-margin-10 coreshop-bg-white coreshop-border-radius-trbl-18" v-if="count">
<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="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="title-box coreshop-flex coreshop-justify-between coreshop-padding-top-10 coreshop-padding-bottom-10 groupon-title"> <view class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">每日拼团</view>
<view class="coreshop-flex coreshop-flex-direction coreshop-align-center"> <u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goPinTuanList()"></u-icon>
<view class="title-text coreshop-margin-right-10 u-line-1">每日拼团</view>
</view> </view>
<u-icon name="arrow-right-double" size="12" label="查看更多" labelSize="12" labelPos="left" @tap="goPinTuanList()"></u-icon>
</view> </view>
<!-- 活动商品 --> <view class="coreshop-divider">
<view class="complete"></view>
</view>
<scroll-view class="scroll-box" scroll-x scroll-anchoring> <scroll-view class="scroll-box" scroll-x scroll-anchoring>
<view class="goods-box coreshop-flex"> <view class="goods-box coreshop-flex coreshop-justify-between coreshop-text-black">
<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="min-goods" v-for="item in coreshopData.parameters.list" :key="item.id" @tap="goPinTuanDetail(item.id)">
<view class="img-box"> <view class="img-box">
<image class="img" :src="mgoods.goodsImage" mode=""></image> <image class="img" :src="item.goodThumbnail" mode=""></image>
</view> </view>
<view class="mgoods-card-bottom coreshop-padding-10"> <view class="item-card-bottom coreshop-padding-10">
<view class="goods-title coreshop-margin-bottom-5 u-line-1">{{ mgoods.name }}</view> <view class="goods-title u-line-1">{{ item.name }}</view>
<view class="price coreshop-margin-bottom-5">{{mgoods.pinTuanPrice}}</view> <view class="price coreshop-margin-bottom-5">{{item.pinTuanPrice}}</view>
<view class="original-price">{{ mgoods.pinTuanPrice + mgoods.discountAmount }}</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> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshoppinTuan", name: "coreshopPinTuan",
props: { props: {
coreshopdata: { coreshopData: {
required: false, required: false,
} }
}, },
@@ -43,14 +49,14 @@
}, },
created() { created() {
let that = this; let that = this;
if (that.coreshopdata.parameters.list.length > 0) { if (that.coreshopData.parameters.list.length > 0) {
let arr = that.sortData(that.coreshopdata.parameters.list, 4); let arr = that.sortData(that.coreshopData.parameters.list, 4);
that.goodsList = arr; that.goodsList = arr;
} }
}, },
computed: { computed: {
count() { count() {
return (this.coreshopdata.parameters.list.length > 0) return (this.coreshopData.parameters.list.length > 0)
} }
}, },
methods: { methods: {
@@ -77,32 +83,29 @@
</script> </script>
<style lang="scss" scoped> <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; }
.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-box {
.title-text { font-size: 32rpx; font-weight: bold; color: #333333; } .title-text { font-size: 16px; font-weight: bold; color: #333333; }
.more-box { .more-box {
.more-text { font-size: 22rpx; font-weight: 500; color: #333333; } .more-text { font-size: 11px; font-weight: 500; color: #333333; }
.more-icon { font-size: 24rpx; color: #333333; } .more-icon { font-size: 12px; color: #333333; }
} }
} }
.scroll-box, .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; .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: 220rpx; height: 220rpx; overflow: hidden; position: relative; border-radius: 10rpx 10rpx 0 0; .img-box { width: 140px; height: 140px; overflow: hidden; position: relative; border-radius: 5px 5px 0 0;
.img { width: 220rpx; height: 220rpx; background-color: #ccc; } .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%; } .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: 26rpx; font-weight: 500; color: #000000; width: 180rpx; line-height: 26rpx; } .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;
.price { font-size: 30rpx; font-weight: 500; color: #ff0000; &::before { content: '¥'; font-size: 12px; }
&::before { content: '¥'; font-size: 24rpx; }
} }
.original-price { font-size: 20rpx; font-weight: 500; text-decoration: line-through; color: #c4c4c4; } .original-price { font-size: 20rpx; font-weight: 500; text-decoration: line-through; color: #c4c4c4; }
.groupon-num-box { .groupon-num-box {
@@ -112,29 +115,4 @@
.groupon-num-text { font-size: 18rpx; font-weight: 500; color: #e9b461; } .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> </style>

View File

@@ -1,5 +1,5 @@
<template> <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-c coreshop-flex-direction-row">
<view class="adbrathing-l"> <view class="adbrathing-l">
<image class="user-head-img" :src="log.avatar" mode="aspectFill"></image> <image class="user-head-img" :src="log.avatar" mode="aspectFill"></image>
@@ -16,9 +16,9 @@
<script> <script>
export default { export default {
name: "coreshoprecord", name: "coreshopRecord",
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, // type: Object,
required: true, required: true,
}, },
@@ -57,12 +57,12 @@
_this.hideanimation = !_this.hideanimation; _this.hideanimation = !_this.hideanimation;
clearInterval(_this.times); clearInterval(_this.times);
_this.times = setInterval(function () { _this.times = setInterval(function () {
_this.getRecod(); _this.getRecord();
}, 5000); }, 5000);
}, 3000) }, 3000)
}, },
//获取日志 //获取日志
getRecod() { getRecord() {
var _this = this; var _this = this;
if (_this.times != {}) { if (_this.times != {}) {
clearInterval(_this.times); clearInterval(_this.times);
@@ -72,7 +72,7 @@
value: _this.lvalue, value: _this.lvalue,
}; };
uni.request({ uni.request({
url: this.$globalConstVars.apiBaseUrl + '/Api/Page/GetRecod', url: this.$globalConstVars.apiBaseUrl + '/Api/Page/GetRecord',
data: data, data: data,
header: { header: {
'Accept': 'application/json', 'Accept': 'application/json',

View File

@@ -1,15 +1,15 @@
<template> <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-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> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopsearch", name: "coreshopSearch",
props: { props: {
coreshopdata: { coreshopData: {
required: true, required: true,
} }
}, },
@@ -22,22 +22,11 @@
}; };
}, },
created() { created() {
//#ifdef H5
this.$nextTick(() => {
this.searchTop = this.$refs.searchBar.$el.offsetTop;
})
// #endif
this.searchStyle() this.searchStyle()
}, },
mounted() {
// #ifdef H5
window.addEventListener('scroll', this.handleScroll)
// #endif
},
methods: { methods: {
searchStyle() { searchStyle() {
this.$store.commit('searchStyle', this.coreshopdata.parameters.style) this.$store.commit('searchStyle', this.coreshopData.parameters.style)
// console.log(this.data.parameters.style)
}, },
change(value) { change(value) {
// 搜索框内容变化时会触发此事件value值为输入框的内容 // 搜索框内容变化时会触发此事件value值为输入框的内容

View File

@@ -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>

View File

@@ -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>

View File

@@ -28,22 +28,13 @@
}; };
}, },
created() { created() {
//#ifdef H5
this.$nextTick(() => {
this.searchTop = this.$refs.tabBar.$el.offsetTop - 52;
})
// #endif
this.searchStyle() this.searchStyle()
}, },
mounted() { mounted() {
// #ifdef H5
window.addEventListener('scroll', this.handleScroll)
// #endif
}, },
methods: { methods: {
searchStyle() { searchStyle() {
this.$store.commit('searchStyle', this.coreshopdata.parameters.style) this.$store.commit('searchStyle', this.coreshopdata.parameters.style)
// console.log(this.data.parameters.style)
}, },
handleScroll() { handleScroll() {
this.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; this.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

View File

@@ -1,6 +1,6 @@
<template> <template>
<view class="textarea coreshop-margin-left-10 coreshop-margin-right-10 coreshop-padding-10"> <view class="textarea coreshop-margin-10 coreshop-padding-10">
<coreshopContent :content="coreshopdata.parameters.value" v-if="coreshopdata.parameters.value"></coreshopContent> <coreshopContent :content="coreshopData.parameters.value" v-if="coreshopData.parameters.value"></coreshopContent>
</view> </view>
</template> </template>
@@ -10,20 +10,12 @@
components: { components: {
coreshopContent coreshopContent
}, },
name: "coreshoptextarea", name: "coreshopTextArea",
props: { props: {
coreshopdata: { coreshopData: {
// type: Object, // type: Object,
required: true, required: true,
} }
},
created() {
},
onLoad() {
},
methods: {
} }
} }
</script> </script>

View File

@@ -1,14 +1,14 @@
<template> <template>
<view class="video coreshop-margin-left-10 coreshop-margin-right-10 coreshop-margin-bottom-10"> <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> </view>
</template> </template>
<script> <script>
export default { export default {
name: "coreshopvideo", name: "coreshopVideo",
props: { props: {
coreshopdata: { coreshopData: {
type: Object, type: Object,
required: true, required: true,
} }
@@ -19,7 +19,7 @@
} }
}, },
created() { 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; this.autoplay = true;
} }

View File

@@ -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>

View File

@@ -96,8 +96,8 @@
params: { params: {
goodsId: this.goodsId goodsId: this.goodsId
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 //终端 client: this.$globalConstVars.shareClient.wxMiNiProgram
} }
let userToken = this.$db.get('userToken') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
@@ -112,31 +112,43 @@
goodsId: this.goodsId, goodsId: this.goodsId,
teamId: this.teamId teamId: this.teamId
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 client: this.$globalConstVars.shareClient.wxMiNiProgram
} }
let userToken = this.$db.get('userToken') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
data.token = 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 = { data = {
page: this.shareType, page: this.shareType,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
params: { params: {
goodsId: this.goodsId,
groupId: this.groupId groupId: this.groupId
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 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') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
data.token = userToken data.token = userToken
} }
console.log(data);
} }
else if (this.shareType == this.$globalConstVars.shareType.goods) { else if (this.shareType == this.$globalConstVars.shareType.goods) {
data = { data = {
@@ -145,14 +157,13 @@
params: { params: {
goodsId: this.goodsId, goodsId: this.goodsId,
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 client: this.$globalConstVars.shareClient.wxMiNiProgram
} }
let userToken = this.$db.get('userToken') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
data.token = userToken data.token = userToken
} }
console.log(data);
} }
else if (this.shareType == this.$globalConstVars.shareType.addPinTuan) { else if (this.shareType == this.$globalConstVars.shareType.addPinTuan) {
data = { data = {
@@ -163,14 +174,13 @@
groupId: this.groupId, groupId: this.groupId,
teamId: this.teamId teamId: this.teamId
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 client: this.$globalConstVars.shareClient.wxMiNiProgram
} }
let userToken = this.$db.get('userToken') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
data.token = userToken data.token = userToken
} }
console.log(data);
} else if (this.shareType == this.$globalConstVars.shareType.solitaire) { } else if (this.shareType == this.$globalConstVars.shareType.solitaire) {
data = { data = {
page: this.shareType, page: this.shareType,
@@ -178,8 +188,22 @@
params: { params: {
id: this.objectId id: this.objectId
}, },
type: 3,//海报 type: this.$globalConstVars.shareModel.poster,
client: 2 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') let userToken = this.$db.get('userToken')
if (userToken) { if (userToken) {
@@ -191,7 +215,10 @@
uni.hideLoading(); uni.hideLoading();
if ( if (
this.shareType == this.$globalConstVars.shareType.goods || 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.posterUrl = encodeURIComponent(res.data);
data.params.posterUrl = res.data; data.params.posterUrl = res.data;

View File

@@ -205,16 +205,7 @@
}); });
// #endif // #endif
// #ifdef H5 // #ifndef APP-NVUE
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
uni.createSelectorQuery().in(this).select('.fy_dropdown__menu').boundingClientRect(rect => { uni.createSelectorQuery().in(this).select('.fy_dropdown__menu').boundingClientRect(rect => {
const top = rect.top + this.titleHeight + 'px'; const top = rect.top + this.titleHeight + 'px';
this.maskClass.top = top; this.maskClass.top = top;

View File

@@ -9,9 +9,6 @@ import * as Db from '@/common/utils/dbHelper.js'
//全局常量配置 //全局常量配置
import * as GlobalConstVars from '@/common/setting/constVarsHelper.js' import * as GlobalConstVars from '@/common/setting/constVarsHelper.js'
//全局常量配置
import * as CoreTheme from '@/common/setting/coreThemeHelper.js'
import store from '@/common/store' import store from '@/common/store'
//引入全局uView //引入全局uView
@@ -44,7 +41,6 @@ Vue.prototype.$upload = Upload;
Vue.prototype.$common = Common; Vue.prototype.$common = Common;
Vue.prototype.$db = Db; Vue.prototype.$db = Db;
Vue.prototype.$globalConstVars = GlobalConstVars; Vue.prototype.$globalConstVars = GlobalConstVars;
Vue.prototype.$coreTheme = CoreTheme;
Vue.prototype.$store = store; Vue.prototype.$store = store;

View File

@@ -1,182 +1,179 @@
{ {
"name": "南山田舍", "name" : "核心商城系统",
"appid": "__UNI__EAACF14", "appid" : "__UNI__EAACF14",
"description": "核心商城系统CoreShop是基于uni-app框架开发的商城应用程序", "description" : "核心商城系统CoreShop是基于uni-app框架开发的商城应用程序",
"versionName": "1.0", "versionName" : "1.0",
"versionCode": 1, "versionCode" : 1,
"transformPx": false, "transformPx" : false,
"app-plus": { "app-plus" : {
/* 5+App */ /* 5+App */
"modules": { "modules" : {
"Payment": {}, "Payment" : {},
"VideoPlayer": {}, "VideoPlayer" : {},
"Maps": {} "Maps" : {}
},
/* */
"distribute": {
/* */
"android": {
/* android */
"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\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters": [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios": {},
/* ios */
"sdkConfigs": {
"payment": {
"weixin": {
"appid": "wx11d95cdaee6058f6"
}
}, },
"ad": {}, /* */
"maps": { "distribute" : {
"amap": { /* */
"appkey_ios": "91b94ecb48605c4e048aa1971459eca7", "android" : {
"appkey_android": "91b94ecb48605c4e048aa1971459eca7" /* android */
} "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\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {},
/* ios */
"sdkConfigs" : {
"payment" : {
"weixin" : {
"appid" : "wx11d95cdaee6058f6"
}
},
"ad" : {},
"maps" : {
"amap" : {
"appkey_ios" : "91b94ecb48605c4e048aa1971459eca7",
"appkey_android" : "91b94ecb48605c4e048aa1971459eca7"
}
},
"oauth" : {
"univerify" : {}
},
"share" : {}
},
"icons" : {
"android" : {
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : "",
"xxxhdpi" : ""
},
"ios" : {
"appstore" : "",
"ipad" : {
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
}
}, },
"oauth": { "splashscreen" : {
"univerify": {} "waiting" : true
},
"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"
},
"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"
},
"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"
}
} }
}
}, },
"splashscreen": { /* SDK */
"waiting": true "quickapp" : {},
} /* */
}, "mp-weixin" : {
/* SDK */ "appid" : "wx6fc139d4de0b470f",
"quickapp": {}, "setting" : {
/* */ "urlCheck" : true,
"mp-weixin": { "postcss" : true,
"appid": "wx6fc139d4de0b470f", "minified" : true,
"setting": { "es6" : true,
"urlCheck": true, "checkSiteMap" : false
"postcss": true, },
"minified": true, "plugins" : {
"es6": true, "chooseLocation" : {
"checkSiteMap": false "version" : "1.0.9",
"provider" : "wx76a9a06e5b4e693e"
}
},
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序定位"
}
},
"optimization" : {
"subPackages" : true
},
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ]
}, },
"plugins": { "h5" : {
"chooseLocation": { "title" : "南山田舍",
"version": "1.0.9", "domain" : "https://h5.coreshop.coreshop.net",
"provider": "wx76a9a06e5b4e693e" "router" : {
} "base" : "./",
}, "mode" : "hash"
"permission": { },
"scope.userLocation": { "template" : "index.html",
"desc": "你的位置信息将用于小程序定位" "devServer" : {
} "port" : 80,
}, "disableHostCheck" : true,
"optimization": { "https" : true
"subPackages": true },
}, "sdkConfigs" : {
"requiredPrivateInfos": [ "maps" : {
"getLocation", "qqmap" : {
"chooseAddress" "key" : "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33"
] }
}, }
"h5": { },
"title": "南山田舍", "optimization" : {
"domain": "https://h5.coreshop.coreshop.net", "treeShaking" : {
"router": { "enable" : false
"base": "./", }
"mode": "hash"
},
"template": "index.html",
"devServer": {
"port": 80,
"disableHostCheck": true,
"https": true
},
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33"
} }
}
}, },
"optimization": { "mp-toutiao" : {
"treeShaking": { "setting" : {
"enable": false "es6" : true,
} "postcss" : true,
} "minified" : true
}, },
"mp-toutiao": { "appid" : ""
"setting": {
"es6": true,
"postcss": true,
"minified": true
}, },
"appid": "" "mp-qq" : {
}, "setting" : {
"mp-qq": { "es6" : true,
"setting": { "postcss" : true,
"es6": true, "minified" : true
"postcss": true, },
"minified": true "optimization" : {
"subPackages" : true
}
}, },
"optimization": { "mp-alipay" : {},
"subPackages": true "mp-baidu" : {}
}
},
"mp-alipay": {},
"mp-baidu": {}
} }

View File

@@ -195,13 +195,6 @@
"navigationBarTitleText": "支付" "navigationBarTitleText": "支付"
} }
}, },
{
"path": "waiting/waiting",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "等待支付"
}
},
{ {
"path": "result/result", "path": "result/result",
"style": { "style": {

View File

@@ -82,7 +82,7 @@
</template> </template>
<script> <script>
import { mapMutations, mapActions, mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
data() { data() {
return { return {

View File

@@ -6,8 +6,6 @@
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon> <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-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
<u-icon name="home" size="22" @click="goHome"></u-icon> <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>
<view slot="right"> <view slot="right">
</view> </view>
@@ -24,7 +22,7 @@
<text class="coreshop-font-16">¥</text> <text class="coreshop-font-16">¥</text>
<text class="coreshop-font-24">{{ product.price || '0.00' }}</text> <text class="coreshop-font-24">{{ product.price || '0.00' }}</text>
</view> </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"> <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"> <u-count-down :time="goodsInfo.groupTimestamp*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
<view class="time"> <view class="time">
@@ -34,7 +32,7 @@
</view> </view>
<text class="time__doc"></text> <text class="time__doc"></text>
<view class="time__custom"> <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> </view>
<text class="time__doc">:</text> <text class="time__doc">:</text>
<view class="time__custom"> <view class="time__custom">
@@ -48,10 +46,6 @@
</u-count-down> </u-count-down>
</view> </view>
</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>
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp"> <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> <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> <text class="font-color-orange">{{ goodsInfo.buyCount || '0' }}</text>
</view> </view>
<view class="coreshop-font-12"> <view class="coreshop-font-12">
<text>累计销售</text> <u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
<text>{{ goodsInfo.buyCount || '0' }}</text>
</view> </view>
<view class="coreshop-font-12"> <view class="coreshop-font-12">
<text>库存</text> <u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
<text>{{product.stock}}</text> <u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
</view> </view>
</view> </view>
</view> </view>
@@ -193,13 +186,9 @@
</view> </view>
</view> </view>
<!-- 分享弹窗 --> <!-- 分享弹窗 -->
<view class="coreshop-padding-0"> <view class="coreshop-padding-0">
<u-popup mode="bottom" :show="shareBox" ref="share"> <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 --> <!-- #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> <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 --> <!-- #endif -->
@@ -258,7 +247,7 @@
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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="tabbar">
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4"> <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()"> <view class="action" @click="showChat()">
<button class="noButtonStyle"> <button class="noButtonStyle">
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon> <u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
@@ -442,9 +431,8 @@
}; };
}, },
onLoad(e) { onLoad(e) {
this.goodsId = e.id; this.groupId = e.id;
this.groupId = e.groupId; if (this.groupId) {
if (this.goodsId && this.groupId) {
this.getServiceDescription(); this.getServiceDescription();
this.getGoodsInfo(); this.getGoodsInfo();
this.getGoodsParams(); this.getGoodsParams();
@@ -517,7 +505,7 @@
shareHref() { shareHref() {
let pages = getCurrentPages(); let pages = getCurrentPages();
let page = pages[pages.length - 1]; 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; return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&groupId=' + this.groupId;
// #endif // #endif
} }
@@ -593,8 +581,7 @@
}, },
getGoodsInfo() { getGoodsInfo() {
let data = { let data = {
id: this.goodsId, id: this.groupId,
groupId: this.groupId,
type: this.cartType, type: this.cartType,
needSku: true, needSku: true,
}; };
@@ -626,6 +613,7 @@
let info = res.data; let info = res.data;
_this.product = res.data.product; _this.product = res.data.product;
_this.goodsInfo = info; _this.goodsInfo = info;
_this.goodsId = info.id;
this.goodsSkuInfo = res.data.skuList; this.goodsSkuInfo = res.data.skuList;
if (_this.goodsInfo.album) { if (_this.goodsInfo.album) {
@@ -751,7 +739,6 @@
this.submitStatus = true; this.submitStatus = true;
this.buyNow(); this.buyNow();
}, },
// 跳转到h5分享页面
goShare() { goShare() {
this.shareBox = true; this.shareBox = true;
}, },
@@ -768,8 +755,6 @@
}, },
//在线客服 //在线客服
showChat() { showChat() {
// #ifdef H5
// #endif
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
this.$u.route('/pages/member/customerService/index'); this.$u.route('/pages/member/customerService/index');
// #endif // #endif
@@ -777,18 +762,17 @@
//获取分享URL //获取分享URL
getShareUrl() { getShareUrl() {
let data = { let data = {
client: 2, client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
type: 1, type: this.$globalConstVars.shareModel.url,
page: 9, page: this.$globalConstVars.shareType.group,
params: { params: {
goodsId: this.goodsId,
groupId: this.groupId groupId: this.groupId
} }
}; };
let userToken = this.$db.get('userToken'); let userToken = this.$db.get('userToken');
if (userToken && userToken != '') { if (userToken && userToken != '') {
data['token'] = userToken; data.token = userToken
} }
this.$u.api.share(data).then(res => { this.$u.api.share(data).then(res => {
this.shareUrl = res.data this.shareUrl = res.data

View File

@@ -9,35 +9,89 @@
<view slot="right"> <view slot="right">
</view> </view>
</u-navbar> </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>
<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-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>
</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>
</view>
<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="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">
<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>
<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> <view class="coreshop-emptybox" v-else>
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无团购信息" mode="list"></u-empty> <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无团购信息" mode="list"></u-empty>
@@ -50,9 +104,9 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
loadStatus: 'loadmore', loadStatus: 'loadmore',
@@ -126,7 +180,7 @@
this.$u.api.getGroup(data).then(res => { this.$u.api.getGroup(data).then(res => {
if (res.status) { if (res.status) {
if (res.data) { if (res.data) {
let _goodsList = res.data.goods; let _goodsList = res.data.list;
_this.goodsList = [..._this.goodsList, ..._goodsList] _this.goodsList = [..._this.goodsList, ..._goodsList]
} }
_this.lastPage = res.data.totalPages; _this.lastPage = res.data.totalPages;
@@ -141,7 +195,10 @@
} }
}); });
} },
onChange(e, key) {
this.$set(this.goodsList[key], 'timeData', e)
},
} }
} }
</script> </script>

View File

@@ -17,36 +17,36 @@
<text class="group-head__title">爆款推荐</text> <text class="group-head__title">爆款推荐</text>
<text class="group-head__notice">省钱省心限时拼</text> <text class="group-head__notice">省钱省心限时拼</text>
</view> </view>
<view class="group-box"> <view class="group-box" v-if="list.length>0">
<view class="goods-item" v-for="(item, index) in goodsList" :key="item.id" v-if="goodsList.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 class="coreshop-flex coreshop-justify-start coreshop-padding-left-10 coreshop-padding-top-10 coreshop-padding-bottom-10">
<view> <view>
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</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>
<view class="goods-right coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-padding-right-10"> <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.pinTuanRule.name }}</view> <view class="title u-line-2 coreshop-text-black">{{ item.name }}</view>
<view class="tip u-line-2 coreshop-text-grey">{{ 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"> <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> <view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已拼{{item.buyPinTuanCount}}</view>
<u-tag :text="'已售'+item.buyCount+ item.unit" type="warning coreshop-margin-right-5 coreshop-font-10" shape="circle" size="mini"></u-tag> <view class="coreshop-font-11 coreshop-bg-orange coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10">已售{{item.pinTuanRecordNums}}{{item.goodUnit}}</view>
<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-olive coreshop-padding-2 coreshop-border-radius-4">{{item.peopleNumber}}人团</view>
</view> </view>
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center"> <view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center">
<view class="coreshop-flex coreshop-align-center"> <view class="coreshop-flex coreshop-align-center">
<view class="current">{{ item.pinTuanPrice }}</view> <view class="current">{{ item.pinTuanPrice }}</view>
<view class="original">{{ item.price }}</view> <view class="original">{{ item.mktPrice }}</view>
</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>
</view> </view>
</view> </view>
<!-- 无数据时默认显示 --> <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
<view class="coreshop-emptybox" v-else> </view>
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/history.png'" icon-size="150" text="暂无提现明细" mode="list"></u-empty> <!-- 无数据时默认显示 -->
</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> </view>
<!-- 空白 --> <!-- 空白 -->
@@ -62,7 +62,9 @@
export default { export default {
data() { data() {
return { return {
goodsList: [], page: 1,
limit: 10,
list: [],
status: 'loadmore', status: 'loadmore',
iconType: 'flower', iconType: 'flower',
loadText: { loadText: {
@@ -72,12 +74,41 @@
} }
}; };
}, },
//加载执行 onLoad() {
onShow: function () { this.getPinTuanlist()
_this = this },
_this.getGoods(); onShow() {
},
onReachBottom() {
if (this.status === 'loadmore') {
this.getPinTuanlist()
}
}, },
methods: { 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 () { getGoods: function () {
uni.showLoading({ uni.showLoading({
@@ -93,7 +124,7 @@
if (item.pinTuanPrice <= 0) { if (item.pinTuanPrice <= 0) {
item.pinTuanPrice = '0.00'; item.pinTuanPrice = '0.00';
} else { } else {
item.pinTuanPrice = _this.$common.moneySub(item.price, item.pinTuanRule.discountAmount); item.pinTuanPrice = parseFloat(item.price - item.pinTuanRule.discountAmount).toFixed(2);
} }
}); });
} }

View File

@@ -1,7 +1,7 @@
.groupHeight { height: 61px !important; } .groupHeight { height: 61px !important; }
.group-swiper-c { height: 121px; } .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 .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-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; } .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-bd { opacity: 0.4; }
.coreshop-lower-shelf .coreshop-cell-item-ft { 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; } .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; }
}

View File

@@ -5,9 +5,7 @@
<view class="coreshop-navbar-left-slot" slot="left"> <view class="coreshop-navbar-left-slot" slot="left">
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon> <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-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
<u-icon name="home" size="22" @click="goHome"></u-icon> <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>
<view slot="right"> <view slot="right">
</view> </view>
@@ -24,7 +22,7 @@
<text class="coreshop-font-16">¥</text> <text class="coreshop-font-16">¥</text>
<text class="coreshop-font-24">{{ price || '0.00' }}</text> <text class="coreshop-font-24">{{ price || '0.00' }}</text>
</view> </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"> <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"> <u-count-down :time="goodsInfo.pinTuanRule.lastTime*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
<view class="time"> <view class="time">
@@ -34,7 +32,7 @@
</view> </view>
<text class="time__doc"></text> <text class="time__doc"></text>
<view class="time__custom"> <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> </view>
<text class="time__doc">:</text> <text class="time__doc">:</text>
<view class="time__custom"> <view class="time__custom">
@@ -56,7 +54,7 @@
</view> </view>
<text class="time__doc"></text> <text class="time__doc"></text>
<view class="time__custom"> <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> </view>
<text class="time__doc">:</text> <text class="time__doc">:</text>
<view class="time__custom"> <view class="time__custom">
@@ -70,12 +68,7 @@
</u-count-down> </u-count-down>
</view> </view>
</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>
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp"> <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> <text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
</view> </view>
@@ -94,12 +87,11 @@
<text class="font-color-orange">{{ goodsInfo.buyPinTuanCount || '0' }}</text> <text class="font-color-orange">{{ goodsInfo.buyPinTuanCount || '0' }}</text>
</view> </view>
<view class="coreshop-font-12"> <view class="coreshop-font-12">
<text>累计销售</text> <u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
<text>{{ goodsInfo.buyCount || '0' }}</text>
</view> </view>
<view class="coreshop-font-12"> <view class="coreshop-font-12">
<text>库存</text> <u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
<text>{{product.stock}}</text> <u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
</view> </view>
</view> </view>
</view> </view>
@@ -140,76 +132,70 @@
<view class="coreshop-margin-bottom-16"> <view class="coreshop-margin-bottom-16">
<text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">开团信息</text> <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">开团信息</text>
</view> </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-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 right-img"> <view class="coreshop-cell-item-hd">
<view class="coreshop-cell-item-hd"> <view class="coreshop-cell-hd-title">{{ teamCount || '0' }}人在拼单可直接参与</view>
<view class="coreshop-cell-hd-title">{{ teamCount || '0' }}人在拼单可直接参与</view>
</view>
</view>
<view class="group-swiper">
<swiper class="group-swiper-c" :class="swiperSet.groupHeight" :indicator-dots="swiperSet.indicatorDots" :autoplay="swiperSet.autoplay" vertical="true" circular="true" :interval="swiperSet.interval" :duration="swiperSet.duration">
<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">
还差
<text class="coreshop-text-red">{{ item[0].teamNums || '' }}</text>
拼成
</text>
</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>
</view>
</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">
还差
<text class="coreshop-text-red">{{ item[1].teamNums || '' }}</text>
拼成
</text>
</view>
<view class="coreshop-cell-bd-view">
<view class="commodity-day">
<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>
</view>
</view>
</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>
<u-button type="default" size="mini" v-if="item[1].isOverdue">已结束</u-button>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view> </view>
</view> </view>
<view class="coreshop-cell-group coreshop-margin-top-10 coreshop-margin-bottom-10" v-else> <view class="group-swiper">
<view class="coreshop-cell-item right-img"> <swiper class="group-swiper-c" :class="swiperSet.groupHeight" :indicator-dots="swiperSet.indicatorDots" :autoplay="swiperSet.autoplay" vertical="true" circular="true" :interval="swiperSet.interval" :duration="swiperSet.duration">
<view class="coreshop-cell-item-hd"><view class="coreshop-cell-hd-title">暂无开团信息</view></view> <swiper-item v-for="(item, index) in pinTuanRecord" :key="index">
</view> <view class="swiper-item">
<view class="coreshop-cell-item" :class="item[0].isOverdue?'coreshop-lower-shelf':''">
<view class="coreshop-cell-item-bd">
<view class="coreshop-cell-bd-view">
<text class="coreshop-cell-bd-text coreshop-font-xs">
还差
<text class="coreshop-text-red">{{ item[0].teamNums || '' }}</text>
拼成
</text>
</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-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="coreshop-cell-item-bd">
<view class="coreshop-cell-bd-view">
<text class="coreshop-cell-bd-text coreshop-font-xs">
还差
<text class="coreshop-text-red">{{ item[1].teamNums || '' }}</text>
拼成
</text>
</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[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>
<u-button type="default" size="mini" v-if="item[1].isOverdue">已结束</u-button>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
</view>
<view class="coreshop-cell-group coreshop-margin-top-10 coreshop-margin-bottom-10" v-else>
<view class="coreshop-cell-item right-img">
<view class="coreshop-cell-item-hd"><view class="coreshop-cell-hd-title">暂无开团信息</view></view>
</view> </view>
</view> </view>
</view> </view>
@@ -306,7 +292,7 @@
<view class="ig-top-b"> <view class="ig-top-b">
<view class="igtb-top"> <view class="igtb-top">
还差 还差
<text class="red-price">{{ teamInfo.teamNums || '' }}</text> <text class="coreshop-text-red">{{ teamInfo.teamNums || '' }}</text>
赶快拼单吧 赶快拼单吧
</view> </view>
<view class="igtb-mid"><button class="coreshop-btn" @click="selectTap(2, teamInfo.id)">参与拼团</button></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"> <view class="coreshop-padding-0">
<u-popup mode="bottom" :show="shareBox" ref="share"> <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 --> <!-- #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> <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 --> <!-- #endif -->
@@ -378,7 +361,7 @@
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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="tabbar">
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4"> <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()"> <view class="action" @click="showChat()">
<button class="noButtonStyle"> <button class="noButtonStyle">
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon> <u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
@@ -533,7 +516,7 @@
</template> </template>
<script> <script>
import { mapMutations, mapActions, mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
@@ -546,7 +529,6 @@
// 后端返回的商品信息 // 后端返回的商品信息
goodsSkuInfo: {}, goodsSkuInfo: {},
discountsGoodsSkuInfo: {}, discountsGoodsSkuInfo: {},
goodsId: 0, // 商品id goodsId: 0, // 商品id
pinTuanId: 0, // 拼团ID pinTuanId: 0, // 拼团ID
goodsInfo: {}, // 商品详情 goodsInfo: {}, // 商品详情
@@ -594,13 +576,12 @@
}; };
}, },
onLoad(e) { onLoad(e) {
this.goodsId = e.id; this.pinTuanId = e.id;
this.pinTuanId = e.pinTuanId;
if (e.teamId && e.teamId > 0) { if (e.teamId && e.teamId > 0) {
this.teamId = e.teamId; this.teamId = e.teamId;
this.getTeam(this.teamId); this.getTeam(this.teamId);
} }
if (this.goodsId) { if (this.pinTuanId) {
this.getServiceDescription(); this.getServiceDescription();
this.getGoodsInfo(); this.getGoodsInfo();
this.getGoodsParams(); this.getGoodsParams();
@@ -681,7 +662,7 @@
shareHref() { shareHref() {
let pages = getCurrentPages(); let pages = getCurrentPages();
let page = pages[pages.length - 1]; 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; return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&pinTuanId=' + this.pinTuanId;
// #endif // #endif
}, },
@@ -777,7 +758,7 @@
// 如果用户已经登录 要传用户token // 如果用户已经登录 要传用户token
let userToken = this.$db.get('userToken'); let userToken = this.$db.get('userToken');
if (userToken) { if (userToken) {
data['token'] = userToken; data.token = userToken
} }
let _this = this; let _this = this;
_this.$u.api.pinTuanGoodsInfo(data).then(res => { _this.$u.api.pinTuanGoodsInfo(data).then(res => {
@@ -801,7 +782,7 @@
} else { } else {
let info = res.data; let info = res.data;
this.product = res.data.product; this.product = res.data.product;
this.goodsId = info.id;
_this.goodsInfo = info; _this.goodsInfo = info;
this.goodsSkuInfo = res.data.skuList; this.goodsSkuInfo = res.data.skuList;
@@ -836,8 +817,9 @@
_this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2); _this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
_this.isfav = _this.goodsInfo.isfav; _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 pinTuanData = info.pinTuanRecord;
let newData = new Array(); let newData = new Array();
@@ -852,6 +834,9 @@
} }
} }
pinTuanData.length < 2 ? (_this.swiperSet.groupHeight = 'groupHeight') : (_this.swiperSet.groupHeight = ''); pinTuanData.length < 2 ? (_this.swiperSet.groupHeight = 'groupHeight') : (_this.swiperSet.groupHeight = '');
if (pinTuanData.length > 1) {
_this.swiperSet.autoplay = true;
}
_this.pinTuanRecord = newData; _this.pinTuanRecord = newData;
_this.teamCount = info.pinTuanRecordNums; _this.teamCount = info.pinTuanRecordNums;
// 判断如果登录用户添加商品浏览足迹 // 判断如果登录用户添加商品浏览足迹
@@ -968,7 +953,6 @@
end(index, number) { end(index, number) {
this.pinTuanRecord[index][number].isOverdue = true; this.pinTuanRecord[index][number].isOverdue = true;
}, },
// 跳转到h5分享页面
goShare() { goShare() {
this.shareBox = true; this.shareBox = true;
}, },
@@ -989,8 +973,6 @@
}, },
//在线客服 //在线客服
showChat() { showChat() {
// #ifdef H5
// #endif
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
this.$u.route('/pages/member/customerService/index'); this.$u.route('/pages/member/customerService/index');
// #endif // #endif
@@ -998,10 +980,10 @@
//获取分享URL //获取分享URL
getShareUrl() { getShareUrl() {
let data = { let data = {
client: 2, client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
type: 1, type: this.$globalConstVars.shareModel.url,
page: 3, page: this.$globalConstVars.shareType.pinTuan,
params: { params: {
groupId: this.pinTuanId, groupId: this.pinTuanId,
goodsId: this.goodsId, goodsId: this.goodsId,
@@ -1028,7 +1010,7 @@
if (teamId) { if (teamId) {
this.teamId = teamId; this.teamId = teamId;
} else { } else {
this.teamId == 0; this.teamId = 0;
} }
if (this.pinTuanType == 2) { if (this.pinTuanType == 2) {
this.price = this.pinTuanPrice; this.price = this.pinTuanPrice;

View File

@@ -17,36 +17,88 @@
</view> </view>
<view class="content-box"> <view class="content-box">
<scroll-view scroll-y="true" enable-back-to-top @scrolltolower="loadMore" class="scroll-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="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="activity-goods-box coreshop-flex coreshop-justify-between"> <view class="coreshop-flex">
<view class="img-box"> <view>
<slot name="tag"></slot> <u--image :src="item.goodThumbnail" mode="widthFix" width="96px" height="96px"></u--image>
<image class="img" :src="item.image" mode="aspectFill"></image>
</view> </view>
<view class="goods-right coreshop-flex coreshop-justify-between coreshop-flex-direction"> <view class="coreshop-flex coreshop-flex-direction coreshop-padding-left-10 coreshop-percent-100">
<view class="title u-line-2">{{ item.name }}</view> <view class="coreshop-font-15 u-line-2 coreshop-text-black">{{ item.name }}</view>
<view class="tip u-line-1">{{ item.brief }}</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="slod-end"> <view class="coreshop-flex coreshop-align-center coreshop-padding-top-10 coreshop-padding-bottom-5">
<view class="coreshop-flex coreshop-align-center"> <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>
<u-line-progress :percentage="getPercent(item.buyPromotionCount, item.stock)"></u-line-progress> <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="progress-text">已抢{{ getProgress(item.buyPromotionCount, item.stock) }}</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> <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>
<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>
</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">
<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>
<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> <view class="coreshop-emptybox" v-else>
<u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无秒杀信息" mode="list"></u-empty> <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="暂无秒杀信息" mode="list"></u-empty>
@@ -61,9 +113,9 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
loadStatus: 'loadmore', loadStatus: 'loadmore',
@@ -80,20 +132,6 @@
status: 1, status: 1,
tabCurrent: 'ing', tabCurrent: 'ing',
goodsList: [], goodsList: [],
btnType: {
ing: {
name: '立即抢购',
color: 'btn-ing'
},
nostart: {
name: '尚未开始',
color: 'btn-nostart'
},
ended: {
name: '已结束',
color: 'btn-end',
},
},
tabList: [ tabList: [
{ {
id: 'ing', id: 'ing',
@@ -115,16 +153,13 @@
}; };
}, },
onLoad() { onLoad() {
setTimeout(() => {
this.loading = true;
}, 500);
this.getGoodsList(); this.getGoodsList();
}, },
//onReachBottom() { onReachBottom() {
// if (this.loadStatus === 'loadmore') { if (this.loadStatus === 'loadmore') {
// this.getGoodsList() this.getGoodsList()
// } }
//}, },
methods: { methods: {
onTab(id, status) { onTab(id, status) {
this.tabCurrent = id; this.tabCurrent = id;
@@ -132,7 +167,7 @@
this.goodsList = []; this.goodsList = [];
this.page = 1; this.page = 1;
this.loadStatus = 'loading'; this.loadStatus = 'loading';
this.$u.debounce(this.getGoodsList, 500); this.getGoodsList();
}, },
// 百分比 // 百分比
getProgress(sales, stock) { getProgress(sales, stock) {
@@ -168,14 +203,14 @@
let data = { let data = {
page: this.page, page: this.page,
limit: this.limit, limit: this.limit,
type: 4, //秒杀 type: this.$globalConstVars.paymentType.seckill,
status: this.status status: this.status
} }
this.loadStatus = 'loading'; this.loadStatus = 'loading';
this.$u.api.getGroup(data).then(res => { this.$u.api.getGroup(data).then(res => {
if (res.status) { if (res.status) {
if (res.data) { if (res.data) {
let _goodsList = res.data.goods; let _goodsList = res.data.list;
_this.goodsList = [..._this.goodsList, ..._goodsList] _this.goodsList = [..._this.goodsList, ..._goodsList]
} }
_this.lastPage = res.data.totalPages; _this.lastPage = res.data.totalPages;
@@ -190,7 +225,10 @@
} }
}); });
} },
onChange(e, key) {
this.$set(this.goodsList[key], 'timeData', e)
},
} }
} }
</script> </script>

View File

@@ -6,8 +6,6 @@
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon> <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-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
<u-icon name="home" size="22" @click="goHome"></u-icon> <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>
<view slot="right"> <view slot="right">
</view> </view>
@@ -24,7 +22,7 @@
<text class="coreshop-font-16">¥</text> <text class="coreshop-font-16">¥</text>
<text class="coreshop-font-24">{{ product.price || '0.00' }}</text> <text class="coreshop-font-24">{{ product.price || '0.00' }}</text>
</view> </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"> <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"> <u-count-down :time="goodsInfo.groupTimestamp*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm秒ss" @change="onChange">
<view class="time"> <view class="time">
@@ -34,7 +32,7 @@
</view> </view>
<text class="time__doc"></text> <text class="time__doc"></text>
<view class="time__custom"> <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> </view>
<text class="time__doc">:</text> <text class="time__doc">:</text>
<view class="time__custom"> <view class="time__custom">
@@ -48,10 +46,6 @@
</u-count-down> </u-count-down>
</view> </view>
</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>
<view class="coreshop-margin-top-12 coreshop-multiple-line-clamp"> <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> <text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
@@ -66,17 +60,16 @@
</view> </view>
</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-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"> <view class="coreshop-font-12">
<text>销量</text> <text>销量</text>
<text>{{ goodsInfo.buyCount || '0' }}</text> <text class="font-color-orange">{{ goodsInfo.buyCount || '0' }}</text>
</view> </view>
<view class="coreshop-font-12"> <view class="coreshop-font-12">
<text>库存</text> <u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
<text>{{product.stock}}</text> </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> </view>
</view> </view>
@@ -201,14 +194,11 @@
<!-- 分享弹窗 --> <!-- 分享弹窗 -->
<view class="coreshop-padding-0"> <view class="coreshop-padding-0">
<u-popup mode="bottom" :show="shareBox" ref="share"> <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 --> <!-- #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 --> <!-- #endif -->
<!-- #ifdef APP-PLUS || APP-PLUS-NVUE --> <!-- #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 --> <!-- #endif -->
</u-popup> </u-popup>
<div id="qrCode" ref="qrCodeDiv"></div> <div id="qrCode" ref="qrCodeDiv"></div>
@@ -261,7 +251,7 @@
{{ pointShowName}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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}}兑换价: {{ pointShowName}}兑换价:
</view> </view>
<view class="coreshop-text-red"> <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> </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"> <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="tabbar">
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4"> <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()"> <view class="action" @click="showChat()">
<button class="noButtonStyle"> <button class="noButtonStyle">
<u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon> <u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
@@ -378,11 +368,6 @@
</button> </button>
</view> </view>
</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"> <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> <u-button type="error" size="normal" @click="openSkuPopup" shape="circle">立即秒杀</u-button>
</view> </view>
@@ -407,7 +392,7 @@
</view> </view>
</template> </template>
<script> <script>
import { mapMutations, mapActions, mapState } from 'vuex'; import { mapState } from 'vuex';
export default { export default {
data() { data() {
@@ -441,7 +426,6 @@
selectType: '', selectType: '',
shareUrl: this.$globalConstVars.shareUrl, shareUrl: this.$globalConstVars.shareUrl,
shareBox: false, shareBox: false,
shareType: 10,
serviceDescription: { serviceDescription: {
commonQuestion: [], commonQuestion: [],
delivery: [], delivery: [],
@@ -451,11 +435,10 @@
}; };
}, },
onLoad(e) { onLoad(e) {
this.goodsId = e.id; this.groupId = e.id;
this.groupId = e.groupId; if (this.groupId) {
if (this.goodsId && this.groupId) {
this.getServiceDescription(); this.getServiceDescription();
this.getGoodsInfo(); this.getGroupInfo();
this.getGoodsParams(); this.getGoodsParams();
this.getGoodsComments(); this.getGoodsComments();
} else { } else {
@@ -526,8 +509,8 @@
shareHref() { shareHref() {
let pages = getCurrentPages(); let pages = getCurrentPages();
let page = pages[pages.length - 1]; 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; return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.groupId;
// #endif // #endif
}, },
}, },
@@ -600,17 +583,16 @@
} }
}) })
}, },
getGoodsInfo() { getGroupInfo() {
let data = { let data = {
id: this.goodsId, id: this.groupId,
groupId: this.groupId,
type: this.cartType, type: this.cartType,
needSku: true needSku: true
}; };
// 如果用户已经登录 要传用户token // 如果用户已经登录 要传用户token
let userToken = this.$db.get('userToken'); let userToken = this.$db.get('userToken');
if (userToken) { if (userToken) {
data['token'] = userToken; data.token = userToken
} }
let _this = this; let _this = this;
this.$u.api.groupInfo(data).then(res => { this.$u.api.groupInfo(data).then(res => {
@@ -635,7 +617,7 @@
} else { } else {
let info = res.data; let info = res.data;
this.product = res.data.product; this.product = res.data.product;
_this.goodsId = info.id;
_this.goodsInfo = info; _this.goodsInfo = info;
this.goodsSkuInfo = res.data.skuList; this.goodsSkuInfo = res.data.skuList;
if (_this.goodsInfo.album) { if (_this.goodsInfo.album) {
@@ -771,8 +753,6 @@
}, },
//在线客服 //在线客服
showChat() { showChat() {
// #ifdef H5
// #endif
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
this.$u.route('/pages/member/customerService/index'); this.$u.route('/pages/member/customerService/index');
// #endif // #endif
@@ -780,12 +760,11 @@
//获取分享URL //获取分享URL
getShareUrl() { getShareUrl() {
let data = { let data = {
client: 2, client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
type: 1, type: this.$globalConstVars.shareModel.url,
page: this.shareType, page: this.$globalConstVars.shareType.seckill,
params: { params: {
goodsId: this.goodsId,
groupId: this.groupId groupId: this.groupId
} }
}; };
@@ -809,7 +788,6 @@
}, },
showModal() { showModal() {
this.bottomModal = true; this.bottomModal = true;
console.log("打开弹窗");
}, },
hideModal(e) { hideModal(e) {
this.bottomModal = false; this.bottomModal = false;

View File

@@ -35,17 +35,22 @@
</view> </view>
<view class="item"> <view class="item">
<view class="left"> <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>
<view class="content"> <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="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> </view>
<view class="bottom coreshop-margin-top-10"> <view class="bottom coreshop-margin-top-10">
<view class="more">正在接龙中</view> <view class="more">正在接龙中</view>
<view class="coreshop-flex"> <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> </view>
</view> </view>

View File

@@ -38,7 +38,11 @@
</view> </view>
</view> </view>
<view class="coreshop-font-11 coreshop-text-gray coreshop-margin-bottom-10 "> <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>
<view class="coreshop-padding-10 coreshop-content"> <view class="coreshop-padding-10 coreshop-content">
<u-parse :content="model.contentBody" :selectable="true" v-if="model.contentBody"></u-parse> <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"> <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> <u-icon name="more-circle" color="#e54d42" label="接龙清单" labelSize="15px" label-pos="right"></u-icon>
</view> </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 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 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"> <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> <text class="coreshop-text-black coreshop-font-12">{{ records.length-index}}</text>
<u-avatar :src="item.avatarImage" :size="30"></u-avatar> <view class="coreshop-margin-left-10 coreshop-width-max-content">
<text class="coreshop-text-black coreshop-font-12 u-line-1">{{ item.nickName}}</text> <view class="coreshop-flex coreshop-flex-nowrap coreshop-justify-between ">
<view class="coreshop-margin-left-10 coreshop-width-max-content"> <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> <text class="coreshop-text-gray coreshop-font-10">{{$u.timeFormat(item.create, 'mm月dd日')}}</text>
</view> </view>
</view> </view>
@@ -108,9 +116,6 @@
<!-- 分享弹窗 --> <!-- 分享弹窗 -->
<view class="coreshop-padding-10"> <view class="coreshop-padding-10">
<u-popup mode="bottom" :show="shareBox" ref="share"> <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 --> <!-- #ifdef MP-WEIXIN -->
<coreshop-share-wx :objectId="model.id" :shareType="12" @close="closeShare()"></coreshop-share-wx> <coreshop-share-wx :objectId="model.id" :shareType="12" @close="closeShare()"></coreshop-share-wx>
<!-- #endif --> <!-- #endif -->
@@ -312,20 +317,14 @@
this.$u.toast('请先选择商品') this.$u.toast('请先选择商品')
return true return true
} }
var totalprice = parseFloat(this.totalprice); //var totalprice = parseFloat(this.totalprice);
var startBuyPrice = parseFloat(this.model.startBuyPrice); //var startBuyPrice = parseFloat(this.model.startBuyPrice);
console.log('商品价格:' + this.totalprice); //console.log('商品价格:' + this.totalprice);
console.log('起购价格:' + this.model.startBuyPrice); //console.log('起购价格:' + this.model.startBuyPrice);
if (this.totalprice < this.model.startBuyPrice) { if (this.totalprice < this.model.startBuyPrice) {
this.$u.toast('最小购买价格为' + this.model.startBuyPrice + '元,请增加购买产品') this.$u.toast('最小购买价格为' + this.model.startBuyPrice + '元,请增加购买产品')
return true return true
} }
//let userToken = this.$db.get('userToken');
//let obj = {
// cart: this.cart,
// id: this.id,
// token: userToken
//}
this.submitStatus = true; this.submitStatus = true;
let newData = ''; let newData = '';
for (var i = 0; i < this.cart.length; i++) { for (var i = 0; i < this.cart.length; i++) {
@@ -337,7 +336,9 @@
newData = newData.substr(1); newData = newData.substr(1);
} }
if (newData.length > 0) { 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; return true;
} else { } else {
//没有选择不跳转 //没有选择不跳转
@@ -353,17 +354,17 @@
//获取分享URL //获取分享URL
getShareUrl() { getShareUrl() {
let data = { let data = {
client: 2, client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
type: 1, type: this.$globalConstVars.shareModel.url,
page: 12, page: this.$globalConstVars.shareType.solitaire,
params: { params: {
id: this.model.id, id: this.model.id,
} }
}; };
let userToken = this.$db.get('userToken'); let userToken = this.$db.get('userToken');
if (userToken && userToken != '') { if (userToken && userToken != '') {
data['token'] = userToken; data.token = userToken
} }
this.$u.api.share(data).then(res => { this.$u.api.share(data).then(res => {
this.shareUrl = res.data this.shareUrl = res.data

View File

@@ -13,7 +13,7 @@
</u-navbar> </u-navbar>
<view class="coreshop-bg-white coreshop-padding-10 coreshop-margin-10"> <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"> <view class="article-title">
{{ info.title }} {{ info.title }}
</view> </view>
@@ -117,10 +117,10 @@
//获取分享URL //获取分享URL
getShareUrl() { getShareUrl() {
let data = { let data = {
client: 2, client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl, url: this.$globalConstVars.shareUrl,
type: 1, type: this.$globalConstVars.shareModel.url,
page: 5, page: this.$globalConstVars.shareType.article,
params: { params: {
articleId: this.id, articleId: this.id,
articleType: this.idType articleType: this.idType
@@ -128,7 +128,7 @@
}; };
let userToken = this.$db.get('userToken'); let userToken = this.$db.get('userToken');
if (userToken && userToken != '') { if (userToken && userToken != '') {
data['token'] = userToken; data.token = userToken
} }
this.$u.api.share(data).then(res => { this.$u.api.share(data).then(res => {
this.shareUrl = res.data this.shareUrl = res.data

View File

@@ -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-menu-wrap { flex: 1; display: flex; overflow: hidden;
.u-tab-view { width: 100px; height: 100%; background: #f6f6f6; .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; } .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