Commit e433c54d authored by 吴春's avatar 吴春
parents 19e76bdf 2e66bd6f
......@@ -81,10 +81,11 @@ namespace Mall.Module.MarketingCenter
/// </summary>
/// <param name="query">查询条件</param>
/// <param name="isGetHome">是否查询首页页面</param>
/// <param name="isGetSchoolPage">是否查询校园版首页页面</param>
/// <returns></returns>
public RB_Miniprogram_Page_Templ_Extend GetMiniprogramPageTemplModule(RB_Miniprogram_Page_Templ_Extend query, bool isGetHome = false)
public RB_Miniprogram_Page_Templ_Extend GetMiniprogramPageTemplModule(RB_Miniprogram_Page_Templ_Extend query, bool isGetHome = false,bool isGetSchoolPage=false)
{
var extModel = pageRepository.GetMiniprogramPageTemplRepository(query, isGetHome: isGetHome);
var extModel = pageRepository.GetMiniprogramPageTemplRepository(query, isGetHome: isGetHome,isGetSchoolPage:isGetSchoolPage);
if (extModel == null)
{
extModel = new RB_Miniprogram_Page_Templ_Extend();
......
......@@ -1217,8 +1217,13 @@ namespace Mall.Module.Product
/// <summary>
/// 获取商品分享
/// </summary>
/// <param name="goodsId"></param>
/// <param name="userId"></param>
/// <param name="path"></param>
/// <param name="mallBaseId"></param>
/// <param name="IsOpenSchool">是否开启校园版(1-开启)</param>
/// <returns></returns>
public object GetAppletGoodsShareInfo(int goodsId, int userId, string path, int mallBaseId)
public object GetAppletGoodsShareInfo(int goodsId, int userId, string path, int mallBaseId, int IsOpenSchool = 0)
{
string QRPath = GetWeiXinQRCode(path, 430, mallBaseId);
var umodel = member_UserRepository.GetEntity(userId);
......@@ -1227,7 +1232,11 @@ namespace Mall.Module.Product
var config = new object();
//商品信息
var info = new object();
var goodsPoster = miniProgram_GoodPosterRepository.GetEntityExtRepository(new RB_MiniProgram_GoodPoster_Extend() { MallBaseId = mallBaseId });
var goodsPoster = miniProgram_GoodPosterRepository.GetEntityExtRepository(new RB_MiniProgram_GoodPoster_Extend()
{
MallBaseId = mallBaseId,
IsOpenSchool = IsOpenSchool
});
config = new
{
poster_style = goodsPoster?.PosterStyleList ?? new List<int>() { 1 },
......
......@@ -61,6 +61,8 @@ namespace Mall.Module.User
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodePaddingTop),extModel.QrCodePaddingTop},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodePaddingLeft),extModel.QrCodePaddingLeft},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodeType),extModel.QrCodeType},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.IsOpenSchool),extModel.IsOpenSchool},
};
flag = fenXiaoPosterRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_FenXiaoPoster_Extend.Id), extModel.Id));
}
......@@ -97,6 +99,7 @@ namespace Mall.Module.User
{
{ nameof(RB_MiniProgram_GoodPoster_Extend.PosterStyle),extModel.PosterStyle},
{ nameof(RB_MiniProgram_GoodPoster_Extend.GoodsImgCount),extModel.GoodsImgCount},
{ nameof(RB_MiniProgram_GoodPoster_Extend.IsOpenSchool),extModel.IsOpenSchool},
};
flag = goodPosterRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_GoodPoster_Extend.Id), extModel.Id));
}
......
......@@ -99,8 +99,9 @@ namespace Mall.Repository.MarketingCenter
/// </summary>
/// <param name="query">查询条件</param>
/// <param name="isGetHome">是否查询首页页面</param>
/// <param name="isGetSchoolPage">是否查询校园版首页页面</param>
/// <returns></returns>
public RB_Miniprogram_Page_Templ_Extend GetMiniprogramPageTemplRepository(RB_Miniprogram_Page_Templ_Extend query,bool isGetHome=false)
public RB_Miniprogram_Page_Templ_Extend GetMiniprogramPageTemplRepository(RB_Miniprogram_Page_Templ_Extend query,bool isGetHome=false,bool isGetSchoolPage = false)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM RB_Miniprogram_Page_Templ WHERE 1=1 ");
......@@ -126,6 +127,10 @@ namespace Mall.Repository.MarketingCenter
{
builder.Append($" AND {nameof(RB_Miniprogram_Page_Templ_Extend.IsHome)}=1 ");
}
if (isGetSchoolPage)
{
builder.Append($" AND {nameof(RB_Miniprogram_Page_Templ_Extend.IsSchoolHomePage)}=1 ");
}
}
return Get<RB_Miniprogram_Page_Templ_Extend>(builder.ToString()).FirstOrDefault();
}
......
......@@ -35,6 +35,10 @@ namespace Mall.Repository.User
{
builder.AppendFormat(" AND Id={0} ", query.Id);
}
if (query.IsOpenSchool >= 0)
{
builder.AppendFormat(" AND IsOpenSchool={0} ", query.IsOpenSchool);
}
}
return Get<RB_MiniProgram_FenXiaoPoster_Extend>(builder.ToString()).FirstOrDefault();
}
......
......@@ -35,6 +35,10 @@ namespace Mall.Repository.User
{
builder.AppendFormat(" AND Id={0} ", query.Id);
}
if (query.IsOpenSchool >= 0)
{
builder.AppendFormat(" AND IsOpenSchool={0} ", query.IsOpenSchool);
}
}
return Get<RB_MiniProgram_GoodPoster_Extend>(builder.ToString()).FirstOrDefault();
}
......
......@@ -94,7 +94,9 @@ namespace Mall.WebApi.Controllers.MallBase
Common.Plugin.LogHelper.Write(ex,"MallController_GetHome");
}
int page_id = parms.GetInt("page_id");
int page_id = parms.GetInt("page_id");
//是否开启校园版【1-是】
int isOpenSchool = parms.GetInt("open_school",0);
//首页数据
var homePage = new object();
//底部导航
......@@ -130,6 +132,9 @@ namespace Mall.WebApi.Controllers.MallBase
//分销商设置
share_setting_custom = MallHelper.GetDistributorCustomInfo(miniProgram);
}
#region 首页页面数据解析
if (page_id > 0)
{
var targetPage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
......@@ -137,7 +142,7 @@ namespace Mall.WebApi.Controllers.MallBase
MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId,
Id = page_id
}, isGetHome: false);
}, isGetHome: false,isGetSchoolPage:false);
List<object> list = new List<object>();
//自定义首页
if (targetPage != null && targetPage.Id > 0)
......@@ -192,38 +197,24 @@ namespace Mall.WebApi.Controllers.MallBase
{
if (miniProgram != null && miniProgram.MallBaseId > 0)
{
//底部导航
navbar = new
RB_Miniprogram_Page_Templ_Extend selfHomePage = new RB_Miniprogram_Page_Templ_Extend();
if (isOpenSchool == 1)
{
//底部导航背景颜色
bottom_background_color = miniProgram.BottomNavBgColor,
//顶部导航背景颜色
top_background_color = miniProgram.TopNavBgColor,
//顶部标题文字颜色
top_text_color = miniProgram.TopNavWordColor,
//导航底部是否开启阴影效果(0-未开启,1-开启)
shadow = miniProgram.BottomNavIsShadow,
//导航栏
navs = miniProgram.BottomTagList.Select(qitem => new
selfHomePage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
{
active_color = qitem.CheckedColor,
active_icon = qitem.CheckedIcon,
color = qitem.DefaultColor,
text = qitem.TagName,
icon = qitem.DefaultIcon,
url = qitem.TagLink,
open_type = "redirect",
key = qitem.TagLink == "/pages/live/index" ? "live" : "",
}),
};
var selfHomePage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId,
}, isGetHome: false,isGetSchoolPage:true);
}
//判断是否存在校园版首页
if (selfHomePage == null||(selfHomePage!=null && selfHomePage.Id<=0))
{
MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId,
}, isGetHome: true);
selfHomePage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
{
MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId,
}, isGetHome: true, isGetSchoolPage: false);
}
List<object> list = new List<object>();
//自定义首页
if (selfHomePage != null && selfHomePage.Id > 0)
......@@ -306,13 +297,50 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
}
#endregion
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
#region 底部导航
if (miniProgram != null && miniProgram.MallBaseId > 0)
{
//底部导航
navbar = new
{
var memberModel = userModule.GetAppletUserCenterStatistics(RequestParm.OpenId);
user_info = memberModel;
}
//底部导航背景颜色
bottom_background_color = miniProgram.BottomNavBgColor,
//顶部导航背景颜色
top_background_color = miniProgram.TopNavBgColor,
//顶部标题文字颜色
top_text_color = miniProgram.TopNavWordColor,
//导航底部是否开启阴影效果(0-未开启,1-开启)
shadow = miniProgram.BottomNavIsShadow,
//导航栏
navs = miniProgram.BottomTagList.Select(qitem => new
{
active_color = qitem.CheckedColor,
active_icon = qitem.CheckedIcon,
color = qitem.DefaultColor,
text = qitem.TagName,
icon = qitem.DefaultIcon,
url = qitem.TagLink,
open_type = "redirect",
key = qitem.TagLink == "/pages/live/index" ? "live" : "",
}),
};
}
#endregion
#region 用户信息
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
{
var memberModel = userModule.GetAppletUserCenterStatistics(RequestParm.OpenId);
user_info = memberModel;
}
#endregion
#region 商品分类样式
var productCategoryStyle = productModule.GetProductCategoryStyleInfo(miniProgram.TenantId ?? 0, miniProgram.MallBaseId);
cat_style = new
......@@ -340,6 +368,8 @@ namespace Mall.WebApi.Controllers.MallBase
option = new List<object>(),
setting,
};
#region 授权页面热区
//授权页面热区
var hotspotCancel = new object();
var hotspotLogin = new object();
......@@ -390,6 +420,8 @@ namespace Mall.WebApi.Controllers.MallBase
hotspot = hotspotLogin,
hotspot_cancel = hotspotCancel
};
#endregion
var liveConfigModel = programModule.GetLiveConfigModule(new Model.Extend.AppletWeChat.RB_Live_Config_Extend() { MallBaseId = miniProgram.MallBaseId, TenantId = miniProgram.TenantId });
liveConfig = new
{
......@@ -647,7 +679,9 @@ namespace Mall.WebApi.Controllers.MallBase
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int goodsId = parms.GetInt("goodsId");
string path = parms.GetStringValue("path");
var obj = productModule.GetAppletGoodsShareInfo(goodsId, RequestParm.UserId, path, (miniProgram?.MallBaseId ?? 0));
//HK 2020-09-22新增【是否开启校园版分享-(1-开启)】
int IsOpenSchool = parms.GetInt("IsOpenSchool",0);
var obj = productModule.GetAppletGoodsShareInfo(goodsId, RequestParm.UserId, path, (miniProgram?.MallBaseId ?? 0),IsOpenSchool:IsOpenSchool);
return ApiResult.Success(data: obj);
}
}
......
......@@ -1400,9 +1400,11 @@ namespace Mall.WebApi.Controllers.User
public ApiResult GetFenXiaoPoster()
{
var userInfo = AppletUserInfo;
JObject jobj = JObject.Parse(RequestParm.msg.ToString());
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_FenXiaoPoster_Extend>(RequestParm.msg.ToString());
extModel.TenantId = userInfo.TenantId;
extModel.MallBaseId = userInfo.MallBaseId;
extModel.IsOpenSchool = jobj.GetInt("IsOpenSchool", 0);
var result = userModule.GetFenXiaoPosterEntityModule(extModel);
return ApiResult.Success(data: result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment