积分设置优化

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> <template>
<div class="layout"> <div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate"> <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"> <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> </Input>
</FormItem> </FormItem>
<FormItem label="注册账号" prop="register"> <FormItem label="注册账号" prop="register">
<Input type="number" v-model="formValidate.register"> <Input type="number" v-model="formValidate.register">
<span slot="append">积分</span> <span slot="append">积分</span>
</Input> </Input>
</FormItem> </FormItem>
<!-- <FormItem label="登录" class="label-item" prop="login"> <!-- <FormItem label="登录" class="label-item" prop="login">
@ -24,26 +31,28 @@
<FormItem label="每日签到积分" prop="signIn"> <FormItem label="每日签到积分" prop="signIn">
<Input type="number" v-model="formValidate.signIn"> <Input type="number" v-model="formValidate.signIn">
<span slot="append">积分</span> <span slot="append">积分</span>
</Input> </Input>
</FormItem> </FormItem>
<FormItem label="订单评价赠送积分" prop="comment"> <FormItem label="订单评价赠送积分" prop="comment">
<Input type="number" v-model="formValidate.comment"> <Input type="number" v-model="formValidate.comment">
<span slot="append">积分</span> <span slot="append">积分</span>
</Input> </Input>
</FormItem> </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"> <div class="label-item">
<InputNumber :min="1" v-model="point.day"></InputNumber> <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> <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> </div>
</FormItem> </FormItem>
@ -58,8 +67,9 @@
</template> </template>
<script> <script>
import { setSetting } from "@/api/index"; import {setSetting} from "@/api/index";
import { handleSubmit } from "./validate"; import {handleSubmit} from "./validate";
export default { export default {
data() { data() {
return { return {
@ -101,7 +111,7 @@ export default {
} }
this.formValidate.pointSettingItems.push({ this.formValidate.pointSettingItems.push({
point: "0", point: "0",
day: this.formValidate.pointSettingItems.length , day: this.formValidate.pointSettingItems.length,
}); });
}, },
// //
@ -114,7 +124,7 @@ export default {
this.res[item] += ""; this.res[item] += "";
}); });
this.$set(this, "formValidate", { ...this.res }); this.$set(this, "formValidate", {...this.res});
Object.keys(this.formValidate).forEach((item) => { Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [ this.ruleValidate[item] = [
@ -150,22 +160,27 @@ export default {
width: 100px; width: 100px;
margin-right: 5px; margin-right: 5px;
} }
> .ivu-input-number:nth-last-of-type(1) { > .ivu-input-number:nth-last-of-type(1) {
width: 150px; width: 150px;
margin-right: 5px; margin-right: 5px;
} }
> .ivu-input { > .ivu-input {
width: 100px; width: 100px;
margin: 0 10px; margin: 0 10px;
} }
} }
/deep/ .ivu-input { /deep/ .ivu-input {
width: 70px !important; width: 70px !important;
} }
.ivu-input-wrapper { .ivu-input-wrapper {
width: 70px; width: 70px;
margin-right: 10px; margin-right: 10px;
} }
.label-btns { .label-btns {
/deep/ .ivu-btn { /deep/ .ivu-btn {
margin-right: 10px; margin-right: 10px;