1 line
5.1 KiB
Plaintext
1 line
5.1 KiB
Plaintext
|
{"version":3,"file":"select-popup.js","sources":["../../../../../../../src/modules/mall/chat/components/select-popup.vue","../../../../../../../uniComponent:/RDovQXBwL1dvcmsvYWRkci9hY2RyLXVpL3NyYy9tb2R1bGVzL21hbGwvY2hhdC9jb21wb25lbnRzL3NlbGVjdC1wb3B1cC52dWU"],"sourcesContent":["<template>\r\n <su-popup :show=\"show\" showClose round=\"10\" backgroundColor=\"#eee\" @close=\"emits('close')\">\r\n <view class=\"select-popup\">\r\n <view class=\"title\">\r\n <span>{{ mode == 'goods' ? '我的浏览' : '我的订单' }}</span>\r\n </view>\r\n <scroll-view\r\n class=\"scroll-box\"\r\n scroll-y=\"true\"\r\n :scroll-with-animation=\"true\"\r\n :show-scrollbar=\"false\"\r\n @scrolltolower=\"loadmore\"\r\n >\r\n <view\r\n class=\"item\"\r\n v-for=\"item in state.pagination.data\"\r\n :key=\"item.id\"\r\n @tap=\"emits('select', { type: mode, data: item })\"\r\n >\r\n <template v-if=\"mode == 'goods'\">\r\n <GoodsItem :goodsData=\"item\" />\r\n </template>\r\n <template v-if=\"mode == 'order'\">\r\n <OrderItem :orderData=\"item\" />\r\n </template>\r\n </view>\r\n <uni-load-more :status=\"state.loadStatus\" :content-text=\"{ contentdown: '上拉加载更多' }\" />\r\n </scroll-view>\r\n </view>\r\n </su-popup>\r\n</template>\r\n\r\n<script setup>\r\nimport { reactive, watch } from 'vue'\r\nimport _ from 'lodash-es'\r\nimport GoodsItem from './goods.vue'\r\nimport OrderItem from './order.vue'\r\nimport OrderApi from '@/sheep/api/trade/order'\r\nimport SpuHistoryApi from '@/sheep/api/product/history'\r\n\r\nconst emits = defineEmits(['select', 'close'])\r\nconst props = defineProps({\r\n mode: {\r\n type: String,\r\n default: 'goods',\r\n },\r\n show: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n})\r\n\r\nwatch(\r\n () => props.mode,\r\n () => {\r\n state.pagination.data = []\r\n if (props.mode) {\r\n getList(state.pagination.page)\r\n }\r\n },\r\n)\r\n\r\nconst state = reactive({\r\n loadStatus: '',\r\n pagination: {\r\n data: [],\r\n current_page: 1,\r\n total: 1,\r\n last_page: 1,\r\n },\r\n})\r\n\r\nasync function getList(page, list_rows = 5) {\r\n state.loadStatus = 'loading'\r\n const res =\r\n props.mode == 'goods'\r\n ? await SpuHistoryApi.getBrowseHistoryPage({\r\n page,\r\n list_rows,\r\n })\r\n : await OrderApi.getOrderPage({\r\n page,\r\n list_rows,\r\n })\r\n const orderList = _.concat(state.pagination.data, res.data.list)\r\n state.pagination = {\r\n ...res.data,\r\n data: orderList,\r\n }\r\n if (state.pagination.current_page < state.pagination.last_page) {\r\n state.loadStatus = 'more'\r\n } else {\r\n state.loadStatus = 'noMore'\r\n }\r\n}\r\n\r\nfunction loadmore() {\r\n if (state.loadStatus !== 'noMore') {\r\n getList(state.pagination.current_page + 1)\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n.select-popup {\r\n max-height: 600rpx;\r\n\r\n .title {\r\n height: 100rpx;\r\n padding: 0 26rpx;\r\n line-height: 100rpx;\r\n background: #fff;\r\n border-radius: 20rpx 20rpx 0 0;\r\n\r\n span {\r\n position: relative;\r\n font-size: 32rpx;\r\n\r\n &::after {\r\n position: absolute;\r\n bottom: -15px;\r\n left: 0;\r\n z-index: 1;\r\n display: block;\r\n width: 100%;\r\n height: 2px;\r\n pointer-events: none;\r\n content: '';\r\n background: var(--ui-BG-Main);\r\n }\r\n }\r\n }\r\n\r\n .scroll-box {\r\n height: 500rpx;\r\n }\r\n\r\n .item {\r\n margin: 26rpx 26rpx 0;\r\n background: #fff;\r\n border-radius: 20rpx;\r\n\r\n :deep() {\r\n .image {\r\n width: 140rpx;\r\n height: 140rpx;\r\n }\r\n }\r\n }\r\n}\r\n</style>\r\n","import Component from 'D:/App/Work/addr/acdr-ui/src/modules/mall/chat/components/select
|