| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473 |
- <div id="app" v-cloak>
- <el-card
- v-loading="loading"
- style="border:0; min-width: 800px;"
- shadow="never"
- body-style="background-color: #f3f3f3;padding: 10px 0 0;"
- >
- <div slot="header">
- <span>配置</span>
- </div>
- <el-form
- :model="formData"
- ref="elForm"
- label-width="172px"
- style="position: relative"
- size="small"
- :rules="rules"
- >
- <el-row>
- <el-col :span="24">
- <div class="form-body">
- <!-- 应用ID -->
- <el-form-item label="APPID" prop="app_id">
- <el-input v-model="formData.app_id" placeholder="请输入应用ID" clearable :style="{width: '100%'}"></el-input>
- </el-form-item>
- <!-- 应用私钥 -->
- <el-form-item label="应用私钥" prop="private_key">
- <el-input v-model="formData.private_key" type="textarea" placeholder="请输入应用私钥"
- :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
- </el-form-item>
- <!-- 支付宝公钥证书 -->
- <el-form-item label="支付宝公钥证书" prop="alipay_public_key">
- <el-input v-model="formData.alipay_public_key" type="textarea" placeholder="请输入支付宝公钥证书"
- :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
- </el-form-item>
- <!-- 应用公钥证书 -->
- <el-form-item label="应用公钥证书" prop="app_cert">
- <el-input v-model="formData.app_cert" type="textarea" placeholder="请输入应用公钥证书"
- :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
- </el-form-item>
- <!-- 支付宝根证书 -->
- <el-form-item label="支付宝根证书" prop="root_cert">
- <el-input v-model="formData.root_cert" type="textarea" placeholder="请输入支付宝根证书"
- :autosize="{minRows: 8, maxRows: 8}" :style="{width: '100%'}"></el-input>
- </el-form-item>
- <el-form-item label="提现免审核">
- <div>
- <el-switch v-model="formData.withdrawal_no_check" :active-value="1" :inactive-value="0"></el-switch>
- </div>
- <div class="tips-text" style="line-height: 24px;">
- 开启后,会员进行提现,后台无需审核,直接调用打款流程
- </div>
- </el-form-item>
- <el-form-item size="large">
- <el-button type="primary" size="small" @click="submitForm">提交</el-button>
- <el-button size="small" @click="resetForm">重置</el-button>
- </el-form-item>
- </div>
- </el-col>
- </el-row>
- </el-form>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading:false,
- submitLoading:false,
- formData: {
- app_id : undefined,
- name : undefined,
- private_key : undefined,
- public_key : undefined,
- alipay_public_key : undefined,
- app_cert : undefined,
- root_cert : undefined,
- use_scene : [],
- withdrawal_no_check:0,
- },
- rules: {
- app_id: [{
- required: true,
- message: '请输入APPID',
- trigger: 'blur'
- }],
- private_key: [{
- required: true,
- message: '请输入应用私钥',
- trigger: 'blur'
- }],
- app_public_key: [{
- required: true,
- message: '请输入应用公钥证书',
- trigger: 'blur'
- }],
- alipay_public_key: [{
- required: true,
- message: '请输入支付宝公钥证书',
- trigger: 'blur'
- }],
- app_cert: [{
- required: true,
- message: '请输入应用公钥证书',
- trigger: 'blur'
- }],
- root_cert: [{
- required: true,
- message: '请输入支付宝根证书',
- trigger: 'blur'
- }],
- },
- }
- },
- computed: {},
- watch: {},
- created() {
- this.readConfig()
- },
- mounted() {},
- methods: {
- submitForm() {
- this.$refs['elForm'].validate(valid => {
- if (valid) {
- this.submitLoading = true;
- request({
- params: {
- r: 'alitopay/setting/index',
- },
- method: 'post',
- data: this.formData,
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- });
- } else {
- this.$message.error('部分参数验证不通过');
- }
- })
- },
- resetForm() {
- this.$refs['elForm'].resetFields()
- },
- readConfig(){
- request({
- params: {
- r: 'alitopay/setting/read',
- },
- method: 'get',
- }).then(e => {
- this.submitLoading = false
- if (e.data.code === 0 && e.data.data) {
- this.formData = e.data.data.setting
- }
- }).catch(e => {
- })
- },
- }
- });
- </script>
- <style>
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .title {
- margin-top: 10px;
- padding: 18px 20px;
- border-top: 1px solid #F3F3F3;
- border-bottom: 1px solid #F3F3F3;
- background-color: #fff;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .title {
- margin-top: 10px;
- padding: 18px 20px;
- border-top: 1px solid #F3F3F3;
- border-bottom: 1px solid #F3F3F3;
- background-color: #fff;
- }
- .form-body {
- background-color: #fff;
- padding: 20px 50% 20px 0;
- }
- .button-item {
- padding: 9px 25px;
- }
- .form-body .item {
- width: 300px;
- margin-bottom: 50px;
- margin-right: 25px;
- }
- .item-img {
- height: 550px;
- padding: 25px 10px;
- border-radius: 30px;
- border: 1px solid #CCCCCC;
- background-color: #fff;
- }
- .item .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .left-setting-menu {
- width: 260px;
- }
- .left-setting-menu .el-form-item {
- height: 60px;
- padding-left: 20px;
- display: flex;
- align-items: center;
- margin-bottom: 0;
- cursor: pointer;
- }
- .left-setting-menu .el-form-item .el-form-item__label {
- cursor: pointer;
- }
- .left-setting-menu .el-form-item.active {
- background-color: #F3F5F6;
- border-top-left-radius: 10px;
- width: 105%;
- border-bottom-left-radius: 10px;
- }
- .left-setting-menu .el-form-item .el-form-item__content {
- margin-left: 0 !important
- }
- .no-radius {
- border-top-left-radius: 0 !important;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- }
- .reset {
- position: absolute;
- top: 3px;
- left: 90px;
- }
- .app-tip {
- position: absolute;
- right: 24px;
- top: 16px;
- height: 72px;
- line-height: 72px;
- max-width: calc(100% - 78px);
- }
- .app-tip:before {
- content: ' ';
- width: 0;
- height: 0;
- border-color: inherit;
- position: absolute;
- top: -32px;
- right: 100px;
- border-width: 16px;
- border-style: solid;
- }
- .tip-content {
- display: block;
- white-space: nowrap;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0 28px;
- font-size: 28px;
- }
- .btn-abs{
- position: absolute;
- top: 12px;
- right: 18px;
- }
- .form-body .app-share {
- padding-top: 12px;
- border-top: 1px solid #e2e2e2;
- margin-top: -20px;
- }
- .form-body .app-share .app-share-bg {
- position: relative;
- width: 310px;
- height: 360px;
- background-repeat: no-repeat;
- background-size: contain;
- background-position: center
- }
- .form-body .app-share .app-share-bg .title {
- width: 160px;
- height: 29px;
- line-height: 1;
- word-break: break-all;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- .form-body .app-share .app-share-bg .pic-image {
- background-repeat: no-repeat;
- background-position: 0 0;
- background-size: cover;
- width: 160px;
- height: 130px;
- }
- .form-body .tab_tpis {
- font-size: 12px;
- color: #737373;
- }
- .redio-center {
- display: flex;
- align-items: center;
- }
- .redio-input {
- margin-left: -28px;
- margin-right: 20px;
- }
- .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
- /* margin-bottom: 0; */
- }
- </style>
|