refactor(account): 重构账户管理页面布局和样式

-精简HTML结构,优化`account.html`,`apple-card/account.html`,和`t-mall-game/account.html`中iframe的布局。
- 调整CSS样式,以增强用户界面的一致性和可读性。
- 优化`account_history.html`中的表格和搜索栏的样式与对齐。

fix(controller): 修正新增控制器参数顺序

- 修正`addController.go`中的参数顺序,确保交易类型正确传递给服务层。
- 更新数据库插入操作,确保UUID正确分配给新记录,防止SQL错误。
This commit is contained in:
danial
2024-09-04 09:54:18 +08:00
parent d51d72c49f
commit c3906e940e
61 changed files with 5849 additions and 5528 deletions

View File

@@ -1,35 +1,35 @@
appname = jhboss appname = jhboss
httpport = 12306 httpport = 12306
runmode = dev runmode = dev
HTTPAddr = localhost HTTPAddr = 0.0.0.0
sessionon = true sessionon = true
# sessionprovider = redis sessionprovider = redis
# sessiongcmaxlifetime = 86400 sessiongcmaxlifetime = 86400
# sessioncookielifetime = 86400 sessioncookielifetime = 86400
# sessionProviderConfig = 127.0.0.1:6379,100,astaxie sessionProviderConfig = redis:6379,100,astaxie
[mysql] [mysql]
dbhost = localhost dbhost = mysql
dbport = 3306 dbport = 3306
dbuser = root dbuser = root
dbpasswd = 123456 dbpasswd = 123456
dbbase = juhe_pay dbbase = kami
[redis] [redis]
host = localhost host = redis
port = 6379 port = 6379
password = '' password = ''
db = 10 db = 10
[gateway] [gateway]
host = http://localhost:12309/ host = http://kami_gateway:12309/
[portal] [portal]
host = http://localhost:5173 host = http://127.0.0.1:12400
[testExtraLink] [testExtraLink]
; 测试连接 ; 测试连接
host = http://localhost:12305 host = http://127.0.0.1:12305
[secret] [secret]
key = thisis32bitlongpassphraseimusing key = thisis32bitlongpassphraseimusing

View File

@@ -4,7 +4,7 @@ FROM golang:1.22 AS builder
ARG USE_PROXY ARG USE_PROXY
WORKDIR /build WORKDIR /build
COPY ./ /build/ COPY .. /build/
# 根据USE_PROXY参数设置环境变量 # 根据USE_PROXY参数设置环境变量
RUN if [ "$USE_PROXY" = "1" ]; then \ RUN if [ "$USE_PROXY" = "1" ]; then \
@@ -40,8 +40,9 @@ COPY --from=builder /build/main /app/
COPY --from=builder /build/conf/ /app/conf/ COPY --from=builder /build/conf/ /app/conf/
COPY --from=builder /build/views/ /app/views/ COPY --from=builder /build/views/ /app/views/
COPY --from=builder /build/static/ /app/static/ COPY --from=builder /build/static/ /app/static/
COPY --from=builder /build/deploy/wait-for-it.sh /app/
# 启动服务 # 启动服务
CMD ["./main"] CMD ["sh", "wait-for-it.sh", "mysql:3306" , "./main"]
EXPOSE 12306 EXPOSE 12306

View File

@@ -0,0 +1,19 @@
services:
boss_kami:
build:
context: ..
dockerfile: ./deploy/Dockerfile
args:
- USE_PROXY=1
container_name: kami_boss
image: kami_boss:latest
ports:
- "12306:12306"
networks:
- 1panel-network
labels:
createdBy: Developer
networks:
1panel-network:
external: true

View File

@@ -1,6 +1,8 @@
services: services:
kami_boss: kami_boss:
build: build:
context: ..
dockerfile: ./deploy/Dockerfile
args: args:
- USE_PROXY=1 - USE_PROXY=1
container_name: kami_boss container_name: kami_boss

19
deploy/wait-for-it.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# $1 = host to connect to (e.g. localhost)
# $2 = port to connect to (e.g. 3306)
# $3 = timeout in seconds, after which the script will exit with status 1 (optional)
# Example usage:
# wait-for-it.sh localhost:3306 -- /usr/bin/python app.py
#
set -x
host="${1%:*}"
port="${1#*:}"
shift
# shellcheck disable=SC2124
cmd="$@"
until nc -z "$host" "$port"; do
>&2 echo "Waiting for $host:$port to be available..."
sleep 1
done
>&2 echo "$host:$port is available!"
exec "$cmd"

View File

@@ -1,20 +0,0 @@
services:
web:
build:
context: .
container_name: kami_boss_test
image: kami_boss_test:0.11
restart: always
ports:
- "22306:12306"
volumes:
- /data/kami/boss/conf/:/app/conf/
- /data/kami/boss/logs/:/app/logs/
networks:
- 1panel-network
labels:
createdBy: Developer
networks:
1panel-network:
external: true

View File

@@ -2,12 +2,13 @@ package common
// 添加新的上游通道时,需要添加这里 // 添加新的上游通道时,需要添加这里
var supplierCode2Name = map[string]string{ var supplierCode2Name = map[string]string{
"KF": "快付支付", //"KF": "快付支付",
"WEIXIN": "官方微信", //"WEIXIN": "官方微信",
"ALIPAY": "官方支付宝", //"ALIPAY": "官方支付宝",
"DAILI": "代丽支付", //"DAILI": "代丽支付",
"APPLE": "苹果充值卡", "APPLE": "苹果充值卡",
"MF178": "蜜蜂178卡密", "MF178": "蜜蜂178卡密",
"TMALLGAME": "天猫游戏充值",
} }
func GetSupplierMap() map[string]string { func GetSupplierMap() map[string]string {

View File

@@ -5,7 +5,7 @@ import (
"boss/internal/datas" "boss/internal/datas"
"boss/internal/models/merchant" "boss/internal/models/merchant"
"boss/internal/models/payfor" "boss/internal/models/payfor"
road2 "boss/internal/models/road" "boss/internal/models/road"
"boss/internal/models/system" "boss/internal/models/system"
"boss/internal/service" "boss/internal/service"
"strconv" "strconv"
@@ -130,6 +130,7 @@ func (c *AddController) AddRoad() {
params := strings.TrimSpace(c.GetString("params")) params := strings.TrimSpace(c.GetString("params"))
productCode := strings.TrimSpace(c.GetString("productCode")) productCode := strings.TrimSpace(c.GetString("productCode"))
paymentHtml := strings.TrimSpace(c.GetString("paymentHtml")) paymentHtml := strings.TrimSpace(c.GetString("paymentHtml"))
transactionType := strings.TrimSpace(c.GetString("transactionType"))
se := new(service.AddService) se := new(service.AddService)
dataJSON := se.AddRoad( dataJSON := se.AddRoad(
@@ -148,8 +149,8 @@ func (c *AddController) AddRoad() {
params, params,
productCode, productCode,
paymentHtml, paymentHtml,
transactionType,
) )
c.GenerateJSON(dataJSON) c.GenerateJSON(dataJSON)
} }
@@ -307,8 +308,8 @@ func (c *AddController) AddMerchantPayType() {
merchantDeployInfo.LoanDays = i merchantDeployInfo.LoanDays = i
merchantDeployInfo.UnfreezeHour = j merchantDeployInfo.UnfreezeHour = j
merchantDeployInfo.RollRoadName = rollPoolRoad merchantDeployInfo.RollRoadName = rollPoolRoad
roadInfo := road2.GetRoadInfoByName(singleRoad) roadInfo := road.GetRoadInfoByName(singleRoad)
rollPoolInfo := road2.GetRoadPoolByName(rollPoolRoad) rollPoolInfo := road.GetRoadPoolByName(rollPoolRoad)
merchantDeployInfo.SingleRoadUid = roadInfo.RoadUid merchantDeployInfo.SingleRoadUid = roadInfo.RoadUid
merchantDeployInfo.RollRoadCode = rollPoolInfo.RoadPoolCode merchantDeployInfo.RollRoadCode = rollPoolInfo.RoadPoolCode
merchantDeployInfo.CreateTime = time.Now() merchantDeployInfo.CreateTime = time.Now()

View File

@@ -1,16 +1,16 @@
package controllers package controllers
import ( import (
common2 "boss/internal/common" "boss/internal/common"
"boss/internal/datas" "boss/internal/datas"
accounts2 "boss/internal/models/accounts" "boss/internal/models/accounts"
"boss/internal/models/agent" "boss/internal/models/agent"
merchant2 "boss/internal/models/merchant" "boss/internal/models/merchant"
"boss/internal/models/notify" "boss/internal/models/notify"
order2 "boss/internal/models/order" "boss/internal/models/order"
"boss/internal/models/payfor" "boss/internal/models/payfor"
road2 "boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
"boss/internal/service" "boss/internal/service"
"fmt" "fmt"
@@ -67,7 +67,7 @@ func (c *GetController) GetMenu() {
params := make(map[string]string) params := make(map[string]string)
params["first_menu__icontains"] = firstMenuSearch params["first_menu__icontains"] = firstMenuSearch
c.GetCutPage(system2.GetMenuLenByMap(params)) c.GetCutPage(system.GetMenuLenByMap(params))
menuDataJSON := new(datas.MenuDataJSON) menuDataJSON := new(datas.MenuDataJSON)
menuDataJSON.DisplayCount = c.DisplayCount menuDataJSON.DisplayCount = c.DisplayCount
@@ -76,15 +76,15 @@ func (c *GetController) GetMenu() {
if c.Offset < 0 { if c.Offset < 0 {
menuDataJSON.Code = -1 menuDataJSON.Code = -1
menuDataJSON.MenuList = make([]system2.MenuInfo, 0) menuDataJSON.MenuList = make([]system.MenuInfo, 0)
c.GenerateJSON(menuDataJSON) c.GenerateJSON(menuDataJSON)
return return
} }
menuInfoList := system2.GetMenuOffsetByMap(params, c.DisplayCount, c.Offset) menuInfoList := system.GetMenuOffsetByMap(params, c.DisplayCount, c.Offset)
sort.Sort(system2.MenuInfoSlice(menuInfoList)) sort.Sort(system.MenuInfoSlice(menuInfoList))
for i, m := range menuInfoList { for i, m := range menuInfoList {
secondMenuInfoList := system2.GetSecondMenuListByFirstMenuUid(m.MenuUid) secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(m.MenuUid)
smenus := "" smenus := ""
for j := 0; j < len(secondMenuInfoList); j++ { for j := 0; j < len(secondMenuInfoList); j++ {
smenus += secondMenuInfoList[j].SecondMenu smenus += secondMenuInfoList[j].SecondMenu
@@ -108,14 +108,14 @@ func (c *GetController) GetMenu() {
func (c *GetController) GetFirstMenu() { func (c *GetController) GetFirstMenu() {
menuDataJSON := new(datas.MenuDataJSON) menuDataJSON := new(datas.MenuDataJSON)
menuList := system2.GetMenuAll() menuList := system.GetMenuAll()
if len(menuList) == 0 { if len(menuList) == 0 {
menuDataJSON.Code = -1 menuDataJSON.Code = -1
} else { } else {
menuDataJSON.Code = 200 menuDataJSON.Code = 200
} }
sort.Sort(system2.MenuInfoSlice(menuList)) sort.Sort(system.MenuInfoSlice(menuList))
menuDataJSON.MenuList = menuList menuDataJSON.MenuList = menuList
c.GenerateJSON(menuDataJSON) c.GenerateJSON(menuDataJSON)
} }
@@ -129,7 +129,7 @@ func (c *GetController) GetSecondMenu() {
params := make(map[string]string) params := make(map[string]string)
params["first_menu__icontains"] = firstMenuSearch params["first_menu__icontains"] = firstMenuSearch
params["second_menu__icontains"] = secondMenuSearch params["second_menu__icontains"] = secondMenuSearch
l := system2.GetSecondMenuLenByMap(params) l := system.GetSecondMenuLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
@@ -141,13 +141,13 @@ func (c *GetController) GetSecondMenu() {
secondMenuDataJSON.TotalPage = c.TotalPage secondMenuDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
secondMenuDataJSON.SecondMenuList = make([]system2.SecondMenuInfo, 0) secondMenuDataJSON.SecondMenuList = make([]system.SecondMenuInfo, 0)
c.GenerateJSON(secondMenuDataJSON) c.GenerateJSON(secondMenuDataJSON)
return return
} }
secondMenuList := system2.GetSecondMenuByMap(params, c.DisplayCount, c.Offset) secondMenuList := system.GetSecondMenuByMap(params, c.DisplayCount, c.Offset)
sort.Sort(system2.SecondMenuSlice(secondMenuList)) sort.Sort(system.SecondMenuSlice(secondMenuList))
secondMenuDataJSON.SecondMenuList = secondMenuList secondMenuDataJSON.SecondMenuList = secondMenuList
secondMenuDataJSON.StartIndex = c.Offset secondMenuDataJSON.StartIndex = c.Offset
@@ -163,7 +163,7 @@ func (c *GetController) GetSecondMenus() {
secondMenuDataJSON := new(datas.SecondMenuDataJSON) secondMenuDataJSON := new(datas.SecondMenuDataJSON)
secondMenuList := system2.GetSecondMenuListByFirstMenuUid(firstMenuUid) secondMenuList := system.GetSecondMenuListByFirstMenuUid(firstMenuUid)
secondMenuDataJSON.Code = 200 secondMenuDataJSON.Code = 200
secondMenuDataJSON.SecondMenuList = secondMenuList secondMenuDataJSON.SecondMenuList = secondMenuList
@@ -174,12 +174,12 @@ func (c *GetController) GetOneMenu() {
menuUid := c.GetString("menuUid") menuUid := c.GetString("menuUid")
dataJSON := new(datas.MenuDataJSON) dataJSON := new(datas.MenuDataJSON)
menuInfo := system2.GetMenuInfoByMenuUid(menuUid) menuInfo := system.GetMenuInfoByMenuUid(menuUid)
if menuInfo.MenuUid == "" { if menuInfo.MenuUid == "" {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "该菜单项不存在" dataJSON.Msg = "该菜单项不存在"
} else { } else {
dataJSON.MenuList = make([]system2.MenuInfo, 0) dataJSON.MenuList = make([]system.MenuInfo, 0)
dataJSON.MenuList = append(dataJSON.MenuList, menuInfo) dataJSON.MenuList = append(dataJSON.MenuList, menuInfo)
dataJSON.Code = 200 dataJSON.Code = 200
} }
@@ -195,7 +195,7 @@ func (c *GetController) GetPowerItem() {
params["power_uid__icontains"] = powerID params["power_uid__icontains"] = powerID
params["power_item_icontains"] = powerItem params["power_item_icontains"] = powerItem
l := system2.GetPowerItemLenByMap(params) l := system.GetPowerItemLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
@@ -206,14 +206,14 @@ func (c *GetController) GetPowerItem() {
powerItemDataJSON.TotalPage = c.TotalPage powerItemDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
powerItemDataJSON.PowerItemList = make([]system2.PowerInfo, 0) powerItemDataJSON.PowerItemList = make([]system.PowerInfo, 0)
c.GenerateJSON(powerItemDataJSON) c.GenerateJSON(powerItemDataJSON)
return return
} }
powerItemDataJSON.StartIndex = c.Offset powerItemDataJSON.StartIndex = c.Offset
powerItemList := system2.GetPowerItemByMap(params, c.DisplayCount, c.Offset) powerItemList := system.GetPowerItemByMap(params, c.DisplayCount, c.Offset)
sort.Sort(system2.PowerInfoSlice(powerItemList)) sort.Sort(system.PowerInfoSlice(powerItemList))
powerItemDataJSON.PowerItemList = powerItemList powerItemDataJSON.PowerItemList = powerItemList
c.GenerateJSON(powerItemDataJSON) c.GenerateJSON(powerItemDataJSON)
@@ -225,7 +225,7 @@ func (c *GetController) GetRole() {
params := make(map[string]string) params := make(map[string]string)
params["role_name__icontains"] = roleName params["role_name__icontains"] = roleName
l := system2.GetRoleLenByMap(params) l := system.GetRoleLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
@@ -236,18 +236,18 @@ func (c *GetController) GetRole() {
roleInfoDataJSON.TotalPage = c.TotalPage roleInfoDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
roleInfoDataJSON.RoleInfoList = make([]system2.RoleInfo, 0) roleInfoDataJSON.RoleInfoList = make([]system.RoleInfo, 0)
c.GenerateJSON(roleInfoDataJSON) c.GenerateJSON(roleInfoDataJSON)
return return
} }
roleInfoDataJSON.StartIndex = c.Offset roleInfoDataJSON.StartIndex = c.Offset
roleInfoDataJSON.RoleInfoList = system2.GetRoleByMap(params, c.DisplayCount, c.Offset) roleInfoDataJSON.RoleInfoList = system.GetRoleByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(roleInfoDataJSON) c.GenerateJSON(roleInfoDataJSON)
} }
func (c *GetController) GetAllRole() { func (c *GetController) GetAllRole() {
roleInfoDataJSON := new(datas.RoleInfoDataJSON) roleInfoDataJSON := new(datas.RoleInfoDataJSON)
roleInfoList := system2.GetRole() roleInfoList := system.GetRole()
fmt.Println(roleInfoList) fmt.Println(roleInfoList)
if len(roleInfoList) == 0 { if len(roleInfoList) == 0 {
roleInfoDataJSON.Code = -1 roleInfoDataJSON.Code = -1
@@ -260,13 +260,13 @@ func (c *GetController) GetAllRole() {
func (c *GetController) GetDeployTree() { func (c *GetController) GetDeployTree() {
roleUid := strings.TrimSpace(c.GetString("roleUid")) roleUid := strings.TrimSpace(c.GetString("roleUid"))
roleInfo := system2.GetRoleByRoleUid(roleUid) roleInfo := system.GetRoleByRoleUid(roleUid)
allFirstMenu := system2.GetMenuAll() allFirstMenu := system.GetMenuAll()
sort.Sort(system2.MenuInfoSlice(allFirstMenu)) sort.Sort(system.MenuInfoSlice(allFirstMenu))
allSecondMenu := system2.GetSecondMenuList() allSecondMenu := system.GetSecondMenuList()
sort.Sort(system2.SecondMenuSlice(allSecondMenu)) sort.Sort(system.SecondMenuSlice(allSecondMenu))
allPower := system2.GetPower() allPower := system.GetPower()
deployTreeJSON := new(datas.DeployTreeJSON) deployTreeJSON := new(datas.DeployTreeJSON)
deployTreeJSON.Code = 200 deployTreeJSON.Code = 200
@@ -336,7 +336,7 @@ func (c *GetController) GetEditOperator() {
userInfo := user.GetUserInfoByUserID(userId) userInfo := user.GetUserInfoByUserID(userId)
fmt.Println(userInfo) fmt.Println(userInfo)
editOperatorDataJSON.OperatorList = append(editOperatorDataJSON.OperatorList, userInfo) editOperatorDataJSON.OperatorList = append(editOperatorDataJSON.OperatorList, userInfo)
editOperatorDataJSON.RoleList = system2.GetRole() editOperatorDataJSON.RoleList = system.GetRole()
editOperatorDataJSON.Code = 200 editOperatorDataJSON.Code = 200
c.GenerateJSON(editOperatorDataJSON) c.GenerateJSON(editOperatorDataJSON)
@@ -347,7 +347,7 @@ func (c *GetController) GetBankCard() {
params := make(map[string]string) params := make(map[string]string)
params["account_name__icontains"] = accountNameSearch params["account_name__icontains"] = accountNameSearch
l := system2.GetBankCardLenByMap(params) l := system.GetBankCardLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
bankCardDataJSON := new(datas.BankCardDataJSON) bankCardDataJSON := new(datas.BankCardDataJSON)
@@ -357,19 +357,19 @@ func (c *GetController) GetBankCard() {
bankCardDataJSON.TotalPage = c.TotalPage bankCardDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
bankCardDataJSON.BankCardInfoList = make([]system2.BankCardInfo, 0) bankCardDataJSON.BankCardInfoList = make([]system.BankCardInfo, 0)
c.GenerateJSON(bankCardDataJSON) c.GenerateJSON(bankCardDataJSON)
return return
} }
bankCardDataJSON.StartIndex = c.Offset bankCardDataJSON.StartIndex = c.Offset
bankCardDataJSON.BankCardInfoList = system2.GetBankCardByMap(params, c.DisplayCount, c.Offset) bankCardDataJSON.BankCardInfoList = system.GetBankCardByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(bankCardDataJSON) c.GenerateJSON(bankCardDataJSON)
} }
func (c *GetController) GetOneBankCard() { func (c *GetController) GetOneBankCard() {
uid := strings.TrimSpace(c.GetString("uid")) uid := strings.TrimSpace(c.GetString("uid"))
bankCardInfo := system2.GetBankCardByUid(uid) bankCardInfo := system.GetBankCardByUid(uid)
bankCardDataJSON := new(datas.BankCardDataJSON) bankCardDataJSON := new(datas.BankCardDataJSON)
bankCardDataJSON.Code = -1 bankCardDataJSON.Code = -1
@@ -396,7 +396,7 @@ func (c *GetController) GetRoad() {
params["road_uid"] = roadUid params["road_uid"] = roadUid
params["pay_type"] = payType params["pay_type"] = payType
l := road2.GetRoadLenByMap(params) l := road.GetRoadLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
roadDataJSON := new(datas.RoadDataJSON) roadDataJSON := new(datas.RoadDataJSON)
@@ -406,14 +406,14 @@ func (c *GetController) GetRoad() {
roadDataJSON.TotalPage = c.TotalPage roadDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
roadDataJSON.RoadInfoList = make([]road2.RoadInfo, 0) roadDataJSON.RoadInfoList = make([]road.RoadInfo, 0)
c.GenerateJSON(roadDataJSON) c.GenerateJSON(roadDataJSON)
return return
} }
roadDataJSON.StartIndex = c.Offset roadDataJSON.StartIndex = c.Offset
roadDataJSON.RoadInfoList = road2.GetRoadInfoByMap(params, c.DisplayCount, c.Offset) roadDataJSON.RoadInfoList = road.GetRoadInfoByMap(params, c.DisplayCount, c.Offset)
roadDataJSON.RoadPool = road2.GetRoadPoolByRoadPoolCode(roadPoolCode) roadDataJSON.RoadPool = road.GetRoadPoolByRoadPoolCode(roadPoolCode)
c.GenerateJSON(roadDataJSON) c.GenerateJSON(roadDataJSON)
} }
@@ -423,7 +423,7 @@ func (c *GetController) GetAllRoad() {
params["road_name__icontains"] = roadName params["road_name__icontains"] = roadName
roadDataJSON := new(datas.RoadDataJSON) roadDataJSON := new(datas.RoadDataJSON)
roadInfoList := road2.GetAllRoad(params) roadInfoList := road.GetAllRoad(params)
roadDataJSON.Code = 200 roadDataJSON.Code = 200
roadDataJSON.RoadInfoList = roadInfoList roadDataJSON.RoadInfoList = roadInfoList
@@ -434,7 +434,7 @@ func (c *GetController) GetAllRoad() {
func (c *GetController) GetOneRoad() { func (c *GetController) GetOneRoad() {
roadUid := strings.TrimSpace(c.GetString("roadUid")) roadUid := strings.TrimSpace(c.GetString("roadUid"))
roadInfo := road2.GetRoadInfoByRoadUid(roadUid) roadInfo := road.GetRoadInfoByRoadUid(roadUid)
roadDataJSON := new(datas.RoadDataJSON) roadDataJSON := new(datas.RoadDataJSON)
roadDataJSON.Code = -1 roadDataJSON.Code = -1
@@ -442,7 +442,7 @@ func (c *GetController) GetOneRoad() {
roadDataJSON.RoadInfoList = append(roadDataJSON.RoadInfoList, roadInfo) roadDataJSON.RoadInfoList = append(roadDataJSON.RoadInfoList, roadInfo)
roadDataJSON.Code = 200 roadDataJSON.Code = 200
} else { } else {
roadDataJSON.RoadInfoList = make([]road2.RoadInfo, 0) roadDataJSON.RoadInfoList = make([]road.RoadInfo, 0)
} }
c.GenerateJSON(roadDataJSON) c.GenerateJSON(roadDataJSON)
@@ -456,7 +456,7 @@ func (c *GetController) GetRoadPool() {
params["road_pool_name__icontains"] = roadPoolName params["road_pool_name__icontains"] = roadPoolName
params["road_pool_code__icontains"] = roadPoolCode params["road_pool_code__icontains"] = roadPoolCode
l := road2.GetRoadPoolLenByMap(params) l := road.GetRoadPoolLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
roadPoolDataJSON := new(datas.RoadPoolDataJSON) roadPoolDataJSON := new(datas.RoadPoolDataJSON)
@@ -466,13 +466,13 @@ func (c *GetController) GetRoadPool() {
roadPoolDataJSON.TotalPage = c.TotalPage roadPoolDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
roadPoolDataJSON.RoadPoolInfoList = make([]road2.RoadPoolInfo, 0) roadPoolDataJSON.RoadPoolInfoList = make([]road.RoadPoolInfo, 0)
c.GenerateJSON(roadPoolDataJSON) c.GenerateJSON(roadPoolDataJSON)
return return
} }
roadPoolDataJSON.StartIndex = c.Offset roadPoolDataJSON.StartIndex = c.Offset
roadPoolDataJSON.RoadPoolInfoList = road2.GetRoadPoolByMap(params, c.DisplayCount, c.Offset) roadPoolDataJSON.RoadPoolInfoList = road.GetRoadPoolByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(roadPoolDataJSON) c.GenerateJSON(roadPoolDataJSON)
} }
@@ -483,7 +483,7 @@ func (c *GetController) GetAllRollPool() {
roadPoolDataJSON := new(datas.RoadPoolDataJSON) roadPoolDataJSON := new(datas.RoadPoolDataJSON)
roadPoolDataJSON.Code = 200 roadPoolDataJSON.Code = 200
roadPoolDataJSON.RoadPoolInfoList = road2.GetAllRollPool(params) roadPoolDataJSON.RoadPoolInfoList = road.GetAllRollPool(params)
c.GenerateJSON(roadPoolDataJSON) c.GenerateJSON(roadPoolDataJSON)
} }
@@ -495,7 +495,7 @@ func (c *GetController) GetMerchant() {
params["merchant_name__icontains"] = merchantName params["merchant_name__icontains"] = merchantName
params["merchant_uid__icontains"] = merchantNo params["merchant_uid__icontains"] = merchantNo
l := merchant2.GetMerchantLenByMap(params) l := merchant.GetMerchantLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
merchantDataJSON := new(datas.MerchantDataJSON) merchantDataJSON := new(datas.MerchantDataJSON)
@@ -505,20 +505,20 @@ func (c *GetController) GetMerchant() {
merchantDataJSON.TotalPage = c.TotalPage merchantDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
merchantDataJSON.MerchantList = make([]merchant2.MerchantInfo, 0) merchantDataJSON.MerchantList = make([]merchant.MerchantInfo, 0)
c.GenerateJSON(merchantDataJSON) c.GenerateJSON(merchantDataJSON)
return return
} }
merchantDataJSON.StartIndex = c.Offset merchantDataJSON.StartIndex = c.Offset
merchantDataJSON.MerchantList = merchant2.GetMerchantListByMap(params, c.DisplayCount, c.Offset) merchantDataJSON.MerchantList = merchant.GetMerchantListByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(merchantDataJSON) c.GenerateJSON(merchantDataJSON)
} }
func (c *GetController) GetAllMerchant() { func (c *GetController) GetAllMerchant() {
merchantDataJSON := new(datas.MerchantDataJSON) merchantDataJSON := new(datas.MerchantDataJSON)
merchantDataJSON.Code = 200 merchantDataJSON.Code = 200
merchantDataJSON.MerchantList = merchant2.GetAllMerchant() merchantDataJSON.MerchantList = merchant.GetAllMerchant()
c.GenerateJSON(merchantDataJSON) c.GenerateJSON(merchantDataJSON)
} }
@@ -532,7 +532,7 @@ func (c *GetController) GetOneMerchant() {
return return
} }
merchantInfo := merchant2.GetMerchantByUid(merchantUid) merchantInfo := merchant.GetMerchantByUid(merchantUid)
merchantDataJSON.Code = 200 merchantDataJSON.Code = 200
merchantDataJSON.MerchantList = append(merchantDataJSON.MerchantList, merchantInfo) merchantDataJSON.MerchantList = append(merchantDataJSON.MerchantList, merchantInfo)
@@ -545,7 +545,7 @@ func (c *GetController) GetOneMerchantDeploy() {
merchantDeployDataJSON := new(datas.MerchantDeployDataJSON) merchantDeployDataJSON := new(datas.MerchantDeployDataJSON)
merchantDeployInfo := merchant2.GetMerchantDeployByUidAndPayType(merchantNo, payType) merchantDeployInfo := merchant.GetMerchantDeployByUidAndPayType(merchantNo, payType)
if merchantDeployInfo.Status == "active" { if merchantDeployInfo.Status == "active" {
merchantDeployDataJSON.Code = 200 merchantDeployDataJSON.Code = 200
@@ -562,7 +562,7 @@ func (c *GetController) GetAllAccount() {
accountDataJSON := new(datas.AccountDataJSON) accountDataJSON := new(datas.AccountDataJSON)
accountDataJSON.Code = 200 accountDataJSON.Code = 200
accountDataJSON.AccountList = accounts2.GetAllAccount() accountDataJSON.AccountList = accounts.GetAllAccount()
c.GenerateJSON(accountDataJSON) c.GenerateJSON(accountDataJSON)
} }
@@ -575,7 +575,7 @@ func (c *GetController) GetAccount() {
params["account_name__icontains"] = accountName params["account_name__icontains"] = accountName
params["account_uid_icontains"] = accountUid params["account_uid_icontains"] = accountUid
l := accounts2.GetAccountLenByMap(params) l := accounts.GetAccountLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
accountDataJSON := new(datas.AccountDataJSON) accountDataJSON := new(datas.AccountDataJSON)
@@ -585,13 +585,13 @@ func (c *GetController) GetAccount() {
accountDataJSON.TotalPage = c.TotalPage accountDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
accountDataJSON.AccountList = make([]accounts2.AccountInfo, 0) accountDataJSON.AccountList = make([]accounts.AccountInfo, 0)
c.GenerateJSON(accountDataJSON) c.GenerateJSON(accountDataJSON)
return return
} }
accountDataJSON.StartIndex = c.Offset accountDataJSON.StartIndex = c.Offset
accountDataJSON.AccountList = accounts2.GetAccountByMap(params, c.DisplayCount, c.Offset) accountDataJSON.AccountList = accounts.GetAccountByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(accountDataJSON) c.GenerateJSON(accountDataJSON)
} }
@@ -601,7 +601,7 @@ func (c *GetController) GetOneAccount() {
//new一个accountDataJSON结构体对象用来做jsonp返回 //new一个accountDataJSON结构体对象用来做jsonp返回
accountDataJSON := new(datas.AccountDataJSON) accountDataJSON := new(datas.AccountDataJSON)
//用accountuid作为过滤字段从数据库中读取一条信息 //用accountuid作为过滤字段从数据库中读取一条信息
accountInfo := accounts2.GetAccountByUid(accountUid) accountInfo := accounts.GetAccountByUid(accountUid)
//code初始值为200 //code初始值为200
accountDataJSON.Code = 200 accountDataJSON.Code = 200
//将从数据库读出来的数据插入到accountList数组中 //将从数据库读出来的数据插入到accountList数组中
@@ -619,13 +619,13 @@ func (c *GetController) GetAccountHistory() {
switch operatorType { switch operatorType {
case "plus-amount": case "plus-amount":
operatorType = common2.PLUS_AMOUNT operatorType = common.PLUS_AMOUNT
case "sub-amount": case "sub-amount":
operatorType = common2.SUB_AMOUNT operatorType = common.SUB_AMOUNT
case "freeze-amount": case "freeze-amount":
operatorType = common2.FREEZE_AMOUNT operatorType = common.FREEZE_AMOUNT
case "unfreeze-amount": case "unfreeze-amount":
operatorType = common2.UNFREEZE_AMOUNT operatorType = common.UNFREEZE_AMOUNT
} }
params := make(map[string]string) params := make(map[string]string)
params["account_name__icontains"] = accountName params["account_name__icontains"] = accountName
@@ -634,7 +634,7 @@ func (c *GetController) GetAccountHistory() {
params["create_time__gte"] = startTime params["create_time__gte"] = startTime
params["create_time__lte"] = endTime params["create_time__lte"] = endTime
l := accounts2.GetAccountHistoryLenByMap(params) l := accounts.GetAccountHistoryLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
accountHistoryDataJSON := new(datas.AccountHistoryDataJSON) accountHistoryDataJSON := new(datas.AccountHistoryDataJSON)
@@ -644,13 +644,13 @@ func (c *GetController) GetAccountHistory() {
accountHistoryDataJSON.TotalPage = c.TotalPage accountHistoryDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
accountHistoryDataJSON.AccountHistoryList = make([]accounts2.AccountHistoryInfo, 0) accountHistoryDataJSON.AccountHistoryList = make([]accounts.AccountHistoryInfo, 0)
c.GenerateJSON(accountHistoryDataJSON) c.GenerateJSON(accountHistoryDataJSON)
return return
} }
accountHistoryDataJSON.StartIndex = c.Offset accountHistoryDataJSON.StartIndex = c.Offset
accountHistoryDataJSON.AccountHistoryList = accounts2.GetAccountHistoryByMap(params, c.DisplayCount, c.Offset) accountHistoryDataJSON.AccountHistoryList = accounts.GetAccountHistoryByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(accountHistoryDataJSON) c.GenerateJSON(accountHistoryDataJSON)
} }
@@ -692,7 +692,7 @@ func (c *GetController) GetAllAgent() {
} }
func (c *GetController) GetProduct() { func (c *GetController) GetProduct() {
supplierCode2Name := common2.GetSupplierMap() supplierCode2Name := common.GetSupplierMap()
productDataJSON := new(datas.ProductDataJSON) productDataJSON := new(datas.ProductDataJSON)
productDataJSON.Code = 200 productDataJSON.Code = 200
productDataJSON.ProductMap = supplierCode2Name productDataJSON.ProductMap = supplierCode2Name
@@ -707,7 +707,7 @@ func (c *GetController) GetAgentToMerchant() {
params["belong_agent_uid"] = agentUid params["belong_agent_uid"] = agentUid
params["merchant_uid"] = merchantUid params["merchant_uid"] = merchantUid
l := merchant2.GetMerchantLenByParams(params) l := merchant.GetMerchantLenByParams(params)
c.GetCutPage(l) c.GetCutPage(l)
merchantDataJSON := new(datas.MerchantDataJSON) merchantDataJSON := new(datas.MerchantDataJSON)
@@ -717,9 +717,9 @@ func (c *GetController) GetAgentToMerchant() {
merchantDataJSON.TotalPage = c.TotalPage merchantDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
merchantDataJSON.MerchantList = make([]merchant2.MerchantInfo, 0) merchantDataJSON.MerchantList = make([]merchant.MerchantInfo, 0)
} else { } else {
merchantDataJSON.MerchantList = merchant2.GetMerchantByParams(params, c.DisplayCount, c.Offset) merchantDataJSON.MerchantList = merchant.GetMerchantByParams(params, c.DisplayCount, c.Offset)
} }
c.GenerateJSON(merchantDataJSON) c.GenerateJSON(merchantDataJSON)
@@ -758,7 +758,7 @@ func (c *GetController) GetOrder() {
case "refund": case "refund":
params["refund"] = "yes" params["refund"] = "yes"
} }
l := order2.GetOrderLenByMap(params) l := order.GetOrderLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
orderDataJSON := new(datas.OrderDataJSON) orderDataJSON := new(datas.OrderDataJSON)
orderDataJSON.DisplayCount = c.DisplayCount orderDataJSON.DisplayCount = c.DisplayCount
@@ -766,17 +766,17 @@ func (c *GetController) GetOrder() {
orderDataJSON.CurrentPage = c.CurrentPage orderDataJSON.CurrentPage = c.CurrentPage
orderDataJSON.TotalPage = c.TotalPage orderDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
orderDataJSON.OrderList = make([]order2.OrderInfo, 0) orderDataJSON.OrderList = make([]order.OrderInfo, 0)
c.GenerateJSON(orderDataJSON) c.GenerateJSON(orderDataJSON)
return return
} }
orderDataJSON.StartIndex = c.Offset orderDataJSON.StartIndex = c.Offset
orderDataJSON.OrderList = order2.GetOrderByMap(params, c.DisplayCount, c.Offset) orderDataJSON.OrderList = order.GetOrderByMap(params, c.DisplayCount, c.Offset)
// orderDataJSON.OrderProfitSummary = order.ProfitSummary{ // orderDataJSON.OrderProfitSummary = order.ProfitSummary{
// TotalProfit: service.QueryTotalSummary(params), // TotalProfit: service.QueryTotalSummary(params),
// TodayProfit: service.QueryTodaySummary(params), // TodayProfit: service.QueryTodaySummary(params),
// } // }
params["status"] = common2.OrderStatusSuccess params["status"] = common.OrderStatusSuccess
c.GenerateJSON(orderDataJSON) c.GenerateJSON(orderDataJSON)
} }
@@ -813,15 +813,15 @@ func (c *GetController) GetOrderSummary() {
case "refund": case "refund":
params["refund"] = "yes" params["refund"] = "yes"
} }
l := order2.GetOrderLenByMap(params) l := order.GetOrderLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
orderDataJSON := new(datas.OrderDataSummaryJSON) orderDataJSON := new(datas.OrderDataSummaryJSON)
// orderDataJSON.OrderList = order.GetOrderByMap(params, c.DisplayCount, c.Offset) // orderDataJSON.OrderList = order.GetOrderByMap(params, c.DisplayCount, c.Offset)
orderDataJSON.OrderProfitSummary = order2.ProfitSummary{ orderDataJSON.OrderProfitSummary = order.ProfitSummary{
TotalProfit: service.QueryTotalSummary(params), TotalProfit: service.QueryTotalSummary(params),
TodayProfit: service.QueryTodaySummary(params), TodayProfit: service.QueryTodaySummary(params),
} }
params["status"] = common2.OrderStatusSuccess params["status"] = common.OrderStatusSuccess
c.GenerateJSON(orderDataJSON) c.GenerateJSON(orderDataJSON)
} }
@@ -829,7 +829,7 @@ func (c *GetController) GetOrderSummary() {
func (c *GetController) GetOneOrder() { func (c *GetController) GetOneOrder() {
bankOrderId := strings.TrimSpace(c.GetString("bankOrderId")) bankOrderId := strings.TrimSpace(c.GetString("bankOrderId"))
orderDataJSON := new(datas.OrderDataJSON) orderDataJSON := new(datas.OrderDataJSON)
orderInfo := order2.GetOneOrder(bankOrderId) orderInfo := order.GetOneOrder(bankOrderId)
orderDataJSON.Code = 200 orderDataJSON.Code = 200
orderDataJSON.OrderList = append(orderDataJSON.OrderList, orderInfo) orderDataJSON.OrderList = append(orderDataJSON.OrderList, orderInfo)
@@ -862,7 +862,7 @@ func (c *GetController) GetOrderProfit() {
params["status"] = status params["status"] = status
params["pay_product_code"] = supplierUid params["pay_product_code"] = supplierUid
params["pay_type_code"] = payWayCode params["pay_type_code"] = payWayCode
orderList := order2.GetAllOrderByMap(map[string]string{"road_uid": roadUid}) orderList := order.GetAllOrderByMap(map[string]string{"road_uid": roadUid})
if len(orderList) > 0 { if len(orderList) > 0 {
orderIDList := make([]string, len(orderList)) orderIDList := make([]string, len(orderList))
for _, info := range orderList { for _, info := range orderList {
@@ -870,7 +870,7 @@ func (c *GetController) GetOrderProfit() {
} }
params["bank_order_id__in"] = orderIDList params["bank_order_id__in"] = orderIDList
} }
l := order2.GetOrderProfitLenByMap(params) l := order.GetOrderProfitLenByMap(params)
c.GetCutPage(l) c.GetCutPage(l)
listDataJSON := new(datas.ListDataJSON) listDataJSON := new(datas.ListDataJSON)
@@ -880,13 +880,13 @@ func (c *GetController) GetOrderProfit() {
listDataJSON.TotalPage = c.TotalPage listDataJSON.TotalPage = c.TotalPage
if c.Offset < 0 { if c.Offset < 0 {
listDataJSON.List = make([]order2.OrderProfitInfo, 0) listDataJSON.List = make([]order.OrderProfitInfo, 0)
c.GenerateJSON(listDataJSON) c.GenerateJSON(listDataJSON)
return return
} }
listDataJSON.StartIndex = c.Offset listDataJSON.StartIndex = c.Offset
listDataJSON.List = order2.GetOrderProfitByMap(params, c.DisplayCount, c.Offset) listDataJSON.List = order.GetOrderProfitByMap(params, c.DisplayCount, c.Offset)
c.GenerateJSON(listDataJSON) c.GenerateJSON(listDataJSON)
} }
@@ -1013,7 +1013,7 @@ func (c *GetController) GetProfit() {
profitListJSON := new(datas.ProfitListJSON) profitListJSON := new(datas.ProfitListJSON)
profitListJSON.Code = 200 profitListJSON.Code = 200
profitListJSON.ProfitList = order2.GetPlatformProfitByMap(params) profitListJSON.ProfitList = order.GetPlatformProfitByMap(params)
profitListJSON.TotalAmount = 0.00 profitListJSON.TotalAmount = 0.00
profitListJSON.PlatformTotalProfit = 0.00 profitListJSON.PlatformTotalProfit = 0.00

View File

@@ -4,7 +4,7 @@ import (
"boss/internal/common" "boss/internal/common"
"boss/internal/datas" "boss/internal/datas"
"boss/internal/models/user" "boss/internal/models/user"
utils2 "boss/internal/utils" "boss/internal/utils"
"boss/internal/utils/mfa" "boss/internal/utils/mfa"
"github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/core/logs"
"github.com/beego/beego/v2/core/validation" "github.com/beego/beego/v2/core/validation"
@@ -58,7 +58,7 @@ func (c *LoginController) Login() {
return return
} }
codeInterface := c.GetSession("verifyCode") codeInterface := c.GetSession("verifyCode")
if userInfo.Passwd != utils2.GetMD5Upper(passWD) { if userInfo.Passwd != utils.GetMD5Upper(passWD) {
dataJSON.Key = "passWD" dataJSON.Key = "passWD"
dataJSON.Msg = "密码不正确!" dataJSON.Msg = "密码不正确!"
dataJSON.Code = -1 dataJSON.Code = -1
@@ -108,7 +108,7 @@ func (c *LoginController) Logout() {
// GetVerifyImg 验证码获取如果获取成功并将验证码存到session中 // GetVerifyImg 验证码获取如果获取成功并将验证码存到session中
func (c *LoginController) GetVerifyImg() { func (c *LoginController) GetVerifyImg() {
Image, verifyCode := utils2.GenerateVerifyCodeImg() Image, verifyCode := utils.GenerateVerifyCodeImg()
if Image == nil || len(verifyCode) != common.VERIFY_CODE_LEN { if Image == nil || len(verifyCode) != common.VERIFY_CODE_LEN {
logs.Error("获取验证码图片失败!") logs.Error("获取验证码图片失败!")
} else { } else {

View File

@@ -105,6 +105,42 @@ func (c *PageAuthController) RechargeAppleAccountPage() {
c.TplName = "apple-card/account.html" c.TplName = "apple-card/account.html"
} }
func (c *PageAuthController) RechargeTMallGameAccountPage() {
token := ""
// 获取当前时间的时间戳
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
c.Data["portalHost"] = config.GetPortalHost()
c.TplName = "t-mall-game/account.html"
}
func (c *PageAuthController) RechargeTMallGameOrderPage() {
token := ""
// 获取当前时间的时间戳
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
c.Data["portalHost"] = config.GetPortalHost()
c.TplName = "t-mall-game/recharge-order.html"
}
func (c *PageAuthController) OrderSummary() { func (c *PageAuthController) OrderSummary() {
token := "" token := ""
// 获取当前时间的时间戳 // 获取当前时间的时间戳

View File

@@ -1,14 +1,5 @@
package controllers package controllers
/***************************************************
** @Desc : This file for ...
** @Time : 2019/12/8 22:15
** @Author : yuebin
** @File : send_notify_merchant
** @Last Modified by : yuebin
** @Last Modified time: 2019/12/8 22:15
** @Software: GoLand
****************************************************/
import ( import (
"boss/internal/service" "boss/internal/service"
"github.com/beego/beego/v2/server/web" "github.com/beego/beego/v2/server/web"

View File

@@ -2,7 +2,7 @@ package controllers
import ( import (
"boss/internal/datas" "boss/internal/datas"
service2 "boss/internal/service" "boss/internal/service"
"boss/internal/utils/valid" "boss/internal/utils/valid"
) )
@@ -20,7 +20,7 @@ func (c *UpdateController) UpdateMerchantPassword() {
return return
} }
// 判断totp是不是正确 // 判断totp是不是正确
if service2.ValidTotp(userID, totpCode) { if service.ValidTotp(userID, totpCode) {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "二次验证错误" dataJSON.Msg = "二次验证错误"
c.GenerateJSON(dataJSON) c.GenerateJSON(dataJSON)
@@ -38,7 +38,7 @@ func (c *UpdateController) UpdateMerchantPassword() {
} else { } else {
dataJSON.Code = 200 dataJSON.Code = 200
dataJSON.Msg = "密码修改成功!" dataJSON.Msg = "密码修改成功!"
service2.UpdateMerchantPassword(merchantUid, totpCode) service.UpdateMerchantPassword(merchantUid, totpCode)
} }
c.GenerateJSON(dataJSON) c.GenerateJSON(dataJSON)
} }

View File

@@ -1,3 +0,0 @@
{
"100": 200
}

View File

@@ -1,13 +1,13 @@
package datas package datas
import ( import (
accounts2 "boss/internal/models/accounts" "boss/internal/models/accounts"
"boss/internal/models/agent" "boss/internal/models/agent"
merchant2 "boss/internal/models/merchant" "boss/internal/models/merchant"
order2 "boss/internal/models/order" "boss/internal/models/order"
"boss/internal/models/payfor" "boss/internal/models/payfor"
road2 "boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
) )
@@ -34,7 +34,7 @@ type MenuDataJSON struct {
TotalPage int TotalPage int
Code int Code int
Msg string Msg string
MenuList []system2.MenuInfo MenuList []system.MenuInfo
} }
type SecondMenuDataJSON struct { type SecondMenuDataJSON struct {
@@ -44,7 +44,7 @@ type SecondMenuDataJSON struct {
TotalPage int TotalPage int
Code int Code int
Msg string Msg string
SecondMenuList []system2.SecondMenuInfo SecondMenuList []system.SecondMenuInfo
} }
type PowerItemDataJSON struct { type PowerItemDataJSON struct {
@@ -54,7 +54,7 @@ type PowerItemDataJSON struct {
TotalPage int TotalPage int
Code int Code int
Msg string Msg string
PowerItemList []system2.PowerInfo PowerItemList []system.PowerInfo
} }
type RoleInfoDataJSON struct { type RoleInfoDataJSON struct {
@@ -64,18 +64,18 @@ type RoleInfoDataJSON struct {
TotalPage int TotalPage int
Code int Code int
Msg string Msg string
RoleInfoList []system2.RoleInfo RoleInfoList []system.RoleInfo
} }
type DeployTreeJSON struct { type DeployTreeJSON struct {
Msg string Msg string
Code int Code int
Key string Key string
AllFirstMenu []system2.MenuInfo AllFirstMenu []system.MenuInfo
ShowFirstMenuUid map[string]bool ShowFirstMenuUid map[string]bool
AllSecondMenu []system2.SecondMenuInfo AllSecondMenu []system.SecondMenuInfo
ShowSecondMenuUid map[string]bool ShowSecondMenuUid map[string]bool
AllPower []system2.PowerInfo AllPower []system.PowerInfo
ShowPowerUid map[string]bool ShowPowerUid map[string]bool
} }
@@ -93,7 +93,7 @@ type EditOperatorDataJSON struct {
Code int Code int
Msg string Msg string
OperatorList []user.UserInfo OperatorList []user.UserInfo
RoleList []system2.RoleInfo RoleList []system.RoleInfo
} }
type BankCardDataJSON struct { type BankCardDataJSON struct {
@@ -103,7 +103,7 @@ type BankCardDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
BankCardInfoList []system2.BankCardInfo BankCardInfoList []system.BankCardInfo
} }
type RoadDataJSON struct { type RoadDataJSON struct {
@@ -113,8 +113,8 @@ type RoadDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
RoadInfoList []road2.RoadInfo RoadInfoList []road.RoadInfo
RoadPool road2.RoadPoolInfo RoadPool road.RoadPoolInfo
} }
type RoadPoolDataJSON struct { type RoadPoolDataJSON struct {
@@ -124,7 +124,7 @@ type RoadPoolDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
RoadPoolInfoList []road2.RoadPoolInfo RoadPoolInfoList []road.RoadPoolInfo
} }
type MerchantDataJSON struct { type MerchantDataJSON struct {
@@ -134,13 +134,13 @@ type MerchantDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
MerchantList []merchant2.MerchantInfo MerchantList []merchant.MerchantInfo
} }
type MerchantDeployDataJSON struct { type MerchantDeployDataJSON struct {
Code int Code int
Msg string Msg string
MerchantDeploy merchant2.MerchantDeployInfo MerchantDeploy merchant.MerchantDeployInfo
} }
type AccountDataJSON struct { type AccountDataJSON struct {
@@ -150,7 +150,7 @@ type AccountDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
AccountList []accounts2.AccountInfo AccountList []accounts.AccountInfo
} }
type AccountHistoryDataJSON struct { type AccountHistoryDataJSON struct {
@@ -160,7 +160,7 @@ type AccountHistoryDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
AccountHistoryList []accounts2.AccountHistoryInfo AccountHistoryList []accounts.AccountHistoryInfo
} }
type AgentDataJSON struct { type AgentDataJSON struct {
@@ -186,7 +186,7 @@ type OrderDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
OrderList []order2.OrderInfo OrderList []order.OrderInfo
//AllAmount float64 //AllAmount float64
//SuccessRate string //SuccessRate string
NotifyUrl string NotifyUrl string
@@ -195,7 +195,7 @@ type OrderDataJSON struct {
type OrderDataSummaryJSON struct { type OrderDataSummaryJSON struct {
//AllAmount float64 //AllAmount float64
//SuccessRate string //SuccessRate string
OrderProfitSummary order2.ProfitSummary `json:"OrderProfitSummary"` OrderProfitSummary order.ProfitSummary `json:"OrderProfitSummary"`
} }
type ListDataJSON struct { type ListDataJSON struct {
@@ -205,7 +205,7 @@ type ListDataJSON struct {
DisplayCount int DisplayCount int
CurrentPage int CurrentPage int
TotalPage int TotalPage int
List []order2.OrderProfitInfo List []order.OrderProfitInfo
AllAmount float64 AllAmount float64
SupplierProfit float64 SupplierProfit float64
AgentProfit float64 AgentProfit float64
@@ -251,5 +251,5 @@ type ProfitListJSON struct {
AgentTotalProfit float64 AgentTotalProfit float64
Msg string Msg string
Code int Code int
ProfitList []order2.PlatformProfit ProfitList []order.PlatformProfit
} }

View File

@@ -1,14 +1,4 @@
package agent package agent
/***************************************************
** @Desc : This file for ...
** @Time : 2019/12/17 17:50
** @Author : yuebin
** @File : agent_profit
** @Last Modified by : yuebin
** @Last Modified time: 2019/12/17 17:50
** @Software: GoLand
****************************************************/
type AgentProfit struct { type AgentProfit struct {
} }

View File

@@ -1,24 +1,14 @@
package models package models
/***************************************************
** @Desc : This file for ...
** @Time : 2019/8/9 13:48
** @Author : yuebin
** @File : init
** @Last Modified by : yuebin
** @Last Modified time: 2019/8/9 13:48
** @Software: GoLand
****************************************************/
import ( import (
accounts2 "boss/internal/models/accounts" "boss/internal/models/accounts"
"boss/internal/models/agent" "boss/internal/models/agent"
merchant2 "boss/internal/models/merchant" "boss/internal/models/merchant"
"boss/internal/models/notify" "boss/internal/models/notify"
order2 "boss/internal/models/order" "boss/internal/models/order"
"boss/internal/models/payfor" "boss/internal/models/payfor"
road2 "boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
"fmt" "fmt"
"github.com/beego/beego/v2/client/orm" "github.com/beego/beego/v2/client/orm"
@@ -42,23 +32,23 @@ func init() {
_ = orm.RegisterDataBase("default", "mysql", link) _ = orm.RegisterDataBase("default", "mysql", link)
orm.RegisterModel( orm.RegisterModel(
new(user.UserInfo), new(user.UserInfo),
new(system2.MenuInfo), new(system.MenuInfo),
new(system2.SecondMenuInfo), new(system.SecondMenuInfo),
new(system2.PowerInfo), new(system.PowerInfo),
new(system2.RoleInfo), new(system.RoleInfo),
new(system2.BankCardInfo), new(system.BankCardInfo),
new(road2.RoadInfo), new(road.RoadInfo),
new(road2.RoadPoolInfo), new(road.RoadPoolInfo),
new(agent.AgentInfo), new(agent.AgentInfo),
new(merchant2.MerchantInfo), new(merchant.MerchantInfo),
new(merchant2.MerchantDeployInfo), new(merchant.MerchantDeployInfo),
new(accounts2.AccountInfo), new(accounts.AccountInfo),
new(accounts2.AccountHistoryInfo), new(accounts.AccountHistoryInfo),
new(order2.OrderInfo), new(order.OrderInfo),
new(order2.OrderProfitInfo), new(order.OrderProfitInfo),
new(order2.OrderSettleInfo), new(order.OrderSettleInfo),
new(notify.NotifyInfo), new(notify.NotifyInfo),
new(merchant2.MerchantLoadInfo), new(merchant.MerchantLoadInfo),
new(payfor.PayforInfo), new(payfor.PayforInfo),
) )
} }

View File

@@ -1,15 +1,5 @@
package merchant package merchant
/***************************************************
** @Desc : This file for ...
** @Time : 2019/10/7 11:52
** @Author : yuebin
** @File : merchant_deploy_info
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/7 11:52
** @Software: GoLand
****************************************************/
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"

View File

@@ -1,15 +1,5 @@
package merchant package merchant
/***************************************************
** @Desc : This file for ...
** @Time : 2019/9/28 16:47
** @Author : yuebin
** @File : merchant_info
** @Last Modified by : yuebin
** @Last Modified time: 2019/9/28 16:47
** @Software: GoLand
****************************************************/
import ( import (
"github.com/beego/beego/v2/client/orm" "github.com/beego/beego/v2/client/orm"
"github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/core/logs"

View File

@@ -1,15 +1,5 @@
package order package order
/***************************************************
** @Desc : This file for ...
** @Time : 2019/10/28 10:15
** @Author : yuebin
** @File : order_info
** @Last Modified by : yuebin
** @Last Modified time: 2019/10/28 10:15
** @Software: GoLand
****************************************************/
import ( import (
"fmt" "fmt"
"strconv" "strconv"
@@ -143,7 +133,7 @@ func GetAllOrderByMap(params map[string]string) []OrderInfo {
// GetToDayInfo 获得今日数据 // GetToDayInfo 获得今日数据
func GetToDayInfo() string { func GetToDayInfo() string {
var params map[string]string = map[string]string{} var params = map[string]string{}
//params["create_time__gte"] = startTime //params["create_time__gte"] = startTime
//params["create_time__lte"] = endTime //params["create_time__lte"] = endTime
o := orm.NewOrm() o := orm.NewOrm()

View File

@@ -2,7 +2,7 @@ package models
import ( import (
"boss/internal/common" "boss/internal/common"
accounts2 "boss/internal/models/accounts" "boss/internal/models/accounts"
"context" "context"
"errors" "errors"
"github.com/beego/beego/v2/client/orm" "github.com/beego/beego/v2/client/orm"
@@ -17,7 +17,7 @@ func OperatorAccount(accountUid, operatorType string, amount float64) (string, b
if err := o.DoTx(func(ctx context.Context, txOrm orm.TxOrmer) error { if err := o.DoTx(func(ctx context.Context, txOrm orm.TxOrmer) error {
//处理事务 //处理事务
accountInfo := new(accounts2.AccountInfo) accountInfo := new(accounts.AccountInfo)
if err := txOrm.Raw("select * from account_info where account_uid = ? for update", accountUid). if err := txOrm.Raw("select * from account_info where account_uid = ? for update", accountUid).
QueryRow(accountInfo); err != nil || accountInfo.AccountUid == "" { QueryRow(accountInfo); err != nil || accountInfo.AccountUid == "" {
logs.Error("operator account get account info for update fail: ", err) logs.Error("operator account get account info for update fail: ", err)
@@ -58,7 +58,7 @@ func OperatorAccount(accountUid, operatorType string, amount float64) (string, b
return err return err
} }
//往account_history表中插入一条动账记录 //往account_history表中插入一条动账记录
accountHistory := accounts2.AccountHistoryInfo{AccountUid: accountUid, AccountName: accountInfo.AccountName, Type: operatorType, accountHistory := accounts.AccountHistoryInfo{AccountUid: accountUid, AccountName: accountInfo.AccountName, Type: operatorType,
Amount: amount, Balance: accountInfo.Balance, CreateTime: time.Now(), UpdateTime: time.Now()} Amount: amount, Balance: accountInfo.Balance, CreateTime: time.Now(), UpdateTime: time.Now()}
if _, err := txOrm.Insert(&accountHistory); err != nil { if _, err := txOrm.Insert(&accountHistory); err != nil {

View File

@@ -1,7 +1,7 @@
package routers package routers
import ( import (
controllers2 "boss/internal/controllers" "boss/internal/controllers"
"github.com/beego/beego/v2/server/web" "github.com/beego/beego/v2/server/web"
) )
@@ -14,106 +14,106 @@ func init() {
test() test()
//beego.Router("/", &controllers.PageController{}, "*:Index") //beego.Router("/", &controllers.PageController{}, "*:Index")
//添加过滤函数 //添加过滤函数
web.Router("/filter.html", &controllers2.FilterController{}, "*:Filter") web.Router("/filter.html", &controllers.FilterController{}, "*:Filter")
//登录验证接口 //登录验证接口
web.Router("/login", &controllers2.LoginController{}, "*:Login") web.Router("/login", &controllers.LoginController{}, "*:Login")
web.Router("/logout", &controllers2.LoginController{}, "*:Logout") web.Router("/logout", &controllers.LoginController{}, "*:Logout")
web.Router("/getVerifyImg", &controllers2.LoginController{}, "*:GetVerifyImg") web.Router("/getVerifyImg", &controllers.LoginController{}, "*:GetVerifyImg")
web.Router("/update/password", &controllers2.UpdateController{}, "*:UpdatePassword") web.Router("/update/password", &controllers.UpdateController{}, "*:UpdatePassword")
web.Router("/freeze/operator", &controllers2.UpdateController{}, "*:FreezeOperator") web.Router("/freeze/operator", &controllers.UpdateController{}, "*:FreezeOperator")
web.Router("/freeze/merchant", &controllers2.UpdateController{}, "*:UpdateMerchantStatus") web.Router("/freeze/merchant", &controllers.UpdateController{}, "*:UpdateMerchantStatus")
web.Router("/unfreeze/operator", &controllers2.UpdateController{}, "*:UnfreezeOperator") web.Router("/unfreeze/operator", &controllers.UpdateController{}, "*:UnfreezeOperator")
web.Router("/unfreeze/merchant", &controllers2.UpdateController{}, "*:UpdateMerchantStatus") web.Router("/unfreeze/merchant", &controllers.UpdateController{}, "*:UpdateMerchantStatus")
web.Router("/edit/operator", &controllers2.UpdateController{}, "*:EditOperator") web.Router("/edit/operator", &controllers.UpdateController{}, "*:EditOperator")
web.Router("/add/menu", &controllers2.AddController{}, "*:AddMenu") web.Router("/add/menu", &controllers.AddController{}, "*:AddMenu")
web.Router("/add/secondMenu", &controllers2.AddController{}, "*:AddSecondMenu") web.Router("/add/secondMenu", &controllers.AddController{}, "*:AddSecondMenu")
web.Router("/add/power", &controllers2.AddController{}, "*:AddPower") web.Router("/add/power", &controllers.AddController{}, "*:AddPower")
web.Router("/add/role", &controllers2.AddController{}, "*:AddRole") web.Router("/add/role", &controllers.AddController{}, "*:AddRole")
web.Router("/add/operator", &controllers2.AddController{}, "*:AddOperator") web.Router("/add/operator", &controllers.AddController{}, "*:AddOperator")
web.Router("/add/bankCard", &controllers2.AddController{}, "*:AddBankCard") web.Router("/add/bankCard", &controllers.AddController{}, "*:AddBankCard")
web.Router("/add/road", &controllers2.AddController{}, "*:AddRoad") web.Router("/add/road", &controllers.AddController{}, "*:AddRoad")
web.Router("/add/roadPool", &controllers2.AddController{}, "*:AddRoadPool") web.Router("/add/roadPool", &controllers.AddController{}, "*:AddRoadPool")
web.Router("/add/merchant", &controllers2.AddController{}, "*:AddMerchant") web.Router("/add/merchant", &controllers.AddController{}, "*:AddMerchant")
web.Router("/add/agent", &controllers2.AddController{}, "*:AddAgent") web.Router("/add/agent", &controllers.AddController{}, "*:AddAgent")
web.Router("/add/merchant/deploy", &controllers2.AddController{}, "*:AddMerchantDeploy") web.Router("/add/merchant/deploy", &controllers.AddController{}, "*:AddMerchantDeploy")
web.Router("/add/merchant/payType", &controllers2.AddController{}, "*:AddMerchantPayType") web.Router("/add/merchant/payType", &controllers.AddController{}, "*:AddMerchantPayType")
web.Router("/add/payfor", &controllers2.AddController{}, "*:AddPayFor") web.Router("/add/payfor", &controllers.AddController{}, "*:AddPayFor")
web.Router("/add/self/payfor", &controllers2.AddController{}, "*:AddSelfPayFor") web.Router("/add/self/payfor", &controllers.AddController{}, "*:AddSelfPayFor")
web.Router("/get/menu", &controllers2.GetController{}, "*:GetMenu") web.Router("/get/menu", &controllers.GetController{}, "*:GetMenu")
web.Router("/get/secondMenu", &controllers2.GetController{}, "*:GetSecondMenu") web.Router("/get/secondMenu", &controllers.GetController{}, "*:GetSecondMenu")
web.Router("/get/secondMenus", &controllers2.GetController{}, "*:GetSecondMenus") web.Router("/get/secondMenus", &controllers.GetController{}, "*:GetSecondMenus")
web.Router("/get/oneMenu", &controllers2.GetController{}, "*:GetOneMenu") web.Router("/get/oneMenu", &controllers.GetController{}, "*:GetOneMenu")
web.Router("/get/firstMenu", &controllers2.GetController{}, "*:GetFirstMenu") web.Router("/get/firstMenu", &controllers.GetController{}, "*:GetFirstMenu")
web.Router("/get/powerItem", &controllers2.GetController{}, "*:GetPowerItem") web.Router("/get/powerItem", &controllers.GetController{}, "*:GetPowerItem")
web.Router("/get/role", &controllers2.GetController{}, "*:GetRole") web.Router("/get/role", &controllers.GetController{}, "*:GetRole")
web.Router("/get/allRole", &controllers2.GetController{}, "*:GetAllRole") web.Router("/get/allRole", &controllers.GetController{}, "*:GetAllRole")
web.Router("/get/deployTree", &controllers2.GetController{}, "*:GetDeployTree") web.Router("/get/deployTree", &controllers.GetController{}, "*:GetDeployTree")
web.Router("/get/operator", &controllers2.GetController{}, "*:GetOperator") web.Router("/get/operator", &controllers.GetController{}, "*:GetOperator")
web.Router("/get/oneOperator", &controllers2.GetController{}, "*:GetOneOperator") web.Router("/get/oneOperator", &controllers.GetController{}, "*:GetOneOperator")
web.Router("/get/editOperator", &controllers2.GetController{}, "*:GetEditOperator") web.Router("/get/editOperator", &controllers.GetController{}, "*:GetEditOperator")
web.Router("/get/bankCard", &controllers2.GetController{}, "*:GetBankCard") web.Router("/get/bankCard", &controllers.GetController{}, "*:GetBankCard")
web.Router("/get/oneBankCard", &controllers2.GetController{}, "*:GetOneBankCard") web.Router("/get/oneBankCard", &controllers.GetController{}, "*:GetOneBankCard")
web.Router("/get/road", &controllers2.GetController{}, "*:GetRoad") web.Router("/get/road", &controllers.GetController{}, "*:GetRoad")
web.Router("/get/oneRoad", &controllers2.GetController{}, "*:GetOneRoad") web.Router("/get/oneRoad", &controllers.GetController{}, "*:GetOneRoad")
web.Router("/get/all/road", &controllers2.GetController{}, "*:GetAllRoad") web.Router("/get/all/road", &controllers.GetController{}, "*:GetAllRoad")
web.Router("/get/roadPool", &controllers2.GetController{}, "*:GetRoadPool") web.Router("/get/roadPool", &controllers.GetController{}, "*:GetRoadPool")
web.Router("/get/all/roll/pool", &controllers2.GetController{}, "*:GetAllRollPool") web.Router("/get/all/roll/pool", &controllers.GetController{}, "*:GetAllRollPool")
web.Router("/get/merchant", &controllers2.GetController{}, "*:GetMerchant") web.Router("/get/merchant", &controllers.GetController{}, "*:GetMerchant")
web.Router("/get/all/merchant", &controllers2.GetController{}, "*:GetAllMerchant") web.Router("/get/all/merchant", &controllers.GetController{}, "*:GetAllMerchant")
web.Router("/get/one/merchant", &controllers2.GetController{}, "*:GetOneMerchant") web.Router("/get/one/merchant", &controllers.GetController{}, "*:GetOneMerchant")
web.Router("/get/one/merchant/deploy", &controllers2.GetController{}, "*:GetOneMerchantDeploy") web.Router("/get/one/merchant/deploy", &controllers.GetController{}, "*:GetOneMerchantDeploy")
web.Router("/get/all/account", &controllers2.GetController{}, "*:GetAllAccount") web.Router("/get/all/account", &controllers.GetController{}, "*:GetAllAccount")
web.Router("/get/account", &controllers2.GetController{}, "*:GetAccount") web.Router("/get/account", &controllers.GetController{}, "*:GetAccount")
web.Router("/get/one/account", &controllers2.GetController{}, "*:GetOneAccount") web.Router("/get/one/account", &controllers.GetController{}, "*:GetOneAccount")
web.Router("/get/account/history", &controllers2.GetController{}, "*:GetAccountHistory") web.Router("/get/account/history", &controllers.GetController{}, "*:GetAccountHistory")
web.Router("/get/agent", &controllers2.GetController{}, "*:GetAgent") web.Router("/get/agent", &controllers.GetController{}, "*:GetAgent")
web.Router("/get/all/agent", &controllers2.GetController{}, "*:GetAllAgent") web.Router("/get/all/agent", &controllers.GetController{}, "*:GetAllAgent")
web.Router("/get/product", &controllers2.GetController{}, "*:GetProduct") web.Router("/get/product", &controllers.GetController{}, "*:GetProduct")
web.Router("/get/order", &controllers2.GetController{}, "*:GetOrder") web.Router("/get/order", &controllers.GetController{}, "*:GetOrder")
web.Router("/get/orderSummary", &controllers2.GetController{}, "*:GetOrderSummary") web.Router("/get/orderSummary", &controllers.GetController{}, "*:GetOrderSummary")
web.Router("/get/one/order", &controllers2.GetController{}, "*:GetOneOrder") web.Router("/get/one/order", &controllers.GetController{}, "*:GetOneOrder")
web.Router("/get/orderProfit", &controllers2.GetController{}, "*:GetOrderProfit") web.Router("/get/orderProfit", &controllers.GetController{}, "*:GetOrderProfit")
web.Router("/get/payfor", &controllers2.GetController{}, "*:GetPayFor") web.Router("/get/payfor", &controllers.GetController{}, "*:GetPayFor")
web.Router("/get/one/payfor", &controllers2.GetController{}, "*:GetOnePayFor") web.Router("/get/one/payfor", &controllers.GetController{}, "*:GetOnePayFor")
web.Router("/get/balance", &controllers2.GetController{}, "*:GetBalance") web.Router("/get/balance", &controllers.GetController{}, "*:GetBalance")
web.Router("/get/notify/bankOrderId/list", &controllers2.GetController{}, "*:GetNotifyBankOrderIdList") web.Router("/get/notify/bankOrderId/list", &controllers.GetController{}, "*:GetNotifyBankOrderIdList")
web.Router("/get/agent/to/merchant", &controllers2.GetController{}, "*:GetAgentToMerchant") web.Router("/get/agent/to/merchant", &controllers.GetController{}, "*:GetAgentToMerchant")
web.Router("/get/profit", &controllers2.GetController{}, "*:GetProfit") web.Router("/get/profit", &controllers.GetController{}, "*:GetProfit")
web.Router("/save/power", &controllers2.AddController{}, "*:SavePower") web.Router("/save/power", &controllers.AddController{}, "*:SavePower")
web.Router("/save/roadUid", &controllers2.AddController{}, "*:SaveRoadUid") web.Router("/save/roadUid", &controllers.AddController{}, "*:SaveRoadUid")
web.Router("/up/menu", &controllers2.UpdateController{}, "*:UpMenu") web.Router("/up/menu", &controllers.UpdateController{}, "*:UpMenu")
web.Router("/down/menu", &controllers2.UpdateController{}, "*:DownMenu") web.Router("/down/menu", &controllers.UpdateController{}, "*:DownMenu")
web.Router("/up/secondMenu", &controllers2.UpdateController{}, "*:UpSecondMenu") web.Router("/up/secondMenu", &controllers.UpdateController{}, "*:UpSecondMenu")
web.Router("/down/secondMenu", &controllers2.UpdateController{}, "*:DownSecondMenu") web.Router("/down/secondMenu", &controllers.UpdateController{}, "*:DownSecondMenu")
web.Router("/update/roadStatus", &controllers2.UpdateController{}, "*:UpdateRoadStatus") web.Router("/update/roadStatus", &controllers.UpdateController{}, "*:UpdateRoadStatus")
web.Router("/update/account/status", &controllers2.UpdateController{}, "*:UpdateAccountStatus") web.Router("/update/account/status", &controllers.UpdateController{}, "*:UpdateAccountStatus")
web.Router("/update/agent/status", &controllers2.UpdateController{}, "*:UpdateAgentStatus") web.Router("/update/agent/status", &controllers.UpdateController{}, "*:UpdateAgentStatus")
web.Router("/update/order/status", &controllers2.UpdateController{}, "*:UpdateOrderStatus") web.Router("/update/order/status", &controllers.UpdateController{}, "*:UpdateOrderStatus")
web.Router("/update/merchant/newPassword", &controllers2.UpdateController{}, "*:UpdateMerchantPassword") web.Router("/update/merchant/newPassword", &controllers.UpdateController{}, "*:UpdateMerchantPassword")
web.Router("/account/operator", &controllers2.UpdateController{}, "*:OperatorAccount") web.Router("/account/operator", &controllers.UpdateController{}, "*:OperatorAccount")
web.Router("/delete/menu", &controllers2.DeleteController{}, "*:DeleteMenu") web.Router("/delete/menu", &controllers.DeleteController{}, "*:DeleteMenu")
web.Router("/delete/secondMenu", &controllers2.DeleteController{}, "*:DeleteSecondMenu") web.Router("/delete/secondMenu", &controllers.DeleteController{}, "*:DeleteSecondMenu")
web.Router("/delete/powerItem", &controllers2.DeleteController{}, "*:DeletePowerItem") web.Router("/delete/powerItem", &controllers.DeleteController{}, "*:DeletePowerItem")
web.Router("/delete/role", &controllers2.DeleteController{}, "*:DeleteRole") web.Router("/delete/role", &controllers.DeleteController{}, "*:DeleteRole")
web.Router("/delete/operator", &controllers2.DeleteController{}, "*:DeleteOperator") web.Router("/delete/operator", &controllers.DeleteController{}, "*:DeleteOperator")
web.Router("/delete/bankCardRecord", &controllers2.DeleteController{}, "*:DeleteBankCardRecord") web.Router("/delete/bankCardRecord", &controllers.DeleteController{}, "*:DeleteBankCardRecord")
web.Router("/delete/road", &controllers2.DeleteController{}, "*:DeleteRoad") web.Router("/delete/road", &controllers.DeleteController{}, "*:DeleteRoad")
web.Router("/delete/roadPool", &controllers2.DeleteController{}, "*:DeleteRoadPool") web.Router("/delete/roadPool", &controllers.DeleteController{}, "*:DeleteRoadPool")
web.Router("/delete/merchant", &controllers2.DeleteController{}, "*:DeleteMerchant") web.Router("/delete/merchant", &controllers.DeleteController{}, "*:DeleteMerchant")
web.Router("/delete/account", &controllers2.DeleteController{}, "*:DeleteAccount") web.Router("/delete/account", &controllers.DeleteController{}, "*:DeleteAccount")
web.Router("/delete/agent", &controllers2.DeleteController{}, "*:DeleteAgent") web.Router("/delete/agent", &controllers.DeleteController{}, "*:DeleteAgent")
web.Router("/delete/agent/merchant/relation", &controllers2.DeleteController{}, "*:DeleteAgentRelation") web.Router("/delete/agent/merchant/relation", &controllers.DeleteController{}, "*:DeleteAgentRelation")
web.Router("/reset/agent/password", &controllers2.UpdateController{}, "*:ResetAgentPassword") web.Router("/reset/agent/password", &controllers.UpdateController{}, "*:ResetAgentPassword")
web.Router("/supplier/order/query", &controllers2.SupplierQuery{}, "*:SupplierOrderQuery") web.Router("/supplier/order/query", &controllers.SupplierQuery{}, "*:SupplierOrderQuery")
web.Router("/supplier/payfor/query", &controllers2.SupplierQuery{}, "*:SupplierPayForQuery") web.Router("/supplier/payfor/query", &controllers.SupplierQuery{}, "*:SupplierPayForQuery")
web.Router("/choose/payfor/road", &controllers2.UpdateController{}, "*:ChoosePayForRoad") web.Router("/choose/payfor/road", &controllers.UpdateController{}, "*:ChoosePayForRoad")
web.Router("/result/payfor", &controllers2.UpdateController{}, "*:ResultPayFor") web.Router("/result/payfor", &controllers.UpdateController{}, "*:ResultPayFor")
web.Router("/send/notify", &controllers2.SendNotify{}, "*:SendNotifyToMerchant") web.Router("/send/notify", &controllers.SendNotify{}, "*:SendNotifyToMerchant")
web.Router("/self/send/notify", &controllers2.SendNotify{}, "*:SelfSendNotify") web.Router("/self/send/notify", &controllers.SendNotify{}, "*:SelfSendNotify")
web.Router("/user/genTotp", &controllers2.TotpQuery{}, "*:GenTotp") web.Router("/user/genTotp", &controllers.TotpQuery{}, "*:GenTotp")
web.Router("/user/saveTotp", &controllers2.TotpQuery{}, "*:SaveTotp") web.Router("/user/saveTotp", &controllers.TotpQuery{}, "*:SaveTotp")
} }

View File

@@ -1,48 +1,51 @@
package routers package routers
import ( import (
controllers2 "boss/internal/controllers" "boss/internal/controllers"
beego "github.com/beego/beego/v2/server/web" beego "github.com/beego/beego/v2/server/web"
) )
func init() { func init() {
beego.Router("/", &controllers2.PageController{}, "*:Index") beego.Router("/", &controllers.PageController{}, "*:Index")
beego.Router("/index.html", &controllers2.PageController{}, "*:Index") beego.Router("/index.html", &controllers.PageController{}, "*:Index")
beego.Router("/login.html", &controllers2.PageController{}, "*:LoginPage") beego.Router("/login.html", &controllers.PageController{}, "*:LoginPage")
beego.Router("/account.html", &controllers2.PageAuthController{}, "*:AccountPage") beego.Router("/account.html", &controllers.PageAuthController{}, "*:AccountPage")
beego.Router("/account_history.html", &controllers2.PageAuthController{}, "*:AccountHistoryPage") beego.Router("/account_history.html", &controllers.PageAuthController{}, "*:AccountHistoryPage")
beego.Router("/bank_card.html", &controllers2.PageAuthController{}, "*:BankCardPage") beego.Router("/bank_card.html", &controllers.PageAuthController{}, "*:BankCardPage")
beego.Router("/create_agent.html", &controllers2.PageAuthController{}, "*:CreateAgentPage") beego.Router("/create_agent.html", &controllers.PageAuthController{}, "*:CreateAgentPage")
beego.Router("/edit_role.html", &controllers2.PageAuthController{}, "*:EditRolePage") beego.Router("/edit_role.html", &controllers.PageAuthController{}, "*:EditRolePage")
beego.Router("/first_menu.html", &controllers2.PageAuthController{}, "*:FirstMenuPage") beego.Router("/first_menu.html", &controllers.PageAuthController{}, "*:FirstMenuPage")
beego.Router("/main.html", &controllers2.PageAuthController{}, "*:MainPage") beego.Router("/main.html", &controllers.PageAuthController{}, "*:MainPage")
beego.Router("/menu.html", &controllers2.PageAuthController{}, "*:MenuPage") beego.Router("/menu.html", &controllers.PageAuthController{}, "*:MenuPage")
beego.Router("/merchant.html", &controllers2.PageAuthController{}, "*:MerchantPage") beego.Router("/merchant.html", &controllers.PageAuthController{}, "*:MerchantPage")
beego.Router("/merchant_v2.html", &controllers2.PageAuthController{}, "*:MerchantV2Page") beego.Router("/merchant_v2.html", &controllers.PageAuthController{}, "*:MerchantV2Page")
beego.Router("/customerUserManagement.html", &controllers2.PageAuthController{}, "*:UserManagement") beego.Router("/customerUserManagement.html", &controllers.PageAuthController{}, "*:UserManagement")
beego.Router("/order-summary-info.html", &controllers2.PageAuthController{}, "*:OrderSummary") beego.Router("/order-summary-info.html", &controllers.PageAuthController{}, "*:OrderSummary")
beego.Router("/recharge-apple-card-account.html", &controllers2.PageAuthController{}, "*:RechargeAppleAccountPage") beego.Router("/recharge-apple-card-account.html", &controllers.PageAuthController{}, "*:RechargeAppleAccountPage")
beego.Router("/recharge-apple-card-order.html", &controllers2.PageAuthController{}, "*:RechargeAppleOrderPage") beego.Router("/recharge-apple-card-order.html", &controllers.PageAuthController{}, "*:RechargeAppleOrderPage")
beego.Router("/operator.html", &controllers2.PageAuthController{}, "*:OperatorPage") beego.Router("/recharge-t-mall-game-account.html", &controllers.PageAuthController{}, "*:RechargeTMallGameAccountPage")
beego.Router("/power.html", &controllers2.PageAuthController{}, "*:PowerPage") beego.Router("/recharge-t-mall-game-order.html", &controllers.PageAuthController{}, "*:RechargeTMallGameOrderPage")
beego.Router("/road.html", &controllers2.PageAuthController{}, "*:RoadPage")
beego.Router("/road_pool.html", &controllers2.PageAuthController{}, "*:RoadPoolPage") beego.Router("/operator.html", &controllers.PageAuthController{}, "*:OperatorPage")
beego.Router("/road_profit.html", &controllers2.PageAuthController{}, "*:RoadProfitPage") beego.Router("/power.html", &controllers.PageAuthController{}, "*:PowerPage")
beego.Router("/role.html", &controllers2.PageAuthController{}, "*:RolePage") beego.Router("/road.html", &controllers.PageAuthController{}, "*:RoadPage")
beego.Router("/second_menu.html", &controllers2.PageAuthController{}, "*:SecondMenuPage") beego.Router("/road_pool.html", &controllers.PageAuthController{}, "*:RoadPoolPage")
beego.Router("/order_info.html", &controllers2.PageAuthController{}, "*:OrderInfoPage") beego.Router("/road_profit.html", &controllers.PageAuthController{}, "*:RoadProfitPage")
beego.Router("/order_profit.html", &controllers2.PageAuthController{}, "*:OrderProfitPage") beego.Router("/role.html", &controllers.PageAuthController{}, "*:RolePage")
beego.Router("/merchant_payfor.html", &controllers2.PageAuthController{}, "*:MerchantPayforPage") beego.Router("/second_menu.html", &controllers.PageAuthController{}, "*:SecondMenuPage")
beego.Router("/self_payfor.html", &controllers2.PageAuthController{}, "*:SelfPayforPage") beego.Router("/order_info.html", &controllers.PageAuthController{}, "*:OrderInfoPage")
beego.Router("/payfor_record.html", &controllers2.PageAuthController{}, "*:PayforRecordPage") beego.Router("/order_profit.html", &controllers.PageAuthController{}, "*:OrderProfitPage")
beego.Router("/confirm.html", &controllers2.PageAuthController{}, "*:ConfirmPage") beego.Router("/merchant_payfor.html", &controllers.PageAuthController{}, "*:MerchantPayforPage")
beego.Router("/self_notify.html", &controllers2.PageAuthController{}, "*:SelfNotifyPage") beego.Router("/self_payfor.html", &controllers.PageAuthController{}, "*:SelfPayforPage")
beego.Router("/payfor_record.html", &controllers.PageAuthController{}, "*:PayforRecordPage")
beego.Router("/confirm.html", &controllers.PageAuthController{}, "*:ConfirmPage")
beego.Router("/self_notify.html", &controllers.PageAuthController{}, "*:SelfNotifyPage")
//beego.Router("/self_plus_sub.html", &controllers.PageController{}, "*:SelfPlusSubPage") //beego.Router("/self_plus_sub.html", &controllers.PageController{}, "*:SelfPlusSubPage")
beego.Router("/agent_to_merchant.html", &controllers2.PageAuthController{}, "*:AgentToMerchantPage") beego.Router("/agent_to_merchant.html", &controllers.PageAuthController{}, "*:AgentToMerchantPage")
beego.Router("/platform_profit.html", &controllers2.PageAuthController{}, "*:PlatFormProfitPage") beego.Router("/platform_profit.html", &controllers.PageAuthController{}, "*:PlatFormProfitPage")
beego.Router("/agent_profit.html", &controllers2.PageAuthController{}, "*:AgentProfitPage") beego.Router("/agent_profit.html", &controllers.PageAuthController{}, "*:AgentProfitPage")
} }

View File

@@ -1,14 +1,14 @@
package service package service
import ( import (
common2 "boss/internal/common" "boss/internal/common"
"boss/internal/datas" "boss/internal/datas"
"boss/internal/models/accounts" "boss/internal/models/accounts"
"boss/internal/models/agent" "boss/internal/models/agent"
merchant2 "boss/internal/models/merchant" "boss/internal/models/merchant"
"boss/internal/models/payfor" "boss/internal/models/payfor"
road2 "boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
"boss/internal/utils" "boss/internal/utils"
"github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/core/logs"
@@ -24,7 +24,7 @@ type AddService struct {
func (c *AddService) AddMenu(oneMenu, userID string) *datas.BaseDataJSON { func (c *AddService) AddMenu(oneMenu, userID string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
menuInfo := system2.MenuInfo{ menuInfo := system.MenuInfo{
MenuUid: xid.New().String(), MenuUid: xid.New().String(),
FirstMenu: oneMenu, FirstMenu: oneMenu,
Status: "active", Status: "active",
@@ -32,10 +32,10 @@ func (c *AddService) AddMenu(oneMenu, userID string) *datas.BaseDataJSON {
CreateTime: time.Now(), CreateTime: time.Now(),
} }
exist := system2.FirstMenuIsExists(oneMenu) exist := system.FirstMenuIsExists(oneMenu)
if !exist { if !exist {
menuInfo.MenuOrder = system2.GetMenuLen() + 1 menuInfo.MenuOrder = system.GetMenuLen() + 1
flag := system2.InsertMenu(menuInfo) flag := system.InsertMenu(menuInfo)
if !flag { if !flag {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "添加菜单失败" dataJSON.Msg = "添加菜单失败"
@@ -52,9 +52,9 @@ func (c *AddService) AddMenu(oneMenu, userID string) *datas.BaseDataJSON {
func (c *AddService) AddSecondMenu(firstMenuUid, secondRouter, secondMenu, userID string) *datas.KeyDataJSON { func (c *AddService) AddSecondMenu(firstMenuUid, secondRouter, secondMenu, userID string) *datas.KeyDataJSON {
dataJSON := new(datas.KeyDataJSON) dataJSON := new(datas.KeyDataJSON)
firstMenuInfo := system2.GetMenuInfoByMenuUid(firstMenuUid) firstMenuInfo := system.GetMenuInfoByMenuUid(firstMenuUid)
routerExists := system2.SecondRouterExists(secondRouter) routerExists := system.SecondRouterExists(secondRouter)
secondMenuExists := system2.SecondMenuIsExists(secondMenu) secondMenuExists := system.SecondMenuIsExists(secondMenu)
if firstMenuInfo.MenuUid == "" { if firstMenuInfo.MenuUid == "" {
dataJSON.Code = -1 dataJSON.Code = -1
@@ -69,8 +69,8 @@ func (c *AddService) AddSecondMenu(firstMenuUid, secondRouter, secondMenu, userI
dataJSON.Key = "second-menu-error" dataJSON.Key = "second-menu-error"
dataJSON.Msg = "*该菜单名已经存在" dataJSON.Msg = "*该菜单名已经存在"
} else { } else {
sl := system2.GetSecondMenuLenByFirstMenuUid(firstMenuUid) sl := system.GetSecondMenuLenByFirstMenuUid(firstMenuUid)
secondMenuInfo := system2.SecondMenuInfo{ secondMenuInfo := system.SecondMenuInfo{
MenuOrder: sl + 1, MenuOrder: sl + 1,
FirstMenuUid: firstMenuInfo.MenuUid, FirstMenuUid: firstMenuInfo.MenuUid,
FirstMenu: firstMenuInfo.FirstMenu, FirstMenu: firstMenuInfo.FirstMenu,
@@ -83,7 +83,7 @@ func (c *AddService) AddSecondMenu(firstMenuUid, secondRouter, secondMenu, userI
UpdateTime: time.Now(), UpdateTime: time.Now(),
FirstMenuOrder: firstMenuInfo.MenuOrder, FirstMenuOrder: firstMenuInfo.MenuOrder,
} }
if !system2.InsertSecondMenu(secondMenuInfo) { if !system.InsertSecondMenu(secondMenuInfo) {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "添加二级菜单失败" dataJSON.Msg = "添加二级菜单失败"
} else { } else {
@@ -108,15 +108,15 @@ func (c *AddService) AddPower(powerItem, powerID, firstMenuUid, secondMenuUid, u
keyDataJSON.Msg = "*权限项ID不能为空" keyDataJSON.Msg = "*权限项ID不能为空"
return keyDataJSON return keyDataJSON
} }
if system2.PowerUidExists(powerID) { if system.PowerUidExists(powerID) {
keyDataJSON.Key = ".power-id-error" keyDataJSON.Key = ".power-id-error"
keyDataJSON.Msg = "*权限项ID已经存在" keyDataJSON.Msg = "*权限项ID已经存在"
return keyDataJSON return keyDataJSON
} }
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(secondMenuUid) secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
powerInfo := system2.PowerInfo{ powerInfo := system.PowerInfo{
SecondMenuUid: secondMenuUid, SecondMenuUid: secondMenuUid,
SecondMenu: secondMenuInfo.SecondMenu, SecondMenu: secondMenuInfo.SecondMenu,
PowerId: powerID, PowerItem: powerItem, PowerId: powerID, PowerItem: powerItem,
@@ -128,7 +128,7 @@ func (c *AddService) AddPower(powerItem, powerID, firstMenuUid, secondMenuUid, u
} }
keyDataJSON.Code = 200 keyDataJSON.Code = 200
if !system2.InsertPowerInfo(powerInfo) { if !system.InsertPowerInfo(powerInfo) {
keyDataJSON.Key = ".power-save-success" keyDataJSON.Key = ".power-save-success"
keyDataJSON.Msg = "添加权限项失败" keyDataJSON.Msg = "添加权限项失败"
} else { } else {
@@ -148,14 +148,14 @@ func (c *AddService) AddRole(roleName, roleRemark, userID string) *datas.KeyData
return keyDataJSON return keyDataJSON
} }
if system2.RoleNameExists(roleName) { if system.RoleNameExists(roleName) {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = ".role-name-error" keyDataJSON.Key = ".role-name-error"
keyDataJSON.Msg = "*角色名称已经存在" keyDataJSON.Msg = "*角色名称已经存在"
return keyDataJSON return keyDataJSON
} }
roleInfo := system2.RoleInfo{ roleInfo := system.RoleInfo{
RoleName: roleName, RoleName: roleName,
RoleUid: xid.New().String(), RoleUid: xid.New().String(),
Creater: userID, Creater: userID,
@@ -165,7 +165,7 @@ func (c *AddService) AddRole(roleName, roleRemark, userID string) *datas.KeyData
UpdateTime: time.Now(), UpdateTime: time.Now(),
} }
if !system2.InsertRole(roleInfo) { if !system.InsertRole(roleInfo) {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = ".role-save-success" keyDataJSON.Key = ".role-save-success"
keyDataJSON.Msg = "添加角色失败" keyDataJSON.Msg = "添加角色失败"
@@ -179,7 +179,7 @@ func (c *AddService) AddRole(roleName, roleRemark, userID string) *datas.KeyData
func (c *AddService) SavePower(roleUid string, firstMenuUids, secondMenuUids, powerIds []string) *datas.BaseDataJSON { func (c *AddService) SavePower(roleUid string, firstMenuUids, secondMenuUids, powerIds []string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
roleInfo := system2.GetRoleByRoleUid(roleUid) roleInfo := system.GetRoleByRoleUid(roleUid)
if len(roleUid) == 0 || len(roleInfo.RoleUid) == 0 { if len(roleUid) == 0 || len(roleInfo.RoleUid) == 0 {
dataJSON.Code = -1 dataJSON.Code = -1
return dataJSON return dataJSON
@@ -190,28 +190,28 @@ func (c *AddService) SavePower(roleUid string, firstMenuUids, secondMenuUids, po
roleInfo.ShowSecondUid = strings.Join(secondMenuUids, "||") roleInfo.ShowSecondUid = strings.Join(secondMenuUids, "||")
roleInfo.ShowPowerUid = strings.Join(powerIds, "||") roleInfo.ShowPowerUid = strings.Join(powerIds, "||")
menuInfoList := system2.GetMenuInfosByMenuUids(firstMenuUids) menuInfoList := system.GetMenuInfosByMenuUids(firstMenuUids)
showFirstMenu := make([]string, 0) showFirstMenu := make([]string, 0)
for _, m := range menuInfoList { for _, m := range menuInfoList {
showFirstMenu = append(showFirstMenu, m.FirstMenu) showFirstMenu = append(showFirstMenu, m.FirstMenu)
} }
roleInfo.ShowFirstMenu = strings.Join(showFirstMenu, "||") roleInfo.ShowFirstMenu = strings.Join(showFirstMenu, "||")
secondMenuInfoList := system2.GetSecondMenuInfoBySecondMenuUids(secondMenuUids) secondMenuInfoList := system.GetSecondMenuInfoBySecondMenuUids(secondMenuUids)
showSecondMenu := make([]string, 0) showSecondMenu := make([]string, 0)
for _, m := range secondMenuInfoList { for _, m := range secondMenuInfoList {
showSecondMenu = append(showSecondMenu, m.SecondMenu) showSecondMenu = append(showSecondMenu, m.SecondMenu)
} }
roleInfo.ShowSecondMenu = strings.Join(showSecondMenu, "||") roleInfo.ShowSecondMenu = strings.Join(showSecondMenu, "||")
powerList := system2.GetPowerByIds(powerIds) powerList := system.GetPowerByIds(powerIds)
showPower := make([]string, 0) showPower := make([]string, 0)
for _, p := range powerList { for _, p := range powerList {
showPower = append(showPower, p.PowerItem) showPower = append(showPower, p.PowerItem)
} }
roleInfo.ShowPower = strings.Join(showPower, "||") roleInfo.ShowPower = strings.Join(showPower, "||")
if !system2.UpdateRoleInfo(roleInfo) { if !system.UpdateRoleInfo(roleInfo) {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "更新roleInfo失败" dataJSON.Msg = "更新roleInfo失败"
} else { } else {
@@ -241,7 +241,7 @@ func (c *AddService) AddOperator(loginAccount, loginPassword, role, status, rema
if len(remark) == 0 { if len(remark) == 0 {
remark = loginAccount remark = loginAccount
} }
roleInfo := system2.GetRoleByRoleUid(role) roleInfo := system.GetRoleByRoleUid(role)
userInfo := user.UserInfo{ userInfo := user.UserInfo{
UserId: loginAccount, UserId: loginAccount,
Passwd: utils.GetMD5Upper(loginPassword), Passwd: utils.GetMD5Upper(loginPassword),
@@ -295,8 +295,8 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
logs.Error("添加银行卡校验失败") logs.Error("添加银行卡校验失败")
} else { } else {
if len(uid) > 0 { if len(uid) > 0 {
bankCardInfo := system2.GetBankCardByUid(uid) bankCardInfo := system.GetBankCardByUid(uid)
bankCardInfo = system2.BankCardInfo{ bankCardInfo = system.BankCardInfo{
Id: bankCardInfo.Id, Id: bankCardInfo.Id,
UserName: userName, UserName: userName,
BankName: bankName, BankName: bankName,
@@ -312,11 +312,11 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
CreateTime: bankCardInfo.CreateTime, CreateTime: bankCardInfo.CreateTime,
Uid: bankCardInfo.Uid, Uid: bankCardInfo.Uid,
} }
if system2.UpdateBankCard(bankCardInfo) { if system.UpdateBankCard(bankCardInfo) {
dataJSON.Code = 200 dataJSON.Code = 200
} }
} else { } else {
bankCardInfo := system2.BankCardInfo{ bankCardInfo := system.BankCardInfo{
Uid: "3333" + xid.New().String(), Uid: "3333" + xid.New().String(),
UserName: userName, UserName: userName,
BankName: bankName, BankName: bankName,
@@ -332,7 +332,7 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
CreateTime: time.Now(), CreateTime: time.Now(),
} }
if system2.InsertBankCardInfo(bankCardInfo) { if system.InsertBankCardInfo(bankCardInfo) {
dataJSON.Code = 200 dataJSON.Code = 200
} }
} }
@@ -340,9 +340,11 @@ func (c *AddService) AddBankCard(userName, bankCode, accountName, certificateTyp
return dataJSON return dataJSON
} }
func (c *AddService) AddRoad(startHour, endHour, roadName, productUid, func (c *AddService) AddRoad(
startHour, endHour, roadName, productUid,
basicRate, settleFee, roadTotalLimit, roadEverydayLimit, basicRate, settleFee, roadTotalLimit, roadEverydayLimit,
singleMinLimit, singleMaxLimit, roadUid, roadRemark, params, productCode, paymentHtml string) *datas.BaseDataJSON { singleMinLimit, singleMaxLimit, roadUid, roadRemark, params, productCode, paymentHtml, transactionType string,
) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1 dataJSON.Code = -1
@@ -395,16 +397,15 @@ func (c *AddService) AddRoad(startHour, endHour, roadName, productUid,
return dataJSON return dataJSON
} }
productName := "" productName := ""
supplierMap := common2.GetSupplierMap() supplierMap := common.GetSupplierMap()
for k, v := range supplierMap { for k, v := range supplierMap {
if k == productUid { if k == productUid {
productName = v productName = v
} }
} }
if len(roadUid) > 0 { if len(roadUid) > 0 {
//更新通道 //更新通道
roadInfo := road2.GetRoadInfoByRoadUid(roadUid) roadInfo := road.GetRoadInfoByRoadUid(roadUid)
roadInfo.RoadName = roadName roadInfo.RoadName = roadName
roadInfo.Remark = roadRemark roadInfo.Remark = roadRemark
roadInfo.ProductUid = productUid roadInfo.ProductUid = productUid
@@ -420,8 +421,9 @@ func (c *AddService) AddRoad(startHour, endHour, roadName, productUid,
roadInfo.Params = params roadInfo.Params = params
roadInfo.ProductCode = productCode roadInfo.ProductCode = productCode
roadInfo.PaymentHtml = paymentHtml roadInfo.PaymentHtml = paymentHtml
roadInfo.TransactionType = transactionType
if road2.UpdateRoadInfo(roadInfo) { if road.UpdateRoadInfo(roadInfo) {
dataJSON.Code = 200 dataJSON.Code = 200
} else { } else {
dataJSON.Msg = "通道更新失败" dataJSON.Msg = "通道更新失败"
@@ -429,28 +431,31 @@ func (c *AddService) AddRoad(startHour, endHour, roadName, productUid,
} else { } else {
//添加新的通道 //添加新的通道
roadUid = "4444" + xid.New().String() roadUid = "4444" + xid.New().String()
roadInfo := road2.RoadInfo{ roadInfo := road.RoadInfo{
RoadName: roadName, ProductCode: productCode,
RoadUid: roadUid, RoadName: roadName,
Remark: roadRemark, RoadUid: roadUid,
ProductUid: productUid, Remark: roadRemark,
ProductName: productName, ProductUid: productUid,
BasicFee: basicFee, ProductName: productName,
SettleFee: settleFeeTmp, BasicFee: basicFee,
TotalLimit: totalLimit, SettleFee: settleFeeTmp,
TodayLimit: todayLimit, TotalLimit: totalLimit,
SingleMinLimit: singleMinLimitTmp, TodayLimit: todayLimit,
Balance: common2.ZERO, SingleMinLimit: singleMinLimitTmp,
SingleMaxLimit: singleMaxLimitTmp, Balance: common.ZERO,
StarHour: startHourTmp, SingleMaxLimit: singleMaxLimitTmp,
EndHour: endHourTmp, StarHour: startHourTmp,
Status: "active", EndHour: endHourTmp,
Params: params, Status: "active",
UpdateTime: time.Now(), Params: params,
CreateTime: time.Now(), TransactionType: transactionType,
PaymentHtml: paymentHtml,
UpdateTime: time.Now(),
CreateTime: time.Now(),
} }
if road2.InsertRoadInfo(roadInfo) { if road.InsertRoadInfo(roadInfo) {
dataJSON.Code = 200 dataJSON.Code = 200
} else { } else {
dataJSON.Msg = "添加新通道失败" dataJSON.Msg = "添加新通道失败"
@@ -470,7 +475,7 @@ func (c *AddService) AddRoadPool(roadPoolName, roadPoolCode string) *datas.KeyDa
keyDataJSON.Msg = "*通道池编号不能为空" keyDataJSON.Msg = "*通道池编号不能为空"
} }
roadPoolInfo := road2.RoadPoolInfo{ roadPoolInfo := road.RoadPoolInfo{
Status: "active", Status: "active",
RoadPoolName: roadPoolName, RoadPoolName: roadPoolName,
RoadPoolCode: roadPoolCode, RoadPoolCode: roadPoolCode,
@@ -478,7 +483,7 @@ func (c *AddService) AddRoadPool(roadPoolName, roadPoolCode string) *datas.KeyDa
CreateTime: time.Now(), CreateTime: time.Now(),
} }
if road2.InsertRoadPool(roadPoolInfo) { if road.InsertRoadPool(roadPoolInfo) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
keyDataJSON.Msg = "添加通道池成功" keyDataJSON.Msg = "添加通道池成功"
} else { } else {
@@ -491,14 +496,14 @@ func (c *AddService) AddRoadPool(roadPoolName, roadPoolCode string) *datas.KeyDa
func (c *AddService) SaveRoadUid(roadPoolCode string, roadUids []string) *datas.BaseDataJSON { func (c *AddService) SaveRoadUid(roadPoolCode string, roadUids []string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1 dataJSON.Code = -1
roadPoolInfo := road2.GetRoadPoolByRoadPoolCode(roadPoolCode) roadPoolInfo := road.GetRoadPoolByRoadPoolCode(roadPoolCode)
if roadPoolInfo.RoadPoolCode == "" { if roadPoolInfo.RoadPoolCode == "" {
return dataJSON return dataJSON
} }
var uids []string var uids []string
for _, uid := range roadUids { for _, uid := range roadUids {
//去掉空格 //去掉空格
if len(uid) > 0 && road2.RoadInfoExistByRoadUid(uid) { if len(uid) > 0 && road.RoadInfoExistByRoadUid(uid) {
uids = append(uids, uid) uids = append(uids, uid)
} }
} }
@@ -507,7 +512,7 @@ func (c *AddService) SaveRoadUid(roadPoolCode string, roadUids []string) *datas.
roadPoolInfo.RoadUidPool = roadUid roadPoolInfo.RoadUidPool = roadUid
} }
roadPoolInfo.UpdateTime = time.Now() roadPoolInfo.UpdateTime = time.Now()
if road2.UpdateRoadPool(roadPoolInfo) { if road.UpdateRoadPool(roadPoolInfo) {
dataJSON.Code = 200 dataJSON.Code = 200
} }
return dataJSON return dataJSON
@@ -607,7 +612,7 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = "#merchant-name-error" keyDataJSON.Key = "#merchant-name-error"
keyDataJSON.Msg = "商户名称为空" keyDataJSON.Msg = "商户名称为空"
} else if merchant2.IsExistByMerchantName(merchantName) { } else if merchant.IsExistByMerchantName(merchantName) {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = "#merchant-name-error" keyDataJSON.Key = "#merchant-name-error"
keyDataJSON.Msg = "商户名已经存在" keyDataJSON.Msg = "商户名已经存在"
@@ -615,7 +620,7 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = "#merchant-phone-error" keyDataJSON.Key = "#merchant-phone-error"
keyDataJSON.Msg = "手机号为空" keyDataJSON.Msg = "手机号为空"
} else if merchant2.IsExistByMerchantPhone(phone) { } else if merchant.IsExistByMerchantPhone(phone) {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Key = "#merchant-phone-error" keyDataJSON.Key = "#merchant-phone-error"
keyDataJSON.Msg = "该手机号已经注册" keyDataJSON.Msg = "该手机号已经注册"
@@ -639,7 +644,7 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
merchantUid := "8888" + xid.New().String() merchantUid := "8888" + xid.New().String()
merchantKey := "kkkk" + xid.New().String() //商户key merchantKey := "kkkk" + xid.New().String() //商户key
merchantSecret := "ssss" + xid.New().String() //商户密钥 merchantSecret := "ssss" + xid.New().String() //商户密钥
merchantInfo := merchant2.MerchantInfo{ merchantInfo := merchant.MerchantInfo{
MerchantName: merchantName, MerchantName: merchantName,
MerchantUid: merchantUid, MerchantUid: merchantUid,
LoginAccount: phone, LoginAccount: phone,
@@ -652,7 +657,7 @@ func (c *AddService) AddMerchant(merchantName, phone, loginPassword,
CreateTime: time.Now(), CreateTime: time.Now(),
} }
if merchant2.InsertMerchantInfo(merchantInfo) { if merchant.InsertMerchantInfo(merchantInfo) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
} else { } else {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
@@ -687,7 +692,7 @@ func (c *AddService) AddMerchantDeploy(merchantUid, isAutoSettle, isAutoPayfor,
belongAgentUid, payforRoadChoose, rollPayforRoadChoose, payforFee string) *datas.KeyDataJSON { belongAgentUid, payforRoadChoose, rollPayforRoadChoose, payforFee string) *datas.KeyDataJSON {
keyDataJSON := new(datas.KeyDataJSON) keyDataJSON := new(datas.KeyDataJSON)
merchantInfo := merchant2.GetMerchantByUid(merchantUid) merchantInfo := merchant.GetMerchantByUid(merchantUid)
merchantInfo.AutoSettle = isAutoSettle merchantInfo.AutoSettle = isAutoSettle
merchantInfo.AutoPayFor = isAutoPayfor merchantInfo.AutoPayFor = isAutoPayfor
merchantInfo.WhiteIps = ipWhite merchantInfo.WhiteIps = ipWhite
@@ -695,22 +700,22 @@ func (c *AddService) AddMerchantDeploy(merchantUid, isAutoSettle, isAutoPayfor,
merchantInfo.BelongAgentUid = belongAgentUid merchantInfo.BelongAgentUid = belongAgentUid
if payforRoadChoose != "" { if payforRoadChoose != "" {
roadInfo := road2.GetRoadInfoByName(payforRoadChoose) roadInfo := road.GetRoadInfoByName(payforRoadChoose)
merchantInfo.SinglePayForRoadName = payforRoadChoose merchantInfo.SinglePayForRoadName = payforRoadChoose
merchantInfo.SinglePayForRoadUid = roadInfo.RoadUid merchantInfo.SinglePayForRoadUid = roadInfo.RoadUid
} }
if rollPayforRoadChoose != "" { if rollPayforRoadChoose != "" {
rollPoolInfo := road2.GetRoadPoolByName(rollPayforRoadChoose) rollPoolInfo := road.GetRoadPoolByName(rollPayforRoadChoose)
merchantInfo.RollPayForRoadName = rollPayforRoadChoose merchantInfo.RollPayForRoadName = rollPayforRoadChoose
merchantInfo.RollPayForRoadCode = rollPoolInfo.RoadPoolCode merchantInfo.RollPayForRoadCode = rollPoolInfo.RoadPoolCode
} }
tmp, err := strconv.ParseFloat(payforFee, 64) tmp, err := strconv.ParseFloat(payforFee, 64)
if err != nil { if err != nil {
logs.Error("手续费由字符串转为float64失败") logs.Error("手续费由字符串转为float64失败")
tmp = common2.PAYFOR_FEE tmp = common.PAYFOR_FEE
} }
merchantInfo.PayforFee = tmp merchantInfo.PayforFee = tmp
if merchant2.UpdateMerchant(merchantInfo) { if merchant.UpdateMerchant(merchantInfo) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
} else { } else {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
@@ -744,7 +749,7 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
keyDataJSON.Msg = "轮询通道平台利润率不能为0" keyDataJSON.Msg = "轮询通道平台利润率不能为0"
} }
if !merchant2.CheckMarginValid(singleRoadPlatformFee) { if !merchant.CheckMarginValid(singleRoadPlatformFee) {
keyDataJSON.Code = -1 keyDataJSON.Code = -1
keyDataJSON.Msg = "费率映射设置错误!" keyDataJSON.Msg = "费率映射设置错误!"
} }
@@ -779,7 +784,7 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
j = 0 j = 0
} }
var merchantDeployInfo merchant2.MerchantDeployInfo var merchantDeployInfo merchant.MerchantDeployInfo
merchantDeployInfo.MerchantUid = merchantNo merchantDeployInfo.MerchantUid = merchantNo
merchantDeployInfo.PayType = payType merchantDeployInfo.PayType = payType
merchantDeployInfo.SingleRoadName = singleRoad merchantDeployInfo.SingleRoadName = singleRoad
@@ -792,16 +797,16 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
merchantDeployInfo.LoanDays = i merchantDeployInfo.LoanDays = i
merchantDeployInfo.UnfreezeHour = j merchantDeployInfo.UnfreezeHour = j
merchantDeployInfo.RollRoadName = rollPoolRoad merchantDeployInfo.RollRoadName = rollPoolRoad
roadInfo := road2.GetRoadInfoByName(singleRoad) roadInfo := road.GetRoadInfoByName(singleRoad)
rollPoolInfo := road2.GetRoadPoolByName(rollPoolRoad) rollPoolInfo := road.GetRoadPoolByName(rollPoolRoad)
merchantDeployInfo.SingleRoadUid = roadInfo.RoadUid merchantDeployInfo.SingleRoadUid = roadInfo.RoadUid
merchantDeployInfo.RollRoadCode = rollPoolInfo.RoadPoolCode merchantDeployInfo.RollRoadCode = rollPoolInfo.RoadPoolCode
//如果该用户的改支付类型已经存在,那么进行更新,否则进行添加 //如果该用户的改支付类型已经存在,那么进行更新,否则进行添加
if merchant2.IsExistByUidAndPayType(merchantNo, payType) { if merchant.IsExistByUidAndPayType(merchantNo, payType) {
if singleRoad == "" && rollPoolRoad == "" { if singleRoad == "" && rollPoolRoad == "" {
//表示需要删除该支付类型的通道 //表示需要删除该支付类型的通道
if merchant2.DeleteMerchantDeployByUidAndPayType(merchantNo, payType) { if merchant.DeleteMerchantDeployByUidAndPayType(merchantNo, payType) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
keyDataJSON.Msg = "删除该支付类型通道成功" keyDataJSON.Msg = "删除该支付类型通道成功"
} else { } else {
@@ -809,12 +814,12 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
keyDataJSON.Msg = "删除该支付类型通道失败" keyDataJSON.Msg = "删除该支付类型通道失败"
} }
} else { } else {
tmpInfo := merchant2.GetMerchantDeployByUidAndPayType(merchantNo, payType) tmpInfo := merchant.GetMerchantDeployByUidAndPayType(merchantNo, payType)
merchantDeployInfo.Id = tmpInfo.Id merchantDeployInfo.Id = tmpInfo.Id
merchantDeployInfo.Status = tmpInfo.Status merchantDeployInfo.Status = tmpInfo.Status
merchantDeployInfo.UpdateTime = time.Now() merchantDeployInfo.UpdateTime = time.Now()
merchantDeployInfo.CreateTime = tmpInfo.CreateTime merchantDeployInfo.CreateTime = tmpInfo.CreateTime
if merchant2.UpdateMerchantDeploy(merchantDeployInfo) { if merchant.UpdateMerchantDeploy(merchantDeployInfo) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
keyDataJSON.Msg = "更新成功" keyDataJSON.Msg = "更新成功"
} else { } else {
@@ -829,8 +834,8 @@ func (c *AddService) AddMerchantPayType(payType, singleRoad, rollPoolRoad,
} else { } else {
merchantDeployInfo.CreateTime = time.Now() merchantDeployInfo.CreateTime = time.Now()
merchantDeployInfo.UpdateTime = time.Now() merchantDeployInfo.UpdateTime = time.Now()
merchantDeployInfo.Status = common2.ACTIVE merchantDeployInfo.Status = common.ACTIVE
if merchant2.InsertMerchantDeployInfo(merchantDeployInfo) { if merchant.InsertMerchantDeployInfo(merchantDeployInfo) {
keyDataJSON.Code = 200 keyDataJSON.Code = 200
keyDataJSON.Msg = "添加支付类型成功" keyDataJSON.Msg = "添加支付类型成功"
} else { } else {
@@ -866,12 +871,12 @@ func (c *AddService) AddPayFor(merchantUid, bankUid, payForAmount, bankNo, accou
} }
accountInfo := accounts.GetAccountByUid(merchantUid) accountInfo := accounts.GetAccountByUid(merchantUid)
if accountInfo.SettleAmount < money+common2.PAYFOR_FEE { if accountInfo.SettleAmount < money+common.PAYFOR_FEE {
keyDataJSON.Msg = "用户可用金额不够" keyDataJSON.Msg = "用户可用金额不够"
return keyDataJSON return keyDataJSON
} }
bankInfo := system2.GetBankCardByUid(bankUid) bankInfo := system.GetBankCardByUid(bankUid)
if bankInfo.BankNo != bankNo || bankInfo.AccountName != accountName || bankInfo.PhoneNo != phone { if bankInfo.BankNo != bankNo || bankInfo.AccountName != accountName || bankInfo.PhoneNo != phone {
keyDataJSON.Msg = "银行卡信息有误,请连接管理员" keyDataJSON.Msg = "银行卡信息有误,请连接管理员"
@@ -884,16 +889,16 @@ func (c *AddService) AddPayFor(merchantUid, bankUid, payForAmount, bankNo, accou
MerchantName: merchantName, PhoneNo: phone, MerchantName: merchantName, PhoneNo: phone,
MerchantOrderId: xid.New().String(), MerchantOrderId: xid.New().String(),
BankOrderId: "4444" + xid.New().String(), BankOrderId: "4444" + xid.New().String(),
PayforFee: common2.PAYFOR_FEE, Type: common2.SELF_MERCHANT, PayforFee: common.PAYFOR_FEE, Type: common.SELF_MERCHANT,
PayforAmount: money, PayforAmount: money,
PayforTotalAmount: money + common2.PAYFOR_FEE, PayforTotalAmount: money + common.PAYFOR_FEE,
BankCode: bankInfo.BankCode, BankCode: bankInfo.BankCode,
BankName: bankName, IsSend: common2.NO, BankName: bankName, IsSend: common.NO,
BankAccountName: bankInfo.AccountName, BankAccountName: bankInfo.AccountName,
BankAccountNo: bankInfo.BankNo, BankAccountNo: bankInfo.BankNo,
BankAccountType: bankInfo.BankAccountType, BankAccountType: bankInfo.BankAccountType,
BankAccountAddress: bankAddress, BankAccountAddress: bankAddress,
Status: common2.PAYFOR_COMFRIM, Status: common.PAYFOR_COMFRIM,
RequestTime: time.Now(), RequestTime: time.Now(),
CreateTime: time.Now(), CreateTime: time.Now(),
UpdateTime: time.Now(), UpdateTime: time.Now(),
@@ -926,7 +931,7 @@ func (c *AddService) AddSelfPayFor(bankUid, payForAmount, accountName,
return keyDataJSON return keyDataJSON
} }
bankInfo := system2.GetBankCardByUid(bankUid) bankInfo := system.GetBankCardByUid(bankUid)
//需要对前端传入的数据做校验,不能完全相信前端的数据 //需要对前端传入的数据做校验,不能完全相信前端的数据
if bankInfo.AccountName != accountName || bankInfo.BankNo != bankNo || bankInfo.PhoneNo != phone { if bankInfo.AccountName != accountName || bankInfo.BankNo != bankNo || bankInfo.PhoneNo != phone {
@@ -937,18 +942,18 @@ func (c *AddService) AddSelfPayFor(bankUid, payForAmount, accountName,
selfPayFor := payfor.PayforInfo{ selfPayFor := payfor.PayforInfo{
PayforUid: "pppp" + xid.New().String(), PayforUid: "pppp" + xid.New().String(),
BankOrderId: "4444" + xid.New().String(), BankOrderId: "4444" + xid.New().String(),
PayforFee: common2.ZERO, PayforFee: common.ZERO,
Type: common2.SELF_HELP, Type: common.SELF_HELP,
PayforAmount: money, PayforAmount: money,
PayforTotalAmount: money + common2.ZERO, PayforTotalAmount: money + common.ZERO,
BankCode: bankInfo.BankCode, BankCode: bankInfo.BankCode,
BankName: bankName, BankName: bankName,
IsSend: common2.NO, IsSend: common.NO,
BankAccountName: bankInfo.AccountName, BankAccountName: bankInfo.AccountName,
BankAccountNo: bankInfo.BankNo, BankAccountNo: bankInfo.BankNo,
BankAccountType: bankInfo.BankAccountType, BankAccountType: bankInfo.BankAccountType,
BankAccountAddress: bankAddress, BankAccountAddress: bankAddress,
Status: common2.PAYFOR_COMFRIM, Status: common.PAYFOR_COMFRIM,
CreateTime: time.Now(), CreateTime: time.Now(),
UpdateTime: time.Now(), UpdateTime: time.Now(),
} }

View File

@@ -5,8 +5,8 @@ import (
"boss/internal/models/accounts" "boss/internal/models/accounts"
"boss/internal/models/agent" "boss/internal/models/agent"
"boss/internal/models/merchant" "boss/internal/models/merchant"
road2 "boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
"github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/core/logs"
"sort" "sort"
@@ -24,27 +24,27 @@ func (c *DeleteService) Finish() {
remainderSecondMenu := make([]string, 0) remainderSecondMenu := make([]string, 0)
remainderPowerId := make([]string, 0) remainderPowerId := make([]string, 0)
remainderPower := make([]string, 0) remainderPower := make([]string, 0)
allRoleInfo := system2.GetRole() allRoleInfo := system.GetRole()
//如果有删除任何的东西,需要重新赋值权限 //如果有删除任何的东西,需要重新赋值权限
for _, r := range allRoleInfo { for _, r := range allRoleInfo {
for _, showFirstUid := range strings.Split(r.ShowFirstUid, "||") { for _, showFirstUid := range strings.Split(r.ShowFirstUid, "||") {
if system2.FirstMenuUidIsExists(showFirstUid) { if system.FirstMenuUidIsExists(showFirstUid) {
remainderFirstMenuUid = append(remainderFirstMenuUid, showFirstUid) remainderFirstMenuUid = append(remainderFirstMenuUid, showFirstUid)
menuInfo := system2.GetMenuInfoByMenuUid(showFirstUid) menuInfo := system.GetMenuInfoByMenuUid(showFirstUid)
remainderFirstMenu = append(remainderFirstMenu, menuInfo.FirstMenu) remainderFirstMenu = append(remainderFirstMenu, menuInfo.FirstMenu)
} }
} }
for _, showSecondUid := range strings.Split(r.ShowSecondUid, "||") { for _, showSecondUid := range strings.Split(r.ShowSecondUid, "||") {
if system2.SecondMenuUidIsExists(showSecondUid) { if system.SecondMenuUidIsExists(showSecondUid) {
remainderSecondMenuUid = append(remainderSecondMenuUid, showSecondUid) remainderSecondMenuUid = append(remainderSecondMenuUid, showSecondUid)
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(showSecondUid) secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(showSecondUid)
remainderSecondMenu = append(remainderSecondMenu, secondMenuInfo.SecondMenu) remainderSecondMenu = append(remainderSecondMenu, secondMenuInfo.SecondMenu)
} }
} }
for _, showPowerId := range strings.Split(r.ShowPowerUid, "||") { for _, showPowerId := range strings.Split(r.ShowPowerUid, "||") {
if system2.PowerUidExists(showPowerId) { if system.PowerUidExists(showPowerId) {
remainderPowerId = append(remainderPowerId, showPowerId) remainderPowerId = append(remainderPowerId, showPowerId)
powerInfo := system2.GetPowerById(showPowerId) powerInfo := system.GetPowerById(showPowerId)
remainderPower = append(remainderPower, powerInfo.PowerItem) remainderPower = append(remainderPower, powerInfo.PowerItem)
} }
} }
@@ -55,22 +55,22 @@ func (c *DeleteService) Finish() {
r.ShowPowerUid = strings.Join(remainderPowerId, "||") r.ShowPowerUid = strings.Join(remainderPowerId, "||")
r.ShowPower = strings.Join(remainderPower, "||") r.ShowPower = strings.Join(remainderPower, "||")
r.UpdateTime = time.Now() r.UpdateTime = time.Now()
system2.UpdateRoleInfo(r) system.UpdateRoleInfo(r)
} }
} }
func (c *DeleteService) DeleteMenu(menuUid, userID string) *datas.BaseDataJSON { func (c *DeleteService) DeleteMenu(menuUid, userID string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
menuInfo := system2.GetMenuInfoByMenuUid(menuUid) menuInfo := system.GetMenuInfoByMenuUid(menuUid)
if menuInfo.MenuUid == "" { if menuInfo.MenuUid == "" {
dataJSON.Msg = "不存在该菜单" dataJSON.Msg = "不存在该菜单"
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
logs.Info(userID + ",执行了删除一级菜单操作") logs.Info(userID + ",执行了删除一级菜单操作")
system2.DeleteMenuInfo(menuUid) system.DeleteMenuInfo(menuUid)
//删除该一级目下下的所有二级目录 //删除该一级目下下的所有二级目录
system2.DeleteSecondMenuByFirstMenuUid(menuUid) system.DeleteSecondMenuByFirstMenuUid(menuUid)
SortFirstMenuOrder() SortFirstMenuOrder()
dataJSON.Code = 200 dataJSON.Code = 200
} }
@@ -79,27 +79,27 @@ func (c *DeleteService) DeleteMenu(menuUid, userID string) *datas.BaseDataJSON {
} }
func (c *DeleteService) DeleteSecondMenu(secondMenuUid string) *datas.BaseDataJSON { func (c *DeleteService) DeleteSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(secondMenuUid) secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
if secondMenuUid == "" || secondMenuInfo.SecondMenuUid == "" { if secondMenuUid == "" || secondMenuInfo.SecondMenuUid == "" {
dataJSON.Code = -1 dataJSON.Code = -1
dataJSON.Msg = "该二级菜单不存在" dataJSON.Msg = "该二级菜单不存在"
} else { } else {
if system2.DeleteSecondMenuBySecondMenuUid(secondMenuUid) { if system.DeleteSecondMenuBySecondMenuUid(secondMenuUid) {
dataJSON.Code = 200 dataJSON.Code = 200
ml := system2.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid) ml := system.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid)
//删除该二级页面下的所有权限项 //删除该二级页面下的所有权限项
system2.DeletePowerBySecondUid(secondMenuUid) system.DeletePowerBySecondUid(secondMenuUid)
if ml == 0 { if ml == 0 {
//如果该二级类目已经被全部删除,那么对应的一级类目也应当删除 //如果该二级类目已经被全部删除,那么对应的一级类目也应当删除
system2.DeleteMenuInfo(secondMenuInfo.FirstMenuUid) system.DeleteMenuInfo(secondMenuInfo.FirstMenuUid)
SortFirstMenuOrder() SortFirstMenuOrder()
} else { } else {
secondMenuInfoList := system2.GetSecondMenuListByFirstMenuUid(secondMenuInfo.FirstMenuUid) secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(secondMenuInfo.FirstMenuUid)
sort.Sort(system2.SecondMenuSlice(secondMenuInfoList)) sort.Sort(system.SecondMenuSlice(secondMenuInfoList))
for i := 0; i < len(secondMenuInfoList); i++ { for i := 0; i < len(secondMenuInfoList); i++ {
m := secondMenuInfoList[i] m := secondMenuInfoList[i]
system2.UpdateSecondMenuOrderBySecondUid(m.SecondMenuUid, i+1) system.UpdateSecondMenuOrderBySecondUid(m.SecondMenuUid, i+1)
} }
} }
} else { } else {
@@ -111,7 +111,7 @@ func (c *DeleteService) DeleteSecondMenu(secondMenuUid string) *datas.BaseDataJS
} }
func (c *DeleteService) DeletePowerItem(powerID string) *datas.BaseDataJSON { func (c *DeleteService) DeletePowerItem(powerID string) *datas.BaseDataJSON {
system2.DeletePowerItemByPowerID(powerID) system.DeletePowerItemByPowerID(powerID)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = 200 dataJSON.Code = 200
return dataJSON return dataJSON
@@ -120,7 +120,7 @@ func (c *DeleteService) DeletePowerItem(powerID string) *datas.BaseDataJSON {
func (c *DeleteService) DeleteRole(roleUid string) *datas.BaseDataJSON { func (c *DeleteService) DeleteRole(roleUid string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
if system2.DeleteRoleByRoleUid(roleUid) { if system.DeleteRoleByRoleUid(roleUid) {
dataJSON.Code = 200 dataJSON.Code = 200
} else { } else {
dataJSON.Code = -1 dataJSON.Code = -1
@@ -145,7 +145,7 @@ func (c *DeleteService) DeleteBankCardRecord(uid string) *datas.BankCardDataJSON
dataJSON := new(datas.BankCardDataJSON) dataJSON := new(datas.BankCardDataJSON)
dataJSON.Code = -1 dataJSON.Code = -1
if system2.DeleteBankCardByUid(uid) { if system.DeleteBankCardByUid(uid) {
dataJSON.Code = 200 dataJSON.Code = 200
} }
return dataJSON return dataJSON
@@ -156,11 +156,11 @@ func (c *DeleteService) DeleteRoad(roadUid string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1 dataJSON.Code = -1
if road2.DeleteRoadByRoadUid(roadUid) { if road.DeleteRoadByRoadUid(roadUid) {
dataJSON.Code = 200 dataJSON.Code = 200
} }
params := make(map[string]string) params := make(map[string]string)
roadPoolInfoList := road2.GetAllRollPool(params) roadPoolInfoList := road.GetAllRollPool(params)
//将轮询池中的对应的通道删除 //将轮询池中的对应的通道删除
for _, roadPoolInfo := range roadPoolInfoList { for _, roadPoolInfo := range roadPoolInfoList {
var uids []string var uids []string
@@ -172,7 +172,7 @@ func (c *DeleteService) DeleteRoad(roadUid string) *datas.BaseDataJSON {
} }
roadPoolInfo.RoadUidPool = strings.Join(uids, "||") roadPoolInfo.RoadUidPool = strings.Join(uids, "||")
roadPoolInfo.UpdateTime = time.Now() roadPoolInfo.UpdateTime = time.Now()
road2.UpdateRoadPool(roadPoolInfo) road.UpdateRoadPool(roadPoolInfo)
} }
return dataJSON return dataJSON
} }
@@ -181,7 +181,7 @@ func (c *DeleteService) DeleteRoadPool(roadPoolCode string) *datas.BaseDataJSON
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1 dataJSON.Code = -1
if road2.DeleteRoadPoolByCode(roadPoolCode) { if road.DeleteRoadPoolByCode(roadPoolCode) {
dataJSON.Code = 200 dataJSON.Code = 200
} else { } else {
dataJSON.Msg = "删除通道池失败" dataJSON.Msg = "删除通道池失败"
@@ -264,14 +264,14 @@ func (c *DeleteService) DeleteAgentRelation(merchantUid string) *datas.KeyDataJS
* 对一级菜单重新进行排序 * 对一级菜单重新进行排序
*/ */
func SortFirstMenuOrder() { func SortFirstMenuOrder() {
menuInfoList := system2.GetMenuAll() menuInfoList := system.GetMenuAll()
sort.Sort(system2.MenuInfoSlice(menuInfoList)) sort.Sort(system.MenuInfoSlice(menuInfoList))
for i := 0; i < len(menuInfoList); i++ { for i := 0; i < len(menuInfoList); i++ {
m := menuInfoList[i] m := menuInfoList[i]
m.UpdateTime = time.Now() m.UpdateTime = time.Now()
m.MenuOrder = i + 1 m.MenuOrder = i + 1
system2.UpdateMenuInfo(m) system.UpdateMenuInfo(m)
//对应的二级菜单也应该重新分配顺序号 //对应的二级菜单也应该重新分配顺序号
SortSecondMenuOrder(m) SortSecondMenuOrder(m)
} }
@@ -280,13 +280,13 @@ func SortFirstMenuOrder() {
/* /*
* 对二级菜单分配顺序号 * 对二级菜单分配顺序号
*/ */
func SortSecondMenuOrder(firstMenuInfo system2.MenuInfo) { func SortSecondMenuOrder(firstMenuInfo system.MenuInfo) {
secondMenuInfoList := system2.GetSecondMenuListByFirstMenuUid(firstMenuInfo.MenuUid) secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(firstMenuInfo.MenuUid)
for _, sm := range secondMenuInfoList { for _, sm := range secondMenuInfoList {
sm.FirstMenuOrder = firstMenuInfo.MenuOrder sm.FirstMenuOrder = firstMenuInfo.MenuOrder
sm.UpdateTime = time.Now() sm.UpdateTime = time.Now()
system2.UpdateSecondMenu(sm) system.UpdateSecondMenu(sm)
//删除下下一级的所有权限项 //删除下下一级的所有权限项
system2.DeletePowerBySecondUid(sm.SecondMenuUid) system.DeletePowerBySecondUid(sm.SecondMenuUid)
} }
} }

View File

@@ -3,7 +3,7 @@ package service
import ( import (
"boss/internal/common" "boss/internal/common"
"boss/internal/datas" "boss/internal/datas"
order2 "boss/internal/models/order" "boss/internal/models/order"
"boss/internal/models/payfor" "boss/internal/models/payfor"
"boss/internal/models/road" "boss/internal/models/road"
"boss/internal/models/user" "boss/internal/models/user"
@@ -21,7 +21,7 @@ type QueryService struct {
} }
func OrderQuery(bankOrderId string) string { func OrderQuery(bankOrderId string) string {
orderInfo := order2.GetOrderByBankOrderId(bankOrderId) orderInfo := order.GetOrderByBankOrderId(bankOrderId)
if orderInfo.BankOrderId == "" || len(orderInfo.BankOrderId) == 0 { if orderInfo.BankOrderId == "" || len(orderInfo.BankOrderId) == 0 {
logs.Error("不存在这样的订单,订单查询结束") logs.Error("不存在这样的订单,订单查询结束")
return "不存在这样的订单" return "不存在这样的订单"
@@ -47,7 +47,7 @@ func OrderQuery(bankOrderId string) string {
func (c *QueryService) SupplierOrderQuery(bankOrderId string) *datas.KeyDataJSON { func (c *QueryService) SupplierOrderQuery(bankOrderId string) *datas.KeyDataJSON {
keyDataJSON := new(datas.KeyDataJSON) keyDataJSON := new(datas.KeyDataJSON)
keyDataJSON.Code = 200 keyDataJSON.Code = 200
exist := order2.BankOrderIdIsExist(bankOrderId) exist := order.BankOrderIdIsExist(bankOrderId)
if !exist { if !exist {
keyDataJSON.Msg = "该订单不存在" keyDataJSON.Msg = "该订单不存在"
keyDataJSON.Code = -1 keyDataJSON.Code = -1
@@ -97,13 +97,13 @@ func querySupplierPayForResult(bankOrderId string) bool {
} }
} }
func QueryTotalSummary(params map[string]string) order2.Summary { func QueryTotalSummary(params map[string]string) order.Summary {
orderInfoList := order2.GetOrderByMap(params, -1, 0) orderInfoList := order.GetOrderByMap(params, -1, 0)
bankIdList := make([]string, 0) bankIdList := make([]string, 0)
for _, info := range orderInfoList { for _, info := range orderInfoList {
bankIdList = append(bankIdList, info.BankOrderId) bankIdList = append(bankIdList, info.BankOrderId)
} }
orderProfitList := order2.GetOrderProfitListByBankOrderIdList(bankIdList) orderProfitList := order.GetOrderProfitListByBankOrderIdList(bankIdList)
supplierAll := 0.0 supplierAll := 0.0
platformAll := 0.0 platformAll := 0.0
agentAll := 0.0 agentAll := 0.0
@@ -129,7 +129,7 @@ func QueryTotalSummary(params map[string]string) order2.Summary {
} else { } else {
succeedRate = 0 succeedRate = 0
} }
return order2.Summary{ return order.Summary{
TotalNum: totalNum, TotalNum: totalNum,
TotalAmount: math.Round(allAmount*100) / 100, TotalAmount: math.Round(allAmount*100) / 100,
PaidNum: succeedNum, PaidNum: succeedNum,
@@ -139,11 +139,11 @@ func QueryTotalSummary(params map[string]string) order2.Summary {
} }
} }
func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) order2.Summary { func QuerySummaryByOrderInfo(infoInfoList []order.OrderInfo) order.Summary {
orderProfitInfoList := make([]order2.OrderProfitInfo, 0) orderProfitInfoList := make([]order.OrderProfitInfo, 0)
for _, info := range infoInfoList { for _, info := range infoInfoList {
orderProfitInfoList = append(orderProfitInfoList, order2.GetOrderProfitByBankOrderId(info.BankOrderId)) orderProfitInfoList = append(orderProfitInfoList, order.GetOrderProfitByBankOrderId(info.BankOrderId))
} }
totalNum := 0 totalNum := 0
@@ -175,7 +175,7 @@ func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) order2.Summary {
succeedRate = 0 succeedRate = 0
} }
return order2.Summary{ return order.Summary{
TotalNum: totalNum, TotalNum: totalNum,
TotalAmount: math.Round(todayAllAmount*100) / 100, TotalAmount: math.Round(todayAllAmount*100) / 100,
PaidNum: TodaySuccessNum, PaidNum: TodaySuccessNum,
@@ -185,7 +185,7 @@ func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) order2.Summary {
} }
} }
func QueryTodaySummary(params map[string]string) order2.Summary { func QueryTodaySummary(params map[string]string) order.Summary {
now := time.Now() now := time.Now()
todayAtMidnight := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) todayAtMidnight := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
tomorrowAtMidNight := time.Date(now.Year(), now.Month(), now.Day(), 59, 59, 59, 0, now.Location()) tomorrowAtMidNight := time.Date(now.Year(), now.Month(), now.Day(), 59, 59, 59, 0, now.Location())
@@ -217,13 +217,13 @@ func QueryTodaySummary(params map[string]string) order2.Summary {
} else { } else {
paramsProfit["create_time__lte"] = end paramsProfit["create_time__lte"] = end
} }
orderInfoList := order2.GetOrderByMap(paramsProfit, -1, 0) orderInfoList := order.GetOrderByMap(paramsProfit, -1, 0)
bankIdList := make([]string, 0) bankIdList := make([]string, 0)
for _, info := range orderInfoList { for _, info := range orderInfoList {
bankIdList = append(bankIdList, info.BankOrderId) bankIdList = append(bankIdList, info.BankOrderId)
} }
dataInfo := order2.GetOrderProfitListByBankOrderIdList(bankIdList) dataInfo := order.GetOrderProfitListByBankOrderIdList(bankIdList)
totalNum := 0 totalNum := 0
todaySuccessNum := 0 todaySuccessNum := 0
todayAllAmount := 0.0 todayAllAmount := 0.0
@@ -247,7 +247,7 @@ func QueryTodaySummary(params map[string]string) order2.Summary {
if totalNum != 0 { if totalNum != 0 {
succeedRate = math.Round(float64(todaySuccessNum)/float64(totalNum)*100*100) / 100 succeedRate = math.Round(float64(todaySuccessNum)/float64(totalNum)*100*100) / 100
} }
return order2.Summary{ return order.Summary{
TotalNum: totalNum, TotalNum: totalNum,
TotalAmount: math.Round(todayAllAmount*100) / 100, TotalAmount: math.Round(todayAllAmount*100) / 100,
PaidNum: todaySuccessNum, PaidNum: todaySuccessNum,

View File

@@ -2,7 +2,7 @@ package service
import ( import (
"boss/internal/common" "boss/internal/common"
order2 "boss/internal/models/order" "boss/internal/models/order"
"math" "math"
"time" "time"
) )
@@ -10,13 +10,13 @@ import (
type OrderSummary struct { type OrderSummary struct {
} }
func (s *OrderSummary) GetTodaySummary() (todaySummary order2.Summary) { func (s *OrderSummary) GetTodaySummary() (todaySummary order.Summary) {
todaySummary = order2.Summary{} todaySummary = order.Summary{}
now := time.Now() now := time.Now()
// 获取今日零点 // 获取今日零点
todayZero := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC) todayZero := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC)
orderList, err := order2.GetOrderByTime(todayZero.String(), now.String()) orderList, err := order.GetOrderByTime(todayZero.String(), now.String())
if err != nil { if err != nil {
return return
@@ -38,7 +38,7 @@ func (s *OrderSummary) GetTodaySummary() (todaySummary order2.Summary) {
} }
todaySummary = order2.Summary{ todaySummary = order.Summary{
TotalNum: len(orderList), TotalNum: len(orderList),
TotalAmount: math.Round(amount*100) / 100, TotalAmount: math.Round(amount*100) / 100,
PaidNum: paidNum, PaidNum: paidNum,

View File

@@ -10,7 +10,7 @@ import (
"boss/internal/models/merchant" "boss/internal/models/merchant"
"boss/internal/models/payfor" "boss/internal/models/payfor"
"boss/internal/models/road" "boss/internal/models/road"
system2 "boss/internal/models/system" "boss/internal/models/system"
"boss/internal/models/user" "boss/internal/models/user"
"boss/internal/utils" "boss/internal/utils"
"fmt" "fmt"
@@ -25,26 +25,26 @@ type UpdateService struct {
} }
func (c *UpdateService) UpMenu(menuUid string) *datas.BaseDataJSON { func (c *UpdateService) UpMenu(menuUid string) *datas.BaseDataJSON {
menuInfo := system2.GetMenuInfoByMenuUid(menuUid) menuInfo := system.GetMenuInfoByMenuUid(menuUid)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
if menuInfo.MenuUid == "" { if menuInfo.MenuUid == "" {
dataJSON.Msg = "更改排列顺序失败" dataJSON.Msg = "更改排列顺序失败"
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
exist := system2.MenuOrderIsExists(menuInfo.MenuOrder - 1) exist := system.MenuOrderIsExists(menuInfo.MenuOrder - 1)
if !exist { if !exist {
dataJSON.Msg = "已经是最高的顺序" dataJSON.Msg = "已经是最高的顺序"
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
//如果他前面有菜单那么交换他们的menuOrder //如果他前面有菜单那么交换他们的menuOrder
preMenuInfo := system2.GetMenuInfoByMenuOrder(menuInfo.MenuOrder - 1) preMenuInfo := system.GetMenuInfoByMenuOrder(menuInfo.MenuOrder - 1)
menuInfo.MenuOrder = menuInfo.MenuOrder - 1 menuInfo.MenuOrder = menuInfo.MenuOrder - 1
preMenuInfo.MenuOrder = preMenuInfo.MenuOrder + 1 preMenuInfo.MenuOrder = preMenuInfo.MenuOrder + 1
preMenuInfo.UpdateTime = time.Now() preMenuInfo.UpdateTime = time.Now()
menuInfo.UpdateTime = time.Now() menuInfo.UpdateTime = time.Now()
//更新菜单表 //更新菜单表
system2.UpdateMenuInfo(preMenuInfo) system.UpdateMenuInfo(preMenuInfo)
system2.UpdateMenuInfo(menuInfo) system.UpdateMenuInfo(menuInfo)
//更新二级菜单表 //更新二级菜单表
SortSecondMenuOrder(preMenuInfo) SortSecondMenuOrder(preMenuInfo)
SortSecondMenuOrder(menuInfo) SortSecondMenuOrder(menuInfo)
@@ -55,26 +55,26 @@ func (c *UpdateService) UpMenu(menuUid string) *datas.BaseDataJSON {
} }
func (c *UpdateService) DownMenu(menuUid string) *datas.BaseDataJSON { func (c *UpdateService) DownMenu(menuUid string) *datas.BaseDataJSON {
menuInfo := system2.GetMenuInfoByMenuUid(menuUid) menuInfo := system.GetMenuInfoByMenuUid(menuUid)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
if menuInfo.MenuUid == "" { if menuInfo.MenuUid == "" {
dataJSON.Msg = "更改排列顺序失败" dataJSON.Msg = "更改排列顺序失败"
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
exist := system2.MenuOrderIsExists(menuInfo.MenuOrder + 1) exist := system.MenuOrderIsExists(menuInfo.MenuOrder + 1)
if !exist { if !exist {
dataJSON.Msg = "已经是最高的顺序" dataJSON.Msg = "已经是最高的顺序"
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
//如果他前面有菜单那么交换他们的menuOrder //如果他前面有菜单那么交换他们的menuOrder
lastMenuInfo := system2.GetMenuInfoByMenuOrder(menuInfo.MenuOrder + 1) lastMenuInfo := system.GetMenuInfoByMenuOrder(menuInfo.MenuOrder + 1)
menuInfo.MenuOrder = menuInfo.MenuOrder + 1 menuInfo.MenuOrder = menuInfo.MenuOrder + 1
lastMenuInfo.MenuOrder = lastMenuInfo.MenuOrder - 1 lastMenuInfo.MenuOrder = lastMenuInfo.MenuOrder - 1
lastMenuInfo.UpdateTime = time.Now() lastMenuInfo.UpdateTime = time.Now()
menuInfo.UpdateTime = time.Now() menuInfo.UpdateTime = time.Now()
//更新菜单表 //更新菜单表
system2.UpdateMenuInfo(lastMenuInfo) system.UpdateMenuInfo(lastMenuInfo)
system2.UpdateMenuInfo(menuInfo) system.UpdateMenuInfo(menuInfo)
//更新二级菜单表 //更新二级菜单表
SortSecondMenuOrder(lastMenuInfo) SortSecondMenuOrder(lastMenuInfo)
SortSecondMenuOrder(menuInfo) SortSecondMenuOrder(menuInfo)
@@ -85,19 +85,19 @@ func (c *UpdateService) DownMenu(menuUid string) *datas.BaseDataJSON {
} }
func (c *UpdateService) UpSecondMenu(secondMenuUid string) *datas.BaseDataJSON { func (c *UpdateService) UpSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(secondMenuUid) secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
if secondMenuInfo.MenuOrder == 1 { if secondMenuInfo.MenuOrder == 1 {
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
preSecondMenuInfo := system2.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder-1, secondMenuInfo.FirstMenuUid) preSecondMenuInfo := system.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder-1, secondMenuInfo.FirstMenuUid)
preSecondMenuInfo.MenuOrder = preSecondMenuInfo.MenuOrder + 1 preSecondMenuInfo.MenuOrder = preSecondMenuInfo.MenuOrder + 1
preSecondMenuInfo.UpdateTime = time.Now() preSecondMenuInfo.UpdateTime = time.Now()
secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder - 1 secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder - 1
secondMenuInfo.UpdateTime = time.Now() secondMenuInfo.UpdateTime = time.Now()
//更新二级菜单项 //更新二级菜单项
system2.UpdateSecondMenu(preSecondMenuInfo) system.UpdateSecondMenu(preSecondMenuInfo)
system2.UpdateSecondMenu(secondMenuInfo) system.UpdateSecondMenu(secondMenuInfo)
dataJSON.Code = 200 dataJSON.Code = 200
} }
@@ -105,23 +105,23 @@ func (c *UpdateService) UpSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
} }
func (c *UpdateService) DownSecondMenu(secondMenuUid string) *datas.BaseDataJSON { func (c *UpdateService) DownSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(secondMenuUid) secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
dataJSON := new(datas.BaseDataJSON) dataJSON := new(datas.BaseDataJSON)
l := system2.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid) l := system.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid)
if l == secondMenuInfo.MenuOrder { if l == secondMenuInfo.MenuOrder {
dataJSON.Code = -1 dataJSON.Code = -1
} else { } else {
lastSecondMenu := system2.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder+1, secondMenuInfo.FirstMenuUid) lastSecondMenu := system.GetSecondMenuInfoByMenuOrder(secondMenuInfo.MenuOrder+1, secondMenuInfo.FirstMenuUid)
lastSecondMenu.MenuOrder = lastSecondMenu.MenuOrder - 1 lastSecondMenu.MenuOrder = lastSecondMenu.MenuOrder - 1
lastSecondMenu.UpdateTime = time.Now() lastSecondMenu.UpdateTime = time.Now()
secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder + 1 secondMenuInfo.MenuOrder = secondMenuInfo.MenuOrder + 1
secondMenuInfo.UpdateTime = time.Now() secondMenuInfo.UpdateTime = time.Now()
system2.UpdateSecondMenu(lastSecondMenu) system.UpdateSecondMenu(lastSecondMenu)
system2.UpdateSecondMenu(secondMenuInfo) system.UpdateSecondMenu(secondMenuInfo)
dataJSON.Code = 200 dataJSON.Code = 200
} }
@@ -179,7 +179,7 @@ func (c *UpdateService) EditOperator(password, changePassword, role, userId, nic
} else { } else {
userInfo.UpdateTime = time.Now() userInfo.UpdateTime = time.Now()
userInfo.Remark = remark userInfo.Remark = remark
roleInfo := system2.GetRoleByRoleUid(role) roleInfo := system.GetRoleByRoleUid(role)
userInfo.RoleName = roleInfo.RoleName userInfo.RoleName = roleInfo.RoleName
userInfo.Role = role userInfo.Role = role
if len(password) > 0 && len(changePassword) > 0 && password == changePassword { if len(password) > 0 && len(changePassword) > 0 && password == changePassword {

View File

@@ -1,8 +1,8 @@
package main package main
import ( import (
_ "boss/models" _ "boss/internal/models"
_ "boss/routers" _ "boss/internal/routers"
"github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/core/logs"
"github.com/beego/beego/v2/server/web" "github.com/beego/beego/v2/server/web"

View File

@@ -5,7 +5,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style type="text/css"> <style type="text/css">
.explain { .explain {
@@ -23,152 +23,153 @@
</head> </head>
<body> <body>
<div class="account-record"> <div class="account-record">
<div class="search"> <div class="search">
<div> <div>
商户名称: 商户名称:
<input type="text" id="account-name"> <input id="account-name" type="text">
</div>
<div>
商户编号:
<input type="text" id="account-no">
</div>
<div>
<button type="button" class="btn btn-default" id="account-search">搜索</button>
</div>
</div> </div>
<div> <div>
商户编号:
<input id="account-no" type="text">
</div>
<div>
<button class="btn btn-default" id="account-search" type="button">搜索</button>
</div>
</div>
<div>
<span class="explain" style="color: red;"> <span class="explain" style="color: red;">
账户余额:用户充值成功后立马相加,提款成功后相减的结果。 账户余额:用户充值成功后立马相加,提款成功后相减的结果。
</span> </span>
<span class="explain" style="color: red;"> <span class="explain" style="color: red;">
待结算金额:用户充值后,还没有加到可结算金中。 待结算金额:用户充值后,还没有加到可结算金中。
</span> </span>
<span class="explain" style="color: red;"> <span class="explain" style="color: red;">
结算金额: 可以提现的金额 = (账户余额 - 待结算金额 - 押款金额 - 冻结金额 - 正在出款金额) 结算金额: 可以提现的金额 = (账户余额 - 待结算金额 - 押款金额 - 冻结金额 - 正在出款金额)
</span> </span>
</div>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>账户编号</th>
<th>账户名称</th>
<th>账户余额</th>
<th>结算金额</th>
<th>待结算金额</th>
<th>押款金额</th>
<th>冻结金额</th>
<th>正在出款的金额</th>
{{/*
<th>可用金额</th>
*/}}
<th>账户状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="account-table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page">
<span class="current_page">
0
</span>
/
<span class="total_page">
0
</span>
</li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value="">
<button type="button" class="btn btn-default">Go</button>
</li>
</div>
</div> </div>
<div class="modal fade" id="account-solve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="menu-table">
<div class="modal-dialog" role="document"> <table>
<div class="modal-content"> <thead class="thead-dark">
<div class="modal-header"> <tr>
<h4 class="modal-title">订单处理</h4> <th>序列号</th>
</div> <th>账户编号</th>
<div class="modal-body modal-body-order-solve"> <th>账户名称</th>
<input type="text" id="account-uid-edit" hidden> <th>账户余额</th>
<div style="display: flex"> <th>结算金额</th>
<div> <th>待结算金额</th>
<label> <th>押款金额</th>
操作: <th>冻结金额</th>
<select value="" id="account-edit-operator"> <th>正在出款的金额</th>
<option value="plus_amount">加款</option> {{/*
<option value="sub_amount">减款</option> <th>可用金额</th>
</select> */}}
</label> <th>账户状态</th>
</div> <th>操作</th>
<div> </tr>
<label> </thead>
<input type="text" value="" id="account-edit-operator-amount" placeholder="请输入增加(减少)金额"> <tbody id="account-table-body">
</label> </tbody>
</div> </table>
</div> </div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page">
<span class="current_page">
0
</span>
/
<span class="total_page">
0
</span>
</li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
</div>
<div aria-labelledby="myModalLabel" class="modal fade" id="account-solve" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">订单处理</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input hidden id="account-uid-edit" type="text">
<div style="display: flex">
<div> <div>
<label> <label>
二次验证 操作
<input type="text" value="" id="order-info-totp"> <select id="account-edit-operator" value="">
<option value="plus_amount">加款</option>
<option value="sub_amount">减款</option>
</select>
</label> </label>
</div> </div>
<div> <div>
<p class="error-msg" style="color: red"></p> <label>
<input id="account-edit-operator-amount" placeholder="请输入增加(减少)金额" type="text"
value="">
</label>
</div> </div>
</div> </div>
<div class="modal-footer"> <div>
<button type="button" class="btn btn-default account-edit-save">确定</button> <label>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">取消</button> 二次验证:
<input id="order-info-totp" type="text" value="">
</label>
</div> </div>
<div>
<p class="error-msg" style="color: red"></p>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default account-edit-save" type="button">确定</button>
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">取消</button>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="modal fade" id="delete-solve" tabindex="-1" role="dialog" aria-labelledby="myModalDeleteLabel"> <div aria-labelledby="myModalDeleteLabel" class="modal fade" id="delete-solve" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">二次验证</h4> <h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input hidden id="account-uid-delete" type="text">
<div>
<label>
二次验证:
<input id="order-info-delete-totp" type="text" value="">
</label>
</div> </div>
<div class="modal-body modal-body-order-solve"> <div>
<input type="text" id="account-uid-delete" hidden> <p class="error-msg" style="color: red"></p>
<div>
<label>
二次验证:
<input type="text" value="" id="order-info-delete-totp">
</label>
</div>
<div>
<p class="error-msg" style="color: red"></p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default account-delete-save">确定</button>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">取消</button>
</div> </div>
</div> </div>
<div class="modal-footer">
<button class="btn btn-default account-delete-save" type="button">确定</button>
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">取消</button>
</div>
</div> </div>
</div> </div>
</div>
</body> </body>
<script> <script>
function getAccountCutPageValues() { function getAccountCutPageValues() {

View File

@@ -2,54 +2,58 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>后台管理</title> <title>后台管理</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
<script src="../static/js/filter.js"></script> type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script> <script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/js/basic.js"></script> <script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<style> <script src="../static/js/basic.js"></script>
#account-history-table-body tr { <style>
height: 30px; #account-history-table-body tr {
} height: 30px;
}
.account-history-record .search { .account-history-record .search {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.search label { .search label {
font-weight: normal; font-weight: normal;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
margin-right: 20px; margin-right: 20px;
} }
.search label select { .search label select {
height: 30px; height: 30px;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="account-history-record"> <div class="account-history-record">
<div class="search"> <div class="search">
<label for=""> <label for="">
开始时间: 开始时间:
<input type="text" name="" value="" id="account-history-start-time" class="start-time" value=""> <input class="start-time" id="account-history-start-time" name="" type="text" value="" value="">
</label> </label>
<label for=""> <label for="">
结束时间: 结束时间:
<input type="text" name="" value="" id="account-history-end-time" class="end-time" value=""> <input class="end-time" id="account-history-end-time" name="" type="text" value="" value="">
</label> </label>
<label for=""> <label for="">
账户名称: 账户名称:
<input type="text" id="account-history-name" value=""> <input id="account-history-name" type="text" value="">
</label> </label>
<label for=""> <label for="">
账户编号: 账户编号:
<input type="text" id="account-history-no" value=""> <input id="account-history-no" type="text" value="">
</label> </label>
<label for=""> <label for="">
动账类型: 动账类型:
@@ -62,157 +66,162 @@
</select> </select>
</label> </label>
<button type="button" class="btn btn-primary" id="account-history-search">搜索</button> <button class="btn btn-primary" id="account-history-search" type="button">搜索</button>
</div> </div>
<div class="menu-table"> <div class="menu-table">
<table> <table>
<thead class="thead-dark"> <thead class="thead-dark">
<tr> <tr>
<th>序列号</th> <th>序列号</th>
<th>账户编号</th> <th>账户编号</th>
<th>账户名称</th> <th>账户名称</th>
<th>动账类型</th> <th>动账类型</th>
<th>动账金额</th> <th>动账金额</th>
<th>当前余额</th> <th>当前余额</th>
<th>动账时间</th> <th>动账时间</th>
</tr> </tr>
</thead> </thead>
<tbody id="account-history-table-body"> <tbody id="account-history-table-body">
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- 分页插件 --> <!-- 分页插件 -->
<div class="cut_page"> <div class="cut_page">
<li> <li>
每页显示 每页显示
<select id="display_count"> <select id="display_count">
<option value="20">20</option> <option value="20">20</option>
<option value="30">30</option> <option value="30">30</option>
<option value="50">50</option> <option value="50">50</option>
<option value="100">100</option> <option value="100">100</option>
</select> </select>
</li> </li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
</div> <button class="btn btn-default" type="button">Go</button>
</li>
</div>
</div> </div>
<script> <script>
function getAccountHistoryCutPageValues() { function getAccountHistoryCutPageValues() {
let displayCount = $("#display_count").val(); let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html(); let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html(); let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val(); let jumpPage = $(".jump_page input").val();
let accountHistoryName = $("#account-history-name").val(); let accountHistoryName = $("#account-history-name").val();
let accountHistoryNo = $("#account-history-no").val(); let accountHistoryNo = $("#account-history-no").val();
let operatorType = $("#account-history-type").val(); let operatorType = $("#account-history-type").val();
let startTime = $("#account-history-start-time").val(); let startTime = $("#account-history-start-time").val();
let endTime = $("#account-history-end-time").val(); let endTime = $("#account-history-end-time").val();
return { return {
"displayCount":displayCount, "displayCount": displayCount,
"currentPage":currentPage, "currentPage": currentPage,
"totalPage":totalPage, "totalPage": totalPage,
"jumpPage":jumpPage, "jumpPage": jumpPage,
"accountHistoryName":accountHistoryName, "accountHistoryName": accountHistoryName,
"accountHistoryNo":accountHistoryNo, "accountHistoryNo": accountHistoryNo,
"operatorType":operatorType, "operatorType": operatorType,
"startTime":startTime, "startTime": startTime,
"endTime":endTime "endTime": endTime
}; };
} }
function setAccountHistoryCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
}
function showAccountHistoryList(res) { function setAccountHistoryCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
}
function showAccountHistoryList(res) {
setAccountHistoryCutPageValues(res); setAccountHistoryCutPageValues(res);
let str = ""; let str = "";
for (let i = 0; i < res.AccountHistoryList.length; i ++) { for (let i = 0; i < res.AccountHistoryList.length; i++) {
let v = res.AccountHistoryList[i]; let v = res.AccountHistoryList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" + let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.AccountUid + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.Type + "</th>" + "<th>" + v.AccountUid + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.Type + "</th>" +
"<th>" + v.Amount + "</th>" + "<th>" + v.Balance + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>"; "<th>" + v.Amount + "</th>" + "<th>" + v.Balance + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>";
tmp = tmp.replace("plus_amount", "加款").replace("sub_amount", "减款").replace("unfreeze_amount", "解冻").replace("freeze_amount", "冻结"); tmp = tmp.replace("plus_amount", "加款").replace("sub_amount", "减款").replace("unfreeze_amount", "解冻").replace("freeze_amount", "冻结");
str = str + tmp; str = str + tmp;
} }
$("#account-history-table-body").html(str);
}
function ajaxAccountHistoryList(dataJSON) {
$.ajax({
url:"/get/account/history",
data: dataJSON,
success: function(res) { $("#account-history-table-body").html(str);
if (res.Code == 404) { }
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("获取账户数据列表失败");
} else {
showAccountHistoryList(res);
}
},
error: function(res) {
alert("系统异常,请稍后再试");
}
});
}
$("#account-history-search").click(function() {
let dataJSON = getAccountHistoryCutPageValues();
ajaxAccountHistoryList(dataJSON);
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getAccountHistoryCutPageValues();
ajaxAccountHistoryList(dataJSON);
});
//点击上一页的按钮 function ajaxAccountHistoryList(dataJSON) {
$(".pre_page").click(function() { $.ajax({
let dataJSON = getAccountHistoryCutPageValues(); url: "/get/account/history",
data: dataJSON,
if (dataJSON["currentPage"] == 1) { success: function (res) {
return; if (res.Code == 404) {
} window.parent.location = "/login.html";
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; } else if (res.Code == -1) {
ajaxAccountHistoryList(dataJSON); alert("获取账户数据列表失败");
}); } else {
showAccountHistoryList(res);
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
}
$("#account-history-search").click(function () {
let dataJSON = getAccountHistoryCutPageValues();
ajaxAccountHistoryList(dataJSON);
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getAccountHistoryCutPageValues();
ajaxAccountHistoryList(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
ajaxAccountHistoryList(dataJSON);
});
//点击下一页的按钮时 //点击下一页的按钮时
$(".next_page").click(function() { $(".next_page").click(function () {
let dataJSON = getAccountHistoryCutPageValues(); let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return; return;
} }
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxAccountHistoryList(dataJSON); ajaxAccountHistoryList(dataJSON);
}); });
//点击跳转那一页的按钮 //点击跳转那一页的按钮
$(".jump_page button").click(function() { $(".jump_page button").click(function () {
let dataJSON = getAccountHistoryCutPageValues(); let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["jumpPage"].length <= 0) { if (dataJSON["jumpPage"].length <= 0) {
return; return;
} }
ajaxAccountHistoryList(dataJSON); ajaxAccountHistoryList(dataJSON);
}); });
$(function() { $(function () {
let day = new Date(new Date().getTime() - 86400000); let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day); let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$(".start-time").val(s); $(".start-time").val(s);
ajaxAccountHistoryList(getAccountHistoryCutPageValues()); ajaxAccountHistoryList(getAccountHistoryCutPageValues());
}); });
</script> </script>
</body> </body>

View File

@@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -16,9 +17,11 @@
.search label { .search label {
font-weight: normal; font-weight: normal;
} }
#select-agent-name,#select-merchant-name {
#select-agent-name, #select-merchant-name {
margin-right: 20px; margin-right: 20px;
} }
.search label select { .search label select {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
@@ -26,175 +29,180 @@
</style> </style>
</head> </head>
<body> <body>
<div class="search"> <div class="search">
<label for=""> <label for="">
代理名称: 代理名称:
<select name="" id="select-agent-name"></select> <select id="select-agent-name" name=""></select>
</label> </label>
<label for=""> <label for="">
商户名称: 商户名称:
<select name="" id="select-merchant-name"></select> <select id="select-merchant-name" name=""></select>
</label> </label>
<input type="button" class="btn btn-primary" value="开始" onclick="search(getValues());"> <input class="btn btn-primary" onclick="search(getValues());" type="button" value="开始">
</div> </div>
<div class="menu-table"> <div class="menu-table">
<table> <table>
<thead class="thead-dark"> <thead class="thead-dark">
<tr> <tr>
<th>序列号</th> <th>序列号</th>
<th>代理名称</th> <th>代理名称</th>
<th>代理uid</th> <th>代理uid</th>
<th>代理商户名</th> <th>代理商户名</th>
<th>代理商户uid</th> <th>代理商户uid</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="table-body"> <tbody id="table-body">
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- 分页插件 --> <!-- 分页插件 -->
<div class="cut_page"> <div class="cut_page">
<li> <li>
每页显示 每页显示
<select id="display_count"> <select id="display_count">
<option value="4">4</option> <option value="4">4</option>
<option value="20">20</option> <option value="20">20</option>
<option value="30">30</option> <option value="30">30</option>
<option value="50">50</option> <option value="50">50</option>
<option value="100">100</option> <option value="100">100</option>
</select> </select>
</li> </li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
</div> <button class="btn btn-default" type="button">Go</button>
</li>
</div>
<script> <script>
//当每页显示数更改后,执行的操作 //当每页显示数更改后,执行的操作
$("#display_count").change(function() { $("#display_count").change(function () {
let dataJSON = getValues(); let dataJSON = getValues();
search(dataJSON); search(dataJSON);
}); });
//点击上一页的按钮 //点击上一页的按钮
$(".pre_page").click(function() { $(".pre_page").click(function () {
let dataJSON = getValues(); let dataJSON = getValues();
if (dataJSON["currentPage"] == 1) { if (dataJSON["currentPage"] == 1) {
return; return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
search(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
search(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
search(dataJSON);
});
function getValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let agentUid = $("#select-agent-name").val();
let merchantUid = $("#select-merchant-name").val();
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"agentUid": agentUid,
"merchantUid": merchantUid
};
}
function clearCutValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
} }
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
search(dataJSON);
}); });
//点击下一页的按钮时 $(".jump_page input").val("");
$(".next_page").click(function() { }
let dataJSON = getValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
search(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getValues();
if (dataJSON["jumpPage"].length <= 0) { function randAgentToMerchant(res) {
return; clearCutValues(res);
} let str = "";
search(dataJSON); for (let i = 0; i < res.MerchantList.length; i++) {
}); let v = res.MerchantList[i];
function getValues() { let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
let displayCount = $("#display_count").val(); "<th>" + v.BelongAgentName + "</th>" + "<th>" + v.BelongAgentUid + "</th>" + "<th>" + v.MerchantName + "</th>" + "<th>" + v.MerchantUid + "</th>";
let currentPage = $(".current_page").html(); tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
let totalPage = $(".total_page").html(); '<button type="button" value="' + v.MerchantUid + '" class="btn btn-default" onclick="deleteRelation(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
let jumpPage = $(".jump_page input").val(); '</div>' + "</th>" + "</tr>";
let agentUid = $("#select-agent-name").val(); str = str + tmp;
let merchantUid = $("#select-merchant-name").val();
return {
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"agentUid":agentUid,
"merchantUid":merchantUid
};
} }
function clearCutValues(res) { $("#table-body").html(str);
$(".current_page").html(res.CurrentPage); }
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() { function deleteRelation(merchantUid) {
if ($(this).text() == res.DisplayCount) { if (!confirm("是否删除?")) {
$(this).attr('selected', true); return
}
$.ajax({
url: "/delete/agent/merchant/relation",
data: {
"merchantUid": merchantUid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("删除失败");
} else {
alert("删除成功");
search(getValues());
} }
});
$(".jump_page input").val("");
}
function randAgentToMerchant(res) {
clearCutValues(res);
let str = "";
for (let i = 0; i < res.MerchantList.length; i ++) {
let v = res.MerchantList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.BelongAgentName + "</th>" + "<th>" + v.BelongAgentUid + "</th>" + "<th>" + v.MerchantName + "</th>" + "<th>" + v.MerchantUid + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.MerchantUid +'" class="btn btn-default" onclick="deleteRelation(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
} }
$("#table-body").html(str);
}
function deleteRelation(merchantUid) {
if (!confirm("是否删除?")) {
return
}
$.ajax({
url:"/delete/agent/merchant/relation",
data:{
"merchantUid":merchantUid
},
success:function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if(res.Code == -1) {
alert("删除失败");
} else {
alert("删除成功");
search(getValues());
}
}
});
}
function search(dataJSON) {
$.ajax({
url: "/get/agent/to/merchant",
data: dataJSON,
success:function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randAgentToMerchant(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
$(function () {
setMerchant();
setAgent();
search(getValues());
}); });
</script> }
function search(dataJSON) {
$.ajax({
url: "/get/agent/to/merchant",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randAgentToMerchant(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
$(function () {
setMerchant();
setAgent();
search(getValues());
});
</script>
</body> </body>
</html> </html>

View File

@@ -1,8 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<body> <body>
<iframe src=""> <iframe src="">
</iframe> </iframe>
</body> </body>
<style> <style>
iframe { iframe {

View File

@@ -2,8 +2,8 @@
<html lang="zh"> <html lang="zh">
<body> <body>
<iframe src=""> <iframe src="">
</iframe> </iframe>
</body> </body>
<style> <style>
iframe { iframe {

View File

@@ -2,468 +2,488 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style> <style>
.add-bank-card, .bank-card-record { .add-bank-card, .bank-card-record {
overflow-x: hidden; overflow-x: hidden;
} }
fieldset {
margin-top: 10px; fieldset {
} margin-top: 10px;
legend { }
width: 60px;
} legend {
fieldset div { width: 60px;
margin-bottom: 20px; }
}
fieldset div span { fieldset div {
display: inline-block; margin-bottom: 20px;
width: 120px; }
}
#certificate-type { fieldset div span {
height: 30px; display: inline-block;
} width: 120px;
.bank-card-footer { }
height: 40px;
width: 100% #certificate-type {
background-color: white; height: 30px;
/* border: 1px solid #e7e7e7; */ }
margin-top: 10px;
} .bank-card-footer {
.bank-card-footer span { height: 40px;
display: inline-block; width: 100%
text-align: center; background-color: white;
background-color: #e7e7e7; /* border: 1px solid #e7e7e7; */
border-radius: 4px; margin-top: 10px;
height: 40px; }
width: 60px;
line-height: 40px; .bank-card-footer span {
margin-left: 20px; display: inline-block;
} text-align: center;
.bank-card-footer span:hover { background-color: #e7e7e7;
background-color: red; border-radius: 4px;
cursor: pointer; height: 40px;
} width: 60px;
.add-card-button { line-height: 40px;
margin-bottom: 10px; margin-left: 20px;
} }
.bank-card-search {
border-bottom: 1px solid #e7e7e7; .bank-card-footer span:hover {
margin-bottom: 10px; background-color: red;
margin-top: 10px; cursor: pointer;
padding-bottom: 10px; }
}
.account-name-search { .add-card-button {
margin-right: 10px; margin-bottom: 10px;
} }
</style>
.bank-card-search {
border-bottom: 1px solid #e7e7e7;
margin-bottom: 10px;
margin-top: 10px;
padding-bottom: 10px;
}
.account-name-search {
margin-right: 10px;
}
</style>
</head> </head>
<body> <body>
<div class="bank-card-record"> <div class="bank-card-record">
<div class="row bank-card-search"> <div class="row bank-card-search">
<div class="col-md-4"> <div class="col-md-4">
<span>开户名:</span> <span>开户名:</span>
<input type="text" value="" class="account-name-search" placeholder="模糊匹配"> <input class="account-name-search" placeholder="模糊匹配" type="text" value="">
<button class="btn btn-info bank-card-button">搜索</button> <button class="btn btn-info bank-card-button">搜索</button>
</div> </div>
</div> </div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-card-button">添加银行卡</button> <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-card-button" type="button">添加银行卡</button>
<div class="menu-table"> <div class="menu-table">
<table> <table>
<thead class="thead-dark"> <thead class="thead-dark">
<tr> <tr>
<th>序列号</th> <th>序列号</th>
<th>商户名称(UID)</th> <th>商户名称(UID)</th>
<th>银行名称</th> <th>银行名称</th>
<th>银行编码</th> <th>银行编码</th>
<th>对账卡类型</th> <th>对账卡类型</th>
<th>开户名</th> <th>开户名</th>
<th>银行卡号</th> <th>银行卡号</th>
<th>证件类型</th> <th>证件类型</th>
<th>身份证号</th> <th>身份证号</th>
<th>手机号</th> <th>手机号</th>
<th>开户银行地址</th> <th>开户银行地址</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="bank_card_table_body"> <tbody id="bank_card_table_body">
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- 分页插件 --> <!-- 分页插件 -->
<div class="cut_page"> <div class="cut_page">
<li> <li>
每页显示 每页显示
<select id="display_count"> <select id="display_count">
<option value="4">4</option> <option value="4">4</option>
<option value="20">20</option> <option value="20">20</option>
<option value="30">30</option> <option value="30">30</option>
<option value="50">50</option> <option value="50">50</option>
<option value="100">100</option> <option value="100">100</option>
</select> </select>
</li> </li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
</div>
<div class="add-bank-card">
<fieldset>
<legend>添加银行卡</legend>
<div class="row">
<div class="col-md-4">
<input type="hidden" value="" class="bank-card-uid">
<div>
<span>商户名称:</span>
<select name="" class="user-name" id="select-self-name">
</select>
</div>
<div>
<span>银行编码:</span>
<input type="text" value="" class="bank-code">
</div>
<div>
<span>银行开户名:</span>
<input type="text" value="" class="account-name">
</div>
<div>
<span>证件类型:</span>
<select id="certificate-type">
<option value="identify-card">身份证&nbsp;</option>
</select>
</div>
<div>
<span>手机号:</span>
<input type="text" value="" placeholder="" class="phone-code">
</div>
</div>
<div class="col-md-4"> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<div> <li class="pre_page">上一页</li>
<span>银行名称:</span> <li class="next_page">下一页</li>
<input type="text" value="" placeholder="" class="bank-name"> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
</div> <button class="btn btn-default" type="button">Go</button>
<div> </li>
<span>银行账户类型</span> </div>
<select id="bank-account-type"> </div>
<option value="private">对私</option>
<option value="public">对公</option>
</select>
</div>
<div>
<span>银行卡账号:</span>
<input type="text" placeholder="" class="bank-no">
</div>
<div>
<span>证件号:</span>
<input type="text" class="certificate-no" value="" placeholder="">
</div>
<div>
<span>开户行详细地址:</span>
<input type="text" class="bank-address" value="" placeholder="">
</div>
</div>
</div>
</fieldset>
<fieldset>
<legend style="width: 25px;">操作</legend>
<div class="bank-card-footer">
<span class="bank-card-cannel">取消</span>
<span class="bank-card-save">保存</span>
</div>
</fieldset>
</div>
<script> <div class="add-bank-card">
function getCutPageval() { <fieldset>
let operatorName = $(".operator-name").val(); <legend>添加银行卡</legend>
let displayCount = $("#display_count").val(); <div class="row">
let currentPage = $(".current_page").html(); <div class="col-md-4">
let totalPage = $(".total_page").html(); <input class="bank-card-uid" type="hidden" value="">
let jumpPage = $(".jump_page input").val(); <div>
return dataJSON = { <span>商户名称:</span>
"operatorName":operatorName, <select class="user-name" id="select-self-name" name="">
"displayCount":displayCount, </select>
"currentPage":currentPage, </div>
"totalPage":totalPage, <div>
"jumpPage":jumpPage <span>银行编码:</span>
}; <input class="bank-code" type="text" value="">
} </div>
function editBankCard(uid) { <div>
$.ajax({ <span>银行开户名:</span>
url: "/get/oneBankCard", <input class="account-name" type="text" value="">
data: {"uid":uid}, </div>
<div>
<span>证件类型:</span>
<select id="certificate-type">
<option value="identify-card">身份证&nbsp;</option>
</select>
</div>
<div>
<span>手机号:</span>
<input class="phone-code" placeholder="" type="text" value="">
</div>
</div>
success: function(res) { <div class="col-md-4">
if (res.Code == 404) { <div>
window.parent.location = "/login.html"; <span>银行名称:</span>
} else if (res.BankCardInfoList.length == 0){ <input class="bank-name" placeholder="" type="text" value="">
alert("编辑失败"); </div>
return; <div>
} else { <span>银行账户类型</span>
let b = res.BankCardInfoList[0]; <select id="bank-account-type">
$(".bank-card-uid").val(b.Uid); <option value="private">对私</option>
$(".user-name").val(b.UserName); <option value="public">对公</option>
$(".bank-code").val(b.BankCode); </select>
$(".account-name").val(b.AccountName); </div>
$(".phone-code").val(b.PhoneNo); <div>
$(".bank-name").val(b.BankName); <span>银行卡账号:</span>
$(".bank-no").val(b.BankNo); <input class="bank-no" placeholder="" type="text">
$(".certificate-no").val(b.CertificateNo); </div>
$(".bank-address").val(b.BankAddress); <div>
$("#bank-account-type option").each(function() { <span>证件号:</span>
if ($(this).val() == b.BankAccountType) { <input class="certificate-no" placeholder="" type="text" value="">
$(this).attr('selected', true); </div>
}else { <div>
$(this).removeAttr('selected'); <span>开户行详细地址:</span>
} <input class="bank-address" placeholder="" type="text" value="">
}); </div>
</div>
$(".bank-card-record").hide(); </div>
$(".add-bank-card").show(); </fieldset>
} <fieldset>
} <legend style="width: 25px;">操作</legend>
}); <div class="bank-card-footer">
} <span class="bank-card-cannel">取消</span>
<span class="bank-card-save">保存</span>
</div>
</fieldset>
</div>
$(".bank-card-button").click(function() { <script>
let dataJSON = getCutPageval(); function getCutPageval() {
let accountNameSearch = $(".account-name-search").val(); let operatorName = $(".operator-name").val();
dataJSON["accountNameSearch"] = accountNameSearch; let displayCount = $("#display_count").val();
showBankCradRecord(dataJSON); let currentPage = $(".current_page").html();
}); let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
return dataJSON = {
"operatorName": operatorName,
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage
};
}
function deleteBankCard(uid) { function editBankCard(uid) {
$.ajax({ $.ajax({
url: "/delete/bankCardRecord", url: "/get/oneBankCard",
data: {"uid":uid}, data: {"uid": uid},
success: function(res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else if (res.Code == 200){ } else if (res.BankCardInfoList.length == 0) {
alert("删除成功"); alert("编辑失败");
showBankCradRecord(getBankCardData()); return;
} } else {
}, let b = res.BankCardInfoList[0];
$(".bank-card-uid").val(b.Uid);
$(".user-name").val(b.UserName);
$(".bank-code").val(b.BankCode);
$(".account-name").val(b.AccountName);
$(".phone-code").val(b.PhoneNo);
$(".bank-name").val(b.BankName);
$(".bank-no").val(b.BankNo);
$(".certificate-no").val(b.CertificateNo);
$(".bank-address").val(b.BankAddress);
$("#bank-account-type option").each(function () {
if ($(this).val() == b.BankAccountType) {
$(this).attr('selected', true);
} else {
$(this).removeAttr('selected');
}
});
error: function() { $(".bank-card-record").hide();
alert("系统异常,请稍后再试"); $(".add-bank-card").show();
} }
}); }
} });
function showBankCradRecord(dataJSON) { }
// let dataJSON = getBankCardData();
$.ajax({
url: "/get/bankCard",
data: dataJSON,
success: function(res) { $(".bank-card-button").click(function () {
if (res.Code == 404) { let dataJSON = getCutPageval();
window.parent.location = "/login.html"; let accountNameSearch = $(".account-name-search").val();
return; dataJSON["accountNameSearch"] = accountNameSearch;
} else { showBankCradRecord(dataJSON);
$(".current_page").html(res.CurrentPage); });
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
let str = "";
for (let i = 0; i < res.BankCardInfoList.length; i ++) {
let v = res.BankCardInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.UserName + "</th>" + "<th>" + v.BankName + "</th>" + "<th>" + v.BankCode + "</th>" +
"<th>" + v.BankAccountType + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankNo + "</th>" +
"<th>" + "身份证" + "</th>" + "<th>" + v.CertificateNo + "</th>" + "<th>" + v.PhoneNo + "</th>" +
"<th>" + v.BankAddress + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' + function deleteBankCard(uid) {
'<button type="button" value="' + v.Uid +'" class="btn btn-default" onclick="editBankCard(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' + $.ajax({
'<button type="button" value="' + v.Uid +'" class="btn btn-default" onclick="deleteBankCard(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' + url: "/delete/bankCardRecord",
'</div>' + "</th>" + "</tr>"; data: {"uid": uid},
tmp = tmp.replace("private", "对私").replace("public", "对公");
str = str + tmp;
}
$("#bank_card_table_body").html(str);
}
},
error: function() { success: function (res) {
alert("系统异常,请稍后再试"); if (res.Code == 404) {
} window.parent.location = "/login.html";
}); } else if (res.Code == 200) {
} alert("删除成功");
$(function() { showBankCradRecord(getBankCardData());
$(".add-bank-card").hide(); }
showBankCradRecord(getBankCardData()); },
$(".bank-card-record").show();
});
$(".bank-card-cannel").click(function(event) {
/* Act on the event */
$(".bank-card-record").show();
$(".add-bank-card").hide();
});
$(".add-card-button").click(function() {
clearBankCardData();
$(".add-bank-card").show();
$(".bank-card-record").hide();
});
function clearBankCardData() {
$(".user-name").val("");
$(".bank-code").val("");
$(".account-name").val("");
$(".phone-code").val("");
$(".bank-name").val("");
// $("#bank-account-type").val();
$(".bank-no").val("");
// $(".identify-card").val("");
$(".certificate-no").val("");
$(".bank-address").val("");
$(".bank-card-uid").html("");
}
function getBankCardData() {
let userName = $(".user-name").val();
let bankCode = $(".bank-code").val();
let accountName = $(".account-name").val();
let certificateType = $("#certificate-type").val();
let phoneNo = $(".phone-code").val();
let bankName = $(".bank-name").val();
let bankAccountType = $("#bank-account-type").val();
let bankNo = $(".bank-no").val();
let identifyCard = $(".identify-card").val();
let certificateNo = $(".certificate-no").val();
let bankAddress = $(".bank-address").val();
let uid = $(".bank-card-uid").val();
return { error: function () {
"uid":uid, alert("系统异常,请稍后再试");
"userName":userName, }
"bankCode":bankCode, });
"accountName":accountName, }
"certificateType":certificateType,
"phoneNo":phoneNo,
"bankName":bankName,
"bankAccountType":bankAccountType,
"bankNo":bankNo,
"identifyCard":identifyCard,
"certificateNo":certificateNo,
"bankAddress":bankAddress
};
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getCutPageval();
showBankCradRecord(dataJSON);
});
//点击上一页的按钮 function showBankCradRecord(dataJSON) {
$(".pre_page").click(function() { // let dataJSON = getBankCardData();
let dataJSON = getCutPageval(); $.ajax({
url: "/get/bankCard",
data: dataJSON,
if (dataJSON["currentPage"] == 1) { success: function (res) {
return; if (res.Code == 404) {
} window.parent.location = "/login.html";
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; return;
showBankCradRecord(dataJSON); } else {
}); $(".current_page").html(res.CurrentPage);
//点击下一页的按钮时 $(".total_page").html(res.TotalPage);
$(".next_page").click(function() { $("#display_count option").each(function () {
let dataJSON = getCutPageval(); if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
let str = "";
for (let i = 0; i < res.BankCardInfoList.length; i++) {
let v = res.BankCardInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.UserName + "</th>" + "<th>" + v.BankName + "</th>" + "<th>" + v.BankCode + "</th>" +
"<th>" + v.BankAccountType + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankNo + "</th>" +
"<th>" + "身份证" + "</th>" + "<th>" + v.CertificateNo + "</th>" + "<th>" + v.PhoneNo + "</th>" +
"<th>" + v.BankAddress + "</th>";
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
return; '<button type="button" value="' + v.Uid + '" class="btn btn-default" onclick="editBankCard(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' +
} '<button type="button" value="' + v.Uid + '" class="btn btn-default" onclick="deleteBankCard(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
tmp = tmp.replace("private", "对私").replace("public", "对公");
str = str + tmp;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; $("#bank_card_table_body").html(str);
showBankCradRecord(dataJSON); }
}); },
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPageval();
if (dataJSON["jumpPage"].length <= 0) { error: function () {
return; alert("系统异常,请稍后再试");
} }
showBankCradRecord(dataJSON); });
}); }
$(".bank-card-save").click(function() { $(function () {
let dataJSON = getBankCardData(); $(".add-bank-card").hide();
if (dataJSON["userName"].length <= 0) { showBankCradRecord(getBankCardData());
alert("用户名称不能为空"); $(".bank-card-record").show();
return; });
} else if (dataJSON["bankCode"].length <= 0) { $(".bank-card-cannel").click(function (event) {
alert("银行编码不能为空"); /* Act on the event */
return; $(".bank-card-record").show();
} else if (dataJSON["accountName"].length <= 0) { $(".add-bank-card").hide();
alert("银行开户名不能为空"); });
return; $(".add-card-button").click(function () {
} else if (dataJSON["phoneNo"].length <= 0) { clearBankCardData();
alert("手机号不能为空"); $(".add-bank-card").show();
return; $(".bank-card-record").hide();
} else if (dataJSON["bankName"].length <= 0) { });
alert("银行名称不能为空");
return;
} else if (dataJSON["bankNo"].length <= 0) {
alert("银行卡账号不能为空");
return;
} else if (dataJSON["certificateNo"].length <= 0) {
alert("身份证号不能为空");
return;
} else if (dataJSON["bankAddress"].length <= 0) {
alert("开户行地址不能为空");
return;
}
$.ajax({
url: "/add/bankCard",
data: dataJSON,
success: function(res) { function clearBankCardData() {
if (res.Code == 404) { $(".user-name").val("");
window.parent.location = "/login.html"; $(".bank-code").val("");
} else if (res.Code == -1) { $(".account-name").val("");
alert(res.Msg); $(".phone-code").val("");
} else { $(".bank-name").val("");
alert("添加银行卡成功"); // $("#bank-account-type").val();
$(".bank-card-record").show(); $(".bank-no").val("");
$(".add-bank-card").hide(); // $(".identify-card").val("");
showBankCradRecord(getBankCardData()); $(".certificate-no").val("");
} $(".bank-address").val("");
} $(".bank-card-uid").html("");
}); }
});
function setAccount() { function getBankCardData() {
$.ajax({ let userName = $(".user-name").val();
url: "/get/all/account", let bankCode = $(".bank-code").val();
success: function (res) { let accountName = $(".account-name").val();
if (res.Code == 404) { let certificateType = $("#certificate-type").val();
window.parent.location = "/login.html"; let phoneNo = $(".phone-code").val();
} else { let bankName = $(".bank-name").val();
let str = '<option value="' + "" + '">' + "请选择" + '</option>'; let bankAccountType = $("#bank-account-type").val();
for (let i = 0; i < res.AccountList.length; i ++) { let bankNo = $(".bank-no").val();
let account = res.AccountList[i]; let identifyCard = $(".identify-card").val();
str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>'; let certificateNo = $(".certificate-no").val();
} let bankAddress = $(".bank-address").val();
$("#select-self-name").html(str); let uid = $(".bank-card-uid").val();
}
} return {
}); "uid": uid,
} "userName": userName,
$(function () { "bankCode": bankCode,
setAccount(); "accountName": accountName,
}); "certificateType": certificateType,
</script> "phoneNo": phoneNo,
"bankName": bankName,
"bankAccountType": bankAccountType,
"bankNo": bankNo,
"identifyCard": identifyCard,
"certificateNo": certificateNo,
"bankAddress": bankAddress
};
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getCutPageval();
showBankCradRecord(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getCutPageval();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showBankCradRecord(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPageval();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
showBankCradRecord(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCutPageval();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
showBankCradRecord(dataJSON);
});
$(".bank-card-save").click(function () {
let dataJSON = getBankCardData();
if (dataJSON["userName"].length <= 0) {
alert("用户名称不能为空");
return;
} else if (dataJSON["bankCode"].length <= 0) {
alert("银行编码不能为空");
return;
} else if (dataJSON["accountName"].length <= 0) {
alert("银行开户名不能为空");
return;
} else if (dataJSON["phoneNo"].length <= 0) {
alert("手机号不能为空");
return;
} else if (dataJSON["bankName"].length <= 0) {
alert("银行名称不能为空");
return;
} else if (dataJSON["bankNo"].length <= 0) {
alert("银行卡账号不能为空");
return;
} else if (dataJSON["certificateNo"].length <= 0) {
alert("身份证号不能为空");
return;
} else if (dataJSON["bankAddress"].length <= 0) {
alert("开户行地址不能为空");
return;
}
$.ajax({
url: "/add/bankCard",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("添加银行卡成功");
$(".bank-card-record").show();
$(".add-bank-card").hide();
showBankCradRecord(getBankCardData());
}
}
});
});
function setAccount() {
$.ajax({
url: "/get/all/account",
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let str = '<option value="' + "" + '">' + "请选择" + '</option>';
for (let i = 0; i < res.AccountList.length; i++) {
let account = res.AccountList[i];
str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>';
}
$("#select-self-name").html(str);
}
}
});
}
$(function () {
setAccount();
});
</script>
</body> </body>
</html> </html>

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link src="../static/lib/bootstrap/css/bootstrap.min.css"> <link src="../static/lib/bootstrap/css/bootstrap.min.css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -13,249 +13,261 @@
font-weight: normal; font-weight: normal;
margin-right: 20px; margin-right: 20px;
} }
.margin-bottom{
.margin-bottom {
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">审核处理</h3> <h3 class="panel-title">审核处理</h3>
</div>
<div class="panel-body">
<div class="margin-bottom">
<label for="">
<input checked name="confirm" type="radio" value="payfor_road">通道打款
</label>
<label for="">
<input name="confirm" type="radio" value="payfor_refuse">拒绝打款
</label>
<label for="">
<input name="confirm" type="radio" value="payfor_hand">手动打款
</label>
<label for="">
备注:<input id="remark" type="text" value=""><span class="color-red"> *必须</span>
</label>
<input class="btn btn-success" onclick="yes();" type="button" value="确定">
</div> </div>
<div class="panel-body"> <div class="margin-bottom" id="road">
<div class="margin-bottom"> <label for="">
<label for=""> 请选择打款通道:
<input type="radio" name="confirm" value="payfor_road" checked>通道打款 <input id="road-name" type="text" value=""><span class="color-red"> *必须</span>
</label> <input class="btn btn-info" id="road-search" type="button" value="搜索">
<label for=""> </label>
<input type="radio" name="confirm" value="payfor_refuse">拒绝打款 <label for="">
</label> <input id="balance" type="text" value="">
<label for=""> <button class="btn btn-primary" onclick="getBalance();" type="button">显示余额
<input type="radio" name="confirm" value="payfor_hand">手动打款 </label>
</label>
<label for="">
备注:<input type="text" id="remark" value=""><span class="color-red"> *必须</span>
</label>
<input type="button" class="btn btn-success" value="确定" onclick="yes();">
</div>
<div class="margin-bottom" id="road">
<label for="">
请选择打款通道:
<input type="text" value="" id="road-name"><span class="color-red"> *必须</span>
<input type="button" class="btn btn-info" value="搜索" id="road-search">
</label>
<label for="">
<input type="text" value="" id="balance">
<button type="button" class="btn btn-primary" onclick="getBalance();">显示余额
</label>
</div>
</div> </div>
</div> </div>
{{/*展示通道列表*/}} </div>
<div class="road-list"> {{/*展示通道列表*/}}
<div class="menu-table table-responsive"> <div class="road-list">
<table> <div class="menu-table table-responsive">
<thead class="thead-dark"> <table>
<tr> <thead class="thead-dark">
<th>序列号</th> <tr>
<th>通道名称</th> <th>序列号</th>
<th>通道uid</th> <th>通道名称</th>
<th>上游名称</th> <th>通道uid</th>
<th>状态</th> <th>上游名称</th>
<th>时间</th> <th>状态</th>
<th>操作</th> <th>时间</th>
</tr> <th>操作</th>
</thead> </tr>
<tbody id="table-body"> </thead>
</tbody> <tbody id="table-body">
</table> </tbody>
</div> </table>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
</div> </div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<script> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
$("input[name='confirm']").change(function () { <li class="pre_page">上一页</li>
let confirmType = $("input[name='confirm']:checked").val(); <li class="next_page">下一页</li>
if (confirmType != "allow") { <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
$("#road").hide(); <button class="btn btn-default" type="button">Go</button>
$(".road-list").hide(); </li>
} else if (confirmType == "allow") { </div>
$("#road").show(); </div>
ajaxRoadList(getCutPageValues());
$(".road-list").show(); <script>
} $("input[name='confirm']").change(function () {
}); let confirmType = $("input[name='confirm']:checked").val();
function getCutPageValues() { if (confirmType != "allow") {
let displayCount = $("#display_count").val(); $("#road").hide();
let currentPage = $(".current_page").html(); $(".road-list").hide();
let totalPage = $(".total_page").html(); } else if (confirmType == "allow") {
let jumpPage = $(".jump_page input").val(); $("#road").show();
let roadName = $("#road-name").val(); ajaxRoadList(getCutPageValues());
return { $(".road-list").show();
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"roadName":roadName
};
} }
//当每页显示数更改后,执行的操作 });
$("#display_count").change(function() {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
});
//点击上一页的按钮 function getCutPageValues() {
$(".pre_page").click(function() { let displayCount = $("#display_count").val();
let dataJSON = getCutPageValues(); let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let roadName = $("#road-name").val();
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"roadName": roadName
};
}
if (dataJSON["currentPage"] == 1) { //当每页显示数更改后,执行的操作
return; $("#display_count").change(function () {
} let dataJSON = getCutPageValues();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; ajaxRoadList(dataJSON);
ajaxRoadList(dataJSON); });
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxRoadList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPageValues();
if (dataJSON["jumpPage"].length <= 0) { //点击上一页的按钮
return; $(".pre_page").click(function () {
let dataJSON = getCutPageValues();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
ajaxRoadList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxRoadList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCutPageValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
ajaxRoadList(dataJSON);
});
function setCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
} }
ajaxRoadList(dataJSON);
}); });
function setCutPageValues(res) { $(".jump_page input").val("");
$(".current_page").html(res.CurrentPage); }
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() { function randRoadList(res) {
if ($(this).text() == res.DisplayCount) { setCutPageValues(res);
$(this).attr('selected', true); let str = "";
for (let i = 0; i < res.RoadInfoList.length; i++) {
let v = res.RoadInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.RoadName + "</th>" + "<th>" + v.RoadUid + "</th>" + "<th>" + v.ProductName + "</th>" +
"<th>" + v.Status + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>";
tmp = tmp.replace("unactive", "不可用").replace("active", "正常");
tmp = tmp + '<th>' + '<button type="button" value="' + v.RoadName + '" class="btn btn-default" onclick="save(this.value);">' + "确定" + '</button>' + '</th></tr>';
str = str + tmp;
$("#table-body").html(str);
}
}
function ajaxRoadList(dataJSON) {
$.ajax({
url: "/get/road",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randRoadList(res);
} }
}); },
$(".jump_page input").val(""); error: function () {
} alert("系统异常,请稍后再试")
function randRoadList(res) {
setCutPageValues(res);
let str = "";
for (let i = 0; i < res.RoadInfoList.length; i ++) {
let v = res.RoadInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.RoadName + "</th>" + "<th>" + v.RoadUid + "</th>" + "<th>" + v.ProductName + "</th>" +
"<th>" + v.Status + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>";
tmp = tmp.replace("unactive", "不可用").replace("active", "正常");
tmp = tmp +'<th>' + '<button type="button" value="' + v.RoadName +'" class="btn btn-default" onclick="save(this.value);">'+ "确定" +'</button>' + '</th></tr>';
str = str + tmp;
$("#table-body").html(str);
} }
} });
function ajaxRoadList(dataJSON) { }
$.ajax({
url: "/get/road", function getBalance() {
data: dataJSON, let roadName = $("#road-name").val();
success: function (res) { $.ajax({
if (res.Code == 404) { url: "/get/balance",
window.parent.location = "/login.html"; data: {
} else { "roadName": roadName
randRoadList(res); },
} success: function (res) {
}, if (res.Code == 404) {
error: function () { window.parent.location = "/login.html";
alert("系统异常,请稍后再试") } else {
$("#balance").val(res.Balance);
} }
}); },
} error: function () {
function getBalance() { alert("查询异常");
let roadName = $("#road-name").val();
$.ajax({
url: "/get/balance",
data: {
"roadName":roadName
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
$("#balance").val(res.Balance);
}
},
error: function () {
alert("查询异常");
}
});
}
function yes() {
let roadName = $("#road-name").val();
let remark = $("#remark").val();
let bankOrderId = $("#main-bank-order-id").val();
let confirmType = $("input[name='confirm']:checked").val();
if (remark.length == 0 ) {
alert("备注不能为空")
return
} }
$.ajax({ });
url:"/choose/payfor/road", }
data: {
"roadName":roadName, function yes() {
"bankOrderId":bankOrderId, let roadName = $("#road-name").val();
"remark":remark, let remark = $("#remark").val();
"confirmType":confirmType let bankOrderId = $("#main-bank-order-id").val();
}, let confirmType = $("input[name='confirm']:checked").val();
success: function (res) { if (remark.length == 0) {
if (res.Code == 404) { alert("备注不能为空")
window.parent.location = "/login.html"; return
} else if (res.Code == -1){ }
alert(res.Msg); $.ajax({
} else { url: "/choose/payfor/road",
alert("下发已经受理"); data: {
loadMainContent("/payfor_record.html"); "roadName": roadName,
} "bankOrderId": bankOrderId,
}, "remark": remark,
error: function () { "confirmType": confirmType
alert("系统异常,请稍后再试") },
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("下发已经受理");
loadMainContent("/payfor_record.html");
} }
}); },
} error: function () {
function save(roadName) { alert("系统异常,请稍后再试")
$("#road-name").val(roadName); }
}
//搜索列表
$("#road-search").click(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
}); });
$(function () { }
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON) function save(roadName) {
}); $("#road-name").val(roadName);
</script> }
//搜索列表
$("#road-search").click(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
});
$(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON)
});
</script>
</body> </body>
</html> </html>

View File

@@ -2,464 +2,482 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style> <style>
#create-agent span { #create-agent span {
display: inline-block; display: inline-block;
width: 100px; width: 100px;
} }
#create-agent div {
margin-bottom: 15px; #create-agent div {
} margin-bottom: 15px;
.add-agnet-button { }
margin-bottom: 10px;
} .add-agnet-button {
margin-bottom: 10px;
#agent-name-error, #agent-phone-error, #agent-login-password-error, #agent-vertify-password-error { }
display: inline-block;
color: red; #agent-name-error, #agent-phone-error, #agent-login-password-error, #agent-vertify-password-error {
margin-left: 10px; display: inline-block;
} color: red;
#reset-agent-password span { margin-left: 10px;
display: inline-block; }
width: 100px;
} #reset-agent-password span {
#reset-agent-password div { display: inline-block;
margin-bottom: 10px; width: 100px;
} }
#agent-login-password-error-reset, #agent-vertify-password-error-reset {
color: red; #reset-agent-password div {
} margin-bottom: 10px;
</style> }
#agent-login-password-error-reset, #agent-vertify-password-error-reset {
color: red;
}
</style>
</head> </head>
<body> <body>
<div class="agent-record"> <div class="agent-record">
<div class="search"> <div class="search">
<div> <div>
代理名称: 代理名称:
<input type="text" value="" placeholder="模糊匹配" id="agent-name-search"> <input id="agent-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default" id="agent-search">搜索</button> <button class="btn btn-default" id="agent-search" type="button">搜索</button>
</div> </div>
</div> </div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-agnet-button">创建代理</button> <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-agnet-button" type="button">创建代理</button>
<!-- 创建代理的模态框 --> <!-- 创建代理的模态框 -->
<div class="modal fade" id="create-agent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="create-agent"
<div class="modal-dialog" role="document"> role="dialog" tabindex="-1">
<div class="modal-content"> <div class="modal-dialog" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">创建代理商</h4> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
</div> aria-hidden="true">&times;</span></button>
<div class="modal-body modal-body-agent"> <h4 class="modal-title" id="myModalLabel">创建代理商</h4>
<div> </div>
<span>代理商名称:</span> <div class="modal-body modal-body-agent">
<input type="text" id="agent-name-modal"> <div>
<span id="agent-name-error"></span> <span>代理商名称:</span>
</div> <input id="agent-name-modal" type="text">
<div> <span id="agent-name-error"></span>
<span>注册手机号:</span> </div>
<input type="text" id="agent-phone-modal"> <div>
<span id="agent-phone-error"></span> <span>注册手机号:</span>
</div> <input id="agent-phone-modal" type="text">
<div> <span id="agent-phone-error"></span>
<span>账号登录密码:</span> </div>
<input type="password" id="agent-login-password-modal"> <div>
<span id="agent-login-password-error"></span> <span>账号登录密码:</span>
</div> <input id="agent-login-password-modal" type="password">
<div> <span id="agent-login-password-error"></span>
<span>确认密码:</span> </div>
<input type="password" id="agent-vertify-password-modal"> <div>
<span id="agent-vertify-password-error"></span> <span>确认密码:</span>
</div> <input id="agent-vertify-password-modal" type="password">
<span id="agent-vertify-password-error"></span>
<div> </div>
<span>代理商状态:</span>
<select id="agent-status">
<option value="active">激活</option>
<option value="unactive">冻结</option>}
</select>
</div>
<div>
<span>备注:</span>
<textarea id="agent-remark"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-agent" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-agent">保存</button>
</div>
</div>
</div>
</div>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>状态</th>
<th>代理编号</th>
<th>代理名称</th>
<th>登录账号</th>
<th>重置密码</th>
<th>操作</th>
</tr>
</thead>
<tbody id="agent-table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
</div>
<!-- 充值密码 --> <div>
<div class="modal fade" id="reset-agent-password" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <span>代理商状态:</span>
<div class="modal-dialog" role="document"> <select id="agent-status">
<div class="modal-content"> <option value="active">激活</option>
<div class="modal-header"> <option value="unactive">冻结</option>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> }
<h4 class="modal-title" id="myModalLabel">重置密码</h4> </select>
</div> </div>
<div class="modal-body modal-body-agent"> <div>
<input type="text" hidden="true" value="" id="agent-uid-reset"> <span>备注:</span>
<div> <textarea id="agent-remark"></textarea>
<span>新密码:</span> </div>
<input type="password" id="agent-login-password-reset"> </div>
<span id="agent-login-password-error-reset"></span> <div class="modal-footer">
</div> <button class="btn btn-default cancel-agent" data-dismiss="modal" type="button">取消</button>
<div> <button class="btn btn-primary save-agent" type="button">保存</button>
<span>确认新密码:</span> </div>
<input type="password" id="agent-vertify-password-reset"> </div>
<span id="agent-vertify-password-error-reset"></span> </div>
</div> </div>
</div> <div class="menu-table">
<div class="modal-footer"> <table>
<button type="button" class="btn btn-default cancel-agent-reset" data-dismiss="modal">放弃</button> <thead class="thead-dark">
<button type="button" class="btn btn-primary save-agent-reset">重置</button> <tr>
</div> <th>序列号</th>
</div> <th>状态</th>
</div> <th>代理编号</th>
</div> <th>代理名称</th>
<th>登录账号</th>
<th>重置密码</th>
<th>操作</th>
</tr>
</thead>
<tbody id="agent-table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<!-- 操作代理商 --> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<div class="modal fade" id="operator-agent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <li class="pre_page">上一页</li>
<div class="modal-dialog" role="document"> <li class="next_page">下一页</li>
<div class="modal-content"> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<div class="modal-header"> <button class="btn btn-default" type="button">Go</button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> </li>
<h4 class="modal-title" id="myModalLabel">代理商操作</h4> </div>
</div> </div>
<div class="modal-body modal-body-agent">
<input type="text" hidden="true" value="" id="agent-uid-operator">
<div>
<span>操作类型:</span>
<select id="agent-opertor">
<option value="plus-amount">加款</option>
<option value="sub-amount">减款</option>
<option value="freeze-amount">冻结</option>
<option value="unfreeze-amount">解冻</option>
</select>
</div>
<div>
<span>操作金额:</span>
<input type="password" id="agent-opertor-amount">
</div>
<div>
<span>操作结果:</span>
<span></span>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-agent-reset" data-dismiss="modal">放弃</button>
<button type="button" class="btn btn-primary save-agent-reset">重置</button>
</div>
</div>
</div>
</div>
<script> <!-- 充值密码 -->
function getAgentModalContent() { <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="reset-agent-password"
let agentName = $("#agent-name-modal").val(); role="dialog" tabindex="-1">
let agentPhone = $("#agent-phone-modal").val(); <div class="modal-dialog" role="document">
let agentLoginPassword = $("#agent-login-password-modal").val(); <div class="modal-content">
let agentVertifyPassword = $("#agent-vertify-password-modal").val(); <div class="modal-header">
let agentRemark = $("#agent-remark").val(); <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
let status = $("#agent-status").val(); </button>
<h4 class="modal-title" id="myModalLabel">重置密码</h4>
</div>
<div class="modal-body modal-body-agent">
<input hidden="true" id="agent-uid-reset" type="text" value="">
<div>
<span>新密码:</span>
<input id="agent-login-password-reset" type="password">
<span id="agent-login-password-error-reset"></span>
</div>
<div>
<span>确认新密码:</span>
<input id="agent-vertify-password-reset" type="password">
<span id="agent-vertify-password-error-reset"></span>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-agent-reset" data-dismiss="modal" type="button">放弃</button>
<button class="btn btn-primary save-agent-reset" type="button">重置</button>
</div>
</div>
</div>
</div>
return { <!-- 操作代理商 -->
"agentName": agentName, <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="operator-agent"
"agentPhone": agentPhone, role="dialog" tabindex="-1">
"agentLoginPassword": agentLoginPassword, <div class="modal-dialog" role="document">
"agentVertifyPassword": agentVertifyPassword, <div class="modal-content">
"agentRemark": agentRemark, <div class="modal-header">
"status": status <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
}; </button>
} <h4 class="modal-title" id="myModalLabel">代理商操作</h4>
function getAgentCutPageValues(){ </div>
let displayCount = $("#display_count").val(); <div class="modal-body modal-body-agent">
let currentPage = $(".current_page").html(); <input hidden="true" id="agent-uid-operator" type="text" value="">
let totalPage = $(".total_page").html(); <div>
let jumpPage = $(".jump_page input").val(); <span>操作类型:</span>
let agentName = $("#agent-name-search").val(); <select id="agent-opertor">
<option value="plus-amount">加款</option>
<option value="sub-amount">减款</option>
<option value="freeze-amount">冻结</option>
<option value="unfreeze-amount">解冻</option>
</select>
</div>
<div>
<span>操作金额:</span>
<input id="agent-opertor-amount" type="password">
</div>
<div>
<span>操作结果:</span>
<span></span>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-agent-reset" data-dismiss="modal" type="button">放弃</button>
<button class="btn btn-primary save-agent-reset" type="button">重置</button>
</div>
</div>
</div>
</div>
return { <script>
"displayCount":displayCount, function getAgentModalContent() {
"currentPage":currentPage, let agentName = $("#agent-name-modal").val();
"totalPage":totalPage, let agentPhone = $("#agent-phone-modal").val();
"jumpPage":jumpPage, let agentLoginPassword = $("#agent-login-password-modal").val();
"agentName":agentName let agentVertifyPassword = $("#agent-vertify-password-modal").val();
}; let agentRemark = $("#agent-remark").val();
} let status = $("#agent-status").val();
function clearAgentModalContent() { return {
$("#agent-name-modal").val(""); "agentName": agentName,
$("#agent-phone-modal").val(""); "agentPhone": agentPhone,
$("#agent-login-password-modal").val(""); "agentLoginPassword": agentLoginPassword,
$("#agent-vertify-password-modal").val(""); "agentVertifyPassword": agentVertifyPassword,
$("#agent-remark").val(""); "agentRemark": agentRemark,
} "status": status
};
}
function clearAgentModalError() { function getAgentCutPageValues() {
$("#agent-name-error").html(""); let displayCount = $("#display_count").val();
$("#agent-phone-error").html(""); let currentPage = $(".current_page").html();
$("#agent-login-password-error").html(""); let totalPage = $(".total_page").html();
$("#agent-vertify-password-error").html(""); let jumpPage = $(".jump_page input").val();
} let agentName = $("#agent-name-search").val();
function clearAgentCutPageValues(res) {
$(".current_page").html(res.CurrentPage); return {
$(".total_page").html(res.TotalPage); "displayCount": displayCount,
$("#display_count option").each(function() { "currentPage": currentPage,
if ($(this).text() == res.DisplayCount) { "totalPage": totalPage,
$(this).attr('selected', true); "jumpPage": jumpPage,
} "agentName": agentName
}); };
$(".jump_page input").val(""); }
}
function showAgentList(res) { function clearAgentModalContent() {
clearAgentCutPageValues(res); $("#agent-name-modal").val("");
let str = ""; $("#agent-phone-modal").val("");
for (let i = 0; i < res.AgentList.length; i ++) { $("#agent-login-password-modal").val("");
let v = res.AgentList[i]; $("#agent-vertify-password-modal").val("");
let tmp = ""; $("#agent-remark").val("");
if (v.Status == "unactive") { }
tmp = "<tr style='color: red;'>";
function clearAgentModalError() {
$("#agent-name-error").html("");
$("#agent-phone-error").html("");
$("#agent-login-password-error").html("");
$("#agent-vertify-password-error").html("");
}
function clearAgentCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
}
function showAgentList(res) {
clearAgentCutPageValues(res);
let str = "";
for (let i = 0; i < res.AgentList.length; i++) {
let v = res.AgentList[i];
let tmp = "";
if (v.Status == "unactive") {
tmp = "<tr style='color: red;'>";
} else {
tmp = "<tr>";
}
tmp = tmp + "<th>" + (res.StartIndex + i + 1) + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.AgentUid + "</th>" +
"<th>" + v.AgentName + "</th>" + "<th>" + v.AgentPhone + "</th>";
tmp = tmp + "<th>" + '<button type="button" value="' + v.AgentUid + '" class="btn btn-default" onclick="resetPassword(this.value);">' +
'<span class="glyphicon glyphicon-edit"></span></button>' + "</th>";
tmp = tmp.replace("unactive", "冻结").replace("active", "激活");
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.AgentUid + '" class="btn btn-default" onclick="updateAgentStatus(this.value);">' + "激活|冻结" + '</button>' +
'<button type="button" value="' + v.AgentUid + '" class="btn btn-default" onclick="deleteAgent(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#agent-table-body").html(str);
}
function resetPassword(agentUid) {
$("#agent-uid-reset").val(agentUid);
$("#agent-login-password-reset").val("");
$("#agent-vertify-password-reset").val("");
$("#agent-login-password-error-reset").html("");
$("#agent-vertify-password-error-reset").html("");
$("#reset-agent-password").modal();
}
function updateAgentStatus(agentUid) {
$.ajax({
url: "/update/agent/status",
data: {
"agentUid": agentUid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("处理失败");
} else { } else {
tmp = "<tr>"; ajaxAgentList(getAgentCutPageValues());
alert("操作成功")
} }
}
});
}
tmp = tmp + "<th>" + (res.StartIndex+i+1) + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.AgentUid + "</th>" + function deleteAgent(agentUid) {
"<th>" + v.AgentName + "</th>" + "<th>" + v.AgentPhone + "</th>" ; if (!window.confirm("确定删除该代理商吗?")) {
return;
}
$.ajax({
url: "/delete/agent",
data: {
"agentUid": agentUid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("删除成功");
ajaxAgentList(getAgentCutPageValues());
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
}
tmp = tmp + "<th>" + '<button type="button" value="' + v.AgentUid +'" class="btn btn-default" onclick="resetPassword(this.value);">' + function ajaxAgentList(dataJSON) {
'<span class="glyphicon glyphicon-edit"></span></button>' + "</th>"; $.ajax({
url: "/get/agent",
data: dataJSON,
tmp = tmp.replace("unactive", "冻结").replace("active", "激活"); success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("获取代理数据失败");
} else {
showAgentList(res);
}
}
});
}
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' + //当每页显示数更改后,执行的操作
'<button type="button" value="' + v.AgentUid +'" class="btn btn-default" onclick="updateAgentStatus(this.value);">'+ "激活|冻结" +'</button>' + $("#display_count").change(function () {
'<button type="button" value="' + v.AgentUid +'" class="btn btn-default" onclick="deleteAgent(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' + let dataJSON = getAgentCutPageValues();
'</div>' + "</th>" + "</tr>"; ajaxAgentList(dataJSON);
str = str + tmp; });
}
$("#agent-table-body").html(str);
}
function resetPassword(agentUid) { //点击上一页的按钮
$("#agent-uid-reset").val(agentUid); $(".pre_page").click(function () {
$("#agent-login-password-reset").val(""); let dataJSON = getAgentCutPageValues();
$("#agent-vertify-password-reset").val("");
$("#agent-login-password-error-reset").html("");
$("#agent-vertify-password-error-reset").html("");
$("#reset-agent-password").modal();
}
function updateAgentStatus(agentUid) {
$.ajax({
url: "/update/agent/status",
data: {
"agentUid": agentUid
},
success: function(res) { if (dataJSON["currentPage"] == 1) {
if (res.Code == 404) { return;
window.parent.location = "/login.html"; }
} else if (res.Code == -1) { dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
alert("处理失败"); ajaxAgentList(dataJSON);
} else { });
ajaxAgentList(getAgentCutPageValues()); //点击下一页的按钮时
alert("操作成功") $(".next_page").click(function () {
} let dataJSON = getAgentCutPageValues();
} if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
}); return;
} }
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxAgentList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getAgentCutPageValues();
function deleteAgent(agentUid) { if (dataJSON["jumpPage"].length <= 0) {
if (!window.confirm("确定删除该代理商吗?")) { return;
return; }
} ajaxAgentList(dataJSON);
$.ajax({ });
url: "/delete/agent",
data: {
"agentUid":agentUid
},
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("删除成功");
ajaxAgentList(getAgentCutPageValues());
}
},
error: function(res) {
alert("系统异常,请稍后再试");
}
});
}
function ajaxAgentList(dataJSON) { $(".save-agent-reset").click(function () {
$.ajax({ let agentUid = $("#agent-uid-reset").val();
url: "/get/agent", let newPassword = $("#agent-login-password-reset").val();
data: dataJSON, let newVertifyPassword = $("#agent-vertify-password-reset").val();
$("#agent-login-password-error-reset").html("");
$("#agent-vertify-password-error-reset").html("");
$.ajax({
url: "/reset/agent/password",
data: {
"agentUid": agentUid,
"newPassword": newPassword,
"newVertifyPassword": newVertifyPassword
},
success: function(res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else if (res.Code == -1) { } else if (res.Code == -2) {
alert("获取代理数据失败"); alert("充值代理商密码遇到错误");
} else { } else if (res.Code == -1) {
showAgentList(res); $(res.Key).html(res.Msg);
} } else {
} alert("重置代理商密码成功");
}); $(".cancel-agent-reset").trigger('click');
} }
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
});
//当每页显示数更改后,执行的操作 $(".save-agent").click(function () {
$("#display_count").change(function() { clearAgentModalError();
let dataJSON = getAgentCutPageValues(); let dataJSON = getAgentModalContent();
ajaxAgentList(dataJSON); $.ajax({
}); url: "/add/agent",
data: dataJSON,
//点击上一页的按钮 success: function (res) {
$(".pre_page").click(function() { if (res.Code == 404) {
let dataJSON = getAgentCutPageValues(); window.parent.location = "/login.html";
} else if (res.Code == -1) {
$(res.Key).html(res.Msg);
} else {
alert("添加成功");
$(".cancel-agent").trigger('click');
ajaxAgentList(getAgentCutPageValues());
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
});
if (dataJSON["currentPage"] == 1) { $(".add-agnet-button").click(function () {
return; clearAgentModalContent();
} clearAgentModalError();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; $("#create-agent").modal();
ajaxAgentList(dataJSON); });
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getAgentCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxAgentList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getAgentCutPageValues();
if (dataJSON["jumpPage"].length <= 0) { $(".cancel-agent").click(function () {
return; clearAgentModalError();
} clearAgentModalContent();
ajaxAgentList(dataJSON); });
}); $(function () {
ajaxAgentList(getAgentCutPageValues());
$(".save-agent-reset").click(function() { });
let agentUid = $("#agent-uid-reset").val(); </script>
let newPassword = $("#agent-login-password-reset").val();
let newVertifyPassword = $("#agent-vertify-password-reset").val();
$("#agent-login-password-error-reset").html("");
$("#agent-vertify-password-error-reset").html("");
$.ajax({
url: "/reset/agent/password",
data: {
"agentUid":agentUid,
"newPassword":newPassword,
"newVertifyPassword":newVertifyPassword
},
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -2) {
alert("充值代理商密码遇到错误");
} else if (res.Code == -1) {
$(res.Key).html(res.Msg);
} else {
alert("重置代理商密码成功");
$(".cancel-agent-reset").trigger('click');
}
},
error: function(res) {
alert("系统异常,请稍后再试");
}
});
});
$(".save-agent").click(function() {
clearAgentModalError();
let dataJSON = getAgentModalContent();
$.ajax({
url: "/add/agent",
data: dataJSON,
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$(res.Key).html(res.Msg);
} else {
alert("添加成功");
$(".cancel-agent").trigger('click');
ajaxAgentList(getAgentCutPageValues());
}
},
error: function(res) {
alert("系统异常,请稍后再试");
}
});
});
$(".add-agnet-button").click(function() {
clearAgentModalContent();
clearAgentModalError();
$("#create-agent").modal();
});
$(".cancel-agent").click(function() {
clearAgentModalError();
clearAgentModalContent();
});
$(function() {
ajaxAgentList(getAgentCutPageValues());
});
</script>
</body> </body>
</html> </html>

View File

@@ -2,217 +2,227 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/jquery.ui.min.js"></script> <script src="../static/js/jquery.ui.min.js"></script>
<style> <style>
#deployRoleModal { #deployRoleModal {
margin-bottom: 95px; margin-bottom: 95px;
height: 500px; height: 500px;
overflow-y: hidden; overflow-y: hidden;
} }
.modal-content {
overflow: auto; .modal-content {
max-height: 500px; overflow: auto;
} max-height: 500px;
.modal-header { }
padding: 10px;
} .modal-header {
.modal-footer { padding: 10px;
padding-top: 10px; }
padding-bottom: 30px;
} .modal-footer {
</style> padding-top: 10px;
padding-bottom: 30px;
}
</style>
</head> </head>
<body> <body>
<!-- 权限配置模态框 --> <!-- 权限配置模态框 -->
<div class="modal fade" id="deployRoleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="deployRoleModal"
<div class="modal-dialog modal-sm" role="document"> role="dialog" tabindex="-1">
<div class="modal-content"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-header">
<h4 class="modal-title" id="deployButton">配置权限项</h4> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</div> </button>
<div class="modal-body modal-body-deploy"> <h4 class="modal-title" id="deployButton">配置权限项</h4>
</div> </div>
<div class="modal-footer"> <div class="modal-body modal-body-deploy">
<button type="button" class="btn btn-default cancel-deploy" data-dismiss="modal">取消</button> </div>
<button type="button" class="btn btn-primary save-deploy">保存</button> <div class="modal-footer">
</div> <button class="btn btn-default cancel-deploy" data-dismiss="modal" type="button">取消</button>
</div> <button class="btn btn-primary save-deploy" type="button">保存</button>
</div> </div>
</div> </div>
<!-- 权限模态框 end --> </div>
<script> </div>
function editRole(roleUid) { <!-- 权限模态框 end -->
showPowerTree(roleUid); <script>
$("#deployRoleModal").modal(); function editRole(roleUid) {
} showPowerTree(roleUid);
$("#deployRoleModal").modal();
}
$(".save-deploy").click(function() { $(".save-deploy").click(function () {
let firstMenuUid = []; let firstMenuUid = [];
let secondMenuUid = []; let secondMenuUid = [];
let powerId = []; let powerId = [];
$('input[name="checkbox-first-menu-uid"]:checked').each(function() { $('input[name="checkbox-first-menu-uid"]:checked').each(function () {
firstMenuUid.push($(this).val()); firstMenuUid.push($(this).val());
}); });
$('input[name="checkbox-second-menu-uid"]:checked').each(function() { $('input[name="checkbox-second-menu-uid"]:checked').each(function () {
secondMenuUid.push($(this).val()); secondMenuUid.push($(this).val());
}); });
$('input[name="checkbox-power-id"]:checked').each(function() { $('input[name="checkbox-power-id"]:checked').each(function () {
powerId.push($(this).val()); powerId.push($(this).val());
}); });
let roleUid = $("#roleUid").html(); let roleUid = $("#roleUid").html();
savePower({"firstMenuUid":firstMenuUid, "secondMenuUid":secondMenuUid, "powerId":powerId, "roleUid": roleUid});
});
//对已经选择checkbox进行打钩 savePower({
function setCheckboxChecked(res) { "firstMenuUid": firstMenuUid,
$('input[name="checkbox-first-menu-uid"]').each(function() { "secondMenuUid": secondMenuUid,
let firstMenuUid = $(this).val(); "powerId": powerId,
if (res.ShowFirstMenuUid[firstMenuUid]) { "roleUid": roleUid
$(this).attr("checked", true); });
} });
});
$('input[name="checkbox-second-menu-uid"]').each(function() {
let secondMenuUid = $(this).val();
if (res.ShowSecondMenuUid[secondMenuUid]) {
$(this).attr('checked', true);
}
});
$('input[name="checkbox-power-id"]').each(function() {
let powerId = $(this).val();
if (res.ShowPowerUid[powerId]) {
$(this).attr('checked', true);
}
});
}
function getCheckboxFirstMenuUid() { //对已经选择checkbox进行打钩
let firstMenuUid = []; function setCheckboxChecked(res) {
$('input[name="checkbox-first-menu-uid"]:checked').each(function() { $('input[name="checkbox-first-menu-uid"]').each(function () {
firstMenuUid.push($(this).val()); let firstMenuUid = $(this).val();
}); if (res.ShowFirstMenuUid[firstMenuUid]) {
return firstMenuUid; $(this).attr("checked", true);
} }
});
$('input[name="checkbox-second-menu-uid"]').each(function () {
let secondMenuUid = $(this).val();
if (res.ShowSecondMenuUid[secondMenuUid]) {
$(this).attr('checked', true);
}
});
$('input[name="checkbox-power-id"]').each(function () {
let powerId = $(this).val();
if (res.ShowPowerUid[powerId]) {
$(this).attr('checked', true);
}
});
}
function getCheckboxSecondMenuUid() { function getCheckboxFirstMenuUid() {
let secondMenuUid = []; let firstMenuUid = [];
$('input[name="checkbox-second-menu-uid"]:checked').each(function() { $('input[name="checkbox-first-menu-uid"]:checked').each(function () {
secondMenuUid.push($(this).val()); firstMenuUid.push($(this).val());
}); });
return secondMenuUid; return firstMenuUid;
} }
function getCheckboxPowerId() { function getCheckboxSecondMenuUid() {
let powerUid = []; let secondMenuUid = [];
$('input[name="checkbox-power-id"]:checked').each(function() { $('input[name="checkbox-second-menu-uid"]:checked').each(function () {
powerUid.push($(this).val()); secondMenuUid.push($(this).val());
}); });
return powerUid; return secondMenuUid;
} }
function savePower(dataJSON) { function getCheckboxPowerId() {
$.ajax({ let powerUid = [];
url: "/save/power", $('input[name="checkbox-power-id"]:checked').each(function () {
data: dataJSON, powerUid.push($(this).val());
success: function(res) { });
if (res.Code == 404) { return powerUid;
window.parent.location = "/login.html"; }
return;
} else if (res.Code == 200) {
alert("保存成功");
} else {
alert("保存失败");
}
$(".cancel-deploy").trigger('click');
},
error: function() { function savePower(dataJSON) {
alert("系统异常,请稍后重试"); $.ajax({
} url: "/save/power",
}); data: dataJSON,
} success: function (res) {
if (res.Code == 404) {
function showPowerTree(roleUid) { window.parent.location = "/login.html";
$.ajax({ return;
url: "/get/deployTree", } else if (res.Code == 200) {
async: false, alert("保存成功");
data: { } else {
"roleUid": roleUid alert("保存失败");
}, }
$(".cancel-deploy").trigger('click');
},
success: function(res) { error: function () {
if (res.Code == 404) { alert("系统异常,请稍后重试");
window.parent.location = "/login.html"; }
return; });
} }
$(".modal-body-deploy").html("");
let str = '<span id="roleUid" style="display: none;">' + roleUid + '</span>';
for (let i = 0; i < res.AllFirstMenu.length; i ++) {
str +='<ul>';
str += '<li><input type="checkbox" name="checkbox-first-menu-uid" class="checkbox-first-menu-uid" value="'+ res.AllFirstMenu[i].MenuUid +'">' + res.AllFirstMenu[i].FirstMenu + '</li>';
for (let j = 0; j < res.AllSecondMenu.length; j ++) {
str += '<ul>';
if (res.AllSecondMenu[j].FirstMenuUid == res.AllFirstMenu[i].MenuUid) {
str += '<li><input type="checkbox" name="checkbox-second-menu-uid" class="checkbox-second-menu-uid" value="' + res.AllSecondMenu[j].SecondMenuUid + '">' + res.AllSecondMenu[j].SecondMenu + '</li>';
str += '<ul>';
for (let k = 0; k < res.AllPower.length; k ++) {
if (res.AllPower[k].SecondMenuUid == res.AllSecondMenu[j].SecondMenuUid) {
str += '<li><input type="checkbox" name="checkbox-power-id" class="checkbox-power-id" value="' + res.AllPower[k].PowerId + '">' + res.AllPower[k].PowerItem + '</li>';
}
}
str += '</ul>';
}
str += '</ul>';
}
str += '</ul>';
}
$(".modal-body-deploy").html(str);
setCheckboxChecked(res);
},
error: function() { function showPowerTree(roleUid) {
alert("系统异常,请稍后重试"); $.ajax({
} url: "/get/deployTree",
}); async: false,
} data: {
"roleUid": roleUid
},
$(document).on("show.bs.modal", ".modal", function(){ success: function (res) {
$(this).draggable(); if (res.Code == 404) {
$(this).css("overflow-y", "hidden"); window.parent.location = "/login.html";
// 防止出现滚动条,出现的话,你会把滚动条一起拖着走的 return;
}); }
$(".modal-body-deploy").on("click",".checkbox-first-menu-uid", function() { $(".modal-body-deploy").html("");
if (this.checked) { let str = '<span id="roleUid" style="display: none;">' + roleUid + '</span>';
$(this).parent().parent().children("ul").children('li').children('.checkbox-second-menu-uid').prop('checked', 'checked'); for (let i = 0; i < res.AllFirstMenu.length; i++) {
} else { str += '<ul>';
$(this).parent().parent().children("ul").children('li').children('.checkbox-second-menu-uid').removeAttr('checked'); str += '<li><input type="checkbox" name="checkbox-first-menu-uid" class="checkbox-first-menu-uid" value="' + res.AllFirstMenu[i].MenuUid + '">' + res.AllFirstMenu[i].FirstMenu + '</li>';
$(this).parent().parent().children("ul").children('ul').children('li').children('.checkbox-power-id').removeAttr('checked'); for (let j = 0; j < res.AllSecondMenu.length; j++) {
} str += '<ul>';
}); if (res.AllSecondMenu[j].FirstMenuUid == res.AllFirstMenu[i].MenuUid) {
$(".modal-body-deploy").on("click", ".checkbox-second-menu-uid", function() { str += '<li><input type="checkbox" name="checkbox-second-menu-uid" class="checkbox-second-menu-uid" value="' + res.AllSecondMenu[j].SecondMenuUid + '">' + res.AllSecondMenu[j].SecondMenu + '</li>';
if (this.checked) { str += '<ul>';
$(this).parent().parent().parent().children('li').children('.checkbox-first-menu-uid').prop('checked', 'checked'); for (let k = 0; k < res.AllPower.length; k++) {
} else { if (res.AllPower[k].SecondMenuUid == res.AllSecondMenu[j].SecondMenuUid) {
$(this).parent().parent().children("ul").children('li').children('.checkbox-power-id').removeAttr('checked'); str += '<li><input type="checkbox" name="checkbox-power-id" class="checkbox-power-id" value="' + res.AllPower[k].PowerId + '">' + res.AllPower[k].PowerItem + '</li>';
if (getCheckboxSecondMenuUid() <= 0) { }
$(this).parent().parent().parent().children('li').children('.checkbox-first-menu-uid').removeAttr('checked'); }
} str += '</ul>';
} }
}); str += '</ul>';
$(".modal-body-deploy").on("click", ".checkbox-power-id", function() { }
if (this.checked) { str += '</ul>';
$(this).parent().parent().parent().children('li').children('.checkbox-second-menu-uid').prop('checked', 'checked'); }
$(this).parent().parent().parent().parent().children('li').children('.checkbox-first-menu-uid').prop('checked', 'checked') $(".modal-body-deploy").html(str);
} setCheckboxChecked(res);
}); },
</script>
error: function () {
alert("系统异常,请稍后重试");
}
});
}
$(document).on("show.bs.modal", ".modal", function () {
$(this).draggable();
$(this).css("overflow-y", "hidden");
// 防止出现滚动条,出现的话,你会把滚动条一起拖着走的
});
$(".modal-body-deploy").on("click", ".checkbox-first-menu-uid", function () {
if (this.checked) {
$(this).parent().parent().children("ul").children('li').children('.checkbox-second-menu-uid').prop('checked', 'checked');
} else {
$(this).parent().parent().children("ul").children('li').children('.checkbox-second-menu-uid').removeAttr('checked');
$(this).parent().parent().children("ul").children('ul').children('li').children('.checkbox-power-id').removeAttr('checked');
}
});
$(".modal-body-deploy").on("click", ".checkbox-second-menu-uid", function () {
if (this.checked) {
$(this).parent().parent().parent().children('li').children('.checkbox-first-menu-uid').prop('checked', 'checked');
} else {
$(this).parent().parent().children("ul").children('li').children('.checkbox-power-id').removeAttr('checked');
if (getCheckboxSecondMenuUid() <= 0) {
$(this).parent().parent().parent().children('li').children('.checkbox-first-menu-uid').removeAttr('checked');
}
}
});
$(".modal-body-deploy").on("click", ".checkbox-power-id", function () {
if (this.checked) {
$(this).parent().parent().parent().children('li').children('.checkbox-second-menu-uid').prop('checked', 'checked');
$(this).parent().parent().parent().parent().children('li').children('.checkbox-first-menu-uid').prop('checked', 'checked')
}
});
</script>
</body> </body>
</html> </html>

View File

@@ -2,287 +2,298 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/basic.js"></script> <script src="../static/js/basic.js"></script>
<style> <style>
.first-input-group .basic-url { .first-input-group .basic-url {
width: 300px; width: 300px;
} }
</style> </style>
</head> </head>
<body> <body>
<!-- 添加菜单的模态框 --> <!-- 添加菜单的模态框 -->
<div class="modal fade" id="addMenuModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addMenuModal"
<div class="modal-dialog" role="document"> role="dialog" tabindex="-1">
<div class="modal-content"> <div class="modal-dialog" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">添加一级菜单</h4> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</div> </button>
<div class="modal-body modal-body-menu"> <h4 class="modal-title" id="myModalLabel">添加一级菜单</h4>
<div class="input-group first-input-group"> </div>
<span class="input-group-addon basic-addon3">一级菜单</span> <div class="modal-body modal-body-menu">
<input type="text" class="form-control basic-url"> <div class="input-group first-input-group">
<span class="first-menu-error"></span> <span class="input-group-addon basic-addon3">一级菜单</span>
</div> <input class="form-control basic-url" type="text">
<span class="first-menu-error"></span>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-menu" data-dismiss="modal">取消</button> </div>
<button type="button" class="btn btn-primary save-menu">保存</button> <div class="modal-footer">
</div> <button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
</div> <button class="btn btn-primary save-menu" type="button">保存</button>
</div> </div>
</div> </div>
<div class="search"> </div>
<div> </div>
<span>一级菜单</span> <div class="search">
<input type="text" class="first-menu-serach" placeholder="模糊匹配" value=""> <div>
</div> <span>一级菜单</span>
<div> <input class="first-menu-serach" placeholder="模糊匹配" type="text" value="">
<button type="button" class="btn btn-default first-menu-search">搜索</button> </div>
</div> <div>
</div> <button class="btn btn-default first-menu-search" type="button">搜索</button>
<div class="add-menu"> </div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-toggle="modal" data-target="#addMenuModal">添加一级菜单</button> </div>
<strong>提示:创建导航菜单栏,一般由技术开发人员进行配置!</strong> <div class="add-menu">
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addMenuModal" data-toggle="modal"
</div> type="button">添加一级菜单
<div class="menu-table"> </button>
<table> <strong>提示:创建导航菜单栏,一般由技术开发人员进行配置!</strong>
<thead class="thead-dark">
<tr> </div>
<th>序列号</th> <div class="menu-table">
<th>菜单识别号</th> <table>
<th>一级菜单</th> <thead class="thead-dark">
<th>菜单顺序号</th> <tr>
<th>二级菜单</th> <th>序列号</th>
<th>创建者</th> <th>菜单识别号</th>
<th>操作</th> <th>一级菜单</th>
</tr> <th>菜单顺序号</th>
</thead> <th>二级菜单</th>
<tbody id="menu_table_body"> <th>创建者</th>
<th>操作</th>
</tbody> </tr>
</table> </thead>
</div> <tbody id="menu_table_body">
<!-- 分页插件 -->
<div class="cut_page"> </tbody>
<li> </table>
每页显示 </div>
<select id="display_count"> <!-- 分页插件 -->
<option value="20">20</option> <div class="cut_page">
<option value="30">30</option> <li>
<option value="50">50</option> 每页显示
<option value="100">100</option> <select id="display_count">
</select> <option value="20">20</option>
</li> <option value="30">30</option>
<option value="50">50</option>
<li class="current_total_page"><span class="current_page">1</span>/<span class="total_page">2</span></li> <option value="100">100</option>
<li class="pre_page">上一页</li> </select>
<li class="next_page">下一页</li> </li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div> <li class="current_total_page"><span class="current_page">1</span>/<span class="total_page">2</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
<script> <script>
$(".search div button").click(function() { $(".search div button").click(function () {
let firstMenuSearch = $(".first-menu-serach").val(); let firstMenuSearch = $(".first-menu-serach").val();
let dataJSON = getCutPageData(); let dataJSON = getCutPageData();
dataJSON["firstMenuSearch"] = firstMenuSearch; dataJSON["firstMenuSearch"] = firstMenuSearch;
showMenuList(dataJSON); showMenuList(dataJSON);
}); });
//获取分页的基础数据
function getCutPageData() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage": jumpPage}; //获取分页的基础数据
} function getCutPageData() {
$(".first-menu-search").click(function() { let displayCount = $("#display_count").val();
showMenuList(getCutPageData()); let currentPage = $(".current_page").html();
}); let totalPage = $(".total_page").html();
//刚开始加载页面的时候,执行的一系列操作 let jumpPage = $(".jump_page input").val();
$(document).ready(function() {
showMenuList(getCutPageData());
});
//获取数据
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
showMenuList(getCutPageData());
});
//点击上一页的按钮 return {"displayCount": displayCount, "currentPage": currentPage, "totalPage": totalPage, "jumpPage": jumpPage};
$(".pre_page").click(function() { }
let dataJSON = getCutPageData();
if (dataJSON["currentPage"] == 1) { $(".first-menu-search").click(function () {
return; showMenuList(getCutPageData());
} });
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; //刚开始加载页面的时候,执行的一系列操作
showMenuList(dataJSON); $(document).ready(function () {
}); showMenuList(getCutPageData());
//点击下一页的按钮时 });
$(".next_page").click(function() { //获取数据
let dataJSON = getCutPageData(); //当每页显示数更改后,执行的操作
$("#display_count").change(function () {
showMenuList(getCutPageData());
});
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { //点击上一页的按钮
return; $(".pre_page").click(function () {
} let dataJSON = getCutPageData();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; if (dataJSON["currentPage"] == 1) {
return;
showMenuList(dataJSON); }
}); dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
//点击跳转那一页的按钮 showMenuList(dataJSON);
$(".jump_page button").click(function() { });
let dataJSON = getCutPageData(); //点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPageData();
if (dataJSON["jumpPage"].length <= 0) { if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return; return;
} }
showMenuList(dataJSON); dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
});
function Ajax(menuUid, hostUrl) { showMenuList(dataJSON);
$.ajax({ });
url: hostUrl, //点击跳转那一页的按钮
data: { $(".jump_page button").click(function () {
"menuUid": menuUid let dataJSON = getCutPageData();
},
success: function(res) { if (dataJSON["jumpPage"].length <= 0) {
return;
if (res.Code == 404) { }
window.parent.location = "/login.html";
} else if (res.Code == 200){
showMenuList(getCutPageData());
$(".table-caption").html("");
} else {
}
},
error: function() { showMenuList(dataJSON);
alert("系统异常,请稍后重试"); });
}
}); function Ajax(menuUid, hostUrl) {
} $.ajax({
url: hostUrl,
//提升菜单的顺序 data: {
function menuUp(menuUid) { "menuUid": menuUid
Ajax(menuUid, "/up/menu"); },
}
//降低菜单的顺序
function menuDown(menuUid) {
Ajax(menuUid, "/down/menu");
}
//删除菜单
function menuDelete(menuUid) {
if (!window.confirm("是否确定删除该项?")) {
return;
}
Ajax(menuUid,"/delete/menu");
}
//此函数的作用,是在每行的最后一格,加入可操作的按钮图标
function showMenuList(dataJSON) {
$.ajax({
url: "/get/menu",
data: dataJSON,
success: function(res) { success: function (res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
if (res.Code == -1) { if (res.Code == 404) {
alert(res.Msg); window.parent.location = "/login.html";
return; } else if (res.Code == 200) {
} else if (res.Code == 404) { showMenuList(getCutPageData());
window.parent.location = "/login.html"; $(".table-caption").html("");
} else {
//将先前的内容清空
$("#menu_table_body").html("");
let str = "";
for(let i = 0; i < res.MenuList.length; i ++) {
let v = res.MenuList[i];
// let secondMenus = v.SecondMenu.split("|"); } else {
}
},
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" + error: function () {
"<th>" + v.MenuUid + "</th>" + "<th>" + v.FirstMenu + "</th>" + "<th>" + v.MenuOrder + "</th>" + alert("系统异常,请稍后重试");
"<th>" + v.SecondMenu + "</th>" + "<th>" + v.Creater + "</th>"; }
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.MenuUid +'" class="btn btn-default" onclick="menuUp(this.value);"><span class="glyphicon glyphicon-arrow-up"></span></button>' +
'<button type="button" value="' + v.MenuUid +'" class="btn btn-default" onclick="menuDown(this.value);"><span class="glyphicon glyphicon-arrow-down"></span></button>' +
'<button type="button" value="' + v.MenuUid +'" class="btn btn-default" onclick="menuDelete(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").append(str);
}
},
error: function() { });
alert("系统异常,请稍后重试"); }
}
});
}
$(".save-menu").click(function() { //提升菜单的顺序
let oneMenu = $(".basic-url").val(); function menuUp(menuUid) {
Ajax(menuUid, "/up/menu");
}
if (oneMenu.length <= 0) { //降低菜单的顺序
$(".first-menu-error").text(" * 一级菜单不能为空"); function menuDown(menuUid) {
return; Ajax(menuUid, "/down/menu");
} }
$(".first-menu-error").text(""); //删除菜单
$.ajax({ function menuDelete(menuUid) {
url: "/add/menu", if (!window.confirm("是否确定删除该项?")) {
data:{ return;
oneMenu: oneMenu }
}, Ajax(menuUid, "/delete/menu");
}
success: function(res) { //此函数的作用,是在每行的最后一格,加入可操作的按钮图标
if (res.Code == 200) { function showMenuList(dataJSON) {
$(".cancel-menu").trigger('click'); $.ajax({
showMenuList(); url: "/get/menu",
data: dataJSON,
} else if (res.Code == 404) {
window.parent.location = "/login.html"; success: function (res) {
} else {
$(".first-menu-error").text(res.Msg); $(".current_page").html(res.CurrentPage);
} $(".total_page").html(res.TotalPage);
}, $("#display_count option").each(function () {
error: function() { if ($(this).text() == res.DisplayCount) {
alert("系统异常,请稍后重试"); $(this).attr('selected', true);
} }
}); });
}); $(".jump_page input").val("");
$(".add-button").click(function() {
$(".basic-url").val(""); if (res.Code == -1) {
$(".basic-url-4").val(""); alert(res.Msg);
$(".first-menu-error").text(""); return;
} else if (res.Code == 404) {
}); window.parent.location = "/login.html";
</script> } else {
//将先前的内容清空
$("#menu_table_body").html("");
let str = "";
for (let i = 0; i < res.MenuList.length; i++) {
let v = res.MenuList[i];
// let secondMenus = v.SecondMenu.split("|");
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.MenuUid + "</th>" + "<th>" + v.FirstMenu + "</th>" + "<th>" + v.MenuOrder + "</th>" +
"<th>" + v.SecondMenu + "</th>" + "<th>" + v.Creater + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.MenuUid + '" class="btn btn-default" onclick="menuUp(this.value);"><span class="glyphicon glyphicon-arrow-up"></span></button>' +
'<button type="button" value="' + v.MenuUid + '" class="btn btn-default" onclick="menuDown(this.value);"><span class="glyphicon glyphicon-arrow-down"></span></button>' +
'<button type="button" value="' + v.MenuUid + '" class="btn btn-default" onclick="menuDelete(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").append(str);
}
},
error: function () {
alert("系统异常,请稍后重试");
}
});
}
$(".save-menu").click(function () {
let oneMenu = $(".basic-url").val();
if (oneMenu.length <= 0) {
$(".first-menu-error").text(" * 一级菜单不能为空");
return;
}
$(".first-menu-error").text("");
$.ajax({
url: "/add/menu",
data: {
oneMenu: oneMenu
},
success: function (res) {
if (res.Code == 200) {
$(".cancel-menu").trigger('click');
showMenuList();
} else if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
$(".first-menu-error").text(res.Msg);
}
},
error: function () {
alert("系统异常,请稍后重试");
}
});
});
$(".add-button").click(function () {
$(".basic-url").val("");
$(".basic-url-4").val("");
$(".first-menu-error").text("");
});
</script>
</body> </body>
</html> </html>

View File

@@ -3,14 +3,14 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta content="width=device-width, initial-scale=1" name="viewport">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css" /> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style type="text/css" media="screen"> <style media="screen" type="text/css">
body { body {
overflow-y: hidden; overflow-y: hidden;
overflow-x: hidden; overflow-x: hidden;
@@ -135,310 +135,325 @@
</head> </head>
<body> <body>
<!-- 更改密码的模态框 --> <!-- 更改密码的模态框 -->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-keyboard="false" id="logoutModal" role="dialog"
data-keyboard="false"> tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span> aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="myModalLabel">用户密码更改</h4> <h4 class="modal-title" id="myModalLabel">用户密码更改</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p class="color-red text-center">温馨提示新密码字为8~16个字符字母和数字组成。</p> <p class="color-red text-center">温馨提示新密码字为8~16个字符字母和数字组成。</p>
<div class="row margin-top-20"> <div class="row margin-top-20">
<div class="col-xs-3"> <div class="col-xs-3">
<span>旧密码:</span> <span>旧密码:</span>
</div> </div>
<div class="col-xs-5"> <div class="col-xs-5">
<input class="old-passwrod" type="password" name=""> <span class="color-red">*</span> <input class="old-passwrod" name="" type="password"> <span class="color-red">*</span>
</div> </div>
<div class="col-xs-4 color-red old-error"> <div class="col-xs-4 color-red old-error">
</div>
</div> </div>
<div class="row margin-top-20"> </div>
<div class="col-xs-3"> <div class="row margin-top-20">
<span>新密码:</span> <div class="col-xs-3">
</div> <span>新密码:</span>
<div class="col-xs-5">
<input class="new-password" type="password" name=""> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red new-error">
</div>
</div> </div>
<div class="row margin-top-20"> <div class="col-xs-5">
<div class="col-xs-3"> <input class="new-password" name="" type="password"> <span class="color-red">*</span>
<span>再次输入新密码:</span> </div>
</div> <div class="col-xs-4 color-red new-error">
<div class="col-xs-5"> </div>
<input class="twice-password" type="password" name=""> <span class="color-red">*</span> </div>
</div> <div class="row margin-top-20">
<div class="col-xs-4 color-red twice-error"> <div class="col-xs-3">
<span>再次输入新密码:</span>
</div>
<div class="col-xs-5">
<input class="twice-password" name="" type="password"> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red twice-error">
</div>
</div> </div>
</div> </div>
<div class="modal-footer"> </div>
<button type="button" class="btn btn-default password-cancal cancal-save" data-dismiss="modal">取消 <div class="modal-footer">
</button> <button class="btn btn-default password-cancal cancal-save" data-dismiss="modal" type="button">取消
<button type="button" class="btn btn-primary password-save">保存</button> </button>
</div> <button class="btn btn-primary password-save" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="totpModal" tabindex="-1" role="dialog" aria-labelledby="myTotpLabel" </div>
data-keyboard="false"> <div aria-labelledby="myTotpLabel" class="modal fade" data-keyboard="false" id="totpModal" role="dialog"
<div class="modal-dialog" role="document"> tabindex="-1">
<div class="modal-content"> <div class="modal-dialog" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <div class="modal-header">
aria-hidden="true">&times;</span> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
</button> aria-hidden="true">&times;</span>
<h4 class="modal-title" id="totpLabel">TOTP二次验证</h4> </button>
</div> <h4 class="modal-title" id="totpLabel">TOTP二次验证</h4>
<div class="modal-body"> </div>
<div class="totp-regeneration"> <div class="modal-body">
<div class="row"> <div class="totp-regeneration">
当前标识:<span id="totp-key"></span> <div class="row">
</div> 当前标识:<span id="totp-key"></span>
<div class="row"> </div>
<button class="btn btn-warning totp-regeneration-btn" data-toggle="tooltip" <div class="row">
<button class="btn btn-warning totp-regeneration-btn" data-toggle="tooltip"
title="重新生成将导致此前的二次验证不可用,请谨慎生成">重新生成 title="重新生成将导致此前的二次验证不可用,请谨慎生成">重新生成
</button> </button>
</div>
</div>
<div class="row margin-top-20 totp-body">
<div id="totp-img">
<img src="" alt="" srcset="">
<input value="" id="totp-secret" hidden>
</div>
<label>请输入二次验证:
<input id="totp-value" type="text" name="">
</label>
</div>
<div class="col-xs-4 color-red totp-new-error">
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="row margin-top-20 totp-body">
<button type="button" class="btn btn-default totp-cancal cancal-save" data-dismiss="modal">取消 <div id="totp-img">
</button> <img alt="" src="" srcset="">
<button type="button" class="btn btn-primary totp-save">保存</button> <input hidden id="totp-secret" value="">
</div>
<label>请输入二次验证:
<input id="totp-value" name="" type="text">
</label>
</div>
<div class="col-xs-4 color-red totp-new-error">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default totp-cancal cancal-save" data-dismiss="modal" type="button">取消
</button>
<button class="btn btn-primary totp-save" type="button">保存</button>
</div>
</div>
</div>
</div>
<!-- 导航栏 -->
<div class="self-nav">
</div>
<nav class="navbar navbar-inverse navbar-fixed-top" id="navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">聚合支付管理系统</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown"
href="#"
role="button">
<span class="glyphicon glyphicon-user"></span>你好!管理员 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a data-target="#logoutModal" data-toggle="modal" href="#" style="text-align: center;">
<i class="glyphicon glyphicon-cog change-password"></i> 更改密码</a>
</li>
<li>
<a data-target="#totpModal" data-toggle="modal" href="#" style="text-align: center;"> <i
class="glyphicon glyphicon-cog totp"></i>二次验证</a>
</li>
<li class="divider" role="separator"></li>
<li>
<a class="logout" href="#" style="text-align: center;"> <i
class="glyphicon glyphicon-off"></i> 退出登录</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- 左侧导航栏 -->
<div class="middle">
<div class="sider-left">
<div class="sider-bar">
<div>
<a class="first-menu" href="#" onclick='loadMainContent("/main.html")'>
<span class="glyphicon glyphicon-home"></span>
<span class="first-title">控制面板</span>
</a>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-wrench"></span>
<span class="first-title">权限控制</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
{{/*<a href="#" onclick='loadMainContent("/first_menu.html");'><span>添加一级菜单</span></a>
<a href="#" onclick='loadMainContent("/second_menu.html")'><span>添加二级菜单</span></a>
<a href="#" onclick='loadMainContent("/power.html")'><span>添加权限</span></a>*/}}
<a href="#" onclick='loadMainContent("/role.html")'><span>角色管理</span></a>
<a href="#" onclick='loadMainContent("/operator.html")'><span>操作员管理</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-road"></span>
<span class="first-title">通道管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/road.html")'><span>支付通道</span></a>
<a href="#" onclick='loadMainContent("/road_pool.html")'><span>轮询池</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">商户管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/merchant.html")'><span>商户配置</span></a>
<a href="#" onclick='loadMainContent("/merchant_v2.html")'><span>商户配置(V2)</span></a>
<a href="#" onclick='loadMainContent("/customerUserManagement.html")'>供销客户管理</a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">Apple兑换管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#"
onclick='loadMainContent("/recharge-apple-card-account.html")'><span>苹果账户管理</span></a>
<a href="#"
onclick='loadMainContent("/recharge-apple-card-order.html")'><span>订单管理</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">充值管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#"
onclick='loadMainContent("/recharge-t-mall-game-account.html")'><span>天猫账户管理</span></a>
<a href="#"
onclick='loadMainContent("/recharge-t-mall-game-order.html")'><span>天猫订单管理</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-console"></span>
<span class="first-title">代理管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/create_agent.html")'>创建代理</a>
<a href="#" onclick='loadMainContent("/agent_to_merchant.html")'><span>代理商户映射列表</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-folder-open"></span>
<span class="first-title">资金管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/account.html")'><span>账户钱包</span></a>
<a href="#" onclick='loadMainContent("/account_history.html")'><span>资金流水</span></a>
</div>
</div>
{{range.roadList}}
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-book"></span>
<span class="first-title" data-toggle="tooltip" title="{{.RoadName}}">订单管理({{.RoadName}})</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a data-toggle="tooltip" href="#"
onclick='loadMainContent("/order_info.html?roadUid={{.RoadUid}}")'><span>实时订单</span></a>
<a data-toggle="tooltip" href="#"
onclick='loadMainContent("/order_profit.html?roadUid={{.RoadUid}}")'><span>订单收益</span></a>
<a data-toggle="tooltip" href="#"
onclick='loadMainContent("/order-summary-info.html?roadUid={{.RoadUid}}")'><span>订单汇总</span></a>
</div>
</div>
{{end}}
<!-- <div>-->
<!-- <a href="#" class="first-menu">-->
<!-- <span class="glyphicon glyphicon-book"></span>-->
<!-- <span class="first-title">订单管理</span>-->
<!-- <span class="glyphicon glyphicon-plus last-glyphicon"></span>-->
<!-- </a>-->
<!-- <div class="second-menu">-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order_info.html?roadUid=")'><span>实时订单</span></a>-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order_profit.html?roadUid=")'><span>订单收益</span></a>-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order-summary-info.html?roadUid=")'><span>订单汇总</span></a>-->
<!-- </div>-->
<!-- </div>-->
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-piggy-bank"></span>
<span class="first-title">代付管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/merchant_payfor.html")'><span>商户下发</span></a>
<a href="#" onclick='loadMainContent("/self_payfor.html")'><span>任意打款</span></a>
<a href="#" onclick='loadMainContent("/payfor_record.html")'><span>代付列表</span></a>
<a href="#" onclick='loadMainContent("/bank_card.html")'><span>银行卡管理</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-yen"></span>
<span class="first-title">分润管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/platform_profit.html")'><span>平台利润</span></a>
<a href="#" onclick='loadMainContent("/agent_profit.html")'><span>代理利润</span></a>
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-edit"></span>
<span class="first-title">自助服务</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick="loadMainContent('/self_notify.html')"><span>批量给下游回调</span></a>
<!-- <a href="#" onclick="loadMainContent('/self_plus_sub.html')"><span>自定义加减款</span></a>-->
</div>
</div>
<div>
<a class="first-menu" href="#">
<span class="glyphicon glyphicon-edit"></span>
<span class="first-title">支付测试</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="{{.extraAddr}}/testpay" target="_blank"><span>打开测试链接</span></a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 导航栏 -->
<div class="self-nav"> <div class="sider-right">
<label for="main-bank-order-id"></label><input hidden="hidden" id="main-bank-order-id" type="text" value="">
<div class="main">
</div>
</div> </div>
<nav class="navbar navbar-inverse navbar-fixed-top" id="navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">聚合支付管理系统</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="footer">版权所有</div>
<ul class="nav navbar-nav navbar-right"> </div>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
<span class="glyphicon glyphicon-user"></span>你好!管理员 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
<a href="#" style="text-align: center;" data-toggle="modal" data-target="#logoutModal">
<i class="glyphicon glyphicon-cog change-password"></i> 更改密码</a>
</li>
<li>
<a href="#" style="text-align: center;" data-toggle="modal" data-target="#totpModal"> <i
class="glyphicon glyphicon-cog totp"></i>二次验证</a>
</li>
<li role="separator" class="divider"></li>
<li>
<a href="#" style="text-align: center;" class="logout"> <i
class="glyphicon glyphicon-off"></i> 退出登录</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- 左侧导航栏 -->
<div class="middle">
<div class="sider-left">
<div class="sider-bar">
<div>
<a href="#" class="first-menu" onclick='loadMainContent("/main.html")'>
<span class="glyphicon glyphicon-home"></span>
<span class="first-title">控制面板</span>
</a>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-wrench"></span>
<span class="first-title">权限控制</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
{{/*<a href="#" onclick='loadMainContent("/first_menu.html");'><span>添加一级菜单</span></a>
<a href="#" onclick='loadMainContent("/second_menu.html")'><span>添加二级菜单</span></a>
<a href="#" onclick='loadMainContent("/power.html")'><span>添加权限</span></a>*/}}
<a href="#" onclick='loadMainContent("/role.html")'><span>角色管理</span></a>
<a href="#" onclick='loadMainContent("/operator.html")'><span>操作员管理</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-road"></span>
<span class="first-title">通道管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/road.html")'><span>支付通道</span></a>
<a href="#" onclick='loadMainContent("/road_pool.html")'><span>轮询池</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">商户管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/merchant.html")'><span>商户配置</span></a>
<a href="#" onclick='loadMainContent("/merchant_v2.html")'><span>商户配置(V2)</span></a>
<a href="#" onclick='loadMainContent("/customerUserManagement.html")'>供销客户管理</a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">Apple充值管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#"
onclick='loadMainContent("/recharge-apple-card-account.html")'><span>苹果账户管理</span></a>
<a href="#" onclick='loadMainContent("/recharge-apple-card-order.html")'><span>充值订单管理</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-console"></span>
<span class="first-title">代理管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/create_agent.html")'>创建代理</a>
<a href="#" onclick='loadMainContent("/agent_to_merchant.html")'><span>代理商户映射列表</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-folder-open"></span>
<span class="first-title">资金管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/account.html")'><span>账户钱包</span></a>
<a href="#" onclick='loadMainContent("/account_history.html")'><span>资金流水</span></a>
</div>
</div>
{{range.roadList}}
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-book"></span>
<span class="first-title" data-toggle="tooltip" title="{{.RoadName}}">订单管理({{.RoadName}})</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" data-toggle="tooltip"
onclick='loadMainContent("/order_info.html?roadUid={{.RoadUid}}")'><span>实时订单</span></a>
<a href="#" data-toggle="tooltip"
onclick='loadMainContent("/order_profit.html?roadUid={{.RoadUid}}")'><span>订单收益</span></a>
<a href="#" data-toggle="tooltip"
onclick='loadMainContent("/order-summary-info.html?roadUid={{.RoadUid}}")'><span>订单汇总</span></a>
</div>
</div>
{{end}}
<!-- <div>-->
<!-- <a href="#" class="first-menu">-->
<!-- <span class="glyphicon glyphicon-book"></span>-->
<!-- <span class="first-title">订单管理</span>-->
<!-- <span class="glyphicon glyphicon-plus last-glyphicon"></span>-->
<!-- </a>-->
<!-- <div class="second-menu">-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order_info.html?roadUid=")'><span>实时订单</span></a>-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order_profit.html?roadUid=")'><span>订单收益</span></a>-->
<!-- <a href="#"-->
<!-- onclick='loadMainContent("/order-summary-info.html?roadUid=")'><span>订单汇总</span></a>-->
<!-- </div>-->
<!-- </div>-->
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-piggy-bank"></span>
<span class="first-title">代付管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/merchant_payfor.html")'><span>商户下发</span></a>
<a href="#" onclick='loadMainContent("/self_payfor.html")'><span>任意打款</span></a>
<a href="#" onclick='loadMainContent("/payfor_record.html")'><span>代付列表</span></a>
<a href="#" onclick='loadMainContent("/bank_card.html")'><span>银行卡管理</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-yen"></span>
<span class="first-title">分润管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/platform_profit.html")'><span>平台利润</span></a>
<a href="#" onclick='loadMainContent("/agent_profit.html")'><span>代理利润</span></a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-edit"></span>
<span class="first-title">自助服务</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick="loadMainContent('/self_notify.html')"><span>批量给下游回调</span></a>
<!-- <a href="#" onclick="loadMainContent('/self_plus_sub.html')"><span>自定义加减款</span></a>-->
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-edit"></span>
<span class="first-title">支付测试</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="{{.extraAddr}}/testpay" target="_blank"><span>打开测试链接</span></a>
</div>
</div>
</div>
</div>
<div class="sider-right">
<input type="text" hidden="hidden" id="main-bank-order-id" value="">
<div class="main">
</div>
</div>
<div class="footer">版权所有</div>
</div>
</body> </body>
<script> <script>
$(function () { $(function () {
@@ -502,11 +517,11 @@
return; return;
} }
if (!(newPassword == twicePassword)) { if (!(newPassword === twicePassword)) {
setError(".twice-error", "新密码两次输入不一致!"); setError(".twice-error", "新密码两次输入不一致!");
return; return;
} }
if (oldPassword == newPassword) { if (oldPassword === newPassword) {
setError(".new-error", "新密码不能和旧密码一样!"); setError(".new-error", "新密码不能和旧密码一样!");
return; return;
} }
@@ -523,14 +538,14 @@
twicePassword: twicePassword twicePassword: twicePassword
}, },
success: function (res) { success: function (res) {
if (res.Code == 200) { if (res.Code === 200) {
//将模态框关闭 //将模态框关闭
$("input[type='password']").val(""); $("input[type='password']").val("");
$(".cancal-save").trigger('click'); $(".cancal-save").trigger('click');
setTimeout("", 1500);//等待1.5秒 setTimeout("", 1500);//等待1.5秒
alert("密码修改成功!"); alert("密码修改成功!");
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else if (res.Code == 404) { } else if (res.Code === 404) {
//用户登录已经过期,需要重新登录 //用户登录已经过期,需要重新登录
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else { } else {
@@ -632,8 +647,7 @@
const secret = $("#totp-secret").val(); const secret = $("#totp-secret").val();
const code = $("#totp-value").val(); const code = $("#totp-value").val();
const key = $("#totp-key").text(); const key = $("#totp-key").text();
console.log(secret, code, key) if (secret === "" || key === "") {
if (secret === "" || code === "" || key === "") {
setError(".totp-new-error", "信息填写不完整,需要重新填写"); setError(".totp-new-error", "信息填写不完整,需要重新填写");
return; return;
} }
@@ -671,5 +685,4 @@
margin: 20px; margin: 20px;
} }
</style> </style>
</html> </html>

View File

@@ -2,13 +2,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title></title> <title></title>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
</div> </div>
</body> </body>
</html> </html>

View File

@@ -2,69 +2,74 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>商戶后台</title> <title>商戶后台</title>
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<style> <style>
.self-tabs { .self-tabs {
margin-left: 1px; margin-left: 1px;
margin-right: 1px; margin-right: 1px;
text-align: center; text-align: center;
} }
.first-menu-html, .second-menu-html {
height: 30px; .first-menu-html, .second-menu-html {
line-height: 30px; height: 30px;
} line-height: 30px;
.first-menu-html, .second-menu-html:hover { }
cursor: pointer;
} .first-menu-html, .second-menu-html:hover {
.first-menu-html { cursor: pointer;
border: 1px solid #d3d3d3; }
border-radius: 2px;
margin-bottom: 5px; .first-menu-html {
} border: 1px solid #d3d3d3;
</style> border-radius: 2px;
margin-bottom: 5px;
}
</style>
</head> </head>
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<div class="row self-tabs"> <div class="row self-tabs">
<div class="col-md-6 first-menu-html"> <div class="col-md-6 first-menu-html">
一级菜单管理 一级菜单管理
</div> </div>
<div class="col-md-6 second-menu-html"> <div class="col-md-6 second-menu-html">
二级菜单管理 二级菜单管理
</div> </div>
</div> </div>
<div class="menu-content-html"> <div class="menu-content-html">
</div>
</div>
<script> </div>
</div>
<script>
function clickFirstMenuHtml() { function clickFirstMenuHtml() {
$(".first-menu-html").css('background-color', 'skyblue'); $(".first-menu-html").css('background-color', 'skyblue');
$(".second-menu-html").css('background-color', 'white'); $(".second-menu-html").css('background-color', 'white');
$(".menu-content-html").load("/jhboss/first_menu.html"); $(".menu-content-html").load("/jhboss/first_menu.html");
} }
function clickSecondMenuHtml() { function clickSecondMenuHtml() {
$(".second-menu-html").css('background-color', 'skyblue'); $(".second-menu-html").css('background-color', 'skyblue');
$(".first-menu-html").css('background-color', 'white'); $(".first-menu-html").css('background-color', 'white');
$(".menu-content-html").load("/jhboss/second_menu.html"); $(".menu-content-html").load("/jhboss/second_menu.html");
} }
//默认打开的是一级菜单管理页面 //默认打开的是一级菜单管理页面
$(function() { $(function () {
clickFirstMenuHtml(); clickFirstMenuHtml();
}); });
$(".first-menu-html").click(function() { $(".first-menu-html").click(function () {
clickFirstMenuHtml(); clickFirstMenuHtml();
}); });
$(".second-menu-html").click(function() { $(".second-menu-html").click(function () {
clickSecondMenuHtml(); clickSecondMenuHtml();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style> <style>
.merchant-record, .merchant-edit { .merchant-record, .merchant-edit {
@@ -118,46 +118,46 @@
<div class="search"> <div class="search">
<div> <div>
商户名称: 商户名称:
<input type="text" value="" placeholder="模糊匹配" id="merchant-name-search"> <input id="merchant-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
商户编号: 商户编号:
<input type="text" value="" placeholder="" id="merchant-no-search"> <input id="merchant-no-search" placeholder="" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default" id="merchant-search">搜索</button> <button class="btn btn-default" id="merchant-search" type="button">搜索</button>
</div> </div>
</div> </div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-merchant-button">添加商户</button> <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-merchant-button" type="button">添加商户</button>
<!-- 创建商户的模态框 --> <!-- 创建商户的模态框 -->
<div class="modal fade" id="create-merchant" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="create-merchant"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">添加商户</h4> <h4 class="modal-title" id="myModalLabel">添加商户</h4>
</div> </div>
<div class="modal-body modal-body-merchant"> <div class="modal-body modal-body-merchant">
<div> <div>
<span>商户名称:</span> <span>商户名称:</span>
<input type="text" id="merchant-name-modal"> <input id="merchant-name-modal" type="text">
<span id="merchant-name-error"></span> <span id="merchant-name-error"></span>
</div> </div>
<div> <div>
<span>注册手机号:</span> <span>注册手机号:</span>
<input type="text" id="merchant-phone-modal"> <input id="merchant-phone-modal" type="text">
<span id="merchant-phone-error"></span> <span id="merchant-phone-error"></span>
</div> </div>
<div> <div>
<span>账号登录密码:</span> <span>账号登录密码:</span>
<input type="password" id="merchant-login-password-modal"> <input id="merchant-login-password-modal" type="password">
<span id="merchant-login-password-error"></span> <span id="merchant-login-password-error"></span>
</div> </div>
<div> <div>
<span>确认密码:</span> <span>确认密码:</span>
<input type="password" id="merchant-vertify-password-modal"> <input id="merchant-vertify-password-modal" type="password">
<span id="merchant-verify-password-error"></span> <span id="merchant-verify-password-error"></span>
</div> </div>
@@ -174,8 +174,8 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-merchant" data-dismiss="modal">取消</button> <button class="btn btn-default cancel-merchant" data-dismiss="modal" type="button">取消</button>
<button type="button" class="btn btn-primary save-merchant">保存</button> <button class="btn btn-primary save-merchant" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>
@@ -214,8 +214,8 @@
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button type="button" class="btn btn-default">Go</button> <button class="btn btn-default" type="button">Go</button>
</li> </li>
</div> </div>
</div> </div>
@@ -225,30 +225,30 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>商户名称:</span> <span>商户名称:</span>
<input type="text" readonly="true" value="不可修改" id="merchant-edit-merchant-name"> <input id="merchant-edit-merchant-name" readonly="true" type="text" value="不可修改">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span>商户编号:</span> <span>商户编号:</span>
<input type="text" readonly="true" value="" id="merchant-edit-merchant-no"> <input id="merchant-edit-merchant-no" readonly="true" type="text" value="">
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>是否自动结算:</span> <span>是否自动结算:</span>
<input type="radio" name="auto-settle-radio" value="yes" checked="checked"> <input checked="checked" name="auto-settle-radio" type="radio" value="yes">
<input type="radio" name="auto-settle-radio" value="no"> <input name="auto-settle-radio" type="radio" value="no">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span>是否自动代付:</span> <span>是否自动代付:</span>
<input type="radio" name="auto-payfor-radio" value="yes" checked="checked"> <input checked="checked" name="auto-payfor-radio" type="radio" value="yes">
<input type="radio" name="auto-payfor-radio" value="no"> <input name="auto-payfor-radio" type="radio" value="no">
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<span>请求ip白名单</span> <span>请求ip白名单</span>
<textarea placeholder="多个ip隔开。" id="merchant-edit-ip-white"></textarea> <textarea id="merchant-edit-ip-white" placeholder="多个ip隔开。"></textarea>
</div> </div>
</div> </div>
</fieldset> </fieldset>
@@ -262,7 +262,7 @@
<div class="col-md-6"> <div class="col-md-6">
<span>支付类型:</span> <span>支付类型:</span>
<label for="pay-type"></label> <label for="pay-type"></label>
<select id="pay-type" style="top: 31px;" value="CARD_DH" hidden> <select hidden id="pay-type" style="top: 31px;" value="CARD_DH">
<option value="none">请选择</option> <option value="none">请选择</option>
<option value="CARD_DH">卡密兑换</option> <option value="CARD_DH">卡密兑换</option>
<option value="WEIXIN_SCAN">微信扫码</option> <option value="WEIXIN_SCAN">微信扫码</option>
@@ -291,49 +291,49 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>单通道:</span> <span>单通道:</span>
<input type="text" readonly id="single-road" value="" placeholder=""> <input id="single-road" placeholder="" readonly type="text" value="">
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<span style="width: 150px;">平台净利率:</span> <span style="width: 150px;">平台净利率:</span>
<input style="width: 60px;" type="text" readonly id="single-road-platform-fee" placeholder="例:0.3"> <input id="single-road-platform-fee" placeholder="例:0.3" readonly style="width: 60px;" type="text">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span style="width: 150px;">代理净利率:</span> <span style="width: 150px;">代理净利率:</span>
<input style="width: 60px;" type="text" id="single-road-agent-fee" placeholder="例:0.3"> <input id="single-road-agent-fee" placeholder="例:0.3" style="width: 60px;" type="text">
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>轮询通道:</span> <span>轮询通道:</span>
<input type="text" readonly value="" placeholder="" id="roll-pool-road"> <input id="roll-pool-road" placeholder="" readonly type="text" value="">
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<span style="width: 150px;">轮询平台净利率:</span> <span style="width: 150px;">轮询平台净利率:</span>
<input style="width: 60px;" type="text" name="" value="0" id="roll-road-platform-fee"> <input id="roll-road-platform-fee" name="" style="width: 60px;" type="text" value="0">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span style="width: 150px;">轮询代理净利率:</span> <span style="width: 150px;">轮询代理净利率:</span>
<label for="roll-road-agent-fee"> <label for="roll-road-agent-fee">
<input style="width: 60px;" type="text" placeholder="" value="0" <input id="roll-road-agent-fee" placeholder="" style="width: 60px;" type="text"
id="roll-road-agent-fee"> value="0">
</label> </label>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span>是否押款:</span> <span>是否押款:</span>
<input type="radio" name="is-loan" value="yes" placeholder=""> <input name="is-loan" placeholder="" type="radio" value="yes">
<input type="radio" name="is-loan" value="no" placeholder="" checked=""> <input checked="" name="is-loan" placeholder="" type="radio" value="no">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span style="width: 150px;">押款比例:</span> <span style="width: 150px;">押款比例:</span>
<input style="width: 60px;" type="text" placeholder="例:0.4" value="0" id="loan-rate"> <input id="loan-rate" placeholder="例:0.4" style="width: 60px;" type="text" value="0">
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<span style="width: 100px;">押款天数:</span> <span style="width: 100px;">押款天数:</span>
<input style="width: 60px;" type="text" name="" value="0" placeholder="x天" id="loan-days"> <input id="loan-days" name="" placeholder="x天" style="width: 60px;" type="text" value="0">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span style="width: 150px;">解款时间点:</span> <span style="width: 150px;">解款时间点:</span>
@@ -378,19 +378,19 @@
<div class="col-md-4"> <div class="col-md-4">
<span>单代付通道:</span> <span>单代付通道:</span>
<label for="payfor-road-choose"> <label for="payfor-road-choose">
<input type="text" id="payfor-road-choose" value="" readonly placeholder=""> <input id="payfor-road-choose" placeholder="" readonly type="text" value="">
</label> </label>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span>轮询代付通道:</span> <span>轮询代付通道:</span>
<label for="roll-payfor-road-choose"> <label for="roll-payfor-road-choose">
<input type="text" id="roll-payfor-road-choose" value="" name="" readonly="true" placeholder=""> <input id="roll-payfor-road-choose" name="" placeholder="" readonly="true" type="text" value="">
</label> </label>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span>代付手续费:</span> <span>代付手续费:</span>
<label for="payfor-fee"> <label for="payfor-fee">
<input id="payfor-fee" type="text" name="" value="0"> <input id="payfor-fee" name="" type="text" value="0">
</label> </label>
</div> </div>
</div> </div>
@@ -400,10 +400,10 @@
<span style="color: blue;display: block;margin-bottom: 10px;">注意:每个商户同时最多只能有一个代理商</span> <span style="color: blue;display: block;margin-bottom: 10px;">注意:每个商户同时最多只能有一个代理商</span>
<div class="row"> <div class="row">
<span>代理商名称:</span> <span>代理商名称:</span>
<input type="text" id="belong-agent-name" readonly="readonly" value="" placeholder=""> <input id="belong-agent-name" placeholder="" readonly="readonly" type="text" value="">
<span>代理商uid</span> <span>代理商uid</span>
<input type="text" id="belong-agent-uid" readonly="readonly"> <input id="belong-agent-uid" readonly="readonly" type="text">
<span id="find-merchant" class="glyphicon glyphicon-search"></span> <span class="glyphicon glyphicon-search" id="find-merchant"></span>
</div> </div>
</fieldset> </fieldset>
<div class="merchant-deploy-footer"> <div class="merchant-deploy-footer">
@@ -411,12 +411,12 @@
<button class="btn btn-success merchant-deploy-save-button" style="margin-top: 5px;margin-left: 20px;">保存 <button class="btn btn-success merchant-deploy-save-button" style="margin-top: 5px;margin-left: 20px;">保存
</button> </button>
</div> </div>
<div class="modal fade" id="roll-or-road-list" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="roll-or-road-list"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabelList">通道或者通道池选择</h4> <h4 class="modal-title" id="myModalLabelList">通道或者通道池选择</h4>
</div> </div>
@@ -424,7 +424,7 @@
<!-- TODO --> <!-- TODO -->
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-single-roll" data-dismiss="modal">放弃</button> <button class="btn btn-default cancel-single-roll" data-dismiss="modal" type="button">放弃</button>
</div> </div>
</div> </div>
</div> </div>
@@ -433,8 +433,8 @@
{{/*展示代理商,配置商户*/}} {{/*展示代理商,配置商户*/}}
</div> </div>
<div class="modal fade" id="platform-rate-list" tabindex="-2" role="dialog" aria-labelledby="myModalLabelData" <div aria-labelledby="myModalLabelData" class="modal fade" data-backdrop="static" data-keyboard="false" id="platform-rate-list"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-2">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@@ -469,17 +469,17 @@
<tr class="platformMM" hidden> <tr class="platformMM" hidden>
<td> <td>
<label> <label>
<input placeholder="输入面值" id="platformM"> <input id="platformM" placeholder="输入面值">
</label> </label>
</td> </td>
<td> <td>
<label> <label>
<input placeholder="输入链接ID" id="linkID"> <input id="linkID" placeholder="输入链接ID">
</label> </label>
</td> </td>
<td> <td>
<label> <label>
<input placeholder="输入折扣" id="platformV"> <input id="platformV" placeholder="输入折扣">
</label> </label>
</td> </td>
<td> <td>
@@ -491,18 +491,18 @@
<div class="error-msg" style="color: red"></div> <div class="error-msg" style="color: red"></div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-single-roll-two" data-dismiss="modal">关闭 <button class="btn btn-default cancel-single-roll-two" data-dismiss="modal" type="button">关闭
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="totp-delete-modal" tabindex="-1" role="dialog" aria-labelledby="totpLabel" <div aria-labelledby="totpLabel" class="modal fade" data-keyboard="false" id="totp-delete-modal" role="dialog"
data-keyboard="false"> tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span> aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="totpLabel">TOTP二次验证</h4> <h4 class="modal-title" id="totpLabel">TOTP二次验证</h4>
@@ -515,24 +515,24 @@
</label> </label>
</div> </div>
</div> </div>
<input id="totp-merchant-value" type="text" name="" value="" hidden> <input hidden id="totp-merchant-value" name="" type="text" value="">
<div class="col-xs-4 color-red totp-new-error"> <div class="col-xs-4 color-red totp-new-error">
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default totp-cancal cancel-save" data-dismiss="modal">取消 <button class="btn btn-default totp-cancal cancel-save" data-dismiss="modal" type="button">取消
</button> </button>
<button type="button" class="btn btn-primary totp-save">保存</button> <button class="btn btn-primary totp-save" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="agent-list" tabindex="-1" role="dialog" aria-labelledby="myModalLabelDL" <div aria-labelledby="myModalLabelDL" class="modal fade" data-backdrop="static" data-keyboard="false" id="agent-list"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabelDL">选择代理商</h4> <h4 class="modal-title" id="myModalLabelDL">选择代理商</h4>
</div> </div>
@@ -540,36 +540,36 @@
<!-- TODO --> <!-- TODO -->
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-agent" data-dismiss="modal">放弃</button> <button class="btn btn-default cancel-agent" data-dismiss="modal" type="button">放弃</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="change-password" tabindex="-1" role="dialog" aria-labelledby="passwordLabel" <div aria-labelledby="passwordLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="change-password"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog modal-sm" role="document"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="passwordLabel">修改商户密码</h4> <h4 class="modal-title" id="passwordLabel">修改商户密码</h4>
</div> </div>
<div class="modal-body modal-body-agent menu-table"> <div class="modal-body modal-body-agent menu-table">
<input type="text" id="merchantUid" value="" placeholder="" hidden> <input hidden id="merchantUid" placeholder="" type="text" value="">
<div class="row"> <div class="row">
<span></span> <span></span>
<label for="newPassword"> <label for="newPassword">
<input type="text" id="newPassword" value="" placeholder="新密码"> <input id="newPassword" placeholder="新密码" type="text" value="">
</label> </label>
<label for="totpCode"> <label for="totpCode">
<input type="text" id="totpCode" value="" placeholder="二次验证"> <input id="totpCode" placeholder="二次验证" type="text" value="">
</label> </label>
</div> </div>
<div class="password-error-msg"></div> <div class="password-error-msg"></div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-save" data-dismiss="modal">放弃</button> <button class="btn btn-default cancel-save" data-dismiss="modal" type="button">放弃</button>
<button type="button" class="btn btn-default btn-primary submit-new-password"> <button class="btn btn-default btn-primary submit-new-password" type="button">
确认 确认
</button> </button>
</div> </div>
@@ -1465,7 +1465,7 @@
$(".totp-save").click(function (event) {// 获取secret $(".totp-save").click(function (event) {// 获取secret
const totpCode = $("#totp-d-value").val(); const totpCode = $("#totp-d-value").val();
const merchantUid = $("#totp-merchant-value").val(); const merchantUid = $("#totp-merchant-value").val();
if (totpCode === "" || merchantUid === "") { if (merchantUid === "") {
setError(".totp-new-error", "信息填写不完整,需要重新填写"); setError(".totp-new-error", "信息填写不完整,需要重新填写");
return; return;
} }

View File

@@ -3,18 +3,22 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link src="../static/lib/bootstrap/css/bootstrap.min.css"> <link src="../static/lib/bootstrap/css/bootstrap.min.css">
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
{{/*<script src="../static/js/basic.js"></script>*/}} {{/*
<script src="../static/js/basic.js"></script>
*/}}
<style> <style>
.panel .panel-body input { .panel .panel-body input {
width: 50%; width: 50%;
} }
.algin-right { .algin-right {
text-align: right; text-align: right;
} }
table tr td { table tr td {
display: inline-block; display: inline-block;
width: 50%; width: 50%;
@@ -23,13 +27,16 @@
.panel-heading:hover { .panel-heading:hover {
cursor: pointer; cursor: pointer;
} }
.panel-footer { .panel-footer {
padding-left: 45%; padding-left: 45%;
} }
#modal-search { #modal-search {
height: 40px; height: 40px;
position: relative; position: relative;
} }
#modal-search button { #modal-search button {
position: absolute; position: absolute;
right: 10px; right: 10px;
@@ -38,377 +45,400 @@
</style> </style>
</head> </head>
<body> <body>
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading" onclick="merchantList({});"> <div class="panel-heading" onclick="merchantList({});">
<span class="panel-title">选择下发商户</span> <span class="panel-title">选择下发商户</span>
<span class="glyphicon glyphicon-search"></span> <span class="glyphicon glyphicon-search"></span>
</div>
<table class="table table-responsive table-bordered">
<thead>
<tr>
<td class="algin-right">下发所属商户</td><td><span id="merchant-name">未选择</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right">商户uid</td><td><span id="merchant-uid">未选择</span></td>
</tr>
<tr>
<td class="algin-right">可用金额</td><td><span id="able-amount"></span></td>
</tr>
<tr>
<td class="algin-right">创建时间</td><td><span id="create-time">未选择</span></td>
</tr>
</tbody>
</table>
<div class="panel-heading" onclick="bankList({});">
<span class="panel-title">选择下发银行卡</span>
<span class="glyphicon glyphicon-search"></span>
</div>
<table class="table table-responsive table-bordered">
<input type="text" hidden="hidden" id="bank-uid" value="">
<thead>
<tr>
<td class="algin-right">银行名称</td><td><span id="bank-name">未选择</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right">开户名</td><td><span id="account-name">未选择</span></td>
</tr>
<tr>
<td class="algin-right">卡号</td><td><span id="card-number">未选择</span></td>
</tr>
<tr>
<td class="algin-right">开户卡类型</td>
<td>
<input type="radio" name="card-type" value="private" checked>对私卡
<input type="radio" name="card-type" value="public">对公卡
</td>
</tr>
<tr>
<td class="algin-right">开户行所在地</td><td><span id="bank-address">未选择</span></td>
</tr>
<tr>
<td class="algin-right">开户人手机号码</td><td><span id="phone">未选择</span></td>
</tr>
<tr>
<td class="algin-right">下发金额</td><td><input type="text" value="" id="payfor-amount"><span></span></td>
</tr>
</tbody>
</table>
<div class="panel-footer">
<input type="button" class="btn btn-default" name="" id="" value="取消">
<input type="button" class="btn btn-primary" value="提交" id="submit">
</div>
</div> </div>
<table class="table table-responsive table-bordered">
<thead>
<tr>
<td class="algin-right">下发所属商户</td>
<td><span id="merchant-name">未选择</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right">商户uid</td>
<td><span id="merchant-uid">未选择</span></td>
</tr>
<tr>
<td class="algin-right">可用金额</td>
<td><span id="able-amount"></span></td>
</tr>
<tr>
<td class="algin-right">创建时间</td>
<td><span id="create-time">未选择</span></td>
</tr>
</tbody>
</table>
<div class="panel-heading" onclick="bankList({});">
<span class="panel-title">选择下发银行卡</span>
<span class="glyphicon glyphicon-search"></span>
</div>
<table class="table table-responsive table-bordered">
<input hidden="hidden" id="bank-uid" type="text" value="">
<thead>
<tr>
<td class="algin-right">银行名称</td>
<td><span id="bank-name">未选择</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right">开户名</td>
<td><span id="account-name">未选择</span></td>
</tr>
<tr>
<td class="algin-right">卡号</td>
<td><span id="card-number">未选择</span></td>
</tr>
<tr>
<td class="algin-right">开户卡类型</td>
<td>
<input checked name="card-type" type="radio" value="private">对私卡
<input name="card-type" type="radio" value="public">对公卡
</td>
</tr>
<tr>
<td class="algin-right">开户行所在地</td>
<td><span id="bank-address">未选择</span></td>
</tr>
<tr>
<td class="algin-right">开户人手机号码</td>
<td><span id="phone">未选择</span></td>
</tr>
<tr>
<td class="algin-right">下发金额</td>
<td><input id="payfor-amount" type="text" value=""><span></span></td>
</tr>
</tbody>
</table>
<div class="panel-footer">
<input class="btn btn-default" id="" name="" type="button" value="取消">
<input class="btn btn-primary" id="submit" type="button" value="提交">
</div>
</div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div aria-labelledby="myModalLabel" class="modal fade" id="myModal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
<div class="menu-table table-responsive"> <div class="menu-table table-responsive">
<table> <table>
<div id="modal-search"> <div id="modal-search">
<input type="text" hidden="hidden" id="modal-search-hidden" value=""> <input hidden="hidden" id="modal-search-hidden" type="text" value="">
搜索:<input type="text" value="" id="modal-search-input" placeholder="名称"> 搜索:<input id="modal-search-input" placeholder="名称" type="text" value="">
<button type="button" class="btn btn-warning" data-dismiss="modal" id="cannel">取消</button> <button class="btn btn-warning" data-dismiss="modal" id="cannel" type="button">取消</button>
</div> </div>
<thead class="thead-dark" id="table-head"> <thead class="thead-dark" id="table-head">
</thead> </thead>
<tbody id="table-body"> <tbody id="table-body">
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- 分页插件 --> <!-- 分页插件 -->
<div class="cut_page"> <div class="cut_page">
<li> <li>
每页显示 每页显示
<select id="display_count"> <select id="display_count">
<option value="4">4</option> <option value="4">4</option>
<option value="30">20</option> <option value="30">20</option>
<option value="50">30</option> <option value="50">30</option>
<option value="100">50</option> <option value="100">50</option>
</select> </select>
</li> </li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span
<li class="pre_page">上一页</li> class="total_page">0</span>
<li class="next_page">下一页</li> </li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li> <li class="pre_page">上一页</li>
</div> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<script> <script>
function getCutPagesValues() { function getCutPagesValues() {
let displayCount = $("#display_count").val(); let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html(); let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html(); let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val(); let jumpPage = $(".jump_page input").val();
return { return {
"displayCount":displayCount, "displayCount": displayCount,
"currentPage":currentPage, "currentPage": currentPage,
"totalPage":totalPage, "totalPage": totalPage,
"jumpPage":jumpPage "jumpPage": jumpPage
}; };
} }
function setOrderCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
}
function clearModal() {
$("#table-head").html("");
$("#table-body").html("");
}
function randMerchantList(res) {
clearModal();
setOrderCutPageValues(res);
let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "商户名称" + "</th>" + "<th>" + "商户uid" + "</th>" +
"<th>" + "可用金额" + "</th>" + "<th>" + "选择" + "</th>";
$("#table-head").html(head);
let str = "";
for (let i = 0; i < res.AccountList.length; i ++) {
let v = res.AccountList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.AccountName + "</th>" + "<th>" + v.AccountUid + "</th>" + "<th>" + (v.SettleAmount-v.FreezeAmount-v.LoanAmount-v.PayforAmount) + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.AccountUid +'" class="btn btn-default" onclick="saveMerchant(this.value);">' + "确定" +'</button>';
tmp = tmp + '</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#table-body").html(str);
$("#myModal").modal();
//标记是商户选择
$("#modal-search-hidden").val("merchant-list");
}
function saveMerchant(accountUid) { function setOrderCutPageValues(res) {
$("#cannel").trigger('click'); $(".current_page").html(res.CurrentPage);
$.ajax({ $(".total_page").html(res.TotalPage);
url:"/get/one/account", $("#display_count option").each(function () {
data: { if ($(this).text() == res.DisplayCount) {
"accountUid":accountUid $(this).attr('selected', true);
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let v = res.AccountList[0];
$("#merchant-name").html(v.AccountName);
$("#merchant-uid").html(v.AccountUid);
$("#able-amount").html((v.SettleAmount - v.FreezeAmount -v.PayforAmount));
$("#create-time").html(new Date(v.CreateTime).toLocaleString());
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
function merchantList(dataJSON) {
if (JSONIsEmpty(dataJSON)) {
dataJSON = getCutPagesValues();
}
dataJSON["accountName"] = $("#modal-search-input").val();
$.ajax({
url: "/get/account",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randMerchantList(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
$("#modal-search-input").change(function () {
let dataJSON = getCutPagesValues();
let type = $("#modal-search-hidden").val();
if (type == "merchant-list") {
merchantList(dataJSON);
} else {
bankList(dataJSON);
} }
}); });
$(".jump_page input").val("");
function f(dataJSON) { }
let type = $("#modal-search-hidden").val();
if (type == "merchant-list") { function clearModal() {
merchantList(dataJSON); $("#table-head").html("");
} else { $("#table-body").html("");
bankList(dataJSON); }
}
function randMerchantList(res) {
clearModal();
setOrderCutPageValues(res);
let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "商户名称" + "</th>" + "<th>" + "商户uid" + "</th>" +
"<th>" + "可用金额" + "</th>" + "<th>" + "选择" + "</th>";
$("#table-head").html(head);
let str = "";
for (let i = 0; i < res.AccountList.length; i++) {
let v = res.AccountList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.AccountName + "</th>" + "<th>" + v.AccountUid + "</th>" + "<th>" + (v.SettleAmount - v.FreezeAmount - v.LoanAmount - v.PayforAmount) + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.AccountUid + '" class="btn btn-default" onclick="saveMerchant(this.value);">' + "确定" + '</button>';
tmp = tmp + '</div>' + "</th>" + "</tr>";
str = str + tmp;
} }
$("#table-body").html(str);
function randBankCardList(res) { $("#myModal").modal();
clearModal(); //标记是商户选择
setOrderCutPageValues(res); $("#modal-search-hidden").val("merchant-list");
let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "开户名" + "</th>" + "<th>" + "银行名称" + "</th>" + }
"<th>" + "卡号" + "</th>" + "<th>" + "手机号码" + "</th>" + "<th>" + "选择" + "</th>";
$("#table-head").html(head); function saveMerchant(accountUid) {
let str = ""; $("#cannel").trigger('click');
for (let i = 0; i < res.BankCardInfoList.length; i ++) { $.ajax({
let v = res.BankCardInfoList[i]; url: "/get/one/account",
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankName + "</th>" + data: {
"<th>" + v.BankNo + "</th>" + "<th>" + v.PhoneNo + "</th>"; "accountUid": accountUid
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' + },
'<button type="button" value="' + v.Uid +'" class="btn btn-default" onclick="saveBankCard(this.value);">' + "确定" +'</button>'; success: function (res) {
tmp = tmp + '</div>' + "</th>" + "</tr>"; if (res.Code == 404) {
str = str + tmp; window.parent.location = "/login.html";
} } else {
$("#table-body").html(str);
$("#myModal").modal(); let v = res.AccountList[0];
//标记是商户选择 $("#merchant-name").html(v.AccountName);
$("#modal-search-hidden").val("bank-list"); $("#merchant-uid").html(v.AccountUid);
} $("#able-amount").html((v.SettleAmount - v.FreezeAmount - v.PayforAmount));
function saveBankCard(uid) { $("#create-time").html(new Date(v.CreateTime).toLocaleString());
$("#cannel").trigger('click');
$.ajax({
url:"/get/oneBankCard",
data: {
"uid":uid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let v = res.BankCardInfoList[0];
$("#bank-uid").val(v.Uid);
$("#bank-name").html(v.BankName);
$("#account-name").html(v.AccountName);
$("#bank-address").html(v.BankAddress);
$("#card-number").html(v.BankNo);
$("#phone").html(v.PhoneNo);
}
},
error: function () {
alert("系统异常,请稍后再试");
} }
}); },
error: function () {
alert("系统异常,请稍后再试");
}
});
}
function merchantList(dataJSON) {
if (JSONIsEmpty(dataJSON)) {
dataJSON = getCutPagesValues();
} }
//当每页显示数更改后,执行的操作 dataJSON["accountName"] = $("#modal-search-input").val();
$("#display_count").change(function() { $.ajax({
let dataJSON = getCutPagesValues(); url: "/get/account",
f(dataJSON); data: dataJSON,
}); success: function (res) {
if (res.Code == 404) {
//点击上一页的按钮 window.parent.location = "/login.html";
$(".pre_page").click(function() { } else {
let dataJSON = getCutPagesValues(); randMerchantList(res);
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
f(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPagesValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
f(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPagesValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
f(dataJSON);
});
function bankList(dataJSON) {
if (JSONIsEmpty(dataJSON)) {
dataJSON = getCutPagesValues();
}
dataJSON["accountNameSearch"] = $("#modal-search-input").val();
$.ajax({
url: "/get/bankCard",
data: dataJSON,
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randBankCardList(res);
}
},
error:function() {
alert("系统异常,请稍后再试");
} }
}); },
$("#myModal").modal(); error: function () {
} alert("系统异常,请稍后再试");
$("#submit").click(function () { }
let merchantUid = $("#merchant-uid").html();
let merchantName = $("#merchant-name").html();
let ableAmount = $("#able-amount").html();
let bankUid = $("#bank-uid").val();
let bankName = $("#bank-name").html();
let accountName = $("#account-name").html();
let bankNo = $("#card-number").html();
let cardType = $("input[name=\"card-type\"]").val();
let bankAddress = $("#bank-address").html();
let phone = $("#phone").html();
let payForAmount = $("#payfor-amount").val();
$.ajax({
url: "/add/payfor",
data:{
"merchantUid":merchantUid,
"merchantName":merchantName,
"ableAmount":ableAmount,
"bankUid":bankUid,
"bankName":bankName,
"accountName":accountName,
"bankNo":bankNo,
"cardType":cardType,
"bankAddress":bankAddress,
"phone":phone,
"payForAmount":payForAmount
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1){
alert(res.Msg);
} else {
alert("已经提交成功,请耐心等待结果");
loadMainContent("/payfor_record.html")
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}); });
//判断json是否为空 }
function JSONIsEmpty(dataJSON) {
let b = (JSON.stringify(dataJSON) == "{}"); $("#modal-search-input").change(function () {
return b; let dataJSON = getCutPagesValues();
let type = $("#modal-search-hidden").val();
if (type == "merchant-list") {
merchantList(dataJSON);
} else {
bankList(dataJSON);
} }
</script> });
function f(dataJSON) {
let type = $("#modal-search-hidden").val();
if (type == "merchant-list") {
merchantList(dataJSON);
} else {
bankList(dataJSON);
}
}
function randBankCardList(res) {
clearModal();
setOrderCutPageValues(res);
let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "开户名" + "</th>" + "<th>" + "银行名称" + "</th>" +
"<th>" + "卡号" + "</th>" + "<th>" + "手机号码" + "</th>" + "<th>" + "选择" + "</th>";
$("#table-head").html(head);
let str = "";
for (let i = 0; i < res.BankCardInfoList.length; i++) {
let v = res.BankCardInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankName + "</th>" +
"<th>" + v.BankNo + "</th>" + "<th>" + v.PhoneNo + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.Uid + '" class="btn btn-default" onclick="saveBankCard(this.value);">' + "确定" + '</button>';
tmp = tmp + '</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#table-body").html(str);
$("#myModal").modal();
//标记是商户选择
$("#modal-search-hidden").val("bank-list");
}
function saveBankCard(uid) {
$("#cannel").trigger('click');
$.ajax({
url: "/get/oneBankCard",
data: {
"uid": uid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let v = res.BankCardInfoList[0];
$("#bank-uid").val(v.Uid);
$("#bank-name").html(v.BankName);
$("#account-name").html(v.AccountName);
$("#bank-address").html(v.BankAddress);
$("#card-number").html(v.BankNo);
$("#phone").html(v.PhoneNo);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getCutPagesValues();
f(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getCutPagesValues();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
f(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPagesValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
f(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCutPagesValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
f(dataJSON);
});
function bankList(dataJSON) {
if (JSONIsEmpty(dataJSON)) {
dataJSON = getCutPagesValues();
}
dataJSON["accountNameSearch"] = $("#modal-search-input").val();
$.ajax({
url: "/get/bankCard",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randBankCardList(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
$("#myModal").modal();
}
$("#submit").click(function () {
let merchantUid = $("#merchant-uid").html();
let merchantName = $("#merchant-name").html();
let ableAmount = $("#able-amount").html();
let bankUid = $("#bank-uid").val();
let bankName = $("#bank-name").html();
let accountName = $("#account-name").html();
let bankNo = $("#card-number").html();
let cardType = $("input[name=\"card-type\"]").val();
let bankAddress = $("#bank-address").html();
let phone = $("#phone").html();
let payForAmount = $("#payfor-amount").val();
$.ajax({
url: "/add/payfor",
data: {
"merchantUid": merchantUid,
"merchantName": merchantName,
"ableAmount": ableAmount,
"bankUid": bankUid,
"bankName": bankName,
"accountName": accountName,
"bankNo": bankNo,
"cardType": cardType,
"bankAddress": bankAddress,
"phone": phone,
"payForAmount": payForAmount
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("已经提交成功,请耐心等待结果");
loadMainContent("/payfor_record.html")
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
});
//判断json是否为空
function JSONIsEmpty(dataJSON) {
let b = (JSON.stringify(dataJSON) == "{}");
return b;
}
</script>
</body> </body>
</html> </html>

View File

@@ -2,8 +2,8 @@
<html lang="zh"> <html lang="zh">
<body> <body>
<iframe src=""> <iframe src="">
</iframe> </iframe>
</body> </body>
<style> <style>
iframe { iframe {

View File

@@ -4,8 +4,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>商户后台</title> <title>商户后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen"> <style media="screen" type="text/css">
.first-input-group .basic-url, .operator-input-group .basic-url { .first-input-group .basic-url, .operator-input-group .basic-url {
width: 210px; width: 210px;
} }
@@ -42,27 +42,27 @@
<div class="search"> <div class="search">
<div> <div>
<span>操作员名称</span> <span>操作员名称</span>
<input type="text" class="operator-name" value="" placeholder="模糊匹配"> <input class="operator-name" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default operator-name-search">搜索</button> <button class="btn btn-default operator-name-search" type="button">搜索</button>
</div> </div>
</div> </div>
<div class="add-menu"> <div class="add-menu">
<button type="button" <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-operator-button"
class="btn btn-default btn-xs glyphicon glyphicon-plus add-operator-button" data-target="#addOperatorModal"
data-toggle="modal" data-target="#addOperatorModal" data-toggle="modal" type="button"
>新加操作员 >新加操作员
</button> </button>
</div> </div>
<!-- 添加操作员的模态框 --> <!-- 添加操作员的模态框 -->
<div class="modal fade" id="addOperatorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addOperatorModal"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="addPowerButton">添加新的操作员</h4> <h4 class="modal-title" id="addPowerButton">添加新的操作员</h4>
</div> </div>
@@ -70,12 +70,12 @@
<div class="modal-body modal-body-menu"> <div class="modal-body modal-body-menu">
<div class="input-group first-input-group"> <div class="input-group first-input-group">
<span class="input-group-addon basic-addon">登录账号</span> <span class="input-group-addon basic-addon">登录账号</span>
<input type="text" class="form-control basic-url operator-account" value=""> <input class="form-control basic-url operator-account" type="text" value="">
<span class="operator-name-error"></span> <span class="operator-name-error"></span>
</div> </div>
<div class="input-group first-input-group"> <div class="input-group first-input-group">
<span class="input-group-addon basic-addon">初始密码</span> <span class="input-group-addon basic-addon">初始密码</span>
<input type="password" class="form-control basic-url operator-password" value=""> <input class="form-control basic-url operator-password" type="password" value="">
<span class="operator-password-error"></span> <span class="operator-password-error"></span>
</div> </div>
@@ -104,20 +104,20 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-operator" data-dismiss="modal">取消</button> <button class="btn btn-default cancel-operator" data-dismiss="modal" type="button">取消</button>
<button type="button" class="btn btn-primary save-operator">保存</button> <button class="btn btn-primary save-operator" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- end 模态框 --> <!-- end 模态框 -->
<!-- 修改操作员信息的模态框 --> <!-- 修改操作员信息的模态框 -->
<div class="modal fade" id="editOperatorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="editOperatorModal"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="editOperatorButton">添加新的操作员</h4> <h4 class="modal-title" id="editOperatorButton">添加新的操作员</h4>
</div> </div>
@@ -129,19 +129,19 @@
</div> </div>
<div class="input-group first-input-group"> <div class="input-group first-input-group">
<span class="input-group-addon basic-addon">修改密码</span> <span class="input-group-addon basic-addon">修改密码</span>
<input type="password" class="form-control basic-url change-operator-password" value=""> <input class="form-control basic-url change-operator-password" type="password" value="">
<span class="change-operator-password-error"></span> <span class="change-operator-password-error"></span>
</div> </div>
<div class="input-group first-input-group"> <div class="input-group first-input-group">
<span class="input-group-addon basic-addon">确认密码</span> <span class="input-group-addon basic-addon">确认密码</span>
<input type="password" class="form-control basic-url veritfy-operator-password" value=""> <input class="form-control basic-url veritfy-operator-password" type="password" value="">
<span class="veritfy-operator-password-error"></span> <span class="veritfy-operator-password-error"></span>
</div> </div>
<div class="input-group first-input-group"> <div class="input-group first-input-group">
<span class="input-group-addon basic-addon">修改昵称</span> <span class="input-group-addon basic-addon">修改昵称</span>
<input type="text" class="form-control basic-url change-operator-nick" value=""> <input class="form-control basic-url change-operator-nick" type="text" value="">
<span class="change-operator-password-error"></span> <span class="change-operator-password-error"></span>
</div> </div>
@@ -162,8 +162,8 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default change-cancel-operator" data-dismiss="modal">取消</button> <button class="btn btn-default change-cancel-operator" data-dismiss="modal" type="button">取消</button>
<button type="button" class="btn btn-primary change-save-operator">保存</button> <button class="btn btn-primary change-save-operator" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>
@@ -202,8 +202,8 @@
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button type="button" class="btn btn-default">Go</button> <button class="btn btn-default" type="button">Go</button>
</li> </li>
</div> </div>

View File

@@ -4,10 +4,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -50,371 +50,372 @@
</head> </head>
<body> <body>
<div class="order-record"> <div class="order-record">
<div class="search form-inline"> <div class="search form-inline">
<label for=""> <label for="">
<span>开始时间:</span> <span>开始时间:</span>
<input type="text" name="" id="search-order-start-time" class="start-time" value=""> <input class="start-time" id="search-order-start-time" name="" type="text" value="">
</label> </label>
<label for=""> <label for="">
<span>结束时间:</span> <span>结束时间:</span>
<input type="text" name="" id="search-order-end-time" class="end-time" value=""> <input class="end-time" id="search-order-end-time" name="" type="text" value="">
</label> </label>
<label for=""> <label for="">
<span>商户名称:</span> <span>商户名称:</span>
<input type="text" id="search-order-merchant-name" placeholder="模糊匹配"> <input id="search-order-merchant-name" placeholder="模糊匹配" type="text">
</label> </label>
<label for=""> <label for="">
<span>卡片数据:</span> <span>卡片数据:</span>
<input type="text" id="search-order-card-data" placeholder="卡片数据"> <input id="search-order-card-data" placeholder="卡片数据" type="text">
</label> </label>
<label for=""> <label for="">
<span>商户订单号:</span> <span>商户订单号:</span>
<input type="text" id="search-order-merchant-order-id" value=""> <input id="search-order-merchant-order-id" type="text" value="">
</label> </label>
<label> <label>
<span>本系统订单号:</span> <span>本系统订单号:</span>
<input type="text" id="search-order-bank-order-id" value=""> <input id="search-order-bank-order-id" type="text" value="">
</label> </label>
<label for=""> <label for="">
订单状态: 订单状态:
<select name="" id="search-order-status"> <select id="search-order-status" name="">
<option value="">请选择</option>
<option value="success">支付成功</option>
<option value="wait">等待支付</option>
<option value="fail">支付失败</option>
<option value="cancel">放弃支付</option>
</select>
</label>
<label for="">
上游名称:
<select name="" id="search-order-supplier-name">
</select>
</label>
<!-- <label for="">-->
<!-- 支付类型:-->
<!-- <select name="" id="search-order-pay-way-code">-->
<!-- <option value="">请选择</option>-->
<!-- <option value="CARD_DH">卡密兑换</option>-->
<!-- <option value="WEIXIN_SCAN">微信扫码</option>-->
<!-- <option value="WEIXIN_H5">微信H5</option>-->
<!-- <option value="WEIXIN_SYT">微信收银台</option>-->
<!-- <option value="ALI_SCAN">支付宝扫码</option>-->
<!-- <option value="ALI_H5">支付宝H5</option>-->
<!-- <option value="ALI_SYT">支付宝收银台</option>-->
<!-- <option value="QQ_SCAN">QQ扫码</option>-->
<!-- <option value="QQ_H5">QQ-H5</option>-->
<!-- <option value="QQ_SYT">QQ收银台</option>-->
<!-- <option value="UNION_SCAN">银联扫码</option>-->
<!-- <option value="UNION_H5">银联H5</option>-->
<!-- <option value="UNION_PC_WAP">银联pc-web</option>-->
<!-- <option value="UNION_SYT">银联收银台</option>-->
<!-- <option value="UNION_FAST">银联快捷</option>-->
<!-- <option value="BAIDU_SCAN">百度钱包扫码</option>-->
<!-- <option value="BAIDU_H5">百度钱包H5</option>-->
<!-- <option value="BAIDU_SYT">百度钱包收银台</option>-->
<!-- <option value="JD_SCAN">京东扫码</option>-->
<!-- <option value="JD_H5">京东H5</option>-->
<!-- <option value="JD_SYT">京东收银台</option>-->
<!-- </select>-->
<!-- </label>-->
<!-- <label>-->
冻结状态:
<select name="" id="search-order-free-status">
<option value="">请选择</option> <option value="">请选择</option>
<option value="freeze_amount">冻结</option> <option value="success">支付成功</option>
<option value="refund">退款</option> <option value="wait">等待支付</option>
<option value="fail">支付失败</option>
<option value="cancel">放弃支付</option>
</select> </select>
</label> </label>
<button type="button" class="btn btn-default" id="order-search">搜索</button> <label for="">
<button onclick='loadMainContent("/order_info.html")' type="button" class="btn btn-default">刷新</button> 上游名称:
<select id="search-order-supplier-name" name="">
</select>
</label>
<!-- <label for="">-->
<!-- 支付类型:-->
<!-- <select name="" id="search-order-pay-way-code">-->
<!-- <option value="">请选择</option>-->
<!-- <option value="CARD_DH">卡密兑换</option>-->
<!-- <option value="WEIXIN_SCAN">微信扫码</option>-->
<!-- <option value="WEIXIN_H5">微信H5</option>-->
<!-- <option value="WEIXIN_SYT">微信收银台</option>-->
<!-- <option value="ALI_SCAN">支付宝扫码</option>-->
<!-- <option value="ALI_H5">支付宝H5</option>-->
<!-- <option value="ALI_SYT">支付宝收银台</option>-->
<!-- <option value="QQ_SCAN">QQ扫码</option>-->
<!-- <option value="QQ_H5">QQ-H5</option>-->
<!-- <option value="QQ_SYT">QQ收银台</option>-->
<!-- <option value="UNION_SCAN">银联扫码</option>-->
<!-- <option value="UNION_H5">银联H5</option>-->
<!-- <option value="UNION_PC_WAP">银联pc-web</option>-->
<!-- <option value="UNION_SYT">银联收银台</option>-->
<!-- <option value="UNION_FAST">银联快捷</option>-->
<!-- <option value="BAIDU_SCAN">百度钱包扫码</option>-->
<!-- <option value="BAIDU_H5">百度钱包H5</option>-->
<!-- <option value="BAIDU_SYT">百度钱包收银台</option>-->
<!-- <option value="JD_SCAN">京东扫码</option>-->
<!-- <option value="JD_H5">京东H5</option>-->
<!-- <option value="JD_SYT">京东收银台</option>-->
<!-- </select>-->
<!-- </label>-->
<!-- <label>-->
冻结状态:
<select id="search-order-free-status" name="">
<option value="">请选择</option>
<option value="freeze_amount">冻结</option>
<option value="refund">退款</option>
</select>
</label>
<button class="btn btn-default" id="order-search" type="button">搜索</button>
<button class="btn btn-default" onclick='loadMainContent("/order_info.html")' type="button">刷新</button>
<!-- <label class="color-red" style="font-size: 16px;">--> <!-- <label class="color-red" style="font-size: 16px;">-->
<!-- 交易金额:--> <!-- 交易金额:-->
<!-- <span id="order-all-amount"></span>--> <!-- <span id="order-all-amount"></span>-->
<!-- </label>--> <!-- </label>-->
<!-- <label class="color-red" style="font-size: 16px;">--> <!-- <label class="color-red" style="font-size: 16px;">-->
<!-- 成功率:--> <!-- 成功率:-->
<!-- <span id="success-rate"></span>--> <!-- <span id="success-rate"></span>-->
<!-- </label>--> <!-- </label>-->
</div> </div>
<!-- <div>--> <!-- <div>-->
<!-- 今日订单数:--> <!-- 今日订单数:-->
<!-- 今日总金额:--> <!-- 今日总金额:-->
<!-- 今日已付订单数:--> <!-- 今日已付订单数:-->
<!-- 今日已付总金额:--> <!-- 今日已付总金额:-->
<!-- 今日平台收入:--> <!-- 今日平台收入:-->
<!-- 今日商户收入:--> <!-- 今日商户收入:-->
<!-- 今日代理收入:--> <!-- 今日代理收入:-->
<!-- 今日通道成本--> <!-- 今日通道成本-->
<!-- </div>--> <!-- </div>-->
<!-- <div>--> <!-- <div>-->
<!-- 提交订单数:--> <!-- 提交订单数:-->
<!-- 订单总金额:--> <!-- 订单总金额:-->
<!-- 已付订单数:--> <!-- 已付订单数:-->
<!-- 已付总金额:--> <!-- 已付总金额:-->
<!-- 平台收入:--> <!-- 平台收入:-->
<!-- 商户收入:--> <!-- 商户收入:-->
<!-- 代理收入:--> <!-- 代理收入:-->
<!-- 通道成本:--> <!-- 通道成本:-->
<!-- </div>--> <!-- </div>-->
<div style="padding: 20px"> <div style="padding: 20px">
<div class="row"> <div class="row">
<div class="col-sm-2 color-red"> <div class="col-sm-2 color-red">
订单总量: 订单总量:
<span id="orderTotalNum"></span> <span id="orderTotalNum"></span>
</div>
<div class="col-sm-2 color-red">
订单总金额:
<span id="AllAmount"></span>
</div>
<div class="col-sm-2 color-red">
成功订单数:
<span id="succeedTotalNum"></span>
</div>
<div class="col-sm-2 color-red">
成功交易总量:
<span id="SucceedPaidAmount"></span>
</div>
<!-- <div class="color-red">-->
<!-- 手续费:-->
<!-- <span id="supplierProfit"></span>-->
<!-- </div>-->
<div class="col-sm-2 color-red" style="font-weight: normal;">
平台利润:
<span id="platformProfit"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
成功率:
<span id="totalSucceedRate"></span>%
</div>
<!-- <div class="color-red" style="font-weight: normal;">-->
<!-- 代理利润:-->
<!-- <span id="agentProfit"></span>-->
<!-- </div>-->
</div> </div>
<div class="row"> <div class="col-sm-2 color-red">
<div class="col-sm-2 color-red" style="font-weight: normal;"> 订单总金额:
今日订单数: <span id="AllAmount"></span>
<span id="TodayAllNum"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日订单总金额:
<span id="TodayAllAmount"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日成功订单数:
<span id="TodaySuccessNum"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日成功订单总金额:
<span id="TodaySuccessAmount"></span>
</div>
<!-- <div class="color-red" style="font-weight: normal;">-->
<!-- 今日通道成本:-->
<!-- <span id="TodaySupplierProfit"></span>-->
<!-- </div>-->
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日平台利润:
<span id="TodayPlatformProfit"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
成功率:
<span id="todaySucceedRate"></span>%
</div>
<!-- <div class="color-red" style="font-weight: normal;">-->
<!-- 今日代理润:-->
<!-- <span id="TodayAgentProfit"></span>-->
<!-- </div>-->
</div> </div>
<div class="col-sm-2 color-red">
成功订单数:
<span id="succeedTotalNum"></span>
</div>
<div class="col-sm-2 color-red">
成功交易总量:
<span id="SucceedPaidAmount"></span>
</div>
<!-- <div class="color-red">-->
<!-- 手续费:-->
<!-- <span id="supplierProfit"></span>-->
<!-- </div>-->
<div class="col-sm-2 color-red" style="font-weight: normal;">
平台利润:
<span id="platformProfit"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
成功率:
<span id="totalSucceedRate"></span>%
</div>
<!-- <div class="color-red" style="font-weight: normal;">-->
<!-- 代理利润:-->
<!-- <span id="agentProfit"></span>-->
<!-- </div>-->
</div> </div>
<div class="menu-table"> <div class="row">
<table> <div class="col-sm-2 color-red" style="font-weight: normal;">
<thead class="thead-dark"> 今日订单数:
<tr> <span id="TodayAllNum"></span>
<th>序列号</th> </div>
<th>商户名称</th> <div class="col-sm-2 color-red" style="font-weight: normal;">
<th>商户订单号</th> 今日订单总金额:
<th>本系统订单号</th> <span id="TodayAllAmount"></span>
<th>实付金额</th> </div>
<th>卡密信息</th> <div class="col-sm-2 color-red" style="font-weight: normal;">
<th>支付状态</th> 今日成功订单数:
<th>冻结状态</th> <span id="TodaySuccessNum"></span>
<th>退款状态</th> </div>
<th>下单时间</th> <div class="col-sm-2 color-red" style="font-weight: normal;">
<th>支付时间</th> 今日成功订单总金额:
<!-- <th>上游供应商</th>--> <span id="TodaySuccessAmount"></span>
<th>上游返回数据</th> </div>
<th>用户IP</th>
<th>操作</th> <!-- <div class="color-red" style="font-weight: normal;">-->
</tr> <!-- 今日通道成本:-->
</thead> <!-- <span id="TodaySupplierProfit"></span>-->
<tbody id="order-table-body"> <!-- </div>-->
</tbody> <div class="col-sm-2 color-red" style="font-weight: normal;">
</table> 今日平台利润:
<span id="TodayPlatformProfit"></span>
</div>
<div class="col-sm-2 color-red" style="font-weight: normal;">
成功率:
<span id="todaySucceedRate"></span>%
</div>
<!-- <div class="color-red" style="font-weight: normal;">-->
<!-- 今日代理润:-->
<!-- <span id="TodayAgentProfit"></span>-->
<!-- </div>-->
</div> </div>
<!-- 分页插件 --> </div>
<div class="cut_page"> <div class="menu-table">
<li> <table>
每页显示 <thead class="thead-dark">
<select id="display_count"> <tr>
<option value="20">20</option> <th>序列号</th>
<option value="30">30</option> <th>商户名称</th>
<option value="50">50</option> <th>商户订单号</th>
<option value="100">100</option> <th>本系统订单号</th>
</select> <th>实付金额</th>
</li> <th>卡密信息</th>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <th>支付状态</th>
<li class="pre_page">上一页</li> <th>冻结状态</th>
<li class="next_page">下一页</li> <th>退款状态</th>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <th>下单时间</th>
<button type="button" class="btn btn-default">Go</button> <th>支付时间</th>
</li> <!-- <th>上游供应商</th>-->
</div> <th>上游返回数据</th>
<!-- 模态框 --> <th>用户IP</th>
<div class="modal fade" id="order-details" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <th>操作</th>
data-keyboard="false" data-backdrop="static"> </tr>
<div class="modal-dialog" role="document"> </thead>
<div class="modal-content"> <tbody id="order-table-body">
<div class="modal-header"> </tbody>
<h4 class="modal-title">订单详情</h4> </table>
</div> </div>
<div class="modal-body modal-body-order-details"> <!-- 分页插件 -->
<div class="row"> <div class="cut_page">
<div class="col-md-6"> <li>
<div>商品名称:<span id="shop-name"></span></div> 每页显示
<div>商户订单id<span id="merchant-order-id"></span></div> <select id="display_count">
<div>系统订单id<span id="bank-order-id"></span></div> <option value="20">20</option>
<div>银行流水id<span id="bank-trans-id"></span></div> <option value="30">30</option>
<div>订单金额:<span id="order-amount"></span></div> <option value="50">50</option>
<div>实际金额:<span id="fact-amount"></span></div> <option value="100">100</option>
<div>轮询池id<span id="roll-pool-code"></span></div> </select>
<div>轮询池名:<span id="roll-pool-name"></span></div> </li>
<div>通道id<span id="road-uid"></span></div> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<div>通道名称:<span id="road-name"></span></div> <li class="pre_page">上一页</li>
<div>上游商编码:<span id="pay-product-code"></span></div> <li class="next_page">下一页</li>
<div>上游商名称:<span id="pay-product-name"></span></div> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<div>支付类型编码:<span id="pay-type-code"></span></div> <button class="btn btn-default" type="button">Go</button>
<div>支付类型名称:<span id="pay-type-name"></span></div> </li>
</div> </div>
<div class="col-md-6"> <!-- 模态框 -->
<div>订单有效时间:<span id="order-period"></span></div> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="order-details"
<div>支付状态:<span id="status"></span></div> role="dialog" tabindex="-1">
<div>是否退款:<span id="refund"></span></div> <div class="modal-dialog" role="document">
<div>退款时间:<span id="refund-time"></span></div> <div class="modal-content">
<div>是否冻结:<span id="free"></span></div> <div class="modal-header">
<div>冻结时间:<span id="free-time"></span></div> <h4 class="modal-title">订单详情</h4>
<div>是否解冻:<span id="unfree"></span></div> </div>
<div>解冻时间:<span id="unfree-time"></span></div> <div class="modal-body modal-body-order-details">
<div>商户名称:<span id="merchant-name"></span></div> <div class="row">
<div>商户编号:<span id="merchant-uid"></span></div> <div class="col-md-6">
<div>代理编号<span id="agent-uid"></span></div> <div>商品名称<span id="shop-name"></span></div>
<div>代理名称<span id="agent-name"></span></div> <div>商户订单id<span id="merchant-order-id"></span></div>
<div>下单时间<span id="create—time"></span></div> <div>系统订单id<span id="bank-order-id"></span></div>
<div>更新时间<span id="update-time"></span></div> <div>银行流水id<span id="bank-trans-id"></span></div>
</div> <div>订单金额:<span id="order-amount"></span></div>
<div>实际金额:<span id="fact-amount"></span></div>
<div>轮询池id<span id="roll-pool-code"></span></div>
<div>轮询池名:<span id="roll-pool-name"></span></div>
<div>通道id<span id="road-uid"></span></div>
<div>通道名称:<span id="road-name"></span></div>
<div>上游商编码:<span id="pay-product-code"></span></div>
<div>上游商名称:<span id="pay-product-name"></span></div>
<div>支付类型编码:<span id="pay-type-code"></span></div>
<div>支付类型名称:<span id="pay-type-name"></span></div>
</div> </div>
<div class="row"> <div class="col-md-6">
<div class="col-md-12"> <div>订单有效时间:<span id="order-period"></span></div>
回调地址<span id="notify"></span> <div>支付状态<span id="status"></span></div>
</div> <div>是否退款:<span id="refund"></span></div>
</div> <div>退款时间:<span id="refund-time"></span></div>
<div class="row"> <div>是否冻结:<span id="free"></span></div>
<div class="col-md-12"> <div>冻结时间:<span id="free-time"></span></div>
回调数据<span id="card-return-data"></span> <div>是否解冻<span id="unfree"></span></div>
</div> <div>解冻时间:<span id="unfree-time"></span></div>
<div>商户名称:<span id="merchant-name"></span></div>
<div>商户编号:<span id="merchant-uid"></span></div>
<div>代理编号:<span id="agent-uid"></span></div>
<div>代理名称:<span id="agent-name"></span></div>
<div>下单时间:<span id="create—time"></span></div>
<div>更新时间:<span id="update-time"></span></div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="row">
<button type="button" class="btn btn-default cancel-order-details" data-dismiss="modal">取消 <div class="col-md-12">
</button> 回调地址:<span id="notify"></span>
</div>
</div>
</div>
</div>
<div class="modal fade" id="order-solve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-keyboard="false" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">订单处理</h4>
</div>
<div class="modal-body modal-body-order-solve">
<div>
<input type="radio" name="order-solve-radio" value="success" style="margin-left: 10%;">
<span style="color: blue;">处理成功</span>
<input type="radio" name="order-solve-radio" value="fail" style="margin-left: 15%;"><span
style="color: red;">处理失败</span>
<input type="text" hidden value="" id="order-solve-bank-order-id">
</div>
<div>
<label>
二次验证:
<input type="text" value="" id="order-info-totp">
</label>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="row">
<button type="button" class="btn btn-default save-order-solve">确定</button> <div class="col-md-12">
<button type="button" class="btn btn-default cancel-order-solve" 回调数据:<span id="card-return-data"></span>
data-dismiss="modal">取消</button> </div>
</div> </div>
</div> </div>
</div> <div class="modal-footer">
</div> <button class="btn btn-default cancel-order-details" data-dismiss="modal" type="button">取消
</button>
<div class="modal fade" id="totp-order-solve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-keyboard="false" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input type="text" hidden value="" id="totp-solve-bank-order-id">
<input type="text" hidden value="" id="totp-solveType">
<label>
二次验证:
<input type="text" value="" id="totp-orderInfo">
</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default save-totp-solve">确定</button>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">
取消
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="totp-order-deal-solve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-keyboard="false" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input type="text" hidden value="" id="totp-solve-deal-order-id">
<input type="text" hidden value="" id="totp-deal-solveType">
<label>
二次验证:
<input type="text" value="" id="totp-totp-orderInfo">
</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default save-totp-deal-solve">确定</button>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">
取消
</button>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="order-solve"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">订单处理</h4>
</div>
<div class="modal-body modal-body-order-solve">
<div>
<input name="order-solve-radio" style="margin-left: 10%;" type="radio" value="success">
<span style="color: blue;">处理成功</span>
<input name="order-solve-radio" style="margin-left: 15%;" type="radio" value="fail"><span
style="color: red;">处理失败</span>
<input hidden id="order-solve-bank-order-id" type="text" value="">
</div>
<div>
<label>
二次验证:
<input id="order-info-totp" type="text" value="">
</label>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default save-order-solve" type="button">确定</button>
<button class="btn btn-default cancel-order-solve" data-dismiss="modal"
type="button">取消
</button>
</div>
</div>
</div>
</div>
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="totp-order-solve"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input hidden id="totp-solve-bank-order-id" type="text" value="">
<input hidden id="totp-solveType" type="text" value="">
<label>
二次验证:
<input id="totp-orderInfo" type="text" value="">
</label>
</div>
<div class="modal-footer">
<button class="btn btn-default save-totp-solve" type="button">确定</button>
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">
取消
</button>
</div>
</div>
</div>
</div>
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="totp-order-deal-solve"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input hidden id="totp-solve-deal-order-id" type="text" value="">
<input hidden id="totp-deal-solveType" type="text" value="">
<label>
二次验证:
<input id="totp-totp-orderInfo" type="text" value="">
</label>
</div>
<div class="modal-footer">
<button class="btn btn-default save-totp-deal-solve" type="button">确定</button>
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">
取消
</button>
</div>
</div>
</div>
</div>
</div>
</body> </body>
<script> <script>
//将上游通道供应商写入 //将上游通道供应商写入
@@ -585,6 +586,7 @@
$("#TodayAllNum").html(res.OrderProfitSummary.todayProfit.totalNum); $("#TodayAllNum").html(res.OrderProfitSummary.todayProfit.totalNum);
$("#todaySucceedRate").html(res.OrderProfitSummary.todayProfit.succeedRate) $("#todaySucceedRate").html(res.OrderProfitSummary.todayProfit.succeedRate)
} }
function orderRoll(bankOrderId) { function orderRoll(bankOrderId) {
$.ajax({ $.ajax({
url: "/update/order/status", url: "/update/order/status",
@@ -773,6 +775,7 @@
} }
}); });
} }
function AjaxOrderList(dataJSON) { function AjaxOrderList(dataJSON) {
dataJSON["roadUid"] = "{{.roadUid}}" dataJSON["roadUid"] = "{{.roadUid}}"
$.ajax({ $.ajax({
@@ -792,6 +795,7 @@
}); });
AjaxOrderSummaryList(dataJSON) AjaxOrderSummaryList(dataJSON)
} }
function AjaxOrderSummaryList(dataJSON) { function AjaxOrderSummaryList(dataJSON) {
dataJSON["roadUid"] = "{{.roadUid}}" dataJSON["roadUid"] = "{{.roadUid}}"
$.ajax({ $.ajax({
@@ -810,6 +814,7 @@
} }
}); });
} }
//当每页显示数更改后,执行的操作 //当每页显示数更改后,执行的操作
$("#display_count").change(function () { $("#display_count").change(function () {
let dataJSON = getOrderSearchValues(); let dataJSON = getOrderSearchValues();

View File

@@ -3,10 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -59,32 +59,32 @@
<div class="search form-inline" style="font-weight: normal;"> <div class="search form-inline" style="font-weight: normal;">
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
<span>开始时间:</span> <span>开始时间:</span>
<input type="text" name="" value="" id="search-order-start-time" class="start-time" value=""> <input class="start-time" id="search-order-start-time" name="" type="text" value="" value="">
</label> </label>
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
<span>结束时间:</span> <span>结束时间:</span>
<input type="text" name="" value="" id="search-order-end-time" class="end-time" value=""> <input class="end-time" id="search-order-end-time" name="" type="text" value="" value="">
</label> </label>
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
<span>商户名称:</span> <span>商户名称:</span>
<input type="text" id="search-order-merchant-name" placeholder="模糊匹配"> <input id="search-order-merchant-name" placeholder="模糊匹配" type="text">
</label> </label>
<label for=""> <label for="">
<span>代理名称:</span> <span>代理名称:</span>
<input type="text" name="" value="" id="search-order-agent-name" placeholder="模糊匹配"> <input id="search-order-agent-name" name="" placeholder="模糊匹配" type="text" value="">
</label> </label>
<label style="font-weight: normal;"> <label style="font-weight: normal;">
<span>本系统订单号:</span> <span>本系统订单号:</span>
<input type="text" id="search-order-bank-order-id" value=""> <input id="search-order-bank-order-id" type="text" value="">
</label> </label>
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
上游名称: 上游名称:
<select name="" id="search-order-supplier-name"> <select id="search-order-supplier-name" name="">
</select> </select>
</label> </label>
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
订单状态: 订单状态:
<select name="" id="search-order-status"> <select id="search-order-status" name="">
<option value="">请选择</option> <option value="">请选择</option>
<option value="success">支付成功</option> <option value="success">支付成功</option>
<option value="wait">等待支付</option> <option value="wait">等待支付</option>
@@ -94,7 +94,7 @@
</label> </label>
<label for="" style="font-weight: normal;"> <label for="" style="font-weight: normal;">
支付类型: 支付类型:
<select name="" id="search-order-pay-way-code"> <select id="search-order-pay-way-code" name="">
<option value="">请选择</option> <option value="">请选择</option>
<option value="CARD_DH">卡密兑换</option> <option value="CARD_DH">卡密兑换</option>
<option value="WEIXIN_SCAN">微信扫码</option> <option value="WEIXIN_SCAN">微信扫码</option>
@@ -119,7 +119,7 @@
<option value="JD_SYT">京东收银台</option> <option value="JD_SYT">京东收银台</option>
</select> </select>
</label> </label>
<button type="button" class="btn btn-default" id="order-search">搜索</button> <button class="btn btn-default" id="order-search" type="button">搜索</button>
</div> </div>
<div class="menu-table table-responsive"> <div class="menu-table table-responsive">
<table> <table>
@@ -155,8 +155,8 @@
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button type="button" class="btn btn-default">Go</button> <button class="btn btn-default" type="button">Go</button>
</li> </li>
</div> </div>
</div> </div>

View File

@@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link src="../static/lib/bootstrap/css/bootstrap.min.css"> <link src="../static/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
@@ -17,327 +18,338 @@
font-weight: normal; font-weight: normal;
margin-right: 20px; margin-right: 20px;
} }
#status { #status {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.search-button { .search-button {
margin-left: 40px; margin-left: 40px;
} }
.modal-body label { .modal-body label {
font-weight: normal; font-weight: normal;
margin-left: 2%; margin-left: 2%;
margin-top: 2%; margin-top: 2%;
} }
#result-modal label { #result-modal label {
margin-right: 50px; margin-right: 50px;
} }
#table-body tr{
#table-body tr {
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="search"> <div class="search">
<label> <label>
开始时间: 开始时间:
<input type="text" name="" value="" id="start-time" class="start-time" value=""> <input class="start-time" id="start-time" name="" type="text" value="" value="">
</label> </label>
<label> <label>
结束时间: 结束时间:
<input type="text" name="" value="" id="end-time" class="end-time" value=""> <input class="end-time" id="end-time" name="" type="text" value="" value="">
</label> </label>
<label> <label>
商户订单号: 商户订单号:
<input type="text" id="merchantOrderId"> <input id="merchantOrderId" type="text">
</label> </label>
<label> <label>
系统订单号: 系统订单号:
<input type="text" id="bankOrderId"> <input id="bankOrderId" type="text">
</label> </label>
<select id="status"> <select id="status">
<option value="">请选择</option> <option value="">请选择</option>
<option value="payfor_confirm">待审核</option> <option value="payfor_confirm">待审核</option>
<option value="payfor_solving">系统处理中</option> <option value="payfor_solving">系统处理中</option>
<option value="payfor_banking">银行处理中</option> <option value="payfor_banking">银行处理中</option>
<option value="payfor_success">代付成功</option> <option value="payfor_success">代付成功</option>
<option value="payfor_fail">代付失败</option> <option value="payfor_fail">代付失败</option>
</select>
<input class="btn btn-primary search-button" type="button" value="搜索">
</div>
<div class="menu-table table-responsive">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>商户名称</th>
<th>商户订单号</th>
<th>系统订单号</th>
<th>代付金额</th>
<th>开户名</th>
<th>银行名称</th>
<th>银行账号</th>
<th>状态</th>
<th>打款类型</th>
<th>时间</th>
<th>代付通道</th>
<th>操作</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select> </select>
<input type="button" class="btn btn-primary search-button" value="搜索"> </li>
</div>
<div class="menu-table table-responsive"> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<table> <li class="pre_page">上一页</li>
<thead class="thead-dark"> <li class="next_page">下一页</li>
<tr> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<th>序列号</th> <button class="btn btn-default" type="button">Go</button>
<th>商户名称</th> </li>
<th>商户订单号</th> </div>
<th>系统订单号</th>
<th>代付金额</th>
<th>开户名</th>
<th>银行名称</th>
<th>银行账号</th>
<th>状态</th>
<th>打款类型</th>
<th>时间</th>
<th>代付通道</th>
<th>操作</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <!-- Modal -->
<li class="pre_page">上一页</li> <div aria-labelledby="myModalLabel" class="modal fade" id="result-modal" role="dialog" tabindex="-1">
<li class="next_page">下一页</li> <div class="modal-dialog" role="document">
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li> <div class="modal-content">
</div> <input hidden="hidden" id="result-bank-order-id" type="text" value="">
<div class="modal-body">
<!-- Modal --> <label>
<div class="modal fade" id="result-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> 打款成功:
<div class="modal-dialog" role="document"> <input name="result-payfor" type="radio" value="payfor_success">
<div class="modal-content"> </label>
<input type="text" value="" hidden="hidden" id="result-bank-order-id"> <label for="">
<div class="modal-body"> 打款失败:
<label> <input name="result-payfor" type="radio" value="payfor_fail">
打款成功: </label>
<input type="radio" name="result-payfor" value="payfor_success"> </div>
</label> <div class="modal-footer">
<label for=""> <button class="btn btn-default" data-dismiss="modal" id="result-cannel" type="button">取消</button>
打款失败: <input class="btn btn-primary" onclick="resultSubmit();" type="button" value="确定">
<input type="radio" name="result-payfor" value="payfor_fail">
</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="result-cannel">取消</button>
<input type="button" class="btn btn-primary" value="确定" onclick="resultSubmit();">
</div>
</div> </div>
</div> </div>
</div> </div>
<script> </div>
function getCurPageValues() { <script>
let displayCount = $("#display_count").val(); function getCurPageValues() {
let currentPage = $(".current_page").html(); let displayCount = $("#display_count").val();
let totalPage = $(".total_page").html(); let currentPage = $(".current_page").html();
let jumpPage = $(".jump_page input").val(); let totalPage = $(".total_page").html();
let startTime = $("#start-time").val(); let jumpPage = $(".jump_page input").val();
let endTime = $("#end-time").val(); let startTime = $("#start-time").val();
let merchantOrderId = $("#merchantOrderId").val(); let endTime = $("#end-time").val();
let bankOrderId = $("#bankOrderId").val(); let merchantOrderId = $("#merchantOrderId").val();
let status = $("#status").val(); let bankOrderId = $("#bankOrderId").val();
let status = $("#status").val();
return { return {
"displayCount":displayCount, "displayCount": displayCount,
"currentPage":currentPage, "currentPage": currentPage,
"totalPage":totalPage, "totalPage": totalPage,
"jumpPage":jumpPage, "jumpPage": jumpPage,
"startTime":startTime, "startTime": startTime,
"endTime":endTime, "endTime": endTime,
"merchantOrderId":merchantOrderId, "merchantOrderId": merchantOrderId,
"bankOrderId":bankOrderId, "bankOrderId": bankOrderId,
"status":status "status": status
}
}
function setCutPageValues(res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
} }
} });
function setCutPageValues(res) { $(".jump_page input").val("");
$(".current_page").html(res.CurrentPage); }
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function() { function randPayForList(res) {
if ($(this).text() == res.DisplayCount) { setCutPageValues(res);
$(this).attr('selected', true); let str = "";
for (let i = 0; i < res.PayForList.length; i++) {
let v = res.PayForList[i];
let tmp = "<tr>";
if (v.Status == "payfor_success") {
tmp = "<tr style='color: blue;'>";
} else if (v.Status == "payfor_fail") {
tmp = "<tr style='color: red;'>"
}
tmp = tmp + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.MerchantName + "</th>" + "<th>" + v.MerchantOrderId + "</th>" + "<th>" + v.BankOrderId + "</th>" +
"<th>" + v.PayforAmount + "</th>" + "<th>" + v.BankAccountName + "</th>" + "</th>" + "<th>" + v.BankName + "</th>" +
"<th>" + v.BankAccountNo + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.GiveType + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>" +
"<th>" + v.RoadName + "</th>" + "<th>";
if (v.Status == "payfor_confirm") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-default" onclick="confirm(this.value);">' + "审核" + '</button>';
} else if ((v.Status == "payfor_solving" && v.GiveType == "payfor_hand") || v.Status == "payfor_banking") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-default" style="color: blue;" onclick="result(this.value);">' + "处理" + '</button>';
if (v.Status == "payfor_banking") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-default" style="color: blue;" onclick="query(this.value);">' + "查询" + '</button>';
} }
}); } else if (v.Status == "payfor_success") {
$(".jump_page input").val(""); tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-default" style="color: green;">' + "成功" + '</button>';
} else if (v.Status == "payfor_fail") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-warning">失败</button>';
} else {
tmp = tmp + '<button type="button" class="btn btn-primary">处理中</button>';
}
tmp = tmp + /*'</div>' +*/ "</th>" + "</tr>";
str = str + tmp.replace("payfor_fail", "失败").replace("payfor_success", "成功").replace("payfor_confirm", "待审核").replace("payfor_solving", "系统处理中").replace("payfor_banking", "银行处理中").replace("payfor_hand", "手动打款").replace("payfor_refuse", "拒绝打款").replace("payfor_road", "通道打款");
} }
function randPayForList(res) {
setCutPageValues(res); $("#table-body").html(str);
let str = ""; }
for (let i = 0; i < res.PayForList.length; i ++) {
let v = res.PayForList[i]; function notify(bankOrderId) {
let tmp = "<tr>"; $.ajax({
if (v.Status == "payfor_success") { url: "/self/send/notify",
tmp = "<tr style='color: blue;'>"; data: {
} else if(v.Status == "payfor_fail") { "bankOrderId": bankOrderId
tmp = "<tr style='color: red;'>" },
} success: function (res) {
tmp = tmp + "<th>" + (res.StartIndex+i+1) + "</th>" + if (res.Code === 404) {
"<th>" + v.MerchantName + "</th>" + "<th>" + v.MerchantOrderId + "</th>" + "<th>" + v.BankOrderId + "</th>" + window.parent.location = "/login.html";
"<th>" + v.PayforAmount + "</th>" + "<th>" + v.BankAccountName + "</th>" + "</th>" + "<th>" + v.BankName + "</th>" +
"<th>" + v.BankAccountNo + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.GiveType + "</th>" + "<th>" +new Date(v.CreateTime).toLocaleString() + "</th>" +
"<th>" + v.RoadName + "</th>" + "<th>" ;
if (v.Status == "payfor_confirm") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId +'" class="btn btn-default" onclick="confirm(this.value);">' + "审核" +'</button>';
} else if ((v.Status == "payfor_solving" && v.GiveType == "payfor_hand") || v.Status == "payfor_banking") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId +'" class="btn btn-default" style="color: blue;" onclick="result(this.value);">' + "处理" +'</button>';
if (v.Status == "payfor_banking") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-default" style="color: blue;" onclick="query(this.value);">' + "查询" + '</button>';
}
} else if (v.Status == "payfor_success") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId +'" class="btn btn-default" style="color: green;">' + "成功" +'</button>';
} else if (v.Status == "payfor_fail") {
tmp = tmp + '<button type="button" value="' + v.BankOrderId + '" class="btn btn-warning">失败</button>';
} else { } else {
tmp = tmp + '<button type="button" class="btn btn-primary">处理中</button>'; alert(res.Msg);
} }
tmp = tmp + /*'</div>' +*/ "</th>" + "</tr>"; },
str = str + tmp.replace("payfor_fail", "失败").replace("payfor_success","成功").replace("payfor_confirm","待审核").replace("payfor_solving","系统处理中"). error: function () {
replace("payfor_banking","银行处理中").replace("payfor_hand","手动打款").replace("payfor_refuse","拒绝打款").replace("payfor_road","通道打款"); alert("系统异常,请稍后再试");
} }
$("#table-body").html(str);
}
function notify(bankOrderId) {
$.ajax({
url: "/self/send/notify",
data: {
"bankOrderId":bankOrderId
},
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else {
alert(res.Msg);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
function query(bankOrderId) {
$.ajax({
url: "/supplier/payfor/query",
data: {
"bankOrderId":bankOrderId
},
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else {
alert(res.Msg);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
function AjaxPayForList(dataJSON) {
$.ajax({
url: "/get/payfor",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randPayForList(res);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
}); });
}
//点击上一页的按钮 function query(bankOrderId) {
$(".pre_page").click(function() { $.ajax({
let dataJSON = getCurPageValues(); url: "/supplier/payfor/query",
data: {
if (dataJSON["currentPage"] == 1) { "bankOrderId": bankOrderId
return; },
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else {
alert(res.Msg);
}
},
error: function () {
alert("系统异常,请稍后再试");
} }
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
AjaxPayForList(dataJSON);
}); });
//点击下一页的按钮时 }
$(".next_page").click(function() {
let dataJSON = getCurPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
AjaxPayForList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCurPageValues();
if (dataJSON["jumpPage"].length <= 0) { function AjaxPayForList(dataJSON) {
return; $.ajax({
} url: "/get/payfor",
AjaxPayForList(dataJSON); data: dataJSON,
}); success: function (res) {
$(".search-button").click(function () { if (res.Code == 404) {
let dataJSON = getCurPageValues(); window.parent.location = "/login.html";
AjaxPayForList(dataJSON); } else {
}); randPayForList(res);
function result(bankOrderId) {
$("#result-bank-order-id").val(bankOrderId);
$("#result-modal").modal();
}
function resultSubmit() {
let bankOrderId = $("#result-bank-order-id").val();
let resultType = $("input[name='result-payfor']:checked").val();
$.ajax({
url: "/result/payfor",
data: {
"bankOrderId":bankOrderId,
"resultType":resultType
},
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else if (res.Code === -1){
alert(res.Msg);
} else {
$("#result-cannel").trigger('click');
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
}
},
error: function () {
alert("系统异常,请稍后再试");
} }
}); },
} error: function () {
//审核操作 alert("系统异常,请稍后再试");
function confirm(bankOrderId) { }
$("#main-bank-order-id").val(bankOrderId);
loadMainContent("/confirm.html")
}
$(function () {
let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$("#start-time").val();
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
}); });
</script> }
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getCurPageValues();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
AjaxPayForList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCurPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
AjaxPayForList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCurPageValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
AjaxPayForList(dataJSON);
});
$(".search-button").click(function () {
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
});
function result(bankOrderId) {
$("#result-bank-order-id").val(bankOrderId);
$("#result-modal").modal();
}
function resultSubmit() {
let bankOrderId = $("#result-bank-order-id").val();
let resultType = $("input[name='result-payfor']:checked").val();
$.ajax({
url: "/result/payfor",
data: {
"bankOrderId": bankOrderId,
"resultType": resultType
},
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else if (res.Code === -1) {
alert(res.Msg);
} else {
$("#result-cannel").trigger('click');
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
}
},
error: function () {
alert("系统异常,请稍后再试");
}
});
}
//审核操作
function confirm(bankOrderId) {
$("#main-bank-order-id").val(bankOrderId);
loadMainContent("/confirm.html")
}
$(function () {
let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$("#start-time").val();
let dataJSON = getCurPageValues();
AjaxPayForList(dataJSON);
});
</script>
</body> </body>
</html> </html>

View File

@@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link src="../static/lib/bootstrap/css/bootstrap.min.css"> <link src="../static/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
@@ -17,19 +18,23 @@
font-weight: normal; font-weight: normal;
margin-right: 20px; margin-right: 20px;
} }
select { select {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
} }
#total-amount ,#total-platform-profit{
#total-amount, #total-platform-profit {
display: inline-block; display: inline-block;
margin-right: 40px; margin-right: 40px;
} }
.profit{
.profit {
font-size: 16px; font-size: 16px;
margin-top: 10px; margin-top: 10px;
} }
table tr { table tr {
height: 28px; height: 28px;
font-size: 16px; font-size: 16px;
@@ -40,19 +45,19 @@
<div class="search"> <div class="search">
<label> <label>
商户名称: 商户名称:
<select name="" id="select-merchant-name"></select> <select id="select-merchant-name" name=""></select>
</label> </label>
<label for=""> <label for="">
代理名称: 代理名称:
<select name="" id="select-agent-name"></select> <select id="select-agent-name" name=""></select>
</label> </label>
<label for=""> <label for="">
上游通道名: 上游通道名:
<select name="" id="search-order-supplier-name"></select> <select id="search-order-supplier-name" name=""></select>
</label> </label>
<label> <label>
支付类型: 支付类型:
<select name="" id="pay-type"> <select id="pay-type" name="">
<option value="">请选择</option> <option value="">请选择</option>
<option value="CARD_DH">卡密兑换</option> <option value="CARD_DH">卡密兑换</option>
<option value="WEIXIN_SCAN">微信扫码</option> <option value="WEIXIN_SCAN">微信扫码</option>
@@ -79,25 +84,25 @@
</label> </label>
<label> <label>
开始时间: 开始时间:
<input type="text" name="" value="" id="start-time" class="start-time" value=""> <input class="start-time" id="start-time" name="" type="text" value="" value="">
</label> </label>
<label> <label>
结束时间: 结束时间:
<input type="text" name="" value="" id="end-time" class="end-time" value=""> <input class="end-time" id="end-time" name="" type="text" value="" value="">
</label> </label>
<label for=""> <label for="">
<input type="button" class="btn btn-primary" value="搜索" onclick="search();"> <input class="btn btn-primary" onclick="search();" type="button" value="搜索">
</label> </label>
<label for="" class="profit"> <label class="profit" for="">
<span class="color-red">交易总金额:</span> <span class="color-red">交易总金额:</span>
<span id="total-amount" class="color-red">00.00</span> <span class="color-red" id="total-amount">00.00</span>
<span class="disabled"></span> <span class="disabled"></span>
<span class="color-red">平台总纯利润:</span> <span class="color-red">平台总纯利润:</span>
<span id="total-platform-profit" class="color-red">00.00</span> <span class="color-red" id="total-platform-profit">00.00</span>
<span class="disabled"></span> <span class="disabled"></span>
<span class="color-red">代理总利润:</span> <span class="color-red">代理总利润:</span>
<span id="total-agent-profit" class="color-red">00.00</span> <span class="color-red" id="total-agent-profit">00.00</span>
</label> </label>
</div> </div>
<div class="menu-table"> <div class="menu-table">
@@ -133,30 +138,32 @@
return { return {
"merchantUid": merchantUid, "merchantUid": merchantUid,
"agentUid":agentUid, "agentUid": agentUid,
"supplierUid": supplierUid, "supplierUid": supplierUid,
"payType": payType, "payType": payType,
"startTime": startTime, "startTime": startTime,
"endTime": endTime "endTime": endTime
}; };
} }
function randProfit(res) { function randProfit(res) {
$("#total-amount").html(res.TotalAmount); $("#total-amount").html(res.TotalAmount);
$("#total-platform-profit").html(res.PlatformTotalProfit); $("#total-platform-profit").html(res.PlatformTotalProfit);
$("#total-agent-profit").html(res.AgentTotalProfit); $("#total-agent-profit").html(res.AgentTotalProfit);
let str = ""; let str = "";
for (let i = 0; i < res.ProfitList.length; i ++) { for (let i = 0; i < res.ProfitList.length; i++) {
let v = res.ProfitList[i]; let v = res.ProfitList[i];
let tmp = "<tr>" + "<th>" + (i+1) + "</th>" + let tmp = "<tr>" + "<th>" + (i + 1) + "</th>" +
"<th>" + v.MerchantName + "</th>" + "<th>" + v.AgentName + "</th>" + "<th>" + v.SupplierName + "</th>" + "<th>" + v.MerchantName + "</th>" + "<th>" + v.AgentName + "</th>" + "<th>" + v.SupplierName + "</th>" +
"<th>" + v.PayTypeName + "</th>" + "<th>" + v.OrderAmount + "</th>" + "<th>" + v.OrderCount + "</th>" + "<th>" + v.PayTypeName + "</th>" + "<th>" + v.OrderAmount + "</th>" + "<th>" + v.OrderCount + "</th>" +
"<th>" + v.PlatformProfit + "</th>" +"<th>" + v.AgentProfit + "</th>" + "</tr>"; "<th>" + v.PlatformProfit + "</th>" + "<th>" + v.AgentProfit + "</th>" + "</tr>";
str = str + tmp; str = str + tmp;
} }
$("#table-body").html(str); $("#table-body").html(str);
} }
function search() { function search() {
$.ajax({ $.ajax({
url: "/get/profit", url: "/get/profit",
@@ -172,6 +179,7 @@
}, },
}); });
} }
$(function () { $(function () {
setMerchant(); setMerchant();
setSupplier(); setSupplier();

View File

@@ -2,329 +2,361 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>商户后台</title> <title>商户后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style type="text/css" media="screen"> <style media="screen" type="text/css">
.first-input-group .basic-url, .router-input-group .basic-url { .first-input-group .basic-url, .router-input-group .basic-url {
width: 210px; width: 210px;
} }
.modal-body .pre-input-group select {
width: 210px; .modal-body .pre-input-group select {
height: 30px; width: 210px;
text-align: center; height: 30px;
text-align-last: center; text-align: center;
padding-left: 5px; text-align-last: center;
} padding-left: 5px;
.power-name-error, .power-id-error, .first-menu-error, .second-menu-error { }
color: red;
display: inline-block; .power-name-error, .power-id-error, .first-menu-error, .second-menu-error {
margin-left: 20px; color: red;
} display: inline-block;
.power-save-success { margin-left: 20px;
color: blue; }
text-align: center;
} .power-save-success {
</style> color: blue;
text-align: center;
}
</style>
</head> </head>
<body> <body>
<div class="search"> <div class="search">
<div> <div>
<span>二级菜单名称</span> <span>二级菜单名称</span>
<input type="text" class="menu-name" value="" placeholder="模糊匹配"> <input class="menu-name" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<span>权限项名称</span> <span>权限项名称</span>
<input type="text" class="power-name" value="" placeholder="模糊匹配"> <input class="power-name" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default power-menu-search">搜索</button> <button class="btn btn-default power-menu-search" type="button">搜索</button>
</div> </div>
</div> </div>
<!-- 模态框 --> <!-- 模态框 -->
<div class="add-menu"> <div class="add-menu">
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-toggle="modal" data-target="#addPowerModal">添加权限控制项</button> <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addPowerModal" data-toggle="modal"
<strong>权限控制项目加好后,不要随意修改,删除!!!</strong> type="button">添加权限控制项
</div> </button>
<div class="modal fade" id="addPowerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <strong>权限控制项目加好后,不要随意修改,删除!!!</strong>
<div class="modal-dialog" role="document"> </div>
<div class="modal-content"> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addPowerModal"
<div class="modal-header"> role="dialog" tabindex="-1">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-dialog" role="document">
<h4 class="modal-title" id="addPowerButton">添加权限控制项</h4> <div class="modal-content">
</div> <div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
<div class="modal-body modal-body-menu"> </button>
<div class="input-group pre-input-group"> <h4 class="modal-title" id="addPowerButton">添加权限控制项</h4>
<span class="input-group-addon basic-addon">一级菜单名</span> </div>
<div class="select-content">
<select id="first-menu-select">
<option value="none">请选择</option>
</select>
<span class="first-menu-error"></span>
</div>
</div>
<div class="input-group pre-input-group"> <div class="modal-body modal-body-menu">
<span class="input-group-addon basic-addon">二级菜单名</span> <div class="input-group pre-input-group">
<div class="select-content"> <span class="input-group-addon basic-addon">一级菜单名</span>
<select id="second-menu-select"> <div class="select-content">
<option value="none">请选择</option> <select id="first-menu-select">
</select> <option value="none">请选择</option>
<span class="second-menu-error"></span> </select>
</div> <span class="first-menu-error"></span>
</div> </div>
</div>
<div class="input-group first-input-group"> <div class="input-group pre-input-group">
<span class="input-group-addon basic-addon">权限项名称</span> <span class="input-group-addon basic-addon">二级菜单名</span>
<input type="text" class="form-control basic-url power-item" value=""> <div class="select-content">
<span class="power-name-error"></span> <select id="second-menu-select">
</div> <option value="none">请选择</option>
</select>
<div class="input-group first-input-group"> <span class="second-menu-error"></span>
<span class="input-group-addon basic-addon">权限项目ID</span> </div>
<input type="text" class="form-control basic-url power-id" value="" placeholder="一级菜单:二级菜单:权限名"> </div>
<span class="power-id-error"></span>
</div>
<div class="input-group"> <div class="input-group first-input-group">
<span class="power-save-success"></span> <span class="input-group-addon basic-addon">权限项名称</span>
</div> <input class="form-control basic-url power-item" type="text" value="">
</div> <span class="power-name-error"></span>
<div class="modal-footer"> </div>
<button type="button" class="btn btn-default cancel-menu" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-menu">保存</button>
</div>
</div>
</div>
</div>
<!-- 模态框end -->
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>二级菜单名</th>
<th>二级菜单标识</th>
<th>权限项目名</th>
<th>权限项目ID</th>
<th>操作</th>
</tr>
</thead>
<tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
<script> <div class="input-group first-input-group">
function Ajax(dataJSON, urlHost) { <span class="input-group-addon basic-addon">权限项目ID</span>
$.ajax({ <input class="form-control basic-url power-id" placeholder="一级菜单:二级菜单:权限名" type="text"
url: urlHost, value="">
data: dataJSON, <span class="power-id-error"></span>
</div>
success: function(res) { <div class="input-group">
if (res.Code == 404) { <span class="power-save-success"></span>
window.parent.location = "/login.html"; </div>
return; </div>
} <div class="modal-footer">
if(urlHost.indexOf("get/firstMenu") != -1) { <button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
initFirstMenuSelect(res); <button class="btn btn-primary save-menu" type="button">保存</button>
} else if (urlHost.indexOf("/get/secondMenu") != -1) { </div>
initSecondMenuSelect(res); </div>
} else if (urlHost.indexOf("/add/power") != -1) { </div>
savePowerItem(res); </div>
} else if (urlHost.indexOf("/get/powerItem") != -1) { <!-- 模态框end -->
showPowerItem(res); <div class="menu-table">
} else if (urlHost.indexOf("/delete/powerItem") != -1) { <table>
Ajax(getCutPageData(), "/get/powerItem"); <thead class="thead-dark">
} <tr>
}, <th>序列号</th>
<th>二级菜单名</th>
<th>二级菜单标识</th>
<th>权限项目名</th>
<th>权限项目ID</th>
<th>操作</th>
</tr>
</thead>
<tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
error: function() { <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
alert("系统异常,请稍后再试"); <li class="pre_page">上一页</li>
} <li class="next_page">下一页</li>
}); <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
} <button class="btn btn-default" type="button">Go</button>
//当每页显示数更改后,执行的操作 </li>
$("#display_count").change(function() { </div>
let dataJSON = getCutPageData();
Ajax(dataJSON, "/get/powerItem");
});
//点击上一页的按钮 <script>
$(".pre_page").click(function() { function Ajax(dataJSON, urlHost) {
let dataJSON = getCutPageData(); $.ajax({
url: urlHost,
data: dataJSON,
if (dataJSON["currentPage"] == 1) { success: function (res) {
return; if (res.Code == 404) {
} window.parent.location = "/login.html";
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; return;
Ajax(dataJSON, "/get/powerItem"); }
}); if (urlHost.indexOf("get/firstMenu") != -1) {
//点击下一页的按钮时 initFirstMenuSelect(res);
$(".next_page").click(function() { } else if (urlHost.indexOf("/get/secondMenu") != -1) {
let dataJSON = getCutPageData(); initSecondMenuSelect(res);
} else if (urlHost.indexOf("/add/power") != -1) {
savePowerItem(res);
} else if (urlHost.indexOf("/get/powerItem") != -1) {
showPowerItem(res);
} else if (urlHost.indexOf("/delete/powerItem") != -1) {
Ajax(getCutPageData(), "/get/powerItem");
}
},
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { error: function () {
return; alert("系统异常,请稍后再试");
} }
});
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; //当每页显示数更改后,执行的操作
Ajax(dataJSON, "/get/powerItem"); $("#display_count").change(function () {
}); let dataJSON = getCutPageData();
//点击跳转那一页的按钮 Ajax(dataJSON, "/get/powerItem");
$(".jump_page button").click(function() { });
let dataJSON = getCutPageData();
if (dataJSON["jumpPage"].length <= 0) { //点击上一页的按钮
return; $(".pre_page").click(function () {
} let dataJSON = getCutPageData();
Ajax(dataJSON, "/get/powerItem");
});
//删除权限项 if (dataJSON["currentPage"] == 1) {
function deletePowerItem(powerID) { return;
if (!window.confirm("是否确定删除该项?")) { }
return; dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
} Ajax(dataJSON, "/get/powerItem");
Ajax({"powerID":powerID}, "/delete/powerItem"); });
} //点击下一页的按钮时
//展示权限项的列表 $(".next_page").click(function () {
function showPowerItem(res) { let dataJSON = getCutPageData();
$(".current_page").html(res.CurrentPage); if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
$(".total_page").html(res.TotalPage); return;
$("#display_count option").each(function() { }
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
let str = ""; dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
for (let i = 0; i < res.PowerItemList.length; i ++) { Ajax(dataJSON, "/get/powerItem");
let v = res.PowerItemList[i]; });
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" + //点击跳转那一页的按钮
"<th>" + v.SecondMenu + "</th>" + "<th>" + v.SecondMenuUid + "</th>" + $(".jump_page button").click(function () {
"<th>" + v.PowerItem + "</th>" + "<th>" + v.PowerId + "</th>"; let dataJSON = getCutPageData();
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.PowerId +'" class="btn btn-default" onclick="deletePowerItem(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").html(str);
}
function initFirstMenuSelect(res) {
let MenuList = res.MenuList;
let str = '<option value="none">请选择</option>';
for (let i = 0; i < MenuList.length; i ++) {
let m = MenuList[i];
str += '<option value="' + m.MenuUid + '">' + m.FirstMenu + '</option>';
}
$("#first-menu-select").html(str);
}
function clearContent() { if (dataJSON["jumpPage"].length <= 0) {
$(".power-name-error").html(""); return;
$(".power-id-error").html(""); }
$(".first-menu-error").html(""); Ajax(dataJSON, "/get/powerItem");
$(".second-menu-error").html(""); });
}
//点击 添加权限控制项 做出的响应
$(".add-button").click(function() {
clearContent();
$(".power-save-success").html();
Ajax({}, "/get/firstMenu");
});
function initSecondMenuSelect(res) {
let secondMenuList = res.SecondMenuList;
let str = '<option value="none">请选择</option>';
for (let i = 0; i < secondMenuList.length; i ++) {
let m = secondMenuList[i];
str += '<option value="' + m.SecondMenuUid + '">' + m.SecondMenu + '</option>';
}
$("#second-menu-select").html(str);
}
//关联二级菜单名
$("#first-menu-select").change(function() {
let firstMenuUid = $("#first-menu-select").val();
if (firstMenuUid == "none") {
return
}
Ajax({"firMenuUid":firstMenuUid}, "/get/secondMenus");
});
//点击 添加权限控制项的保存 按钮
function savePowerItem(res) {
let powerItem = $(".power-item").val();
if (res.Code == -1) {
$(res.Key).html(res.Msg);
return;
} else if (res.Code == 200) {
$(".power-item").val("");
$(".power-id").val("");
$(res.Key).html(powerItem + ":" + res.Msg);
}
clearContent();
}
$(".cancel-menu").click(function() {
Ajax(getCutPageData(), "/get/powerItem");
});
$(".save-menu").click(function() {
let firstMenuUid = $("#first-menu-select").val();
let secondMenuUid = $("#second-menu-select").val();
let powerItem = $(".power-item").val();
let powerID = $(".power-id").val();
clearContent();
$(".power-save-success").html("");
if (firstMenuUid == "none") {
$(".first-menu-error").html("*没选择一级菜单名");
return
}
if (secondMenuUid == "none") { //删除权限项
$(".second-menu-error").html("*没选择二级菜单"); function deletePowerItem(powerID) {
return if (!window.confirm("是否确定删除该项?")) {
} return;
}
Ajax({"firstMenuUid":firstMenuUid, "secondMenuUid":secondMenuUid, "powerItem":powerItem, "powerID":powerID}, "/add/power"); Ajax({"powerID": powerID}, "/delete/powerItem");
}); }
//获取搜索框的数据,和分页的基础数据
function getCutPageData() { //展示权限项的列表
let powerItem = $(".power-item").val(); function showPowerItem(res) {
let powerID = $(".power-id").val();
let displayCount = $("#display_count").val(); $(".current_page").html(res.CurrentPage);
let currentPage = $(".current_page").html(); $(".total_page").html(res.TotalPage);
let totalPage = $(".total_page").html(); $("#display_count option").each(function () {
let jumpPage = $(".jump_page input").val(); if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage":jumpPage, "powerItem": powerItem, "powerID":powerID}; }
} });
$(".power-menu-search").click(function() { $(".jump_page input").val("");
Ajax(getCutPageData(), "/get/powerItem");
}); let str = "";
$(function() { for (let i = 0; i < res.PowerItemList.length; i++) {
Ajax(getCutPageData(), "/get/powerItem"); let v = res.PowerItemList[i];
}); let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
</script> "<th>" + v.SecondMenu + "</th>" + "<th>" + v.SecondMenuUid + "</th>" +
"<th>" + v.PowerItem + "</th>" + "<th>" + v.PowerId + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.PowerId + '" class="btn btn-default" onclick="deletePowerItem(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").html(str);
}
function initFirstMenuSelect(res) {
let MenuList = res.MenuList;
let str = '<option value="none">请选择</option>';
for (let i = 0; i < MenuList.length; i++) {
let m = MenuList[i];
str += '<option value="' + m.MenuUid + '">' + m.FirstMenu + '</option>';
}
$("#first-menu-select").html(str);
}
function clearContent() {
$(".power-name-error").html("");
$(".power-id-error").html("");
$(".first-menu-error").html("");
$(".second-menu-error").html("");
}
//点击 添加权限控制项 做出的响应
$(".add-button").click(function () {
clearContent();
$(".power-save-success").html();
Ajax({}, "/get/firstMenu");
});
function initSecondMenuSelect(res) {
let secondMenuList = res.SecondMenuList;
let str = '<option value="none">请选择</option>';
for (let i = 0; i < secondMenuList.length; i++) {
let m = secondMenuList[i];
str += '<option value="' + m.SecondMenuUid + '">' + m.SecondMenu + '</option>';
}
$("#second-menu-select").html(str);
}
//关联二级菜单名
$("#first-menu-select").change(function () {
let firstMenuUid = $("#first-menu-select").val();
if (firstMenuUid == "none") {
return
}
Ajax({"firMenuUid": firstMenuUid}, "/get/secondMenus");
});
//点击 添加权限控制项的保存 按钮
function savePowerItem(res) {
let powerItem = $(".power-item").val();
if (res.Code == -1) {
$(res.Key).html(res.Msg);
return;
} else if (res.Code == 200) {
$(".power-item").val("");
$(".power-id").val("");
$(res.Key).html(powerItem + ":" + res.Msg);
}
clearContent();
}
$(".cancel-menu").click(function () {
Ajax(getCutPageData(), "/get/powerItem");
});
$(".save-menu").click(function () {
let firstMenuUid = $("#first-menu-select").val();
let secondMenuUid = $("#second-menu-select").val();
let powerItem = $(".power-item").val();
let powerID = $(".power-id").val();
clearContent();
$(".power-save-success").html("");
if (firstMenuUid == "none") {
$(".first-menu-error").html("*没选择一级菜单名");
return
}
if (secondMenuUid == "none") {
$(".second-menu-error").html("*没选择二级菜单");
return
}
Ajax({
"firstMenuUid": firstMenuUid,
"secondMenuUid": secondMenuUid,
"powerItem": powerItem,
"powerID": powerID
}, "/add/power");
});
//获取搜索框的数据,和分页的基础数据
function getCutPageData() {
let powerItem = $(".power-item").val();
let powerID = $(".power-id").val();
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"powerItem": powerItem,
"powerID": powerID
};
}
$(".power-menu-search").click(function () {
Ajax(getCutPageData(), "/get/powerItem");
});
$(function () {
Ajax(getCutPageData(), "/get/powerItem");
});
</script>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style type="text/css"> <style type="text/css">
.road-pool-record, .edit-road-pool { .road-pool-record, .edit-road-pool {
@@ -115,17 +115,17 @@
<div class="search"> <div class="search">
<div> <div>
<span>通道池名称:</span> <span>通道池名称:</span>
<input type="text" class="road-pool-name-search" value="" placeholder="模糊匹配"> <input class="road-pool-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<span>通道池编号:</span> <span>通道池编号:</span>
<input type="text" class="product-pool-name-search" value="" placeholder="模糊匹配"> <input class="product-pool-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default road-pool-search">搜索</button> <button class="btn btn-default road-pool-search" type="button">搜索</button>
</div> </div>
</div> </div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-road-pool-button">添加通道池 <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-road-pool-button" type="button">添加通道池
</button> </button>
<div class="menu-table"> <div class="menu-table">
<table> <table>
@@ -159,29 +159,29 @@
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button type="button" class="btn btn-default">Go</button> <button class="btn btn-default" type="button">Go</button>
</li> </li>
</div> </div>
</div> </div>
<div class="edit-road-pool"> <div class="edit-road-pool">
<input type="hidden" value="" class="road-pool-code-hide"> <input class="road-pool-code-hide" type="hidden" value="">
<div class="edit-road-search"> <div class="edit-road-search">
<div> <div>
通道名称: 通道名称:
<input type="text" class="road-name-search" value="" placeholder="模糊匹配"> <input class="road-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
产品名称: 产品名称:
<input type="text" class="road-product-name-search" value="" placeholder="模糊匹配"> <input class="road-product-name-search" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
支付类型: 支付类型:
<input type="text" class="road-pay-type-search" value=""> <input class="road-pay-type-search" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default edit-road-search-button">搜索</button> <button class="btn btn-default edit-road-search-button" type="button">搜索</button>
</div> </div>
</div> </div>
@@ -189,7 +189,7 @@
<table> <table>
<thead class="thead-dark"> <thead class="thead-dark">
<tr> <tr>
<th><input type="checkbox" id="controller-all-checkbox"></th> <th><input id="controller-all-checkbox" type="checkbox"></th>
<th>序列号</th> <th>序列号</th>
<th>通道名称</th> <th>通道名称</th>
<th>产品名称</th> <th>产品名称</th>
@@ -229,8 +229,8 @@
</li> </li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" id="jump_page" value=""> <li class="jump_page">跳转 <input id="jump_page" type="text" value="">
<button type="button" class="btn btn-default">Go</button> <button class="btn btn-default" type="button">Go</button>
</li> </li>
</div> </div>
<div class="road-footer"> <div class="road-footer">
@@ -241,12 +241,12 @@
</div> </div>
<!-- 模态框 --> <!-- 模态框 -->
<div class="modal fade" id="roadPoolModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="roadPoolModal"
data-keyboard="false" data-backdrop="static"> role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button> </button>
<h4 class="modal-title" id="addroadPoolButton">添加通道池</h4> <h4 class="modal-title" id="addroadPoolButton">添加通道池</h4>
</div> </div>
@@ -254,18 +254,18 @@
<div class="modal-body modal-body-road-pool"> <div class="modal-body modal-body-road-pool">
<div> <div>
<span>通道池名称:</span> <span>通道池名称:</span>
<input type="text" value="" placeholder="" class="road-pool-name"> <input class="road-pool-name" placeholder="" type="text" value="">
<span class="road-pool-name-error"></span> <span class="road-pool-name-error"></span>
</div> </div>
<div> <div>
<span>通道池编号:</span> <span>通道池编号:</span>
<input type="text" value="" class="road-pool-code"> <input class="road-pool-code" type="text" value="">
<span class="road-pool-code-error"></span> <span class="road-pool-code-error"></span>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default cancel-road-pool" data-dismiss="modal">取消</button> <button class="btn btn-default cancel-road-pool" data-dismiss="modal" type="button">取消</button>
<button type="button" class="btn btn-primary save-road-pool">保存</button> <button class="btn btn-primary save-road-pool" type="button">保存</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -2,12 +2,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
</head> </head>
<body> <body>
<h1>利润统计</h1> <h1>利润统计</h1>
</body> </body>
</html> </html>

View File

@@ -2,262 +2,279 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>商户后台</title> <title>商户后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style> <style>
.role-name-add { .role-name-add {
margin-left: 30px; margin-left: 30px;
vertical-align: bottom; vertical-align: bottom;
} }
.role-remark {
margin-left: 30px; .role-remark {
margin-top: 20px; margin-left: 30px;
width: 190px; margin-top: 20px;
} width: 190px;
.role-remark-word { }
vertical-align: center;
} .role-remark-word {
.role-name-error { vertical-align: center;
margin-left: 20px; }
color: red;
} .role-name-error {
</style> margin-left: 20px;
color: red;
}
</style>
</head> </head>
<body> <body>
<div class="search"> <div class="search">
<div> <div>
<span>角色名称</span> <span>角色名称</span>
<input type="text" class="role-name" value="" placeholder="模糊匹配"> <input class="role-name" placeholder="模糊匹配" type="text" value="">
</div> </div>
<div> <div>
<button type="button" class="btn btn-default role-menu-search">搜索</button> <button class="btn btn-default role-menu-search" type="button">搜索</button>
</div> </div>
</div> </div>
<div class="add-menu">
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-toggle="modal" data-target="#addRoleModal">创建新角色</button>
</div>
<!-- 创建新角色的模态框 -->
<div class="modal fade" id="addRoleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="addPowerButton">添加角色</h4>
</div>
<div class="modal-body modal-body-menu">
<div>
<span>角色名称: </span>
<input type="text" class="role-name-add">
<span class="role-name-error"></span>
</div>
<div>
<span class="role-remark-word">角色描述:</span>
<textarea class="role-remark"></textarea>
<span class="role-remark-error"></span>
</div>
<div class="input-group"> <div class="add-menu">
<span class="role-save-success"></span> <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addRoleModal" data-toggle="modal"
</div> type="button">创建新角色
</div> </button>
<div class="modal-footer"> </div>
<button type="button" class="btn btn-default cancel-menu" data-dismiss="modal">取消</button> <!-- 创建新角色的模态框 -->
<button type="button" class="btn btn-primary save-menu">保存</button> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addRoleModal"
</div> role="dialog" tabindex="-1">
</div> <div class="modal-dialog" role="document">
</div> <div class="modal-content">
</div> <div class="modal-header">
<!-- 模态框end --> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
<!-- 权限配置模态框 --> </button>
<div class="edit-role-modal"></div> <h4 class="modal-title" id="addPowerButton">添加角色</h4>
<!-- 权限模态框 end --> </div>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>角色名称</th>
<th>角色标识号</th>
<th>备注</th>
<th>创建时间</th>
<th>编辑</th>
</tr>
</thead>
<tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
<script> <div class="modal-body modal-body-menu">
function getRolePageData() { <div>
let displayCount = $("#display_count").val(); <span>角色名称: </span>
let currentPage = $(".current_page").html(); <input class="role-name-add" type="text">
let totalPage = $(".total_page").html(); <span class="role-name-error"></span>
let jumpPage = $(".jump_page input").val(); </div>
let roleName = $(".role-name").val(); <div>
let roleNameAdd = $(".role-name-add").val(); <span class="role-remark-word">角色描述:</span>
let roleRemark = $(".role-remark").val(); <textarea class="role-remark"></textarea>
<span class="role-remark-error"></span>
</div>
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage":jumpPage, <div class="input-group">
"roleName":roleName, "roleRemark":roleRemark, "roleNameAdd":roleNameAdd}; <span class="role-save-success"></span>
} </div>
function Ajax(dataJSON, urlHost) { </div>
$.ajax({ <div class="modal-footer">
url: urlHost, <button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
async:false, <button class="btn btn-primary save-menu" type="button">保存</button>
data: dataJSON, </div>
</div>
</div>
</div>
<!-- 模态框end -->
<!-- 权限配置模态框 -->
<div class="edit-role-modal"></div>
<!-- 权限模态框 end -->
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>角色名称</th>
<th>角色标识号</th>
<th>备注</th>
<th>创建时间</th>
<th>编辑</th>
</tr>
</thead>
<tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
success: function(res) { <li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li>
if (res.Code == 404) { <li class="pre_page">上一页</li>
window.parent.location = "/login.html"; <li class="next_page">下一页</li>
return; <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
} <button class="btn btn-default" type="button">Go</button>
if(urlHost.indexOf("/get/role") != -1) { </li>
showRoleList(res); </div>
} else if (urlHost.indexOf("/add/role") != -1) {
addRole(res);
} else if (urlHost.indexOf("/delete/role") != -1) {
if (res.Code == 200) {
Ajax(dataJSON, "/get/role");
}
}
},
error: function() { <script>
alert("系统异常,请稍后再试"); function getRolePageData() {
} let displayCount = $("#display_count").val();
}); let currentPage = $(".current_page").html();
} let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
function deleteRole(roleUid) {
if (!window.confirm("是否确定删除?")) {
return;
}
let dataJSON = getRolePageData();
dataJSON["roleUid"] = roleUid;
Ajax(dataJSON, "/delete/role");
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getRolePageData();
Ajax(dataJSON, "/get/role");
});
//点击上一页的按钮 let roleName = $(".role-name").val();
$(".pre_page").click(function() { let roleNameAdd = $(".role-name-add").val();
let dataJSON = getRolePageData(); let roleRemark = $(".role-remark").val();
if (dataJSON["currentPage"] == 1) { return {
return; "displayCount": displayCount, "currentPage": currentPage, "totalPage": totalPage, "jumpPage": jumpPage,
} "roleName": roleName, "roleRemark": roleRemark, "roleNameAdd": roleNameAdd
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1; };
Ajax(dataJSON, "/get/role"); }
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getRolePageData();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { function Ajax(dataJSON, urlHost) {
return; $.ajax({
} url: urlHost,
async: false,
data: dataJSON,
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; success: function (res) {
Ajax(dataJSON, "/get/role"); if (res.Code == 404) {
}); window.parent.location = "/login.html";
//点击跳转那一页的按钮 return;
$(".jump_page button").click(function() { }
let dataJSON = getRolePageData(); if (urlHost.indexOf("/get/role") != -1) {
showRoleList(res);
} else if (urlHost.indexOf("/add/role") != -1) {
addRole(res);
} else if (urlHost.indexOf("/delete/role") != -1) {
if (res.Code == 200) {
Ajax(dataJSON, "/get/role");
}
}
},
if (dataJSON["jumpPage"].length <= 0) { error: function () {
return; alert("系统异常,请稍后再试");
} }
Ajax(dataJSON, "/get/role"); });
}); }
function addRole(res) {
let role = $(".role-name-add").val();
if (res.Code == 200) {
$(".role-save-success").html(role + ":添加成功");
$(".cancel-menu").trigger('click');
Ajax(getRolePageData(), "/get/role");
} else {
$(res.Key).html(res.Msg);
}
}
$(".save-menu").click(function() {
let roleName = $(".role-name").val();
let roleNameAdd = $(".role-name-add").val();
let roleRemark = $(".role-remark").val();
$(".role-name-error").html(""); function deleteRole(roleUid) {
$(".role-remark-error").html(""); if (!window.confirm("是否确定删除?")) {
return;
}
let dataJSON = getRolePageData();
dataJSON["roleUid"] = roleUid;
Ajax(dataJSON, "/delete/role");
}
if (roleNameAdd.length == 0) { //当每页显示数更改后,执行的操作
$(".role-name-error").html("*角色名称不能为空"); $("#display_count").change(function () {
} let dataJSON = getRolePageData();
Ajax(dataJSON, "/get/role");
});
Ajax({"roleName":roleName, "roleRemark":roleRemark, "roleNameAdd":roleNameAdd},"/add/role"); //点击上一页的按钮
}); $(".pre_page").click(function () {
function showRoleList(res) { let dataJSON = getRolePageData();
if (res.Code != 200) {
alert("获取数据失败");
return;
}
$(".current_page").html(res.CurrentPage); if (dataJSON["currentPage"] == 1) {
$(".total_page").html(res.TotalPage); return;
$("#display_count option").each(function() { }
if ($(this).text() == res.DisplayCount) { dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
$(this).attr('selected', true); Ajax(dataJSON, "/get/role");
} });
}); //点击下一页的按钮时
$(".jump_page input").val(""); $(".next_page").click(function () {
let dataJSON = getRolePageData();
let str = ""; if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
for (let i = 0; i < res.RoleInfoList.length; i ++) { return;
let v = res.RoleInfoList[i]; }
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.RoleName + "</th>" + "<th>" + v.RoleUid + "</th>" + dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
"<th>" + v.Remark + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>"; Ajax(dataJSON, "/get/role");
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' + });
// '<button type="button" value="' + v.RoleUid +'" class="btn btn-default" onclick="editRole(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' + //点击跳转那一页的按钮
'<button type="button" value="' + v.RoleUid +'" class="btn btn-default" onclick="deleteRole(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' + $(".jump_page button").click(function () {
'</div>' + "</th>" + "</tr>"; let dataJSON = getRolePageData();
str = str + tmp;
} if (dataJSON["jumpPage"].length <= 0) {
$("#menu_table_body").html(str); return;
} }
$(".role-menu-search").click(function() { Ajax(dataJSON, "/get/role");
Ajax(getRolePageData(), "/get/role"); });
$(".edit-role-modal").load("/jhboss/edit_role.html");
}); function addRole(res) {
$(function() { let role = $(".role-name-add").val();
if (res.Code == 200) {
$(".role-save-success").html(role + ":添加成功");
$(".cancel-menu").trigger('click');
Ajax(getRolePageData(), "/get/role"); Ajax(getRolePageData(), "/get/role");
$(".edit-role-modal").load("/jhboss/edit_role.html"); } else {
}); $(res.Key).html(res.Msg);
</script> }
}
$(".save-menu").click(function () {
let roleName = $(".role-name").val();
let roleNameAdd = $(".role-name-add").val();
let roleRemark = $(".role-remark").val();
$(".role-name-error").html("");
$(".role-remark-error").html("");
if (roleNameAdd.length == 0) {
$(".role-name-error").html("*角色名称不能为空");
}
Ajax({"roleName": roleName, "roleRemark": roleRemark, "roleNameAdd": roleNameAdd}, "/add/role");
});
function showRoleList(res) {
if (res.Code != 200) {
alert("获取数据失败");
return;
}
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
let str = "";
for (let i = 0; i < res.RoleInfoList.length; i++) {
let v = res.RoleInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.RoleName + "</th>" + "<th>" + v.RoleUid + "</th>" +
"<th>" + v.Remark + "</th>" + "<th>" + new Date(v.CreateTime).toLocaleString() + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
// '<button type="button" value="' + v.RoleUid +'" class="btn btn-default" onclick="editRole(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' +
'<button type="button" value="' + v.RoleUid + '" class="btn btn-default" onclick="deleteRole(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").html(str);
}
$(".role-menu-search").click(function () {
Ajax(getRolePageData(), "/get/role");
$(".edit-role-modal").load("/jhboss/edit_role.html");
});
$(function () {
Ajax(getRolePageData(), "/get/role");
$(".edit-role-modal").load("/jhboss/edit_role.html");
});
</script>
</body> </body>
</html> </html>

View File

@@ -2,341 +2,361 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.ui.min.js"></script> <script src="../static/js/jquery.ui.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<style> <style>
.first-input-group .basic-url, .router-input-group .basic-url { .first-input-group .basic-url, .router-input-group .basic-url {
width: 210px; width: 210px;
} }
.pre-menu-error ,.second-menu-error ,.second-router-error { .pre-menu-error, .second-menu-error, .second-router-error {
padding-left: 20px; padding-left: 20px;
color: red color: red
} }
</style> </style>
</head> </head>
<body> <body>
<!-- 添加菜单的模态框 --> <!-- 添加菜单的模态框 -->
<div class="modal fade" id="addMenuModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static"> <div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addMenuModal"
<div class="modal-dialog" role="document"> role="dialog" tabindex="-1">
<div class="modal-content"> <div class="modal-dialog" role="document">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">添加二级菜单</h4> <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</div> </button>
<div class="modal-body modal-body-menu"> <h4 class="modal-title" id="myModalLabel">添加二级菜单</h4>
<div class="input-group pre-input-group"> </div>
<span class="input-group-addon basic-addon">父级菜单</span> <div class="modal-body modal-body-menu">
<div class="select-content"> <div class="input-group pre-input-group">
</div> <span class="input-group-addon basic-addon">父级菜单</span>
<div class="select-content">
<span class="pre-menu-error"></span> </div>
</div>
<div class="input-group first-input-group">
<span class="input-group-addon basic-addon">二级菜单</span>
<input type="text" class="form-control basic-url second-menu-content">
<span class="second-menu-error"></span>
</div>
<div class="input-group first-input-group">
<span class="input-group-addon basic-addon">菜单路由</span>
<input type="text" class="form-control basic-url router-url">
<span class="second-router-error"></span>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-menu" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-menu">保存</button>
</div>
</div>
</div>
</div>
<div class="search"> <span class="pre-menu-error"></span>
<div> </div>
<span>一级菜单</span> <div class="input-group first-input-group">
<input type="text" class="first-menu-serach" placeholder ="模糊匹配"> <span class="input-group-addon basic-addon">二级菜单</span>
</div> <input class="form-control basic-url second-menu-content" type="text">
<div> <span class="second-menu-error"></span>
<span>二级菜单</span> </div>
<input type="text" class="second-menu-serach" value="" placeholder="模糊匹配">
</div>
<div>
<button type="button" class="btn btn-default second-menu-search">搜索</button>
</div>
</div>
<div class="add-menu"> <div class="input-group first-input-group">
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-toggle="modal" data-target="#addMenuModal">添加二级菜单</button> <span class="input-group-addon basic-addon">菜单路由</span>
<strong>在添加二级菜单时,确保对应的一级菜单已经创建好!</strong> <input class="form-control basic-url router-url" type="text">
</div> <span class="second-router-error"></span>
<div class="menu-table"> </div>
<table> </div>
<thead class="thead-dark"> <div class="modal-footer">
<tr> <button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
<th>序列号</th> <button class="btn btn-primary save-menu" type="button">保存</button>
<th>父级菜单</th> </div>
<th>父级菜单排序号</th> </div>
<th>父级菜单识别号</th> </div>
<th>二级菜单顺序</th> </div>
<th>二级菜单识别号</th>
<th>二级菜单</th>
<th>二级菜单路由</th>
<th>操作</th>
</tr>
</thead>
<tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
<li class="current_total_page"><span class="current_page">1</span>/<span class="total_page">2</span></li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li>
</div>
<script> <div class="search">
<div>
<span>一级菜单</span>
<input class="first-menu-serach" placeholder="模糊匹配" type="text">
</div>
<div>
<span>二级菜单</span>
<input class="second-menu-serach" placeholder="模糊匹配" type="text" value="">
</div>
<div>
<button class="btn btn-default second-menu-search" type="button">搜索</button>
</div>
</div>
//获取搜索框的数据,和分页的基础数据 <div class="add-menu">
function getCutPageData() { <button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addMenuModal" data-toggle="modal"
let firstMenuSerach = $(".first-menu-serach").val(); type="button">添加二级菜单
let secondMenuSerach = $(".second-menu-serach").val(); </button>
let displayCount = $("#display_count").val(); <strong>在添加二级菜单时,确保对应的一级菜单已经创建好!</strong>
let currentPage = $(".current_page").html(); </div>
let totalPage = $(".total_page").html(); <div class="menu-table">
let jumpPage = $(".jump_page input").val(); <table>
<thead class="thead-dark">
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage":jumpPage, "firstMenuSerach": firstMenuSerach, "secondMenuSerach":secondMenuSerach}; <tr>
} <th>序列号</th>
$(".second-menu-search").click(function() { <th>父级菜单</th>
showSecondMenuList(getCutPageData()); <th>父级菜单排序号</th>
}); <th>父级菜单识别号</th>
//刚开始加载页面的时候,执行的一系列操作 <th>二级菜单顺序</th>
$(document).ready(function() { <th>二级菜单识别号</th>
showSecondMenuList(getCutPageData()); <th>二级菜单</th>
}); <th>二级菜单路由</th>
//当每页显示数更改后,执行的操作 <th>操作</th>
$("#display_count").change(function() { </tr>
showSecondMenuList(getCutPageData()); </thead>
}); <tbody id="menu_table_body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</li>
//点击上一页的按钮 <li class="current_total_page"><span class="current_page">1</span>/<span class="total_page">2</span></li>
$(".pre_page").click(function() { <li class="pre_page">上一页</li>
let dataJSON = getCutPageData(); <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
if (dataJSON["currentPage"] == 1) { <script>
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showSecondMenuList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPageData();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { //获取搜索框的数据,和分页的基础数据
return; function getCutPageData() {
} let firstMenuSerach = $(".first-menu-serach").val();
let secondMenuSerach = $(".second-menu-serach").val();
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1; return {
"displayCount": displayCount,
showSecondMenuList(dataJSON); "currentPage": currentPage,
}); "totalPage": totalPage,
//点击跳转那一页的按钮 "jumpPage": jumpPage,
$(".jump_page button").click(function() { "firstMenuSerach": firstMenuSerach,
let dataJSON = getCutPageData(); "secondMenuSerach": secondMenuSerach
};
}
if (dataJSON["jumpPage"].length <= 0) { $(".second-menu-search").click(function () {
return; showSecondMenuList(getCutPageData());
} });
//刚开始加载页面的时候,执行的一系列操作
$(document).ready(function () {
showSecondMenuList(getCutPageData());
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
showSecondMenuList(getCutPageData());
});
showSecondMenuList(dataJSON); //点击上一页的按钮
}); $(".pre_page").click(function () {
$(".search div button").click(function() { let dataJSON = getCutPageData();
let dataJSON = getCutPageData();
showSecondMenuList(dataJSON);
});
function Ajax(secondMenuUid, hostUrl) {
$.ajax({
url: hostUrl,
data: {
"secondMenuUid": secondMenuUid
},
success: function(res) { if (dataJSON["currentPage"] == 1) {
return;
if (res.Code == 404) { }
window.parent.location = "/login.html"; dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
} else if (res.Code == 200){ showSecondMenuList(dataJSON);
showSecondMenuList(); });
} else { //点击下一页的按钮时
alert("参数传入有误"); $(".next_page").click(function () {
} let dataJSON = getCutPageData();
},
error: function() { if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
alert("系统异常,请稍后重试"); return;
} }
}); dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
}
//提升菜单的顺序
function menuUp(secondMenuUid) {
Ajax(secondMenuUid, "/up/secondMenu");
}
//降低菜单的顺序
function menuDown(secondMenuUid) {
Ajax(secondMenuUid, "/down/secondMenu");
}
//删除菜单
function menuDelete(secondMenuUid) {
if (!window.confirm("是否确定删除该项?")) {
return;
}
Ajax(secondMenuUid, "/delete/secondMenu");
}
//此函数的作用,是在每行的最后一格,加入可操作的按钮图标
function showSecondMenuList(dataJSON) {
$.ajax({
url: "/get/secondMenu",
data: dataJSON,
success: function(res) { showSecondMenuList(dataJSON);
$(".current_page").html(res.CurrentPage); });
$(".total_page").html(res.TotalPage); //点击跳转那一页的按钮
$("#display_count option").each(function() { $(".jump_page button").click(function () {
if ($(this).text() == res.DisplayCount) { let dataJSON = getCutPageData();
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
if (res.Code == -1) { if (dataJSON["jumpPage"].length <= 0) {
alert(res.Msg); return;
}else if (res.Code == 404) { }
window.parent.location = "/login.html";
} else {
//将先前的内容清空
$("#menu_table_body").html("");
let str = "";
for(let i = 0; i < res.SecondMenuList.length; i ++) {
let v = res.SecondMenuList[i];
let secondMenus = v.SecondMenu.split("|");
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" +
"<th>" + v.FirstMenu + "</th>" + "<th>" + v.FirstMenuOrder + "</th>" +
"<th>" + v.FirstMenuUid + "</th>" + "<th>" + v.MenuOrder + "</th>" + "<th>" + v.SecondMenuUid + "</th>" +
"<th>" + v.SecondMenu + "</th>" + "<th>" + v.SecondRouter + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.SecondMenuUid +'" class="btn btn-default" onclick="menuUp(this.value);"><span class="glyphicon glyphicon-arrow-up"></span></button>' +
'<button type="button" value="' + v.SecondMenuUid +'" class="btn btn-default" onclick="menuDown(this.value);"><span class="glyphicon glyphicon-arrow-down"></span></button>' +
'<button type="button" value="' + v.SecondMenuUid +'" class="btn btn-default" onclick="menuDelete(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").append(str);
}
},
error: function() { showSecondMenuList(dataJSON);
alert("系统异常,请稍后重试"); });
} $(".search div button").click(function () {
}); let dataJSON = getCutPageData();
} showSecondMenuList(dataJSON);
});
$(".save-menu").click(function() { function Ajax(secondMenuUid, hostUrl) {
clearMenuError(); $.ajax({
let preMenuUid = $("#pre-menu").val(); url: hostUrl,
if (preMenuUid == "none") { data: {
$(".pre-menu-error").text("*父级菜单不能为空"); "secondMenuUid": secondMenuUid
return; },
}
let secondMenu = $(".second-menu-content").val();
let secondRouter = $(".router-url").val();
if (secondMenu.length == 0) { success: function (res) {
$(".second-menu-error").text("*二级菜单不能为空");
return;
}
if (secondRouter.length == 0) {
$(".second-router-error").text("*二级菜单路由不能为空");
return;
}
$.ajax({ if (res.Code == 404) {
url: "/add/secondMenu", window.parent.location = "/login.html";
data: { } else if (res.Code == 200) {
"preMenuUid": preMenuUid, showSecondMenuList();
"secondMenu": secondMenu, } else {
"secondRouter": secondRouter alert("参数传入有误");
}, }
},
success: function(res) { error: function () {
if (res.Code == 404) { alert("系统异常,请稍后重试");
window.parent.location = "/login.html"; }
} else if (res.Code == -1) {
$("." + res.Key).text(res.Msg);
} else {
$(".cancel-menu").trigger('click');
showSecondMenuList();
}
},
error: function() {
alert("系统异常,请稍后重试");
}
});
});
function clearMenuError() {
$(".pre-menu-error").text("");
$(".second-menu-error").text("");
$(".second-router-error").text("");
}
function selectContent() {
$.ajax({
url: "/get/firstMenu",
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200) {
let str = '<select id="pre-menu">' + '<option value="none">请选择父菜单</option>';
for (let i = 0; i < res.MenuList.length; i ++) {
let m = res.MenuList[i];
str = str + '<option value="' + m.MenuUid + '">' + m.FirstMenu + '</option>' ;
}
str = str + '</select>';
$(".select-content").html(str);
} else {
} });
}, }
error: function() { //提升菜单的顺序
alert("系统异常,请稍后重试"); function menuUp(secondMenuUid) {
} Ajax(secondMenuUid, "/up/secondMenu");
}); }
}
$(".add-button").click(function() { //降低菜单的顺序
$(".basic-url").val(""); function menuDown(secondMenuUid) {
$(".select-content").html(""); Ajax(secondMenuUid, "/down/secondMenu");
clearMenuError(); }
selectContent();
}); //删除菜单
</script> function menuDelete(secondMenuUid) {
if (!window.confirm("是否确定删除该项?")) {
return;
}
Ajax(secondMenuUid, "/delete/secondMenu");
}
//此函数的作用,是在每行的最后一格,加入可操作的按钮图标
function showSecondMenuList(dataJSON) {
$.ajax({
url: "/get/secondMenu",
data: dataJSON,
success: function (res) {
$(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage);
$("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true);
}
});
$(".jump_page input").val("");
if (res.Code == -1) {
alert(res.Msg);
} else if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
//将先前的内容清空
$("#menu_table_body").html("");
let str = "";
for (let i = 0; i < res.SecondMenuList.length; i++) {
let v = res.SecondMenuList[i];
let secondMenus = v.SecondMenu.split("|");
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
"<th>" + v.FirstMenu + "</th>" + "<th>" + v.FirstMenuOrder + "</th>" +
"<th>" + v.FirstMenuUid + "</th>" + "<th>" + v.MenuOrder + "</th>" + "<th>" + v.SecondMenuUid + "</th>" +
"<th>" + v.SecondMenu + "</th>" + "<th>" + v.SecondRouter + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.SecondMenuUid + '" class="btn btn-default" onclick="menuUp(this.value);"><span class="glyphicon glyphicon-arrow-up"></span></button>' +
'<button type="button" value="' + v.SecondMenuUid + '" class="btn btn-default" onclick="menuDown(this.value);"><span class="glyphicon glyphicon-arrow-down"></span></button>' +
'<button type="button" value="' + v.SecondMenuUid + '" class="btn btn-default" onclick="menuDelete(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' + "</th>" + "</tr>";
str = str + tmp;
}
$("#menu_table_body").append(str);
}
},
error: function () {
alert("系统异常,请稍后重试");
}
});
}
$(".save-menu").click(function () {
clearMenuError();
let preMenuUid = $("#pre-menu").val();
if (preMenuUid == "none") {
$(".pre-menu-error").text("*父级菜单不能为空");
return;
}
let secondMenu = $(".second-menu-content").val();
let secondRouter = $(".router-url").val();
if (secondMenu.length == 0) {
$(".second-menu-error").text("*二级菜单不能为空");
return;
}
if (secondRouter.length == 0) {
$(".second-router-error").text("*二级菜单路由不能为空");
return;
}
$.ajax({
url: "/add/secondMenu",
data: {
"preMenuUid": preMenuUid,
"secondMenu": secondMenu,
"secondRouter": secondRouter
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$("." + res.Key).text(res.Msg);
} else {
$(".cancel-menu").trigger('click');
showSecondMenuList();
}
},
error: function () {
alert("系统异常,请稍后重试");
}
});
});
function clearMenuError() {
$(".pre-menu-error").text("");
$(".second-menu-error").text("");
$(".second-router-error").text("");
}
function selectContent() {
$.ajax({
url: "/get/firstMenu",
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200) {
let str = '<select id="pre-menu">' + '<option value="none">请选择父菜单</option>';
for (let i = 0; i < res.MenuList.length; i++) {
let m = res.MenuList[i];
str = str + '<option value="' + m.MenuUid + '">' + m.FirstMenu + '</option>';
}
str = str + '</select>';
$(".select-content").html(str);
} else {
}
},
error: function () {
alert("系统异常,请稍后重试");
}
});
}
$(".add-button").click(function () {
$(".basic-url").val("");
$(".select-content").html("");
clearMenuError();
selectContent();
});
</script>
</body> </body>
</html> </html>

View File

@@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -21,7 +22,8 @@
.order-record .search div { .order-record .search div {
height: 20px; height: 20px;
} }
#search-order-supplier-name, #select-merchant-name,#search-notify-pay-type {
#search-order-supplier-name, #select-merchant-name, #search-notify-pay-type {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
@@ -32,26 +34,26 @@
<div class="search form-inline"> <div class="search form-inline">
<label for=""> <label for="">
<span>开始时间:</span> <span>开始时间:</span>
<input type="text" name="" id="search-notify-start-time" class="start-time" value=""> <input class="start-time" id="search-notify-start-time" name="" type="text" value="">
</label> </label>
<label for=""> <label for="">
<span>结束时间:</span> <span>结束时间:</span>
<input type="text" name="" id="search-notify-end-time" class="end-time" value=""> <input class="end-time" id="search-notify-end-time" name="" type="text" value="">
</label> </label>
<label for=""> <label for="">
<span>商户名称:</span> <span>商户名称:</span>
<select name="" id="select-merchant-name"> <select id="select-merchant-name" name="">
</select> </select>
</label> </label>
<label for=""> <label for="">
<span>商户名称:</span> <span>商户名称:</span>
<select name="" id="search-order-supplier-name"> <select id="search-order-supplier-name" name="">
</select> </select>
</label> </label>
<label for=""> <label for="">
<span>回调类型:</span> <span>回调类型:</span>
<select name="" id="notify-type"> <select id="notify-type" name="">
<option value="">请选择</option> <option value="">请选择</option>
<option value="order">支付回调</option> <option value="order">支付回调</option>
<option value="payfor">代付回调</option> <option value="payfor">代付回调</option>
@@ -59,7 +61,7 @@
</label> </label>
<label for=""> <label for="">
<input type="button" class="btn btn-primary" value="开始" onclick="startNotify()"> <input class="btn btn-primary" onclick="startNotify()" type="button" value="开始">
</label> </label>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
@@ -78,23 +80,25 @@
return { return {
"startTime": startTime, "startTime": startTime,
"endTime":endTime, "endTime": endTime,
"merchantUid":merchantUid, "merchantUid": merchantUid,
"notifyType":notifyType "notifyType": notifyType
}; };
} }
function sendNotify(bankOrderId) { function sendNotify(bankOrderId) {
$.ajax({ $.ajax({
url:"/self/send/notify", url: "/self/send/notify",
data: { data: {
"bankOrderId":bankOrderId "bankOrderId": bankOrderId
}, },
success: function () { success: function () {
} }
}); });
} }
function startNotify() { function startNotify() {
if (!confirm("是否开始执行批量回调操作")){ if (!confirm("是否开始执行批量回调操作")) {
return; return;
} }
let dataJSON = getSearchValues(); let dataJSON = getSearchValues();
@@ -102,11 +106,11 @@
url: "/get/notify/bankOrderId/list", url: "/get/notify/bankOrderId/list",
data: dataJSON, data: dataJSON,
success: function (res) { success: function (res) {
if (res.Code == 404){ if (res.Code == 404) {
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else if (res.Code == 200) { } else if (res.Code == 200) {
$(".panel-body").html("回调处理中......"); $(".panel-body").html("回调处理中......");
for (let i = 0; i < res.NotifyIdList.length; i++) { for (let i = 0; i < res.NotifyIdList.length; i++) {
sendNotify(res.NotifyIdList[i]); sendNotify(res.NotifyIdList[i]);
$(".panel-body").html("回调完毕"); $(".panel-body").html("回调完毕");
} }
@@ -117,6 +121,7 @@
} }
}); });
} }
$(function () { $(function () {
let day = new Date(new Date().getTime() - 86400000); let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day); let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link src="../static/lib/bootstrap/css/bootstrap.min.css"> <link src="../static/lib/bootstrap/css/bootstrap.min.css">
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
@@ -11,9 +11,11 @@
.panel .panel-body input { .panel .panel-body input {
width: 50%; width: 50%;
} }
.algin-right { .algin-right {
text-align: right; text-align: right;
} }
table tr td { table tr td {
display: inline-block; display: inline-block;
width: 50%; width: 50%;
@@ -22,13 +24,16 @@
.panel-heading:hover { .panel-heading:hover {
cursor: pointer; cursor: pointer;
} }
.panel-footer { .panel-footer {
padding-left: 45%; padding-left: 45%;
} }
#modal-search { #modal-search {
height: 40px; height: 40px;
position: relative; position: relative;
} }
#modal-search button { #modal-search button {
position: absolute; position: absolute;
right: 10px; right: 10px;
@@ -43,44 +48,50 @@
<span class="glyphicon glyphicon-search"></span> <span class="glyphicon glyphicon-search"></span>
</div> </div>
<table class="table table-responsive table-bordered"> <table class="table table-responsive table-bordered">
<input type="text" hidden="hidden" id="bank-uid" value=""> <input hidden="hidden" id="bank-uid" type="text" value="">
<thead> <thead>
<tr> <tr>
<td class="algin-right">银行名称</td><td><span id="bank-name">未选择</span></td> <td class="algin-right">银行名称</td>
<td><span id="bank-name">未选择</span></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td class="algin-right">开户名</td><td><span id="account-name">未选择</span></td> <td class="algin-right">开户名</td>
<td><span id="account-name">未选择</span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">卡号</td><td><span id="card-number">未选择</span></td> <td class="algin-right">卡号</td>
<td><span id="card-number">未选择</span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">开户卡类型</td> <td class="algin-right">开户卡类型</td>
<td> <td>
<input type="radio" name="card-type" value="private" checked>对私卡 <input checked name="card-type" type="radio" value="private">对私卡
<input type="radio" name="card-type" value="public">对公卡 <input name="card-type" type="radio" value="public">对公卡
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">开户行所在地</td><td><span id="bank-address">未选择</span></td> <td class="algin-right">开户行所在地</td>
<td><span id="bank-address">未选择</span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">开户人手机号码</td><td><span id="phone">未选择</span></td> <td class="algin-right">开户人手机号码</td>
<td><span id="phone">未选择</span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">下发金额</td><td><input type="text" value="" id="payfor-amount"><span></span></td> <td class="algin-right">下发金额</td>
<td><input id="payfor-amount" type="text" value=""><span></span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="panel-footer"> <div class="panel-footer">
<input type="button" class="btn btn-default" name="" id="" value="取消"> <input class="btn btn-default" id="" name="" type="button" value="取消">
<input type="button" class="btn btn-primary" value="提交" id="submit"> <input class="btn btn-primary" id="submit" type="button" value="提交">
</div> </div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div aria-labelledby="myModalLabel" class="modal fade" id="myModal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
@@ -88,9 +99,10 @@
<div class="menu-table table-responsive"> <div class="menu-table table-responsive">
<table> <table>
<div id="modal-search"> <div id="modal-search">
<input type="text" hidden="hidden" id="modal-search-hidden" value=""> <input hidden="hidden" id="modal-search-hidden" type="text" value="">
搜索:<input type="text" value="" id="modal-search-input" placeholder="名称"> 搜索:<input id="modal-search-input" placeholder="名称" type="text" value="">
<button type="button" class="btn btn-warning" data-dismiss="modal" id="cannel">取消</button> <button class="btn btn-warning" data-dismiss="modal" id="cannel" type="button">取消
</button>
</div> </div>
<thead class="thead-dark" id="table-head"> <thead class="thead-dark" id="table-head">
</thead> </thead>
@@ -110,10 +122,14 @@
</select> </select>
</li> </li>
<li class="current_total_page"><span class="current_page">0</span>/<span class="total_page">0</span></li> <li class="current_total_page"><span class="current_page">0</span>/<span
class="total_page">0</span>
</li>
<li class="pre_page">上一页</li> <li class="pre_page">上一页</li>
<li class="next_page">下一页</li> <li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" name="jump_page" value=""> <button type="button" class="btn btn-default">Go</button></li> <li class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div> </div>
</div> </div>
</div> </div>
@@ -127,51 +143,55 @@
let totalPage = $(".total_page").html(); let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val(); let jumpPage = $(".jump_page input").val();
return { return {
"displayCount":displayCount, "displayCount": displayCount,
"currentPage":currentPage, "currentPage": currentPage,
"totalPage":totalPage, "totalPage": totalPage,
"jumpPage":jumpPage "jumpPage": jumpPage
}; };
} }
function setOrderCutPageValues(res) { function setOrderCutPageValues(res) {
$(".current_page").html(res.CurrentPage); $(".current_page").html(res.CurrentPage);
$(".total_page").html(res.TotalPage); $(".total_page").html(res.TotalPage);
$("#display_count option").each(function() { $("#display_count option").each(function () {
if ($(this).text() == res.DisplayCount) { if ($(this).text() == res.DisplayCount) {
$(this).attr('selected', true); $(this).attr('selected', true);
} }
}); });
$(".jump_page input").val(""); $(".jump_page input").val("");
} }
function clearModal() { function clearModal() {
$("#table-head").html(""); $("#table-head").html("");
$("#table-body").html(""); $("#table-body").html("");
} }
function randBankCardList(res) { function randBankCardList(res) {
clearModal(); clearModal();
setOrderCutPageValues(res); setOrderCutPageValues(res);
let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "开户名" + "</th>" + "<th>" + "银行名称" + "</th>" + let head = "<tr>" + "<th>" + "序号" + "</th>" + "<th>" + "开户名" + "</th>" + "<th>" + "银行名称" + "</th>" +
"<th>" + "卡号" + "</th>" + "<th>" + "手机号码" + "</th>" + "<th>" + "选择" + "</th>"; "<th>" + "卡号" + "</th>" + "<th>" + "手机号码" + "</th>" + "<th>" + "选择" + "</th>";
$("#table-head").html(head); $("#table-head").html(head);
let str = ""; let str = "";
for (let i = 0; i < res.BankCardInfoList.length; i ++) { for (let i = 0; i < res.BankCardInfoList.length; i++) {
let v = res.BankCardInfoList[i]; let v = res.BankCardInfoList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankName + "</th>" + let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.BankName + "</th>" +
"<th>" + v.BankNo + "</th>" + "<th>" + v.PhoneNo + "</th>"; "<th>" + v.BankNo + "</th>" + "<th>" + v.PhoneNo + "</th>";
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' + tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<button type="button" value="' + v.Uid +'" class="btn btn-default" onclick="saveBankCard(this.value);">' + "确定" +'</button>'; '<button type="button" value="' + v.Uid + '" class="btn btn-default" onclick="saveBankCard(this.value);">' + "确定" + '</button>';
tmp = tmp + '</div>' + "</th>" + "</tr>"; tmp = tmp + '</div>' + "</th>" + "</tr>";
str = str + tmp; str = str + tmp;
} }
$("#table-body").html(str); $("#table-body").html(str);
$("#myModal").modal(); $("#myModal").modal();
} }
function saveBankCard(uid) { function saveBankCard(uid) {
$("#cannel").trigger('click'); $("#cannel").trigger('click');
$.ajax({ $.ajax({
url:"/get/oneBankCard", url: "/get/oneBankCard",
data: { data: {
"uid":uid "uid": uid
}, },
success: function (res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
@@ -191,6 +211,7 @@
} }
}); });
} }
$("#submit").click(function () { $("#submit").click(function () {
let bankUid = $("#bank-uid").val(); let bankUid = $("#bank-uid").val();
let bankName = $("#bank-name").html(); let bankName = $("#bank-name").html();
@@ -203,20 +224,20 @@
$.ajax({ $.ajax({
url: "/add/self/payfor", url: "/add/self/payfor",
data:{ data: {
"bankUid":bankUid, "bankUid": bankUid,
"bankName":bankName, "bankName": bankName,
"accountName":accountName, "accountName": accountName,
"bankNo":bankNo, "bankNo": bankNo,
"cardType":cardType, "cardType": cardType,
"bankAddress":bankAddress, "bankAddress": bankAddress,
"phone":phone, "phone": phone,
"payForAmount":payForAmount "payForAmount": payForAmount
}, },
success: function (res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else if (res.Code == -1){ } else if (res.Code == -1) {
alert(res.Msg); alert(res.Msg);
} else { } else {
alert("已经提交成功,请耐心等待结果"); alert("已经提交成功,请耐心等待结果");
@@ -229,13 +250,13 @@
}); });
}); });
//当每页显示数更改后,执行的操作 //当每页显示数更改后,执行的操作
$("#display_count").change(function() { $("#display_count").change(function () {
let dataJSON = getCutPagesValues(); let dataJSON = getCutPagesValues();
bankList(dataJSON); bankList(dataJSON);
}); });
//点击上一页的按钮 //点击上一页的按钮
$(".pre_page").click(function() { $(".pre_page").click(function () {
let dataJSON = getCutPagesValues(); let dataJSON = getCutPagesValues();
if (dataJSON["currentPage"] == 1) { if (dataJSON["currentPage"] == 1) {
@@ -245,7 +266,7 @@
bankList(dataJSON); bankList(dataJSON);
}); });
//点击下一页的按钮时 //点击下一页的按钮时
$(".next_page").click(function() { $(".next_page").click(function () {
let dataJSON = getCutPagesValues(); let dataJSON = getCutPagesValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) { if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return; return;
@@ -254,7 +275,7 @@
bankList(dataJSON); bankList(dataJSON);
}); });
//点击跳转那一页的按钮 //点击跳转那一页的按钮
$(".jump_page button").click(function() { $(".jump_page button").click(function () {
let dataJSON = getCutPagesValues(); let dataJSON = getCutPagesValues();
if (dataJSON["jumpPage"].length <= 0) { if (dataJSON["jumpPage"].length <= 0) {
@@ -262,19 +283,20 @@
} }
bankList(dataJSON); bankList(dataJSON);
}); });
function bankList(dataJSON) { function bankList(dataJSON) {
$.ajax({ $.ajax({
url: "/get/bankCard", url: "/get/bankCard",
data: dataJSON, data: dataJSON,
success: function(res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else { } else {
randBankCardList(res); randBankCardList(res);
} }
}, },
error:function() { error: function () {
alert("系统异常,请稍后再试"); alert("系统异常,请稍后再试");
} }
}); });

View File

@@ -3,9 +3,10 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>管理后台</title> <title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css"> <link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css"> <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"> <link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/filter.js"></script> <script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script> <script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script> <script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -17,6 +18,7 @@
font-weight: normal; font-weight: normal;
margin-right: 10px; margin-right: 10px;
} }
#select-self-name { #select-self-name {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
@@ -31,12 +33,12 @@
<div class="panel-body"> <div class="panel-body">
<label for=""> <label for="">
<span>操作账户:</span> <span>操作账户:</span>
<select name="" id="select-self-name"> <select id="select-self-name" name="">
</select> </select>
</label> </label>
<label for=""> <label for="">
<span>操作类型:</span> <span>操作类型:</span>
<select name="" id="select-self-type"> <select id="select-self-type" name="">
<option value="">请选择</option> <option value="">请选择</option>
<option value="plus_amount">加款</option> <option value="plus_amount">加款</option>
<option value="sub_amount">减款</option> <option value="sub_amount">减款</option>
@@ -46,9 +48,9 @@
</label> </label>
<label for=""> <label for="">
<span>操作金额:</span> <span>操作金额:</span>
<input type="text" id="select-self-amount" placeholder="单位:元"> <input id="select-self-amount" placeholder="单位:元" type="text">
</label> </label>
<input type="button" class="btn btn-primary" value="执行" onclick="selfOperateAccount();"> <input class="btn btn-primary" onclick="selfOperateAccount();" type="button" value="执行">
</div> </div>
</div> </div>
@@ -59,28 +61,35 @@
<div class="panel-body"> <div class="panel-body">
<table class="table table-responsive table-bordered"> <table class="table table-responsive table-bordered">
<thead> <thead>
<tr> <tr>
<td class="algin-right">结果</td><td><span id="operate-result">待处理......</span></td> <td class="algin-right">结果</td>
</tr> <td><span id="operate-result">待处理......</span></td>
</tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td class="algin-right">账户余额</td><td><span id="balance"> </span></td> <td class="algin-right">账户余额</td>
<td><span id="balance"> </span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">结算金额</td><td><span id="settle-amount"></span></td> <td class="algin-right">结算金额</td>
<td><span id="settle-amount"></span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">在途金额</td><td><span id="wait-amount"></span></td> <td class="algin-right">在途金额</td>
<td><span id="wait-amount"></span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">冻结金额</td><td><span id="freeze-amount"></span></td> <td class="algin-right">冻结金额</td>
<td><span id="freeze-amount"></span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">押款金额</td><td><span id="loan-amount"></span></td> <td class="algin-right">押款金额</td>
<td><span id="loan-amount"></span></td>
</tr> </tr>
<tr> <tr>
<td class="algin-right">代付中金额</td><td><span id="payfor-amount"></span></td> <td class="algin-right">代付中金额</td>
<td><span id="payfor-amount"></span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@@ -94,11 +103,12 @@
let amount = $("#select-self-amount").val(); let amount = $("#select-self-amount").val();
return { return {
"accountUid":accountUid, "accountUid": accountUid,
"accountOperator":accountOperator, "accountOperator": accountOperator,
"amount":amount "amount": amount
}; };
} }
function clearResult() { function clearResult() {
$("#operate-result").html("待处理......"); $("#operate-result").html("待处理......");
$("#balance").html(""); $("#balance").html("");
@@ -108,6 +118,7 @@
$("#loan-amount").html(""); $("#loan-amount").html("");
$("#payfor-amount").html(""); $("#payfor-amount").html("");
} }
function randResult(res) { function randResult(res) {
let account = res.AccountList[0]; let account = res.AccountList[0];
$("#operate-result").html(res.Msg); $("#operate-result").html(res.Msg);
@@ -118,11 +129,12 @@
$("#loan-amount").html(account.LoanAmount); $("#loan-amount").html(account.LoanAmount);
$("#payfor-amount").html(account.PayforAmount); $("#payfor-amount").html(account.PayforAmount);
} }
function selfOperateAccount() { function selfOperateAccount() {
clearResult(); clearResult();
let dataJSON = getValues(); let dataJSON = getValues();
$.ajax({ $.ajax({
url:"/account/operator", url: "/account/operator",
data: dataJSON, data: dataJSON,
success: function (res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
@@ -139,10 +151,11 @@
} }
}); });
} }
function getAccount() { function getAccount() {
let dataJSON = getValues(); let dataJSON = getValues();
$.ajax({ $.ajax({
url:"/get/one/account", url: "/get/one/account",
data: dataJSON, data: dataJSON,
success: function (res) { success: function (res) {
if (res.Code == 404) { if (res.Code == 404) {
@@ -158,6 +171,7 @@
} }
}); });
} }
$("#select-self-name").change(function () { $("#select-self-name").change(function () {
clearResult(); clearResult();
let accountUid = $("#select-self-name").val(); let accountUid = $("#select-self-name").val();
@@ -169,6 +183,7 @@
$("#select-self-type").click(function () { $("#select-self-type").click(function () {
// clearResult(); // clearResult();
}); });
function setAccount() { function setAccount() {
$.ajax({ $.ajax({
url: "/get/all/account", url: "/get/all/account",
@@ -177,7 +192,7 @@
window.parent.location = "/login.html"; window.parent.location = "/login.html";
} else { } else {
let str = '<option value="' + "" + '">' + "请选择" + '</option>'; let str = '<option value="' + "" + '">' + "请选择" + '</option>';
for (let i = 0; i < res.AccountList.length; i ++) { for (let i = 0; i < res.AccountList.length; i++) {
let account = res.AccountList[i]; let account = res.AccountList[i];
str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>'; str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>';
} }
@@ -186,6 +201,7 @@
} }
}); });
} }
$(function () { $(function () {
setAccount(); setAccount();
}); });

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh">
<body>
<iframe src="">
</iframe>
</body>
<style>
iframe {
width: 100%;
height: 90vh;
}
</style>
<script>
// 构建链接
const url = "{{.portalHost}}" + "/iframe/tMallGameAccount?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="zh">
<body>
<iframe src="">
</iframe>
</body>
<style>
iframe {
width: 100%;
height: 90vh;
}
</style>
<script>
// 构建链接
const url = "{{.portalHost}}" + "/iframe/tMallGameOrder?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>