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

View File

@@ -4,7 +4,7 @@ FROM golang:1.22 AS builder
ARG USE_PROXY
WORKDIR /build
COPY ./ /build/
COPY .. /build/
# 根据USE_PROXY参数设置环境变量
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/views/ /app/views/
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

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:
kami_boss:
build:
context: ..
dockerfile: ./deploy/Dockerfile
args:
- USE_PROXY=1
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{
"KF": "快付支付",
"WEIXIN": "官方微信",
"ALIPAY": "官方支付宝",
"DAILI": "代丽支付",
"APPLE": "苹果充值卡",
"MF178": "蜜蜂178卡密",
//"KF": "快付支付",
//"WEIXIN": "官方微信",
//"ALIPAY": "官方支付宝",
//"DAILI": "代丽支付",
"APPLE": "苹果充值卡",
"MF178": "蜜蜂178卡密",
"TMALLGAME": "天猫游戏充值",
}
func GetSupplierMap() map[string]string {

View File

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

View File

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

View File

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

View File

@@ -105,6 +105,42 @@ func (c *PageAuthController) RechargeAppleAccountPage() {
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() {
token := ""
// 获取当前时间的时间戳

View File

@@ -1,14 +1,5 @@
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 (
"boss/internal/service"
"github.com/beego/beego/v2/server/web"

View File

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

View File

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

View File

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

View File

@@ -1,14 +1,4 @@
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 {
}

View File

@@ -1,24 +1,14 @@
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 (
accounts2 "boss/internal/models/accounts"
"boss/internal/models/accounts"
"boss/internal/models/agent"
merchant2 "boss/internal/models/merchant"
"boss/internal/models/merchant"
"boss/internal/models/notify"
order2 "boss/internal/models/order"
"boss/internal/models/order"
"boss/internal/models/payfor"
road2 "boss/internal/models/road"
system2 "boss/internal/models/system"
"boss/internal/models/road"
"boss/internal/models/system"
"boss/internal/models/user"
"fmt"
"github.com/beego/beego/v2/client/orm"
@@ -42,23 +32,23 @@ func init() {
_ = orm.RegisterDataBase("default", "mysql", link)
orm.RegisterModel(
new(user.UserInfo),
new(system2.MenuInfo),
new(system2.SecondMenuInfo),
new(system2.PowerInfo),
new(system2.RoleInfo),
new(system2.BankCardInfo),
new(road2.RoadInfo),
new(road2.RoadPoolInfo),
new(system.MenuInfo),
new(system.SecondMenuInfo),
new(system.PowerInfo),
new(system.RoleInfo),
new(system.BankCardInfo),
new(road.RoadInfo),
new(road.RoadPoolInfo),
new(agent.AgentInfo),
new(merchant2.MerchantInfo),
new(merchant2.MerchantDeployInfo),
new(accounts2.AccountInfo),
new(accounts2.AccountHistoryInfo),
new(order2.OrderInfo),
new(order2.OrderProfitInfo),
new(order2.OrderSettleInfo),
new(merchant.MerchantInfo),
new(merchant.MerchantDeployInfo),
new(accounts.AccountInfo),
new(accounts.AccountHistoryInfo),
new(order.OrderInfo),
new(order.OrderProfitInfo),
new(order.OrderSettleInfo),
new(notify.NotifyInfo),
new(merchant2.MerchantLoadInfo),
new(merchant.MerchantLoadInfo),
new(payfor.PayforInfo),
)
}

View File

@@ -1,15 +1,5 @@
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 (
"encoding/json"
"fmt"

View File

@@ -1,15 +1,5 @@
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 (
"github.com/beego/beego/v2/client/orm"
"github.com/beego/beego/v2/core/logs"

View File

@@ -1,15 +1,5 @@
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 (
"fmt"
"strconv"
@@ -143,7 +133,7 @@ func GetAllOrderByMap(params map[string]string) []OrderInfo {
// GetToDayInfo 获得今日数据
func GetToDayInfo() string {
var params map[string]string = map[string]string{}
var params = map[string]string{}
//params["create_time__gte"] = startTime
//params["create_time__lte"] = endTime
o := orm.NewOrm()

View File

@@ -2,7 +2,7 @@ package models
import (
"boss/internal/common"
accounts2 "boss/internal/models/accounts"
"boss/internal/models/accounts"
"context"
"errors"
"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 {
//处理事务
accountInfo := new(accounts2.AccountInfo)
accountInfo := new(accounts.AccountInfo)
if err := txOrm.Raw("select * from account_info where account_uid = ? for update", accountUid).
QueryRow(accountInfo); err != nil || accountInfo.AccountUid == "" {
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
}
//往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()}
if _, err := txOrm.Insert(&accountHistory); err != nil {

View File

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

View File

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

View File

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

View File

@@ -5,8 +5,8 @@ import (
"boss/internal/models/accounts"
"boss/internal/models/agent"
"boss/internal/models/merchant"
road2 "boss/internal/models/road"
system2 "boss/internal/models/system"
"boss/internal/models/road"
"boss/internal/models/system"
"boss/internal/models/user"
"github.com/beego/beego/v2/core/logs"
"sort"
@@ -24,27 +24,27 @@ func (c *DeleteService) Finish() {
remainderSecondMenu := make([]string, 0)
remainderPowerId := make([]string, 0)
remainderPower := make([]string, 0)
allRoleInfo := system2.GetRole()
allRoleInfo := system.GetRole()
//如果有删除任何的东西,需要重新赋值权限
for _, r := range allRoleInfo {
for _, showFirstUid := range strings.Split(r.ShowFirstUid, "||") {
if system2.FirstMenuUidIsExists(showFirstUid) {
if system.FirstMenuUidIsExists(showFirstUid) {
remainderFirstMenuUid = append(remainderFirstMenuUid, showFirstUid)
menuInfo := system2.GetMenuInfoByMenuUid(showFirstUid)
menuInfo := system.GetMenuInfoByMenuUid(showFirstUid)
remainderFirstMenu = append(remainderFirstMenu, menuInfo.FirstMenu)
}
}
for _, showSecondUid := range strings.Split(r.ShowSecondUid, "||") {
if system2.SecondMenuUidIsExists(showSecondUid) {
if system.SecondMenuUidIsExists(showSecondUid) {
remainderSecondMenuUid = append(remainderSecondMenuUid, showSecondUid)
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(showSecondUid)
secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(showSecondUid)
remainderSecondMenu = append(remainderSecondMenu, secondMenuInfo.SecondMenu)
}
}
for _, showPowerId := range strings.Split(r.ShowPowerUid, "||") {
if system2.PowerUidExists(showPowerId) {
if system.PowerUidExists(showPowerId) {
remainderPowerId = append(remainderPowerId, showPowerId)
powerInfo := system2.GetPowerById(showPowerId)
powerInfo := system.GetPowerById(showPowerId)
remainderPower = append(remainderPower, powerInfo.PowerItem)
}
}
@@ -55,22 +55,22 @@ func (c *DeleteService) Finish() {
r.ShowPowerUid = strings.Join(remainderPowerId, "||")
r.ShowPower = strings.Join(remainderPower, "||")
r.UpdateTime = time.Now()
system2.UpdateRoleInfo(r)
system.UpdateRoleInfo(r)
}
}
func (c *DeleteService) DeleteMenu(menuUid, userID string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON)
menuInfo := system2.GetMenuInfoByMenuUid(menuUid)
menuInfo := system.GetMenuInfoByMenuUid(menuUid)
if menuInfo.MenuUid == "" {
dataJSON.Msg = "不存在该菜单"
dataJSON.Code = -1
} else {
logs.Info(userID + ",执行了删除一级菜单操作")
system2.DeleteMenuInfo(menuUid)
system.DeleteMenuInfo(menuUid)
//删除该一级目下下的所有二级目录
system2.DeleteSecondMenuByFirstMenuUid(menuUid)
system.DeleteSecondMenuByFirstMenuUid(menuUid)
SortFirstMenuOrder()
dataJSON.Code = 200
}
@@ -79,27 +79,27 @@ func (c *DeleteService) DeleteMenu(menuUid, userID string) *datas.BaseDataJSON {
}
func (c *DeleteService) DeleteSecondMenu(secondMenuUid string) *datas.BaseDataJSON {
secondMenuInfo := system2.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
secondMenuInfo := system.GetSecondMenuInfoBySecondMenuUid(secondMenuUid)
dataJSON := new(datas.BaseDataJSON)
if secondMenuUid == "" || secondMenuInfo.SecondMenuUid == "" {
dataJSON.Code = -1
dataJSON.Msg = "该二级菜单不存在"
} else {
if system2.DeleteSecondMenuBySecondMenuUid(secondMenuUid) {
if system.DeleteSecondMenuBySecondMenuUid(secondMenuUid) {
dataJSON.Code = 200
ml := system2.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid)
ml := system.GetSecondMenuLenByFirstMenuUid(secondMenuInfo.FirstMenuUid)
//删除该二级页面下的所有权限项
system2.DeletePowerBySecondUid(secondMenuUid)
system.DeletePowerBySecondUid(secondMenuUid)
if ml == 0 {
//如果该二级类目已经被全部删除,那么对应的一级类目也应当删除
system2.DeleteMenuInfo(secondMenuInfo.FirstMenuUid)
system.DeleteMenuInfo(secondMenuInfo.FirstMenuUid)
SortFirstMenuOrder()
} else {
secondMenuInfoList := system2.GetSecondMenuListByFirstMenuUid(secondMenuInfo.FirstMenuUid)
sort.Sort(system2.SecondMenuSlice(secondMenuInfoList))
secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(secondMenuInfo.FirstMenuUid)
sort.Sort(system.SecondMenuSlice(secondMenuInfoList))
for i := 0; i < len(secondMenuInfoList); i++ {
m := secondMenuInfoList[i]
system2.UpdateSecondMenuOrderBySecondUid(m.SecondMenuUid, i+1)
system.UpdateSecondMenuOrderBySecondUid(m.SecondMenuUid, i+1)
}
}
} else {
@@ -111,7 +111,7 @@ func (c *DeleteService) DeleteSecondMenu(secondMenuUid string) *datas.BaseDataJS
}
func (c *DeleteService) DeletePowerItem(powerID string) *datas.BaseDataJSON {
system2.DeletePowerItemByPowerID(powerID)
system.DeletePowerItemByPowerID(powerID)
dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = 200
return dataJSON
@@ -120,7 +120,7 @@ func (c *DeleteService) DeletePowerItem(powerID string) *datas.BaseDataJSON {
func (c *DeleteService) DeleteRole(roleUid string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON)
if system2.DeleteRoleByRoleUid(roleUid) {
if system.DeleteRoleByRoleUid(roleUid) {
dataJSON.Code = 200
} else {
dataJSON.Code = -1
@@ -145,7 +145,7 @@ func (c *DeleteService) DeleteBankCardRecord(uid string) *datas.BankCardDataJSON
dataJSON := new(datas.BankCardDataJSON)
dataJSON.Code = -1
if system2.DeleteBankCardByUid(uid) {
if system.DeleteBankCardByUid(uid) {
dataJSON.Code = 200
}
return dataJSON
@@ -156,11 +156,11 @@ func (c *DeleteService) DeleteRoad(roadUid string) *datas.BaseDataJSON {
dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1
if road2.DeleteRoadByRoadUid(roadUid) {
if road.DeleteRoadByRoadUid(roadUid) {
dataJSON.Code = 200
}
params := make(map[string]string)
roadPoolInfoList := road2.GetAllRollPool(params)
roadPoolInfoList := road.GetAllRollPool(params)
//将轮询池中的对应的通道删除
for _, roadPoolInfo := range roadPoolInfoList {
var uids []string
@@ -172,7 +172,7 @@ func (c *DeleteService) DeleteRoad(roadUid string) *datas.BaseDataJSON {
}
roadPoolInfo.RoadUidPool = strings.Join(uids, "||")
roadPoolInfo.UpdateTime = time.Now()
road2.UpdateRoadPool(roadPoolInfo)
road.UpdateRoadPool(roadPoolInfo)
}
return dataJSON
}
@@ -181,7 +181,7 @@ func (c *DeleteService) DeleteRoadPool(roadPoolCode string) *datas.BaseDataJSON
dataJSON := new(datas.BaseDataJSON)
dataJSON.Code = -1
if road2.DeleteRoadPoolByCode(roadPoolCode) {
if road.DeleteRoadPoolByCode(roadPoolCode) {
dataJSON.Code = 200
} else {
dataJSON.Msg = "删除通道池失败"
@@ -264,14 +264,14 @@ func (c *DeleteService) DeleteAgentRelation(merchantUid string) *datas.KeyDataJS
* 对一级菜单重新进行排序
*/
func SortFirstMenuOrder() {
menuInfoList := system2.GetMenuAll()
sort.Sort(system2.MenuInfoSlice(menuInfoList))
menuInfoList := system.GetMenuAll()
sort.Sort(system.MenuInfoSlice(menuInfoList))
for i := 0; i < len(menuInfoList); i++ {
m := menuInfoList[i]
m.UpdateTime = time.Now()
m.MenuOrder = i + 1
system2.UpdateMenuInfo(m)
system.UpdateMenuInfo(m)
//对应的二级菜单也应该重新分配顺序号
SortSecondMenuOrder(m)
}
@@ -280,13 +280,13 @@ func SortFirstMenuOrder() {
/*
* 对二级菜单分配顺序号
*/
func SortSecondMenuOrder(firstMenuInfo system2.MenuInfo) {
secondMenuInfoList := system2.GetSecondMenuListByFirstMenuUid(firstMenuInfo.MenuUid)
func SortSecondMenuOrder(firstMenuInfo system.MenuInfo) {
secondMenuInfoList := system.GetSecondMenuListByFirstMenuUid(firstMenuInfo.MenuUid)
for _, sm := range secondMenuInfoList {
sm.FirstMenuOrder = firstMenuInfo.MenuOrder
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 (
"boss/internal/common"
"boss/internal/datas"
order2 "boss/internal/models/order"
"boss/internal/models/order"
"boss/internal/models/payfor"
"boss/internal/models/road"
"boss/internal/models/user"
@@ -21,7 +21,7 @@ type QueryService struct {
}
func OrderQuery(bankOrderId string) string {
orderInfo := order2.GetOrderByBankOrderId(bankOrderId)
orderInfo := order.GetOrderByBankOrderId(bankOrderId)
if orderInfo.BankOrderId == "" || len(orderInfo.BankOrderId) == 0 {
logs.Error("不存在这样的订单,订单查询结束")
return "不存在这样的订单"
@@ -47,7 +47,7 @@ func OrderQuery(bankOrderId string) string {
func (c *QueryService) SupplierOrderQuery(bankOrderId string) *datas.KeyDataJSON {
keyDataJSON := new(datas.KeyDataJSON)
keyDataJSON.Code = 200
exist := order2.BankOrderIdIsExist(bankOrderId)
exist := order.BankOrderIdIsExist(bankOrderId)
if !exist {
keyDataJSON.Msg = "该订单不存在"
keyDataJSON.Code = -1
@@ -97,13 +97,13 @@ func querySupplierPayForResult(bankOrderId string) bool {
}
}
func QueryTotalSummary(params map[string]string) order2.Summary {
orderInfoList := order2.GetOrderByMap(params, -1, 0)
func QueryTotalSummary(params map[string]string) order.Summary {
orderInfoList := order.GetOrderByMap(params, -1, 0)
bankIdList := make([]string, 0)
for _, info := range orderInfoList {
bankIdList = append(bankIdList, info.BankOrderId)
}
orderProfitList := order2.GetOrderProfitListByBankOrderIdList(bankIdList)
orderProfitList := order.GetOrderProfitListByBankOrderIdList(bankIdList)
supplierAll := 0.0
platformAll := 0.0
agentAll := 0.0
@@ -129,7 +129,7 @@ func QueryTotalSummary(params map[string]string) order2.Summary {
} else {
succeedRate = 0
}
return order2.Summary{
return order.Summary{
TotalNum: totalNum,
TotalAmount: math.Round(allAmount*100) / 100,
PaidNum: succeedNum,
@@ -139,11 +139,11 @@ func QueryTotalSummary(params map[string]string) order2.Summary {
}
}
func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) order2.Summary {
orderProfitInfoList := make([]order2.OrderProfitInfo, 0)
func QuerySummaryByOrderInfo(infoInfoList []order.OrderInfo) order.Summary {
orderProfitInfoList := make([]order.OrderProfitInfo, 0)
for _, info := range infoInfoList {
orderProfitInfoList = append(orderProfitInfoList, order2.GetOrderProfitByBankOrderId(info.BankOrderId))
orderProfitInfoList = append(orderProfitInfoList, order.GetOrderProfitByBankOrderId(info.BankOrderId))
}
totalNum := 0
@@ -175,7 +175,7 @@ func QuerySummaryByOrderInfo(infoInfoList []order2.OrderInfo) order2.Summary {
succeedRate = 0
}
return order2.Summary{
return order.Summary{
TotalNum: totalNum,
TotalAmount: math.Round(todayAllAmount*100) / 100,
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()
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())
@@ -217,13 +217,13 @@ func QueryTodaySummary(params map[string]string) order2.Summary {
} else {
paramsProfit["create_time__lte"] = end
}
orderInfoList := order2.GetOrderByMap(paramsProfit, -1, 0)
orderInfoList := order.GetOrderByMap(paramsProfit, -1, 0)
bankIdList := make([]string, 0)
for _, info := range orderInfoList {
bankIdList = append(bankIdList, info.BankOrderId)
}
dataInfo := order2.GetOrderProfitListByBankOrderIdList(bankIdList)
dataInfo := order.GetOrderProfitListByBankOrderIdList(bankIdList)
totalNum := 0
todaySuccessNum := 0
todayAllAmount := 0.0
@@ -247,7 +247,7 @@ func QueryTodaySummary(params map[string]string) order2.Summary {
if totalNum != 0 {
succeedRate = math.Round(float64(todaySuccessNum)/float64(totalNum)*100*100) / 100
}
return order2.Summary{
return order.Summary{
TotalNum: totalNum,
TotalAmount: math.Round(todayAllAmount*100) / 100,
PaidNum: todaySuccessNum,

View File

@@ -2,7 +2,7 @@ package service
import (
"boss/internal/common"
order2 "boss/internal/models/order"
"boss/internal/models/order"
"math"
"time"
)
@@ -10,13 +10,13 @@ import (
type OrderSummary struct {
}
func (s *OrderSummary) GetTodaySummary() (todaySummary order2.Summary) {
todaySummary = order2.Summary{}
func (s *OrderSummary) GetTodaySummary() (todaySummary order.Summary) {
todaySummary = order.Summary{}
now := time.Now()
// 获取今日零点
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 {
return
@@ -38,7 +38,7 @@ func (s *OrderSummary) GetTodaySummary() (todaySummary order2.Summary) {
}
todaySummary = order2.Summary{
todaySummary = order.Summary{
TotalNum: len(orderList),
TotalAmount: math.Round(amount*100) / 100,
PaidNum: paidNum,

View File

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

View File

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

View File

@@ -5,7 +5,7 @@
<head>
<meta charset="utf-8">
<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>
<style type="text/css">
.explain {
@@ -23,152 +23,153 @@
</head>
<body>
<div class="account-record">
<div class="search">
<div>
商户名称:
<input type="text" id="account-name">
</div>
<div>
商户编号:
<input type="text" id="account-no">
</div>
<div>
<button type="button" class="btn btn-default" id="account-search">搜索</button>
</div>
<div class="account-record">
<div class="search">
<div>
商户名称:
<input id="account-name" type="text">
</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>
<span class="explain" style="color: red;">
<span class="explain" style="color: red;">
待结算金额:用户充值后,还没有加到可结算金中。
</span>
<span class="explain" style="color: red;">
<span class="explain" style="color: red;">
结算金额: 可以提现的金额 = (账户余额 - 待结算金额 - 押款金额 - 冻结金额 - 正在出款金额)
</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 class="modal fade" id="account-solve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<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" id="account-uid-edit" hidden>
<div style="display: flex">
<div>
<label>
操作:
<select value="" id="account-edit-operator">
<option value="plus_amount">加款</option>
<option value="sub_amount">减款</option>
</select>
</label>
</div>
<div>
<label>
<input type="text" value="" id="account-edit-operator-amount" placeholder="请输入增加(减少)金额">
</label>
</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>
<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 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>
<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>
</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 class="modal-footer">
<button type="button" class="btn btn-default account-edit-save">确定</button>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">取消</button>
<div>
<label>
二次验证:
<input id="order-info-totp" type="text" value="">
</label>
</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 class="modal fade" id="delete-solve" tabindex="-1" role="dialog" aria-labelledby="myModalDeleteLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
<div aria-labelledby="myModalDeleteLabel" class="modal fade" id="delete-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-delete" type="text">
<div>
<label>
二次验证:
<input id="order-info-delete-totp" type="text" value="">
</label>
</div>
<div class="modal-body modal-body-order-solve">
<input type="text" id="account-uid-delete" hidden>
<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>
<p class="error-msg" style="color: red"></p>
</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>
</body>
<script>
function getAccountCutPageValues() {

View File

@@ -2,54 +2,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script src="../static/js/filter.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-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../static/js/basic.js"></script>
<style>
#account-history-table-body tr {
height: 30px;
}
<meta charset="utf-8">
<title>后台管理</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/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/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../static/js/basic.js"></script>
<style>
#account-history-table-body tr {
height: 30px;
}
.account-history-record .search {
margin: 0;
padding: 0;
}
.search label {
font-weight: normal;
margin-top: 10px;
margin-bottom: 10px;
margin-right: 20px;
}
.search label select {
height: 30px;
}
</style>
</style>
</head>
<body>
<div class="account-history-record">
<div class="search">
<div class="search">
<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 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 for="">
账户名称:
<input type="text" id="account-history-name" value="">
<input id="account-history-name" type="text" value="">
</label>
<label for="">
账户编号:
<input type="text" id="account-history-no" value="">
<input id="account-history-no" type="text" value="">
</label>
<label for="">
动账类型:
@@ -62,157 +66,162 @@
</select>
</label>
<button type="button" class="btn btn-primary" id="account-history-search">搜索</button>
</div>
<button class="btn btn-primary" id="account-history-search" type="button">搜索</button>
</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="account-history-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>
<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="account-history-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>
<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>
<script>
function getAccountHistoryCutPageValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let accountHistoryName = $("#account-history-name").val();
let accountHistoryNo = $("#account-history-no").val();
let operatorType = $("#account-history-type").val();
let startTime = $("#account-history-start-time").val();
let endTime = $("#account-history-end-time").val();
function getAccountHistoryCutPageValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let accountHistoryName = $("#account-history-name").val();
let accountHistoryNo = $("#account-history-no").val();
let operatorType = $("#account-history-type").val();
let startTime = $("#account-history-start-time").val();
let endTime = $("#account-history-end-time").val();
return {
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"accountHistoryName":accountHistoryName,
"accountHistoryNo":accountHistoryNo,
"operatorType":operatorType,
"startTime":startTime,
"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("");
}
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"accountHistoryName": accountHistoryName,
"accountHistoryNo": accountHistoryNo,
"operatorType": operatorType,
"startTime": startTime,
"endTime": endTime
};
}
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);
let str = "";
for (let i = 0; i < res.AccountHistoryList.length; i ++) {
let v = res.AccountHistoryList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex+i+1) + "</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>";
tmp = tmp.replace("plus_amount", "加款").replace("sub_amount", "减款").replace("unfreeze_amount", "解冻").replace("freeze_amount", "冻结");
str = str + tmp;
}
let str = "";
for (let i = 0; i < res.AccountHistoryList.length; i++) {
let v = res.AccountHistoryList[i];
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</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>";
tmp = tmp.replace("plus_amount", "加款").replace("sub_amount", "减款").replace("unfreeze_amount", "解冻").replace("freeze_amount", "冻结");
str = str + tmp;
}
$("#account-history-table-body").html(str);
}
function ajaxAccountHistoryList(dataJSON) {
$.ajax({
url:"/get/account/history",
data: dataJSON,
$("#account-history-table-body").html(str);
}
success: function(res) {
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) {
$.ajax({
url: "/get/account/history",
data: dataJSON,
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getAccountHistoryCutPageValues();
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("获取账户数据列表失败");
} else {
showAccountHistoryList(res);
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
}
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
ajaxAccountHistoryList(dataJSON);
});
$("#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() {
let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxAccountHistoryList(dataJSON);
$(".next_page").click(function () {
let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
ajaxAccountHistoryList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getAccountHistoryCutPageValues();
$(".jump_page button").click(function () {
let dataJSON = getAccountHistoryCutPageValues();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
ajaxAccountHistoryList(dataJSON);
if (dataJSON["jumpPage"].length <= 0) {
return;
}
ajaxAccountHistoryList(dataJSON);
});
$(function() {
let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$(".start-time").val(s);
ajaxAccountHistoryList(getAccountHistoryCutPageValues());
$(function () {
let day = new Date(new Date().getTime() - 86400000);
let s = dateFtt("yyyy-MM-dd hh:mm:ss", day);
$(".start-time").val(s);
ajaxAccountHistoryList(getAccountHistoryCutPageValues());
});
</script>
</body>

View File

@@ -3,9 +3,10 @@
<head>
<meta charset="UTF-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../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/css/basic.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/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/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -16,9 +17,11 @@
.search label {
font-weight: normal;
}
#select-agent-name,#select-merchant-name {
#select-agent-name, #select-merchant-name {
margin-right: 20px;
}
.search label select {
height: 30px;
line-height: 30px;
@@ -26,175 +29,180 @@
</style>
</head>
<body>
<div class="search">
<label for="">
代理名称:
<select name="" id="select-agent-name"></select>
</label>
<label for="">
商户名称:
<select name="" id="select-merchant-name"></select>
</label>
<input type="button" class="btn btn-primary" value="开始" onclick="search(getValues());">
</div>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>代理名称</th>
<th>代理uid</th>
<th>代理商户名</th>
<th>代理商户uid</th>
<th>操作</th>
</tr>
</thead>
<tbody id="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>
<div class="search">
<label for="">
代理名称:
<select id="select-agent-name" name=""></select>
</label>
<label for="">
商户名称:
<select id="select-merchant-name" name=""></select>
</label>
<input class="btn btn-primary" onclick="search(getValues());" type="button" value="开始">
</div>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>代理名称</th>
<th>代理uid</th>
<th>代理商户名</th>
<th>代理商户uid</th>
<th>操作</th>
</tr>
</thead>
<tbody id="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>
<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>
<script>
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getValues();
search(dataJSON);
});
<script>
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getValues();
search(dataJSON);
});
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getValues();
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getValues();
if (dataJSON["currentPage"] == 1) {
return;
if (dataJSON["currentPage"] == 1) {
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);
});
//点击下一页的按钮时
$(".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();
$(".jump_page input").val("");
}
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 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;
}
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);
$("#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());
}
});
$(".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>
</html>

View File

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

View File

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

View File

@@ -2,468 +2,488 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script>
<style>
.add-bank-card, .bank-card-record {
overflow-x: hidden;
}
fieldset {
margin-top: 10px;
}
legend {
width: 60px;
}
fieldset div {
margin-bottom: 20px;
}
fieldset div span {
display: inline-block;
width: 120px;
}
#certificate-type {
height: 30px;
}
.bank-card-footer {
height: 40px;
width: 100%
background-color: white;
/* border: 1px solid #e7e7e7; */
margin-top: 10px;
}
.bank-card-footer span {
display: inline-block;
text-align: center;
background-color: #e7e7e7;
border-radius: 4px;
height: 40px;
width: 60px;
line-height: 40px;
margin-left: 20px;
}
.bank-card-footer span:hover {
background-color: red;
cursor: pointer;
}
.add-card-button {
margin-bottom: 10px;
}
.bank-card-search {
border-bottom: 1px solid #e7e7e7;
margin-bottom: 10px;
margin-top: 10px;
padding-bottom: 10px;
}
.account-name-search {
margin-right: 10px;
}
</style>
<meta charset="utf-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script>
<style>
.add-bank-card, .bank-card-record {
overflow-x: hidden;
}
fieldset {
margin-top: 10px;
}
legend {
width: 60px;
}
fieldset div {
margin-bottom: 20px;
}
fieldset div span {
display: inline-block;
width: 120px;
}
#certificate-type {
height: 30px;
}
.bank-card-footer {
height: 40px;
width: 100%
background-color: white;
/* border: 1px solid #e7e7e7; */
margin-top: 10px;
}
.bank-card-footer span {
display: inline-block;
text-align: center;
background-color: #e7e7e7;
border-radius: 4px;
height: 40px;
width: 60px;
line-height: 40px;
margin-left: 20px;
}
.bank-card-footer span:hover {
background-color: red;
cursor: pointer;
}
.add-card-button {
margin-bottom: 10px;
}
.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>
<body>
<div class="bank-card-record">
<div class="row bank-card-search">
<div class="col-md-4">
<span>开户名:</span>
<input type="text" value="" class="account-name-search" placeholder="模糊匹配">
<button class="btn btn-info bank-card-button">搜索</button>
</div>
</div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-card-button">添加银行卡</button>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>商户名称(UID)</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="bank_card_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>
<div class="bank-card-record">
<div class="row bank-card-search">
<div class="col-md-4">
<span>开户名:</span>
<input class="account-name-search" placeholder="模糊匹配" type="text" value="">
<button class="btn btn-info bank-card-button">搜索</button>
</div>
</div>
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-card-button" type="button">添加银行卡</button>
<div class="menu-table">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>商户名称(UID)</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="bank_card_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>
<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 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="add-bank-card">
<fieldset>
<legend>添加银行卡</legend>
<div class="row">
<div class="col-md-4">
<input class="bank-card-uid" type="hidden" value="">
<div>
<span>商户名称:</span>
<select class="user-name" id="select-self-name" name="">
</select>
</div>
<div>
<span>银行编码:</span>
<input class="bank-code" type="text" value="">
</div>
<div>
<span>银行开户名:</span>
<input class="account-name" type="text" value="">
</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>
<div class="col-md-4">
<div>
<span>银行名称:</span>
<input type="text" value="" placeholder="" class="bank-name">
</div>
<div>
<span>银行账户类型</span>
<select id="bank-account-type">
<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>
<div class="col-md-4">
<div>
<span>银行名称:</span>
<input class="bank-name" placeholder="" type="text" value="">
</div>
<div>
<span>银行账户类型</span>
<select id="bank-account-type">
<option value="private">对私</option>
<option value="public">对公</option>
</select>
</div>
<div>
<span>银行卡账号:</span>
<input class="bank-no" placeholder="" type="text">
</div>
<div>
<span>证件号:</span>
<input class="certificate-no" placeholder="" type="text" value="">
</div>
<div>
<span>开户行详细地址:</span>
<input class="bank-address" placeholder="" type="text" value="">
</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>
function getCutPageval() {
let operatorName = $(".operator-name").val();
let displayCount = $("#display_count").val();
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 editBankCard(uid) {
$.ajax({
url: "/get/oneBankCard",
data: {"uid":uid},
<script>
function getCutPageval() {
let operatorName = $(".operator-name").val();
let displayCount = $("#display_count").val();
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
};
}
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.BankCardInfoList.length == 0){
alert("编辑失败");
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');
}
});
function editBankCard(uid) {
$.ajax({
url: "/get/oneBankCard",
data: {"uid": uid},
$(".bank-card-record").hide();
$(".add-bank-card").show();
}
}
});
}
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.BankCardInfoList.length == 0) {
alert("编辑失败");
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');
}
});
$(".bank-card-button").click(function() {
let dataJSON = getCutPageval();
let accountNameSearch = $(".account-name-search").val();
dataJSON["accountNameSearch"] = accountNameSearch;
showBankCradRecord(dataJSON);
});
$(".bank-card-record").hide();
$(".add-bank-card").show();
}
}
});
}
function deleteBankCard(uid) {
$.ajax({
url: "/delete/bankCardRecord",
data: {"uid":uid},
$(".bank-card-button").click(function () {
let dataJSON = getCutPageval();
let accountNameSearch = $(".account-name-search").val();
dataJSON["accountNameSearch"] = accountNameSearch;
showBankCradRecord(dataJSON);
});
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200){
alert("删除成功");
showBankCradRecord(getBankCardData());
}
},
function deleteBankCard(uid) {
$.ajax({
url: "/delete/bankCardRecord",
data: {"uid": uid},
error: function() {
alert("系统异常,请稍后再试");
}
});
}
function showBankCradRecord(dataJSON) {
// let dataJSON = getBankCardData();
$.ajax({
url: "/get/bankCard",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200) {
alert("删除成功");
showBankCradRecord(getBankCardData());
}
},
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
} else {
$(".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>";
error: function () {
alert("系统异常,请稍后再试");
}
});
}
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<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;
}
function showBankCradRecord(dataJSON) {
// let dataJSON = getBankCardData();
$.ajax({
url: "/get/bankCard",
data: dataJSON,
$("#bank_card_table_body").html(str);
}
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
} else {
$(".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>";
error: function() {
alert("系统异常,请稍后再试");
}
});
}
$(function() {
$(".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();
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
'<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;
}
return {
"uid":uid,
"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);
});
$("#bank_card_table_body").html(str);
}
},
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getCutPageval();
error: function () {
alert("系统异常,请稍后再试");
}
});
}
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showBankCradRecord(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPageval();
$(function () {
$(".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();
});
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
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("");
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
showBankCradRecord(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPageval();
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();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
showBankCradRecord(dataJSON);
});
return {
"uid": uid,
"userName": userName,
"bankCode": bankCode,
"accountName": accountName,
"certificateType": certificateType,
"phoneNo": phoneNo,
"bankName": bankName,
"bankAccountType": bankAccountType,
"bankNo": bankNo,
"identifyCard": identifyCard,
"certificateNo": certificateNo,
"bankAddress": bankAddress
};
}
$(".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,
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getCutPageval();
showBankCradRecord(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());
}
}
});
});
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getCutPageval();
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>
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>
</html>

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<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">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -13,249 +13,261 @@
font-weight: normal;
margin-right: 20px;
}
.margin-bottom{
.margin-bottom {
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">审核处理</h3>
<div class="panel panel-info">
<div class="panel-heading">
<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 class="panel-body">
<div class="margin-bottom">
<label for="">
<input type="radio" name="confirm" value="payfor_road" checked>通道打款
</label>
<label for="">
<input type="radio" name="confirm" value="payfor_refuse">拒绝打款
</label>
<label for="">
<input type="radio" name="confirm" value="payfor_hand">手动打款
</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 class="margin-bottom" id="road">
<label for="">
请选择打款通道:
<input id="road-name" type="text" value=""><span class="color-red"> *必须</span>
<input class="btn btn-info" id="road-search" type="button" value="搜索">
</label>
<label for="">
<input id="balance" type="text" value="">
<button class="btn btn-primary" onclick="getBalance();" type="button">显示余额
</label>
</div>
</div>
</div>
{{/*展示通道列表*/}}
<div class="road-list">
<div class="menu-table table-responsive">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>通道名称</th>
<th>通道uid</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>
<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="road-list">
<div class="menu-table table-responsive">
<table>
<thead class="thead-dark">
<tr>
<th>序列号</th>
<th>通道名称</th>
<th>通道uid</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>
<script>
$("input[name='confirm']").change(function () {
let confirmType = $("input[name='confirm']:checked").val();
if (confirmType != "allow") {
$("#road").hide();
$(".road-list").hide();
} else if (confirmType == "allow") {
$("#road").show();
ajaxRoadList(getCutPageValues());
$(".road-list").show();
}
});
function getCutPageValues() {
let displayCount = $("#display_count").val();
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
};
<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>
<script>
$("input[name='confirm']").change(function () {
let confirmType = $("input[name='confirm']:checked").val();
if (confirmType != "allow") {
$("#road").hide();
$(".road-list").hide();
} else if (confirmType == "allow") {
$("#road").show();
ajaxRoadList(getCutPageValues());
$(".road-list").show();
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
});
});
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getCutPageValues();
function getCutPageValues() {
let displayCount = $("#display_count").val();
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;
}
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();
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
});
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) {
$(".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 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",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randRoadList(res);
}
});
$(".jump_page input").val("");
}
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);
},
error: function () {
alert("系统异常,请稍后再试")
}
}
function ajaxRoadList(dataJSON) {
$.ajax({
url: "/get/road",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randRoadList(res);
}
},
error: function () {
alert("系统异常,请稍后再试")
});
}
function getBalance() {
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);
}
});
}
function getBalance() {
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
},
error: function () {
alert("查询异常");
}
$.ajax({
url:"/choose/payfor/road",
data: {
"roadName":roadName,
"bankOrderId":bankOrderId,
"remark":remark,
"confirmType":confirmType
},
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("系统异常,请稍后再试")
});
}
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,
"bankOrderId": bankOrderId,
"remark": remark,
"confirmType": confirmType
},
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");
}
});
}
function save(roadName) {
$("#road-name").val(roadName);
}
//搜索列表
$("#road-search").click(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
},
error: function () {
alert("系统异常,请稍后再试")
}
});
$(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON)
});
</script>
}
function save(roadName) {
$("#road-name").val(roadName);
}
//搜索列表
$("#road-search").click(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON);
});
$(function () {
let dataJSON = getCutPageValues();
ajaxRoadList(dataJSON)
});
</script>
</body>
</html>

