| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?php
- ?>
- <style>
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 0;
- }
- .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 .el-form-item {
- width: 300px;
- margin: 20px auto;
- }
- .form_box {
- background-color: #f3f3f3;
- padding: 0 0 20px;
- }
- .button-item {
- /* margin-top: 12px; */
- padding: 9px 25px;
- }
- .el-input-group__append {
- background-color: #fff;
- color: #353535;
- }
- .el-radio-group {
- font-size: 13px;
- line-height: 32px;
- }
- </style>
- <div id="app" v-cloak>
- <div style="display:flex;justify-content:space-between;align-items:center;background-color:#FFF;padding: 10px 20px;font-weight:800px;font-size:15px;margin-bottom:10px;">
- <div>基础设置</div>
- <div>
- <el-button :loading="btnLoading" class="button-item" type="primary" @click="store('ruleForm')" size="small">
- 保存
- </el-button>
- </div>
- </div>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 0px;">
- <el-form :model="ruleForm" size="small" :rules="rules" ref="ruleForm" label-width="160px">
- <el-card shadow="never">
- <div>
- <el-row>
- <el-col :span="16">
- <el-form-item label="限制收货信息">
- <div>
- <el-switch v-model="ruleForm.is_limit_address" :active-value="1" :inactive-value="0">
- </el-switch>
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-form>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- ruleForm: {
- is_limit_address: 0, //是否启用 限制收货地址
- },
- rules: {
- },
- }
- },
- mounted: function() {
- this.loadData()
- },
- watch: {
- },
- methods: {
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'score-mall/setting/index',
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- Object.assign(this.ruleForm, e.data.data);
- }
- }).catch(e => {
- this.loading = false;
- })
- },
- store(formName) {
- this.btnLoading = true;
- request({
- params: {
- r: 'score-mall/setting/index',
- },
- method: 'post',
- data: this.ruleForm
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error(e);
- this.btnLoading = false;
- })
- },
- }
- });
- </script>
|