积分设置优化

master
Chopper 2022-01-21 16:20:15 +08:00
parent 15456ae377
commit c8a0619141
1 changed files with 28 additions and 13 deletions

View File

@ -1,17 +1,24 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="积分比率" prop="money">
<FormItem label="消费1元赠送积分" prop="money">
<Input type="number" v-model="formValidate.money">
<span slot="prepend">1积分=</span>
<span slot="append">人民币</span>
<span slot="append">积分</span>
<!-- <span slot="append">人民币</span>-->
</Input>
</FormItem>
<FormItem label="积分抵扣付款" prop="money">
<Input type="number" v-model="formValidate.money">
<span slot="prepend">积分</span>
<span slot="append"> = 1 人民币</span>
</Input>
</FormItem>
<FormItem label="注册账号" prop="register">
<Input type="number" v-model="formValidate.register">
<span slot="append">积分</span>
<span slot="append">积分</span>
</Input>
</FormItem>
<!-- <FormItem label="登录" class="label-item" prop="login">
@ -24,26 +31,28 @@
<FormItem label="每日签到积分" prop="signIn">
<Input type="number" v-model="formValidate.signIn">
<span slot="append">积分</span>
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem label="订单评价赠送积分" prop="comment">
<Input type="number" v-model="formValidate.comment">
<span slot="append">积分</span>
<span slot="append">积分</span>
</Input>
</FormItem>
<FormItem class="label-item" v-for="(point,index) in formValidate.pointSettingItems" :key="index" :label="'签到设置'+(index+1)">
<FormItem class="label-item" v-for="(point,index) in formValidate.pointSettingItems" :key="index"
:label="'签到设置'+(index+1)">
<div class="label-item">
<InputNumber :min="1" v-model="point.day"></InputNumber>
<InputNumber :min="0" v-model="point.point"></InputNumber>
<InputNumber :min="0" v-model="point.point"></InputNumber>
<Button ghost type="error" @click="delSign(point,index)"></Button>
<span class="ml_10">签到<span class="theme_color">{{point.day}}</span>赠送<span class="theme_color">{{point.point}}</span>积分</span>
<span class="ml_10">签到<span class="theme_color">{{ point.day }}</span>赠送<span
class="theme_color">{{ point.point }}</span>积分</span>
</div>
</FormItem>
@ -58,8 +67,9 @@
</template>
<script>
import { setSetting } from "@/api/index";
import { handleSubmit } from "./validate";
import {setSetting} from "@/api/index";
import {handleSubmit} from "./validate";
export default {
data() {
return {
@ -101,7 +111,7 @@ export default {
}
this.formValidate.pointSettingItems.push({
point: "0",
day: this.formValidate.pointSettingItems.length ,
day: this.formValidate.pointSettingItems.length,
});
},
//
@ -114,7 +124,7 @@ export default {
this.res[item] += "";
});
this.$set(this, "formValidate", { ...this.res });
this.$set(this, "formValidate", {...this.res});
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
@ -150,22 +160,27 @@ export default {
width: 100px;
margin-right: 5px;
}
> .ivu-input-number:nth-last-of-type(1) {
width: 150px;
margin-right: 5px;
}
> .ivu-input {
width: 100px;
margin: 0 10px;
}
}
/deep/ .ivu-input {
width: 70px !important;
}
.ivu-input-wrapper {
width: 70px;
margin-right: 10px;
}
.label-btns {
/deep/ .ivu-btn {
margin-right: 10px;