View File

@@ -2,464 +2,482 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/filter.js"></script>
<style>
#create-agent span {
display: inline-block;
width: 100px;
}
#create-agent div {
margin-bottom: 15px;
}
.add-agnet-button {
margin-bottom: 10px;
}
<meta charset="utf-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script>
<style>
#create-agent span {
display: inline-block;
width: 100px;
}
#agent-name-error, #agent-phone-error, #agent-login-password-error, #agent-vertify-password-error {
display: inline-block;
color: red;
margin-left: 10px;
}
#reset-agent-password span {
display: inline-block;
width: 100px;
}
#reset-agent-password div {
margin-bottom: 10px;
}
#agent-login-password-error-reset, #agent-vertify-password-error-reset {
color: red;
}
</style>
#create-agent div {
margin-bottom: 15px;
}
.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;
margin-left: 10px;
}
#reset-agent-password span {
display: inline-block;
width: 100px;
}
#reset-agent-password div {
margin-bottom: 10px;
}
#agent-login-password-error-reset, #agent-vertify-password-error-reset {
color: red;
}
</style>
</head>
<body>
<div class="agent-record">
<div class="search">
<div>
代理名称:
<input type="text" value="" placeholder="模糊匹配" id="agent-name-search">
</div>
<div>
<button type="button" class="btn btn-default" id="agent-search">搜索</button>
</div>
</div>
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-agnet-button">创建代理</button>
<!-- 创建代理的模态框 -->
<div class="modal fade" id="create-agent" 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="myModalLabel">创建代理商</h4>
</div>
<div class="modal-body modal-body-agent">
<div>
<span>代理商名称:</span>
<input type="text" id="agent-name-modal">
<span id="agent-name-error"></span>
</div>
<div>
<span>注册手机号:</span>
<input type="text" id="agent-phone-modal">
<span id="agent-phone-error"></span>
</div>
<div>
<span>账号登录密码:</span>
<input type="password" id="agent-login-password-modal">
<span id="agent-login-password-error"></span>
</div>
<div>
<span>确认密码:</span>
<input type="password" id="agent-vertify-password-modal">
<span id="agent-vertify-password-error"></span>
</div>
<div class="agent-record">
<div class="search">
<div>
代理名称:
<input id="agent-name-search" placeholder="模糊匹配" type="text" value="">
</div>
<div>
<button class="btn btn-default" id="agent-search" type="button">搜索</button>
</div>
</div>
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-agnet-button" type="button">创建代理</button>
<!-- 创建代理的模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="create-agent"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</div>
<div class="modal-body modal-body-agent">
<div>
<span>代理商名称:</span>
<input id="agent-name-modal" type="text">
<span id="agent-name-error"></span>
</div>
<div>
<span>注册手机号:</span>
<input id="agent-phone-modal" type="text">
<span id="agent-phone-error"></span>
</div>
<div>
<span>账号登录密码:</span>
<input id="agent-login-password-modal" type="password">
<span id="agent-login-password-error"></span>
</div>
<div>
<span>确认密码:</span>
<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>
<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 class="btn btn-default cancel-agent" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-agent" type="button">保存</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>
<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 class="modal fade" id="reset-agent-password" 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="myModalLabel">重置密码</h4>
</div>
<div class="modal-body modal-body-agent">
<input type="text" hidden="true" value="" id="agent-uid-reset">
<div>
<span>新密码:</span>
<input type="password" id="agent-login-password-reset">
<span id="agent-login-password-error-reset"></span>
</div>
<div>
<span>确认新密码:</span>
<input type="password" id="agent-vertify-password-reset">
<span id="agent-vertify-password-error-reset"></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>
<!-- 充值密码 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="reset-agent-password"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</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>
<!-- 操作代理商 -->
<div class="modal fade" id="operator-agent" 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="myModalLabel">代理商操作</h4>
</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>
<!-- 操作代理商 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="operator-agent"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</div>
<div class="modal-body modal-body-agent">
<input hidden="true" id="agent-uid-operator" type="text" value="">
<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 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>
<script>
function getAgentModalContent() {
let agentName = $("#agent-name-modal").val();
let agentPhone = $("#agent-phone-modal").val();
let agentLoginPassword = $("#agent-login-password-modal").val();
let agentVertifyPassword = $("#agent-vertify-password-modal").val();
let agentRemark = $("#agent-remark").val();
let status = $("#agent-status").val();
<script>
function getAgentModalContent() {
let agentName = $("#agent-name-modal").val();
let agentPhone = $("#agent-phone-modal").val();
let agentLoginPassword = $("#agent-login-password-modal").val();
let agentVertifyPassword = $("#agent-vertify-password-modal").val();
let agentRemark = $("#agent-remark").val();
let status = $("#agent-status").val();
return {
"agentName": agentName,
"agentPhone": agentPhone,
"agentLoginPassword": agentLoginPassword,
"agentVertifyPassword": agentVertifyPassword,
"agentRemark": agentRemark,
"status": status
};
}
function getAgentCutPageValues(){
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let agentName = $("#agent-name-search").val();
return {
"agentName": agentName,
"agentPhone": agentPhone,
"agentLoginPassword": agentLoginPassword,
"agentVertifyPassword": agentVertifyPassword,
"agentRemark": agentRemark,
"status": status
};
}
return {
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"agentName":agentName
};
}
function getAgentCutPageValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let agentName = $("#agent-name-search").val();
function clearAgentModalContent() {
$("#agent-name-modal").val("");
$("#agent-phone-modal").val("");
$("#agent-login-password-modal").val("");
$("#agent-vertify-password-modal").val("");
$("#agent-remark").val("");
}
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"agentName": agentName
};
}
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;'>";
function clearAgentModalContent() {
$("#agent-name-modal").val("");
$("#agent-phone-modal").val("");
$("#agent-login-password-modal").val("");
$("#agent-vertify-password-modal").val("");
$("#agent-remark").val("");
}
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 {
tmp = "<tr>";
ajaxAgentList(getAgentCutPageValues());
alert("操作成功")
}
}
});
}
tmp = tmp + "<th>" + (res.StartIndex+i+1) + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.AgentUid + "</th>" +
"<th>" + v.AgentName + "</th>" + "<th>" + v.AgentPhone + "</th>" ;
function deleteAgent(agentUid) {
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);">' +
'<span class="glyphicon glyphicon-edit"></span></button>' + "</th>";
function ajaxAgentList(dataJSON) {
$.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>' +
'<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;
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getAgentCutPageValues();
ajaxAgentList(dataJSON);
});
$("#agent-table-body").html(str);
}
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getAgentCutPageValues();
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
},
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
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();
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("处理失败");
} else {
ajaxAgentList(getAgentCutPageValues());
alert("操作成功")
}
}
});
}
if (dataJSON["jumpPage"].length <= 0) {
return;
}
ajaxAgentList(dataJSON);
});
function deleteAgent(agentUid) {
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("系统异常,请稍后再试");
}
});
}
$(".save-agent-reset").click(function () {
let agentUid = $("#agent-uid-reset").val();
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
},
function ajaxAgentList(dataJSON) {
$.ajax({
url: "/get/agent",
data: dataJSON,
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("系统异常,请稍后再试");
}
});
});
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert("获取代理数据失败");
} else {
showAgentList(res);
}
}
});
}
$(".save-agent").click(function () {
clearAgentModalError();
let dataJSON = getAgentModalContent();
$.ajax({
url: "/add/agent",
data: dataJSON,
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
let dataJSON = getAgentCutPageValues();
ajaxAgentList(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("系统异常,请稍后再试");
}
});
});
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getAgentCutPageValues();
$(".add-agnet-button").click(function () {
clearAgentModalContent();
clearAgentModalError();
$("#create-agent").modal();
});
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
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) {
return;
}
ajaxAgentList(dataJSON);
});
$(".save-agent-reset").click(function() {
let agentUid = $("#agent-uid-reset").val();
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>
$(".cancel-agent").click(function () {
clearAgentModalError();
clearAgentModalContent();
});
$(function () {
ajaxAgentList(getAgentCutPageValues());
});
</script>
</body>
</html>

View File

@@ -2,217 +2,227 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/jquery.ui.min.js"></script>
<style>
<meta charset="utf-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/jquery.ui.min.js"></script>
<style>
#deployRoleModal {
margin-bottom: 95px;
height: 500px;
overflow-y: hidden;
}
.modal-content {
overflow: auto;
max-height: 500px;
}
.modal-header {
padding: 10px;
}
.modal-footer {
padding-top: 10px;
padding-bottom: 30px;
}
</style>
#deployRoleModal {
margin-bottom: 95px;
height: 500px;
overflow-y: hidden;
}
.modal-content {
overflow: auto;
max-height: 500px;
}
.modal-header {
padding: 10px;
}
.modal-footer {
padding-top: 10px;
padding-bottom: 30px;
}
</style>
</head>
<body>
<!-- 权限配置模态框 -->
<div class="modal fade" id="deployRoleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false" data-backdrop="static">
<div class="modal-dialog modal-sm" 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="deployButton">配置权限项</h4>
</div>
<div class="modal-body modal-body-deploy">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-deploy" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-deploy">保存</button>
</div>
</div>
</div>
</div>
<!-- 权限模态框 end -->
<script>
function editRole(roleUid) {
showPowerTree(roleUid);
$("#deployRoleModal").modal();
}
<!-- 权限配置模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="deployRoleModal"
role="dialog" tabindex="-1">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="deployButton">配置权限项</h4>
</div>
<div class="modal-body modal-body-deploy">
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-deploy" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-deploy" type="button">保存</button>
</div>
</div>
</div>
</div>
<!-- 权限模态框 end -->
<script>
function editRole(roleUid) {
showPowerTree(roleUid);
$("#deployRoleModal").modal();
}
$(".save-deploy").click(function() {
let firstMenuUid = [];
let secondMenuUid = [];
let powerId = [];
$('input[name="checkbox-first-menu-uid"]:checked').each(function() {
firstMenuUid.push($(this).val());
});
$('input[name="checkbox-second-menu-uid"]:checked').each(function() {
secondMenuUid.push($(this).val());
});
$('input[name="checkbox-power-id"]:checked').each(function() {
powerId.push($(this).val());
});
$(".save-deploy").click(function () {
let firstMenuUid = [];
let secondMenuUid = [];
let powerId = [];
$('input[name="checkbox-first-menu-uid"]:checked').each(function () {
firstMenuUid.push($(this).val());
});
$('input[name="checkbox-second-menu-uid"]:checked').each(function () {
secondMenuUid.push($(this).val());
});
$('input[name="checkbox-power-id"]:checked').each(function () {
powerId.push($(this).val());
});
let roleUid = $("#roleUid").html();
let roleUid = $("#roleUid").html();
savePower({"firstMenuUid":firstMenuUid, "secondMenuUid":secondMenuUid, "powerId":powerId, "roleUid": roleUid});
});
savePower({
"firstMenuUid": firstMenuUid,
"secondMenuUid": secondMenuUid,
"powerId": powerId,
"roleUid": roleUid
});
});
//对已经选择checkbox进行打钩
function setCheckboxChecked(res) {
$('input[name="checkbox-first-menu-uid"]').each(function() {
let firstMenuUid = $(this).val();
if (res.ShowFirstMenuUid[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);
}
});
}
//对已经选择checkbox进行打钩
function setCheckboxChecked(res) {
$('input[name="checkbox-first-menu-uid"]').each(function () {
let firstMenuUid = $(this).val();
if (res.ShowFirstMenuUid[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 getCheckboxFirstMenuUid() {
let firstMenuUid = [];
$('input[name="checkbox-first-menu-uid"]:checked').each(function() {
firstMenuUid.push($(this).val());
});
return firstMenuUid;
}
function getCheckboxFirstMenuUid() {
let firstMenuUid = [];
$('input[name="checkbox-first-menu-uid"]:checked').each(function () {
firstMenuUid.push($(this).val());
});
return firstMenuUid;
}
function getCheckboxSecondMenuUid() {
let secondMenuUid = [];
$('input[name="checkbox-second-menu-uid"]:checked').each(function() {
secondMenuUid.push($(this).val());
});
return secondMenuUid;
}
function getCheckboxSecondMenuUid() {
let secondMenuUid = [];
$('input[name="checkbox-second-menu-uid"]:checked').each(function () {
secondMenuUid.push($(this).val());
});
return secondMenuUid;
}
function getCheckboxPowerId() {
let powerUid = [];
$('input[name="checkbox-power-id"]:checked').each(function() {
powerUid.push($(this).val());
});
return powerUid;
}
function getCheckboxPowerId() {
let powerUid = [];
$('input[name="checkbox-power-id"]:checked').each(function () {
powerUid.push($(this).val());
});
return powerUid;
}
function savePower(dataJSON) {
$.ajax({
url: "/save/power",
data: dataJSON,
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
} else if (res.Code == 200) {
alert("保存成功");
} else {
alert("保存失败");
}
$(".cancel-deploy").trigger('click');
},
function savePower(dataJSON) {
$.ajax({
url: "/save/power",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
} else if (res.Code == 200) {
alert("保存成功");
} else {
alert("保存失败");
}
$(".cancel-deploy").trigger('click');
},
error: function() {
alert("系统异常,请稍后重试");
}
});
}
error: function () {
alert("系统异常,请稍后重试");
}
});
}
function showPowerTree(roleUid) {
$.ajax({
url: "/get/deployTree",
async: false,
data: {
"roleUid": roleUid
},
function showPowerTree(roleUid) {
$.ajax({
url: "/get/deployTree",
async: false,
data: {
"roleUid": roleUid
},
success: function(res) {
if (res.Code == 404) {
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);
},
success: function (res) {
if (res.Code == 404) {
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() {
alert("系统异常,请稍后重试");
}
});
}
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>
$(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>
</html>

View File

@@ -2,287 +2,298 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script>
<script src="../static/js/basic.js"></script>
<style>
.first-input-group .basic-url {
width: 300px;
}
</style>
<meta charset="utf-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/filter.js"></script>
<script src="../static/js/basic.js"></script>
<style>
.first-input-group .basic-url {
width: 300px;
}
</style>
</head>
<body>
<!-- 添加菜单的模态框 -->
<div class="modal fade" id="addMenuModal" 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="myModalLabel">添加一级菜单</h4>
</div>
<div class="modal-body modal-body-menu">
<div class="input-group first-input-group">
<span class="input-group-addon basic-addon3">一级菜单</span>
<input type="text" class="form-control basic-url">
<span class="first-menu-error"></span>
</div>
<!-- 添加菜单的模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addMenuModal"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</div>
<div class="modal-body modal-body-menu">
<div class="input-group first-input-group">
<span class="input-group-addon basic-addon3">一级菜单</span>
<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>
<button type="button" class="btn btn-primary save-menu">保存</button>
</div>
</div>
</div>
</div>
<div class="search">
<div>
<span>一级菜单</span>
<input type="text" class="first-menu-serach" placeholder="模糊匹配" value="">
</div>
<div>
<button type="button" class="btn btn-default first-menu-search">搜索</button>
</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="#addMenuModal">添加一级菜单</button>
<strong>提示:创建导航菜单栏,一般由技术开发人员进行配置!</strong>
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-menu" type="button">保存</button>
</div>
</div>
</div>
</div>
<div class="search">
<div>
<span>一级菜单</span>
<input class="first-menu-serach" placeholder="模糊匹配" type="text" value="">
</div>
<div>
<button class="btn btn-default first-menu-search" type="button">搜索</button>
</div>
</div>
<div class="add-menu">
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addMenuModal" data-toggle="modal"
type="button">添加一级菜单
</button>
<strong>提示:创建导航菜单栏,一般由技术开发人员进行配置!</strong>
</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="menu_table_body">
</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="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>
</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>
<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>
$(".search div button").click(function() {
let firstMenuSearch = $(".first-menu-serach").val();
let dataJSON = getCutPageData();
dataJSON["firstMenuSearch"] = firstMenuSearch;
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();
<script>
$(".search div button").click(function () {
let firstMenuSearch = $(".first-menu-serach").val();
let dataJSON = getCutPageData();
dataJSON["firstMenuSearch"] = firstMenuSearch;
showMenuList(dataJSON);
});
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage": jumpPage};
}
$(".first-menu-search").click(function() {
showMenuList(getCutPageData());
});
//刚开始加载页面的时候,执行的一系列操作
$(document).ready(function() {
showMenuList(getCutPageData());
});
//获取数据
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
showMenuList(getCutPageData());
});
//获取分页的基础数据
function getCutPageData() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getCutPageData();
return {"displayCount": displayCount, "currentPage": currentPage, "totalPage": totalPage, "jumpPage": jumpPage};
}
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showMenuList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPageData();
$(".first-menu-search").click(function () {
showMenuList(getCutPageData());
});
//刚开始加载页面的时候,执行的一系列操作
$(document).ready(function () {
showMenuList(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;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showMenuList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPageData();
showMenuList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPageData();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
if (dataJSON["jumpPage"].length <= 0) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
showMenuList(dataJSON);
});
showMenuList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCutPageData();
function Ajax(menuUid, hostUrl) {
$.ajax({
url: hostUrl,
data: {
"menuUid": menuUid
},
if (dataJSON["jumpPage"].length <= 0) {
return;
}
success: function(res) {
showMenuList(dataJSON);
});
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200){
showMenuList(getCutPageData());
$(".table-caption").html("");
function Ajax(menuUid, hostUrl) {
$.ajax({
url: hostUrl,
data: {
"menuUid": menuUid
},
} else {
}
},
success: function (res) {
error: function() {
alert("系统异常,请稍后重试");
}
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200) {
showMenuList(getCutPageData());
$(".table-caption").html("");
});
}
} else {
}
},
//提升菜单的顺序
function menuUp(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,
error: function () {
alert("系统异常,请稍后重试");
}
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("");
//提升菜单的顺序
function menuUp(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) {
$(".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);
return;
} else if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
//将先前的内容清空
$("#menu_table_body").html("");
let str = "";
for(let i = 0; i < res.MenuList.length; i ++) {
let v = res.MenuList[i];
if (res.Code == -1) {
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.MenuList.length; i++) {
let v = res.MenuList[i];
// let secondMenus = v.SecondMenu.split("|");
// 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);
}
},
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("系统异常,请稍后重试");
}
});
}
error: function () {
alert("系统异常,请稍后重试");
}
});
}
$(".save-menu").click(function() {
let oneMenu = $(".basic-url").val();
$(".save-menu").click(function () {
let oneMenu = $(".basic-url").val();
if (oneMenu.length <= 0) {
$(".first-menu-error").text(" * 一级菜单不能为空");
return;
}
if (oneMenu.length <= 0) {
$(".first-menu-error").text(" * 一级菜单不能为空");
return;
}
$(".first-menu-error").text("");
$.ajax({
url: "/add/menu",
data:{
oneMenu: oneMenu
},
$(".first-menu-error").text("");
$.ajax({
url: "/add/menu",
data: {
oneMenu: oneMenu
},
success: function(res) {
if (res.Code == 200) {
$(".cancel-menu").trigger('click');
showMenuList();
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("系统异常,请稍后重试");
}
});
});
} 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("");
$(".add-button").click(function () {
$(".basic-url").val("");
$(".basic-url-4").val("");
$(".first-menu-error").text("");
});
</script>
});
</script>
</body>
</html>

View File

@@ -3,14 +3,14 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
<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/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script>
<style type="text/css" media="screen">
<style media="screen" type="text/css">
body {
overflow-y: hidden;
overflow-x: hidden;
@@ -135,310 +135,325 @@
</head>
<body>
<!-- 更改密码的模态框 -->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-keyboard="false">
<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="myModalLabel">用户密码更改</h4>
</div>
<div class="modal-body">
<p class="color-red text-center">温馨提示新密码字为8~16个字符字母和数字组成。</p>
<div class="row margin-top-20">
<div class="col-xs-3">
<span>旧密码:</span>
</div>
<div class="col-xs-5">
<input class="old-passwrod" type="password" name=""> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red old-error">
<!-- 更改密码的模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-keyboard="false" id="logoutModal" role="dialog"
tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</div>
<div class="modal-body">
<p class="color-red text-center">温馨提示新密码字为8~16个字符字母和数字组成。</p>
<div class="row margin-top-20">
<div class="col-xs-3">
<span>旧密码:</span>
</div>
<div class="col-xs-5">
<input class="old-passwrod" name="" type="password"> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red old-error">
</div>
</div>
<div class="row margin-top-20">
<div class="col-xs-3">
<span>新密码:</span>
</div>
<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 class="row margin-top-20">
<div class="col-xs-3">
<span>新密码:</span>
</div>
<div class="row margin-top-20">
<div class="col-xs-3">
<span>再次输入新密码:</span>
</div>
<div class="col-xs-5">
<input class="twice-password" type="password" name=""> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red twice-error">
<div class="col-xs-5">
<input class="new-password" name="" type="password"> <span class="color-red">*</span>
</div>
<div class="col-xs-4 color-red new-error">
</div>
</div>
<div class="row margin-top-20">
<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 class="modal-footer">
<button type="button" class="btn btn-default password-cancal cancal-save" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary password-save">保存</button>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default password-cancal cancal-save" data-dismiss="modal" type="button">取消
</button>
<button class="btn btn-primary password-save" type="button">保存</button>
</div>
</div>
</div>
<div class="modal fade" id="totpModal" tabindex="-1" role="dialog" aria-labelledby="myTotpLabel"
data-keyboard="false">
<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="totpLabel">TOTP二次验证</h4>
</div>
<div class="modal-body">
<div class="totp-regeneration">
<div class="row">
当前标识:<span id="totp-key"></span>
</div>
<div class="row">
<button class="btn btn-warning totp-regeneration-btn" data-toggle="tooltip"
</div>
<div aria-labelledby="myTotpLabel" class="modal fade" data-keyboard="false" id="totpModal" role="dialog"
tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="totpLabel">TOTP二次验证</h4>
</div>
<div class="modal-body">
<div class="totp-regeneration">
<div class="row">
当前标识:<span id="totp-key"></span>
</div>
<div class="row">
<button class="btn btn-warning totp-regeneration-btn" data-toggle="tooltip"
title="重新生成将导致此前的二次验证不可用,请谨慎生成">重新生成
</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">
</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default totp-cancal cancal-save" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary totp-save">保存</button>
<div class="row margin-top-20 totp-body">
<div id="totp-img">
<img alt="" src="" srcset="">
<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 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>
<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 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>
<div class="footer">版权所有</div>
</div>
</body>
<script>
$(function () {
@@ -502,11 +517,11 @@
return;
}
if (!(newPassword == twicePassword)) {
if (!(newPassword === twicePassword)) {
setError(".twice-error", "新密码两次输入不一致!");
return;
}
if (oldPassword == newPassword) {
if (oldPassword === newPassword) {
setError(".new-error", "新密码不能和旧密码一样!");
return;
}
@@ -523,14 +538,14 @@
twicePassword: twicePassword
},
success: function (res) {
if (res.Code == 200) {
if (res.Code === 200) {
//将模态框关闭
$("input[type='password']").val("");
$(".cancal-save").trigger('click');
setTimeout("", 1500);//等待1.5秒
alert("密码修改成功!");
window.parent.location = "/login.html";
} else if (res.Code == 404) {
} else if (res.Code === 404) {
//用户登录已经过期,需要重新登录
window.parent.location = "/login.html";
} else {
@@ -632,8 +647,7 @@
const secret = $("#totp-secret").val();
const code = $("#totp-value").val();
const key = $("#totp-key").text();
console.log(secret, code, key)
if (secret === "" || code === "" || key === "") {
if (secret === "" || key === "") {
setError(".totp-new-error", "信息填写不完整,需要重新填写");
return;
}
@@ -671,5 +685,4 @@
margin: 20px;
}
</style>
</html>

View File

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

View File

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

View File

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

View File

@@ -3,18 +3,22 @@
<head>
<meta charset="UTF-8">
<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">
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script>
{{/*<script src="../static/js/basic.js"></script>*/}}
{{/*
<script src="../static/js/basic.js"></script>
*/}}
<style>
.panel .panel-body input {
width: 50%;
}
.algin-right {
text-align: right;
}
table tr td {
display: inline-block;
width: 50%;
@@ -23,13 +27,16 @@
.panel-heading:hover {
cursor: pointer;
}
.panel-footer {
padding-left: 45%;
}
#modal-search {
height: 40px;
position: relative;
}
#modal-search button {
position: absolute;
right: 10px;
@@ -38,377 +45,400 @@
</style>
</head>
<body>
<div class="panel panel-info">
<div class="panel-heading" onclick="merchantList({});">
<span class="panel-title">选择下发商户</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 class="panel panel-info">
<div class="panel-heading" onclick="merchantList({});">
<span class="panel-title">选择下发商户</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 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 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<!-- Modal -->
<div aria-labelledby="myModalLabel" class="modal fade" id="myModal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="menu-table table-responsive">
<table>
<div id="modal-search">
<input type="text" hidden="hidden" id="modal-search-hidden" value="">
搜索:<input type="text" value="" id="modal-search-input" placeholder="名称">
<button type="button" class="btn btn-warning" data-dismiss="modal" id="cannel">取消</button>
</div>
<thead class="thead-dark" id="table-head">
</thead>
<div class="modal-body">
<div class="menu-table table-responsive">
<table>
<div id="modal-search">
<input hidden="hidden" id="modal-search-hidden" type="text" value="">
搜索:<input id="modal-search-input" placeholder="名称" type="text" value="">
<button class="btn btn-warning" data-dismiss="modal" id="cannel" type="button">取消</button>
</div>
<thead class="thead-dark" id="table-head">
</thead>
<tbody id="table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="30">20</option>
<option value="50">30</option>
<option value="100">50</option>
</select>
</li>
<tbody id="table-body">
</tbody>
</table>
</div>
<!-- 分页插件 -->
<div class="cut_page">
<li>
每页显示
<select id="display_count">
<option value="4">4</option>
<option value="30">20</option>
<option value="50">30</option>
<option value="100">50</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>
<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>
</div>
</div>
<script>
function getCutPagesValues() {
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 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");
}
<script>
function getCutPagesValues() {
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 saveMerchant(accountUid) {
$("#cannel").trigger('click');
$.ajax({
url:"/get/one/account",
data: {
"accountUid":accountUid
},
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);
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 f(dataJSON) {
let type = $("#modal-search-hidden").val();
if (type == "merchant-list") {
merchantList(dataJSON);
} else {
bankList(dataJSON);
}
}
function clearModal() {
$("#table-head").html("");
$("#table-body").html("");
}
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 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;
}
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("系统异常,请稍后再试");
$("#table-body").html(str);
$("#myModal").modal();
//标记是商户选择
$("#modal-search-hidden").val("merchant-list");
}
function saveMerchant(accountUid) {
$("#cannel").trigger('click');
$.ajax({
url: "/get/one/account",
data: {
"accountUid": accountUid
},
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();
}
//当每页显示数更改后,执行的操作
$("#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("系统异常,请稍后再试");
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);
}
});
$("#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("系统异常,请稍后再试");
}
});
},
error: function () {
alert("系统异常,请稍后再试");
}
});
//判断json是否为空
function JSONIsEmpty(dataJSON) {
let b = (JSON.stringify(dataJSON) == "{}");
return b;
}
$("#modal-search-input").change(function () {
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>
</html>

View File

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

View File

@@ -4,8 +4,8 @@
<head>
<meta charset="utf-8">
<title>商户后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<style type="text/css" media="screen">
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<style media="screen" type="text/css">
.first-input-group .basic-url, .operator-input-group .basic-url {
width: 210px;
}
@@ -42,27 +42,27 @@
<div class="search">
<div>
<span>操作员名称</span>
<input type="text" class="operator-name" value="" placeholder="模糊匹配">
<input class="operator-name" placeholder="模糊匹配" type="text" value="">
</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 class="add-menu">
<button type="button"
class="btn btn-default btn-xs glyphicon glyphicon-plus add-operator-button"
data-toggle="modal" data-target="#addOperatorModal"
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-operator-button"
data-target="#addOperatorModal"
data-toggle="modal" type="button"
>新加操作员
</button>
</div>
<!-- 添加操作员的模态框 -->
<div class="modal fade" id="addOperatorModal" 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="addOperatorModal"
role="dialog" tabindex="-1">
<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 aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="addPowerButton">添加新的操作员</h4>
</div>
@@ -70,12 +70,12 @@
<div class="modal-body modal-body-menu">
<div class="input-group first-input-group">
<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>
</div>
<div class="input-group first-input-group">
<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>
</div>
@@ -104,20 +104,20 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-operator" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-operator">保存</button>
<button class="btn btn-default cancel-operator" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-operator" type="button">保存</button>
</div>
</div>
</div>
</div>
<!-- end 模态框 -->
<!-- 修改操作员信息的模态框 -->
<div class="modal fade" id="editOperatorModal" 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="editOperatorModal"
role="dialog" tabindex="-1">
<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 aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="editOperatorButton">添加新的操作员</h4>
</div>
@@ -129,19 +129,19 @@
</div>
<div class="input-group first-input-group">
<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>
</div>
<div class="input-group first-input-group">
<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>
</div>
<div class="input-group first-input-group">
<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>
</div>
@@ -162,8 +162,8 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default change-cancel-operator" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary change-save-operator">保存</button>
<button class="btn btn-default change-cancel-operator" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary change-save-operator" type="button">保存</button>
</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="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 class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>

View File

@@ -4,10 +4,10 @@
<head>
<meta charset="UTF-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../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/css/basic.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/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/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
@@ -50,371 +50,372 @@
</head>
<body>
<div class="order-record">
<div class="search form-inline">
<label for="">
<span>开始时间:</span>
<input type="text" name="" id="search-order-start-time" class="start-time" value="">
</label>
<label for="">
<span>结束时间:</span>
<input type="text" name="" id="search-order-end-time" class="end-time" value="">
</label>
<label for="">
<span>商户名称:</span>
<input type="text" id="search-order-merchant-name" placeholder="模糊匹配">
</label>
<label for="">
<span>卡片数据:</span>
<input type="text" id="search-order-card-data" placeholder="卡片数据">
</label>
<label for="">
<span>商户订单号:</span>
<input type="text" id="search-order-merchant-order-id" value="">
</label>
<label>
<span>本系统订单号:</span>
<input type="text" id="search-order-bank-order-id" value="">
</label>
<label for="">
订单状态:
<select name="" id="search-order-status">
<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">
<div class="order-record">
<div class="search form-inline">
<label for="">
<span>开始时间:</span>
<input class="start-time" id="search-order-start-time" name="" type="text" value="">
</label>
<label for="">
<span>结束时间:</span>
<input class="end-time" id="search-order-end-time" name="" type="text" value="">
</label>
<label for="">
<span>商户名称:</span>
<input id="search-order-merchant-name" placeholder="模糊匹配" type="text">
</label>
<label for="">
<span>卡片数据:</span>
<input id="search-order-card-data" placeholder="卡片数据" type="text">
</label>
<label for="">
<span>商户订单号:</span>
<input id="search-order-merchant-order-id" type="text" value="">
</label>
<label>
<span>本系统订单号:</span>
<input id="search-order-bank-order-id" type="text" value="">
</label>
<label for="">
订单状态:
<select id="search-order-status" name="">
<option value="">请选择</option>
<option value="freeze_amount">冻结</option>
<option value="refund">退款</option>
<option value="success">支付成功</option>
<option value="wait">等待支付</option>
<option value="fail">支付失败</option>
<option value="cancel">放弃支付</option>
</select>
</label>
<button type="button" class="btn btn-default" id="order-search">搜索</button>
<button onclick='loadMainContent("/order_info.html")' type="button" class="btn btn-default">刷新</button>
</label>
<label for="">
上游名称:
<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;">-->
<!-- 交易金额:-->
<!-- <span id="order-all-amount"></span>-->
<!-- </label>-->
<!-- <label class="color-red" style="font-size: 16px;">-->
<!-- 交易金额:-->
<!-- <span id="order-all-amount"></span>-->
<!-- </label>-->
<!-- <label class="color-red" style="font-size: 16px;">-->
<!-- 成功率:-->
<!-- <span id="success-rate"></span>-->
<!-- </label>-->
</div>
<!-- <div>-->
<!-- 今日订单数:-->
<!-- 今日总金额:-->
<!-- 今日已付订单数:-->
<!-- 今日已付总金额:-->
<!-- 今日平台收入:-->
<!-- 今日商户收入:-->
<!-- 今日代理收入:-->
<!-- 今日通道成本-->
<!-- </div>-->
<!-- <div>-->
<!-- 提交订单数:-->
<!-- 订单总金额:-->
<!-- 已付订单数:-->
<!-- 已付总金额:-->
<!-- 平台收入:-->
<!-- 商户收入:-->
<!-- 代理收入:-->
<!-- 通道成本:-->
<!-- </div>-->
<div style="padding: 20px">
<div class="row">
<div class="col-sm-2 color-red">
订单总量:
<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>-->
<!-- <label class="color-red" style="font-size: 16px;">-->
<!-- 成功率:-->
<!-- <span id="success-rate"></span>-->
<!-- </label>-->
</div>
<!-- <div>-->
<!-- 今日订单数:-->
<!-- 今日总金额:-->
<!-- 今日已付订单数:-->
<!-- 今日已付总金额:-->
<!-- 今日平台收入:-->
<!-- 今日商户收入:-->
<!-- 今日代理收入:-->
<!-- 今日通道成本-->
<!-- </div>-->
<!-- <div>-->
<!-- 提交订单数:-->
<!-- 订单总金额:-->
<!-- 已付订单数:-->
<!-- 已付总金额:-->
<!-- 平台收入:-->
<!-- 商户收入:-->
<!-- 代理收入:-->
<!-- 通道成本:-->
<!-- </div>-->
<div style="padding: 20px">
<div class="row">
<div class="col-sm-2 color-red">
订单总量:
<span id="orderTotalNum"></span>
</div>
<div class="row">
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日订单数:
<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 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 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>-->
<th>上游返回数据</th>
<th>用户IP</th>
<th>操作</th>
</tr>
</thead>
<tbody id="order-table-body">
</tbody>
</table>
<div class="row">
<div class="col-sm-2 color-red" style="font-weight: normal;">
今日订单数:
<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 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 class="modal fade" id="order-details" 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-details">
<div class="row">
<div class="col-md-6">
<div>商品名称:<span id="shop-name"></span></div>
<div>商户订单id<span id="merchant-order-id"></span></div>
<div>系统订单id<span id="bank-order-id"></span></div>
<div>银行流水id<span id="bank-trans-id"></span></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 class="col-md-6">
<div>订单有效时间:<span id="order-period"></span></div>
<div>支付状态:<span id="status"></span></div>
<div>是否退款:<span id="refund"></span></div>
<div>退款时间:<span id="refund-time"></span></div>
<div>是否冻结:<span id="free"></span></div>
<div>冻结时间:<span id="free-time"></span></div>
<div>是否解冻:<span id="unfree"></span></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 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>-->
<th>上游返回数据</th>
<th>用户IP</th>
<th>操作</th>
</tr>
</thead>
<tbody id="order-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 name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
<!-- 模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="order-details"
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-details">
<div class="row">
<div class="col-md-6">
<div>商品名称<span id="shop-name"></span></div>
<div>商户订单id<span id="merchant-order-id"></span></div>
<div>系统订单id<span id="bank-order-id"></span></div>
<div>银行流水id<span id="bank-trans-id"></span></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 class="row">
<div class="col-md-12">
回调地址<span id="notify"></span>
</div>
</div>
<div class="row">
<div class="col-md-12">
回调数据<span id="card-return-data"></span>
</div>
<div class="col-md-6">
<div>订单有效时间:<span id="order-period"></span></div>
<div>支付状态<span id="status"></span></div>
<div>是否退款:<span id="refund"></span></div>
<div>退款时间:<span id="refund-time"></span></div>
<div>是否冻结:<span id="free"></span></div>
<div>冻结时间:<span id="free-time"></span></div>
<div>是否解冻<span id="unfree"></span></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 class="modal-footer">
<button type="button" class="btn btn-default cancel-order-details" data-dismiss="modal">取消
</button>
</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 class="row">
<div class="col-md-12">
回调地址:<span id="notify"></span>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default save-order-solve">确定</button>
<button type="button" class="btn btn-default cancel-order-solve"
data-dismiss="modal">取消</button>
<div class="row">
<div class="col-md-12">
回调数据:<span id="card-return-data"></span>
</div>
</div>
</div>
</div>
</div>
<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 class="modal-footer">
<button class="btn btn-default cancel-order-details" data-dismiss="modal" type="button">取消
</button>
</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>
<script>
//将上游通道供应商写入
@@ -585,6 +586,7 @@
$("#TodayAllNum").html(res.OrderProfitSummary.todayProfit.totalNum);
$("#todaySucceedRate").html(res.OrderProfitSummary.todayProfit.succeedRate)
}
function orderRoll(bankOrderId) {
$.ajax({
url: "/update/order/status",
@@ -773,6 +775,7 @@
}
});
}
function AjaxOrderList(dataJSON) {
dataJSON["roadUid"] = "{{.roadUid}}"
$.ajax({
@@ -792,6 +795,7 @@
});
AjaxOrderSummaryList(dataJSON)
}
function AjaxOrderSummaryList(dataJSON) {
dataJSON["roadUid"] = "{{.roadUid}}"
$.ajax({
@@ -810,6 +814,7 @@
}
});
}
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getOrderSearchValues();

View File

@@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<link rel="stylesheet" type="text/css" href="../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/css/basic.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/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/jquery.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;">
<label for="" style="font-weight: normal;">
<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 for="" style="font-weight: normal;">
<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 for="" style="font-weight: normal;">
<span>商户名称:</span>
<input type="text" id="search-order-merchant-name" placeholder="模糊匹配">
<input id="search-order-merchant-name" placeholder="模糊匹配" type="text">
</label>
<label for="">
<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 style="font-weight: normal;">
<span>本系统订单号:</span>
<input type="text" id="search-order-bank-order-id" value="">
<input id="search-order-bank-order-id" type="text" value="">
</label>
<label for="" style="font-weight: normal;">
上游名称:
<select name="" id="search-order-supplier-name">
<select id="search-order-supplier-name" name="">
</select>
</label>
<label for="" style="font-weight: normal;">
订单状态:
<select name="" id="search-order-status">
<select id="search-order-status" name="">
<option value="">请选择</option>
<option value="success">支付成功</option>
<option value="wait">等待支付</option>
@@ -94,7 +94,7 @@
</label>
<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="CARD_DH">卡密兑换</option>
<option value="WEIXIN_SCAN">微信扫码</option>
@@ -119,7 +119,7 @@
<option value="JD_SYT">京东收银台</option>
</select>
</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 class="menu-table table-responsive">
<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="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 class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
</div>

View File

@@ -3,9 +3,10 @@
<head>
<meta charset="UTF-8">
<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 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/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script>
@@ -17,327 +18,338 @@
font-weight: normal;
margin-right: 20px;
}
#status {
height: 30px;
line-height: 30px;
}
.search-button {
margin-left: 40px;
}
.modal-body label {
font-weight: normal;
margin-left: 2%;
margin-top: 2%;
}
#result-modal label {
margin-right: 50px;
}
#table-body tr{
#table-body tr {
height: 25px;
line-height: 25px;
}
</style>
</head>
<body>
<div class="search">
<label>
开始时间:
<input type="text" name="" value="" id="start-time" class="start-time" value="">
</label>
<label>
结束时间:
<input type="text" name="" value="" id="end-time" class="end-time" value="">
</label>
<label>
商户订单号:
<input type="text" id="merchantOrderId">
</label>
<label>
系统订单号:
<input type="text" id="bankOrderId">
</label>
<select id="status">
<option value="">请选择</option>
<option value="payfor_confirm">待审核</option>
<option value="payfor_solving">系统处理中</option>
<option value="payfor_banking">银行处理中</option>
<option value="payfor_success">代付成功</option>
<option value="payfor_fail">代付失败</option>
<div class="search">
<label>
开始时间:
<input class="start-time" id="start-time" name="" type="text" value="" value="">
</label>
<label>
结束时间:
<input class="end-time" id="end-time" name="" type="text" value="" value="">
</label>
<label>
商户订单号:
<input id="merchantOrderId" type="text">
</label>
<label>
系统订单号:
<input id="bankOrderId" type="text">
</label>
<select id="status">
<option value="">请选择</option>
<option value="payfor_confirm">待审核</option>
<option value="payfor_solving">系统处理中</option>
<option value="payfor_banking">银行处理中</option>
<option value="payfor_success">代付成功</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>
<input type="button" class="btn btn-primary search-button" value="搜索">
</div>
</li>
<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>
</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>
<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>
<!-- Modal -->
<div class="modal fade" id="result-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<input type="text" value="" hidden="hidden" id="result-bank-order-id">
<div class="modal-body">
<label>
打款成功:
<input type="radio" name="result-payfor" value="payfor_success">
</label>
<label for="">
打款失败:
<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>
<!-- Modal -->
<div aria-labelledby="myModalLabel" class="modal fade" id="result-modal" role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<input hidden="hidden" id="result-bank-order-id" type="text" value="">
<div class="modal-body">
<label>
打款成功:
<input name="result-payfor" type="radio" value="payfor_success">
</label>
<label for="">
打款失败:
<input name="result-payfor" type="radio" value="payfor_fail">
</label>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" id="result-cannel" type="button">取消</button>
<input class="btn btn-primary" onclick="resultSubmit();" type="button" value="确定">
</div>
</div>
</div>
<script>
function getCurPageValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let startTime = $("#start-time").val();
let endTime = $("#end-time").val();
let merchantOrderId = $("#merchantOrderId").val();
let bankOrderId = $("#bankOrderId").val();
let status = $("#status").val();
</div>
<script>
function getCurPageValues() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let startTime = $("#start-time").val();
let endTime = $("#end-time").val();
let merchantOrderId = $("#merchantOrderId").val();
let bankOrderId = $("#bankOrderId").val();
let status = $("#status").val();
return {
"displayCount":displayCount,
"currentPage":currentPage,
"totalPage":totalPage,
"jumpPage":jumpPage,
"startTime":startTime,
"endTime":endTime,
"merchantOrderId":merchantOrderId,
"bankOrderId":bankOrderId,
"status":status
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"startTime": startTime,
"endTime": endTime,
"merchantOrderId": merchantOrderId,
"bankOrderId": bankOrderId,
"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) {
$(".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 randPayForList(res) {
setCutPageValues(res);
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>';
}
});
$(".jump_page input").val("");
} 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 {
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);
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") {
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>';
$("#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 {
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","系统处理中").
replace("payfor_banking","银行处理中").replace("payfor_hand","手动打款").replace("payfor_refuse","拒绝打款").replace("payfor_road","通道打款");
},
error: function () {
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);
});
}
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getCurPageValues();
if (dataJSON["currentPage"] == 1) {
return;
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("系统异常,请稍后再试");
}
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 AjaxPayForList(dataJSON) {
$.ajax({
url: "/get/payfor",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
randPayForList(res);
}
});
}
//审核操作
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);
},
error: function () {
alert("系统异常,请稍后再试");
}
});
</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>
</html>

