| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="form_box">
- <el-form :model="form" size="small" ref="form" label-width="300px">
- <el-card shadow="never">
- <div slot="header">
- <span>基础配置</span>
- </div>
- <el-row>
- <el-col :span="16">
- <el-form-item label="门店优惠券是否展示到前端门店列表页面">
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="form.is_show_coupon"
- >
- </el-switch>
- </el-form-item>
- </el-col>
- </el-row>
- </el-card>
- </el-form>
- <el-button type="primary" class="button-item" size="small" style="margin-top: 20px;" :loading=btnLoading @click="onSubmit">提交</el-button>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- form: {
- is_show_coupon: 1
- },
- }
- },
- methods: {
- onSubmit() {
- this.$refs.form.validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- let para = Object.assign(this.form);
- request({
- params: {
- r: 'store/client/coupon/setting'
- },
- data: para,
- method: 'post'
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code === 0) {
- this.$message({
- message: e.data.msg,
- type: 'success'
- });
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.btnLoading = false;
- this.$message.error(e.data.msg);
- });
- }
- });
- },
- getList() {
- this.loading = true;
- request({
- params: {
- r: 'store/client/coupon/setting'
- },
- }).then(e => {
- this.loading = false;
- if (e.data.code === 0) {
- this.form = e.data.data;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- },
- mounted: function() {
- this.getList();
- }
- })
- </script>
|