|
|
@@ -7,53 +7,28 @@
|
|
|
<span>注册管理</span>
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
- <el-table
|
|
|
- :data="accountRegistryList"
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- prop="enabled"
|
|
|
- label="是否启用注册"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.enabled" :type="'warning'" disable-transitions>
|
|
|
- 启用
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else :type="'danger'" disable-transitions>
|
|
|
- 禁用
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="rule"
|
|
|
- label="注册规则"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- fixed="right"
|
|
|
- label="操作"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="warning"
|
|
|
- @click="onApprove(scope.row)"
|
|
|
- >编辑</el-button>
|
|
|
- <el-button
|
|
|
- v-if="scope.row.enabled"
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="onDecline(scope.row)"
|
|
|
- >禁用</el-button>
|
|
|
- <el-button
|
|
|
- v-else
|
|
|
- size="mini"
|
|
|
- type="danger"
|
|
|
- @click="onDecline(scope.row)"
|
|
|
- >启用</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-form ref="form" :model="accountRegistry" label-width="100px">
|
|
|
+ <el-form-item label="开放注册">
|
|
|
+ <el-input v-model="accountRegistry.enabled" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ <el-button size="mini" type="info" @click="onSetRegistry()">
|
|
|
+ <span v-if="!accountRegistry.enabled">启用</span>
|
|
|
+ <span v-else>禁用</span>
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图形验证码">
|
|
|
+ <el-input v-model="accountRegistry.captchaCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="短信验证码">
|
|
|
+ <el-input v-model="accountRegistry.verifyCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="启用验证码">
|
|
|
+ <el-input v-model="accountRegistry.enableCode" style="width: 50%; padding-right: 10px" readonly />
|
|
|
+ <el-button size="mini" type="info" @click="onSetCode()">
|
|
|
+ <span v-if="!accountRegistry.enableCode">启用</span>
|
|
|
+ <span v-else>禁用</span>
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
@@ -96,7 +71,7 @@
|
|
|
import { userMixin } from 'assets/js/mixin'
|
|
|
import {
|
|
|
getAccountRegistry,
|
|
|
- getChargeReq, getVipPlan
|
|
|
+ getChargeReq, getVipPlan, setAccountCode, setAccountRegistry
|
|
|
} from '@/api/admin'
|
|
|
|
|
|
export default {
|
|
|
@@ -106,7 +81,7 @@ export default {
|
|
|
return {
|
|
|
chargeReqList: [],
|
|
|
vipPlanList: [],
|
|
|
- accountRegistryList: []
|
|
|
+ accountRegistry: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -117,22 +92,17 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getData() {
|
|
|
- this.accountRegistryList = []
|
|
|
- getAccountRegistry().then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.accountRegistryList.push(resp.data)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- getChargeReq(1).then(resp => {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+ getVipPlan().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
- this.chargeReqList = resp.data
|
|
|
+ this.vipPlanList = resp.data
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- getVipPlan().then(resp => {
|
|
|
+ },
|
|
|
+ getAccountRegistryWrapper() {
|
|
|
+ getAccountRegistry().then(resp => {
|
|
|
if (resp.code === 0) {
|
|
|
- this.vipPlanList = resp.data
|
|
|
+ this.accountRegistry = resp.data
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -141,6 +111,28 @@ export default {
|
|
|
},
|
|
|
onDecline(row) {
|
|
|
this.$message.info('拒绝充值' + row)
|
|
|
+ },
|
|
|
+ onSetRegistry() {
|
|
|
+ const payload = {}
|
|
|
+ payload.enabled = !this.accountRegistry.enabled
|
|
|
+ setAccountRegistry(payload).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSetCode() {
|
|
|
+ const payload = {}
|
|
|
+ payload.enabled = !this.accountRegistry.enableCode
|
|
|
+ setAccountCode(payload).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAccountRegistryWrapper()
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|