商户管理

This commit is contained in:
yanran200730
2022-07-01 17:49:20 +08:00
parent 6447668067
commit 85a52d3d9f
2 changed files with 114 additions and 49 deletions

View File

@@ -24,53 +24,67 @@
</div>
</div>
</div>
<div class="btn">新增商户</div>
<div class="btn" @click="linkTo('./add')">新增商户</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
import {mapState} from 'vuex'
export default {
name: 'AppMerchantManage',
appName: '商户管理',
data() {
return {
keyword: '',
current: 1,
pages: 2,
list: []
}
},
computed: {...mapState(['user'])},
created() {
export default {
name: 'AppMerchantManage',
appName: '商户管理',
data() {
return {
keyword: '',
current: 1,
pages: 2,
list: []
}
},
},
onShow() {
document.title = "商户管理"
},
methods: {
getList() {
if(this.current > this.pages) return
this.$http.post('/app/appresident/list', null, {
params: {
size: 10,
current: this.current,
con: this.keyword,
},
}).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
computed: {...mapState(['user'])},
onLoad () {
this.getList()
uni.$on('update', () => {
this.current = 1
this.getList()
})
},
},
onReachBottom() {
this.current ++
this.getList()
onShow() {
document.title = "商户管理"
},
methods: {
getList() {
if(this.current > this.pages) return
this.$http.post('/app/appcompany/list', null, {
params: {
size: 10,
current: this.current,
con: this.keyword,
},
}).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
linkTo (url) {
uni.navigateTo({
url
})
}
},
onReachBottom() {
this.current ++
this.getList()
}
}
}
</script>
<style lang="scss" scoped>