|
|
@@ -14,7 +14,7 @@
|
|
|
<view :class="['tab-item', { 'tab-active': activeTab === 'transaction' }]" @click="activeTab = 'transaction'">
|
|
|
<cwg-icon class="icons" name="list" :size="18" :color="activeTab === 'transaction' ? '#ea002a' : '#9ca3af'" />
|
|
|
<view :class="['tab-text', { 'tab-text-active': activeTab === 'transaction' }]">{{ t('Shop.Index.Transaction')
|
|
|
- }}</view>
|
|
|
+ }}</view>
|
|
|
<view v-if="activeTab === 'transaction'" class="tab-indicator" />
|
|
|
</view>
|
|
|
|
|
|
@@ -29,25 +29,18 @@
|
|
|
<view class="filters-container" :style="{ top: statusBarHeight + 113 + 'px' }">
|
|
|
<view class="filter-item">
|
|
|
<text class="filter-label">{{ t('card.Form.f52') }}</text>
|
|
|
- <cwg-picker v-model="currentTypeIndex" :options="currentTypeOptions" />
|
|
|
+ <cwg-filter-select v-model="currentTypeIndex" :options="currentTypeOptions" />
|
|
|
</view>
|
|
|
|
|
|
<view class="filter-item" v-if="activeTab !== 'deduction'">
|
|
|
<text class="filter-label">{{ t('card.Form.f45') }}</text>
|
|
|
-
|
|
|
- <cwg-picker v-model="statusFilterIndex" :options="statusOptions" />
|
|
|
+ <cwg-filter-select v-model="statusFilterIndex" :options="statusOptions" />
|
|
|
</view>
|
|
|
|
|
|
<view class="filter-item">
|
|
|
<text class="filter-label">{{ t('card.Form.f51') }}</text>
|
|
|
- <view class="filter-picker" @click="open">
|
|
|
- <view class="picker-value">
|
|
|
- <text class="picker-text">{{ dateFilter || t('card.Form.f57') }}</text>
|
|
|
- <uni-icons type="calendar" size="14" color="#6b7280" class="picker-icon" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <cwg-date-picker v-model:show="show" v-model="dateFilter" mode="date" @confirm="onDateConfirm"
|
|
|
- :minDate="minDate" :maxDate="maxDate" />
|
|
|
+ <cwg-filter-picker v-model="dateFilter"
|
|
|
+ :returnType="activeTab == 'deduction' ? 'timestamp' : 'string'"></cwg-filter-picker>
|
|
|
</view>
|
|
|
|
|
|
<view class="reset-btn" @click="resetFilters">
|
|
|
@@ -68,7 +61,7 @@
|
|
|
|
|
|
<!-- Deduction Records -->
|
|
|
<DeductionList v-if="activeTab === 'deduction'" ref="deductionListRef" :cardNumber="cardNumber"
|
|
|
- :typeIndex="currentTypeIndex" :statusIndex="statusFilterIndex" :dateFilter="dateFilter1"
|
|
|
+ :typeIndex="currentTypeIndex" :statusIndex="statusFilterIndex" :dateFilter="dateFilter"
|
|
|
:typeOptions="currentTypeOptions" />
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -85,13 +78,9 @@ import RechargeList from './components/RechargeList.vue';
|
|
|
import TransactionList from './components/TransactionList.vue';
|
|
|
import DeductionList from './components/DeductionList.vue';
|
|
|
import { rechargeType, transactionTypeMap, WITHDRAW_TYPE_MAP, transactionStatusMap, rechargeStatusMap } from '@/utils/dataMap';
|
|
|
-
|
|
|
const globalStore = useGlobalStore()
|
|
|
const statusBarHeight = computed(() => globalStore.statusBarHeight);
|
|
|
const { t } = useI18n();
|
|
|
-const minDate = ref(new Date(2000, 0, 1).getTime());
|
|
|
-const maxDate = ref(new Date().getTime());
|
|
|
-
|
|
|
const activeTab = ref<'recharge' | 'transaction' | 'deduction'>('recharge');
|
|
|
const cardNumber = ref('');
|
|
|
onLoad((options) => {
|
|
|
@@ -118,10 +107,9 @@ const statusOptions = computed(() => {
|
|
|
console.log(statusOptions, 1212);
|
|
|
|
|
|
// const statusOptions = ['全部', '成功', '处理中', '失败'];
|
|
|
-const currentTypeIndex = ref();
|
|
|
-const statusFilterIndex = ref();
|
|
|
-const dateFilter = ref('');
|
|
|
-const dateFilter1 = ref('');
|
|
|
+const currentTypeIndex = ref(-1);
|
|
|
+const statusFilterIndex = ref(-1);
|
|
|
+const dateFilter = ref([]);
|
|
|
const pageTitle = computed(() => {
|
|
|
if (activeTab.value === 'recharge') {
|
|
|
return t('card.tab7'); // 充值记录
|
|
|
@@ -131,21 +119,11 @@ const pageTitle = computed(() => {
|
|
|
return t('card.tab20'); // 扣款记录
|
|
|
}
|
|
|
});
|
|
|
-const show = ref(false)
|
|
|
-const onDateConfirm = (e: any) => {
|
|
|
- if (activeTab.value == 'deduction') {
|
|
|
- dateFilter1.value = e.value;
|
|
|
- }
|
|
|
- dateFilter.value = e.formatted;
|
|
|
-};
|
|
|
-function open() {
|
|
|
- show.value = true
|
|
|
-}
|
|
|
+
|
|
|
const resetFilters = () => {
|
|
|
- currentTypeIndex.value = undefined;
|
|
|
- statusFilterIndex.value = undefined;
|
|
|
- dateFilter.value = '';
|
|
|
- dateFilter1.value = '';
|
|
|
+ currentTypeIndex.value = -1;
|
|
|
+ statusFilterIndex.value = -1;
|
|
|
+ dateFilter.value = [];
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -154,7 +132,6 @@ const resetFilters = () => {
|
|
|
watch(activeTab, () => {
|
|
|
resetFilters();
|
|
|
});
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
@@ -299,7 +276,7 @@ watch(activeTab, () => {
|
|
|
position: sticky;
|
|
|
top: 0;
|
|
|
z-index: 10;
|
|
|
- overflow-x: auto;
|
|
|
+ // overflow-x: auto;
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
}
|
|
|
|