View File

@@ -3,9 +3,10 @@
<head>
<meta charset="UTF-8">
<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 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/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/js/filter.js"></script>
@@ -17,19 +18,23 @@
font-weight: normal;
margin-right: 20px;
}
select {
height: 30px;
line-height: 30px;
text-align: center;
}
#total-amount ,#total-platform-profit{
#total-amount, #total-platform-profit {
display: inline-block;
margin-right: 40px;
}
.profit{
.profit {
font-size: 16px;
margin-top: 10px;
}
table tr {
height: 28px;
font-size: 16px;
@@ -40,19 +45,19 @@
<div class="search">
<label>
商户名称:
<select name="" id="select-merchant-name"></select>
<select id="select-merchant-name" name=""></select>
</label>
<label for="">
代理名称:
<select name="" id="select-agent-name"></select>
<select id="select-agent-name" name=""></select>
</label>
<label for="">
上游通道名:
<select name="" id="search-order-supplier-name"></select>
<select id="search-order-supplier-name" name=""></select>
</label>
<label>
支付类型:
<select name="" id="pay-type">
<select id="pay-type" name="">
<option value="">请选择</option>
<option value="CARD_DH">卡密兑换</option>
<option value="WEIXIN_SCAN">微信扫码</option>
@@ -79,25 +84,25 @@
</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>
结束时间:
<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 for="">
<input type="button" class="btn btn-primary" value="搜索" onclick="search();">
<input class="btn btn-primary" onclick="search();" type="button" value="搜索">
</label>
<label for="" class="profit">
<label class="profit" for="">
<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="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="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>
</div>
<div class="menu-table">
@@ -133,30 +138,32 @@
return {
"merchantUid": merchantUid,
"agentUid":agentUid,
"agentUid": agentUid,
"supplierUid": supplierUid,
"payType": payType,
"startTime": startTime,
"endTime": endTime
};
}
function randProfit(res) {
$("#total-amount").html(res.TotalAmount);
$("#total-platform-profit").html(res.PlatformTotalProfit);
$("#total-agent-profit").html(res.AgentTotalProfit);
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 tmp = "<tr>" + "<th>" + (i+1) + "</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.PlatformProfit + "</th>" +"<th>" + v.AgentProfit + "</th>" + "</tr>";
let tmp = "<tr>" + "<th>" + (i + 1) + "</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.PlatformProfit + "</th>" + "<th>" + v.AgentProfit + "</th>" + "</tr>";
str = str + tmp;
}
$("#table-body").html(str);
}
function search() {
$.ajax({
url: "/get/profit",
@@ -172,6 +179,7 @@
},
});
}
$(function () {
setMerchant();
setSupplier();

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<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>
<style type="text/css">
.road-pool-record, .edit-road-pool {
@@ -115,17 +115,17 @@
<div class="search">
<div>
<span>通道池名称:</span>
<input type="text" class="road-pool-name-search" value="" placeholder="模糊匹配">
<input class="road-pool-name-search" placeholder="模糊匹配" type="text" value="">
</div>
<div>
<span>通道池编号:</span>
<input type="text" class="product-pool-name-search" value="" placeholder="模糊匹配">
<input class="product-pool-name-search" placeholder="模糊匹配" type="text" value="">
</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>
<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>
<div class="menu-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="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 class="jump_page">跳转 <input name="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
</div>
<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>
通道名称:
<input type="text" class="road-name-search" value="" placeholder="模糊匹配">
<input class="road-name-search" placeholder="模糊匹配" type="text" value="">
</div>
<div>
产品名称:
<input type="text" class="road-product-name-search" value="" placeholder="模糊匹配">
<input class="road-product-name-search" placeholder="模糊匹配" type="text" value="">
</div>
<div>
支付类型:
<input type="text" class="road-pay-type-search" value="">
<input class="road-pay-type-search" type="text" value="">
</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>
@@ -189,7 +189,7 @@
<table>
<thead class="thead-dark">
<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>
@@ -229,8 +229,8 @@
</li>
<li class="pre_page">上一页</li>
<li class="next_page">下一页</li>
<li class="jump_page">跳转 <input type="text" id="jump_page" value="">
<button type="button" class="btn btn-default">Go</button>
<li class="jump_page">跳转 <input id="jump_page" type="text" value="">
<button class="btn btn-default" type="button">Go</button>
</li>
</div>
<div class="road-footer">
@@ -241,12 +241,12 @@
</div>
<!-- 模态框 -->
<div class="modal fade" id="roadPoolModal" 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="roadPoolModal"
role="dialog" tabindex="-1">
<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 aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="addroadPoolButton">添加通道池</h4>
</div>
@@ -254,18 +254,18 @@
<div class="modal-body modal-body-road-pool">
<div>
<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>
</div>
<div>
<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>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default cancel-road-pool" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary save-road-pool">保存</button>
<button class="btn btn-default cancel-road-pool" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-road-pool" type="button">保存</button>
</div>
</div>
</div>

View File

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

View File

@@ -2,262 +2,279 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>商户后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/filter.js"></script>
<style>
.role-name-add {
margin-left: 30px;
vertical-align: bottom;
}
.role-remark {
margin-left: 30px;
margin-top: 20px;
width: 190px;
}
.role-remark-word {
vertical-align: center;
}
.role-name-error {
margin-left: 20px;
color: red;
}
</style>
<meta charset="utf-8">
<title>商户后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/filter.js"></script>
<style>
.role-name-add {
margin-left: 30px;
vertical-align: bottom;
}
.role-remark {
margin-left: 30px;
margin-top: 20px;
width: 190px;
}
.role-remark-word {
vertical-align: center;
}
.role-name-error {
margin-left: 20px;
color: red;
}
</style>
</head>
<body>
<div class="search">
<div>
<span>角色名称</span>
<input type="text" class="role-name" value="" placeholder="模糊匹配">
</div>
<div>
<button type="button" class="btn btn-default role-menu-search">搜索</button>
</div>
</div>
<div class="search">
<div>
<span>角色名称</span>
<input class="role-name" placeholder="模糊匹配" type="text" value="">
</div>
<div>
<button class="btn btn-default role-menu-search" type="button">搜索</button>
</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="add-menu">
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addRoleModal" data-toggle="modal"
type="button">创建新角色
</button>
</div>
<!-- 创建新角色的模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addRoleModal"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button aria-label="Close" class="close" data-dismiss="modal" type="button"><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 class="modal-body modal-body-menu">
<div>
<span>角色名称: </span>
<input class="role-name-add" type="text">
<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>
<span class="role-remark-word">角色描述:</span>
<textarea class="role-remark"></textarea>
<span class="role-remark-error"></span>
</div>
<div class="input-group">
<span class="role-save-success"></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>
<!-- 模态框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>
<div class="input-group">
<span class="role-save-success"></span>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-menu" type="button">保存</button>
</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>
<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>
<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>
<script>
function getRolePageData() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
<script>
function getRolePageData() {
let displayCount = $("#display_count").val();
let currentPage = $(".current_page").html();
let totalPage = $(".total_page").html();
let jumpPage = $(".jump_page input").val();
let roleName = $(".role-name").val();
let roleNameAdd = $(".role-name-add").val();
let roleRemark = $(".role-remark").val();
let roleName = $(".role-name").val();
let roleNameAdd = $(".role-name-add").val();
let roleRemark = $(".role-remark").val();
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage":jumpPage,
"roleName":roleName, "roleRemark":roleRemark, "roleNameAdd":roleNameAdd};
}
function Ajax(dataJSON, urlHost) {
$.ajax({
url: urlHost,
async:false,
data: dataJSON,
return {
"displayCount": displayCount, "currentPage": currentPage, "totalPage": totalPage, "jumpPage": jumpPage,
"roleName": roleName, "roleRemark": roleRemark, "roleNameAdd": roleNameAdd
};
}
success: function(res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
}
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");
}
}
},
function Ajax(dataJSON, urlHost) {
$.ajax({
url: urlHost,
async: false,
data: dataJSON,
error: function() {
alert("系统异常,请稍后再试");
}
});
}
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
return;
}
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");
}
}
},
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");
});
error: function () {
alert("系统异常,请稍后再试");
}
});
}
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getRolePageData();
function deleteRole(roleUid) {
if (!window.confirm("是否确定删除?")) {
return;
}
let dataJSON = getRolePageData();
dataJSON["roleUid"] = roleUid;
Ajax(dataJSON, "/delete/role");
}
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
Ajax(dataJSON, "/get/role");
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getRolePageData();
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getRolePageData();
Ajax(dataJSON, "/get/role");
});
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getRolePageData();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
Ajax(dataJSON, "/get/role");
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getRolePageData();
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
Ajax(dataJSON, "/get/role");
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getRolePageData();
if (dataJSON["jumpPage"].length <= 0) {
return;
}
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() {
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
let roleName = $(".role-name").val();
let roleNameAdd = $(".role-name-add").val();
let roleRemark = $(".role-remark").val();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
Ajax(dataJSON, "/get/role");
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getRolePageData();
$(".role-name-error").html("");
$(".role-remark-error").html("");
if (dataJSON["jumpPage"].length <= 0) {
return;
}
Ajax(dataJSON, "/get/role");
});
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() {
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");
$(".edit-role-modal").load("/jhboss/edit_role.html");
});
</script>
} 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("");
$(".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>
</html>

View File

@@ -2,341 +2,361 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>管理后台</title>
<link rel="stylesheet" type="text/css" href="../static/css/basic.css">
<script src="../static/js/jquery.ui.min.js"></script>
<script src="../static/js/filter.js"></script>
<style>
.first-input-group .basic-url, .router-input-group .basic-url {
width: 210px;
}
<meta charset="utf-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery.ui.min.js"></script>
<script src="../static/js/filter.js"></script>
<style>
.first-input-group .basic-url, .router-input-group .basic-url {
width: 210px;
}
.pre-menu-error ,.second-menu-error ,.second-router-error {
padding-left: 20px;
color: red
}
</style>
.pre-menu-error, .second-menu-error, .second-router-error {
padding-left: 20px;
color: red
}
</style>
</head>
<body>
<!-- 添加菜单的模态框 -->
<div class="modal fade" id="addMenuModal" 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="myModalLabel">添加二级菜单</h4>
</div>
<div class="modal-body modal-body-menu">
<div class="input-group pre-input-group">
<span class="input-group-addon basic-addon">父级菜单</span>
<div class="select-content">
</div>
<!-- 添加菜单的模态框 -->
<div aria-labelledby="myModalLabel" class="modal fade" data-backdrop="static" data-keyboard="false" id="addMenuModal"
role="dialog" tabindex="-1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<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>
</div>
<div class="modal-body modal-body-menu">
<div class="input-group pre-input-group">
<span class="input-group-addon basic-addon">父级菜单</span>
<div class="select-content">
</div>
<span class="pre-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 second-menu-content">
<span class="second-menu-error"></span>
</div>
<span class="pre-menu-error"></span>
</div>
<div class="input-group first-input-group">
<span class="input-group-addon basic-addon">二级菜单</span>
<input class="form-control basic-url second-menu-content" type="text">
<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="input-group first-input-group">
<span class="input-group-addon basic-addon">菜单路由</span>
<input class="form-control basic-url router-url" type="text">
<span class="second-router-error"></span>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default cancel-menu" data-dismiss="modal" type="button">取消</button>
<button class="btn btn-primary save-menu" type="button">保存</button>
</div>
</div>
</div>
</div>
<div class="search">
<div>
<span>一级菜单</span>
<input type="text" class="first-menu-serach" placeholder ="模糊匹配">
</div>
<div>
<span>二级菜单</span>
<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="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">
<button type="button" class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-toggle="modal" data-target="#addMenuModal">添加二级菜单</button>
<strong>添加二级菜单时,确保对应的一级菜单已经创建好!</strong>
</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>
</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>
<div class="add-menu">
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-button" data-target="#addMenuModal" data-toggle="modal"
type="button">添加二级菜单
</button>
<strong>在添加二级菜单时,确保对应的一级菜单已经创建好!</strong>
</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>
</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>
<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>
//获取搜索框的数据,和分页的基础数据
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();
//获取搜索框的数据,和分页的基础数据
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();
return {"displayCount":displayCount, "currentPage":currentPage, "totalPage":totalPage, "jumpPage":jumpPage, "firstMenuSerach": firstMenuSerach, "secondMenuSerach":secondMenuSerach};
}
$(".second-menu-search").click(function() {
showSecondMenuList(getCutPageData());
});
//刚开始加载页面的时候,执行的一系列操作
$(document).ready(function() {
showSecondMenuList(getCutPageData());
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function() {
showSecondMenuList(getCutPageData());
});
return {
"displayCount": displayCount,
"currentPage": currentPage,
"totalPage": totalPage,
"jumpPage": jumpPage,
"firstMenuSerach": firstMenuSerach,
"secondMenuSerach": secondMenuSerach
};
}
//点击上一页的按钮
$(".pre_page").click(function() {
let dataJSON = getCutPageData();
$(".second-menu-search").click(function () {
showSecondMenuList(getCutPageData());
});
//刚开始加载页面的时候,执行的一系列操作
$(document).ready(function () {
showSecondMenuList(getCutPageData());
});
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
showSecondMenuList(getCutPageData());
});
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showSecondMenuList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function() {
let dataJSON = getCutPageData();
//点击上一页的按钮
$(".pre_page").click(function () {
let dataJSON = getCutPageData();
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
if (dataJSON["currentPage"] == 1) {
return;
}
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
showSecondMenuList(dataJSON);
});
//点击下一页的按钮时
$(".next_page").click(function () {
let dataJSON = getCutPageData();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
if (dataJSON["currentPage"] == dataJSON["totalPage"]) {
return;
}
showSecondMenuList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function() {
let dataJSON = getCutPageData();
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
if (dataJSON["jumpPage"].length <= 0) {
return;
}
showSecondMenuList(dataJSON);
});
//点击跳转那一页的按钮
$(".jump_page button").click(function () {
let dataJSON = getCutPageData();
showSecondMenuList(dataJSON);
});
$(".search div button").click(function() {
let dataJSON = getCutPageData();
showSecondMenuList(dataJSON);
});
if (dataJSON["jumpPage"].length <= 0) {
return;
}
function Ajax(secondMenuUid, hostUrl) {
$.ajax({
url: hostUrl,
data: {
"secondMenuUid": secondMenuUid
},
showSecondMenuList(dataJSON);
});
$(".search div button").click(function () {
let dataJSON = getCutPageData();
showSecondMenuList(dataJSON);
});
success: function(res) {
function Ajax(secondMenuUid, hostUrl) {
$.ajax({
url: hostUrl,
data: {
"secondMenuUid": secondMenuUid
},
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200){
showSecondMenuList();
} else {
alert("参数传入有误");
}
},
success: function (res) {
error: function() {
alert("系统异常,请稍后重试");
}
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == 200) {
showSecondMenuList();
} else {
alert("参数传入有误");
}
},
});
}
error: function () {
alert("系统异常,请稍后重试");
}
//提升菜单的顺序
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) {
$(".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 menuUp(secondMenuUid) {
Ajax(secondMenuUid, "/up/secondMenu");
}
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);
}
},
//降低菜单的顺序
function menuDown(secondMenuUid) {
Ajax(secondMenuUid, "/down/secondMenu");
}
error: function() {
alert("系统异常,请稍后重试");
}
});
}
//删除菜单
function menuDelete(secondMenuUid) {
if (!window.confirm("是否确定删除该项?")) {
return;
}
Ajax(secondMenuUid, "/delete/secondMenu");
}
$(".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();
//此函数的作用,是在每行的最后一格,加入可操作的按钮图标
function showSecondMenuList(dataJSON) {
$.ajax({
url: "/get/secondMenu",
data: dataJSON,
if (secondMenu.length == 0) {
$(".second-menu-error").text("*二级菜单不能为空");
return;
}
if (secondRouter.length == 0) {
$(".second-router-error").text("*二级菜单路由不能为空");
return;
}
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("");
$.ajax({
url: "/add/secondMenu",
data: {
"preMenuUid": preMenuUid,
"secondMenu": secondMenu,
"secondRouter": secondRouter
},
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);
}
},
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("系统异常,请稍后重试");
}
});
}
}
},
$(".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();
error: function() {
alert("系统异常,请稍后重试");
}
});
}
$(".add-button").click(function() {
$(".basic-url").val("");
$(".select-content").html("");
clearMenuError();
selectContent();
});
</script>
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>
</html>

View File

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

View File

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

View File

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