wanghousheng 12 months ago
parent 2e7483df5c
commit fe702a1c94
  1. 6
      package.json
  2. 28
      src/api/invite/invite.js
  3. 14
      src/components/GlobalFooter/index.vue
  4. 112
      src/config/router.config.js
  5. 109
      src/views/market/Invite.vue

@ -3,10 +3,10 @@
"version": "3.0.0",
"private": true,
"scripts": {
"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build": "export 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>

@ -580,6 +580,12 @@ export const asyncRouterMap = [
meta: { title: '满额包邮', keepAlive: false, permission: ['/market/full-free'] },
moduleKey: 'market-fullFree',
},
{
path: '/market/Invite',
component: () => import(/* webpackChunkName: "market" */ '@/views/market/Invite'),
meta: { title: '邀请设置', keepAlive: false, permission: ['/market/Invite'] },
},
],
},
@ -624,39 +630,39 @@ export const asyncRouterMap = [
},
],
},
{
path: '/client/wxofficial',
component: RouteView,
redirect: '/client/wxofficial/setting',
meta: { title: '微信公众号', keepAlive: false, permission: ['/client/wxofficial'] },
moduleKey: 'client-wxofficial',
children: [
{
path: '/client/wxofficial/setting',
component: () => import(/* webpackChunkName: "client" */ '@/views/client/wxofficial/Setting'),
meta: { title: '公众号设置', keepAlive: false, permission: ['/client/wxofficial/setting'] },
},
{
path: '/client/wxofficial/share',
component: () => import(/* webpackChunkName: "client" */ '@/views/client/wxofficial/Share'),
meta: { title: '分享设置', keepAlive: false, permission: ['/client/wxofficial/share'] },
},
],
},
{
path: '/client/h5',
component: RouteView,
redirect: '/client/h5/setting',
meta: { title: 'H5端', keepAlive: false, permission: ['/client/h5'] },
moduleKey: 'client-h5',
children: [
{
path: '/client/h5/setting',
component: () => import(/* webpackChunkName: "client" */ '@/views/client/h5/Setting'),
meta: { title: '站点设置', keepAlive: false, permission: ['/client/h5/setting'] },
},
],
},
// {
// path: '/client/wxofficial',
// component: RouteView,
// redirect: '/client/wxofficial/setting',
// meta: { title: '微信公众号', keepAlive: false, permission: ['/client/wxofficial'] },
// moduleKey: 'client-wxofficial',
// children: [
// {
// path: '/client/wxofficial/setting',
// component: () => import(/* webpackChunkName: "client" */ '@/views/client/wxofficial/Setting'),
// meta: { title: '公众号设置', keepAlive: false, permission: ['/client/wxofficial/setting'] },
// },
// {
// path: '/client/wxofficial/share',
// component: () => import(/* webpackChunkName: "client" */ '@/views/client/wxofficial/Share'),
// meta: { title: '分享设置', keepAlive: false, permission: ['/client/wxofficial/share'] },
// },
// ],
// },
// {
// path: '/client/h5',
// component: RouteView,
// redirect: '/client/h5/setting',
// meta: { title: 'H5端', keepAlive: false, permission: ['/client/h5'] },
// moduleKey: 'client-h5',
// children: [
// {
// path: '/client/h5/setting',
// component: () => import(/* webpackChunkName: "client" */ '@/views/client/h5/Setting'),
// meta: { title: '站点设置', keepAlive: false, permission: ['/client/h5/setting'] },
// },
// ],
// },
{
path: '/client/mp/alipay',
isPlugin: true,
@ -939,26 +945,26 @@ export const asyncRouterMap = [
},
],
},
{
path: '/apps/collector',
component: RouteView,
redirect: '/apps/collector/index',
meta: { title: '商品采集', keepAlive: false, permission: ['/apps/collector'] },
moduleKey: 'apps-collector',
isHideChildren: true,
children: [
{
path: '/apps/collector/index',
component: () => import(/* webpackChunkName: "collector" */ '@/views/apps/collector/Index'),
meta: { title: '一键采集', keepAlive: false, permission: ['/apps/collector/index'] },
},
{
path: '/apps/collector/setting',
component: () => import(/* webpackChunkName: "collector" */ '@/views/apps/collector/Setting'),
meta: { title: '接口配置', keepAlive: false, permission: ['/apps/collector/setting'] },
},
],
},
// {
// path: '/apps/collector',
// component: RouteView,
// redirect: '/apps/collector/index',
// meta: { title: '商品采集', keepAlive: false, permission: ['/apps/collector'] },
// moduleKey: 'apps-collector',
// isHideChildren: true,
// children: [
// {
// path: '/apps/collector/index',
// component: () => import(/* webpackChunkName: "collector" */ '@/views/apps/collector/Index'),
// meta: { title: '一键采集', keepAlive: false, permission: ['/apps/collector/index'] },
// },
// {
// path: '/apps/collector/setting',
// component: () => import(/* webpackChunkName: "collector" */ '@/views/apps/collector/Setting'),
// meta: { title: '接口配置', keepAlive: false, permission: ['/apps/collector/setting'] },
// },
// ],
// },
],
},

@ -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