Commit 6528a9a0 authored by liudong1993's avatar liudong1993

调整+

parent 4de0ff95
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" /> <ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" /> <ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" /> <ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
......
...@@ -3,8 +3,6 @@ using System.Collections.Generic; ...@@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.Model.Entity.User; using Mall.Model.Entity.User;
...@@ -220,7 +218,7 @@ namespace Mall.Module.Product ...@@ -220,7 +218,7 @@ namespace Mall.Module.Product
//会员价格 //会员价格
var MemberPriceList = new List<RB_Goods_MemberPrice_Extend>(); var MemberPriceList = new List<RB_Goods_MemberPrice_Extend>();
if (list.Where(x=> x.EnjoyMember == 1 && x.SeparateSetMember == 1).Any()) if (list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Any())
{ {
string goodsIds = string.Join(",", list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Select(x => x.Id)); string goodsIds = string.Join(",", list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Select(x => x.Id));
MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
...@@ -869,6 +867,100 @@ namespace Mall.Module.Product ...@@ -869,6 +867,100 @@ namespace Mall.Module.Product
return model; return model;
} }
/// <summary>
/// 获取商品分享
/// </summary>
/// <returns></returns>
public object GetAppletGoodsShareInfo(int goodsId, int userId, string path, int mallBaseId)
{
string QRPath = GetWeiXinQRCode(path, 430, mallBaseId);
var umodel = member_UserRepository.GetEntity(userId);
var goodsModel = goodsRepository.GetEntity(goodsId);
if (goodsModel == null)
{
return new
{
goods_name = "",
multi_map = new List<string>(),
is_negotiable = 0,
min_price = 0,
max_price = 0,
nickname = umodel?.Name ?? "",
avatar = umodel?.Photo ?? "",
qrcode_url = QRPath,
sign = ""
};
}
else {
//商品图片处理
var imgList = new List<string>();
if (!string.IsNullOrEmpty(goodsModel.CarouselImage) && goodsModel.CarouselImage != "[]") {
imgList = JsonConvert.DeserializeObject<List<string>>(goodsModel.CarouselImage);
}
if (imgList.Any()) {
if (imgList.Count() < 8) {
var imgList2 = new List<string>();
int Num = 8 / imgList.Count();
for (var i = 0; i < Num + 1; i++) {
imgList2.AddRange(imgList);
}
imgList = imgList2.Take(8).ToList();
}
}
return new
{
goods_name = goodsModel.Name,
multi_map = imgList,
is_negotiable = 0,
min_price = goodsModel.SellingPrice,
max_price = goodsModel.SellingPrice,
nickname = umodel?.Name ?? "",
avatar = umodel?.Photo ?? "",
qrcode_url = QRPath,
sign = ""
};
}
}
#region 获取小程序码
/// <summary>
/// 生成小程序码
/// </summary>
/// <param name="path"></param>
/// <param name="width"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public string GetWeiXinQRCode(string path, int width, int mallBaseId)
{
var appletWeChatModel = programRepository.GetEntity(mallBaseId);
string token = CacheManager.AppletWeChat.WeiXinReidsCache.Get(appletWeChatModel.MiniAppId);
if (string.IsNullOrEmpty(token))
{
token = Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, appletWeChatModel.MiniAppId, appletWeChatModel.MiniAppSecret);
System.Threading.Tasks.Task.Run(() => CacheManager.AppletWeChat.WeiXinReidsCache.Set(appletWeChatModel.MiniAppId, token));
}
if (!string.IsNullOrEmpty(token))
{
//string GetImageUrl = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + token;//获取二维码
string GetImageUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + token;//获取小程序码
var postData = new
{
path,
width
};
string pathName = Guid.NewGuid().ToString() + ".jpg";
string basepath = AppContext.BaseDirectory;
string path_server = basepath + "\\upfile\\temporary\\" + pathName;
var Robj = HttpHelper.HttpPostForGetWXQRCodePath(GetImageUrl, JsonHelper.Serialize(postData), path_server);
//var Robj1 = HttpHelper.HttpPost(GetImageUrl, JsonHelper.Serialize(postData), "");
return Robj;
}
return "";
}
#endregion
/// <summary> /// <summary>
/// 获取小程序商品详情 /// 获取小程序商品详情
/// </summary> /// </summary>
...@@ -1610,7 +1702,7 @@ namespace Mall.Module.Product ...@@ -1610,7 +1702,7 @@ namespace Mall.Module.Product
{ {
integral = new integral = new
{ {
title = "购买可得" + Integral + "积分" title = Integral > 0 ? "购买可得" + Integral + "积分" : ""
} }
}, },
//plugin_extra = new List<object>(), //plugin_extra = new List<object>(),
......
...@@ -2972,6 +2972,7 @@ namespace Mall.Module.User ...@@ -2972,6 +2972,7 @@ namespace Mall.Module.User
{ {
return ""; return "";
} }
var baseModel = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend() { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
return new return new
{ {
...@@ -2979,7 +2980,8 @@ namespace Mall.Module.User ...@@ -2979,7 +2980,8 @@ namespace Mall.Module.User
{ {
CustomModel.CommissionTobePaidName, CustomModel.CommissionTobePaidName,
CustomModel.UserNotesName, CustomModel.UserNotesName,
CustomModel.IWantToWithdrawName CustomModel.IWantToWithdrawName,
baseModel.UserNotes
}, },
CommissionInfo = new CommissionInfo = new
{ {
......
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