| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-image');
- ComponentHelper::loadComponentView('com-rich-text');
- ?>
- <style>
- .info-title {
- margin-left: 20px;
- color: #ff4544;
- }
- .red {
- display:inline-block;
- padding: 0 25px;
- color: #ff4544;
- }
- .info-title span {
- color: #3399ff;
- cursor: pointer;
- font-size: 13px;
- }
- .button-item {
- margin-top: 20px;
- padding: 9px 25px;
- }
- .el-tabs__header {
- padding: 0 20px;
- height: 56px;
- line-height: 56px;
- background-color: #fff;
- margin-bottom: 10px;
- }
- .form-body {
- padding: 10px 20px;
- background-color: #fff;
- margin-bottom: 20px;
- }
- .red {
- color: #ff4544;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- </style>
- <section id="app" v-cloak>
- <el-card style="border:0" shadow="never" body-style="background-color: #f3f3f3;padding: 0 0;"
- v-loading="loading">
- <el-tabs v-model="activeName">
- <el-tab-pane label="基础设置" class="form-body" name="first">
- <div class="text item" style="width:100%">
- <el-form :model="form" label-width="150px" :rules="rule" ref="form">
- <el-form-item label="砍价者佣金发放" prop="grant_type">
- <el-radio-group v-model="form.grant_type">
- <el-radio label="1">订单支付发放</el-radio>
- <el-radio label="2">订单完成发放</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="活动规则" prop="rule">
- <com-rich-text style="width: 750px" :simple-attachment="true" v-model="form.rule"></com-rich-text>
- </el-form-item>
- <el-button class="button-item" :loading="btnLoading" type="primary" @click="store('form')" size="small">保存</el-button>
- </el-form>
- </div>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- </section>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- form: {
- title : '',
- grant_type : '1',
- share_title:"",
- share_pic:'',
- rule : '',
- notify_type:''
- },
- notify_type:[],
- rule: {
- title: [{
- required: true,
- message: '请输入活动标题',
- trigger: 'change'
- }, ],
- },
- is_show: false,
- activeName: 'first',
- };
- },
- methods: {
- //保存基础设置
- store(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- this.btnLoading = true;
- this.form.notify_type = this.notify_type;
- request({
- params: {
- r: 'bargain/default/setting'
- },
- method: 'post',
- data: this.form
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- } else {
- this.$message.error(e.data.msg);
- }
- });
- } else {
- this.btnLoading = false;
- console.log('error submit!!');
- return false;
- }
- })
- },
- //加载数据
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'bargain/default/setting'
- },
- method: 'get'
- }).then(e => {
- this.loading = false;
- this.is_show = true;
- if (e.data.code == 0) {
- this.form = e.data.data.list;
- this.form.grant_type = this.form.grant_type.toString();
- }
- }).catch(e => {
- this.loading = false;
- });
- },
- },
- created() {
- this.loadData();
- },
- })
- </script>
|