| | |
| | | <script> |
| | | |
| | | import UIcon from '@/uview-components/uview-ui/components/u-icon/u-icon.vue'; |
| | | |
| | | import * as API_GOODS from "@/api/goods.js"; |
| | | |
| | | export default { |
| | | components: { UIcon }, |
| | | data() { |
| | |
| | | formData: { |
| | | waterfall: false, // 布局方向切换 |
| | | status: 'loading', // 加载状态 |
| | | }, |
| | | params: { |
| | | pageNumber: 1, |
| | | pageSize: 10, |
| | | }, |
| | | data: [ |
| | | { |
| | |
| | | tipShow: false // 是否显示顶部提示框 |
| | | }; |
| | | }, |
| | | onLoad() { }, |
| | | onLoad() { |
| | | }, |
| | | onShow() { |
| | | if (this.$options.filters.tipsToLogin()) { |
| | | this.getGoodsList(); |
| | | } |
| | | }, |
| | | methods: { |
| | | load(data, ended) { |
| | | if (ended) { |
| | | this.formData.status = 'noMore' |
| | | } |
| | | |
| | | getGoodsList() { |
| | | uni.showLoading(); |
| | | API_GOODS.getStoreGoods( |
| | | this.params.pageNumber, |
| | | this.params.pageSize |
| | | ).then((res) => { |
| | | this.data = res.data.result.records; |
| | | |
| | | if (this.$store.state.isShowToast) { uni.hideLoading() }; |
| | | }); |
| | | }, |
| | | addGoods(id) { |
| | | console.log("addGoods:" + id); |
| | | |
| | | uni.navigateTo({ |
| | | url: `/pages/goods-manager/addGoods/addGoods${id ? "?id=" + id : ""}`, |
| | | }); |