chenwei
wangmingchuan 10 months ago
commit 5fcfb45d49
  1. 2
      package.json
  2. 28
      src/api/invite/invite.js
  3. 14
      src/components/GlobalFooter/index.vue
  4. 109
      src/views/market/Invite.vue

@ -6,7 +6,7 @@
"serve": "vue-cli-service serve",
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint",
"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint",
"build:preview": "vue-cli-service build --mode preview",
"lint:nofix": "vue-cli-service lint --no-fix"
},

@ -0,0 +1,28 @@
import { axios } from '@/utils/request'
// api接口列表
const api = {
info: '/invite/getConfig',
edit: '/invite/editConfig',
}
// 列表记录
export function info(params) {
return axios({
url: api.info,
method: 'post',
params,
})
}
/**
* 更新
* @param {*} data
*/
export function edit(data) {
return axios({
url: api.edit,
method: 'post',
data,
})
}

@ -18,17 +18,17 @@ import { GlobalFooter } from '@/layouts/ProLayout'
export default {
name: 'ProGlobalFooter',
components: {
GlobalFooter
GlobalFooter,
},
data () {
data() {
return {
visibility: false,
copyright: 'Copyright © 2021 萤火科技 |',
copyright: 'Copyright © 2024 仁舟网络 |',
link: {
text: 'YIOVO.COM',
url: 'https://www.yiovo.com'
}
text: 'njrenzhou.com',
url: 'https://www.saas.njrenzhou.com/',
},
}
}
},
}
</script>

@ -0,0 +1,109 @@
<template>
<a-card :bordered="false">
<div class="card-title">邀请设置</div>
<a-spin :spinning="isLoading">
<a-form-model ref="myForm" class="my-form" :model="form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-model-item label="赠送优惠券" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="couponId">
<SelectCoupon :multiple="false" v-model="form.coupon_id" />
<div class="form-item-help">
<small>请先确保优惠券剩余数量充足否则将会导致发送失败</small>
</div>
</a-form-model-item>
<a-form-item label="首单返利" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="one_order_rate">
<a-input-number :min="0" :max="9.9" :precision="1" v-model="form.one_order_rate" />
<span class="ml-5">%</span>
<p class="form-item-help">
<small>返利率范围 0-9.98代表返利8%0代表不返利</small>
</p>
</a-form-item>
<a-form-item label="赠送积分" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
:min="0"
v-decorator="['integral', { initialValue: 1, rules: [{ message: '请输入积分' }] }]"
v-model="form.integral"
/>
</a-form-item>
<a-form-model-item :wrapperCol="{ span: wrapperCol.span, offset: labelCol.span }">
<a-button type="primary" :loading="confirmLoading" @click="handleSubmit">保存</a-button>
</a-form-model-item>
</a-form-model>
</a-spin>
</a-card>
</template>
<script>
import { cloneDeep } from 'lodash'
import { SelectCoupon } from '@/components'
import * as InviteApi from '@/api/invite/invite'
//
const defaultData = {
coupon_id: 0,
one_order_rate: 0,
integral: 0,
}
export default {
components: {
SelectCoupon,
},
data() {
return {
//
labelCol: { span: 4 },
//
wrapperCol: { span: 12 },
//
isLoading: false,
confirmLoading: false,
//
form: cloneDeep(defaultData),
}
},
//
created() {
this.handleInfo()
},
methods: {
//
handleSubmit(e) {
const app = this
app.$refs.myForm.validate((valid) => {
if (valid) {
this.confirmLoading = true
InviteApi.edit({ form: app.form })
.then((result) => {
app.$message.success(result.message, 1.5)
// app.form = cloneDeep(defaultData)
//
// setTimeout(() => this.$router.push('./receive/index'), 1200)
})
.finally((result) => (app.confirmLoading = false))
}
})
},
handleInfo() {
InviteApi.info()
.then((result) => {
this.form.integral = result.data.info.integral
this.form.one_order_rate = result.data.info.one_order_rate
this.form.coupon_id = result.data.info.coupon_id
})
.finally(() => (this.isLoading = false))
},
},
}
</script>
<style lang="less" scoped>
.ant-form-item {
.ant-form-item {
margin-bottom: 0;
}
}
/deep/.ant-form-item-control {
padding-left: 10px;
.ant-form-item-control {
padding-left: 0;
}
}
</style>
Loading…
Cancel
Save