Browse Source

bug--商品收藏和足迹添加刷新

master
taochengbo 4 years ago committed by xuwenbo
parent
commit
1534620e16
  1. 20
      src/views/shop/collect/index.vue
  2. 20
      src/views/shop/foot/index.vue

20
src/views/shop/collect/index.vue

@ -1,5 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="head-container">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@ -70,6 +79,7 @@
</template> </template>
<script> <script>
import initData from '@/mixins/crud'
import crudYxStoreProductRelation from '@/api/yxStoreProductRelation' import crudYxStoreProductRelation from '@/api/yxStoreProductRelation'
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
@ -84,7 +94,7 @@ const defaultForm = { id: null, uid: null, productId: null, type: null, category
export default { export default {
name: 'YxStoreProductRelation', name: 'YxStoreProductRelation',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList}, components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()], mixins: [presenter(defaultCrud), header(), form(defaultForm), crud(),initData],
data() { data() {
return { return {
query: { query: {
@ -110,6 +120,14 @@ export default {
watch: { watch: {
}, },
methods: { methods: {
beforeInit() {
this.url = 'api/yxStoreProductRelation'
const sort = 'create_time,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
this.params[query.type] = 'collect'
return true
},
// //
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
const query = this.query const query = this.query

20
src/views/shop/foot/index.vue

@ -1,5 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="head-container">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@ -70,6 +79,7 @@
</template> </template>
<script> <script>
import initData from '@/mixins/crud'
import crudYxStoreProductRelation from '@/api/yxStoreProductRelation' import crudYxStoreProductRelation from '@/api/yxStoreProductRelation'
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
@ -84,7 +94,7 @@ const defaultForm = { id: null, uid: null, productId: null, type: null, category
export default { export default {
name: 'YxStoreProductRelation', name: 'YxStoreProductRelation',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList}, components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()], mixins: [presenter(defaultCrud), header(), form(defaultForm), crud(),initData],
data() { data() {
return { return {
query:{ query:{
@ -110,6 +120,14 @@ export default {
watch: { watch: {
}, },
methods: { methods: {
beforeInit() {
this.url = 'api/yxStoreProductRelation'
const sort = 'create_time,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
this.params[query.type] = 'foot'
return true
},
// //
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
const query = this.query const query = this.query

Loading…
Cancel
Save