增加H5业务开关

main
岩仔88 19 hours ago
parent ba684915c5
commit 92ecb1bd4d

@ -12,7 +12,7 @@ class ConfigController extends Controller
//获取站点配置信息
public function GetConfigInfo(){
$configs = new ConfigService();
return $configs->GetConfigInfo(['站点名称','站点图片','存款利率','管理员手机号']);
return $configs->GetConfigInfo(['站点名称','站点图片','存款利率','管理员手机号','H5业务开关']);
}
public function SaveConfig(){
$info = request('info');

@ -84,7 +84,7 @@ class MemberController
}
}
$memberInfo->first_name_char = !empty($memberInfo->name) ? mb_substr($memberInfo->name, 0, 1, 'UTF-8') : '';
$configs=DB::table('configs')->whereIn('label',['存款利率','借款利率'])->get();
$configs=DB::table('configs')->whereIn('label',['存款利率','借款利率','H5业务开关'])->get();
foreach ($configs as $config) {
$memberInfo->{$config->label}=$config->value;
}

@ -172,9 +172,9 @@ class TransactionController
$userid = $request->get('userid');//中间件产生的参数
$amount = request('amount');
$img = request('img');
if (empty($img)) {
return \Yz::echoError1('请上传充值凭证!');
}
// if (empty($img)) {
// return \Yz::echoError1('请上传充值凭证!');
// }
if (empty($amount) || $amount < 10000) {
return \Yz::echoError1('充值金额不能小于10000元');
}

