yshop1.4版本发布,新增积分会员功能等,详细看文档介绍

This commit is contained in:
hupeng
2019-12-08 17:03:34 +08:00
parent 17aa0f4676
commit 6d570d39c4
22 changed files with 994 additions and 31 deletions

View File

@ -95,7 +95,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_home_activity',
value: '',
addTime: '',
sort: '',

View File

@ -91,7 +91,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_home_banner',
value: '',
addTime: '',
sort: '',

View File

@ -81,7 +81,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_hot_search',
value: '',
addTime: '',
sort: '',

View File

@ -91,7 +91,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_home_menus',
value: '',
addTime: '',
sort: '',

View File

@ -85,7 +85,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_home_roll_news',
value: '',
addTime: '',
sort: '',

118
src/views/shop/set/sign.vue Normal file
View File

@ -0,0 +1,118 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID"/>
<el-table-column prop="map.day" label="第几天"/>
<el-table-column prop="map.sign_num" label="获取积分"/>
<el-table-column v-if="checkPermission(['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxSystemGroupData'
import eForm from './signform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'sign_day_num' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
day: data.map.day,
sign_num: data.map.sign_num
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,101 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="第几天" >
<el-input v-model="form.day" style="width: 370px;"/>
</el-form-item>
<el-form-item label="获取积分" >
<el-input v-model="form.sign_num" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'sign_day_num',
day: 1,
sign_num: 0
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'sign_day_num',
value: '',
addTime: '',
sort: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -91,7 +91,7 @@ export default {
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: '',
groupName: 'routine_my_menus',
value: '',
addTime: '',
sort: '',