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
7700990e
Commit
7700990e
authored
Apr 27, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
5a4223a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
2 deletions
+169
-2
RB_MiniProgram_Extend.cs
Mall.Model/Extend/User/RB_MiniProgram_Extend.cs
+3
-0
MiniProgramModule.cs
Mall.Module.User/MiniProgramModule.cs
+81
-1
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+84
-0
appsettings.json
Mall.WebApi/appsettings.json
+1
-1
No files found.
Mall.Model/Extend/User/RB_MiniProgram_Extend.cs
View file @
7700990e
...
...
@@ -61,6 +61,9 @@ namespace Mall.Model.Extend.User
}
}
/// <summary>
/// 底部导航列表
/// </summary>
public
List
<
RB_Miniprogram_Bottomnav_Extend
>
BottomTagList
{
get
;
set
;
}
}
}
Mall.Module.User/MiniProgramModule.cs
View file @
7700990e
...
...
@@ -14,7 +14,12 @@ namespace Mall.Module.User
/// <summary>
/// 商户仓储层对象
/// </summary>
private
Mall
.
Repository
.
User
.
RB_MiniProgramRepository
programRepository
=
new
Repository
.
User
.
RB_MiniProgramRepository
();
private
Mall
.
Repository
.
User
.
RB_MiniProgramRepository
programRepository
=
new
Repository
.
User
.
RB_MiniProgramRepository
();
/// <summary>
/// 底部导航仓储层对象
/// </summary>
private
Repository
.
User
.
RB_Miniprogram_BottomnavRepository
bottomnavRepository
=
new
Repository
.
User
.
RB_Miniprogram_BottomnavRepository
();
/// <summary>
...
...
@@ -93,11 +98,68 @@ namespace Mall.Module.User
extModel
.
CreateDate
=
DateTime
.
Now
;
int
NewId
=
programRepository
.
Insert
(
extModel
);
extModel
.
MallBaseId
=
NewId
;
if
(
extModel
.
BottomTagList
!=
null
)
{
SetMiniProgramMallTagModule
(
extModel
,
isUpdateBasic
:
false
);
}
flag
=
NewId
>
0
;
}
return
flag
;
}
/// <summary>
/// 设置顶部和底部导航配置
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetMiniProgramMallTagModule
(
RB_MiniProgram_Extend
extModel
,
bool
isUpdateBasic
=
true
)
{
bool
flag
=
false
;
if
(
extModel
.
MallBaseId
>
0
)
{
if
(
isUpdateBasic
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_MiniProgram_Extend
.
TopNavWordType
),
extModel
.
TopNavWordType
},
{
nameof
(
RB_MiniProgram_Extend
.
TopNavWordColor
),
extModel
.
TopNavWordColor
},
{
nameof
(
RB_MiniProgram_Extend
.
TopNavBgColor
),
extModel
.
TopNavBgColor
},
{
nameof
(
RB_MiniProgram_Extend
.
BottomNavBgColor
),
extModel
.
BottomNavBgColor
},
{
nameof
(
RB_MiniProgram_Extend
.
BottomNavIsShadow
),
extModel
.
BottomNavIsShadow
},
};
flag
=
programRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_MiniProgram_Extend
.
MallBaseId
),
extModel
.
MallBaseId
));
}
if
(
extModel
.
BottomTagList
!=
null
&&
extModel
.
BottomTagList
.
Count
>
0
)
{
foreach
(
var
item
in
extModel
.
BottomTagList
)
{
if
(
item
.
TagId
>
0
)
{
Dictionary
<
string
,
object
>
tagfileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
DefaultIcon
),
item
.
DefaultIcon
},
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
CheckedIcon
),
item
.
CheckedIcon
},
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
TagName
),
item
.
TagName
},
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
DefaultColor
),
item
.
DefaultColor
},
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
CheckedColor
),
item
.
CheckedColor
},
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
TagLink
),
item
.
TagLink
},
};
flag
=
bottomnavRepository
.
Update
(
tagfileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
TagId
),
item
.
TagId
));
}
else
{
item
.
MallBaseId
=
extModel
.
MallBaseId
;
item
.
TenantId
=
extModel
.
TenantId
;
item
.
Status
=
0
;
flag
=
bottomnavRepository
.
Insert
(
item
)
>
0
;
}
}
}
}
return
flag
;
}
/// <summary>
/// 修改小程序版权信息
/// </summary>
...
...
@@ -171,5 +233,23 @@ namespace Mall.Module.User
}
return
flag
;
}
/// <summary>
/// 删除小程序底部导航
/// </summary>
/// <param name="TagId"></param>
/// <returns></returns>
public
bool
RemoveMiniProgramMallTagModule
(
object
TagId
)
{
var
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
Status
),
1
},
};
flag
=
programRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Bottomnav_Extend
.
TagId
),
TagId
));
return
flag
;
}
}
}
Mall.WebApi/Controllers/User/TenantController.cs
View file @
7700990e
...
...
@@ -190,6 +190,64 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Failed
(
message
:
"只能创建"
+
createMiniPrograme
+
"个小程序"
);
}
extModel
.
TenantId
=
TenantId
;
if
(
extModel
.
MallBaseId
<=
0
)
{
extModel
.
BottomTagList
=
new
List
<
RB_Miniprogram_Bottomnav_Extend
>()
{
new
RB_Miniprogram_Bottomnav_Extend
()
{
TenantId
=
TenantId
,
DefaultIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-user.png"
,
CheckedIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-user.active.png"
,
CheckedColor
=
"rgb(255, 69, 68)"
,
DefaultColor
=
"rgb(136, 136, 136)"
,
Status
=
0
,
TagLink
=
""
,
TagName
=
"我"
,
TagId
=
0
,
MallBaseId
=
0
,
},
new
RB_Miniprogram_Bottomnav_Extend
()
{
TenantId
=
TenantId
,
DefaultIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-index.png"
,
CheckedIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-index.active.png"
,
CheckedColor
=
"rgb(255, 69, 68)"
,
DefaultColor
=
"rgb(136, 136, 136)"
,
Status
=
0
,
TagLink
=
""
,
TagName
=
"首页"
,
TagId
=
0
,
MallBaseId
=
0
,
},
new
RB_Miniprogram_Bottomnav_Extend
()
{
TenantId
=
TenantId
,
DefaultIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-cart.png"
,
CheckedIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-cart.active.png"
,
CheckedColor
=
"rgb(255, 69, 68)"
,
DefaultColor
=
"rgb(136, 136, 136)"
,
Status
=
0
,
TagLink
=
""
,
TagName
=
"购物车"
,
TagId
=
0
,
MallBaseId
=
0
,
},
new
RB_Miniprogram_Bottomnav_Extend
()
{
TenantId
=
TenantId
,
DefaultIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-cat.png"
,
CheckedIcon
=
Common
.
Config
.
GetOssFileUrl
+
"/Static/"
+
"nav-icon-cat.active.png"
,
CheckedColor
=
"rgb(255, 69, 68)"
,
DefaultColor
=
"rgb(136, 136, 136)"
,
Status
=
0
,
TagLink
=
""
,
TagName
=
"分类"
,
TagId
=
0
,
MallBaseId
=
0
,
},
};
}
var
flag
=
programModule
.
SetMiniProgramModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
...
...
@@ -226,6 +284,32 @@ namespace Mall.WebApi.Controllers.User
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 新增修改底部导航
/// </summary>
/// <returns></returns>
public
ApiResult
SetMiniProgramMallTag
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_MiniProgram_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
var
flag
=
programModule
.
SetMiniProgramMallTagModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除底部导航
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveMiniProgramMallTag
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
TagId
=
parms
.
GetInt
(
"TagId"
,
0
);
var
flag
=
programModule
.
RemoveMiniProgramMallTagModule
(
TagId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 根据小程序编号获取小程序信息
/// </summary>
...
...
Mall.WebApi/appsettings.json
View file @
7700990e
...
...
@@ -16,7 +16,7 @@
"AllowedHosts"
:
"*"
,
"OpenValidation"
:
"False"
,
"UploadSiteUrl"
:
"http://192.168.2.214:8120"
,
"ViewFileSiteUrl"
:
"http
://192.168.2.214:8130
"
,
"ViewFileSiteUrl"
:
"http
s://viitto-1301420277.cos.ap-chengdu.myqcloud.com
"
,
"ImKey"
:
"b612b31e837c79c68f141aeb719d2b20"
,
"ImSecret"
:
"66000451fb72"
,
"Mongo"
:
"mongodb://192.168.2.214:27017"
,
...
...
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