@ -23,45 +23,63 @@
</el-form-item>
</el-col>
<el-col :span="8" style="display:flex;align-items:center;"><el-button type="primary" size="large"
@click="saveInfo({
@click="saveInfo({
'站点名称': configInfo.站点名称,
'站点图片': configInfo.站点图片
})"> </el-button></el-col>
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
业务相关设置
</el-col>
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
<el-form-item label="存款年化收益率">
<el-input size="large" v-model="configInfo." placeholder="存款年化收益率"
style=" margin: auto 20px;" />
<span class="tishi">*注意此处设置的是年化收益率</span>
</el-form-item>
</el-col>
<el-col :span="8" style="display:flex;align-items:center;"><el-button type="primary" size="large"
@click="saveInfo({
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
业务相关设置
</el-col>
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
<el-form-item label="存款年化收益率">
<el-input size="large" v-model="configInfo." placeholder="存款年化收益率"
style=" margin: auto 20px;" />
<span class="tishi">*注意此处设置的是年化收益率</span>
</el-form-item>
</el-col>
<el-col :span="8" style="display:flex;align-items:center;"><el-button type="primary" size="large"
@click="saveInfo({
'存款利率': configInfo.存款利率,
})"> </el-button></el-col>
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
<el-form-item label="管理员手机号">
<el-input size="large" v-model="configInfo." placeholder="管理员手机号"
style=" margin: auto 20px;" />
<span class="tishi">*设置管理员手机号充值提现等短信通知会发送到此手机</span>
</el-form-item>
</el-col>
<el-col :span="8" style="display:flex;align-items:center;"><el-button type="primary" size="large"
@click="saveInfo({
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
<el-form-item label="管理员手机号">
<el-input size="large" v-model="configInfo." placeholder="管理员手机号"
style=" margin: auto 20px;" />
<span class="tishi">*设置管理员手机号充值提现等短信通知会发送到此手机</span>
</el-form-item>
</el-col>
<el-col :span="8" style="display:flex;align-items:center;"><el-button type="primary" size="large"
@click="saveInfo({
'管理员手机号': configInfo.管理员手机号,
})"> </el-button></el-col>
</el-row>
</el-row>
<el-row style="padding: 20px;margin:10px ;">
<el-col :span="16">
<el-form-item label="H5业务开关">
<div v-if="configInfo.H5业务开关" style="margin-left: 20px;margin-right: 20px;">
<div v-for="(value, key) in configInfo.H5业务开关" :key="key" style="display: flex; align-items: center; margin-bottom: 10px;">
<span style="margin-right: 20px;">{{ key }}</span>
<el-switch
v-model="configInfo.H5业务开关[key]"
:active-value="1"
:inactive-value="0"
@change="handleH5SwitchChange(key, $event)"
/>
</div>
</div>
<span class="tishi">*控制H5端各项业务功能的开启与关闭</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
@ -92,23 +110,28 @@
configInfo.value.站点图片 = res.data
}
//
const GetConfig=()=>{
loading.value=true
const GetConfig = () => {
loading.value = true
GetConfigInfo().then(res => {
loading.value=false
if(res.status){
configInfo.value.站点名称=res.data.站点名称
configInfo.value.站点图片=res.data.站点图片
logo.value=import.meta.env.VITE_APP_FILE+configInfo.value.站点图片
configInfo.value.存款利率=res.data.存款利率
configInfo.value.管理员手机号=res.data.管理员手机号
}
loading.value = false
if (res.status) {
configInfo.value.站点名称 = res.data.站点名称
configInfo.value.站点图片 = res.data.站点图片
logo.value = import.meta.env.VITE_APP_FILE + configInfo.value.站点图片
configInfo.value.存款利率 = res.data.存款利率
configInfo.value.管理员手机号 = res.data.管理员手机号
configInfo.value.H5业务开关 = JSON.parse(res.data.H5业务开关)
console.log(configInfo.value)
}
})
}
//
let configInfo=ref({
name:'',
logo:''
let configInfo = ref({
name: '',
logo: '',
'H5业务开关': {}
});
const saveInfo = (data) => {
loading.value = true
@ -121,45 +144,50 @@
message: '保存成功',
type: 'success',
})
setTimeout(() => {
location.reload();
}, 500)
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(()=>{
//H5
const handleH5SwitchChange = (key, value) => {
//H5
const data = {
'H5业务开关': JSON.stringify(configInfo.value.H5业务开关)
}
saveInfo(data)
}
onMounted(() => {
GetConfig()
})
</script>
<style scoped>
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
.avatar-uploader .avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
border-color: var(--el-color-primary);
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 50px;
height: 50px;
text-align: center;
font-size: 28px;
color: #8c939d;
width: 50px;
height: 50px;
text-align: center;
}
</style>

@ -1,11 +1,5 @@
{
"pages": [{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "会员管理",
"navigationStyle": "custom"
}
},
"pages": [
{
"path" : "pages/login",
"style" :

@ -1,64 +1,6 @@
<template>
<view class="container">
<view class="top">
<view class="top_left" @click="ToUserList('expend')">
<view style="display: flex;margin-top: 60rpx;">
<view>收费</view>
<!-- <uni-icons type="wallet"
style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;" size="24"></uni-icons> -->
</view>
<view style="padding-top: 20rpx;text-align: center;">
<uni-icons type="wallet" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
size="99"></uni-icons>
</view>
</view>
<view class="top_right">
<view class="top_right1" @click="goto('/pages/user/user_add')">
<view style="display: flex;">
<view>新建</view>
<!-- <uni-icons type="personadd" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
size="24"></uni-icons> -->
</view>
<view style="text-align: center;">
<uni-icons type="personadd" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
size="60"></uni-icons>
</view>
</view>
<view class="top_right2" @click="ToUserList('recharge')">
<view style="display: flex;">
<view>充值</view>
<!-- <uni-icons type="vip" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
size="24"></uni-icons> -->
</view>
<view style="text-align: center;">
<uni-icons type="vip" style="color: #fff;margin-top: 4rpx;margin-left: 4rpx;"
size="60"></uni-icons>
</view>
</view>
</view>
</view>
<view style="padding: 15rpx;">
<view class="title">
<view>今日流水</view><uni-icons type="map" style="color: #00BBF9;margin-top: 2rpx;margin-left: 4rpx;"
size="22"></uni-icons>
</view>
<view class="bottom">
<uni-list>
<view v-for="(item,index) in List" :key="index">
<uni-list-item showExtraIcon="true" :extraIcon="icon_chongzhi" v-if="item.type==1"
:title="`充值${item.change_money}`" :note="item.name"
:rightText="item.created_at.slice(-8)"></uni-list-item>
<uni-list-item showExtraIcon="true" :extraIcon="icon_xiaofei" v-if="item.type==2"
:title="`${item.desc}${item.change_money}`" :note="item.name"
:rightText="item.created_at.slice(-8)"></uni-list-item>
</view>
</uni-list>
<view v-if="List.length==0" style="font-size: 28rpx;color: #ccc;text-align: center;padding-top: 20rpx;">
今日暂无记录
</view>
</view>
</view>
</view>
</template>
@ -72,31 +14,10 @@
onShow
} from "@dcloudio/uni-app"
let icon_chongzhi = ref({
color: '#FF8A5B',
size: '28',
type: 'vip'
});
let icon_xiaofei = ref({
color: '#26CED0',
size: '28',
type: 'hand-up'
});
const ToUserList = (type) => {
sessionStorage.setItem('userlist_type', type)
uni.switchTab({
url: '/pages/user/list'
})
}
const goto = (page) => {
uni.navigateTo({
url: page
})
}
let List = ref([]);
onShow(() => {
sessionStorage.setItem('userlist_type', '')
})
</script>
@ -107,62 +28,5 @@
background-color: #fff;
}
.top {
display: flex;
justify-content: space-around;
}
.top_left {
border: 1rpx solid #ccc;
width: 240rpx;
padding: 40rpx;
border-radius: 20rpx;
height: 400rpx;
font-size: 50rpx;
font-weight: 700;
background-color: #26CED0;
color: #fff;
}
.top_right {
font-size: 40rpx;
}
.top_right1 {
border: 1rpx solid #ccc;
width: 240rpx;
padding: 40rpx;
border-radius: 20rpx;
height: 145rpx;
font-weight: 700;
background-color: #00BBF9;
color: #fff;
}
.top_right2 {
border: 1rpx solid #ccc;
width: 240rpx;
padding: 40rpx;
border-radius: 20rpx;
margin-top: 28rpx;
height: 145rpx;
font-weight: 700;
background-color: #FF8A5B;
color: #fff;
}
.title {
font-size: 35rpx;
font-weight: 700;
margin-top: 10rpx;
margin-bottom: 18rpx;
color: #00BBF9;
display: flex;
}
.bottom {
height: calc(100vh - 720rpx);
overflow: scroll;
}
</style>

@ -147,13 +147,6 @@
// return;
// }
if (!imageUrl.value) {
uni.showToast({
title: '请上传充值截图',
icon: 'none'
});
return;
}
TransactionRecharge({
amount:amount.value,

@ -137,6 +137,7 @@
MemberGetInfo().then(res => {
if (res.status) {
userInfo.value=res.data.info
userInfo.value.H5业务开关=JSON.parse(userInfo.value.H5业务开关)
}
})
}
@ -150,16 +151,37 @@
})
}
const RechargeClick=()=>{
if(userInfo.value.H5业务开关.充值!==1){
uni.showToast({
title: '此业务暂未开放',
icon: 'none'
});
return false
}
uni.navigateTo({
url:'/pages/user/recharge'
})
}
const WithdrawClick=()=>{
if(userInfo.value.H5业务开关.提现!==1){
uni.showToast({
title: '此业务暂未开放',
icon: 'none'
});
return false
}
uni.navigateTo({
url:'/pages/user/withdraw?mp='+userInfo.value.balance
})
}
const LoanClick=()=>{
if(userInfo.value.H5业务开关.借款!==1){
uni.showToast({
title: '此业务暂未开放',
icon: 'none'
});
return false
}
uni.navigateTo({
url:'/pages/user/loan?rate='+userInfo.value.借款利率
})

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/h5/assets/uni.4bcf8a6a.css">
<link rel="stylesheet" href="/h5/assets/uni.c9ca5d04.css">
<meta charset="UTF-8" />
<script>
@ -14,7 +14,7 @@
<title>MemberMngr</title>
<!--preload-links-->
<!--app-context-->
<script type="module" crossorigin src="/h5/assets/index-D8Ix7A2O.js"></script>
<script type="module" crossorigin src="/h5/assets/index-BxY9v43b.js"></script>
<link rel="stylesheet" crossorigin href="/h5/assets/index-C67uVxTw.css">
</head>
<body>

Loading…
Cancel
Save