mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 15:53:26 +08:00
【修复】修复首页【秒杀】【团购】优惠后价格计算显示异常的问题。修复【秒杀】【团购】列表页面优惠后价格计算显示异常的问。
【优化】取消首页【秒杀】【团购】【服务商品】自定义倒计时组件,使用组件原生数字倒计时,减少监听事件,去除内存可能泄露的风险。
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.DTO;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.DTO;
|
||||
@@ -47,8 +48,16 @@ namespace CoreCms.Net.IServices
|
||||
/// <returns></returns>
|
||||
Task<bool> SetPromotion(CoreCmsPromotion promotion, CartDto cartModel);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取团购列表数据
|
||||
/// 获取团购列表数据(根据类型获取当前可用)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GroupPurchaseSeckillDTO>> GetGroupListForPages(int[] promotionIds);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取团购列表数据(根据营销序列)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<WebApiCallBack> GetGroupList(int type, int status, int pageIndex, int pageSize);
|
||||
|
||||
@@ -30,6 +30,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using static SKIT.FlurlHttpClient.Wechat.Api.Models.ScanProductV2AddRequest.Types.Product.Types;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
@@ -176,10 +177,143 @@ namespace CoreCms.Net.Services
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取团购列表数据
|
||||
#region 获取团购列表数据(根据营销序列)
|
||||
/// <summary>
|
||||
/// 获取团购列表数据
|
||||
/// 获取团购列表数据(根据营销序列)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<GroupPurchaseSeckillDTO>> GetGroupListForPages(int[] promotionIds)
|
||||
{
|
||||
using var container = _serviceProvider.CreateScope();
|
||||
|
||||
var goodsServices = container.ServiceProvider.GetService<ICoreCmsGoodsServices>();
|
||||
|
||||
var dtoData = new List<GroupPurchaseSeckillDTO>();
|
||||
|
||||
var promotions = await _dal.QueryListByClauseAsync(p => p.isEnable == true && p.isDel == false && promotionIds.Contains(p.id), promotionIds.Length, "", true, true);
|
||||
if (promotions != null && promotions.Any())
|
||||
{
|
||||
//获取团购序列
|
||||
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 dtNow = DateTime.Now;
|
||||
|
||||
var dto = new GroupPurchaseSeckillDTO();
|
||||
|
||||
//事物处理过程开始
|
||||
dto.id = item.id;
|
||||
dto.name = item.name;
|
||||
dto.type = item.type;
|
||||
dto.sort = item.sort;
|
||||
dto.maxNums = item.maxNums;
|
||||
dto.maxGoodsNums = item.maxGoodsNums;
|
||||
dto.maxRecevieNums = item.maxRecevieNums;
|
||||
dto.startTime = item.startTime;
|
||||
dto.endTime = item.endTime;
|
||||
dto.isEnable = item.isEnable;
|
||||
dto.isExclusive = item.isExclusive;
|
||||
dto.isAutoReceive = item.isAutoReceive;
|
||||
dto.effectiveDays = item.effectiveDays;
|
||||
dto.effectiveHours = item.effectiveHours;
|
||||
|
||||
var dt = DateTime.Now;
|
||||
if (item.startTime > dt)
|
||||
{
|
||||
dto.startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming;
|
||||
}
|
||||
else if (item.startTime < dt && dt < item.endTime)
|
||||
{
|
||||
dto.startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress;
|
||||
}
|
||||
else if (item.endTime < dt)
|
||||
{
|
||||
dto.startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished;
|
||||
}
|
||||
|
||||
var condition = conditions.Find(p => p.promotionId == item.id);
|
||||
if (condition != null && condition.parameters.Contains("goodsId"))
|
||||
{
|
||||
var parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters);
|
||||
var goodId = parameters["goodsId"].ObjectToInt(0);
|
||||
var good = goodData.Find(p => p.id == goodId);
|
||||
if (good != null)
|
||||
{
|
||||
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;
|
||||
|
||||
var ts = item.endTime.Subtract(dtNow);
|
||||
dto.timestamp = (int)ts.TotalSeconds;
|
||||
}
|
||||
}
|
||||
var result = results.Find(p => p.promotionId == item.id);
|
||||
if (result != null)
|
||||
{
|
||||
var resultParameters = (JObject)JsonConvert.DeserializeObject(result.parameters);
|
||||
decimal promotionAmount = 0;
|
||||
{
|
||||
var cartProducts = new CartProducts()
|
||||
{
|
||||
nums = 1,
|
||||
products = new CoreCmsProducts()
|
||||
{
|
||||
price = dto.price,
|
||||
amount = dto.price,
|
||||
}
|
||||
};
|
||||
switch (result.code)
|
||||
{
|
||||
//指定商品减固定金额
|
||||
case "GOODS_REDUCE":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_REDUCE(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品打X折
|
||||
case "GOODS_DISCOUNT":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_DISCOUNT(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品一口价
|
||||
case "GOODS_ONE_PRICE":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_ONE_PRICE(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品每第几件减指定金额
|
||||
case "GOODS_HALF_PRICE":
|
||||
//这个条件不在列表做处理
|
||||
promotionAmount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (promotionAmount > 0)
|
||||
{
|
||||
dto.price = Math.Round(dto.price - promotionAmount, 2);
|
||||
}
|
||||
}
|
||||
dtoData.Add(dto);
|
||||
}
|
||||
}
|
||||
return dtoData;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取团购列表数据(根据类型获取当前可用)
|
||||
/// <summary>
|
||||
/// 获取团购列表数据(根据类型获取当前可用)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<WebApiCallBack> GetGroupList(int type, int status, int pageIndex, int pageSize)
|
||||
@@ -270,6 +404,52 @@ namespace CoreCms.Net.Services
|
||||
dto.timestamp = (int)ts.TotalSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var result = results.Find(p => p.promotionId == item.id);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
JObject resultParameters = (JObject)JsonConvert.DeserializeObject(result.parameters);
|
||||
decimal promotionAmount = 0;
|
||||
{
|
||||
var cartProducts = new CartProducts()
|
||||
{
|
||||
nums = 1,
|
||||
products = new CoreCmsProducts()
|
||||
{
|
||||
price = dto.price,
|
||||
amount = dto.price,
|
||||
}
|
||||
};
|
||||
|
||||
switch (result.code)
|
||||
{
|
||||
//指定商品减固定金额
|
||||
case "GOODS_REDUCE":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_REDUCE(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品打X折
|
||||
case "GOODS_DISCOUNT":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_DISCOUNT(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品一口价
|
||||
case "GOODS_ONE_PRICE":
|
||||
promotionAmount = _promotionResultServices.result_GOODS_ONE_PRICE(resultParameters, cartProducts, item);
|
||||
break;
|
||||
//指定商品每第几件减指定金额
|
||||
case "GOODS_HALF_PRICE":
|
||||
//这个条件不在列表做处理
|
||||
promotionAmount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (promotionAmount > 0)
|
||||
{
|
||||
dto.price = Math.Round(dto.price - promotionAmount, 2);
|
||||
}
|
||||
}
|
||||
|
||||
dtoData.Add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace CoreCms.Net.Services
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var newReslut = new JArray();
|
||||
var ids = new List<int>();
|
||||
foreach (var jToken in result)
|
||||
{
|
||||
var ss = (JObject)jToken;
|
||||
@@ -509,47 +509,17 @@ namespace CoreCms.Net.Services
|
||||
var promotionId = ss["id"].ObjectToInt(0);
|
||||
if (promotionId > 0)
|
||||
{
|
||||
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true);
|
||||
if (promotionModel != null)
|
||||
{
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true);
|
||||
if (condition != null)
|
||||
{
|
||||
var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Group, false);
|
||||
if (goods.status)
|
||||
{
|
||||
var goodJson = JsonConvert.SerializeObject(goods.data);
|
||||
ss.Add("goods", JToken.Parse(goodJson));
|
||||
}
|
||||
}
|
||||
int startStatus;
|
||||
var lastTime = 0;
|
||||
if (promotionModel.startTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming;
|
||||
var ts = promotionModel.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (promotionModel.startTime <= dt && promotionModel.endTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress;
|
||||
var ts = promotionModel.endTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished;
|
||||
}
|
||||
|
||||
ss.Add("startStatus", startStatus);
|
||||
ss.Add("lastTime", lastTime);
|
||||
newReslut.Add(ss);
|
||||
}
|
||||
ids.Add(promotionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", newReslut);
|
||||
|
||||
if (ids.Any())
|
||||
{
|
||||
var list = await _promotionServices.GetGroupListForPages(ids.ToArray());
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", JArray.FromObject(list));
|
||||
}
|
||||
}
|
||||
|
||||
dto.parameters = parameters;
|
||||
@@ -561,7 +531,7 @@ namespace CoreCms.Net.Services
|
||||
if (parameters != null && parameters.ContainsKey("list"))
|
||||
{
|
||||
var result = JArray.Parse(parameters["list"].ToString());
|
||||
var newReslut = new JArray();
|
||||
var ids = new List<int>();
|
||||
foreach (var jToken in result)
|
||||
{
|
||||
var ss = (JObject)jToken;
|
||||
@@ -572,53 +542,18 @@ namespace CoreCms.Net.Services
|
||||
var promotionId = ss["id"].ObjectToInt(0);
|
||||
if (promotionId > 0)
|
||||
{
|
||||
var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true);
|
||||
if (promotionModel != null)
|
||||
{
|
||||
var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true);
|
||||
if (condition != null)
|
||||
{
|
||||
var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Seckill, false);
|
||||
if (goods.status)
|
||||
{
|
||||
var goodJson = JsonConvert.SerializeObject(goods.data);
|
||||
ss.Add("goods", JToken.Parse(goodJson));
|
||||
}
|
||||
}
|
||||
|
||||
int startStatus;
|
||||
int lastTime = 0;
|
||||
|
||||
if (promotionModel.startTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming;
|
||||
|
||||
var ts = promotionModel.startTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else if (promotionModel.startTime <= dt && promotionModel.endTime > dt)
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress;
|
||||
|
||||
var ts = promotionModel.endTime.Subtract(dt);
|
||||
lastTime = (int)ts.TotalSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished;
|
||||
}
|
||||
|
||||
ss.Add("startStatus", startStatus);
|
||||
ss.Add("lastTime", lastTime);
|
||||
newReslut.Add(ss);
|
||||
}
|
||||
ids.Add(promotionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", newReslut);
|
||||
}
|
||||
|
||||
if (ids.Any())
|
||||
{
|
||||
var list = await _promotionServices.GetGroupListForPages(ids.ToArray());
|
||||
parameters.Remove("list");
|
||||
parameters.Add("list", JArray.FromObject(list));
|
||||
}
|
||||
}
|
||||
dto.parameters = parameters;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7,69 +7,70 @@
|
||||
<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">
|
||||
<view class="coreshop-flex coreshop-justify-start">
|
||||
<view class="coreshop-flex-direction coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.goods.image" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
|
||||
<u--image :src="item.goodThumbnail" 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-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.maxBuyNumber>0">限购{{item.maxBuyNumber}}</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-green coreshop-padding-2 coreshop-border-radius-4 coreshop-margin-right-10" v-if="item.maxBuyNumber==0">不限购</view>
|
||||
<view class="coreshop-font-11 coreshop-bg-olive coreshop-padding-2 coreshop-border-radius-4">{{item.ticketNumber}}张券</view>
|
||||
</view>-->
|
||||
<view class="coreshop-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<view class="coreshop-text-right coreshop-time-right coreshop-margin-top-10" v-if="(item.startStatus == 1) && item.lastTime">
|
||||
<u-count-down :time="item.lastTime*1000" :autoStart="true" format="DD天HH时mm秒ss" @change="onChange($event,key)">
|
||||
<view class="time coreshop-font-11">
|
||||
<view class="coreshop-font-12">仅剩:</view>
|
||||
<view class="time__custom">
|
||||
<text class="time__custom__item">{{ item.timeData.days }}</text>
|
||||
</view>
|
||||
<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 class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 1) && item.timestamp">
|
||||
<view class="coreshop-font-12">仅剩:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
<!--<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>
|
||||
</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>
|
||||
<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>
|
||||
</u-count-down>
|
||||
</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-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 2) && item.timestamp">
|
||||
<view class="coreshop-font-12">即将开始:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
<!--<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>-->
|
||||
ew
|
||||
</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.goods.product.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}元</view>
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.mktPrice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 1" @click="goGroupBuyingDetail(item.id)">立即团</view>
|
||||
<view class="coreshop-groupPurchase-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
|
||||
@@ -7,64 +7,64 @@
|
||||
<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-direction coreshop-margin-bottom-10 coreshop-text-black" v-for="(item, key) in listData" :key="key">
|
||||
<view class="coreshop-flex">
|
||||
<view>
|
||||
<u--image :src="item.goods.image" mode="widthFix" width="96px" height="96px" radius="8"></u--image>
|
||||
<u--image :src="item.goodThumbnail" 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 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-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 1) && item.timestamp">
|
||||
<view class="coreshop-font-12">仅剩:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
<!--<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>
|
||||
</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>
|
||||
<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>
|
||||
</u-count-down>
|
||||
</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-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-min-height-30" v-if="(item.startStatus == 2) && item.timestamp">
|
||||
<view class="coreshop-font-12">即将开始:</view><u-count-down :time="item.timestamp*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
<!--<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 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.goods.product.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.goods.product.mktprice}}元</view>
|
||||
<view class="coreshop-font-14 coreshop-text-red">¥{{item.price}}</view>
|
||||
<view class="coreshop-font-xs coreshop-text-through coreshop-margin-left-5">{{item.mktPrice}}元</view>
|
||||
</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 1" @click="goSeckillDetail(item.id)">马上秒</view>
|
||||
<view class="coreshop-seckill-btn" v-if="item.startStatus == 0">即将开始</view>
|
||||
@@ -127,6 +127,8 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-count-down__text { font-size: 12px; }
|
||||
|
||||
.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;
|
||||
|
||||
@@ -20,53 +20,56 @@
|
||||
<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 class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start" v-if="item.openStatus == 1 && item.lastTime > 0">
|
||||
<view class="coreshop-font-12">仅剩:</view><u-count-down :time="item.lastTime*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
|
||||
<!--<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>
|
||||
</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>
|
||||
<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>
|
||||
</u-count-down>
|
||||
</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-flex coreshop-justify-between coreshop-flex-direction-row coreshop-align-center coreshop-margin-top-10">
|
||||
<view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start" v-if="item.openStatus == 2 && item.lastTime > 0">
|
||||
<view class="coreshop-font-12">即将开始:</view><u-count-down :time="item.lastTime*1000" format="DD天HH时mm秒ss" autoStart></u-count-down>
|
||||
<!--<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 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.money }}</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user