Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
f367d62e
Commit
f367d62e
authored
Jun 12, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分销海报
parent
890e8ef5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
8 deletions
+130
-8
RB_MiniProgram_GoodPoster_Extend.cs
Mall.Model/Extend/User/RB_MiniProgram_GoodPoster_Extend.cs
+53
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+44
-8
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+33
-0
No files found.
Mall.Model/Extend/User/RB_MiniProgram_GoodPoster_Extend.cs
View file @
f367d62e
...
...
@@ -13,5 +13,58 @@ namespace Mall.Model.Extend.User
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_MiniProgram_GoodPoster_Extend
:
Model
.
Entity
.
User
.
RB_MiniProgram_GoodPoster
{
/// <summary>
/// 海报样式
/// </summary>
public
List
<
int
>
PosterStyleList
{
get
{
List
<
int
>
posters
=
new
List
<
int
>();
if
(
this
.
PosterStyle
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
this
.
PosterStyle
))
{
var
array
=
this
.
PosterStyle
.
Split
(
","
);
if
(
array
!=
null
&&
array
.
Length
>
0
)
{
foreach
(
var
item
in
array
)
{
Int32
.
TryParse
(
item
,
out
int
presult
);
if
(
presult
>
0
)
{
posters
.
Add
(
presult
);
}
}
}
}
return
posters
;
}
}
/// <summary>
/// 商品样式
/// </summary>
public
List
<
int
>
GoodsImgCountList
{
get
{
List
<
int
>
goods
=
new
List
<
int
>();
if
(
this
.
GoodsImgCount
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
this
.
GoodsImgCount
))
{
var
array
=
this
.
GoodsImgCount
.
Split
(
","
);
if
(
array
!=
null
&&
array
.
Length
>
0
)
{
foreach
(
var
item
in
array
)
{
Int32
.
TryParse
(
item
,
out
int
result
);
if
(
result
>
0
)
{
goods
.
Add
(
result
);
}
}
}
}
return
goods
;
}
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
f367d62e
...
...
@@ -142,7 +142,10 @@ namespace Mall.Module.Product
/// </summary>
private
readonly
RB_Distributor_HPGradeRatioRepository
distributor_HPGradeRatioRepository
=
new
RB_Distributor_HPGradeRatioRepository
();
/// <summary>
/// 商品分销
/// </summary>
private
readonly
RB_MiniProgram_GoodPosterRepository
miniProgram_GoodPosterRepository
=
new
RB_MiniProgram_GoodPosterRepository
();
#
region
小程序接口
...
...
@@ -876,9 +879,31 @@ namespace Mall.Module.Product
string
QRPath
=
GetWeiXinQRCode
(
path
,
430
,
mallBaseId
);
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
var
goodsModel
=
goodsRepository
.
GetEntity
(
goodsId
);
//商品海报配置信息
var
config
=
new
object
();
//商品信息
var
info
=
new
object
();
var
goodsPoster
=
miniProgram_GoodPosterRepository
.
GetEntityExtRepository
(
new
RB_MiniProgram_GoodPoster_Extend
()
{
MallBaseId
=
mallBaseId
});
config
=
new
{
poster_style
=
goodsPoster
?.
PosterStyleList
??
new
List
<
int
>()
{
1
},
image_style
=
goodsPoster
?.
GoodsImgCountList
??
new
List
<
int
>()
{
1
},
color
=
new
List
<
string
>()
{
"#fc4a3b"
,
"#ff7b22"
,
"#ffc73f"
,
"#3e9b6a"
,
"#4bb1ff"
,
"#8548ef"
,
"#000000"
,
"#a0a0a0"
,
"#FFFFFF"
}
};
if
(
goodsModel
==
null
)
{
return
new
info
=
new
{
goods_name
=
""
,
multi_map
=
new
List
<
string
>(),
...
...
@@ -891,23 +916,28 @@ namespace Mall.Module.Product
sign
=
""
};
}
else
{
else
{
//商品图片处理
var
imgList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
goodsModel
.
CarouselImage
)
&&
goodsModel
.
CarouselImage
!=
"[]"
)
{
if
(!
string
.
IsNullOrEmpty
(
goodsModel
.
CarouselImage
)
&&
goodsModel
.
CarouselImage
!=
"[]"
)
{
imgList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
goodsModel
.
CarouselImage
);
}
if
(
imgList
.
Any
())
{
if
(
imgList
.
Count
()
<
8
)
{
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
++)
{
for
(
var
i
=
0
;
i
<
Num
+
1
;
i
++)
{
imgList2
.
AddRange
(
imgList
);
}
imgList
=
imgList2
.
Take
(
8
).
ToList
();
}
}
return
new
info
=
new
{
goods_name
=
goodsModel
.
Name
,
multi_map
=
imgList
,
...
...
@@ -920,6 +950,12 @@ namespace Mall.Module.Product
sign
=
""
};
}
var
obj
=
new
{
config
,
info
};
return
obj
;
}
#
region
获取小程序码
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
f367d62e
...
...
@@ -578,5 +578,38 @@ namespace Mall.WebApi.Controllers.MallBase
}
return
ApiResult
.
Success
(
data
:
openId
);
}
/// <summary>
/// 获取用户信息
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetGoosPoster
()
{
string
MiniAppId
=
""
;
try
{
//小程序Id
MiniAppId
=
RequestParm
.
MiniAppId
;
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Error
(
"GetGoosPoster"
,
ex
);
}
//获取小程序信息
var
miniProgram
=
new
RB_MiniProgram_Extend
();
if
(
MiniAppId
!=
null
&&
!
string
.
IsNullOrEmpty
(
MiniAppId
))
{
miniProgram
=
programModule
.
GetMiniProgramModule
(
new
Model
.
Extend
.
User
.
RB_MiniProgram_Extend
()
{
MiniAppId
=
MiniAppId
},
isGetHomeData
:
true
,
isGetNav
:
1
);
}
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
));
return
ApiResult
.
Success
(
data
:
obj
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment